summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/Android.derived.jscbindings.mk1
-rw-r--r--WebCore/Android.derived.v8bindings.mk7
-rw-r--r--WebCore/Android.jscbindings.mk9
-rw-r--r--WebCore/Android.mk7
-rw-r--r--WebCore/CMakeLists.txt8
-rw-r--r--WebCore/CMakeListsEfl.txt1
-rw-r--r--WebCore/ChangeLog6987
-rw-r--r--WebCore/Configurations/FeatureDefines.xcconfig4
-rw-r--r--WebCore/DerivedSources.cpp1
-rw-r--r--WebCore/DerivedSources.make1
-rw-r--r--WebCore/English.lproj/localizedStrings.jsbin51194 -> 51426 bytes
-rw-r--r--WebCore/GNUmakefile.am40
-rw-r--r--WebCore/WebCore.exp.in37
-rw-r--r--WebCore/WebCore.gyp/WebCore.gyp26
-rw-r--r--WebCore/WebCore.gypi45
-rw-r--r--WebCore/WebCore.pri1
-rw-r--r--WebCore/WebCore.pro61
-rw-r--r--WebCore/WebCore.vcproj/QTMovieWin.vcproj8
-rw-r--r--WebCore/WebCore.vcproj/WebCore.vcproj625
-rw-r--r--WebCore/WebCore.vcproj/WebCoreCairo.vsprops2
-rw-r--r--WebCore/WebCore.vcproj/WebCoreGenerated.vcproj12
-rwxr-xr-xWebCore/WebCore.vcproj/copyForwardingHeaders.cmd1
-rw-r--r--WebCore/WebCore.xcodeproj/project.pbxproj185
-rw-r--r--WebCore/WebCorePrefix.h2
-rw-r--r--WebCore/accessibility/AXObjectCache.cpp2
-rw-r--r--WebCore/accessibility/AccessibilityARIAGrid.cpp2
-rw-r--r--WebCore/accessibility/AccessibilityARIAGridCell.cpp2
-rw-r--r--WebCore/accessibility/AccessibilityARIAGridRow.cpp6
-rw-r--r--WebCore/accessibility/AccessibilityListBoxOption.cpp4
-rw-r--r--WebCore/accessibility/AccessibilityObject.h2
-rw-r--r--WebCore/accessibility/AccessibilityRenderObject.cpp46
-rw-r--r--WebCore/accessibility/AccessibilityRenderObject.h2
-rw-r--r--WebCore/accessibility/AccessibilityTable.cpp84
-rw-r--r--WebCore/accessibility/AccessibilityTable.h5
-rw-r--r--WebCore/accessibility/AccessibilityTableCell.cpp2
-rw-r--r--WebCore/accessibility/AccessibilityTableHeaderContainer.cpp2
-rw-r--r--WebCore/accessibility/AccessibilityTableRow.cpp2
-rw-r--r--WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp111
-rw-r--r--WebCore/accessibility/mac/AccessibilityObjectWrapper.mm12
-rw-r--r--WebCore/bindings/generic/RuntimeEnabledFeatures.h1
-rw-r--r--WebCore/bindings/gobject/GNUmakefile.am3
-rw-r--r--WebCore/bindings/js/JSAudioConstructor.cpp2
-rw-r--r--WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSCallbackData.cpp4
-rw-r--r--WebCore/bindings/js/JSCoordinatesCustom.cpp16
-rw-r--r--WebCore/bindings/js/JSCustomXPathNSResolver.cpp4
-rw-r--r--WebCore/bindings/js/JSDOMBinding.cpp10
-rw-r--r--WebCore/bindings/js/JSDOMWindowCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSDeviceMotionEventCustom.cpp14
-rw-r--r--WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp6
-rw-r--r--WebCore/bindings/js/JSEventListener.cpp8
-rw-r--r--WebCore/bindings/js/JSFileReaderCustom.cpp55
-rw-r--r--WebCore/bindings/js/JSGeolocationCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSHTMLInputElementCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSIDBKeyCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSInjectedScriptHostCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSOptionConstructor.cpp2
-rw-r--r--WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSSVGLengthCustom.cpp20
-rw-r--r--WebCore/bindings/js/JSSVGPODTypeWrapper.h2
-rw-r--r--WebCore/bindings/js/JSScriptProfileNodeCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp6
-rw-r--r--WebCore/bindings/js/JSWorkerContextCustom.cpp6
-rw-r--r--WebCore/bindings/js/JSWorkerContextErrorHandler.cpp10
-rw-r--r--WebCore/bindings/js/ScheduledAction.cpp4
-rw-r--r--WebCore/bindings/js/ScriptFunctionCall.cpp10
-rw-r--r--WebCore/bindings/js/SerializedScriptValue.cpp8
-rw-r--r--WebCore/bindings/js/WorkerScriptController.cpp4
-rw-r--r--WebCore/bindings/objc/WebScriptObject.mm8
-rw-r--r--WebCore/bindings/scripts/CodeGenerator.pm96
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorGObject.pm32
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorJS.pm288
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorObjC.pm221
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorV8.pm221
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp92
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.h55
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp163
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.h54
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListenerPrivate.h39
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp194
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h87
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h37
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm95
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h38
-rw-r--r--WebCore/bindings/scripts/test/TestMediaQueryListListener.idl32
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp109
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h72
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestObj.cpp12
-rw-r--r--WebCore/bindings/v8/DateExtension.cpp2
-rw-r--r--WebCore/bindings/v8/IDBBindingUtilities.cpp4
-rw-r--r--WebCore/bindings/v8/SerializedScriptValue.cpp33
-rw-r--r--WebCore/bindings/v8/V8Proxy.cpp6
-rw-r--r--WebCore/bindings/v8/custom/V8DOMSettableTokenListCustom.cpp41
-rwxr-xr-xWebCore/bindings/v8/custom/V8FileReaderCustom.cpp16
-rw-r--r--WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp19
-rw-r--r--WebCore/bridge/NP_jsobject.cpp16
-rw-r--r--WebCore/bridge/c/c_instance.cpp4
-rw-r--r--WebCore/bridge/c/c_utility.cpp4
-rw-r--r--WebCore/bridge/jni/jni_jsobject.mm8
-rw-r--r--WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp18
-rw-r--r--WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp18
-rw-r--r--WebCore/bridge/objc/objc_instance.mm4
-rw-r--r--WebCore/bridge/objc/objc_utility.mm26
-rw-r--r--WebCore/bridge/qt/qt_instance.cpp4
-rw-r--r--WebCore/bridge/qt/qt_pixmapruntime.cpp10
-rw-r--r--WebCore/bridge/qt/qt_runtime.cpp12
-rw-r--r--WebCore/bridge/runtime_array.cpp4
-rw-r--r--WebCore/bridge/runtime_method.cpp4
-rw-r--r--WebCore/css/CSSComputedStyleDeclaration.cpp3
-rw-r--r--WebCore/css/CSSFontFaceSource.cpp2
-rw-r--r--WebCore/css/CSSRule.h5
-rw-r--r--WebCore/css/CSSStyleSelector.cpp63
-rw-r--r--WebCore/css/CSSStyleSelector.h6
-rw-r--r--WebCore/dom/Document.cpp12
-rw-r--r--WebCore/dom/Document.h17
-rw-r--r--WebCore/dom/DocumentMarker.h17
-rw-r--r--WebCore/dom/DocumentMarkerController.cpp75
-rw-r--r--WebCore/dom/DocumentMarkerController.h4
-rw-r--r--WebCore/dom/Element.cpp88
-rw-r--r--WebCore/dom/Element.h14
-rw-r--r--WebCore/dom/ElementRareData.h4
-rw-r--r--WebCore/dom/EventListener.h3
-rw-r--r--WebCore/dom/ExceptionCode.cpp46
-rw-r--r--WebCore/dom/ExceptionCode.h3
-rw-r--r--WebCore/dom/IgnoreDestructiveWriteCountIncrementer.h57
-rw-r--r--WebCore/dom/InputElement.cpp5
-rw-r--r--WebCore/dom/KeyboardEvent.h5
-rw-r--r--WebCore/dom/Node.cpp4
-rw-r--r--WebCore/dom/ScriptElement.cpp39
-rw-r--r--WebCore/dom/ScriptElement.h3
-rw-r--r--WebCore/dom/SpaceSplitString.cpp34
-rw-r--r--WebCore/dom/SpaceSplitString.h5
-rw-r--r--WebCore/dom/StyledElement.cpp3
-rw-r--r--WebCore/dom/StyledElement.h1
-rw-r--r--WebCore/editing/ApplyStyleCommand.cpp75
-rw-r--r--WebCore/editing/ApplyStyleCommand.h8
-rw-r--r--WebCore/editing/CompositeEditCommand.cpp2
-rw-r--r--WebCore/editing/DeleteSelectionCommand.cpp6
-rw-r--r--WebCore/editing/EditingAllInOne.cpp1
-rw-r--r--WebCore/editing/Editor.cpp640
-rw-r--r--WebCore/editing/Editor.h15
-rw-r--r--WebCore/editing/EditorCommand.cpp2
-rw-r--r--WebCore/editing/IndentOutdentCommand.cpp3
-rw-r--r--WebCore/editing/RemoveFormatCommand.cpp82
-rw-r--r--WebCore/editing/TextCheckingHelper.cpp525
-rw-r--r--WebCore/editing/TextCheckingHelper.h52
-rw-r--r--WebCore/editing/TypingCommand.cpp18
-rw-r--r--WebCore/editing/visible_units.cpp24
-rw-r--r--WebCore/editing/visible_units.h9
-rw-r--r--WebCore/fileapi/AsyncFileWriterClient.h4
-rw-r--r--WebCore/fileapi/BlobBuilder.cpp56
-rw-r--r--WebCore/fileapi/BlobBuilder.h17
-rw-r--r--WebCore/fileapi/BlobBuilder.idl3
-rw-r--r--WebCore/fileapi/DOMFileSystemBase.cpp3
-rw-r--r--WebCore/fileapi/DOMFileSystemBase.h2
-rw-r--r--WebCore/fileapi/DirectoryEntry.cpp8
-rw-r--r--WebCore/fileapi/DirectoryEntry.h4
-rw-r--r--WebCore/fileapi/DirectoryEntrySync.cpp9
-rw-r--r--WebCore/fileapi/DirectoryEntrySync.h4
-rw-r--r--WebCore/fileapi/DirectoryReader.cpp2
-rw-r--r--WebCore/fileapi/DirectoryReader.h6
-rw-r--r--WebCore/fileapi/DirectoryReaderBase.h6
-rw-r--r--WebCore/fileapi/DirectoryReaderSync.cpp6
-rw-r--r--WebCore/fileapi/DirectoryReaderSync.h4
-rw-r--r--WebCore/fileapi/Entry.cpp12
-rw-r--r--WebCore/fileapi/Entry.h4
-rw-r--r--WebCore/fileapi/EntryBase.h6
-rw-r--r--WebCore/fileapi/EntrySync.cpp11
-rw-r--r--WebCore/fileapi/EntrySync.h4
-rw-r--r--WebCore/fileapi/FileEntry.cpp2
-rw-r--r--WebCore/fileapi/FileEntry.h4
-rw-r--r--WebCore/fileapi/FileEntrySync.cpp2
-rw-r--r--WebCore/fileapi/FileEntrySync.h4
-rw-r--r--WebCore/fileapi/FileError.h24
-rw-r--r--WebCore/fileapi/FileError.idl24
-rw-r--r--WebCore/fileapi/FileException.h27
-rw-r--r--WebCore/fileapi/FileException.idl22
-rw-r--r--WebCore/fileapi/FileReader.cpp211
-rw-r--r--WebCore/fileapi/FileReader.h68
-rw-r--r--WebCore/fileapi/FileReader.idl3
-rw-r--r--WebCore/fileapi/FileReaderLoader.cpp302
-rw-r--r--WebCore/fileapi/FileReaderLoader.h119
-rw-r--r--WebCore/fileapi/FileReaderLoaderClient.h52
-rw-r--r--WebCore/fileapi/FileReaderSync.cpp151
-rw-r--r--WebCore/fileapi/FileReaderSync.h22
-rw-r--r--WebCore/fileapi/FileReaderSync.idl2
-rw-r--r--WebCore/fileapi/FileSystemCallbacks.cpp18
-rw-r--r--WebCore/fileapi/FileSystemCallbacks.h17
-rw-r--r--WebCore/fileapi/FileWriter.cpp34
-rw-r--r--WebCore/fileapi/FileWriter.h6
-rw-r--r--WebCore/fileapi/SyncCallbackHelper.h13
-rw-r--r--WebCore/history/BackForwardList.h66
-rw-r--r--WebCore/history/BackForwardListChromium.cpp17
-rw-r--r--WebCore/history/BackForwardListImpl.h27
-rw-r--r--WebCore/history/CachedFrame.cpp2
-rw-r--r--WebCore/history/PageCache.cpp11
-rw-r--r--WebCore/html/BaseButtonInputType.cpp50
-rw-r--r--WebCore/html/BaseButtonInputType.h50
-rw-r--r--WebCore/html/BaseCheckableInputType.cpp60
-rw-r--r--WebCore/html/BaseCheckableInputType.h51
-rw-r--r--WebCore/html/ButtonInputType.h6
-rw-r--r--WebCore/html/CheckboxInputType.h6
-rw-r--r--WebCore/html/ClassList.cpp146
-rw-r--r--WebCore/html/ClassList.h74
-rw-r--r--WebCore/html/DOMSettableTokenList.cpp98
-rw-r--r--WebCore/html/DOMSettableTokenList.h71
-rw-r--r--WebCore/html/DOMSettableTokenList.idl35
-rw-r--r--WebCore/html/DOMTokenList.cpp124
-rw-r--r--WebCore/html/DOMTokenList.h48
-rw-r--r--WebCore/html/FileInputType.cpp76
-rw-r--r--WebCore/html/FileInputType.h8
-rw-r--r--WebCore/html/HTMLAttributeNames.in1
-rw-r--r--WebCore/html/HTMLDocument.cpp2
-rw-r--r--WebCore/html/HTMLElement.cpp11
-rw-r--r--WebCore/html/HTMLElement.h3
-rw-r--r--WebCore/html/HTMLElement.idl2
-rw-r--r--WebCore/html/HTMLFormControlElement.cpp14
-rw-r--r--WebCore/html/HTMLFormControlElement.h2
-rw-r--r--WebCore/html/HTMLFrameElementBase.cpp5
-rw-r--r--WebCore/html/HTMLFrameElementBase.h2
-rw-r--r--WebCore/html/HTMLFrameSetElement.cpp16
-rw-r--r--WebCore/html/HTMLFrameSetElement.h5
-rw-r--r--WebCore/html/HTMLInputElement.cpp205
-rw-r--r--WebCore/html/HTMLInputElement.h4
-rw-r--r--WebCore/html/HTMLInputElement.idl1
-rw-r--r--WebCore/html/HTMLMeterElement.cpp12
-rw-r--r--WebCore/html/HTMLObjectElement.cpp47
-rw-r--r--WebCore/html/HTMLObjectElement.h2
-rw-r--r--WebCore/html/HiddenInputType.cpp6
-rw-r--r--WebCore/html/HiddenInputType.h1
-rw-r--r--WebCore/html/ImageDocument.cpp2
-rw-r--r--WebCore/html/ImageInputType.cpp64
-rw-r--r--WebCore/html/ImageInputType.h9
-rw-r--r--WebCore/html/InputType.cpp34
-rw-r--r--WebCore/html/InputType.h24
-rw-r--r--WebCore/html/NumberInputType.cpp30
-rw-r--r--WebCore/html/PasswordInputType.cpp13
-rw-r--r--WebCore/html/PasswordInputType.h2
-rw-r--r--WebCore/html/RadioInputType.h6
-rw-r--r--WebCore/html/RangeInputType.cpp6
-rw-r--r--WebCore/html/RangeInputType.h1
-rw-r--r--WebCore/html/ResetInputType.h6
-rw-r--r--WebCore/html/SubmitInputType.cpp10
-rw-r--r--WebCore/html/SubmitInputType.h7
-rw-r--r--WebCore/html/TextFieldInputType.cpp7
-rw-r--r--WebCore/html/TextFieldInputType.h1
-rw-r--r--WebCore/html/canvas/ArrayBuffer.cpp11
-rw-r--r--WebCore/html/canvas/ArrayBuffer.h1
-rw-r--r--WebCore/html/canvas/WebGLFramebuffer.cpp7
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.cpp34
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.h1
-rw-r--r--WebCore/html/canvas/WebGLTexture.h2
-rw-r--r--WebCore/html/parser/HTMLElementStack.cpp18
-rw-r--r--WebCore/html/parser/HTMLParserIdioms.cpp5
-rw-r--r--WebCore/html/parser/HTMLScriptRunner.cpp2
-rw-r--r--WebCore/html/parser/HTMLTreeBuilder.cpp189
-rw-r--r--WebCore/html/parser/HTMLTreeBuilder.h16
-rw-r--r--WebCore/inspector/Inspector.idl17
-rw-r--r--WebCore/inspector/InspectorCSSAgent.cpp245
-rw-r--r--WebCore/inspector/InspectorCSSAgent.h13
-rw-r--r--WebCore/inspector/InspectorCSSStore.cpp3
-rw-r--r--WebCore/inspector/InspectorController.cpp363
-rw-r--r--WebCore/inspector/InspectorController.h38
-rw-r--r--WebCore/inspector/InspectorDOMAgent.cpp108
-rw-r--r--WebCore/inspector/InspectorDOMAgent.h1
-rw-r--r--WebCore/inspector/InspectorDOMStorageResource.cpp4
-rw-r--r--WebCore/inspector/InspectorDebuggerAgent.cpp7
-rw-r--r--WebCore/inspector/InspectorDebuggerAgent.h1
-rw-r--r--WebCore/inspector/InspectorInstrumentation.cpp22
-rw-r--r--WebCore/inspector/InspectorInstrumentation.h53
-rw-r--r--WebCore/inspector/InspectorResource.cpp4
-rw-r--r--WebCore/inspector/InspectorResource.h3
-rw-r--r--WebCore/inspector/InspectorResourceAgent.cpp76
-rw-r--r--WebCore/inspector/InspectorResourceAgent.h6
-rw-r--r--WebCore/inspector/InspectorState.cpp2
-rw-r--r--WebCore/inspector/InspectorState.h201
-rw-r--r--WebCore/inspector/InspectorStyleSheet.cpp539
-rw-r--r--WebCore/inspector/InspectorStyleSheet.h136
-rw-r--r--WebCore/inspector/front-end/ApplicationCacheItemsView.js2
-rw-r--r--WebCore/inspector/front-end/AuditLauncherView.js1
-rw-r--r--WebCore/inspector/front-end/AuditRules.js17
-rw-r--r--WebCore/inspector/front-end/AuditsPanel.js10
-rw-r--r--WebCore/inspector/front-end/CSSStyleModel.js106
-rw-r--r--WebCore/inspector/front-end/ConsoleView.js25
-rw-r--r--WebCore/inspector/front-end/CookieItemsView.js244
-rwxr-xr-xWebCore/inspector/front-end/CookieParser.js20
-rw-r--r--WebCore/inspector/front-end/DOMAgent.js249
-rw-r--r--WebCore/inspector/front-end/DataGrid.js21
-rw-r--r--WebCore/inspector/front-end/DatabaseTableView.js2
-rw-r--r--WebCore/inspector/front-end/EventListenersSidebarPane.js15
-rw-r--r--WebCore/inspector/front-end/ExtensionServer.js33
-rw-r--r--WebCore/inspector/front-end/FontView.js1
-rw-r--r--WebCore/inspector/front-end/HAREntry.js14
-rw-r--r--WebCore/inspector/front-end/ImageView.js8
-rw-r--r--WebCore/inspector/front-end/Images/frame.pngbin0 -> 448 bytes
-rw-r--r--WebCore/inspector/front-end/Images/networkIcon.pngbin6431 -> 4628 bytes
-rw-r--r--WebCore/inspector/front-end/InjectedScript.js2
-rw-r--r--WebCore/inspector/front-end/MetricsSidebarPane.js56
-rw-r--r--WebCore/inspector/front-end/NetworkPanel.js99
-rw-r--r--WebCore/inspector/front-end/Panel.js2
-rw-r--r--WebCore/inspector/front-end/Resource.js89
-rw-r--r--WebCore/inspector/front-end/ResourceCategory.js29
-rw-r--r--WebCore/inspector/front-end/ResourceManager.js462
-rw-r--r--WebCore/inspector/front-end/ResourceView.js104
-rw-r--r--WebCore/inspector/front-end/ResourcesPanel.js107
-rw-r--r--WebCore/inspector/front-end/ScriptsPanel.js23
-rw-r--r--WebCore/inspector/front-end/Settings.js114
-rw-r--r--WebCore/inspector/front-end/SourceView.js3
-rw-r--r--WebCore/inspector/front-end/StoragePanel.js626
-rw-r--r--WebCore/inspector/front-end/StylesSidebarPane.js347
-rw-r--r--WebCore/inspector/front-end/WatchExpressionsSidebarPane.js4
-rw-r--r--WebCore/inspector/front-end/WebKit.qrc1
-rw-r--r--WebCore/inspector/front-end/inspector.css151
-rw-r--r--WebCore/inspector/front-end/inspector.js165
-rw-r--r--WebCore/inspector/front-end/networkPanel.css43
-rw-r--r--WebCore/loader/Cache.cpp16
-rw-r--r--WebCore/loader/CachedFont.cpp6
-rw-r--r--WebCore/loader/CachedFont.h3
-rw-r--r--WebCore/loader/CachedImage.cpp2
-rw-r--r--WebCore/loader/DocumentLoader.cpp21
-rw-r--r--WebCore/loader/DocumentLoader.h5
-rw-r--r--WebCore/loader/EmptyClients.h7
-rw-r--r--WebCore/loader/FrameLoader.cpp23
-rw-r--r--WebCore/loader/FrameLoader.h6
-rw-r--r--WebCore/loader/FrameLoaderClient.h5
-rw-r--r--WebCore/loader/MainResourceLoader.cpp3
-rw-r--r--WebCore/loader/PolicyCallback.cpp7
-rw-r--r--WebCore/loader/PolicyCallback.h8
-rw-r--r--WebCore/loader/PolicyChecker.cpp2
-rw-r--r--WebCore/loader/ThreadableLoaderClient.h2
-rw-r--r--WebCore/loader/appcache/ApplicationCacheHost.cpp6
-rw-r--r--WebCore/loader/appcache/ApplicationCacheHost.h1
-rw-r--r--WebCore/manual-tests/autocorrection/autocorrection-cancelled-by-ESC.html50
-rw-r--r--WebCore/manual-tests/compositing/show-composited-iframe-on-back-button.html76
-rw-r--r--WebCore/manual-tests/cursor-empty-url.html3
-rw-r--r--WebCore/manual-tests/indexed-database.html49
-rw-r--r--WebCore/manual-tests/indexeddb-persists.html69
-rw-r--r--WebCore/manual-tests/plugins/windowed.html4
-rw-r--r--WebCore/manual-tests/plugins/windowless.html4
-rw-r--r--WebCore/manual-tests/resources/cursor-empty-url.css1
-rw-r--r--WebCore/mathml/RenderMathMLFenced.cpp20
-rw-r--r--WebCore/mathml/RenderMathMLFenced.h3
-rw-r--r--WebCore/mathml/RenderMathMLFraction.cpp7
-rw-r--r--WebCore/mathml/RenderMathMLOperator.cpp3
-rw-r--r--WebCore/mathml/RenderMathMLRoot.cpp6
-rw-r--r--WebCore/mathml/RenderMathMLRow.cpp76
-rw-r--r--WebCore/mathml/RenderMathMLRow.h1
-rw-r--r--WebCore/mathml/RenderMathMLSubSup.cpp62
-rw-r--r--WebCore/mathml/RenderMathMLUnderOver.cpp20
-rw-r--r--WebCore/mathml/mathtags.in4
-rw-r--r--WebCore/page/Chrome.cpp4
-rw-r--r--WebCore/page/Chrome.h3
-rw-r--r--WebCore/page/ChromeClient.h5
-rw-r--r--WebCore/page/ContextMenuController.cpp3
-rw-r--r--WebCore/page/DOMWindow.cpp9
-rw-r--r--WebCore/page/DOMWindow.idl7
-rw-r--r--WebCore/page/EventHandler.cpp17
-rw-r--r--WebCore/page/Frame.cpp34
-rw-r--r--WebCore/page/Frame.h6
-rw-r--r--WebCore/page/FrameView.cpp30
-rw-r--r--WebCore/page/FrameView.h3
-rw-r--r--WebCore/page/SecurityOriginHash.h2
-rw-r--r--WebCore/page/Settings.cpp21
-rw-r--r--WebCore/page/Settings.h11
-rw-r--r--WebCore/page/SpeechInput.cpp6
-rw-r--r--WebCore/page/SpeechInput.h4
-rw-r--r--WebCore/page/SpeechInputClient.h4
-rw-r--r--WebCore/page/SpeechInputListener.h5
-rw-r--r--WebCore/page/SpeechInputResult.cpp56
-rw-r--r--WebCore/page/SpeechInputResult.h57
-rw-r--r--WebCore/page/animation/KeyframeAnimation.cpp4
-rw-r--r--WebCore/page/animation/KeyframeAnimation.h1
-rw-r--r--WebCore/platform/AsyncFileSystemCallbacks.h3
-rw-r--r--WebCore/platform/ContextMenu.cpp2
-rw-r--r--WebCore/platform/FileMetadata.h62
-rw-r--r--WebCore/platform/MIMETypeRegistry.cpp7
-rw-r--r--WebCore/platform/ScrollView.cpp11
-rw-r--r--WebCore/platform/ScrollView.h6
-rw-r--r--WebCore/platform/UUID.cpp29
-rw-r--r--WebCore/platform/android/TemporaryLinkStubs.cpp6
-rw-r--r--WebCore/platform/audio/AudioBus.cpp4
-rw-r--r--WebCore/platform/audio/AudioChannel.cpp4
-rw-r--r--WebCore/platform/audio/AudioDSPKernel.h10
-rw-r--r--WebCore/platform/audio/AudioResamplerKernel.cpp143
-rw-r--r--WebCore/platform/audio/AudioResamplerKernel.h76
-rw-r--r--WebCore/platform/audio/Biquad.cpp5
-rw-r--r--WebCore/platform/audio/FFTConvolver.cpp4
-rw-r--r--WebCore/platform/audio/FFTConvolver.h2
-rw-r--r--WebCore/platform/audio/Panner.cpp2
-rw-r--r--WebCore/platform/audio/Reverb.cpp16
-rw-r--r--WebCore/platform/audio/ReverbAccumulationBuffer.cpp4
-rw-r--r--WebCore/platform/audio/ReverbAccumulationBuffer.h2
-rw-r--r--WebCore/platform/audio/ReverbConvolver.cpp12
-rw-r--r--WebCore/platform/audio/ReverbConvolver.h2
-rw-r--r--WebCore/platform/audio/ReverbConvolverStage.cpp10
-rw-r--r--WebCore/platform/audio/ReverbConvolverStage.h2
-rw-r--r--WebCore/platform/audio/ReverbInputBuffer.h2
-rw-r--r--WebCore/platform/audio/VectorMath.cpp84
-rw-r--r--WebCore/platform/audio/VectorMath.h41
-rw-r--r--WebCore/platform/brew/LanguageBrew.cpp40
-rw-r--r--WebCore/platform/brew/LocalizedStringsBrew.cpp5
-rw-r--r--WebCore/platform/brew/TemporaryLinkStubs.cpp40
-rw-r--r--WebCore/platform/cf/SchedulePair.h2
-rw-r--r--WebCore/platform/chromium/TemporaryLinkStubs.cpp6
-rw-r--r--WebCore/platform/efl/LanguageEfl.cpp16
-rw-r--r--WebCore/platform/efl/TemporaryLinkStubs.cpp6
-rw-r--r--WebCore/platform/graphics/FontCache.cpp12
-rw-r--r--WebCore/platform/graphics/FontDescription.h9
-rw-r--r--WebCore/platform/graphics/FontOrientation.h35
-rw-r--r--WebCore/platform/graphics/Gradient.cpp10
-rw-r--r--WebCore/platform/graphics/Gradient.h1
-rw-r--r--WebCore/platform/graphics/GraphicsContext3D.cpp2
-rw-r--r--WebCore/platform/graphics/GraphicsContext3D.h5
-rw-r--r--WebCore/platform/graphics/GraphicsLayer.h20
-rw-r--r--WebCore/platform/graphics/ImageSource.h5
-rw-r--r--WebCore/platform/graphics/SimpleFontData.h6
-rw-r--r--WebCore/platform/graphics/TiledBackingStoreClient.h1
-rw-r--r--WebCore/platform/graphics/WOFFFileFormat.cpp20
-rw-r--r--WebCore/platform/graphics/cairo/FontCacheFreeType.cpp68
-rw-r--r--WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/cairo/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h2
-rw-r--r--WebCore/platform/graphics/cairo/PathCairo.cpp2
-rw-r--r--WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp190
-rw-r--r--WebCore/platform/graphics/chromium/FontLinux.cpp131
-rw-r--r--WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h2
-rw-r--r--WebCore/platform/graphics/chromium/LayerChromium.cpp4
-rw-r--r--WebCore/platform/graphics/chromium/LayerRendererChromium.h1
-rw-r--r--WebCore/platform/graphics/cocoa/FontPlatformData.h21
-rw-r--r--WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm37
-rw-r--r--WebCore/platform/graphics/filters/FEBlend.cpp18
-rw-r--r--WebCore/platform/graphics/filters/FEColorMatrix.cpp47
-rw-r--r--WebCore/platform/graphics/filters/FEComponentTransfer.cpp15
-rw-r--r--WebCore/platform/graphics/filters/FEComposite.cpp13
-rw-r--r--WebCore/platform/graphics/filters/FEDisplacementMap.cpp12
-rw-r--r--WebCore/platform/graphics/filters/FEGaussianBlur.cpp14
-rw-r--r--WebCore/platform/graphics/filters/FEMorphology.cpp7
-rw-r--r--WebCore/platform/graphics/filters/FETile.cpp8
-rw-r--r--WebCore/platform/graphics/filters/FETile.h4
-rw-r--r--WebCore/platform/graphics/filters/FETurbulence.cpp4
-rw-r--r--WebCore/platform/graphics/filters/Filter.h4
-rw-r--r--WebCore/platform/graphics/filters/FilterEffect.cpp17
-rw-r--r--WebCore/platform/graphics/filters/FilterEffect.h3
-rw-r--r--WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp2
-rw-r--r--WebCore/platform/graphics/gtk/FontPlatformDataPango.h2
-rw-r--r--WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/haiku/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/mac/FontCacheMac.mm5
-rw-r--r--WebCore/platform/graphics/mac/FontCustomPlatformData.cpp4
-rw-r--r--WebCore/platform/graphics/mac/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/mac/FontMac.mm33
-rw-r--r--WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp71
-rw-r--r--WebCore/platform/graphics/mac/GraphicsContext3DMac.mm2
-rw-r--r--WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp12
-rw-r--r--WebCore/platform/graphics/mac/SimpleFontDataMac.mm31
-rw-r--r--WebCore/platform/graphics/opengl/TextureMapperGL.cpp591
-rw-r--r--WebCore/platform/graphics/opengl/TextureMapperGL.h83
-rw-r--r--WebCore/platform/graphics/qt/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp2
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContextQt.cpp50
-rw-r--r--WebCore/platform/graphics/qt/GraphicsLayerQt.cpp10
-rw-r--r--WebCore/platform/graphics/qt/ImageBufferQt.cpp17
-rw-r--r--WebCore/platform/graphics/qt/TileQt.cpp5
-rw-r--r--WebCore/platform/graphics/skia/FontCustomPlatformData.cpp15
-rw-r--r--WebCore/platform/graphics/skia/FontCustomPlatformData.h9
-rw-r--r--WebCore/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp (renamed from WebCore/platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp)0
-rw-r--r--WebCore/platform/graphics/skia/ImageSkia.cpp7
-rw-r--r--WebCore/platform/graphics/skia/PlatformContextSkia.cpp10
-rw-r--r--WebCore/platform/graphics/skia/PlatformContextSkia.h1
-rw-r--r--WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp12
-rw-r--r--WebCore/platform/graphics/win/FontCustomPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/win/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp2
-rw-r--r--WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h3
-rw-r--r--WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp23
-rw-r--r--WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h2
-rw-r--r--WebCore/platform/graphics/win/QTDecompressionSession.cpp170
-rw-r--r--WebCore/platform/graphics/win/QTDecompressionSession.h64
-rw-r--r--WebCore/platform/graphics/win/QTMovieVisualContext.cpp57
-rw-r--r--WebCore/platform/graphics/win/QTMovieVisualContext.h6
-rw-r--r--WebCore/platform/graphics/win/QTPixelBuffer.cpp36
-rw-r--r--WebCore/platform/graphics/win/QTPixelBuffer.h3
-rw-r--r--WebCore/platform/graphics/wince/FontCustomPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/wince/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/wince/FontPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp14
-rw-r--r--WebCore/platform/graphics/wince/ImageBufferWinCE.cpp4
-rw-r--r--WebCore/platform/graphics/wince/ImageWinCE.cpp6
-rw-r--r--WebCore/platform/graphics/wx/FontCustomPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/wx/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/wx/FontPlatformDataWx.cpp29
-rw-r--r--WebCore/platform/gtk/RenderThemeGtk.cpp60
-rw-r--r--WebCore/platform/gtk/RenderThemeGtk.h13
-rw-r--r--WebCore/platform/gtk/ScrollViewGtk.cpp61
-rw-r--r--WebCore/platform/gtk/TemporaryLinkStubs.cpp2
-rw-r--r--WebCore/platform/haiku/TemporaryLinkStubs.cpp6
-rw-r--r--WebCore/platform/image-decoders/ImageDecoder.cpp23
-rw-r--r--WebCore/platform/image-decoders/ImageDecoder.h47
-rw-r--r--WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp2
-rw-r--r--WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp79
-rw-r--r--WebCore/platform/image-decoders/gif/GIFImageDecoder.h4
-rw-r--r--WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp2
-rw-r--r--WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp2
-rw-r--r--WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp11
-rw-r--r--WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp4
-rw-r--r--WebCore/platform/mac/WebCoreSystemInterface.h4
-rw-r--r--WebCore/platform/mac/WebCoreSystemInterface.mm3
-rw-r--r--WebCore/platform/mock/SpeechInputClientMock.cpp37
-rw-r--r--WebCore/platform/mock/SpeechInputClientMock.h11
-rw-r--r--WebCore/platform/network/CookieStorage.h35
-rw-r--r--WebCore/platform/network/cf/AuthenticationChallenge.h1
-rw-r--r--WebCore/platform/network/cf/CookieJarCFNet.cpp (renamed from WebCore/platform/network/win/CookieJarCFNetWin.cpp)2
-rw-r--r--WebCore/platform/network/cf/CookieStorageCFNet.cpp (renamed from WebCore/platform/network/win/CookieStorageWin.cpp)18
-rw-r--r--WebCore/platform/network/cf/CookieStorageCFNet.h (renamed from WebCore/platform/network/win/CookieStorageWin.h)9
-rw-r--r--WebCore/platform/network/cf/ResourceError.h2
-rw-r--r--WebCore/platform/network/cf/ResourceHandleCFNet.cpp2
-rw-r--r--WebCore/platform/network/cf/ResourceRequest.h2
-rw-r--r--WebCore/platform/network/cf/ResourceResponse.h1
-rw-r--r--WebCore/platform/network/cf/SocketStreamError.h16
-rw-r--r--WebCore/platform/network/cf/SocketStreamHandle.h100
-rw-r--r--WebCore/platform/network/curl/CookieJarCurl.cpp5
-rw-r--r--WebCore/platform/network/mac/CookieStorageMac.mm38
-rw-r--r--WebCore/platform/network/mac/FormDataStreamMac.mm6
-rw-r--r--WebCore/platform/network/soup/ResourceHandleSoup.cpp9
-rw-r--r--WebCore/platform/network/soup/ResourceRequestSoup.cpp11
-rw-r--r--WebCore/platform/network/soup/ResourceResponseSoup.cpp5
-rw-r--r--WebCore/platform/network/soup/SoupURIUtils.cpp44
-rw-r--r--WebCore/platform/network/soup/SoupURIUtils.h37
-rw-r--r--WebCore/platform/network/win/AuthenticationChallenge.h46
-rw-r--r--WebCore/platform/network/win/NetworkStateNotifierWin.cpp5
-rw-r--r--WebCore/platform/network/win/ResourceError.h46
-rw-r--r--WebCore/platform/network/win/ResourceHandleWin.cpp4
-rw-r--r--WebCore/platform/network/win/ResourceRequest.h71
-rw-r--r--WebCore/platform/network/win/ResourceResponse.h55
-rw-r--r--WebCore/platform/network/win/SocketStreamError.h50
-rw-r--r--WebCore/platform/network/win/SocketStreamHandle.h68
-rw-r--r--WebCore/platform/network/win/SocketStreamHandleWin.cpp89
-rw-r--r--WebCore/platform/qt/QWebPageClient.h8
-rw-r--r--WebCore/platform/qt/RenderThemeQt.cpp33
-rw-r--r--WebCore/platform/qt/TemporaryLinkStubsQt.cpp6
-rw-r--r--WebCore/platform/sql/SQLiteDatabase.cpp6
-rw-r--r--WebCore/platform/text/TextEncoding.cpp4
-rw-r--r--WebCore/platform/text/brew/StringBrew.cpp44
-rw-r--r--WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp278
-rw-r--r--WebCore/platform/text/gtk/TextCodecGtk.cpp689
-rw-r--r--WebCore/platform/text/gtk/TextCodecGtk.h87
-rw-r--r--WebCore/platform/win/COMPtr.h9
-rw-r--r--WebCore/platform/win/ClipboardWin.cpp42
-rw-r--r--WebCore/platform/win/ContextMenuItemWin.cpp12
-rw-r--r--WebCore/platform/win/FileSystemWin.cpp4
-rw-r--r--WebCore/platform/wince/FileSystemWinCE.cpp4
-rw-r--r--WebCore/platform/wince/TemporaryLinkStubs.cpp37
-rw-r--r--WebCore/plugins/PluginDatabase.cpp36
-rw-r--r--WebCore/plugins/PluginPackage.cpp2
-rw-r--r--WebCore/plugins/PluginStream.cpp1
-rw-r--r--WebCore/plugins/gtk/PluginViewGtk.cpp2
-rw-r--r--WebCore/plugins/gtk/gtk2xtbin.c5
-rw-r--r--WebCore/plugins/gtk/gtk2xtbin.h2
-rw-r--r--WebCore/plugins/win/PluginDatabaseWin.cpp12
-rw-r--r--WebCore/plugins/win/PluginPackageWin.cpp2
-rw-r--r--WebCore/rendering/InlineBox.cpp26
-rw-r--r--WebCore/rendering/InlineBox.h7
-rw-r--r--WebCore/rendering/InlineFlowBox.cpp310
-rw-r--r--WebCore/rendering/InlineFlowBox.h55
-rw-r--r--WebCore/rendering/InlineTextBox.cpp212
-rw-r--r--WebCore/rendering/InlineTextBox.h18
-rw-r--r--WebCore/rendering/RenderBlock.cpp26
-rw-r--r--WebCore/rendering/RenderBlock.h4
-rw-r--r--WebCore/rendering/RenderBlockLineLayout.cpp3
-rw-r--r--WebCore/rendering/RenderBox.cpp71
-rw-r--r--WebCore/rendering/RenderBox.h12
-rw-r--r--WebCore/rendering/RenderBoxModelObject.cpp240
-rw-r--r--WebCore/rendering/RenderBoxModelObject.h8
-rw-r--r--WebCore/rendering/RenderFlexibleBox.cpp2
-rw-r--r--WebCore/rendering/RenderLayer.cpp17
-rw-r--r--WebCore/rendering/RenderLayer.h5
-rw-r--r--WebCore/rendering/RenderLayerBacking.cpp7
-rw-r--r--WebCore/rendering/RenderLineBoxList.cpp94
-rw-r--r--WebCore/rendering/RenderLineBoxList.h4
-rw-r--r--WebCore/rendering/RenderMeter.h2
-rw-r--r--WebCore/rendering/RenderSVGImage.cpp1
-rw-r--r--WebCore/rendering/RenderSVGResourceFilter.cpp13
-rw-r--r--WebCore/rendering/RenderSVGResourceFilterPrimitive.cpp68
-rw-r--r--WebCore/rendering/RenderSVGResourceFilterPrimitive.h10
-rw-r--r--WebCore/rendering/RenderSVGResourceMasker.cpp7
-rw-r--r--WebCore/rendering/RenderScrollbar.cpp18
-rw-r--r--WebCore/rendering/RenderTextControl.cpp34
-rw-r--r--WebCore/rendering/RenderTextControl.h9
-rw-r--r--WebCore/rendering/RenderTextFragment.cpp22
-rw-r--r--WebCore/rendering/RenderTextFragment.h4
-rw-r--r--WebCore/rendering/RenderView.cpp5
-rw-r--r--WebCore/rendering/RenderView.h2
-rw-r--r--WebCore/rendering/RootInlineBox.cpp2
-rw-r--r--WebCore/rendering/TextControlInnerElements.cpp26
-rw-r--r--WebCore/rendering/TextControlInnerElements.h3
-rw-r--r--WebCore/rendering/style/CursorList.h2
-rw-r--r--WebCore/rendering/style/RenderStyle.cpp25
-rw-r--r--WebCore/rendering/style/RenderStyle.h9
-rw-r--r--WebCore/rendering/svg/SVGInlineTextBox.cpp2
-rw-r--r--WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp9
-rw-r--r--WebCore/storage/IDBDatabaseBackendImpl.cpp85
-rw-r--r--WebCore/storage/IDBDatabaseBackendImpl.h13
-rw-r--r--WebCore/storage/IDBDatabaseException.h3
-rw-r--r--WebCore/storage/IDBDatabaseException.idl3
-rw-r--r--WebCore/storage/IDBFactoryBackendImpl.cpp77
-rw-r--r--WebCore/storage/IDBFactoryBackendImpl.h13
-rw-r--r--WebCore/storage/IDBObjectStoreBackendImpl.cpp29
-rw-r--r--WebCore/storage/IDBObjectStoreBackendImpl.h3
-rw-r--r--WebCore/storage/IDBRequest.cpp14
-rw-r--r--WebCore/storage/IDBSQLiteDatabase.cpp48
-rw-r--r--WebCore/storage/IDBSQLiteDatabase.h62
-rw-r--r--WebCore/storage/IDBTransactionBackendImpl.cpp2
-rw-r--r--WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h88
-rw-r--r--WebCore/svg/DeprecatedSVGAnimatedTemplate.h11
-rw-r--r--WebCore/svg/SVGAElement.h4
-rw-r--r--WebCore/svg/SVGAngle.cpp235
-rw-r--r--WebCore/svg/SVGAngle.h54
-rw-r--r--WebCore/svg/SVGAngle.idl30
-rw-r--r--WebCore/svg/SVGAnimatedAngle.h34
-rw-r--r--WebCore/svg/SVGAnimatedBoolean.h33
-rw-r--r--WebCore/svg/SVGAnimatedBoolean.idl5
-rw-r--r--WebCore/svg/SVGAnimatedEnumeration.h33
-rw-r--r--WebCore/svg/SVGAnimatedEnumeration.idl3
-rw-r--r--WebCore/svg/SVGAnimatedInteger.h33
-rw-r--r--WebCore/svg/SVGAnimatedLength.h34
-rw-r--r--WebCore/svg/SVGAnimatedLengthList.h34
-rw-r--r--WebCore/svg/SVGAnimatedRect.h34
-rw-r--r--WebCore/svg/SVGAnimationElement.h4
-rw-r--r--WebCore/svg/SVGCircleElement.h10
-rw-r--r--WebCore/svg/SVGClipPathElement.h8
-rw-r--r--WebCore/svg/SVGComponentTransferFunctionElement.h5
-rw-r--r--WebCore/svg/SVGCursorElement.h9
-rw-r--r--WebCore/svg/SVGDefsElement.h3
-rw-r--r--WebCore/svg/SVGElement.cpp15
-rw-r--r--WebCore/svg/SVGElement.h3
-rw-r--r--WebCore/svg/SVGEllipseElement.h12
-rw-r--r--WebCore/svg/SVGExternalResourcesRequired.cpp1
-rw-r--r--WebCore/svg/SVGExternalResourcesRequired.h32
-rw-r--r--WebCore/svg/SVGFEBlendElement.h2
-rw-r--r--WebCore/svg/SVGFEColorMatrixElement.h2
-rw-r--r--WebCore/svg/SVGFECompositeElement.h2
-rw-r--r--WebCore/svg/SVGFEConvolveMatrixElement.h12
-rw-r--r--WebCore/svg/SVGFEDiffuseLightingElement.cpp15
-rw-r--r--WebCore/svg/SVGFEDiffuseLightingElement.h10
-rw-r--r--WebCore/svg/SVGFEDisplacementMapElement.h4
-rw-r--r--WebCore/svg/SVGFEGaussianBlurElement.cpp15
-rw-r--r--WebCore/svg/SVGFEGaussianBlurElement.h10
-rw-r--r--WebCore/svg/SVGFEImageElement.h2
-rw-r--r--WebCore/svg/SVGFEMorphologyElement.h5
-rw-r--r--WebCore/svg/SVGFESpecularLightingElement.cpp12
-rw-r--r--WebCore/svg/SVGFESpecularLightingElement.h10
-rw-r--r--WebCore/svg/SVGFETurbulenceElement.cpp15
-rw-r--r--WebCore/svg/SVGFETurbulenceElement.h16
-rw-r--r--WebCore/svg/SVGFilterElement.cpp15
-rw-r--r--WebCore/svg/SVGFilterElement.h27
-rw-r--r--WebCore/svg/SVGFilterPrimitiveStandardAttributes.h10
-rw-r--r--WebCore/svg/SVGFitToViewBox.h2
-rw-r--r--WebCore/svg/SVGFontElement.h3
-rw-r--r--WebCore/svg/SVGFontFaceElement.cpp2
-rw-r--r--WebCore/svg/SVGFontFaceSrcElement.cpp7
-rw-r--r--WebCore/svg/SVGForeignObjectElement.h12
-rw-r--r--WebCore/svg/SVGGElement.h3
-rw-r--r--WebCore/svg/SVGGradientElement.h7
-rw-r--r--WebCore/svg/SVGImageElement.h12
-rw-r--r--WebCore/svg/SVGLength.idl2
-rw-r--r--WebCore/svg/SVGLengthList.cpp24
-rw-r--r--WebCore/svg/SVGLengthList.h18
-rw-r--r--WebCore/svg/SVGLengthList.idl2
-rw-r--r--WebCore/svg/SVGLineElement.h12
-rw-r--r--WebCore/svg/SVGLinearGradientElement.h10
-rw-r--r--WebCore/svg/SVGMPathElement.h5
-rw-r--r--WebCore/svg/SVGMarkerElement.cpp18
-rw-r--r--WebCore/svg/SVGMarkerElement.h26
-rw-r--r--WebCore/svg/SVGMaskElement.h16
-rw-r--r--WebCore/svg/SVGNumber.idl3
-rw-r--r--WebCore/svg/SVGPathElement.h3
-rw-r--r--WebCore/svg/SVGPatternElement.h18
-rw-r--r--WebCore/svg/SVGPoint.idl6
-rw-r--r--WebCore/svg/SVGPolyElement.h3
-rw-r--r--WebCore/svg/SVGRadialGradientElement.h12
-rw-r--r--WebCore/svg/SVGRect.idl14
-rw-r--r--WebCore/svg/SVGRectElement.h16
-rw-r--r--WebCore/svg/SVGSVGElement.cpp6
-rw-r--r--WebCore/svg/SVGSVGElement.h15
-rw-r--r--WebCore/svg/SVGSVGElement.idl4
-rw-r--r--WebCore/svg/SVGScriptElement.h7
-rw-r--r--WebCore/svg/SVGStyledElement.cpp9
-rw-r--r--WebCore/svg/SVGSwitchElement.h3
-rw-r--r--WebCore/svg/SVGSymbolElement.h5
-rw-r--r--WebCore/svg/SVGTextContentElement.h8
-rw-r--r--WebCore/svg/SVGTextPathElement.h6
-rw-r--r--WebCore/svg/SVGTextPositioningElement.cpp49
-rw-r--r--WebCore/svg/SVGTextPositioningElement.h8
-rw-r--r--WebCore/svg/SVGUseElement.h12
-rw-r--r--WebCore/svg/SVGViewElement.h5
-rw-r--r--WebCore/svg/SVGViewSpec.cpp2
-rw-r--r--WebCore/svg/SVGViewSpec.h11
-rw-r--r--WebCore/svg/SVGZoomEvent.idl2
-rw-r--r--WebCore/svg/graphics/filters/SVGFilter.cpp60
-rw-r--r--WebCore/svg/graphics/filters/SVGFilter.h6
-rw-r--r--WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h94
-rw-r--r--WebCore/svg/properties/SVGAnimatedProperty.h105
-rw-r--r--WebCore/svg/properties/SVGAnimatedPropertyDescription.h100
-rw-r--r--WebCore/svg/properties/SVGAnimatedPropertyMacros.h126
-rw-r--r--WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h2
-rw-r--r--WebCore/svg/properties/SVGAnimatedPropertyTearOff.h71
-rw-r--r--WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h73
-rw-r--r--WebCore/svg/properties/SVGListPropertyTearOff.h382
-rw-r--r--WebCore/svg/properties/SVGProperty.h42
-rw-r--r--WebCore/svg/properties/SVGPropertyTearOff.h124
-rw-r--r--WebCore/svg/properties/SVGPropertyTraits.h114
-rw-r--r--WebCore/webaudio/AudioContext.cpp72
-rw-r--r--WebCore/webaudio/AudioContext.h18
-rw-r--r--WebCore/webaudio/AudioNode.cpp24
-rw-r--r--WebCore/webaudio/AudioNode.h26
-rw-r--r--WebCore/webaudio/AudioNode.idl24
-rw-r--r--WebCore/webaudio/AudioNodeInput.cpp270
-rw-r--r--WebCore/webaudio/AudioNodeInput.h125
-rw-r--r--WebCore/webaudio/AudioNodeOutput.cpp216
-rw-r--r--WebCore/webaudio/AudioNodeOutput.h134
-rw-r--r--WebCore/webaudio/DelayNode.cpp47
-rw-r--r--WebCore/webaudio/DelayNode.h53
-rw-r--r--WebCore/webaudio/DelayNode.idl32
-rw-r--r--WebCore/webaudio/DelayProcessor.cpp54
-rw-r--r--WebCore/webaudio/DelayProcessor.h53
-rw-r--r--WebCore/websockets/WebSocketChannel.cpp55
-rw-r--r--WebCore/websockets/WebSocketChannel.h8
-rw-r--r--WebCore/workers/WorkerContext.cpp9
-rw-r--r--WebCore/xml/XSLTProcessor.cpp1
730 files changed, 25743 insertions, 7036 deletions
diff --git a/WebCore/Android.derived.jscbindings.mk b/WebCore/Android.derived.jscbindings.mk
index 080ad2d..db414ab 100644
--- a/WebCore/Android.derived.jscbindings.mk
+++ b/WebCore/Android.derived.jscbindings.mk
@@ -204,6 +204,7 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/fileapi/%.cpp : $(intermediates)/
# HTML
GEN := \
$(intermediates)/html/JSDOMFormData.h \
+ $(intermediates)/html/JSDOMSettableTokenList.h \
$(intermediates)/html/JSDOMTokenList.h \
$(intermediates)/html/JSDataGridColumn.h \
$(intermediates)/html/JSDataGridColumnList.h \
diff --git a/WebCore/Android.derived.v8bindings.mk b/WebCore/Android.derived.v8bindings.mk
index 38d55fd..b8e48ae 100644
--- a/WebCore/Android.derived.v8bindings.mk
+++ b/WebCore/Android.derived.v8bindings.mk
@@ -146,6 +146,7 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/bindings/%.cpp : $(intermediates)
GEN := \
$(intermediates)/bindings/V8Blob.h \
$(intermediates)/bindings/V8BlobBuilder.h \
+<<<<<<< HEAD
$(intermediates)/bindings/V8DOMFileSystem.h \
$(intermediates)/bindings/V8DOMFileSystemSync.h \
$(intermediates)/bindings/V8DirectoryEntry.h \
@@ -159,6 +160,12 @@ GEN := \
$(intermediates)/bindings/V8EntryCallback.h \
$(intermediates)/bindings/V8EntrySync.h \
$(intermediates)/bindings/V8ErrorCallback.h \
+=======
+ $(intermediates)/bindings/V8DOMTokenList.h \
+ $(intermediates)/bindings/V8DOMSettableTokenList.h \
+ $(intermediates)/bindings/V8DataGridColumn.h \
+ $(intermediates)/bindings/V8DataGridColumnList.h \
+>>>>>>> webkit.org at r70949
$(intermediates)/bindings/V8File.h \
$(intermediates)/bindings/V8FileCallback.h \
$(intermediates)/bindings/V8FileEntry.h \
diff --git a/WebCore/Android.jscbindings.mk b/WebCore/Android.jscbindings.mk
index fee0094..80e9516 100644
--- a/WebCore/Android.jscbindings.mk
+++ b/WebCore/Android.jscbindings.mk
@@ -88,10 +88,15 @@ LOCAL_SRC_FILES += \
bindings/js/JSDOMBinding.cpp \
bindings/js/JSDOMFormDataCustom.cpp \
bindings/js/JSDOMGlobalObject.cpp \
+<<<<<<< HEAD
bindings/js/JSDOMMimeTypeArrayCustom.cpp \
bindings/js/JSDOMPluginArrayCustom.cpp \
bindings/js/JSDOMPluginCustom.cpp \
bindings/js/JSDOMStringMapCustom.cpp \
+=======
+ bindings/js/JSDOMSettableTokenList.cpp \
+ bindings/js/JSDOMTokenList.cpp \
+>>>>>>> webkit.org at r70949
bindings/js/JSDOMWindowBase.cpp \
bindings/js/JSDOMWindowCustom.cpp \
bindings/js/JSDOMWindowShell.cpp \
@@ -110,7 +115,11 @@ LOCAL_SRC_FILES += \
bindings/js/JSEventListener.cpp \
bindings/js/JSEventTarget.cpp \
bindings/js/JSExceptionBase.cpp \
+<<<<<<< HEAD
bindings/js/JSFloat32ArrayCustom.cpp \
+=======
+ bindings/js/JSFileReaderCustom.cpp \
+>>>>>>> webkit.org at r70949
bindings/js/JSGeolocationCustom.cpp \
bindings/js/JSHTMLAllCollectionCustom.cpp \
bindings/js/JSHTMLAppletElementCustom.cpp \
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index bbc8bdc..eadb310 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -287,12 +287,18 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
html/BaseTextInputType.cpp \
html/ButtonInputType.cpp \
html/CheckboxInputType.cpp \
+ html/ClassList.cpp \
html/CollectionCache.cpp \
html/parser/CSSPreloadScanner.cpp \
html/ColorInputType.cpp \
html/DOMFormData.cpp \
+<<<<<<< HEAD
html/DOMTokenList.cpp \
html/DateComponents.cpp \
+=======
+ html/DOMSettableTokenList.cpp \
+ html/DOMTokenList.cpp \
+>>>>>>> webkit.org at r70949
html/DateInputType.cpp \
html/DateTimeInputType.cpp \
html/DateTimeLocalInputType.cpp \
@@ -462,6 +468,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
page/Settings.cpp \
page/SpatialNavigation.cpp \
page/SpeechInput.cpp \
+ page/SpeechInputResult.cpp \
page/SuspendableTimer.cpp \
page/Timing.cpp \
page/UserContentURLPattern.cpp \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 42e344a..30fd99d 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -207,6 +207,7 @@ SET(WebCore_IDL_FILES
html/DataGridColumn.idl
html/DataGridColumnList.idl
html/DOMFormData.idl
+ html/DOMSettableTokenList.idl
html/DOMTokenList.idl
html/HTMLAllCollection.idl
html/HTMLAnchorElement.idl
@@ -619,6 +620,7 @@ SET(WebCore_SOURCES
bindings/js/JSEventSourceCustom.cpp
bindings/js/JSEventTarget.cpp
bindings/js/JSExceptionBase.cpp
+ bindings/js/JSFileReaderCustom.cpp
bindings/js/JSGeolocationCustom.cpp
bindings/js/JSHistoryCustom.cpp
bindings/js/JSIDBAnyCustom.cpp
@@ -924,6 +926,7 @@ SET(WebCore_SOURCES
editing/SplitElementCommand.cpp
editing/SplitTextNodeCommand.cpp
editing/SplitTextNodeContainingElementCommand.cpp
+ editing/TextCheckingHelper.cpp
editing/TextIterator.cpp
editing/TypingCommand.cpp
editing/UnlinkCommand.cpp
@@ -949,14 +952,18 @@ SET(WebCore_SOURCES
history/PageCache.cpp
html/AsyncImageResizer.cpp
+ html/BaseButtonInputType.cpp
+ html/BaseCheckableInputType.cpp
html/BaseDateAndTimeInputType.cpp
html/BaseTextInputType.cpp
html/ButtonInputType.cpp
html/CheckboxInputType.cpp
+ html/ClassList.cpp
html/CollectionCache.cpp
html/ColorInputType.cpp
html/DOMDataGridDataSource.cpp
html/DOMFormData.cpp
+ html/DOMSettableTokenList.cpp
html/DOMTokenList.cpp
html/DataGridColumn.cpp
html/DataGridColumnList.cpp
@@ -1590,6 +1597,7 @@ SET(WebCore_SOURCES
IF (ENABLE_BLOB)
LIST(APPEND WebCore_SOURCES
fileapi/FileReader.cpp
+ fileapi/FileReaderLoader.cpp
fileapi/FileThread.cpp
fileapi/FileStreamProxy.cpp
platform/FileStream.cpp
diff --git a/WebCore/CMakeListsEfl.txt b/WebCore/CMakeListsEfl.txt
index e44dfd4..3397bc2 100644
--- a/WebCore/CMakeListsEfl.txt
+++ b/WebCore/CMakeListsEfl.txt
@@ -102,6 +102,7 @@ IF (WTF_USE_SOUP)
platform/network/soup/ResourceRequestSoup.cpp
platform/network/soup/ResourceResponseSoup.cpp
platform/network/soup/SocketStreamHandleSoup.cpp
+ platform/network/soup/SoupURIUtils.cpp
platform/network/soup/cache/soup-directory-input-stream.c
platform/network/soup/cache/soup-http-input-stream.c
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 83f63cc..44714b7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,6988 @@
+2010-10-29 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove RenderTextControl::setSelectionRange
+ https://bugs.webkit.org/show_bug.cgi?id=47870
+
+ Made RenderTextControl::setSelectionRange a global function.
+ Removed setSelectionStart, setSelectionEnd, and select from RenderTextControl.
+
+ No new tests are added since there is no behavioral change.
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::setSelectedTextRange): Calls setSelectedTextRange.
+ * dom/InputElement.cpp:
+ (WebCore::InputElement::updateSelectionRange): Ditto.
+ * html/HTMLFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::setSelectionStart): Ditto.
+ (WebCore::HTMLTextFormControlElement::setSelectionEnd): Ditto.
+ (WebCore::HTMLTextFormControlElement::select): Ditto.
+ (WebCore::HTMLTextFormControlElement::setSelectionRange): Ditto.
+ * rendering/RenderTextControl.cpp:
+ (WebCore::RenderTextControl::hasVisibleTextArea): Added.
+ (WebCore::setSelectionRange): See above.
+ * rendering/RenderTextControl.h:
+
+2010-10-29 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Reviewed by Andreas Kling.
+
+ [GTK] Crash in TextEncoding.cpp when using glib unicode
+ https://bugs.webkit.org/show_bug.cgi?id=48521
+
+ When the conversion to UTF-8 fails, try to encode the original string
+ without normalizing. Fixes tests cases:
+ fast/url/anchor.html
+ fast/url/query.html
+ fast/url/standard-url.html
+
+ * platform/text/TextEncoding.cpp:
+ (WebCore::TextEncoding::encode):
+
+2010-10-29 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ TextureMapperGL get the driver info log but do not use it
+ https://bugs.webkit.org/show_bug.cgi?id=48247
+
+ Remove the call to glGetProgramInfoLog().
+
+ * platform/graphics/opengl/TextureMapperGL.cpp:
+ (WebCore::TexmapShaderInfo::createShaderProgram):
+
+2010-10-29 Benjamin Kalman <kalman@google.com>
+
+ Reviewed by Tony Chang.
+
+ Deleting contenteditable text to the left of a non-contenteditable span inserts unnecessary placeholder <br/>
+ https://bugs.webkit.org/show_bug.cgi?id=48658
+
+ * WebCore.exp.in: Update is{Start,End}OfParagraph symbols.
+ * editing/DeleteSelectionCommand.cpp:
+ (WebCore::DeleteSelectionCommand::doApply): Cross editability boundaries when determining whether to insert placeholder.
+ * editing/visible_units.cpp: Allow editability boundary to be crossed in {start,end,isStart,isEnd}OfParagraph.
+ (WebCore::startOfParagraph): Also, avoid returning a position where renderer can't accept caret, like in endOfParagraph.
+ (WebCore::endOfParagraph):
+ (WebCore::isStartOfParagraph):
+ (WebCore::isEndOfParagraph):
+ * editing/visible_units.h: Ditto.
+
+2010-10-29 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: last active panel is not restored upon opening inspector.
+ https://bugs.webkit.org/show_bug.cgi?id=48668
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::inspect):
+ (WebCore::InspectorController::showPanel):
+ (WebCore::InspectorController::disconnectFrontend):
+ (WebCore::InspectorController::populateScriptObjects):
+ * inspector/InspectorController.h:
+ * inspector/InspectorState.cpp:
+ (WebCore::InspectorState::InspectorState):
+ * inspector/front-end/Settings.js:
+ (WebInspector.Settings):
+ * inspector/front-end/inspector.js:
+ (WebInspector.set currentPanel):
+ (WebInspector.doLoadedDone.onPopulateScriptObjects):
+ (WebInspector.doLoadedDone):
+ (WebInspector.documentClick.followLink):
+ (WebInspector.documentClick):
+
+2010-10-28 Michael Nordman <michaeln@google.com>
+
+ Reviewed by ap.
+
+ [Chrome] Fix an appcache regression introduced in r69226
+ https://bugs.webkit.org/show_bug.cgi?id=48592
+ Define a new ApplicationCacheHost method for the specific case of main resource redirect handling.
+
+ Tests: the existing layout test applies
+
+ * loader/MainResourceLoader.cpp: use the newly introduced method
+ (WebCore::MainResourceLoader::willSendRequest):
+ * loader/appcache/ApplicationCacheHost.cpp:
+ (WebCore::ApplicationCacheHost::maybeLoadMainResourceForRedirect):
+ * loader/appcache/ApplicationCacheHost.h:
+
+2010-10-29 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Navigating to a .wav file creates a plugin document but should create a media document
+ https://bugs.webkit.org/show_bug.cgi?id=48546
+ <rdar://problem/8606105>
+
+ Test: media/media-can-play-wav-audio.html
+
+ * platform/MIMETypeRegistry.cpp: Add mapping from ".wav" to "audio/x-wav".
+
+2010-10-29 Aaron Colwell <acolwell@chromium.org>
+
+ Reviewed by James Robinson.
+
+ Created helper method WebCore::PlatformContextSkia::getNormalizedAlpha()
+ to centralize alpha rounding & clipping logic.
+ https://bugs.webkit.org/show_bug.cgi?id=48094
+
+ Test: media/video-canvas-alpha.html
+
+ * platform/graphics/skia/ImageSkia.cpp:
+ (WebCore::paintSkBitmap):
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PlatformContextSkia::getNormalizedAlpha):
+ * platform/graphics/skia/PlatformContextSkia.h:
+
+2010-10-29 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ ASSERT when SVGAnimatedProperty instance is assigned to multiple elements.
+ https://bugs.webkit.org/show_bug.cgi?id=48555
+
+ Test: svg/custom/insertItemBefore-from-non-list-origin.svg
+
+ * bindings/scripts/CodeGeneratorJS.pm: Include SVGAnimatedPropertyTearOff.h instead of SVGPropertyTearOff.h
+ * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ * svg/properties/SVGAnimatedListPropertyTearOff.h:
+ (WebCore::SVGAnimatedListPropertyTearOff::isAnimatedListTearOff): Return true.
+ (WebCore::SVGAnimatedListPropertyTearOff::removeItemFromList): Devirtualize function.
+ * svg/properties/SVGAnimatedProperty.h:
+ (WebCore::SVGAnimatedProperty::isAnimatedListTearOff): Return false.
+ * svg/properties/SVGListPropertyTearOff.h:
+ (WebCore::SVGListPropertyTearOff::removeItemFromListIfNeeded): Only try to remove the passed item from its list, if its actually a list and not just a SVGAnimatedProperty.
+
+2010-10-29 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Adam Roben.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48444
+
+ Fix the dirty rect checks in RenderBoxLineList, InlineFlowBox, InlineTextBox. They were still assuming horizontal-tb writing-mode.
+ This patch makes the checks directionally abstract and also refactors the checks in RenderLineBoxList to share code.
+
+ No tests yet, since the invalidation code for inlines still assumes horizontal-tb. That will be fixed in a follow-up bug,
+ and then repaint tests will be easy to write.
+
+ * rendering/InlineBox.cpp:
+ (WebCore::InlineBox::adjustForFlippedBlocksWritingMode):
+ * rendering/InlineBox.h:
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paint):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paint):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::convertFromFlippedWritingMode):
+ * rendering/RenderBox.h:
+ * rendering/RenderLineBoxList.cpp:
+ (WebCore::RenderLineBoxList::rangeIntersectsDirtyRect):
+ (WebCore::RenderLineBoxList::anyLineIntersectsDirtyRect):
+ (WebCore::RenderLineBoxList::lineIntersectsDirtyRect):
+ (WebCore::RenderLineBoxList::paint):
+ (WebCore::RenderLineBoxList::hitTest):
+ * rendering/RenderLineBoxList.h:
+
+2010-10-29 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Cleanup createGlobalImageFileDescriptor in ClipboardWin
+ https://bugs.webkit.org/show_bug.cgi?id=48189
+
+ * platform/win/ClipboardWin.cpp:
+ (WebCore::createGlobalURLContent):
+ (WebCore::createGlobalUrlFileDescriptor):
+ (WebCore::ClipboardWin::writeURL):
+
+2010-10-29 Dmitry Titov <dimich@chromium.org>
+
+ [Chromium clang] Unreviewed fix removing compiler warning.
+ If GIFImageReader is a struct, don't call it a class.
+
+ * platform/image-decoders/gif/GIFImageDecoder.h:
+
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Fix the world (d'oh!)
+
+ https://bugs.webkit.org/show_bug.cgi?id=48576
+ Let WebKit2 client know when a frame is a frameset
+
+ * html/HTMLFrameSetElement.cpp:
+ (WebCore::HTMLFrameSetElement::insertedIntoDocument):
+ (WebCore::HTMLFrameSetElement::removedFromDocument):
+ Call base class version.
+
+2010-10-29 Jian Li <jianli@chromium.org>
+
+ Unreviewed. Fix chromium build break.
+
+ * bindings/v8/custom/V8FileReaderCustom.cpp:
+ (WebCore::V8FileReader::resultAccessorGetter):
+
+2010-10-29 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Support readAsArrayBuffer in FileReader and FileReaderSync
+ https://bugs.webkit.org/show_bug.cgi?id=47691
+
+ Merge the similar code in FileReader and FileReaderSync into
+ FileReaderLoader.
+
+ Test cases have been added to read-file-test-cases.js.
+
+ * Android.jscbindings.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/v8/custom/V8FileReaderCustom.cpp: Added.
+ * fileapi/FileReader.cpp:
+ (WebCore::FileReader::FileReader):
+ (WebCore::FileReader::readAsArrayBuffer):
+ (WebCore::FileReader::readAsBinaryString):
+ (WebCore::FileReader::readAsText):
+ (WebCore::FileReader::readAsDataURL):
+ (WebCore::FileReader::readInternal):
+ (WebCore::FileReader::doAbort):
+ (WebCore::FileReader::terminate):
+ (WebCore::FileReader::start):
+ (WebCore::FileReader::didStartLoading):
+ (WebCore::FileReader::didReceiveData):
+ (WebCore::FileReader::didFinishLoading):
+ (WebCore::FileReader::didFail):
+ (WebCore::FileReader::fireEvent):
+ (WebCore::FileReader::arrayBufferResult):
+ (WebCore::FileReader::stringResult):
+ * fileapi/FileReader.h:
+ (WebCore::FileReader::readType):
+ * fileapi/FileReader.idl:
+ * fileapi/FileReaderLoader.cpp: Added.
+ * fileapi/FileReaderLoader.h: Added.
+ * fileapi/FileReaderLoaderClient.h: Added.
+ * fileapi/FileReaderSync.cpp:
+ (WebCore::FileReaderSync::FileReaderSync):
+ (WebCore::FileReaderSync::readAsArrayBuffer):
+ (WebCore::FileReaderSync::readAsBinaryString):
+ (WebCore::FileReaderSync::readAsText):
+ (WebCore::FileReaderSync::readAsDataURL):
+ (WebCore::FileReaderSync::startLoading):
+ * fileapi/FileReaderSync.h:
+ * fileapi/FileReaderSync.idl:
+ * html/canvas/ArrayBuffer.cpp:
+ (WebCore::ArrayBuffer::create):
+ * html/canvas/ArrayBuffer.h:
+ * loader/ThreadableLoaderClient.h:
+
+2010-10-29 Tony Chang <tony@chromium.org>
+
+ Unreviewed, rolling out r70850.
+ http://trac.webkit.org/changeset/70850
+ https://bugs.webkit.org/show_bug.cgi?id=45640
+
+ chromium and qt pixel test regressions
+
+ * dom/Document.cpp:
+ * dom/Document.h:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::invalidateRect):
+ (WebCore::FrameView::repaintContentRectangle):
+ (WebCore::FrameView::doDeferredRepaints):
+ * page/FrameView.h:
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintContents):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::paintLayer):
+
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48576
+ Let WebKit2 client know when a frame is a frameset
+
+ This can change in two cases, when document changes, and when frame is navigated to another
+ document.
+
+ * dom/Document.cpp: (WebCore::Document::documentDidBecomeActive): Update the client when
+ a document is restored from page cache.
+
+ * loader/FrameLoaderClient.h: Added a new client call to notify client.
+
+ * html/HTMLFrameSetElement.h:
+ * html/HTMLFrameSetElement.cpp:
+ (WebCore::HTMLFrameSetElement::insertedIntoDocument):
+ (WebCore::HTMLFrameSetElement::removedFromDocument):
+ Update the client when document changes, potentially becoming a frameset. Per WebCore
+ definition, a document is a frameset when it has a FRAMESET element as direct child of
+ document element (it may also have body elements).
+
+ * loader/EmptyClients.h: (WebCore::EmptyFrameLoaderClient::dispatchDidBecomeFrameset):
+ Added an empty implementation.
+
+2010-10-29 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unreviewed fix. Touch WebCorePrefix.h to fix incremental build failure after r70878.
+
+ * WebCorePrefix.h:
+
+2010-10-29 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Handle surrogate pairs in TextBreakIteratorGtk
+ https://bugs.webkit.org/show_bug.cgi?id=48227
+
+ TextBreakIteratorGtk uses UTF-8 because it's what pango expects, but we
+ need to return indices for the given input string that are in UTF-16.
+ The number of characters is the same for both UTF-16 and UTF-8 except when
+ the input string contains surrogate pairs. We need to keep both, the
+ index for the UTF-8 string to be used internally, and the index for the
+ UTF-16 string to be used as return value of the iterator interface. It
+ fixes test fast/forms/textarea-maxlength.html
+
+ * platform/text/gtk/TextBreakIteratorGtk.cpp:
+ (WebCore::CharacterIterator::getText):
+ (WebCore::CharacterIterator::getLength):
+ (WebCore::CharacterIterator::getSize):
+ (WebCore::CharacterIterator::getIndex):
+ (WebCore::CharacterIterator::getUTF16Index):
+ (WebCore::CharacterIterator::getUTF16Length):
+ (WebCore::CharacterIterator::characterSize):
+ (WebCore::CharacterIterator::setText):
+ (WebCore::CharacterIterator::setIndex):
+ (WebCore::CharacterIterator::setUTF16Index):
+ (WebCore::CharacterIterator::first):
+ (WebCore::CharacterIterator::last):
+ (WebCore::CharacterIterator::next):
+ (WebCore::CharacterIterator::previous):
+ (WebCore::setUpIterator):
+ (WebCore::textBreakFirst):
+ (WebCore::textBreakLast):
+ (WebCore::textBreakNext):
+ (WebCore::textBreakPrevious):
+ (WebCore::textBreakPreceding):
+ (WebCore::textBreakFollowing):
+ (WebCore::textBreakCurrent):
+ (WebCore::isTextBreak):
+
+2010-10-29 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: [REGRESSION] Addition of a new (blank) style property does not work
+ https://bugs.webkit.org/show_bug.cgi?id=48631
+
+ Test: inspector/styles-add-blank-property.html
+
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertiesSection.prototype.addNewBlankProperty):
+ (WebInspector.ComputedStylePropertiesSection.prototype.onpopulate):
+
+2010-10-29 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: add close button to network view, make tests pass for
+ resource manager on all ports.
+ https://bugs.webkit.org/show_bug.cgi?id=48628
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::didCommitLoad):
+ (WebCore::InspectorController::frameDetachedFromParent):
+ (WebCore::InspectorController::didLoadResourceFromMemoryCache):
+ (WebCore::InspectorController::identifierForInitialRequest):
+ (WebCore::InspectorController::willSendRequest):
+ (WebCore::InspectorController::markResourceAsCached):
+ (WebCore::InspectorController::didReceiveResponse):
+ (WebCore::InspectorController::didReceiveContentLength):
+ (WebCore::InspectorController::didFinishLoading):
+ (WebCore::InspectorController::didFailLoading):
+ (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest):
+ (WebCore::InspectorController::scriptImported):
+ (WebCore::InspectorController::didCreateWebSocket):
+ (WebCore::InspectorController::willSendWebSocketHandshakeRequest):
+ (WebCore::InspectorController::didReceiveWebSocketHandshakeResponse):
+ (WebCore::InspectorController::didCloseWebSocket):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceTreeModel.prototype.didCommitLoadForFrame):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel.prototype.addResourceToFrame):
+ * inspector/front-end/inspector.js:
+ (WebInspector._createPanels):
+ * inspector/front-end/networkPanel.css:
+ (.network-close-button):
+
+2010-10-29 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Convert SVGAnimatedEnumeration/Integer to the new SVGAnimatedPropertyTearOff concept
+ https://bugs.webkit.org/show_bug.cgi?id=48623
+
+ Besides converting SVGAnimatedEnumeration/Integer to the new animated property tear off concept, fix support
+ for multiple wrappers within the new concept, which was broken - covered by existing svg/dynamic-updates/ tests.
+
+ Replace all 'extern char[]' usage when using the multiple wrappers macro, by static AtomicStrings.
+
+ * GNUmakefile.am: Add SVGAnimatedEnumeration.h / SVGAnimatedInteger.h to build.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * bindings/scripts/CodeGenerator.pm: Recognize SVGAnimatedEnumeration / SVGAnimatedInteger as animated types using the new concept.
+ * bindings/scripts/CodeGeneratorObjC.pm: Touched, to force regenerating ObjC bindings, dependency tracking is obviously broken.
+ * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove SVGAnimatedBoolean/Enumeration/Integer handling.
+ * svg/DeprecatedSVGAnimatedTemplate.h: Ditto.
+ * svg/SVGAnimatedEnumeration.h: Added.
+ * svg/SVGAnimatedEnumeration.idl:
+ * svg/SVGAnimatedInteger.h: Added.
+ * svg/SVGClipPathElement.h: Adapted all code to create new style animated property tear offs for long & int types.
+ * svg/SVGComponentTransferFunctionElement.h:
+ * svg/SVGFEBlendElement.h:
+ * svg/SVGFEColorMatrixElement.h:
+ * svg/SVGFECompositeElement.h:
+ * svg/SVGFEConvolveMatrixElement.h:
+ * svg/SVGFEDiffuseLightingElement.cpp:
+ (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier): Replaced extern[] char hack using a static AtomicString.
+ (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier): Ditto.
+ * svg/SVGFEDiffuseLightingElement.h:
+ * svg/SVGFEDisplacementMapElement.h:
+ * svg/SVGFEGaussianBlurElement.cpp:
+ (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier): Ditto.
+ (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier): Ditto.
+ * svg/SVGFEGaussianBlurElement.h:
+ * svg/SVGFEMorphologyElement.h:
+ * svg/SVGFESpecularLightingElement.cpp:
+ (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier): Ditto.
+ (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier): Ditto.
+ * svg/SVGFESpecularLightingElement.h:
+ * svg/SVGFETurbulenceElement.cpp:
+ (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier): Ditto.
+ (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier): Ditto.
+ * svg/SVGFETurbulenceElement.h:
+ * svg/SVGFilterElement.cpp:
+ (WebCore::SVGFilterElement::filterResXIdentifier): Ditto.
+ (WebCore::SVGFilterElement::filterResYIdentifier): Ditto.
+ * svg/SVGFilterElement.h:
+ * svg/SVGGradientElement.h:
+ * svg/SVGMarkerElement.cpp:
+ (WebCore::SVGMarkerElement::orientTypeIdentifier): Ditto.
+ (WebCore::SVGMarkerElement::orientAngleIdentifier): Ditto.
+ * svg/SVGMarkerElement.h:
+ * svg/SVGMaskElement.h:
+ * svg/SVGPatternElement.h:
+ * svg/SVGTextContentElement.h:
+ * svg/SVGTextPathElement.h:
+ * svg/properties/SVGAnimatedPropertyMacros.h: Add new macro for multiple wrappers using static properties.
+
+2010-10-29 Andreas Kling <kling@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Make GraphicsContext cheaper to construct
+ https://bugs.webkit.org/show_bug.cgi?id=48626
+
+ Do less unnecessary things when creating the Qt GraphicsContext:
+ - Don't create a black QBrush that's immediately discarded.
+ - Don't call setPlatform*(), set the painter brush and pen directly.
+ - Call setRenderHints() once instead of multiple setRenderHint().
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
+ (WebCore::GraphicsContext::GraphicsContext):
+
+2010-10-29 Andreas Kling <kling@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] GraphicsLayer: Don't notifySyncRequired() more than necessary
+ https://bugs.webkit.org/show_bug.cgi?id=48624
+
+ Don't queue multiple meta method invocations for notifySyncRequired()
+
+ 4% speedup on <http://ariya.github.com/clock.htm>
+
+ * platform/graphics/qt/GraphicsLayerQt.cpp:
+ (WebCore::GraphicsLayerQtImpl::GraphicsLayerQtImpl):
+ (WebCore::GraphicsLayerQtImpl::notifySyncRequired):
+ (WebCore::GraphicsLayerQtImpl::notifyChange):
+
+2010-10-29 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Chris Marrin.
+
+ drawArrays/drawElements with first/offset out of range but size==0 should generate no error
+ https://bugs.webkit.org/show_bug.cgi?id=48601
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::drawArrays):
+ (WebCore::WebGLRenderingContext::drawElements):
+
+2010-10-29 Leandro Gracia Gil <leandrogracia@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Patch the current speech input implementation to use the nearest
+ language tag. The language is now passed to the startRecognition
+ methods so that language-specific recognition could be used. Also added
+ a second parameter to setMockSpeechInputResult for the language used in
+ speech recognition.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ This is the 2nd of a 4-sided patch in Chromium and WebKit. For more
+ details see http://codereview.chromium.org/3615005/show,
+ http://codereview.chromium.org/3595018/show and
+ https://bugs.webkit.org/show_bug.cgi?id=47420.
+
+ Test: fast/speech/input-text-language-tag.html
+
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::startRecognition):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h:
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::startRecognition):
+ (WebCore::SpeechInputClientMock::setRecognitionResult):
+ (WebCore::SpeechInputClientMock::timerFired):
+ * platform/mock/SpeechInputClientMock.h:
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::TextControlInnerElement::attachInnerElement):
+ (WebCore::SearchFieldCancelButtonElement::detach):
+ (WebCore::SpinButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::detach):
+
+2010-10-29 Mads Ager <ager@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ [V8] The DateExtension cannot handle overwritten Date
+ https://bugs.webkit.org/show_bug.cgi?id=48621
+
+ Check that the Date property is an object before attempting to get
+ hidden properties from it.
+
+ Test: fast/dom/Window/slow-unload-handler-overwritten-date.html
+
+ * bindings/v8/DateExtension.cpp:
+ (WebCore::DateExtension::setAllowSleep):
+
+2010-10-27 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Convert SVGAnimatedBoolean to the new SVGAnimatedPropertyTearOff concept
+ https://bugs.webkit.org/show_bug.cgi?id=48469
+
+ Convert the next SVG animated primitive type to use the SVGAnimatedPropertyTearOff concept: SVGAnimatedBoolean.
+ Added new test verifying that StrictTypeChecking is enabled for SVGAnimatedBooleans. It also tests that this type is "static", see LayoutTests/ChangeLog for details.
+
+ Add support for StrictTypeChecking for boolean types.
+
+ Test: svg/dom/SVGExternalResourcesRequired.html
+
+ * GNUmakefile.am: Add SVGAnimatedBoolean.h and SVGAnimatedStaticPropertyTearOff.h to build.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * bindings/scripts/CodeGenerator.pm: Add SVGAnimatedBoolean to the new style svg animated bindings list.
+ * bindings/scripts/CodeGeneratorJS.pm: Add StrictTypeChecking support for boolean types.
+ * bindings/scripts/CodeGeneratorObjC.pm: Ditto. Only generate kit() usage for new style animated types, if the wrapped type needs a tear off.
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ * svg/DeprecatedSVGAnimatedTemplate.h: Remove SVGAnimatedBoolean handling.
+ * svg/SVGAElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_STATIC_PROPERTY_NEW/ for boolean types everywhere. Include SVGAnimatedPropertyMacros.h where needed.
+ * svg/SVGAnimatedBoolean.h: Added.
+ * svg/SVGAnimatedBoolean.idl:
+ * svg/SVGAnimationElement.h:
+ * svg/SVGCircleElement.h:
+ * svg/SVGClipPathElement.h:
+ * svg/SVGCursorElement.h:
+ * svg/SVGDefsElement.h:
+ * svg/SVGEllipseElement.h:
+ * svg/SVGExternalResourcesRequired.cpp:
+ * svg/SVGExternalResourcesRequired.h:
+ (WebCore::SVGExternalResourcesRequired::~SVGExternalResourcesRequired):
+ * svg/SVGFEConvolveMatrixElement.h:
+ * svg/SVGFEImageElement.h:
+ * svg/SVGFilterElement.h:
+ * svg/SVGFontElement.h:
+ * svg/SVGForeignObjectElement.h:
+ * svg/SVGGElement.h:
+ * svg/SVGGradientElement.h:
+ * svg/SVGImageElement.h:
+ * svg/SVGLineElement.h:
+ * svg/SVGMPathElement.h:
+ * svg/SVGMarkerElement.h:
+ * svg/SVGMaskElement.h:
+ * svg/SVGPathElement.h:
+ * svg/SVGPatternElement.h:
+ * svg/SVGPolyElement.h:
+ * svg/SVGRectElement.h:
+ * svg/SVGSVGElement.h:
+ * svg/SVGScriptElement.h:
+ * svg/SVGSwitchElement.h:
+ * svg/SVGSymbolElement.h:
+ * svg/SVGTextContentElement.h:
+ * svg/SVGUseElement.h:
+ * svg/SVGViewElement.h:
+ * svg/properties/SVGAnimatedListPropertyTearOff.h: Moved RefPtr<SVGProperty> m_baseVal/m_animVal from SVGAnimatedProperty, as SVGAnimatedStaticPropertyTearOff doesn't need them.
+ * svg/properties/SVGAnimatedProperty.h: Remove m_baseVal/m_animVal.
+ (WebCore::SVGAnimatedProperty::commitChange): New method to share code between the SVGAnimated*PropertyTearOff classes.
+ * svg/properties/SVGAnimatedPropertyMacros.h: Add new DECLARE_ANIMATED_STATIC_PROPERTY_NEW macro which creates SVGAnimatedStaticPropertyTearOff types.
+ * svg/properties/SVGAnimatedPropertyTearOff.h: Moved RefPtr<SVGProperty> m_baseVal/m_animVal from SVGAnimatedProperty, as SVGAnimatedStaticPropertyTearOff doesn't need them.
+ * svg/properties/SVGAnimatedStaticPropertyTearOff.h: Added.
+ (WebCore::SVGAnimatedStaticPropertyTearOff::baseVal): Directly returns the stored m_property as reference, no tear off is created.
+ (WebCore::SVGAnimatedStaticPropertyTearOff::animVal): Ditto.
+ (WebCore::SVGAnimatedStaticPropertyTearOff::setBaseVal): Directly updates the stored m_property reference, and invalidates the SVG attributes.
+ (WebCore::SVGAnimatedStaticPropertyTearOff::setAnimVal): Not implemented.
+ (WebCore::SVGAnimatedStaticPropertyTearOff::create):
+ (WebCore::SVGAnimatedStaticPropertyTearOff::SVGAnimatedStaticPropertyTearOff):
+ * svg/properties/SVGListPropertyTearOff.h:
+ (WebCore::SVGListPropertyTearOff::commitChange): Share code, use SVGAnimatedProperty::commitChange.
+ * svg/properties/SVGPropertyTearOff.h:
+ (WebCore::SVGPropertyTearOff::commitChange): Ditto.
+
+2010-10-28 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Kent Tamura.
+
+ <meter min=0 max=100 value=100> should be optimum.
+ https://bugs.webkit.org/show_bug.cgi?id=48613
+
+ Changed to make the condition inclusive for better case consistently.
+ - Values on the border between optimum and subsequntial go optimum.
+ - Values on the border between suboptimal and even-less-than-good go suboptimal.
+
+ Test: fast/dom/HTMLMeterElement/meter-boundary-values.html
+
+ * html/HTMLMeterElement.cpp:
+ (WebCore::HTMLMeterElement::gaugeRegion):
+
+2010-10-29 Kenichi Ishibashi <bashi@google.com>
+
+ Reviewed by Kent Tamura.
+
+ [HTML5] Add DOMSettableTokenList
+ https://bugs.webkit.org/show_bug.cgi?id=47810
+
+ Adds DOMSettableTokenList interface to support <output> element.
+ The DOMTokenList interface was refactored since its was tightly coupled
+ with HTMLElement.classList property.
+
+ * Android.derived.jscbindings.mk: Added JSDOMSettableTokenList.h file.
+ * Android.derived.v8bindings.mk: Added V8DOMSettableTokenList.h file.
+ * Android.jscbindings.mk: Added JSDOMSettableTokenList.cpp file.
+ * Android.mk: Added ClassList.cpp file.
+ * CMakeLists.txt: Added DOMSettableTokenList.{cpp,idl} and ClassList.cpp files.
+ * DerivedSources.cpp: Added JSDOMSettableTokenList.cpp file.
+ * DerivedSources.make: Added DOMSettableTokenList entry.
+ * GNUmakefile.am: Added JSDOMSettableTokenList.{h,cpp} and ClassList.{h,cpp} files.
+ * WebCore.gypi: Added DOMSettableTokenList.{h,cpp,idl}, V8DOMSettableTokenListCustom.cpp and ClassList.{h,cpp} files.
+ * WebCore.pri: Added DOMSettableTokenList.idl file.
+ * WebCore.pro: Added V8DOMSettableTokenListCustom.cpp, ClassList.{h,cpp} and DOMSettableTokenList.{h,cpp} files.
+ * WebCore.vcproj/WebCore.vcproj: Added JSDOMSettableTokenList.{h,cpp}, ClassList.{h,cpp} and DOMSettableTokenList.{h,cpp} files.
+ * WebCore.xcodeproj/project.pbxproj: Added ClassList.{h,cpp}, DOMSettabletokenList.{h,cpp} and JSDOMSettableTokenList.{h,cpp}
+ * bindings/gobject/GNUmakefile.am: Added WebKitDOMDOMSettableTokenList.{h,cpp} and WebKitDOMDOMSettableTokenListPrivate.cpp files.
+ * bindings/scripts/CodeGeneratorJS.pm: Modified IndexGetterReturnsStrings() returns 1 for DOMSettableTokenList.
+ * bindings/v8/custom/V8DOMSettableTokenListCustom.cpp: Added.
+ (WebCore::V8DOMSettableTokenList::indexedPropertyGetter):
+ * dom/Element.cpp: Replaced DOMTokenList to ClassList.
+ (WebCore::Element::classList):
+ * dom/ElementRareData.h: ditto.
+ * dom/SpaceSplitString.cpp: Added add() and remove() functions.
+ (WebCore::SpaceSplitStringData::add):
+ (WebCore::SpaceSplitStringData::remove):
+ (WebCore::SpaceSplitString::add):
+ (WebCore::SpaceSplitString::remove):
+ * dom/SpaceSplitString.h: Added add() and remove() functions.
+ * dom/StyledElement.cpp: Replaced DOMTokenList to ClassList.
+ (WebCore::StyledElement::classAttributeChanged):
+ * dom/StyledElement.h: ditto.
+ * html/ClassList.cpp: Added, mostly from original DOMTokenList.cpp.
+ (WebCore::ClassList::ClassList):
+ (WebCore::ClassList::ref):
+ (WebCore::ClassList::deref):
+ (WebCore::ClassList::length):
+ (WebCore::ClassList::item):
+ (WebCore::ClassList::contains):
+ (WebCore::ClassList::containsInternal):
+ (WebCore::ClassList::add):
+ (WebCore::ClassList::addInternal):
+ (WebCore::ClassList::remove):
+ (WebCore::ClassList::removeInternal):
+ (WebCore::ClassList::toggle):
+ (WebCore::ClassList::toString):
+ (WebCore::ClassList::reset):
+ (WebCore::ClassList::classNames):
+ * html/ClassList.h: Added, mostly from original DOMTokenList.h.
+ (WebCore::ClassList::create):
+ (WebCore::ClassList::element):
+ * html/DOMSettableTokenList.cpp: Added.
+ (WebCore::DOMSettableTokenList::DOMSettableTokenList):
+ (WebCore::DOMSettableTokenList::~DOMSettableTokenList):
+ (WebCore::DOMSettableTokenList::item):
+ (WebCore::DOMSettableTokenList::contains):
+ (WebCore::DOMSettableTokenList::add):
+ (WebCore::DOMSettableTokenList::addInternal):
+ (WebCore::DOMSettableTokenList::remove):
+ (WebCore::DOMSettableTokenList::removeInternal):
+ (WebCore::DOMSettableTokenList::toggle):
+ (WebCore::DOMSettableTokenList::setValue):
+ * html/DOMSettableTokenList.h: Added.
+ (WebCore::DOMSettableTokenList::create):
+ (WebCore::DOMSettableTokenList::ref):
+ (WebCore::DOMSettableTokenList::deref):
+ (WebCore::DOMSettableTokenList::length):
+ (WebCore::DOMSettableTokenList::toString):
+ (WebCore::DOMSettableTokenList::value):
+ * html/DOMSettableTokenList.idl: Added.
+ * html/DOMTokenList.cpp: Refactored to be an abstract interface for both of ClassList and DOMSettableTokenList.
+ (WebCore::DOMTokenList::validateToken): Changed to be a static member function of DOMTokenList.
+ (WebCore::DOMTokenList::addToken): Added, mostly from original DOMTokenList::addInternal().
+ (WebCore::DOMTokenList::removeToken): Added, mostly from original DOMTokenList::removeInternal().
+ * html/DOMTokenList.h: Refactored to be an abstract interface for both of ClassList and DOMSettableTokenList.
+ (WebCore::DOMTokenList::~DOMTokenList):
+ (WebCore::DOMTokenList::element):
+ * page/DOMWindow.cpp: Added an entry for DOMSettableTokenList.
+ * page/DOMWindow.idl: ditto.
+
+2010-10-29 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: make legacy resource tracking optional in the native code,
+ make cookeis work against new resource manager.
+ https://bugs.webkit.org/show_bug.cgi?id=48532
+
+ * inspector/InspectorCSSStore.cpp:
+ (WebCore::InspectorCSSStore::resourceStyleSheetText):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::~InspectorController):
+ (WebCore::InspectorController::connectFrontend):
+ (WebCore::InspectorController::releaseFrontendLifetimeAgents):
+ (WebCore::InspectorController::populateScriptObjects):
+ (WebCore::InspectorController::unbindAllResources):
+ (WebCore::InspectorController::didCommitLoad):
+ (WebCore::InspectorController::frameDetachedFromParent):
+ (WebCore::InspectorController::didLoadResourceFromMemoryCache):
+ (WebCore::InspectorController::identifierForInitialRequest):
+ (WebCore::InspectorController::willSendRequest):
+ (WebCore::InspectorController::markResourceAsCached):
+ (WebCore::InspectorController::didReceiveResponse):
+ (WebCore::InspectorController::didReceiveContentLength):
+ (WebCore::InspectorController::didFinishLoading):
+ (WebCore::InspectorController::didFailLoading):
+ (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest):
+ (WebCore::InspectorController::scriptImported):
+ (WebCore::InspectorController::setResourceTrackingEnabled):
+ (WebCore::InspectorController::getCookies):
+ (WebCore::InspectorController::deleteCookie):
+ (WebCore::InspectorController::didCreateWebSocket):
+ (WebCore::InspectorController::willSendWebSocketHandshakeRequest):
+ (WebCore::InspectorController::didReceiveWebSocketHandshakeResponse):
+ (WebCore::InspectorController::didCloseWebSocket):
+ (WebCore::InspectorController::breakpointsSettingKey):
+ (WebCore::InspectorController::getResourceContent):
+ * inspector/InspectorController.h:
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::updateScriptObject):
+ (WebCore::InspectorResource::markFailed):
+ * inspector/InspectorResource.h:
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::populateObjectWithFrameResources):
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView.prototype._updateWithCookies):
+ (WebInspector.CookieItemsView.prototype._filterCookiesForDomain):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype._mimeTypeIsConsistentWithType):
+ (WebInspector.Resource.prototype._checkWarning):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager.prototype._updateResourceWithResponse):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ * inspector/front-end/inspector.js:
+ (WebInspector.forAllResources):
+ (WebInspector.updateResource):
+
+2010-10-29 MORITA Hajime <morrita@google.com>
+
+ Unreviewed attempt for fixing build break for http://trac.webkit.org/changeset/70847
+
+ * editing/EditingAllInOne.cpp:
+
+2010-10-29 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Support RegExp in V8 implementation of SerializedScriptValue
+ https://bugs.webkit.org/show_bug.cgi?id=44809
+
+ Add RegExp serialization/deserialization now that V8 provides API access
+ to the RegExp type.
+
+ * bindings/v8/SerializedScriptValue.cpp:
+ (WebCore::ZigZag::Writer::writeRegExp):
+ (WebCore::ZigZag::Serializer::writeRegExp):
+ (WebCore::ZigZag::Serializer::doSerialize):
+ (WebCore::ZigZag::Reader::read):
+ (WebCore::ZigZag::Reader::readRegExp):
+
+2010-10-13 MORITA Hajime <morrita@google.com>
+
+ Reviewed by David Hyatt.
+
+ Navigating dark background websites results in blinding white flashes between pages.
+ https://bugs.webkit.org/show_bug.cgi?id=45640
+
+ This FOUC is caused by an early layout request before the <body> is ready,
+ and the page's background style given for <body>, instead of <html>.
+ So many sites have such stylesheets that we should care them.
+
+ - Some DOM operation such as 'element.offsetLeft' causes page layout.
+ - The page layout results page repaint
+ - The page page repaint makes a white screen. because there is nothing to paint
+ before <body> is available.
+
+ This change:
+ - extracted existing FOUC check on RenderBlock and RenderLayer to
+ Document::mayCauseFlashOfUnstyledContent(),
+ - checked <body> availability on mayCauseFlashOfUnstyledContent(), and
+ - added FOUC guards before requesting reapint on FrameView.
+
+ No new tests. The data loading speed matters and it cannot be
+ captured by DRT.
+
+ * dom/Document.cpp:
+ (WebCore::Document::mayCauseFlashOfUnstyledContent): Added.
+ * dom/Document.h:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::invalidateRect): Added a guard.
+ (WebCore::FrameView::repaintContentRectangle): Added a guard.
+ (WebCore::FrameView::doDeferredRepaints): Added a guard.
+ (WebCore::FrameView::shouldUpdate): Added.
+ * page/FrameView.h:
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintContents): Replaced FOUC check to use mayCauseFlashOfUnstyledContent
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::paintLayer): Replaced FOUC check to use mayCauseFlashOfUnstyledContent
+
+2010-10-29 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48618
+
+ Backgrounds should clip to the border radius properly for vertical lines. The code that does this still assumes horizontal lines.
+ The testcase to cover this used nested spans, which also exposed a bug in the propagation of the vertical bit through the line
+ box tree.
+
+ Added fast/blockflow/border-radius-clipping-vertical-lr.html.
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::createLineBoxes):
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+
+2010-10-26 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Kent Tamura.
+
+ Refactoring: Spellchecking related static functions could form a class
+ https://bugs.webkit.org/show_bug.cgi?id=48287
+
+ Extracted spellcheck related static functions to TextCheckingHelper class,
+ which has EditorClient and Range as its member.
+
+ No new tests. Just a refactoring.
+
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * editing/Editor.cpp:
+ (WebCore::Editor::advanceToNextMisspelling):
+ (WebCore::Editor::isSelectionUngrammatical):
+ (WebCore::Editor::guessesForUngrammaticalSelection):
+ (WebCore::Editor::guessesForMisspelledOrUngrammaticalSelection):
+ (WebCore::Editor::markMisspellingsAfterTypingToPosition):
+ (WebCore::Editor::markMisspellingsOrBadGrammar):
+ (WebCore::Editor::markMisspellings):
+ (WebCore::Editor::markBadGrammar):
+ (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
+ (WebCore::Editor::changeBackToReplacedString):
+ * editing/Editor.h:
+ * editing/TextCheckingHelper.cpp: Added.
+ (WebCore::TextCheckingHelper::TextCheckingHelper):
+ (WebCore::TextCheckingHelper::~TextCheckingHelper):
+ (WebCore::TextCheckingHelper::paragraphAlignedRange):
+ (WebCore::TextCheckingHelper::findFirstMisspelling):
+ (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
+ (WebCore::TextCheckingHelper::findFirstGrammarDetail):
+ (WebCore::TextCheckingHelper::findFirstBadGrammar):
+ (WebCore::TextCheckingHelper::isUngrammatical):
+ (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
+ (WebCore::TextCheckingHelper::markAllMisspellings):
+ (WebCore::TextCheckingHelper::markAllBadGrammar):
+ * editing/TextCheckingHelper.h: Added.
+
+2010-10-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel, Peter Kasting, and Darin Fisher.
+ (Eric reviewed the CoreGraphics interactions, Peter reviewed the image
+ decoder interaction, and Darin Fisher SGTMed the policy decision.)
+
+ [chromium] Chromium Mac should use WebKit's image decoders
+ https://bugs.webkit.org/show_bug.cgi?id=47974
+
+ This patch teaches WebKit's image decoders how to talk to CoreGraphics.
+ This patch doesn't handle color profiles, but that will come in a
+ subsequent patch.
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * loader/CachedImage.cpp:
+ (WebCore::CachedImage::createImage):
+ * platform/graphics/ImageSource.h:
+ * platform/image-decoders/ImageDecoder.cpp:
+ (WebCore::RGBA32Buffer::clear):
+ (WebCore::RGBA32Buffer::zeroFill):
+ (WebCore::RGBA32Buffer::copyBitmapData):
+ (WebCore::RGBA32Buffer::setSize):
+ * platform/image-decoders/ImageDecoder.h:
+ (WebCore::RGBA32Buffer::getAddr):
+ * platform/image-decoders/cg: Added.
+ * platform/image-decoders/cg/ImageDecoderCG.cpp: Added.
+ (WebCore::RGBA32Buffer::copyBitmapData):
+ (WebCore::RGBA32Buffer::setSize):
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+
+2010-10-28 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] GObject bindings generator issues
+ https://bugs.webkit.org/show_bug.cgi?id=48135
+
+ GObject code generator must not generate conditional API's. This
+ patch also adds an alternative return value for non-void
+ conditional methods. With this change the conditionalMethods hack
+ is no longer needed.
+
+ * bindings/scripts/CodeGeneratorGObject.pm:
+
+2010-10-28 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48569
+
+ Box shadows on vertical inlines don't paint properly. Fix the paintBoxShadow method to treat the edges to include as
+ logical (so that top/bottom are used instead of left/right for vertical lines). In order to make my box-shadow tests
+ work I had to fix a bug in the transform code of InlineTextBox that was causing the baselines of vertical lines to
+ be wrong.
+
+ Added fast/blockflow/box-shadow-* tests
+
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paint):
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintBoxShadow):
+ * rendering/RenderBoxModelObject.h:
+
+2010-10-28 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ iframes forced into slow scrolling mode by containing RenderLayer sometimes
+ https://bugs.webkit.org/show_bug.cgi?id=48570
+
+ Only performs the overlap test for RenderLayers that paint themselves. This
+ prevents marking RenderWidgets as being overlapped unnecessarily.
+
+ Test: fast/repaint/iframe-scroll-repaint.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::paintLayer):
+
+2010-10-28 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70814.
+ http://trac.webkit.org/changeset/70814
+ https://bugs.webkit.org/show_bug.cgi?id=48612
+
+ Caused media/controls-drag-timebar.html to fail on multiple
+ platforms (Requested by aroben on #webkit).
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::seek):
+ * platform/graphics/MediaPlayer.cpp:
+ * platform/graphics/MediaPlayer.h:
+ * platform/graphics/MediaPlayerPrivate.h:
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
+ * platform/graphics/win/QTMovie.cpp:
+ * platform/graphics/win/QTMovie.h:
+
+2010-10-28 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ <rdar://problem/8597430> Crash triggered by incremental layout of block truncated by line-clamp
+ https://bugs.webkit.org/show_bug.cgi?id=48602
+
+ Test: fast/flexbox/line-clamp-crash.html
+
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::applyLineClamp): Even if the child needs layout, call clearTruncation(),
+ since layout itself may be partial and not touch the truncated line (but touch its markup box).
+
+2010-10-28 Jian Li <jianli@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ [chromium] UUID generation does not work in Linux that has sandbox
+ turned on
+ https://bugs.webkit.org/show_bug.cgi?id=48571
+
+ This is because we cannot access /proc when sandbox is on. The fix is to
+ use random numbers to construct UUID.
+
+ * platform/UUID.cpp:
+ (WebCore::createCanonicalUUIDString):
+
+2010-10-28 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Editing a word with misspell or autocorrection underline should remove the underline when the editing changes the word.
+ https://bugs.webkit.org/show_bug.cgi?id=48078
+ <rdar://problem/8579155>
+
+ Tests: platform/mac/editing/spelling/editing-multiple-words-with-markers.html
+ platform/mac/editing/spelling/editing-word-with-marker-1.html
+ platform/mac/editing/spelling/editing-word-with-marker-2.html
+
+ This patch is part of on-going improvement of autocorrection feature on Mac OS X. When an editing
+ occurs, if it affects words (by deleting/inserting characters, spliting word, merging words) that
+ have Spelling and/or CorrectionIndicator markers, we want to remove the markers. If subsequntial
+ spelling checking finds spelling error in newlly formed words, it will add the markers back in.
+
+ * dom/DocumentMarker.h: Changed MarkerType to bit masks to make search multiple types easier.
+
+ * dom/DocumentMarkerController.cpp: Refactored two removeMarkers() methods to support remove
+ markers with specific type from a node.
+ (WebCore::DocumentMarkerController::removeMarkers): Changed signature to remove marker with specific type.
+ (WebCore::DocumentMarkerController::removeMarkersFromMarkerMapVectorPair): Refactoring.
+ (WebCore::DocumentMarkerController::hasMarkers): Convenience method to search markers in range.
+
+ * dom/DocumentMarkerController.h: Added new methods and matched new signature of removeMarkers().
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::respondToChangedContents): Remove existing markers if the change formed new word.
+ (WebCore::Editor::cut): Remove markers on words that will be modified by this editing.
+ (WebCore::Editor::paste): Ditto.
+ (WebCore::Editor::pasteAsPlainText): Ditto.
+ (WebCore::Editor::removeSpellAndCorrectionMarkersFromWordsToBeEdited): Main logic for removing
+ markers on words affected by editing.
+
+ * editing/Editor.h: Added removeSpellAndCorrectionMarkersFromWordsToBeEdited(). Added
+ REMOVE_MARKERS_UPON_EDITING and SUPPORT_AUTOCORRECTION_PANEL macro to improve readability.
+
+ * editing/TypingCommand.cpp:
+ (WebCore::TypingCommand::insertText): Remove markers on words that will be modified by this editing.
+ (WebCore::TypingCommand::deleteKeyPressed): Ditto.
+ (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
+
+2010-10-28 Brian Weinstein <bweinstein@apple.com>
+
+ Reviewed by Brady Eidson.
+
+ Part of <https://bugs.webkit.org/show_bug.cgi?id=45980>
+ userscripts/user-script-*-document.html tests are flaky on Windows
+
+ In WebFrameLoaderClient::committedLoad on Windows, we call through to PluginStream::didRecieveData
+ if our manual loader is a plugin stream, and we can call didRecieveData with a 0 length.
+
+ We shouldn't ASSERT that length is 0, because code paths exists where we call it with a 0 length.
+
+ This is tested by re-enabling user-script-plugin-document.html on Windows.
+
+ * plugins/PluginStream.cpp:
+ (WebCore::PluginStream::didReceiveData):
+
+2010-10-28 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ [Chromium] History related tests REGRESSED after r70723
+ https://bugs.webkit.org/show_bug.cgi?id=48513
+
+ Remove backItem(), forwardItem() and currentItem() from the Chromium
+ BackForwardList implementation, since they can use the base class
+ behavior now (which call itemAtIndex with -1, 1, and 0 respectively).
+
+ * history/BackForwardList.h:
+ * history/BackForwardListChromium.cpp:
+
+2010-10-28 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Tony Chang.
+
+ chrome.dll!WebCore::Node::shadowAncestorNode ReadAV@NULL (98643190851b5662363449cc7303d8a5)
+ https://bugs.webkit.org/show_bug.cgi?id=47888
+
+ The crash was caused by the while loop in ApplyStyleCommand::fixRangeAndApplyInlineStyle
+ not considering the case where startNode is the root editable element.
+ Fixed the bug by not entering the loop when startNode is the editable root.
+
+ Test: editing/style/fix-range-from-root-editable-crash.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
+
+2010-10-28 Noam Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Texmap] [Qt] Texture mapper initial implementation
+ https://bugs.webkit.org/show_bug.cgi?id=47070
+
+ Build fix, some wrong changes slipped into the previous patch.
+ No new tests: build fix.
+
+ * platform/graphics/GraphicsLayer.h:
+ * platform/graphics/opengl/TextureMapperGL.cpp:
+ (WebCore::BitmapTextureGL::setContentsToImage):
+ * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
+ (WebCore::TextureMapperNode::uploadTextureFromContent):
+ (WebCore::TextureMapperNode::paintRecursive):
+ * platform/qt/QWebPageClient.h:
+ (QWebPageClient::setRootGraphicsLayer):
+
+2010-10-28 David Hyatt <hyatt@apple.com>
+
+ Reviewed by James Robinson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48568
+
+ Backgrounds don't work right with vertical RenderInlines. Make background painting
+ do the right thing for vertical strips.
+
+ Added fast/blockflow/background-* tests
+
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paintFillLayer):
+
+2010-10-28 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Seeking by very small increment doesn't generate 'seeked' event
+ https://bugs.webkit.org/show_bug.cgi?id=48530
+
+ Test: media/video-seek-by-small-increment.html
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::seek): Ask the media engine for its closest time value so we can
+ avoid asking it to seek to the current time.
+
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::MediaPlayer::mediaTimeForTimeValue): New.
+ * platform/graphics/MediaPlayer.h:
+ * platform/graphics/MediaPlayerPrivate.h:
+ (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValue): Ditto.
+
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+ (WebCore::MediaPlayerPrivate::mediaTimeForTimeValue): Return the closest value in the movie's time scale.
+
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::mediaTimeForTimeValue): Ditto
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
+
+ * platform/graphics/win/QTMovie.cpp:
+ (QTMovie::timeScale): Return the movie's time scale.
+ * platform/graphics/win/QTMovie.h:
+
+2010-10-28 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48443
+
+ Border images don't work right with vertical RenderInlines. Make border/mask/background painting
+ do the right thing for vertical strips.
+
+ Added fast/blockflow/border-image-* tests.
+
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paintBoxDecorations):
+ (WebCore::InlineFlowBox::paintMask):
+
+2010-10-28 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Port ContextMenuItemWin.cpp to WinCE
+ https://bugs.webkit.org/show_bug.cgi?id=48407
+
+ * platform/win/ContextMenuItemWin.cpp:
+
+2010-10-28 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ queryCommandValue should fall back to queryCommandState
+ https://bugs.webkit.org/show_bug.cgi?id=48479
+
+ Added a fallback to Command::value so that commands with a state function without a value function
+ returns the value returned by the state function as a string.
+
+ * editing/EditorCommand.cpp:
+ (WebCore::Editor::Command::value):
+
+2010-10-28 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed. Rolling out r70800.
+
+2010-10-28 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48551
+ HTMLDocument::isFrameSet() should not depend on renderer
+
+ No change in functionality, so no new tests.
+
+ * html/HTMLDocument.cpp: (WebCore::HTMLDocument::isFrameSet): Omit the check for renderer.
+
+ * rendering/RenderLayer.h: Removed unneeded includes and forward declarations.
+
+2010-10-28 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: make legacy resource tracking optional in the native code,
+ make cookeis work against new resource manager.
+ https://bugs.webkit.org/show_bug.cgi?id=48532
+
+ * inspector/InspectorCSSStore.cpp:
+ (WebCore::InspectorCSSStore::resourceStyleSheetText):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::~InspectorController):
+ (WebCore::InspectorController::connectFrontend):
+ (WebCore::InspectorController::releaseFrontendLifetimeAgents):
+ (WebCore::InspectorController::populateScriptObjects):
+ (WebCore::InspectorController::unbindAllResources):
+ (WebCore::InspectorController::didCommitLoad):
+ (WebCore::InspectorController::frameDetachedFromParent):
+ (WebCore::InspectorController::didLoadResourceFromMemoryCache):
+ (WebCore::InspectorController::identifierForInitialRequest):
+ (WebCore::InspectorController::willSendRequest):
+ (WebCore::InspectorController::markResourceAsCached):
+ (WebCore::InspectorController::didReceiveResponse):
+ (WebCore::InspectorController::didReceiveContentLength):
+ (WebCore::InspectorController::didFinishLoading):
+ (WebCore::InspectorController::didFailLoading):
+ (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest):
+ (WebCore::InspectorController::scriptImported):
+ (WebCore::InspectorController::setResourceTrackingEnabled):
+ (WebCore::InspectorController::getCookies):
+ (WebCore::InspectorController::deleteCookie):
+ (WebCore::InspectorController::didCreateWebSocket):
+ (WebCore::InspectorController::willSendWebSocketHandshakeRequest):
+ (WebCore::InspectorController::didReceiveWebSocketHandshakeResponse):
+ (WebCore::InspectorController::didCloseWebSocket):
+ (WebCore::InspectorController::breakpointsSettingKey):
+ (WebCore::InspectorController::getResourceContent):
+ * inspector/InspectorController.h:
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::updateScriptObject):
+ (WebCore::InspectorResource::markFailed):
+ * inspector/InspectorResource.h:
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::populateObjectWithFrameResources):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype._mimeTypeIsConsistentWithType):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager.prototype._updateResourceWithResponse):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ * inspector/front-end/inspector.js:
+ (WebInspector.updateResource):
+
+2010-10-28 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: fix pausing on next JavaScript statement
+ https://bugs.webkit.org/show_bug.cgi?id=48534
+
+ * inspector/InspectorDebuggerAgent.cpp:
+ (WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
+ (WebCore::InspectorDebuggerAgent::schedulePauseOnNextStatement):
+ (WebCore::InspectorDebuggerAgent::cancelPauseOnNextStatement):
+ (WebCore::InspectorDebuggerAgent::pause):
+ (WebCore::InspectorDebuggerAgent::didPause):
+ * inspector/InspectorDebuggerAgent.h:
+
+2010-10-28 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by David Hyatt.
+
+ Fix for Bug 14550 - Non-layout style change does not update nested first-letter
+ https://bugs.webkit.org/show_bug.cgi?id=14550
+
+ If a render text fragment is accompanied by a first letter, update the
+ first letter's style when the fragment's style is changed.
+
+ Test: fast/css/first-letter-nested.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::styleDidChange): Stop calling updateFirstLetter
+ from here.
+ * rendering/RenderBlock.h: Make updateFirstLetter accessbile from
+ RenderTextFragment.
+ * rendering/RenderTextFragment.cpp:
+ (WebCore::RenderTextFragment::styleDidChange): If appropriate, update
+ first letter after removing stale cached pseudo style.
+ (WebCore::RenderTextFragment::blockForAccompanyingFirstLetter): Helper
+ to get the block for the first letter.
+ * rendering/RenderTextFragment.h:
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::removeCachedPseudoStyle): Remove the specified
+ pseudo style from cache.
+ * rendering/style/RenderStyle.h:
+
+2010-10-28 Benoit Jacob <bjacob@mozilla.com>
+
+ Reviewed by Kenneth Russell.
+
+ Ensure that WebGL stencil buffers are correctly initialized
+ https://bugs.webkit.org/show_bug.cgi?id=48351
+
+ * html/canvas/WebGLFramebuffer.cpp:
+ (WebCore::WebGLFramebuffer::initializeRenderbuffers):
+
+2010-10-28 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ AX: multi select group option does not handle setting of AXSelectedChildren correctly
+ https://bugs.webkit.org/show_bug.cgi?id=48464
+
+ Ensure that when selecting an item from a <select> element, it accounts for <optgroups>.
+
+ Test: platform/mac/accessibility/select-element-selection-with-optgroups.html
+
+ * accessibility/AccessibilityListBoxOption.cpp:
+ (WebCore::AccessibilityListBoxOption::setSelected):
+
+2010-10-28 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Adam Roben.
+
+ No longer soft-link zlib
+ https://bugs.webkit.org/show_bug.cgi?id=48004
+
+ * platform/graphics/WOFFFileFormat.cpp:
+ (WebCore::convertWOFFToSfnt): Removed Windows-speciific code to soft-link
+ zlib.
+
+2010-10-27 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Work around a Mac driver bug in generateMipmap
+ https://bugs.webkit.org/show_bug.cgi?id=48489
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::generateMipmap): Make sure minFilter is set to NEAREST_MIPMAP_LINEAR before generateMipmap, and after the call, set it back to the original value.
+ * html/canvas/WebGLTexture.h:
+ (WebCore::WebGLTexture::getMinFilter): Return the cached minFilter value.
+
+2010-10-28 Mikhail Naganov <mnaganov@chromium.org>
+
+ [Chromium clang] Unreviewed. Fix forward declaration of 'struct FileMetadata'.
+
+ See http://build.chromium.org/p/chromium.fyi/builders/Chromium%20Linux%20Debug%20Clang/builds/753/steps/compile/logs/stdio
+
+ * fileapi/FileSystemCallbacks.h:
+ * platform/AsyncFileSystemCallbacks.h:
+
+2010-10-28 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Bring backend-frontend message format to follow the protocol specification
+ https://bugs.webkit.org/show_bug.cgi?id=48406
+
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::getStyles):
+ (WebCore::InspectorDOMAgent::applyStyleText):
+ (WebCore::InspectorDOMAgent::buildObjectForStyle):
+ (WebCore::InspectorDOMAgent::populateObjectWithStyleProperties):
+ (WebCore::InspectorDOMAgent::buildObjectForStyleSheet):
+ (WebCore::InspectorDOMAgent::buildObjectForRule):
+ * inspector/InspectorDOMAgent.h:
+ * inspector/front-end/AuditRules.js:
+ (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback.selectorsCallback):
+ (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun):
+ * inspector/front-end/CSSStyleModel.js:
+ (WebInspector.CSSStyleModel.parseRuleArrayPayload):
+ (WebInspector.CSSStyleModel.prototype.getStylesAsync):
+ (WebInspector.CSSStyleModel.prototype.getComputedStyleAsync):
+ (WebInspector.CSSStyleModel.prototype.getInlineStyleAsync):
+ (WebInspector.CSSStyleModel.prototype.setCSSText):
+ * inspector/front-end/DOMAgent.js:
+ (WebInspector.CSSStyleDeclaration):
+ (WebInspector.CSSStyleDeclaration.parsePayload):
+ (WebInspector.CSSStyleDeclaration.prototype.get allProperties):
+ (WebInspector.CSSStyleDeclaration.prototype.getLiveProperty):
+ (WebInspector.CSSStyleDeclaration.prototype.getPropertyValue):
+ (WebInspector.CSSStyleDeclaration.prototype.getPropertyPriority):
+ (WebInspector.CSSStyleDeclaration.prototype.getPropertyShorthand):
+ (WebInspector.CSSStyleDeclaration.prototype.isPropertyImplicit):
+ (WebInspector.CSSStyleDeclaration.prototype.getShorthandValue):
+ (WebInspector.CSSStyleDeclaration.prototype.getShorthandPriority):
+ (WebInspector.CSSStyleDeclaration.prototype.appendProperty):
+ (WebInspector.CSSStyleDeclaration.prototype.propertyAt):
+ (WebInspector.CSSRule):
+ (WebInspector.CSSRule.parsePayload):
+ (WebInspector.CSSRule.prototype.get isUserAgent):
+ (WebInspector.CSSRule.prototype.get isUser):
+ (WebInspector.CSSRule.prototype.get isViaInspector):
+ (WebInspector.CSSRule.prototype.get isRegular):
+ (WebInspector.CSSProperty):
+ (WebInspector.CSSProperty.parsePayload):
+ (WebInspector.CSSProperty.prototype.get propertyText):
+ (WebInspector.CSSProperty.prototype.get isLive):
+ (WebInspector.CSSProperty.prototype.get active):
+ (WebInspector.CSSProperty.prototype.get styleBased):
+ (WebInspector.CSSProperty.prototype.get inactive):
+ (WebInspector.CSSProperty.prototype.get disabled):
+ (WebInspector.CSSProperty.prototype.setText):
+ (WebInspector.CSSProperty.prototype.setValue):
+ (WebInspector.CSSProperty.prototype.setDisabled.callback):
+ (WebInspector.CSSProperty.prototype.setDisabled):
+ * inspector/front-end/MetricsSidebarPane.js:
+ (WebInspector.MetricsSidebarPane.prototype.update.callback):
+ (WebInspector.MetricsSidebarPane.prototype.update.inlineStyleCallback):
+ (WebInspector.MetricsSidebarPane.prototype.update):
+ (WebInspector.MetricsSidebarPane.prototype._update):
+ (WebInspector.MetricsSidebarPane.prototype.editingCommitted.callback):
+ (WebInspector.MetricsSidebarPane.prototype.editingCommitted.setEnabledValueCallback):
+ (WebInspector.MetricsSidebarPane.prototype.editingCommitted):
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylesSidebarPane.prototype.update):
+ (WebInspector.StylesSidebarPane.prototype._rebuildUpdate):
+ (WebInspector.StylesSidebarPane.prototype._refreshStyleRules):
+ (WebInspector.StylesSidebarPane.prototype._rebuildStyleRules):
+ (WebInspector.StylesSidebarPane.prototype._markUsedProperties):
+ (WebInspector.StylesSidebarPane.prototype._containsInherited):
+ (WebInspector.StylePropertiesSection):
+ (WebInspector.StylePropertiesSection.prototype.isPropertyInherited):
+ (WebInspector.StylePropertiesSection.prototype.isPropertyOverloaded):
+ (WebInspector.StylePropertiesSection.prototype.onpopulate):
+ (WebInspector.StylePropertiesSection.prototype.addNewBlankProperty):
+ (WebInspector.StylePropertiesSection.prototype.editingSelectorCommitted.successCallback):
+ (WebInspector.StylePropertiesSection.prototype.editingSelectorCommitted):
+ (WebInspector.ComputedStylePropertiesSection.prototype._isPropertyInherited):
+ (WebInspector.ComputedStylePropertiesSection.prototype.onpopulate):
+ (WebInspector.ComputedStylePropertiesSection.prototype.rebuildComputedTrace):
+ (WebInspector.StylePropertyTreeElement):
+ (WebInspector.StylePropertyTreeElement.prototype.get disabled):
+ (WebInspector.StylePropertyTreeElement.prototype.get name):
+ (WebInspector.StylePropertyTreeElement.prototype.get priority):
+ (WebInspector.StylePropertyTreeElement.prototype.get value):
+ (WebInspector.StylePropertyTreeElement.prototype.get parsedOk):
+ (WebInspector.StylePropertyTreeElement.prototype):
+ (WebInspector.StylePropertyTreeElement.prototype.):
+
+2010-10-27 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Kent Tamura.
+
+ WebKit needs to expose an Element::spellcheck attribute to javascript.
+ https://bugs.webkit.org/show_bug.cgi?id=25536
+
+ Published Element.spellcheck property on IDL, implemented it.
+
+ Tests: editing/spelling/spelling-attribute-change.html
+ fast/dom/HTMLElement/spellcheck.html
+
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::spellcheck):
+ (WebCore::HTMLElement::setSpellcheck):
+ * html/HTMLElement.h:
+ * html/HTMLElement.idl:
+
+2010-10-27 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: make debugger work against new resource manager.
+ https://bugs.webkit.org/show_bug.cgi?id=48376
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::identifierForInitialRequest):
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::InspectorResourceAgent::identifierForInitialRequest):
+ * inspector/InspectorResourceAgent.h:
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onGetResourceContent):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.set content):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager):
+ (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
+ (WebInspector.ResourceManager.prototype._createResource):
+ (WebInspector.ResourceManager.prototype.willSendRequest):
+ (WebInspector.ResourceManager.prototype._updateResourceWithRequest):
+ (WebInspector.ResourceManager.prototype.didFinishLoading):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ (WebInspector.ResourceManager.prototype.setOverrideContent):
+ (WebInspector.ResourceManager.prototype._processCachedResources):
+ (WebInspector.ResourceManager.prototype._addFramesRecursively):
+ (WebInspector.ResourceManager.prototype.resourceForURL):
+ (WebInspector.ResourceManager.prototype.addConsoleMessage):
+ (WebInspector.ResourceManager.prototype.clearConsoleMessages):
+ (WebInspector.ResourceManager.prototype.forAllResources):
+ (WebInspector.ResourceManager.prototype._bindResourceURL):
+ (WebInspector.ResourceManager.prototype._unbindResourceURL):
+ (WebInspector.ResourceManager.getContent):
+ (WebInspector.ResourceTreeModel):
+ (WebInspector.ResourceTreeModel.prototype.didCommitLoadForFrame):
+ (WebInspector.ResourceTreeModel.prototype.addResourceToFrame):
+ (WebInspector.ResourceTreeModel.prototype._clearResources):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel.prototype.addOrUpdateFrame):
+ * inspector/front-end/networkPanel.css:
+ (.network.panel .resources-dividers):
+
+2010-10-28 Andy Estes <aestes@apple.com>
+
+ One more Qt fix due to r70754.
+
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::hasValidClassId):
+
+2010-10-28 Pascal Massimino <pascal.massimino@gmail.com>
+
+ Reviewed by Adam Barth.
+
+ fix setSize() call flow: it was only called the first
+ time (when onlySize is true)
+ Bug URL: https://bugs.webkit.org/show_bug.cgi?id=48494
+
+ Testing: difficult to exercise the bug, as it requires
+ some manual flow (change tab, scroll,...)
+
+ * platform/image-decoders/webp/WEBPImageDecoder.cpp:
+ (WebCore::WEBPImageDecoder::decode):
+ fix: call setSize() even when onlySize is false
+
+2010-10-28 Andy Estes <aestes@apple.com>
+
+ Fix the Qt build after r70754.
+
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::hasValidClassId):
+ (WebCore::HTMLObjectElement::updateWidget):
+ * html/HTMLObjectElement.h:
+
+2010-10-28 Andy Estes <aestes@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Fix a test failure introduced in r70748 by supporting Qt's non-standard
+ use of classid.
+ https://bugs.webkit.org/show_bug.cgi?id=45679
+
+ * html/HTMLObjectElement.cpp:
+ (WebCore::objectHasSupportedClassId): Return true if the object's
+ serviceType is 'application/x-qt-plugin'.
+ (WebCore::HTMLObjectElement::updateWidget): Do not render fallback
+ content if a non-empty classid is specified for a Qt plugin object.
+
+2010-10-28 Ivan Krstić <ike@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Remove unused experimental proxied panel interface.
+ <rdar://problem/7237059>
+
+ * WebCore.exp.in:
+ * platform/mac/WebCoreSystemInterface.h:
+ * platform/mac/WebCoreSystemInterface.mm:
+
+2010-10-27 Andy Estes <aestes@apple.com>
+
+ Reviewed by Adam Barth.
+
+ r66156 broke AtlasCT library, formerly affected http://map.d.co.il/
+ https://bugs.webkit.org/show_bug.cgi?id=45679
+
+ This patch removes WebKit's map of classid values to MIME types. It also
+ changes the behavior of object elements to render fallback content when
+ a non-empty classid attribute is specified, which is the behavior HTML5
+ specifies when a UA encounters a classid it doesn't understand.
+
+ Test: fast/replaced/object-with-non-empty-classid-triggers-fallback.html
+
+ * html/HTMLObjectElement.cpp: Remove serviceTypeForClassId(),
+ createClassIdToTypeMap(), and the ClassIdToTypeMap typedef.
+ (WebCore::HTMLObjectElement::updateWidget): Do not call
+ serviceTypeForClassId() when there is no type attribute, and render
+ fallback content if the classid attribute is non-empty.
+
+2010-10-27 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by David Levin.
+
+ [Chromium] Metadata queries should return full file info, not just modification time
+ https://bugs.webkit.org/show_bug.cgi?id=48098
+
+ LayoutTests that use this functionality via WorkerAsyncFileWriter are in review.
+
+ Build file changes to add FileMetadata.
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+
+ The rest of the changes here just pass the new FileMetadata object through calls that used to take a modification time.
+ * platform/FileMetadata.h: Added.
+ (WebCore::FileMetadata::FileMetadata):
+ * fileapi/FileSystemCallbacks.cpp:
+ (WebCore::FileSystemCallbacksBase::didReadMetadata):
+ (WebCore::MetadataCallbacks::didReadMetadata):
+ * fileapi/FileSystemCallbacks.h:
+ * platform/AsyncFileSystemCallbacks.h:
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add VectorMath files
+ https://bugs.webkit.org/show_bug.cgi?id=48467
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/VectorMath.cpp: Added.
+ (WebCore::VectorMath::vsmul):
+ (WebCore::VectorMath::vadd):
+ * platform/audio/VectorMath.h: Added.
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Fixup files affected by VectorMath and related API changes
+ https://bugs.webkit.org/show_bug.cgi?id=48481
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/AudioBus.cpp:
+ * platform/audio/AudioChannel.cpp:
+ * platform/audio/Biquad.cpp:
+ * platform/audio/FFTConvolver.cpp:
+ * platform/audio/FFTConvolver.h:
+ * platform/audio/Panner.cpp:
+ (WebCore::Panner::create):
+ * platform/audio/Reverb.cpp:
+ (WebCore::calculateNormalizationScale):
+ (WebCore::Reverb::initialize):
+ (WebCore::Reverb::process):
+ * platform/audio/ReverbAccumulationBuffer.cpp:
+ * platform/audio/ReverbAccumulationBuffer.h:
+ * platform/audio/ReverbConvolver.cpp:
+ (WebCore::ReverbConvolver::ReverbConvolver):
+ (WebCore::ReverbConvolver::process):
+ * platform/audio/ReverbConvolver.h:
+ * platform/audio/ReverbConvolverStage.cpp:
+ (WebCore::ReverbConvolverStage::ReverbConvolverStage):
+ * platform/audio/ReverbConvolverStage.h:
+ * platform/audio/ReverbInputBuffer.h:
+
+2010-10-27 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ DOMFileSystem's reference should be kept while there're any active Entries/callbacks
+ https://bugs.webkit.org/show_bug.cgi?id=47535
+
+ Changed to keep DOMFileSystem's reference in each EntryBase, DirectoryReaderBase, EntryCallbacks and EntriesCallbacks.
+
+ Test: fast/filesystem/filesystem-reference.html
+
+ * fileapi/DOMFileSystemBase.cpp:
+ (WebCore::DOMFileSystemBase::readDirectory): Changed to pass/take
+ PassRefPtr but not a raw pointer.
+ * fileapi/DOMFileSystemBase.h:
+ * fileapi/DirectoryEntry.cpp:
+ (WebCore::DirectoryEntry::DirectoryEntry): Ditto.
+ (WebCore::DirectoryEntry::createReader):
+ * fileapi/DirectoryEntry.h:
+ (WebCore::DirectoryEntry::create): Ditto.
+ * fileapi/DirectoryEntrySync.cpp:
+ (WebCore::DirectoryEntrySync::DirectoryEntrySync): Ditto.
+ * fileapi/DirectoryEntrySync.h:
+ (WebCore::DirectoryEntrySync::create): Ditto.
+ * fileapi/DirectoryReader.h:
+ (WebCore::DirectoryReader::filesystem):
+ * fileapi/DirectoryReaderBase.h:
+ (WebCore::DirectoryReaderBase::filesystem):
+ * fileapi/Entry.cpp:
+ (WebCore::Entry::Entry): Ditto.
+ * fileapi/Entry.h:
+ (WebCore::Entry::filesystem):
+ * fileapi/EntryBase.h:
+ (WebCore::EntryBase::filesystem):
+ (WebCore::EntryBase::EntryBase): Ditto.
+ * fileapi/EntrySync.cpp:
+ (WebCore::EntrySync::create): Ditto.
+ (WebCore::EntrySync::getParent):
+ (WebCore::EntrySync::EntrySync): Ditto.
+ * fileapi/EntrySync.h:
+ (WebCore::EntrySync::filesystem):
+ * fileapi/FileEntry.cpp:
+ (WebCore::FileEntry::FileEntry): Ditto.
+ * fileapi/FileEntry.h:
+ (WebCore::FileEntry::create): Ditto.
+ * fileapi/FileEntrySync.cpp:
+ (WebCore::FileEntrySync::FileEntrySync): Ditto.
+ * fileapi/FileEntrySync.h:
+ (WebCore::FileEntrySync::create): Ditto.
+ * fileapi/FileSystemCallbacks.cpp:
+ (WebCore::EntriesCallbacks::create): Ditto.
+ (WebCore::EntriesCallbacks::EntriesCallbacks): Ditto.
+ * fileapi/FileSystemCallbacks.h:
+
+2010-10-27 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Eric Seidel.
+
+ Fix for Bug 48310 - SVG font-face-name without name attribute causes a crash
+ https://bugs.webkit.org/show_bug.cgi?id=48310
+
+ Test: svg/custom/font-face-name-without-name-attr.svg
+
+ * svg/SVGFontFaceElement.cpp:
+ (WebCore::SVGFontFaceElement::rebuildFontFace): Don't create src
+ property if the src value list is empty.
+ * svg/SVGFontFaceSrcElement.cpp:
+ (WebCore::SVGFontFaceSrcElement::srcValue): Don't add empty src
+ values to the src value list.
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Allow AudioDSPKernel to function without an AudioDSPKernelProcessor
+ https://bugs.webkit.org/show_bug.cgi?id=48472
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/AudioDSPKernel.h:
+ (WebCore::AudioDSPKernel::AudioDSPKernel):
+ (WebCore::AudioDSPKernel::sampleRate):
+
+2010-10-27 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Support Appkit key bindings and custom key bindings in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=48271
+ <rdar://problem/7660723>
+
+ * dom/KeyboardEvent.h:
+ (WebCore::KeypressCommand::KeypressCommand): Added default constructor and modified assert for text
+ insertion command constructor to support WebKit2 scenarios.
+ The default constructor is needed to support the generated WebKit2 message processing code.
+
+2010-10-26 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
+ https://bugs.webkit.org/show_bug.cgi?id=42322
+ rdar://problem/8193631
+
+ WebKitTestRunner needs to support layoutTestController.clearBackForwardList
+ https://bugs.webkit.org/show_bug.cgi?id=42333
+ rdar://problem/8193643
+
+ * WebCore.exp.in: Updated exports.
+
+ * history/BackForwardList.h: Added comments about future refactoring.
+ Moved functions that are not called inside WebCore into a separate
+ section, to be removed later. Added an isActive function to replace the
+ use of enabled() and entries().
+
+ * history/BackForwardListImpl.h: Removed isBackForwardListImpl.
+ Marked virtual function overrides virtual explicitly, except for the
+ ones that will be non-virtual once we make the changes above.
+ Added the isActive function.
+
+ * history/PageCache.cpp:
+ (WebCore::logCanCachePageDecision): Use isActive.
+ (WebCore::PageCache::canCache): Ditto.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::checkDidPerformFirstNavigation): Check
+ using currentItem, backItem, and forwardItem instead of
+ using entries.
+
+ * page/Settings.cpp:
+ (WebCore::Settings::setUsesPageCache): Loop through the back/forward
+ list entries using backListCount and forwardListCount instead of
+ using entries.
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Chris Marrin.
+
+ Add ENABLE_WEB_AUDIO feature enable flag (initially disabled) to build-webkit
+ https://bugs.webkit.org/show_bug.cgi?id=48279
+
+ No new tests since flag is disabled.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add AudioResamplerKernel files
+ https://bugs.webkit.org/show_bug.cgi?id=47624
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/AudioResamplerKernel.cpp: Added.
+ (WebCore::AudioResamplerKernel::AudioResamplerKernel):
+ (WebCore::AudioResamplerKernel::getSourcePointer):
+ (WebCore::AudioResamplerKernel::process):
+ (WebCore::AudioResamplerKernel::reset):
+ (WebCore::AudioResamplerKernel::rate):
+ * platform/audio/AudioResamplerKernel.h: Added.
+
+2010-10-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Ojan Vafai.
+
+ REGRESSION(66511): CORDYS Process Factory doesn't work
+ https://bugs.webkit.org/show_bug.cgi?id=48453
+
+ When Ojan refactored this function in 66511, he missed an "else",
+ which causes us to generated HIERARCHY_REQUEST_ERR in some cases where
+ we're not supposed to. This patch restores the "else" behavior (using
+ an early return) and adds a test for the cases that caused problems in
+ the field.
+
+ Test: fast/dom/allowed-children.html
+
+ * dom/Node.cpp:
+ (WebCore::isChildTypeAllowed):
+
+2010-10-27 Beth Dakin <bdakin@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=48385 Add WebKit
+ SPI to scale a WebView
+ -and corresponding-
+ <rdar://problem/8107667>
+
+ This patch adds SPI to Mac WebKit that scales the page by the given
+ scale factor. The scale factor is factored into the RenderStyle's
+ transform.
+
+ Set the current pageScale for the document.
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::styleForDocument):
+
+ Frame keeps track of the page scale factor. When
+ scalePage() is called, it modifies the RenderView's style to
+ include a transform of the appropriate scale and forces a style
+ recalc.
+ * page/Frame.cpp:
+ (WebCore::Frame::Frame):
+ (WebCore::Frame::scalePage):
+ * page/Frame.h:
+ (WebCore::Frame::pageScaleFactor):
+ * WebCore.exp.in:
+
+ Add a scale to the transformation matrix.
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::setPageScaleTransform):
+ * rendering/style/RenderStyle.h:
+
+2010-10-27 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r70335): Incorrect article layout in Safari Reader
+ https://bugs.webkit.org/show_bug.cgi?id=48436
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::getMatchedCSSRules): Return rules from all origins if the cross-origin
+ check is disabled.
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings): Initialize m_crossOriginCheckInGetMatchedCSSRulesDisabled.
+ * page/Settings.h:
+ (WebCore::Settings::setCrossOriginCheckInGetMatchedCSSRulesDisabled): Added this accessor.
+ (WebCore::Settings::crossOriginCheckInGetMatchedCSSRulesDisabled): Ditto.
+
+2010-10-27 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ refactor the nested large switch statements in GraphicsContext3DCG.cpp:getImageData()
+ https://bugs.webkit.org/show_bug.cgi?id=47027
+
+ * platform/graphics/GraphicsContext3D.cpp:
+ (WebCore::doPacking): ASSERT false if undefined format is passed in.
+ * platform/graphics/GraphicsContext3D.h: Add kSourceFormatUndefined enum.
+ * platform/graphics/cg/GraphicsContext3DCG.cpp:
+ (WebCore::getSourceDataFormat): Decide source data format from componentsPerPixel, alpha format, bitsPerComponet, etc.
+ (WebCore::GraphicsContext3D::getImageData): Refactor the code to use getSourceDataFormat and remove nested switches.
+
+2010-10-27 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Use WTF::StringHasher::createBlobHash where possible
+ https://bugs.webkit.org/show_bug.cgi?id=48228
+
+ Replace StringImpl::computeHash with StringHasher::createBlobHash.
+ This removes many duplicated code.
+
+ * bindings/js/JSSVGPODTypeWrapper.h:
+ (WebCore::PODTypeWrapperCacheInfoHash::hash):
+ * page/SecurityOriginHash.h:
+ (WebCore::SecurityOriginHash::hash):
+ * platform/cf/SchedulePair.h:
+ (WebCore::SchedulePairHash::hash):
+ * platform/graphics/FontCache.cpp:
+ (WebCore::computeHash):
+ * platform/graphics/chromium/FontPlatformDataChromiumWin.h:
+ (WebCore::FontPlatformData::RefCountedHFONT::hash):
+ * platform/graphics/cocoa/FontPlatformData.h:
+ (WebCore::FontPlatformData::hash):
+ * platform/graphics/gtk/FontPlatformDataPango.h:
+ (WebCore::FontPlatformData::hash):
+ * platform/graphics/wince/FontPlatformData.cpp:
+ (WebCore::FixedSizeFontDataKeyHash::hash):
+ * platform/graphics/wx/FontPlatformDataWx.cpp:
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::computeHash):
+ * plugins/PluginPackage.cpp:
+ (WebCore::PluginPackage::hash):
+ * plugins/win/PluginPackageWin.cpp:
+ (WebCore::PluginPackage::hash):
+ * svg/DeprecatedSVGAnimatedTemplate.h:
+ (WebCore::DeprecatedSVGAnimatedTypeWrapperKeyHash::hash):
+ * svg/properties/SVGAnimatedPropertyDescription.h:
+ (WebCore::SVGAnimatedPropertyDescriptionHash::hash):
+
+2010-10-27 Tony Chang <tony@chromium.org>
+
+ Unreviewed, build fix after r70692.
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintBorder):
+
+2010-10-27 Leandro Pereira <leandro@profusion.mobi>
+
+ Unreviewed. Build fix after r70651.
+
+ * CMakeListsEfl.txt: Add SoupURIUtils.cpp.
+
+2010-10-27 Crystal Zhang <haizhang@rim.com>
+
+ Reviewed by Eric Carlson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48446
+
+ Fix an issue where we were passing the wrong parameter
+ to MIMETypeRegistry::getMIMETypeForExtension().
+
+ * platform/MIMETypeRegistry.cpp:
+
+2010-10-27 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48449
+
+ Make border drawing work correctly with vertical inline flows. The top and bottom edge have to be omitted
+ rather than the left and right edges.
+
+ Also discovered that border-radius is broken with the new path-based-drawing code for all inline flows. This
+ is a regression from the old drawing code. I patched the code to be correct rather than clipping out stuff
+ that it shouldn't and applying border-radii on lines that don't even have them.
+
+ Added fast/blockflow/border-vertical-lr.html and fast/borders/border-radius-inline-flow.html
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintBorder):
+ (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
+ * rendering/RenderBoxModelObject.h:
+
+2010-10-27 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [Cairo] Font fallback determination is very ineffecient
+ https://bugs.webkit.org/show_bug.cgi?id=42052
+
+ When choosing a fallback font in FontCache::getFontDataForCharacters, use FontConfig's
+ mechanism for searching the fallback list directly, instead of scanning the list manually.
+ If the font is a custom font or any other font with no FontConfig pattern associated with
+ it, as FontConfig for a font that can supply the missing glyphs.
+
+ Test: platform/gtk/fonts/custom-font-missing-glyphs.html
+
+ * platform/graphics/cairo/FontCacheFreeType.cpp:
+ (WebCore::createFontConfigPatternForCharacters): Added this helper which turns
+ a collection of unicode characters into a FontConfig pattern.
+ (WebCore::findBestFontGivenFallbacks): Using a FontConfig pattern created with th
+ above helper and a FcFontSet of fallback fonts, this helper will find a font in
+ the set which fulfills the requirments.
+ (WebCore::FontCache::getFontDataForCharacters): Given an existing font with missing
+ glyphs, either find an appropriate fallback font from the list of FontConfig fallbacks
+ or ask FontConfig directly for an appropriate font.
+ * platform/graphics/cairo/FontPlatformDataFreeType.h: Made a member mutable, as it is
+ initialized lazily.
+
+2010-10-27 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: "Reload Page and Audit on Load" fails to run audits when resource tracking is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=48431
+
+ * inspector/front-end/AuditsPanel.js:
+ (WebInspector.AuditsPanel.prototype._reloadResources):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype._createPanelEnabler):
+ (WebInspector.ResourcesPanel.prototype._enableResourceTracking):
+
+2010-10-27 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ Add a function to make sure child is allowed before adding to a
+ render view.
+ https://bugs.webkit.org/show_bug.cgi?id=48328
+
+ Test: fast/inline/inline-child-height-width-calc-crash.html
+
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::isChildAllowed):
+ * rendering/RenderView.h:
+
+2010-10-27 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] r69296 includes a cast from GdkWindow* to GtkWindow*
+ https://bugs.webkit.org/show_bug.cgi?id=48445
+
+ Pass the pageClient GtkWidget* to gtk_xtbin_new instead of the
+ GdkWindow*. The pageClient is used to get the proper visual for the
+ plugin container widget.
+
+ No new tests. This patch should prevent plugins/null-npp-getvalue-pointer.html
+ from crashing.
+
+ * plugins/gtk/PluginViewGtk.cpp:
+ (WebCore::PluginView::platformStart): Pass the widget instead of the window.
+ * plugins/gtk/gtk2xtbin.c: Accept the widget instead of the window.
+ (gtk_xtbin_new):
+ * plugins/gtk/gtk2xtbin.h: Update the declaration.
+
+2010-10-27 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by James Robinson.
+
+ [BREWMP] Port graphics backend
+ https://bugs.webkit.org/show_bug.cgi?id=40275
+
+ Add PLATFORM(BREWMP) guard to skia's FontCustomPlatformData
+ to share OS(LINUX) implementation.
+
+ * loader/CachedFont.cpp:
+ * platform/graphics/skia/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ (WebCore::createFontCustomPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.h:
+
+2010-10-27 Satish Sampath <satish@chromium.org>
+
+ Unreviewed, rolling out r70665.
+ http://trac.webkit.org/changeset/70665
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ Need to address Alexey's review comments.
+
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::startRecognition):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h:
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::startRecognition):
+ (WebCore::SpeechInputClientMock::setRecognitionResult):
+ (WebCore::SpeechInputClientMock::timerFired):
+ * platform/mock/SpeechInputClientMock.h:
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::TextControlInnerElement::attachInnerElement):
+ (WebCore::SearchFieldCancelButtonElement::detach):
+ (WebCore::SpinButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::detach):
+
+2010-10-27 ZHenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Must enable GL_POINT_SPRITE in GraphicsContext3D implementations
+ https://bugs.webkit.org/show_bug.cgi?id=45908
+
+ * platform/graphics/mac/GraphicsContext3DMac.mm: Enable for Mac port.
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+
+2010-10-27 Leandro Gracia Gil <leandrogracia@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Patch the current speech input implementation to use the nearest
+ language tag. The language is now passed to the startRecognition
+ methods so that language-specific recognition could be used. Also added
+ a second parameter to setMockSpeechInputResult for the language used in
+ speech recognition.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ This is the 2nd of a 4-sided patch in Chromium and WebKit. For more
+ details see http://codereview.chromium.org/3615005/show and
+ http://codereview.chromium.org/3595018/show. The last of the 4 patches
+ depends also on the language tag validation provided by this patch:
+ https://bugs.webkit.org/show_bug.cgi?id=48225.
+
+ Test: fast/speech/input-text-language-tag.html
+
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::startRecognition):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h:
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::startRecognition):
+ (WebCore::SpeechInputClientMock::setRecognitionResult):
+ (WebCore::SpeechInputClientMock::timerFired):
+ * platform/mock/SpeechInputClientMock.h:
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::TextControlInnerElement::attachInnerElement):
+ (WebCore::SearchFieldCancelButtonElement::detach):
+ (WebCore::SpinButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::detach):
+
+2010-10-27 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48381
+
+ Make basic layer positioning work with vertical-lr writing-mode.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintChildren):
+ (WebCore::RenderBlock::paintFloats):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::adjustForFlippedBlocksWritingMode):
+ (WebCore::RenderBox::locationOffsetIncludingFlipping):
+ * rendering/RenderBox.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::updateLayerPosition):
+
+2010-10-27 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ object-deletion-behaviour.html fails with mesa backend
+ https://bugs.webkit.org/show_bug.cgi?id=46667
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter): If object_type is 0, we return early because object_name should be always be 0.
+
+2010-10-27 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ If WebGL is running on top of a strict version of OpenGL ES it should make sure attribs have buffers assigned at all times
+ https://bugs.webkit.org/show_bug.cgi?id=47964
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::validateRenderingState): Minimum checking: if input <= 0, only check if each enabled vertex attribute is bound to a buffer.
+ (WebCore::WebGLRenderingContext::drawArrays): If underlying GL performs bounds checking, we still need to do the minimum checking using validateRenderingState.
+ (WebCore::WebGLRenderingContext::drawElements): Ditto.
+ * html/canvas/WebGLRenderingContext.h: Add a comment for input <= 0 in validateRenderingState.
+
+2010-10-27 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Accelerated animation with missing values in keyframes is broken
+ https://bugs.webkit.org/show_bug.cgi?id=48395
+
+ r66339 changed the behavior of keyframe animations such that if a property
+ is missing from a keyframe, the property will be interpolated between those
+ keyframes that do have a value for the property. If a value is missing
+ from the first or last keyframes, the element's unanimated style supplies
+ that value.
+
+ However, accelerated animations had a bug where if a value was missing
+ from the first (and maybe subsequent) or last (and maybe preceding) keyframes,
+ the animation data given to the GraphicsLayer would be missing the style from the
+ first or final keyframe.
+
+ Tests: animations/missing-values-first-keyframe.html
+ animations/missing-values-last-keyframe.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::startAnimation):
+
+2010-10-27 Renata Hodovan <reni@inf.u-szeged.hu>
+
+ Reviewed by Dirk Schulze.
+
+ Calling the super class of RenderSVGImage::updateFromElement is missing
+ https://bugs.webkit.org/show_bug.cgi?id=48347
+
+ RenderSVGImage::updateFromElement is an inherited function of RenderSVGModelObject what needs calling its ancestor.
+ Lack of this call caused filters were not invalidated at SVGImage objects.
+
+ No new tests, because this modification is covered by SVGFEConvolveMatrixElement's dynamic update tests.
+
+ * rendering/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::updateFromElement):
+
+2010-10-27 Justin Schuh <jschuh@chromium.org>
+
+ Reviewed by Dirk Schulze.
+
+ Ignore invalid blend modes
+ https://bugs.webkit.org/show_bug.cgi?id=48371
+
+ Test: svg/filters/feBlend-invalid-mode.xhtml
+
+ * platform/graphics/filters/FEBlend.cpp:
+ (WebCore::FEBlend::apply):
+
+2010-10-27 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [Gtk] http/tests/xmlhttprequest/basic-auth-default.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=38956
+
+ Added a new utility function that turns SoupURIs into
+ KURLs. That addresses some issues with SoupURIs like for example
+ soup_uri_to_string ignoring the URI password. Basic authentication
+ using URL credentials should work now.
+
+ * GNUmakefile.am:
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ (WebCore::ResourceHandle::start):
+ (WebCore::ResourceHandle::loadResourceSynchronously):
+ * platform/network/soup/ResourceRequestSoup.cpp:
+ (WebCore::ResourceRequest::updateFromSoupMessage):
+ * platform/network/soup/ResourceResponseSoup.cpp:
+ (WebCore::ResourceResponse::updateFromSoupMessage):
+ * platform/network/soup/SoupURIUtils.cpp: Added.
+ (WebCore::soupURIToKURL):
+ * platform/network/soup/SoupURIUtils.h: Added.
+
+2010-10-27 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
+
+ Reviewed by Andreas Kling.
+
+ Remove references to ancient QGVLauncher and QtLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=48430
+
+ * manual-tests/plugins/windowed.html: change to QtTestBrowser
+ * manual-tests/plugins/windowless.html: ditto
+
+2010-10-27 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Csaba Osztrogonác.
+
+ [WINCE] Buildfix after r70400.
+ https://bugs.webkit.org/show_bug.cgi?id=48419
+
+ * platform/wince/TemporaryLinkStubs.cpp: Added.
+ (WebCore::setCookieStoragePrivateBrowsingEnabled):
+
+2010-10-27 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Add runtime flag check before enabling speech input in code.
+ https://bugs.webkit.org/show_bug.cgi?id=48426
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::isSpeechEnabled): Added runtime flag check.
+
+2010-10-27 Adam Roben <aroben@apple.com>
+
+ Only decompress pixel buffers when needed (and fix a crash in the
+ process)
+
+ Fixes <http://webkit.org/b/48417> Crash when running
+ compositing/video/video-background-color.html on Windows
+
+ Reviewed by Anders Carlsson.
+
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::paint): Only
+ decompress the pixel buffer when it has an incompatible format. This
+ also has the benefit of only decompressing the buffer when a
+ QTDecompressionSession has been created! (I assume this was just a typo
+ from when this code was added in r70252.)
+
+2010-10-27 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ getTextAtOffset returns incorrect results if a link includes text and an image
+ https://bugs.webkit.org/show_bug.cgi?id=47365
+
+ Properly consider text under a non-text renderer in textForObject.
+
+ We need to check all the children under a non-text renderer, if
+ any, to consider when current object is not a text object but some
+ of its children are, in order not to miss those portions of text
+ by not properly handling those situations.
+
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (textForRenderer): New. Get the text for a RenderObject's children.
+ (textForObject): Use the new textForRenderer function.
+
+2010-10-26 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Rob Buis.
+
+ Convert SVGRect to the new SVGPropertyTearOff concept
+ https://bugs.webkit.org/show_bug.cgi?id=48204
+
+ Convert the next SVG primitive type to use the SVGPropertyTearOff concept: SVGRect.
+ Added new test verifying that StrictTypeChecking is enabled for SVGRect. Refactor and share code between JSC/V8/ObjC generators.
+
+ Test: svg/dom/SVGRect.html
+
+ * GNUmakefile.am: Add SVGAnimatedRect.h to build.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * bindings/scripts/CodeGenerator.pm: Refactor SVGPropertyTearOff handling, and share code between JSC/V8/ObjC generators.
+ * bindings/scripts/CodeGeneratorJS.pm: Ditto.
+ * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove SVGAnimatedRect handling.
+ * svg/DeprecatedSVGAnimatedTemplate.h: Ditto.
+ * svg/SVGAngle.idl: Remove [SVGProperty] flag.
+ * svg/SVGAnimatedAngle.idl: Remove [SVGAnimatedProperty] flag.
+ * svg/SVGAnimatedLength.idl: Ditto.
+ * svg/SVGAnimatedLengthList.idl: Ditto.
+ * svg/SVGAnimatedRect.h: Added.
+ * svg/SVGFitToViewBox.h: SVGRect now uses the new tear off concept, adapt code.
+ * svg/SVGLength.idl: Remove [SVGProperty] flag.
+ * svg/SVGMarkerElement.h:
+ * svg/SVGPatternElement.h:
+ * svg/SVGRect.idl: Remove [PODType] flag, add StrictTypeChecking to all attributes.
+ * svg/SVGSVGElement.cpp: s/setViewBox/setViewBoxBaseValue/.
+ (WebCore::SVGSVGElement::currentView):
+ (WebCore::SVGSVGElement::inheritViewAttributes):
+ * svg/SVGSVGElement.h:
+ * svg/SVGSVGElement.idl: Remove [Immutable] flags for SVGRect types, no longer needed.
+ * svg/SVGSymbolElement.h:
+ * svg/SVGViewElement.h:
+ * svg/SVGViewSpec.cpp: Take a SVGElement as context element.
+ (WebCore::SVGViewSpec::SVGViewSpec):
+ * svg/SVGViewSpec.h: Ditto.
+ (WebCore::SVGViewSpec::contextElement):
+ * svg/SVGZoomEvent.idl: Remove [Immutable] flags for SVGRect types, no longer needed.
+ * svg/properties/SVGAnimatedPropertyMacros.h: Support declaring animated properties on non-SVGElement types (here: SVGViewSpec), just like the old macros handled it.
+
+2010-10-27 Pavel Podivilov <podivilov@chromium.org>
+
+ Unreviewed, fix line endings in InspectorState.h
+
+ * inspector/InspectorState.h:
+
+2010-10-27 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: move frontend settings to local storage
+ https://bugs.webkit.org/show_bug.cgi?id=47715
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::didCommitLoad):
+ * inspector/InspectorController.h:
+ * inspector/InspectorState.cpp:
+ (WebCore::InspectorState::InspectorState):
+ * inspector/InspectorState.h:
+ * inspector/front-end/ConsoleView.js:
+ * inspector/front-end/EventListenersSidebarPane.js:
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel.prototype._createStatusbarButtons):
+ * inspector/front-end/Panel.js:
+ (WebInspector.Panel):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype._createStatusbarButtons):
+ * inspector/front-end/Settings.js:
+ (WebInspector.Settings):
+ (WebInspector.Settings.prototype.installApplicationSetting):
+ (WebInspector.Settings.prototype.installProjectSetting):
+ (WebInspector.Settings.prototype._get):
+ (WebInspector.Settings.prototype._set):
+ (WebInspector.Settings.prototype._getProjectSetting):
+ (WebInspector.Settings.prototype._setProjectSetting):
+ (WebInspector.Settings.prototype._formatProjectKey):
+ * inspector/front-end/StylesSidebarPane.js:
+ * inspector/front-end/WatchExpressionsSidebarPane.js:
+ (WebInspector.WatchExpressionsSidebarPane):
+ (WebInspector.WatchExpressionsSidebarPane.prototype.reset):
+ * inspector/front-end/inspector.js:
+ (WebInspector.reset):
+
+2010-10-27 Andy Estes <aestes@apple.com>
+
+ Reviewed by David Hyatt.
+
+ Siblings of floated elements should be cleared below the float if they
+ are too wide to fit in the containing block.
+ https://bugs.webkit.org/show_bug.cgi?id=48396
+
+ Test: fast/block/float/clear-element-too-wide-for-containing-block.html
+
+ WebKit did not clear elements adjacent to floats if they were wider than
+ the containing block, instead keeping them on the same line and allowing
+ them to spill out the right side of the containing block. We should
+ match the spec in this regard and clear the element below the float even
+ if it is too wide for the containing block. Doing this seems to also
+ match IE's and Firefox's behavior.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::getClearDelta): Continue to compute the clear
+ delta even if the child's minimum preferred width is greater than the
+ containing block's available width.
+
+2010-10-26 Rob Buis <rwlbuis@gmail.com>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Title-Element has no popup on <svg>-Elements, but on <g>
+ https://bugs.webkit.org/show_bug.cgi?id=47669
+
+ Allow tooltips on non-root svg elements.
+
+ No new tests.
+
+ * svg/SVGStyledElement.cpp:
+
+2010-10-26 Dai Mikurube <dmikurube@google.com>
+
+ Reviewed by Kent Tamura.
+
+ constraint validation: stepMismatch (rounding error)
+ https://bugs.webkit.org/show_bug.cgi?id=48220
+
+ 1. Changed the computation to achieve difference from a integral
+ multiple of the allowed value step.
+
+ The previous fmod(doubleValue, step) sometimes returned unacceptable
+ remainder. For example,
+ double doubleValue = 1.005; // Actually, near to 1.005
+ double step = 0.005; // Actually, near to 0.005
+ fmod(doubleValue, step) ==> (near to) 0.005
+ It's a case that doubleValue is a little smaller than 1.005 and step is
+ a little larger than 0.005.
+
+ 2. Changed the error threshold.
+
+ Number values in HTML5 are expressed in IEEE 754 single-precision.
+ Too precise comparison sometimes leads unintended errors.
+
+ For example, I found a case :
+ remainder = 0.00000000000000022204460
+ acceptableError = 0.00000000000000007105427
+
+ * html/NumberInputType.cpp:
+ (WebCore::NumberInputType::stepMismatch):
+
+2010-10-26 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add DelayNode files
+ https://bugs.webkit.org/show_bug.cgi?id=47516
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/DelayNode.cpp: Added.
+ (WebCore::DelayNode::DelayNode):
+ (WebCore::DelayNode::delayTime):
+ * webaudio/DelayNode.h: Added.
+ (WebCore::DelayNode::create):
+ (WebCore::DelayNode::delayProcessor):
+ * webaudio/DelayNode.idl: Added.
+
+2010-10-26 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ AudioContext and AudioNode followup changes for AudioNodeInput/AudioNodeOutput thread safety
+ https://bugs.webkit.org/show_bug.cgi?id=47504
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioContext.cpp:
+ (WebCore::AudioContext::isAudioThread):
+ (WebCore::AudioContext::isGraphOwner):
+ (WebCore::AudioContext::handlePreRenderTasks):
+ (WebCore::AudioContext::handlePostRenderTasks):
+ (WebCore::AudioContext::deleteMarkedNodes):
+ (WebCore::AudioContext::markAudioNodeInputDirty):
+ (WebCore::AudioContext::markAudioNodeOutputDirty):
+ (WebCore::AudioContext::handleDirtyAudioNodeInputs):
+ (WebCore::AudioContext::handleDirtyAudioNodeOutputs):
+ * webaudio/AudioContext.h:
+ * webaudio/AudioNode.cpp:
+ * webaudio/AudioNode.h:
+ (WebCore::AudioNode::isMarkedForDeletion):
+ * webaudio/AudioNode.idl:
+
+2010-10-26 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add DelayProcessor files
+ https://bugs.webkit.org/show_bug.cgi?id=47517
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/DelayProcessor.cpp: Added.
+ (WebCore::DelayProcessor::DelayProcessor):
+ (WebCore::DelayProcessor::~DelayProcessor):
+ (WebCore::DelayProcessor::createKernel):
+ * webaudio/DelayProcessor.h: Added.
+ (WebCore::DelayProcessor::delayTime):
+
+2010-10-26 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add AudioNodeOutput files
+ https://bugs.webkit.org/show_bug.cgi?id=45581
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioNodeOutput.cpp: Added.
+ (WebCore::AudioNodeOutput::AudioNodeOutput):
+ (WebCore::AudioNodeOutput::setNumberOfChannels):
+ (WebCore::AudioNodeOutput::setInternalBus):
+ (WebCore::AudioNodeOutput::updateRenderingState):
+ (WebCore::AudioNodeOutput::updateNumberOfChannels):
+ (WebCore::AudioNodeOutput::propagateChannelCount):
+ (WebCore::AudioNodeOutput::pull):
+ (WebCore::AudioNodeOutput::bus):
+ (WebCore::AudioNodeOutput::renderingFanOutCount):
+ (WebCore::AudioNodeOutput::fanOutCount):
+ (WebCore::AudioNodeOutput::addInput):
+ (WebCore::AudioNodeOutput::removeInput):
+ (WebCore::AudioNodeOutput::disconnectAllInputs):
+ (WebCore::AudioNodeOutput::disable):
+ (WebCore::AudioNodeOutput::enable):
+ * webaudio/AudioNodeOutput.h: Added.
+ (WebCore::AudioNodeOutput::node):
+ (WebCore::AudioNodeOutput::context):
+ (WebCore::AudioNodeOutput::numberOfChannels):
+ (WebCore::AudioNodeOutput::isChannelCountKnown):
+
+2010-10-26 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add AudioNodeInput files
+ https://bugs.webkit.org/show_bug.cgi?id=45577
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioNodeInput.cpp: Added.
+ (WebCore::AudioNodeInput::AudioNodeInput):
+ (WebCore::AudioNodeInput::connect):
+ (WebCore::AudioNodeInput::disconnect):
+ (WebCore::AudioNodeInput::disable):
+ (WebCore::AudioNodeInput::enable):
+ (WebCore::AudioNodeInput::changedOutputs):
+ (WebCore::AudioNodeInput::updateRenderingState):
+ (WebCore::AudioNodeInput::numberOfChannels):
+ (WebCore::AudioNodeInput::numberOfRenderingChannels):
+ (WebCore::AudioNodeInput::bus):
+ (WebCore::AudioNodeInput::internalSummingBus):
+ (WebCore::AudioNodeInput::sumAllConnections):
+ (WebCore::AudioNodeInput::pull):
+ * webaudio/AudioNodeInput.h: Added.
+ (WebCore::AudioNodeInput::node):
+ (WebCore::AudioNodeInput::context):
+ (WebCore::AudioNodeInput::numberOfRenderingConnections):
+ (WebCore::AudioNodeInput::renderingOutput):
+ (WebCore::AudioNodeInput::isConnected):
+ (WebCore::AudioNodeInput::numberOfConnections):
+
+2010-10-26 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Tony Chang.
+
+ Rolling in r70512 again, added missing null-check to
+ Editor::isSpellCheckingEnabled().
+ http://trac.webkit.org/changeset/70512
+
+ spellcheck='' should be the same as spellcheck="true"
+ https://bugs.webkit.org/show_bug.cgi?id=25539
+
+ * dom/Element.cpp:
+ (WebCore::Element::spellcheckAttributeState):
+ (WebCore::Element::isSpellCheckingEnabled):
+ * dom/Element.h:
+ * editing/Editor.cpp:
+ (WebCore::markMisspellingsOrBadGrammar):
+ (WebCore::Editor::isSpellCheckingEnabledInFocusedNode):
+ (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
+ * editing/Editor.h:
+ * platform/ContextMenu.cpp:
+ (WebCore::ContextMenu::populate):
+
+2010-10-26 Brent Fulgham <bfulgham@webkit.org>
+
+ Unreviewed build fixes.
+
+ * WebCore.vcproj/WebCore.vcproj: Turn off several non-WinCairo
+ files. We don't support CoreAnimation!
+ * WebCore.vcproj/WebCoreCairo.vsprops: Add missing include path
+ for 'image-decoders/webp'
+ * platform/network/curl/CookieJarCurl.cpp:
+ (WebCore::setCookieStoragePrivateBrowsingEnabled): Add build stub.
+
+2010-10-26 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Kent Tamura.
+
+ Crash in CompositeEditCommand::splitTreeToNode
+ https://bugs.webkit.org/show_bug.cgi?id=48349
+
+ The bug was caused by indentIntoBlockquote's passing null pointer to splitTreeToNode.
+ Fixed the crash by adding early exits.
+
+ Test: editing/execCommand/indent-node-to-split-to-crash.html
+
+ * editing/CompositeEditCommand.cpp:
+ (WebCore::CompositeEditCommand::splitTreeToNode):
+ * editing/IndentOutdentCommand.cpp:
+ (WebCore::IndentOutdentCommand::indentIntoBlockquote):
+
+2010-10-26 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Kent Tamura.
+
+ REGRESSION(r67170): crash in removeImplicitlyStyledElement
+ https://bugs.webkit.org/show_bug.cgi?id=48389
+
+ Fixed the crash by adding a null pointer check.
+
+ Test: editing/style/invalid-font-size.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
+
+2010-10-26 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, rolling out r70573.
+ http://trac.webkit.org/changeset/70573
+ https://bugs.webkit.org/show_bug.cgi?id=48204
+
+ Broke 39 tests on Chromium
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/scripts/CodeGenerator.pm:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorObjC.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * svg/DeprecatedSVGAnimatedPropertyTraits.h:
+ * svg/DeprecatedSVGAnimatedTemplate.h:
+ * svg/SVGAngle.idl:
+ * svg/SVGAnimatedAngle.idl:
+ * svg/SVGAnimatedLength.idl:
+ * svg/SVGAnimatedLengthList.idl:
+ * svg/SVGAnimatedRect.h: Removed.
+ * svg/SVGFitToViewBox.h:
+ * svg/SVGLength.idl:
+ * svg/SVGMarkerElement.h:
+ * svg/SVGPatternElement.h:
+ * svg/SVGRect.idl:
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::currentView):
+ (WebCore::SVGSVGElement::inheritViewAttributes):
+ * svg/SVGSVGElement.h:
+ * svg/SVGSVGElement.idl:
+ * svg/SVGSymbolElement.h:
+ * svg/SVGViewElement.h:
+ * svg/SVGViewSpec.cpp:
+ (WebCore::SVGViewSpec::SVGViewSpec):
+ * svg/SVGViewSpec.h:
+ (WebCore::SVGViewSpec::contextElement):
+ * svg/SVGZoomEvent.idl:
+ * svg/properties/SVGAnimatedPropertyMacros.h:
+
+2010-10-26 Anders Carlsson <andersca@apple.com>
+
+ Fix 32-bit build.
+
+ * platform/graphics/mac/FontMac.mm:
+ (WebCore::showGlyphsWithAdvances):
+
+2010-10-26 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Resource tracking failure when trying to move a frame between documents
+ https://bugs.webkit.org/show_bug.cgi?id=44713
+
+ Test: fast/frames/iframe-reparenting-fail-load.html
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::transferLoadingResourcesFromPage):
+ Added method that notifies the client to update resource tracking for
+ loading resources that have been transferred to a different page.
+ * loader/DocumentLoader.h:
+ * loader/EmptyClients.h:
+ (WebCore::EmptyFrameLoaderClient::transferLoadingResourceFromPage):
+ Empty method.
+ * loader/FrameLoader.h:
+ * loader/FrameLoader.cpp:
+ Added method that triggers resource tracking updates. This wraps
+ the DocumentLoader method as it appears DocumentLoader is opaque
+ to Frame.
+ * loader/FrameLoaderClient.h:
+ Added API to notify the client to update resource tracking for
+ a loading resource that has been transferred to a different page.
+ * page/Frame.cpp:
+ (WebCore::Frame::transferChildFrameToNewDocument):
+ Update resource tracking if page has changed.
+
+2010-10-26 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Rob Buis.
+
+ Convert SVGRect to the new SVGPropertyTearOff concept
+ https://bugs.webkit.org/show_bug.cgi?id=48204
+
+ Convert the next SVG primitive type to use the SVGPropertyTearOff concept: SVGRect.
+ Added new test verifying that StrictTypeChecking is enabled for SVGRect. Refactor and share code between JSC/V8/ObjC generators.
+
+ Test: svg/dom/SVGRect.html
+
+ * GNUmakefile.am: Add SVGAnimatedRect.h to build.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * bindings/scripts/CodeGenerator.pm: Refactor SVGPropertyTearOff handling, and share code between JSC/V8/ObjC generators.
+ * bindings/scripts/CodeGeneratorJS.pm: Ditto.
+ * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove SVGAnimatedRect handling.
+ * svg/DeprecatedSVGAnimatedTemplate.h: Ditto.
+ * svg/SVGAngle.idl: Remove [SVGProperty] flag.
+ * svg/SVGAnimatedAngle.idl: Remove [SVGAnimatedProperty] flag.
+ * svg/SVGAnimatedLength.idl: Ditto.
+ * svg/SVGAnimatedLengthList.idl: Ditto.
+ * svg/SVGAnimatedRect.h: Added.
+ * svg/SVGFitToViewBox.h: SVGRect now uses the new tear off concept, adapt code.
+ * svg/SVGLength.idl: Remove [SVGProperty] flag.
+ * svg/SVGMarkerElement.h:
+ * svg/SVGPatternElement.h:
+ * svg/SVGRect.idl: Remove [PODType] flag, add StrictTypeChecking to all attributes.
+ * svg/SVGSVGElement.cpp: s/setViewBox/setViewBoxBaseValue/.
+ (WebCore::SVGSVGElement::currentView):
+ (WebCore::SVGSVGElement::inheritViewAttributes):
+ * svg/SVGSVGElement.h:
+ * svg/SVGSVGElement.idl: Remove [Immutable] flags for SVGRect types, no longer needed.
+ * svg/SVGSymbolElement.h:
+ * svg/SVGViewElement.h:
+ * svg/SVGViewSpec.cpp: Take a SVGElement as context element.
+ (WebCore::SVGViewSpec::SVGViewSpec):
+ * svg/SVGViewSpec.h: Ditto.
+ (WebCore::SVGViewSpec::contextElement):
+ * svg/SVGZoomEvent.idl: Remove [Immutable] flags for SVGRect types, no longer needed.
+ * svg/properties/SVGAnimatedPropertyMacros.h: Support declaring animated properties on non-SVGElement types (here: SVGViewSpec), just like the old macros handled it.
+
+2010-10-26 takano takumi <takano1@asia.apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ Advances are wrong and glyphs are rotated improperly in vertical writing
+ https://bugs.webkit.org/show_bug.cgi?id=48315
+
+ We shouldn't use vertical metrics for Roman fonts. Also, we should rotate vertical variant
+ glyphs back on drawing as the whole run has already been rotated beforehand.
+
+ * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+ (WebCore::FontPlatformData::FontPlatformData): Changed to ignore vertical orientation when the font doesn't support vertical metrics.
+ * platform/graphics/mac/FontMac.mm:
+ (WebCore::showGlyphsWithAdvances): Changed to rotate glyphs -90 degree for vertical variants.
+ (WebCore::Font::drawGlyphs):
+
+2010-10-26 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Add a 'grammar' attribute for speech input.
+ https://bugs.webkit.org/show_bug.cgi?id=48339
+
+ To differentiate between various types of speech input, we add a 'x-webkit-grammar' attribute to a
+ speech enabled input element. This is passed without validation to the speech recognizer. Typical values
+ could be "builtin:search", "builtin:dictation" and even an externally hosted SRGS grammar XML file URI.
+ It is up to the recognizer to interpret the value and use it as an aid in recognition.
+
+ * bindings/generic/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::webkitGrammarEnabled):
+ * html/HTMLAttributeNames.in:
+ * html/HTMLInputElement.idl:
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::startRecognition):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h:
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::startRecognition):
+ * platform/mock/SpeechInputClientMock.h:
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+
+2010-10-26 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: console does not work after two reloads.
+ https://bugs.webkit.org/show_bug.cgi?id=48318
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::disconnectFrontend):
+
+2010-10-26 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: console doesn't work in closures when window is overrode
+ https://bugs.webkit.org/show_bug.cgi?id=48320
+
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor.):
+
+2010-10-26 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix an assert with QtPixmapInstance creation.
+ https://bugs.webkit.org/show_bug.cgi?id=48323
+
+ This places the newly refcounted QtPixmapInstance in a RefPtr
+ to prevent an assert on the first ref() call.
+
+ * bridge/qt/qt_pixmapruntime.cpp:
+ (JSC::Bindings::QtPixmapInstance::createPixmapRuntimeObject):
+
+2010-10-26 Kenichi Ishibashi <bashi@google.com>
+
+ Reviewed by Kent Tamura.
+
+ Input Method inserts conversion candidates unexpectedly
+ https://bugs.webkit.org/show_bug.cgi?id=46868
+
+ Calls updateStyleIfNeeded() before setting selection for the composition to
+ avoid inserting the previous composition text into a content editable element
+ which has an event handler that changes the style of the element.
+
+ Test: platform/chromium/fast/text/chromium-mac-duplicate-ime-composition.html
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::setComposition): calls updateStyleIfNeeded() before setting selection.
+
+2010-10-26 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Chris Fleizach.
+
+ [Gtk] Layout tables should indicate that they are not data tables via an object attribute
+ https://bugs.webkit.org/show_bug.cgi?id=35422
+
+ Set the 'layout-guess' attribute to 'true' for data tables.
+
+ Reorganized some code in AccessibilityTable so now the function
+ isDataTable() is more coherent by just answering that very
+ specific question, regardless of whether the table is being
+ exposed or not to Assistive Technologies.
+
+ Hence, now it's possible to make two questions separately instead
+ of just one, meaning that the new function isAccessibleTable() is
+ now what we formerly defined as the isDataTable() function.
+
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::isAccessibilityTable):
+ New function to allow asking tables both whether they are
+ exposed and whether they are data tables, which are different
+ questions whose answers might be the same in many situations,
+ but different sometimes (as it can happen in the GTK port).
+ * accessibility/AccessibilityTable.h:
+ * accessibility/AccessibilityTable.cpp:
+ (WebCore::AccessibilityTable::hasARIARole):
+ New, checks whether the table has a valid ARIA role.
+ (WebCore::AccessibilityTable::isAccessibilityTable):
+ New, returns the value of m_isAccessibilityTable. It's
+ basically the former isDataTable() function renamed.
+ (WebCore::AccessibilityTable::isDataTable):
+ Changed behaviour. Instead of just returning the value of
+ m_isAccessibilityTable as it did so far (which was confusing
+ because of that's not what the name suggests), focus on
+ checking whether it's a data table or not and return a bool
+ value accordingly. It's basically a rename of the former
+ isTableExposableThroughAccessibility() function, but withouth
+ the GTK-specific if-endif region (which didn't make sense
+ here now, because that was answering the question "is the table
+ exposed in the GTK port?", instead of "is it a data table?").
+ (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
+ Uses the hasAriaRole(), and isDataTable() to determine whether
+ a table should be exposed or not. Also includes the GTK-specific
+ if-region coming from the former implementation of the function
+ isTableExposableThroughAccessibility() not to check whether it's
+ a data table in case the rest of the checks succeeded (all
+ tables are exposed in the GTK port).
+ (WebCore::AccessibilityTable::addChildren):
+ Replace usage of isDataTable() with isAccessibilityTable(), to
+ keep exactly the same behaviour happening before this patch.
+ (WebCore::AccessibilityTable::roleValue): Ditto.
+ (WebCore::AccessibilityTable::accessibilityIsIgnored): Ditto.
+ (WebCore::AccessibilityTable::title): Ditto.
+
+ Updated usage of the former function isDataTable() everywhere
+ else, replacing it with the new isAccessibilityTable(), so keeping
+ exactly the same behaviour happening before this patch.
+
+ * accessibility/AccessibilityARIAGrid.cpp:
+ (WebCore::AccessibilityARIAGrid::addChildren):
+ Use isAccessibilityTable() instead of isDataTable().
+ * accessibility/AccessibilityARIAGridCell.cpp:
+ (WebCore::AccessibilityARIAGridCell::parentTable): Ditto.
+ * accessibility/AccessibilityARIAGridRow.cpp:
+ (WebCore::AccessibilityARIAGridRow::disclosedRows): Ditto.
+ (WebCore::AccessibilityARIAGridRow::disclosedByRow): Ditto.
+ (WebCore::AccessibilityARIAGridRow::parentTable): Ditto.
+ * accessibility/AccessibilityTableCell.cpp:
+ (WebCore::AccessibilityTableCell::isTableCell):
+ Use isAccessibilityTable() instead of isDataTable().
+ * accessibility/AccessibilityTableHeaderContainer.cpp:
+ (WebCore::AccessibilityTableHeaderContainer::addChildren): Ditto.
+ * accessibility/AccessibilityTableRow.cpp:
+ (WebCore::AccessibilityTableRow::isTableRow): Ditto
+ * accessibility/mac/AccessibilityObjectWrapper.mm:
+ (-[AccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
+ Use isAccessibilityTable() instead of isDataTable().
+ (-[AccessibilityObjectWrapper accessibilityAttributeNames]): Ditto.
+ (-[AccessibilityObjectWrapper accessibilityAttributeValue:]): Ditto.
+ (-[AccessibilityObjectWrapper accessibilityParameterizedAttributeNames]): Ditto.
+ (-[AccessibilityObjectWrapper accessibilitySetValue:forAttribute:]): Ditto.
+ (-[AccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): Ditto.
+
+ Use the new function isAccessibilityTable() together with the
+ modified implementation of isDataTable() to set the 'layout-guess'
+ attribute when needed.
+
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (webkit_accessible_get_attributes):
+ Set the 'layout-guess' attribute to 'true' to help Assistive
+ Technologies guessing which tables are not data tables.
+
+2010-10-26 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Resuming animations causes webkitAnimationStart events to be fired
+ https://bugs.webkit.org/show_bug.cgi?id=46540
+
+ Added a flag that makes sure start animation event is only ever
+ fired once.
+
+ Test: animations/suspend-resume-animation-events.html
+
+ * page/animation/KeyframeAnimation.cpp:
+ (WebCore::KeyframeAnimation::KeyframeAnimation):
+ (WebCore::KeyframeAnimation::sendAnimationEvent):
+ * page/animation/KeyframeAnimation.h:
+
+2010-10-26 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Added checks to ensure that events types are right before casting.
+ https://bugs.webkit.org/show_bug.cgi?id=48345
+
+ * html/ImageDocument.cpp:
+ (WebCore::ImageEventListener::handleEvent):
+ * inspector/InspectorDOMStorageResource.cpp:
+ (WebCore::InspectorDOMStorageResource::handleEvent):
+
+2010-10-26 Dai Mikurube <dmikurube@google.com>
+
+ Reviewed by Kent Tamura.
+
+ Number values for form controls should be in the range of IEEE 754
+ single-precision floating point number
+ https://bugs.webkit.org/show_bug.cgi?id=48221
+
+ Changed the range of number values to fit in IEEE 754 single-precision
+
+ * html/parser/HTMLParserIdioms.cpp:
+ (WebCore::parseToDoubleForNumberType):
+ * html/NumberInputType.cpp:
+
+2010-10-26 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48157
+
+ Direction and writing-mode should propagate from the <body> to the <html> to the initial containing block.
+ Modify the existing code that propagates from the document element to also propagate from the body.
+
+ Fix the buggy code that was trying to dirty the body when the view changed size if it stretched to fill the
+ viewport. The code didn't consider the root element, and it only worked with one axis. I pulled it
+ out of calculateScrollbarModesForLayout, since it should never have been put there in the first place.
+
+ Added four new tests in fast/blockflow.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::initElement):
+ (WebCore::CSSStyleSelector::styleForDocument):
+ (WebCore::CSSStyleSelector::applyProperty):
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ * dom/Document.h:
+ (WebCore::Document::directionSetOnDocumentElement):
+ (WebCore::Document::writingModeSetOnDocumentElement):
+ (WebCore::Document::setDirectionSetOnDocumentElement):
+ (WebCore::Document::setWritingModeSetOnDocumentElement):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::calculateScrollbarModesForLayout):
+ (WebCore::FrameView::layout):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::styleDidChange):
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::stretchesToViewport):
+
+2010-10-26 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Fix Cache::dumpStats formatting
+ https://bugs.webkit.org/show_bug.cgi?id=48286
+
+ This updates the column width in the dumpStats output to be wide enough
+ for all the titles. Previously one of the titles was too wide and crept
+ into later column space.
+
+ * loader/Cache.cpp:
+ (WebCore::Cache::dumpStats): make columns 13 characters wide.
+
+2010-10-26 Alexey Marinichev <amarinichev@chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ [chromium] Check getGraphicsResetStatusARB and reinitialize the
+ renderer in an error is returned.
+ https://bugs.webkit.org/show_bug.cgi?id=47848
+
+ Tested by failure injection (stopping in the debugger and issuing a
+ jump as if an error has occurred).
+
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::setLayerRenderer):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ (WebCore::LayerRendererChromium::transferRootLayer): added
+
+2010-10-26 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed. Touching inspector controller to kick gtk build, removing comments.
+
+ * inspector/InspectorController.cpp:
+ * inspector/front-end/ResourceManager.js:
+ * inspector/front-end/ScriptsPanel.js:
+
+2010-10-26 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: continue making resources panel optional.
+ https://bugs.webkit.org/show_bug.cgi?id=48261
+
+ This refactoring makes console, audits and extensions tests pass while taking data from
+ resources panel. Network panel as a source is to follow.
+
+ * inspector/front-end/AuditLauncherView.js:
+ (WebInspector.AuditLauncherView.prototype._createLauncherUI):
+ * inspector/front-end/AuditsPanel.js:
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.addMessage):
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView.prototype._filterCookiesForDomain.populateResourcesForDocuments):
+ (WebInspector.CookieItemsView.prototype._filterCookiesForDomain):
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onRevealAndSelectResource):
+ (WebInspector.ExtensionServer.prototype._onGetResources):
+ (WebInspector.ExtensionServer.prototype._onGetResourceContent):
+ * inspector/front-end/HAREntry.js:
+ (WebInspector.HARLog.prototype.build):
+ (WebInspector.HARLog.prototype.buildMainResourceTimings):
+ (WebInspector.HARLog.prototype._convertResource):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel):
+ (WebInspector.NetworkPanel.prototype._reset):
+ (WebInspector.NetworkPanel.prototype.get resources):
+ (WebInspector.NetworkPanel.prototype.addResource):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.set category):
+ * inspector/front-end/ResourceCategory.js:
+ (WebInspector.ResourceCategory):
+ (WebInspector.ResourceCategory.prototype.toString):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
+ (WebInspector.ResourceManager.prototype.willSendRequest):
+ (WebInspector.ResourceManager.prototype.didFinishLoading):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
+ (WebInspector.ResourceManager.prototype.setOverrideContent):
+ (WebInspector.ResourceTreeModel.prototype._callForFrameResources):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel):
+ (WebInspector.ResourcesPanel.prototype.reset):
+ (WebInspector.ResourcesPanel.prototype.addResource):
+ (WebInspector.ResourcesPanel.prototype.removeResource):
+ (WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.addScript):
+ (WebInspector.ScriptsPanel.prototype._resourceLoadingFinished):
+ (WebInspector.ScriptsPanel.prototype._breakpointAdded):
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertyTreeElement.prototype.updateTitle.linkifyURL):
+ * inspector/front-end/inspector.js:
+ (WebInspector._updateFocusedNode):
+ (WebInspector.get networkResources):
+ (WebInspector.forAllResources):
+ (WebInspector.resourceForURL):
+ (WebInspector.updateResource):
+ (WebInspector.domContentEventFired):
+ (WebInspector.loadEventFired):
+ (WebInspector.removeResource):
+ (WebInspector.reset):
+ (WebInspector.displayNameForURL):
+ (WebInspector.linkifyStringAsFragment):
+ (WebInspector.resourceURLForRelatedNode.callback):
+ (WebInspector.resourceURLForRelatedNode):
+
+2010-10-26 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Steve Block.
+ Fix IndexedDB crashes
+ https://bugs.webkit.org/show_bug.cgi?id=48266
+
+ If IDBKey returns null, type conversion failed. Handle this case
+ in the bindings.
+
+ Change UNKNOWN_ERR to be 1 since 0 is hard coded to mean no error.
+ This is just a stop-gap move until we get it figured out in standards
+ land.
+
+ IDBObjectStore needs to handle null ranges.
+
+ It's actually OK for m_transaction to be non-null when hitting the
+ destructor. We just need to then remove it from the set of pending
+ transactions.
+
+ The transaction can become aborted in the middle of processing a
+ list of tasks. Fix this.
+
+ All changes (except the last 2 races) are tested in LayoutTests.
+ I couldn't find a way to reliably reproduce the races.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::TestObjInternal::idbKeyCallback):
+ * bindings/v8/IDBBindingUtilities.cpp:
+ (WebCore::createIDBKeyFromValue):
+ * storage/IDBDatabaseException.h:
+ * storage/IDBDatabaseException.idl:
+ * storage/IDBObjectStoreBackendImpl.cpp:
+ (WebCore::IDBObjectStoreBackendImpl::openCursorInternal):
+ * storage/IDBRequest.cpp:
+ (WebCore::IDBRequest::~IDBRequest):
+ (WebCore::IDBRequest::timerFired):
+ * storage/IDBTransactionBackendImpl.cpp:
+ (WebCore::IDBTransactionBackendImpl::taskTimerFired):
+
+2010-10-25 Andrey Kosyakov <caseq@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Show cookie data in the request headers in network pane
+ https://bugs.webkit.org/show_bug.cgi?id=16531
+
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView): Factor out common cookies grid logic to CookiesTable
+ (WebInspector.CookieItemsView.prototype._populateDataGrid):
+ * inspector/front-end/CookieParser.js: Store cookie type (request/response) within a cookie.
+ (WebInspector.CookieParser.prototype.parseCookie):
+ (WebInspector.CookieParser.prototype.parseSetCookie):
+ (WebInspector.CookieParser.prototype._addCookie):
+ (WebInspector.Cookie):
+ * inspector/front-end/DataGrid.js:
+ (WebInspector.DataGrid.prototype.autoSizeColumns): Optionally, traverse nested nodes when looking for max field widths.
+ (WebInspector.DataGrid.prototype._enumerateChildren):
+ (WebInspector.DataGrid.prototype.updateWidths): Skip attempt to calculate column widths if grid is not attached to DOM tree yet.
+ * inspector/front-end/FontView.js:
+ (WebInspector.FontView.prototype.resize):
+ * inspector/front-end/ResourceView.js:
+ (WebInspector.ResourceView.prototype.resize):
+ (WebInspector.ResourceView.prototype._selectTab):
+ (WebInspector.ResourceView.prototype._selectCookiesTab):
+ (WebInspector.ResourceView.prototype._innerSelectContentTab):
+ (WebInspector.ResourceView.prototype._refreshRequestHeaders):
+ (WebInspector.ResourceView.prototype._refreshResponseHeaders):
+ (WebInspector.ResourceView.prototype._refreshHeaders):
+ (WebInspector.ResourceView.prototype._refreshCookies):
+ (WebInspector.ResourceCookiesTab):
+ (WebInspector.ResourceCookiesTab.prototype.set requestCookies):
+ (WebInspector.ResourceCookiesTab.prototype.set responseCookies):
+ (WebInspector.ResourceCookiesTab.prototype._populateDataGrid):
+ (WebInspector.ResourceCookiesTab.prototype._populateCookies):
+ (WebInspector.ResourceCookiesTab.prototype._createFolder):
+ * inspector/front-end/SourceView.js:
+ (WebInspector.SourceView.prototype.resize):
+ * inspector/front-end/inspector.css:
+ (.resource-view .resource-view-cookies):
+ (.resource-view.headers-visible .resource-view-cookies):
+ (.resource-view-cookies.table .data-grid):
+ (.resource-view-cookies .data-grid .row-group):
+
+2010-10-26 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70518.
+ http://trac.webkit.org/changeset/70518
+ https://bugs.webkit.org/show_bug.cgi?id=48332
+
+ Breaks inspector tests. (Requested by pfeldman on #webkit).
+
+ * inspector/front-end/AuditLauncherView.js:
+ (WebInspector.AuditLauncherView.prototype._createLauncherUI):
+ * inspector/front-end/AuditsPanel.js:
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.addMessage):
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView.prototype._filterCookiesForDomain):
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onRevealAndSelectResource):
+ (WebInspector.ExtensionServer.prototype._onGetResources):
+ (WebInspector.ExtensionServer.prototype._onGetResourceContent):
+ * inspector/front-end/HAREntry.js:
+ (WebInspector.HARLog.prototype.build):
+ (WebInspector.HARLog.prototype.buildMainResourceTimings):
+ (WebInspector.HARLog.prototype._convertResource):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel):
+ (WebInspector.NetworkPanel.prototype._reset):
+ (WebInspector.NetworkPanel.prototype.addResource):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.set category):
+ * inspector/front-end/ResourceCategory.js:
+ (WebInspector.ResourceCategory):
+ (WebInspector.ResourceCategory.prototype.toString):
+ (WebInspector.ResourceCategory.prototype.addResource):
+ (WebInspector.ResourceCategory.prototype.removeResource):
+ (WebInspector.ResourceCategory.prototype.removeAllResources):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
+ (WebInspector.ResourceManager.prototype.willSendRequest):
+ (WebInspector.ResourceManager.prototype.didFinishLoading):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
+ (WebInspector.ResourceManager.prototype.setOverrideContent):
+ (WebInspector.ResourceTreeModel.prototype._callForFrameResources):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel):
+ (WebInspector.ResourcesPanel.prototype.reset):
+ (WebInspector.ResourcesPanel.prototype.addResource):
+ (WebInspector.ResourcesPanel.prototype.removeResource):
+ (WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.addScript):
+ (WebInspector.ScriptsPanel.prototype._resourceLoadingFinished):
+ (WebInspector.ScriptsPanel.prototype._breakpointAdded):
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertyTreeElement.prototype.updateTitle.linkifyURL):
+ * inspector/front-end/inspector.js:
+ (WebInspector._updateFocusedNode):
+ (WebInspector.updateResource):
+ (WebInspector.domContentEventFired):
+ (WebInspector.loadEventFired):
+ (WebInspector.removeResource):
+ (WebInspector.reset):
+ (WebInspector.displayNameForURL):
+ (WebInspector.resourceForURL):
+ (WebInspector.linkifyStringAsFragment):
+ (WebInspector.resourceURLForRelatedNode):
+
+2010-10-26 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Quota for IndexedDB should be per origin not per database
+ https://bugs.webkit.org/show_bug.cgi?id=48064
+
+ Merge all databases for each origin into a single SQLiteDatabase.
+
+ Replace the awkward metaData table with a Database table.
+
+ Create a new IDBSQLiteDatabase class that wraps SQLiteDatabase
+ and implements weak pointer semantics for IDBFactory. It's ref
+ counted so multiple IDBDatabaseBackendImpls can share one.
+
+ Fix uniqueness constraints that were overly conservitive.
+
+ Get rid of the code that blows away existing data every time
+ the database is opened.
+
+ Get rid of the fairly useless indexedDB manual test and replace
+ it with one that verifies data persists.
+
+ Use name+origin (not just name) in our cache of IDBDatabaseBackend
+ objects (so one origin can't access anothers' data).
+
+ Test: storage/indexeddb/duplicates.html
+
+ * WebCore.gypi:
+ * manual-tests/indexed-database.html: Removed.
+ * manual-tests/indexeddb-persists.html: Added.
+ * storage/IDBDatabaseBackendImpl.cpp:
+ (WebCore::extractMetaData):
+ (WebCore::setMetaData):
+ (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
+ (WebCore::IDBDatabaseBackendImpl::setDescription):
+ (WebCore::IDBDatabaseBackendImpl::sqliteDatabase):
+ (WebCore::IDBDatabaseBackendImpl::createObjectStoreInternal):
+ (WebCore::IDBDatabaseBackendImpl::setVersionInternal):
+ (WebCore::IDBDatabaseBackendImpl::loadObjectStores):
+ * storage/IDBDatabaseBackendImpl.h:
+ (WebCore::IDBDatabaseBackendImpl::create):
+ (WebCore::IDBDatabaseBackendImpl::id):
+ * storage/IDBFactoryBackendImpl.cpp:
+ (WebCore::IDBFactoryBackendImpl::removeSQLiteDatabase):
+ (WebCore::openSQLiteDatabase):
+ (WebCore::createTables):
+ (WebCore::IDBFactoryBackendImpl::open):
+ (WebCore::IDBFactoryBackendImpl::databaseFileName):
+ * storage/IDBFactoryBackendImpl.h:
+ * storage/IDBObjectStoreBackendImpl.cpp:
+ (WebCore::putObjectStoreData):
+ (WebCore::IDBObjectStoreBackendImpl::putInternal):
+ * storage/IDBSQLiteDatabase.cpp: Added.
+ (WebCore::IDBSQLiteDatabase::IDBSQLiteDatabase):
+ (WebCore::IDBSQLiteDatabase::~IDBSQLiteDatabase):
+ * storage/IDBSQLiteDatabase.h: Added.
+ (WebCore::IDBSQLiteDatabase::create):
+ (WebCore::IDBSQLiteDatabase::db):
+
+2010-10-20 Andrey Kosyakov <caseq@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Inspector needs to use cached resources to display image resources.
+ https://bugs.webkit.org/show_bug.cgi?id=16395
+
+ * inspector/Inspector.idl: Add base64Encode parameter to getContent
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::InspectorResourceAgent::resourceContent):
+ * inspector/InspectorResourceAgent.h:
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onGetResourceContent):
+ * inspector/front-end/ImageView.js:
+ (WebInspector.ImageView.prototype.contentTabSelected.onResourceContent):
+ (WebInspector.ImageView.prototype.contentTabSelected):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkDataGridNode.prototype._refreshNameCell.):
+ (WebInspector.NetworkDataGridNode.prototype._refreshNameCell):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource):
+ (WebInspector.Resource.prototype.set finished):
+ (WebInspector.Resource.prototype.getContent):
+ (WebInspector.Resource.prototype.get contentURL):
+ (WebInspector.Resource.prototype._requestContent.onResourceContent):
+ (WebInspector.Resource.prototype._requestContent):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourceSidebarTreeElement.prototype.createIconElement.):
+ (WebInspector.ResourceSidebarTreeElement.prototype.createIconElement):
+ * inspector/front-end/Settings.js: Added useDataURLForResourceImageIcons
+ * inspector/front-end/SourceView.js:
+ (WebInspector.SourceView.prototype.setupSourceFrameIfNeeded):
+
+2010-10-26 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: continue making resources panel optional.
+ https://bugs.webkit.org/show_bug.cgi?id=48261
+
+ This refactoring makes console, audits and extensions tests pass while taking data from
+ resources panel. Network panel as a source is to follow.
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::connectFrontend):
+ * inspector/front-end/AuditLauncherView.js:
+ (WebInspector.AuditLauncherView.prototype._createLauncherUI):
+ * inspector/front-end/AuditsPanel.js:
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.addMessage):
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView.prototype._filterCookiesForDomain.populateResourcesForDocuments):
+ (WebInspector.CookieItemsView.prototype._filterCookiesForDomain):
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onRevealAndSelectResource):
+ (WebInspector.ExtensionServer.prototype._onGetResources):
+ (WebInspector.ExtensionServer.prototype._onGetResourceContent):
+ * inspector/front-end/HAREntry.js:
+ (WebInspector.HARLog.prototype.build):
+ (WebInspector.HARLog.prototype.buildMainResourceTimings):
+ (WebInspector.HARLog.prototype._convertResource):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel):
+ (WebInspector.NetworkPanel.prototype._reset):
+ (WebInspector.NetworkPanel.prototype.get resources):
+ (WebInspector.NetworkPanel.prototype.addResource):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.set category):
+ * inspector/front-end/ResourceCategory.js:
+ (WebInspector.ResourceCategory):
+ (WebInspector.ResourceCategory.prototype.toString):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
+ (WebInspector.ResourceManager.prototype.willSendRequest):
+ (WebInspector.ResourceManager.prototype.didFinishLoading):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
+ (WebInspector.ResourceManager.prototype.setOverrideContent):
+ (WebInspector.ResourceTreeModel.prototype._callForFrameResources):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel):
+ (WebInspector.ResourcesPanel.prototype.reset):
+ (WebInspector.ResourcesPanel.prototype.addResource):
+ (WebInspector.ResourcesPanel.prototype.removeResource):
+ (WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.addScript):
+ (WebInspector.ScriptsPanel.prototype._resourceLoadingFinished):
+ (WebInspector.ScriptsPanel.prototype._breakpointAdded):
+ * inspector/front-end/Settings.js:
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertyTreeElement.prototype.updateTitle.linkifyURL):
+ * inspector/front-end/inspector.js:
+ (WebInspector._updateFocusedNode):
+ (WebInspector.get networkResources):
+ (WebInspector.forAllResources):
+ (WebInspector.resourceForURL):
+ (WebInspector.updateResource):
+ (WebInspector.domContentEventFired):
+ (WebInspector.loadEventFired):
+ (WebInspector.removeResource):
+ (WebInspector.reset):
+ (WebInspector.displayNameForURL):
+ (WebInspector.linkifyStringAsFragment):
+ (WebInspector.resourceURLForRelatedNode.callback):
+ (WebInspector.resourceURLForRelatedNode):
+
+2010-10-26 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Protect the frame from being blown away in loadWithDocumentLoader function call.
+ dispatchBeforeLoadEvent can cause the frame to be freed, which gets later used in
+ continueLoadAfterNavigationPolicy call.
+ https://bugs.webkit.org/show_bug.cgi?id=48281
+
+ Test: fast/events/form-iframe-target-before-load-crash.html
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::loadWithDocumentLoader):
+
+2010-10-26 Xan Lopez <xlopez@igalia.com>
+
+ Restore another mix-up in copy&paste error. Use height for the
+ vertical adjustments instead of width.
+
+ * platform/gtk/ScrollViewGtk.cpp:
+ (WebCore::ScrollView::setVerticalAdjustment):
+
+2010-10-26 Xan Lopez <xlopez@igalia.com>
+
+ Restore early return accidentally removed in previous
+ patch. Should make API tests pass again.
+
+ * platform/gtk/ScrollViewGtk.cpp:
+ (WebCore::ScrollView::setHorizontalAdjustment):
+ (WebCore::ScrollView::setVerticalAdjustment):
+
+2010-10-26 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Port to new GtkScrollable interface in GTK+ 3.x
+ https://bugs.webkit.org/show_bug.cgi?id=48202
+
+ The new GtkScrollable API sets the adjustments individually, so
+ adjust the code for this fact.
+
+ * platform/ScrollView.h:
+ * platform/gtk/ScrollViewGtk.cpp:
+ (WebCore::ScrollView::setHorizontalAdjustment): new method to set the horizontal adjustment.
+ (WebCore::ScrollView::setVerticalAdjustment): new method to set the vertical adjustment.
+ (WebCore::ScrollView::setGtkAdjustments): make this just call the other two methods.
+
+2010-10-26 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70512.
+ http://trac.webkit.org/changeset/70512
+ https://bugs.webkit.org/show_bug.cgi?id=48314
+
+ crashes many tests (Requested by inferno-sec on #webkit).
+
+ * dom/Element.cpp:
+ * dom/Element.h:
+ * editing/Editor.cpp:
+ (WebCore::markMisspellingsOrBadGrammar):
+ (WebCore::Editor::spellCheckingEnabledInFocusedNode):
+ (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
+ * editing/Editor.h:
+ * platform/ContextMenu.cpp:
+ (WebCore::ContextMenu::populate):
+
+2010-10-24 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Tony Chang.
+
+ spellcheck='' should be the same as spellcheck="true"
+ https://bugs.webkit.org/show_bug.cgi?id=25539
+
+ - Added a check for empty string and missing attribute.
+ - Extracted the check to Element::spellCheckingEnabled()
+ - Introduced SpellcheckAttributeState enum to represent the
+ states for spellcheck attributes.
+
+ * dom/Element.cpp:
+ (WebCore::Element::spellcheckAttributeState): Added.
+ (WebCore::Element::isSpellCheckingEnabled): Added.
+ * dom/Element.h:
+ * editing/Editor.cpp:
+ (WebCore::markMisspellingsOrBadGrammar):
+ (WebCore::Editor::isSpellCheckingEnabledInFocusedNode): Renamed, partly extracted to Element::isSpellCheckingEnabled()
+ (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
+ * editing/Editor.h:
+ * platform/ContextMenu.cpp:
+ (WebCore::ContextMenu::populate):
+
+2010-10-25 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Refactor HTMLInputElement: Move createRender(), appendFormData(),
+ saveFormControlState() and restoreFormControlState() to InputTypes.
+ https://bugs.webkit.org/show_bug.cgi?id=47834
+
+ This change adds BaseButtonInputType and BaseCheckableInputType. They
+ are super classes of some concrete InputType classes.
+
+ No new tests. Just a code refactoring.
+
+ * CMakeLists.txt: Add BaseButtonInputType and BaseCheckableInputType files.
+ * GNUmakefile.am: ditto.
+ * WebCore.gypi: ditto.
+ * WebCore.pro: ditto.
+ * WebCore.vcproj/WebCore.vcproj: ditto.
+ * WebCore.xcodeproj/project.pbxproj: ditto.
+ * html/BaseButtonInputType.cpp: Added.
+ (WebCore::BaseButtonInputType::appendFormData):
+ (WebCore::BaseButtonInputType::createRenderer):
+ * html/BaseButtonInputType.h: Added.
+ (WebCore::BaseButtonInputType::BaseButtonInputType):
+ * html/BaseCheckableInputType.cpp: Added.
+ (WebCore::BaseCheckableInputType::saveFormControlState):
+ (WebCore::BaseCheckableInputType::restoreFormControlState):
+ (WebCore::BaseCheckableInputType::appendFormData):
+ * html/BaseCheckableInputType.h: Added.
+ (WebCore::BaseCheckableInputType::BaseCheckableInputType):
+ * html/ButtonInputType.h: Change the super class.
+ (WebCore::ButtonInputType::ButtonInputType):
+ * html/CheckboxInputType.h: Change the super class.
+ (WebCore::CheckboxInputType::CheckboxInputType):
+ * html/FileInputType.cpp:
+ (WebCore::FileInputType::appendFormData):
+ (WebCore::FileInputType::createRenderer):
+ * html/FileInputType.h: Change the super class.
+ (WebCore::FileInputType::FileInputType):
+ * html/HTMLFormControlElement.h:
+ Make placeholderShouldBeVisible() public for access from TextFieldInputType.
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::saveFormControlState):
+ (WebCore::HTMLInputElement::restoreFormControlState):
+ (WebCore::HTMLInputElement::createRenderer):
+ (WebCore::HTMLInputElement::appendFormData):
+ * html/HTMLInputElement.h:
+ Add the following functions for ImageInputType and SubmitInputType.
+ (WebCore::HTMLInputElement::xPosition):
+ (WebCore::HTMLInputElement::yPosition):
+ * html/HiddenInputType.cpp:
+ (WebCore::HiddenInputType::createRenderer):
+ * html/HiddenInputType.h:
+ * html/ImageInputType.cpp:
+ (WebCore::ImageInputType::isFormDataAppendable):
+ (WebCore::ImageInputType::appendFormData):
+ (WebCore::ImageInputType::createRenderer):
+ * html/ImageInputType.h: Change the super class.
+ (WebCore::ImageInputType::ImageInputType):
+ * html/InputType.cpp:
+ (WebCore::InputType::saveFormControlState):
+ (WebCore::InputType::restoreFormControlState):
+ (WebCore::InputType::isFormDataAppendable):
+ (WebCore::InputType::appendFormData):
+ (WebCore::InputType::createRenderer):
+ * html/InputType.h:
+ * html/PasswordInputType.cpp:
+ (WebCore::PasswordInputType::saveFormControlState):
+ (WebCore::PasswordInputType::restoreFormControlState):
+ * html/PasswordInputType.h:
+ * html/RadioInputType.h: Change the super class.
+ (WebCore::RadioInputType::RadioInputType):
+ * html/RangeInputType.cpp:
+ (WebCore::RangeInputType::createRenderer):
+ * html/RangeInputType.h:
+ * html/ResetInputType.h:
+ (WebCore::ResetInputType::ResetInputType):
+ * html/SubmitInputType.cpp:
+ (WebCore::SubmitInputType::appendFormData):
+ * html/SubmitInputType.h: Change the super class.
+ (WebCore::SubmitInputType::SubmitInputType):
+ * html/TextFieldInputType.cpp:
+ (WebCore::TextFieldInputType::createRenderer):
+ * html/TextFieldInputType.h:
+
+2010-10-25 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fix scrolling of noncomposited iframes within composited document
+ https://bugs.webkit.org/show_bug.cgi?id=47391
+
+ When an iframe that is painting into a compositing layer is scrolled,
+ we need to repaint via the RenderObject (which dirties the compositing layer contents),
+ rather than going out to hostWindow.
+
+ Test: compositing/iframes/composited-iframe-scroll.html
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::scrollContentsSlowPath):
+ * page/FrameView.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::scrollContents):
+ (WebCore::ScrollView::scrollContentsSlowPath):
+ * platform/ScrollView.h:
+
+2010-10-25 Ryosuke Niwa <rniwa@webkit.org>
+
+ Unreviewed Qt build fix for r70496.
+
+ * bridge/qt/qt_instance.cpp:
+ (JSC::Bindings::QtInstance::numberValue):
+ * bridge/qt/qt_pixmapruntime.cpp:
+ (JSC::Bindings::QtPixmapWidthField::valueFromInstance):
+ (JSC::Bindings::QtPixmapHeightField::valueFromInstance):
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertValueToQVariant):
+ (JSC::Bindings::convertQVariantToValue):
+ (JSC::Bindings::QtRuntimeMetaMethod::lengthGetter):
+ (JSC::Bindings::QtRuntimeConnectionMethod::lengthGetter):
+
+2010-10-25 Andy Estes <aestes@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Source change by Simon Fraser.
+
+ Setting an element's visibility property to visible has no effect when
+ it has a hidden parent.
+ https://bugs.webkit.org/show_bug.cgi?id=48267
+
+ Test: fast/layers/visible-layer-with-hidden-parent.html
+
+ When a layer is hidden, there is an optimization that removes it from
+ the layer tree. If the layer is made visible again, it would only mark
+ its own stacking context's z-order list as dirty. If there are hidden
+ parent layers, they need to be marked dirty as well so layers with
+ visible descendents are re-added to the layer tree.
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::setHasVisibleContent): Dirty the z-order lists of
+ all parent stacking context render layers up to and including the first
+ visible stacking context.
+
+2010-10-25 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Remove exec and globalData arguments from jsNumber
+ https://bugs.webkit.org/show_bug.cgi?id=48270
+
+ Mechanical removal of exec parameter to jsNumber.
+
+ * bindings/js/JSAudioConstructor.cpp:
+ (WebCore::JSAudioConstructor::JSAudioConstructor):
+ * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+ (WebCore::JSCSSStyleDeclaration::nameGetter):
+ * bindings/js/JSCoordinatesCustom.cpp:
+ (WebCore::JSCoordinates::altitude):
+ (WebCore::JSCoordinates::altitudeAccuracy):
+ (WebCore::JSCoordinates::heading):
+ (WebCore::JSCoordinates::speed):
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::setTimeout):
+ (WebCore::JSDOMWindow::setInterval):
+ * bindings/js/JSDeviceMotionEventCustom.cpp:
+ (WebCore::createAccelerationObject):
+ (WebCore::createRotationRateObject):
+ (WebCore::JSDeviceMotionEvent::interval):
+ * bindings/js/JSDeviceOrientationEventCustom.cpp:
+ (WebCore::JSDeviceOrientationEvent::alpha):
+ (WebCore::JSDeviceOrientationEvent::beta):
+ (WebCore::JSDeviceOrientationEvent::gamma):
+ * bindings/js/JSGeolocationCustom.cpp:
+ (WebCore::JSGeolocation::watchPosition):
+ * bindings/js/JSHTMLInputElementCustom.cpp:
+ (WebCore::JSHTMLInputElement::selectionStart):
+ (WebCore::JSHTMLInputElement::selectionEnd):
+ * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
+ (WebCore::JSHTMLOptionsCollection::length):
+ * bindings/js/JSIDBKeyCustom.cpp:
+ (WebCore::toJS):
+ * bindings/js/JSInjectedScriptHostCustom.cpp:
+ (WebCore::InjectedScriptHost::createInjectedScript):
+ (WebCore::JSInjectedScriptHost::pushNodePathToFrontend):
+ * bindings/js/JSOptionConstructor.cpp:
+ (WebCore::JSOptionConstructor::JSOptionConstructor):
+ * bindings/js/JSSQLResultSetRowListCustom.cpp:
+ (WebCore::JSSQLResultSetRowList::item):
+ * bindings/js/JSSVGLengthCustom.cpp:
+ (WebCore::JSSVGLength::value):
+ * bindings/js/JSScriptProfileNodeCustom.cpp:
+ (WebCore::JSScriptProfileNode::callUID):
+ * bindings/js/JSWebGLRenderingContextCustom.cpp:
+ (WebCore::toJS):
+ * bindings/js/JSWorkerContextCustom.cpp:
+ (WebCore::JSWorkerContext::setTimeout):
+ (WebCore::JSWorkerContext::setInterval):
+ * bindings/js/JSWorkerContextErrorHandler.cpp:
+ (WebCore::JSWorkerContextErrorHandler::handleEvent):
+ * bindings/js/ScriptFunctionCall.cpp:
+ (WebCore::ScriptCallArgumentHandler::appendArgument):
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::CloneDeserializer::readTerminal):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bridge/c/c_instance.cpp:
+ (JSC::Bindings::CInstance::numberValue):
+ * bridge/c/c_utility.cpp:
+ (JSC::Bindings::convertNPVariantToValue):
+ * bridge/jni/jsc/JNIBridgeJSC.cpp:
+ (JavaField::valueFromInstance):
+ (JavaArray::valueAt):
+ * bridge/jni/jsc/JavaInstanceJSC.cpp:
+ (JavaInstance::numberValue):
+ (JavaInstance::invokeMethod):
+ * bridge/objc/objc_instance.mm:
+ (ObjcInstance::numberValue):
+ * bridge/objc/objc_utility.mm:
+ (JSC::Bindings::convertObjcValueToValue):
+ * bridge/runtime_array.cpp:
+ (JSC::RuntimeArray::lengthGetter):
+ * bridge/runtime_method.cpp:
+ (JSC::RuntimeMethod::lengthGetter):
+
+2010-10-21 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Allow embedder to pass on all the speech recognition results to the input element.
+ https://bugs.webkit.org/show_bug.cgi?id=48068
+
+ No new tests added as functionality has not changed, tests will be added in the next
+ patch where these results are exposed as an attribute to scripts.
+
+ * Android.mk: Added new source files.
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.xcodeproj/project.pbxproj:
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::setRecognitionResult): Accept an array instead of a single string.
+ * page/SpeechInput.h:
+ * page/SpeechInputListener.h:
+ * page/SpeechInputResult.cpp: Added, defines a class for managing a speech input result.
+ (WebCore::SpeechInputResult::create):
+ (WebCore::SpeechInputResult::SpeechInputResult):
+ (WebCore::SpeechInputResult::confidence):
+ (WebCore::SpeechInputResult::utterance):
+ * page/SpeechInputResult.h: Added.
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::timerFired):
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::InputFieldSpeechButtonElement::setRecognitionResult):
+ * rendering/TextControlInnerElements.h:
+
+2010-10-25 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Support appending an ArrayBuffer object in BlobBuilder
+ https://bugs.webkit.org/show_bug.cgi?id=47701
+
+ Test cases have been added to read-blob-test-cases.js.
+
+ * fileapi/BlobBuilder.cpp:
+ (WebCore::BlobBuilder::getBuffer):
+ (WebCore::BlobBuilder::append): Removed bool return values since they
+ weren't used.
+ * fileapi/BlobBuilder.h:
+ * fileapi/BlobBuilder.idl:
+
+2010-10-25 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Texmap] [Qt] Texture mapper initial implementation
+ https://bugs.webkit.org/show_bug.cgi?id=47070
+
+ Glue layer (WebCoreSupport) changes to allow connecting TextureMapper to a Qt PageClient, i.e.
+ a QWebView or a QGraphicsWebView. This enables the new type, TextureMapperPlatformLayer, to be recognized both by
+ the compositor and by the page client.
+ Note that this is temporarily an opt-in, under USE(TEXTURE_MAPPER)
+
+ No new tests: the existing tests under LayoutTests/compositing already cover this.
+
+ * platform/graphics/GraphicsLayer.h:
+ * platform/qt/QWebPageClient.h:
+ (QWebPageClient::setRootGraphicsLayer):
+
+2010-10-25 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Texmap] [Qt] Texture mapper initial implementation
+ https://bugs.webkit.org/show_bug.cgi?id=47070
+
+ Add a config flag and a define (WTF_USE_TEXTURE_MAPPER) to WebCore, to enable opt-in compilation of texture-mapper with Qt.
+
+ No new tests: WIP for a new implementation.
+
+ * WebCore.pro:
+
+2010-10-25 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Calling FileReader.abort during reading could cause crash
+ https://bugs.webkit.org/show_bug.cgi?id=48163
+
+ Test: fast/files/file-reader-abort.html
+
+ * fileapi/FileReader.cpp:
+ (WebCore::delayedAbort):
+ (WebCore::FileReader::abort): Schedule to do the abort later to work
+ around the case that abort() could be called from event handler.
+ (WebCore::FileReader::doAbort):
+ (WebCore::FileReader::didFail): Do not go with normal error handling
+ when we are in the process of aborting.
+ (WebCore::FileReader::failed):
+ (WebCore::FileReader::readyState):
+ * fileapi/FileReader.h:
+
+2010-10-25 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Buildfix for NetworkStateNotifier
+ https://bugs.webkit.org/show_bug.cgi?id=48240
+
+ WinCE does not support RegisterWaitForSingleObject, so disable it for now.
+
+ * platform/network/win/NetworkStateNotifierWin.cpp:
+ (WebCore::NetworkStateNotifier::NetworkStateNotifier):
+
+2010-10-25 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48257
+
+ Make "rl" and "bt" writing-modes work for blocks and lines. InlineTextBox is refactored to compute the correct
+ top left corner and left baseline edge once so that can be passed down to all the painting functions instead of
+ tx and ty.
+
+ adjustment helpers have been added that can be called before painting children or lines and that fix up
+ the coordinates from flipped to physical.
+
+ Added fast/blockflow/english-rl-text.html and fast/blockflow/english-bt-text.html
+
+ * rendering/InlineBox.cpp:
+ (WebCore::InlineBox::adjustForFlippedBlocksWritingMode):
+ * rendering/InlineBox.h:
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paintBoxDecorations):
+ (WebCore::InlineFlowBox::paintMask):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::paintTextWithShadows):
+ (WebCore::InlineTextBox::paint):
+ (WebCore::InlineTextBox::paintSelection):
+ (WebCore::InlineTextBox::paintCompositionBackground):
+ (WebCore::InlineTextBox::paintDecoration):
+ (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
+ (WebCore::InlineTextBox::paintTextMatchMarker):
+ (WebCore::InlineTextBox::computeRectForReplacementMarker):
+ (WebCore::InlineTextBox::paintDocumentMarkers):
+ (WebCore::InlineTextBox::paintCompositionUnderline):
+ * rendering/InlineTextBox.h:
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintChildren):
+ (WebCore::RenderBlock::paintFloats):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::adjustForFlippedBlocksWritingMode):
+ * rendering/RenderBox.h:
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::isFlippedBlocksWritingMode):
+
+2010-10-25 Ben Murdoch <benm@google.com>
+
+ Reviewed by Steve Block.
+
+ Build break with ENABLE(BLOB) and not ENABLE(3D_CANVAS)
+ https://bugs.webkit.org/show_bug.cgi?id=48243
+
+ Build fix only so no new tests.
+
+ * bindings/generic/RuntimeEnabledFeatures.h: Guard appropriately.
+ * bindings/v8/custom/V8ArrayBufferViewCustom.h: ditto.
+
+2010-10-25 Cris Neckar <cdn@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Added check to ensure that events with the type "mousedown" are mouse events before dispatching.
+ https://bugs.webkit.org/show_bug.cgi?id=48159
+
+ Test: fast/events/keyboardevent-mousedown-crash.html
+
+ * dom/Node.cpp:
+ (WebCore::Node::defaultEventHandler):
+
+2010-10-25 Kwang Yul Seo <skyul@company100.net>
+
+ Unreviewed build fix for r70400.
+
+ Add dummy setCookieStoragePrivateBrowsingEnabled.
+
+ * platform/brew/TemporaryLinkStubs.cpp: Added.
+ (WebCore::setCookieStoragePrivateBrowsingEnabled):
+
+2010-10-25 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Use default implementation of AXObjectCache::platformGenerateAXID
+ https://bugs.webkit.org/show_bug.cgi?id=48239
+
+ WinCE does not support NotifyWinEvent, so use the default implementation.
+
+ * accessibility/AXObjectCache.cpp:
+
+2010-10-25 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Need WebKit2 API to figure out if a frame can provide source
+ <rdar://problem/8424632>
+ https://bugs.webkit.org/show_bug.cgi?id=48252
+
+ * WebCore.exp.in:
+
+2010-10-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70451.
+ http://trac.webkit.org/changeset/70451
+ https://bugs.webkit.org/show_bug.cgi?id=48249
+
+ Broke set-unloaded-frame-location.html under Qt (Requested by
+ caseq on #webkit).
+
+ * ForwardingHeaders/wtf/text/TextPosition.h: Removed.
+ * bindings/js/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+ * bindings/v8/ScheduledAction.cpp:
+ (WebCore::ScheduledAction::ScheduledAction):
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::eventHandlerLineNumber):
+ (WebCore::ScriptController::eventHandlerColumnNumber):
+ * bindings/v8/ScriptController.h:
+ * bindings/v8/ScriptEventListener.cpp:
+ (WebCore::createAttributeEventListener):
+ * bindings/v8/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+ (WebCore::ScriptSourceCode::startLine):
+ * bindings/v8/V8LazyEventListener.cpp:
+ (WebCore::V8LazyEventListener::V8LazyEventListener):
+ (WebCore::V8LazyEventListener::prepareListenerObject):
+ * bindings/v8/V8LazyEventListener.h:
+ (WebCore::V8LazyEventListener::create):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::compileScript):
+ (WebCore::V8Proxy::evaluate):
+ (WebCore::V8Proxy::runScript):
+ * bindings/v8/V8Proxy.h:
+ * bindings/v8/WorkerContextExecutionProxy.cpp:
+ (WebCore::WorkerContextExecutionProxy::evaluate):
+ (WebCore::WorkerContextExecutionProxy::runScript):
+ * bindings/v8/WorkerContextExecutionProxy.h:
+ * bindings/v8/WorkerScriptController.cpp:
+ (WebCore::WorkerScriptController::evaluate):
+ * dom/PendingScript.cpp:
+ (WebCore::PendingScript::releaseElementAndClear):
+ * dom/PendingScript.h:
+ (WebCore::PendingScript::PendingScript):
+ (WebCore::PendingScript::operator=):
+ (WebCore::PendingScript::startingLineNumber):
+ * dom/ScriptableDocumentParser.h:
+ * dom/XMLDocumentParser.h:
+ * dom/XMLDocumentParserLibxml2.cpp:
+ (WebCore::XMLDocumentParser::XMLDocumentParser):
+ (WebCore::XMLDocumentParser::startElementNs):
+ (WebCore::XMLDocumentParser::endElementNs):
+ (WebCore::XMLDocumentParser::lineNumber):
+ (WebCore::XMLDocumentParser::columnNumber):
+ * dom/XMLDocumentParserQt.cpp:
+ (WebCore::XMLDocumentParser::XMLDocumentParser):
+ (WebCore::XMLDocumentParser::parseStartElement):
+ (WebCore::XMLDocumentParser::parseEndElement):
+ * html/parser/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
+ (WebCore::HTMLDocumentParser::columnNumber):
+ * html/parser/HTMLDocumentParser.h:
+ * html/parser/HTMLScriptRunner.cpp:
+ (WebCore::HTMLScriptRunner::sourceFromPendingScript):
+ (WebCore::HTMLScriptRunner::execute):
+ (WebCore::HTMLScriptRunner::runScript):
+ * html/parser/HTMLScriptRunner.h:
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ (WebCore::HTMLTreeBuilder::takeScriptToProcess):
+ (WebCore::HTMLTreeBuilder::processEndTag):
+ (WebCore::HTMLTreeBuilder::processScriptStartTag):
+ * html/parser/HTMLTreeBuilder.h:
+
+2010-10-25 Kwang Yul Seo <skyul@company100.net>
+
+ Unreviewed build fix for r70095.
+
+ Provide platformDefaultLanguage().
+
+ * platform/brew/LanguageBrew.cpp: Added.
+ (WebCore::platformDefaultLanguage):
+ * platform/brew/LocalizedStringsBrew.cpp:
+
+2010-10-25 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Replace _countof with WTF_ARRAY_LENGTH
+ https://bugs.webkit.org/show_bug.cgi?id=48229
+
+ * platform/win/FileSystemWin.cpp:
+ (WebCore::openTemporaryFile):
+ * platform/wince/FileSystemWinCE.cpp:
+ (WebCore::openTemporaryFile):
+ * plugins/win/PluginDatabaseWin.cpp:
+ (WebCore::addPluginPathsFromRegistry):
+ (WebCore::addWindowsMediaPlayerPluginDirectory):
+ (WebCore::addMacromediaPluginDirectories):
+
+2010-10-25 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48246
+
+ Make selectionRect() on InlineTextBox give the right value for a vertical line. Selection is still too broken
+ to test anything though.
+
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::selectionRect):
+
+2010-10-25 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ Typo in the TextureMapperGL
+ https://bugs.webkit.org/show_bug.cgi?id=48241
+
+ Fix the typo.
+
+ * platform/graphics/opengl/TextureMapperGL.cpp:
+ (WebCore::TextureMapperGL::TextureMapperGL):
+
+2010-10-25 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: slowly make old resources panel optional (continued).
+ https://bugs.webkit.org/show_bug.cgi?id=48207
+
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.set url):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel.prototype.get toolbarItemLabel):
+ (WebInspector.StoragePanel.prototype.showResource):
+ (WebInspector.StoragePanel.prototype.searchMatchFound):
+ (WebInspector.StoragePanel.prototype._findTreeElementForResource):
+ (WebInspector.StoragePanel.prototype._findTreeElementForResource.getParent):
+ (WebInspector.BaseStorageTreeElement.prototype.onattach):
+ * inspector/front-end/inspector.css:
+ (.storage.panel .sidebar):
+ (.storage.panel .sidebar li):
+ (.storage.panel .sidebar li.parent):
+ (.storage.panel .sidebar li.selected):
+ (.storage.panel .sidebar li .selection):
+ (.storage.panel .sidebar :focus li .selection):
+ (body.inactive .storage.panel .sidebar li .selection):
+ (.storage.panel .sidebar .icon):
+
+2010-10-25 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Texmap] [Qt] Texture mapper initial implementation
+ This patch adds the OpenGL implementation of TextureMapper. See the other entries from bug 47070 for details.
+ https://bugs.webkit.org/show_bug.cgi?id=47070
+
+ No new tests. Part of a new implementation.
+
+ * platform/graphics/opengl/TextureMapperGL.cpp: Added.
+ * platform/graphics/opengl/TextureMapperGL.h: Added.
+
+2010-10-25 Peter Rybin <peter.rybin@gmail.com>
+
+ Reviewed by Adam Barth.
+
+ HTML parser should provide script column position within HTML document to JavaScript engine
+ https://bugs.webkit.org/show_bug.cgi?id=45271
+
+ Replaces line number with TextPosition struct so that script engine
+ gets script starting line/column.
+
+ * ForwardingHeaders/wtf/text/TextPosition.h: Added.
+ * bindings/js/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+ * bindings/v8/ScheduledAction.cpp:
+ (WebCore::ScheduledAction::ScheduledAction):
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::eventHandlerPosition):
+ * bindings/v8/ScriptController.h:
+ * bindings/v8/ScriptEventListener.cpp:
+ (WebCore::createAttributeEventListener):
+ * bindings/v8/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+ (WebCore::ScriptSourceCode::startLine):
+ (WebCore::ScriptSourceCode::startPosition):
+ * bindings/v8/V8LazyEventListener.cpp:
+ (WebCore::V8LazyEventListener::V8LazyEventListener):
+ (WebCore::V8LazyEventListener::prepareListenerObject):
+ * bindings/v8/V8LazyEventListener.h:
+ (WebCore::V8LazyEventListener::create):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::compileScript):
+ (WebCore::V8Proxy::evaluate):
+ (WebCore::V8Proxy::runScript):
+ * bindings/v8/V8Proxy.h:
+ * bindings/v8/WorkerContextExecutionProxy.cpp:
+ (WebCore::WorkerContextExecutionProxy::evaluate):
+ (WebCore::WorkerContextExecutionProxy::runScript):
+ * bindings/v8/WorkerContextExecutionProxy.h:
+ * bindings/v8/WorkerScriptController.cpp:
+ (WebCore::WorkerScriptController::evaluate):
+ * dom/PendingScript.cpp:
+ (WebCore::PendingScript::releaseElementAndClear):
+ * dom/PendingScript.h:
+ (WebCore::PendingScript::PendingScript):
+ (WebCore::PendingScript::operator=):
+ (WebCore::PendingScript::startingPosition):
+ * dom/ScriptableDocumentParser.h:
+ * dom/XMLDocumentParser.h:
+ * dom/XMLDocumentParserLibxml2.cpp:
+ (WebCore::XMLDocumentParser::XMLDocumentParser):
+ (WebCore::XMLDocumentParser::startElementNs):
+ (WebCore::XMLDocumentParser::endElementNs):
+ (WebCore::XMLDocumentParser::lineNumber):
+ (WebCore::XMLDocumentParser::columnNumber):
+ (WebCore::XMLDocumentParser::textPosition):
+ (WebCore::XMLDocumentParser::textPositionOneBased):
+ * dom/XMLDocumentParserQt.cpp:
+ (WebCore::XMLDocumentParser::XMLDocumentParser):
+ (WebCore::XMLDocumentParser::textPosition):
+ (WebCore::XMLDocumentParser::parseStartElement):
+ (WebCore::XMLDocumentParser::parseEndElement):
+ * html/parser/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
+ (WebCore::HTMLDocumentParser::textPosition):
+ * html/parser/HTMLDocumentParser.h:
+ * html/parser/HTMLScriptRunner.cpp:
+ (WebCore::HTMLScriptRunner::sourceFromPendingScript):
+ (WebCore::HTMLScriptRunner::execute):
+ (WebCore::HTMLScriptRunner::runScript):
+ * html/parser/HTMLScriptRunner.h:
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::uninitializedPositionValue1):
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ (WebCore::HTMLTreeBuilder::takeScriptToProcess):
+ (WebCore::HTMLTreeBuilder::processEndTag):
+ (WebCore::HTMLTreeBuilder::processScriptStartTag):
+ * html/parser/HTMLTreeBuilder.h:
+
+2010-10-24 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: slowly make old resources panel optional.
+ https://bugs.webkit.org/show_bug.cgi?id=48207
+
+ * inspector/front-end/AuditsPanel.js:
+ (WebInspector.AuditsPanel.prototype._reloadResources):
+ (WebInspector.AuditsPanel.prototype.show):
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onRevealAndSelectResource):
+ * inspector/front-end/ResourcesPanel.js:
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype._sourceFrameForScriptOrResource):
+ (WebInspector.ScriptsPanel.prototype._sourceFrameForResource):
+ * inspector/front-end/inspector.js:
+ (WebInspector._createPanels):
+ (WebInspector.doLoadedDone.populateInspectorState):
+ (WebInspector.doLoadedDone):
+ (WebInspector.openResource):
+ (WebInspector.updateResource):
+ (WebInspector.domContentEventFired):
+ (WebInspector.loadEventFired):
+ (WebInspector.removeResource):
+ (WebInspector.displayNameForURL):
+ (WebInspector._choosePanelToShowSourceLine):
+ (WebInspector.doPerformSearch):
+
+2010-10-24 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: add support for errors, warnings and search to the storage panel.
+ https://bugs.webkit.org/show_bug.cgi?id=48206
+
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.addMessage):
+ (WebInspector.ConsoleView.prototype.clearMessages):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.set errors):
+ (WebInspector.Resource.prototype.set warnings):
+ (WebInspector.Resource.prototype.get searchMatches):
+ (WebInspector.Resource.prototype.set searchMatches):
+ (WebInspector.Resource.prototype.clearErrorsAndWarnings):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager):
+ (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
+ (WebInspector.ResourceManager.prototype._createResource):
+ (WebInspector.ResourceManager.prototype._appendRedirect):
+ (WebInspector.ResourceManager.prototype.didReceiveResponse):
+ (WebInspector.ResourceManager.prototype.didFinishLoading):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
+ (WebInspector.ResourceManager.prototype.didCommitLoadForFrame):
+ (WebInspector.ResourceManager.prototype.frameDetachedFromParent):
+ (WebInspector.ResourceManager.prototype._addFramesRecursively):
+ (WebInspector.ResourceManager.prototype.resourceForURL):
+ (WebInspector.ResourceManager.prototype.addConsoleMessage):
+ (WebInspector.ResourceManager.prototype.clearConsoleMessages):
+ (WebInspector.ResourceTreeModel):
+ (WebInspector.ResourceTreeModel.prototype.addOrUpdateFrame):
+ (WebInspector.ResourceTreeModel.prototype.didCommitLoadForFrame):
+ (WebInspector.ResourceTreeModel.prototype.frameDetachedFromParent):
+ (WebInspector.ResourceTreeModel.prototype._clearChildFramesAndResources):
+ (WebInspector.ResourceTreeModel.prototype.addResourceToFrame):
+ (WebInspector.ResourceTreeModel.prototype._clearResources):
+ (WebInspector.ResourceTreeModel.prototype._bindResourceURL):
+ (WebInspector.ResourceTreeModel.prototype._unbindResourceURL):
+ (WebInspector.ResourceTreeModel.prototype.resourceForURL):
+ (WebInspector.ResourceTreeModel.prototype.forAllResources):
+ (WebInspector.ResourceTreeModel.prototype._callForFrameResources):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel):
+ (WebInspector.StoragePanel.prototype.get toolbarItemLabel):
+ (WebInspector.StoragePanel.prototype.reset):
+ (WebInspector.StoragePanel.prototype.removeFrame):
+ (WebInspector.StoragePanel.prototype.canShowSourceLine):
+ (WebInspector.StoragePanel.prototype.showSourceLine):
+ (WebInspector.StoragePanel.prototype.showResource):
+ (WebInspector.StoragePanel.prototype._showResourceView):
+ (WebInspector.StoragePanel.prototype.updateMainViewWidth):
+ (WebInspector.StoragePanel.prototype.get searchableViews.callback):
+ (WebInspector.StoragePanel.prototype.get searchableViews):
+ (WebInspector.StoragePanel.prototype._forAllResourceTreeElements):
+ (WebInspector.StoragePanel.prototype.searchMatchFound):
+ (WebInspector.StoragePanel.prototype.searchCanceled.callback):
+ (WebInspector.StoragePanel.prototype.searchCanceled):
+ (WebInspector.StoragePanel.prototype.performSearch):
+ (WebInspector.StoragePanel.prototype.showView):
+ (WebInspector.BaseStorageTreeElement.prototype.onattach):
+ (WebInspector.BaseStorageTreeElement.prototype.set titleText):
+ (WebInspector.BaseStorageTreeElement.prototype.isEventWithinDisclosureTriangle):
+ (WebInspector.FrameResourceTreeElement):
+ (WebInspector.FrameResourceTreeElement.prototype.onselect):
+ (WebInspector.FrameResourceTreeElement.prototype.ondblclick):
+ (WebInspector.FrameResourceTreeElement.prototype.onattach):
+ (WebInspector.FrameResourceTreeElement.prototype._ondragstart):
+ (WebInspector.FrameResourceTreeElement.prototype._setBubbleText):
+ (WebInspector.FrameResourceTreeElement.prototype._resetBubble):
+ (WebInspector.FrameResourceTreeElement.prototype._searchMatchesUpdated):
+ (WebInspector.FrameResourceTreeElement.prototype._errorsWarningsUpdated):
+ * inspector/front-end/inspector.css:
+ (.storage.panel .sidebar):
+ (.storage.panel .outline-disclosure li):
+ (.storage.panel .outline-disclosure li.parent):
+ (.storage.panel .outline-disclosure li .selection):
+ (.storage.panel .outline-disclosure .icon):
+ (.storage.panel .base-storage-tree-element-title):
+ (.storage.panel .status):
+ (.storage.panel li .status .bubble):
+ (li .status):
+ (li .status:empty):
+ (li .status .bubble):
+ (li .status .bubble:empty):
+ (li.selected .status .bubble):
+ (:focus li.selected .status .bubble):
+ (body.inactive li.selected .status .bubble):
+ (li.selected .bubble.search-matches):
+ (:focus li.selected .bubble.search-matches):
+ (body.inactive li.selected .bubble.search-matches):
+
+2010-10-24 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Fix Qt minimal build break revealed by r70413.
+ https://bugs.webkit.org/show_bug.cgi?id=48185
+
+ * rendering/RenderMeter.h: Missing include added, needless include removed.
+
+2010-10-20 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Jian Li.
+
+ Renumber FileError/FileException error codes per latest File API spec changes
+ https://bugs.webkit.org/show_bug.cgi?id=47936
+
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::setDOMException): Added FileExceptionType case.
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::setDOMException): Added FileExceptionType case.
+ * dom/ExceptionCode.cpp:
+ (WebCore::getExceptionCodeDescription): Added code for FileException.
+ * dom/ExceptionCode.h:
+ * fileapi/AsyncFileWriterClient.h:
+ * fileapi/DirectoryEntry.cpp:
+ (WebCore::DirectoryEntry::getFile):
+ (WebCore::DirectoryEntry::getDirectory):
+ (WebCore::DirectoryEntry::removeRecursively):
+ * fileapi/DirectoryEntrySync.cpp:
+ (WebCore::DirectoryEntrySync::getFile):
+ (WebCore::DirectoryEntrySync::getDirectory):
+ (WebCore::DirectoryEntrySync::removeRecursively):
+ * fileapi/DirectoryReaderSync.cpp:
+ (WebCore::DirectoryReaderSync::readEntries):
+ * fileapi/Entry.cpp:
+ (WebCore::Entry::getMetadata):
+ (WebCore::Entry::moveTo):
+ (WebCore::Entry::copyTo):
+ (WebCore::Entry::remove):
+ (WebCore::Entry::getParent):
+ * fileapi/EntrySync.cpp:
+ (WebCore::EntrySync::getMetadata):
+ (WebCore::EntrySync::moveTo):
+ (WebCore::EntrySync::copyTo):
+ (WebCore::EntrySync::remove):
+ * fileapi/FileError.h: Added error code enum.
+ (WebCore::FileError::create):
+ (WebCore::FileError::code):
+ (WebCore::FileError::FileError):
+ * fileapi/FileError.idl: Rebased error code numbers.
+ * fileapi/FileException.h: Added exception code enum.
+ (WebCore::FileException::ErrorCodeToExceptionCode): Added.
+ * fileapi/FileException.idl: Rebased exception code numbers.
+ * fileapi/FileReader.cpp:
+ (WebCore::FileReader::abort):
+ (WebCore::FileReader::failed):
+ (WebCore::FileReader::httpStatusCodeToErrorCode): Changed from
+ httpStatuCodeToExceptionCode.
+ * fileapi/FileReader.h:
+ * fileapi/FileReaderSync.cpp:
+ (WebCore::FileReaderSyncLoader::start):
+ * fileapi/FileSystemCallbacks.cpp:
+ (WebCore::FileSystemCallbacksBase::didFail):
+ * fileapi/FileWriter.cpp:
+ (WebCore::FileWriter::write):
+ (WebCore::FileWriter::seek):
+ (WebCore::FileWriter::truncate):
+ (WebCore::FileWriter::abort):
+ (WebCore::FileWriter::didFail):
+ (WebCore::FileWriter::setError):
+ * fileapi/FileWriter.h:
+ * fileapi/SyncCallbackHelper.h:
+ (WebCore::SyncCallbackHelper::SyncCallbackHelper):
+ (WebCore::SyncCallbackHelper::getResult):
+ (WebCore::SyncCallbackHelper::setError):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::requestFileSystem):
+ * workers/WorkerContext.cpp:
+ (WebCore::WorkerContext::requestFileSystem):
+ (WebCore::WorkerContext::requestFileSystemSync):
+
+2010-10-24 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Expose HitTestResult::absoluteMediaURL() via WebKit API
+ https://bugs.webkit.org/show_bug.cgi?id=48219
+
+ * WebCore.exp.in: Export HitTestResult::absoluteMediaURL().
+
+2010-10-24 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ Need a way to determine the screen rect for a form control in WebKit2
+ <rdar://problem/8530670>
+ https://bugs.webkit.org/show_bug.cgi?id=48216
+
+ * WebCore.exp.in: Add export.
+ * dom/Element.cpp:
+ (WebCore::Element::boundsInWindowSpace):
+ * dom/Element.h:
+ Add function to return the bounding box in window (in ScrollView terminology) space,
+ this is the same space as the root viewport.
+
+2010-10-24 Andreas Kling <kling@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] ImageBuffer::platformTransformColorSpace is unnecessarily slow
+ https://bugs.webkit.org/show_bug.cgi?id=48211
+
+ Grab the QImage::bits() and do direct access instead of going through
+ QImage::pixel() and QImage::setPixel().
+
+ This is a performance optimization, so no new tests.
+
+ * platform/graphics/qt/ImageBufferQt.cpp:
+ (WebCore::ImageBuffer::platformTransformColorSpace):
+
+2010-10-24 Dirk Schulze <krit@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Filter example Chiseled from SVG Wow! is slow
+ https://bugs.webkit.org/show_bug.cgi?id=48174
+
+ Use a pointer to the ByteArray instead of the ref counted CanvasPixelArray or ImageData directly
+ to access the data for pixel manipulation on SVG Filters or SVG Masker. This is a
+ performance increase since the recurring use of the -> operator can be avoided.
+ FEConvolveMatrix and FELighting still need to change in a followup patch.
+
+ No functionality was changed. So, no new tests.
+
+ * platform/graphics/filters/FEBlend.cpp:
+ (WebCore::FEBlend::apply):
+ * platform/graphics/filters/FEColorMatrix.cpp:
+ (WebCore::luminance):
+ (WebCore::effectType):
+ (WebCore::FEColorMatrix::apply):
+ * platform/graphics/filters/FEComponentTransfer.cpp:
+ (WebCore::FEComponentTransfer::apply):
+ * platform/graphics/filters/FEComposite.cpp:
+ (WebCore::arithmetic):
+ (WebCore::FEComposite::apply):
+ * platform/graphics/filters/FEDisplacementMap.cpp:
+ (WebCore::FEDisplacementMap::apply):
+ * platform/graphics/filters/FEGaussianBlur.cpp:
+ (WebCore::boxBlur):
+ (WebCore::FEGaussianBlur::apply):
+ * platform/graphics/filters/FEMorphology.cpp:
+ (WebCore::FEMorphology::apply):
+ * platform/graphics/filters/FETurbulence.cpp:
+ (WebCore::FETurbulence::apply):
+ * rendering/RenderSVGResourceMasker.cpp:
+ (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
+
+2010-10-24 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: polish network panel UI.
+ https://bugs.webkit.org/show_bug.cgi?id=48205
+
+ * inspector/front-end/Images/frame.png:
+ * inspector/front-end/Images/networkIcon.png:
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel.prototype._createTable):
+ (WebInspector.NetworkPanel.prototype._setLargerResources):
+ (WebInspector.NetworkPanel.prototype._toggleGridMode):
+ * inspector/front-end/networkPanel.css:
+ (.network.panel .data-grid td):
+ (.network.panel .data-grid.small td):
+ (#network-views .resource-view.headers-visible .resource-view-content):
+ (#network-views.small .resource-view.headers-visible .resource-view-content):
+ (#network-views .resource-view-headers):
+ (#network-views.small .resource-view-headers):
+ (#network-views .resource-view .tabbed-pane-header):
+ (#network-views.small .resource-view .tabbed-pane-header):
+
+2010-10-24 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Convert SVGAngle to the new SVGPropertyTearOff concept, reimplement it properly
+ https://bugs.webkit.org/show_bug.cgi?id=48179
+
+ Fix WebGL tests. Accept 'boolean' as valid numeric type in StrictTypeChecking mode.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+
+2010-10-24 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Convert SVGAngle to the new SVGPropertyTearOff concept, reimplement it properly
+ https://bugs.webkit.org/show_bug.cgi?id=48179
+
+ Speculative fix for the WebGL tests, I was not aware they're not run on Leopard, so I missed the breakage.
+
+ * bindings/scripts/CodeGeneratorJS.pm: Restore the order of type checking in the 'StrictTypeChecking' code.
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+
+2010-10-23 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Convert SVGAngle to the new SVGPropertyTearOff concept, reimplement it properly
+ https://bugs.webkit.org/show_bug.cgi?id=48179
+
+ Rewrite SVGAngle to use the new SVGPropertyTearOff concept, and consume much less memory.
+ Down from two floats, one string and an ushort to one float and one ushort. Synchronize value/valueInSpecifiedUnits/valueAsString on demand.
+
+ Adding an extensive SVGAngle test, that required to implement 'StrictTypeChecking' for attribute setters (was only implemented in V8/JSC for function cals so far).
+
+ Test: svg/dom/SVGAngle.html
+
+ * GNUmakefile.am: Add SVGAnimatedAngle.h to build.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * bindings/scripts/CodeGenerator.pm: Split IsPrimitiveType in IsPrimitiveType and IsNumericType.
+ * bindings/scripts/CodeGeneratorJS.pm: Implement 'StrictTypeChecking' for setters and recognize SVGAngle as new SVGPropertyTearOff type.
+ * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove SVGAngle handling.
+ * svg/DeprecatedSVGAnimatedTemplate.h: Remove SVGAnimatedAngle handling.
+ * svg/SVGAngle.cpp: Rewrite, to consume less memory and to operate more efficient.
+ * svg/SVGAngle.h: Ditto.
+ * svg/SVGAngle.idl: Add 'StrictTypeChecking' to the value/valueInSpecifiedUnits methods.
+ * svg/SVGAnimatedAngle.h: Added.
+ * svg/SVGAnimatedAngle.idl: Mark as [SVGAnimatedProperty].
+ * svg/SVGMarkerElement.cpp:
+ (WebCore::SVGMarkerElement::parseMappedAttribute): SVGAngle::setValueAsString() now takes an ExceptionCode parameter.
+ * svg/SVGMarkerElement.h: s/ANIMATED_PROPERTY/ANIMATED_PROPERTY_NEW/ for the SVGAngle type.
+ * svg/SVGNumber.idl: Remove exception setter exceptions, which aren't needed. As we're now generating exception handlers in the bindings, it would lead to compile errors.
+ * svg/SVGPoint.idl: Ditto.
+ * svg/SVGRect.idl: Ditto.
+ * svg/SVGSVGElement.idl: Remove obsolete [SVGLiveProperty] flag.
+
+2010-10-23 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Adam Barth.
+
+ Remove unused method HTMLFrameElementBase::setNameAndOpenURLCallback()
+ https://bugs.webkit.org/show_bug.cgi?id=48197
+
+ With the landing of the patch for bug #45365 in
+ changeset 67182 <http://trac.webkit.org/changeset/67182>,
+ HTMLFrameElementBase::setNameAndOpenURLCallback() is not needed.
+ Therefore, we remove it.
+
+ Before changeset 67182, HTMLFrameElementBase::attach() set up a post-attach
+ callback to HTMLFrameElementBase::setNameAndOpenURLCallback(). Changeset 67182
+ removed this callback.
+
+ No functionality was changed. So, no new tests.
+
+ * html/HTMLFrameElementBase.cpp: Remove HTMLFrameElementBase::setNameAndOpenURLCallback().
+ * html/HTMLFrameElementBase.h: Ditto.
+
+2010-10-23 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Sam Weinig.
+
+ Unify globalData APIs
+ https://bugs.webkit.org/show_bug.cgi?id=47969
+
+ Adapt code to JSGlobalObject::globalData returning a reference
+ instead of a pointer.
+
+ * bindings/js/JSCallbackData.cpp:
+ (WebCore::JSCallbackData::invokeCallback):
+ * bindings/js/JSCustomXPathNSResolver.cpp:
+ (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
+ * bindings/js/JSEventListener.cpp:
+ (WebCore::JSEventListener::handleEvent):
+ * bindings/js/JSWorkerContextCustom.cpp:
+ (WebCore::JSWorkerContext::markChildren):
+ * bindings/js/JSWorkerContextErrorHandler.cpp:
+ (WebCore::JSWorkerContextErrorHandler::handleEvent):
+ * bindings/js/ScheduledAction.cpp:
+ (WebCore::ScheduledAction::executeFunctionInContext):
+ * bindings/js/WorkerScriptController.cpp:
+ (WebCore::WorkerScriptController::evaluate):
+ * bridge/NP_jsobject.cpp:
+ (_NPN_InvokeDefault):
+ (_NPN_Invoke):
+ (_NPN_Evaluate):
+ (_NPN_Construct):
+
+2010-10-23 Alexey Proskuryakov <ap@apple.com>
+
+ Windows debug build fix.
+
+ * platform/network/cf/CookieStorageCFNet.cpp: Include MainThread.h for isMainThread().
+
+2010-10-23 Alexey Proskuryakov <ap@apple.com>
+
+ Windows build fix.
+
+ * platform/network/cf/CookieStorageCFNet.cpp:
+ (WebCore::setCookieStoragePrivateBrowsingEnabled): It's adoptCF, not adoptPtr.
+
+2010-10-23 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48083
+ <rdar://problem/8489082> Need WebKit2 API for private browsing (48083)
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ Added CookieStorage.h to build files that contain headers.
+
+ * WebCore.xcodeproj/project.pbxproj: Added CookieStorage.h and CookieStorageMac.mm.
+
+ * WebCore.exp.in: Export _wkSetCookieStoragePrivateBrowsingEnabled (WebKit initializes WKSI
+ on WebCore's behalf).
+
+ * platform/mac/WebCoreSystemInterface.h:
+ * platform/mac/WebCoreSystemInterface.mm:
+ More work for passing the function pointer down to WebCore.
+
+ * page/Settings.cpp: (WebCore::Settings::setPrivateBrowsingEnabled): Tell cookie manager to
+ when to use private browsing mode. Note that although this is a per-page setting, it
+ actually has global effect.
+
+ * page/Settings.h: Extended a comment about what private browsing does.
+
+ * platform/android/TemporaryLinkStubs.cpp: (setCookieStoragePrivateBrowsingEnabled):
+ * platform/chromium/TemporaryLinkStubs.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ * platform/efl/TemporaryLinkStubs.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ * platform/gtk/TemporaryLinkStubs.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ * platform/haiku/TemporaryLinkStubs.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ * platform/qt/TemporaryLinkStubsQt.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ Added an empty implementation for ports that don't implement private browsing, or implement
+ it in ways I cannot discover.
+
+ * platform/network/CookieStorage.h: Added. I'm not entirely sure how this is different from
+ CookieJar.h, just following a precedent already set by Windows port with CookieStorageWin.h.
+
+ * platform/network/mac/CookieStorageMac.mm: Added.
+ (WebCore::setCookieStoragePrivateBrowsingEnabled): Call a WKSI function to enable private
+ browsing mode for cookies.
+
+ * platform/network/cf/CookieStorageCFNet.cpp:
+ (WebCore::currentCookieStorage): Added ASSERT(isMainThread()).
+ (WebCore::setCurrentCookieStorage): Ditto.
+ (WebCore::setCookieStoragePrivateBrowsingEnabled): Set cookie storage to a private one
+ when in private browsing mode. ResourceHandle applies the storage to each individual request.
+
+ * platform/network/cf/CookieStorageCFNet.h: Added a comment explaining that these functions
+ are only for WebKit1.
+
+2010-10-23 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48181> Add missing include of MacErrors.h
+
+ Reviewed by Alexey Proskuryakov.
+
+ * platform/network/mac/FormDataStreamMac.mm: Added #import of
+ <MacErrors.h> for iOS since the formOpen() method uses "fnfErr",
+ which was added in r55670. The same header is included through
+ <CoreServices/CoreServices.h> on Mac OS X.
+
+2010-10-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ [WINCE] Port COMPtr.h to WinCE
+ https://bugs.webkit.org/show_bug.cgi?id=48190
+
+ Don't include guiddef.h on WinCE. It's not required and only creates build problems.
+
+ * platform/win/COMPtr.h:
+
+2010-10-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ [WINCE] Rename SharedBitmap::createInstance to SharedBitmap::create
+ https://bugs.webkit.org/show_bug.cgi?id=48180
+
+ Also use better arguments for the create function.
+
+ * platform/graphics/wince/GraphicsContextWinCE.cpp:
+ (WebCore::GraphicsContextPlatformPrivate::getTransparentLayerBitmap):
+ (WebCore::TransparentLayerDC::TransparentLayerDC):
+ (WebCore::GraphicsContext::drawFrameControl):
+ * platform/graphics/wince/ImageBufferWinCE.cpp:
+ (WebCore::ImageBufferData::ImageBufferData):
+ * platform/graphics/wince/ImageWinCE.cpp:
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+
+2010-10-23 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, rolling out r70369.
+ http://trac.webkit.org/changeset/70369
+ https://bugs.webkit.org/show_bug.cgi?id=47974
+
+ Caused weird artifacts in expected results.
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * loader/CachedImage.cpp:
+ (WebCore::CachedImage::createImage):
+ * platform/graphics/ImageSource.h:
+ * platform/image-decoders/ImageDecoder.cpp:
+ (WebCore::RGBA32Buffer::operator=):
+ (WebCore::RGBA32Buffer::clear):
+ (WebCore::RGBA32Buffer::zeroFill):
+ (WebCore::RGBA32Buffer::copyBitmapData):
+ (WebCore::RGBA32Buffer::setSize):
+ * platform/image-decoders/ImageDecoder.h:
+ (WebCore::RGBA32Buffer::getAddr):
+ * platform/image-decoders/cairo/ImageDecoderCairo.cpp:
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+ * platform/image-decoders/cg/ImageDecoderCG.cpp: Removed.
+ * platform/image-decoders/haiku/ImageDecoderHaiku.cpp:
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+ * platform/image-decoders/openvg/ImageDecoderOpenVG.cpp:
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+ * platform/image-decoders/wx/ImageDecoderWx.cpp:
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+
+2010-10-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ WebP decoding hits ASSERT
+ https://bugs.webkit.org/show_bug.cgi?id=48168
+
+ Calling reserveCapacity only allocates the memory. It doesn't actually
+ set the length. When you try to access the zeroth element, you hit an
+ ASSERT.
+
+ Covered by fast/images/webp-image-decoding.html in debug.
+
+ * platform/image-decoders/webp/WEBPImageDecoder.cpp:
+ (WebCore::WEBPImageDecoder::decode):
+
+2010-10-23 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Menu list buttons do react properly to CSS styling
+ https://bugs.webkit.org/show_bug.cgi?id=48099
+
+ Correct the way that menu list buttons get their necessary padding from
+ GTK+. Instead of resetting the padding to these values, return them via
+ the popupInternalPadding* methods. Add implementations for *MenuListButton*
+ methods.
+
+ * platform/gtk/RenderThemeGtk.cpp:
+ (WebCore::getComboBoxPadding): Added.
+ (WebCore::RenderThemeGtk::popupInternalPaddingLeft): Added.
+ (WebCore::RenderThemeGtk::popupInternalPaddingRight): Added.
+ (WebCore::RenderThemeGtk::popupInternalPaddingTop): Added.
+ (WebCore::RenderThemeGtk::popupInternalPaddingBottom): Added.
+ (WebCore::RenderThemeGtk::adjustMenuListStyle): Do not reset CSS
+ properties, instead rely on the poupInternalPadding* methods.
+ (WebCore::RenderThemeGtk::adjustMenuListButtonStyle): Added.
+ (WebCore::RenderThemeGtk::paintMenuListButton): Added.
+ * platform/gtk/RenderThemeGtk.h: Added new method declarations.
+
+2010-10-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Add Gradient::hasAlpha
+ https://bugs.webkit.org/show_bug.cgi?id=48183
+
+ WinCE can do some performance improvements if the gradient is opaque.
+
+ * platform/graphics/Gradient.cpp:
+ (WebCore::Gradient::hasAlpha):
+ * platform/graphics/Gradient.h:
+
+2010-10-23 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Reviewed by David Kilzer.
+
+ [EFL] Implement platformDefaultLanguage()
+ https://bugs.webkit.org/show_bug.cgi?id=48113
+
+ Implement the platformDefaultLanguage() function for EFL port.
+
+ * platform/efl/LanguageEfl.cpp:
+ (WebCore::platformDefaultLanguage):
+
+2010-10-23 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70367.
+ http://trac.webkit.org/changeset/70367
+ https://bugs.webkit.org/show_bug.cgi?id=48176
+
+ It made 8-10 tests crash on Qt bot (Requested by Ossy on
+ #webkit).
+
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::MainResourceLoader):
+ (WebCore::MainResourceLoader::continueAfterContentPolicy):
+ (WebCore::MainResourceLoader::didReceiveResponse):
+ (WebCore::MainResourceLoader::setDefersLoading):
+ * loader/MainResourceLoader.h:
+
+2010-10-22 Andy Estes <aestes@apple.com>
+
+ Reviewed by Adam Roben and Sam Weinig.
+
+ WebKit shouldn't load a plug-in based on file extension if a MIME type
+ is specified.
+ https://bugs.webkit.org/show_bug.cgi?id=48046
+
+ The fix landed in r70332 only covered the Mac port. Implement this fix
+ for other ports as well.
+
+ * plugins/PluginDatabase.cpp:
+ (WebCore::PluginDatabase::findPlugin):
+
+2010-10-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel, Peter Kasting, and Darin Fisher.
+ (Eric reviewed the CoreGraphics interactions, Peter reviewed the image
+ decoder interaction, and Darin Fisher SGTMed the policy decision.)
+
+ [chromium] Chromium Mac should use WebKit's image decoders
+ https://bugs.webkit.org/show_bug.cgi?id=47974
+
+ This patch teaches WebKit's image decoders how to talk to CoreGraphics.
+ This patch doesn't handle color profiles, but that will come in a
+ subsequent patch.
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * loader/CachedImage.cpp:
+ (WebCore::CachedImage::createImage):
+ * platform/graphics/ImageSource.h:
+ * platform/image-decoders/ImageDecoder.cpp:
+ (WebCore::RGBA32Buffer::clear):
+ (WebCore::RGBA32Buffer::zeroFill):
+ (WebCore::RGBA32Buffer::copyBitmapData):
+ (WebCore::RGBA32Buffer::setSize):
+ * platform/image-decoders/ImageDecoder.h:
+ (WebCore::RGBA32Buffer::getAddr):
+ * platform/image-decoders/cg: Added.
+ * platform/image-decoders/cg/ImageDecoderCG.cpp: Added.
+ (WebCore::RGBA32Buffer::copyBitmapData):
+ (WebCore::RGBA32Buffer::setSize):
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+
+2010-10-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam Barth and Darin Adler.
+
+ Using the decidePolicyForMIMEType delegate message in an asynchronous manner does not work
+ https://bugs.webkit.org/show_bug.cgi?id=48014
+ <rdar://problem/8202716>
+
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::continueAfterContentPolicy):
+ Resume loading.
+
+ (WebCore::MainResourceLoader::didReceiveResponse):
+ Defer loading until we hear back from the policy client.
+
+2010-10-22 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ REGRESSION(66391): http://ligth-arts.all-up.com/ crashes in EventHandler::selectCursor
+ https://bugs.webkit.org/show_bug.cgi?id=47942
+
+ Add checks for a NULL StyleImage in a CursorList.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::loadPendingImages):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::selectCursor):
+ * rendering/style/CursorList.h:
+ (WebCore::CursorList::at):
+ * manual-tests/cursor-empty-url.html: Added.
+ * manual-tests/resources/cursor-empty-url.css: Added.
+
+2010-10-22 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48156
+
+ Make vertical lines hit test properly and show a vertical i-beam cursor. Numerous bugs with overflow were discovered while getting this to work,
+ so these are in the patch as well. The broken layout tests are fixed by the overflow bug fixes as well (which just restore the old behavior).
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::selectCursor):
+ * rendering/InlineBox.h:
+ (WebCore::InlineBox::width):
+ (WebCore::InlineBox::height):
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::placeBoxesInInlineDirection):
+ (WebCore::InlineFlowBox::computeBlockDirectionOverflow):
+ (WebCore::InlineFlowBox::nodeAtPoint):
+ * rendering/InlineFlowBox.h:
+ (WebCore::InlineFlowBox::logicalTopVisibleOverflow):
+ (WebCore::InlineFlowBox::logicalBottomVisibleOverflow):
+ (WebCore::InlineFlowBox::visibleOverflowRect):
+ (WebCore::InlineFlowBox::layoutOverflowRect):
+ (WebCore::InlineFlowBox::logicalTopLayoutOverflow):
+ (WebCore::InlineFlowBox::logicalBottomLayoutOverflow):
+ (WebCore::InlineFlowBox::visualOverflowRect):
+ (WebCore::InlineFlowBox::logicalTopVisualOverflow):
+ (WebCore::InlineFlowBox::logicalBottomVisualOverflow):
+ (WebCore::InlineFlowBox::setBlockDirectionOverflowPositions):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::nodeAtPoint):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::blockDirectionOverflow):
+ * rendering/RenderBox.h:
+ * rendering/RenderLineBoxList.cpp:
+ (WebCore::RenderLineBoxList::hitTest):
+
+2010-10-22 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ <rdar://problem/8251616> Layout not updating in a subtree when a scrollbar is hidden in a flexbox descendant
+ https://bugs.webkit.org/show_bug.cgi?id=48154
+
+ Test: scrollbars/hidden-scrollbar-prevents-layout.html
+
+ updateScrollInfoAfterLayout() calling setHasHorizontalScrollbar() caused updateScrollbarParts()
+ to call setChildNeedsLayout() on the overflow, because the RenderScrollbar was created with
+ the default thickness instead of the thickness specified in style. This led to the the overflow’s
+ parent to be re-marked for layout during its own parent’s finishDelayUpdateScrollInfo(), and
+ the result was that at the end of RenderView::layout(), there was a dirty renderer.
+
+ * rendering/RenderScrollbar.cpp:
+ (WebCore::RenderScrollbar::RenderScrollbar): Set the frame size in the 'display: none' and
+ 'visibility: hidden' cases as well.
+
+2010-10-22 Patrick Gansterer <paroga@webkit.org>
+
+ Unreviewed.
+
+ [WINCE] Build fix after r70143.
+
+ * platform/graphics/wince/ImageBufferWinCE.cpp:
+ (WebCore::ImageBuffer::ImageBuffer):
+
+2010-10-22 Adam Roben <aroben@apple.com>
+
+ Windows build fix
+
+ r70319 added Windows-native versions of the various platform/network
+ headers to platform/network/win. WebCoreGenerated was copying these
+ headers over the CFNetwork-specific versions in $WebKitOutputDir,
+ leading to the wrong headers being used in WebKit.
+
+ This patch changes WebCoreGenerated not to copy any headers from
+ platform/network/win into $WebKitOutputDir. Instead, only headers from
+ platform/network/cf or platform/network/curl (as specified) are copied.
+ There were some CFNetwork-specific files still hanging around in
+ platform/network/win; these have been moved to platform/network/cf.
+
+ * WebCore.vcproj/WebCore.vcproj: Updated for file moves and let VS
+ * format the file as it saw fit.
+
+ * WebCore.vcproj/WebCoreGenerated.vcproj: Added the various scripts
+ * this project uses to make editing them easier.
+
+ * WebCore.vcproj/copyForwardingHeaders.cmd: Changed not to copy any
+ * headers from platform/network/win.
+
+ * platform/network/cf/CookieJarCFNet.cpp: Renamed from WebCore/platform/network/win/CookieJarCFNetWin.cpp.
+ * platform/network/cf/CookieStorageCFNet.cpp: Renamed from WebCore/platform/network/win/CookieStorageWin.cpp.
+ * platform/network/cf/CookieStorageCFNet.h: Renamed from WebCore/platform/network/win/CookieStorageWin.h.
+
+ * platform/network/cf/ResourceHandleCFNet.cpp: Updated for rename.
+
+ * platform/network/cf/AuthenticationChallenge.h:
+ * platform/network/cf/ResourceError.h:
+ * platform/network/cf/ResourceRequest.h:
+ * platform/network/cf/ResourceResponse.h:
+ * platform/network/cf/SocketStreamError.h:
+ * platform/network/cf/SocketStreamHandle.h:
+ Touched to force a re-copy.
+
+2010-10-22 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ Add code in getMatchedCSSRules to block cross origin access to stylesheet data. Prevent access
+ in Javascript to non author stylesheets.
+ https://bugs.webkit.org/show_bug.cgi?id=46853
+
+ Tests: http/tests/security/cross-origin-getMatchedCSSRules.html
+ http/tests/security/cross-origin-getMatchedCSSRules2.html
+
+ * css/CSSRule.h:
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::matchRulesForList):
+ (WebCore::CSSStyleSelector::SelectorChecker::SelectorChecker):
+ (WebCore::CSSStyleSelector::styleRulesForElement):
+ (WebCore::CSSStyleSelector::pseudoStyleRulesForElement):
+ * css/CSSStyleSelector.h:
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::getMatchedCSSRules):
+ * page/DOMWindow.idl:
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 needs to pass the current event modifier flags when requesting a new window
+ https://bugs.webkit.org/show_bug.cgi?id=48140
+
+ Store the NavigationAction used for the newWindowPolicyDecision in the PolicyCallback
+ so that it can be used after the decision has been made in further callbacks.
+
+ * WebCore.exp.in: Fix export name for new function signature.
+ * loader/EmptyClients.h:
+ (WebCore::EmptyChromeClient::createWindow):
+ (WebCore::EmptyFrameLoaderClient::dispatchCreatePage):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::callContinueLoadAfterNewWindowPolicy):
+ (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
+ (WebCore::createWindow):
+ * loader/FrameLoader.h:
+ * loader/FrameLoaderClient.h:
+ * loader/PolicyCallback.cpp:
+ (WebCore::PolicyCallback::set):
+ (WebCore::PolicyCallback::call):
+ (WebCore::PolicyCallback::cancel):
+ * loader/PolicyCallback.h:
+ * loader/PolicyChecker.cpp:
+ (WebCore::PolicyChecker::checkNewWindowPolicy):
+ * page/Chrome.cpp:
+ (WebCore::Chrome::createWindow):
+ * page/Chrome.h:
+ * page/ChromeClient.h:
+ * page/ContextMenuController.cpp:
+ (WebCore::openNewWindow):
+
+2010-10-22 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48149
+
+ Update block direction line overflow computation to be writing-mode-aware.
+
+ * rendering/InlineBox.h:
+ (WebCore::InlineBox::logicalBottom):
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::computeBlockDirectionOverflow):
+ * rendering/InlineFlowBox.h:
+ (WebCore::InlineFlowBox::setInlineDirectionOverflowPositions):
+ (WebCore::InlineFlowBox::setBlockDirectionOverflowPositions):
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::layoutInlineChildren):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::blockDirectionOverflow):
+ * rendering/RenderBox.h:
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::addHighlightOverflow):
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::getTextShadowBlockDirectionExtent):
+ (WebCore::InheritedFlags::getBoxShadowBlockDirectionExtent):
+ (WebCore::InheritedFlags::getShadowBlockDirectionExtent):
+
+2010-10-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ ASSERT while viewing Google C++ style guide
+ https://bugs.webkit.org/show_bug.cgi?id=48148
+
+ This code used to stop the parser twice. Instead of reaching in an
+ trying to stop the parser manually, we now just let close() do the work
+ for us.
+
+ Test: fast/xsl/transform-to-html.xml
+
+ * xml/XSLTProcessor.cpp:
+ (WebCore::XSLTProcessor::createDocumentFromSource):
+
+2010-10-22 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Implement GraphicsContext::(get|release)WindowsContext
+ https://bugs.webkit.org/show_bug.cgi?id=48136
+
+ * platform/graphics/wince/GraphicsContextWinCE.cpp:
+ (WebCore::GraphicsContext::getWindowsContext):
+ (WebCore::GraphicsContext::releaseWindowsContext):
+
+2010-10-22 Adam Roben <aroben@apple.com>
+
+ Attempt to fix the Windows build
+
+ * platform/network/win/CookieJarCFNetWin.cpp: Add a missing #include.
+
+2010-10-22 Cosmin Truta <ctruta@chromium.org>
+
+ Reviewed by Dirk Schulze.
+
+ getBoundingClientRect does not work with SVG <text>
+ https://bugs.webkit.org/show_bug.cgi?id=46775
+
+ Added back to SVGStyledTransformableElement overloads of the following
+ methods: nearestViewportElement, farthestViewportElement, getBBox.
+ This was necessary to appease the Visual C++ compiler, which warned on
+ inheritance via dominance.
+
+ * svg/SVGStyledTransformableElement.cpp:
+ * svg/SVGStyledTransformableElement.h:
+ (SVGStyledTransformableElement::nearestViewportElement):
+ (SVGStyledTransformableElement::farthestViewportElement):
+ (SVGStyledTransformableElement::getBBox):
+
+2010-10-21 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Content in <iframe> doesn't appear when going back to http://webkit.org/blog/386/3d-transforms/
+ https://bugs.webkit.org/show_bug.cgi?id=32447
+
+ Added documentDidBecomeActive() when document comes back from cache to cause compositing
+ layers in iframes to be reattached.
+
+ There is no layout test, but I added a manual test. This test is ready to be a layout test
+ but currently DRT disables the WebCore page cache, so the back/forward essentially do a
+ page load which does not exhibit the bug.
+
+ * history/CachedFrame.cpp:
+ (WebCore::CachedFrameBase::restore):
+ * manual-tests/compositing/show-composited-iframe-on-back-button.html: Added.
+
+2010-10-22 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WIN] Add Windows specific files for platform/network/win
+ https://bugs.webkit.org/show_bug.cgi?id=27376
+
+ * platform/network/win/AuthenticationChallenge.h: Added.
+ (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+ * platform/network/win/ResourceError.h: Added.
+ (WebCore::ResourceError::ResourceError):
+ * platform/network/win/ResourceRequest.h: Added.
+ (WebCore::ResourceRequest::ResourceRequest):
+ (WebCore::ResourceRequest::doUpdatePlatformRequest):
+ (WebCore::ResourceRequest::doUpdateResourceRequest):
+ (WebCore::ResourceRequest::doPlatformCopyData):
+ (WebCore::ResourceRequest::doPlatformAdopt):
+ * platform/network/win/ResourceResponse.h: Added.
+ (WebCore::ResourceResponse::ResourceResponse):
+ (WebCore::ResourceResponse::doPlatformCopyData):
+ (WebCore::ResourceResponse::doPlatformAdopt):
+
+2010-10-22 Adam Barth <abarth@webkit.org>
+
+ Unreviewed, rolling out r70290.
+ http://trac.webkit.org/changeset/70290
+ https://bugs.webkit.org/show_bug.cgi?id=48111
+
+ Undelete Android build files.
+
+ * Android.mk: Added.
+
+2010-10-22 Cosmin Truta <ctruta@chromium.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ getBoundingClientRect does not work with SVG <text>
+ https://bugs.webkit.org/show_bug.cgi?id=46775
+
+ Dispatched the calls from Element::getBoundingClientRect to getBBox
+ through SVGElement::boundingBox.
+ Recognized SVGTextElement in addition to SVGStyledLocatableElement
+ as a class that provides getBBox.
+ Fixed the result of zooming: adjusted the getBoundingClientRect rectangle
+ for absolute zoom, even for SVG elements.
+
+ Additional cleanup task:
+ Removed redundant overloads of SVGStyledTransformableElement
+ methods: nearestViewportElement, farthestViewportElement, getBBox.
+ These methods are already inherited from SVGStyledLocatableElement.
+
+ Test: css3/zoom-coords.xhtml
+
+ * WebCore.xcodeproj/project.pbxproj: Set role of SVGLocatable.h to private.
+ * dom/Element.cpp:
+ (Element::getBoundingClientRect): Used SVGElement::boundingBox.
+ Adjusted coordinates for absolute zoom, for all kinds of elements.
+ * svg/SVGElement.cpp:
+ * svg/SVGElement.h:
+ (SVGElement::boundingBox): Added.
+ * svg/SVGStyledTransformableElement.cpp:
+ * svg/SVGStyledTransformableElement.h:
+ (SVGStyledTransformableElement::nearestViewportElement): Removed.
+ (SVGStyledTransformableElement::farthestViewportElement): Removed.
+ (SVGStyledTransformableElement::getBBox): Removed.
+
+2010-10-22 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WIN] Add stubs for SocketStream classes
+ https://bugs.webkit.org/show_bug.cgi?id=47983
+
+ * platform/network/win/SocketStreamError.h: Copied from WebCore/platform/network/curl/SocketStreamError.h.
+ (WebCore::SocketStreamError::SocketStreamError):
+ * platform/network/win/SocketStreamHandle.h: Copied from WebCore/platform/network/curl/SocketStreamHandle.h.
+ (WebCore::SocketStreamHandle::create):
+ * platform/network/win/SocketStreamHandleWin.cpp: Copied from WebCore/platform/network/curl/SocketStreamHandleCurl.cpp.
+
+2010-10-22 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Disable cache in ResourceHandleWin
+ https://bugs.webkit.org/show_bug.cgi?id=48128
+
+ The caching of windows does not work correctly, so disable it for now.
+
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::start):
+
+2010-10-22 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Regression (r69548): cancelled autocorrection suggestion is still applied.
+ https://bugs.webkit.org/show_bug.cgi?id=48081
+ <rdar://problem/8579765>
+
+ The test requires a 0.3 second delay using setTimeout(). So we put it in manual-tests.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::handleRejectedCorrection): Clear autocorrection info when user dismissed the panel.
+ * manual-tests/autocorrection/autocorrection-cancelled-by-ESC.html: Added.
+
+2010-10-22 Andreas Kling <kling@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Gtk] Fix canvas/philip/tests/2d.path.isPointInPath.nonfinite.html
+ https://bugs.webkit.org/show_bug.cgi?id=48133
+
+ * platform/graphics/cairo/PathCairo.cpp:
+ (WebCore::Path::contains): Return false if any x or y are nonfinite.
+
+2010-10-22 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Implement property toggling in InspectorCSSAgent
+
+ This change implements enablement/disablement and setting of style properties.
+ Disabled properties are persisted in the (top-level) scope of InspectorStyleSheet.
+ https://bugs.webkit.org/show_bug.cgi?id=47339
+
+ Drive-by: fixes for the Web Inspector Protocol format.
+
+ * inspector/InspectorCSSAgent.cpp:
+ (WebCore::InspectorCSSAgent::getComputedStyleForNode2):
+ (WebCore::InspectorCSSAgent::getInheritedStylesForNode2):
+ (WebCore::InspectorCSSAgent::setPropertyText2):
+ (WebCore::InspectorCSSAgent::toggleProperty2):
+ (WebCore::InspectorCSSAgent::setRuleSelector2):
+ (WebCore::InspectorCSSAgent::buildObjectForAttributeStyles):
+ * inspector/InspectorCSSAgent.h:
+ * inspector/InspectorStyleSheet.cpp:
+ (WebCore::InspectorStyle::buildObjectForStyle):
+ (WebCore::InspectorStyle::setPropertyText):
+ (WebCore::InspectorStyle::toggleProperty):
+ (WebCore::InspectorStyle::disabledIndexByOrdinal):
+ (WebCore::InspectorStyle::styleText):
+ (WebCore::InspectorStyle::disableProperty):
+ (WebCore::InspectorStyle::enableProperty):
+ (WebCore::InspectorStyle::populateAllProperties):
+ (WebCore::InspectorStyle::populateObjectWithStyleProperties):
+ (WebCore::InspectorStyle::shiftDisabledProperties):
+ (WebCore::InspectorStyle::replacePropertyInStyleText):
+ (WebCore::InspectorStyle::shorthandValue):
+ (WebCore::InspectorStyle::shorthandPriority):
+ (WebCore::InspectorStyle::longhandProperties):
+ (WebCore::InspectorStyleSheet::setText):
+ (WebCore::InspectorStyleSheet::setRuleSelector):
+ (WebCore::InspectorStyleSheet::addRule):
+ (WebCore::InspectorStyleSheet::ruleForId):
+ (WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
+ (WebCore::InspectorStyleSheet::buildObjectForRule):
+ (WebCore::InspectorStyleSheet::buildObjectForStyle):
+ (WebCore::InspectorStyleSheet::setPropertyText):
+ (WebCore::InspectorStyleSheet::toggleProperty):
+ (WebCore::InspectorStyleSheet::styleForId):
+ (WebCore::InspectorStyleSheet::inspectorStyleForId):
+ (WebCore::InspectorStyleSheet::rememberInspectorStyle):
+ (WebCore::InspectorStyleSheet::forgetInspectorStyle):
+ (WebCore::InspectorStyleSheet::ruleOrStyleId):
+ (WebCore::InspectorStyleSheet::ensureText):
+ (WebCore::InspectorStyleSheet::setStyleText):
+ (WebCore::InspectorStyleSheet::styleSheetTextWithChangedStyle):
+ (WebCore::InspectorStyleSheet::ruleId):
+ (WebCore::InspectorStyleSheet::revalidateStyle):
+ (WebCore::InspectorStyleSheet::originalStyleSheetText):
+ (WebCore::InspectorStyleSheet::resourceStyleSheetText):
+ (WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
+ (WebCore::InspectorStyleSheetForInlineStyle::setStyleText):
+ (WebCore::InspectorStyleSheetForInlineStyle::inspectorStyleForId):
+ * inspector/InspectorStyleSheet.h:
+ (WebCore::InspectorCSSId::createFromParts):
+ (WebCore::InspectorCSSId::InspectorCSSId):
+ (WebCore::InspectorCSSId::styleSheetId):
+ (WebCore::InspectorCSSId::ordinal):
+ (WebCore::InspectorCSSId::isEmpty):
+ (WebCore::InspectorCSSId::asString):
+ (WebCore::InspectorStyleProperty::InspectorStyleProperty):
+ (WebCore::InspectorStyle::create):
+ (WebCore::InspectorStyle::InspectorStyle):
+ (WebCore::InspectorStyle::cssStyle):
+ (WebCore::InspectorStyle::hasDisabledProperties):
+ (WebCore::InspectorStyleSheet::styleId):
+ (WebCore::InspectorStyleSheetForInlineStyle::styleForId):
+ (WebCore::InspectorStyleSheetForInlineStyle::ruleSourceDataFor):
+ (WebCore::InspectorStyleSheetForInlineStyle::rememberInspectorStyle):
+ (WebCore::InspectorStyleSheetForInlineStyle::forgetInspectorStyle):
+
+2010-10-22 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: update resources tree in storage panel upon network events.
+ https://bugs.webkit.org/show_bug.cgi?id=48121
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::buildObjectForDocumentLoader):
+ (WebCore::buildObjectForFrameTree):
+ (WebCore::InspectorResourceAgent::didCommitLoad):
+ (WebCore::InspectorResourceAgent::frameDetachedFromParent):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager):
+ (WebInspector.ResourceManager.prototype._createResource):
+ (WebInspector.ResourceManager.prototype.didReceiveResponse):
+ (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
+ (WebInspector.ResourceManager.prototype.didCommitLoadForFrame):
+ (WebInspector.ResourceManager.prototype._addResourceToStorageFrame):
+ (WebInspector.ResourceManager.prototype.frameDetachedFromParent):
+ (WebInspector.ResourceManager.prototype._clearResources):
+ (WebInspector.ResourceManager.prototype._processCachedResources):
+ (WebInspector.ResourceManager.prototype._addFramesRecursively):
+ (WebInspector.ResourceManager.getContents):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel.prototype.addOrUpdateFrame):
+ (WebInspector.StoragePanel.prototype.removeFrame):
+ (WebInspector.StoragePanel.prototype.addResourceToFrame):
+ (WebInspector.StoragePanel.prototype.removeResourcesFromFrame):
+ (WebInspector.BaseStorageTreeElement.prototype.onattach):
+ (WebInspector.BaseStorageTreeElement.prototype.onreveal):
+ (WebInspector.BaseStorageTreeElement.prototype.set titleText):
+ (WebInspector.FrameTreeElement):
+ (WebInspector.FrameTreeElement.prototype.onselect):
+ (WebInspector.FrameTreeElement.prototype.get displayName):
+ (WebInspector.FrameTreeElement.prototype.set displayName):
+
+2010-10-22 François Sausset <sausset@gmail.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Fix wrong xHeight() value for Apple Symbols font.
+ https://bugs.webkit.org/show_bug.cgi?id=41535
+
+ Test: mathml/xHeight.xhtml
+
+ * platform/graphics/mac/SimpleFontDataMac.mm:
+ (WebCore::SimpleFontData::platformInit):
+
+2010-10-22 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Further preparations to deploy the new SVGAnimatedProperty concept for the rest of the SVG datatypes
+ https://bugs.webkit.org/show_bug.cgi?id=48125
+
+ Model SVGListPropertyTearOff similar to SVGPropertyTearOff, allow it to be used for SVGXXXList datatypes, that are not animated. (SVGStringList)
+ Recognize all SVG primitive datatypes in SVGPropertyTraits.
+ Add a new - temporary - macro to support multiple animated properties that map to a single DOM attribute (kernelUnitLength attribute vs. kernelUnitLengthX/Y properties).
+ These macros will all be removed and expanded by their content, as soon as the transition to the new SVGAnimatedProperty concept is done.
+
+ Doesn't affect any tests yet, as the code is still unused.
+
+ * svg/properties/SVGAnimatedProperty.h:
+ (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper):
+ (WebCore::SVGAnimatedProperty::lookupWrapper):
+ * svg/properties/SVGAnimatedPropertyMacros.h:
+ * svg/properties/SVGAnimatedPropertySynchronizer.h:
+ * svg/properties/SVGListPropertyTearOff.h:
+ (WebCore::SVGListPropertyTearOff::create):
+ (WebCore::SVGListPropertyTearOff::removeItemFromList):
+ (WebCore::SVGListPropertyTearOff::detachListWrappers):
+ (WebCore::SVGListPropertyTearOff::clear):
+ (WebCore::SVGListPropertyTearOff::numberOfItems):
+ (WebCore::SVGListPropertyTearOff::initialize):
+ (WebCore::SVGListPropertyTearOff::getItem):
+ (WebCore::SVGListPropertyTearOff::insertItemBefore):
+ (WebCore::SVGListPropertyTearOff::replaceItem):
+ (WebCore::SVGListPropertyTearOff::removeItem):
+ (WebCore::SVGListPropertyTearOff::appendItem):
+ (WebCore::SVGListPropertyTearOff::SVGListPropertyTearOff):
+ (WebCore::SVGListPropertyTearOff::~SVGListPropertyTearOff):
+ (WebCore::SVGListPropertyTearOff::commitChange):
+ * svg/properties/SVGPropertyTearOff.h:
+ * svg/properties/SVGPropertyTraits.h:
+
+2010-10-22 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70301.
+ http://trac.webkit.org/changeset/70301
+ https://bugs.webkit.org/show_bug.cgi?id=48126
+
+ "Lang attribute layout tests failing" (Requested by satish on
+ #webkit).
+
+ * dom/Element.cpp:
+ (WebCore::Element::computeInheritedLanguage):
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::startRecognition):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h:
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::startRecognition):
+ (WebCore::SpeechInputClientMock::setRecognitionResult):
+ (WebCore::SpeechInputClientMock::timerFired):
+ * platform/mock/SpeechInputClientMock.h:
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::TextControlInnerElement::attachInnerElement):
+ (WebCore::SearchFieldCancelButtonElement::detach):
+ (WebCore::SpinButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::detach):
+
+2010-10-22 Leandro Gracia Gil <leandrogracia@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Patch the current speech input implementation to use and validate the
+ nearest language tag. The language is now passed to the startRecognition
+ methods so that language-specific recognition could be used. Also added
+ a second parameter to setMockSpeechInputResult for the language used in
+ speech recognition.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ This is the 2nd of a 4-sided patch in Chromium and WebKit. For more
+ details see http://codereview.chromium.org/3615005/show and
+ http://codereview.chromium.org/3595018/show.
+
+ Test: fast/speech/input-text-language-tag.html
+
+ * dom/Element.cpp:
+ (WebCore::Element::computeInheritedLanguage): includes a brief character
+ validation for the BCP 47 language tag.
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::startRecognition):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h:
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::startRecognition):
+ (WebCore::SpeechInputClientMock::setRecognitionResult): results are now
+ stored by language using a hash map.
+ (WebCore::SpeechInputClientMock::timerFired):
+ * platform/mock/SpeechInputClientMock.h:
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::TextControlInnerElement::attachInnerElement):
+ (WebCore::SearchFieldCancelButtonElement::detach):
+ (WebCore::SpinButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::detach):
+
+2010-10-21 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed, rolling out r70298.WebKit win compilation failure.
+ http://trac.webkit.org/changeset/70298
+ https://bugs.webkit.org/show_bug.cgi?id=48122
+
+2010-10-21 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: decouple ScriptArguments from ScriptCallStack
+ https://bugs.webkit.org/show_bug.cgi?id=48058
+
+ ScriptCallFrame and ScriptCallStack are now the same for both JSC and V8.
+ The factory functions that allow to create ScriptCallStack from VM-specific
+ objects are defined in ScriptCallStackFactory.cpp.
+
+ ScriptArguments class is used for passing arguments from JS code to the native
+ part.
+
+ No new tests. This refactoring is covered with existing Console tests.
+
+ * WebCore.gypi:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/ScriptCallFrame.cpp: Removed.
+ * bindings/js/ScriptCallFrame.h: Removed.
+ * bindings/js/ScriptCallStack.cpp: Removed.
+ * bindings/js/ScriptCallStack.h: Removed.
+ * bindings/js/ScriptCallStackFactory.cpp: Added.
+ (WebCore::createScriptCallStack):
+ (WebCore::createScriptArguments):
+ (WebCore::ScriptCallStack::stackTrace):
+ * bindings/js/ScriptCallStackFactory.h: Added.
+ * bindings/js/ScriptState.h:
+ (WebCore::ScriptStateProtectedPtr::get):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/ScriptCallFrame.cpp: Removed.
+ * bindings/v8/ScriptCallFrame.h: Removed.
+ * bindings/v8/ScriptCallStack.cpp: Removed.
+ * bindings/v8/ScriptCallStack.h: Removed.
+ * bindings/v8/ScriptCallStackFactory.cpp: Added.
+ (WebCore::toScriptCallFrame):
+ (WebCore::toScriptCallFramesVector):
+ (WebCore::createScriptCallStack):
+ (WebCore::createScriptArguments):
+ (WebCore::ScriptCallStack::stackTrace):
+ * bindings/v8/ScriptCallStackFactory.h: Added.
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::setCaptureCallStackForUncaughtExceptions):
+ * bindings/v8/ScriptState.h:
+ (WebCore::ScriptStateProtectedPtr::get):
+ * bindings/v8/V8ConsoleMessage.cpp:
+ (WebCore::V8ConsoleMessage::handler):
+ (WebCore::V8ConsoleMessage::dispatchNow):
+ * bindings/v8/V8ConsoleMessage.h:
+ * bindings/v8/custom/V8ConsoleCustom.cpp:
+ (WebCore::V8Console::traceCallback):
+ (WebCore::V8Console::assertCallback):
+ * inspector/ConsoleMessage.cpp:
+ (WebCore::ConsoleMessage::ConsoleMessage):
+ (WebCore::ConsoleMessage::addToFrontend):
+ (WebCore::ConsoleMessage::updateRepeatCountInConsole):
+ (WebCore::ConsoleMessage::isEqual):
+ * inspector/ConsoleMessage.h:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::addMessageToConsole):
+ (WebCore::InspectorController::startGroup):
+ * inspector/InspectorController.h:
+ * inspector/ScriptArguments.cpp: Added.
+ (WebCore::ScriptArguments::ScriptArguments):
+ (WebCore::ScriptArguments::~ScriptArguments):
+ (WebCore::ScriptArguments::argumentAt):
+ (WebCore::ScriptArguments::globalState):
+ (WebCore::ScriptArguments::getFirstArgumentAsString):
+ (WebCore::ScriptArguments::isEqual):
+ * inspector/ScriptArguments.h: Added.
+ (WebCore::ScriptArguments::argumentCount):
+ * inspector/ScriptCallFrame.cpp: Added.
+ (WebCore::ScriptCallFrame::ScriptCallFrame):
+ (WebCore::ScriptCallFrame::~ScriptCallFrame):
+ (WebCore::ScriptCallFrame::isEqual):
+ (WebCore::ScriptCallFrame::buildInspectorObject):
+ * inspector/ScriptCallFrame.h: Added.
+ (WebCore::ScriptCallFrame::functionName):
+ (WebCore::ScriptCallFrame::sourceURL):
+ (WebCore::ScriptCallFrame::lineNumber):
+ * inspector/ScriptCallStack.cpp: Added.
+ (WebCore::ScriptCallStack::ScriptCallStack):
+ (WebCore::ScriptCallStack::~ScriptCallStack):
+ (WebCore::ScriptCallStack::at):
+ (WebCore::ScriptCallStack::size):
+ (WebCore::ScriptCallStack::isEqual):
+ (WebCore::ScriptCallStack::buildInspectorObject):
+ * inspector/ScriptCallStack.h: Added.
+ * page/Console.cpp:
+ (WebCore::Console::addMessage):
+ (WebCore::Console::debug):
+ (WebCore::Console::error):
+ (WebCore::Console::info):
+ (WebCore::Console::log):
+ (WebCore::Console::dir):
+ (WebCore::Console::dirxml):
+ (WebCore::Console::trace):
+ (WebCore::Console::assertCondition):
+ (WebCore::Console::count):
+ (WebCore::Console::markTimeline):
+ (WebCore::Console::profile):
+ (WebCore::Console::profileEnd):
+ (WebCore::Console::timeEnd):
+ (WebCore::Console::group):
+ (WebCore::Console::groupCollapsed):
+ (WebCore::Console::shouldCaptureFullStackTrace):
+ (WebCore::Console::warn):
+ * page/Console.h:
+
+2010-10-22 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] All widgets are rendered incorrectly when rendered through a cache
+ https://bugs.webkit.org/show_bug.cgi?id=47767
+
+ When a widget is not available to the RenderTheme, default
+ value are used for the state.
+
+ * platform/qt/RenderThemeQt.cpp:
+ (WebCore::initStyleOption):
+ (WebCore::RenderThemeQt::paintButton):
+ (WebCore::RenderThemeQt::paintTextField):
+ (WebCore::RenderThemeQt::paintMenuList):
+ (WebCore::RenderThemeQt::paintMenuListButton):
+ (WebCore::RenderThemeQt::paintProgressBar):
+ (WebCore::RenderThemeQt::paintSliderTrack):
+
+2010-10-22 Zoltan Herczeg <zherczeg@webkit.org>
+
+ Reviewed by Dirk Schulze.
+
+ Moving all bounding box related calculation to RenderSVGResourceFilterPrimitive
+ https://bugs.webkit.org/show_bug.cgi?id=47174
+
+ The primitive sub-region calculation was spread in many
+ files across in WebKit source code, and all of them are moved
+ to RenderSVGResourceFilterPrimitive, where they should be.
+ In this patch the calculation is a static method which will
+ be turned to a real member function in the near future.
+
+ * platform/graphics/filters/FETile.cpp:
+ * platform/graphics/filters/FETile.h:
+ (WebCore::FETile::filterEffectType):
+ * platform/graphics/filters/Filter.h:
+ * platform/graphics/filters/FilterEffect.cpp:
+ * platform/graphics/filters/FilterEffect.h:
+ * rendering/RenderSVGResourceFilter.cpp:
+ (WebCore::RenderSVGResourceFilter::applyResource):
+ * rendering/RenderSVGResourceFilterPrimitive.cpp:
+ (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion):
+ * rendering/RenderSVGResourceFilterPrimitive.h:
+ (WebCore::RenderSVGResourceFilterPrimitive::RenderSVGResourceFilterPrimitive):
+ * svg/graphics/filters/SVGFilter.cpp:
+ * svg/graphics/filters/SVGFilter.h:
+ (WebCore::SVGFilter::mapLocalRectToAbsoluteRect):
+ (WebCore::SVGFilter::targetBoundingBox):
+
+2010-10-21 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Add a String constructor which takes AECHAR*
+ https://bugs.webkit.org/show_bug.cgi?id=45043
+
+ Implement String(const AECHAR*) constructor.
+
+ * platform/text/brew/StringBrew.cpp: Added.
+ (WTF::String::String):
+
+2010-10-21 James Simonsen <simonjam@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ HTMLTreeBuilder's InForeignContent code needs a re-write
+
+ Foreign Content mode was changed significantly by:
+ http://www.w3.org/Bugs/Public/show_bug.cgi?id=10314
+
+ The differences can be seen here:
+ http://html5.org/tools/web-apps-tracker?from=5520&to=5522
+
+ This bug addresses all spec changes in the diff except the select scope
+ changes, which have already been fixed in a separate bug.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46676
+
+ * html/parser/HTMLElementStack.cpp:
+ (WebCore::HTMLNames::isScopeMarker): Add foreign elements to list.
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ (WebCore::HTMLTreeBuilder::processDoctypeToken): Switch mode before reprocessing any tokens.
+ (WebCore::HTMLTreeBuilder::processStartTagForInBody): Ditto. Remove secondary insertion mode.
+ (WebCore::HTMLTreeBuilder::processStartTagForInTable): Switch mode before reprocessing any tokens.
+ (WebCore::HTMLTreeBuilder::processStartTag): Ditto. Remove secondary insertion mode.
+ (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately): Remove foreign var. Use hasTagName() instead of == localName() to fix bug with foreign elements.
+ (WebCore::HTMLTreeBuilder::processEndTagForInTableBody): Switch mode before reprocessing any tokens.
+ (WebCore::HTMLTreeBuilder::processEndTagForInRow): Ditto.
+ (WebCore::HTMLTreeBuilder::processEndTagForInCell): Ditto.
+ (WebCore::HTMLTreeBuilder::processEndTagForInBody): Ditto.
+ (WebCore::HTMLTreeBuilder::processEndTag): Ditto.
+ (WebCore::HTMLTreeBuilder::prepareToReprocessToken): Added.
+ (WebCore::HTMLTreeBuilder::reprocessStartTag): Added.
+ (WebCore::HTMLTreeBuilder::reprocessEndTag): Added.
+ (WebCore::HTMLTreeBuilder::processForeignContentUsingInBodyModeAndResetMode): Added.
+ (WebCore::HTMLTreeBuilder::resetForeignInsertionMode): Added.
+ (WebCore::HTMLTreeBuilder::processComment): Switch mode before reprocessing any tokens.
+ (WebCore::HTMLTreeBuilder::processCharacterBuffer): Ditto.
+ (WebCore::HTMLTreeBuilder::processEndOfFile): Ditto.
+ * html/parser/HTMLTreeBuilder.h: Functions and member for tracking potential switch from InForeignContentMode.
+
+2010-10-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by David Levin.
+
+ Remove Android build system
+ https://bugs.webkit.org/show_bug.cgi?id=48111
+
+ As far as I can tell, these files are not maintained. They are a
+ mantaince burden on the project. If folks would like to come out of
+ the woodwork and maintain these files, that's great. At the moment,
+ they seem like dead weight for the project.
+
+ * Android.mk: Removed.
+
+2010-10-21 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by James Robinson.
+
+ Make sure skia is not Chromium specific
+ https://bugs.webkit.org/show_bug.cgi?id=39672
+
+ GlyphPageTreeNodeLinux does not depend on Linux or Chromium.
+ Move GlyphPageTreeNodeLinux to platform/graphics/skia and rename it to
+ GlyphPageTreeNodeSkia.cpp so that other ports can use it.
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp: Removed.
+ * platform/graphics/skia/GlyphPageTreeNodeSkia.cpp: Added.
+
+2010-10-21 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Tony Chang.
+
+ removeFormat needs to be reimplemented
+ https://bugs.webkit.org/show_bug.cgi?id=43017
+
+ Reimplemented execCommand('RemoveFormat', false, null). New implementation removes
+ the same elements removed by Internet Explorer. Because WebKit supports StyleWithCSS
+ we also reset any editing styles to match that of the root editable element
+ while Internet Explorer does not remove any CSS styles.
+
+ New implementation uses ApplyStyleCommand to remove appropriate elements and reset the style.
+ Added new constructor and member variable to ApplyStyleCommand to support mass-removal of elements
+ since it's inefficient to call ApplyStyleCommand on each element we're removing.
+
+ To avoid an infinite loop in pushDownInlineStyleAroundNode when mass-removing, WebKit no longer
+ push down element one level at a time. Instead, we keep a stack of styled elements to be applied,
+ and apply wrap siblings of targetNode's ancestors by all of them at once.
+
+ Tests: editing/execCommand/remove-format-elements.html
+ editing/execCommand/remove-format-multiple-elements.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::ApplyStyleCommand): Added; this version takes style and a function pointer
+ to a boolean function that determines which element needs to removed, and set m_removeOnly to true.
+ (WebCore::ApplyStyleCommand::doApply): Added support for m_isInlineElementToRemoveFunction.
+ (WebCore::ApplyStyleCommand::applyBlockStyle): Ditto.
+ (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): Exits early if m_removeOnly is true.
+ (WebCore::ApplyStyleCommand::isStyledInlineElementToRemove): Added.
+ (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle): Calls isStyledInlineElementToRemove.
+ (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Ditto.
+ (WebCore::ApplyStyleCommand::removeInlineStyle): Ditto.
+ (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): See above.
+ * editing/ApplyStyleCommand.h:
+ (WebCore::ApplyStyleCommand::create): Added.
+ * editing/RemoveFormatCommand.cpp:
+ (WebCore::isElementForRemoveFormatCommand): Added.
+ (WebCore::RemoveFormatCommand::doApply): Rewritten.
+
+2010-10-21 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Ignore document.write() when it comes from a network task
+ https://bugs.webkit.org/show_bug.cgi?id=47560
+
+ This implements the update to the spec made by:
+ http://www.w3.org/Bugs/Public/show_bug.cgi?id=9767
+
+ It also matches the latest Firefox 4 beta. The notable change is that
+ document.write from a deferred script no longer works. This avoids
+ blowing the patch away.
+
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ (WebCore::Document::write):
+ * dom/Document.h:
+ (WebCore::DestructiveWriteCountIncrementer::DestructiveWriteCountIncrementer):
+ (WebCore::Document::ignoreDestructiveWriteCountIncrementer):
+ * dom/ScriptElement.cpp:
+ (WebCore::ScriptElement::insertedIntoDocument):
+ (WebCore::ScriptElementData::ScriptElementData):
+ (WebCore::ScriptElementData::evaluateScript):
+ * dom/ScriptElement.h:
+ * html/parser/HTMLScriptRunner.cpp:
+ (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
+
+2010-10-21 Ryosuke Niwa <rniwa@webkit.org>
+
+ Unreviewed Leopard build fix attempt.
+
+ Explicitly cast the return value of deg2rad to float.
+
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paint):
+
+2010-10-21 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by James Robinson.
+
+ [Chromium] Fix Chromium Mac build
+ https://bugs.webkit.org/show_bug.cgi?id=48096
+
+ Fix Chromium Mac build after r70225 (Chromium uses Core Text but is not
+ PLATFORM(MAC)).
+
+ * platform/graphics/SimpleFontData.h:
+
+2010-10-21 Xiaomei Ji <xji@chromium.org>
+
+ Reviewed by David Levin.
+
+ Performance improvement for FontLinux.
+ https://bugs.webkit.org/show_bug.cgi?id=47019
+
+ Reduce the number of calls for the normalization function because converting
+ to NFC form is very expensive.
+
+ Combine space normalization and character mirroring into one text scan.
+
+ Test: platform/chromium/fast/text/font-linux-normalize.html
+
+ * platform/graphics/chromium/FontLinux.cpp:
+ (WebCore::TextRunWalker::TextRunWalker):
+ (WebCore::TextRunWalker::~TextRunWalker):
+ (WebCore::TextRunWalker::getNormalizedTextRun):
+ (WebCore::TextRunWalker::normalizeSpacesAndMirrorChars):
+
+2010-10-21 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48085
+
+ Make basic vertical text painting work. This includes the text itself, underlines, overlines, line-throughs and shadows.
+
+ Added fast/blockflow/english-lr-text.html
+
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paint):
+ * rendering/InlineFlowBox.h:
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::applyShadowToGraphicsContext):
+ (WebCore::paintTextWithShadows):
+ (WebCore::InlineTextBox::paint):
+ (WebCore::InlineTextBox::paintDecoration):
+ (WebCore::InlineTextBox::paintTextMatchMarker):
+ * rendering/InlineTextBox.h:
+ * rendering/svg/SVGInlineTextBox.cpp:
+ (WebCore::SVGInlineTextBox::paintTextWithShadows):
+
+2010-10-21 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] When doing rendering through tiling, it seems the tiles are not initialized before rendering
+ https://bugs.webkit.org/show_bug.cgi?id=48070
+
+ No new tests. Auto-tests for Tiled Backing Store should be added, see bug 48082
+
+ * page/Frame.cpp:
+ (WebCore::Frame::tiledBackingStoreBackgroundColor):
+ * page/Frame.h:
+ * platform/graphics/TiledBackingStoreClient.h:
+ * platform/graphics/qt/TileQt.cpp:
+ (WebCore::Tile::updateBackBuffer):
+
+2010-10-21 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Use GCharsetConverter instead of g_iconv in TextCodecGtk
+ https://bugs.webkit.org/show_bug.cgi?id=47896
+
+ It makes error handling easier. Fixes tests:
+ fast/encoding/invalid-multi-byte-over-consumption.html
+ fast/encoding/invalid-xml.html
+ fast/encoding/japanese-encoding-mix.html
+ when building with glib unicode
+
+ * platform/text/gtk/TextCodecGtk.cpp:
+ (WebCore::TextCodecGtk::TextCodecGtk):
+ (WebCore::TextCodecGtk::~TextCodecGtk):
+ (WebCore::TextCodecGtk::createIConvDecoder):
+ (WebCore::TextCodecGtk::createIConvEncoder):
+ (WebCore::TextCodecGtk::decode):
+ (WebCore::TextCodecGtk::encode):
+ * platform/text/gtk/TextCodecGtk.h:
+
+2010-10-21 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ AX: contenteditable nodes do not return correct AXSelectedText* attributes
+ https://bugs.webkit.org/show_bug.cgi?id=48080
+
+ The ariaSelectedDOMTextRange() method was not returning the correct values.
+ The fix is to return a plain text range that represents the current selection.
+
+ Test: platform/mac/accessibility/content-editable-range-properties.html
+
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::accessibilityDescription):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::ariaSelectedTextRange):
+ (WebCore::AccessibilityRenderObject::selectedText):
+ (WebCore::AccessibilityRenderObject::selectedTextRange):
+ * accessibility/AccessibilityRenderObject.h:
+
+2010-10-20 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Video -> Canvas doesn't work on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=47996
+ rdar://problem/7884690
+
+ * WebCore.vcproj/QTMovieWin.vcproj: Added QTDecompressionSession.{cpp,h}
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::paint): Create a
+ QTDecompressionSession if necessary and convert the QTPixelBuffer
+ into a CG-compatible one.
+ * platform/graphics/win/QTDecompressionSession.cpp: Added.
+ * platform/graphics/win/QTDecompressionSession.h: Added.
+ * platform/graphics/win/QTPixelBuffer.cpp:
+ (SetNumberValue): Moved from QTMovieVisualContext.
+ (QTPixelBuffer::createPixelBufferAttributesDictionary): Moved from inside
+ QTMovieVisualContext::createPixelBufferOptionsDictionary().
+ * platform/graphics/win/QTPixelBuffer.h: Moved the Type enum
+ from QTMovieVisualContext.h.
+
+2010-10-21 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] TextBreakIteratorGtk should initialize its internal index to 0
+ https://bugs.webkit.org/show_bug.cgi?id=48065
+
+ It fixes the following tests when using glib unicode:
+ fast/forms/ValidityState-tooLong-input.html
+ fast/forms/ValidityState-tooLong-textarea.html
+ fast/forms/input-appearance-maxlength.html
+ fast/forms/input-implicit-length-limit.html
+ fast/forms/input-maxlength.html
+ fast/forms/textarea-live-pseudo-selectors.html
+ fast/forms/mailto/advanced-get.html
+ fast/forms/mailto/advanced-put.html
+
+ * platform/text/gtk/TextBreakIteratorGtk.cpp:
+ (WebCore::setUpIterator):
+
+2010-10-21 takano takumi <takano1@asia.apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Need to swap glyphs for vertical writing
+ https://bugs.webkit.org/show_bug.cgi?id=46973
+
+ Made changes to pass the writing-mode orientation flag in RenderStyle down to FontPlatformData,
+ and ultimately to CoreText APIs in both font complex path and fast path.
+
+ Tests: fast/text/international/vertical-text-glyph-test.html
+ fast/text/international/vertical-text-metrics-test.html
+
+ * WebCore.exp.in:
+ * WebCore.xcodeproj/project.pbxproj: Added platform/graphics/FontOrientation.h.
+ * css/CSSFontFaceSource.cpp:
+ (WebCore::CSSFontFaceSource::getFontData): Added font orientation parameter to SimpleFontData.
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty): Set appropriate font orientation to the font description
+ when writing-mode is being specified.
+ * loader/CachedFont.cpp:
+ (WebCore::CachedFont::platformDataFromCustomData): Made to pass font orientation to FontPlatformData.
+ * loader/CachedFont.h:
+ * platform/graphics/FontCache.cpp: Added font orientation to FontPlatformDataCacheKey
+ (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
+ (WebCore::FontPlatformDataCacheKey::operator==):
+ (WebCore::computeHash):
+ (WebCore::FontCache::getCachedFontPlatformData):
+ * platform/graphics/FontDescription.h: Added font orientation support to FontDescription class
+ (WebCore::FontDescription::FontDescription):
+ (WebCore::FontDescription::orientation):
+ (WebCore::FontDescription::setOrientation):
+ (WebCore::FontDescription::operator==):
+ * platform/graphics/FontOrientation.h: Added.
+ * platform/graphics/SimpleFontData.h:
+ * platform/graphics/cairo/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/cairo/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/cocoa/FontPlatformData.h: Added font orientation support to FontPlatformData class
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::orientation):
+ (WebCore::FontPlatformData::hash):
+ (WebCore::FontPlatformData::operator==):
+ * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Added font orientation support
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::operator=):
+ (WebCore::FontPlatformData::allowsLigatures): Don't allow ligatures when the font is vertical orientation.
+ (WebCore::FontPlatformData::description):
+ * platform/graphics/gtk/FontCustomPlatformDataPango.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/haiku/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/haiku/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/mac/FontCacheMac.mm: Added font orientation parameter when creating FontPlatformData object.
+ (WebCore::FontCache::getFontDataForCharacters):
+ (WebCore::FontCache::createFontPlatformData):
+ * platform/graphics/mac/FontCustomPlatformData.cpp: Added font orientation parameter when creating FontPlatformData object.
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/mac/FontCustomPlatformData.h: Changed to pass font orientation parameter to fontPlatformData()
+ * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
+ (WebCore::GlyphPage::fill): Changed to use CoreText to extract glyphs when the current font is vertical orientation.
+ CoreText automatically swaps glyphs with vertical variants when the font orientation is vertical.
+ * platform/graphics/mac/SimpleFontDataCoreText.cpp: Added vertical form attribute to the attribute dictionary for a CTLine.
+ (WebCore::SimpleFontData::getCFStringAttributes):
+ * platform/graphics/mac/SimpleFontDataMac.mm:
+ (WebCore::SimpleFontData::platformBoundsForGlyph): Changed to use CoreText (from CG) to support vertical metrics.
+ (WebCore::SimpleFontData::platformWidthForGlyph): Made to use CoreText, instead of wkGetGlyphTransformedAdvances,
+ to get vertical metrics when the font orientation is vertical.
+ * platform/graphics/qt/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/qt/FontCustomPlatformDataQt.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/win/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/win/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/win/FontCustomPlatformDataCairo.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/win/FontCustomPlatformDataCairo.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/wince/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/wince/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/wx/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/wx/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+
+2010-10-21 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: provide resource tree in the Storage panel (behind the flag).
+ https://bugs.webkit.org/show_bug.cgi?id=48069
+
+ * WebCore.gypi:
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::frameDetachedFromParent):
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::buildObjectForDocumentLoader):
+ (WebCore::buildObjectForFrameResource):
+ (WebCore::buildObjectForCachedResource):
+ (WebCore::populateObjectWithFrameResources):
+ (WebCore::InspectorResourceAgent::identifierForInitialRequest):
+ (WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache):
+ (WebCore::buildObjectForFrameTree):
+ (WebCore::InspectorResourceAgent::didCommitLoad):
+ (WebCore::InspectorResourceAgent::frameDetachedFromParent):
+ (WebCore::InspectorResourceAgent::cachedResources):
+ (WebCore::InspectorResourceAgent::resourceContent):
+ * inspector/InspectorResourceAgent.h:
+ * inspector/front-end/Images/frame.png: Added.
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel.prototype.refreshResource):
+ (WebInspector.NetworkPanel.prototype._showResource):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.Type.toString):
+ (WebInspector.Resource.prototype.getContents):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager):
+ (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
+ (WebInspector.ResourceManager.prototype._createResource):
+ (WebInspector.ResourceManager.prototype.willSendRequest):
+ (WebInspector.ResourceManager.prototype._appendRedirect):
+ (WebInspector.ResourceManager.prototype.markResourceAsCached):
+ (WebInspector.ResourceManager.prototype.didReceiveResponse):
+ (WebInspector.ResourceManager.prototype._updateResourceWithResponse):
+ (WebInspector.ResourceManager.prototype.didReceiveContentLength):
+ (WebInspector.ResourceManager.prototype.didFinishLoading):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
+ (WebInspector.ResourceManager.prototype._updateResourceWithCachedResource):
+ (WebInspector.ResourceManager.prototype.setOverrideContent):
+ (WebInspector.ResourceManager.prototype.didCommitLoadForFrame):
+ (WebInspector.ResourceManager.prototype.frameDetachedFromParent):
+ (WebInspector.ResourceManager.prototype._clearResources):
+ (WebInspector.ResourceManager.prototype.didCreateWebSocket):
+ (WebInspector.ResourceManager.prototype.willSendWebSocketHandshakeRequest):
+ (WebInspector.ResourceManager.prototype.didReceiveWebSocketHandshakeResponse):
+ (WebInspector.ResourceManager.prototype.didCloseWebSocket):
+ (WebInspector.ResourceManager.prototype._processCachedResources):
+ (WebInspector.ResourceManager.prototype._appendFramesRecursively.comparator):
+ (WebInspector.ResourceManager.prototype._appendFramesRecursively):
+ (WebInspector.ResourceManager.createResourceView):
+ (WebInspector.ResourceManager.resourceViewTypeMatchesResource):
+ (WebInspector.ResourceManager.resourceViewForResource):
+ (WebInspector.ResourceManager.getContents):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype.get searchableViews):
+ (WebInspector.ResourcesPanel.prototype.addMessageToResource):
+ (WebInspector.ResourcesPanel.prototype._recreateViewForResourceIfNeeded):
+ (WebInspector.ResourcesPanel.prototype.showResource):
+ (WebInspector.ResourcesPanel.prototype.sourceFrameForResource):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype._showScriptOrResource):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel):
+ (WebInspector.StoragePanel.prototype.addFrame):
+ (WebInspector.StoragePanel.prototype.removeFrame):
+ (WebInspector.StoragePanel.prototype.addFrameResource):
+ (WebInspector.StoragePanel.prototype.removeFrameResources):
+ (WebInspector.StoragePanel.prototype.showResource):
+ (WebInspector.BaseStorageTreeElement.prototype.onattach):
+ (WebInspector.BaseStorageTreeElement.prototype.onreveal):
+ (WebInspector.FrameTreeElement):
+ (WebInspector.FrameTreeElement.prototype.onselect):
+ (WebInspector.FrameResourceTreeElement):
+ (WebInspector.FrameResourceTreeElement.prototype.onselect):
+ (WebInspector.FrameResourceTreeElement.prototype.onattach):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.css:
+ (.frame-storage-tree-item .icon):
+ (.storage.panel .sidebar.outline-disclosure > ol):
+ (.resources-category-images .image-resource-icon-preview):
+ (.children.small .resources-category-images .image-resource-icon-preview):
+ * inspector/front-end/inspector.js:
+
+2010-10-21 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48047> Fix warnings found by check-Xcode-source-file-types
+
+ Reviewed by Adam Roben.
+
+ Fixes the following warning:
+
+ WARNING: Unknown file type 'sourcecode' for file 'CSSPrimitiveValue.idl'.
+ 1 issues found for WebCore/WebCore.xcodeproj/project.pbxproj.
+
+ * WebCore.xcodeproj/project.pbxproj: Removed explicit file type
+ for CSSPrimitiveValue.idl to make it match other IDL files.
+
+2010-10-21 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed. Revert r70232. Chromium compilation failure.
+
+2010-10-21 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed. Revert r70233. Too many failures.
+
+2010-10-21 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed. Remove references to deleted headers from WebCore.pro
+
+ * WebCore.pro:
+
+2010-10-21 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: decouple ScriptArguments from ScriptCallStack
+ https://bugs.webkit.org/show_bug.cgi?id=48058
+
+ ScriptCallFrame and ScriptCallStack are now the same for both JSC and V8.
+ The factory functions that allow to create ScriptCallStack from VM-specific
+ objects are defined in ScriptCallStackFactory.cpp.
+
+ ScriptArguments class is used for passing arguments from JS code to the native
+ part.
+
+ No new tests. This refactoring is covered with existing Console tests.
+
+ * WebCore.gypi:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/ScriptCallFrame.cpp: Removed.
+ * bindings/js/ScriptCallFrame.h: Removed.
+ * bindings/js/ScriptCallStack.cpp: Removed.
+ * bindings/js/ScriptCallStack.h: Removed.
+ * bindings/js/ScriptCallStackFactory.cpp: Added.
+ (WebCore::createScriptCallStack):
+ (WebCore::createScriptArguments):
+ (WebCore::ScriptCallStack::stackTrace):
+ * bindings/js/ScriptCallStackFactory.h: Added.
+ * bindings/js/ScriptState.h:
+ (WebCore::ScriptStateProtectedPtr::get):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/ScriptCallFrame.cpp: Removed.
+ * bindings/v8/ScriptCallFrame.h: Removed.
+ * bindings/v8/ScriptCallStack.cpp: Removed.
+ * bindings/v8/ScriptCallStack.h: Removed.
+ * bindings/v8/ScriptCallStackFactory.cpp: Added.
+ (WebCore::toScriptCallFrame):
+ (WebCore::toScriptCallFramesVector):
+ (WebCore::createScriptCallStack):
+ (WebCore::createScriptArguments):
+ (WebCore::ScriptCallStack::stackTrace):
+ * bindings/v8/ScriptCallStackFactory.h: Added.
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::setCaptureCallStackForUncaughtExceptions):
+ * bindings/v8/ScriptState.h:
+ (WebCore::ScriptStateProtectedPtr::get):
+ * bindings/v8/V8ConsoleMessage.cpp:
+ (WebCore::V8ConsoleMessage::handler):
+ (WebCore::V8ConsoleMessage::dispatchNow):
+ * bindings/v8/V8ConsoleMessage.h:
+ * bindings/v8/custom/V8ConsoleCustom.cpp:
+ (WebCore::V8Console::traceCallback):
+ (WebCore::V8Console::assertCallback):
+ * inspector/ConsoleMessage.cpp:
+ (WebCore::ConsoleMessage::ConsoleMessage):
+ (WebCore::ConsoleMessage::addToFrontend):
+ (WebCore::ConsoleMessage::updateRepeatCountInConsole):
+ (WebCore::ConsoleMessage::isEqual):
+ * inspector/ConsoleMessage.h:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::addMessageToConsole):
+ (WebCore::InspectorController::startGroup):
+ * inspector/InspectorController.h:
+ * inspector/ScriptArguments.cpp: Added.
+ (WebCore::ScriptArguments::ScriptArguments):
+ (WebCore::ScriptArguments::~ScriptArguments):
+ (WebCore::ScriptArguments::argumentAt):
+ (WebCore::ScriptArguments::globalState):
+ (WebCore::ScriptArguments::getFirstArgumentAsString):
+ (WebCore::ScriptArguments::isEqual):
+ * inspector/ScriptArguments.h: Added.
+ (WebCore::ScriptArguments::argumentCount):
+ * inspector/ScriptCallFrame.cpp: Added.
+ (WebCore::ScriptCallFrame::ScriptCallFrame):
+ (WebCore::ScriptCallFrame::~ScriptCallFrame):
+ (WebCore::ScriptCallFrame::isEqual):
+ (WebCore::ScriptCallFrame::buildInspectorObject):
+ * inspector/ScriptCallFrame.h: Added.
+ (WebCore::ScriptCallFrame::functionName):
+ (WebCore::ScriptCallFrame::sourceURL):
+ (WebCore::ScriptCallFrame::lineNumber):
+ * inspector/ScriptCallStack.cpp: Added.
+ (WebCore::ScriptCallStack::ScriptCallStack):
+ (WebCore::ScriptCallStack::~ScriptCallStack):
+ (WebCore::ScriptCallStack::at):
+ (WebCore::ScriptCallStack::size):
+ (WebCore::ScriptCallStack::isEqual):
+ (WebCore::ScriptCallStack::buildInspectorObject):
+ * inspector/ScriptCallStack.h: Added.
+ * page/Console.cpp:
+ (WebCore::Console::addMessage):
+ (WebCore::Console::debug):
+ (WebCore::Console::error):
+ (WebCore::Console::info):
+ (WebCore::Console::log):
+ (WebCore::Console::dir):
+ (WebCore::Console::dirxml):
+ (WebCore::Console::trace):
+ (WebCore::Console::assertCondition):
+ (WebCore::Console::count):
+ (WebCore::Console::markTimeline):
+ (WebCore::Console::profile):
+ (WebCore::Console::profileEnd):
+ (WebCore::Console::timeEnd):
+ (WebCore::Console::group):
+ (WebCore::Console::groupCollapsed):
+ (WebCore::Console::shouldCaptureFullStackTrace):
+ (WebCore::Console::warn):
+ * page/Console.h:
+
+2010-10-21 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Chromium: use dedicated event listener type in EventListenerWrapper.
+ https://bugs.webkit.org/show_bug.cgi?id=48059
+
+ This change introduces new EventListener::Type NativeEventListenerType.
+ This new type is intended to be used by any code that wants to protect
+ itself from unsafe casts to particular event listener implementations.
+
+ * dom/EventListener.h:
+
+2010-10-21 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70225.
+ http://trac.webkit.org/changeset/70225
+ https://bugs.webkit.org/show_bug.cgi?id=48061
+
+ Build breakage on Leopard. (Requested by pfeldman on #webkit).
+
+ * WebCore.exp.in:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSFontFaceSource.cpp:
+ (WebCore::CSSFontFaceSource::getFontData):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ * loader/CachedFont.cpp:
+ (WebCore::CachedFont::platformDataFromCustomData):
+ * loader/CachedFont.h:
+ * platform/graphics/FontCache.cpp:
+ (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
+ (WebCore::FontPlatformDataCacheKey::operator==):
+ (WebCore::computeHash):
+ (WebCore::FontCache::getCachedFontPlatformData):
+ * platform/graphics/FontDescription.h:
+ (WebCore::FontDescription::FontDescription):
+ (WebCore::FontDescription::operator==):
+ * platform/graphics/FontOrientation.h: Removed.
+ * platform/graphics/SimpleFontData.h:
+ * platform/graphics/cairo/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/cairo/FontCustomPlatformData.h:
+ * platform/graphics/cocoa/FontPlatformData.h:
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::hash):
+ (WebCore::FontPlatformData::operator==):
+ * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::operator=):
+ (WebCore::FontPlatformData::allowsLigatures):
+ (WebCore::FontPlatformData::description):
+ * platform/graphics/gtk/FontCustomPlatformDataPango.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/haiku/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/haiku/FontCustomPlatformData.h:
+ * platform/graphics/mac/FontCacheMac.mm:
+ (WebCore::FontCache::getFontDataForCharacters):
+ (WebCore::FontCache::createFontPlatformData):
+ * platform/graphics/mac/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/mac/FontCustomPlatformData.h:
+ * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
+ (WebCore::GlyphPage::fill):
+ * platform/graphics/mac/SimpleFontDataCoreText.cpp:
+ (WebCore::SimpleFontData::getCFStringAttributes):
+ * platform/graphics/mac/SimpleFontDataMac.mm:
+ (WebCore::SimpleFontData::platformBoundsForGlyph):
+ (WebCore::SimpleFontData::platformWidthForGlyph):
+ * platform/graphics/qt/FontCustomPlatformData.h:
+ * platform/graphics/qt/FontCustomPlatformDataQt.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.h:
+ * platform/graphics/win/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/win/FontCustomPlatformData.h:
+ * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/win/FontCustomPlatformDataCairo.h:
+ * platform/graphics/wince/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/wince/FontCustomPlatformData.h:
+ * platform/graphics/wx/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/wx/FontCustomPlatformData.h:
+
+2010-10-21 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Tests LayoutTests/fast/encoding/utf-32* fail when using glib unicode
+ https://bugs.webkit.org/show_bug.cgi?id=47805
+
+ Register UTF-32 encodings in TextCodecGtk.
+
+ * platform/text/gtk/TextCodecGtk.cpp:
+ (WebCore::TextCodecGtk::registerBaseEncodingNames):
+ (WebCore::TextCodecGtk::registerBaseCodecs):
+
+2010-10-21 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Adding MediaQueryListListener binding test cases
+ https://bugs.webkit.org/show_bug.cgi?id=48028
+
+ MediaQueryListListener type will need special handling of the code generators. Adding the test cases.
+
+ * bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp: Added.
+ (WebDOMTestMediaQueryListListener::WebDOMTestMediaQueryListListenerPrivate::WebDOMTestMediaQueryListListenerPrivate):
+ (WebDOMTestMediaQueryListListener::WebDOMTestMediaQueryListListener):
+ (WebDOMTestMediaQueryListListener::operator=):
+ (WebDOMTestMediaQueryListListener::impl):
+ (WebDOMTestMediaQueryListListener::~WebDOMTestMediaQueryListListener):
+ (WebDOMTestMediaQueryListListener::method):
+ (toWebCore):
+ (toWebKit):
+ * bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.h: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp: Added.
+ (WebKit::kit):
+ (webkit_dom_test_media_query_list_listener_method):
+ (WebKit::core):
+ (webkit_dom_test_media_query_list_listener_finalize):
+ (webkit_dom_test_media_query_list_listener_set_property):
+ (webkit_dom_test_media_query_list_listener_get_property):
+ (webkit_dom_test_media_query_list_listener_constructed):
+ (webkit_dom_test_media_query_list_listener_class_init):
+ (webkit_dom_test_media_query_list_listener_init):
+ (WebKit::wrapTestMediaQueryListListener):
+ * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.h: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListenerPrivate.h: Added.
+ * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Added.
+ (WebCore::JSTestMediaQueryListListenerConstructor::classInfo):
+ (WebCore::JSTestMediaQueryListListenerConstructor::createStructure):
+ (WebCore::JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor):
+ (WebCore::JSTestMediaQueryListListenerConstructor::getOwnPropertySlot):
+ (WebCore::JSTestMediaQueryListListenerConstructor::getOwnPropertyDescriptor):
+ (WebCore::JSTestMediaQueryListListenerPrototype::self):
+ (WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertySlot):
+ (WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor):
+ (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):
+ (WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
+ (WebCore::JSTestMediaQueryListListener::createPrototype):
+ (WebCore::JSTestMediaQueryListListener::getOwnPropertySlot):
+ (WebCore::JSTestMediaQueryListListener::getOwnPropertyDescriptor):
+ (WebCore::jsTestMediaQueryListListenerConstructor):
+ (WebCore::JSTestMediaQueryListListener::getConstructor):
+ (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
+ (WebCore::toJS):
+ (WebCore::toTestMediaQueryListListener):
+ * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: Added.
+ (WebCore::JSTestMediaQueryListListener::classInfo):
+ (WebCore::JSTestMediaQueryListListener::createStructure):
+ (WebCore::JSTestMediaQueryListListener::impl):
+ (WebCore::JSTestMediaQueryListListenerPrototype::classInfo):
+ (WebCore::JSTestMediaQueryListListenerPrototype::createStructure):
+ (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
+ * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h: Added.
+ * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm: Added.
+ (-[DOMTestMediaQueryListListener dealloc]):
+ (-[DOMTestMediaQueryListListener finalize]):
+ (-[DOMTestMediaQueryListListener method:]):
+ (core):
+ (kit):
+ * bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h: Added.
+ * bindings/scripts/test/TestMediaQueryListListener.idl: Added.
+ * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: Added.
+ (WebCore::TestMediaQueryListListenerInternal::V8_USE):
+ (WebCore::TestMediaQueryListListenerInternal::methodCallback):
+ (WebCore::ConfigureV8TestMediaQueryListListenerTemplate):
+ (WebCore::V8TestMediaQueryListListener::GetRawTemplate):
+ (WebCore::V8TestMediaQueryListListener::GetTemplate):
+ (WebCore::V8TestMediaQueryListListener::HasInstance):
+ (WebCore::V8TestMediaQueryListListener::wrapSlow):
+ (WebCore::V8TestMediaQueryListListener::derefObject):
+ * bindings/scripts/test/V8/V8TestMediaQueryListListener.h: Added.
+ (WebCore::V8TestMediaQueryListListener::toNative):
+ (WebCore::V8TestMediaQueryListListener::wrap):
+ (WebCore::toV8):
+
+2010-10-21 takano takumi <takano1@asia.apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Need to swap glyphs for vertical writing
+ https://bugs.webkit.org/show_bug.cgi?id=46973
+
+ Made changes to pass the writing-mode orientation flag in RenderStyle down to FontPlatformData,
+ and ultimately to CoreText APIs in both font complex path and fast path.
+
+ Tests: fast/text/international/vertical-text-glyph-test.html
+ fast/text/international/vertical-text-metrics-test.html
+
+ * WebCore.exp.in:
+ * WebCore.xcodeproj/project.pbxproj: Added platform/graphics/FontOrientation.h.
+ * css/CSSFontFaceSource.cpp:
+ (WebCore::CSSFontFaceSource::getFontData): Added font orientation parameter to SimpleFontData.
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty): Set appropriate font orientation to the font description
+ when writing-mode is being specified.
+ * loader/CachedFont.cpp:
+ (WebCore::CachedFont::platformDataFromCustomData): Made to pass font orientation to FontPlatformData.
+ * loader/CachedFont.h:
+ * platform/graphics/FontCache.cpp: Added font orientation to FontPlatformDataCacheKey
+ (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
+ (WebCore::FontPlatformDataCacheKey::operator==):
+ (WebCore::computeHash):
+ (WebCore::FontCache::getCachedFontPlatformData):
+ * platform/graphics/FontDescription.h: Added font orientation support to FontDescription class
+ (WebCore::FontDescription::FontDescription):
+ (WebCore::FontDescription::orientation):
+ (WebCore::FontDescription::setOrientation):
+ (WebCore::FontDescription::operator==):
+ * platform/graphics/FontOrientation.h: Added.
+ * platform/graphics/SimpleFontData.h:
+ * platform/graphics/cairo/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/cairo/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/cocoa/FontPlatformData.h: Added font orientation support to FontPlatformData class
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::orientation):
+ (WebCore::FontPlatformData::hash):
+ (WebCore::FontPlatformData::operator==):
+ * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Added font orientation support
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::operator=):
+ (WebCore::FontPlatformData::allowsLigatures): Don't allow ligatures when the font is vertical orientation.
+ (WebCore::FontPlatformData::description):
+ * platform/graphics/gtk/FontCustomPlatformDataPango.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/haiku/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/haiku/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/mac/FontCacheMac.mm: Added font orientation parameter when creating FontPlatformData object.
+ (WebCore::FontCache::getFontDataForCharacters):
+ (WebCore::FontCache::createFontPlatformData):
+ * platform/graphics/mac/FontCustomPlatformData.cpp: Added font orientation parameter when creating FontPlatformData object.
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/mac/FontCustomPlatformData.h: Changed to pass font orientation parameter to fontPlatformData()
+ * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
+ (WebCore::GlyphPage::fill): Changed to use CoreText to extract glyphs when the current font is vertical orientation.
+ CoreText automatically swaps glyphs with vertical variants when the font orientation is vertical.
+ * platform/graphics/mac/SimpleFontDataCoreText.cpp: Added vertical form attribute to the attribute dictionary for a CTLine.
+ (WebCore::SimpleFontData::getCFStringAttributes):
+ * platform/graphics/mac/SimpleFontDataMac.mm:
+ (WebCore::SimpleFontData::platformBoundsForGlyph): Changed to use CoreText (from CG) to support vertical metrics.
+ (WebCore::SimpleFontData::platformWidthForGlyph): Made to use CoreText, instead of wkGetGlyphTransformedAdvances,
+ to get vertical metrics when the font orientation is vertical.
+ * platform/graphics/qt/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/qt/FontCustomPlatformDataQt.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/win/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/win/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/win/FontCustomPlatformDataCairo.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/win/FontCustomPlatformDataCairo.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/wince/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/wince/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/wx/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/wx/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+
+2010-10-20 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Redesign SVGAnimatedProperty concept to share "POD type wrappers" between all bindings (-> add ObjC SVG bindings)
+ https://bugs.webkit.org/show_bug.cgi?id=47905
+
+ Tests: svg/dom/SVGLengthList-appendItem.xhtml
+ svg/dom/SVGLengthList-basics.xhtml
+ svg/dom/SVGLengthList-getItem.xhtml
+ svg/dom/SVGLengthList-initialize.xhtml
+ svg/dom/SVGLengthList-insertItemBefore.xhtml
+ svg/dom/SVGLengthList-removeItem.xhtml
+ svg/dom/SVGLengthList-replaceItem.xhtml
+ svg/dom/SVGLengthList-xml-dom-modifications.xhtml
+
+ Introduce a more lightweight, less intrusive way to expose SVGAnimated* DOM bindings.
+
+ Concrete example:
+ The SVG DOM defines a 'SVGAnimatedLength' object, that's used to represent the x / y / width / height attributes of a 'SVGRectElement'.
+ Each 'SVGAnimatedLength' object exposes a baseVal (markup defined attribute value) and an animVal (reflects the current state during animations),
+ both of type 'SVGLength'. These objects are all _live_. That means you can do:
+ var foobar = rect.x.baseVal; foobar.value += 150;
+
+ If we'd implement the SVG DOM straightforward, we'd have to store a refcounted SVGAnimatedLength object, containing two refcounted SVGLength objects
+ in SVGRectElement, for each of the x/y/width/height attributes. Our solution, to reduce memory footprint and increase performance is to store
+ SVGLength stack-allocated, non refcounted types in SVGRectElement for x/y/width/height, and don't implement the SVGAnimatedLength object at all.
+
+ In the past the JS bindings had to expose wrappers for SVGAnimatedLength on their own, and wrap each SVGLength object in an object called JSSVGPODTypeWrapper<SVGLength>.
+ When JS changed the 'value' of the 'SVGLength', we constructed a copy of the SVGLength object, modified it, and called rectElement->setXBaseValue(newLength).
+ This is not efficient at all, as we have to construct several copies of the SVGLength object, utilize callbacks to propagate the value changes in the SVG DOM.
+ Furthermore, all bindings had to expose a similar concept, otherwhise SVG DOM wouldn't work. Up until now, only JSC and V8 bindings were available, that worked properly.
+
+ The new SVGAnimatedProperty concept removes the need for JSSVGPODTypeWrapper (and friends like JSSVGContextCache, that associated a SVGLength with its SVGRectElement).
+ Instead a solution is offered, that all bindings can use simultaneously, without adding new types or special concepts like JSSVGPODTypeWrapper.
+
+ It works like this:
+ A new refcounted SVGAnimatedProperty<PropertyType> template class is available, that stores a QualifiedName to associate the SVG DOM property with a XML DOM attribute.
+ It also stores a RefPtr to the SVGElement that created it.
+
+ In SVGRectElement we still store SVGLength m_x/m_y/m_width/m_height members, and offer a new "xAnimated()" method which looks up or creates a SVGAnimatedProperty<SVGLength>
+ object. The JS/V8/ObjC bindings call this method whenever someone requests "rect.x/y/width/height", and a new wrapper is created, and stored in a HashMap.
+
+ The SVGAnimatedProperty<PropertyType> is a base class for SVGAnimatedPropertyTearOff and SVGAnimatedListPropertyTearOff, the latter is used for all types of lists (SVGLengthList).
+ SVGAnimatedProperty contains two methods used in the bindings: SVGProperty* baseVal and SVGProperty* animVal. SVGProperty is a base class for SVGPropertyTearOff and
+ SVGListPropertyTearOff. Upon invocation of the baseVal/animVal methods a new SVG(List)PropertyTearOff object is created and stored in a RefPtr.
+ The SVGPropertyTearOff objects stores a _reference_ to the type it wraps. Concrete example:
+ When calling rect.x, a SVGAnimatedPropertyTearOff<SVGLength> is created, that stores a pointer to the SVGRectElement, and a SVGNames::xAttr.
+ When calling rect.x.baseVal, a SVGPropertyTearOf<SVGLength> is created, that stores a reference to the "m_x" member variable of the SVGRectElement.
+ Any changes applied to the SVGLength object, through the wrapper, are immediately live, as no copies are involved anymore, nor the need to fire any callback methods.
+ This is the key concept of the new tear offs, no copies, no callbacks, no virtual methods (except one, needed for lists, but it's a detail).
+
+ The SVGAnimatedListPropertyTearOff and SVGListPropertyTearOff work the same, but for SVG*List objects. The whole SVG*List API is _removed_ from the SVG DOM classes
+ like SVGLengthList. It now inherits from Vector<SVGLength>, where it used to store a Vector<RefPtr<SVGListItem<SVGLength> > >. The SVGList API (insertItemBefore, appendItem, etc.)
+ is exposed through SVGListPropertyTearOff, and there's no need anymore for SVGLengthList to deal with it at all.
+ SVGLengthList is live just like most other SVG DOM object. Concrete example:
+ var item0 = text.x.baseVal.getItem(0); item0.value += 150;
+
+ Previously we chose to store a refcounted SVGListItem object, which wrapped the SVGLength object, to achieve liveness. We could change a single list item from DOM
+ w/o copying the whole list. The drawback is that a simple type likeSVGLengthList, was heavy to store, as it contained a list of RefPtrs around a wrapper object
+ around the real object 'SVGLength'. This complexity is completly gone.
+
+ The SVGListPropertyTearOff<SVGLengthList> stores a reference to the SVGLengthList object (eg. SVGTextElement::m_x) and maintains a list of SVGPropertyTearOff<SVGLength>
+ wrappers, that are created when necessary (getItem(2), will create a wrapper around the third list item), and cached. These SVGPropertyTearOff<SVGLength> objects
+ store references to the SVGLength object _in the SVGLengthList_. One has to be extra carefully, to keep those lists synchronized.
+ The SVGLengthList API is fully implemented for the first time, including moving items between lists, and is extensively tested with 8 new testcases.
+
+ This patch only changed SVGLength/SVGLengthList to the new concept. All other types remain using the old DeprecatedSVGAnimatedProperty* concept.
+ This will change in follow-up patches.
+
+ * GNUmakefile.am: Add new files from svg/properties to build.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * bindings/js/JSSVGLengthCustom.cpp: Adapt to context cache removal for SVGLength.
+ (WebCore::JSSVGLength::value):
+ (WebCore::JSSVGLength::convertToSpecifiedUnits):
+ * bindings/scripts/CodeGenerator.pm: Add new isSVGNewStyleAnimatedProperty() helper method, return true for "SVGAnimatedLength" and "SVGAnimatedLengthList".
+ * bindings/scripts/CodeGeneratorJS.pm: Generate new style SVG JS bindings, that don't need JSSVGContextCache / JSSVGPODTypeWrapper.
+ * bindings/scripts/CodeGeneratorObjC.pm: Ditto. (+ Finally expose a working set of SVG DOM API for Objective C).
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ * bindings/v8/custom/V8SVGLengthCustom.cpp: Adapt to context cache removal for SVGLength.
+ (WebCore::V8SVGLength::valueAccessorGetter):
+ (WebCore::V8SVGLength::convertToSpecifiedUnitsCallback):
+ * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
+ (WebCore::extractFloatValuesFromSVGLengthList): SVGLengthList is a POD type now, passed as const reference.
+ * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove handling for SVGLength/SVGLengthList, those are converted to the new SVGAnimatedProperty design now.
+ * svg/DeprecatedSVGAnimatedTemplate.h: Ditto.
+ * svg/SVGAnimatedLength.h: Added.
+ * svg/SVGAnimatedLength.idl: Mark as [SVGAnimatedProperty].
+ * svg/SVGAnimatedLengthList.h: Added.
+ * svg/SVGAnimatedLengthList.idl: Mark as [SVGAnimatedProperty].
+ * svg/SVGCircleElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_PROPERTY_NEW/ until the transition to the new concept is finished.
+ * svg/SVGCursorElement.h: Ditto.
+ * svg/SVGEllipseElement.h: Ditto.
+ * svg/SVGFilterElement.h: Ditto.
+ * svg/SVGFilterPrimitiveStandardAttributes.h: Ditto.
+ * svg/SVGForeignObjectElement.h: Ditto.
+ * svg/SVGImageElement.h: Ditto.
+ * svg/SVGLength.idl: Mark as [SVGProperty].
+ * svg/SVGLengthList.cpp: Use Vector API (appendItem -> append). No need to ever use the SVGList API internally. SVGLengthList is a Vector<SVGLength> now.
+ (WebCore::SVGLengthList::parse):
+ (WebCore::SVGLengthList::valueAsString):
+ * svg/SVGLengthList.h: Inherit from Vector<SVGLength> - not from the SVGList base class. It's a simple, non-refcounted POD type now.
+ (WebCore::SVGLengthList::SVGLengthList):
+ * svg/SVGLengthList.idl: Mark as [SVGListProperty].
+ * svg/SVGLineElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_PROPERTY_NEW/ until the transition to the new concept is finished.
+ * svg/SVGLinearGradientElement.h: Ditto.
+ * svg/SVGMarkerElement.h: Ditto.
+ * svg/SVGMaskElement.h: Ditto.
+ * svg/SVGPatternElement.h: Ditto.
+ * svg/SVGRadialGradientElement.h: Ditto.
+ * svg/SVGRectElement.h: Ditto.
+ * svg/SVGSVGElement.h: Ditto.
+ * svg/SVGSVGElement.idl: Mark createSVGLength() as [SVGLiveProperty] - a wrapper for the returned object has to be created.
+ * svg/SVGTextContentElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_PROPERTY_NEW/ until the transition to the new concept is finished.
+ * svg/SVGTextPathElement.h: Ditto.
+ * svg/SVGTextPositioningElement.cpp:
+ (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
+ (WebCore::SVGTextPositioningElement::parseMappedAttribute): Detach wrappers pointing to the old x/y/dx/dy list, if the underlying list changes via XML DOM.
+ (WebCore::listContainsRelativeValue): Adapt to SVGLengthList interface changes, it's a POD type now.
+ * svg/SVGTextPositioningElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_LIST_PROPERTY_NEW/ until the transition to the new concept is finished.
+ * svg/SVGUseElement.h:
+ * svg/properties/SVGAnimatedListPropertyTearOff.h: Added.
+ * svg/properties/SVGAnimatedProperty.h: Added. This is the base class for SVGAnimatedPropertyTearOff and SVGAnimatedListPropertyTearOff.
+ * svg/properties/SVGAnimatedPropertyDescription.h: Added. Refactored from DeprecatedSVGAnimatedProperty.h.
+ * svg/properties/SVGAnimatedPropertyMacros.h: Added. These macros will be _removed_ as soon as the transition to the new concept is finished.
+ * svg/properties/SVGAnimatedPropertyTearOff.h: Added.
+ * svg/properties/SVGListPropertyTearOff.h: Added.
+ * svg/properties/SVGProperty.h: Added. This is the base class for SVGPropertyTearOff and SVGListPropertyTearOff.
+ * svg/properties/SVGPropertyTearOff.h: Added.
+ * svg/properties/SVGPropertyTraits.h: Added.
+
+2010-10-21 Alex Milowski <alex@milowski.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Changed the layout algorithm for rows to avoid unnecessary recursion
+ into child rows. This solves the long rendering time experienced in
+ https://bugs.webkit.org/show_bug.cgi?id=43462 as well as reports in
+ various other bugs. The change in the algorithm required some
+ tweaks to other rendering objects to make sure that the baseline
+ alignment still works.
+
+ In addition, an attempt was made to go through the various
+ rendering objects for MathML and reduce unnecessary calls that
+ mark the tree in need of layout.
+
+ * mathml/RenderMathMLFenced.cpp:
+ * mathml/RenderMathMLFenced.h:
+ * mathml/RenderMathMLFraction.cpp:
+ (WebCore::RenderMathMLFraction::layout):
+ * mathml/RenderMathMLOperator.cpp:
+ (WebCore::RenderMathMLOperator::stretchToHeight):
+ * mathml/RenderMathMLRoot.cpp:
+ (WebCore::RenderMathMLRoot::layout):
+ * mathml/RenderMathMLRow.cpp:
+ (WebCore::RenderMathMLRow::layout):
+ * mathml/RenderMathMLRow.h:
+ (WebCore::RenderMathMLRow::stretchToHeight):
+ * mathml/RenderMathMLSubSup.cpp:
+ (WebCore::RenderMathMLSubSup::addChild):
+ (WebCore::RenderMathMLSubSup::stretchToHeight):
+ (WebCore::RenderMathMLSubSup::nonOperatorHeight):
+ (WebCore::RenderMathMLSubSup::layout):
+ (WebCore::RenderMathMLSubSup::baselinePosition):
+ * mathml/RenderMathMLUnderOver.cpp:
+ (WebCore::RenderMathMLUnderOver::stretchToHeight):
+ (WebCore::RenderMathMLUnderOver::layout):
+ (WebCore::RenderMathMLUnderOver::nonOperatorHeight):
+ * mathml/mathtags.in:
+
+2010-10-21 Evan Martin <evan@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ sqlite: show extended error codes in error logs
+ https://bugs.webkit.org/show_bug.cgi?id=47859
+
+ SQLite can provide "extended" error codes, where extra information
+ about the error is potentially encoded in the high bits of the error
+ code. It's only off by default in case older apps rely on equality
+ testing on the older error codes, which WebKit doesn't do.
+
+ * platform/sql/SQLiteDatabase.cpp:
+ (WebCore::SQLiteDatabase::open):
+ * platform/sql/SQLiteStatement.cpp:
+ (WebCore::SQLiteStatement::step):
+
+2010-10-21 Yuta Kitamura <yutak@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Handle WebSocket events via InspectorInstrumentation
+ https://bugs.webkit.org/show_bug.cgi?id=47968
+
+ * inspector/InspectorInstrumentation.cpp:
+ (WebCore::InspectorInstrumentation::didCreateWebSocketImpl):
+ (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl):
+ (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl):
+ (WebCore::InspectorInstrumentation::didCloseWebSocketImpl):
+ * inspector/InspectorInstrumentation.h:
+ (WebCore::InspectorInstrumentation::didCreateWebSocket):
+ (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequest):
+ (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponse):
+ (WebCore::InspectorInstrumentation::didCloseWebSocket):
+ * websockets/WebSocketChannel.cpp:
+ (WebCore::WebSocketChannel::WebSocketChannel):
+ Now we do not depend on InspectorController to generate a resource identifier.
+ (WebCore::WebSocketChannel::disconnect):
+ Check if m_identifier is valid in case we could not obtain an identifier.
+ (WebCore::WebSocketChannel::didOpen):
+ (WebCore::WebSocketChannel::didClose):
+ (WebCore::WebSocketChannel::processBuffer):
+ * websockets/WebSocketChannel.h:
+
+2010-10-20 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Convert sidebar into the browsing tree in the Storage panel.
+ https://bugs.webkit.org/show_bug.cgi?id=47988
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/ApplicationCacheItemsView.js:
+ (WebInspector.ApplicationCacheItemsView):
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleMessage.prototype._formatMessage):
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView):
+ * inspector/front-end/DatabaseTableView.js:
+ (WebInspector.DatabaseTableView.prototype._queryFinished):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel):
+ (WebInspector.StoragePanel.prototype.reset):
+ (WebInspector.StoragePanel.prototype.addDatabase):
+ (WebInspector.StoragePanel.prototype.addCookieDomain):
+ (WebInspector.StoragePanel.prototype.addDOMStorage):
+ (WebInspector.StoragePanel.prototype.addApplicationCache):
+ (WebInspector.StoragePanel.prototype.showDatabase):
+ (WebInspector.StoragePanel.prototype.showDOMStorage):
+ (WebInspector.StoragePanel.prototype.showCookies):
+ (WebInspector.StoragePanel.prototype.showApplicationCache):
+ (WebInspector.StoragePanel.prototype.showCategoryView):
+ (WebInspector.StoragePanel.prototype._innerShowView):
+ (WebInspector.BaseStorageTreeElement):
+ (WebInspector.BaseStorageTreeElement.prototype.onattach):
+ (WebInspector.StorageCategoryTreeElement):
+ (WebInspector.StorageCategoryTreeElement.prototype.onselect):
+ (WebInspector.DatabaseTreeElement):
+ (WebInspector.DatabaseTreeElement.prototype.onselect):
+ (WebInspector.DatabaseTreeElement.prototype.onpopulate.tableNamesCallback):
+ (WebInspector.DatabaseTreeElement.prototype.onpopulate):
+ (WebInspector.DatabaseTableTreeElement):
+ (WebInspector.DatabaseTableTreeElement.prototype.onselect):
+ (WebInspector.DOMStorageTreeElement):
+ (WebInspector.DOMStorageTreeElement.prototype.onselect):
+ (WebInspector.CookieTreeElement):
+ (WebInspector.CookieTreeElement.prototype.onselect):
+ (WebInspector.ApplicationCacheTreeElement):
+ (WebInspector.ApplicationCacheTreeElement.prototype.onselect):
+ (WebInspector.StorageCategoryView):
+ (WebInspector.StorageCategoryView.prototype.setText):
+ * inspector/front-end/inspector.css:
+ (.properties-tree ol):
+ (.properties-tree ol.expanded):
+ (.database-storage-tree-item .icon):
+ (.database-table-storage-tree-item .icon):
+ (.domstorage-storage-tree-item.local-storage .icon):
+ (.domstorage-storage-tree-item.session-storage .icon):
+ (.cookie-storage-tree-item .icon):
+ (.application-cache-storage-tree-item .icon):
+ (.storage.panel .sidebar):
+ (.storage.panel .outline-disclosure > ol):
+ (.storage.panel .outline-disclosure li):
+ (.storage.panel .outline-disclosure li .selection):
+ (.storage.panel .sidebar-resizer-vertical):
+ (.storage-base-tree-element-title):
+ (.storage.panel .outline-disclosure ol):
+ (.storage.panel .outline-disclosure li.selected):
+ (.storage.panel .outline-disclosure .icon):
+ (.storage-empty-view, .storage-view.table .storage-table-error):
+
+2010-10-21 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Replace encodings multi-dimensional array with calls to registrar method
+ https://bugs.webkit.org/show_bug.cgi?id=47990
+
+ * platform/text/gtk/TextCodecGtk.cpp:
+ (WebCore::isEncodingAvailable):
+ (WebCore::registerEncodingNameIfAvailable):
+ (WebCore::registerEncodingAliasIfAvailable):
+ (WebCore::registerCodecIfAvailable):
+ (WebCore::TextCodecGtk::registerBaseEncodingNames):
+ (WebCore::TextCodecGtk::registerBaseCodecs):
+ (WebCore::TextCodecGtk::registerExtendedEncodingNames):
+ (WebCore::TextCodecGtk::registerExtendedCodecs):
+ (WebCore::TextCodecGtk::createIConvDecoder):
+ (WebCore::TextCodecGtk::createIConvEncoder):
+ * platform/text/gtk/TextCodecGtk.h:
+
2010-10-20 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r70040.
@@ -318,7 +7303,7 @@
(WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
(WebCore::InputFieldSpeechButtonElement::detach):
-2010-10-19 Leandro Gracia Gil <leandrogracia@google.com>
+2010-10-20 Leandro Gracia Gil <leandrogracia@google.com>
Reviewed by Jeremy Orlow.
diff --git a/WebCore/Configurations/FeatureDefines.xcconfig b/WebCore/Configurations/FeatureDefines.xcconfig
index 7cb8640..d08fadf 100644
--- a/WebCore/Configurations/FeatureDefines.xcconfig
+++ b/WebCore/Configurations/FeatureDefines.xcconfig
@@ -109,6 +109,8 @@ ENABLE_SVG_FOREIGN_OBJECT = ENABLE_SVG_FOREIGN_OBJECT;
ENABLE_SVG_USE = ENABLE_SVG_USE;
ENABLE_VIDEO = ENABLE_VIDEO;
+ENABLE_WEB_AUDIO = ;
+
ENABLE_WEB_SOCKETS = $(ENABLE_WEB_SOCKETS_$(REAL_PLATFORM_NAME));
ENABLE_WEB_SOCKETS_macosx = ENABLE_WEB_SOCKETS;
@@ -122,4 +124,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp
index 01f5023..80c1304 100644
--- a/WebCore/DerivedSources.cpp
+++ b/WebCore/DerivedSources.cpp
@@ -92,6 +92,7 @@
#include "JSDOMPlugin.cpp"
#include "JSDOMPluginArray.cpp"
#include "JSDOMSelection.cpp"
+#include "JSDOMSettableTokenList.cpp"
#include "JSDOMStringList.cpp"
#include "JSDOMStringMap.cpp"
#include "JSDOMTokenList.cpp"
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index 342bb7b..4e732de 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -125,6 +125,7 @@ DOM_CLASSES = \
DOMSelection \
DOMStringList \
DOMStringMap \
+ DOMSettableTokenList \
DOMTokenList \
DOMWindow \
Database \
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index 8f3a228..7403b22 100644
--- a/WebCore/English.lproj/localizedStrings.js
+++ b/WebCore/English.lproj/localizedStrings.js
Binary files differ
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index b057051..6c1bc35 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -221,6 +221,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSDOMPlugin.h \
DerivedSources/WebCore/JSDOMSelection.cpp \
DerivedSources/WebCore/JSDOMSelection.h \
+ DerivedSources/WebCore/JSDOMSettableTokenList.cpp \
+ DerivedSources/WebCore/JSDOMSettableTokenList.h \
DerivedSources/WebCore/JSDOMStringList.cpp \
DerivedSources/WebCore/JSDOMStringList.h \
DerivedSources/WebCore/JSDOMStringMap.cpp \
@@ -726,6 +728,7 @@ webcore_sources += \
WebCore/bindings/js/JSEventTarget.h \
WebCore/bindings/js/JSExceptionBase.cpp \
WebCore/bindings/js/JSExceptionBase.h \
+ WebCore/bindings/js/JSFileReaderCustom.cpp \
WebCore/bindings/js/JSGeolocationCustom.cpp \
WebCore/bindings/js/JSHistoryCustom.cpp \
WebCore/bindings/js/JSHistoryCustom.h \
@@ -1141,6 +1144,7 @@ webcore_sources += \
WebCore/dom/ExceptionCode.cpp \
WebCore/dom/ExceptionCode.h \
WebCore/dom/FragmentScriptingPermission.h \
+ WebCore/dom/IgnoreDestructiveWriteCountIncrementer.h \
WebCore/dom/InputElement.cpp \
WebCore/dom/InputElement.h \
WebCore/dom/HashChangeEvent.h \
@@ -1351,6 +1355,8 @@ webcore_sources += \
WebCore/editing/SplitTextNodeContainingElementCommand.cpp \
WebCore/editing/SplitTextNodeContainingElementCommand.h \
WebCore/editing/TextAffinity.h \
+ WebCore/editing/TextCheckingHelper.cpp \
+ WebCore/editing/TextCheckingHelper.h \
WebCore/editing/TextGranularity.h \
WebCore/editing/TextIterator.cpp \
WebCore/editing/TextIterator.h \
@@ -1415,6 +1421,9 @@ webcore_sources += \
WebCore/fileapi/FileList.h \
WebCore/fileapi/FileReader.cpp \
WebCore/fileapi/FileReader.h \
+ WebCore/fileapi/FileReaderLoader.cpp \
+ WebCore/fileapi/FileReaderLoader.h \
+ WebCore/fileapi/FileReaderLoaderClient.h \
WebCore/fileapi/FileReaderSync.cpp \
WebCore/fileapi/FileReaderSync.h \
WebCore/fileapi/FileStreamProxy.cpp \
@@ -1452,6 +1461,10 @@ webcore_sources += \
WebCore/history/PageCache.h \
WebCore/html/AsyncImageResizer.cpp \
WebCore/html/AsyncImageResizer.h \
+ WebCore/html/BaseButtonInputType.cpp \
+ WebCore/html/BaseButtonInputType.h \
+ WebCore/html/BaseCheckableInputType.cpp \
+ WebCore/html/BaseCheckableInputType.h \
WebCore/html/BaseDateAndTimeInputType.cpp \
WebCore/html/BaseDateAndTimeInputType.h \
WebCore/html/BaseTextInputType.cpp \
@@ -1471,10 +1484,14 @@ webcore_sources += \
WebCore/html/canvas/CanvasRenderingContext.h \
WebCore/html/canvas/CanvasStyle.cpp \
WebCore/html/canvas/CanvasStyle.h \
+ WebCore/html/DOMSettableTokenList.cpp \
+ WebCore/html/DOMSettableTokenList.h \
WebCore/html/DOMTokenList.cpp \
WebCore/html/DOMTokenList.h \
WebCore/html/CheckboxInputType.cpp \
WebCore/html/CheckboxInputType.h \
+ WebCore/html/ClassList.cpp \
+ WebCore/html/ClassList.h \
WebCore/html/CollectionCache.cpp \
WebCore/html/CollectionCache.h \
WebCore/html/CollectionType.h \
@@ -2125,6 +2142,8 @@ webcore_sources += \
WebCore/page/SpeechInput.cpp \
WebCore/page/SpeechInput.h \
WebCore/page/SpeechInputListener.h \
+ WebCore/page/SpeechInputResult.cpp \
+ WebCore/page/SpeechInputResult.h \
WebCore/page/SuspendableTimer.cpp \
WebCore/page/SuspendableTimer.h \
WebCore/page/Timing.cpp \
@@ -2173,6 +2192,7 @@ webcore_sources += \
WebCore/platform/EventLoop.h \
WebCore/platform/FileChooser.cpp \
WebCore/platform/FileChooser.h \
+ WebCore/platform/FileMetadata.h \
WebCore/platform/FileStreamClient.h \
WebCore/platform/FileStream.cpp \
WebCore/platform/FileStream.h \
@@ -2371,6 +2391,7 @@ webcore_sources += \
WebCore/platform/network/BlobResourceHandle.cpp \
WebCore/platform/network/BlobResourceHandle.h \
WebCore/platform/network/BlobStorageData.h \
+ WebCore/platform/network/CookieStorage.h \
WebCore/platform/network/Credential.cpp \
WebCore/platform/network/Credential.h \
WebCore/platform/network/DNS.h \
@@ -3007,7 +3028,17 @@ webcore_sources += \
WebCore/svg/graphics/SVGImage.h \
WebCore/svg/LinearGradientAttributes.h \
WebCore/svg/PatternAttributes.h \
+ WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h \
+ WebCore/svg/properties/SVGAnimatedProperty.h \
+ WebCore/svg/properties/SVGAnimatedPropertyDescription.h \
+ WebCore/svg/properties/SVGAnimatedPropertyMacros.h \
WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h \
+ WebCore/svg/properties/SVGAnimatedPropertyTearOff.h \
+ WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h \
+ WebCore/svg/properties/SVGListPropertyTearOff.h \
+ WebCore/svg/properties/SVGProperty.h \
+ WebCore/svg/properties/SVGPropertyTearOff.h \
+ WebCore/svg/properties/SVGPropertyTraits.h \
WebCore/svg/RadialGradientAttributes.h \
WebCore/svg/SVGAElement.cpp \
WebCore/svg/SVGAElement.h \
@@ -3017,10 +3048,17 @@ webcore_sources += \
WebCore/svg/SVGAngle.h \
WebCore/svg/SVGAnimateColorElement.cpp \
WebCore/svg/SVGAnimateColorElement.h \
+ WebCore/svg/SVGAnimatedAngle.h \
+ WebCore/svg/SVGAnimatedBoolean.h \
+ WebCore/svg/SVGAnimatedEnumeration.h \
+ WebCore/svg/SVGAnimatedInteger.h \
+ WebCore/svg/SVGAnimatedLength.h \
+ WebCore/svg/SVGAnimatedLengthList.h \
WebCore/svg/SVGAnimatedPathData.cpp \
WebCore/svg/SVGAnimatedPathData.h \
WebCore/svg/SVGAnimatedPoints.cpp \
WebCore/svg/SVGAnimatedPoints.h \
+ WebCore/svg/SVGAnimatedRect.h \
WebCore/svg/SVGAnimateElement.cpp \
WebCore/svg/SVGAnimateElement.h \
WebCore/svg/SVGAnimateMotionElement.cpp \
@@ -3595,6 +3633,8 @@ webcoregtk_sources += \
WebCore/platform/network/soup/SocketStreamError.h \
WebCore/platform/network/soup/SocketStreamHandle.h \
WebCore/platform/network/soup/SocketStreamHandleSoup.cpp \
+ WebCore/platform/network/soup/SoupURIUtils.cpp \
+ WebCore/platform/network/soup/SoupURIUtils.h \
WebCore/platform/network/soup/cache/soup-directory-input-stream.c \
WebCore/platform/network/soup/cache/soup-directory-input-stream.h \
WebCore/platform/network/soup/cache/soup-http-input-stream.c \
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 6948d67..66dc594 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -347,21 +347,17 @@ __ZN7WebCore15FocusController15setFocusedFrameEN3WTF10PassRefPtrINS_5FrameEEE
__ZN7WebCore15FocusController15setInitialFocusENS_14FocusDirectionEPNS_13KeyboardEventE
__ZN7WebCore15FocusController9setActiveEb
__ZN7WebCore15GraphicsContext12setFillColorERKNS_5ColorENS_10ColorSpaceE
+__ZN7WebCore15GraphicsContext15setFillGradientEN3WTF10PassRefPtrINS_8GradientEEE
__ZN7WebCore15GraphicsContext20endTransparencyLayerEv
__ZN7WebCore15GraphicsContext21setCompositeOperationENS_17CompositeOperatorE
__ZN7WebCore15GraphicsContext22beginTransparencyLayerEf
+__ZN7WebCore15GraphicsContext4clipERKNS_4PathE
__ZN7WebCore15GraphicsContext4clipERKNS_9FloatRectE
+__ZN7WebCore15GraphicsContext4saveEv
__ZN7WebCore15GraphicsContext5scaleERKNS_9FloatSizeE
-__ZN7WebCore15GraphicsContext15setFillGradientEN3WTF10PassRefPtrINS_8GradientEEE
-__ZN7WebCore4PathD1Ev
-__ZN7WebCore8Gradient12addColorStopEfRKNS_5ColorE
-__ZN7WebCore4PathC1Ev
-__ZN7WebCore15GraphicsContext4clipERKNS_4PathE
-__ZN7WebCore15GraphicsContext8fillPathEv
-__ZN7WebCore4Path14addRoundedRectERKNS_9FloatRectERKNS_9FloatSizeE
__ZN7WebCore15GraphicsContext7addPathERKNS_4PathE
-__ZN7WebCore15GraphicsContext4saveEv
__ZN7WebCore15GraphicsContext7restoreEv
+__ZN7WebCore15GraphicsContext8fillPathEv
__ZN7WebCore15GraphicsContext8fillRectERKNS_9FloatRectE
__ZN7WebCore15GraphicsContext8fillRectERKNS_9FloatRectERKNS_5ColorENS_10ColorSpaceE
__ZN7WebCore15GraphicsContext9setShadowERKNS_9FloatSizeEfRKNS_5ColorENS_10ColorSpaceE
@@ -384,7 +380,7 @@ __ZN7WebCore16DeviceMotionData12Acceleration6createEbdbdbd
__ZN7WebCore16DeviceMotionData12RotationRate6createEbdbdbd
__ZN7WebCore16DeviceMotionData6createEN3WTF10PassRefPtrINS0_12AccelerationEEES4_NS2_INS0_12RotationRateEEEbd
__ZN7WebCore16FontFallbackList15releaseFontDataEv
-__ZN7WebCore16FontPlatformDataC1EP6NSFontbb
+__ZN7WebCore16FontPlatformDataC1EP6NSFontbbNS_15FontOrientationE
__ZN7WebCore16FontPlatformDataD1Ev
__ZN7WebCore16HTMLInputElement13setAutofilledEb
__ZN7WebCore16LegacyWebArchive19createFromSelectionEPNS_5FrameE
@@ -421,9 +417,10 @@ __ZN7WebCore16createFullMarkupEPKNS_4NodeE
__ZN7WebCore16createFullMarkupEPKNS_5RangeE
__ZN7WebCore16enclosingIntRectERK7_NSRect
__ZN7WebCore16enclosingIntRectERKNS_9FloatRectE
-__ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionE
+__ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionENS_8Position27EditingBoundaryCrossingRuleE
__ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERNS0_9WeakGCMapIPN3WTF10StringImplEPNS0_8JSStringEEES6_
__ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE
+__ZN7WebCore17DOMImplementation13isXMLMIMETypeERKN3WTF6StringE
__ZN7WebCore17DOMImplementation14isTextMIMETypeERKN3WTF6StringE
__ZN7WebCore17DeviceOrientation6createEbdbdbd
__ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
@@ -431,13 +428,16 @@ __ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv
__ZN7WebCore17nameForCursorTypeENS_6Cursor4TypeE
__ZN7WebCore17openTemporaryFileEPKcRi
__ZN7WebCore18SearchPopupMenuMacC1EPNS_15PopupMenuClientE
-__ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionE
+__ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionENS_8Position27EditingBoundaryCrossingRuleE
__ZN7WebCore18pluginScriptObjectEPN3JSC9ExecStateEPNS_13JSHTMLElementE
__ZN7WebCore18proxyServersForURLERKNS_4KURLEPKNS_17NetworkingContextE
__ZN7WebCore19AnimationController16resumeAnimationsEPNS_8DocumentE
__ZN7WebCore19AnimationController17suspendAnimationsEPNS_8DocumentE
__ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKN3WTF6StringEd
__ZN7WebCore19AnimationController21pauseTransitionAtTimeEPNS_12RenderObjectERKN3WTF6StringEd
+__ZN7WebCore19BackForwardListImpl11currentItemEv
+__ZN7WebCore19BackForwardListImpl11forwardItemEv
+__ZN7WebCore19BackForwardListImpl8backItemEv
__ZN7WebCore19BackForwardListImplC1EPNS_4PageE
__ZN7WebCore19CSSStyleDeclaration11setPropertyERKN3WTF6StringES4_Ri
__ZN7WebCore19ResourceRequestBase11setHTTPBodyEN3WTF10PassRefPtrINS_8FormDataEEE
@@ -485,8 +485,8 @@ __ZN7WebCore22counterValueForElementEPNS_7ElementE
__ZN7WebCore22createFragmentFromTextEPNS_5RangeERKN3WTF6StringE
__ZN7WebCore22externalRepresentationEPNS_5FrameEj
__ZN7WebCore23ReplaceSelectionCommandC1EPNS_8DocumentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEbbbbbNS_10EditActionE
-__ZN7WebCore23overrideDefaultLanguageERKN3WTF6StringE
__ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0EEE
+__ZN7WebCore23overrideDefaultLanguageERKN3WTF6StringE
__ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv
__ZN7WebCore24DocumentMarkerController13removeMarkersENS_14DocumentMarker10MarkerTypeE
__ZN7WebCore24DocumentMarkerController14markersForNodeEPNS_4NodeE
@@ -607,6 +607,9 @@ __ZN7WebCore4Page9goForwardEv
__ZN7WebCore4Page9initGroupEv
__ZN7WebCore4PageC1ERKNS0_11PageClientsE
__ZN7WebCore4PageD1Ev
+__ZN7WebCore4Path14addRoundedRectERKNS_9FloatRectERKNS_9FloatSizeE
+__ZN7WebCore4PathC1Ev
+__ZN7WebCore4PathD1Ev
__ZN7WebCore4coreEP20NSURLProtectionSpace
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_5RangeE
@@ -625,6 +628,7 @@ __ZN7WebCore5Frame28searchForLabelsBeforeElementEP7NSArrayPNS_7ElementEPmPb
__ZN7WebCore5Frame6createEPNS_4PageEPNS_21HTMLFrameOwnerElementEPNS_17FrameLoaderClientE
__ZN7WebCore5Frame7setViewEN3WTF10PassRefPtrINS_9FrameViewEEE
__ZN7WebCore5Frame9nodeImageEPNS_4NodeE
+__ZN7WebCore5Frame9scalePageEf
__ZN7WebCore5FrameD1Ev
__ZN7WebCore5Image12supportsTypeERKN3WTF6StringE
__ZN7WebCore5Image20loadPlatformResourceEPKc
@@ -721,6 +725,7 @@ __ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsEv
__ZN7WebCore8Document4headEv
__ZN7WebCore8FormData6createEPKvm
__ZN7WebCore8FormDataD1Ev
+__ZN7WebCore8Gradient12addColorStopEfRKNS_5ColorE
__ZN7WebCore8GradientC1ERKNS_10FloatPointES3_
__ZN7WebCore8IntPointC1ERK8_NSPoint
__ZN7WebCore8PositionC1EN3WTF10PassRefPtrINS_4NodeEEEi
@@ -901,8 +906,8 @@ __ZNK7WebCore11FrameLoader12blockedErrorERKNS_15ResourceRequestE
__ZNK7WebCore11FrameLoader14cancelledErrorERKNS_15ResourceRequestE
__ZNK7WebCore11FrameLoader14frameHasLoadedEv
__ZNK7WebCore11FrameLoader16outgoingReferrerEv
-__ZNK7WebCore11FrameLoader20activeDocumentLoaderEv
__ZNK7WebCore11FrameLoader17networkingContextEv
+__ZNK7WebCore11FrameLoader20activeDocumentLoaderEv
__ZNK7WebCore11FrameLoader27numPendingOrLoadingRequestsEb
__ZNK7WebCore11FrameLoader8loadTypeEv
__ZNK7WebCore11HistoryItem10visitCountEv
@@ -950,6 +955,7 @@ __ZNK7WebCore13HitTestResult11textContentEv
__ZNK7WebCore13HitTestResult15absoluteLinkURLEv
__ZNK7WebCore13HitTestResult15spellingToolTipERNS_13TextDirectionE
__ZNK7WebCore13HitTestResult16absoluteImageURLEv
+__ZNK7WebCore13HitTestResult16absoluteMediaURLEv
__ZNK7WebCore13HitTestResult16altDisplayStringEv
__ZNK7WebCore13HitTestResult17isContentEditableEv
__ZNK7WebCore13HitTestResult18titleDisplayStringEv
@@ -1050,7 +1056,7 @@ __ZNK7WebCore5Range14startContainerERi
__ZNK7WebCore5Range19boundaryPointsValidEv
__ZNK7WebCore5Range9endOffsetERi
__ZNK7WebCore5Range9firstNodeEv
-__ZNK7WebCore6Chrome12createWindowEPNS_5FrameERKNS_16FrameLoadRequestERKNS_14WindowFeaturesE
+__ZNK7WebCore6Chrome12createWindowEPNS_5FrameERKNS_16FrameLoadRequestERKNS_14WindowFeaturesERKNS_16NavigationActionE
__ZNK7WebCore6Cursor14platformCursorEv
__ZNK7WebCore6Editor12selectedTextEv
__ZNK7WebCore6Editor13canEditRichlyEv
@@ -1085,6 +1091,7 @@ __ZNK7WebCore6Widget25convertToContainingWindowERKNS_7IntRectE
__ZNK7WebCore6Widget25convertToContainingWindowERKNS_8IntPointE
__ZNK7WebCore6Widget9frameRectEv
__ZNK7WebCore7Element12getAttributeERKNS_13QualifiedNameE
+__ZNK7WebCore7Element19boundsInWindowSpaceEv
__ZNK7WebCore7Element9innerTextEv
__ZNK7WebCore7IntRectcv6CGRectEv
__ZNK7WebCore7IntRectcv7_NSRectEv
@@ -1162,7 +1169,6 @@ _wkInitializeMaximumHTTPConnectionCountPerHost
_wkIsLatchingWheelEvent
_wkMeasureMediaUIPart
_wkMediaControllerThemeAvailable
-_wkNoteOpenPanelFiles
_wkPopupMenu
_wkQTIncludeOnlyModernMediaFileTypes
_wkQTMovieDataRate
@@ -1178,6 +1184,7 @@ _wkQTMovieViewSetDrawSynchronously
_wkSetCGFontRenderingMode
_wkSetCONNECTProxyAuthorizationForStream
_wkSetCONNECTProxyForStream
+_wkSetCookieStoragePrivateBrowsingEnabled
_wkSetDragImage
_wkSetNSURLConnectionDefersCallbacks
_wkSetNSURLRequestShouldContentSniff
diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
index 7f586a6..ce77c8f 100644
--- a/WebCore/WebCore.gyp/WebCore.gyp
+++ b/WebCore/WebCore.gyp/WebCore.gyp
@@ -1077,7 +1077,6 @@
['include', 'platform/graphics/chromium/FontCacheLinux\\.cpp$'],
['include', 'platform/graphics/chromium/FontLinux\\.cpp$'],
['include', 'platform/graphics/chromium/FontPlatformDataLinux\\.cpp$'],
- ['include', 'platform/graphics/chromium/GlyphPageTreeNodeLinux\\.cpp$'],
['include', 'platform/graphics/chromium/SimpleFontDataLinux\\.cpp$'],
],
}],
@@ -1165,23 +1164,14 @@
# platform/graphics/chromium, included by regex above, instead.
['exclude', 'platform/graphics/chromium/ImageChromium\\.cpp$'],
- # The Mac uses ImageSourceCG.cpp from platform/graphics/cg, included
- # by regex above, instead.
- ['exclude', 'platform/graphics/ImageSource\\.cpp$'],
+ # The Mac does not use ImageSourceCG.cpp from platform/graphics/cg
+ # even though it is included by regex above.
+ ['exclude', 'platform/graphics/cg/ImageSourceCG\\.cpp$'],
+ ['exclude', 'platform/graphics/cg/PDFDocumentImage\\.cpp$'],
- # Skia image-decoders are also not used on mac. CoreGraphics
- # is used directly instead.
- ['exclude', 'platform/image-decoders/ImageDecoder\\.h$'],
- ['exclude', 'platform/image-decoders/bmp/BMPImageDecoder\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/bmp/BMPImageReader\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/gif/GIFImageDecoder\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/gif/GIFImageReader\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/ico/ICOImageDecoder\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/jpeg/JPEGImageDecoder\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/webp/WEBPImageDecoder\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/png/PNGImageDecoder\\.(cpp|h)$'],
+ # ImageDecoderSkia is not used on mac. ImageDecoderCG is used instead.
['exclude', 'platform/image-decoders/skia/ImageDecoderSkia\\.cpp$'],
- ['exclude', 'platform/image-decoders/xbm/XBMImageDecoder\\.(cpp|h)$'],
+ ['include', 'platform/image-decoders/cg/ImageDecoderCG\\.cpp$'],
# Again, Skia is not used on Mac.
['exclude', 'platform/chromium/DragImageChromiumSkia\\.cpp$'],
@@ -1206,6 +1196,10 @@
['OS=="win"', {
'sources/': [
['exclude', 'Posix\\.cpp$'],
+
+ # The Chromium Win currently uses GlyphPageTreeNodeChromiumWin.cpp from
+ # platform/graphics/chromium, included by regex above, instead.
+ ['exclude', 'platform/graphics/skia/GlyphPageTreeNodeSkia\\.cpp$']
],
}],
['"ENABLE_CLIENT_BASED_GEOLOCATION=1" in feature_defines', {
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 166c4d1..934db17 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -117,6 +117,7 @@
'fileapi/Metadata.idl',
'fileapi/MetadataCallback.idl',
'html/DOMFormData.idl',
+ 'html/DOMSettableTokenList.idl',
'html/DOMTokenList.idl',
'html/DataGridColumn.idl',
'html/DataGridColumnList.idl',
@@ -601,6 +602,7 @@
'bindings/js/JSEventTarget.h',
'bindings/js/JSExceptionBase.cpp',
'bindings/js/JSExceptionBase.h',
+ 'bindings/js/JSFileReaderCustom.cpp',
'bindings/js/JSGeolocationCustom.cpp',
'bindings/js/JSHistoryCustom.cpp',
'bindings/js/JSHistoryCustom.h',
@@ -777,6 +779,7 @@
'bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp',
'bindings/v8/custom/V8DocumentLocationCustom.cpp',
'bindings/v8/custom/V8DOMFormDataCustom.cpp',
+ 'bindings/v8/custom/V8DOMSettableTokenListCustom.cpp',
'bindings/v8/custom/V8DOMStringMapCustom.cpp',
'bindings/v8/custom/V8DOMTokenListCustom.cpp',
'bindings/v8/custom/V8DOMWindowCustom.cpp',
@@ -1212,6 +1215,7 @@
'dom/ExceptionCode.cpp',
'dom/ExceptionCode.h',
'dom/FragmentScriptingPermission.h',
+ 'dom/IgnoreDestructiveWriteCountIncrementer.h',
'dom/InputElement.cpp',
'dom/InputElement.h',
'dom/HashChangeEvent.h',
@@ -1433,6 +1437,8 @@
'editing/SplitTextNodeContainingElementCommand.cpp',
'editing/SplitTextNodeContainingElementCommand.h',
'editing/TextAffinity.h',
+ 'editing/TextCheckingHelper.cpp',
+ 'editing/TextCheckingHelper.h',
'editing/TextGranularity.h',
'editing/TextIterator.cpp',
'editing/TextIterator.h',
@@ -1503,6 +1509,9 @@
'fileapi/FileList.h',
'fileapi/FileReader.cpp',
'fileapi/FileReader.h',
+ 'fileapi/FileReaderLoader.cpp',
+ 'fileapi/FileReaderLoader.h',
+ 'fileapi/FileReaderLoaderClient.h',
'fileapi/FileReaderSync.cpp',
'fileapi/FileReaderSync.h',
'fileapi/FileStreamProxy.cpp',
@@ -1542,6 +1551,10 @@
'history/PageCache.h',
'html/AsyncImageResizer.cpp',
'html/AsyncImageResizer.h',
+ 'html/BaseButtonInputType.cpp',
+ 'html/BaseButtonInputType.h',
+ 'html/BaseCheckableInputType.cpp',
+ 'html/BaseCheckableInputType.h',
'html/BaseDateAndTimeInputType.cpp',
'html/BaseDateAndTimeInputType.h',
'html/BaseTextInputType.cpp',
@@ -1550,6 +1563,8 @@
'html/ButtonInputType.h',
'html/CheckboxInputType.cpp',
'html/CheckboxInputType.h',
+ 'html/ClassList.cpp',
+ 'html/ClassList.h',
'html/CollectionCache.cpp',
'html/CollectionCache.h',
'html/CollectionType.h',
@@ -1559,6 +1574,8 @@
'html/DOMDataGridDataSource.h',
'html/DOMFormData.cpp',
'html/DOMFormData.h',
+ 'html/DOMSettableTokenList.cpp',
+ 'html/DOMSettableTokenList.h',
'html/DOMTokenList.cpp',
'html/DOMTokenList.h',
'html/DataGridColumn.cpp',
@@ -2262,6 +2279,8 @@
'page/SpeechInput.h',
'page/SpeechInputClient.h',
'page/SpeechInputListener.h',
+ 'page/SpeechInputResult.cpp',
+ 'page/SpeechInputResult.h',
'page/SuspendableTimer.cpp',
'page/SuspendableTimer.h',
'page/Timing.cpp',
@@ -2419,7 +2438,6 @@
'platform/graphics/chromium/GLES2Canvas.cpp',
'platform/graphics/chromium/GLES2Canvas.h',
'platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp',
- 'platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp',
'platform/graphics/chromium/GraphicsLayerChromium.cpp',
'platform/graphics/chromium/GraphicsLayerChromium.h',
'platform/graphics/chromium/HarfbuzzSkia.cpp',
@@ -2614,6 +2632,7 @@
'platform/graphics/skia/FloatRectSkia.cpp',
'platform/graphics/skia/FontCustomPlatformData.cpp',
'platform/graphics/skia/FontCustomPlatformData.h',
+ 'platform/graphics/skia/GlyphPageTreeNodeSkia.cpp',
'platform/graphics/skia/GradientSkia.cpp',
'platform/graphics/skia/GraphicsContextPlatformPrivate.h',
'platform/graphics/skia/GraphicsContextSkia.cpp',
@@ -2844,6 +2863,7 @@
'platform/image-decoders/bmp/BMPImageReader.cpp',
'platform/image-decoders/bmp/BMPImageReader.h',
'platform/image-decoders/cairo/ImageDecoderCairo.cpp',
+ 'platform/image-decoders/cg/ImageDecoderCG.cpp',
'platform/image-decoders/gif/GIFImageDecoder.cpp',
'platform/image-decoders/gif/GIFImageDecoder.h',
'platform/image-decoders/gif/GIFImageReader.cpp',
@@ -3013,6 +3033,7 @@
'platform/network/BlobData.h',
'platform/network/BlobRegistry.h',
'platform/network/BlobStorageData.h',
+ 'platform/network/CookieStorage.h',
'platform/network/Credential.cpp',
'platform/network/Credential.h',
'platform/network/DNS.h',
@@ -3284,6 +3305,7 @@
'platform/EventLoop.h',
'platform/FileChooser.cpp',
'platform/FileChooser.h',
+ 'platform/FileMetadata.h',
'platform/FileStream.cpp',
'platform/FileStream.h',
'platform/FileStreamClient.h',
@@ -3844,6 +3866,8 @@
'storage/IDBPendingTransactionMonitor.h',
'storage/IDBRequest.cpp',
'storage/IDBRequest.h',
+ 'storage/IDBSQLiteDatabase.cpp',
+ 'storage/IDBSQLiteDatabase.h',
'storage/IDBSuccessEvent.cpp',
'storage/IDBSuccessEvent.h',
'storage/IDBTimeoutEvent.cpp',
@@ -3921,6 +3945,17 @@
'svg/graphics/SVGImage.cpp',
'svg/graphics/SVGImage.h',
'svg/properties/SVGAnimatedPropertySynchronizer.h',
+ 'svg/properties/SVGAnimatedListPropertyTearOff.h',
+ 'svg/properties/SVGAnimatedProperty.h',
+ 'svg/properties/SVGAnimatedPropertyDescription.h',
+ 'svg/properties/SVGAnimatedPropertyMacros.h',
+ 'svg/properties/SVGAnimatedPropertySynchronizer.h',
+ 'svg/properties/SVGAnimatedPropertyTearOff.h',
+ 'svg/properties/SVGAnimatedStaticPropertyTearOff.h',
+ 'svg/properties/SVGListPropertyTearOff.h',
+ 'svg/properties/SVGProperty.h',
+ 'svg/properties/SVGPropertyTearOff.h',
+ 'svg/properties/SVGPropertyTraits.h',
'svg/ColorDistance.cpp',
'svg/ColorDistance.h',
'svg/DeprecatedSVGAnimatedProperty.h',
@@ -3946,10 +3981,17 @@
'svg/SVGAnimateMotionElement.h',
'svg/SVGAnimateTransformElement.cpp',
'svg/SVGAnimateTransformElement.h',
+ 'svg/SVGAnimatedAngle.h',
+ 'svg/SVGAnimatedBoolean.h',
+ 'svg/SVGAnimatedEnumeration.h',
+ 'svg/SVGAnimatedInteger.h',
+ 'svg/SVGAnimatedLength.h',
+ 'svg/SVGAnimatedLengthList.h',
'svg/SVGAnimatedPathData.cpp',
'svg/SVGAnimatedPathData.h',
'svg/SVGAnimatedPoints.cpp',
'svg/SVGAnimatedPoints.h',
+ 'svg/SVGAnimatedRect.h',
'svg/SVGAnimationElement.cpp',
'svg/SVGAnimationElement.h',
'svg/SVGCircleElement.cpp',
@@ -4496,6 +4538,7 @@
'inspector/front-end/Images/excludeButtonGlyph.png',
'inspector/front-end/Images/focusButtonGlyph.png',
'inspector/front-end/Images/forward.png',
+ 'inspector/front-end/Images/frame.png',
'inspector/front-end/Images/gearButtonGlyph.png',
'inspector/front-end/Images/glossyHeader.png',
'inspector/front-end/Images/glossyHeaderPressed.png',
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index 051f4d9..3b38a45 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -207,6 +207,7 @@ IDL_BINDINGS += \
html/DataGridColumn.idl \
html/DataGridColumnList.idl \
html/DOMFormData.idl \
+ html/DOMSettableTokenList.idl \
html/DOMTokenList.idl \
html/HTMLAllCollection.idl \
html/HTMLAudioElement.idl \
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index b73061e..132d36d 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -403,6 +403,7 @@ v8 {
bindings/v8/custom/V8InjectedScriptHostCustom.cpp \
bindings/v8/custom/V8InspectorFrontendHostCustom.cpp \
bindings/v8/custom/V8CustomEventListener.cpp \
+ bindings/v8/custom/V8DOMSettableTokenListCustom.cpp \
bindings/v8/custom/V8DOMStringMapCustom.cpp \
bindings/v8/custom/V8DOMTokenListCustom.cpp
@@ -419,6 +420,7 @@ v8 {
bindings/v8/custom/V8ElementCustom.cpp \
bindings/v8/custom/V8EventCustom.cpp \
bindings/v8/custom/V8EventSourceConstructor.cpp \
+ bindings/v8/custom/V8FileReaderCustom.cpp \
bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
contains(DEFINES, ENABLE_VIDEO=1) {
@@ -518,6 +520,7 @@ v8 {
bindings/js/JSEventSourceCustom.cpp \
bindings/js/JSEventTarget.cpp \
bindings/js/JSExceptionBase.cpp \
+ bindings/js/JSFileReaderCustom.cpp \
bindings/js/JSGeolocationCustom.cpp \
bindings/js/JSHistoryCustom.cpp \
bindings/js/JSHTMLAppletElementCustom.cpp \
@@ -814,6 +817,7 @@ SOURCES += \
editing/SplitElementCommand.cpp \
editing/SplitTextNodeCommand.cpp \
editing/SplitTextNodeContainingElementCommand.cpp \
+ editing/TextCheckingHelper.cpp \
editing/TextIterator.cpp \
editing/TypingCommand.cpp \
editing/UnlinkCommand.cpp \
@@ -827,6 +831,7 @@ SOURCES += \
fileapi/File.cpp \
fileapi/FileList.cpp \
fileapi/FileReader.cpp \
+ fileapi/FileReaderLoader.cpp \
fileapi/FileReaderSync.cpp \
fileapi/FileStreamProxy.cpp \
fileapi/FileThread.cpp \
@@ -839,14 +844,18 @@ SOURCES += \
history/qt/HistoryItemQt.cpp \
history/PageCache.cpp \
html/AsyncImageResizer.cpp \
+ html/BaseButtonInputType.cpp \
+ html/BaseCheckableInputType.cpp \
html/BaseDateAndTimeInputType.cpp \
html/BaseTextInputType.cpp \
html/ButtonInputType.cpp \
html/CheckboxInputType.cpp \
+ html/ClassList.cpp \
html/CollectionCache.cpp \
html/ColorInputType.cpp \
html/DOMDataGridDataSource.cpp \
html/DOMFormData.cpp \
+ html/DOMSettableTokenList.cpp \
html/DOMTokenList.cpp \
html/DataGridColumn.cpp \
html/DataGridColumnList.cpp \
@@ -1730,6 +1739,8 @@ HEADERS += \
fileapi/FileException.h \
fileapi/FileList.h \
fileapi/FileReader.h \
+ fileapi/FileReaderLoader.h \
+ fileapi/FileReaderLoaderClient.h \
fileapi/FileReaderSync.h \
fileapi/FileStreamProxy.h \
fileapi/FileThread.h \
@@ -1749,12 +1760,14 @@ HEADERS += \
html/canvas/CanvasRenderingContext.h \
html/canvas/CanvasRenderingContext2D.h \
html/canvas/CanvasStyle.h \
+ html/ClassList.h \
html/CollectionCache.h \
html/DataGridColumn.h \
html/DataGridColumnList.h \
html/DateComponents.h \
html/DOMDataGridDataSource.h \
html/DOMFormData.h \
+ html/DOMSettableTokenList.h \
html/DOMTokenList.h \
html/FormDataList.h \
html/FTPDirectoryDocument.h \
@@ -1999,6 +2012,7 @@ HEADERS += \
page/SpeechInput.h \
page/SpeechInputClient.h \
page/SpeechInputListener.h \
+ page/SpeechInputResult.h \
page/WindowFeatures.h \
page/WorkerNavigator.h \
page/XSSAuditor.h \
@@ -2070,7 +2084,6 @@ HEADERS += \
platform/graphics/Pattern.h \
platform/graphics/Pen.h \
platform/graphics/qt/FontCustomPlatformData.h \
- platform/graphics/qt/GraphicsLayerQt.h \
platform/graphics/qt/ImageDecoderQt.h \
platform/graphics/qt/StillImageQt.h \
platform/graphics/qt/TransparencyLayer.h \
@@ -2103,6 +2116,7 @@ HEADERS += \
platform/network/BlobRegistryImpl.h \
platform/network/BlobResourceHandle.h \
platform/network/BlobStorageData.h \
+ platform/network/CookieStorage.h \
platform/network/Credential.h \
platform/network/FormDataBuilder.h \
platform/network/FormData.h \
@@ -2343,13 +2357,30 @@ HEADERS += \
svg/graphics/filters/SVGFilterBuilder.h \
svg/graphics/filters/SVGFilter.h \
svg/graphics/SVGImage.h \
+ svg/properties/SVGAnimatedListPropertyTearOff.h \
+ svg/properties/SVGAnimatedProperty.h \
+ svg/properties/SVGAnimatedPropertyDescription.h \
+ svg/properties/SVGAnimatedPropertyMacros.h \
svg/properties/SVGAnimatedPropertySynchronizer.h \
+ svg/properties/SVGAnimatedPropertyTearOff.h \
+ svg/properties/SVGAnimatedStaticPropertyTearOff.h \
+ svg/properties/SVGListPropertyTearOff.h \
+ svg/properties/SVGProperty.h \
+ svg/properties/SVGPropertyTearOff.h \
+ svg/properties/SVGPropertyTraits.h \
svg/SVGAElement.h \
svg/SVGAltGlyphElement.h \
svg/SVGAngle.h \
svg/SVGAnimateColorElement.h \
+ svg/SVGAnimatedAngle.h \
+ svg/SVGAnimatedBoolean.h \
+ svg/SVGAnimatedEnumeration.h \
+ svg/SVGAnimatedInteger.h \
+ svg/SVGAnimatedLength.h \
+ svg/SVGAnimatedLengthList.h \
svg/SVGAnimatedPathData.h \
svg/SVGAnimatedPoints.h \
+ svg/SVGAnimatedRect.h \
svg/SVGAnimateElement.h \
svg/SVGAnimateMotionElement.h \
svg/SVGAnimateTransformElement.h \
@@ -2593,7 +2624,6 @@ SOURCES += \
platform/graphics/qt/FloatRectQt.cpp \
platform/graphics/qt/GradientQt.cpp \
platform/graphics/qt/GraphicsContextQt.cpp \
- platform/graphics/qt/GraphicsLayerQt.cpp \
platform/graphics/qt/IconQt.cpp \
platform/graphics/qt/ImageBufferQt.cpp \
platform/graphics/qt/ImageDecoderQt.cpp \
@@ -3016,7 +3046,8 @@ contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
fileapi/Metadata.h \
fileapi/MetadataCallback.h \
platform/AsyncFileSystem.h \
- platform/AsyncFileSystemCallbacks.h
+ platform/AsyncFileSystemCallbacks.h \
+ platform/FileMetadata.h
SOURCES += \
bindings/js/JSDirectoryEntryCustom.cpp \
@@ -3092,6 +3123,7 @@ contains(DEFINES, ENABLE_SHARED_WORKERS=1) {
contains(DEFINES, ENABLE_INPUT_SPEECH=1) {
SOURCES += \
page/SpeechInput.cpp \
+ page/SpeechInputResult.cpp \
rendering/RenderInputSpeech.cpp
}
@@ -3806,6 +3838,29 @@ win32:!win32-g++*:contains(QMAKE_HOST.arch, x86_64):{
}
}
+# Uncomment this to enable Texture Mapper.
+# CONFIG += texmap
+
+contains(CONFIG, texmap) {
+ DEFINES += WTF_USE_TEXTURE_MAPPER=1
+ HEADERS += \
+ platform/graphics/texmap/TextureMapper.h \
+ platform/graphics/texmap/TextureMapperPlatformLayer.h
+
+ SOURCES += \
+ platform/graphics/qt/TextureMapperQt.cpp \
+ platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
+
+ contains(QT_CONFIG, opengl) {
+ QT += opengl
+ HEADERS += platform/graphics/opengl/TextureMapperGL.h
+ SOURCES += platform/graphics/opengl/TextureMapperGL.cpp
+ }
+} else {
+ HEADERS += platform/graphics/qt/GraphicsLayerQt.h
+ SOURCES += platform/graphics/qt/GraphicsLayerQt.cpp
+}
+
symbian {
shared {
contains(CONFIG, def_files) {
diff --git a/WebCore/WebCore.vcproj/QTMovieWin.vcproj b/WebCore/WebCore.vcproj/QTMovieWin.vcproj
index adda5e0..73e287e 100644
--- a/WebCore/WebCore.vcproj/QTMovieWin.vcproj
+++ b/WebCore/WebCore.vcproj/QTMovieWin.vcproj
@@ -318,6 +318,10 @@
>
</File>
<File
+ RelativePath="..\platform\graphics\win\QTDecompressionSession.cpp"
+ >
+ </File>
+ <File
RelativePath="..\platform\graphics\win\QTMovie.cpp"
>
</File>
@@ -356,6 +360,10 @@
>
</File>
<File
+ RelativePath="..\platform\graphics\win\QTDecompressionSession.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\graphics\win\QTMovie.h"
>
</File>
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index b7996e5..8cb84a7 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -180,6 +180,7 @@
</Configuration>
<Configuration
Name="Debug_Cairo|Win32"
+ IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefinesCairo.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\WinCairo.vsprops;.\WebCoreCommon.vsprops;.\WebCoreCairo.vsprops;.\WebCoreCURL.vsprops"
CharacterSet="1"
@@ -3959,6 +3960,62 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMSettableTokenList.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMSettableTokenList.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMStringList.cpp"
>
<FileConfiguration
@@ -24263,6 +24320,10 @@
>
</File>
<File
+ RelativePath="..\platform\FileMetadata.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\FileStream.cpp"
>
</File>
@@ -25811,10 +25872,42 @@
<File
RelativePath="..\platform\graphics\win\GraphicsLayerCACF.cpp"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\GraphicsLayerCACF.h"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\IconWin.cpp"
@@ -25899,18 +25992,82 @@
<File
RelativePath="..\platform\graphics\win\MediaPlayerPrivateFullscreenWindow.cpp"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\MediaPlayerPrivateFullscreenWindow.h"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\MediaPlayerPrivateQuickTimeVisualContext.cpp"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\MediaPlayerPrivateQuickTimeVisualContext.h"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\MediaPlayerPrivateQuickTimeWin.cpp"
@@ -26047,50 +26204,242 @@
<File
RelativePath="..\platform\graphics\win\WebLayer.cpp"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\WebLayer.h"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\WebTiledLayer.cpp"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\WebTiledLayer.h"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\WKCACFContextFlusher.cpp"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\WKCACFContextFlusher.h"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\WKCACFLayer.cpp"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\WKCACFLayer.h"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\WKCACFLayerRenderer.cpp"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\WKCACFLayerRenderer.h"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\WKCAImageQueue.cpp"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\platform\graphics\win\WKCAImageQueue.h"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
</Filter>
<Filter
@@ -27526,6 +27875,10 @@
>
</File>
<File
+ RelativePath="..\platform\network\CookieStorage.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\network\Credential.cpp"
>
</File>
@@ -27745,7 +28098,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\CredentialStorageCFNet.cpp"
+ RelativePath="..\platform\network\cf\CookieJarCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27765,7 +28118,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\DNSCFNet.cpp"
+ RelativePath="..\platform\network\cf\CookieStorageCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27785,7 +28138,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\FormDataStreamCFNet.cpp"
+ RelativePath="..\platform\network\cf\CookieStorageCFNet.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\network\cf\CredentialStorageCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27805,14 +28162,14 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\FormDataStreamCFNet.h"
+ RelativePath="..\platform\network\cf\DNSCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
ExcludedFromBuild="true"
>
<Tool
- Name="VCCustomBuildTool"
+ Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
@@ -27820,20 +28177,12 @@
ExcludedFromBuild="true"
>
<Tool
- Name="VCCustomBuildTool"
+ Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\LoaderRunLoopCF.cpp"
- >
- </File>
- <File
- RelativePath="..\platform\network\cf\LoaderRunLoopCF.h"
- >
- </File>
- <File
- RelativePath="..\platform\network\cf\ProxyServerCFNet.cpp"
+ RelativePath="..\platform\network\cf\FormDataStreamCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27853,7 +28202,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceError.h"
+ RelativePath="..\platform\network\cf\FormDataStreamCFNet.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27873,27 +28222,15 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceErrorCF.cpp"
+ RelativePath="..\platform\network\cf\LoaderRunLoopCF.cpp"
>
- <FileConfiguration
- Name="Debug_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceHandleCFNet.cpp"
+ RelativePath="..\platform\network\cf\LoaderRunLoopCF.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\network\cf\ProxyServerCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27913,7 +28250,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceRequest.h"
+ RelativePath="..\platform\network\cf\ResourceError.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27933,7 +28270,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceRequestCFNet.cpp"
+ RelativePath="..\platform\network\cf\ResourceErrorCF.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27953,14 +28290,14 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceRequestCFNet.h"
+ RelativePath="..\platform\network\cf\ResourceHandleCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
ExcludedFromBuild="true"
>
<Tool
- Name="VCCustomBuildTool"
+ Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
@@ -27968,12 +28305,12 @@
ExcludedFromBuild="true"
>
<Tool
- Name="VCCustomBuildTool"
+ Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceResponse.h"
+ RelativePath="..\platform\network\cf\ResourceRequest.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27993,7 +28330,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceResponseCFNet.cpp"
+ RelativePath="..\platform\network\cf\ResourceRequestCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -28013,14 +28350,14 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\SocketStreamError.h"
+ RelativePath="..\platform\network\cf\ResourceRequestCFNet.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
ExcludedFromBuild="true"
>
<Tool
- Name="VCCLCompilerTool"
+ Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
@@ -28028,19 +28365,19 @@
ExcludedFromBuild="true"
>
<Tool
- Name="VCCLCompilerTool"
+ Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\SocketStreamHandle.h"
+ RelativePath="..\platform\network\cf\ResourceResponse.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
ExcludedFromBuild="true"
>
<Tool
- Name="VCCLCompilerTool"
+ Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
@@ -28048,12 +28385,12 @@
ExcludedFromBuild="true"
>
<Tool
- Name="VCCLCompilerTool"
+ Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\SocketStreamHandleCFNet.cpp"
+ RelativePath="..\platform\network\cf\ResourceResponseCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -28072,12 +28409,8 @@
/>
</FileConfiguration>
</File>
- </Filter>
- <Filter
- Name="win"
- >
<File
- RelativePath="..\platform\network\win\CookieJarCFNetWin.cpp"
+ RelativePath="..\platform\network\cf\SocketStreamError.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -28097,7 +28430,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\win\CookieStorageWin.cpp"
+ RelativePath="..\platform\network\cf\SocketStreamHandle.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -28117,7 +28450,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\win\CookieStorageWin.h"
+ RelativePath="..\platform\network\cf\SocketStreamHandleCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -28136,6 +28469,10 @@
/>
</FileConfiguration>
</File>
+ </Filter>
+ <Filter
+ Name="win"
+ >
<File
RelativePath="..\platform\network\win\NetworkStateNotifierWin.cpp"
>
@@ -42171,6 +42508,10 @@
>
</File>
<File
+ RelativePath="..\dom\IgnoreDestructiveWriteCountIncrementer.h"
+ >
+ </File>
+ <File
RelativePath="..\dom\InputElement.cpp"
>
<FileConfiguration
@@ -47619,6 +47960,62 @@
>
</File>
<File
+ RelativePath="..\editing\TextCheckingHelper.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\editing\TextCheckingHelper.h"
+ >
+ </File>
+ <File
RelativePath="..\editing\TextGranularity.h"
>
</File>
@@ -48035,6 +48432,22 @@
>
</File>
<File
+ RelativePath="..\html\BaseButtonInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\BaseButtonInputType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\BaseCheckableInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\BaseCheckableInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\html\BaseDateAndTimeInputType.cpp"
>
</File>
@@ -48139,6 +48552,14 @@
>
</File>
<File
+ RelativePath="..\html\ClassList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\ClassList.h"
+ >
+ </File>
+ <File
RelativePath="..\html\CollectionCache.cpp"
>
<FileConfiguration
@@ -48303,6 +48724,14 @@
>
</File>
<File
+ RelativePath="..\html\DOMSettableTokenList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\DOMSettableTokenList.h"
+ >
+ </File>
+ <File
RelativePath="..\html\DOMTokenList.cpp"
>
</File>
@@ -48427,6 +48856,18 @@
>
</File>
<File
+ RelativePath="..\fileapi\FileReaderLoader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\FileReaderLoader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\FileReaderLoaderClient.h"
+ >
+ </File>
+ <File
RelativePath="..\fileapi\FileReaderSync.cpp"
>
</File>
@@ -55970,6 +56411,10 @@
>
</File>
<File
+ RelativePath="..\bindings\js\JSFileReaderCustom.cpp"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\JSGeolocationCustom.cpp"
>
<FileConfiguration
@@ -61199,6 +61644,30 @@
>
</File>
<File
+ RelativePath="..\svg\SVGAnimatedAngle.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\SVGAnimatedBoolean.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\SVGAnimatedEnumeration.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\SVGAnimatedInteger.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\SVGAnimatedLength.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\SVGAnimatedLengthList.h"
+ >
+ </File>
+ <File
RelativePath="..\svg\SVGAnimatedPathData.h"
>
</File>
@@ -61207,6 +61676,10 @@
>
</File>
<File
+ RelativePath="..\svg\SVGAnimatedRect.h"
+ >
+ </File>
+ <File
RelativePath="..\svg\SVGAnimateElement.h"
>
</File>
@@ -62226,7 +62699,47 @@
Name="properties"
>
<File
- RelativePath="..\svg\properties\SVGAnimatedPropertySynchronizer.h"
+ RelativePath="..\svg\properties\SVGAnimatedListPropertyTearOff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGAnimatedProperty.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGAnimatedPropertyDescription.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGAnimatedPropertyMacros.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGAnimatedPropertySynchronizer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGAnimatedPropertyTearOff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGAnimatedStaticPropertyTearOff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGListPropertyTearOff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGProperty.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGPropertyTearOff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGPropertyTraits.h"
>
</File>
</Filter>
diff --git a/WebCore/WebCore.vcproj/WebCoreCairo.vsprops b/WebCore/WebCore.vcproj/WebCoreCairo.vsprops
index 3531128..8c2e770 100644
--- a/WebCore/WebCore.vcproj/WebCoreCairo.vsprops
+++ b/WebCore/WebCore.vcproj/WebCoreCairo.vsprops
@@ -6,6 +6,6 @@
>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\svg\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(WebKitLibrariesDir)\include\cairo&quot;"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\svg\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\cairo&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\webp&quot;;&quot;$(WebKitLibrariesDir)\include\cairo&quot;"
/>
</VisualStudioPropertySheet>
diff --git a/WebCore/WebCore.vcproj/WebCoreGenerated.vcproj b/WebCore/WebCore.vcproj/WebCoreGenerated.vcproj
index 4f7dcd9..9b891cd 100644
--- a/WebCore/WebCore.vcproj/WebCoreGenerated.vcproj
+++ b/WebCore/WebCore.vcproj/WebCoreGenerated.vcproj
@@ -62,6 +62,18 @@
RelativePath=".\build-generated-files.sh"
>
</File>
+ <File
+ RelativePath=".\copyForwardingHeaders.cmd"
+ >
+ </File>
+ <File
+ RelativePath=".\copyInspectorFiles.cmd"
+ >
+ </File>
+ <File
+ RelativePath=".\migrate-scripts.sh"
+ >
+ </File>
</Files>
<Globals>
</Globals>
diff --git a/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd b/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd
index a85ace3..3885487 100755
--- a/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd
+++ b/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd
@@ -44,7 +44,6 @@ xcopy /y /d "%ProjectDir%..\platform\text\transcoder\*.h" "%WebKitOutputDir%\inc
xcopy /y /d "%ProjectDir%..\platform\win\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\network\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\network\%2\*.h" "%WebKitOutputDir%\include\WebCore"
-xcopy /y /d "%ProjectDir%..\platform\network\win\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\sql\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\cairo\cairo\src\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\bindings\*.h" "%WebKitOutputDir%\include\WebCore"
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index bc612df..6bc2e36 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -91,6 +91,7 @@
08203AA00ED8C35300B8B61A /* WMLAccessElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08203A9E0ED8C35300B8B61A /* WMLAccessElement.h */; };
082341C50FCF3A9500D75BD6 /* WMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 082341C30FCF3A9400D75BD6 /* WMLSelectElement.cpp */; };
082341C60FCF3A9500D75BD6 /* WMLSelectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 082341C40FCF3A9400D75BD6 /* WMLSelectElement.h */; };
+ 0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */; settings = {ATTRIBUTES = (Private, ); }; };
082FCAC4110927CE00CC4821 /* JSSVGContextCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 082FCAC3110927CE00CC4821 /* JSSVGContextCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
083192AA112B43050083C3B9 /* RenderSVGResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 083192A7112B43050083C3B9 /* RenderSVGResource.h */; };
083192AB112B43050083C3B9 /* RenderSVGResourceMasker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 083192A8112B43050083C3B9 /* RenderSVGResourceMasker.cpp */; };
@@ -114,6 +115,7 @@
084D0E3F11F5816100081E1A /* SVGResourcesCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D0E3B11F5816100081E1A /* SVGResourcesCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
084DBAA10ED39D360038C226 /* WMLVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084DBA9D0ED39D350038C226 /* WMLVariables.cpp */; };
084DBAA20ED39D360038C226 /* WMLVariables.h in Headers */ = {isa = PBXBuildFile; fileRef = 084DBA9E0ED39D360038C226 /* WMLVariables.h */; };
+ 08525E631278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; };
0854B0141255E4E600B9CDD0 /* RenderSVGInline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0854B0021255E4E600B9CDD0 /* RenderSVGInline.cpp */; };
0854B0151255E4E600B9CDD0 /* RenderSVGInline.h in Headers */ = {isa = PBXBuildFile; fileRef = 0854B0031255E4E600B9CDD0 /* RenderSVGInline.h */; };
0854B0161255E4E600B9CDD0 /* RenderSVGInlineText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0854B0041255E4E600B9CDD0 /* RenderSVGInlineText.cpp */; };
@@ -135,6 +137,7 @@
08563BB4117861780012B578 /* RenderSVGResourcePattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08563BB2117861770012B578 /* RenderSVGResourcePattern.cpp */; };
08563BB5117861780012B578 /* RenderSVGResourcePattern.h in Headers */ = {isa = PBXBuildFile; fileRef = 08563BB3117861770012B578 /* RenderSVGResourcePattern.h */; };
08563BD0117865F50012B578 /* RenderSVGResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08563BCF117865F50012B578 /* RenderSVGResource.cpp */; };
+ 085797091278394C00A8EC5F /* SVGAnimatedBoolean.h in Headers */ = {isa = PBXBuildFile; fileRef = 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */; settings = {ATTRIBUTES = (Private, ); }; };
08591AA50F085C4E009BACB1 /* InputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08591AA40F085C4E009BACB1 /* InputElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
085AFDC80F2977350061F2B3 /* WMLFormControlElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085AFDC60F2977350061F2B3 /* WMLFormControlElement.cpp */; };
085AFDC90F2977350061F2B3 /* WMLFormControlElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 085AFDC70F2977350061F2B3 /* WMLFormControlElement.h */; settings = {ATTRIBUTES = (); }; };
@@ -156,6 +159,7 @@
08735FB910E91232006D6FAD /* SVGMarkerLayoutInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 08735FB710E91232006D6FAD /* SVGMarkerLayoutInfo.h */; };
08744BAA0EDB7D86004C9E63 /* WMLOnEventElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08744BA90EDB7D86004C9E63 /* WMLOnEventElement.cpp */; };
08744BAE0EDB7D92004C9E63 /* WMLOnEventElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08744BAD0EDB7D92004C9E63 /* WMLOnEventElement.h */; };
+ 087B84961272CEC800A14417 /* SVGAnimatedAngle.h in Headers */ = {isa = PBXBuildFile; fileRef = 087B84951272CEC700A14417 /* SVGAnimatedAngle.h */; settings = {ATTRIBUTES = (Private, ); }; };
087D97BF10FB8D7700C00874 /* JSSVGPODListCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 087D97BE10FB8D7700C00874 /* JSSVGPODListCustom.h */; };
087FFA0F0EFF3ED3009DBD88 /* WMLInsertedLegendElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 087FFA0D0EFF3ED3009DBD88 /* WMLInsertedLegendElement.cpp */; };
087FFA100EFF3ED3009DBD88 /* WMLInsertedLegendElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 087FFA0E0EFF3ED3009DBD88 /* WMLInsertedLegendElement.h */; };
@@ -173,6 +177,15 @@
088451160F267B63007F139E /* WMLInputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 088451140F267B63007F139E /* WMLInputElement.h */; };
0885067F11DA045B00182B98 /* PaintInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067D11DA045B00182B98 /* PaintInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
0885068011DA045B00182B98 /* PaintPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067E11DA045B00182B98 /* PaintPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E04126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E05126EF1DB00978F7A /* SVGAnimatedProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFC126EF1DB00978F7A /* SVGAnimatedProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E07126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFE126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E09126EF1DB00978F7A /* SVGListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E0A126EF1DB00978F7A /* SVGProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E01126EF1DB00978F7A /* SVGProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E0B126EF1DB00978F7A /* SVGPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E0C126EF1DB00978F7A /* SVGPropertyTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
088C2F7912390081003D65CE /* SVGTextLayoutAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 088C2F7512390080003D65CE /* SVGTextLayoutAttributes.cpp */; };
088C2F7A12390081003D65CE /* SVGTextLayoutAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */; };
088C97120ECB6D92000534BA /* WMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA3AB490E556F2400E9C0C0 /* WMLNames.cpp */; };
@@ -189,6 +202,8 @@
088C976D0ECB6E29000534BA /* WMLPageState.h in Headers */ = {isa = PBXBuildFile; fileRef = 0893E4660ECB68F400A28563 /* WMLPageState.h */; };
088C976E0ECB6E29000534BA /* WMLPElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6B99350E52E37300487BB7 /* WMLPElement.cpp */; };
088C976F0ECB6E29000534BA /* WMLPElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C6B99360E52E37300487BB7 /* WMLPElement.h */; };
+ 089021A9126EF5DE0092D5EA /* SVGAnimatedLength.h in Headers */ = {isa = PBXBuildFile; fileRef = 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */ = {isa = PBXBuildFile; fileRef = 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */; settings = {ATTRIBUTES = (Private, ); }; };
089582550E857A7E00F82C83 /* ImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 089582530E857A7E00F82C83 /* ImageLoader.cpp */; };
089582560E857A7E00F82C83 /* ImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 089582540E857A7E00F82C83 /* ImageLoader.h */; };
0897C14C0ED2EBA500AE06DB /* WMLBRElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0897C14A0ED2EBA400AE06DB /* WMLBRElement.cpp */; };
@@ -213,10 +228,12 @@
08C6A7AB117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08C6A7A9117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.cpp */; };
08C6A7AC117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C6A7AA117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.h */; };
08C7A2C710DC7462002D368B /* SVGNames.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 656581E909D1508D000E61D7 /* SVGNames.h */; };
+ 08C859C01274575400A5728D /* SVGAnimatedRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C859BF1274575300A5728D /* SVGAnimatedRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
08C925190FCC7C4A00480DEC /* FilterEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08C925170FCC7C4A00480DEC /* FilterEffect.cpp */; };
08C9251A0FCC7C4A00480DEC /* FilterEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C925180FCC7C4A00480DEC /* FilterEffect.h */; };
08CD61BC0ED3929C002DDF51 /* WMLTaskElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08CD61B80ED3929C002DDF51 /* WMLTaskElement.cpp */; };
08CD61BD0ED3929C002DDF51 /* WMLTaskElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08CD61B90ED3929C002DDF51 /* WMLTaskElement.h */; };
+ 08D46CE3127AD5FC0089694B /* SVGAnimatedEnumeration.h in Headers */ = {isa = PBXBuildFile; fileRef = 08D46CE2127AD5FC0089694B /* SVGAnimatedEnumeration.h */; settings = {ATTRIBUTES = (Private, ); }; };
08DAB9BA1103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08DAB9B81103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.cpp */; };
08DAB9BB1103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 08DAB9B91103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.h */; };
08DAB9C21103D9C1003E7ABA /* SVGShadowTreeElements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08DAB9C01103D9C1003E7ABA /* SVGShadowTreeElements.cpp */; };
@@ -732,6 +749,10 @@
2E4346550F546A8200B0F1BA /* WorkerThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346430F546A8200B0F1BA /* WorkerThread.h */; settings = {ATTRIBUTES = (Private, ); }; };
2E4346580F546A9900B0F1BA /* CrossThreadCopier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E4346560F546A9900B0F1BA /* CrossThreadCopier.cpp */; };
2E4346590F546A9900B0F1BA /* CrossThreadCopier.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346570F546A9900B0F1BA /* CrossThreadCopier.h */; };
+ 2E7582EE12764F260062628B /* JSFileReaderCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E7582ED12764F260062628B /* JSFileReaderCustom.cpp */; };
+ 2E75841D12779ADA0062628B /* FileReaderLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E75841A12779ADA0062628B /* FileReaderLoader.cpp */; };
+ 2E75841E12779ADA0062628B /* FileReaderLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E75841B12779ADA0062628B /* FileReaderLoader.h */; };
+ 2E75841F12779ADA0062628B /* FileReaderLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E75841C12779ADA0062628B /* FileReaderLoaderClient.h */; };
2E94F43B119207DA00B7F75D /* JSFileReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E94F439119207DA00B7F75D /* JSFileReader.cpp */; };
2E94F43C119207DA00B7F75D /* JSFileReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E94F43A119207DA00B7F75D /* JSFileReader.h */; };
2EA768040FE7126400AB9C8A /* WorkerScriptLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EA768030FE7126400AB9C8A /* WorkerScriptLoaderClient.h */; };
@@ -845,6 +866,10 @@
379919961200DDF400EA041C /* WOFFFileFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379919941200DDF400EA041C /* WOFFFileFormat.cpp */; };
379919971200DDF400EA041C /* WOFFFileFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 379919951200DDF400EA041C /* WOFFFileFormat.h */; };
379919B21200DE5000EA041C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 379919B11200DE5000EA041C /* libz.dylib */; };
+ 379E61C9126CA5C300B63E8D /* BaseButtonInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379E61C5126CA5C300B63E8D /* BaseButtonInputType.cpp */; };
+ 379E61CA126CA5C400B63E8D /* BaseButtonInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = 379E61C6126CA5C300B63E8D /* BaseButtonInputType.h */; };
+ 379E61CB126CA5C400B63E8D /* BaseCheckableInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379E61C7126CA5C300B63E8D /* BaseCheckableInputType.cpp */; };
+ 379E61CC126CA5C400B63E8D /* BaseCheckableInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = 379E61C8126CA5C300B63E8D /* BaseCheckableInputType.h */; };
37ACCE420DA2980F0089E602 /* FontRenderingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 37ACCE410DA2980F0089E602 /* FontRenderingMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
37ACCF690DA414E70089E602 /* FontDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37ACCE620DA2AA960089E602 /* FontDescription.cpp */; };
37C2360B1097EDED00EF9F72 /* FontComplexTextMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37C2360A1097EDED00EF9F72 /* FontComplexTextMac.cpp */; };
@@ -931,6 +956,7 @@
4614A1FE0B23A8D600446E1C /* copyCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 4614A1FD0B23A8D600446E1C /* copyCursor.png */; };
464EA2730B8A350B00A8E6E3 /* crossHairCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 464EA2710B8A350B00A8E6E3 /* crossHairCursor.png */; };
464EA2740B8A350B00A8E6E3 /* notAllowedCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 464EA2720B8A350B00A8E6E3 /* notAllowedCursor.png */; };
+ 4689F1AF1267BAE100E8D380 /* FileMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 4689F1AE1267BAE100E8D380 /* FileMetadata.h */; };
46BD16E30B279473001F0839 /* noneCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46BD16E20B279473001F0839 /* noneCursor.png */; };
46D4F2490AF97E810035385A /* cellCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46D4F2460AF97E810035385A /* cellCursor.png */; };
46D4F24A0AF97E810035385A /* contextMenuCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46D4F2470AF97E810035385A /* contextMenuCursor.png */; };
@@ -1104,6 +1130,12 @@
49FFBF3F11C93EE3006A7118 /* WebGLLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 49FFBF3D11C93EE3006A7118 /* WebGLLayer.h */; };
49FFBF4011C93EE3006A7118 /* WebGLLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49FFBF3E11C93EE3006A7118 /* WebGLLayer.mm */; };
4A8C96EB0BE69032004EEFF0 /* SelectionControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4A8C96EA0BE69032004EEFF0 /* SelectionControllerMac.mm */; };
+ 4ACBC0BE12713CBD0094F9B2 /* ClassList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACBC0BC12713CBD0094F9B2 /* ClassList.cpp */; };
+ 4ACBC0BF12713CBD0094F9B2 /* ClassList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0BD12713CBD0094F9B2 /* ClassList.h */; };
+ 4ACBC0C312713CCA0094F9B2 /* DOMSettableTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACBC0C012713CCA0094F9B2 /* DOMSettableTokenList.cpp */; };
+ 4ACBC0C412713CCA0094F9B2 /* DOMSettableTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0C112713CCA0094F9B2 /* DOMSettableTokenList.h */; };
+ 4ACBC0CA12713D0A0094F9B2 /* JSDOMSettableTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACBC0C812713D0A0094F9B2 /* JSDOMSettableTokenList.cpp */; };
+ 4ACBC0CB12713D0A0094F9B2 /* JSDOMSettableTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0C912713D0A0094F9B2 /* JSDOMSettableTokenList.h */; };
4B2708C70AF19EE40065127F /* Pasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2708C50AF19EE40065127F /* Pasteboard.h */; };
4B2709830AF2E5E00065127F /* PasteboardMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B2709810AF2E5E00065127F /* PasteboardMac.mm */; };
4B3043C70AE0370300A82647 /* Sound.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3043C60AE0370300A82647 /* Sound.h */; };
@@ -1466,6 +1498,7 @@
75793ED30D0CE85B007FC0AC /* DOMMessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */; };
75793ED40D0CE85B007FC0AC /* DOMMessageEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */; };
75793ED50D0CE85B007FC0AC /* DOMMessageEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */; };
+ 758978EC127090D60076D5A9 /* SpeechInputResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 758978EA127090D60076D5A9 /* SpeechInputResult.cpp */; };
7637C541112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7637C540112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp */; };
7637C543112E7B7E003D6CDC /* WebSocketHandshakeRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7637C542112E7B7E003D6CDC /* WebSocketHandshakeRequest.h */; };
767F99BE11A1194A0080C51D /* WebSocketHandshakeResponse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 767F99BD11A1194A0080C51D /* WebSocketHandshakeResponse.cpp */; };
@@ -2586,6 +2619,7 @@
8A9A587511E84C81008ACFD1 /* JSPerformance.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A9A587311E84C81008ACFD1 /* JSPerformance.h */; };
8A9A588711E84F37008ACFD1 /* JSTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A9A587611E84C98008ACFD1 /* JSTiming.cpp */; };
8A9A588811E84F37008ACFD1 /* JSTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A9A587711E84C98008ACFD1 /* JSTiming.h */; };
+ 8AB4BC77126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB4BC76126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h */; };
8AF4E55511DC5A36000ED3DE /* Navigation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AF4E55211DC5A36000ED3DE /* Navigation.cpp */; };
8AF4E55611DC5A36000ED3DE /* Navigation.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AF4E55311DC5A36000ED3DE /* Navigation.h */; };
8AF4E55B11DC5A63000ED3DE /* Timing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AF4E55811DC5A63000ED3DE /* Timing.cpp */; };
@@ -3033,6 +3067,8 @@
A7D3C5240B576B4B002CA450 /* PasteboardHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D3C5230B576B4B002CA450 /* PasteboardHelper.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7D6B3490F61104500B79FD1 /* WorkerScriptLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D6B3470F61104500B79FD1 /* WorkerScriptLoader.h */; };
A7D6B34A0F61104500B79FD1 /* WorkerScriptLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D6B3480F61104500B79FD1 /* WorkerScriptLoader.cpp */; };
+ A7DBF8DD1276919C006B6008 /* TextCheckingHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7DBF8DB1276919C006B6008 /* TextCheckingHelper.cpp */; };
+ A7DBF8DE1276919C006B6008 /* TextCheckingHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A7DBF8DC1276919C006B6008 /* TextCheckingHelper.h */; };
A7F338A311C0EFCA00A320A7 /* ShadowElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7F338A111C0EFCA00A320A7 /* ShadowElement.cpp */; };
A7F338A411C0EFCA00A320A7 /* ShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A7F338A211C0EFCA00A320A7 /* ShadowElement.h */; };
A809F1470B73793A002E4D7F /* RenderSVGGradientStop.h in Headers */ = {isa = PBXBuildFile; fileRef = A809F1450B73793A002E4D7F /* RenderSVGGradientStop.h */; };
@@ -4036,7 +4072,7 @@
B2227A3E0D00BF220071B782 /* SVGList.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278A80D00BF200071B782 /* SVGList.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2227A3F0D00BF220071B782 /* SVGListTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278A90D00BF200071B782 /* SVGListTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2227A400D00BF220071B782 /* SVGLocatable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B22278AA0D00BF200071B782 /* SVGLocatable.cpp */; };
- B2227A410D00BF220071B782 /* SVGLocatable.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278AB0D00BF200071B782 /* SVGLocatable.h */; };
+ B2227A410D00BF220071B782 /* SVGLocatable.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278AB0D00BF200071B782 /* SVGLocatable.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2227A430D00BF220071B782 /* SVGMarkerElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B22278AD0D00BF200071B782 /* SVGMarkerElement.cpp */; };
B2227A440D00BF220071B782 /* SVGMarkerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278AE0D00BF200071B782 /* SVGMarkerElement.h */; };
B2227A460D00BF220071B782 /* SVGMaskElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B22278B00D00BF200071B782 /* SVGMaskElement.cpp */; };
@@ -5321,6 +5357,8 @@
E1284BD61044A01E00EAEB52 /* DOMPageTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E1284BD41044A01E00EAEB52 /* DOMPageTransitionEvent.h */; };
E12EDB7B0B308A78002704B6 /* EventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = E12EDB7A0B308A78002704B6 /* EventTarget.h */; settings = {ATTRIBUTES = (Private, ); }; };
E12EDBEA0B308E0B002704B6 /* EventTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E12EDBE90B308E0B002704B6 /* EventTarget.cpp */; };
+ E13F01EB1270E10D00DFBA71 /* CookieStorage.h in Resources */ = {isa = PBXBuildFile; fileRef = E13F01EA1270E10D00DFBA71 /* CookieStorage.h */; };
+ E13F01F11270E19000DFBA71 /* CookieStorageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E13F01F01270E19000DFBA71 /* CookieStorageMac.mm */; };
E15A36D71104572000B7B639 /* XMLNSNames.h in Headers */ = {isa = PBXBuildFile; fileRef = E15A36D61104572000B7B639 /* XMLNSNames.h */; };
E15A36D91104572700B7B639 /* XMLNSNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E15A36D81104572700B7B639 /* XMLNSNames.cpp */; };
E169803D1133542D00894115 /* CRuntimeObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E169803C1133542D00894115 /* CRuntimeObject.h */; };
@@ -5515,6 +5553,7 @@
F5C041E70FFCA96D00839D4A /* JSHTMLDataListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C041E20FFCA96D00839D4A /* JSHTMLDataListElement.h */; };
F5D3A57C106B83B300545297 /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D3A57A106B83B300545297 /* DateComponents.cpp */; };
F5D3A57D106B83B300545297 /* DateComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = F5D3A57B106B83B300545297 /* DateComponents.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ F7A034C4126BF6BE007DC19E /* FontOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = F7A034C3126BF6BE007DC19E /* FontOrientation.h */; settings = {ATTRIBUTES = (Private, ); }; };
F916C48D0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */; };
F916C48E0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */; };
F98FFF4411A2676200F548E8 /* CSSOMUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F98FFF4211A2676200F548E8 /* CSSOMUtils.cpp */; };
@@ -6077,6 +6116,7 @@
08203A9E0ED8C35300B8B61A /* WMLAccessElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLAccessElement.h; sourceTree = "<group>"; };
082341C30FCF3A9400D75BD6 /* WMLSelectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLSelectElement.cpp; sourceTree = "<group>"; };
082341C40FCF3A9400D75BD6 /* WMLSelectElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLSelectElement.h; sourceTree = "<group>"; };
+ 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedInteger.h; sourceTree = "<group>"; };
082FCAC3110927CE00CC4821 /* JSSVGContextCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGContextCache.h; sourceTree = "<group>"; };
083192A7112B43050083C3B9 /* RenderSVGResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResource.h; sourceTree = "<group>"; };
083192A8112B43050083C3B9 /* RenderSVGResourceMasker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceMasker.cpp; sourceTree = "<group>"; };
@@ -6098,6 +6138,7 @@
084D0E3B11F5816100081E1A /* SVGResourcesCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCache.h; sourceTree = "<group>"; };
084DBA9D0ED39D350038C226 /* WMLVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLVariables.cpp; sourceTree = "<group>"; };
084DBA9E0ED39D360038C226 /* WMLVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLVariables.h; sourceTree = "<group>"; };
+ 08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedStaticPropertyTearOff.h; sourceTree = "<group>"; };
0854B0021255E4E600B9CDD0 /* RenderSVGInline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGInline.cpp; sourceTree = "<group>"; };
0854B0031255E4E600B9CDD0 /* RenderSVGInline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGInline.h; sourceTree = "<group>"; };
0854B0041255E4E600B9CDD0 /* RenderSVGInlineText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGInlineText.cpp; sourceTree = "<group>"; };
@@ -6119,6 +6160,7 @@
08563BB2117861770012B578 /* RenderSVGResourcePattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourcePattern.cpp; sourceTree = "<group>"; };
08563BB3117861770012B578 /* RenderSVGResourcePattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourcePattern.h; sourceTree = "<group>"; };
08563BCF117865F50012B578 /* RenderSVGResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResource.cpp; sourceTree = "<group>"; };
+ 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedBoolean.h; sourceTree = "<group>"; };
08591AA40F085C4E009BACB1 /* InputElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputElement.h; sourceTree = "<group>"; };
085AFDC60F2977350061F2B3 /* WMLFormControlElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLFormControlElement.cpp; sourceTree = "<group>"; };
085AFDC70F2977350061F2B3 /* WMLFormControlElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLFormControlElement.h; sourceTree = "<group>"; };
@@ -6140,6 +6182,7 @@
08735FB710E91232006D6FAD /* SVGMarkerLayoutInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMarkerLayoutInfo.h; sourceTree = "<group>"; };
08744BA90EDB7D86004C9E63 /* WMLOnEventElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLOnEventElement.cpp; sourceTree = "<group>"; };
08744BAD0EDB7D92004C9E63 /* WMLOnEventElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLOnEventElement.h; sourceTree = "<group>"; };
+ 087B84951272CEC700A14417 /* SVGAnimatedAngle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedAngle.h; sourceTree = "<group>"; };
087D97BE10FB8D7700C00874 /* JSSVGPODListCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGPODListCustom.h; sourceTree = "<group>"; };
087FFA0D0EFF3ED3009DBD88 /* WMLInsertedLegendElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLInsertedLegendElement.cpp; sourceTree = "<group>"; };
087FFA0E0EFF3ED3009DBD88 /* WMLInsertedLegendElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLInsertedLegendElement.h; sourceTree = "<group>"; };
@@ -6157,8 +6200,19 @@
088451140F267B63007F139E /* WMLInputElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLInputElement.h; sourceTree = "<group>"; };
0885067D11DA045B00182B98 /* PaintInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintInfo.h; sourceTree = "<group>"; };
0885067E11DA045B00182B98 /* PaintPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintPhase.h; sourceTree = "<group>"; };
+ 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedListPropertyTearOff.h; sourceTree = "<group>"; };
+ 088A0DFC126EF1DB00978F7A /* SVGAnimatedProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedProperty.h; sourceTree = "<group>"; };
+ 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyDescription.h; sourceTree = "<group>"; };
+ 088A0DFE126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyMacros.h; sourceTree = "<group>"; };
+ 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyTearOff.h; sourceTree = "<group>"; };
+ 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGListPropertyTearOff.h; sourceTree = "<group>"; };
+ 088A0E01126EF1DB00978F7A /* SVGProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGProperty.h; sourceTree = "<group>"; };
+ 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyTearOff.h; sourceTree = "<group>"; };
+ 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyTraits.h; sourceTree = "<group>"; };
088C2F7512390080003D65CE /* SVGTextLayoutAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextLayoutAttributes.cpp; sourceTree = "<group>"; };
088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutAttributes.h; sourceTree = "<group>"; };
+ 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedLength.h; sourceTree = "<group>"; };
+ 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedLengthList.h; sourceTree = "<group>"; };
0893E4650ECB68F400A28563 /* WMLPageState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLPageState.cpp; sourceTree = "<group>"; };
0893E4660ECB68F400A28563 /* WMLPageState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLPageState.h; sourceTree = "<group>"; };
089582530E857A7E00F82C83 /* ImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageLoader.cpp; sourceTree = "<group>"; };
@@ -6184,10 +6238,12 @@
08C4C5170EF19A4000E4840F /* WMLImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLImageLoader.h; sourceTree = "<group>"; };
08C6A7A9117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceSolidColor.cpp; sourceTree = "<group>"; };
08C6A7AA117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourceSolidColor.h; sourceTree = "<group>"; };
+ 08C859BF1274575300A5728D /* SVGAnimatedRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedRect.h; sourceTree = "<group>"; };
08C925170FCC7C4A00480DEC /* FilterEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FilterEffect.cpp; path = filters/FilterEffect.cpp; sourceTree = "<group>"; };
08C925180FCC7C4A00480DEC /* FilterEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FilterEffect.h; path = filters/FilterEffect.h; sourceTree = "<group>"; };
08CD61B80ED3929C002DDF51 /* WMLTaskElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLTaskElement.cpp; sourceTree = "<group>"; };
08CD61B90ED3929C002DDF51 /* WMLTaskElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLTaskElement.h; sourceTree = "<group>"; };
+ 08D46CE2127AD5FC0089694B /* SVGAnimatedEnumeration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedEnumeration.h; sourceTree = "<group>"; };
08DAB9B81103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGShadowTreeRootContainer.cpp; sourceTree = "<group>"; };
08DAB9B91103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGShadowTreeRootContainer.h; sourceTree = "<group>"; };
08DAB9C01103D9C1003E7ABA /* SVGShadowTreeElements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGShadowTreeElements.cpp; sourceTree = "<group>"; };
@@ -6747,6 +6803,10 @@
2E4346430F546A8200B0F1BA /* WorkerThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerThread.h; path = workers/WorkerThread.h; sourceTree = "<group>"; };
2E4346560F546A9900B0F1BA /* CrossThreadCopier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrossThreadCopier.cpp; sourceTree = "<group>"; };
2E4346570F546A9900B0F1BA /* CrossThreadCopier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossThreadCopier.h; sourceTree = "<group>"; };
+ 2E7582ED12764F260062628B /* JSFileReaderCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileReaderCustom.cpp; sourceTree = "<group>"; };
+ 2E75841A12779ADA0062628B /* FileReaderLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileReaderLoader.cpp; path = fileapi/FileReaderLoader.cpp; sourceTree = "<group>"; };
+ 2E75841B12779ADA0062628B /* FileReaderLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileReaderLoader.h; path = fileapi/FileReaderLoader.h; sourceTree = "<group>"; };
+ 2E75841C12779ADA0062628B /* FileReaderLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileReaderLoaderClient.h; path = fileapi/FileReaderLoaderClient.h; sourceTree = "<group>"; };
2E94F439119207DA00B7F75D /* JSFileReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileReader.cpp; sourceTree = "<group>"; };
2E94F43A119207DA00B7F75D /* JSFileReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileReader.h; sourceTree = "<group>"; };
2EA768030FE7126400AB9C8A /* WorkerScriptLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerScriptLoaderClient.h; path = workers/WorkerScriptLoaderClient.h; sourceTree = "<group>"; };
@@ -6870,6 +6930,10 @@
379919941200DDF400EA041C /* WOFFFileFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WOFFFileFormat.cpp; sourceTree = "<group>"; };
379919951200DDF400EA041C /* WOFFFileFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WOFFFileFormat.h; sourceTree = "<group>"; };
379919B11200DE5000EA041C /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
+ 379E61C5126CA5C300B63E8D /* BaseButtonInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseButtonInputType.cpp; sourceTree = "<group>"; };
+ 379E61C6126CA5C300B63E8D /* BaseButtonInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseButtonInputType.h; sourceTree = "<group>"; };
+ 379E61C7126CA5C300B63E8D /* BaseCheckableInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseCheckableInputType.cpp; sourceTree = "<group>"; };
+ 379E61C8126CA5C300B63E8D /* BaseCheckableInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseCheckableInputType.h; sourceTree = "<group>"; };
37ACCE410DA2980F0089E602 /* FontRenderingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontRenderingMode.h; sourceTree = "<group>"; };
37ACCE620DA2AA960089E602 /* FontDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontDescription.cpp; sourceTree = "<group>"; };
37C2360A1097EDED00EF9F72 /* FontComplexTextMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontComplexTextMac.cpp; sourceTree = "<group>"; };
@@ -6963,6 +7027,7 @@
4614A1FD0B23A8D600446E1C /* copyCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = copyCursor.png; sourceTree = "<group>"; };
464EA2710B8A350B00A8E6E3 /* crossHairCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = crossHairCursor.png; sourceTree = "<group>"; };
464EA2720B8A350B00A8E6E3 /* notAllowedCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = notAllowedCursor.png; sourceTree = "<group>"; };
+ 4689F1AE1267BAE100E8D380 /* FileMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileMetadata.h; path = platform/FileMetadata.h; sourceTree = "<group>"; };
46BD16E20B279473001F0839 /* noneCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = noneCursor.png; sourceTree = "<group>"; };
46D4F2460AF97E810035385A /* cellCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cellCursor.png; sourceTree = "<group>"; };
46D4F2470AF97E810035385A /* contextMenuCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = contextMenuCursor.png; sourceTree = "<group>"; };
@@ -7159,6 +7224,13 @@
49FFBF3D11C93EE3006A7118 /* WebGLLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLLayer.h; sourceTree = "<group>"; };
49FFBF3E11C93EE3006A7118 /* WebGLLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebGLLayer.mm; sourceTree = "<group>"; };
4A8C96EA0BE69032004EEFF0 /* SelectionControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = SelectionControllerMac.mm; path = mac/SelectionControllerMac.mm; sourceTree = "<group>"; };
+ 4ACBC0BC12713CBD0094F9B2 /* ClassList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClassList.cpp; sourceTree = "<group>"; };
+ 4ACBC0BD12713CBD0094F9B2 /* ClassList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClassList.h; sourceTree = "<group>"; };
+ 4ACBC0C012713CCA0094F9B2 /* DOMSettableTokenList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMSettableTokenList.cpp; sourceTree = "<group>"; };
+ 4ACBC0C112713CCA0094F9B2 /* DOMSettableTokenList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSettableTokenList.h; sourceTree = "<group>"; };
+ 4ACBC0C212713CCA0094F9B2 /* DOMSettableTokenList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMSettableTokenList.idl; sourceTree = "<group>"; };
+ 4ACBC0C812713D0A0094F9B2 /* JSDOMSettableTokenList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMSettableTokenList.cpp; sourceTree = "<group>"; };
+ 4ACBC0C912713D0A0094F9B2 /* JSDOMSettableTokenList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMSettableTokenList.h; sourceTree = "<group>"; };
4B2708C50AF19EE40065127F /* Pasteboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pasteboard.h; sourceTree = "<group>"; };
4B2709810AF2E5E00065127F /* PasteboardMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardMac.mm; sourceTree = "<group>"; };
4B3043C60AE0370300A82647 /* Sound.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Sound.h; sourceTree = "<group>"; };
@@ -7561,6 +7633,8 @@
75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEvent.h; sourceTree = "<group>"; };
75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMMessageEvent.mm; sourceTree = "<group>"; };
75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEventInternal.h; sourceTree = "<group>"; };
+ 758978EA127090D60076D5A9 /* SpeechInputResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechInputResult.cpp; sourceTree = "<group>"; };
+ 758978EB127090D60076D5A9 /* SpeechInputResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputResult.h; sourceTree = "<group>"; };
7637C540112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketHandshakeRequest.cpp; sourceTree = "<group>"; };
7637C542112E7B7E003D6CDC /* WebSocketHandshakeRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketHandshakeRequest.h; sourceTree = "<group>"; };
767F99BD11A1194A0080C51D /* WebSocketHandshakeResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketHandshakeResponse.cpp; sourceTree = "<group>"; };
@@ -8637,6 +8711,7 @@
8A9A587311E84C81008ACFD1 /* JSPerformance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPerformance.h; sourceTree = "<group>"; };
8A9A587611E84C98008ACFD1 /* JSTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTiming.cpp; sourceTree = "<group>"; };
8A9A587711E84C98008ACFD1 /* JSTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTiming.h; sourceTree = "<group>"; };
+ 8AB4BC76126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IgnoreDestructiveWriteCountIncrementer.h; sourceTree = "<group>"; };
8AF4E55211DC5A36000ED3DE /* Navigation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Navigation.cpp; sourceTree = "<group>"; };
8AF4E55311DC5A36000ED3DE /* Navigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Navigation.h; sourceTree = "<group>"; };
8AF4E55411DC5A36000ED3DE /* Navigation.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Navigation.idl; sourceTree = "<group>"; };
@@ -8650,7 +8725,7 @@
9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroup.cpp; sourceTree = "<group>"; };
9302B0BE0D79F82C00C7EE83 /* PageGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroup.h; sourceTree = "<group>"; };
9305B24C098F1B6B00C28855 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timer.h; sourceTree = "<group>"; };
- 9307059009E0C75800B17FE4 /* CSSPrimitiveValue.idl */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 4; path = CSSPrimitiveValue.idl; sourceTree = "<group>"; };
+ 9307059009E0C75800B17FE4 /* CSSPrimitiveValue.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSPrimitiveValue.idl; sourceTree = "<group>"; };
930705C709E0C95F00B17FE4 /* Counter.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Counter.idl; sourceTree = "<group>"; };
930705D709E0C9B700B17FE4 /* JSCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCounter.cpp; sourceTree = "<group>"; };
930705D909E0C9BF00B17FE4 /* JSCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCounter.h; sourceTree = "<group>"; };
@@ -9080,6 +9155,8 @@
A7D3C5230B576B4B002CA450 /* PasteboardHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasteboardHelper.h; sourceTree = "<group>"; };
A7D6B3470F61104500B79FD1 /* WorkerScriptLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerScriptLoader.h; path = workers/WorkerScriptLoader.h; sourceTree = "<group>"; };
A7D6B3480F61104500B79FD1 /* WorkerScriptLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WorkerScriptLoader.cpp; path = workers/WorkerScriptLoader.cpp; sourceTree = "<group>"; };
+ A7DBF8DB1276919C006B6008 /* TextCheckingHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextCheckingHelper.cpp; sourceTree = "<group>"; };
+ A7DBF8DC1276919C006B6008 /* TextCheckingHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCheckingHelper.h; sourceTree = "<group>"; };
A7F338A111C0EFCA00A320A7 /* ShadowElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowElement.cpp; sourceTree = "<group>"; };
A7F338A211C0EFCA00A320A7 /* ShadowElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowElement.h; sourceTree = "<group>"; };
A809F1450B73793A002E4D7F /* RenderSVGGradientStop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGGradientStop.h; sourceTree = "<group>"; };
@@ -11322,6 +11399,8 @@
E1284BD41044A01E00EAEB52 /* DOMPageTransitionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPageTransitionEvent.h; sourceTree = "<group>"; };
E12EDB7A0B308A78002704B6 /* EventTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventTarget.h; sourceTree = "<group>"; };
E12EDBE90B308E0B002704B6 /* EventTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventTarget.cpp; sourceTree = "<group>"; };
+ E13F01EA1270E10D00DFBA71 /* CookieStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CookieStorage.h; sourceTree = "<group>"; };
+ E13F01F01270E19000DFBA71 /* CookieStorageMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CookieStorageMac.mm; sourceTree = "<group>"; };
E15A36D61104572000B7B639 /* XMLNSNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLNSNames.h; sourceTree = "<group>"; };
E15A36D81104572700B7B639 /* XMLNSNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLNSNames.cpp; sourceTree = "<group>"; };
E169803C1133542D00894115 /* CRuntimeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRuntimeObject.h; sourceTree = "<group>"; };
@@ -11555,6 +11634,7 @@
F5C2869502846DCD018635CA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
F5D3A57A106B83B300545297 /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = "<group>"; };
F5D3A57B106B83B300545297 /* DateComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateComponents.h; sourceTree = "<group>"; };
+ F7A034C3126BF6BE007DC19E /* FontOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontOrientation.h; sourceTree = "<group>"; };
F8216299029F4FB501000131 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLHttpRequestProgressEvent.cpp; sourceTree = "<group>"; };
F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXMLHttpRequestProgressEvent.h; sourceTree = "<group>"; };
@@ -11663,7 +11743,17 @@
081CDFBD126ECFE800D215CA /* properties */ = {
isa = PBXGroup;
children = (
+ 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */,
+ 088A0DFC126EF1DB00978F7A /* SVGAnimatedProperty.h */,
+ 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */,
+ 088A0DFE126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h */,
081CDFBE126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h */,
+ 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */,
+ 08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */,
+ 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */,
+ 088A0E01126EF1DB00978F7A /* SVGProperty.h */,
+ 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */,
+ 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */,
);
path = properties;
sourceTree = "<group>";
@@ -12918,6 +13008,7 @@
2EB4BCD0121F03E300EC4885 /* BlobResourceHandle.cpp */,
2EB4BCD1121F03E300EC4885 /* BlobResourceHandle.h */,
2EDEF1F2121B0EFC00726DB2 /* BlobStorageData.h */,
+ E13F01EA1270E10D00DFBA71 /* CookieStorage.h */,
514C76580CE923A1007EF3CD /* Credential.cpp */,
514C76590CE923A1007EF3CD /* Credential.h */,
51A052321058774F00CC9E95 /* CredentialStorage.cpp */,
@@ -12966,6 +13057,7 @@
934F71430D5A6F5300018D69 /* AuthenticationChallenge.h */,
514C76420CE9234E007EF3CD /* AuthenticationMac.h */,
514C76430CE9234E007EF3CD /* AuthenticationMac.mm */,
+ E13F01F01270E19000DFBA71 /* CookieStorageMac.mm */,
E1B4CD2410B322E200BFFD7E /* CredentialStorageMac.mm */,
514C76440CE9234E007EF3CD /* FormDataStreamMac.h */,
514C76450CE9234E007EF3CD /* FormDataStreamMac.mm */,
@@ -13173,6 +13265,8 @@
7578F90911DDF26900D933C5 /* SpeechInput.h */,
7578F90A11DDF26900D933C5 /* SpeechInputClient.h */,
7578F91E11E4E32800D933C5 /* SpeechInputListener.h */,
+ 758978EA127090D60076D5A9 /* SpeechInputResult.cpp */,
+ 758978EB127090D60076D5A9 /* SpeechInputResult.h */,
62C1217A11AB9E76003C462C /* SuspendableTimer.cpp */,
62C1217B11AB9E77003C462C /* SuspendableTimer.h */,
8AF4E55811DC5A63000ED3DE /* Timing.cpp */,
@@ -14454,6 +14548,8 @@
93309DC6099E64910056E581 /* SplitTextNodeContainingElementCommand.cpp */,
93309DC7099E64910056E581 /* SplitTextNodeContainingElementCommand.h */,
93309DC8099E64910056E581 /* TextAffinity.h */,
+ A7DBF8DB1276919C006B6008 /* TextCheckingHelper.cpp */,
+ A7DBF8DC1276919C006B6008 /* TextCheckingHelper.h */,
93309DC9099E64910056E581 /* TextGranularity.h */,
93309DCC099E64910056E581 /* TextIterator.cpp */,
93309DCD099E64910056E581 /* TextIterator.h */,
@@ -14518,6 +14614,10 @@
97C1F5511228558800EDE616 /* parser */,
B0149E7911A4B21500196A7B /* AsyncImageResizer.cpp */,
B0149E7A11A4B21500196A7B /* AsyncImageResizer.h */,
+ 379E61C5126CA5C300B63E8D /* BaseButtonInputType.cpp */,
+ 379E61C6126CA5C300B63E8D /* BaseButtonInputType.h */,
+ 379E61C7126CA5C300B63E8D /* BaseCheckableInputType.cpp */,
+ 379E61C8126CA5C300B63E8D /* BaseCheckableInputType.h */,
F59C95FD1255B23F000623C0 /* BaseDateAndTimeInputType.cpp */,
F59C95FE1255B23F000623C0 /* BaseDateAndTimeInputType.h */,
F55B3D791251F12D003EF269 /* BaseTextInputType.cpp */,
@@ -14526,6 +14626,8 @@
F55B3D7C1251F12D003EF269 /* ButtonInputType.h */,
F55B3D7D1251F12D003EF269 /* CheckboxInputType.cpp */,
F55B3D7E1251F12D003EF269 /* CheckboxInputType.h */,
+ 4ACBC0BC12713CBD0094F9B2 /* ClassList.cpp */,
+ 4ACBC0BD12713CBD0094F9B2 /* ClassList.h */,
93C441ED0F813A1A00C1A634 /* CollectionCache.cpp */,
93C441EE0F813A1A00C1A634 /* CollectionCache.h */,
93C441FF0F813AE100C1A634 /* CollectionType.h */,
@@ -14551,6 +14653,9 @@
2ED609BA1145B07100C8684E /* DOMFormData.cpp */,
2ED609BB1145B07100C8684E /* DOMFormData.h */,
2E0888C3114883A900AF4265 /* DOMFormData.idl */,
+ 4ACBC0C012713CCA0094F9B2 /* DOMSettableTokenList.cpp */,
+ 4ACBC0C112713CCA0094F9B2 /* DOMSettableTokenList.h */,
+ 4ACBC0C212713CCA0094F9B2 /* DOMSettableTokenList.idl */,
76FC2B0812370DA0006A991A /* DOMTokenList.cpp */,
76FC2B0912370DA0006A991A /* DOMTokenList.h */,
76FC2B0A12370DA0006A991A /* DOMTokenList.idl */,
@@ -14931,8 +15036,12 @@
2EDF369E122C94C8002F7D4E /* FileException.h */,
976D6C66122B8A3D001FD1F7 /* FileList.cpp */,
976D6C67122B8A3D001FD1F7 /* FileList.h */,
+ 4689F1AE1267BAE100E8D380 /* FileMetadata.h */,
976D6C69122B8A3D001FD1F7 /* FileReader.cpp */,
976D6C6A122B8A3D001FD1F7 /* FileReader.h */,
+ 2E75841A12779ADA0062628B /* FileReaderLoader.cpp */,
+ 2E75841B12779ADA0062628B /* FileReaderLoader.h */,
+ 2E75841C12779ADA0062628B /* FileReaderLoaderClient.h */,
2EDF369A122C94B4002F7D4E /* FileReaderSync.cpp */,
2EDF369B122C94B4002F7D4E /* FileReaderSync.h */,
976D6C6C122B8A3D001FD1F7 /* FileStreamProxy.cpp */,
@@ -15101,6 +15210,8 @@
BC77D1680FF19F550070887B /* JSDataGridColumnList.h */,
2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */,
2E0888D31148848A00AF4265 /* JSDOMFormData.h */,
+ 4ACBC0C812713D0A0094F9B2 /* JSDOMSettableTokenList.cpp */,
+ 4ACBC0C912713D0A0094F9B2 /* JSDOMSettableTokenList.h */,
7694563A1214D97C0007CBAE /* JSDOMTokenList.cpp */,
7694563B1214D97C0007CBAE /* JSDOMTokenList.h */,
49EECEF4105070C400099FAB /* JSFloat32Array.cpp */,
@@ -15900,11 +16011,17 @@
B22277E30D00BF1F0071B782 /* SVGAnimateColorElement.cpp */,
B22277E40D00BF1F0071B782 /* SVGAnimateColorElement.h */,
B22277E50D00BF1F0071B782 /* SVGAnimateColorElement.idl */,
+ 087B84951272CEC700A14417 /* SVGAnimatedAngle.h */,
B22277E60D00BF1F0071B782 /* SVGAnimatedAngle.idl */,
+ 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */,
B22277E70D00BF1F0071B782 /* SVGAnimatedBoolean.idl */,
+ 08D46CE2127AD5FC0089694B /* SVGAnimatedEnumeration.h */,
B22277E80D00BF1F0071B782 /* SVGAnimatedEnumeration.idl */,
+ 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */,
B22277E90D00BF1F0071B782 /* SVGAnimatedInteger.idl */,
+ 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */,
B22277EA0D00BF1F0071B782 /* SVGAnimatedLength.idl */,
+ 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */,
B22277EB0D00BF1F0071B782 /* SVGAnimatedLengthList.idl */,
B22277EC0D00BF1F0071B782 /* SVGAnimatedNumber.idl */,
B22277ED0D00BF1F0071B782 /* SVGAnimatedNumberList.idl */,
@@ -15915,6 +16032,7 @@
B22277F20D00BF1F0071B782 /* SVGAnimatedPoints.h */,
B22277F30D00BF1F0071B782 /* SVGAnimatedPoints.idl */,
B22277F40D00BF1F0071B782 /* SVGAnimatedPreserveAspectRatio.idl */,
+ 08C859BF1274575300A5728D /* SVGAnimatedRect.h */,
B22277F50D00BF1F0071B782 /* SVGAnimatedRect.idl */,
B22277F60D00BF1F0071B782 /* SVGAnimatedString.idl */,
B22277F80D00BF1F0071B782 /* SVGAnimatedTransformList.idl */,
@@ -16478,6 +16596,7 @@
B2C3DA580D006CD600EF6F26 /* FontFamily.cpp */,
B2C3DA590D006CD600EF6F26 /* FontFamily.h */,
72626E010EF022FE00A07E20 /* FontFastPath.cpp */,
+ F7A034C3126BF6BE007DC19E /* FontOrientation.h */,
37ACCE410DA2980F0089E602 /* FontRenderingMode.h */,
B2C3DA5A0D006CD600EF6F26 /* FontSelector.h */,
37202198106213C600F25C4B /* FontSmoothingMode.h */,
@@ -16865,6 +16984,7 @@
893C485212499B06002B3D86 /* JSEntrySyncCustom.cpp */,
BCEFAF4D0C317E6900FA81F6 /* JSEventCustom.cpp */,
BC275B8011C5D2B400C9206C /* JSEventSourceCustom.cpp */,
+ 2E7582ED12764F260062628B /* JSFileReaderCustom.cpp */,
49EECF7210508D9C00099FAB /* JSFloat32ArrayCustom.cpp */,
FE80D7A60E9C1ED2000D6F75 /* JSGeolocationCustom.cpp */,
BCE7B1920D4E86960075A539 /* JSHistoryCustom.cpp */,
@@ -18062,6 +18182,7 @@
A853123C11D0471B00D4D077 /* FragmentScriptingPermission.h */,
2442BBF81194C9D300D49469 /* HashChangeEvent.h */,
8482B7441198C32E00BFB005 /* HashChangeEvent.idl */,
+ 8AB4BC76126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h */,
08700BE60F086C5300919419 /* InputElement.cpp */,
08591AA40F085C4E009BACB1 /* InputElement.h */,
85031B2D0A44EFC700F992E0 /* KeyboardEvent.cpp */,
@@ -18338,6 +18459,8 @@
BCA8CA6011E4E6D100812FB7 /* BackForwardListImpl.h in Headers */,
BC124EE80C2641CD009E2349 /* BarInfo.h in Headers */,
B2C3DA220D006C1D00EF6F26 /* Base64.h in Headers */,
+ 379E61CA126CA5C400B63E8D /* BaseButtonInputType.h in Headers */,
+ 379E61CC126CA5C400B63E8D /* BaseCheckableInputType.h in Headers */,
F59C96001255B23F000623C0 /* BaseDateAndTimeInputType.h in Headers */,
F55B3DAE1251F12D003EF269 /* BaseTextInputType.h in Headers */,
BC9462D8107A7B4C00857193 /* BeforeLoadEvent.h in Headers */,
@@ -18406,6 +18529,7 @@
A81872200977D3C0005826D9 /* ChildNodeList.h in Headers */,
14D823520AF92A790004F057 /* Chrome.h in Headers */,
14D824080AF93AEB0004F057 /* ChromeClient.h in Headers */,
+ 4ACBC0BF12713CBD0094F9B2 /* ClassList.h in Headers */,
BC904B770D10998F00680D32 /* ClassNodeList.h in Headers */,
BCC0657E0F3CE1B700CD2D87 /* ClientRect.h in Headers */,
BCC065810F3CE1B700CD2D87 /* ClientRectList.h in Headers */,
@@ -18544,6 +18668,9 @@
93309DE1099E64920056E581 /* DeleteSelectionCommand.h in Headers */,
93F1998208245E59001E9ABC /* DeprecatedPtrList.h in Headers */,
93F1996D08245E59001E9ABC /* DeprecatedPtrListImpl.h in Headers */,
+ 081CDFB8126ECFDB00D215CA /* DeprecatedSVGAnimatedProperty.h in Headers */,
+ 081CDFB9126ECFDB00D215CA /* DeprecatedSVGAnimatedPropertyTraits.h in Headers */,
+ 081CDFBA126ECFDB00D215CA /* DeprecatedSVGAnimatedTemplate.h in Headers */,
31FB1A57120A5D0600DC02A0 /* DeviceMotionClient.h in Headers */,
31FB1A59120A5D0600DC02A0 /* DeviceMotionController.h in Headers */,
31FB1A5B120A5D0600DC02A0 /* DeviceMotionData.h in Headers */,
@@ -18833,6 +18960,7 @@
855D358A0AD707310019AAC7 /* DOMRGBColor.h in Headers */,
BCD0FC4F0DBD720B00B2F630 /* DOMRGBColorInternal.h in Headers */,
BC5A86850C33676000EEA649 /* DOMSelection.h in Headers */,
+ 4ACBC0C412713CCA0094F9B2 /* DOMSettableTokenList.h in Headers */,
C544274B11A57E7A0063A749 /* DOMStringList.h in Headers */,
BC64640A11D7F304006455B0 /* DOMStringMap.h in Headers */,
0FF5025B102BA9010066F39A /* DOMStyleMedia.h in Headers */,
@@ -19397,7 +19525,10 @@
2EDF369F122C94C8002F7D4E /* FileException.h in Headers */,
F55B3DBE1251F12D003EF269 /* FileInputType.h in Headers */,
976D6C86122B8A3D001FD1F7 /* FileList.h in Headers */,
+ 4689F1AF1267BAE100E8D380 /* FileMetadata.h in Headers */,
976D6C89122B8A3D001FD1F7 /* FileReader.h in Headers */,
+ 2E75841E12779ADA0062628B /* FileReaderLoader.h in Headers */,
+ 2E75841F12779ADA0062628B /* FileReaderLoaderClient.h in Headers */,
2EDF369D122C94B4002F7D4E /* FileReaderSync.h in Headers */,
2EF1BFEB121C9F4200C27627 /* FileStream.h in Headers */,
2EF1BFF9121CB0CE00C27627 /* FileStreamClient.h in Headers */,
@@ -19431,6 +19562,7 @@
B2C3DA680D006CD600EF6F26 /* FontFallbackList.h in Headers */,
B2C3DA6A0D006CD600EF6F26 /* FontFamily.h in Headers */,
A80E6CF30A1989CA007FB8C5 /* FontFamilyValue.h in Headers */,
+ F7A034C4126BF6BE007DC19E /* FontOrientation.h in Headers */,
B5320D6B122A24E9002D1440 /* FontPlatformData.h in Headers */,
37ACCE420DA2980F0089E602 /* FontRenderingMode.h in Headers */,
B2C3DA6B0D006CD600EF6F26 /* FontSelector.h in Headers */,
@@ -19641,6 +19773,7 @@
49E911C50EF86D47009D0CAF /* IdentityTransformOperation.h in Headers */,
C0C054CD1118C8E400CE2636 /* IDLParser.pm in Headers */,
C0C054CE1118C8E400CE2636 /* IDLStructure.pm in Headers */,
+ 8AB4BC77126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h in Headers */,
B27535700B053814002CE64F /* Image.h in Headers */,
B2A10B920B3818BD00099AA4 /* ImageBuffer.h in Headers */,
BCA979171215D055005C485C /* ImageBufferData.h in Headers */,
@@ -19686,6 +19819,7 @@
9F0D6B2F121BFEBA006C0288 /* InspectorProfilerAgent.h in Headers */,
41F062010F5F0B6600A07EAC /* InspectorResource.h in Headers */,
82AB1776125C826700C5069D /* InspectorResourceAgent.h in Headers */,
+ 4FA3B90B125CD12200300BAD /* InspectorState.h in Headers */,
7AB0B1C11211A62200A76940 /* InspectorStorageAgent.h in Headers */,
82AB1774125C826700C5069D /* InspectorStyleSheet.h in Headers */,
754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */,
@@ -19791,6 +19925,7 @@
A9D247FF0D757E6900FDF959 /* JSDOMPlugin.h in Headers */,
A9D248010D757E6900FDF959 /* JSDOMPluginArray.h in Headers */,
BC5A86B60C3367E800EEA649 /* JSDOMSelection.h in Headers */,
+ 4ACBC0CB12713D0A0094F9B2 /* JSDOMSettableTokenList.h in Headers */,
C5137CF311A58378004ADB99 /* JSDOMStringList.h in Headers */,
BC64649811D82349006455B0 /* JSDOMStringMap.h in Headers */,
7694563D1214D97C0007CBAE /* JSDOMTokenList.h in Headers */,
@@ -20212,6 +20347,7 @@
1A8F6BC60DB55CDC001DB794 /* ManifestParser.h in Headers */,
A8C4A84C09D5649D0003AC8D /* MappedAttributeEntry.h in Headers */,
93309DF8099E64920056E581 /* markup.h in Headers */,
+ 9728C3141268E4390041E89B /* MarkupAccumulator.h in Headers */,
FABE72F51059C1EB00D999DD /* MathMLElement.h in Headers */,
FABE72F71059C1EB00D999DD /* MathMLInlineContainerElement.h in Headers */,
FABE72F91059C1EB00D999DD /* MathMLMathElement.h in Headers */,
@@ -20677,8 +20813,18 @@
65653F2E0D9727D200CA9723 /* SVGAltGlyphElement.h in Headers */,
B22279770D00BF220071B782 /* SVGAngle.h in Headers */,
B222797A0D00BF220071B782 /* SVGAnimateColorElement.h in Headers */,
+ 087B84961272CEC800A14417 /* SVGAnimatedAngle.h in Headers */,
+ 089021A9126EF5DE0092D5EA /* SVGAnimatedLength.h in Headers */,
+ 089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */,
+ 088A0E04126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h in Headers */,
B22279850D00BF220071B782 /* SVGAnimatedPathData.h in Headers */,
B22279880D00BF220071B782 /* SVGAnimatedPoints.h in Headers */,
+ 088A0E05126EF1DB00978F7A /* SVGAnimatedProperty.h in Headers */,
+ 088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */,
+ 088A0E07126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h in Headers */,
+ 081CDFBF126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h in Headers */,
+ 088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */,
+ 08C859C01274575400A5728D /* SVGAnimatedRect.h in Headers */,
B22279900D00BF220071B782 /* SVGAnimateElement.h in Headers */,
B22279930D00BF220071B782 /* SVGAnimateMotionElement.h in Headers */,
B22279950D00BF220071B782 /* SVGAnimateTransformElement.h in Headers */,
@@ -20756,6 +20902,7 @@
B2227A390D00BF220071B782 /* SVGLinearGradientElement.h in Headers */,
B2227A3C0D00BF220071B782 /* SVGLineElement.h in Headers */,
B2227A3E0D00BF220071B782 /* SVGList.h in Headers */,
+ 088A0E09126EF1DB00978F7A /* SVGListPropertyTearOff.h in Headers */,
B2227A3F0D00BF220071B782 /* SVGListTraits.h in Headers */,
B2227A410D00BF220071B782 /* SVGLocatable.h in Headers */,
08385FF610F0186000BFE07B /* SVGMarkerData.h in Headers */,
@@ -20801,6 +20948,9 @@
B2227A910D00BF220071B782 /* SVGPolygonElement.h in Headers */,
B2227A940D00BF220071B782 /* SVGPolylineElement.h in Headers */,
B2227A970D00BF220071B782 /* SVGPreserveAspectRatio.h in Headers */,
+ 088A0E0A126EF1DB00978F7A /* SVGProperty.h in Headers */,
+ 088A0E0B126EF1DB00978F7A /* SVGPropertyTearOff.h in Headers */,
+ 088A0E0C126EF1DB00978F7A /* SVGPropertyTraits.h in Headers */,
B2227A9A0D00BF220071B782 /* SVGRadialGradientElement.h in Headers */,
B2227A9E0D00BF220071B782 /* SVGRectElement.h in Headers */,
B2227AA00D00BF220071B782 /* SVGRenderingIntent.h in Headers */,
@@ -20866,6 +21016,7 @@
B2C3DA340D006C1D00EF6F26 /* TextBoundaries.h in Headers */,
B2C3DA360D006C1D00EF6F26 /* TextBreakIterator.h in Headers */,
B2C3DA380D006C1D00EF6F26 /* TextBreakIteratorInternalICU.h in Headers */,
+ A7DBF8DE1276919C006B6008 /* TextCheckingHelper.h in Headers */,
B2C3DA3A0D006C1D00EF6F26 /* TextCodec.h in Headers */,
B2C3DA3C0D006C1D00EF6F26 /* TextCodecICU.h in Headers */,
B2C3DA3E0D006C1D00EF6F26 /* TextCodecLatin1.h in Headers */,
@@ -21087,12 +21238,10 @@
93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
- 4FA3B90B125CD12200300BAD /* InspectorState.h in Headers */,
- 9728C3141268E4390041E89B /* MarkupAccumulator.h in Headers */,
- 081CDFB8126ECFDB00D215CA /* DeprecatedSVGAnimatedProperty.h in Headers */,
- 081CDFB9126ECFDB00D215CA /* DeprecatedSVGAnimatedPropertyTraits.h in Headers */,
- 081CDFBA126ECFDB00D215CA /* DeprecatedSVGAnimatedTemplate.h in Headers */,
- 081CDFBF126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h in Headers */,
+ 085797091278394C00A8EC5F /* SVGAnimatedBoolean.h in Headers */,
+ 08525E631278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h in Headers */,
+ 08D46CE3127AD5FC0089694B /* SVGAnimatedEnumeration.h in Headers */,
+ 0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -21152,7 +21301,6 @@
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
compatibilityVersion = "Xcode 2.4";
- developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
@@ -21184,6 +21332,7 @@
46F9D5DD0B0D60170028EE36 /* aliasCursor.png in Resources */,
46D4F2490AF97E810035385A /* cellCursor.png in Resources */,
46D4F24A0AF97E810035385A /* contextMenuCursor.png in Resources */,
+ E13F01EB1270E10D00DFBA71 /* CookieStorage.h in Resources */,
4614A1FE0B23A8D600446E1C /* copyCursor.png in Resources */,
464EA2730B8A350B00A8E6E3 /* crossHairCursor.png in Resources */,
1C14E76C0AD8C81C00B6158B /* deleteButton.tiff in Resources */,
@@ -21453,6 +21602,8 @@
BCA8CA5F11E4E6D100812FB7 /* BackForwardListImpl.cpp in Sources */,
BC124EE70C2641CD009E2349 /* BarInfo.cpp in Sources */,
B2C3DA210D006C1D00EF6F26 /* Base64.cpp in Sources */,
+ 379E61C9126CA5C300B63E8D /* BaseButtonInputType.cpp in Sources */,
+ 379E61CB126CA5C400B63E8D /* BaseCheckableInputType.cpp in Sources */,
F59C95FF1255B23F000623C0 /* BaseDateAndTimeInputType.cpp in Sources */,
F55B3DAD1251F12D003EF269 /* BaseTextInputType.cpp in Sources */,
5172204B11D2960500638B42 /* BeforeProcessEvent.cpp in Sources */,
@@ -21506,6 +21657,7 @@
A81872250977D3C0005826D9 /* ChildNodeList.cpp in Sources */,
14D8238B0AF92DF60004F057 /* Chrome.cpp in Sources */,
ABAF22080C03B1C700B0BCF0 /* ChromeMac.mm in Sources */,
+ 4ACBC0BE12713CBD0094F9B2 /* ClassList.cpp in Sources */,
BC904B760D10998F00680D32 /* ClassNodeList.cpp in Sources */,
BCC0657D0F3CE1B700CD2D87 /* ClientRect.cpp in Sources */,
BCC065800F3CE1B700CD2D87 /* ClientRectList.cpp in Sources */,
@@ -21536,6 +21688,7 @@
06027CB30B1CC03D00884B2D /* ContextMenuItemMac.mm in Sources */,
93B6A0EA0B0BCA8400F5027A /* ContextMenuMac.mm in Sources */,
9352087709BD453400F2038D /* CookieJar.mm in Sources */,
+ E13F01F11270E19000DFBA71 /* CookieStorageMac.mm in Sources */,
BC5EB9500E82056B00B25965 /* CounterDirectives.cpp in Sources */,
9392F1500AD1862300691BD4 /* CounterNode.cpp in Sources */,
D0B0556909C6700100307E43 /* CreateLinkCommand.cpp in Sources */,
@@ -21779,6 +21932,7 @@
858C38A80AA8F20400B187A4 /* DOMRect.mm in Sources */,
BCAEFCAE1016CE4A0040D34E /* DOMRGBColor.mm in Sources */,
BC5A86840C33676000EEA649 /* DOMSelection.cpp in Sources */,
+ 4ACBC0C312713CCA0094F9B2 /* DOMSettableTokenList.cpp in Sources */,
C55610F111A704EB00B82D27 /* DOMStringList.cpp in Sources */,
BC64640911D7F304006455B0 /* DOMStringMap.cpp in Sources */,
0FF5025C102BA9010066F39A /* DOMStyleMedia.mm in Sources */,
@@ -21997,6 +22151,7 @@
F55B3DBD1251F12D003EF269 /* FileInputType.cpp in Sources */,
976D6C85122B8A3D001FD1F7 /* FileList.cpp in Sources */,
976D6C88122B8A3D001FD1F7 /* FileReader.cpp in Sources */,
+ 2E75841D12779ADA0062628B /* FileReaderLoader.cpp in Sources */,
2EDF369C122C94B4002F7D4E /* FileReaderSync.cpp in Sources */,
2EF1BFEA121C9F4200C27627 /* FileStream.cpp in Sources */,
976D6C8B122B8A3D001FD1F7 /* FileStreamProxy.cpp in Sources */,
@@ -22243,6 +22398,7 @@
B885E8D411E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp in Sources */,
7A74ECBA101839A600BF939E /* InspectorBackend.cpp in Sources */,
4F707A9911EF679400ACDA69 /* InspectorBackendDispatcher.cpp in Sources */,
+ 7A1F2B52126C61B20006A7E6 /* InspectorClient.cpp in Sources */,
1C81B95B0E97330800266E07 /* InspectorController.cpp in Sources */,
82AB1743124B99EC00C5069D /* InspectorCSSAgent.cpp in Sources */,
82B6589A1189E47600E052A1 /* InspectorCSSStore.cpp in Sources */,
@@ -22257,6 +22413,7 @@
9F0D6B2E121BFEBA006C0288 /* InspectorProfilerAgent.cpp in Sources */,
41F062020F5F0B6600A07EAC /* InspectorResource.cpp in Sources */,
82AB1775125C826700C5069D /* InspectorResourceAgent.cpp in Sources */,
+ 4FA3B90A125CD12200300BAD /* InspectorState.cpp in Sources */,
7AB0B1C01211A62200A76940 /* InspectorStorageAgent.cpp in Sources */,
82AB1773125C826700C5069D /* InspectorStyleSheet.cpp in Sources */,
754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */,
@@ -22387,6 +22544,7 @@
A9C6E64C0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp in Sources */,
A9C6E64D0D7465E7006442E9 /* JSDOMPluginCustom.cpp in Sources */,
BC5A86B50C3367E800EEA649 /* JSDOMSelection.cpp in Sources */,
+ 4ACBC0CA12713D0A0094F9B2 /* JSDOMSettableTokenList.cpp in Sources */,
C5137CF211A58378004ADB99 /* JSDOMStringList.cpp in Sources */,
BC64649711D82349006455B0 /* JSDOMStringMap.cpp in Sources */,
BC64649C11D8238C006455B0 /* JSDOMStringMapCustom.cpp in Sources */,
@@ -22426,6 +22584,7 @@
898785F0122E1E87003AABDA /* JSFileException.cpp in Sources */,
BC00F0160E0A189500FD04E3 /* JSFileList.cpp in Sources */,
2E94F43B119207DA00B7F75D /* JSFileReader.cpp in Sources */,
+ 2E7582EE12764F260062628B /* JSFileReaderCustom.cpp in Sources */,
898785F4122E1EAC003AABDA /* JSFileReaderSync.cpp in Sources */,
898785B2122CA2A7003AABDA /* JSFileSystemCallback.cpp in Sources */,
46DA844D1224A0710060D006 /* JSFileWriter.cpp in Sources */,
@@ -22850,6 +23009,7 @@
1A98956B0AA78F80005EF5EF /* KURLCFNet.cpp in Sources */,
6593923A09AE435C002C531F /* KURLMac.mm in Sources */,
A456FA2611AD4A830020B420 /* LabelsNodeList.cpp in Sources */,
+ E18772F1126E2629003DD586 /* Language.cpp in Sources */,
9352084509BD43B900F2038D /* Language.mm in Sources */,
2D9066060BE141D400956998 /* LayoutState.cpp in Sources */,
512DD8F40D91E6AF000F89EE /* LegacyWebArchive.cpp in Sources */,
@@ -22874,6 +23034,7 @@
93E227E10AF589AD00D48324 /* MainResourceLoader.cpp in Sources */,
1A8F6BC50DB55CDC001DB794 /* ManifestParser.cpp in Sources */,
93309DF7099E64920056E581 /* markup.cpp in Sources */,
+ 9728C3131268E4390041E89B /* MarkupAccumulator.cpp in Sources */,
FABE72F41059C1EB00D999DD /* MathMLElement.cpp in Sources */,
FABE72FD1059C21100D999DD /* MathMLElementFactory.cpp in Sources */,
FABE72F61059C1EB00D999DD /* MathMLInlineContainerElement.cpp in Sources */,
@@ -23209,6 +23370,7 @@
626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */,
7578F90B11DDF26900D933C5 /* SpeechInput.cpp in Sources */,
7535BC9412020CFF0037EC45 /* SpeechInputClientMock.cpp in Sources */,
+ 758978EC127090D60076D5A9 /* SpeechInputResult.cpp in Sources */,
93309E11099E64920056E581 /* SplitElementCommand.cpp in Sources */,
93309E13099E64920056E581 /* SplitTextNodeCommand.cpp in Sources */,
93309E15099E64920056E581 /* SplitTextNodeContainingElementCommand.cpp in Sources */,
@@ -23454,6 +23616,7 @@
B2AFFC970D00A5DF0030074D /* TextBoundaries.mm in Sources */,
B2C3DA370D006C1D00EF6F26 /* TextBreakIteratorICU.cpp in Sources */,
B2AFFC980D00A5DF0030074D /* TextBreakIteratorInternalICUMac.mm in Sources */,
+ A7DBF8DD1276919C006B6008 /* TextCheckingHelper.cpp in Sources */,
B2C3DA390D006C1D00EF6F26 /* TextCodec.cpp in Sources */,
B2C3DA3B0D006C1D00EF6F26 /* TextCodecICU.cpp in Sources */,
B2C3DA3D0D006C1D00EF6F26 /* TextCodecLatin1.cpp in Sources */,
@@ -23640,10 +23803,6 @@
93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
- 4FA3B90A125CD12200300BAD /* InspectorState.cpp in Sources */,
- 9728C3131268E4390041E89B /* MarkupAccumulator.cpp in Sources */,
- E18772F1126E2629003DD586 /* Language.cpp in Sources */,
- 7A1F2B52126C61B20006A7E6 /* InspectorClient.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/WebCorePrefix.h b/WebCore/WebCorePrefix.h
index a871e4c..b42f035 100644
--- a/WebCore/WebCorePrefix.h
+++ b/WebCore/WebCorePrefix.h
@@ -23,7 +23,7 @@
* 2) in one case at least: OS-X-specific performance bug workarounds
* 3) the special trick to catch us using new or delete without including "config.h"
* The project should be able to build without this header, although we rarely test that.
- */
+ */
/* Things that need to be defined globally should go into "config.h". */
diff --git a/WebCore/accessibility/AXObjectCache.cpp b/WebCore/accessibility/AXObjectCache.cpp
index 30cce3a..5f969cd 100644
--- a/WebCore/accessibility/AXObjectCache.cpp
+++ b/WebCore/accessibility/AXObjectCache.cpp
@@ -323,7 +323,7 @@ void AXObjectCache::remove(RenderObject* renderer)
m_renderObjectMapping.remove(renderer);
}
-#if !PLATFORM(WIN)
+#if !PLATFORM(WIN) || OS(WINCE)
AXID AXObjectCache::platformGenerateAXID() const
{
static AXID lastUsedID = 0;
diff --git a/WebCore/accessibility/AccessibilityARIAGrid.cpp b/WebCore/accessibility/AccessibilityARIAGrid.cpp
index 0d9f845..8651a80 100644
--- a/WebCore/accessibility/AccessibilityARIAGrid.cpp
+++ b/WebCore/accessibility/AccessibilityARIAGrid.cpp
@@ -83,7 +83,7 @@ void AccessibilityARIAGrid::addChildren()
{
ASSERT(!m_haveChildren);
- if (!isDataTable()) {
+ if (!isAccessibilityTable()) {
AccessibilityRenderObject::addChildren();
return;
}
diff --git a/WebCore/accessibility/AccessibilityARIAGridCell.cpp b/WebCore/accessibility/AccessibilityARIAGridCell.cpp
index 1771bb8..c8157f5 100644
--- a/WebCore/accessibility/AccessibilityARIAGridCell.cpp
+++ b/WebCore/accessibility/AccessibilityARIAGridCell.cpp
@@ -57,7 +57,7 @@ AccessibilityObject* AccessibilityARIAGridCell::parentTable() const
return 0;
parent = parent->parentObjectUnignored();
- if (!parent || !parent->isDataTable())
+ if (!parent || !parent->isAccessibilityTable())
return 0;
return parent;
diff --git a/WebCore/accessibility/AccessibilityARIAGridRow.cpp b/WebCore/accessibility/AccessibilityARIAGridRow.cpp
index 7d562d9..2b96036 100644
--- a/WebCore/accessibility/AccessibilityARIAGridRow.cpp
+++ b/WebCore/accessibility/AccessibilityARIAGridRow.cpp
@@ -65,7 +65,7 @@ void AccessibilityARIAGridRow::disclosedRows(AccessibilityChildrenVector& disclo
// The contiguous disclosed rows will be the rows in the table that
// have an aria-level of plus 1 from this row.
AccessibilityObject* parent = parentObjectUnignored();
- if (!parent || !parent->isDataTable())
+ if (!parent || !parent->isAccessibilityTable())
return;
// Search for rows that match the correct level.
@@ -92,7 +92,7 @@ AccessibilityObject* AccessibilityARIAGridRow::disclosedByRow() const
// The row that discloses this one is the row in the table
// that is aria-level subtract 1 from this row.
AccessibilityObject* parent = parentObjectUnignored();
- if (!parent || !parent->isDataTable())
+ if (!parent || !parent->isAccessibilityTable())
return 0;
// If the level is 1 or less, than nothing discloses this row.
@@ -119,7 +119,7 @@ AccessibilityObject* AccessibilityARIAGridRow::disclosedByRow() const
AccessibilityObject* AccessibilityARIAGridRow::parentTable() const
{
AccessibilityObject* parent = parentObjectUnignored();
- if (!parent->isDataTable())
+ if (!parent->isAccessibilityTable())
return 0;
return parent;
diff --git a/WebCore/accessibility/AccessibilityListBoxOption.cpp b/WebCore/accessibility/AccessibilityListBoxOption.cpp
index 3e4dad9..81a5978 100644
--- a/WebCore/accessibility/AccessibilityListBoxOption.cpp
+++ b/WebCore/accessibility/AccessibilityListBoxOption.cpp
@@ -184,7 +184,9 @@ void AccessibilityListBoxOption::setSelected(bool selected)
if ((isOptionSelected && selected) || (!isOptionSelected && !selected))
return;
- selectElement->accessKeySetSelectedIndex(listBoxOptionIndex());
+ // Convert from the entire list index to the option index.
+ int optionIndex = static_cast<SelectElement*>(selectElement)->listToOptionIndex(listBoxOptionIndex());
+ selectElement->accessKeySetSelectedIndex(optionIndex);
}
HTMLSelectElement* AccessibilityListBoxOption::listBoxOptionParentNode() const
diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h
index bcf09d2..66424ea 100644
--- a/WebCore/accessibility/AccessibilityObject.h
+++ b/WebCore/accessibility/AccessibilityObject.h
@@ -285,6 +285,7 @@ public:
virtual bool isSlider() const { return false; }
virtual bool isControl() const { return false; }
virtual bool isList() const { return false; }
+ virtual bool isAccessibilityTable() const { return false; }
virtual bool isDataTable() const { return false; }
virtual bool isTableRow() const { return false; }
virtual bool isTableColumn() const { return false; }
@@ -392,7 +393,6 @@ public:
virtual String ariaLabeledByAttribute() const { return String(); }
virtual String ariaDescribedByAttribute() const { return String(); }
virtual String accessibilityDescription() const { return String(); }
- virtual PassRefPtr<Range> ariaSelectedTextDOMRange() const { return 0; }
virtual AXObjectCache* axObjectCache() const { return 0; }
AXID axObjectID() const { return m_id; }
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 0b82c67..efa2036 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -1916,35 +1916,22 @@ int AccessibilityRenderObject::textLength() const
return text().length();
}
-PassRefPtr<Range> AccessibilityRenderObject::ariaSelectedTextDOMRange() const
+PlainTextRange AccessibilityRenderObject::ariaSelectedTextRange() const
{
Node* node = m_renderer->node();
if (!node)
- return 0;
-
- RefPtr<Range> currentSelectionRange = selection().toNormalizedRange();
- if (!currentSelectionRange)
- return 0;
+ return PlainTextRange();
ExceptionCode ec = 0;
- if (!currentSelectionRange->intersectsNode(node, ec))
- return Range::create(currentSelectionRange->ownerDocument());
-
- RefPtr<Range> ariaRange = rangeOfContents(node);
- Position startPosition, endPosition;
-
- // Find intersection of currentSelectionRange and ariaRange
- if (ariaRange->startOffset() > currentSelectionRange->startOffset())
- startPosition = ariaRange->startPosition();
- else
- startPosition = currentSelectionRange->startPosition();
+ VisibleSelection visibleSelection = selection();
+ RefPtr<Range> currentSelectionRange = visibleSelection.toNormalizedRange();
+ if (!currentSelectionRange || !currentSelectionRange->intersectsNode(node, ec))
+ return PlainTextRange();
- if (ariaRange->endOffset() < currentSelectionRange->endOffset())
- endPosition = ariaRange->endPosition();
- else
- endPosition = currentSelectionRange->endPosition();
+ int start = indexForVisiblePosition(visibleSelection.start());
+ int end = indexForVisiblePosition(visibleSelection.end());
- return Range::create(ariaRange->ownerDocument(), startPosition, endPosition);
+ return PlainTextRange(start, end - start);
}
String AccessibilityRenderObject::selectedText() const
@@ -1962,10 +1949,7 @@ String AccessibilityRenderObject::selectedText() const
if (ariaRoleAttribute() == UnknownRole)
return String();
- RefPtr<Range> ariaRange = ariaSelectedTextDOMRange();
- if (!ariaRange)
- return String();
- return ariaRange->text();
+ return doAXStringForRange(ariaSelectedTextRange());
}
const AtomicString& AccessibilityRenderObject::accessKey() const
@@ -1999,20 +1983,16 @@ PlainTextRange AccessibilityRenderObject::selectedTextRange() const
if (ariaRole == UnknownRole)
return PlainTextRange();
- RefPtr<Range> ariaRange = ariaSelectedTextDOMRange();
- if (!ariaRange)
- return PlainTextRange();
- return PlainTextRange(ariaRange->startOffset(), ariaRange->endOffset());
+ return ariaSelectedTextRange();
}
void AccessibilityRenderObject::setSelectedTextRange(const PlainTextRange& range)
{
if (isNativeTextControl()) {
- RenderTextControl* textControl = toRenderTextControl(m_renderer);
- textControl->setSelectionRange(range.start, range.start + range.length);
+ setSelectionRange(m_renderer->node(), range.start, range.start + range.length);
return;
}
-
+
Document* document = m_renderer->document();
if (!document)
return;
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index c62e98d..970ef9f 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -186,7 +186,6 @@ public:
virtual String textUnderElement() const;
virtual String text() const;
virtual int textLength() const;
- virtual PassRefPtr<Range> ariaSelectedTextDOMRange() const;
virtual String selectedText() const;
virtual const AtomicString& accessKey() const;
virtual const String& actionVerb() const;
@@ -277,6 +276,7 @@ private:
bool isAllowedChildOfTree() const;
bool hasTextAlternative() const;
String positionalDescriptionForMSAA() const;
+ PlainTextRange ariaSelectedTextRange() const;
Element* menuElementForMenuButton() const;
Element* menuItemElementForMenu() const;
diff --git a/WebCore/accessibility/AccessibilityTable.cpp b/WebCore/accessibility/AccessibilityTable.cpp
index 7f7b6f2..aa51f9e 100644
--- a/WebCore/accessibility/AccessibilityTable.cpp
+++ b/WebCore/accessibility/AccessibilityTable.cpp
@@ -67,37 +67,45 @@ PassRefPtr<AccessibilityTable> AccessibilityTable::create(RenderObject* renderer
return adoptRef(new AccessibilityTable(renderer));
}
-bool AccessibilityTable::isTableExposableThroughAccessibility()
+bool AccessibilityTable::hasARIARole() const
{
- // the following is a heuristic used to determine if a
- // <table> should be exposed as an AXTable. The goal
- // is to only show "data" tables
-
- if (!renderer())
+ if (!m_renderer)
return false;
- // if the developer assigned an aria role to this, then we shouldn't
- // expose it as a table, unless, of course, the aria role is a table
AccessibilityRole ariaRole = ariaRoleAttribute();
if (ariaRole != UnknownRole)
+ return true;
+
+ return false;
+}
+
+bool AccessibilityTable::isAccessibilityTable() const
+{
+ if (!m_renderer)
return false;
- RenderTable* table = toRenderTable(m_renderer);
-
- // this employs a heuristic to determine if this table should appear.
- // Only "data" tables should be exposed as tables.
+ return m_isAccessibilityTable;
+}
+
+bool AccessibilityTable::isDataTable() const
+{
+ if (!m_renderer)
+ return false;
+
+ // Do not consider it a data table is it has an ARIA role.
+ if (hasARIARole())
+ return false;
+
+ // This employs a heuristic to determine if this table should appear.
+ // Only "data" tables should be exposed as tables.
// Unfortunately, there is no good way to determine the difference
- // between a "layout" table and a "data" table
+ // between a "layout" table and a "data" table.
+ RenderTable* table = toRenderTable(m_renderer);
Node* tableNode = table->node();
if (!tableNode || !tableNode->hasTagName(tableTag))
return false;
- // Gtk+ ATs expect all tables to be exposed as tables.
-#if PLATFORM(GTK)
- return true;
-#endif
-
// if there is a caption element, summary, THEAD, or TFOOT section, it's most certainly a data table
HTMLTableElement* tableElement = static_cast<HTMLTableElement*>(tableNode);
if (!tableElement->summary().isEmpty() || tableElement->tHead() || tableElement->tFoot() || tableElement->caption())
@@ -242,6 +250,30 @@ bool AccessibilityTable::isTableExposableThroughAccessibility()
return false;
}
+bool AccessibilityTable::isTableExposableThroughAccessibility() const
+{
+ // The following is a heuristic used to determine if a
+ // <table> should be exposed as an AXTable. The goal
+ // is to only show "data" tables.
+
+ if (!m_renderer)
+ return false;
+
+ // If the developer assigned an aria role to this, then we
+ // shouldn't expose it as a table, unless, of course, the aria
+ // role is a table.
+ if (hasARIARole())
+ return false;
+
+ // Gtk+ ATs expect all tables to be exposed as tables.
+#if PLATFORM(GTK)
+ Node* tableNode = toRenderTable(m_renderer)->node();
+ return tableNode && tableNode->hasTagName(tableTag);
+#endif
+
+ return isDataTable();
+}
+
void AccessibilityTable::clearChildren()
{
AccessibilityRenderObject::clearChildren();
@@ -251,7 +283,7 @@ void AccessibilityTable::clearChildren()
void AccessibilityTable::addChildren()
{
- if (!isDataTable()) {
+ if (!isAccessibilityTable()) {
AccessibilityRenderObject::addChildren();
return;
}
@@ -488,7 +520,7 @@ AccessibilityTableCell* AccessibilityTable::cellForColumnAndRow(unsigned column,
AccessibilityRole AccessibilityTable::roleValue() const
{
- if (!isDataTable())
+ if (!isAccessibilityTable())
return AccessibilityRenderObject::roleValue();
return TableRole;
@@ -502,7 +534,7 @@ bool AccessibilityTable::accessibilityIsIgnored() const
if (decision == IgnoreObject)
return true;
- if (!isDataTable())
+ if (!isAccessibilityTable())
return AccessibilityRenderObject::accessibilityIsIgnored();
return false;
@@ -510,7 +542,7 @@ bool AccessibilityTable::accessibilityIsIgnored() const
String AccessibilityTable::title() const
{
- if (!isDataTable())
+ if (!isAccessibilityTable())
return AccessibilityRenderObject::title();
String title;
@@ -532,12 +564,4 @@ String AccessibilityTable::title() const
return title;
}
-bool AccessibilityTable::isDataTable() const
-{
- if (!m_renderer)
- return false;
-
- return m_isAccessibilityTable;
-}
-
} // namespace WebCore
diff --git a/WebCore/accessibility/AccessibilityTable.h b/WebCore/accessibility/AccessibilityTable.h
index 2ee5812..1666367 100644
--- a/WebCore/accessibility/AccessibilityTable.h
+++ b/WebCore/accessibility/AccessibilityTable.h
@@ -51,7 +51,9 @@ public:
static PassRefPtr<AccessibilityTable> create(RenderObject*);
virtual ~AccessibilityTable();
+ virtual bool isAccessibilityTable() const;
virtual bool isDataTable() const;
+
virtual AccessibilityRole roleValue() const;
virtual bool isAriaTable() const { return false; }
@@ -86,7 +88,8 @@ protected:
AccessibilityTableHeaderContainer* m_headerContainer;
mutable bool m_isAccessibilityTable;
- bool isTableExposableThroughAccessibility();
+ bool hasARIARole() const;
+ bool isTableExposableThroughAccessibility() const;
};
} // namespace WebCore
diff --git a/WebCore/accessibility/AccessibilityTableCell.cpp b/WebCore/accessibility/AccessibilityTableCell.cpp
index e2efb5e..7ad6063 100644
--- a/WebCore/accessibility/AccessibilityTableCell.cpp
+++ b/WebCore/accessibility/AccessibilityTableCell.cpp
@@ -84,7 +84,7 @@ AccessibilityObject* AccessibilityTableCell::parentTable() const
bool AccessibilityTableCell::isTableCell() const
{
AccessibilityObject* table = parentTable();
- if (!table || !table->isDataTable())
+ if (!table || !table->isAccessibilityTable())
return false;
return true;
diff --git a/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp b/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
index e2da83c..dad6963 100644
--- a/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
+++ b/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
@@ -85,7 +85,7 @@ void AccessibilityTableHeaderContainer::addChildren()
ASSERT(!m_haveChildren);
m_haveChildren = true;
- if (!m_parentTable || !m_parentTable->isDataTable())
+ if (!m_parentTable || !m_parentTable->isAccessibilityTable())
return;
static_cast<AccessibilityTable*>(m_parentTable)->columnHeaders(m_children);
diff --git a/WebCore/accessibility/AccessibilityTableRow.cpp b/WebCore/accessibility/AccessibilityTableRow.cpp
index 5e9f05c..09db132 100644
--- a/WebCore/accessibility/AccessibilityTableRow.cpp
+++ b/WebCore/accessibility/AccessibilityTableRow.cpp
@@ -68,7 +68,7 @@ AccessibilityRole AccessibilityTableRow::roleValue() const
bool AccessibilityTableRow::isTableRow() const
{
AccessibilityObject* table = parentTable();
- if (!table || !table->isDataTable())
+ if (!table || !table->isAccessibilityTable())
return false;
return true;
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index aa88217..283b2de 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -329,14 +329,23 @@ static AtkAttributeSet* addAttributeToSet(AtkAttributeSet* attributeSet, const c
static AtkAttributeSet* webkit_accessible_get_attributes(AtkObject* object)
{
AtkAttributeSet* attributeSet = 0;
-
attributeSet = addAttributeToSet(attributeSet, "toolkit", "WebKitGtk");
- int headingLevel = core(object)->headingLevel();
+ AccessibilityObject* coreObject = core(object);
+ if (!coreObject)
+ return attributeSet;
+
+ int headingLevel = coreObject->headingLevel();
if (headingLevel) {
String value = String::number(headingLevel);
attributeSet = addAttributeToSet(attributeSet, "level", value.utf8().data());
}
+
+ // Set the 'layout-guess' attribute to help Assistive
+ // Technologies know when an exposed table is not data table.
+ if (coreObject->isAccessibilityTable() && !coreObject->isDataTable())
+ attributeSet = addAttributeToSet(attributeSet, "layout-guess", "true");
+
return attributeSet;
}
@@ -861,6 +870,59 @@ static gchar* convertUniCharToUTF8(const UChar* characters, gint length, int fro
return g_string_free(ret, FALSE);
}
+gchar* textForRenderer(RenderObject* renderer)
+{
+ GString* resultText = g_string_new(0);
+
+ if (!renderer)
+ return g_string_free(resultText, FALSE);
+
+ // For RenderBlocks, piece together the text from the RenderText objects they contain.
+ for (RenderObject* object = renderer->firstChild(); object; object = object->nextSibling()) {
+ if (object->isBR()) {
+ g_string_append(resultText, "\n");
+ continue;
+ }
+
+ RenderText* renderText;
+ if (object->isText())
+ renderText = toRenderText(object);
+ else {
+ // We need to check children, if any, to consider when
+ // current object is not a text object but some of its
+ // children are, in order not to miss those portions of
+ // text by not properly handling those situations
+ if (object->firstChild())
+ g_string_append(resultText, textForRenderer(object));
+
+ continue;
+ }
+
+ InlineTextBox* box = renderText->firstTextBox();
+ while (box) {
+ gchar* text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());
+ g_string_append(resultText, text);
+ // Newline chars in the source result in separate text boxes, so check
+ // before adding a newline in the layout. See bug 25415 comment #78.
+ // If the next sibling is a BR, we'll add the newline when we examine that child.
+ if (!box->nextOnLineExists() && (!object->nextSibling() || !object->nextSibling()->isBR()))
+ g_string_append(resultText, "\n");
+ box = box->nextTextBox();
+ }
+ }
+
+ // Insert the text of the marker for list item in the right place, if present
+ if (renderer->isListItem()) {
+ String markerText = toRenderListItem(renderer)->markerTextWithSuffix();
+ if (renderer->style()->direction() == LTR)
+ g_string_prepend(resultText, markerText.utf8().data());
+ else
+ g_string_append(resultText, markerText.utf8().data());
+ }
+
+ return g_string_free(resultText, FALSE);
+}
+
gchar* textForObject(AccessibilityRenderObject* accObject)
{
GString* str = g_string_new(0);
@@ -879,48 +941,9 @@ gchar* textForObject(AccessibilityRenderObject* accObject)
g_string_append(str, "\n");
range = accObject->doAXRangeForLine(++lineNumber);
}
- } else {
- RenderObject* renderer = accObject->renderer();
- if (!renderer)
- return g_string_free(str, FALSE);
-
- // For RenderBlocks, piece together the text from the RenderText objects they contain.
- for (RenderObject* obj = renderer->firstChild(); obj; obj = obj->nextSibling()) {
- if (obj->isBR()) {
- g_string_append(str, "\n");
- continue;
- }
-
- RenderText* renderText;
- if (obj->isText())
- renderText = toRenderText(obj);
- else if (obj->firstChild() && obj->firstChild()->isText()) {
- // Handle RenderInlines (and any other similiar RenderObjects).
- renderText = toRenderText(obj->firstChild());
- } else
- continue;
-
- InlineTextBox* box = renderText->firstTextBox();
- while (box) {
- gchar* text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());
- g_string_append(str, text);
- // Newline chars in the source result in separate text boxes, so check
- // before adding a newline in the layout. See bug 25415 comment #78.
- // If the next sibling is a BR, we'll add the newline when we examine that child.
- if (!box->nextOnLineExists() && (!obj->nextSibling() || !obj->nextSibling()->isBR()))
- g_string_append(str, "\n");
- box = box->nextTextBox();
- }
- }
-
- // Insert the text of the marker for list item in the right place, if present
- if (renderer->isListItem()) {
- String markerText = toRenderListItem(renderer)->markerTextWithSuffix();
- if (renderer->style()->direction() == LTR)
- g_string_prepend(str, markerText.utf8().data());
- else
- g_string_append(str, markerText.utf8().data());
- }
+ } else if (accObject->isAccessibilityRenderObject()) {
+ GOwnPtr<gchar> rendererText(textForRenderer(accObject->renderer()));
+ g_string_append(str, rendererText.get());
}
return g_string_free(str, FALSE);
diff --git a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
index e4b7d8e..7a13f11 100644
--- a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
+++ b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
@@ -647,7 +647,7 @@ static WebCoreTextMarkerRange* textMarkerRangeFromVisiblePositions(AXObjectCache
if (m_object->supportsARIADropping())
[additional addObject:NSAccessibilityDropEffectsAttribute];
- if (m_object->isDataTable() && static_cast<AccessibilityTable*>(m_object)->supportsSelectedRows())
+ if (m_object->isAccessibilityTable() && static_cast<AccessibilityTable*>(m_object)->supportsSelectedRows())
[additional addObject:NSAccessibilitySelectedRowsAttribute];
if (m_object->supportsARIALiveRegion()) {
@@ -948,7 +948,7 @@ static WebCoreTextMarkerRange* textMarkerRangeFromVisiblePositions(AXObjectCache
else if (m_object->isAnchor() || m_object->isImage() || m_object->isLink())
objectAttributes = anchorAttrs;
- else if (m_object->isDataTable())
+ else if (m_object->isAccessibilityTable())
objectAttributes = tableAttrs;
else if (m_object->isTableColumn())
objectAttributes = tableColAttrs;
@@ -1636,7 +1636,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
}
}
- if (m_object->isDataTable()) {
+ if (m_object->isAccessibilityTable()) {
// TODO: distinguish between visible and non-visible rows
if ([attributeName isEqualToString:NSAccessibilityRowsAttribute] ||
[attributeName isEqualToString:NSAccessibilityVisibleRowsAttribute]) {
@@ -2086,7 +2086,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
if (m_object->isTextControl())
return textParamAttrs;
- if (m_object->isDataTable())
+ if (m_object->isAccessibilityTable())
return tableParamAttrs;
if (m_object->isMenuRelated())
@@ -2247,7 +2247,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
else if ([attributeName isEqualToString:NSAccessibilitySelectedRowsAttribute]) {
AccessibilityObject::AccessibilityChildrenVector selectedRows;
convertToVector(array, selectedRows);
- if (m_object->isTree() || m_object->isDataTable())
+ if (m_object->isTree() || m_object->isAccessibilityTable())
m_object->setSelectedRows(selectedRows);
} else if ([attributeName isEqualToString:NSAccessibilityGrabbedAttribute])
m_object->setARIAGrabbed([number boolValue]);
@@ -2541,7 +2541,7 @@ static RenderObject* rendererForView(NSView* view)
return [self textMarkerForVisiblePosition:visiblePosRange.end];
}
- if (m_object->isDataTable()) {
+ if (m_object->isAccessibilityTable()) {
if ([attribute isEqualToString:NSAccessibilityCellForColumnAndRowParameterizedAttribute]) {
if (array == nil || [array count] != 2)
return nil;
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.h b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
index b572b2c..4a9a420 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.h
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
@@ -139,6 +139,7 @@ public:
static void setSpeechInputEnabled(bool isEnabled) { isSpeechInputEnabled = isEnabled; }
static bool speechInputEnabled() { return isSpeechInputEnabled; }
static bool webkitSpeechEnabled() { return isSpeechInputEnabled; }
+ static bool webkitGrammarEnabled() { return isSpeechInputEnabled; }
#if ENABLE(XHR_RESPONSE_BLOB)
static bool xhrResponseBlobEnabled() { return isXHRResponseBlobEnabled; }
diff --git a/WebCore/bindings/gobject/GNUmakefile.am b/WebCore/bindings/gobject/GNUmakefile.am
index d808e18..338d7f9 100644
--- a/WebCore/bindings/gobject/GNUmakefile.am
+++ b/WebCore/bindings/gobject/GNUmakefile.am
@@ -49,6 +49,8 @@ webkitgtk_gdom_built_sources += \
DerivedSources/webkit/WebKitDOMDOMStringListPrivate.h \
DerivedSources/webkit/WebKitDOMDOMStringMap.cpp \
DerivedSources/webkit/WebKitDOMDOMStringMapPrivate.h \
+ DerivedSources/webkit/WebKitDOMDOMSettableTokenList.cpp \
+ DerivedSources/webkit/WebKitDOMDOMSettableTokenListPrivate.h \
DerivedSources/webkit/WebKitDOMDOMTokenList.cpp \
DerivedSources/webkit/WebKitDOMDOMTokenListPrivate.h \
DerivedSources/webkit/WebKitDOMDOMWindow.cpp \
@@ -263,6 +265,7 @@ webkitgtk_built_h_api += \
DerivedSources/webkit/WebKitDOMDocumentFragment.h \
DerivedSources/webkit/WebKitDOMDocumentType.h \
DerivedSources/webkit/WebKitDOMDOMImplementation.h \
+ DerivedSources/webkit/WebKitDOMDOMSettableTokenList.h \
DerivedSources/webkit/WebKitDOMDOMStringList.h \
DerivedSources/webkit/WebKitDOMDOMStringMap.h \
DerivedSources/webkit/WebKitDOMDOMTokenList.h \
diff --git a/WebCore/bindings/js/JSAudioConstructor.cpp b/WebCore/bindings/js/JSAudioConstructor.cpp
index 5bbaf41..1ea5ae4 100644
--- a/WebCore/bindings/js/JSAudioConstructor.cpp
+++ b/WebCore/bindings/js/JSAudioConstructor.cpp
@@ -43,7 +43,7 @@ JSAudioConstructor::JSAudioConstructor(ExecState* exec, JSDOMGlobalObject* globa
: DOMConstructorWithDocument(JSAudioConstructor::createStructure(globalObject->objectPrototype()), globalObject)
{
putDirect(exec->propertyNames().prototype, JSHTMLAudioElementPrototype::self(exec, globalObject), None);
- putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontDelete | DontEnum);
+ putDirect(exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum);
}
static EncodedJSValue JSC_HOST_CALL constructAudio(ExecState* exec)
diff --git a/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp b/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
index 3b3465e..458ad5b 100644
--- a/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
+++ b/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
@@ -156,7 +156,7 @@ JSValue JSCSSStyleDeclaration::nameGetter(ExecState* exec, JSValue slotBase, con
RefPtr<CSSValue> v = thisObj->impl()->getPropertyCSSValue(prop);
if (v) {
if (pixelOrPos && v->cssValueType() == CSSValue::CSS_PRIMITIVE_VALUE)
- return jsNumber(exec, static_pointer_cast<CSSPrimitiveValue>(v)->getFloatValue(CSSPrimitiveValue::CSS_PX));
+ return jsNumber(static_pointer_cast<CSSPrimitiveValue>(v)->getFloatValue(CSSPrimitiveValue::CSS_PX));
return jsStringOrNull(exec, v->cssText());
}
diff --git a/WebCore/bindings/js/JSCallbackData.cpp b/WebCore/bindings/js/JSCallbackData.cpp
index 6b19639..f39c53c 100644
--- a/WebCore/bindings/js/JSCallbackData.cpp
+++ b/WebCore/bindings/js/JSCallbackData.cpp
@@ -59,7 +59,7 @@ JSValue JSCallbackData::invokeCallback(MarkedArgumentBuffer& args, bool* raisedE
function = callback();
}
- globalObject()->globalData()->timeoutChecker.start();
+ globalObject()->globalData().timeoutChecker.start();
ScriptExecutionContext* context = globalObject()->scriptExecutionContext();
// We will fail to get the context if the frame has been detached.
if (!context)
@@ -68,7 +68,7 @@ JSValue JSCallbackData::invokeCallback(MarkedArgumentBuffer& args, bool* raisedE
JSValue result = context->isDocument()
? JSMainThreadExecState::call(exec, function, callType, callData, callback(), args)
: JSC::call(exec, function, callType, callData, callback(), args);
- globalObject()->globalData()->timeoutChecker.stop();
+ globalObject()->globalData().timeoutChecker.stop();
Document::updateStyleForAllDocuments();
diff --git a/WebCore/bindings/js/JSCoordinatesCustom.cpp b/WebCore/bindings/js/JSCoordinatesCustom.cpp
index 720bb9b..8ef34ad 100644
--- a/WebCore/bindings/js/JSCoordinatesCustom.cpp
+++ b/WebCore/bindings/js/JSCoordinatesCustom.cpp
@@ -32,36 +32,36 @@ using namespace JSC;
namespace WebCore {
-JSValue JSCoordinates::altitude(ExecState* exec) const
+JSValue JSCoordinates::altitude(ExecState*) const
{
Coordinates* imp = impl();
if (!imp->canProvideAltitude())
return jsNull();
- return jsNumber(exec, imp->altitude());
+ return jsNumber(imp->altitude());
}
-JSValue JSCoordinates::altitudeAccuracy(ExecState* exec) const
+JSValue JSCoordinates::altitudeAccuracy(ExecState*) const
{
Coordinates* imp = impl();
if (!imp->canProvideAltitudeAccuracy())
return jsNull();
- return jsNumber(exec, imp->altitudeAccuracy());
+ return jsNumber(imp->altitudeAccuracy());
}
-JSValue JSCoordinates::heading(ExecState* exec) const
+JSValue JSCoordinates::heading(ExecState*) const
{
Coordinates* imp = impl();
if (!imp->canProvideHeading())
return jsNull();
- return jsNumber(exec, imp->heading());
+ return jsNumber(imp->heading());
}
-JSValue JSCoordinates::speed(ExecState* exec) const
+JSValue JSCoordinates::speed(ExecState*) const
{
Coordinates* imp = impl();
if (!imp->canProvideSpeed())
return jsNull();
- return jsNumber(exec, imp->speed());
+ return jsNumber(imp->speed());
}
} // namespace WebCore
diff --git a/WebCore/bindings/js/JSCustomXPathNSResolver.cpp b/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
index 37f2512..e8e1369 100644
--- a/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
+++ b/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
@@ -89,9 +89,9 @@ String JSCustomXPathNSResolver::lookupNamespaceURI(const String& prefix)
MarkedArgumentBuffer args;
args.append(jsString(exec, prefix));
- m_globalObject->globalData()->timeoutChecker.start();
+ m_globalObject->globalData().timeoutChecker.start();
JSValue retval = JSC::call(exec, function, callType, callData, m_customResolver, args);
- m_globalObject->globalData()->timeoutChecker.stop();
+ m_globalObject->globalData().timeoutChecker.stop();
String result;
if (exec->hadException())
diff --git a/WebCore/bindings/js/JSDOMBinding.cpp b/WebCore/bindings/js/JSDOMBinding.cpp
index 72e6d03..e4cff4a 100644
--- a/WebCore/bindings/js/JSDOMBinding.cpp
+++ b/WebCore/bindings/js/JSDOMBinding.cpp
@@ -78,6 +78,11 @@
#include "SQLException.h"
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+#include "FileException.h"
+#include "JSFileException.h"
+#endif
+
using namespace JSC;
namespace WebCore {
@@ -619,6 +624,11 @@ void setDOMException(ExecState* exec, ExceptionCode ec)
errorObject = toJS(exec, globalObject, SQLException::create(description));
break;
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+ case FileExceptionType:
+ errorObject = toJS(exec, globalObject, FileException::create(description));
+ break;
+#endif
}
ASSERT(errorObject);
diff --git a/WebCore/bindings/js/JSDOMWindowCustom.cpp b/WebCore/bindings/js/JSDOMWindowCustom.cpp
index ecb37f3..7119ea6 100644
--- a/WebCore/bindings/js/JSDOMWindowCustom.cpp
+++ b/WebCore/bindings/js/JSDOMWindowCustom.cpp
@@ -910,7 +910,7 @@ JSValue JSDOMWindow::setTimeout(ExecState* exec)
int result = impl()->setTimeout(action.release(), delay, ec);
setDOMException(exec, ec);
- return jsNumber(exec, result);
+ return jsNumber(result);
}
JSValue JSDOMWindow::setInterval(ExecState* exec)
@@ -924,7 +924,7 @@ JSValue JSDOMWindow::setInterval(ExecState* exec)
int result = impl()->setInterval(action.release(), delay, ec);
setDOMException(exec, ec);
- return jsNumber(exec, result);
+ return jsNumber(result);
}
JSValue JSDOMWindow::addEventListener(ExecState* exec)
diff --git a/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp b/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
index f1c1bc0..7bb09a9 100644
--- a/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
+++ b/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
@@ -114,18 +114,18 @@ static PassRefPtr<DeviceMotionData::RotationRate> readRotationRateArgument(JSVal
static JSObject* createAccelerationObject(const DeviceMotionData::Acceleration* acceleration, ExecState* exec)
{
JSObject* object = constructEmptyObject(exec);
- object->putDirect(Identifier(exec, "x"), acceleration->canProvideX() ? jsNumber(exec, acceleration->x()) : jsNull());
- object->putDirect(Identifier(exec, "y"), acceleration->canProvideY() ? jsNumber(exec, acceleration->y()) : jsNull());
- object->putDirect(Identifier(exec, "z"), acceleration->canProvideZ() ? jsNumber(exec, acceleration->z()) : jsNull());
+ object->putDirect(Identifier(exec, "x"), acceleration->canProvideX() ? jsNumber(acceleration->x()) : jsNull());
+ object->putDirect(Identifier(exec, "y"), acceleration->canProvideY() ? jsNumber(acceleration->y()) : jsNull());
+ object->putDirect(Identifier(exec, "z"), acceleration->canProvideZ() ? jsNumber(acceleration->z()) : jsNull());
return object;
}
static JSObject* createRotationRateObject(const DeviceMotionData::RotationRate* rotationRate, ExecState* exec)
{
JSObject* object = constructEmptyObject(exec);
- object->putDirect(Identifier(exec, "alpha"), rotationRate->canProvideAlpha() ? jsNumber(exec, rotationRate->alpha()) : jsNull());
- object->putDirect(Identifier(exec, "beta"), rotationRate->canProvideBeta() ? jsNumber(exec, rotationRate->beta()) : jsNull());
- object->putDirect(Identifier(exec, "gamma"), rotationRate->canProvideGamma() ? jsNumber(exec, rotationRate->gamma()) : jsNull());
+ object->putDirect(Identifier(exec, "alpha"), rotationRate->canProvideAlpha() ? jsNumber(rotationRate->alpha()) : jsNull());
+ object->putDirect(Identifier(exec, "beta"), rotationRate->canProvideBeta() ? jsNumber(rotationRate->beta()) : jsNull());
+ object->putDirect(Identifier(exec, "gamma"), rotationRate->canProvideGamma() ? jsNumber(rotationRate->gamma()) : jsNull());
return object;
}
@@ -158,7 +158,7 @@ JSValue JSDeviceMotionEvent::interval(ExecState* exec) const
DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
if (!imp->deviceMotionData()->canProvideInterval())
return jsNull();
- return jsNumber(exec, imp->deviceMotionData()->interval());
+ return jsNumber(imp->deviceMotionData()->interval());
}
JSValue JSDeviceMotionEvent::initDeviceMotionEvent(ExecState* exec)
diff --git a/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp b/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
index 05f8755..9074a6b 100644
--- a/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
+++ b/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
@@ -40,7 +40,7 @@ JSValue JSDeviceOrientationEvent::alpha(ExecState* exec) const
DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
if (!imp->orientation()->canProvideAlpha())
return jsNull();
- return jsNumber(exec, imp->orientation()->alpha());
+ return jsNumber(imp->orientation()->alpha());
}
JSValue JSDeviceOrientationEvent::beta(ExecState* exec) const
@@ -48,7 +48,7 @@ JSValue JSDeviceOrientationEvent::beta(ExecState* exec) const
DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
if (!imp->orientation()->canProvideBeta())
return jsNull();
- return jsNumber(exec, imp->orientation()->beta());
+ return jsNumber(imp->orientation()->beta());
}
JSValue JSDeviceOrientationEvent::gamma(ExecState* exec) const
@@ -56,7 +56,7 @@ JSValue JSDeviceOrientationEvent::gamma(ExecState* exec) const
DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
if (!imp->orientation()->canProvideGamma())
return jsNull();
- return jsNumber(exec, imp->orientation()->gamma());
+ return jsNumber(imp->orientation()->gamma());
}
JSValue JSDeviceOrientationEvent::initDeviceOrientationEvent(ExecState* exec)
diff --git a/WebCore/bindings/js/JSEventListener.cpp b/WebCore/bindings/js/JSEventListener.cpp
index ceed445..5604374 100644
--- a/WebCore/bindings/js/JSEventListener.cpp
+++ b/WebCore/bindings/js/JSEventListener.cpp
@@ -108,10 +108,10 @@ void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext
Event* savedEvent = globalObject->currentEvent();
globalObject->setCurrentEvent(event);
- JSGlobalData* globalData = globalObject->globalData();
- DynamicGlobalObjectScope globalObjectScope(exec, globalData->dynamicGlobalObject ? globalData->dynamicGlobalObject : globalObject);
+ JSGlobalData& globalData = globalObject->globalData();
+ DynamicGlobalObjectScope globalObjectScope(exec, globalData.dynamicGlobalObject ? globalData.dynamicGlobalObject : globalObject);
- globalData->timeoutChecker.start();
+ globalData.timeoutChecker.start();
JSValue retval;
if (handleEventFunction) {
retval = scriptExecutionContext->isDocument()
@@ -123,7 +123,7 @@ void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext
? JSMainThreadExecState::call(exec, jsFunction, callType, callData, currentTarget, args)
: JSC::call(exec, jsFunction, callType, callData, currentTarget, args);
}
- globalData->timeoutChecker.stop();
+ globalData.timeoutChecker.stop();
globalObject->setCurrentEvent(savedEvent);
diff --git a/WebCore/bindings/js/JSFileReaderCustom.cpp b/WebCore/bindings/js/JSFileReaderCustom.cpp
new file mode 100644
index 0000000..c771b63
--- /dev/null
+++ b/WebCore/bindings/js/JSFileReaderCustom.cpp
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(BLOB)
+
+#include "JSFileReader.h"
+
+#include "ArrayBuffer.h"
+#include "FileReader.h"
+#include "JSArrayBuffer.h"
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSFileReader::result(ExecState* exec) const
+{
+ FileReader* imp = impl();
+ if (imp->readType() == FileReaderLoader::ReadAsArrayBuffer)
+ return toJS(exec, globalObject(), WTF::getPtr(imp->arrayBufferResult()));
+ return jsOwnedStringOrNull(exec, imp->stringResult());
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(BLOB)
diff --git a/WebCore/bindings/js/JSGeolocationCustom.cpp b/WebCore/bindings/js/JSGeolocationCustom.cpp
index bd36df8..1e40f86 100644
--- a/WebCore/bindings/js/JSGeolocationCustom.cpp
+++ b/WebCore/bindings/js/JSGeolocationCustom.cpp
@@ -181,7 +181,7 @@ JSValue JSGeolocation::watchPosition(ExecState* exec)
ASSERT(positionOptions);
int watchID = m_impl->watchPosition(positionCallback.release(), positionErrorCallback.release(), positionOptions.release());
- return jsNumber(exec, watchID);
+ return jsNumber(watchID);
}
} // namespace WebCore
diff --git a/WebCore/bindings/js/JSHTMLInputElementCustom.cpp b/WebCore/bindings/js/JSHTMLInputElementCustom.cpp
index 412a096..171a1f9 100644
--- a/WebCore/bindings/js/JSHTMLInputElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLInputElementCustom.cpp
@@ -39,7 +39,7 @@ JSValue JSHTMLInputElement::selectionStart(ExecState* exec) const
if (!input->canHaveSelection())
return throwTypeError(exec);
- return jsNumber(exec, input->selectionStart());
+ return jsNumber(input->selectionStart());
}
void JSHTMLInputElement::setSelectionStart(ExecState* exec, JSValue value)
@@ -57,7 +57,7 @@ JSValue JSHTMLInputElement::selectionEnd(ExecState* exec) const
if (!input->canHaveSelection())
return throwTypeError(exec);
- return jsNumber(exec, input->selectionEnd());
+ return jsNumber(input->selectionEnd());
}
void JSHTMLInputElement::setSelectionEnd(ExecState* exec, JSValue value)
diff --git a/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp b/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
index 6143c1e..d169bc4 100644
--- a/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
@@ -35,10 +35,10 @@ using namespace JSC;
namespace WebCore {
-JSValue JSHTMLOptionsCollection::length(ExecState* exec) const
+JSValue JSHTMLOptionsCollection::length(ExecState*) const
{
HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl());
- return jsNumber(exec, imp->length());
+ return jsNumber(imp->length());
}
void JSHTMLOptionsCollection::setLength(ExecState* exec, JSValue value)
diff --git a/WebCore/bindings/js/JSIDBKeyCustom.cpp b/WebCore/bindings/js/JSIDBKeyCustom.cpp
index 98c9315..f0faef5 100644
--- a/WebCore/bindings/js/JSIDBKeyCustom.cpp
+++ b/WebCore/bindings/js/JSIDBKeyCustom.cpp
@@ -46,7 +46,7 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject*, IDBKey* key)
case IDBKey::NullType:
return jsNull();
case IDBKey::NumberType:
- return jsNumber(exec, key->number());
+ return jsNumber(key->number());
case IDBKey::StringType:
return jsString(exec, key->string());
// FIXME: Implement dates.
diff --git a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
index ac5225e..818d549 100644
--- a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -95,7 +95,7 @@ ScriptObject InjectedScriptHost::createInjectedScript(const String& source, Scri
MarkedArgumentBuffer args;
args.append(toJS(scriptState, globalObject, this));
args.append(globalThisValue);
- args.append(jsNumber(scriptState, id));
+ args.append(jsNumber(id));
args.append(jsString(scriptState, String("JSC")));
JSValue result = JSC::call(scriptState, functionValue, callType, callData, globalThisValue, args);
if (result.isObject())
@@ -149,7 +149,7 @@ JSValue JSInjectedScriptHost::pushNodePathToFrontend(ExecState* exec)
bool withChildren = exec->argument(1).toBoolean(exec);
bool selectInUI = exec->argument(2).toBoolean(exec);
- return jsNumber(exec, impl()->pushNodePathToFrontend(node, withChildren, selectInUI));
+ return jsNumber(impl()->pushNodePathToFrontend(node, withChildren, selectInUI));
}
#if ENABLE(DATABASE)
diff --git a/WebCore/bindings/js/JSOptionConstructor.cpp b/WebCore/bindings/js/JSOptionConstructor.cpp
index d0a51cd..4ecfe58 100644
--- a/WebCore/bindings/js/JSOptionConstructor.cpp
+++ b/WebCore/bindings/js/JSOptionConstructor.cpp
@@ -39,7 +39,7 @@ JSOptionConstructor::JSOptionConstructor(ExecState* exec, JSDOMGlobalObject* glo
: DOMConstructorWithDocument(JSOptionConstructor::createStructure(globalObject->objectPrototype()), globalObject)
{
putDirect(exec->propertyNames().prototype, JSHTMLOptionElementPrototype::self(exec, globalObject), None);
- putDirect(exec->propertyNames().length, jsNumber(exec, 4), ReadOnly|DontDelete|DontEnum);
+ putDirect(exec->propertyNames().length, jsNumber(4), ReadOnly | DontDelete | DontEnum);
}
static EncodedJSValue JSC_HOST_CALL constructHTMLOptionElement(ExecState* exec)
diff --git a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
index e9a97ed..7274cd0 100644
--- a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
+++ b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
@@ -68,7 +68,7 @@ JSValue JSSQLResultSetRowList::item(ExecState* exec)
jsValue = jsNull();
break;
case SQLValue::NumberValue:
- jsValue = jsNumber(exec, value.number());
+ jsValue = jsNumber(value.number());
break;
default:
ASSERT_NOT_REACHED();
diff --git a/WebCore/bindings/js/JSSVGLengthCustom.cpp b/WebCore/bindings/js/JSSVGLengthCustom.cpp
index c7cfdb0..0cc7c6d 100644
--- a/WebCore/bindings/js/JSSVGLengthCustom.cpp
+++ b/WebCore/bindings/js/JSSVGLengthCustom.cpp
@@ -22,28 +22,24 @@
#if ENABLE(SVG)
#include "JSSVGLength.h"
+#include "SVGAnimatedProperty.h"
+
using namespace JSC;
namespace WebCore {
-JSValue JSSVGLength::value(ExecState* exec) const
+JSValue JSSVGLength::value(ExecState*) const
{
- JSSVGPODTypeWrapper<SVGLength>* imp = impl();
- SVGElement* context = JSSVGContextCache::svgContextForDOMObject(const_cast<JSSVGLength*>(this));
-
- SVGLength podImp(*imp);
- return jsNumber(exec, podImp.value(context));
+ SVGLength& podImp = impl()->propertyReference();
+ return jsNumber(podImp.value(impl()->contextElement()));
}
JSValue JSSVGLength::convertToSpecifiedUnits(ExecState* exec)
{
- JSSVGPODTypeWrapper<SVGLength>* imp = impl();
- SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
-
- SVGLength podImp(*imp);
- podImp.convertToSpecifiedUnits(exec->argument(0).toInt32(exec), context);
+ SVGLength& podImp = impl()->propertyReference();
+ podImp.convertToSpecifiedUnits(exec->argument(0).toInt32(exec), impl()->contextElement());
- imp->commitChange(podImp, this);
+ impl()->commitChange();
return jsUndefined();
}
diff --git a/WebCore/bindings/js/JSSVGPODTypeWrapper.h b/WebCore/bindings/js/JSSVGPODTypeWrapper.h
index 2efc60e..2329365 100644
--- a/WebCore/bindings/js/JSSVGPODTypeWrapper.h
+++ b/WebCore/bindings/js/JSSVGPODTypeWrapper.h
@@ -323,7 +323,7 @@ struct PODTypeWrapperCacheInfoHash {
static unsigned hash(const CacheInfo& info)
{
- return StringImpl::computeHash(reinterpret_cast<const UChar*>(&info), sizeof(CacheInfo) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(CacheInfo)>(&info);
}
static bool equal(const CacheInfo& a, const CacheInfo& b)
diff --git a/WebCore/bindings/js/JSScriptProfileNodeCustom.cpp b/WebCore/bindings/js/JSScriptProfileNodeCustom.cpp
index 127227e..0c2a6a2 100644
--- a/WebCore/bindings/js/JSScriptProfileNodeCustom.cpp
+++ b/WebCore/bindings/js/JSScriptProfileNodeCustom.cpp
@@ -40,9 +40,9 @@ namespace WebCore {
#if ENABLE(JAVASCRIPT_DEBUGGER)
-JSValue JSScriptProfileNode::callUID(ExecState* exec) const
+JSValue JSScriptProfileNode::callUID(ExecState*) const
{
- JSValue result = jsNumber(exec, impl()->callIdentifier().hash());
+ JSValue result = jsNumber(impl()->callIdentifier().hash());
return result;
}
diff --git a/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp b/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
index 4b31659..643ce64 100644
--- a/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
+++ b/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
@@ -81,15 +81,15 @@ static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, const WebG
return constructArray(exec, list);
}
case WebGLGetInfo::kTypeFloat:
- return jsNumber(exec, info.getFloat());
+ return jsNumber(info.getFloat());
case WebGLGetInfo::kTypeLong:
- return jsNumber(exec, info.getLong());
+ return jsNumber(info.getLong());
case WebGLGetInfo::kTypeNull:
return jsNull();
case WebGLGetInfo::kTypeString:
return jsString(exec, info.getString());
case WebGLGetInfo::kTypeUnsignedLong:
- return jsNumber(exec, info.getUnsignedLong());
+ return jsNumber(info.getUnsignedLong());
case WebGLGetInfo::kTypeWebGLBuffer:
return toJS(exec, globalObject, info.getWebGLBuffer());
case WebGLGetInfo::kTypeWebGLFloatArray:
diff --git a/WebCore/bindings/js/JSWorkerContextCustom.cpp b/WebCore/bindings/js/JSWorkerContextCustom.cpp
index b8885cf..8c1caef 100644
--- a/WebCore/bindings/js/JSWorkerContextCustom.cpp
+++ b/WebCore/bindings/js/JSWorkerContextCustom.cpp
@@ -57,7 +57,7 @@ void JSWorkerContext::markChildren(MarkStack& markStack)
{
Base::markChildren(markStack);
- JSGlobalData& globalData = *this->globalData();
+ JSGlobalData& globalData = this->globalData();
markActiveObjectsForContext(markStack, globalData, scriptExecutionContext());
@@ -126,7 +126,7 @@ JSValue JSWorkerContext::setTimeout(ExecState* exec)
if (exec->hadException())
return jsUndefined();
int delay = exec->argument(1).toInt32(exec);
- return jsNumber(exec, impl()->setTimeout(action.release(), delay));
+ return jsNumber(impl()->setTimeout(action.release(), delay));
}
JSValue JSWorkerContext::setInterval(ExecState* exec)
@@ -135,7 +135,7 @@ JSValue JSWorkerContext::setInterval(ExecState* exec)
if (exec->hadException())
return jsUndefined();
int delay = exec->argument(1).toInt32(exec);
- return jsNumber(exec, impl()->setInterval(action.release(), delay));
+ return jsNumber(impl()->setInterval(action.release(), delay));
}
diff --git a/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp b/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp
index ad3f5ec..f7d2b02 100644
--- a/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp
+++ b/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp
@@ -86,16 +86,16 @@ void JSWorkerContextErrorHandler::handleEvent(ScriptExecutionContext* scriptExec
MarkedArgumentBuffer args;
args.append(jsString(exec, errorEvent->message()));
args.append(jsString(exec, errorEvent->filename()));
- args.append(jsNumber(exec, errorEvent->lineno()));
+ args.append(jsNumber(errorEvent->lineno()));
- JSGlobalData* globalData = globalObject->globalData();
- DynamicGlobalObjectScope globalObjectScope(exec, globalData->dynamicGlobalObject ? globalData->dynamicGlobalObject : globalObject);
+ JSGlobalData& globalData = globalObject->globalData();
+ DynamicGlobalObjectScope globalObjectScope(exec, globalData.dynamicGlobalObject ? globalData.dynamicGlobalObject : globalObject);
JSValue thisValue = globalObject->toThisObject(exec);
- globalData->timeoutChecker.start();
+ globalData.timeoutChecker.start();
JSValue returnValue = JSC::call(exec, jsFunction, callType, callData, thisValue, args);
- globalData->timeoutChecker.stop();
+ globalData.timeoutChecker.stop();
globalObject->setCurrentEvent(savedEvent);
diff --git a/WebCore/bindings/js/ScheduledAction.cpp b/WebCore/bindings/js/ScheduledAction.cpp
index a9dc6a8..d6f8a38 100644
--- a/WebCore/bindings/js/ScheduledAction.cpp
+++ b/WebCore/bindings/js/ScheduledAction.cpp
@@ -101,12 +101,12 @@ void ScheduledAction::executeFunctionInContext(JSGlobalObject* globalObject, JSV
for (size_t i = 0; i < size; ++i)
args.append(m_args[i]);
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
if (context->isDocument())
JSMainThreadExecState::call(exec, m_function, callType, callData, thisValue, args);
else
JSC::call(exec, m_function, callType, callData, thisValue, args);
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
if (exec->hadException())
reportCurrentException(exec);
diff --git a/WebCore/bindings/js/ScriptFunctionCall.cpp b/WebCore/bindings/js/ScriptFunctionCall.cpp
index 775e3ad..f77c691 100644
--- a/WebCore/bindings/js/ScriptFunctionCall.cpp
+++ b/WebCore/bindings/js/ScriptFunctionCall.cpp
@@ -82,31 +82,31 @@ void ScriptCallArgumentHandler::appendArgument(JSC::JSValue argument)
void ScriptCallArgumentHandler::appendArgument(long argument)
{
JSLock lock(SilenceAssertionsOnly);
- m_arguments.append(jsNumber(m_exec, argument));
+ m_arguments.append(jsNumber(argument));
}
void ScriptCallArgumentHandler::appendArgument(long long argument)
{
JSLock lock(SilenceAssertionsOnly);
- m_arguments.append(jsNumber(m_exec, argument));
+ m_arguments.append(jsNumber(argument));
}
void ScriptCallArgumentHandler::appendArgument(unsigned int argument)
{
JSLock lock(SilenceAssertionsOnly);
- m_arguments.append(jsNumber(m_exec, argument));
+ m_arguments.append(jsNumber(argument));
}
void ScriptCallArgumentHandler::appendArgument(unsigned long argument)
{
JSLock lock(SilenceAssertionsOnly);
- m_arguments.append(jsNumber(m_exec, argument));
+ m_arguments.append(jsNumber(argument));
}
void ScriptCallArgumentHandler::appendArgument(int argument)
{
JSLock lock(SilenceAssertionsOnly);
- m_arguments.append(jsNumber(m_exec, argument));
+ m_arguments.append(jsNumber(argument));
}
void ScriptCallArgumentHandler::appendArgument(bool argument)
diff --git a/WebCore/bindings/js/SerializedScriptValue.cpp b/WebCore/bindings/js/SerializedScriptValue.cpp
index c9ad0e6..65abd75 100644
--- a/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -1041,12 +1041,12 @@ private:
int32_t i;
if (!read(i))
return JSValue();
- return jsNumber(m_exec, i);
+ return jsNumber(i);
}
case ZeroTag:
- return jsNumber(m_exec, 0);
+ return jsNumber(0);
case OneTag:
- return jsNumber(m_exec, 1);
+ return jsNumber(1);
case FalseTag:
return jsBoolean(false);
case TrueTag:
@@ -1055,7 +1055,7 @@ private:
double d;
if (!read(d))
return JSValue();
- return jsNumber(m_exec, d);
+ return jsNumber(d);
}
case DateTag: {
double d;
diff --git a/WebCore/bindings/js/WorkerScriptController.cpp b/WebCore/bindings/js/WorkerScriptController.cpp
index 6ff8a69..5872b2e 100644
--- a/WebCore/bindings/js/WorkerScriptController.cpp
+++ b/WebCore/bindings/js/WorkerScriptController.cpp
@@ -124,9 +124,9 @@ ScriptValue WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode,
JSLock lock(SilenceAssertionsOnly);
ExecState* exec = m_workerContextWrapper->globalExec();
- m_workerContextWrapper->globalData()->timeoutChecker.start();
+ m_workerContextWrapper->globalData().timeoutChecker.start();
Completion comp = JSC::evaluate(exec, exec->dynamicGlobalObject()->globalScopeChain(), sourceCode.jsSourceCode(), m_workerContextWrapper);
- m_workerContextWrapper->globalData()->timeoutChecker.stop();
+ m_workerContextWrapper->globalData().timeoutChecker.stop();
if (comp.complType() == Normal || comp.complType() == ReturnValue)
return comp.value();
diff --git a/WebCore/bindings/objc/WebScriptObject.mm b/WebCore/bindings/objc/WebScriptObject.mm
index a26c315..6bf7afe 100644
--- a/WebCore/bindings/objc/WebScriptObject.mm
+++ b/WebCore/bindings/objc/WebScriptObject.mm
@@ -304,9 +304,9 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
if (![self _isSafeScript])
return nil;
- [self _rootObject]->globalObject()->globalData()->timeoutChecker.start();
+ [self _rootObject]->globalObject()->globalData().timeoutChecker.start();
JSValue result = JSMainThreadExecState::call(exec, function, callType, callData, [self _imp], argList);
- [self _rootObject]->globalObject()->globalData()->timeoutChecker.stop();
+ [self _rootObject]->globalObject()->globalData().timeoutChecker.stop();
if (exec->hadException()) {
addExceptionToConsole(exec);
@@ -333,9 +333,9 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
JSValue result;
JSLock lock(SilenceAssertionsOnly);
- [self _rootObject]->globalObject()->globalData()->timeoutChecker.start();
+ [self _rootObject]->globalObject()->globalData().timeoutChecker.start();
Completion completion = JSMainThreadExecState::evaluate([self _rootObject]->globalObject()->globalExec(), [self _rootObject]->globalObject()->globalScopeChain(), makeSource(String(script)), JSC::JSValue());
- [self _rootObject]->globalObject()->globalData()->timeoutChecker.stop();
+ [self _rootObject]->globalObject()->globalData().timeoutChecker.stop();
ComplType type = completion.complType();
if (type == Normal) {
diff --git a/WebCore/bindings/scripts/CodeGenerator.pm b/WebCore/bindings/scripts/CodeGenerator.pm
index ec762b6..c4f87f0 100644
--- a/WebCore/bindings/scripts/CodeGenerator.pm
+++ b/WebCore/bindings/scripts/CodeGenerator.pm
@@ -5,6 +5,7 @@
# Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
# Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
+# Copyright (C) Research In Motion Limited 2010. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -42,19 +43,24 @@ my $codeGenerator = 0;
my $verbose = 0;
-my %primitiveTypeHash = ("int" => 1, "short" => 1, "long" => 1, "long long" => 1,
- "unsigned int" => 1, "unsigned short" => 1,
- "unsigned long" => 1, "unsigned long long" => 1,
- "float" => 1, "double" => 1,
- "boolean" => 1, "void" => 1,
- "Date" => 1);
+my %numericTypeHash = ("int" => 1, "short" => 1, "long" => 1, "long long" => 1,
+ "unsigned int" => 1, "unsigned short" => 1,
+ "unsigned long" => 1, "unsigned long long" => 1,
+ "float" => 1, "double" => 1);
+
+my %primitiveTypeHash = ( "boolean" => 1, "void" => 1, "Date" => 1);
my %podTypeHash = ("SVGNumber" => 1, "SVGTransform" => 1);
-my %podTypesWithWritablePropertiesHash = ("SVGAngle" => 1, "SVGLength" => 1, "SVGMatrix" => 1, "SVGPoint" => 1, "SVGPreserveAspectRatio" => 1, "SVGRect" => 1);
+my %podTypesWithWritablePropertiesHash = ("SVGMatrix" => 1, "SVGPoint" => 1, "SVGPreserveAspectRatio" => 1);
my %stringTypeHash = ("DOMString" => 1, "AtomicString" => 1);
my %nonPointerTypeHash = ("DOMTimeStamp" => 1, "CompareHow" => 1, "SVGPaintType" => 1);
+my %svgNewStyleAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1,
+ "SVGAnimatedEnumeration" => 1, "SVGAnimatedInteger" => 1,
+ "SVGAnimatedLength" => 1, "SVGAnimatedLengthList" => 1,
+ "SVGAnimatedRect" => 1);
+
my %svgAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1,
"SVGAnimatedEnumeration" => 1, "SVGAnimatedInteger" => 1,
"SVGAnimatedLength" => 1, "SVGAnimatedLengthList" => 1,
@@ -69,6 +75,13 @@ my %svgAttributesInHTMLHash = ("class" => 1, "id" => 1, "onabort" => 1, "onclick
"onmouseup" => 1, "onresize" => 1, "onscroll" => 1,
"onunload" => 1);
+my %svgNativeType = (
+ "SVGAngle" => "SVGPropertyTearOff<SVGAngle>",
+ "SVGLength" => "SVGPropertyTearOff<SVGLength>",
+ "SVGLengthList" => "SVGListPropertyTearOff<SVGLengthList>",
+ "SVGRect" => "SVGPropertyTearOff<FloatRect>"
+);
+
# Cache of IDL file pathnames.
my $idlFiles;
@@ -281,6 +294,18 @@ sub ParseInterface
}
# Helpers for all CodeGenerator***.pm modules
+
+sub AvoidInclusionOfType
+{
+ my $object = shift;
+ my $type = shift;
+
+ # Special case: SVGRect.h / SVGPoint.h / SVGNumber.h / SVGMatrix.h do not exist.
+ return 1 if $type eq "SVGRect" or $type eq "SVGPoint" or $type eq "SVGNumber" or $type eq "SVGMatrix";
+ return 0;
+}
+
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub IsPodType
{
my $object = shift;
@@ -300,12 +325,22 @@ sub IsPodTypeWithWriteableProperties
return 0;
}
+sub IsNumericType
+{
+ my $object = shift;
+ my $type = shift;
+
+ return 1 if $numericTypeHash{$type};
+ return 0;
+}
+
sub IsPrimitiveType
{
my $object = shift;
my $type = shift;
return 1 if $primitiveTypeHash{$type};
+ return 1 if $numericTypeHash{$type};
return 0;
}
@@ -323,7 +358,52 @@ sub IsNonPointerType
my $object = shift;
my $type = shift;
- return 1 if $nonPointerTypeHash{$type} or $primitiveTypeHash{$type};
+ return 1 if $nonPointerTypeHash{$type} or $primitiveTypeHash{$type} or $numericTypeHash{$type};
+ return 0;
+}
+
+sub IsSVGTypeNeedingTearOff
+{
+ my $object = shift;
+ my $type = shift;
+
+ return 1 if exists $svgNativeType{$type};
+ return 0;
+}
+
+sub GetSVGTypeNeedingTearOff
+{
+ my $object = shift;
+ my $type = shift;
+
+ return $svgNativeType{$type} if exists $svgNativeType{$type};
+ return undef;
+}
+
+sub GetSVGWrappedTypeNeedingTearOff
+{
+ my $object = shift;
+ my $type = shift;
+
+ my $svgNativeType = $object->GetSVGTypeNeedingTearOff($type);
+ return $svgNativeType if not $svgNativeType;
+
+ if ($svgNativeType =~ /SVGPropertyTearOff/) {
+ $svgNativeType =~ s/SVGPropertyTearOff<//;
+ } elsif ($svgNativeType =~ /SVGListPropertyTearOff/) {
+ $svgNativeType =~ s/SVGListPropertyTearOff<//;
+ }
+ $svgNativeType =~ s/>//;
+ return $svgNativeType;
+}
+
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
+sub IsSVGNewStyleAnimatedType
+{
+ my $object = shift;
+ my $type = shift;
+
+ return 1 if $svgNewStyleAnimatedTypeHash{$type};
return 0;
}
diff --git a/WebCore/bindings/scripts/CodeGeneratorGObject.pm b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
index 6a1d115..dd9e3c7 100644
--- a/WebCore/bindings/scripts/CodeGeneratorGObject.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
@@ -796,11 +796,6 @@ sub addIncludeInBody {
}
}
-# Some methods' body (only the body, since the public API can't be
-# conditional) should be guarded by #ifdefs depending on whether
-# certain features in WebKit are enabled.
-my %conditionalMethods = ("webkit_dom_geolocation_clear_watch" => "GEOLOCATION");
-
sub GenerateFunction {
my ($object, $interfaceName, $function, $prefix) = @_;
@@ -879,18 +874,11 @@ sub GenerateFunction {
$functionSig .= ", GError **error";
}
- push(@hBody, "#if ${conditionalString}\n") if $conditionalString;
push(@hBody, "WEBKIT_API $returnType\n$functionName($functionSig);\n");
- push(@hBody, "#endif /* ${conditionalString} */\n") if $conditionalString;
push(@hBody, "\n");
- push(@cBody, "#if ${conditionalString}\n") if $conditionalString;
push(@cBody, "$returnType\n$functionName($functionSig)\n{\n");
- push(@cBody, " WebCore::JSMainThreadNullState state;\n");
-
- if ($conditionalMethods{$functionName}) {
- push(@cBody, "#if ENABLE($conditionalMethods{$functionName})\n");
- }
+ push(@cBody, "#if ${conditionalString}\n") if $conditionalString;
if ($returnType ne "void") {
# TODO: return proper default result
@@ -899,6 +887,8 @@ sub GenerateFunction {
push(@cBody, " g_return_if_fail(self);\n");
}
+ push(@cBody, " WebCore::JSMainThreadNullState state;\n");
+
# The WebKit::core implementations check for NULL already; no need to
# duplicate effort.
push(@cBody, " WebCore::${interfaceName} * item = WebKit::core(self);\n");
@@ -1050,13 +1040,19 @@ EOF
}
}
- if ($conditionalMethods{$functionName}) {
- push(@cBody, "#endif\n");
+ if ($conditionalString) {
+ if ($returnType ne "void") {
+ push(@cBody, "#else\n");
+ if ($codeGenerator->IsNonPointerType($functionSigType)) {
+ push(@cBody, " return static_cast<${returnType}>(0);\n");
+ } else {
+ push(@cBody, " return NULL;\n");
+ }
+ }
+ push(@cBody, "#endif /* ${conditionalString} */\n") if $conditionalString;
}
- push(@cBody, "}\n");
- push(@cBody, "#endif /* ${conditionalString} */\n") if $conditionalString;
- push(@cBody, "\n");
+ push(@cBody, "}\n\n");
}
sub ClassHasFunction {
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index fe29b80..9244bc6 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -227,20 +227,11 @@ sub GetCallbackClassName
return "JS$className";
}
-sub AvoidInclusionOfType
-{
- my $type = shift;
-
- # Special case: SVGRect.h / SVGPoint.h / SVGNumber.h / SVGMatrix.h do not exist.
- return 1 if $type eq "SVGRect" or $type eq "SVGPoint" or $type eq "SVGNumber" or $type eq "SVGMatrix";
- return 0;
-}
-
sub IndexGetterReturnsStrings
{
my $type = shift;
- return 1 if $type eq "CSSStyleDeclaration" or $type eq "MediaList" or $type eq "CSSVariablesDeclaration" or $type eq "DOMStringList" or $type eq "DOMTokenList";
+ return 1 if $type eq "CSSStyleDeclaration" or $type eq "MediaList" or $type eq "CSSVariablesDeclaration" or $type eq "DOMStringList" or $type eq "DOMTokenList" or $type eq "DOMSettableTokenList";
return 0;
}
@@ -251,7 +242,7 @@ sub AddIncludesForType
# When we're finished with the one-file-per-class
# reorganization, we won't need these special cases.
- if ($codeGenerator->IsPrimitiveType($type) or AvoidInclusionOfType($type)
+ if ($codeGenerator->IsPrimitiveType($type) or $codeGenerator->AvoidInclusionOfType($type)
or $type eq "DOMString" or $type eq "DOMObject" or $type eq "Array") {
} elsif ($type =~ /SVGPathSeg/) {
$joinedName = $type;
@@ -284,6 +275,7 @@ sub AddIncludesForType
}
}
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub AddIncludesForSVGAnimatedType
{
my $type = shift;
@@ -324,13 +316,19 @@ sub AddClassForwardIfNeeded
}
}
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub IsSVGTypeNeedingContextParameter
{
+ # FIXME: This function will be removed, as soon the PODType concept is gone, and all SVG datatypes use the new style JS bindings.
+
my $implClassName = shift;
return 0 unless $implClassName =~ /SVG/;
return 0 if $implClassName =~ /Element/;
- my @noContextNeeded = ("SVGPaint", "SVGColor", "SVGDocument", "SVGZoomEvent");
+ return 0 if $codeGenerator->IsSVGNewStyleAnimatedType($implClassName);
+ return 0 if $codeGenerator->IsSVGTypeNeedingTearOff($implClassName);
+
+ my @noContextNeeded = ("SVGColor", "SVGDocument", "SVGPaint", "SVGZoomEvent");
foreach (@noContextNeeded) {
return 0 if $implClassName eq $_;
}
@@ -668,16 +666,24 @@ sub GenerateHeader
}
$headerIncludes{"<runtime/JSObjectWithGlobalObject.h>"} = 1;
-
$headerIncludes{"SVGElement.h"} = 1 if $className =~ /^JSSVG/;
- # Get correct pass/store types respecting PODType flag
- my $podType = $dataNode->extendedAttributes->{"PODType"};
- my $implType = $podType ? "JSSVGPODTypeWrapper<$podType> " : $implClassName;
+ my $implType = $implClassName;
+ my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implType);
+ $implType = $svgNativeType if $svgNativeType;
- $headerIncludes{"$podType.h"} = 1 if $podType and $podType ne "float";
+ # FIXME: Old style SVG JS bindings, will vanish soon.
+ my $podType = $dataNode->extendedAttributes->{"PODType"};
+ if ($podType) {
+ $implType = "JSSVGPODTypeWrapper<$podType> ";
+ $headerIncludes{"$podType.h"} = 1 if $podType ne "float";
+ $headerIncludes{"JSSVGPODTypeWrapper.h"} = 1;
+ }
- $headerIncludes{"JSSVGPODTypeWrapper.h"} = 1 if $podType;
+ my $svgPropertyOrPodType;
+ $svgPropertyOrPodType = $podType if $podType;
+ $svgPropertyOrPodType = $svgPropertyType if $svgPropertyType;
+ $svgPropertyOrPodType = $svgListPropertyType if $svgListPropertyType;
my $numConstants = @{$dataNode->constants};
my $numAttributes = @{$dataNode->attributes};
@@ -685,8 +691,13 @@ sub GenerateHeader
push(@headerContent, "\nnamespace WebCore {\n\n");
- # Implementation class forward declaration
- AddClassForwardIfNeeded($implClassName) unless $podType;
+ if ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName)) {
+ $headerIncludes{"$implClassName.h"} = 1;
+ } else {
+ # Implementation class forward declaration
+ AddClassForwardIfNeeded($implClassName) unless $svgPropertyOrPodType;
+ }
+
AddClassForwardIfNeeded("JSDOMWindowShell") if $interfaceName eq "DOMWindow";
# Class declaration
@@ -875,8 +886,6 @@ sub GenerateHeader
}
if (!$hasParent) {
- # Extra space after JSSVGPODTypeWrapper<> to make RefPtr<Wrapper<> > compile.
- my $implType = $podType ? "JSSVGPODTypeWrapper<$podType> " : $implClassName;
push(@headerContent, " $implType* impl() const { return m_impl.get(); }\n\n");
push(@headerContent, "private:\n");
push(@headerContent, " RefPtr<$implType> m_impl;\n");
@@ -936,7 +945,9 @@ sub GenerateHeader
if (!$hasParent || $dataNode->extendedAttributes->{"GenerateToJS"} || $dataNode->extendedAttributes->{"CustomToJS"}) {
if ($podType) {
- push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, JSSVGPODTypeWrapper<$podType>*, SVGElement*);\n");
+ push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*, SVGElement*);\n");
+ } elsif ($svgPropertyType) {
+ push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n");
} elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*, SVGElement* context);\n");
} else {
@@ -944,12 +955,13 @@ sub GenerateHeader
}
}
if (!$hasParent || $dataNode->extendedAttributes->{"GenerateNativeConverter"}) {
+
if ($podType) {
push(@headerContent, "$podType to${interfaceName}(JSC::JSValue);\n");
} elsif ($interfaceName eq "NodeFilter") {
push(@headerContent, "PassRefPtr<NodeFilter> toNodeFilter(JSC::JSValue);\n");
} else {
- push(@headerContent, "$implClassName* to${interfaceName}(JSC::JSValue);\n");
+ push(@headerContent, "$implType* to${interfaceName}(JSC::JSValue);\n");
}
}
if ($usesToJSNewlyCreated{$interfaceName}) {
@@ -1414,9 +1426,19 @@ sub GenerateImplementation
}
push(@implContent, "};\n\n");
- # Get correct pass/store types respecting PODType flag
+ my $implType = $implClassName;
+ my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implType);
+ $implType = $svgNativeType if $svgNativeType;
+
my $podType = $dataNode->extendedAttributes->{"PODType"};
- my $implType = $podType ? "JSSVGPODTypeWrapper<$podType> " : $implClassName;
+ if ($podType) {
+ $implType = "JSSVGPODTypeWrapper<$podType> ";
+ }
+
+ my $svgPropertyOrPodType;
+ $svgPropertyOrPodType = $podType if $podType;
+ $svgPropertyOrPodType = $svgPropertyType if $svgPropertyType;
+ $svgPropertyOrPodType = $svgListPropertyType if $svgListPropertyType;
# Constructor
if ($interfaceName eq "DOMWindow") {
@@ -1540,7 +1562,7 @@ sub GenerateImplementation
push(@implContent, " ${className}* castedThis = static_cast<$className*>(asObject(slotBase));\n");
my $implClassNameForValueConversion = "";
- if (!$podType and ($codeGenerator->IsSVGAnimatedType($implClassName) or $attribute->type !~ /^readonly/)) {
+ if (!$svgPropertyOrPodType and ($codeGenerator->IsSVGAnimatedType($implClassName) or $attribute->type !~ /^readonly/)) {
$implClassNameForValueConversion = $implClassName;
}
@@ -1592,9 +1614,13 @@ sub GenerateImplementation
push(@implContent, " if (JSValue cachedValue = castedThis->getAnonymousValue(" . $className . "::" . $attribute->signature->name . "Slot))\n");
push(@implContent, " return cachedValue;\n");
}
- if ($podType) {
- push(@implContent, " $podType imp(*castedThis->impl());\n");
- if ($podType eq "float") { # Special case for JSSVGNumber
+
+ if ($svgListPropertyType) {
+ push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "castedThis->impl()->$implGetterFunctionName()", "castedThis") . ";\n");
+ } elsif ($svgPropertyOrPodType) {
+ push(@implContent, " $svgPropertyOrPodType imp(*castedThis->impl());\n") if $podType;
+ push(@implContent, " $svgPropertyOrPodType& imp = castedThis->impl()->propertyReference();\n") if !$podType;
+ if ($svgPropertyOrPodType eq "float") { # Special case for JSSVGNumber
push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp", "castedThis") . ";\n");
} else {
push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp.$implGetterFunctionName()", "castedThis") . ";\n");
@@ -1605,7 +1631,12 @@ sub GenerateImplementation
push(@implContent, " $implClassName* imp = static_cast<$implClassName*>(castedThis->impl());\n");
if ($codeGenerator->IsSVGAnimatedType($type)) {
push(@implContent, " RefPtr<$type> obj = $jsType;\n");
- push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);\n");
+
+ if ($codeGenerator->IsSVGNewStyleAnimatedType($type)) {
+ push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get());\n");
+ } else {
+ push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);\n");
+ }
} else {
push(@implContent, " JSValue result = $jsType;\n");
}
@@ -1616,8 +1647,8 @@ sub GenerateImplementation
} else {
push(@implContent, " ExceptionCode ec = 0;\n");
- if ($podType) {
- push(@implContent, " $podType imp(*castedThis->impl());\n");
+ if ($svgPropertyOrPodType) {
+ push(@implContent, " $svgPropertyOrPodType imp(*castedThis->impl());\n");
push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp.$implGetterFunctionName(ec)", "castedThis") . ";\n");
} else {
push(@implContent, " $implClassName* imp = static_cast<$implClassName*>(castedThis->impl());\n");
@@ -1749,19 +1780,60 @@ sub GenerateImplementation
} else {
push(@implContent, " $className* castedThis = static_cast<$className*>(thisObject);\n");
push(@implContent, " $implType* imp = static_cast<$implType*>(castedThis->impl());\n");
- if ($podType) {
- push(@implContent, " $podType podImp(*imp);\n");
- if ($podType eq "float") { # Special case for JSSVGNumber
- push(@implContent, " podImp = " . JSValueToNative($attribute->signature, "value") . ";\n");
+ push(@implContent, " ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
+
+ # For setters with "StrictTypeChecking", if an input parameter's type does not match the signature,
+ # a TypeError is thrown instead of casting to null.
+ if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"}) {
+ $implIncludes{"<runtime/Error.h>"} = 1;
+
+ my $argType = $attribute->signature->type;
+ if (!IsNativeType($argType)) {
+ push(@implContent, " if (!value.isUndefinedOrNull() && !value.inherits(&JS${argType}::s_info)) {\n");
+ push(@implContent, " throwVMTypeError(exec);\n");
+ push(@implContent, " return;\n");
+ push(@implContent, " };\n");
+ } elsif ($codeGenerator->IsStringType($argType)) {
+ push(@implContent, " if (!value.isUndefinedOrNull() && !value.isString() && !value.isObject()) {\n");
+ push(@implContent, " throwVMTypeError(exec);\n");
+ push(@implContent, " return;\n");
+ push(@implContent, " };\n");
+ } elsif ($codeGenerator->IsNumericType($argType)) {
+ push(@implContent, " if (!value.isUndefinedOrNull() && !value.isNumber() && !value.isBoolean()) {\n");
+ push(@implContent, " throwVMTypeError(exec);\n");
+ push(@implContent, " return;\n");
+ push(@implContent, " };\n");
+ } elsif ($argType eq "boolean") {
+ push(@implContent, " if (!value.isUndefinedOrNull() && !value.isBoolean()) {\n");
+ push(@implContent, " throwVMTypeError(exec);\n");
+ push(@implContent, " return;\n");
+ push(@implContent, " };\n");
+ }
+ }
+
+ my $nativeValue = JSValueToNative($attribute->signature, "value");
+ if ($svgPropertyOrPodType) {
+ push(@implContent, " $svgPropertyOrPodType podImp(*imp);\n") if $podType;
+ push(@implContent, " $svgPropertyOrPodType& podImp = imp->propertyReference();\n") if !$podType;
+ if ($svgPropertyOrPodType eq "float") { # Special case for JSSVGNumber
+ push(@implContent, " podImp = $nativeValue;\n");
} else {
- push(@implContent, " podImp.set$implSetterFunctionName(" . JSValueToNative($attribute->signature, "value") . ");\n");
+ push(@implContent, " podImp.set$implSetterFunctionName($nativeValue");
+ push(@implContent, ", ec") if @{$attribute->setterExceptions};
+ push(@implContent, ");\n");
+ push(@implContent, " setDOMException(exec, ec);\n") if @{$attribute->setterExceptions};
+ }
+ push(@implContent, " imp->commitChange(podImp, castedThis);\n") if $podType;
+ if ($svgPropertyType) {
+ if (@{$attribute->setterExceptions}) {
+ push(@implContent, " if (!ec)\n");
+ push(@implContent, " imp->commitChange();\n");
+ } else {
+ push(@implContent, " imp->commitChange();\n");
+ }
}
- push(@implContent, " imp->commitChange(podImp, castedThis);\n");
} else {
- my $nativeValue = JSValueToNative($attribute->signature, "value");
my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
-
- push(@implContent, " ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
push(@implContent, " imp->$setterExpressionPrefix$nativeValue");
push(@implContent, ", ec") if @{$attribute->setterExceptions};
push(@implContent, ");\n");
@@ -1848,7 +1920,7 @@ sub GenerateImplementation
# classes, we directly forward the calls to JSSVGPODListCustom, which centralizes the otherwise
# duplicated code for the JSSVG*List classes mentioned above.
my $svgPODListType;
- if ($implClassName =~ /SVG.*List/) {
+ if ($implClassName =~ /SVG.*List/ and !$svgListPropertyType) {
$svgPODListType = $implClassName;
$svgPODListType =~ s/List$//;
$svgPODListType = "" unless $codeGenerator->IsPodType($svgPODListType);
@@ -1867,7 +1939,8 @@ sub GenerateImplementation
. ">(castedThis, exec, to" . $svgPODListType . "));\n");
} else {
push(@implContent, " $implType* imp = static_cast<$implType*>(castedThis->impl());\n");
- push(@implContent, " $podType podImp(*imp);\n") if $podType;
+ push(@implContent, " $svgPropertyOrPodType podImp(*imp);\n") if $podType;
+ push(@implContent, " $svgPropertyOrPodType& podImp = imp->propertyReference();\n") if !$podType and $svgPropertyType;
my $numParameters = @{$function->parameters};
@@ -1906,8 +1979,7 @@ sub GenerateImplementation
} else {
my $argsIndex = 0;
my $paramIndex = 0;
- my $functionString = ($podType ? "podImp." : "imp->") . $functionImplementationName . "(";
-
+ my $functionString = (($svgPropertyOrPodType and !$svgListPropertyType) ? "podImp." : "imp->") . $functionImplementationName . "(";
my $hasOptionalArguments = 0;
if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) {
@@ -1948,13 +2020,14 @@ sub GenerateImplementation
$hasOptionalArguments = 1;
}
push(@implContent, " if (argsCount <= $argsIndex) {\n");
- GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 2, $podType, $implClassName);
+ GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 2, $podType, $svgPropertyType, $implClassName);
push(@implContent, " }\n\n");
}
my $name = $parameter->name;
+ my $argType = $codeGenerator->StripModule($parameter->type);
- if ($parameter->type eq "XPathNSResolver") {
+ if ($argType eq "XPathNSResolver") {
push(@implContent, " RefPtr<XPathNSResolver> customResolver;\n");
push(@implContent, " XPathNSResolver* resolver = toXPathNSResolver(exec->argument($argsIndex));\n");
push(@implContent, " if (!resolver) {\n");
@@ -1964,10 +2037,10 @@ sub GenerateImplementation
push(@implContent, " resolver = customResolver.get();\n");
push(@implContent, " }\n");
} elsif ($parameter->extendedAttributes->{"Callback"}) {
- my $callbackClassName = GetCallbackClassName($parameter->type);
+ my $callbackClassName = GetCallbackClassName($argType);
$implIncludes{"$callbackClassName.h"} = 1;
if ($parameter->extendedAttributes->{"Optional"}) {
- push(@implContent, " RefPtr<" . $parameter->type. "> $name;\n");
+ push(@implContent, " RefPtr<$argType> $name;\n");
push(@implContent, " if (exec->argumentCount() > $argsIndex && !exec->argument($argsIndex).isNull() && !exec->argument($argsIndex).isUndefined()) {\n");
push(@implContent, " if (!exec->argument($argsIndex).isObject()) {\n");
push(@implContent, " setDOMException(exec, TYPE_MISMATCH_ERR);\n");
@@ -1980,20 +2053,24 @@ sub GenerateImplementation
push(@implContent, " setDOMException(exec, TYPE_MISMATCH_ERR);\n");
push(@implContent, " return JSValue::encode(jsUndefined());\n");
push(@implContent, " }\n");
- push(@implContent, " RefPtr<" . $parameter->type . "> $name = ${callbackClassName}::create(asObject(exec->argument($argsIndex)), castedThis->globalObject());\n");
+ push(@implContent, " RefPtr<$argType> $name = ${callbackClassName}::create(asObject(exec->argument($argsIndex)), castedThis->globalObject());\n");
}
} else {
# For functions with "StrictTypeChecking", if an input parameter's type does not match the signature,
# a TypeError is thrown instead of casting to null.
if ($function->signature->extendedAttributes->{"StrictTypeChecking"}) {
+ $implIncludes{"<runtime/Error.h>"} = 1;
+
my $argValue = "exec->argument($argsIndex)";
- my $argType = $codeGenerator->StripModule($parameter->type);
if (!IsNativeType($argType)) {
push(@implContent, " if (exec->argumentCount() > $argsIndex && !${argValue}.isUndefinedOrNull() && !${argValue}.inherits(&JS${argType}::s_info))\n");
push(@implContent, " return throwVMTypeError(exec);\n");
} elsif ($codeGenerator->IsStringType($argType)) {
push(@implContent, " if (exec->argumentCount() > $argsIndex && !${argValue}.isUndefinedOrNull() && !${argValue}.isString() && !${argValue}.isObject())\n");
push(@implContent, " return throwVMTypeError(exec);\n");
+ } elsif ($codeGenerator->IsNumericType($argType)) {
+ push(@implContent, " if (exec->argumentCount() > $argsIndex && !${argValue}.isUndefinedOrNull() && !${argValue}.isNumber() && !${argValue}.isBoolean())\n");
+ push(@implContent, " return throwVMTypeError(exec);\n");
}
}
@@ -2012,12 +2089,21 @@ sub GenerateImplementation
# Check if the type conversion succeeded.
push(@implContent, " if (exec->hadException())\n");
push(@implContent, " return JSValue::encode(jsUndefined());\n");
+
+ if ($codeGenerator->IsSVGTypeNeedingTearOff($argType) and not $implClassName =~ /List$/) {
+ push(@implContent, " if (!$name) {\n");
+ push(@implContent, " setDOMException(exec, TYPE_MISMATCH_ERR);\n");
+ push(@implContent, " return JSValue::encode(jsUndefined());\n");
+ push(@implContent, " }\n");
+ }
}
$functionString .= ", " if $paramIndex;
- if ($parameter->type eq "NodeFilter") {
+ if ($argType eq "NodeFilter") {
$functionString .= "$name.get()";
+ } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($argType) and not $implClassName =~ /List$/) {
+ $functionString .= "$name->propertyReference()";
} else {
$functionString .= $name;
}
@@ -2032,7 +2118,7 @@ sub GenerateImplementation
}
push(@implContent, "\n");
- GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " ", $podType, $implClassName);
+ GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " ", $podType, $svgPropertyType, $implClassName);
}
}
push(@implContent, "}\n\n");
@@ -2056,7 +2142,8 @@ sub GenerateImplementation
if ($constant->type eq "DOMString") {
push(@implContent, " return jsStringOrNull(exec, String(" . $constant->value . "));\n");
} else {
- push(@implContent, " return jsNumber(exec, static_cast<int>(" . $constant->value . "));\n");
+ push(@implContent, " UNUSED_PARAM(exec);");
+ push(@implContent, " return jsNumber(static_cast<int>(" . $constant->value . "));\n");
}
push(@implContent, "}\n\n");
}
@@ -2080,9 +2167,9 @@ sub GenerateImplementation
}
if ($dataNode->extendedAttributes->{"HasNumericIndexGetter"}) {
- push(@implContent, "\nJSValue ${className}::getByIndex(ExecState* exec, unsigned index)\n");
+ push(@implContent, "\nJSValue ${className}::getByIndex(ExecState*, unsigned index)\n");
push(@implContent, "{\n");
- push(@implContent, " return jsNumber(exec, static_cast<$implClassName*>(impl())->item(index));\n");
+ push(@implContent, " return jsNumber(static_cast<$implClassName*>(impl())->item(index));\n");
push(@implContent, "}\n");
if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") {
$implIncludes{"JSNode.h"} = 1;
@@ -2091,16 +2178,18 @@ sub GenerateImplementation
}
if ((!$hasParent or $dataNode->extendedAttributes->{"GenerateToJS"}) and !$dataNode->extendedAttributes->{"CustomToJS"}) {
- if ($podType) {
- push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, JSSVGPODTypeWrapper<$podType>* object, SVGElement* context)\n");
- } elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
+ if ($svgPropertyType) {
+ push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* object)\n");
+ } elsif ($podType or IsSVGTypeNeedingContextParameter($implClassName)) {
push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* object, SVGElement* context)\n");
} else {
push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* object)\n");
}
push(@implContent, "{\n");
- if ($podType) {
- push(@implContent, " return getDOMObjectWrapper<$className, JSSVGPODTypeWrapper<$podType> >(exec, globalObject, object, context);\n");
+ if ($svgPropertyType) {
+ push(@implContent, " return getDOMObjectWrapper<$className, $implType>(exec, globalObject, object);\n");
+ } elsif ($podType) {
+ push(@implContent, " return getDOMObjectWrapper<$className, $implType>(exec, globalObject, object, context);\n");
} elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
push(@implContent, " return getDOMObjectWrapper<$className>(exec, globalObject, object, context);\n");
} else {
@@ -2112,18 +2201,15 @@ sub GenerateImplementation
if ((!$hasParent or $dataNode->extendedAttributes->{"GenerateNativeConverter"}) and !$dataNode->extendedAttributes->{"CustomNativeConverter"}) {
if ($podType) {
push(@implContent, "$podType to${interfaceName}(JSC::JSValue value)\n");
+ push(@implContent, "{\n");
+ push(@implContent, " return value.inherits(&${className}::s_info) ? ($podType) *static_cast<$className*>(asObject(value))->impl() : $podType()");
} else {
- push(@implContent, "$implClassName* to${interfaceName}(JSC::JSValue value)\n");
+ push(@implContent, "$implType* to${interfaceName}(JSC::JSValue value)\n");
+ push(@implContent, "{\n");
+ push(@implContent, " return value.inherits(&${className}::s_info) ? static_cast<$className*>(asObject(value))->impl() : 0");
}
- push(@implContent, "{\n");
-
- push(@implContent, " return value.inherits(&${className}::s_info) ? " . ($podType ? "($podType) *" : "") . "static_cast<$className*>(asObject(value))->impl() : ");
- if ($podType and $podType ne "float") {
- push(@implContent, "$podType();\n}\n");
- } else {
- push(@implContent, "0;\n}\n");
- }
+ push(@implContent, ";\n}\n");
}
push(@implContent, "\n}\n");
@@ -2298,6 +2384,7 @@ sub GenerateImplementationFunctionCall()
my $paramIndex = shift;
my $indent = shift;
my $podType = shift;
+ my $svgPropertyType = shift;
my $implClassName = shift;
if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) {
@@ -2316,6 +2403,16 @@ sub GenerateImplementationFunctionCall()
push(@implContent, $indent . "$functionString;\n");
push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions};
push(@implContent, $indent . "imp->commitChange(podImp, castedThis);\n") if $podType;
+
+ if ($svgPropertyType) {
+ if (@{$function->raisesExceptions}) {
+ push(@implContent, $indent . "if (!ec)\n");
+ push(@implContent, $indent . " imp->commitChange();\n");
+ } else {
+ push(@implContent, $indent . "imp->commitChange();\n");
+ }
+ }
+
push(@implContent, $indent . "return JSValue::encode(jsUndefined());\n");
} else {
push(@implContent, "\n" . $indent . "JSC::JSValue result = " . NativeToJSValue($function->signature, 1, $implClassName, "", $functionString, "castedThis") . ";\n");
@@ -2357,8 +2454,6 @@ my %nativeType = (
"NodeFilter" => "RefPtr<NodeFilter>",
"SerializedScriptValue" => "RefPtr<SerializedScriptValue>",
"IDBKey" => "RefPtr<IDBKey>",
- "SVGAngle" => "SVGAngle",
- "SVGLength" => "SVGLength",
"SVGMatrix" => "AffineTransform",
"SVGNumber" => "float",
"SVGPaintType" => "SVGPaint::SVGPaintType",
@@ -2380,12 +2475,44 @@ sub GetNativeType
{
my $type = shift;
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($type);
+ return "${svgNativeType}*" if $svgNativeType;
return $nativeType{$type} if exists $nativeType{$type};
# For all other types, the native type is a pointer with same type name as the IDL type.
return "${type}*";
}
+sub GetSVGPropertyTypes
+{
+ my $implType = shift;
+
+ my $svgPropertyType;
+ my $svgListPropertyType;
+ my $svgNativeType;
+
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $implType =~ /SVG/;
+
+ $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType);
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType;
+
+ # Append space to avoid compilation errors when using PassRefPtr<$svgNativeType>
+ $svgNativeType = "$svgNativeType ";
+
+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType);
+ if ($svgNativeType =~ /SVGPropertyTearOff/) {
+ $svgPropertyType = $svgWrappedNativeType;
+ $headerIncludes{"$svgWrappedNativeType.h"} = 1;
+ $headerIncludes{"SVGAnimatedPropertyTearOff.h"} = 1;
+ } elsif ($svgNativeType =~ /SVGListPropertyTearOff/) {
+ $svgListPropertyType = $svgWrappedNativeType;
+ $headerIncludes{"$svgWrappedNativeType.h"} = 1;
+ $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1;
+ }
+
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType);
+}
+
sub IsNativeType
{
my $type = shift;
@@ -2461,7 +2588,7 @@ sub NativeToJSValue
}
if ($codeGenerator->IsPrimitiveType($type) or $type eq "SVGPaintType" or $type eq "DOMTimeStamp") {
$implIncludes{"<runtime/JSNumberCell.h>"} = 1;
- return "jsNumber(exec, $value)";
+ return "jsNumber($value)";
}
if ($codeGenerator->IsStringType($type)) {
@@ -2509,7 +2636,7 @@ sub NativeToJSValue
} else {
return "toJS(exec, $globalObject, JSSVGDynamicPODTypeWrapperCache<$nativeType, $implClassNameForValueConversion>::lookupOrCreateWrapper(imp, &${implClassNameForValueConversion}::$getter, &${implClassNameForValueConversion}::$setter).get(), JSSVGContextCache::svgContextForDOMObject(castedThis));"
}
- }
+ }
if ($type eq "CSSStyleDeclaration") {
$implIncludes{"CSSMutableStyleDeclaration.h"} = 1;
@@ -2536,7 +2663,7 @@ sub NativeToJSValue
} else {
# Default, include header with same name.
$implIncludes{"JS$type.h"} = 1;
- $implIncludes{"$type.h"} = 1;
+ $implIncludes{"$type.h"} = 1 if not $codeGenerator->AvoidInclusionOfType($type);
}
return $value if $codeGenerator->IsSVGAnimatedType($type);
@@ -2550,6 +2677,13 @@ sub NativeToJSValue
return "toJSNewlyCreated(exec, $globalObject, WTF::getPtr($value))";
}
+ if ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName)) {
+ # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked.
+ $value = "static_cast<" . GetNativeType($type) . ">($value)";
+ } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($type) and not $implClassName =~ /List$/) {
+ $value = $codeGenerator->GetSVGTypeNeedingTearOff($type) . "::create($value)";
+ }
+
return "toJS(exec, $globalObject, WTF::getPtr($value))";
}
@@ -2858,7 +2992,7 @@ sub GenerateConstructorDefinition
} else {
push(@$outputArray, " putDirect(exec->propertyNames().prototype, ${protoClassName}::self(exec, globalObject), DontDelete | ReadOnly);\n");
}
- push(@$outputArray, " putDirect(exec->propertyNames().length, jsNumber(exec, ${numberOfconstructParameters}), ReadOnly | DontDelete | DontEnum);\n") if $numberOfconstructParameters;
+ push(@$outputArray, " putDirect(exec->propertyNames().length, jsNumber(${numberOfconstructParameters}), ReadOnly | DontDelete | DontEnum);\n") if $numberOfconstructParameters;
push(@$outputArray, "}\n\n");
push(@$outputArray, "bool ${constructorClassName}::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)\n");
diff --git a/WebCore/bindings/scripts/CodeGeneratorObjC.pm b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
index 96f0446..8351c87 100644
--- a/WebCore/bindings/scripts/CodeGeneratorObjC.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
@@ -1,4 +1,4 @@
-#
+#
# Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
# Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
# Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
@@ -6,6 +6,7 @@
# Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
# Copyright (C) 2010 Google Inc.
+# Copyright (C) Research In Motion Limited 2010. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -587,15 +588,15 @@ sub AddIncludesForType
return;
}
- if ($codeGenerator->IsSVGAnimatedType($type)) {
- $implIncludes{"DeprecatedSVGAnimatedTemplate.h"} = 1;
+ if ($codeGenerator->IsSVGNewStyleAnimatedType($type)) {
+ $implIncludes{"${type}.h"} = 1;
$implIncludes{"DOM${type}Internal.h"} = 1;
return;
}
- if ($type eq "SVGRect") {
- $implIncludes{"FloatRect.h"} = 1;
- $implIncludes{"DOMSVGRectInternal.h"} = 1;
+ if ($codeGenerator->IsSVGAnimatedType($type)) {
+ $implIncludes{"DeprecatedSVGAnimatedTemplate.h"} = 1;
+ $implIncludes{"DOM${type}Internal.h"} = 1;
return;
}
@@ -651,10 +652,39 @@ sub AddIncludesForType
$implIncludes{"NameNodeList.h"} = 1 if $type eq "NodeList";
# Default, include the same named file (the implementation) and the same name prefixed with "DOM".
- $implIncludes{"$type.h"} = 1;
+ $implIncludes{"$type.h"} = 1 if not $codeGenerator->AvoidInclusionOfType($type);
$implIncludes{"DOM${type}Internal.h"} = 1;
}
+sub GetSVGPropertyTypes
+{
+ my $implType = shift;
+
+ my $svgPropertyType;
+ my $svgListPropertyType;
+ my $svgNativeType;
+
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $implType =~ /SVG/;
+
+ $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType);
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType;
+
+ # Append space to avoid compilation errors when using PassRefPtr<$svgNativeType>
+ $svgNativeType = "WebCore::$svgNativeType ";
+ $svgNativeType =~ s/</\<WebCore::/;
+
+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType);
+ if ($svgNativeType =~ /SVGPropertyTearOff/) {
+ $svgPropertyType = "WebCore::$svgWrappedNativeType";
+ $svgPropertyType =~ s/</\<WebCore::/;
+ } elsif ($svgNativeType =~ /SVGListPropertyTearOff/) {
+ $svgListPropertyType = "WebCore::$svgWrappedNativeType";
+ $svgListPropertyType =~ s/</\<WebCore::/;
+ }
+
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType);
+}
+
sub GenerateHeader
{
my $object = shift;
@@ -967,11 +997,24 @@ sub GenerateHeader
unless ($isProtocol) {
# Generate internal interfaces
my $podType = $dataNode->extendedAttributes->{"PODType"};
+ my $podTypeWithNamespace;
+ my $implClassName = GetImplClassName($interfaceName);
+ my $implClassNameWithNamespace = "WebCore::" . $implClassName;
+
+ my $implType = $implClassNameWithNamespace;
+ my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName);
+ $implType = $svgNativeType if $svgNativeType;
+ if ($podType) {
+ $podTypeWithNamespace = ($podType eq "float") ? "$podType" : "WebCore::$podType";
+ }
+
# Generate interface definitions.
@internalHeaderContent = split("\r", $implementationLicenseTemplate);
push(@internalHeaderContent, "\n#import <WebCore/$className.h>\n\n");
+ push(@internalHeaderContent, "#import <WebCore/SVGAnimatedPropertyTearOff.h>\n\n") if $svgPropertyType;
+ push(@internalHeaderContent, "#import <WebCore/SVGAnimatedListPropertyTearOff.h>\n\n") if $svgListPropertyType;
push(@internalHeaderContent, $interfaceAvailabilityVersionCheck) if length $interfaceAvailabilityVersion;
if ($interfaceName eq "Node") {
@@ -980,9 +1023,9 @@ sub GenerateHeader
my $startedNamespace = 0;
- my $implClassName = GetImplClassName($interfaceName);
-
- if ($codeGenerator->IsSVGAnimatedType($interfaceName)) {
+ if ($codeGenerator->IsSVGNewStyleAnimatedType($interfaceName)) {
+ push(@internalHeaderContent, "#import <WebCore/$implClassName.h>\n\n");
+ } elsif ($codeGenerator->IsSVGAnimatedType($interfaceName)) {
push(@internalHeaderContent, "#import <WebCore/DeprecatedSVGAnimatedTemplate.h>\n\n");
} else {
push(@internalHeaderContent, "namespace WebCore {\n");
@@ -998,27 +1041,15 @@ sub GenerateHeader
}
if ($podType) {
- if ($podType eq "float") {
- push(@internalHeaderContent, "float core($className *);\n");
- } else {
- push(@internalHeaderContent, "WebCore::$podType core($className *);\n");
- }
+ push(@internalHeaderContent, "$podTypeWithNamespace core($className *);\n");
+ push(@internalHeaderContent, "$className *kit($podTypeWithNamespace);\n");
} else {
- push(@internalHeaderContent, "WebCore::$implClassName* core($className *);\n");
- }
-
- if ($podType) {
- if ($podType eq "float") {
- push(@internalHeaderContent, "$className *kit($podType);\n");
- } else {
- push(@internalHeaderContent, "$className *kit(WebCore::$podType);\n");
- }
- } else {
- push(@internalHeaderContent, "$className *kit(WebCore::$implClassName*);\n");
+ push(@internalHeaderContent, "$implType* core($className *);\n");
+ push(@internalHeaderContent, "$className *kit($implType*);\n");
}
if ($dataNode->extendedAttributes->{Polymorphic}) {
- push(@internalHeaderContent, "Class kitClass(WebCore::$implClassName*);\n");
+ push(@internalHeaderContent, "Class kitClass($implType*);\n");
}
if ($interfaceName eq "Node") {
@@ -1053,6 +1084,10 @@ sub GenerateImplementation
my $podType = $dataNode->extendedAttributes->{"PODType"};
my $podTypeWithNamespace;
+ my $implType = $implClassNameWithNamespace;
+
+ my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName);
+ $implType = $svgNativeType if $svgNativeType;
if ($podType) {
$podTypeWithNamespace = ($podType eq "float") ? "$podType" : "WebCore::$podType";
@@ -1086,13 +1121,13 @@ sub GenerateImplementation
$implIncludes{"DOMSVGPathSegInternal.h"} = 1 if $interfaceName =~ /^SVGPathSeg.+/;
- if ($codeGenerator->IsSVGAnimatedType($interfaceName)) {
+ if ($codeGenerator->IsSVGAnimatedType($interfaceName) and !$codeGenerator->IsSVGNewStyleAnimatedType($interfaceName)) {
$implIncludes{"DeprecatedSVGAnimatedTemplate.h"} = 1;
} elsif ($interfaceName =~ /(\w+)(Abs|Rel)$/) {
$implIncludes{"$1.h"} = 1;
} else {
if (!$podType) {
- $implIncludes{"$implClassName.h"} = 1;
+ $implIncludes{"$implClassName.h"} = 1 if not $codeGenerator->AvoidInclusionOfType($implClassName);
} else {
$implIncludes{"$podType.h"} = 1 unless $podType eq "float";
}
@@ -1106,7 +1141,7 @@ sub GenerateImplementation
if ($podType) {
push(@implContent, "#define IMPL reinterpret_cast<$podTypeWithNamespace*>(_internal)\n\n");
} elsif ($parentImplClassName eq "Object") {
- push(@implContent, "#define IMPL reinterpret_cast<$implClassNameWithNamespace*>(_internal)\n\n");
+ push(@implContent, "#define IMPL reinterpret_cast<$implType*>(_internal)\n\n");
} else {
my $baseClassWithNamespace = "WebCore::$baseClass";
push(@implContent, "#define IMPL static_cast<$implClassNameWithNamespace*>(reinterpret_cast<$baseClassWithNamespace*>(_internal))\n\n");
@@ -1196,15 +1231,19 @@ sub GenerateImplementation
my $getterContentHead = "IMPL->$getterExpressionPrefix";
my $getterContentTail = ")";
- # Special case for DOMSVGNumber
- if ($podType and $podType eq "float") {
- $getterContentHead = "*IMPL";
- $getterContentTail = "";
- }
+ if ($svgPropertyType) {
+ $getterContentHead = "$getterExpressionPrefix";
- # TODO: Handle special case for DOMSVGLength
- if ($podType and $podType eq "SVGLength" and $attributeName eq "value") {
- $getterContentHead = "IMPL->value(0 /* FIXME */";
+ # TODO: Handle special case for DOMSVGLength. We do need Custom code support for this.
+ if ($svgPropertyType eq "WebCore::SVGLength" and $attributeName eq "value") {
+ $getterContentHead = "value(0 /* FIXME */";
+ }
+ } else {
+ # Special case for DOMSVGNumber
+ if ($podType and $podType eq "float") {
+ $getterContentHead = "*IMPL";
+ $getterContentTail = "";
+ }
}
my $attributeTypeSansPtr = $attributeType;
@@ -1247,6 +1286,13 @@ sub GenerateImplementation
} elsif ($codeGenerator->IsPodType($idlType) or $idlType eq "Date") {
$getterContentHead = "kit($getterContentHead";
$getterContentTail .= ")";
+ } elsif ($svgPropertyType) {
+ $getterContentHead = "IMPL->propertyReference().$getterContentHead";
+ } elsif ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName) and $codeGenerator->IsSVGTypeNeedingTearOff($idlType)) {
+ my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType);
+ $idlTypeWithNamespace =~ s/</\<WebCore::/;
+ $getterContentHead = "kit(static_cast<$idlTypeWithNamespace*>($getterContentHead)";
+ $getterContentTail .= ")";
} elsif (IsProtocolType($idlType) and $idlType ne "EventTarget") {
$getterContentHead = "kit($getterContentHead";
$getterContentTail .= ")";
@@ -1257,8 +1303,16 @@ sub GenerateImplementation
$getterContentHead = "$getterContentHead";
$getterContentTail .= "->toString()";
} elsif (ConversionNeeded($attribute->signature->type)) {
- $getterContentHead = "kit(WTF::getPtr($getterContentHead";
- $getterContentTail .= "))";
+ if ($codeGenerator->IsSVGTypeNeedingTearOff($attribute->signature->type) and not $implClassName =~ /List$/) {
+ my $idlType = $attribute->signature->type;
+ my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType);
+ $idlTypeWithNamespace =~ s/</\<WebCore::/;
+ $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($getterContentHead";
+ $getterContentTail .= ")))";
+ } else {
+ $getterContentHead = "kit(WTF::getPtr($getterContentHead";
+ $getterContentTail .= "))";
+ }
}
my $getterContent;
@@ -1322,7 +1376,23 @@ sub GenerateImplementation
$arg = "core(" . $arg . ")";
}
- if ($podType) {
+ if ($svgPropertyType) {
+ $getterContentHead = "$getterExpressionPrefix";
+ push(@implContent, " $svgPropertyType& podImpl = IMPL->propertyReference();\n");
+ my $ec = $hasSetterException ? ", ec" : "";
+ push(@implContent, " $exceptionInit\n") if $hasSetterException;
+ push(@implContent, " podImpl.$coreSetterName($arg$ec);\n");
+ if ($hasSetterException) {
+ push(@implContent, " if (!ec)\n");
+ push(@implContent, " IMPL->commitChange();\n");
+ push(@implContent, " $exceptionRaiseOnError\n");
+ } else {
+ push(@implContent, " IMPL->commitChange();\n");
+ }
+ } elsif ($svgListPropertyType) {
+ $getterContentHead = "$getterExpressionPrefix";
+ push(@implContent, " IMPL->$coreSetterName($arg);\n");
+ } elsif ($podType) {
# Special case for DOMSVGNumber
if ($podType eq "float") {
push(@implContent, " *IMPL = $arg;\n");
@@ -1447,10 +1517,48 @@ sub GenerateImplementation
# FIXME! We need [Custom] support for ObjC, to move these hacks into DOMSVGLength/MatrixCustom.mm
my $svgMatrixRotateFromVector = ($podType and $podType eq "AffineTransform" and $functionName eq "rotateFromVector");
my $svgMatrixInverse = ($podType and $podType eq "AffineTransform" and $functionName eq "inverse");
- my $svgLengthConvertToSpecifiedUnits = ($podType and $podType eq "SVGLength" and $functionName eq "convertToSpecifiedUnits");
+ my $svgLengthConvertToSpecifiedUnits = ($svgPropertyType and $svgPropertyType eq "WebCore::SVGLength" and $functionName eq "convertToSpecifiedUnits");
push(@parameterNames, "ec") if $raisesExceptions and !($svgMatrixRotateFromVector || $svgMatrixInverse);
- my $content = $caller . "->" . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")";
+ push(@parameterNames, "0 /* FIXME */") if $svgLengthConvertToSpecifiedUnits;
+
+ # Handle arguments that are 'SVGProperty' based (SVGAngle/SVGLength). We need to convert from SVGPropertyTearOff<Type>* to Type,
+ # to be able to call the desired WebCore function. If the conversion fails, we can't extract Type and need to raise an exception.
+ my $currentParameter = -1;
+ foreach my $param (@{$function->parameters}) {
+ $currentParameter++;
+
+ my $paramName = $param->name;
+ my $idlType = $codeGenerator->StripModule($param->type);
+ next if not $codeGenerator->IsSVGTypeNeedingTearOff($idlType) or $implClassName =~ /List$/;
+
+ my $implGetter = GetObjCTypeGetter($paramName, $idlType);
+ my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType);
+ $idlTypeWithNamespace =~ s/</\<WebCore::/;
+
+ push(@functionContent, " $idlTypeWithNamespace* ${paramName}Core = $implGetter;\n");
+ push(@functionContent, " if (!${paramName}Core) {\n");
+ push(@functionContent, " WebCore::ExceptionCode ec = WebCore::TYPE_MISMATCH_ERR;\n");
+ push(@functionContent, " $exceptionRaiseOnError\n");
+ if ($returnType eq "void") {
+ push(@functionContent, " return;\n");
+ } else {
+ push(@functionContent, " return nil;\n");
+ }
+ push(@functionContent, " }\n");
+
+ # Replace the paramter core() getter, by the cached variable.
+ splice(@parameterNames, $currentParameter, 1, "${paramName}Core->propertyReference()");
+ }
+
+ my $content = $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")";
+
+ if ($svgPropertyType) {
+ push(@functionContent, " $svgPropertyType& podImpl = IMPL->propertyReference();\n");
+ $content = "podImpl.$content;\n IMPL->commitChange()";
+ } else {
+ $content = $caller . "->$content";
+ }
if ($svgMatrixRotateFromVector) {
# Special case with rotateFromVector & SVGMatrix
@@ -1466,8 +1574,6 @@ sub GenerateImplementation
push(@functionContent, " ec = WebCore::SVGException::SVG_MATRIX_NOT_INVERTABLE;\n");
push(@functionContent, " $exceptionRaiseOnError\n");
push(@functionContent, " return kit($content);\n");
- } elsif ($svgLengthConvertToSpecifiedUnits) {
- push(@functionContent, " IMPL->convertToSpecifiedUnits(inUnitType, 0 /* FIXME */);\n");
} elsif ($returnType eq "void") {
# Special case 'void' return type.
if ($raisesExceptions) {
@@ -1496,7 +1602,12 @@ sub GenerateImplementation
$content = "foo";
} else {
if (ConversionNeeded($function->signature->type)) {
- if ($codeGenerator->IsPodType($function->signature->type)) {
+ if ($codeGenerator->IsSVGTypeNeedingTearOff($function->signature->type) and not $implClassName =~ /List$/) {
+ my $idlType = $function->signature->type;
+ my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType);
+ $idlTypeWithNamespace =~ s/</\<WebCore::/;
+ $content = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($content)))";
+ } elsif ($codeGenerator->IsPodType($function->signature->type)) {
$content = "kit($content)";
} else {
$content = "kit(WTF::getPtr($content))";
@@ -1549,30 +1660,28 @@ sub GenerateImplementation
# Generate internal interfaces
if ($podType) {
- my $prefixedPodType = $podType eq "float" ? $podType : "WebCore::$podType";
- push(@implContent, "\n$prefixedPodType core($className *wrapper)\n");
+ push(@implContent, "\n$podTypeWithNamespace core($className *wrapper)\n");
push(@implContent, "{\n");
- push(@implContent, " return wrapper ? *reinterpret_cast<$prefixedPodType*>(wrapper->_internal) : $prefixedPodType();\n");
+ push(@implContent, " return wrapper ? *reinterpret_cast<$podTypeWithNamespace*>(wrapper->_internal) : $podTypeWithNamespace();\n");
push(@implContent, "}\n\n");
} else {
- push(@implContent, "\nWebCore::$implClassName* core($className *wrapper)\n");
+ push(@implContent, "\n$implType* core($className *wrapper)\n");
push(@implContent, "{\n");
- push(@implContent, " return wrapper ? reinterpret_cast<WebCore::$implClassName*>(wrapper->_internal) : 0;\n");
+ push(@implContent, " return wrapper ? reinterpret_cast<$implType*>(wrapper->_internal) : 0;\n");
push(@implContent, "}\n\n");
}
if ($podType) {
# FIXME: Implement caching.
- my $prefixedPodType = $podType eq "float" ? $podType : "WebCore::$podType";
- push(@implContent, "$className *kit($prefixedPodType value)\n");
+ push(@implContent, "$className *kit($podTypeWithNamespace value)\n");
push(@implContent, "{\n");
push(@implContent, " $assertMainThread;\n");
push(@implContent, " $className *wrapper = [[$className alloc] _init];\n");
- push(@implContent, " wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(new $prefixedPodType(value));\n");
+ push(@implContent, " wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(new $podTypeWithNamespace(value));\n");
push(@implContent, " return [wrapper autorelease];\n");
push(@implContent, "}\n");
} elsif ($parentImplClassName eq "Object") {
- push(@implContent, "$className *kit(WebCore::$implClassName* value)\n");
+ push(@implContent, "$className *kit($implType* value)\n");
push(@implContent, "{\n");
push(@implContent, " $assertMainThread;\n");
push(@implContent, " if (!value)\n");
@@ -1592,7 +1701,7 @@ sub GenerateImplementation
push(@implContent, " return [wrapper autorelease];\n");
push(@implContent, "}\n");
} else {
- push(@implContent, "$className *kit(WebCore::$implClassName* value)\n");
+ push(@implContent, "$className *kit($implType* value)\n");
push(@implContent, "{\n");
push(@implContent, " $assertMainThread;\n");
push(@implContent, " return static_cast<$className*>(kit(static_cast<WebCore::$baseClass*>(value)));\n");
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 91ffeaa..8cbd63d 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -6,6 +6,7 @@
# Copyright (C) 2006 Apple Computer, Inc.
# Copyright (C) 2007, 2008, 2009 Google Inc.
# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
+# Copyright (C) Research In Motion Limited 2010. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -87,6 +88,7 @@ sub finish
}
# Workaround for V8 bindings difference where RGBColor is not a POD type.
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub IsPodType
{
my $type = shift;
@@ -179,6 +181,8 @@ sub AddIncludesForType
sub AddIncludesForSVGAnimatedType
{
my $type = shift;
+ return if $codeGenerator->IsSVGNewStyleAnimatedType($type);
+
$type =~ s/SVGAnimated//;
if ($type eq "Point" or $type eq "Rect") {
@@ -208,6 +212,34 @@ sub GenerateConditionalString
}
}
+sub GetSVGPropertyTypes
+{
+ my $implType = shift;
+
+ my $svgPropertyType;
+ my $svgListPropertyType;
+ my $svgNativeType;
+
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $implType =~ /SVG/;
+
+ $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType);
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType;
+
+ # Append space to avoid compilation errors when using PassRefPtr<$svgNativeType>
+ $svgNativeType = "$svgNativeType ";
+
+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType);
+ if ($svgNativeType =~ /SVGPropertyTearOff/) {
+ $svgPropertyType = $svgWrappedNativeType;
+ $implIncludes{"SVGAnimatedPropertyTearOff.h"} = 1,
+ } elsif ($svgNativeType =~ /SVGListPropertyTearOff/) {
+ $svgListPropertyType = $svgWrappedNativeType;
+ $implIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1,
+ }
+
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType);
+}
+
sub GenerateHeader
{
my $object = shift;
@@ -225,8 +257,6 @@ sub GenerateHeader
# - Add default header template
push(@headerContent, GenerateHeaderContentHeader($dataNode));
-
- # Get correct pass/store types respecting PODType flag
my $podType = $dataNode->extendedAttributes->{"PODType"};
my %headerInclues = ();
@@ -234,9 +264,12 @@ sub GenerateHeader
$headerIncludes{"wtf/text/StringHash.h"} = 1;
$headerIncludes{"WrapperTypeInfo.h"} = 1;
$headerIncludes{"V8DOMWrapper.h"} = 1;
+
my $headerClassInclude = GetHeaderClassInclude($implClassName);
$headerIncludes{$headerClassInclude} = 1 if $headerClassInclude ne "";
+ my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName);
+
foreach my $headerInclude (sort keys(%headerIncludes)) {
push(@headerContent, "#include \"${headerInclude}\"\n");
}
@@ -245,16 +278,12 @@ sub GenerateHeader
push(@headerContent, "#include <wtf/HashMap.h>\n");
push(@headerContent, "\nnamespace WebCore {\n");
- if ($podType) {
- push(@headerContent, "\ntemplate<typename PODType> class V8SVGPODTypeWrapper;\n");
- }
+ push(@headerContent, "\ntemplate<typename PODType> class V8SVGPODTypeWrapper;\n") if $podType;
+ push(@headerContent, "\ntemplate<typename PropertyType> class SVGPropertyTearOff;\n") if $svgPropertyType;
+ push(@headerContent, "\ntemplate<typename PropertyType> class SVGListPropertyTearOff;\n") if $svgListPropertyType;
push(@headerContent, "\nclass $className {\n");
- my $nativeType = GetNativeTypeForConversions($interfaceName);
- if ($podType) {
- $nativeType = "V8SVGPODTypeWrapper<${nativeType} >";
- }
-
+ my $nativeType = GetNativeTypeForConversions($dataNode, $interfaceName);
my $domMapFunction = GetDomMapFunction($dataNode, $interfaceName);
my $forceNewObjectParameter = IsDOMNodeType($interfaceName) ? ", bool forceNewObject = false" : "";
my $forceNewObjectInput = IsDOMNodeType($interfaceName) ? ", bool forceNewObject" : "";
@@ -450,7 +479,7 @@ sub GetHeaderClassInclude
$className =~ s/Abs|Rel//;
}
return "" if (AvoidInclusionOfType($className));
- return "DeprecatedSVGAnimatedTemplate.h" if ($codeGenerator->IsSVGAnimatedType($className));
+ return "DeprecatedSVGAnimatedTemplate.h" if $codeGenerator->IsSVGAnimatedType($className) and !$codeGenerator->IsSVGNewStyleAnimatedType($className);
return "${className}.h";
}
@@ -693,18 +722,13 @@ sub GenerateNormalAttrGetter
$skipContext = 1;
}
- # Special case: SVGSVGEelement::viewport is read-only
- if (($implClassName eq "SVGSVGElement") and ($attrName eq "viewport")) {
- $attrIsPodType = 0;
- $skipContext = 1;
- }
-
# Special case for SVGColor
if (($implClassName eq "SVGColor") and ($attrName eq "rgbColor")) {
$attrIsPodType = 0;
}
my $getterStringUsesImp = $implClassName ne "float";
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implClassName);
# Getter
my $conditionalString = GenerateConditionalString($attribute->signature);
@@ -726,7 +750,19 @@ END
$implClassName* imp = &impInstance;
END
}
-
+ } elsif ($svgNativeType) {
+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName);
+ if ($svgWrappedNativeType =~ /List$/) {
+ push(@implContentDecls, <<END);
+ $svgNativeType* imp = V8${implClassName}::toNative(info.Holder());
+END
+ } else {
+ push(@implContentDecls, <<END);
+ $svgNativeType* wrapper = V8${implClassName}::toNative(info.Holder());
+ $svgWrappedNativeType& impInstance = wrapper->propertyReference();
+ $svgWrappedNativeType* imp = &impInstance;
+END
+ }
} elsif ($attrExt->{"v8OnProto"} || $attrExt->{"V8DisallowShadowing"}) {
if ($interfaceName eq "DOMWindow") {
push(@implContentDecls, <<END);
@@ -883,7 +919,16 @@ END
}
}
- if ($attrIsPodType) {
+ if ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName) and $codeGenerator->IsSVGTypeNeedingTearOff($attrType)) {
+ $implIncludes{"V8$attrType.h"} = 1;
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType);
+ # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked.
+ push(@implContentDecls, " return toV8(static_cast<$svgNativeType*>($result));\n");
+ } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($attrType) and not $implClassName =~ /List$/) {
+ $implIncludes{"V8$attrType.h"} = 1;
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType);
+ push(@implContentDecls, " return toV8(WTF::getPtr(${svgNativeType}::create($result)));\n");
+ } elsif ($attrIsPodType) {
$implIncludes{"V8${attrType}.h"} = 1;
push(@implContentDecls, " return toV8(wrapper.release().get());\n");
} else {
@@ -911,7 +956,35 @@ sub GenerateNormalAttrSetter
push(@implContentDecls, "static void ${attrName}AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)\n{\n");
push(@implContentDecls, " INC_STATS(\"DOM.$implClassName.$attrName._set\");\n");
+ # For functions with "StrictTypeChecking", if an input parameter's type does not match the signature,
+ # a TypeError is thrown instead of casting to null.
+ if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"}) {
+ my $argType = GetTypeFromSignature($attribute->signature);
+ if (IsWrapperType($argType)) {
+ push(@implContentDecls, " if (!isUndefinedOrNull(value) && !V8${argType}::HasInstance(value)) {\n");
+ push(@implContentDecls, " V8Proxy::throwTypeError();\n");
+ push(@implContentDecls, " return;\n");
+ push(@implContentDecls, " }\n");
+ } elsif ($codeGenerator->IsStringType($argType)) {
+ push(@implContentDecls, " if (!isUndefinedOrNull(value) && !value->IsString() && !value->IsObject()) {\n");
+ push(@implContentDecls, " V8Proxy::throwTypeError();\n");
+ push(@implContentDecls, " return;\n");
+ push(@implContentDecls, " }\n");
+ } elsif ($codeGenerator->IsNumericType($argType)) {
+ push(@implContentDecls, " if (!isUndefinedOrNull(value) && !value->IsNumber() && !value->IsBoolean()) {\n");
+ push(@implContentDecls, " V8Proxy::throwTypeError();\n");
+ push(@implContentDecls, " return;\n");
+ push(@implContentDecls, " }\n");
+ } elsif ($argType eq "boolean") {
+ push(@implContentDecls, " if (!isUndefinedOrNull(value) && !value->IsBoolean()) {\n");
+ push(@implContentDecls, " V8Proxy::throwTypeError();\n");
+ push(@implContentDecls, " return;\n");
+ push(@implContentDecls, " }\n");
+ }
+ }
+
my $isPodType = IsPodType($implClassName);
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implClassName);
if ($isPodType) {
$implClassName = GetNativeType($implClassName);
@@ -919,7 +992,19 @@ sub GenerateNormalAttrSetter
push(@implContentDecls, " V8SVGPODTypeWrapper<$implClassName>* wrapper = V8SVGPODTypeWrapper<$implClassName>::toNative(info.Holder());\n");
push(@implContentDecls, " $implClassName impInstance = *wrapper;\n");
push(@implContentDecls, " $implClassName* imp = &impInstance;\n");
-
+ } elsif ($svgNativeType) {
+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName);
+ if ($svgWrappedNativeType =~ /List$/) {
+ push(@implContentDecls, <<END);
+ $svgNativeType* imp = V8${implClassName}::toNative(info.Holder());
+END
+ } else {
+ push(@implContentDecls, <<END);
+ $svgNativeType* wrapper = V8${implClassName}::toNative(info.Holder());
+ $svgWrappedNativeType& impInstance = wrapper->propertyReference();
+ $svgWrappedNativeType* imp = &impInstance;
+END
+ }
} elsif ($attrExt->{"v8OnProto"}) {
if ($interfaceName eq "DOMWindow") {
push(@implContentDecls, <<END);
@@ -1013,6 +1098,13 @@ END
if ($isPodType) {
push(@implContentDecls, " wrapper->commitChange(*imp, V8Proxy::svgContext(wrapper));\n");
+ } elsif ($svgNativeType) {
+ if ($useExceptions) {
+ push(@implContentDecls, " if (!ec)\n");
+ push(@implContentDecls, " wrapper->commitChange();\n");
+ } else {
+ push(@implContentDecls, " wrapper->commitChange();\n");
+ }
} elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
$implIncludes{"SVGElement.h"} = 1;
@@ -1024,7 +1116,7 @@ END
push(@implContentDecls, " if (SVGElement* context = V8Proxy::svgContext($currentObject))\n");
push(@implContentDecls, " context->svgAttributeChanged(imp->associatedAttributeName());\n");
}
-
+
push(@implContentDecls, " return;\n");
push(@implContentDecls, "}\n\n"); # end of setter
push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString;
@@ -1213,11 +1305,23 @@ END
}
}
+ my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName);
+
if (IsPodType($implClassName)) {
my $nativeClassName = GetNativeType($implClassName);
push(@implContentDecls, " V8SVGPODTypeWrapper<$nativeClassName>* impWrapper = V8SVGPODTypeWrapper<$nativeClassName>::toNative(args.Holder());\n");
push(@implContentDecls, " $nativeClassName impInstance = *impWrapper;\n");
push(@implContentDecls, " $nativeClassName* imp = &impInstance;\n");
+ } elsif ($svgNativeType) {
+ my $nativeClassName = GetNativeType($implClassName);
+ if ($implClassName =~ /List$/) {
+ push(@implContentDecls, " $nativeClassName imp = V8${svgListPropertyType}::toNative(args.Holder());\n");
+ } else {
+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName);
+ push(@implContentDecls, " $nativeClassName wrapper = V8${svgPropertyType}::toNative(args.Holder());\n");
+ push(@implContentDecls, " $svgWrappedNativeType& impInstance = wrapper->propertyReference();\n");
+ push(@implContentDecls, " $svgWrappedNativeType* imp = &impInstance;\n");
+ }
} elsif (!$function->signature->extendedAttributes->{"ClassMethod"}) {
push(@implContentDecls, <<END);
${implClassName}* imp = V8${implClassName}::toNative(args.Holder());
@@ -1338,6 +1442,11 @@ END
push(@implContentDecls, " V8Proxy::throwTypeError();\n");
push(@implContentDecls, " return notHandledByInterceptor();\n");
push(@implContentDecls, " }\n");
+ } elsif ($codeGenerator->IsNumericType($argType)) {
+ push(@implContentDecls, " if (args.Length() > $paramIndex && !isUndefinedOrNull($argValue) && !${argValue}->IsNumber() && !${argValue}->IsBoolean()) {\n");
+ push(@implContentDecls, " V8Proxy::throwTypeError();\n");
+ push(@implContentDecls, " return notHandledByInterceptor();\n");
+ push(@implContentDecls, " }\n");
}
}
push(@implContentDecls, " EXCEPTION_BLOCK($nativeType, $parameterName, " .
@@ -2130,10 +2239,7 @@ END
END
}
- my $nativeType = GetNativeTypeForConversions($interfaceName);
- if ($dataNode->extendedAttributes->{"PODType"}) {
- $nativeType = "V8SVGPODTypeWrapper<${nativeType}>";
- }
+ my $nativeType = GetNativeTypeForConversions($dataNode, $interfaceName);
push(@implContent, <<END);
// Custom toString template
@@ -2538,7 +2644,7 @@ sub GetDomMapFunction
return "getDOMSVGElementInstanceMap()" if $type eq "SVGElementInstance";
return "getDOMNodeMap()" if ($dataNode && IsNodeSubType($dataNode));
# Only use getDOMSVGObjectWithContextMap() for non-node svg objects
- return "getDOMSVGObjectWithContextMap()" if $type =~ /SVG/;
+ return "getDOMSVGObjectWithContextMap()" if $type =~ /SVG/ and $type ne "SVGLength" and $type ne "SVGLengthList" and not $codeGenerator->IsSVGNewStyleAnimatedType($type);
return "" if $type eq "DOMImplementation";
return "getActiveDOMObjectMap()" if IsActiveDomType($type);
return "getDOMObjectMap()";
@@ -2562,11 +2668,14 @@ sub IsActiveDomType
sub GetNativeTypeForConversions
{
+ my $dataNode = shift;
my $type = shift;
- return "FloatRect" if $type eq "SVGRect";
- return "FloatPoint" if $type eq "SVGPoint";
- return "AffineTransform" if $type eq "SVGMatrix";
- return "float" if $type eq "SVGNumber";
+
+ $type = "FloatPoint" if $type eq "SVGPoint";
+ $type = "AffineTransform" if $type eq "SVGMatrix";
+ $type = "float" if $type eq "SVGNumber";
+ $type = "V8SVGPODTypeWrapper<$type>" if $dataNode->extendedAttributes->{"PODType"};
+ $type = $codeGenerator->GetSVGTypeNeedingTearOff($type) if $codeGenerator->IsSVGTypeNeedingTearOff($type);
return $type;
}
@@ -2584,6 +2693,9 @@ sub GenerateFunctionCallString()
my $nativeReturnType = GetNativeType($returnType, 0);
my $result = "";
+ my $isSVGTearOffType = ($codeGenerator->IsSVGTypeNeedingTearOff($returnType) and not $implClassName =~ /List$/);
+ $nativeReturnType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($returnType) if $isSVGTearOffType;
+
# Special case: SVG matrix transform methods should not mutate
# the matrix but return a copy
my $copyFirst = 0;
@@ -2660,6 +2772,12 @@ sub GenerateFunctionCallString()
if ($parameter->type eq "NodeFilter" || $parameter->type eq "XPathNSResolver") {
$functionString .= "$paramName.get()";
+ } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($parameter->type) and not $implClassName =~ /List$/) {
+ $functionString .= "$paramName->propertyReference()";
+ $result .= $indent . "if (!$paramName) {\n";
+ $result .= $indent . " V8Proxy::setDOMException(WebCore::TYPE_MISMATCH_ERR);\n";
+ $result .= $indent . " return v8::Handle<v8::Value>();\n";
+ $result .= $indent . "}\n";
} else {
$functionString .= $paramName;
}
@@ -2725,6 +2843,14 @@ sub GenerateFunctionCallString()
$return = "wrapper";
}
+ if ($isSVGTearOffType) {
+ $implIncludes{"V8$returnType.h"} = 1;
+ $implIncludes{"SVGPropertyTearOff.h"} = 1;
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($returnType);
+ $result .= $indent . "return toV8(WTF::getPtr(${svgNativeType}::create($return)));\n";
+ return $result;
+ }
+
my $generatedSVGContextRetrieval = 0;
# If the return type needs an SVG context, output it
if (IsSVGTypeNeedingContextParameter($returnType)) {
@@ -2750,6 +2876,8 @@ sub GenerateFunctionCallString()
}
$result .= $indent . "impWrapper->commitChange(impInstance, context);\n";
+ } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($implClassName) and not $implClassName =~ /List$/) {
+ $result .= $indent . "wrapper->commitChange();\n";
}
if ($returnsPodType) {
@@ -2824,6 +2952,15 @@ sub GetNativeType
my $type = shift;
my $isParameter = shift;
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($type);
+ if ($svgNativeType) {
+ if ($svgNativeType =~ /List$/) {
+ return "${svgNativeType}*";
+ } else {
+ return "RefPtr<${svgNativeType} >";
+ }
+ }
+
if ($type eq "float" or $type eq "double") {
return $type;
}
@@ -2838,12 +2975,9 @@ sub GetNativeType
return "bool" if $type eq "boolean";
return "String" if $type eq "DOMString";
return "Range::CompareHow" if $type eq "CompareHow";
- return "FloatRect" if $type eq "SVGRect";
return "FloatPoint" if $type eq "SVGPoint";
return "AffineTransform" if $type eq "SVGMatrix";
return "SVGTransform" if $type eq "SVGTransform";
- return "SVGLength" if $type eq "SVGLength";
- return "SVGAngle" if $type eq "SVGAngle";
return "float" if $type eq "SVGNumber";
return "SVGPreserveAspectRatio" if $type eq "SVGPreserveAspectRatio";
return "SVGPaint::SVGPaintType" if $type eq "SVGPaintType";
@@ -2895,12 +3029,9 @@ sub BasicTypeCanFailConversion
my $signature = shift;
my $type = GetTypeFromSignature($signature);
- return 1 if $type eq "SVGAngle";
- return 1 if $type eq "SVGLength";
return 1 if $type eq "SVGMatrix";
return 1 if $type eq "SVGPoint";
return 1 if $type eq "SVGPreserveAspectRatio";
- return 1 if $type eq "SVGRect";
return 1 if $type eq "SVGTransform";
return 0;
}
@@ -2914,6 +3045,7 @@ sub TypeCanFailConversion
$implIncludes{"ExceptionCode.h"} = 1 if $type eq "Attr";
return 1 if $type eq "Attr";
return 1 if $type eq "VoidCallback";
+ return 1 if $type eq "IDBKey";
return BasicTypeCanFailConversion($signature);
}
@@ -3220,6 +3352,7 @@ sub ReturnNativeToJSValue
return "return toV8($value)";
}
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub GenerateSVGStaticPodTypeWrapper {
my $type = shift;
my $value = shift;
@@ -3274,17 +3407,24 @@ sub WriteData
}
}
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub IsSVGTypeNeedingContextParameter
{
my $implClassName = shift;
- if ($implClassName =~ /SVG/ and not $implClassName =~ /Element/) {
- return 1 unless $implClassName =~ /SVGPaint/ or $implClassName =~ /SVGColor/ or $implClassName =~ /SVGDocument/;
- }
+ return 0 unless $implClassName =~ /SVG/;
+ return 0 if $implClassName =~ /Element/;
+ return 0 if $codeGenerator->IsSVGNewStyleAnimatedType($implClassName);
+ return 0 if $codeGenerator->IsSVGTypeNeedingTearOff($implClassName);
- return 0;
+ my @noContextNeeded = ("SVGColor", "SVGDocument", "SVGPaintType", "SVGPaint", "SVGZoomEvent");
+ foreach (@noContextNeeded) {
+ return 0 if $implClassName eq $_;
+ }
+ return 1;
}
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub GenerateSVGContextAssignment
{
my $srcType = shift;
@@ -3297,6 +3437,7 @@ sub GenerateSVGContextAssignment
return $result;
}
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub GenerateSVGContextRetrieval
{
my $srcType = shift;
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp
new file mode 100644
index 0000000..7543fc4
--- /dev/null
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp
@@ -0,0 +1,92 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebDOMTestMediaQueryListListener.h"
+
+#include "MediaQueryListListener.h"
+#include "TestMediaQueryListListener.h"
+#include "WebDOMMediaQueryListListener.h"
+#include "WebExceptionHandler.h"
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+
+struct WebDOMTestMediaQueryListListener::WebDOMTestMediaQueryListListenerPrivate {
+ WebDOMTestMediaQueryListListenerPrivate(WebCore::TestMediaQueryListListener* object = 0)
+ : impl(object)
+ {
+ }
+
+ RefPtr<WebCore::TestMediaQueryListListener> impl;
+};
+
+WebDOMTestMediaQueryListListener::WebDOMTestMediaQueryListListener()
+ : WebDOMObject()
+ , m_impl(0)
+{
+}
+
+WebDOMTestMediaQueryListListener::WebDOMTestMediaQueryListListener(WebCore::TestMediaQueryListListener* impl)
+ : WebDOMObject()
+ , m_impl(new WebDOMTestMediaQueryListListenerPrivate(impl))
+{
+}
+
+WebDOMTestMediaQueryListListener::WebDOMTestMediaQueryListListener(const WebDOMTestMediaQueryListListener& copy)
+ : WebDOMObject()
+{
+ m_impl = copy.impl() ? new WebDOMTestMediaQueryListListenerPrivate(copy.impl()) : 0;
+}
+
+WebDOMTestMediaQueryListListener& WebDOMTestMediaQueryListListener::operator=(const WebDOMTestMediaQueryListListener& copy)
+{
+ delete m_impl;
+ m_impl = copy.impl() ? new WebDOMTestMediaQueryListListenerPrivate(copy.impl()) : 0;
+ return *this;
+}
+
+WebCore::TestMediaQueryListListener* WebDOMTestMediaQueryListListener::impl() const
+{
+ return m_impl ? m_impl->impl.get() : 0;
+}
+
+WebDOMTestMediaQueryListListener::~WebDOMTestMediaQueryListListener()
+{
+ delete m_impl;
+ m_impl = 0;
+}
+
+void WebDOMTestMediaQueryListListener::method(const WebDOMMediaQueryListListener& listener)
+{
+ if (!impl())
+ return;
+
+ impl()->method(toWebCore(listener));
+}
+
+WebCore::TestMediaQueryListListener* toWebCore(const WebDOMTestMediaQueryListListener& wrapper)
+{
+ return wrapper.impl();
+}
+
+WebDOMTestMediaQueryListListener toWebKit(WebCore::TestMediaQueryListListener* value)
+{
+ return WebDOMTestMediaQueryListListener(value);
+}
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.h
new file mode 100644
index 0000000..8f89836
--- /dev/null
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebDOMTestMediaQueryListListener_h
+#define WebDOMTestMediaQueryListListener_h
+
+#include <WebDOMObject.h>
+#include <WebDOMString.h>
+
+namespace WebCore {
+class TestMediaQueryListListener;
+};
+
+class WebDOMMediaQueryListListener;
+
+class WebDOMTestMediaQueryListListener : public WebDOMObject {
+public:
+ WebDOMTestMediaQueryListListener();
+ explicit WebDOMTestMediaQueryListListener(WebCore::TestMediaQueryListListener*);
+ WebDOMTestMediaQueryListListener(const WebDOMTestMediaQueryListListener&);
+ WebDOMTestMediaQueryListListener& operator=(const WebDOMTestMediaQueryListListener&);
+ virtual ~WebDOMTestMediaQueryListListener();
+
+ void method(const WebDOMMediaQueryListListener& listener);
+
+ WebCore::TestMediaQueryListListener* impl() const;
+
+protected:
+ struct WebDOMTestMediaQueryListListenerPrivate;
+ WebDOMTestMediaQueryListListenerPrivate* m_impl;
+};
+
+WebCore::TestMediaQueryListListener* toWebCore(const WebDOMTestMediaQueryListListener&);
+WebDOMTestMediaQueryListListener toWebKit(WebCore::TestMediaQueryListListener*);
+
+#endif
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp
new file mode 100644
index 0000000..af9300d
--- /dev/null
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp
@@ -0,0 +1,163 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <glib-object.h>
+#include "config.h"
+
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+#include "ExceptionCode.h"
+#include "JSMainThreadExecState.h"
+#include "TestMediaQueryListListener.h"
+#include "WebKitDOMBinding.h"
+#include "gobject/ConvertToUTF8String.h"
+#include "webkit/WebKitDOMMediaQueryListListener.h"
+#include "webkit/WebKitDOMMediaQueryListListenerPrivate.h"
+#include "webkit/WebKitDOMTestMediaQueryListListener.h"
+#include "webkit/WebKitDOMTestMediaQueryListListenerPrivate.h"
+#include "webkitmarshal.h"
+#include "webkitprivate.h"
+
+namespace WebKit {
+
+gpointer kit(WebCore::TestMediaQueryListListener* obj)
+{
+ g_return_val_if_fail(obj, 0);
+
+ if (gpointer ret = DOMObjectCache::get(obj))
+ return ret;
+
+ return DOMObjectCache::put(obj, WebKit::wrapTestMediaQueryListListener(obj));
+}
+
+} // namespace WebKit //
+
+void
+webkit_dom_test_media_query_list_listener_method(WebKitDOMTestMediaQueryListListener* self, WebKitDOMMediaQueryListListener* listener)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(self);
+ WebCore::TestMediaQueryListListener * item = WebKit::core(self);
+ g_return_if_fail(listener);
+ WebCore::MediaQueryListListener * converted_listener = NULL;
+ if (listener != NULL) {
+ converted_listener = WebKit::core(listener);
+ g_return_if_fail(converted_listener);
+ }
+ item->method(converted_listener);
+}
+
+
+G_DEFINE_TYPE(WebKitDOMTestMediaQueryListListener, webkit_dom_test_media_query_list_listener, WEBKIT_TYPE_DOM_OBJECT)
+
+namespace WebKit {
+
+WebCore::TestMediaQueryListListener* core(WebKitDOMTestMediaQueryListListener* request)
+{
+ g_return_val_if_fail(request, 0);
+
+ WebCore::TestMediaQueryListListener* coreObject = static_cast<WebCore::TestMediaQueryListListener*>(WEBKIT_DOM_OBJECT(request)->coreObject);
+ g_return_val_if_fail(coreObject, 0);
+
+ return coreObject;
+}
+
+} // namespace WebKit
+enum {
+ PROP_0,
+};
+
+
+static void webkit_dom_test_media_query_list_listener_finalize(GObject* object)
+{
+ WebKitDOMObject* dom_object = WEBKIT_DOM_OBJECT(object);
+
+ if (dom_object->coreObject) {
+ WebCore::TestMediaQueryListListener* coreObject = static_cast<WebCore::TestMediaQueryListListener *>(dom_object->coreObject);
+
+ WebKit::DOMObjectCache::forget(coreObject);
+ coreObject->deref();
+
+ dom_object->coreObject = NULL;
+ }
+
+ G_OBJECT_CLASS(webkit_dom_test_media_query_list_listener_parent_class)->finalize(object);
+}
+
+static void webkit_dom_test_media_query_list_listener_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
+{
+ WebCore::JSMainThreadNullState state;
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+
+static void webkit_dom_test_media_query_list_listener_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
+{
+ WebCore::JSMainThreadNullState state;
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+
+static void webkit_dom_test_media_query_list_listener_constructed(GObject* object)
+{
+
+ if (G_OBJECT_CLASS(webkit_dom_test_media_query_list_listener_parent_class)->constructed)
+ G_OBJECT_CLASS(webkit_dom_test_media_query_list_listener_parent_class)->constructed(object);
+}
+
+static void webkit_dom_test_media_query_list_listener_class_init(WebKitDOMTestMediaQueryListListenerClass* requestClass)
+{
+ GObjectClass *gobjectClass = G_OBJECT_CLASS(requestClass);
+ gobjectClass->finalize = webkit_dom_test_media_query_list_listener_finalize;
+ gobjectClass->set_property = webkit_dom_test_media_query_list_listener_set_property;
+ gobjectClass->get_property = webkit_dom_test_media_query_list_listener_get_property;
+ gobjectClass->constructed = webkit_dom_test_media_query_list_listener_constructed;
+
+
+
+}
+
+static void webkit_dom_test_media_query_list_listener_init(WebKitDOMTestMediaQueryListListener* request)
+{
+}
+
+namespace WebKit {
+WebKitDOMTestMediaQueryListListener* wrapTestMediaQueryListListener(WebCore::TestMediaQueryListListener* coreObject)
+{
+ g_return_val_if_fail(coreObject, 0);
+
+ /* We call ref() rather than using a C++ smart pointer because we can't store a C++ object
+ * in a C-allocated GObject structure. See the finalize() code for the
+ * matching deref().
+ */
+ coreObject->ref();
+
+ return WEBKIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER(g_object_new(WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER,
+ "core-object", coreObject, NULL));
+}
+} // namespace WebKit
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.h b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.h
new file mode 100644
index 0000000..94e825e
--- /dev/null
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.h
@@ -0,0 +1,54 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef WebKitDOMTestMediaQueryListListener_h
+#define WebKitDOMTestMediaQueryListListener_h
+
+#include "webkit/webkitdomdefines.h"
+#include <glib-object.h>
+#include <webkit/webkitdefines.h>
+#include "webkit/WebKitDOMObject.h"
+
+
+G_BEGIN_DECLS
+#define WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER (webkit_dom_test_media_query_list_listener_get_type())
+#define WEBKIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER, WebKitDOMTestMediaQueryListListener))
+#define WEBKIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER, WebKitDOMTestMediaQueryListListenerClass)
+#define WEBKIT_DOM_IS_TEST_MEDIA_QUERY_LIST_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER))
+#define WEBKIT_DOM_IS_TEST_MEDIA_QUERY_LIST_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER))
+#define WEBKIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER, WebKitDOMTestMediaQueryListListenerClass))
+
+struct _WebKitDOMTestMediaQueryListListener {
+ WebKitDOMObject parent_instance;
+};
+
+struct _WebKitDOMTestMediaQueryListListenerClass {
+ WebKitDOMObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_dom_test_media_query_list_listener_get_type (void);
+
+WEBKIT_API void
+webkit_dom_test_media_query_list_listener_method(WebKitDOMTestMediaQueryListListener* self, WebKitDOMMediaQueryListListener* listener);
+
+G_END_DECLS
+
+#endif /* WebKitDOMTestMediaQueryListListener_h */
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListenerPrivate.h b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListenerPrivate.h
new file mode 100644
index 0000000..c8ba6cc
--- /dev/null
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListenerPrivate.h
@@ -0,0 +1,39 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef WEB_KIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER_PRIVATE_H
+#define WEB_KIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER_PRIVATE_H
+
+#include <glib-object.h>
+#include <webkit/WebKitDOMObject.h>
+#include "TestMediaQueryListListener.h"
+namespace WebKit {
+ WebKitDOMTestMediaQueryListListener *
+ wrapTestMediaQueryListListener(WebCore::TestMediaQueryListListener *coreObject);
+
+ WebCore::TestMediaQueryListListener *
+ core(WebKitDOMTestMediaQueryListListener *request);
+
+ gpointer
+ kit(WebCore::TestMediaQueryListListener* node);
+
+} // namespace WebKit
+
+#endif /* WEB_KIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER_PRIVATE_H */
diff --git a/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp b/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
new file mode 100644
index 0000000..cde9672
--- /dev/null
+++ b/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
@@ -0,0 +1,194 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestMediaQueryListListener.h"
+
+#include "ExceptionCode.h"
+#include "JSDOMBinding.h"
+#include "JSMediaQueryListListener.h"
+#include "TestMediaQueryListListener.h"
+#include <runtime/Error.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+ASSERT_CLASS_FITS_IN_CELL(JSTestMediaQueryListListener);
+
+/* Hash table */
+#if ENABLE(JIT)
+#define THUNK_GENERATOR(generator) , generator
+#else
+#define THUNK_GENERATOR(generator)
+#endif
+
+static const HashTableValue JSTestMediaQueryListListenerTableValues[2] =
+{
+ { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestMediaQueryListListenerConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
+ { 0, 0, 0, 0 THUNK_GENERATOR(0) }
+};
+
+#undef THUNK_GENERATOR
+static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerTable = { 2, 1, JSTestMediaQueryListListenerTableValues, 0 };
+/* Hash table for constructor */
+#if ENABLE(JIT)
+#define THUNK_GENERATOR(generator) , generator
+#else
+#define THUNK_GENERATOR(generator)
+#endif
+
+static const HashTableValue JSTestMediaQueryListListenerConstructorTableValues[1] =
+{
+ { 0, 0, 0, 0 THUNK_GENERATOR(0) }
+};
+
+#undef THUNK_GENERATOR
+static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerConstructorTable = { 1, 0, JSTestMediaQueryListListenerConstructorTableValues, 0 };
+class JSTestMediaQueryListListenerConstructor : public DOMConstructorObject {
+public:
+ JSTestMediaQueryListListenerConstructor(JSC::ExecState*, JSDOMGlobalObject*);
+
+ virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
+ static const JSC::ClassInfo s_info;
+ static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
+ }
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
+};
+
+const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", 0, &JSTestMediaQueryListListenerConstructorTable, 0 };
+
+JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
+ : DOMConstructorObject(JSTestMediaQueryListListenerConstructor::createStructure(globalObject->objectPrototype()), globalObject)
+{
+ putDirect(exec->propertyNames().prototype, JSTestMediaQueryListListenerPrototype::self(exec, globalObject), DontDelete | ReadOnly);
+}
+
+bool JSTestMediaQueryListListenerConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ return getStaticValueSlot<JSTestMediaQueryListListenerConstructor, DOMObject>(exec, &JSTestMediaQueryListListenerConstructorTable, this, propertyName, slot);
+}
+
+bool JSTestMediaQueryListListenerConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ return getStaticValueDescriptor<JSTestMediaQueryListListenerConstructor, DOMObject>(exec, &JSTestMediaQueryListListenerConstructorTable, this, propertyName, descriptor);
+}
+
+/* Hash table for prototype */
+#if ENABLE(JIT)
+#define THUNK_GENERATOR(generator) , generator
+#else
+#define THUNK_GENERATOR(generator)
+#endif
+
+static const HashTableValue JSTestMediaQueryListListenerPrototypeTableValues[2] =
+{
+ { "method", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestMediaQueryListListenerPrototypeFunctionMethod), (intptr_t)1 THUNK_GENERATOR(0) },
+ { 0, 0, 0, 0 THUNK_GENERATOR(0) }
+};
+
+#undef THUNK_GENERATOR
+static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerPrototypeTable = { 2, 1, JSTestMediaQueryListListenerPrototypeTableValues, 0 };
+const ClassInfo JSTestMediaQueryListListenerPrototype::s_info = { "TestMediaQueryListListenerPrototype", 0, &JSTestMediaQueryListListenerPrototypeTable, 0 };
+
+JSObject* JSTestMediaQueryListListenerPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return getDOMPrototype<JSTestMediaQueryListListener>(exec, globalObject);
+}
+
+bool JSTestMediaQueryListListenerPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ return getStaticFunctionSlot<JSObject>(exec, &JSTestMediaQueryListListenerPrototypeTable, this, propertyName, slot);
+}
+
+bool JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ return getStaticFunctionDescriptor<JSObject>(exec, &JSTestMediaQueryListListenerPrototypeTable, this, propertyName, descriptor);
+}
+
+const ClassInfo JSTestMediaQueryListListener::s_info = { "TestMediaQueryListListener", 0, &JSTestMediaQueryListListenerTable, 0 };
+
+JSTestMediaQueryListListener::JSTestMediaQueryListListener(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestMediaQueryListListener> impl)
+ : DOMObjectWithGlobalPointer(structure, globalObject)
+ , m_impl(impl)
+{
+}
+
+JSTestMediaQueryListListener::~JSTestMediaQueryListListener()
+{
+ forgetDOMObject(this, impl());
+}
+
+JSObject* JSTestMediaQueryListListener::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return new (exec) JSTestMediaQueryListListenerPrototype(globalObject, JSTestMediaQueryListListenerPrototype::createStructure(globalObject->objectPrototype()));
+}
+
+bool JSTestMediaQueryListListener::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ return getStaticValueSlot<JSTestMediaQueryListListener, Base>(exec, &JSTestMediaQueryListListenerTable, this, propertyName, slot);
+}
+
+bool JSTestMediaQueryListListener::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ return getStaticValueDescriptor<JSTestMediaQueryListListener, Base>(exec, &JSTestMediaQueryListListenerTable, this, propertyName, descriptor);
+}
+
+JSValue jsTestMediaQueryListListenerConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestMediaQueryListListener* domObject = static_cast<JSTestMediaQueryListListener*>(asObject(slotBase));
+ return JSTestMediaQueryListListener::getConstructor(exec, domObject->globalObject());
+}
+JSValue JSTestMediaQueryListListener::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return getDOMConstructor<JSTestMediaQueryListListenerConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestMediaQueryListListenerPrototypeFunctionMethod(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestMediaQueryListListener::s_info))
+ return throwVMTypeError(exec);
+ JSTestMediaQueryListListener* castedThis = static_cast<JSTestMediaQueryListListener*>(asObject(thisValue));
+ TestMediaQueryListListener* imp = static_cast<TestMediaQueryListListener*>(castedThis->impl());
+ MediaQueryListListener* listener = toMediaQueryListListener(exec->argument(0));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+
+ imp->method(listener);
+ return JSValue::encode(jsUndefined());
+}
+
+JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestMediaQueryListListener* object)
+{
+ return getDOMObjectWrapper<JSTestMediaQueryListListener>(exec, globalObject, object);
+}
+TestMediaQueryListListener* toTestMediaQueryListListener(JSC::JSValue value)
+{
+ return value.inherits(&JSTestMediaQueryListListener::s_info) ? static_cast<JSTestMediaQueryListListener*>(asObject(value))->impl() : 0;
+}
+
+}
diff --git a/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h b/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h
new file mode 100644
index 0000000..1863703
--- /dev/null
+++ b/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h
@@ -0,0 +1,87 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef JSTestMediaQueryListListener_h
+#define JSTestMediaQueryListListener_h
+
+#include "JSDOMBinding.h"
+#include <runtime/JSGlobalObject.h>
+#include <runtime/JSObjectWithGlobalObject.h>
+#include <runtime/ObjectPrototype.h>
+
+namespace WebCore {
+
+class TestMediaQueryListListener;
+
+class JSTestMediaQueryListListener : public DOMObjectWithGlobalPointer {
+ typedef DOMObjectWithGlobalPointer Base;
+public:
+ JSTestMediaQueryListListener(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<TestMediaQueryListListener>);
+ virtual ~JSTestMediaQueryListListener();
+ static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
+ virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
+ virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
+ virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
+ static const JSC::ClassInfo s_info;
+
+ static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
+ }
+
+ static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
+ TestMediaQueryListListener* impl() const { return m_impl.get(); }
+
+private:
+ RefPtr<TestMediaQueryListListener> m_impl;
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
+};
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestMediaQueryListListener*);
+TestMediaQueryListListener* toTestMediaQueryListListener(JSC::JSValue);
+
+class JSTestMediaQueryListListenerPrototype : public JSC::JSObjectWithGlobalObject {
+ typedef JSC::JSObjectWithGlobalObject Base;
+public:
+ static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
+ virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
+ static const JSC::ClassInfo s_info;
+ virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
+ }
+ JSTestMediaQueryListListenerPrototype(JSC::JSGlobalObject* globalObject, NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObjectWithGlobalObject(globalObject, structure) { }
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
+};
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestMediaQueryListListenerPrototypeFunctionMethod(JSC::ExecState*);
+// Attributes
+
+JSC::JSValue jsTestMediaQueryListListenerConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h b/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h
new file mode 100644
index 0000000..20be806
--- /dev/null
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebCore/DOMObject.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+
+@class DOMMediaQueryListListener;
+
+@interface DOMTestMediaQueryListListener : DOMObject
+- (void)method:(DOMMediaQueryListListener *)listener;
+@end
+
+#endif
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm b/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm
new file mode 100644
index 0000000..74e3d52
--- /dev/null
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm
@@ -0,0 +1,95 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "DOMInternal.h"
+
+#import "DOMTestMediaQueryListListener.h"
+
+#import "DOMBlobInternal.h"
+#import "DOMCSSRuleInternal.h"
+#import "DOMCSSValueInternal.h"
+#import "DOMEventInternal.h"
+#import "DOMMediaQueryListListenerInternal.h"
+#import "DOMNodeInternal.h"
+#import "DOMStyleSheetInternal.h"
+#import "DOMTestMediaQueryListListenerInternal.h"
+#import "ExceptionHandlers.h"
+#import "JSMainThreadExecState.h"
+#import "MediaQueryListListener.h"
+#import "TestMediaQueryListListener.h"
+#import "ThreadCheck.h"
+#import "WebCoreObjCExtras.h"
+#import "WebScriptObjectPrivate.h"
+#import <wtf/GetPtr.h>
+
+#define IMPL reinterpret_cast<WebCore::TestMediaQueryListListener*>(_internal)
+
+@implementation DOMTestMediaQueryListListener
+
+- (void)dealloc
+{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([DOMTestMediaQueryListListener class], self))
+ return;
+
+ if (_internal)
+ IMPL->deref();
+ [super dealloc];
+}
+
+- (void)finalize
+{
+ if (_internal)
+ IMPL->deref();
+ [super finalize];
+}
+
+- (void)method:(DOMMediaQueryListListener *)listener
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->method(core(listener));
+}
+
+@end
+
+WebCore::TestMediaQueryListListener* core(DOMTestMediaQueryListListener *wrapper)
+{
+ return wrapper ? reinterpret_cast<WebCore::TestMediaQueryListListener*>(wrapper->_internal) : 0;
+}
+
+DOMTestMediaQueryListListener *kit(WebCore::TestMediaQueryListListener* value)
+{
+ { DOM_ASSERT_MAIN_THREAD(); WebCoreThreadViolationCheckRoundOne(); };
+ if (!value)
+ return nil;
+ if (DOMTestMediaQueryListListener *wrapper = getDOMWrapper(value))
+ return [[wrapper retain] autorelease];
+ DOMTestMediaQueryListListener *wrapper = [[DOMTestMediaQueryListListener alloc] _init];
+ wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(value);
+ value->ref();
+ addDOMWrapper(wrapper, value);
+ return [wrapper autorelease];
+}
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h b/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h
new file mode 100644
index 0000000..b1421a3
--- /dev/null
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h
@@ -0,0 +1,38 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebCore/DOMTestMediaQueryListListener.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+
+namespace WebCore {
+ class TestMediaQueryListListener;
+}
+
+WebCore::TestMediaQueryListListener* core(DOMTestMediaQueryListListener *);
+DOMTestMediaQueryListListener *kit(WebCore::TestMediaQueryListListener*);
+
+#endif
diff --git a/WebCore/bindings/scripts/test/TestMediaQueryListListener.idl b/WebCore/bindings/scripts/test/TestMediaQueryListListener.idl
new file mode 100644
index 0000000..536393b
--- /dev/null
+++ b/WebCore/bindings/scripts/test/TestMediaQueryListListener.idl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This IDL file is for testing the bindings code generator with an interface
+// that has methods receiving a parameter of the type MediaQueryListListener.
+module test {
+ interface TestMediaQueryListListener {
+ void method(in MediaQueryListListener listener);
+ };
+}
diff --git a/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp b/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
new file mode 100644
index 0000000..1f78f39
--- /dev/null
+++ b/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
@@ -0,0 +1,109 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "config.h"
+#include "V8TestMediaQueryListListener.h"
+
+#include "ExceptionCode.h"
+#include "RuntimeEnabledFeatures.h"
+#include "V8Binding.h"
+#include "V8BindingMacros.h"
+#include "V8BindingState.h"
+#include "V8DOMWrapper.h"
+#include "V8IsolatedContext.h"
+#include "V8MediaQueryListListener.h"
+#include "V8Proxy.h"
+
+namespace WebCore {
+
+WrapperTypeInfo V8TestMediaQueryListListener::info = { V8TestMediaQueryListListener::GetTemplate, V8TestMediaQueryListListener::derefObject, 0 };
+
+namespace TestMediaQueryListListenerInternal {
+
+template <typename T> void V8_USE(T) { }
+
+static v8::Handle<v8::Value> methodCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestMediaQueryListListener.method");
+ TestMediaQueryListListener* imp = V8TestMediaQueryListListener::toNative(args.Holder());
+ EXCEPTION_BLOCK(MediaQueryListListener*, listener, V8MediaQueryListListener::HasInstance(args[0]) ? V8MediaQueryListListener::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
+ imp->method(listener);
+ return v8::Handle<v8::Value>();
+}
+
+} // namespace TestMediaQueryListListenerInternal
+
+static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestMediaQueryListListenerTemplate(v8::Persistent<v8::FunctionTemplate> desc)
+{
+ v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "TestMediaQueryListListener", v8::Persistent<v8::FunctionTemplate>(), V8TestMediaQueryListListener::internalFieldCount,
+ 0, 0,
+ 0, 0);
+ v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
+ v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
+
+
+ // Custom Signature 'method'
+ const int methodArgc = 1;
+ v8::Handle<v8::FunctionTemplate> methodArgv[methodArgc] = { V8MediaQueryListListener::GetRawTemplate() };
+ v8::Handle<v8::Signature> methodSignature = v8::Signature::New(desc, methodArgc, methodArgv);
+ proto->Set(v8::String::New("method"), v8::FunctionTemplate::New(TestMediaQueryListListenerInternal::methodCallback, v8::Handle<v8::Value>(), methodSignature));
+
+ // Custom toString template
+ desc->Set(getToStringName(), getToStringTemplate());
+ return desc;
+}
+
+v8::Persistent<v8::FunctionTemplate> V8TestMediaQueryListListener::GetRawTemplate()
+{
+ static v8::Persistent<v8::FunctionTemplate> V8TestMediaQueryListListenerRawCache = createRawTemplate();
+ return V8TestMediaQueryListListenerRawCache;
+}
+
+v8::Persistent<v8::FunctionTemplate> V8TestMediaQueryListListener::GetTemplate()
+{
+ static v8::Persistent<v8::FunctionTemplate> V8TestMediaQueryListListenerCache = ConfigureV8TestMediaQueryListListenerTemplate(GetRawTemplate());
+ return V8TestMediaQueryListListenerCache;
+}
+
+bool V8TestMediaQueryListListener::HasInstance(v8::Handle<v8::Value> value)
+{
+ return GetRawTemplate()->HasInstance(value);
+}
+
+
+v8::Handle<v8::Object> V8TestMediaQueryListListener::wrapSlow(TestMediaQueryListListener* impl)
+{
+ v8::Handle<v8::Object> wrapper;
+ V8Proxy* proxy = 0;
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
+ if (wrapper.IsEmpty())
+ return wrapper;
+
+ impl->ref();
+ getDOMObjectMap().set(impl, v8::Persistent<v8::Object>::New(wrapper));
+ return wrapper;
+}
+
+void V8TestMediaQueryListListener::derefObject(void* object)
+{
+ static_cast<TestMediaQueryListListener*>(object)->deref();
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h b/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h
new file mode 100644
index 0000000..908d9cd
--- /dev/null
+++ b/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h
@@ -0,0 +1,72 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef V8TestMediaQueryListListener_h
+#define V8TestMediaQueryListListener_h
+
+#include "TestMediaQueryListListener.h"
+#include "V8DOMWrapper.h"
+#include "WrapperTypeInfo.h"
+#include "wtf/text/StringHash.h"
+#include <v8.h>
+#include <wtf/HashMap.h>
+
+namespace WebCore {
+
+class V8TestMediaQueryListListener {
+
+public:
+ static bool HasInstance(v8::Handle<v8::Value> value);
+ static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
+ static v8::Persistent<v8::FunctionTemplate> GetTemplate();
+ static TestMediaQueryListListener* toNative(v8::Handle<v8::Object> object)
+ {
+ return reinterpret_cast<TestMediaQueryListListener*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
+ }
+ inline static v8::Handle<v8::Object> wrap(TestMediaQueryListListener*);
+ static void derefObject(void*);
+ static WrapperTypeInfo info;
+ static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+private:
+ static v8::Handle<v8::Object> wrapSlow(TestMediaQueryListListener*);
+};
+
+
+v8::Handle<v8::Object> V8TestMediaQueryListListener::wrap(TestMediaQueryListListener* impl)
+{
+ v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return V8TestMediaQueryListListener::wrapSlow(impl);
+}
+
+inline v8::Handle<v8::Value> toV8(TestMediaQueryListListener* impl)
+{
+ if (!impl)
+ return v8::Null();
+ return V8TestMediaQueryListListener::wrap(impl);
+}
+inline v8::Handle<v8::Value> toV8(PassRefPtr< TestMediaQueryListListener > impl)
+{
+ return toV8(impl.get());
+}
+}
+
+#endif // V8TestMediaQueryListListener_h
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index 44f0d3e..4be1177 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -678,9 +678,19 @@ static v8::Handle<v8::Value> idbKeyCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.idbKey");
TestObj* imp = V8TestObj::toNative(args.Holder());
- EXCEPTION_BLOCK(RefPtr<IDBKey>, key, createIDBKeyFromValue(args[0]));
+ ExceptionCode ec = 0;
+ {
+ RefPtr<IDBKey> key = createIDBKeyFromValue(args[0]);
+ if (UNLIKELY(!key)) {
+ ec = TYPE_MISMATCH_ERR;
+ goto fail;
+ }
imp->idbKey(key);
return v8::Handle<v8::Value>();
+ }
+ fail:
+ V8Proxy::setDOMException(ec);
+ return v8::Handle<v8::Value>();
}
static v8::Handle<v8::Value> methodWithExceptionCallback(const v8::Arguments& args)
diff --git a/WebCore/bindings/v8/DateExtension.cpp b/WebCore/bindings/v8/DateExtension.cpp
index f2b6242..332828b 100644
--- a/WebCore/bindings/v8/DateExtension.cpp
+++ b/WebCore/bindings/v8/DateExtension.cpp
@@ -76,7 +76,7 @@ DateExtension* DateExtension::get()
void DateExtension::setAllowSleep(bool allow)
{
v8::Local<v8::Value> result = V8Proxy::currentContext()->Global()->Get(v8::String::New("Date"));
- if (result.IsEmpty())
+ if (result.IsEmpty() || !result->IsObject())
return;
v8::Handle<v8::Object> dateObject = v8::Handle<v8::Object>::Cast(result);
diff --git a/WebCore/bindings/v8/IDBBindingUtilities.cpp b/WebCore/bindings/v8/IDBBindingUtilities.cpp
index 4a58853..123b15c 100644
--- a/WebCore/bindings/v8/IDBBindingUtilities.cpp
+++ b/WebCore/bindings/v8/IDBBindingUtilities.cpp
@@ -28,6 +28,7 @@
#if ENABLE(INDEXED_DATABASE)
+#include "IDBDatabaseException.h"
#include "IDBKey.h"
#include "IDBKeyPath.h"
#include "SerializedScriptValue.h"
@@ -45,7 +46,8 @@ PassRefPtr<IDBKey> createIDBKeyFromValue(v8::Handle<v8::Value> value)
if (value->IsString())
return IDBKey::create(v8ValueToWebCoreString(value));
// FIXME: Implement dates.
- return 0;
+
+ return 0; // Signals type error.
}
template<typename T>
diff --git a/WebCore/bindings/v8/SerializedScriptValue.cpp b/WebCore/bindings/v8/SerializedScriptValue.cpp
index ff92167..36fc1f6 100644
--- a/WebCore/bindings/v8/SerializedScriptValue.cpp
+++ b/WebCore/bindings/v8/SerializedScriptValue.cpp
@@ -82,6 +82,7 @@ enum SerializationTag {
ArrayTag = '[',
ObjectTag = '{',
SparseArrayTag = '@',
+ RegExpTag = 'R',
};
static bool shouldCheckForCycles(int depth)
@@ -219,6 +220,14 @@ public:
doWriteUint32(pixelDataLength);
append(pixelData, pixelDataLength);
}
+
+ void writeRegExp(v8::Local<v8::String> pattern, v8::RegExp::Flags flags)
+ {
+ append(RegExpTag);
+ v8::String::Utf8Value patternUtf8Value(pattern);
+ doWriteString(*patternUtf8Value, patternUtf8Value.length());
+ doWriteUint32(static_cast<uint32_t>(flags));
+ }
void writeArray(uint32_t length)
{
@@ -605,6 +614,12 @@ private:
WTF::ByteArray* pixelArray = imageData->data()->data();
m_writer.writeImageData(imageData->width(), imageData->height(), pixelArray->data(), pixelArray->length());
}
+
+ void writeRegExp(v8::Handle<v8::Value> value)
+ {
+ v8::Handle<v8::RegExp> regExp = value.As<v8::RegExp>();
+ m_writer.writeRegExp(regExp->GetSource(), regExp->GetFlags());
+ }
static StateBase* newArrayState(v8::Handle<v8::Array> array, StateBase* next)
{
@@ -656,6 +671,8 @@ Serializer::StateBase* Serializer::doSerialize(v8::Handle<v8::Value> value, Stat
writeFileList(value);
else if (V8ImageData::HasInstance(value))
writeImageData(value);
+ else if (value->IsRegExp())
+ writeRegExp(value);
else if (value->IsObject())
return push(newObjectState(value.As<v8::Object>(), next));
return 0;
@@ -751,6 +768,10 @@ public:
return false;
break;
}
+ case RegExpTag:
+ if (!readRegExp(value))
+ return false;
+ break;
case ObjectTag: {
uint32_t numProperties;
if (!doReadUint32(&numProperties))
@@ -867,6 +888,18 @@ private:
*value = toV8(imageData);
return true;
}
+
+ bool readRegExp(v8::Handle<v8::Value>* value)
+ {
+ v8::Handle<v8::Value> pattern;
+ if (!readString(&pattern))
+ return false;
+ uint32_t flags;
+ if (!doReadUint32(&flags))
+ return false;
+ *value = v8::RegExp::New(pattern.As<v8::String>(), static_cast<v8::RegExp::Flags>(flags));
+ return true;
+ }
bool readBlob(v8::Handle<v8::Value>* value)
{
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index e7dca4f..c7e5bf1 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -55,6 +55,7 @@
#include "V8DOMMap.h"
#include "V8DOMWindow.h"
#include "V8EventException.h"
+#include "V8FileException.h"
#include "V8HiddenPropertyName.h"
#include "V8IsolatedContext.h"
#include "V8RangeException.h"
@@ -737,6 +738,11 @@ void V8Proxy::setDOMException(int exceptionCode)
exception = toV8(SQLException::create(description));
break;
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+ case FileExceptionType:
+ exception = toV8(FileException::create(description));
+ break;
+#endif
default:
ASSERT_NOT_REACHED();
}
diff --git a/WebCore/bindings/v8/custom/V8DOMSettableTokenListCustom.cpp b/WebCore/bindings/v8/custom/V8DOMSettableTokenListCustom.cpp
new file mode 100644
index 0000000..4eeb1e0
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8DOMSettableTokenListCustom.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "V8DOMSettableTokenList.h"
+
+#include "DOMSettableTokenList.h"
+
+#include "V8Binding.h"
+#include "V8Proxy.h"
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8DOMSettableTokenList::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
+{
+ // FIXME: Implement this function.
+ return v8String("");
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp b/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp
index 5f4fb57..fb0d53c 100755
--- a/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp
@@ -29,9 +29,13 @@
*/
#include "config.h"
+
+#if ENABLE(BLOB)
+
#include "V8FileReader.h"
#include "ScriptExecutionContext.h"
+#include "V8ArrayBuffer.h"
#include "V8Binding.h"
namespace WebCore {
@@ -57,4 +61,16 @@ v8::Handle<v8::Value> V8FileReader::constructorCallback(const v8::Arguments& arg
return args.Holder();
}
+v8::Handle<v8::Value> V8FileReader::resultAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.FileReader.result._get");
+ v8::Handle<v8::Object> holder = info.Holder();
+ FileReader* imp = V8FileReader::toNative(holder);
+ if (imp->readType() == FileReaderLoader::ReadAsArrayBuffer)
+ return toV8(imp->arrayBufferResult());
+ return v8StringOrNull(imp->stringResult());
+}
+
} // namespace WebCore
+
+#endif // ENABLE(BLOB)
diff --git a/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp b/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
index 0dae6af..3582a36 100644
--- a/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
@@ -33,29 +33,26 @@
#if ENABLE(SVG)
#include "V8SVGLength.h"
-#include "SVGLength.h"
+#include "SVGPropertyTearOff.h"
#include "V8Binding.h"
-#include "V8SVGPODTypeWrapper.h"
-#include "V8Proxy.h"
namespace WebCore {
v8::Handle<v8::Value> V8SVGLength::valueAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.SVGLength.value");
- V8SVGPODTypeWrapper<SVGLength>* wrapper = V8SVGPODTypeWrapper<SVGLength>::toNative(info.Holder());
- SVGLength imp = *wrapper;
- return v8::Number::New(imp.value(V8Proxy::svgContext(wrapper)));
+ SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
+ SVGLength& imp = wrapper->propertyReference();
+ return v8::Number::New(imp.value(wrapper->contextElement()));
}
v8::Handle<v8::Value> V8SVGLength::convertToSpecifiedUnitsCallback(const v8::Arguments& args)
{
INC_STATS("DOM.SVGLength.convertToSpecifiedUnits");
- V8SVGPODTypeWrapper<SVGLength>* wrapper = V8SVGPODTypeWrapper<SVGLength>::toNative(args.Holder());
- SVGLength imp = *wrapper;
- SVGElement* context = V8Proxy::svgContext(wrapper);
- imp.convertToSpecifiedUnits(toInt32(args[0]), context);
- wrapper->commitChange(imp, context);
+ SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(args.Holder());
+ SVGLength& imp = wrapper->propertyReference();
+ imp.convertToSpecifiedUnits(toInt32(args[0]), wrapper->contextElement());
+ wrapper->commitChange();
return v8::Undefined();
}
diff --git a/WebCore/bridge/NP_jsobject.cpp b/WebCore/bridge/NP_jsobject.cpp
index 17270eb..0780ad7 100644
--- a/WebCore/bridge/NP_jsobject.cpp
+++ b/WebCore/bridge/NP_jsobject.cpp
@@ -190,9 +190,9 @@ bool _NPN_InvokeDefault(NPP, NPObject* o, const NPVariant* args, uint32_t argCou
MarkedArgumentBuffer argList;
getListFromVariantArgs(exec, args, argCount, rootObject, argList);
ProtectedPtr<JSGlobalObject> globalObject = rootObject->globalObject();
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
JSValue resultV = JSC::call(exec, function, callType, callData, function, argList);
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
// Convert and return the result of the function call.
convertValueToNPVariant(exec, resultV, result);
@@ -240,9 +240,9 @@ bool _NPN_Invoke(NPP npp, NPObject* o, NPIdentifier methodName, const NPVariant*
MarkedArgumentBuffer argList;
getListFromVariantArgs(exec, args, argCount, rootObject, argList);
ProtectedPtr<JSGlobalObject> globalObject = rootObject->globalObject();
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
JSValue resultV = JSC::call(exec, function, callType, callData, obj->imp, argList);
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
// Convert and return the result of the function call.
convertValueToNPVariant(exec, resultV, result);
@@ -274,9 +274,9 @@ bool _NPN_Evaluate(NPP instance, NPObject* o, NPString* s, NPVariant* variant)
JSLock lock(SilenceAssertionsOnly);
String scriptString = convertNPStringToUTF16(s);
ProtectedPtr<JSGlobalObject> globalObject = rootObject->globalObject();
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
Completion completion = JSC::evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(scriptString), JSC::JSValue());
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
ComplType type = completion.complType();
JSValue result;
@@ -514,9 +514,9 @@ bool _NPN_Construct(NPP, NPObject* o, const NPVariant* args, uint32_t argCount,
MarkedArgumentBuffer argList;
getListFromVariantArgs(exec, args, argCount, rootObject, argList);
ProtectedPtr<JSGlobalObject> globalObject = rootObject->globalObject();
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
JSValue resultV = JSC::construct(exec, constructor, constructType, constructData, argList);
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
// Convert and return the result.
convertValueToNPVariant(exec, resultV, result);
diff --git a/WebCore/bridge/c/c_instance.cpp b/WebCore/bridge/c/c_instance.cpp
index 03e72fc..f1dd4e5 100644
--- a/WebCore/bridge/c/c_instance.cpp
+++ b/WebCore/bridge/c/c_instance.cpp
@@ -265,10 +265,10 @@ JSValue CInstance::stringValue(ExecState* exec) const
return jsString(exec, buf);
}
-JSValue CInstance::numberValue(ExecState* exec) const
+JSValue CInstance::numberValue(ExecState*) const
{
// FIXME: Implement something sensible.
- return jsNumber(exec, 0);
+ return jsNumber(0);
}
JSValue CInstance::booleanValue() const
diff --git a/WebCore/bridge/c/c_utility.cpp b/WebCore/bridge/c/c_utility.cpp
index b160f9f..e786896 100644
--- a/WebCore/bridge/c/c_utility.cpp
+++ b/WebCore/bridge/c/c_utility.cpp
@@ -118,9 +118,9 @@ JSValue convertNPVariantToValue(ExecState* exec, const NPVariant* variant, RootO
if (type == NPVariantType_Void)
return jsUndefined();
if (type == NPVariantType_Int32)
- return jsNumber(exec, NPVARIANT_TO_INT32(*variant));
+ return jsNumber(NPVARIANT_TO_INT32(*variant));
if (type == NPVariantType_Double)
- return jsNumber(exec, NPVARIANT_TO_DOUBLE(*variant));
+ return jsNumber(NPVARIANT_TO_DOUBLE(*variant));
if (type == NPVariantType_String)
return WebCore::jsString(exec, convertNPStringToUTF16(&variant->value.stringValue));
if (type == NPVariantType_Object) {
diff --git a/WebCore/bridge/jni/jni_jsobject.mm b/WebCore/bridge/jni/jni_jsobject.mm
index d7d3a54..f8ec1c4 100644
--- a/WebCore/bridge/jni/jni_jsobject.mm
+++ b/WebCore/bridge/jni/jni_jsobject.mm
@@ -296,9 +296,9 @@ jobject JavaJSObject::call(jstring methodName, jobjectArray args) const
// Call the function object.
MarkedArgumentBuffer argList;
getListFromJArray(exec, args, argList);
- rootObject->globalObject()->globalData()->timeoutChecker.start();
+ rootObject->globalObject()->globalData().timeoutChecker.start();
JSValue result = JSC::call(exec, function, callType, callData, _imp, argList);
- rootObject->globalObject()->globalData()->timeoutChecker.stop();
+ rootObject->globalObject()->globalData().timeoutChecker.stop();
return convertValueToJObject(result);
}
@@ -315,9 +315,9 @@ jobject JavaJSObject::eval(jstring script) const
if (!rootObject)
return 0;
- rootObject->globalObject()->globalData()->timeoutChecker.start();
+ rootObject->globalObject()->globalData().timeoutChecker.start();
Completion completion = JSC::evaluate(rootObject->globalObject()->globalExec(), rootObject->globalObject()->globalScopeChain(), makeSource(JavaString(script)), JSC::JSValue());
- rootObject->globalObject()->globalData()->timeoutChecker.stop();
+ rootObject->globalObject()->globalData().timeoutChecker.stop();
ComplType type = completion.complType();
if (type == Normal) {
diff --git a/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp b/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
index 8a34ced..3c16d05 100644
--- a/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
+++ b/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
@@ -132,7 +132,7 @@ JSValue JavaField::valueFromInstance(ExecState* exec, const Instance* i) const
jint value;
jvalue result = dispatchValueFromInstance(exec, instance, "getInt", "(Ljava/lang/Object;)I", int_type);
value = result.i;
- jsresult = jsNumber(exec, static_cast<int>(value));
+ jsresult = jsNumber(static_cast<int>(value));
}
break;
@@ -143,7 +143,7 @@ JSValue JavaField::valueFromInstance(ExecState* exec, const Instance* i) const
jdouble value;
jvalue result = dispatchValueFromInstance(exec, instance, "getDouble", "(Ljava/lang/Object;)D", double_type);
value = result.i;
- jsresult = jsNumber(exec, static_cast<double>(value));
+ jsresult = jsNumber(static_cast<double>(value));
}
break;
default:
@@ -380,7 +380,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jbyteArray byteArray = static_cast<jbyteArray>(javaArray());
jbyte aByte;
env->GetByteArrayRegion(byteArray, index, 1, &aByte);
- return jsNumber(exec, aByte);
+ return jsNumber(aByte);
}
case char_type:
@@ -388,7 +388,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jcharArray charArray = static_cast<jcharArray>(javaArray());
jchar aChar;
env->GetCharArrayRegion(charArray, index, 1, &aChar);
- return jsNumber(exec, aChar);
+ return jsNumber(aChar);
break;
}
@@ -397,7 +397,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jshortArray shortArray = static_cast<jshortArray>(javaArray());
jshort aShort;
env->GetShortArrayRegion(shortArray, index, 1, &aShort);
- return jsNumber(exec, aShort);
+ return jsNumber(aShort);
}
case int_type:
@@ -405,7 +405,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jintArray intArray = static_cast<jintArray>(javaArray());
jint anInt;
env->GetIntArrayRegion(intArray, index, 1, &anInt);
- return jsNumber(exec, anInt);
+ return jsNumber(anInt);
}
case long_type:
@@ -413,7 +413,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jlongArray longArray = static_cast<jlongArray>(javaArray());
jlong aLong;
env->GetLongArrayRegion(longArray, index, 1, &aLong);
- return jsNumber(exec, aLong);
+ return jsNumber(aLong);
}
case float_type:
@@ -421,7 +421,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jfloatArray floatArray = static_cast<jfloatArray>(javaArray());
jfloat aFloat;
env->GetFloatArrayRegion(floatArray, index, 1, &aFloat);
- return jsNumber(exec, aFloat);
+ return jsNumber(aFloat);
}
case double_type:
@@ -429,7 +429,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jdoubleArray doubleArray = static_cast<jdoubleArray>(javaArray());
jdouble aDouble;
env->GetDoubleArrayRegion(doubleArray, index, 1, &aDouble);
- return jsNumber(exec, aDouble);
+ return jsNumber(aDouble);
}
default:
break;
diff --git a/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp b/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
index 1e584af..db57d2c 100644
--- a/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
+++ b/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
@@ -104,10 +104,10 @@ JSValue JavaInstance::stringValue(ExecState* exec) const
return jsString(exec, u);
}
-JSValue JavaInstance::numberValue(ExecState* exec) const
+JSValue JavaInstance::numberValue(ExecState*) const
{
jdouble doubleValue = callJNIMethod<jdouble>(m_instance->m_instance, "doubleValue", "()D");
- return jsNumber(exec, doubleValue);
+ return jsNumber(doubleValue);
}
JSValue JavaInstance::booleanValue() const
@@ -284,43 +284,43 @@ JSValue JavaInstance::invokeMethod(ExecState* exec, RuntimeMethod* runtimeMethod
case byte_type:
{
- resultValue = jsNumber(exec, result.b);
+ resultValue = jsNumber(result.b);
}
break;
case char_type:
{
- resultValue = jsNumber(exec, result.c);
+ resultValue = jsNumber(result.c);
}
break;
case short_type:
{
- resultValue = jsNumber(exec, result.s);
+ resultValue = jsNumber(result.s);
}
break;
case int_type:
{
- resultValue = jsNumber(exec, result.i);
+ resultValue = jsNumber(result.i);
}
break;
case long_type:
{
- resultValue = jsNumber(exec, result.j);
+ resultValue = jsNumber(result.j);
}
break;
case float_type:
{
- resultValue = jsNumber(exec, result.f);
+ resultValue = jsNumber(result.f);
}
break;
case double_type:
{
- resultValue = jsNumber(exec, result.d);
+ resultValue = jsNumber(result.d);
}
break;
diff --git a/WebCore/bridge/objc/objc_instance.mm b/WebCore/bridge/objc/objc_instance.mm
index 989d9eb..ae9d95d 100644
--- a/WebCore/bridge/objc/objc_instance.mm
+++ b/WebCore/bridge/objc/objc_instance.mm
@@ -447,10 +447,10 @@ JSValue ObjcInstance::stringValue(ExecState* exec) const
return convertNSStringToString(exec, [getObject() description]);
}
-JSValue ObjcInstance::numberValue(ExecState* exec) const
+JSValue ObjcInstance::numberValue(ExecState*) const
{
// FIXME: Implement something sensible
- return jsNumber(exec, 0);
+ return jsNumber(0);
}
JSValue ObjcInstance::booleanValue() const
diff --git a/WebCore/bridge/objc/objc_utility.mm b/WebCore/bridge/objc/objc_utility.mm
index 8eb7ba5..dfba852 100644
--- a/WebCore/bridge/objc/objc_utility.mm
+++ b/WebCore/bridge/objc/objc_utility.mm
@@ -242,7 +242,7 @@ JSValue convertObjcValueToValue(ExecState* exec, void* buffer, ObjcValueType typ
if ((CFBooleanRef)obj == kCFBooleanFalse)
return jsBoolean(false);
if ([obj isKindOfClass:[NSNumber class]])
- return jsNumber(exec, [obj doubleValue]);
+ return jsNumber([obj doubleValue]);
if ([obj isKindOfClass:[NSArray class]])
return new (exec) RuntimeArray(exec, new ObjcArray(obj, rootObject));
if ([obj isKindOfClass:webScriptObjectClass()]) {
@@ -256,29 +256,29 @@ JSValue convertObjcValueToValue(ExecState* exec, void* buffer, ObjcValueType typ
return ObjcInstance::create(obj, rootObject)->createRuntimeObject(exec);
}
case ObjcCharType:
- return jsNumber(exec, *(char*)buffer);
+ return jsNumber(*(char*)buffer);
case ObjcUnsignedCharType:
- return jsNumber(exec, *(unsigned char*)buffer);
+ return jsNumber(*(unsigned char*)buffer);
case ObjcShortType:
- return jsNumber(exec, *(short*)buffer);
+ return jsNumber(*(short*)buffer);
case ObjcUnsignedShortType:
- return jsNumber(exec, *(unsigned short*)buffer);
+ return jsNumber(*(unsigned short*)buffer);
case ObjcIntType:
- return jsNumber(exec, *(int*)buffer);
+ return jsNumber(*(int*)buffer);
case ObjcUnsignedIntType:
- return jsNumber(exec, *(unsigned int*)buffer);
+ return jsNumber(*(unsigned int*)buffer);
case ObjcLongType:
- return jsNumber(exec, *(long*)buffer);
+ return jsNumber(*(long*)buffer);
case ObjcUnsignedLongType:
- return jsNumber(exec, *(unsigned long*)buffer);
+ return jsNumber(*(unsigned long*)buffer);
case ObjcLongLongType:
- return jsNumber(exec, *(long long*)buffer);
+ return jsNumber(*(long long*)buffer);
case ObjcUnsignedLongLongType:
- return jsNumber(exec, *(unsigned long long*)buffer);
+ return jsNumber(*(unsigned long long*)buffer);
case ObjcFloatType:
- return jsNumber(exec, *(float*)buffer);
+ return jsNumber(*(float*)buffer);
case ObjcDoubleType:
- return jsNumber(exec, *(double*)buffer);
+ return jsNumber(*(double*)buffer);
default:
// Should never get here. Argument types are filtered.
fprintf(stderr, "%s: invalid type (%d)\n", __PRETTY_FUNCTION__, (int)type);
diff --git a/WebCore/bridge/qt/qt_instance.cpp b/WebCore/bridge/qt/qt_instance.cpp
index 1229919..c2e2dce 100644
--- a/WebCore/bridge/qt/qt_instance.cpp
+++ b/WebCore/bridge/qt/qt_instance.cpp
@@ -306,9 +306,9 @@ JSValue QtInstance::stringValue(ExecState* exec) const
return jsString(exec, buf.constData());
}
-JSValue QtInstance::numberValue(ExecState* exec) const
+JSValue QtInstance::numberValue(ExecState*) const
{
- return jsNumber(exec, 0);
+ return jsNumber(0);
}
JSValue QtInstance::booleanValue() const
diff --git a/WebCore/bridge/qt/qt_pixmapruntime.cpp b/WebCore/bridge/qt/qt_pixmapruntime.cpp
index ad26019..1ef20c3 100644
--- a/WebCore/bridge/qt/qt_pixmapruntime.cpp
+++ b/WebCore/bridge/qt/qt_pixmapruntime.cpp
@@ -51,9 +51,9 @@ public:
class QtPixmapWidthField : public Field {
public:
static const char* name() { return "width"; }
- virtual JSValue valueFromInstance(ExecState* exec, const Instance* instance) const
+ virtual JSValue valueFromInstance(ExecState*, const Instance* instance) const
{
- return jsNumber(exec, static_cast<const QtPixmapInstance*>(instance)->width());
+ return jsNumber(static_cast<const QtPixmapInstance*>(instance)->width());
}
virtual void setValueToInstance(ExecState*, const Instance*, JSValue) const {}
};
@@ -61,9 +61,9 @@ public:
class QtPixmapHeightField : public Field {
public:
static const char* name() { return "height"; }
- virtual JSValue valueFromInstance(ExecState* exec, const Instance* instance) const
+ virtual JSValue valueFromInstance(ExecState*, const Instance* instance) const
{
- return jsNumber(exec, static_cast<const QtPixmapInstance*>(instance)->height());
+ return jsNumber(static_cast<const QtPixmapInstance*>(instance)->height());
}
virtual void setValueToInstance(ExecState*, const Instance*, JSValue) const {}
};
@@ -355,7 +355,7 @@ RuntimeObject* QtPixmapInstance::newRuntimeObject(ExecState* exec)
JSObject* QtPixmapInstance::createPixmapRuntimeObject(ExecState* exec, PassRefPtr<RootObject> root, const QVariant& data)
{
JSLock lock(SilenceAssertionsOnly);
- QtPixmapInstance* instance = new QtPixmapInstance(root, data);
+ RefPtr<QtPixmapInstance> instance = adoptRef(new QtPixmapInstance(root, data));
return instance->createRuntimeObject(exec);
}
diff --git a/WebCore/bridge/qt/qt_runtime.cpp b/WebCore/bridge/qt/qt_runtime.cpp
index ce4567a..96851fa 100644
--- a/WebCore/bridge/qt/qt_runtime.cpp
+++ b/WebCore/bridge/qt/qt_runtime.cpp
@@ -179,7 +179,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
}
// check magic pointer values before dereferencing value
- if (value == jsNaN(exec)
+ if (value == jsNaN()
|| (value == jsUndefined()
&& hint != QMetaType::QString
&& hint != (QMetaType::Type) qMetaTypeId<QVariant>())) {
@@ -816,7 +816,7 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con
type == QMetaType::UShort ||
type == QMetaType::Float ||
type == QMetaType::Double)
- return jsNumber(exec, variant.toDouble());
+ return jsNumber(variant.toDouble());
if (type == QMetaType::QRegExp) {
QRegExp re = variant.value<QRegExp>();
@@ -1477,10 +1477,10 @@ void QtRuntimeMetaMethod::getOwnPropertyNames(ExecState* exec, PropertyNameArray
QtRuntimeMethod::getOwnPropertyNames(exec, propertyNames, mode);
}
-JSValue QtRuntimeMetaMethod::lengthGetter(ExecState* exec, JSValue, const Identifier&)
+JSValue QtRuntimeMetaMethod::lengthGetter(ExecState*, JSValue, const Identifier&)
{
// QtScript always returns 0
- return jsNumber(exec, 0);
+ return jsNumber(0);
}
JSValue QtRuntimeMetaMethod::connectGetter(ExecState* exec, JSValue slotBase, const Identifier& ident)
@@ -1683,10 +1683,10 @@ void QtRuntimeConnectionMethod::getOwnPropertyNames(ExecState* exec, PropertyNam
QtRuntimeMethod::getOwnPropertyNames(exec, propertyNames, mode);
}
-JSValue QtRuntimeConnectionMethod::lengthGetter(ExecState* exec, JSValue, const Identifier&)
+JSValue QtRuntimeConnectionMethod::lengthGetter(ExecState*, JSValue, const Identifier&)
{
// we have one formal argument, and one optional
- return jsNumber(exec, 1);
+ return jsNumber(1);
}
// ===============
diff --git a/WebCore/bridge/runtime_array.cpp b/WebCore/bridge/runtime_array.cpp
index ca12f48..2d0b7e3 100644
--- a/WebCore/bridge/runtime_array.cpp
+++ b/WebCore/bridge/runtime_array.cpp
@@ -50,10 +50,10 @@ RuntimeArray::~RuntimeArray()
delete getConcreteArray();
}
-JSValue RuntimeArray::lengthGetter(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue RuntimeArray::lengthGetter(ExecState*, JSValue slotBase, const Identifier&)
{
RuntimeArray* thisObj = static_cast<RuntimeArray*>(asObject(slotBase));
- return jsNumber(exec, thisObj->getLength());
+ return jsNumber(thisObj->getLength());
}
JSValue RuntimeArray::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
diff --git a/WebCore/bridge/runtime_method.cpp b/WebCore/bridge/runtime_method.cpp
index 15e029c..8a61f2e 100644
--- a/WebCore/bridge/runtime_method.cpp
+++ b/WebCore/bridge/runtime_method.cpp
@@ -52,7 +52,7 @@ RuntimeMethod::RuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, cons
{
}
-JSValue RuntimeMethod::lengthGetter(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue RuntimeMethod::lengthGetter(ExecState*, JSValue slotBase, const Identifier&)
{
RuntimeMethod* thisObj = static_cast<RuntimeMethod*>(asObject(slotBase));
@@ -62,7 +62,7 @@ JSValue RuntimeMethod::lengthGetter(ExecState* exec, JSValue slotBase, const Ide
// Java does.
// FIXME: a better solution might be to give the maximum number of parameters
// of any method
- return jsNumber(exec, thisObj->_methodList->at(0)->numParameters());
+ return jsNumber(thisObj->_methodList->at(0)->numParameters());
}
bool RuntimeMethod::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp
index 9f4c3be..3f6aa4a 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -913,7 +913,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
if (cursors && cursors->size() > 0) {
list = CSSValueList::createCommaSeparated();
for (unsigned i = 0; i < cursors->size(); ++i)
- list->append((*cursors)[i].image()->cssValue());
+ if (StyleImage* image = cursors->at(i).image())
+ list->append(image->cssValue());
}
RefPtr<CSSValue> value = CSSPrimitiveValue::create(style->cursor());
if (list) {
diff --git a/WebCore/css/CSSFontFaceSource.cpp b/WebCore/css/CSSFontFaceSource.cpp
index ad9bebc..4fdcc03 100644
--- a/WebCore/css/CSSFontFaceSource.cpp
+++ b/WebCore/css/CSSFontFaceSource.cpp
@@ -162,7 +162,7 @@ SimpleFontData* CSSFontFaceSource::getFontData(const FontDescription& fontDescri
if (!m_font->ensureCustomFontData())
return 0;
- fontData.set(new SimpleFontData(m_font->platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic, fontDescription.renderingMode()), true, false));
+ fontData.set(new SimpleFontData(m_font->platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic, fontDescription.orientation(), fontDescription.renderingMode()), true, false));
}
} else {
#if ENABLE(SVG_FONTS)
diff --git a/WebCore/css/CSSRule.h b/WebCore/css/CSSRule.h
index fc48dd6..1ffca93 100644
--- a/WebCore/css/CSSRule.h
+++ b/WebCore/css/CSSRule.h
@@ -30,6 +30,11 @@ namespace WebCore {
typedef int ExceptionCode;
+enum CSSRuleFilter {
+ AllCSSRules,
+ SameOriginCSSRulesOnly
+};
+
class CSSRule : public StyleBase {
public:
// FIXME: Change name to Type.
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index 9ae0505..881bf74 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -702,6 +702,8 @@ void CSSStyleSelector::matchRulesForList(CSSRuleDataList* rules, int& firstRuleI
for (CSSRuleData* d = rules->first(); d; d = d->next()) {
CSSStyleRule* rule = d->rule();
+ if (m_checker.m_sameOriginOnly && !m_checker.m_document->securityOrigin()->canRequest(rule->baseURL()))
+ continue;
if (checkSelector(d->selector())) {
// If the rule has no properties to apply, then ignore it in the non-debug mode.
CSSMutableStyleDeclaration* decl = rule->declaration();
@@ -817,6 +819,10 @@ inline void CSSStyleSelector::initElement(Element* e)
m_element = e;
m_styledElement = m_element && m_element->isStyledElement() ? static_cast<StyledElement*>(m_element) : 0;
m_elementLinkState = m_checker.determineLinkState(m_element);
+ if (e && e == e->document()->documentElement()) {
+ e->document()->setDirectionSetOnDocumentElement(false);
+ e->document()->setWritingModeSetOnDocumentElement(false);
+ }
}
}
@@ -884,6 +890,7 @@ CSSStyleSelector::SelectorChecker::SelectorChecker(Document* document, bool stri
: m_document(document)
, m_strictParsing(strictParsing)
, m_collectRulesOnly(false)
+ , m_sameOriginOnly(false)
, m_pseudoStyle(NOPSEUDO)
, m_documentIsHTML(document->isHTMLDocument())
, m_matchVisitedPseudoClass(false)
@@ -1105,13 +1112,23 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForDocument(Document* document)
documentStyle->setDisplay(BLOCK);
documentStyle->setVisuallyOrdered(document->visuallyOrdered());
documentStyle->setZoom(frame ? frame->pageZoomFactor() : 1);
+ documentStyle->setPageScaleTransform(frame ? frame->pageScaleFactor() : 1);
Element* docElement = document->documentElement();
- if (docElement && docElement->renderer()) {
- // Use the direction and block-flow of the document element to set the
- // viewport's direction and block-flow.
- documentStyle->setWritingMode(docElement->renderer()->style()->writingMode());
- documentStyle->setDirection(docElement->renderer()->style()->direction());
+ RenderObject* docElementRenderer = docElement ? docElement->renderer() : 0;
+ if (docElementRenderer) {
+ // Use the direction and writing-mode of the body to set the
+ // viewport's direction and writing-mode unless the property is set on the document element.
+ // If there is no body, then use the document element.
+ RenderObject* bodyRenderer = document->body() ? document->body()->renderer() : 0;
+ if (bodyRenderer && !document->writingModeSetOnDocumentElement())
+ documentStyle->setWritingMode(bodyRenderer->style()->writingMode());
+ else
+ documentStyle->setWritingMode(docElementRenderer->style()->writingMode());
+ if (bodyRenderer && !document->directionSetOnDocumentElement())
+ documentStyle->setDirection(bodyRenderer->style()->direction());
+ else
+ documentStyle->setDirection(docElementRenderer->style()->direction());
}
FontDescription fontDescription;
@@ -1866,12 +1883,12 @@ void CSSStyleSelector::cacheBorderAndBackground()
}
}
-PassRefPtr<CSSRuleList> CSSStyleSelector::styleRulesForElement(Element* e, bool authorOnly, bool includeEmptyRules)
+PassRefPtr<CSSRuleList> CSSStyleSelector::styleRulesForElement(Element* e, bool authorOnly, bool includeEmptyRules, CSSRuleFilter filter)
{
- return pseudoStyleRulesForElement(e, NOPSEUDO, authorOnly, includeEmptyRules);
+ return pseudoStyleRulesForElement(e, NOPSEUDO, authorOnly, includeEmptyRules, filter);
}
-PassRefPtr<CSSRuleList> CSSStyleSelector::pseudoStyleRulesForElement(Element* e, PseudoId pseudoId, bool authorOnly, bool includeEmptyRules)
+PassRefPtr<CSSRuleList> CSSStyleSelector::pseudoStyleRulesForElement(Element* e, PseudoId pseudoId, bool authorOnly, bool includeEmptyRules, CSSRuleFilter filter)
{
if (!e || !e->document()->haveStylesheetsLoaded())
return 0;
@@ -1894,13 +1911,17 @@ PassRefPtr<CSSRuleList> CSSStyleSelector::pseudoStyleRulesForElement(Element* e,
}
if (m_matchAuthorAndUserStyles) {
+ m_checker.m_sameOriginOnly = (filter == SameOriginCSSRulesOnly);
+
// Check the rules in author sheets.
int firstAuthorRule = -1, lastAuthorRule = -1;
matchRules(m_authorStyle.get(), firstAuthorRule, lastAuthorRule, includeEmptyRules);
+
+ m_checker.m_sameOriginOnly = false;
}
m_checker.m_collectRulesOnly = false;
-
+
return m_ruleList.release();
}
@@ -3224,6 +3245,8 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
return;
case CSSPropertyDirection:
HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(direction, Direction)
+ if (!isInherit && !isInitial && m_element && m_element == m_element->document()->documentElement())
+ m_element->document()->setDirectionSetOnDocumentElement(true);
return;
case CSSPropertyDisplay:
HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(display, Display)
@@ -5571,9 +5594,16 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
#endif
// CSS Text Layout Module Level 3: Vertical writing support
- case CSSPropertyWebkitWritingMode:
+ case CSSPropertyWebkitWritingMode: {
HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(writingMode, WritingMode)
+ if (!isInherit && !isInitial && m_element && m_element == m_element->document()->documentElement())
+ m_element->document()->setWritingModeSetOnDocumentElement(true);
+ FontDescription fontDescription = m_style->fontDescription();
+ fontDescription.setOrientation(m_style->isHorizontalWritingMode() ? Horizontal : Vertical);
+ if (m_style->setFontDescription(fontDescription))
+ m_fontDirty = true;
return;
+<<<<<<< HEAD
#ifdef ANDROID_CSS_RING
case CSSPropertyWebkitRing:
@@ -5719,6 +5749,9 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
}
#endif
+=======
+ }
+>>>>>>> webkit.org at r70949
#if ENABLE(SVG)
default:
// Try the SVG properties
@@ -6972,10 +7005,12 @@ void CSSStyleSelector::loadPendingImages()
case CSSPropertyCursor: {
if (CursorList* cursorList = m_style->cursors()) {
for (size_t i = 0; i < cursorList->size(); ++i) {
- CursorData& currentCursor = (*cursorList)[i];
- if (currentCursor.image()->isPendingImage()) {
- CSSImageValue* imageValue = static_cast<StylePendingImage*>(currentCursor.image())->cssImageValue();
- currentCursor.setImage(imageValue->cachedImage(cachedResourceLoader));
+ CursorData& currentCursor = cursorList->at(i);
+ if (StyleImage* image = currentCursor.image()) {
+ if (image->isPendingImage()) {
+ CSSImageValue* imageValue = static_cast<StylePendingImage*>(image)->cssImageValue();
+ currentCursor.setImage(imageValue->cachedImage(cachedResourceLoader));
+ }
}
}
}
diff --git a/WebCore/css/CSSStyleSelector.h b/WebCore/css/CSSStyleSelector.h
index 5f70e05..20cd866 100644
--- a/WebCore/css/CSSStyleSelector.h
+++ b/WebCore/css/CSSStyleSelector.h
@@ -23,6 +23,7 @@
#define CSSStyleSelector_h
#include "CSSFontSelector.h"
+#include "CSSRule.h"
#include "LinkHash.h"
#include "MediaQueryExp.h"
#include "RenderStyle.h"
@@ -119,8 +120,8 @@ public:
public:
// These methods will give back the set of rules that matched for a given element (or a pseudo-element).
- PassRefPtr<CSSRuleList> styleRulesForElement(Element*, bool authorOnly, bool includeEmptyRules = false);
- PassRefPtr<CSSRuleList> pseudoStyleRulesForElement(Element*, PseudoId, bool authorOnly, bool includeEmptyRules = false);
+ PassRefPtr<CSSRuleList> styleRulesForElement(Element*, bool authorOnly, bool includeEmptyRules = false, CSSRuleFilter filter = AllCSSRules);
+ PassRefPtr<CSSRuleList> pseudoStyleRulesForElement(Element*, PseudoId, bool authorOnly, bool includeEmptyRules = false, CSSRuleFilter filter = AllCSSRules);
// Given a CSS keyword in the range (xx-small to -webkit-xxx-large), this function will return
// the correct font size scaled relative to the user's default (medium).
@@ -231,6 +232,7 @@ public:
Document* m_document;
bool m_strictParsing;
bool m_collectRulesOnly;
+ bool m_sameOriginOnly;
PseudoId m_pseudoStyle;
bool m_documentIsHTML;
mutable bool m_matchVisitedPseudoClass;
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 9ad263c..272387d 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -62,6 +62,7 @@
#include "FocusController.h"
#include "Frame.h"
#include "FrameLoader.h"
+#include "FrameLoaderClient.h"
#include "FrameTree.h"
#include "FrameView.h"
#include "HashChangeEvent.h"
@@ -381,7 +382,7 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML, con
, m_frameElementsShouldIgnoreScrolling(false)
, m_containsValidityStyleRules(false)
, m_updateFocusAppearanceRestoresSelection(false)
- , m_writeDisabled(false)
+ , m_ignoreDestructiveWriteCount(0)
, m_title("")
, m_rawTitle("")
, m_titleSetExplicitly(false)
@@ -425,6 +426,8 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML, con
#endif
, m_loadEventDelayCount(0)
, m_loadEventDelayTimer(this, &Document::loadEventDelayTimerFired)
+ , m_directionSetOnDocumentElement(false)
+ , m_writingModeSetOnDocumentElement(false)
{
m_document = this;
@@ -2178,10 +2181,8 @@ void Document::write(const SegmentedString& text, Document* ownerDocument)
printf("Beginning a document.write at %d\n", elapsedTime());
#endif
- // If the insertion point is undefined and the Document has the
- // "write-neutralised" flag set, then abort these steps.
bool hasInsertionPoint = m_parser && m_parser->hasInsertionPoint();
- if (!hasInsertionPoint && writeDisabled())
+ if (!hasInsertionPoint && m_ignoreDestructiveWriteCount)
return;
if (!hasInsertionPoint)
@@ -3924,6 +3925,9 @@ void Document::documentDidBecomeActive()
if (renderer())
renderView()->didMoveOnscreen();
#endif
+
+ ASSERT(m_frame);
+ m_frame->loader()->client()->dispatchDidBecomeFrameset(isFrameSet());
}
void Document::registerForDocumentActivationCallbacks(Element* e)
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index 25122b5..2d169e7 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -841,6 +841,11 @@ public:
DocumentMarkerController* markers() const { return m_markers.get(); }
+ bool directionSetOnDocumentElement() const { return m_directionSetOnDocumentElement; }
+ bool writingModeSetOnDocumentElement() const { return m_writingModeSetOnDocumentElement; }
+ void setDirectionSetOnDocumentElement(bool b) { m_directionSetOnDocumentElement = b; }
+ void setWritingModeSetOnDocumentElement(bool b) { m_writingModeSetOnDocumentElement = b; }
+
bool execCommand(const String& command, bool userInterface = false, const String& value = String());
bool queryCommandEnabled(const String& command);
bool queryCommandIndeterm(const String& command);
@@ -1043,9 +1048,6 @@ public:
void webkitDidExitFullScreenForElement(Element*);
#endif
- bool writeDisabled() const { return m_writeDisabled; }
- void setWriteDisabled(bool flag) { m_writeDisabled = flag; }
-
// Used to allow element that loads data without going through a FrameLoader to delay the 'load' event.
void incrementLoadEventDelayCount() { ++m_loadEventDelayCount; }
void decrementLoadEventDelayCount();
@@ -1063,6 +1065,8 @@ protected:
private:
+ friend class IgnoreDestructiveWriteCountIncrementer;
+
void detachParser();
typedef void (*ArgumentsCallback)(const String& keyString, const String& valueString, Document*, void* data);
@@ -1220,8 +1224,8 @@ private:
bool m_containsValidityStyleRules;
bool m_updateFocusAppearanceRestoresSelection;
- // http://www.whatwg.org/specs/web-apps/current-work/#write-neutralised
- bool m_writeDisabled;
+ // http://www.whatwg.org/specs/web-apps/current-work/#ignore-destructive-writes-counter
+ unsigned m_ignoreDestructiveWriteCount;
String m_title;
String m_rawTitle;
@@ -1353,6 +1357,9 @@ private:
Timer<Document> m_loadEventDelayTimer;
ViewportArguments m_viewportArguments;
+
+ bool m_directionSetOnDocumentElement;
+ bool m_writingModeSetOnDocumentElement;
};
inline bool Document::hasElementWithId(AtomicStringImpl* id) const
diff --git a/WebCore/dom/DocumentMarker.h b/WebCore/dom/DocumentMarker.h
index dd5e981..2be60f8 100644
--- a/WebCore/dom/DocumentMarker.h
+++ b/WebCore/dom/DocumentMarker.h
@@ -33,18 +33,17 @@ namespace WebCore {
// It also optionally includes a flag specifying whether the match is active, which is ignored
// for all types other than type TextMatch.
struct DocumentMarker {
-
enum MarkerType {
- AllMarkers = -1,
- Spelling,
- Grammar,
- TextMatch,
- Replacement,
- CorrectionIndicator,
- RejectedCorrection
+ Spelling = 1 << 0,
+ Grammar = 1 << 1,
+ TextMatch = 1 << 2,
+ Replacement = 1 << 3,
+ CorrectionIndicator = 1 << 4,
+ RejectedCorrection = 1 << 5,
+ AllMarkers = Spelling | Grammar | TextMatch | Replacement | CorrectionIndicator | RejectedCorrection
};
-
MarkerType type;
+ typedef unsigned MarkerTypes;
unsigned startOffset;
unsigned endOffset;
String description;
diff --git a/WebCore/dom/DocumentMarkerController.cpp b/WebCore/dom/DocumentMarkerController.cpp
index 2b7fd85..3b7abcc 100644
--- a/WebCore/dom/DocumentMarkerController.cpp
+++ b/WebCore/dom/DocumentMarkerController.cpp
@@ -321,15 +321,11 @@ Vector<IntRect> DocumentMarkerController::renderedRectsForMarkers(DocumentMarker
return result;
}
-void DocumentMarkerController::removeMarkers(Node* node)
+void DocumentMarkerController::removeMarkers(Node* node, DocumentMarker::MarkerType markerType)
{
- MarkerMap::iterator i = m_markers.find(node);
- if (i != m_markers.end()) {
- delete i->second;
- m_markers.remove(i);
- if (RenderObject* renderer = node->renderer())
- renderer->repaint();
- }
+ MarkerMap::iterator iterator = m_markers.find(node);
+ if (iterator != m_markers.end())
+ removeMarkersFromMarkerMapVectorPair(node, iterator->second, markerType);
}
void DocumentMarkerController::removeMarkers(DocumentMarker::MarkerType markerType)
@@ -339,10 +335,21 @@ void DocumentMarkerController::removeMarkers(DocumentMarker::MarkerType markerTy
MarkerMap::iterator end = markerMapCopy.end();
for (MarkerMap::iterator i = markerMapCopy.begin(); i != end; ++i) {
Node* node = i->first.get();
- bool nodeNeedsRepaint = false;
-
- // inner loop: process each marker in the current node
MarkerMapVectorPair* vectorPair = i->second;
+ removeMarkersFromMarkerMapVectorPair(node, vectorPair, markerType);
+ }
+}
+
+// This function may release node and vectorPair.
+void DocumentMarkerController::removeMarkersFromMarkerMapVectorPair(Node* node, MarkerMapVectorPair* vectorPair, DocumentMarker::MarkerType markerType)
+{
+ if (markerType == DocumentMarker::AllMarkers) {
+ delete vectorPair;
+ m_markers.remove(node);
+ if (RenderObject* renderer = node->renderer())
+ renderer->repaint();
+ } else {
+ bool needsRepaint = false;
Vector<DocumentMarker>& markers = vectorPair->first;
Vector<IntRect>& rects = vectorPair->second;
ASSERT(markers.size() == rects.size());
@@ -350,7 +357,7 @@ void DocumentMarkerController::removeMarkers(DocumentMarker::MarkerType markerTy
DocumentMarker marker = markers[i];
// skip nodes that are not of the specified type
- if (marker.type != markerType && markerType != DocumentMarker::AllMarkers) {
+ if (marker.type != markerType) {
++i;
continue;
}
@@ -358,13 +365,13 @@ void DocumentMarkerController::removeMarkers(DocumentMarker::MarkerType markerTy
// pitch the old marker
markers.remove(i);
rects.remove(i);
- nodeNeedsRepaint = true;
- // markerIterator now points to the next node
+ needsRepaint = true;
+ // i now is the index of the next marker
}
- // Redraw the node if it changed. Do this before the node is removed from m_markers, since
+ // Redraw the node if it changed. Do this before the node is removed from m_markers, since
// m_markers might contain the last reference to the node.
- if (nodeNeedsRepaint) {
+ if (needsRepaint) {
RenderObject* renderer = node->renderer();
if (renderer)
renderer->repaint();
@@ -524,4 +531,40 @@ void DocumentMarkerController::setMarkersActive(Node* node, unsigned startOffset
node->renderer()->repaint();
}
+bool DocumentMarkerController::hasMarkers(Range* range, DocumentMarker::MarkerTypes markerTypes)
+{
+ if (m_markers.isEmpty())
+ return false;
+
+ Node* startContainer = range->startContainer();
+ ASSERT(startContainer);
+ Node* endContainer = range->endContainer();
+ ASSERT(endContainer);
+
+ Node* pastLastNode = range->pastLastNode();
+ for (Node* node = range->firstNode(); node != pastLastNode; node = node->traverseNextNode()) {
+ Vector<DocumentMarker> markers = markersForNode(node);
+ Vector<DocumentMarker>::const_iterator end = markers.end();
+ for (Vector<DocumentMarker>::const_iterator it = markers.begin(); it != end; ++it) {
+ if (!(markerTypes & it->type))
+ continue;
+ if (node == startContainer && node == endContainer) {
+ // The range spans only one node.
+ if (it->endOffset > static_cast<unsigned>(range->startOffset()) && it->startOffset < static_cast<unsigned>(range->endOffset()))
+ return true;
+ } else {
+ if (node == startContainer) {
+ if (it->endOffset > static_cast<unsigned>(range->startOffset()))
+ return true;
+ } else if (node == endContainer) {
+ if (it->startOffset < static_cast<unsigned>(range->endOffset()))
+ return true;
+ } else
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
} // namespace WebCore
diff --git a/WebCore/dom/DocumentMarkerController.h b/WebCore/dom/DocumentMarkerController.h
index 8921baa..96fb7f3 100644
--- a/WebCore/dom/DocumentMarkerController.h
+++ b/WebCore/dom/DocumentMarkerController.h
@@ -46,10 +46,11 @@ public:
void addMarker(Range*, DocumentMarker::MarkerType, String description = String());
void addMarker(Node*, DocumentMarker);
void copyMarkers(Node* srcNode, unsigned startOffset, int length, Node* dstNode, int delta, DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
+ bool hasMarkers(Range*, DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers);
void removeMarkers(Range*, DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
void removeMarkers(Node*, unsigned startOffset, int length, DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
void removeMarkers(DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
- void removeMarkers(Node*);
+ void removeMarkers(Node*, DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
void repaintMarkers(DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
void setRenderedRectForMarker(Node*, const DocumentMarker&, const IntRect&);
void invalidateRenderedRectsForMarkersInRect(const IntRect&);
@@ -65,6 +66,7 @@ private:
typedef std::pair<Vector<DocumentMarker>, Vector<IntRect> > MarkerMapVectorPair;
typedef HashMap<RefPtr<Node>, MarkerMapVectorPair*> MarkerMap;
MarkerMap m_markers;
+ void removeMarkersFromMarkerMapVectorPair(Node*, MarkerMapVectorPair*, DocumentMarker::MarkerType);
};
} // namespace WebCore
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index 10ba71b..a86f30a 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -31,6 +31,7 @@
#include "CSSParser.h"
#include "CSSSelectorList.h"
#include "CSSStyleSelector.h"
+#include "ClassList.h"
#include "ClientRect.h"
#include "ClientRectList.h"
#include "DOMTokenList.h"
@@ -52,13 +53,13 @@
#include "RenderLayer.h"
#include "RenderView.h"
#include "RenderWidget.h"
-#include "SVGStyledLocatableElement.h"
#include "Settings.h"
#include "TextIterator.h"
#include "XMLNames.h"
#include <wtf/text/CString.h>
#if ENABLE(SVG)
+#include "SVGElement.h"
#include "SVGNames.h"
#endif
@@ -457,6 +458,41 @@ int Element::scrollHeight() const
return 0;
}
+IntRect Element::boundsInWindowSpace() const
+{
+ document()->updateLayoutIgnorePendingStylesheets();
+
+ FrameView* view = document()->view();
+ if (!view)
+ return IntRect();
+
+ Vector<FloatQuad> quads;
+#if ENABLE(SVG)
+ if (isSVGElement() && renderer()) {
+ // Get the bounding rectangle from the SVG model.
+ const SVGElement* svgElement = static_cast<const SVGElement*>(this);
+ FloatRect localRect;
+ if (svgElement->boundingBox(localRect))
+ quads.append(renderer()->localToAbsoluteQuad(localRect));
+ } else
+#endif
+ {
+ // Get the bounding rectangle from the box model.
+ if (renderBoxModelObject())
+ renderBoxModelObject()->absoluteQuads(quads);
+ }
+
+ if (quads.isEmpty())
+ return IntRect();
+
+ IntRect result = quads[0].enclosingBoundingBox();
+ for (size_t i = 1; i < quads.size(); ++i)
+ result.unite(quads[i].enclosingBoundingBox());
+
+ result = view->contentsToWindow(result);
+ return result;
+}
+
PassRefPtr<ClientRectList> Element::getClientRects() const
{
document()->updateLayoutIgnorePendingStylesheets();
@@ -488,15 +524,12 @@ PassRefPtr<ClientRect> Element::getBoundingClientRect() const
Vector<FloatQuad> quads;
#if ENABLE(SVG)
- if (isSVGElement()) {
+ if (isSVGElement() && renderer()) {
// Get the bounding rectangle from the SVG model.
const SVGElement* svgElement = static_cast<const SVGElement*>(this);
- if (svgElement->isStyledLocatable()) {
- if (renderer()) {
- const FloatRect& localRect = static_cast<const SVGStyledLocatableElement*>(svgElement)->getBBox();
- quads.append(renderer()->localToAbsoluteQuad(localRect));
- }
- }
+ FloatRect localRect;
+ if (svgElement->boundingBox(localRect))
+ quads.append(renderer()->localToAbsoluteQuad(localRect));
} else
#endif
{
@@ -517,9 +550,7 @@ PassRefPtr<ClientRect> Element::getBoundingClientRect() const
result.move(-visibleContentRect.x(), -visibleContentRect.y());
}
- if (renderBoxModelObject())
- adjustIntRectForAbsoluteZoom(result, renderBoxModelObject());
-
+ adjustIntRectForAbsoluteZoom(result, renderer());
return ClientRect::create(result);
}
@@ -1588,7 +1619,7 @@ DOMTokenList* Element::classList()
{
ElementRareData* data = ensureRareData();
if (!data->m_classList)
- data->m_classList = DOMTokenList::create(this);
+ data->m_classList = ClassList::create(this);
return data->m_classList.get();
}
@@ -1681,4 +1712,37 @@ void Element::webkitRequestFullScreen(unsigned short flags)
}
#endif
+SpellcheckAttributeState Element::spellcheckAttributeState() const
+{
+ if (!hasAttribute(HTMLNames::spellcheckAttr))
+ return SpellcheckAttributeDefault;
+
+ const AtomicString& value = getAttribute(HTMLNames::spellcheckAttr);
+ if (equalIgnoringCase(value, "true") || equalIgnoringCase(value, ""))
+ return SpellcheckAttributeTrue;
+ if (equalIgnoringCase(value, "false"))
+ return SpellcheckAttributeFalse;
+
+ return SpellcheckAttributeDefault;
+}
+
+bool Element::isSpellCheckingEnabled() const
+{
+ const Element* element = this;
+ while (element) {
+ switch (element->spellcheckAttributeState()) {
+ case SpellcheckAttributeTrue:
+ return true;
+ case SpellcheckAttributeFalse:
+ return false;
+ case SpellcheckAttributeDefault:
+ break;
+ }
+
+ element = element->parentElement();
+ }
+
+ return true;
+}
+
} // namespace WebCore
diff --git a/WebCore/dom/Element.h b/WebCore/dom/Element.h
index b890ecd..67887cc 100644
--- a/WebCore/dom/Element.h
+++ b/WebCore/dom/Element.h
@@ -40,6 +40,12 @@ class DOMTokenList;
class ElementRareData;
class IntSize;
+enum SpellcheckAttributeState {
+ SpellcheckAttributeTrue,
+ SpellcheckAttributeFalse,
+ SpellcheckAttributeDefault
+};
+
class Element : public ContainerNode {
public:
static PassRefPtr<Element> create(const QualifiedName&, Document*);
@@ -159,6 +165,8 @@ public:
virtual int scrollWidth() const;
virtual int scrollHeight() const;
+ IntRect boundsInWindowSpace() const;
+
PassRefPtr<ClientRectList> getClientRects() const;
PassRefPtr<ClientRect> getBoundingClientRect() const;
@@ -318,6 +326,8 @@ public:
void webkitRequestFullScreen(unsigned short flags);
#endif
+ bool isSpellCheckingEnabled() const;
+
protected:
Element(const QualifiedName& tagName, Document* document, ConstructionType type)
: ContainerNode(document, type)
@@ -373,7 +383,9 @@ private:
ElementRareData* rareData() const;
ElementRareData* ensureRareData();
-
+
+ SpellcheckAttributeState spellcheckAttributeState() const;
+
private:
mutable RefPtr<NamedNodeMap> m_attributeMap;
};
diff --git a/WebCore/dom/ElementRareData.h b/WebCore/dom/ElementRareData.h
index f1e6334..06bfe0c 100644
--- a/WebCore/dom/ElementRareData.h
+++ b/WebCore/dom/ElementRareData.h
@@ -22,7 +22,7 @@
#ifndef ElementRareData_h
#define ElementRareData_h
-#include "DOMTokenList.h"
+#include "ClassList.h"
#include "DatasetDOMStringMap.h"
#include "Element.h"
#include "NodeRareData.h"
@@ -43,7 +43,7 @@ public:
RefPtr<RenderStyle> m_computedStyle;
OwnPtr<DatasetDOMStringMap> m_datasetDOMStringMap;
- OwnPtr<DOMTokenList> m_classList;
+ OwnPtr<ClassList> m_classList;
};
inline IntSize defaultMinimumSizeForResizing()
diff --git a/WebCore/dom/EventListener.h b/WebCore/dom/EventListener.h
index 96bc858..96d0beb 100644
--- a/WebCore/dom/EventListener.h
+++ b/WebCore/dom/EventListener.h
@@ -43,7 +43,8 @@ namespace WebCore {
ObjCEventListenerType,
CPPEventListenerType,
ConditionEventListenerType,
- GObjectEventListenerType
+ GObjectEventListenerType,
+ NativeEventListenerType
};
virtual ~EventListener() { }
diff --git a/WebCore/dom/ExceptionCode.cpp b/WebCore/dom/ExceptionCode.cpp
index 9303f9e..f048fe5 100644
--- a/WebCore/dom/ExceptionCode.cpp
+++ b/WebCore/dom/ExceptionCode.cpp
@@ -42,6 +42,10 @@
#include "SQLException.h"
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+#include "FileException.h"
+#endif
+
namespace WebCore {
static const char* const exceptionNames[] = {
@@ -173,6 +177,38 @@ static const char* const sqlExceptionDescriptions[] = {
};
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+static const char* const fileExceptionNames[] = {
+ "NOT_FOUND_ERR",
+ "SECURITY_ERR",
+ "ABORT_ERR",
+ "NOT_READABLE_ERR",
+ "ENCODING_ERR",
+ "NO_MODIFICATION_ALLOWED_ERR",
+ "INVALID_STATE_ERR",
+ "SYNTAX_ERR",
+ "INVALID_MODIFICATION_ERR",
+ "QUOTA_EXCEEDED_ERR",
+ "TYPE_MISMATCH_ERR",
+ "PATH_EXISTS_ERR"
+};
+
+static const char* const fileExceptionDescriptions[] = {
+ "A requested file or directory could not be found at the time an operation was processed.",
+ "It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.",
+ "An ongoing operation was aborted, typically with a call to abort().",
+ "The requested file could not be read, typically due to permission problems that have occured after a reference to a file was acquired.",
+ "A URI supplied to the API was malformed, or the resulting Data URL has exceeded the URL length limitations for Data URLs.",
+ "An attempt was made to write to a file or directory which could not be modified due to the state of the underlying filesystem.",
+ "An operation that depends on state cached in an interface object was made but the state had changed since it was read from disk.",
+ "An invalid or unsupported argument was given, like an invalid line ending specifier.",
+ "The modification request was illegal.",
+ "The operation failed because it would cause the application to exceed its storage quota.",
+ "The path supplied exists, but was not an entry of requested type.",
+ "An attempt was made to create a file or directory where an element already exists."
+};
+#endif
+
void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& description)
{
ASSERT(ec);
@@ -241,6 +277,16 @@ void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& des
nameTableSize = sizeof(sqlExceptionNames) / sizeof(sqlExceptionNames[0]);
nameTableOffset = SQLException::UNKNOWN_ERR;
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+ } else if (code >= FileException::FileExceptionOffset && code <= FileException::FileExceptionMax) {
+ type = FileExceptionType;
+ typeName = "DOM File";
+ code -= FileException::FileExceptionOffset;
+ nameTable = fileExceptionNames;
+ descriptionTable = fileExceptionDescriptions;
+ nameTableSize = sizeof(fileExceptionNames) / sizeof(fileExceptionNames[0]);
+ nameTableOffset = FileException::NOT_FOUND_ERR;
+#endif
} else {
type = DOMExceptionType;
typeName = "DOM";
diff --git a/WebCore/dom/ExceptionCode.h b/WebCore/dom/ExceptionCode.h
index cbbf650..6ea9f7d 100644
--- a/WebCore/dom/ExceptionCode.h
+++ b/WebCore/dom/ExceptionCode.h
@@ -81,6 +81,9 @@ namespace WebCore {
#if ENABLE(DATABASE)
, SQLExceptionType
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+ , FileExceptionType
+#endif
};
diff --git a/WebCore/dom/IgnoreDestructiveWriteCountIncrementer.h b/WebCore/dom/IgnoreDestructiveWriteCountIncrementer.h
new file mode 100644
index 0000000..9d1835a
--- /dev/null
+++ b/WebCore/dom/IgnoreDestructiveWriteCountIncrementer.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IgnoreDestructiveWriteCountIncrementer_h
+#define IgnoreDestructiveWriteCountIncrementer_h
+
+#include "Document.h"
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class IgnoreDestructiveWriteCountIncrementer : public Noncopyable {
+public:
+ explicit IgnoreDestructiveWriteCountIncrementer(Document* document)
+ : m_count(document ? &document->m_ignoreDestructiveWriteCount : 0)
+ {
+ if (!m_count)
+ return;
+ ++(*m_count);
+ }
+
+ ~IgnoreDestructiveWriteCountIncrementer()
+ {
+ if (!m_count)
+ return;
+ --(*m_count);
+ }
+
+private:
+ unsigned* m_count;
+};
+
+}
+
+#endif
diff --git a/WebCore/dom/InputElement.cpp b/WebCore/dom/InputElement.cpp
index ecae206..85f37e1 100644
--- a/WebCore/dom/InputElement.cpp
+++ b/WebCore/dom/InputElement.cpp
@@ -107,10 +107,7 @@ void InputElement::updateSelectionRange(InputElement* inputElement, Element* ele
if (!inputElement->isTextField())
return;
- element->document()->updateLayoutIgnorePendingStylesheets();
-
- if (RenderTextControl* renderer = toRenderTextControl(element->renderer()))
- renderer->setSelectionRange(start, end);
+ setSelectionRange(element, start, end);
}
void InputElement::aboutToUnload(InputElement* inputElement, Element* element)
diff --git a/WebCore/dom/KeyboardEvent.h b/WebCore/dom/KeyboardEvent.h
index 793ac41..30a2ef0 100644
--- a/WebCore/dom/KeyboardEvent.h
+++ b/WebCore/dom/KeyboardEvent.h
@@ -33,8 +33,9 @@ namespace WebCore {
#if PLATFORM(MAC)
struct KeypressCommand {
- KeypressCommand(const String& commandName) : commandName(commandName) {}
- KeypressCommand(const String& commandName, const String& text) : commandName(commandName), text(text) { ASSERT(commandName == "insertText:"); }
+ KeypressCommand() { }
+ KeypressCommand(const String& commandName) : commandName(commandName) { }
+ KeypressCommand(const String& commandName, const String& text) : commandName(commandName), text(text) { ASSERT(commandName == "insertText:" || commandName == "insertText"); }
String commandName;
String text;
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 5c67bfd..cea2e07 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -1085,13 +1085,13 @@ static bool isChildTypeAllowed(Node* newParent, Node* child)
if (child->nodeType() != Node::DOCUMENT_FRAGMENT_NODE) {
if (!newParent->childTypeAllowed(child->nodeType()))
return false;
+ return true;
}
for (Node *n = child->firstChild(); n; n = n->nextSibling()) {
if (!newParent->childTypeAllowed(n->nodeType()))
return false;
}
-
return true;
}
@@ -2992,7 +2992,7 @@ void Node::defaultEventHandler(Event* event)
if (Frame* frame = document()->frame())
frame->eventHandler()->defaultTextInputEventHandler(static_cast<TextEvent*>(event));
#if ENABLE(PAN_SCROLLING)
- } else if (eventType == eventNames().mousedownEvent) {
+ } else if (eventType == eventNames().mousedownEvent && event->isMouseEvent()) {
MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
if (mouseEvent->button() == MiddleButton) {
if (enclosingLinkEventParentOrSelf())
diff --git a/WebCore/dom/ScriptElement.cpp b/WebCore/dom/ScriptElement.cpp
index 46c85e3..28c7594 100644
--- a/WebCore/dom/ScriptElement.cpp
+++ b/WebCore/dom/ScriptElement.cpp
@@ -33,6 +33,7 @@
#include "FrameLoader.h"
#include "HTMLNames.h"
#include "HTMLScriptElement.h"
+#include "IgnoreDestructiveWriteCountIncrementer.h"
#include "MIMETypeRegistry.h"
#include "Page.h"
#include "ScriptController.h"
@@ -57,14 +58,6 @@ void ScriptElement::insertedIntoDocument(ScriptElementData& data, const String&
// http://www.whatwg.org/specs/web-apps/current-work/#script
- // If the element's Document has an active parser, and the parser's script
- // nesting level is non-zero, but this script element does not have the
- // "parser-inserted" flag set, the user agent must set the element's
- // "write-neutralised" flag.
- DocumentParser* parser = data.element()->document()->parser();
- if (parser && parser->hasInsertionPoint())
- data.setWriteDisabled(true);
-
if (!sourceUrl.isEmpty()) {
data.requestScript(sourceUrl);
return;
@@ -142,7 +135,6 @@ ScriptElementData::ScriptElementData(ScriptElement* scriptElement, Element* elem
, m_element(element)
, m_cachedScript(0)
, m_createdByParser(false)
- , m_writeDisabled(false)
, m_requested(false)
, m_evaluated(false)
, m_firedLoad(false)
@@ -191,7 +183,9 @@ void ScriptElementData::evaluateScript(const ScriptSourceCode& sourceCode)
if (m_evaluated || sourceCode.isEmpty() || !shouldExecuteAsJavaScript())
return;
- if (Frame* frame = m_element->document()->frame()) {
+ RefPtr<Document> document = m_element->document();
+ ASSERT(document);
+ if (Frame* frame = document->frame()) {
if (!frame->script()->canExecuteScripts(AboutToExecuteScript))
return;
@@ -199,25 +193,12 @@ void ScriptElementData::evaluateScript(const ScriptSourceCode& sourceCode)
// http://www.whatwg.org/specs/web-apps/current-work/#script
- // If the script element's "write-neutralised" flag is set, then flag
- // the Document the script element was in when the "write-neutralised"
- // flag was set as being itself "write-neutralised". Let neutralised doc
- // be that Document.
- if (m_writeDisabled) {
- ASSERT(!m_element->document()->writeDisabled());
- m_element->document()->setWriteDisabled(true);
- }
-
- // Create a script from the script element node, using the script
- // block's source and the script block's type.
- // Note: This is where the script is compiled and actually executed.
- frame->script()->evaluate(sourceCode);
-
- // Remove the "write-neutralised" flag from neutralised doc, if it was
- // set in the earlier step.
- if (m_writeDisabled) {
- ASSERT(m_element->document()->writeDisabled());
- m_element->document()->setWriteDisabled(false);
+ {
+ IgnoreDestructiveWriteCountIncrementer ignoreDesctructiveWriteCountIncrementer(m_requested ? document.get() : 0);
+ // Create a script from the script element node, using the script
+ // block's source and the script block's type.
+ // Note: This is where the script is compiled and actually executed.
+ frame->script()->evaluate(sourceCode);
}
Document::updateStyleForAllDocuments();
diff --git a/WebCore/dom/ScriptElement.h b/WebCore/dom/ScriptElement.h
index 698ffbc..c663e43 100644
--- a/WebCore/dom/ScriptElement.h
+++ b/WebCore/dom/ScriptElement.h
@@ -82,8 +82,6 @@ public:
Element* element() const { return m_element; }
bool createdByParser() const { return m_createdByParser; }
void setCreatedByParser(bool value) { m_createdByParser = value; }
- bool writeDisabled() const { return m_writeDisabled; }
- void setWriteDisabled(bool value) { m_writeDisabled = value; }
bool haveFiredLoadEvent() const { return m_firedLoad; }
void setHaveFiredLoadEvent(bool firedLoad) { m_firedLoad = firedLoad; }
@@ -101,7 +99,6 @@ private:
Element* m_element;
CachedResourceHandle<CachedScript> m_cachedScript;
bool m_createdByParser; // HTML5: "parser-inserted"
- bool m_writeDisabled; // http://www.whatwg.org/specs/web-apps/current-work/#write-neutralised
bool m_requested;
bool m_evaluated; // HTML5: "already started"
bool m_firedLoad;
diff --git a/WebCore/dom/SpaceSplitString.cpp b/WebCore/dom/SpaceSplitString.cpp
index 8a2710c..4bd5b1b 100644
--- a/WebCore/dom/SpaceSplitString.cpp
+++ b/WebCore/dom/SpaceSplitString.cpp
@@ -23,6 +23,7 @@
#include "HTMLParserIdioms.h"
#include <wtf/ASCIICType.h>
+#include <wtf/text/StringBuilder.h>
using namespace WTF;
@@ -90,4 +91,37 @@ bool SpaceSplitStringData::containsAll(SpaceSplitStringData& other)
return true;
}
+void SpaceSplitStringData::add(const AtomicString& string)
+{
+ if (contains(string))
+ return;
+
+ m_vector.append(string);
+}
+
+void SpaceSplitStringData::remove(const AtomicString& string)
+{
+ ensureVector();
+
+ size_t position = 0;
+ while (position < m_vector.size()) {
+ if (m_vector[position] == string)
+ m_vector.remove(position);
+ else
+ ++position;
+ }
+}
+
+void SpaceSplitString::add(const AtomicString& string)
+{
+ if (m_data)
+ m_data->add(string);
+}
+
+void SpaceSplitString::remove(const AtomicString& string)
+{
+ if (m_data)
+ m_data->remove(string);
+}
+
} // namespace WebCore
diff --git a/WebCore/dom/SpaceSplitString.h b/WebCore/dom/SpaceSplitString.h
index 09ca8d9..826e6bd 100644
--- a/WebCore/dom/SpaceSplitString.h
+++ b/WebCore/dom/SpaceSplitString.h
@@ -48,6 +48,9 @@ namespace WebCore {
bool containsAll(SpaceSplitStringData&);
+ void add(const AtomicString&);
+ void remove(const AtomicString&);
+
size_t size() { ensureVector(); return m_vector.size(); }
const AtomicString& operator[](size_t i) { ensureVector(); ASSERT(i < size()); return m_vector[i]; }
@@ -72,6 +75,8 @@ namespace WebCore {
bool contains(const AtomicString& string) const { return m_data && m_data->contains(string); }
bool containsAll(const SpaceSplitString& names) const { return !names.m_data || (m_data && m_data->containsAll(*names.m_data)); }
+ void add(const AtomicString&);
+ void remove(const AtomicString&);
size_t size() const { return m_data ? m_data->size() : 0; }
bool isNull() const { return !m_data; }
diff --git a/WebCore/dom/StyledElement.cpp b/WebCore/dom/StyledElement.cpp
index 12744cb..7384c0b 100644
--- a/WebCore/dom/StyledElement.cpp
+++ b/WebCore/dom/StyledElement.cpp
@@ -25,6 +25,7 @@
#include "StyledElement.h"
#include "Attribute.h"
+#include "ClassList.h"
#include "CSSStyleSelector.h"
#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
@@ -222,7 +223,7 @@ void StyledElement::classAttributeChanged(const AtomicString& newClassString)
if (hasClass) {
attributes()->setClass(newClassString);
if (DOMTokenList* classList = optionalClassList())
- classList->reset(newClassString);
+ static_cast<ClassList*>(classList)->reset(newClassString);
} else if (attributeMap())
attributeMap()->clearClass();
setNeedsStyleRecalc();
diff --git a/WebCore/dom/StyledElement.h b/WebCore/dom/StyledElement.h
index 4b62388..8040dbf 100644
--- a/WebCore/dom/StyledElement.h
+++ b/WebCore/dom/StyledElement.h
@@ -32,7 +32,6 @@
namespace WebCore {
class Attribute;
-class ClassList;
class CSSMappedAttributeDeclaration;
class StyledElement : public Element {
diff --git a/WebCore/editing/ApplyStyleCommand.cpp b/WebCore/editing/ApplyStyleCommand.cpp
index 3f60a8b..8862da7 100644
--- a/WebCore/editing/ApplyStyleCommand.cpp
+++ b/WebCore/editing/ApplyStyleCommand.cpp
@@ -538,6 +538,7 @@ ApplyStyleCommand::ApplyStyleCommand(Document* document, CSSStyleDeclaration* st
, m_useEndingSelection(true)
, m_styledInlineElement(0)
, m_removeOnly(false)
+ , m_isInlineElementToRemoveFunction(0)
{
}
@@ -551,6 +552,7 @@ ApplyStyleCommand::ApplyStyleCommand(Document* document, CSSStyleDeclaration* st
, m_useEndingSelection(false)
, m_styledInlineElement(0)
, m_removeOnly(false)
+ , m_isInlineElementToRemoveFunction(0)
{
}
@@ -564,6 +566,21 @@ ApplyStyleCommand::ApplyStyleCommand(PassRefPtr<Element> element, bool removeOnl
, m_useEndingSelection(true)
, m_styledInlineElement(element)
, m_removeOnly(removeOnly)
+ , m_isInlineElementToRemoveFunction(0)
+{
+}
+
+ApplyStyleCommand::ApplyStyleCommand(Document* document, CSSStyleDeclaration* style, IsInlineElementToRemoveFunction isInlineElementToRemoveFunction, EditAction editingAction)
+ : CompositeEditCommand(document)
+ , m_style(style->makeMutable())
+ , m_editingAction(editingAction)
+ , m_propertyLevel(PropertyDefault)
+ , m_start(endingSelection().start().downstream())
+ , m_end(endingSelection().end().upstream())
+ , m_useEndingSelection(true)
+ , m_styledInlineElement(0)
+ , m_removeOnly(true)
+ , m_isInlineElementToRemoveFunction(isInlineElementToRemoveFunction)
{
}
@@ -605,7 +622,7 @@ void ApplyStyleCommand::doApply()
applyBlockStyle(blockStyle.get());
// apply any remaining styles to the inline elements
// NOTE: hopefully, this string comparison is the same as checking for a non-null diff
- if (blockStyle->length() < m_style->length() || m_styledInlineElement) {
+ if (blockStyle->length() < m_style->length() || m_styledInlineElement || m_isInlineElementToRemoveFunction) {
RefPtr<CSSMutableStyleDeclaration> inlineStyle = m_style->copy();
applyRelativeFontStyleChange(inlineStyle.get());
blockStyle->diff(inlineStyle.get());
@@ -664,9 +681,11 @@ void ApplyStyleCommand::applyBlockStyle(CSSMutableStyleDeclaration *style)
StyleChange styleChange(style, paragraphStart.deepEquivalent());
if (styleChange.cssStyle().length() || m_removeOnly) {
RefPtr<Node> block = enclosingBlock(paragraphStart.deepEquivalent().node());
- RefPtr<Node> newBlock = moveParagraphContentsToNewBlockIfNecessary(paragraphStart.deepEquivalent());
- if (newBlock)
- block = newBlock;
+ if (!m_removeOnly) {
+ RefPtr<Node> newBlock = moveParagraphContentsToNewBlockIfNecessary(paragraphStart.deepEquivalent());
+ if (newBlock)
+ block = newBlock;
+ }
ASSERT(block->isHTMLElement());
if (block->isHTMLElement()) {
removeCSSStyle(style, static_cast<HTMLElement*>(block.get()));
@@ -1104,8 +1123,10 @@ void ApplyStyleCommand::fixRangeAndApplyInlineStyle(CSSMutableStyleDeclaration*
// to generate <font color="blue" size="4">hello</font> instead of <font color="blue"><font size="4">hello</font></font>
RefPtr<Range> range = Range::create(startNode->document(), start, end);
Element* editableRoot = startNode->rootEditableElement();
- while (editableRoot && startNode->parentNode() != editableRoot && isNodeVisiblyContainedWithin(startNode->parentNode(), range.get()))
- startNode = startNode->parentNode();
+ if (startNode != editableRoot) {
+ while (editableRoot && startNode->parentNode() != editableRoot && isNodeVisiblyContainedWithin(startNode->parentNode(), range.get()))
+ startNode = startNode->parentNode();
+ }
applyInlineStyleToNodeRange(style, startNode, pastEndNode);
}
@@ -1126,6 +1147,9 @@ static bool containsNonEditableRegion(Node* node)
void ApplyStyleCommand::applyInlineStyleToNodeRange(CSSMutableStyleDeclaration* style, Node* node, Node* pastEndNode)
{
+ if (m_removeOnly)
+ return;
+
for (Node* next; node && node != pastEndNode; node = next) {
next = node->traverseNextNode();
@@ -1171,10 +1195,16 @@ void ApplyStyleCommand::applyInlineStyleToNodeRange(CSSMutableStyleDeclaration*
if (!removeStyleFromRunBeforeApplyingStyle(style, node, runEnd))
continue;
- addInlineStyleIfNeeded(style, node, runEnd, m_removeOnly ? DoNotAddStyledElement : AddStyledElement);
+ addInlineStyleIfNeeded(style, node, runEnd, AddStyledElement);
}
}
+bool ApplyStyleCommand::isStyledInlineElementToRemove(Element* element) const
+{
+ return (m_styledInlineElement && element->hasTagName(m_styledInlineElement->tagQName()))
+ || (m_isInlineElementToRemoveFunction && m_isInlineElementToRemoveFunction(element));
+}
+
bool ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle(CSSMutableStyleDeclaration* style, Node*& runStart, Node*& runEnd)
{
ASSERT(runStart && runEnd && runStart->parentNode() == runEnd->parentNode());
@@ -1183,6 +1213,7 @@ bool ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle(CSSMutableStyleDec
for (Node* node = runStart; node && node != pastEndNode; node = node->traverseNextNode()) {
if (node->childNodeCount())
continue;
+ // We don't consider m_isInlineElementToRemoveFunction here because we never apply style when m_isInlineElementToRemoveFunction is specified
if (getPropertiesNotIn(style, computedStyle(node).get())->length()
|| (m_styledInlineElement && !enclosingNodeWithTag(positionBeforeNode(node), m_styledInlineElement->tagQName()))) {
needToApplyStyle = true;
@@ -1222,7 +1253,7 @@ bool ApplyStyleCommand::removeInlineStyleFromElement(CSSMutableStyleDeclaration*
if (!element->parentNode() || !element->parentNode()->isContentEditable())
return false;
- if (m_styledInlineElement && element->hasTagName(m_styledInlineElement->tagQName())) {
+ if (isStyledInlineElementToRemove(element)) {
if (mode == RemoveNone)
return true;
ASSERT(extractedStyle);
@@ -1331,7 +1362,7 @@ bool ApplyStyleCommand::removeImplicitlyStyledElement(CSSMutableStyleDeclaration
continue; // If CSS value is primitive, then skip if they are equal.
}
- if (extractedStyle)
+ if (extractedStyle && mapValue)
extractedStyle->setProperty(equivalent.propertyID, mapValue->cssText());
if (mode == RemoveNone)
@@ -1504,6 +1535,9 @@ void ApplyStyleCommand::pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration
// The outer loop is traversing the tree vertically from highestAncestor to targetNode
Node* current = highestAncestor;
+ // Along the way, styled elements that contain targetNode are removed and accumulated into elementsToPushDown.
+ // Each child of the removed element, exclusing ancestors of targetNode, is then wrapped by clones of elements in elementsToPushDown.
+ Vector<RefPtr<Element> > elementsToPushDown;
while (current != targetNode) {
ASSERT(current);
ASSERT(current->isHTMLElement());
@@ -1511,8 +1545,10 @@ void ApplyStyleCommand::pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration
Node* child = current->firstChild();
Node* lastChild = current->lastChild();
RefPtr<StyledElement> styledElement;
- if (current->isStyledElement() && m_styledInlineElement && current->hasTagName(m_styledInlineElement->tagQName()))
+ if (current->isStyledElement() && isStyledInlineElementToRemove(static_cast<Element*>(current))) {
styledElement = static_cast<StyledElement*>(current);
+ elementsToPushDown.append(styledElement);
+ }
RefPtr<CSSMutableStyleDeclaration> styleToPushDown = CSSMutableStyleDeclaration::create();
removeInlineStyleFromElement(style, static_cast<HTMLElement*>(current), RemoveIfNeeded, styleToPushDown.get());
@@ -1521,17 +1557,14 @@ void ApplyStyleCommand::pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration
while (child) {
Node* nextChild = child->nextSibling();
- if (child != targetNode && styledElement) {
- // If child has children, wrap children of child by a clone of the styled element to avoid infinite loop.
- // Otherwise, wrap the child by the styled element, and we won't fall into an infinite loop.
- RefPtr<Element> wrapper = styledElement->cloneElementWithoutChildren();
- ExceptionCode ec = 0;
- wrapper->removeAttribute(styleAttr, ec);
- ASSERT(!ec);
- if (child->firstChild())
- surroundNodeRangeWithElement(child->firstChild(), child->lastChild(), wrapper);
- else
+ if (!child->contains(targetNode) && elementsToPushDown.size()) {
+ for (size_t i = 0; i < elementsToPushDown.size(); i++) {
+ RefPtr<Element> wrapper = elementsToPushDown[i]->cloneElementWithoutChildren();
+ ExceptionCode ec = 0;
+ wrapper->removeAttribute(styleAttr, ec);
+ ASSERT(!ec);
surroundNodeRangeWithElement(child, child, wrapper);
+ }
}
// Apply text decoration to all nodes containing targetNode and their siblings but NOT to targetNode
@@ -1594,7 +1627,7 @@ void ApplyStyleCommand::removeInlineStyle(PassRefPtr<CSSMutableStyleDeclaration>
RefPtr<Node> next = elem->traverseNextNode();
RefPtr<CSSMutableStyleDeclaration> styleToPushDown;
PassRefPtr<Node> childNode = 0;
- if (m_styledInlineElement && elem->hasTagName(m_styledInlineElement->tagQName())) {
+ if (isStyledInlineElementToRemove(elem.get())) {
styleToPushDown = CSSMutableStyleDeclaration::create();
childNode = elem->firstChild();
}
diff --git a/WebCore/editing/ApplyStyleCommand.h b/WebCore/editing/ApplyStyleCommand.h
index eb6a2bc..16c5b68 100644
--- a/WebCore/editing/ApplyStyleCommand.h
+++ b/WebCore/editing/ApplyStyleCommand.h
@@ -44,6 +44,7 @@ public:
enum EPropertyLevel { PropertyDefault, ForceBlockProperties };
enum InlineStyleRemovalMode { RemoveIfNeeded, RemoveAlways, RemoveNone };
enum EAddStyledElement { AddStyledElement, DoNotAddStyledElement };
+ typedef bool (*IsInlineElementToRemoveFunction)(const Element*);
static PassRefPtr<ApplyStyleCommand> create(Document* document, CSSStyleDeclaration* style, EditAction action = EditActionChangeAttributes, EPropertyLevel level = PropertyDefault)
{
@@ -57,6 +58,10 @@ public:
{
return adoptRef(new ApplyStyleCommand(element, removeOnly, action));
}
+ static PassRefPtr<ApplyStyleCommand> create(Document* document, CSSStyleDeclaration* style, IsInlineElementToRemoveFunction isInlineElementToRemoveFunction, EditAction action = EditActionChangeAttributes)
+ {
+ return adoptRef(new ApplyStyleCommand(document, style, isInlineElementToRemoveFunction, action));
+ }
static RefPtr<CSSMutableStyleDeclaration> removeNonEditingProperties(CSSStyleDeclaration* style);
static PassRefPtr<CSSMutableStyleDeclaration> editingStyleAtPosition(Position pos, ShouldIncludeTypingStyle shouldIncludeTypingStyle = IgnoreTypingStyle);
@@ -65,6 +70,7 @@ private:
ApplyStyleCommand(Document*, CSSStyleDeclaration*, EditAction, EPropertyLevel);
ApplyStyleCommand(Document*, CSSStyleDeclaration*, const Position& start, const Position& end, EditAction, EPropertyLevel);
ApplyStyleCommand(PassRefPtr<Element>, bool removeOnly, EditAction);
+ ApplyStyleCommand(Document*, CSSStyleDeclaration*, bool (*isInlineElementToRemove)(const Element*), EditAction);
virtual void doApply();
virtual EditAction editingAction() const;
@@ -72,6 +78,7 @@ private:
CSSMutableStyleDeclaration* style() const { return m_style.get(); }
// style-removal helpers
+ bool isStyledInlineElementToRemove(Element*) const;
bool removeStyleFromRunBeforeApplyingStyle(CSSMutableStyleDeclaration* style, Node*& runStart, Node*& runEnd);
bool removeInlineStyleFromElement(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveIfNeeded, CSSMutableStyleDeclaration* extractedStyle = 0);
inline bool shouldRemoveInlineStyleFromElement(CSSMutableStyleDeclaration* style, HTMLElement* element) {return removeInlineStyleFromElement(style, element, RemoveNone);}
@@ -122,6 +129,7 @@ private:
bool m_useEndingSelection;
RefPtr<Element> m_styledInlineElement;
bool m_removeOnly;
+ IsInlineElementToRemoveFunction m_isInlineElementToRemoveFunction;
};
bool isStyleSpan(const Node*);
diff --git a/WebCore/editing/CompositeEditCommand.cpp b/WebCore/editing/CompositeEditCommand.cpp
index a00db36..6f47fb4 100644
--- a/WebCore/editing/CompositeEditCommand.cpp
+++ b/WebCore/editing/CompositeEditCommand.cpp
@@ -1184,6 +1184,8 @@ PassRefPtr<Node> CompositeEditCommand::splitTreeToNode(Node* start, Node* end, b
RefPtr<Node> node;
for (node = start; node && node->parent() != end; node = node->parent()) {
+ if (!node->parent()->isElementNode())
+ break;
VisiblePosition positionInParent(Position(node->parent(), 0), DOWNSTREAM);
VisiblePosition positionInNode(Position(node, 0), DOWNSTREAM);
if (positionInParent != positionInNode)
diff --git a/WebCore/editing/DeleteSelectionCommand.cpp b/WebCore/editing/DeleteSelectionCommand.cpp
index 4aca57e..1f56da7 100644
--- a/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/WebCore/editing/DeleteSelectionCommand.cpp
@@ -756,9 +756,9 @@ void DeleteSelectionCommand::doApply()
EAffinity affinity = m_selectionToDelete.affinity();
Position downstreamEnd = m_selectionToDelete.end().downstream();
- m_needPlaceholder = isStartOfParagraph(m_selectionToDelete.visibleStart()) &&
- isEndOfParagraph(m_selectionToDelete.visibleEnd()) &&
- !lineBreakExistsAtVisiblePosition(m_selectionToDelete.visibleEnd());
+ m_needPlaceholder = isStartOfParagraph(m_selectionToDelete.visibleStart(), Position::CanCrossEditingBoundary)
+ && isEndOfParagraph(m_selectionToDelete.visibleEnd(), Position::CanCrossEditingBoundary)
+ && !lineBreakExistsAtVisiblePosition(m_selectionToDelete.visibleEnd());
if (m_needPlaceholder) {
// Don't need a placeholder when deleting a selection that starts just before a table
// and ends inside it (we do need placeholders to hold open empty cells, but that's
diff --git a/WebCore/editing/EditingAllInOne.cpp b/WebCore/editing/EditingAllInOne.cpp
index ba484be..81483f8 100644
--- a/WebCore/editing/EditingAllInOne.cpp
+++ b/WebCore/editing/EditingAllInOne.cpp
@@ -65,6 +65,7 @@
#include <SplitElementCommand.cpp>
#include <SplitTextNodeCommand.cpp>
#include <SplitTextNodeContainingElementCommand.cpp>
+#include <TextCheckingHelper.cpp>
#include <TextIterator.cpp>
#include <TypingCommand.cpp>
#include <UnlinkCommand.cpp>
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 7b3d055..c74d765 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -62,6 +62,7 @@
#include "NodeList.h"
#include "Page.h"
#include "Pasteboard.h"
+#include "TextCheckingHelper.h"
#include "RemoveFormatCommand.h"
#include "RenderBlock.h"
#include "RenderPart.h"
@@ -468,9 +469,13 @@ void Editor::respondToChangedContents(const VisibleSelection& endingSelection)
if (node)
m_frame->document()->axObjectCache()->postNotification(node->renderer(), AXObjectCache::AXValueChanged, false);
}
-
+
+#if REMOVE_MARKERS_UPON_EDITING
+ removeSpellAndCorrectionMarkersFromWordsToBeEdited(true);
+#endif
+
if (client())
- client()->respondToChangedContents();
+ client()->respondToChangedContents();
}
const SimpleFontData* Editor::fontForSelection(bool& hasMultipleFonts) const
@@ -1154,6 +1159,9 @@ void Editor::cut()
}
RefPtr<Range> selection = selectedRange();
if (shouldDeleteRange(selection.get())) {
+#if REMOVE_MARKERS_UPON_EDITING
+ removeSpellAndCorrectionMarkersFromWordsToBeEdited(true);
+#endif
if (isNodeInTextFormControl(m_frame->selection()->start().node()))
Pasteboard::generalPasteboard()->writePlainText(selectedText());
else
@@ -1192,6 +1200,9 @@ void Editor::paste()
return; // DHTML did the whole operation
if (!canPaste())
return;
+#if REMOVE_MARKERS_UPON_EDITING
+ removeSpellAndCorrectionMarkersFromWordsToBeEdited(false);
+#endif
CachedResourceLoader* loader = m_frame->document()->cachedResourceLoader();
loader->setAllowStaleResources(true);
if (m_frame->selection()->isContentRichlyEditable())
@@ -1207,6 +1218,9 @@ void Editor::pasteAsPlainText()
return;
if (!canPaste())
return;
+#if REMOVE_MARKERS_UPON_EDITING
+ removeSpellAndCorrectionMarkersFromWordsToBeEdited(false);
+#endif
pasteAsPlainTextWithPasteboard(Pasteboard::generalPasteboard());
}
@@ -1534,6 +1548,11 @@ void Editor::setComposition(const String& text, const Vector<CompositionUnderlin
setIgnoreCompositionSelectionChange(true);
+ // Updates styles before setting selection for composition to prevent
+ // inserting the previous composition text into text nodes oddly.
+ // See https://bugs.webkit.org/show_bug.cgi?id=46868
+ m_frame->document()->updateStyleIfNeeded();
+
selectComposition();
if (m_frame->selection()->isNone()) {
@@ -1641,328 +1660,6 @@ void Editor::learnSpelling()
client()->learnWord(text);
}
-static String findFirstMisspellingInRange(EditorClient* client, Range* searchRange, int& firstMisspellingOffset, bool markAll, RefPtr<Range>& firstMisspellingRange)
-{
- ASSERT_ARG(client, client);
- ASSERT_ARG(searchRange, searchRange);
-
- WordAwareIterator it(searchRange);
- firstMisspellingOffset = 0;
-
- String firstMisspelling;
- int currentChunkOffset = 0;
-
- while (!it.atEnd()) {
- const UChar* chars = it.characters();
- int len = it.length();
-
- // Skip some work for one-space-char hunks
- if (!(len == 1 && chars[0] == ' ')) {
-
- int misspellingLocation = -1;
- int misspellingLength = 0;
- client->checkSpellingOfString(chars, len, &misspellingLocation, &misspellingLength);
-
- // 5490627 shows that there was some code path here where the String constructor below crashes.
- // We don't know exactly what combination of bad input caused this, so we're making this much
- // more robust against bad input on release builds.
- ASSERT(misspellingLength >= 0);
- ASSERT(misspellingLocation >= -1);
- ASSERT(!misspellingLength || misspellingLocation >= 0);
- ASSERT(misspellingLocation < len);
- ASSERT(misspellingLength <= len);
- ASSERT(misspellingLocation + misspellingLength <= len);
-
- if (misspellingLocation >= 0 && misspellingLength > 0 && misspellingLocation < len && misspellingLength <= len && misspellingLocation + misspellingLength <= len) {
-
- // Compute range of misspelled word
- RefPtr<Range> misspellingRange = TextIterator::subrange(searchRange, currentChunkOffset + misspellingLocation, misspellingLength);
-
- // Remember first-encountered misspelling and its offset.
- if (!firstMisspelling) {
- firstMisspellingOffset = currentChunkOffset + misspellingLocation;
- firstMisspelling = String(chars + misspellingLocation, misspellingLength);
- firstMisspellingRange = misspellingRange;
- }
-
- // Store marker for misspelled word.
- ExceptionCode ec = 0;
- misspellingRange->startContainer(ec)->document()->markers()->addMarker(misspellingRange.get(), DocumentMarker::Spelling);
- ASSERT(!ec);
-
- // Bail out if we're marking only the first misspelling, and not all instances.
- if (!markAll)
- break;
- }
- }
-
- currentChunkOffset += len;
- it.advance();
- }
-
- return firstMisspelling;
-}
-
-#ifndef BUILDING_ON_TIGER
-
-static PassRefPtr<Range> paragraphAlignedRangeForRange(Range* arbitraryRange, int& offsetIntoParagraphAlignedRange, String& paragraphString)
-{
- ASSERT_ARG(arbitraryRange, arbitraryRange);
-
- ExceptionCode ec = 0;
-
- // Expand range to paragraph boundaries
- RefPtr<Range> paragraphRange = arbitraryRange->cloneRange(ec);
- setStart(paragraphRange.get(), startOfParagraph(arbitraryRange->startPosition()));
- setEnd(paragraphRange.get(), endOfParagraph(arbitraryRange->endPosition()));
-
- // Compute offset from start of expanded range to start of original range
- RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), arbitraryRange->startPosition());
- offsetIntoParagraphAlignedRange = TextIterator::rangeLength(offsetAsRange.get());
-
- // Fill in out parameter with string representing entire paragraph range.
- // Someday we might have a caller that doesn't use this, but for now all callers do.
- paragraphString = plainText(paragraphRange.get());
-
- return paragraphRange;
-}
-
-static int findFirstGrammarDetailInRange(const Vector<GrammarDetail>& grammarDetails, int badGrammarPhraseLocation, int /*badGrammarPhraseLength*/, Range *searchRange, int startOffset, int endOffset, bool markAll)
-{
- // Found some bad grammar. Find the earliest detail range that starts in our search range (if any).
- // Optionally add a DocumentMarker for each detail in the range.
- int earliestDetailLocationSoFar = -1;
- int earliestDetailIndex = -1;
- for (unsigned i = 0; i < grammarDetails.size(); i++) {
- const GrammarDetail* detail = &grammarDetails[i];
- ASSERT(detail->length > 0 && detail->location >= 0);
-
- int detailStartOffsetInParagraph = badGrammarPhraseLocation + detail->location;
-
- // Skip this detail if it starts before the original search range
- if (detailStartOffsetInParagraph < startOffset)
- continue;
-
- // Skip this detail if it starts after the original search range
- if (detailStartOffsetInParagraph >= endOffset)
- continue;
-
- if (markAll) {
- RefPtr<Range> badGrammarRange = TextIterator::subrange(searchRange, badGrammarPhraseLocation - startOffset + detail->location, detail->length);
- ExceptionCode ec = 0;
- badGrammarRange->startContainer(ec)->document()->markers()->addMarker(badGrammarRange.get(), DocumentMarker::Grammar, detail->userDescription);
- ASSERT(!ec);
- }
-
- // Remember this detail only if it's earlier than our current candidate (the details aren't in a guaranteed order)
- if (earliestDetailIndex < 0 || earliestDetailLocationSoFar > detail->location) {
- earliestDetailIndex = i;
- earliestDetailLocationSoFar = detail->location;
- }
- }
-
- return earliestDetailIndex;
-}
-
-static String findFirstBadGrammarInRange(EditorClient* client, Range* searchRange, GrammarDetail& outGrammarDetail, int& outGrammarPhraseOffset, bool markAll)
-{
- ASSERT_ARG(client, client);
- ASSERT_ARG(searchRange, searchRange);
-
- // Initialize out parameters; these will be updated if we find something to return.
- outGrammarDetail.location = -1;
- outGrammarDetail.length = 0;
- outGrammarDetail.guesses.clear();
- outGrammarDetail.userDescription = "";
- outGrammarPhraseOffset = 0;
-
- String firstBadGrammarPhrase;
-
- // Expand the search range to encompass entire paragraphs, since grammar checking needs that much context.
- // Determine the character offset from the start of the paragraph to the start of the original search range,
- // since we will want to ignore results in this area.
- int searchRangeStartOffset;
- String paragraphString;
- RefPtr<Range> paragraphRange = paragraphAlignedRangeForRange(searchRange, searchRangeStartOffset, paragraphString);
-
- // Determine the character offset from the start of the paragraph to the end of the original search range,
- // since we will want to ignore results in this area also.
- int searchRangeEndOffset = searchRangeStartOffset + TextIterator::rangeLength(searchRange);
-
- // Start checking from beginning of paragraph, but skip past results that occur before the start of the original search range.
- int startOffset = 0;
- while (startOffset < searchRangeEndOffset) {
- Vector<GrammarDetail> grammarDetails;
- int badGrammarPhraseLocation = -1;
- int badGrammarPhraseLength = 0;
- client->checkGrammarOfString(paragraphString.characters() + startOffset, paragraphString.length() - startOffset, grammarDetails, &badGrammarPhraseLocation, &badGrammarPhraseLength);
-
- if (!badGrammarPhraseLength) {
- ASSERT(badGrammarPhraseLocation == -1);
- return String();
- }
-
- ASSERT(badGrammarPhraseLocation >= 0);
- badGrammarPhraseLocation += startOffset;
-
-
- // Found some bad grammar. Find the earliest detail range that starts in our search range (if any).
- int badGrammarIndex = findFirstGrammarDetailInRange(grammarDetails, badGrammarPhraseLocation, badGrammarPhraseLength, searchRange, searchRangeStartOffset, searchRangeEndOffset, markAll);
- if (badGrammarIndex >= 0) {
- ASSERT(static_cast<unsigned>(badGrammarIndex) < grammarDetails.size());
- outGrammarDetail = grammarDetails[badGrammarIndex];
- }
-
- // If we found a detail in range, then we have found the first bad phrase (unless we found one earlier but
- // kept going so we could mark all instances).
- if (badGrammarIndex >= 0 && firstBadGrammarPhrase.isEmpty()) {
- outGrammarPhraseOffset = badGrammarPhraseLocation - searchRangeStartOffset;
- firstBadGrammarPhrase = paragraphString.substring(badGrammarPhraseLocation, badGrammarPhraseLength);
-
- // Found one. We're done now, unless we're marking each instance.
- if (!markAll)
- break;
- }
-
- // These results were all between the start of the paragraph and the start of the search range; look
- // beyond this phrase.
- startOffset = badGrammarPhraseLocation + badGrammarPhraseLength;
- }
-
- return firstBadGrammarPhrase;
-}
-
-#endif /* not BUILDING_ON_TIGER */
-
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
-
-static String findFirstMisspellingOrBadGrammarInRange(EditorClient* client, Range* searchRange, bool checkGrammar, bool& outIsSpelling, int& outFirstFoundOffset, GrammarDetail& outGrammarDetail)
-{
- ASSERT_ARG(client, client);
- ASSERT_ARG(searchRange, searchRange);
-
- String firstFoundItem;
- String misspelledWord;
- String badGrammarPhrase;
- ExceptionCode ec = 0;
-
- // Initialize out parameters; these will be updated if we find something to return.
- outIsSpelling = true;
- outFirstFoundOffset = 0;
- outGrammarDetail.location = -1;
- outGrammarDetail.length = 0;
- outGrammarDetail.guesses.clear();
- outGrammarDetail.userDescription = "";
-
- // Expand the search range to encompass entire paragraphs, since text checking needs that much context.
- // Determine the character offset from the start of the paragraph to the start of the original search range,
- // since we will want to ignore results in this area.
- RefPtr<Range> paragraphRange = searchRange->cloneRange(ec);
- setStart(paragraphRange.get(), startOfParagraph(searchRange->startPosition()));
- int totalRangeLength = TextIterator::rangeLength(paragraphRange.get());
- setEnd(paragraphRange.get(), endOfParagraph(searchRange->startPosition()));
-
- RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), searchRange->startPosition());
- int searchRangeStartOffset = TextIterator::rangeLength(offsetAsRange.get());
- int totalLengthProcessed = 0;
-
- bool firstIteration = true;
- bool lastIteration = false;
- while (totalLengthProcessed < totalRangeLength) {
- // Iterate through the search range by paragraphs, checking each one for spelling and grammar.
- int currentLength = TextIterator::rangeLength(paragraphRange.get());
- int currentStartOffset = firstIteration ? searchRangeStartOffset : 0;
- int currentEndOffset = currentLength;
- if (inSameParagraph(paragraphRange->startPosition(), searchRange->endPosition())) {
- // Determine the character offset from the end of the original search range to the end of the paragraph,
- // since we will want to ignore results in this area.
- RefPtr<Range> endOffsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), searchRange->endPosition());
- currentEndOffset = TextIterator::rangeLength(endOffsetAsRange.get());
- lastIteration = true;
- }
- if (currentStartOffset < currentEndOffset) {
- String paragraphString = plainText(paragraphRange.get());
- if (paragraphString.length() > 0) {
- bool foundGrammar = false;
- int spellingLocation = 0;
- int grammarPhraseLocation = 0;
- int grammarDetailLocation = 0;
- unsigned grammarDetailIndex = 0;
-
- Vector<TextCheckingResult> results;
- uint64_t checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling;
- client->checkTextOfParagraph(paragraphString.characters(), paragraphString.length(), checkingTypes, results);
-
- for (unsigned i = 0; i < results.size(); i++) {
- const TextCheckingResult* result = &results[i];
- if (result->type == TextCheckingTypeSpelling && result->location >= currentStartOffset && result->location + result->length <= currentEndOffset) {
- ASSERT(result->length > 0 && result->location >= 0);
- spellingLocation = result->location;
- misspelledWord = paragraphString.substring(result->location, result->length);
- ASSERT(misspelledWord.length());
- break;
- }
- if (checkGrammar && result->type == TextCheckingTypeGrammar && result->location < currentEndOffset && result->location + result->length > currentStartOffset) {
- ASSERT(result->length > 0 && result->location >= 0);
- // We can't stop after the first grammar result, since there might still be a spelling result after
- // it begins but before the first detail in it, but we can stop if we find a second grammar result.
- if (foundGrammar)
- break;
- for (unsigned j = 0; j < result->details.size(); j++) {
- const GrammarDetail* detail = &result->details[j];
- ASSERT(detail->length > 0 && detail->location >= 0);
- if (result->location + detail->location >= currentStartOffset && result->location + detail->location + detail->length <= currentEndOffset && (!foundGrammar || result->location + detail->location < grammarDetailLocation)) {
- grammarDetailIndex = j;
- grammarDetailLocation = result->location + detail->location;
- foundGrammar = true;
- }
- }
- if (foundGrammar) {
- grammarPhraseLocation = result->location;
- outGrammarDetail = result->details[grammarDetailIndex];
- badGrammarPhrase = paragraphString.substring(result->location, result->length);
- ASSERT(badGrammarPhrase.length());
- }
- }
- }
-
- if (!misspelledWord.isEmpty() && (!checkGrammar || badGrammarPhrase.isEmpty() || spellingLocation <= grammarDetailLocation)) {
- int spellingOffset = spellingLocation - currentStartOffset;
- if (!firstIteration) {
- RefPtr<Range> paragraphOffsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), searchRange->startPosition(), paragraphRange->startPosition());
- spellingOffset += TextIterator::rangeLength(paragraphOffsetAsRange.get());
- }
- outIsSpelling = true;
- outFirstFoundOffset = spellingOffset;
- firstFoundItem = misspelledWord;
- break;
- }
- if (checkGrammar && !badGrammarPhrase.isEmpty()) {
- int grammarPhraseOffset = grammarPhraseLocation - currentStartOffset;
- if (!firstIteration) {
- RefPtr<Range> paragraphOffsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), searchRange->startPosition(), paragraphRange->startPosition());
- grammarPhraseOffset += TextIterator::rangeLength(paragraphOffsetAsRange.get());
- }
- outIsSpelling = false;
- outFirstFoundOffset = grammarPhraseOffset;
- firstFoundItem = badGrammarPhrase;
- break;
- }
- }
- }
- if (lastIteration || totalLengthProcessed + currentLength >= totalRangeLength)
- break;
- VisiblePosition newParagraphStart = startOfNextParagraph(paragraphRange->endPosition());
- setStart(paragraphRange.get(), newParagraphStart);
- setEnd(paragraphRange.get(), endOfParagraph(newParagraphStart));
- firstIteration = false;
- totalLengthProcessed += currentLength;
- }
- return firstFoundItem;
-}
-
-#endif
-
void Editor::advanceToNextMisspelling(bool startBeforeSelection)
{
ExceptionCode ec = 0;
@@ -1974,6 +1671,8 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
// repeated "check spelling" commands work.
VisibleSelection selection(frame()->selection()->selection());
RefPtr<Range> spellingSearchRange(rangeOfContents(frame()->document()));
+ TextCheckingHelper checker(client(), spellingSearchRange);
+
bool startedWithSelection = false;
if (selection.start().node()) {
startedWithSelection = true;
@@ -2039,7 +1738,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
bool isSpelling = true;
int foundOffset = 0;
GrammarDetail grammarDetail;
- String foundItem = findFirstMisspellingOrBadGrammarInRange(client(), spellingSearchRange.get(), isGrammarCheckingEnabled(), isSpelling, foundOffset, grammarDetail);
+ String foundItem = checker.findFirstMisspellingOrBadGrammar(isGrammarCheckingEnabled(), isSpelling, foundOffset, grammarDetail);
if (isSpelling) {
misspelledWord = foundItem;
misspellingOffset = foundOffset;
@@ -2049,7 +1748,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
}
#else
RefPtr<Range> firstMisspellingRange;
- String misspelledWord = findFirstMisspellingInRange(client(), spellingSearchRange.get(), misspellingOffset, false, firstMisspellingRange);
+ String misspelledWord = checker.findFirstMisspelling(misspellingOffset, false, firstMisspellingRange);
String badGrammarPhrase;
#ifndef BUILDING_ON_TIGER
@@ -2066,7 +1765,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
}
if (isGrammarCheckingEnabled())
- badGrammarPhrase = findFirstBadGrammarInRange(client(), grammarSearchRange.get(), grammarDetail, grammarPhraseOffset, false);
+ badGrammarPhrase = checker.findFirstBadGrammar(grammarDetail, grammarPhraseOffset, false);
#endif
#endif
@@ -2079,7 +1778,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
grammarSearchRange = spellingSearchRange->cloneRange(ec);
- foundItem = findFirstMisspellingOrBadGrammarInRange(client(), spellingSearchRange.get(), isGrammarCheckingEnabled(), isSpelling, foundOffset, grammarDetail);
+ foundItem = checker.findFirstMisspellingOrBadGrammar(isGrammarCheckingEnabled(), isSpelling, foundOffset, grammarDetail);
if (isSpelling) {
misspelledWord = foundItem;
misspellingOffset = foundOffset;
@@ -2088,7 +1787,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
grammarPhraseOffset = foundOffset;
}
#else
- misspelledWord = findFirstMisspellingInRange(client(), spellingSearchRange.get(), misspellingOffset, false, firstMisspellingRange);
+ misspelledWord = checker.findFirstMisspelling(misspellingOffset, false, firstMisspellingRange);
#ifndef BUILDING_ON_TIGER
grammarSearchRange = spellingSearchRange->cloneRange(ec);
@@ -2099,7 +1798,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
grammarSearchRange->setEnd(chars.range()->startContainer(ec), chars.range()->startOffset(ec), ec);
}
if (isGrammarCheckingEnabled())
- badGrammarPhrase = findFirstBadGrammarInRange(client(), grammarSearchRange.get(), grammarDetail, grammarPhraseOffset, false);
+ badGrammarPhrase = checker.findFirstBadGrammar(grammarDetail, grammarPhraseOffset, false);
#endif
#endif
}
@@ -2163,60 +1862,13 @@ bool Editor::isSelectionMisspelled()
return true;
}
-#ifndef BUILDING_ON_TIGER
-static bool isRangeUngrammatical(EditorClient* client, Range *range, Vector<String>& guessesVector)
-{
- if (!client)
- return false;
-
- ExceptionCode ec;
- if (!range || range->collapsed(ec))
- return false;
-
- // Returns true only if the passed range exactly corresponds to a bad grammar detail range. This is analogous
- // to isSelectionMisspelled. It's not good enough for there to be some bad grammar somewhere in the range,
- // or overlapping the range; the ranges must exactly match.
- guessesVector.clear();
- int grammarPhraseOffset;
-
- GrammarDetail grammarDetail;
- String badGrammarPhrase = findFirstBadGrammarInRange(client, range, grammarDetail, grammarPhraseOffset, false);
-
- // No bad grammar in these parts at all.
- if (badGrammarPhrase.isEmpty())
- return false;
-
- // Bad grammar, but phrase (e.g. sentence) starts beyond start of range.
- if (grammarPhraseOffset > 0)
- return false;
-
- ASSERT(grammarDetail.location >= 0 && grammarDetail.length > 0);
-
- // Bad grammar, but start of detail (e.g. ungrammatical word) doesn't match start of range
- if (grammarDetail.location + grammarPhraseOffset)
- return false;
-
- // Bad grammar at start of range, but end of bad grammar is before or after end of range
- if (grammarDetail.length != TextIterator::rangeLength(range))
- return false;
-
- // Update the spelling panel to be displaying this error (whether or not the spelling panel is on screen).
- // This is necessary to make a subsequent call to [NSSpellChecker ignoreWord:inSpellDocumentWithTag:] work
- // correctly; that call behaves differently based on whether the spelling panel is displaying a misspelling
- // or a grammar error.
- client->updateSpellingUIWithGrammarString(badGrammarPhrase, grammarDetail);
-
- return true;
-}
-#endif
-
bool Editor::isSelectionUngrammatical()
{
#ifdef BUILDING_ON_TIGER
return false;
#else
Vector<String> ignoredGuesses;
- return isRangeUngrammatical(client(), frame()->selection()->toNormalizedRange().get(), ignoredGuesses);
+ return TextCheckingHelper(client(), frame()->selection()->toNormalizedRange()).isUngrammatical(ignoredGuesses);
#endif
}
@@ -2226,8 +1878,8 @@ Vector<String> Editor::guessesForUngrammaticalSelection()
return Vector<String>();
#else
Vector<String> guesses;
- // Ignore the result of isRangeUngrammatical; we just want the guesses, whether or not there are any
- isRangeUngrammatical(client(), frame()->selection()->toNormalizedRange().get(), guesses);
+ // Ignore the result of isUngrammatical; we just want the guesses, whether or not there are any
+ TextCheckingHelper(client(), frame()->selection()->toNormalizedRange()).isUngrammatical(guesses);
return guesses;
#endif
}
@@ -2243,72 +1895,10 @@ Vector<String> Editor::guessesForMisspelledSelection()
return guesses;
}
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
-
-static Vector<String> guessesForMisspelledOrUngrammaticalRange(EditorClient* client, Range *range, bool checkGrammar, bool& misspelled, bool& ungrammatical)
-{
- Vector<String> guesses;
- ExceptionCode ec;
- misspelled = false;
- ungrammatical = false;
-
- if (!client || !range || range->collapsed(ec))
- return guesses;
-
- // Expand the range to encompass entire paragraphs, since text checking needs that much context.
- int rangeStartOffset;
- String paragraphString;
- RefPtr<Range> paragraphRange = paragraphAlignedRangeForRange(range, rangeStartOffset, paragraphString);
- int rangeLength = TextIterator::rangeLength(range);
- if (!rangeLength || !paragraphString.length())
- return guesses;
-
- Vector<TextCheckingResult> results;
- uint64_t checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling;
- client->checkTextOfParagraph(paragraphString.characters(), paragraphString.length(), checkingTypes, results);
-
- for (unsigned i = 0; i < results.size(); i++) {
- const TextCheckingResult* result = &results[i];
- if (result->type == TextCheckingTypeSpelling && result->location == rangeStartOffset && result->length == rangeLength) {
- String misspelledWord = paragraphString.substring(rangeStartOffset, rangeLength);
- ASSERT(misspelledWord.length());
- client->getGuessesForWord(misspelledWord, guesses);
- client->updateSpellingUIWithMisspelledWord(misspelledWord);
- misspelled = true;
- return guesses;
- }
- }
-
- if (!checkGrammar)
- return guesses;
-
- for (unsigned i = 0; i < results.size(); i++) {
- const TextCheckingResult* result = &results[i];
- if (result->type == TextCheckingTypeGrammar && result->location <= rangeStartOffset && result->location + result->length >= rangeStartOffset + rangeLength) {
- for (unsigned j = 0; j < result->details.size(); j++) {
- const GrammarDetail* detail = &result->details[j];
- ASSERT(detail->length > 0 && detail->location >= 0);
- if (result->location + detail->location == rangeStartOffset && detail->length == rangeLength) {
- String badGrammarPhrase = paragraphString.substring(result->location, result->length);
- ASSERT(badGrammarPhrase.length());
- for (unsigned k = 0; k < detail->guesses.size(); k++)
- guesses.append(detail->guesses[k]);
- client->updateSpellingUIWithGrammarString(badGrammarPhrase, *detail);
- ungrammatical = true;
- return guesses;
- }
- }
- }
- }
- return guesses;
-}
-
-#endif
-
Vector<String> Editor::guessesForMisspelledOrUngrammaticalSelection(bool& misspelled, bool& ungrammatical)
{
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
- return guessesForMisspelledOrUngrammaticalRange(client(), frame()->selection()->toNormalizedRange().get(), isGrammarCheckingEnabled(), misspelled, ungrammatical);
+ return TextCheckingHelper(client(), frame()->selection()->toNormalizedRange()).guessesForMisspelledOrUngrammaticalRange(isGrammarCheckingEnabled(), misspelled, ungrammatical);
#else
misspelled = isSelectionMisspelled();
if (misspelled) {
@@ -2485,34 +2075,15 @@ void Editor::markMisspellingsAfterTypingToPosition(const VisiblePosition &p)
markBadGrammar(VisibleSelection(startOfSentence(p), endOfSentence(p)));
#endif
}
-
-static void markAllMisspellingsInRange(EditorClient* client, Range* searchRange, RefPtr<Range>& firstMisspellingRange)
-{
- // Use the "markAll" feature of findFirstMisspellingInRange. Ignore the return value and the "out parameter";
- // all we need to do is mark every instance.
- int ignoredOffset;
- findFirstMisspellingInRange(client, searchRange, ignoredOffset, true, firstMisspellingRange);
-}
-
-#ifndef BUILDING_ON_TIGER
-static void markAllBadGrammarInRange(EditorClient* client, Range* searchRange)
-{
- // Use the "markAll" feature of findFirstBadGrammarInRange. Ignore the return value and "out parameters"; all we need to
- // do is mark every instance.
- GrammarDetail ignoredGrammarDetail;
- int ignoredOffset;
- findFirstBadGrammarInRange(client, searchRange, ignoredGrammarDetail, ignoredOffset, true);
-}
-#endif
-static void markMisspellingsOrBadGrammar(Editor* editor, const VisibleSelection& selection, bool checkSpelling, RefPtr<Range>& firstMisspellingRange)
+void Editor::markMisspellingsOrBadGrammar(const VisibleSelection& selection, bool checkSpelling, RefPtr<Range>& firstMisspellingRange)
{
// This function is called with a selection already expanded to word boundaries.
// Might be nice to assert that here.
// This function is used only for as-you-type checking, so if that's off we do nothing. Note that
// grammar checking can only be on if spell checking is also on.
- if (!editor->isContinuousSpellCheckingEnabled())
+ if (!isContinuousSpellCheckingEnabled())
return;
RefPtr<Range> searchRange(selection.toNormalizedRange());
@@ -2524,53 +2095,49 @@ static void markMisspellingsOrBadGrammar(Editor* editor, const VisibleSelection&
if (!editableNode || !editableNode->isContentEditable())
return;
- if (!editor->spellCheckingEnabledInFocusedNode())
+ if (!isSpellCheckingEnabledInFocusedNode())
return;
// Get the spell checker if it is available
- if (!editor->client())
+ if (!client())
return;
+ TextCheckingHelper checker(client(), searchRange);
if (checkSpelling)
- markAllMisspellingsInRange(editor->client(), searchRange.get(), firstMisspellingRange);
+ checker.markAllMisspellings(firstMisspellingRange);
else {
#ifdef BUILDING_ON_TIGER
ASSERT_NOT_REACHED();
#else
- if (editor->isGrammarCheckingEnabled())
- markAllBadGrammarInRange(editor->client(), searchRange.get());
+ if (isGrammarCheckingEnabled())
+ checker.markAllBadGrammar();
#endif
}
}
-bool Editor::spellCheckingEnabledInFocusedNode() const
+bool Editor::isSpellCheckingEnabledInFocusedNode() const
{
// Ascend the DOM tree to find a "spellcheck" attribute.
// When we find a "spellcheck" attribute, retrieve its value and return false if its value is "false".
const Node* node = frame()->document()->focusedNode();
- while (node) {
- if (node->isElementNode()) {
- const WTF::AtomicString& value = static_cast<const Element*>(node)->getAttribute(spellcheckAttr);
- if (equalIgnoringCase(value, "true"))
- return true;
- if (equalIgnoringCase(value, "false"))
- return false;
- }
- node = node->parent();
- }
- return true;
+ if (!node)
+ return false;
+ const Element* focusedElement = node->isElementNode() ? toElement(node) : node->parentElement();
+ if (!focusedElement)
+ return false;
+ return focusedElement->isSpellCheckingEnabled();
}
void Editor::markMisspellings(const VisibleSelection& selection, RefPtr<Range>& firstMisspellingRange)
{
- markMisspellingsOrBadGrammar(this, selection, true, firstMisspellingRange);
+ markMisspellingsOrBadGrammar(selection, true, firstMisspellingRange);
}
void Editor::markBadGrammar(const VisibleSelection& selection)
{
#ifndef BUILDING_ON_TIGER
RefPtr<Range> firstMisspellingRange;
- markMisspellingsOrBadGrammar(this, selection, false, firstMisspellingRange);
+ markMisspellingsOrBadGrammar(selection, false, firstMisspellingRange);
#else
UNUSED_PARAM(selection);
#endif
@@ -2603,7 +2170,7 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions textCh
if (!editableNode || !editableNode->isContentEditable())
return;
- if (!spellCheckingEnabledInFocusedNode())
+ if (!isSpellCheckingEnabledInFocusedNode())
return;
// Expand the range to encompass entire paragraphs, since text checking needs that much context.
@@ -2620,15 +2187,16 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions textCh
bool adjustSelectionForParagraphBoundaries = false;
String paragraphString;
RefPtr<Range> paragraphRange;
+ TextCheckingHelper checker(client(), grammarRange);
if (shouldMarkGrammar) {
// The spelling range should be contained in the paragraph-aligned extension of the grammar range.
- paragraphRange = paragraphAlignedRangeForRange(grammarRange, grammarRangeStartOffset, paragraphString);
+ paragraphRange = checker.paragraphAlignedRange(grammarRangeStartOffset, paragraphString);
RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), spellingRange->startPosition());
spellingRangeStartOffset = TextIterator::rangeLength(offsetAsRange.get());
grammarRangeEndOffset = grammarRangeStartOffset + TextIterator::rangeLength(grammarRange);
} else {
- paragraphRange = paragraphAlignedRangeForRange(spellingRange, spellingRangeStartOffset, paragraphString);
+ paragraphRange = checker.paragraphAlignedRange(spellingRangeStartOffset, paragraphString);
}
spellingRangeEndOffset = spellingRangeStartOffset + TextIterator::rangeLength(spellingRange);
paragraphLength = paragraphString.length();
@@ -2818,10 +2386,10 @@ void Editor::changeBackToReplacedString(const String& replacedString)
RefPtr<Range> selection = selectedRange();
if (!shouldInsertText(replacedString, selection.get(), EditorInsertActionPasted))
return;
-
+
String paragraphString;
int selectionOffset;
- RefPtr<Range> paragraphRange = paragraphAlignedRangeForRange(selection.get(), selectionOffset, paragraphString);
+ RefPtr<Range> paragraphRange = TextCheckingHelper(client(), selection).paragraphAlignedRange(selectionOffset, paragraphString);
replaceSelectionWithText(replacedString, false, false);
RefPtr<Range> changedRange = TextIterator::subrange(paragraphRange.get(), selectionOffset, replacedString.length());
changedRange->startContainer()->document()->markers()->addMarker(changedRange.get(), DocumentMarker::Replacement, String());
@@ -2864,6 +2432,7 @@ void Editor::handleRejectedCorrection()
return;
replacedRange->startContainer()->document()->markers()->addMarker(replacedRange, DocumentMarker::RejectedCorrection, m_stringToBeReplacedByCorrection);
+ m_rangeToBeReplacedByCorrection.clear();
}
void Editor::startCorrectionPanelTimer()
@@ -2901,6 +2470,101 @@ bool Editor::isShowingCorrectionPanel()
return false;
}
+void Editor::removeSpellAndCorrectionMarkersFromWordsToBeEdited(bool doNotRemoveIfSelectionAtWordBoundary)
+{
+ // We want to remove the markers from a word if an editing command will change the word. This can happen in one of
+ // several scenarios:
+ // 1. Insert in the middle of a word.
+ // 2. Appending non whitespace at the beginning of word.
+ // 3. Appending non whitespace at the end of word.
+ // Note that, appending only whitespaces at the beginning or end of word won't change the word, so we don't need to
+ // remove the markers on that word.
+ // Of course, if current selection is a range, we potentially will edit two words that fall on the boundaries of
+ // selection, and remove words between the selection boundaries.
+ //
+ VisiblePosition startOfSelection = frame()->selection()->selection().start();
+ VisiblePosition endOfSelection = frame()->selection()->selection().end();
+ if (startOfSelection.isNull())
+ return;
+ // First word is the word that ends after or on the start of selection.
+ VisiblePosition startOfFirstWord = startOfWord(startOfSelection, LeftWordIfOnBoundary);
+ VisiblePosition endOfFirstWord = endOfWord(startOfSelection, LeftWordIfOnBoundary);
+ // Last word is the word that begins before or on the end of selection
+ VisiblePosition startOfLastWord = startOfWord(endOfSelection, RightWordIfOnBoundary);
+ VisiblePosition endOfLastWord = endOfWord(endOfSelection, RightWordIfOnBoundary);
+
+ // This can be the case if the end of selection is at the end of document.
+ if (endOfLastWord.deepEquivalent().anchorType() != Position::PositionIsOffsetInAnchor) {
+ startOfLastWord = startOfWord(frame()->selection()->selection().start(), LeftWordIfOnBoundary);
+ endOfLastWord = endOfWord(frame()->selection()->selection().start(), LeftWordIfOnBoundary);
+ }
+
+ // If doNotRemoveIfSelectionAtWordBoundary is true, and first word ends at the start of selection,
+ // we choose next word as the first word.
+ if (doNotRemoveIfSelectionAtWordBoundary && endOfFirstWord == startOfSelection) {
+ startOfFirstWord = nextWordPosition(startOfFirstWord);
+ if (startOfFirstWord == endOfSelection)
+ return;
+ endOfFirstWord = endOfWord(startOfFirstWord, RightWordIfOnBoundary);
+ if (endOfFirstWord.deepEquivalent().anchorType() != Position::PositionIsOffsetInAnchor)
+ return;
+ }
+
+ // If doNotRemoveIfSelectionAtWordBoundary is true, and last word begins at the end of selection,
+ // we choose previous word as the last word.
+ if (doNotRemoveIfSelectionAtWordBoundary && startOfLastWord == endOfSelection) {
+ startOfLastWord = previousWordPosition(startOfLastWord);
+ endOfLastWord = endOfWord(startOfLastWord, RightWordIfOnBoundary);
+ if (endOfLastWord == startOfFirstWord)
+ return;
+ }
+
+ // Now we remove markers on everything between startOfFirstWord and endOfLastWord.
+ // However, if an autocorrection change a single word to multiple words, we want to remove correction mark from all the
+ // resulted words even we only edit one of them. For example, assuming autocorrection changes "avantgarde" to "avant
+ // garde", we will have CorrectionIndicator marker on both words and on the whitespace between them. If we then edit garde,
+ // we would like to remove the marker from word "avant" and whitespace as well. So we need to get the continous range of
+ // of marker that contains the word in question, and remove marker on that whole range.
+ Document* document = m_frame->document();
+ RefPtr<Range> wordRange = Range::create(document, startOfFirstWord.deepEquivalent(), endOfLastWord.deepEquivalent());
+ RefPtr<Range> rangeOfFirstWord = Range::create(document, startOfFirstWord.deepEquivalent(), endOfFirstWord.deepEquivalent());
+ RefPtr<Range> rangeOfLastWord = Range::create(document, startOfLastWord.deepEquivalent(), endOfLastWord.deepEquivalent());
+
+ typedef pair<RefPtr<Range>, DocumentMarker::MarkerType> RangeMarkerPair;
+ // It's probably unsafe to remove marker while iterating a vector of markers. So we store the markers and ranges that we want to remove temporarily. Then remove them at the end of function.
+ // To avoid allocation on the heap, Give markersToRemove a small inline capacity
+ Vector<RangeMarkerPair, 16> markersToRemove;
+ for (TextIterator textIterator(wordRange.get()); !textIterator.atEnd(); textIterator.advance()) {
+ Node* node = textIterator.node();
+ if (node == startOfFirstWord.deepEquivalent().containerNode() || node == endOfLastWord.deepEquivalent().containerNode()) {
+ // First word and last word can belong to the same node
+ bool processFirstWord = node == startOfFirstWord.deepEquivalent().containerNode() && document->markers()->hasMarkers(rangeOfFirstWord.get(), DocumentMarker::Spelling | DocumentMarker::CorrectionIndicator);
+ bool processLastWord = node == endOfLastWord.deepEquivalent().containerNode() && document->markers()->hasMarkers(rangeOfLastWord.get(), DocumentMarker::Spelling | DocumentMarker::CorrectionIndicator);
+ // Take note on the markers whose range overlaps with the range of the first word or the last word.
+ Vector<DocumentMarker> markers = document->markers()->markersForNode(node);
+ for (size_t i = 0; i < markers.size(); ++i) {
+ DocumentMarker marker = markers[i];
+ if (processFirstWord && static_cast<int>(marker.endOffset) > startOfFirstWord.deepEquivalent().offsetInContainerNode() && (marker.type == DocumentMarker::Spelling || marker.type == DocumentMarker::CorrectionIndicator)) {
+ RefPtr<Range> markerRange = Range::create(document, node, marker.startOffset, node, marker.endOffset);
+ markersToRemove.append(std::make_pair(markerRange, marker.type));
+ }
+ if (processLastWord && static_cast<int>(marker.startOffset) <= endOfLastWord.deepEquivalent().offsetInContainerNode() && (marker.type == DocumentMarker::Spelling || marker.type == DocumentMarker::CorrectionIndicator)) {
+ RefPtr<Range> markerRange = Range::create(document, node, marker.startOffset, node, marker.endOffset);
+ markersToRemove.append(std::make_pair(markerRange, marker.type));
+ }
+ }
+ } else {
+ document->markers()->removeMarkers(node, DocumentMarker::Spelling);
+ document->markers()->removeMarkers(node, DocumentMarker::CorrectionIndicator);
+ }
+ }
+
+ // Actually remove the markers.
+ Vector<RangeMarkerPair>::const_iterator pairEnd = markersToRemove.end();
+ for (Vector<RangeMarkerPair>::const_iterator pairIterator = markersToRemove.begin(); pairIterator != pairEnd; ++pairIterator)
+ document->markers()->removeMarkers(pairIterator->first.get(), pairIterator->second);
+}
+
PassRefPtr<Range> Editor::rangeForPoint(const IntPoint& windowPoint)
{
Document* document = m_frame->documentAtPoint(windowPoint);
diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h
index df2e947..110e3f9 100644
--- a/WebCore/editing/Editor.h
+++ b/WebCore/editing/Editor.h
@@ -34,6 +34,17 @@
#include "EditorInsertAction.h"
#include "SelectionController.h"
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+// Some platforms provide UI for suggesting autocorrection.
+#define SUPPORT_AUTOCORRECTION_PANEL 1
+// Some platforms use spelling and autocorrection markers to provide visual cue.
+// On such platform, if word with marker is edited, we need to remove the marker.
+#define REMOVE_MARKERS_UPON_EDITING 1
+#else
+#define SUPPORT_AUTOCORRECTION_PANEL 0
+#define REMOVE_MARKERS_UPON_EDITING 0
+#endif /* #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) */
+
#if PLATFORM(MAC) && !defined(__OBJC__)
class NSDictionary;
typedef int NSWritingDirection;
@@ -207,7 +218,7 @@ public:
Vector<String> guessesForMisspelledSelection();
Vector<String> guessesForUngrammaticalSelection();
Vector<String> guessesForMisspelledOrUngrammaticalSelection(bool& misspelled, bool& ungrammatical);
- bool spellCheckingEnabledInFocusedNode() const;
+ bool isSpellCheckingEnabledInFocusedNode() const;
void markMisspellingsAfterTypingToPosition(const VisiblePosition&);
void markMisspellings(const VisibleSelection&, RefPtr<Range>& firstMisspellingRange);
void markBadGrammar(const VisibleSelection&);
@@ -362,6 +373,7 @@ public:
#endif
bool selectionStartHasSpellingMarkerFor(int from, int length) const;
+ void removeSpellAndCorrectionMarkersFromWordsToBeEdited(bool doNotRemoveIfSelectionAtWordBoundary);
private:
Frame* m_frame;
@@ -392,6 +404,7 @@ private:
void replaceSelectionWithText(const String&, bool selectReplacement, bool smartReplace);
void writeSelectionToPasteboard(Pasteboard*);
void revealSelectionAfterEditingOperation();
+ void markMisspellingsOrBadGrammar(const VisibleSelection&, bool checkSpelling, RefPtr<Range>& firstMisspellingRange);
void selectComposition();
void confirmComposition(const String&, bool preserveSelection);
diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp
index 23fba39..85becd5 100644
--- a/WebCore/editing/EditorCommand.cpp
+++ b/WebCore/editing/EditorCommand.cpp
@@ -1638,6 +1638,8 @@ String Editor::Command::value(Event* triggeringEvent) const
{
if (!isSupported() || !m_frame)
return String();
+ if (m_command->value == valueNull && m_command->state != stateNone)
+ return m_command->state(m_frame.get(), triggeringEvent) == TrueTriState ? "true" : "false";
return m_command->value(m_frame.get(), triggeringEvent);
}
diff --git a/WebCore/editing/IndentOutdentCommand.cpp b/WebCore/editing/IndentOutdentCommand.cpp
index 9642afa..7089f6f 100644
--- a/WebCore/editing/IndentOutdentCommand.cpp
+++ b/WebCore/editing/IndentOutdentCommand.cpp
@@ -99,6 +99,9 @@ void IndentOutdentCommand::indentIntoBlockquote(const Position& start, const Pos
else
nodeToSplitTo = editableRootForPosition(start);
+ if (!nodeToSplitTo)
+ return;
+
RefPtr<Node> outerBlock = (start.node() == nodeToSplitTo) ? start.node() : splitTreeToNode(start.node(), nodeToSplitTo);
if (!targetBlockquote) {
diff --git a/WebCore/editing/RemoveFormatCommand.cpp b/WebCore/editing/RemoveFormatCommand.cpp
index 65f6008..f8807e2 100644
--- a/WebCore/editing/RemoveFormatCommand.cpp
+++ b/WebCore/editing/RemoveFormatCommand.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2007 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,32 +11,35 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "RemoveFormatCommand.h"
+#include "ApplyStyleCommand.h"
#include "CSSComputedStyleDeclaration.h"
#include "CSSMutableStyleDeclaration.h"
+#include "CSSValueKeywords.h"
#include "Editor.h"
#include "Frame.h"
+#include "HTMLElement.h"
#include "HTMLNames.h"
#include "VisibleSelection.h"
#include "SelectionController.h"
#include "TextIterator.h"
#include "TypingCommand.h"
-#include "ApplyStyleCommand.h"
+#include "htmlediting.h"
namespace WebCore {
@@ -46,6 +50,38 @@ RemoveFormatCommand::RemoveFormatCommand(Document* document)
{
}
+static bool isElementForRemoveFormatCommand(const Element* element)
+{
+ DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, elements, ());
+ if (elements.isEmpty()) {
+ elements.add(acronymTag);
+ elements.add(bTag);
+ elements.add(bdoTag);
+ elements.add(bigTag);
+ elements.add(citeTag);
+ elements.add(codeTag);
+ elements.add(dfnTag);
+ elements.add(emTag);
+ elements.add(fontTag);
+ elements.add(iTag);
+ elements.add(insTag);
+ elements.add(kbdTag);
+ elements.add(nobrTag);
+ elements.add(qTag);
+ elements.add(sTag);
+ elements.add(sampTag);
+ elements.add(smallTag);
+ elements.add(strikeTag);
+ elements.add(strongTag);
+ elements.add(subTag);
+ elements.add(supTag);
+ elements.add(ttTag);
+ elements.add(uTag);
+ elements.add(varTag);
+ }
+ return elements.contains(element->tagQName());
+}
+
void RemoveFormatCommand::doApply()
{
Frame* frame = document()->frame();
@@ -53,34 +89,12 @@ void RemoveFormatCommand::doApply()
if (!frame->selection()->selection().isNonOrphanedCaretOrRange())
return;
- // Make a plain text string from the selection to remove formatting like tables and lists.
- String string = plainText(frame->selection()->selection().toNormalizedRange().get());
-
// Get the default style for this editable root, it's the style that we'll give the
// content that we're operating on.
Node* root = frame->selection()->rootEditableElement();
RefPtr<CSSMutableStyleDeclaration> defaultStyle = ApplyStyleCommand::editingStyleAtPosition(Position(root, 0));
- // Delete the selected content.
- // FIXME: We should be able to leave this to insertText, but its delete operation
- // doesn't preserve the style we're about to set.
- deleteSelection();
-
- // Delete doesn't remove fully selected lists.
- while (breakOutOfEmptyListItem())
- ;
-
- // If the selection was all formatting (like an empty list) the format-less text will
- // be empty. Early return since we don't need to do any of the work that follows and
- // to avoid the ASSERT that fires if input(...) is called with an empty String.
- if (string.isEmpty())
- return;
-
- // Insert the content with the default style.
- // See <rdar://problem/5794382> RemoveFormat doesn't always reset text alignment
- frame->selection()->setTypingStyle(defaultStyle.release());
-
- inputText(string, true);
+ applyCommandToComposite(ApplyStyleCommand::create(document(), defaultStyle.get(), isElementForRemoveFormatCommand, editingAction()));
}
}
diff --git a/WebCore/editing/TextCheckingHelper.cpp b/WebCore/editing/TextCheckingHelper.cpp
new file mode 100644
index 0000000..49674ff
--- /dev/null
+++ b/WebCore/editing/TextCheckingHelper.cpp
@@ -0,0 +1,525 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TextCheckingHelper.h"
+
+#include "Range.h"
+#include "TextIterator.h"
+#include "VisiblePosition.h"
+#include "visible_units.h"
+
+namespace WebCore {
+
+TextCheckingHelper::TextCheckingHelper(EditorClient* client, PassRefPtr<Range> range)
+ : m_client(client)
+ , m_range(range)
+{
+ ASSERT_ARG(m_client, m_client);
+ ASSERT_ARG(m_range, m_range);
+}
+
+TextCheckingHelper::~TextCheckingHelper()
+{
+}
+
+PassRefPtr<Range> TextCheckingHelper::paragraphAlignedRange(int& offsetIntoParagraphAlignedRange, String& paragraphString) const
+{
+#ifndef BUILDING_ON_TIGER
+ ExceptionCode ec = 0;
+
+ // Expand range to paragraph boundaries
+ RefPtr<Range> paragraphRange = m_range->cloneRange(ec);
+ setStart(paragraphRange.get(), startOfParagraph(m_range->startPosition()));
+ setEnd(paragraphRange.get(), endOfParagraph(m_range->endPosition()));
+
+ // Compute offset from start of expanded range to start of original range
+ RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), m_range->startPosition());
+ offsetIntoParagraphAlignedRange = TextIterator::rangeLength(offsetAsRange.get());
+
+ // Fill in out parameter with string representing entire paragraph range.
+ // Someday we might have a caller that doesn't use this, but for now all callers do.
+ paragraphString = plainText(paragraphRange.get());
+
+ return paragraphRange;
+#else
+ ASSERT_NOT_REACHED();
+ UNUSED_PARAM(offsetIntoParagraphAlignedRange);
+ UNUSED_PARAM(paragraphString);
+ return PassRefPtr<Range>(0);
+#endif
+}
+
+String TextCheckingHelper::findFirstMisspelling(int& firstMisspellingOffset, bool markAll, RefPtr<Range>& firstMisspellingRange)
+{
+ WordAwareIterator it(m_range.get());
+ firstMisspellingOffset = 0;
+
+ String firstMisspelling;
+ int currentChunkOffset = 0;
+
+ while (!it.atEnd()) {
+ const UChar* chars = it.characters();
+ int len = it.length();
+
+ // Skip some work for one-space-char hunks
+ if (!(len == 1 && chars[0] == ' ')) {
+
+ int misspellingLocation = -1;
+ int misspellingLength = 0;
+ m_client->checkSpellingOfString(chars, len, &misspellingLocation, &misspellingLength);
+
+ // 5490627 shows that there was some code path here where the String constructor below crashes.
+ // We don't know exactly what combination of bad input caused this, so we're making this much
+ // more robust against bad input on release builds.
+ ASSERT(misspellingLength >= 0);
+ ASSERT(misspellingLocation >= -1);
+ ASSERT(!misspellingLength || misspellingLocation >= 0);
+ ASSERT(misspellingLocation < len);
+ ASSERT(misspellingLength <= len);
+ ASSERT(misspellingLocation + misspellingLength <= len);
+
+ if (misspellingLocation >= 0 && misspellingLength > 0 && misspellingLocation < len && misspellingLength <= len && misspellingLocation + misspellingLength <= len) {
+
+ // Compute range of misspelled word
+ RefPtr<Range> misspellingRange = TextIterator::subrange(m_range.get(), currentChunkOffset + misspellingLocation, misspellingLength);
+
+ // Remember first-encountered misspelling and its offset.
+ if (!firstMisspelling) {
+ firstMisspellingOffset = currentChunkOffset + misspellingLocation;
+ firstMisspelling = String(chars + misspellingLocation, misspellingLength);
+ firstMisspellingRange = misspellingRange;
+ }
+
+ // Store marker for misspelled word.
+ ExceptionCode ec = 0;
+ misspellingRange->startContainer(ec)->document()->markers()->addMarker(misspellingRange.get(), DocumentMarker::Spelling);
+ ASSERT(!ec);
+
+ // Bail out if we're marking only the first misspelling, and not all instances.
+ if (!markAll)
+ break;
+ }
+ }
+
+ currentChunkOffset += len;
+ it.advance();
+ }
+
+ return firstMisspelling;
+}
+
+String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, bool& outIsSpelling, int& outFirstFoundOffset, GrammarDetail& outGrammarDetail)
+{
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ String firstFoundItem;
+ String misspelledWord;
+ String badGrammarPhrase;
+ ExceptionCode ec = 0;
+
+ // Initialize out parameters; these will be updated if we find something to return.
+ outIsSpelling = true;
+ outFirstFoundOffset = 0;
+ outGrammarDetail.location = -1;
+ outGrammarDetail.length = 0;
+ outGrammarDetail.guesses.clear();
+ outGrammarDetail.userDescription = "";
+
+ // Expand the search range to encompass entire paragraphs, since text checking needs that much context.
+ // Determine the character offset from the start of the paragraph to the start of the original search range,
+ // since we will want to ignore results in this area.
+ RefPtr<Range> paragraphRange = m_range->cloneRange(ec);
+ setStart(paragraphRange.get(), startOfParagraph(m_range->startPosition()));
+ int totalRangeLength = TextIterator::rangeLength(paragraphRange.get());
+ setEnd(paragraphRange.get(), endOfParagraph(m_range->startPosition()));
+
+ RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), m_range->startPosition());
+ int rangeStartOffset = TextIterator::rangeLength(offsetAsRange.get());
+ int totalLengthProcessed = 0;
+
+ bool firstIteration = true;
+ bool lastIteration = false;
+ while (totalLengthProcessed < totalRangeLength) {
+ // Iterate through the search range by paragraphs, checking each one for spelling and grammar.
+ int currentLength = TextIterator::rangeLength(paragraphRange.get());
+ int currentStartOffset = firstIteration ? rangeStartOffset : 0;
+ int currentEndOffset = currentLength;
+ if (inSameParagraph(paragraphRange->startPosition(), m_range->endPosition())) {
+ // Determine the character offset from the end of the original search range to the end of the paragraph,
+ // since we will want to ignore results in this area.
+ RefPtr<Range> endOffsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), m_range->endPosition());
+ currentEndOffset = TextIterator::rangeLength(endOffsetAsRange.get());
+ lastIteration = true;
+ }
+ if (currentStartOffset < currentEndOffset) {
+ String paragraphString = plainText(paragraphRange.get());
+ if (paragraphString.length() > 0) {
+ bool foundGrammar = false;
+ int spellingLocation = 0;
+ int grammarPhraseLocation = 0;
+ int grammarDetailLocation = 0;
+ unsigned grammarDetailIndex = 0;
+
+ Vector<TextCheckingResult> results;
+ uint64_t checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling;
+ m_client->checkTextOfParagraph(paragraphString.characters(), paragraphString.length(), checkingTypes, results);
+
+ for (unsigned i = 0; i < results.size(); i++) {
+ const TextCheckingResult* result = &results[i];
+ if (result->type == TextCheckingTypeSpelling && result->location >= currentStartOffset && result->location + result->length <= currentEndOffset) {
+ ASSERT(result->length > 0 && result->location >= 0);
+ spellingLocation = result->location;
+ misspelledWord = paragraphString.substring(result->location, result->length);
+ ASSERT(misspelledWord.length());
+ break;
+ }
+ if (checkGrammar && result->type == TextCheckingTypeGrammar && result->location < currentEndOffset && result->location + result->length > currentStartOffset) {
+ ASSERT(result->length > 0 && result->location >= 0);
+ // We can't stop after the first grammar result, since there might still be a spelling result after
+ // it begins but before the first detail in it, but we can stop if we find a second grammar result.
+ if (foundGrammar)
+ break;
+ for (unsigned j = 0; j < result->details.size(); j++) {
+ const GrammarDetail* detail = &result->details[j];
+ ASSERT(detail->length > 0 && detail->location >= 0);
+ if (result->location + detail->location >= currentStartOffset && result->location + detail->location + detail->length <= currentEndOffset && (!foundGrammar || result->location + detail->location < grammarDetailLocation)) {
+ grammarDetailIndex = j;
+ grammarDetailLocation = result->location + detail->location;
+ foundGrammar = true;
+ }
+ }
+ if (foundGrammar) {
+ grammarPhraseLocation = result->location;
+ outGrammarDetail = result->details[grammarDetailIndex];
+ badGrammarPhrase = paragraphString.substring(result->location, result->length);
+ ASSERT(badGrammarPhrase.length());
+ }
+ }
+ }
+
+ if (!misspelledWord.isEmpty() && (!checkGrammar || badGrammarPhrase.isEmpty() || spellingLocation <= grammarDetailLocation)) {
+ int spellingOffset = spellingLocation - currentStartOffset;
+ if (!firstIteration) {
+ RefPtr<Range> paragraphOffsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), m_range->startPosition(), paragraphRange->startPosition());
+ spellingOffset += TextIterator::rangeLength(paragraphOffsetAsRange.get());
+ }
+ outIsSpelling = true;
+ outFirstFoundOffset = spellingOffset;
+ firstFoundItem = misspelledWord;
+ break;
+ }
+ if (checkGrammar && !badGrammarPhrase.isEmpty()) {
+ int grammarPhraseOffset = grammarPhraseLocation - currentStartOffset;
+ if (!firstIteration) {
+ RefPtr<Range> paragraphOffsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), m_range->startPosition(), paragraphRange->startPosition());
+ grammarPhraseOffset += TextIterator::rangeLength(paragraphOffsetAsRange.get());
+ }
+ outIsSpelling = false;
+ outFirstFoundOffset = grammarPhraseOffset;
+ firstFoundItem = badGrammarPhrase;
+ break;
+ }
+ }
+ }
+ if (lastIteration || totalLengthProcessed + currentLength >= totalRangeLength)
+ break;
+ VisiblePosition newParagraphStart = startOfNextParagraph(paragraphRange->endPosition());
+ setStart(paragraphRange.get(), newParagraphStart);
+ setEnd(paragraphRange.get(), endOfParagraph(newParagraphStart));
+ firstIteration = false;
+ totalLengthProcessed += currentLength;
+ }
+ return firstFoundItem;
+#else
+ ASSERT_NOT_REACHED();
+ UNUSED_PARAM(checkGrammar);
+ UNUSED_PARAM(outIsSpelling);
+ UNUSED_PARAM(outFirstFoundOffset);
+ UNUSED_PARAM(outGrammarDetail);
+ return "";
+#endif
+}
+
+int TextCheckingHelper::findFirstGrammarDetail(const Vector<GrammarDetail>& grammarDetails, int badGrammarPhraseLocation, int /*badGrammarPhraseLength*/, int startOffset, int endOffset, bool markAll)
+{
+#ifndef BUILDING_ON_TIGER
+ // Found some bad grammar. Find the earliest detail range that starts in our search range (if any).
+ // Optionally add a DocumentMarker for each detail in the range.
+ int earliestDetailLocationSoFar = -1;
+ int earliestDetailIndex = -1;
+ for (unsigned i = 0; i < grammarDetails.size(); i++) {
+ const GrammarDetail* detail = &grammarDetails[i];
+ ASSERT(detail->length > 0 && detail->location >= 0);
+
+ int detailStartOffsetInParagraph = badGrammarPhraseLocation + detail->location;
+
+ // Skip this detail if it starts before the original search range
+ if (detailStartOffsetInParagraph < startOffset)
+ continue;
+
+ // Skip this detail if it starts after the original search range
+ if (detailStartOffsetInParagraph >= endOffset)
+ continue;
+
+ if (markAll) {
+ RefPtr<Range> badGrammarRange = TextIterator::subrange(m_range.get(), badGrammarPhraseLocation - startOffset + detail->location, detail->length);
+ ExceptionCode ec = 0;
+ badGrammarRange->startContainer(ec)->document()->markers()->addMarker(badGrammarRange.get(), DocumentMarker::Grammar, detail->userDescription);
+ ASSERT(!ec);
+ }
+
+ // Remember this detail only if it's earlier than our current candidate (the details aren't in a guaranteed order)
+ if (earliestDetailIndex < 0 || earliestDetailLocationSoFar > detail->location) {
+ earliestDetailIndex = i;
+ earliestDetailLocationSoFar = detail->location;
+ }
+ }
+
+ return earliestDetailIndex;
+#else
+ ASSERT_NOT_REACHED();
+ UNUSED_PARAM(grammarDetails);
+ UNUSED_PARAM(badGrammarPhraseLocation);
+ UNUSED_PARAM(startOffset);
+ UNUSED_PARAM(endOffset);
+ UNUSED_PARAM(markAll);
+ return 0;
+#endif
+}
+
+String TextCheckingHelper::findFirstBadGrammar(GrammarDetail& outGrammarDetail, int& outGrammarPhraseOffset, bool markAll)
+{
+#ifndef BUILDING_ON_TIGER
+ // Initialize out parameters; these will be updated if we find something to return.
+ outGrammarDetail.location = -1;
+ outGrammarDetail.length = 0;
+ outGrammarDetail.guesses.clear();
+ outGrammarDetail.userDescription = "";
+ outGrammarPhraseOffset = 0;
+
+ String firstBadGrammarPhrase;
+
+ // Expand the search range to encompass entire paragraphs, since grammar checking needs that much context.
+ // Determine the character offset from the start of the paragraph to the start of the original search range,
+ // since we will want to ignore results in this area.
+ int searchRangeStartOffset;
+ String paragraphString;
+ RefPtr<Range> paragraphRange = paragraphAlignedRange(searchRangeStartOffset, paragraphString);
+
+ // Determine the character offset from the start of the paragraph to the end of the original search range,
+ // since we will want to ignore results in this area also.
+ int searchRangeEndOffset = searchRangeStartOffset + TextIterator::rangeLength(m_range.get());
+
+ // Start checking from beginning of paragraph, but skip past results that occur before the start of the original search range.
+ int startOffset = 0;
+ while (startOffset < searchRangeEndOffset) {
+ Vector<GrammarDetail> grammarDetails;
+ int badGrammarPhraseLocation = -1;
+ int badGrammarPhraseLength = 0;
+ m_client->checkGrammarOfString(paragraphString.characters() + startOffset, paragraphString.length() - startOffset, grammarDetails, &badGrammarPhraseLocation, &badGrammarPhraseLength);
+
+ if (!badGrammarPhraseLength) {
+ ASSERT(badGrammarPhraseLocation == -1);
+ return String();
+ }
+
+ ASSERT(badGrammarPhraseLocation >= 0);
+ badGrammarPhraseLocation += startOffset;
+
+
+ // Found some bad grammar. Find the earliest detail range that starts in our search range (if any).
+ int badGrammarIndex = findFirstGrammarDetail(grammarDetails, badGrammarPhraseLocation, badGrammarPhraseLength, searchRangeStartOffset, searchRangeEndOffset, markAll);
+ if (badGrammarIndex >= 0) {
+ ASSERT(static_cast<unsigned>(badGrammarIndex) < grammarDetails.size());
+ outGrammarDetail = grammarDetails[badGrammarIndex];
+ }
+
+ // If we found a detail in range, then we have found the first bad phrase (unless we found one earlier but
+ // kept going so we could mark all instances).
+ if (badGrammarIndex >= 0 && firstBadGrammarPhrase.isEmpty()) {
+ outGrammarPhraseOffset = badGrammarPhraseLocation - searchRangeStartOffset;
+ firstBadGrammarPhrase = paragraphString.substring(badGrammarPhraseLocation, badGrammarPhraseLength);
+
+ // Found one. We're done now, unless we're marking each instance.
+ if (!markAll)
+ break;
+ }
+
+ // These results were all between the start of the paragraph and the start of the search range; look
+ // beyond this phrase.
+ startOffset = badGrammarPhraseLocation + badGrammarPhraseLength;
+ }
+
+ return firstBadGrammarPhrase;
+#else
+ ASSERT_NOT_REACHED();
+ UNUSED_PARAM(outGrammarDetail);
+ UNUSED_PARAM(outGrammarPhraseOffset);
+ UNUSED_PARAM(markAll);
+#endif
+}
+
+
+bool TextCheckingHelper::isUngrammatical(Vector<String>& guessesVector) const
+{
+#ifndef BUILDING_ON_TIGER
+ if (!m_client)
+ return false;
+
+ ExceptionCode ec;
+ if (!m_range || m_range->collapsed(ec))
+ return false;
+
+ // Returns true only if the passed range exactly corresponds to a bad grammar detail range. This is analogous
+ // to isSelectionMisspelled. It's not good enough for there to be some bad grammar somewhere in the range,
+ // or overlapping the range; the ranges must exactly match.
+ guessesVector.clear();
+ int grammarPhraseOffset;
+
+ GrammarDetail grammarDetail;
+ String badGrammarPhrase = const_cast<TextCheckingHelper*>(this)->findFirstBadGrammar(grammarDetail, grammarPhraseOffset, false);
+
+ // No bad grammar in these parts at all.
+ if (badGrammarPhrase.isEmpty())
+ return false;
+
+ // Bad grammar, but phrase (e.g. sentence) starts beyond start of range.
+ if (grammarPhraseOffset > 0)
+ return false;
+
+ ASSERT(grammarDetail.location >= 0 && grammarDetail.length > 0);
+
+ // Bad grammar, but start of detail (e.g. ungrammatical word) doesn't match start of range
+ if (grammarDetail.location + grammarPhraseOffset)
+ return false;
+
+ // Bad grammar at start of range, but end of bad grammar is before or after end of range
+ if (grammarDetail.length != TextIterator::rangeLength(m_range.get()))
+ return false;
+
+ // Update the spelling panel to be displaying this error (whether or not the spelling panel is on screen).
+ // This is necessary to make a subsequent call to [NSSpellChecker ignoreWord:inSpellDocumentWithTag:] work
+ // correctly; that call behaves differently based on whether the spelling panel is displaying a misspelling
+ // or a grammar error.
+ m_client->updateSpellingUIWithGrammarString(badGrammarPhrase, grammarDetail);
+
+ return true;
+#else
+ ASSERT_NOT_REACHED();
+ UNUSED_PARAM(guessesVector);
+ return true;
+#endif
+}
+
+Vector<String> TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange(bool checkGrammar, bool& misspelled, bool& ungrammatical) const
+{
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ Vector<String> guesses;
+ ExceptionCode ec;
+ misspelled = false;
+ ungrammatical = false;
+
+ if (!m_client || !m_range || m_range->collapsed(ec))
+ return guesses;
+
+ // Expand the range to encompass entire paragraphs, since text checking needs that much context.
+ int rangeStartOffset;
+ String paragraphString;
+ RefPtr<Range> paragraphRange = paragraphAlignedRange(rangeStartOffset, paragraphString);
+ int rangeLength = TextIterator::rangeLength(m_range.get());
+ if (!rangeLength || !paragraphString.length())
+ return guesses;
+
+ Vector<TextCheckingResult> results;
+ uint64_t checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling;
+ m_client->checkTextOfParagraph(paragraphString.characters(), paragraphString.length(), checkingTypes, results);
+
+ for (unsigned i = 0; i < results.size(); i++) {
+ const TextCheckingResult* result = &results[i];
+ if (result->type == TextCheckingTypeSpelling && result->location == rangeStartOffset && result->length == rangeLength) {
+ String misspelledWord = paragraphString.substring(rangeStartOffset, rangeLength);
+ ASSERT(misspelledWord.length());
+ m_client->getGuessesForWord(misspelledWord, guesses);
+ m_client->updateSpellingUIWithMisspelledWord(misspelledWord);
+ misspelled = true;
+ return guesses;
+ }
+ }
+
+ if (!checkGrammar)
+ return guesses;
+
+ for (unsigned i = 0; i < results.size(); i++) {
+ const TextCheckingResult* result = &results[i];
+ if (result->type == TextCheckingTypeGrammar && result->location <= rangeStartOffset && result->location + result->length >= rangeStartOffset + rangeLength) {
+ for (unsigned j = 0; j < result->details.size(); j++) {
+ const GrammarDetail* detail = &result->details[j];
+ ASSERT(detail->length > 0 && detail->location >= 0);
+ if (result->location + detail->location == rangeStartOffset && detail->length == rangeLength) {
+ String badGrammarPhrase = paragraphString.substring(result->location, result->length);
+ ASSERT(badGrammarPhrase.length());
+ for (unsigned k = 0; k < detail->guesses.size(); k++)
+ guesses.append(detail->guesses[k]);
+ m_client->updateSpellingUIWithGrammarString(badGrammarPhrase, *detail);
+ ungrammatical = true;
+ return guesses;
+ }
+ }
+ }
+ }
+ return guesses;
+#else
+ ASSERT_NOT_REACHED();
+ UNUSED_PARAM(checkGrammar);
+ UNUSED_PARAM(misspelled);
+ UNUSED_PARAM(ungrammatical);
+ return Vector<String>();
+#endif
+}
+
+
+void TextCheckingHelper::markAllMisspellings(RefPtr<Range>& firstMisspellingRange)
+{
+ // Use the "markAll" feature of findFirstMisspelling. Ignore the return value and the "out parameter";
+ // all we need to do is mark every instance.
+ int ignoredOffset;
+ findFirstMisspelling(ignoredOffset, true, firstMisspellingRange);
+}
+
+void TextCheckingHelper::markAllBadGrammar()
+{
+#ifndef BUILDING_ON_TIGER
+ // Use the "markAll" feature of findFirstBadGrammar. Ignore the return value and "out parameters"; all we need to
+ // do is mark every instance.
+ GrammarDetail ignoredGrammarDetail;
+ int ignoredOffset;
+ findFirstBadGrammar(ignoredGrammarDetail, ignoredOffset, true);
+#else
+ ASSERT_NOT_REACHED();
+#endif
+}
+
+}
diff --git a/WebCore/editing/TextCheckingHelper.h b/WebCore/editing/TextCheckingHelper.h
new file mode 100644
index 0000000..1dd3b3d
--- /dev/null
+++ b/WebCore/editing/TextCheckingHelper.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef TextCheckingHelper_h
+#define TextCheckingHelper_h
+
+#include "EditorClient.h"
+
+namespace WebCore {
+
+class Range;
+
+class TextCheckingHelper : public Noncopyable {
+public:
+ TextCheckingHelper(EditorClient*, PassRefPtr<Range>);
+ ~TextCheckingHelper();
+
+ String findFirstMisspelling(int& firstMisspellingOffset, bool markAll, RefPtr<Range>& firstMisspellingRange);
+ String findFirstMisspellingOrBadGrammar(bool checkGrammar, bool& outIsSpelling, int& outFirstFoundOffset, GrammarDetail& outGrammarDetail);
+ String findFirstBadGrammar(GrammarDetail& outGrammarDetail, int& outGrammarPhraseOffset, bool markAll);
+ int findFirstGrammarDetail(const Vector<GrammarDetail>& grammarDetails, int badGrammarPhraseLocation, int badGrammarPhraseLength, int startOffset, int endOffset, bool markAll);
+ void markAllMisspellings(RefPtr<Range>& firstMisspellingRange);
+ void markAllBadGrammar();
+
+ bool isUngrammatical(Vector<String>& guessesVector) const;
+ Vector<String> guessesForMisspelledOrUngrammaticalRange(bool checkGrammar, bool& misspelled, bool& ungrammatical) const;
+ PassRefPtr<Range> paragraphAlignedRange(int& offsetIntoParagraphAlignedRange, String& paragraphString) const;
+private:
+ EditorClient* m_client;
+ RefPtr<Range> m_range;
+};
+
+} // namespace WebCore
+
+#endif // TextCheckingHelper_h
diff --git a/WebCore/editing/TypingCommand.cpp b/WebCore/editing/TypingCommand.cpp
index 60b3f7b..d78708b 100644
--- a/WebCore/editing/TypingCommand.cpp
+++ b/WebCore/editing/TypingCommand.cpp
@@ -131,14 +131,18 @@ void TypingCommand::insertText(Document* document, const String& text, bool sele
void TypingCommand::insertText(Document* document, const String& text, const VisibleSelection& selectionForInsertion, bool selectInsertedText, bool insertedTextIsComposition)
{
+#if REMOVE_MARKERS_UPON_EDITING
+ if (!text.isEmpty())
+ document->frame()->editor()->removeSpellAndCorrectionMarkersFromWordsToBeEdited(isSpaceOrNewline(text.characters()[0]));
+#endif
+
ASSERT(document);
-
+
RefPtr<Frame> frame = document->frame();
ASSERT(frame);
-
+
VisibleSelection currentSelection = frame->selection()->selection();
bool changeSelection = currentSelection != selectionForInsertion;
-
String newText = text;
Node* startNode = selectionForInsertion.start().node();
@@ -419,9 +423,12 @@ bool TypingCommand::makeEditableRootEmpty()
void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
{
+#if REMOVE_MARKERS_UPON_EDITING
+ document()->frame()->editor()->removeSpellAndCorrectionMarkersFromWordsToBeEdited(false);
+#endif
VisibleSelection selectionToDelete;
VisibleSelection selectionAfterUndo;
-
+
switch (endingSelection().selectionType()) {
case VisibleSelection::RangeSelection:
selectionToDelete = endingSelection();
@@ -515,6 +522,9 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity, bool killRing)
{
+#if REMOVE_MARKERS_UPON_EDITING
+ document()->frame()->editor()->removeSpellAndCorrectionMarkersFromWordsToBeEdited(false);
+#endif
VisibleSelection selectionToDelete;
VisibleSelection selectionAfterUndo;
diff --git a/WebCore/editing/visible_units.cpp b/WebCore/editing/visible_units.cpp
index d9ca223..8b11013 100644
--- a/WebCore/editing/visible_units.cpp
+++ b/WebCore/editing/visible_units.cpp
@@ -29,6 +29,7 @@
#include "Document.h"
#include "Element.h"
#include "HTMLNames.h"
+#include "Position.h"
#include "RenderBlock.h"
#include "RenderLayer.h"
#include "RenderObject.h"
@@ -779,7 +780,7 @@ VisiblePosition nextSentencePosition(const VisiblePosition &c)
return c.honorEditableBoundaryAtOrBefore(next);
}
-VisiblePosition startOfParagraph(const VisiblePosition& c)
+VisiblePosition startOfParagraph(const VisiblePosition& c, Position::EditingBoundaryCrossingRule boundaryCrossingRule)
{
Position p = c.deepEquivalent();
Node *startNode = p.node();
@@ -797,7 +798,7 @@ VisiblePosition startOfParagraph(const VisiblePosition& c)
Node *n = startNode;
while (n) {
- if (n->isContentEditable() != startNode->isContentEditable())
+ if (boundaryCrossingRule == Position::CannotCrossEditingBoundary && n->isContentEditable() != startNode->isContentEditable())
break;
RenderObject *r = n->renderer();
if (!r) {
@@ -812,8 +813,8 @@ VisiblePosition startOfParagraph(const VisiblePosition& c)
if (r->isBR() || isBlock(n))
break;
-
- if (r->isText()) {
+
+ if (r->isText() && r->caretMaxRenderedOffset() > 0) {
if (style->preserveNewline()) {
const UChar* chars = toRenderText(r)->characters();
int i = toRenderText(r)->textLength();
@@ -838,7 +839,7 @@ VisiblePosition startOfParagraph(const VisiblePosition& c)
return VisiblePosition(node, offset, DOWNSTREAM);
}
-VisiblePosition endOfParagraph(const VisiblePosition &c)
+VisiblePosition endOfParagraph(const VisiblePosition &c, Position::EditingBoundaryCrossingRule boundaryCrossingRule)
{
if (c.isNull())
return VisiblePosition();
@@ -857,7 +858,7 @@ VisiblePosition endOfParagraph(const VisiblePosition &c)
Node *n = startNode;
while (n) {
- if (n->isContentEditable() != startNode->isContentEditable())
+ if (boundaryCrossingRule == Position::CannotCrossEditingBoundary && n->isContentEditable() != startNode->isContentEditable())
break;
RenderObject *r = n->renderer();
if (!r) {
@@ -872,9 +873,8 @@ VisiblePosition endOfParagraph(const VisiblePosition &c)
if (r->isBR() || isBlock(n))
break;
-
+
// FIXME: We avoid returning a position where the renderer can't accept the caret.
- // We should probably do this in other cases such as startOfParagraph.
if (r->isText() && r->caretMaxRenderedOffset() > 0) {
int length = toRenderText(r)->textLength();
if (style->preserveNewline()) {
@@ -914,14 +914,14 @@ bool inSameParagraph(const VisiblePosition &a, const VisiblePosition &b)
return a.isNotNull() && startOfParagraph(a) == startOfParagraph(b);
}
-bool isStartOfParagraph(const VisiblePosition &pos)
+bool isStartOfParagraph(const VisiblePosition &pos, Position::EditingBoundaryCrossingRule boundaryCrossingRule)
{
- return pos.isNotNull() && pos == startOfParagraph(pos);
+ return pos.isNotNull() && pos == startOfParagraph(pos, boundaryCrossingRule);
}
-bool isEndOfParagraph(const VisiblePosition &pos)
+bool isEndOfParagraph(const VisiblePosition &pos, Position::EditingBoundaryCrossingRule boundaryCrossingRule)
{
- return pos.isNotNull() && pos == endOfParagraph(pos);
+ return pos.isNotNull() && pos == endOfParagraph(pos, boundaryCrossingRule);
}
VisiblePosition previousParagraphPosition(const VisiblePosition& p, int x)
diff --git a/WebCore/editing/visible_units.h b/WebCore/editing/visible_units.h
index a20b588..f78f9d1 100644
--- a/WebCore/editing/visible_units.h
+++ b/WebCore/editing/visible_units.h
@@ -27,6 +27,7 @@
#define visible_units_h
#include "Document.h"
+#include "Position.h"
#include "TextAffinity.h"
namespace WebCore {
@@ -60,14 +61,14 @@ VisiblePosition logicalStartOfLine(const VisiblePosition &);
VisiblePosition logicalEndOfLine(const VisiblePosition &);
// paragraphs (perhaps a misnomer, can be divided by line break elements)
-VisiblePosition startOfParagraph(const VisiblePosition&);
-VisiblePosition endOfParagraph(const VisiblePosition&);
+VisiblePosition startOfParagraph(const VisiblePosition&, Position::EditingBoundaryCrossingRule = Position::CannotCrossEditingBoundary);
+VisiblePosition endOfParagraph(const VisiblePosition&, Position::EditingBoundaryCrossingRule = Position::CannotCrossEditingBoundary);
VisiblePosition startOfNextParagraph(const VisiblePosition&);
VisiblePosition previousParagraphPosition(const VisiblePosition &, int x);
VisiblePosition nextParagraphPosition(const VisiblePosition &, int x);
+bool isStartOfParagraph(const VisiblePosition &, Position::EditingBoundaryCrossingRule = Position::CannotCrossEditingBoundary);
+bool isEndOfParagraph(const VisiblePosition &, Position::EditingBoundaryCrossingRule = Position::CannotCrossEditingBoundary);
bool inSameParagraph(const VisiblePosition &, const VisiblePosition &);
-bool isStartOfParagraph(const VisiblePosition &);
-bool isEndOfParagraph(const VisiblePosition &);
// blocks (true paragraphs; line break elements don't break blocks)
VisiblePosition startOfBlock(const VisiblePosition &);
diff --git a/WebCore/fileapi/AsyncFileWriterClient.h b/WebCore/fileapi/AsyncFileWriterClient.h
index 327b19c..929f523 100644
--- a/WebCore/fileapi/AsyncFileWriterClient.h
+++ b/WebCore/fileapi/AsyncFileWriterClient.h
@@ -33,7 +33,7 @@
#if ENABLE(FILE_SYSTEM)
-#include "ExceptionCode.h"
+#include "FileError.h"
namespace WebCore {
@@ -43,7 +43,7 @@ public:
virtual void didWrite(long long bytes, bool complete) = 0;
virtual void didTruncate() = 0;
- virtual void didFail(ExceptionCode) = 0;
+ virtual void didFail(FileError::ErrorCode) = 0;
};
} // namespace
diff --git a/WebCore/fileapi/BlobBuilder.cpp b/WebCore/fileapi/BlobBuilder.cpp
index 69443a5..9406899 100644
--- a/WebCore/fileapi/BlobBuilder.cpp
+++ b/WebCore/fileapi/BlobBuilder.cpp
@@ -32,12 +32,16 @@
#include "BlobBuilder.h"
+#include "ArrayBuffer.h"
#include "Blob.h"
#include "ExceptionCode.h"
#include "File.h"
#include "LineEnding.h"
#include "TextEncoding.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/Vector.h>
#include <wtf/text/AtomicString.h>
+#include <wtf/text/CString.h>
namespace WebCore {
@@ -46,46 +50,57 @@ BlobBuilder::BlobBuilder()
{
}
-bool BlobBuilder::append(const String& text, const String& endingType, ExceptionCode& ec)
+Vector<char>& BlobBuilder::getBuffer()
+{
+ // If the last item is not a data item, create one. Otherwise, we simply append the new string to the last data item.
+ if (m_items.isEmpty() || m_items[m_items.size() - 1].type != BlobDataItem::Data)
+ m_items.append(BlobDataItem(RawData::create()));
+
+ return *m_items[m_items.size() - 1].data->mutableData();
+}
+
+void BlobBuilder::append(const String& text, const String& endingType, ExceptionCode& ec)
{
bool isEndingTypeTransparent = endingType == "transparent";
bool isEndingTypeNative = endingType == "native";
if (!endingType.isEmpty() && !isEndingTypeTransparent && !isEndingTypeNative) {
ec = SYNTAX_ERR;
- return 0;
+ return;
}
CString utf8Text = UTF8Encoding().encode(text.characters(), text.length(), EntitiesForUnencodables);
- // If the last item is not a data item, create one. Otherwise, we simply append the new string to the last data item.
- if (m_items.isEmpty() || m_items[m_items.size() - 1].type != BlobDataItem::Data)
- m_items.append(BlobDataItem(RawData::create()));
-
- if (!utf8Text.isNull()) {
- Vector<char>& buffer = *m_items[m_items.size() - 1].data->mutableData();
- size_t oldSize = buffer.size();
+ Vector<char>& buffer = getBuffer();
+ size_t oldSize = buffer.size();
- if (isEndingTypeNative)
- normalizeLineEndingsToNative(utf8Text, buffer);
- else
- buffer.append(utf8Text.data(), utf8Text.length());
- m_size += buffer.size() - oldSize;
- }
+ if (isEndingTypeNative)
+ normalizeLineEndingsToNative(utf8Text, buffer);
+ else
+ buffer.append(utf8Text.data(), utf8Text.length());
+ m_size += buffer.size() - oldSize;
+}
- return true;
+void BlobBuilder::append(const String& text, ExceptionCode& ec)
+{
+ append(text, String(), ec);
}
-bool BlobBuilder::append(const String& text, ExceptionCode& ec)
+#if ENABLE(BLOB)
+void BlobBuilder::append(ArrayBuffer* arrayBuffer)
{
- return append(text, String(), ec);
+ Vector<char>& buffer = getBuffer();
+ size_t oldSize = buffer.size();
+ buffer.append(static_cast<const char*>(arrayBuffer->data()), arrayBuffer->byteLength());
+ m_size += buffer.size() - oldSize;
}
+#endif
-bool BlobBuilder::append(PassRefPtr<Blob> blob)
+void BlobBuilder::append(Blob* blob)
{
if (blob->isFile()) {
// If the blob is file that is not snapshoted, capture the snapshot now.
// FIXME: This involves synchronous file operation. We need to figure out how to make it asynchronous.
- File* file = static_cast<File*>(blob.get());
+ File* file = static_cast<File*>(blob);
long long snapshotSize;
double snapshotModificationTime;
file->captureSnapshot(snapshotSize, snapshotModificationTime);
@@ -97,7 +112,6 @@ bool BlobBuilder::append(PassRefPtr<Blob> blob)
m_size += blobSize;
m_items.append(BlobDataItem(blob->url(), 0, blobSize));
}
- return true;
}
PassRefPtr<Blob> BlobBuilder::getBlob(const String& contentType)
diff --git a/WebCore/fileapi/BlobBuilder.h b/WebCore/fileapi/BlobBuilder.h
index a981e31..db46591 100644
--- a/WebCore/fileapi/BlobBuilder.h
+++ b/WebCore/fileapi/BlobBuilder.h
@@ -32,14 +32,12 @@
#define BlobBuilder_h
#include "BlobData.h"
-#include "PlatformString.h"
-#include <wtf/PassRefPtr.h>
+#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
-#include <wtf/text/CString.h>
namespace WebCore {
+class ArrayBuffer;
class Blob;
class TextEncoding;
@@ -49,15 +47,20 @@ class BlobBuilder : public RefCounted<BlobBuilder> {
public:
static PassRefPtr<BlobBuilder> create() { return adoptRef(new BlobBuilder()); }
- bool append(PassRefPtr<Blob>);
- bool append(const String& text, ExceptionCode&);
- bool append(const String& text, const String& ending, ExceptionCode&);
+ void append(Blob*);
+ void append(const String& text, ExceptionCode&);
+ void append(const String& text, const String& ending, ExceptionCode&);
+#if ENABLE(BLOB)
+ void append(ArrayBuffer*);
+#endif
PassRefPtr<Blob> getBlob(const String& contentType = String());
private:
BlobBuilder();
+ Vector<char>& getBuffer();
+
long long m_size;
BlobDataItemList m_items;
};
diff --git a/WebCore/fileapi/BlobBuilder.idl b/WebCore/fileapi/BlobBuilder.idl
index 0da9314..8f5049f 100644
--- a/WebCore/fileapi/BlobBuilder.idl
+++ b/WebCore/fileapi/BlobBuilder.idl
@@ -38,6 +38,9 @@ module html {
Blob getBlob(in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
#endif
void append(in Blob blob);
+#if defined(ENABLE_BLOB) && ENABLE_BLOB
+ void append(in ArrayBuffer arrayBuffer);
+#endif
void append(in DOMString value, in [Optional, ConvertUndefinedOrNullToNullString] DOMString endings) raises (DOMException);
};
diff --git a/WebCore/fileapi/DOMFileSystemBase.cpp b/WebCore/fileapi/DOMFileSystemBase.cpp
index fefe99f..c462c3c 100644
--- a/WebCore/fileapi/DOMFileSystemBase.cpp
+++ b/WebCore/fileapi/DOMFileSystemBase.cpp
@@ -35,6 +35,7 @@
#include "DOMFilePath.h"
#include "DirectoryEntry.h"
+#include "DirectoryReaderBase.h"
#include "EntriesCallback.h"
#include "EntryArray.h"
#include "EntryBase.h"
@@ -190,7 +191,7 @@ bool DOMFileSystemBase::getDirectory(const EntryBase* base, const String& path,
return true;
}
-bool DOMFileSystemBase::readDirectory(DirectoryReaderBase* reader, const String& path, PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+bool DOMFileSystemBase::readDirectory(PassRefPtr<DirectoryReaderBase> reader, const String& path, PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
ASSERT(DOMFilePath::isAbsolute(path));
String platformPath = m_asyncFileSystem->virtualToPlatformPath(path);
diff --git a/WebCore/fileapi/DOMFileSystemBase.h b/WebCore/fileapi/DOMFileSystemBase.h
index 36e35b4..66f1331 100644
--- a/WebCore/fileapi/DOMFileSystemBase.h
+++ b/WebCore/fileapi/DOMFileSystemBase.h
@@ -72,7 +72,7 @@ public:
bool getParent(const EntryBase*, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
bool getFile(const EntryBase*, const String& path, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
bool getDirectory(const EntryBase*, const String& path, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
- bool readDirectory(DirectoryReaderBase*, const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>);
+ bool readDirectory(PassRefPtr<DirectoryReaderBase>, const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>);
protected:
DOMFileSystemBase(const String& name, PassOwnPtr<AsyncFileSystem>);
diff --git a/WebCore/fileapi/DirectoryEntry.cpp b/WebCore/fileapi/DirectoryEntry.cpp
index 765fcd5..7bc0af8 100644
--- a/WebCore/fileapi/DirectoryEntry.cpp
+++ b/WebCore/fileapi/DirectoryEntry.cpp
@@ -41,7 +41,7 @@
namespace WebCore {
-DirectoryEntry::DirectoryEntry(DOMFileSystemBase* fileSystem, const String& fullPath)
+DirectoryEntry::DirectoryEntry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: Entry(fileSystem, fullPath)
{
}
@@ -55,21 +55,21 @@ void DirectoryEntry::getFile(const String& path, PassRefPtr<Flags> flags, PassRe
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->getFile(this, path, flags, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
void DirectoryEntry::getDirectory(const String& path, PassRefPtr<Flags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef)
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->getDirectory(this, path, flags, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
void DirectoryEntry::removeRecursively(PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->removeRecursively(this, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
}
diff --git a/WebCore/fileapi/DirectoryEntry.h b/WebCore/fileapi/DirectoryEntry.h
index dd0159e..da903da 100644
--- a/WebCore/fileapi/DirectoryEntry.h
+++ b/WebCore/fileapi/DirectoryEntry.h
@@ -49,7 +49,7 @@ class VoidCallback;
class DirectoryEntry : public Entry {
public:
- static PassRefPtr<DirectoryEntry> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+ static PassRefPtr<DirectoryEntry> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
{
return adoptRef(new DirectoryEntry(fileSystem, fullPath));
}
@@ -61,7 +61,7 @@ public:
void removeRecursively(PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> = 0) const;
private:
- DirectoryEntry(DOMFileSystemBase*, const String& fullPath);
+ DirectoryEntry(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
} // namespace
diff --git a/WebCore/fileapi/DirectoryEntrySync.cpp b/WebCore/fileapi/DirectoryEntrySync.cpp
index d8d22c2..e68f7be 100644
--- a/WebCore/fileapi/DirectoryEntrySync.cpp
+++ b/WebCore/fileapi/DirectoryEntrySync.cpp
@@ -36,11 +36,12 @@
#include "DirectoryReaderSync.h"
#include "EntrySync.h"
#include "FileEntrySync.h"
+#include "FileException.h"
#include "SyncCallbackHelper.h"
namespace WebCore {
-DirectoryEntrySync::DirectoryEntrySync(DOMFileSystemBase* fileSystem, const String& fullPath)
+DirectoryEntrySync::DirectoryEntrySync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: EntrySync(fileSystem, fullPath)
{
}
@@ -55,7 +56,7 @@ PassRefPtr<FileEntrySync> DirectoryEntrySync::getFile(const String& path, PassRe
ec = 0;
EntrySyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->getFile(this, path, flags, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
return static_pointer_cast<FileEntrySync>(helper.getResult(ec));
@@ -66,7 +67,7 @@ PassRefPtr<DirectoryEntrySync> DirectoryEntrySync::getDirectory(const String& pa
ec = 0;
EntrySyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->getDirectory(this, path, flags, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
return static_pointer_cast<DirectoryEntrySync>(helper.getResult(ec));
@@ -77,7 +78,7 @@ void DirectoryEntrySync::removeRecursively(ExceptionCode& ec)
ec = 0;
VoidSyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->removeRecursively(this, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return;
}
helper.getResult(ec);
diff --git a/WebCore/fileapi/DirectoryEntrySync.h b/WebCore/fileapi/DirectoryEntrySync.h
index 9a3e0df..eb412bb 100644
--- a/WebCore/fileapi/DirectoryEntrySync.h
+++ b/WebCore/fileapi/DirectoryEntrySync.h
@@ -46,7 +46,7 @@ class FileEntrySync;
class DirectoryEntrySync : public EntrySync {
public:
- static PassRefPtr<DirectoryEntrySync> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+ static PassRefPtr<DirectoryEntrySync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
{
return adoptRef(new DirectoryEntrySync(fileSystem, fullPath));
}
@@ -59,7 +59,7 @@ public:
private:
friend class EntrySync;
- DirectoryEntrySync(DOMFileSystemBase*, const String& fullPath);
+ DirectoryEntrySync(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
}
diff --git a/WebCore/fileapi/DirectoryReader.cpp b/WebCore/fileapi/DirectoryReader.cpp
index 3437675..fe2d99f 100644
--- a/WebCore/fileapi/DirectoryReader.cpp
+++ b/WebCore/fileapi/DirectoryReader.cpp
@@ -40,7 +40,7 @@
namespace WebCore {
-DirectoryReader::DirectoryReader(DOMFileSystemBase* fileSystem, const String& fullPath)
+DirectoryReader::DirectoryReader(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: DirectoryReaderBase(fileSystem, fullPath)
{
}
diff --git a/WebCore/fileapi/DirectoryReader.h b/WebCore/fileapi/DirectoryReader.h
index 806fdf1..bc89858 100644
--- a/WebCore/fileapi/DirectoryReader.h
+++ b/WebCore/fileapi/DirectoryReader.h
@@ -47,17 +47,17 @@ class ErrorCallback;
class DirectoryReader : public DirectoryReaderBase {
public:
- static PassRefPtr<DirectoryReader> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+ static PassRefPtr<DirectoryReader> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
{
return adoptRef(new DirectoryReader(fileSystem, fullPath));
}
void readEntries(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback> = 0);
- DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem); }
+ DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem.get()); }
private:
- DirectoryReader(DOMFileSystemBase*, const String& fullPath);
+ DirectoryReader(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
}
diff --git a/WebCore/fileapi/DirectoryReaderBase.h b/WebCore/fileapi/DirectoryReaderBase.h
index 5a2c048..4096fe8 100644
--- a/WebCore/fileapi/DirectoryReaderBase.h
+++ b/WebCore/fileapi/DirectoryReaderBase.h
@@ -42,18 +42,18 @@ namespace WebCore {
class DirectoryReaderBase : public RefCounted<DirectoryReaderBase> {
public:
- DOMFileSystemBase* filesystem() const { return m_fileSystem; }
+ DOMFileSystemBase* filesystem() const { return m_fileSystem.get(); }
void setHasMoreEntries(bool hasMoreEntries) { m_hasMoreEntries = hasMoreEntries; }
protected:
- DirectoryReaderBase(DOMFileSystemBase* fileSystem, const String& fullPath)
+ DirectoryReaderBase(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: m_fileSystem(fileSystem)
, m_fullPath(fullPath)
, m_hasMoreEntries(true)
{
}
- DOMFileSystemBase* m_fileSystem;
+ RefPtr<DOMFileSystemBase> m_fileSystem;
// This is a virtual path.
String m_fullPath;
diff --git a/WebCore/fileapi/DirectoryReaderSync.cpp b/WebCore/fileapi/DirectoryReaderSync.cpp
index 6c66a15..15cdaa8 100644
--- a/WebCore/fileapi/DirectoryReaderSync.cpp
+++ b/WebCore/fileapi/DirectoryReaderSync.cpp
@@ -39,12 +39,12 @@
#include "EntrySync.h"
#include "ExceptionCode.h"
#include "FileEntrySync.h"
-#include "FileError.h"
+#include "FileException.h"
#include "SyncCallbackHelper.h"
namespace WebCore {
-DirectoryReaderSync::DirectoryReaderSync(DOMFileSystemBase* fileSystem, const String& fullPath)
+DirectoryReaderSync::DirectoryReaderSync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: DirectoryReaderBase(fileSystem, fullPath)
{
}
@@ -57,7 +57,7 @@ PassRefPtr<EntryArraySync> DirectoryReaderSync::readEntries(ExceptionCode& ec)
EntriesSyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->readDirectory(this, m_fullPath, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
setHasMoreEntries(false);
return 0;
}
diff --git a/WebCore/fileapi/DirectoryReaderSync.h b/WebCore/fileapi/DirectoryReaderSync.h
index 39119b7..5e3d61b 100644
--- a/WebCore/fileapi/DirectoryReaderSync.h
+++ b/WebCore/fileapi/DirectoryReaderSync.h
@@ -43,7 +43,7 @@ namespace WebCore {
class DirectoryReaderSync : public DirectoryReaderBase {
public:
- static PassRefPtr<DirectoryReaderSync> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+ static PassRefPtr<DirectoryReaderSync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
{
return adoptRef(new DirectoryReaderSync(fileSystem, fullPath));
}
@@ -51,7 +51,7 @@ public:
PassRefPtr<EntryArraySync> readEntries(ExceptionCode&);
private:
- DirectoryReaderSync(DOMFileSystemBase*, const String& fullPath);
+ DirectoryReaderSync(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
} // namespace
diff --git a/WebCore/fileapi/Entry.cpp b/WebCore/fileapi/Entry.cpp
index 2183b33..9c3fa4e 100644
--- a/WebCore/fileapi/Entry.cpp
+++ b/WebCore/fileapi/Entry.cpp
@@ -42,7 +42,7 @@
namespace WebCore {
-Entry::Entry(DOMFileSystemBase* fileSystem, const String& fullPath)
+Entry::Entry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: EntryBase(fileSystem, fullPath)
{
}
@@ -51,35 +51,35 @@ void Entry::getMetadata(PassRefPtr<MetadataCallback> successCallback, PassRefPtr
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->getMetadata(this, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
void Entry::moveTo(PassRefPtr<DirectoryEntry> parent, const String& name, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->move(this, parent.get(), name, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
void Entry::copyTo(PassRefPtr<DirectoryEntry> parent, const String& name, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->copy(this, parent.get(), name, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
void Entry::remove(PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->remove(this, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
void Entry::getParent(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->getParent(this, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
String Entry::toURI(const String&)
diff --git a/WebCore/fileapi/Entry.h b/WebCore/fileapi/Entry.h
index 36f85eb..9367f4f 100644
--- a/WebCore/fileapi/Entry.h
+++ b/WebCore/fileapi/Entry.h
@@ -49,7 +49,7 @@ class VoidCallback;
class Entry : public EntryBase {
public:
- DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem); }
+ DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem.get()); }
void getMetadata(PassRefPtr<MetadataCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
void moveTo(PassRefPtr<DirectoryEntry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const;
@@ -60,7 +60,7 @@ public:
String toURI(const String& mimeType = String());
protected:
- Entry(DOMFileSystemBase*, const String& fullPath);
+ Entry(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
} // namespace WebCore
diff --git a/WebCore/fileapi/EntryBase.h b/WebCore/fileapi/EntryBase.h
index 2aaeba8..16f93ba 100644
--- a/WebCore/fileapi/EntryBase.h
+++ b/WebCore/fileapi/EntryBase.h
@@ -48,7 +48,7 @@ class EntryBase : public RefCounted<EntryBase> {
public:
virtual ~EntryBase() { }
- DOMFileSystemBase* filesystem() const { return m_fileSystem; }
+ DOMFileSystemBase* filesystem() const { return m_fileSystem.get(); }
virtual bool isFile() const { return false; }
virtual bool isDirectory() const { return false; }
@@ -57,7 +57,7 @@ public:
const String& name() const { return m_name; }
protected:
- EntryBase(DOMFileSystemBase* fileSystem, const String& fullPath)
+ EntryBase(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: m_fileSystem(fileSystem)
, m_fullPath(fullPath)
, m_name(DOMFilePath::getName(fullPath))
@@ -66,7 +66,7 @@ protected:
friend class EntrySync;
- DOMFileSystemBase* m_fileSystem;
+ RefPtr<DOMFileSystemBase> m_fileSystem;
// This is a virtual path.
String m_fullPath;
diff --git a/WebCore/fileapi/EntrySync.cpp b/WebCore/fileapi/EntrySync.cpp
index ad007db..299aeda 100644
--- a/WebCore/fileapi/EntrySync.cpp
+++ b/WebCore/fileapi/EntrySync.cpp
@@ -38,6 +38,7 @@
#include "DirectoryEntry.h"
#include "DirectoryEntrySync.h"
#include "FileEntrySync.h"
+#include "FileException.h"
#include "Metadata.h"
#include "SyncCallbackHelper.h"
@@ -55,7 +56,7 @@ PassRefPtr<Metadata> EntrySync::getMetadata(ExceptionCode& ec)
ec = 0;
MetadataSyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->getMetadata(this, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
return helper.getResult(ec);
@@ -66,7 +67,7 @@ PassRefPtr<EntrySync> EntrySync::moveTo(PassRefPtr<DirectoryEntrySync> parent, c
ec = 0;
EntrySyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->move(this, parent.get(), name, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
return helper.getResult(ec);
@@ -77,7 +78,7 @@ PassRefPtr<EntrySync> EntrySync::copyTo(PassRefPtr<DirectoryEntrySync> parent, c
ec = 0;
EntrySyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->copy(this, parent.get(), name, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
return helper.getResult(ec);
@@ -88,7 +89,7 @@ void EntrySync::remove(ExceptionCode& ec) const
ec = 0;
VoidSyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->remove(this, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return;
}
helper.getResult(ec);
@@ -101,7 +102,7 @@ PassRefPtr<EntrySync> EntrySync::getParent() const
return DirectoryEntrySync::create(m_fileSystem, parentPath);
}
-EntrySync::EntrySync(DOMFileSystemBase* fileSystem, const String& fullPath)
+EntrySync::EntrySync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: EntryBase(fileSystem, fullPath)
{
}
diff --git a/WebCore/fileapi/EntrySync.h b/WebCore/fileapi/EntrySync.h
index 24a0101..175d591 100644
--- a/WebCore/fileapi/EntrySync.h
+++ b/WebCore/fileapi/EntrySync.h
@@ -49,7 +49,7 @@ class EntrySync : public EntryBase {
public:
static PassRefPtr<EntrySync> create(EntryBase*);
- DOMFileSystemSync* filesystem() const { return static_cast<DOMFileSystemSync*>(m_fileSystem); }
+ DOMFileSystemSync* filesystem() const { return static_cast<DOMFileSystemSync*>(m_fileSystem.get()); }
PassRefPtr<Metadata> getMetadata(ExceptionCode&);
PassRefPtr<EntrySync> moveTo(PassRefPtr<DirectoryEntrySync> parent, const String& name, ExceptionCode&) const;
@@ -58,7 +58,7 @@ public:
PassRefPtr<EntrySync> getParent() const;
protected:
- EntrySync(DOMFileSystemBase*, const String& fullPath);
+ EntrySync(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
}
diff --git a/WebCore/fileapi/FileEntry.cpp b/WebCore/fileapi/FileEntry.cpp
index 29cbd33..a5ecff5 100644
--- a/WebCore/fileapi/FileEntry.cpp
+++ b/WebCore/fileapi/FileEntry.cpp
@@ -41,7 +41,7 @@
namespace WebCore {
-FileEntry::FileEntry(DOMFileSystemBase* fileSystem, const String& fullPath)
+FileEntry::FileEntry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: Entry(fileSystem, fullPath)
{
}
diff --git a/WebCore/fileapi/FileEntry.h b/WebCore/fileapi/FileEntry.h
index 216cca2..2fa4394 100644
--- a/WebCore/fileapi/FileEntry.h
+++ b/WebCore/fileapi/FileEntry.h
@@ -43,7 +43,7 @@ class DOMFileSystemBase;
class FileEntry : public Entry {
public:
- static PassRefPtr<FileEntry> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+ static PassRefPtr<FileEntry> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
{
return adoptRef(new FileEntry(fileSystem, fullPath));
}
@@ -54,7 +54,7 @@ public:
virtual bool isFile() const { return true; }
private:
- FileEntry(DOMFileSystemBase* fileSystem, const String& fullPath);
+ FileEntry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath);
};
} // namespace
diff --git a/WebCore/fileapi/FileEntrySync.cpp b/WebCore/fileapi/FileEntrySync.cpp
index 8fc5a77..36ec735 100644
--- a/WebCore/fileapi/FileEntrySync.cpp
+++ b/WebCore/fileapi/FileEntrySync.cpp
@@ -37,7 +37,7 @@
namespace WebCore {
-FileEntrySync::FileEntrySync(DOMFileSystemBase* fileSystem, const String& fullPath)
+FileEntrySync::FileEntrySync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: EntrySync(fileSystem, fullPath)
{
}
diff --git a/WebCore/fileapi/FileEntrySync.h b/WebCore/fileapi/FileEntrySync.h
index d027f63..be12e21 100644
--- a/WebCore/fileapi/FileEntrySync.h
+++ b/WebCore/fileapi/FileEntrySync.h
@@ -44,7 +44,7 @@ class File;
class FileEntrySync : public EntrySync {
public:
- static PassRefPtr<FileEntrySync> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+ static PassRefPtr<FileEntrySync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
{
return adoptRef(new FileEntrySync(fileSystem, fullPath));
}
@@ -55,7 +55,7 @@ public:
private:
friend class EntrySync;
- FileEntrySync(DOMFileSystemBase*, const String& fullPath);
+ FileEntrySync(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
}
diff --git a/WebCore/fileapi/FileError.h b/WebCore/fileapi/FileError.h
index 3528109..27ad397 100644
--- a/WebCore/fileapi/FileError.h
+++ b/WebCore/fileapi/FileError.h
@@ -33,7 +33,6 @@
#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
-#include "ExceptionCode.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -41,16 +40,31 @@ namespace WebCore {
class FileError : public RefCounted<FileError> {
public:
- static PassRefPtr<FileError> create(ExceptionCode code) { return adoptRef(new FileError(code)); }
+ enum ErrorCode {
+ NOT_FOUND_ERR = 1,
+ SECURITY_ERR = 2,
+ ABORT_ERR = 3,
+ NOT_READABLE_ERR = 4,
+ ENCODING_ERR = 5,
+ NO_MODIFICATION_ALLOWED_ERR = 6,
+ INVALID_STATE_ERR = 7,
+ SYNTAX_ERR = 8,
+ INVALID_MODIFICATION_ERR = 9,
+ QUOTA_EXCEEDED_ERR = 10,
+ TYPE_MISMATCH_ERR = 11,
+ PATH_EXISTS_ERR = 12,
+ };
- ExceptionCode code() const { return m_code; }
+ static PassRefPtr<FileError> create(ErrorCode code) { return adoptRef(new FileError(code)); }
+
+ ErrorCode code() const { return m_code; }
private:
- FileError(ExceptionCode code)
+ FileError(ErrorCode code)
: m_code(code)
{ }
- ExceptionCode m_code;
+ ErrorCode m_code;
};
} // namespace WebCore
diff --git a/WebCore/fileapi/FileError.idl b/WebCore/fileapi/FileError.idl
index c5dedbe..bab815a 100644
--- a/WebCore/fileapi/FileError.idl
+++ b/WebCore/fileapi/FileError.idl
@@ -31,21 +31,23 @@
module html {
interface [
Conditional=BLOB|FILE_SYSTEM,
- DontCheckEnums,
NoStaticTables
] FileError {
#if !defined(LANGUAGE_OBJECTIVE_C)
- const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
- const unsigned short NOT_FOUND_ERR = 8;
- const unsigned short INVALID_STATE_ERR = 11;
- const unsigned short SYNTAX_ERR = 12;
- const unsigned short INVALID_MODIFICATION_ERR = 13;
+ // FIXME: Some of constant names are already defined in DOMException.h for Objective-C binding and we cannot have the same names here (they are translated into a enum in the same namespace).
+ const unsigned short NOT_FOUND_ERR = 1;
+ const unsigned short SECURITY_ERR = 2;
+ const unsigned short ABORT_ERR = 3;
+ const unsigned short NOT_READABLE_ERR = 4;
+ const unsigned short ENCODING_ERR = 5;
+ const unsigned short NO_MODIFICATION_ALLOWED_ERR = 6;
+ const unsigned short INVALID_STATE_ERR = 7;
+ const unsigned short SYNTAX_ERR = 8;
+ const unsigned short INVALID_MODIFICATION_ERR = 9;
+ const unsigned short QUOTA_EXCEEDED_ERR = 10;
+ const unsigned short TYPE_MISMATCH_ERR = 11;
+ const unsigned short PATH_EXISTS_ERR = 12;
#endif
- const unsigned short SECURITY_ERR = 18;
- const unsigned short ABORT_ERR = 20;
- const unsigned short QUOTA_EXCEEDED_ERR = 22;
- const unsigned short NOT_READABLE_ERR = 24;
- const unsigned short ENCODING_ERR = 26;
readonly attribute unsigned short code;
};
}
diff --git a/WebCore/fileapi/FileException.h b/WebCore/fileapi/FileException.h
index e90ab90..c3cc638 100644
--- a/WebCore/fileapi/FileException.h
+++ b/WebCore/fileapi/FileException.h
@@ -44,13 +44,31 @@ public:
return adoptRef(new FileException(description));
}
- static const int FileExceptionOffset = 100;
- static const int FileExceptionMax = 199;
+ static const int FileExceptionOffset = 1100;
+ static const int FileExceptionMax = 1199;
- enum EventExceptionCode {
- UNSPECIFIED_EVENT_TYPE_ERR = FileExceptionOffset
+ enum FileExceptionCode {
+ NOT_FOUND_ERR = FileExceptionOffset + 1,
+ SECURITY_ERR = FileExceptionOffset + 2,
+ ABORT_ERR = FileExceptionOffset + 3,
+ NOT_READABLE_ERR = FileExceptionOffset + 4,
+ ENCODING_ERR = FileExceptionOffset + 5,
+ NO_MODIFICATION_ALLOWED_ERR = FileExceptionOffset + 6,
+ INVALID_STATE_ERR = FileExceptionOffset + 7,
+ SYNTAX_ERR = FileExceptionOffset + 8,
+ INVALID_MODIFICATION_ERR = FileExceptionOffset + 9,
+ QUOTA_EXCEEDED_ERR = FileExceptionOffset + 10,
+ TYPE_MISMATCH_ERR = FileExceptionOffset + 11,
+ PATH_EXISTS_ERR = FileExceptionOffset + 12,
};
+ static int ErrorCodeToExceptionCode(int errorCode)
+ {
+ if (!errorCode)
+ return 0;
+ return errorCode + FileExceptionOffset;
+ }
+
private:
FileException(const ExceptionCodeDescription& description)
: ExceptionBase(description)
@@ -63,4 +81,3 @@ private:
#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // FileException_h
-
diff --git a/WebCore/fileapi/FileException.idl b/WebCore/fileapi/FileException.idl
index 0b2ab9c..10bd151 100644
--- a/WebCore/fileapi/FileException.idl
+++ b/WebCore/fileapi/FileException.idl
@@ -45,15 +45,17 @@ module html {
#endif
// FileExceptionCode
- const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
- const unsigned short NOT_FOUND_ERR = 8;
- const unsigned short INVALID_STATE_ERR = 11;
- const unsigned short SYNTAX_ERR = 12;
- const unsigned short INVALID_MODIFICATION_ERR = 13;
- const unsigned short SECURITY_ERR = 18;
- const unsigned short ABORT_ERR = 20;
- const unsigned short QUOTA_EXCEEDED_ERR = 22;
- const unsigned short NOT_READABLE_ERR = 24;
- const unsigned short ENCODING_ERR = 26;
+ const unsigned short NOT_FOUND_ERR = 1;
+ const unsigned short SECURITY_ERR = 2;
+ const unsigned short ABORT_ERR = 3;
+ const unsigned short NOT_READABLE_ERR = 4;
+ const unsigned short ENCODING_ERR = 5;
+ const unsigned short NO_MODIFICATION_ALLOWED_ERR = 6;
+ const unsigned short INVALID_STATE_ERR = 7;
+ const unsigned short SYNTAX_ERR = 8;
+ const unsigned short INVALID_MODIFICATION_ERR = 9;
+ const unsigned short QUOTA_EXCEEDED_ERR = 10;
+ const unsigned short TYPE_MISMATCH_ERR = 11;
+ const unsigned short PATH_EXISTS_ERR = 12;
};
}
diff --git a/WebCore/fileapi/FileReader.cpp b/WebCore/fileapi/FileReader.cpp
index 0b7b46d..a54a337 100644
--- a/WebCore/fileapi/FileReader.cpp
+++ b/WebCore/fileapi/FileReader.cpp
@@ -34,21 +34,17 @@
#include "FileReader.h"
-#include "Base64.h"
+#include "ArrayBuffer.h"
#include "Blob.h"
-#include "BlobURL.h"
#include "CrossThreadTask.h"
#include "File.h"
#include "Logging.h"
#include "ProgressEvent.h"
-#include "ResourceError.h"
-#include "ResourceRequest.h"
-#include "ResourceResponse.h"
#include "ScriptExecutionContext.h"
-#include "TextResourceDecoder.h"
-#include "ThreadableBlobRegistry.h"
-#include "ThreadableLoader.h"
#include <wtf/CurrentTime.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
namespace WebCore {
@@ -57,10 +53,7 @@ const double progressNotificationIntervalMS = 50;
FileReader::FileReader(ScriptExecutionContext* context)
: ActiveDOMObject(context, this)
, m_state(None)
- , m_readType(ReadFileAsBinaryString)
- , m_isRawDataConverted(false)
- , m_bytesLoaded(0)
- , m_totalBytes(0)
+ , m_readType(FileReaderLoader::ReadAsBinaryString)
, m_lastProgressNotificationTimeMS(0)
{
}
@@ -86,6 +79,16 @@ void FileReader::stop()
terminate();
}
+void FileReader::readAsArrayBuffer(Blob* blob)
+{
+ if (!blob)
+ return;
+
+ LOG(FileAPI, "FileReader: reading as array buffer: %s %s\n", blob->url().string().utf8().data(), blob->isFile() ? static_cast<File*>(blob)->path().utf8().data() : "");
+
+ readInternal(blob, FileReaderLoader::ReadAsArrayBuffer);
+}
+
void FileReader::readAsBinaryString(Blob* blob)
{
if (!blob)
@@ -93,7 +96,7 @@ void FileReader::readAsBinaryString(Blob* blob)
LOG(FileAPI, "FileReader: reading as binary: %s %s\n", blob->url().string().utf8().data(), blob->isFile() ? static_cast<File*>(blob)->path().utf8().data() : "");
- readInternal(blob, ReadFileAsBinaryString);
+ readInternal(blob, FileReaderLoader::ReadAsBinaryString);
}
void FileReader::readAsText(Blob* blob, const String& encoding)
@@ -103,9 +106,8 @@ void FileReader::readAsText(Blob* blob, const String& encoding)
LOG(FileAPI, "FileReader: reading as text: %s %s\n", blob->url().string().utf8().data(), blob->isFile() ? static_cast<File*>(blob)->path().utf8().data() : "");
- if (!encoding.isEmpty())
- m_encoding = TextEncoding(encoding);
- readInternal(blob, ReadFileAsText);
+ m_encoding = encoding;
+ readInternal(blob, FileReaderLoader::ReadAsText);
}
void FileReader::readAsDataURL(Blob* blob)
@@ -115,8 +117,7 @@ void FileReader::readAsDataURL(Blob* blob)
LOG(FileAPI, "FileReader: reading as data URL: %s %s\n", blob->url().string().utf8().data(), blob->isFile() ? static_cast<File*>(blob)->path().utf8().data() : "");
- m_fileType = blob->type();
- readInternal(blob, ReadFileAsDataURL);
+ readInternal(blob, FileReaderLoader::ReadAsDataURL);
}
static void delayedStart(ScriptExecutionContext*, FileReader* reader)
@@ -124,7 +125,7 @@ static void delayedStart(ScriptExecutionContext*, FileReader* reader)
reader->start();
}
-void FileReader::readInternal(Blob* blob, ReadType type)
+void FileReader::readInternal(Blob* blob, FileReaderLoader::ReadType type)
{
// readAs*** methods() can be called multiple times. Only the last call before the actual reading happens is processed.
if (m_state != None && m_state != Starting)
@@ -138,14 +139,28 @@ void FileReader::readInternal(Blob* blob, ReadType type)
m_state = Starting;
}
+static void delayedAbort(ScriptExecutionContext*, FileReader* reader)
+{
+ reader->doAbort();
+}
+
void FileReader::abort()
{
LOG(FileAPI, "FileReader: aborting\n");
+ if (m_state == Aborting)
+ return;
+ m_state = Aborting;
+
+ // Schedule to have the abort done later since abort() might be called from the event handler and we do not want the resource loading code to be in the stack.
+ scriptExecutionContext()->postTask(createCallbackTask(&delayedAbort, this));
+}
+
+void FileReader::doAbort()
+{
terminate();
- m_builder.clear();
- m_error = FileError::create(ABORT_ERR);
+ m_error = FileError::create(FileError::ABORT_ERR);
fireEvent(eventNames().errorEvent);
fireEvent(eventNames().abortEvent);
@@ -156,75 +171,29 @@ void FileReader::terminate()
{
if (m_loader) {
m_loader->cancel();
- cleanup();
+ m_loader = 0;
}
m_state = Completed;
}
-void FileReader::cleanup()
-{
- m_loader = 0;
- ThreadableBlobRegistry::unregisterBlobURL(m_urlForReading);
- m_urlForReading = KURL();
-}
-
void FileReader::start()
{
m_state = Opening;
- // The blob is read by routing through the request handling layer given a temporary public url.
- m_urlForReading = BlobURL::createPublicURL(scriptExecutionContext()->securityOrigin());
- ThreadableBlobRegistry::registerBlobURL(m_urlForReading, m_blob->url());
-
- ResourceRequest request(m_urlForReading);
- request.setHTTPMethod("GET");
-
- ThreadableLoaderOptions options;
- options.sendLoadCallbacks = true;
- options.sniffContent = false;
- options.forcePreflight = false;
- options.allowCredentials = true;
- options.crossOriginRequestPolicy = DenyCrossOriginRequests;
-
- m_loader = ThreadableLoader::create(scriptExecutionContext(), this, request, options);
+ m_loader = adoptPtr(new FileReaderLoader(m_readType, this));
+ m_loader->setEncoding(m_encoding);
+ m_loader->setDataType(m_blob->type());
+ m_loader->start(scriptExecutionContext(), m_blob.get());
}
-void FileReader::didReceiveResponse(const ResourceResponse& response)
+void FileReader::didStartLoading()
{
- if (response.httpStatusCode() != 200) {
- failed(response.httpStatusCode());
- return;
- }
-
m_state = Reading;
fireEvent(eventNames().loadstartEvent);
-
- m_totalBytes = response.expectedContentLength();
}
-void FileReader::didReceiveData(const char* data, int lengthReceived)
+void FileReader::didReceiveData()
{
- ASSERT(data && lengthReceived);
-
- // Bail out if we have aborted the reading.
- if (m_state == Completed)
- return;
-
- switch (m_readType) {
- case ReadFileAsBinaryString:
- m_builder.append(data, static_cast<unsigned>(lengthReceived));
- break;
- case ReadFileAsText:
- case ReadFileAsDataURL:
- m_rawData.append(data, static_cast<unsigned>(lengthReceived));
- m_isRawDataConverted = false;
- break;
- default:
- ASSERT_NOT_REACHED();
- }
-
- m_bytesLoaded += lengthReceived;
-
// Fire the progress event at least every 50ms.
double now = WTF::currentTimeMS();
if (!m_lastProgressNotificationTimeMS)
@@ -235,49 +204,33 @@ void FileReader::didReceiveData(const char* data, int lengthReceived)
}
}
-void FileReader::didFinishLoading(unsigned long)
+void FileReader::didFinishLoading()
{
m_state = Completed;
fireEvent(eventNames().loadEvent);
fireEvent(eventNames().loadendEvent);
-
- cleanup();
}
-void FileReader::didFail(const ResourceError&)
+void FileReader::didFail(int errorCode)
{
- // Treat as internal error.
- failed(500);
-}
+ // If we're aborting, do not proceed with normal error handling since it is covered in aborting code.
+ if (m_state == Aborting)
+ return;
-void FileReader::failed(int httpStatusCode)
-{
m_state = Completed;
- m_error = FileError::create(httpStatusCodeToExceptionCode(httpStatusCode));
+ m_error = FileError::create(static_cast<FileError::ErrorCode>(errorCode));
fireEvent(eventNames().errorEvent);
fireEvent(eventNames().loadendEvent);
-
- cleanup();
-}
-
-ExceptionCode FileReader::httpStatusCodeToExceptionCode(int httpStatusCode)
-{
- switch (httpStatusCode) {
- case 403:
- return SECURITY_ERR;
- case 404:
- return NOT_FOUND_ERR;
- default:
- return NOT_READABLE_ERR;
- }
}
void FileReader::fireEvent(const AtomicString& type)
{
// FIXME: the current ProgressEvent uses "unsigned long" for total and loaded attributes. Need to talk with the spec writer to resolve the issue.
- dispatchEvent(ProgressEvent::create(type, true, static_cast<unsigned>(m_bytesLoaded), static_cast<unsigned>(m_totalBytes)));
+ unsigned bytesLoaded = m_loader ? m_loader->bytesLoaded() : 0;
+ unsigned totalBytes = m_loader ? m_loader->totalBytes() : 0;
+ dispatchEvent(ProgressEvent::create(type, true, bytesLoaded, totalBytes));
}
FileReader::ReadyState FileReader::readyState() const
@@ -288,6 +241,7 @@ FileReader::ReadyState FileReader::readyState() const
return EMPTY;
case Opening:
case Reading:
+ case Aborting:
return LOADING;
case Completed:
return DONE;
@@ -296,65 +250,14 @@ FileReader::ReadyState FileReader::readyState() const
return EMPTY;
}
-String FileReader::result()
-{
- // If reading as binary string, we can return the result immediately.
- if (m_readType == ReadFileAsBinaryString)
- return m_builder.toString();
-
- // If we already convert the raw data received so far, we can return the result now.
- if (m_isRawDataConverted)
- return m_builder.toString();
- m_isRawDataConverted = true;
-
- if (m_readType == ReadFileAsText)
- convertToText();
- // For data URL, we only do the coversion until we receive all the raw data.
- else if (m_readType == ReadFileAsDataURL && m_state == Completed)
- convertToDataURL(m_rawData, m_fileType, m_builder);
-
- return m_builder.toString();
-}
-
-void FileReader::convertToText()
+PassRefPtr<ArrayBuffer> FileReader::arrayBufferResult() const
{
- if (!m_rawData.size()) {
- m_builder.clear();
- return;
- }
-
- // Decode the data.
- // The File API spec says that we should use the supplied encoding if it is valid. However, we choose to ignore this
- // requirement in order to be consistent with how WebKit decodes the web content: always has the BOM override the
- // provided encoding.
- // FIXME: consider supporting incremental decoding to improve the perf.
- if (!m_decoder)
- m_decoder = TextResourceDecoder::create("text/plain", m_encoding.isValid() ? m_encoding : UTF8Encoding());
- m_builder.clear();
- m_builder.append(m_decoder->decode(&m_rawData.at(0), m_rawData.size()));
-
- if (m_state == Completed && !m_error)
- m_builder.append(m_decoder->flush());
+ return m_loader ? m_loader->arrayBufferResult() : 0;
}
-void FileReader::convertToDataURL(const Vector<char>& rawData, const String& fileType, StringBuilder& builder)
+String FileReader::stringResult()
{
- builder.clear();
- builder.append("data:");
-
- if (!rawData.size())
- return;
-
- if (!fileType.isEmpty()) {
- builder.append(fileType);
- builder.append(";base64,");
- } else
- builder.append("base64,");
-
- Vector<char> out;
- base64Encode(rawData, out);
- out.append('\0');
- builder.append(out.data());
+ return m_loader ? m_loader->stringResult() : "";
}
} // namespace WebCore
diff --git a/WebCore/fileapi/FileReader.h b/WebCore/fileapi/FileReader.h
index f914dad..04513f3 100644
--- a/WebCore/fileapi/FileReader.h
+++ b/WebCore/fileapi/FileReader.h
@@ -36,24 +36,19 @@
#include "ActiveDOMObject.h"
#include "EventTarget.h"
#include "FileError.h"
-#include "KURL.h"
-#include "TextEncoding.h"
-#include "ThreadableLoaderClient.h"
-#include <wtf/PassRefPtr.h>
+#include "FileReaderLoader.h"
+#include "FileReaderLoaderClient.h"
+#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
-#include <wtf/text/StringBuilder.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
+class ArrayBuffer;
class Blob;
class ScriptExecutionContext;
-class TextResourceDecoder;
-class ThreadableLoader;
-class FileReader : public RefCounted<FileReader>, public ActiveDOMObject, public EventTarget, public ThreadableLoaderClient {
+class FileReader : public RefCounted<FileReader>, public ActiveDOMObject, public EventTarget, public FileReaderLoaderClient {
public:
static PassRefPtr<FileReader> create(ScriptExecutionContext* context)
{
@@ -68,20 +63,20 @@ public:
DONE = 2
};
+ void readAsArrayBuffer(Blob*);
void readAsBinaryString(Blob*);
void readAsText(Blob*, const String& encoding = "");
void readAsDataURL(Blob*);
void abort();
void start();
+ void doAbort();
ReadyState readyState() const;
PassRefPtr<FileError> error() { return m_error; }
- String result();
-
- // Helper methods, also used by FileReaderSync.
- static ExceptionCode httpStatusCodeToExceptionCode(int httpStatusCode);
- static void convertToDataURL(const Vector<char>& rawData, const String& fileType, StringBuilder&);
+ FileReaderLoader::ReadType readType() const { return m_readType; }
+ PassRefPtr<ArrayBuffer> arrayBufferResult() const;
+ String stringResult();
// ActiveDOMObject
virtual bool canSuspend() const;
@@ -92,11 +87,11 @@ public:
virtual FileReader* toFileReader() { return this; }
virtual ScriptExecutionContext* scriptExecutionContext() const { return ActiveDOMObject::scriptExecutionContext(); }
- // ThreadableLoaderClient
- virtual void didReceiveResponse(const ResourceResponse&);
- virtual void didReceiveData(const char*, int);
- virtual void didFinishLoading(unsigned long identifier);
- virtual void didFail(const ResourceError&);
+ // FileReaderLoaderClient
+ virtual void didStartLoading();
+ virtual void didReceiveData();
+ virtual void didFinishLoading();
+ virtual void didFail(int errorCode);
using RefCounted<FileReader>::ref;
using RefCounted<FileReader>::deref;
@@ -109,16 +104,12 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(loadend);
private:
- enum ReadType {
- ReadFileAsBinaryString,
- ReadFileAsText,
- ReadFileAsDataURL
- };
enum InternalState {
None,
Starting,
Opening,
Reading,
+ Aborting,
Completed
};
@@ -131,38 +122,19 @@ private:
virtual EventTargetData* ensureEventTargetData() { return &m_eventTargetData; }
void terminate();
- void cleanup();
- void readInternal(Blob*, ReadType);
- void failed(int httpStatusCode);
+ void readInternal(Blob*, FileReaderLoader::ReadType);
void fireErrorEvent(int httpStatusCode);
void fireEvent(const AtomicString& type);
- void convertToText();
- void convertToDataURL();
InternalState m_state;
EventTargetData m_eventTargetData;
RefPtr<Blob> m_blob;
- KURL m_urlForReading;
- ReadType m_readType;
- TextEncoding m_encoding;
-
- StringBuilder m_builder;
-
- // The raw data. We have to keep track of all the raw data for it to be converted to text or data URL data.
- Vector<char> m_rawData;
- bool m_isRawDataConverted;
-
- // The decoder used to decode the text data.
- RefPtr<TextResourceDecoder> m_decoder;
-
- // Needed to create data URL.
- String m_fileType;
+ FileReaderLoader::ReadType m_readType;
+ String m_encoding;
- RefPtr<ThreadableLoader> m_loader;
+ OwnPtr<FileReaderLoader> m_loader;
RefPtr<FileError> m_error;
- long long m_bytesLoaded;
- long long m_totalBytes;
double m_lastProgressNotificationTimeMS;
};
diff --git a/WebCore/fileapi/FileReader.idl b/WebCore/fileapi/FileReader.idl
index febb231..ebc6ffd 100644
--- a/WebCore/fileapi/FileReader.idl
+++ b/WebCore/fileapi/FileReader.idl
@@ -44,6 +44,7 @@ module html {
readonly attribute unsigned short readyState;
// async read methods
+ void readAsArrayBuffer(in Blob blob);
void readAsBinaryString(in Blob blob);
void readAsText(in Blob blob, in [Optional] DOMString encoding);
void readAsDataURL(in Blob blob);
@@ -51,7 +52,7 @@ module html {
void abort();
// file data
- readonly attribute [ConvertScriptString] DOMString result;
+ readonly attribute [Custom] DOMObject result;
readonly attribute FileError error;
diff --git a/WebCore/fileapi/FileReaderLoader.cpp b/WebCore/fileapi/FileReaderLoader.cpp
new file mode 100644
index 0000000..dcd5860
--- /dev/null
+++ b/WebCore/fileapi/FileReaderLoader.cpp
@@ -0,0 +1,302 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(BLOB)
+
+#include "FileReaderLoader.h"
+
+#include "ArrayBuffer.h"
+#include "Base64.h"
+#include "Blob.h"
+#include "BlobURL.h"
+#include "FileReaderLoaderClient.h"
+#include "ResourceRequest.h"
+#include "ResourceResponse.h"
+#include "ScriptExecutionContext.h"
+#include "TextResourceDecoder.h"
+#include "ThreadableBlobRegistry.h"
+#include "ThreadableLoader.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+#include <wtf/text/StringBuilder.h>
+
+namespace WebCore {
+
+FileReaderLoader::FileReaderLoader(ReadType readType, FileReaderLoaderClient* client)
+ : m_readType(readType)
+ , m_client(client)
+ , m_isRawDataConverted(false)
+ , m_stringResult("")
+ , m_bytesLoaded(0)
+ , m_totalBytes(0)
+ , m_errorCode(0)
+{
+}
+
+FileReaderLoader::~FileReaderLoader()
+{
+ terminate();
+ ThreadableBlobRegistry::unregisterBlobURL(m_urlForReading);
+}
+
+void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, Blob* blob)
+{
+ // The blob is read by routing through the request handling layer given a temporary public url.
+ m_urlForReading = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin());
+ ThreadableBlobRegistry::registerBlobURL(m_urlForReading, blob->url());
+
+ // Construct and load the request.
+ ResourceRequest request(m_urlForReading);
+ request.setHTTPMethod("GET");
+
+ ThreadableLoaderOptions options;
+ options.sendLoadCallbacks = true;
+ options.sniffContent = false;
+ options.forcePreflight = false;
+ options.allowCredentials = true;
+ options.crossOriginRequestPolicy = DenyCrossOriginRequests;
+
+ if (m_client)
+ m_loader = ThreadableLoader::create(scriptExecutionContext, this, request, options);
+ else
+ ThreadableLoader::loadResourceSynchronously(scriptExecutionContext, request, *this, options);
+}
+
+void FileReaderLoader::cancel()
+{
+ m_errorCode = FileError::ABORT_ERR;
+ terminate();
+}
+
+void FileReaderLoader::terminate()
+{
+ if (m_loader) {
+ m_loader->cancel();
+ cleanup();
+ }
+}
+
+void FileReaderLoader::cleanup()
+{
+ m_loader = 0;
+
+ // If we get any error, we do not need to keep a buffer around.
+ if (m_errorCode) {
+ m_rawData = 0;
+ m_stringResult = "";
+ }
+}
+
+void FileReaderLoader::didReceiveResponse(const ResourceResponse& response)
+{
+ if (response.httpStatusCode() != 200) {
+ failed(httpStatusCodeToErrorCode(response.httpStatusCode()));
+ return;
+ }
+
+ // FIXME: Support reading more than the current size limit of ArrayBuffer.
+ if (static_cast<unsigned long long>(response.expectedContentLength()) > std::numeric_limits<unsigned>::max()) {
+ failed(FileError::NOT_READABLE_ERR);
+ return;
+ }
+ m_totalBytes = static_cast<unsigned>(response.expectedContentLength());
+
+ ASSERT(!m_rawData);
+ m_rawData = ArrayBuffer::create(static_cast<unsigned>(m_totalBytes), 1);
+
+ if (m_client)
+ m_client->didStartLoading();
+}
+
+void FileReaderLoader::didReceiveData(const char* data, int lengthReceived)
+{
+ ASSERT(data && lengthReceived > 0);
+
+ // Bail out if we encounter an error.
+ if (m_errorCode)
+ return;
+
+ memcpy(static_cast<char*>(m_rawData->data()) + static_cast<unsigned>(m_bytesLoaded), data, static_cast<unsigned>(lengthReceived));
+ m_bytesLoaded += static_cast<unsigned>(lengthReceived);
+
+ m_isRawDataConverted = false;
+
+ if (m_client)
+ m_client->didReceiveData();
+}
+
+void FileReaderLoader::didFinishLoading(unsigned long)
+{
+ cleanup();
+ if (m_client)
+ m_client->didFinishLoading();
+}
+
+void FileReaderLoader::didFail(const ResourceError&)
+{
+ // If we're aborting, do not proceed with normal error handling since it is covered in aborting code.
+ if (m_errorCode == FileError::ABORT_ERR)
+ return;
+
+ failed(FileError::NOT_READABLE_ERR);
+}
+
+void FileReaderLoader::failed(int errorCode)
+{
+ m_errorCode = errorCode;
+ cleanup();
+ if (m_client)
+ m_client->didFail(m_errorCode);
+}
+
+FileError::ErrorCode FileReaderLoader::httpStatusCodeToErrorCode(int httpStatusCode)
+{
+ switch (httpStatusCode) {
+ case 403:
+ return FileError::SECURITY_ERR;
+ case 404:
+ return FileError::NOT_FOUND_ERR;
+ default:
+ return FileError::NOT_READABLE_ERR;
+ }
+}
+
+PassRefPtr<ArrayBuffer> FileReaderLoader::arrayBufferResult() const
+{
+ ASSERT(m_readType == ReadAsArrayBuffer);
+
+ // If the loading is not started or an error occurs, return an empty result.
+ if (!m_rawData || m_errorCode)
+ return 0;
+
+ // If completed, we can simply return our buffer.
+ if (isCompleted())
+ return m_rawData;
+
+ // Otherwise, return a copy.
+ return ArrayBuffer::create(m_rawData.get());
+}
+
+String FileReaderLoader::stringResult()
+{
+ ASSERT(m_readType != ReadAsArrayBuffer);
+
+ // If the loading is not started or an error occurs, return an empty result.
+ if (!m_rawData || m_errorCode)
+ return m_stringResult;
+
+ // If already converted from the raw data, return the result now.
+ if (m_isRawDataConverted)
+ return m_stringResult;
+
+ switch (m_readType) {
+ case ReadAsArrayBuffer:
+ // No conversion is needed.
+ break;
+ case ReadAsBinaryString:
+ m_stringResult = String(static_cast<const char*>(m_rawData->data()), m_bytesLoaded);
+ break;
+ case ReadAsText:
+ convertToText();
+ break;
+ case ReadAsDataURL:
+ // Partial data is not supported when reading as data URL.
+ if (isCompleted())
+ convertToDataURL();
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ return m_stringResult;
+}
+
+void FileReaderLoader::convertToText()
+{
+ if (!m_bytesLoaded)
+ return;
+
+ // Decode the data.
+ // The File API spec says that we should use the supplied encoding if it is valid. However, we choose to ignore this
+ // requirement in order to be consistent with how WebKit decodes the web content: always has the BOM override the
+ // provided encoding.
+ // FIXME: consider supporting incremental decoding to improve the perf.
+ StringBuilder builder;
+ if (!m_decoder)
+ m_decoder = TextResourceDecoder::create("text/plain", m_encoding.isValid() ? m_encoding : UTF8Encoding());
+ builder.append(m_decoder->decode(static_cast<const char*>(m_rawData->data()), m_bytesLoaded));
+
+ if (isCompleted())
+ builder.append(m_decoder->flush());
+
+ m_stringResult = builder.toString();
+}
+
+void FileReaderLoader::convertToDataURL()
+{
+ StringBuilder builder;
+ builder.append("data:");
+
+ if (!m_bytesLoaded) {
+ m_stringResult = builder.toString();
+ return;
+ }
+
+ if (!m_dataType.isEmpty()) {
+ builder.append(m_dataType);
+ builder.append(";base64,");
+ } else
+ builder.append("base64,");
+
+ Vector<char> out;
+ base64Encode(static_cast<const char*>(m_rawData->data()), m_bytesLoaded, out);
+ out.append('\0');
+ builder.append(out.data());
+
+ m_stringResult = builder.toString();
+}
+
+bool FileReaderLoader::isCompleted() const
+{
+ return m_bytesLoaded == m_totalBytes;
+}
+
+void FileReaderLoader::setEncoding(const String& encoding)
+{
+ if (!encoding.isEmpty())
+ m_encoding = TextEncoding(encoding);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(BLOB)
diff --git a/WebCore/fileapi/FileReaderLoader.h b/WebCore/fileapi/FileReaderLoader.h
new file mode 100644
index 0000000..a15ee01
--- /dev/null
+++ b/WebCore/fileapi/FileReaderLoader.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FileReaderLoader_h
+#define FileReaderLoader_h
+
+#if ENABLE(BLOB)
+
+#include "FileError.h"
+#include "KURL.h"
+#include "TextEncoding.h"
+#include "ThreadableLoaderClient.h"
+#include <wtf/Forward.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class ArrayBuffer;
+class Blob;
+class FileReaderLoaderClient;
+class ScriptExecutionContext;
+class TextResourceDecoder;
+class ThreadableLoader;
+
+class FileReaderLoader : public ThreadableLoaderClient {
+public:
+ enum ReadType {
+ ReadAsArrayBuffer,
+ ReadAsBinaryString,
+ ReadAsText,
+ ReadAsDataURL
+ };
+
+ // If client is given, do the loading asynchronously. Otherwise, load synchronously.
+ FileReaderLoader(ReadType, FileReaderLoaderClient*);
+ ~FileReaderLoader();
+
+ void start(ScriptExecutionContext*, Blob*);
+ void cancel();
+
+ // ThreadableLoaderClient
+ virtual void didReceiveResponse(const ResourceResponse&);
+ virtual void didReceiveData(const char*, int);
+ virtual void didFinishLoading(unsigned long identifier);
+ virtual void didFail(const ResourceError&);
+
+ String stringResult();
+ PassRefPtr<ArrayBuffer> arrayBufferResult() const;
+ unsigned bytesLoaded() const { return m_bytesLoaded; }
+ unsigned totalBytes() const { return m_totalBytes; }
+ int errorCode() const { return m_errorCode; }
+
+ void setEncoding(const String&);
+ void setDataType(const String& dataType) { m_dataType = dataType; }
+
+private:
+ void terminate();
+ void cleanup();
+ void failed(int errorCode);
+ void convertToText();
+ void convertToDataURL();
+
+ bool isCompleted() const;
+
+ static FileError::ErrorCode httpStatusCodeToErrorCode(int);
+
+ ReadType m_readType;
+ FileReaderLoaderClient* m_client;
+ TextEncoding m_encoding;
+ String m_dataType;
+
+ KURL m_urlForReading;
+ RefPtr<ThreadableLoader> m_loader;
+
+ RefPtr<ArrayBuffer> m_rawData;
+ bool m_isRawDataConverted;
+
+ String m_stringResult;
+
+ // The decoder used to decode the text data.
+ RefPtr<TextResourceDecoder> m_decoder;
+
+ unsigned m_bytesLoaded;
+ unsigned m_totalBytes;
+ int m_errorCode;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(BLOB)
+
+#endif // FileReaderLoader_h
diff --git a/WebCore/fileapi/FileReaderLoaderClient.h b/WebCore/fileapi/FileReaderLoaderClient.h
new file mode 100644
index 0000000..4acb8ad
--- /dev/null
+++ b/WebCore/fileapi/FileReaderLoaderClient.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FileReaderLoaderClient_h
+#define FileReaderLoaderClient_h
+
+#if ENABLE(BLOB)
+
+namespace WebCore {
+
+class FileReaderLoaderClient {
+public:
+ virtual ~FileReaderLoaderClient() {}
+
+ virtual void didStartLoading() = 0;
+ virtual void didReceiveData() = 0;
+ virtual void didFinishLoading() = 0;
+ virtual void didFail(int errorCode) = 0;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(BLOB)
+
+#endif // FileReaderLoaderClient_h
diff --git a/WebCore/fileapi/FileReaderSync.cpp b/WebCore/fileapi/FileReaderSync.cpp
index 6425bcf..85e7f52 100644
--- a/WebCore/fileapi/FileReaderSync.cpp
+++ b/WebCore/fileapi/FileReaderSync.cpp
@@ -34,161 +34,66 @@
#include "FileReaderSync.h"
-#include "Base64.h"
+#include "ArrayBuffer.h"
#include "Blob.h"
#include "BlobURL.h"
-#include "FileReader.h"
-#include "ResourceRequest.h"
-#include "ResourceResponse.h"
-#include "ScriptExecutionContext.h"
-#include "TextEncoding.h"
-#include "TextResourceDecoder.h"
-#include "ThreadableBlobRegistry.h"
-#include "ThreadableLoader.h"
+#include "FileException.h"
+#include "FileReaderLoader.h"
+#include <wtf/PassRefPtr.h>
namespace WebCore {
-class FileReaderSyncLoader : public ThreadableLoaderClient {
-public:
- // If the output result is provided, use it. Otherwise, save it as the raw data.
- FileReaderSyncLoader(StringBuilder*);
-
- // Returns the http status code.
- void start(ScriptExecutionContext*, const ResourceRequest&, ExceptionCode&);
-
- // ThreadableLoaderClient
- virtual void didReceiveResponse(const ResourceResponse&);
- virtual void didReceiveData(const char*, int);
- virtual void didFinishLoading(unsigned long identifier);
- virtual void didFail(const ResourceError&);
-
- const Vector<char>& rawData() const { return m_rawData; }
-
-private:
- // The output result. The caller provides this in order to load the binary data directly.
- StringBuilder* m_builder;
-
- // The raw data. The caller does not provide the above output result and we need to save it here.
- Vector<char> m_rawData;
-
- int m_httpStatusCode;
-};
-
-FileReaderSyncLoader::FileReaderSyncLoader(StringBuilder* builder)
- : m_builder(builder)
- , m_httpStatusCode(0)
-{
-}
-
-void FileReaderSyncLoader::start(ScriptExecutionContext* scriptExecutionContext, const ResourceRequest& request, ExceptionCode& ec)
+FileReaderSync::FileReaderSync()
{
- ThreadableLoaderOptions options;
- options.sendLoadCallbacks = true;
- options.sniffContent = false;
- options.forcePreflight = false;
- options.allowCredentials = true;
- options.crossOriginRequestPolicy = DenyCrossOriginRequests;
-
- ThreadableLoader::loadResourceSynchronously(scriptExecutionContext, request, *this, options);
-
- ec = (m_httpStatusCode == 200) ? 0 : FileReader::httpStatusCodeToExceptionCode(m_httpStatusCode);
}
-void FileReaderSyncLoader::didReceiveResponse(const ResourceResponse& response)
+PassRefPtr<ArrayBuffer> FileReaderSync::readAsArrayBuffer(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
{
- m_httpStatusCode = response.httpStatusCode();
-}
+ if (!blob)
+ return 0;
-void FileReaderSyncLoader::didReceiveData(const char* data, int lengthReceived)
-{
- if (m_builder)
- m_builder->append(data, static_cast<unsigned>(lengthReceived));
- else
- m_rawData.append(data, static_cast<unsigned>(lengthReceived));
-}
+ FileReaderLoader loader(FileReaderLoader::ReadAsArrayBuffer, 0);
+ startLoading(scriptExecutionContext, loader, blob, ec);
-void FileReaderSyncLoader::didFinishLoading(unsigned long)
-{
-}
-
-void FileReaderSyncLoader::didFail(const ResourceError&)
-{
- // Treat as internal error.
- m_httpStatusCode = 500;
+ return loader.arrayBufferResult();
}
String FileReaderSync::readAsBinaryString(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
{
if (!blob)
- return m_builder.toString();
+ return String();
- read(scriptExecutionContext, blob, ReadAsBinaryString, ec);
- return m_builder.toString();
+ FileReaderLoader loader(FileReaderLoader::ReadAsBinaryString, 0);
+ startLoading(scriptExecutionContext, loader, blob, ec);
+ return loader.stringResult();
}
String FileReaderSync::readAsText(ScriptExecutionContext* scriptExecutionContext, Blob* blob, const String& encoding, ExceptionCode& ec)
{
if (!blob)
- return m_builder.toString();
+ return String();
- m_encoding = encoding;
- read(scriptExecutionContext, blob, ReadAsText, ec);
- return m_builder.toString();
+ FileReaderLoader loader(FileReaderLoader::ReadAsText, 0);
+ loader.setEncoding(encoding);
+ startLoading(scriptExecutionContext, loader, blob, ec);
+ return loader.stringResult();
}
String FileReaderSync::readAsDataURL(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
{
if (!blob)
- return m_builder.toString();
+ return String();
- read(scriptExecutionContext, blob, ReadAsDataURL, ec);
- return m_builder.toString();
-}
-
-void FileReaderSync::read(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ReadType readType, ExceptionCode& ec)
-{
- // The blob is read by routing through the request handling layer given the temporary public url.
- KURL urlForReading = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin());
- ThreadableBlobRegistry::registerBlobURL(urlForReading, blob->url());
-
- ResourceRequest request(urlForReading);
- request.setHTTPMethod("GET");
-
- FileReaderSyncLoader loader((readType == ReadAsBinaryString) ? &m_builder : 0);
- loader.start(scriptExecutionContext, request, ec);
- ThreadableBlobRegistry::unregisterBlobURL(urlForReading);
- if (ec)
- return;
-
- switch (readType) {
- case ReadAsBinaryString:
- // Nothing to do since we need no conversion.
- return;
- case ReadAsText:
- convertToText(loader.rawData().data(), loader.rawData().size(), m_builder);
- return;
- case ReadAsDataURL:
- FileReader::convertToDataURL(loader.rawData(), blob->type(), m_builder);
- return;
- }
-
- ASSERT_NOT_REACHED();
+ FileReaderLoader loader(FileReaderLoader::ReadAsDataURL, 0);
+ loader.setDataType(blob->type());
+ startLoading(scriptExecutionContext, loader, blob, ec);
+ return loader.stringResult();
}
-void FileReaderSync::convertToText(const char* data, int size, StringBuilder& builder)
+void FileReaderSync::startLoading(ScriptExecutionContext* scriptExecutionContext, FileReaderLoader& loader, Blob* blob, ExceptionCode& ec)
{
- if (!size)
- return;
-
- // Decode the data.
- // The File API spec says that we should use the supplied encoding if it is valid. However, we choose to ignore this
- // requirement in order to be consistent with how WebKit decodes the web content: always have the BOM override the
- // provided encoding.
- // FIXME: consider supporting incremental decoding to improve the perf.
- RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/plain", m_encoding.isEmpty() ? UTF8Encoding() : TextEncoding(m_encoding));
- builder.clear();
- builder.append(decoder->decode(data, size));
- builder.append(decoder->flush());
+ loader.start(scriptExecutionContext, blob);
+ ec = FileException::ErrorCodeToExceptionCode(loader.errorCode());
}
} // namespace WebCore
diff --git a/WebCore/fileapi/FileReaderSync.h b/WebCore/fileapi/FileReaderSync.h
index cb0e00d..79b637f 100644
--- a/WebCore/fileapi/FileReaderSync.h
+++ b/WebCore/fileapi/FileReaderSync.h
@@ -34,13 +34,15 @@
#if ENABLE(BLOB)
#include "ExceptionCode.h"
-#include <wtf/PassRefPtr.h>
+#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
-#include <wtf/text/StringBuilder.h>
+#include <wtf/text/WTFString.h>
namespace WebCore {
+class ArrayBuffer;
class Blob;
+class FileReaderLoader;
class ScriptExecutionContext;
class FileReaderSync : public RefCounted<FileReaderSync> {
@@ -52,6 +54,7 @@ public:
virtual ~FileReaderSync() { }
+ PassRefPtr<ArrayBuffer> readAsArrayBuffer(ScriptExecutionContext*, Blob*, ExceptionCode&);
String readAsBinaryString(ScriptExecutionContext*, Blob*, ExceptionCode&);
String readAsText(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
{
@@ -61,20 +64,9 @@ public:
String readAsDataURL(ScriptExecutionContext*, Blob*, ExceptionCode&);
private:
- enum ReadType {
- ReadAsBinaryString,
- ReadAsText,
- ReadAsDataURL
- };
+ FileReaderSync();
- FileReaderSync() { }
-
- void read(ScriptExecutionContext*, Blob*, ReadType, ExceptionCode&);
- void convertToText(const char* data, int size, StringBuilder&);
-
- StringBuilder m_builder;
-
- String m_encoding;
+ void startLoading(ScriptExecutionContext*, FileReaderLoader&, Blob*, ExceptionCode&);
};
} // namespace WebCore
diff --git a/WebCore/fileapi/FileReaderSync.idl b/WebCore/fileapi/FileReaderSync.idl
index 72818b1..381d483 100644
--- a/WebCore/fileapi/FileReaderSync.idl
+++ b/WebCore/fileapi/FileReaderSync.idl
@@ -34,6 +34,8 @@ module html {
CanBeConstructed,
NoStaticTables
] FileReaderSync {
+ [CallWith=ScriptExecutionContext] ArrayBuffer readAsArrayBuffer(in Blob blob)
+ raises(FileException);
[CallWith=ScriptExecutionContext, ConvertScriptString] DOMString readAsBinaryString(in Blob blob)
raises(FileException);
[CallWith=ScriptExecutionContext, ConvertScriptString] DOMString readAsText(in Blob blob, in [Optional] DOMString encoding)
diff --git a/WebCore/fileapi/FileSystemCallbacks.cpp b/WebCore/fileapi/FileSystemCallbacks.cpp
index e5f404e..6644589 100644
--- a/WebCore/fileapi/FileSystemCallbacks.cpp
+++ b/WebCore/fileapi/FileSystemCallbacks.cpp
@@ -43,9 +43,9 @@
#include "EntryArray.h"
#include "EntryCallback.h"
#include "ErrorCallback.h"
-#include "ExceptionCode.h"
#include "FileEntry.h"
#include "FileError.h"
+#include "FileMetadata.h"
#include "FileSystemCallback.h"
#include "FileWriter.h"
#include "FileWriterCallback.h"
@@ -77,7 +77,7 @@ void FileSystemCallbacksBase::didOpenFileSystem(const String&, PassOwnPtr<AsyncF
ASSERT_NOT_REACHED();
}
-void FileSystemCallbacksBase::didReadMetadata(double)
+void FileSystemCallbacksBase::didReadMetadata(const FileMetadata&)
{
// Each subclass must implement an appropriate one.
ASSERT_NOT_REACHED();
@@ -104,19 +104,19 @@ void FileSystemCallbacksBase::didCreateFileWriter(PassOwnPtr<AsyncFileWriter>, l
void FileSystemCallbacksBase::didFail(int code)
{
if (m_errorCallback) {
- m_errorCallback->handleEvent(FileError::create(code).get());
+ m_errorCallback->handleEvent(FileError::create(static_cast<FileError::ErrorCode>(code)).get());
m_errorCallback.clear();
}
}
// EntryCallbacks -------------------------------------------------------------
-PassOwnPtr<EntryCallbacks> EntryCallbacks::create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem, const String& expectedPath, bool isDirectory)
+PassOwnPtr<EntryCallbacks> EntryCallbacks::create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
{
return adoptPtr(new EntryCallbacks(successCallback, errorCallback, fileSystem, expectedPath, isDirectory));
}
-EntryCallbacks::EntryCallbacks(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem, const String& expectedPath, bool isDirectory)
+EntryCallbacks::EntryCallbacks(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
: FileSystemCallbacksBase(errorCallback)
, m_successCallback(successCallback)
, m_fileSystem(fileSystem)
@@ -138,12 +138,12 @@ void EntryCallbacks::didSucceed()
// EntriesCallbacks -----------------------------------------------------------
-PassOwnPtr<EntriesCallbacks> EntriesCallbacks::create(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DirectoryReaderBase* directoryReader, const String& basePath)
+PassOwnPtr<EntriesCallbacks> EntriesCallbacks::create(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath)
{
return adoptPtr(new EntriesCallbacks(successCallback, errorCallback, directoryReader, basePath));
}
-EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DirectoryReaderBase* directoryReader, const String& basePath)
+EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath)
: FileSystemCallbacksBase(errorCallback)
, m_successCallback(successCallback)
, m_directoryReader(directoryReader)
@@ -205,10 +205,10 @@ MetadataCallbacks::MetadataCallbacks(PassRefPtr<MetadataCallback> successCallbac
{
}
-void MetadataCallbacks::didReadMetadata(double modificationTime)
+void MetadataCallbacks::didReadMetadata(const FileMetadata& metadata)
{
if (m_successCallback)
- m_successCallback->handleEvent(Metadata::create(modificationTime).get());
+ m_successCallback->handleEvent(Metadata::create(metadata.modificationTime).get());
m_successCallback.clear();
}
diff --git a/WebCore/fileapi/FileSystemCallbacks.h b/WebCore/fileapi/FileSystemCallbacks.h
index c600a76..100fd0c 100644
--- a/WebCore/fileapi/FileSystemCallbacks.h
+++ b/WebCore/fileapi/FileSystemCallbacks.h
@@ -47,6 +47,7 @@ class ErrorCallback;
class EntriesCallback;
class EntryArray;
class EntryCallback;
+struct FileMetadata;
class FileSystemCallback;
class FileWriter;
class FileWriterCallback;
@@ -65,7 +66,7 @@ public:
virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>);
// For MetadataCallbacks.
- virtual void didReadMetadata(double modificationTime);
+ virtual void didReadMetadata(const FileMetadata&);
// For EntriesCallbacks. didReadDirectoryEntry is called each time the API reads an entry, and didReadDirectoryDone is called when a chunk of entries have been read (i.e. good time to call back to the application). If hasMore is true there can be more chunks.
virtual void didReadDirectoryEntry(const String& name, bool isDirectory);
@@ -86,27 +87,27 @@ protected:
class EntryCallbacks : public FileSystemCallbacksBase {
public:
- static PassOwnPtr<EntryCallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, DOMFileSystemBase*, const String& expectedPath, bool isDirectory);
+ static PassOwnPtr<EntryCallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
virtual void didSucceed();
private:
- EntryCallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, DOMFileSystemBase*, const String& expectedPath, bool isDirectory);
+ EntryCallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
RefPtr<EntryCallback> m_successCallback;
- DOMFileSystemBase* m_fileSystem;
+ RefPtr<DOMFileSystemBase> m_fileSystem;
String m_expectedPath;
bool m_isDirectory;
};
class EntriesCallbacks : public FileSystemCallbacksBase {
public:
- static PassOwnPtr<EntriesCallbacks> create(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, DirectoryReaderBase*, const String& basePath);
+ static PassOwnPtr<EntriesCallbacks> create(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
virtual void didReadDirectoryEntry(const String& name, bool isDirectory);
virtual void didReadDirectoryEntries(bool hasMore);
private:
- EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, DirectoryReaderBase*, const String& basePath);
+ EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
RefPtr<EntriesCallback> m_successCallback;
- DirectoryReaderBase* m_directoryReader;
+ RefPtr<DirectoryReaderBase> m_directoryReader;
String m_basePath;
RefPtr<EntryArray> m_entries;
};
@@ -125,7 +126,7 @@ private:
class MetadataCallbacks : public FileSystemCallbacksBase {
public:
static PassOwnPtr<MetadataCallbacks> create(PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>);
- virtual void didReadMetadata(double modificationTime);
+ virtual void didReadMetadata(const FileMetadata&);
private:
MetadataCallbacks(PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>);
diff --git a/WebCore/fileapi/FileWriter.cpp b/WebCore/fileapi/FileWriter.cpp
index bc76984..7775709 100644
--- a/WebCore/fileapi/FileWriter.cpp
+++ b/WebCore/fileapi/FileWriter.cpp
@@ -38,6 +38,7 @@
#include "Blob.h"
#include "ExceptionCode.h"
#include "FileError.h"
+#include "FileException.h"
#include "ProgressEvent.h"
namespace WebCore {
@@ -90,13 +91,11 @@ void FileWriter::write(Blob* data, ExceptionCode& ec)
{
ASSERT(m_writer);
if (m_readyState == WRITING) {
- ec = INVALID_STATE_ERR;
- m_error = FileError::create(ec);
+ setError(FileError::INVALID_STATE_ERR, ec);
return;
}
if (!data) {
- ec = TYPE_MISMATCH_ERR;
- m_error = FileError::create(ec);
+ setError(FileError::TYPE_MISMATCH_ERR, ec);
return;
}
@@ -112,8 +111,7 @@ void FileWriter::seek(long long position, ExceptionCode& ec)
{
ASSERT(m_writer);
if (m_readyState == WRITING) {
- ec = INVALID_STATE_ERR;
- m_error = FileError::create(ec);
+ setError(FileError::INVALID_STATE_ERR, ec);
return;
}
@@ -132,8 +130,7 @@ void FileWriter::truncate(long long position, ExceptionCode& ec)
{
ASSERT(m_writer);
if (m_readyState == WRITING || position < 0) {
- ec = INVALID_STATE_ERR;
- m_error = FileError::create(ec);
+ setError(FileError::INVALID_STATE_ERR, ec);
return;
}
m_readyState = WRITING;
@@ -147,12 +144,11 @@ void FileWriter::abort(ExceptionCode& ec)
{
ASSERT(m_writer);
if (m_readyState != WRITING) {
- ec = INVALID_STATE_ERR;
- m_error = FileError::create(ec);
+ setError(FileError::INVALID_STATE_ERR, ec);
return;
}
-
- m_error = FileError::create(ABORT_ERR);
+
+ m_error = FileError::create(FileError::ABORT_ERR);
m_writer->abort();
}
@@ -191,11 +187,11 @@ void FileWriter::didTruncate()
fireEvent(eventNames().writeendEvent);
}
-void FileWriter::didFail(ExceptionCode ec)
+void FileWriter::didFail(FileError::ErrorCode code)
{
- m_error = FileError::create(ec);
+ m_error = FileError::create(code);
fireEvent(eventNames().errorEvent);
- if (ABORT_ERR == ec)
+ if (FileError::ABORT_ERR == code)
fireEvent(eventNames().abortEvent);
fireEvent(eventNames().errorEvent);
m_blobBeingWritten.clear();
@@ -209,6 +205,12 @@ void FileWriter::fireEvent(const AtomicString& type)
dispatchEvent(ProgressEvent::create(type, true, static_cast<unsigned>(m_bytesWritten), static_cast<unsigned>(m_bytesToWrite)));
}
+void FileWriter::setError(FileError::ErrorCode errorCode, ExceptionCode& ec)
+{
+ ec = FileException::ErrorCodeToExceptionCode(errorCode);
+ m_error = FileError::create(errorCode);
+}
+
} // namespace WebCore
-
+
#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/fileapi/FileWriter.h b/WebCore/fileapi/FileWriter.h
index 454081c..0e884ea 100644
--- a/WebCore/fileapi/FileWriter.h
+++ b/WebCore/fileapi/FileWriter.h
@@ -77,7 +77,7 @@ public:
// AsyncFileWriterClient
void didWrite(long long bytes, bool complete);
void didTruncate();
- void didFail(ExceptionCode ec);
+ void didFail(FileError::ErrorCode);
// ActiveDOMObject
virtual bool canSuspend() const;
@@ -97,7 +97,7 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(abort);
DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
DEFINE_ATTRIBUTE_EVENT_LISTENER(writeend);
-
+
private:
FileWriter(ScriptExecutionContext*);
@@ -113,6 +113,8 @@ private:
void fireEvent(const AtomicString& type);
+ void setError(FileError::ErrorCode, ExceptionCode&);
+
RefPtr<FileError> m_error;
EventTargetData m_eventTargetData;
OwnPtr<AsyncFileWriter> m_writer;
diff --git a/WebCore/fileapi/SyncCallbackHelper.h b/WebCore/fileapi/SyncCallbackHelper.h
index 1612e93..25e6739 100644
--- a/WebCore/fileapi/SyncCallbackHelper.h
+++ b/WebCore/fileapi/SyncCallbackHelper.h
@@ -41,6 +41,7 @@
#include "ExceptionCode.h"
#include "FileEntry.h"
#include "FileError.h"
+#include "FileException.h"
#include "FileSystemCallback.h"
#include "MetadataCallback.h"
#include "VoidCallback.h"
@@ -64,7 +65,7 @@ public:
: m_observer(observer)
, m_successCallback(SuccessCallbackImpl::create(this))
, m_errorCallback(ErrorCallbackImpl::create(this))
- , m_error(0)
+ , m_exceptionCode(0)
, m_completed(false)
{
}
@@ -74,12 +75,12 @@ public:
if (m_observer) {
while (!m_completed) {
if (!m_observer->waitForOperationToComplete()) {
- m_error = ABORT_ERR;
+ m_exceptionCode = FileException::ABORT_ERR;
break;
}
}
}
- ec = m_error;
+ ec = m_exceptionCode;
return m_result.release();
}
@@ -138,9 +139,9 @@ private:
friend class SuccessCallbackImpl;
friend class ErrorCallbackImpl;
- void setError(ExceptionCode ec)
+ void setError(int code)
{
- m_error = ec;
+ m_exceptionCode = FileException::ErrorCodeToExceptionCode(code);
m_completed = true;
}
@@ -154,7 +155,7 @@ private:
RefPtr<SuccessCallbackImpl> m_successCallback;
RefPtr<ErrorCallbackImpl> m_errorCallback;
RefPtr<ResultType> m_result;
- ExceptionCode m_error;
+ ExceptionCode m_exceptionCode;
bool m_completed;
};
diff --git a/WebCore/history/BackForwardList.h b/WebCore/history/BackForwardList.h
index 861b43b..b622a9d 100644
--- a/WebCore/history/BackForwardList.h
+++ b/WebCore/history/BackForwardList.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
* Copyright (C) 2009 Google, Inc. All rights reserved.
*
@@ -36,8 +36,16 @@ namespace WebCore {
class HistoryItem;
+// FIXME: Remove this and rely on the typedef in BackForwardListImpl
+// instead, after removing the virtual functions at the bottom
+// of this class.
typedef Vector<RefPtr<HistoryItem> > HistoryItemVector;
+// FIXME: Move this class out of this file and into BackForwardListImpl.
+// FIXME: Consider replacing this BackForwardListClient concept with a
+// function that creates a BackForwardList object. The functions in
+// BackForwardList are now almost identical to this, and there is no
+// need for the extra level of indirection.
#if PLATFORM(CHROMIUM)
// In the Chromium port, the back/forward list is managed externally.
// See BackForwardListChromium.cpp
@@ -46,7 +54,6 @@ public:
virtual ~BackForwardListClient() {}
virtual void addItem(PassRefPtr<HistoryItem>) = 0;
virtual void goToItem(HistoryItem*) = 0;
- virtual HistoryItem* currentItem() = 0;
virtual HistoryItem* itemAtIndex(int) = 0;
virtual int backListCount() = 0;
virtual int forwardListCount() = 0;
@@ -54,50 +61,63 @@ public:
};
#endif
+// FIXME: Rename this class to BackForwardClient, and rename the
+// getter in Page accordingly.
class BackForwardList : public RefCounted<BackForwardList> {
public:
virtual ~BackForwardList()
{
}
- virtual bool isBackForwardListImpl() const { return false; }
-
+ // FIXME: Move this function to BackForwardListImpl, or eliminate
+ // it (see comment at definition of BackForwardListClient class).
#if PLATFORM(CHROMIUM)
// Must be called before any other methods.
virtual void setClient(BackForwardListClient*) = 0;
#endif
virtual void addItem(PassRefPtr<HistoryItem>) = 0;
- virtual void goBack() = 0;
- virtual void goForward() = 0;
+
virtual void goToItem(HistoryItem*) = 0;
- virtual HistoryItem* backItem() = 0;
- virtual HistoryItem* currentItem() = 0;
- virtual HistoryItem* forwardItem() = 0;
virtual HistoryItem* itemAtIndex(int) = 0;
-
- virtual void backListWithLimit(int, HistoryItemVector&) = 0;
- virtual void forwardListWithLimit(int, HistoryItemVector&) = 0;
-
- virtual int capacity() = 0;
- virtual void setCapacity(int) = 0;
- virtual bool enabled() = 0;
- virtual void setEnabled(bool) = 0;
virtual int backListCount() = 0;
virtual int forwardListCount() = 0;
- virtual bool containsItem(HistoryItem*) = 0;
+
+ virtual bool isActive() = 0;
virtual void close() = 0;
- virtual bool closed() = 0;
-
- virtual void removeItem(HistoryItem*) = 0;
- virtual HistoryItemVector& entries() = 0;
-
+
+ // FIXME: Rename this to just "clear" and change it so it's not
+ // WML-specific. This is the same operation as clearBackForwardList
+ // in the layout test controller; it would be reasonable to have it
+ // here even though HTML DOM interfaces don't require it.
#if ENABLE(WML)
virtual void clearWMLPageHistory() = 0;
#endif
+ HistoryItem* backItem() { return itemAtIndex(-1); }
+ HistoryItem* currentItem() { return itemAtIndex(0); }
+ HistoryItem* forwardItem() { return itemAtIndex(1); }
+
+ // FIXME: Remove these functions once all call sites are calling them
+ // directly on BackForwardListImpl instead of on BackForwardList.
+ // There is no need for any of these to be virtual functions and no
+ // need to implement them in classes other than BackForwardListImpl.
+ // Also remove the HistoryItemVector typedef in this file once this is done.
+ virtual void goBack() { }
+ virtual void goForward() { }
+ virtual void backListWithLimit(int, HistoryItemVector&) { }
+ virtual void forwardListWithLimit(int, HistoryItemVector&) { }
+ virtual int capacity() { return 0; }
+ virtual void setCapacity(int) { }
+ virtual bool enabled() { return false; }
+ virtual void setEnabled(bool) { }
+ virtual bool containsItem(HistoryItem*) { return false; }
+ virtual bool closed() { return false; }
+ virtual void removeItem(HistoryItem*) { }
+ virtual HistoryItemVector& entries() { HistoryItemVector* bogus = 0; return *bogus; }
+
protected:
BackForwardList()
{
diff --git a/WebCore/history/BackForwardListChromium.cpp b/WebCore/history/BackForwardListChromium.cpp
index dc1efc9..a22a147 100644
--- a/WebCore/history/BackForwardListChromium.cpp
+++ b/WebCore/history/BackForwardListChromium.cpp
@@ -64,23 +64,6 @@ void BackForwardListImpl::goToItem(HistoryItem* item)
m_client->goToItem(item);
}
-HistoryItem* BackForwardListImpl::backItem()
-{
- ASSERT_NOT_REACHED();
- return 0;
-}
-
-HistoryItem* BackForwardListImpl::forwardItem()
-{
- ASSERT_NOT_REACHED();
- return 0;
-}
-
-HistoryItem* BackForwardListImpl::currentItem()
-{
- return m_client->currentItem();
-}
-
int BackForwardListImpl::capacity()
{
return m_capacity;
diff --git a/WebCore/history/BackForwardListImpl.h b/WebCore/history/BackForwardListImpl.h
index ab92710..2f08cfe 100644
--- a/WebCore/history/BackForwardListImpl.h
+++ b/WebCore/history/BackForwardListImpl.h
@@ -33,35 +33,34 @@
namespace WebCore {
-class HistoryItem;
class Page;
typedef Vector<RefPtr<HistoryItem> > HistoryItemVector;
typedef HashSet<RefPtr<HistoryItem> > HistoryItemHashSet;
+// FIXME: After renaming BackForwardList to BackForwardClient,
+// rename this to BackForwardList.
class BackForwardListImpl : public BackForwardList {
public:
static PassRefPtr<BackForwardListImpl> create(Page* page) { return adoptRef(new BackForwardListImpl(page)); }
- ~BackForwardListImpl();
-
- bool isBackForwardListImpl() const { return true; }
+ virtual ~BackForwardListImpl();
#if PLATFORM(CHROMIUM)
// Must be called before any other methods.
- void setClient(BackForwardListClient* client) { m_client = client; }
+ virtual void setClient(BackForwardListClient* client) { m_client = client; }
#endif
Page* page() { return m_page; }
- void addItem(PassRefPtr<HistoryItem>);
+ virtual void addItem(PassRefPtr<HistoryItem>);
void goBack();
void goForward();
- void goToItem(HistoryItem*);
+ virtual void goToItem(HistoryItem*);
HistoryItem* backItem();
HistoryItem* currentItem();
HistoryItem* forwardItem();
- HistoryItem* itemAtIndex(int);
+ virtual HistoryItem* itemAtIndex(int);
void backListWithLimit(int, HistoryItemVector&);
void forwardListWithLimit(int, HistoryItemVector&);
@@ -70,23 +69,25 @@ public:
void setCapacity(int);
bool enabled();
void setEnabled(bool);
- int backListCount();
- int forwardListCount();
+ virtual int backListCount();
+ virtual int forwardListCount();
bool containsItem(HistoryItem*);
- void close();
+ virtual void close();
bool closed();
void removeItem(HistoryItem*);
HistoryItemVector& entries();
#if ENABLE(WML)
- void clearWMLPageHistory();
+ virtual void clearWMLPageHistory();
#endif
private:
BackForwardListImpl(Page*);
-
+
+ virtual bool isActive() { return enabled() && capacity(); }
+
Page* m_page;
#if PLATFORM(CHROMIUM)
BackForwardListClient* m_client;
diff --git a/WebCore/history/CachedFrame.cpp b/WebCore/history/CachedFrame.cpp
index 470e03f..a3ef401 100644
--- a/WebCore/history/CachedFrame.cpp
+++ b/WebCore/history/CachedFrame.cpp
@@ -115,6 +115,8 @@ void CachedFrameBase::restore()
if (m_document->hasListenerType(Document::TOUCH_LISTENER))
m_document->page()->chrome()->client()->needTouchEvents(true);
#endif
+
+ m_document->documentDidBecomeActive();
}
CachedFrame::CachedFrame(Frame* frame)
diff --git a/WebCore/history/PageCache.cpp b/WebCore/history/PageCache.cpp
index fedc1e3..30c3b42 100644
--- a/WebCore/history/PageCache.cpp
+++ b/WebCore/history/PageCache.cpp
@@ -192,12 +192,8 @@ static void logCanCachePageDecision(Page* page)
bool cannotCache = !logCanCacheFrameDecision(page->mainFrame(), 1);
FrameLoadType loadType = page->mainFrame()->loader()->loadType();
- if (!page->backForwardList()->enabled()) {
- PCLOG(" -The back/forward list is disabled");
- cannotCache = true;
- }
- if (!(page->backForwardList()->capacity() > 0)) {
- PCLOG(" -The back/forward list has a 0 capacity");
+ if (!page->backForwardList()->isActive()) {
+ PCLOG(" -The back/forward list is disabled or has 0 capacity");
cannotCache = true;
}
if (!page->settings()->usesPageCache()) {
@@ -307,8 +303,7 @@ bool PageCache::canCache(Page* page)
FrameLoadType loadType = page->mainFrame()->loader()->loadType();
return canCachePageContainingThisFrame(page->mainFrame())
- && page->backForwardList()->enabled()
- && page->backForwardList()->capacity() > 0
+ && page->backForwardList()->isActive()
&& page->settings()->usesPageCache()
#if ENABLE(DEVICE_ORIENTATION)
&& !(page->deviceMotionController() && page->deviceMotionController()->isActive())
diff --git a/WebCore/html/BaseButtonInputType.cpp b/WebCore/html/BaseButtonInputType.cpp
new file mode 100644
index 0000000..fd6a8ff
--- /dev/null
+++ b/WebCore/html/BaseButtonInputType.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "BaseButtonInputType.h"
+
+#include "HTMLInputElement.h"
+#include "RenderButton.h"
+
+namespace WebCore {
+
+bool BaseButtonInputType::appendFormData(FormDataList&, bool) const
+{
+ // Buttons except overridden types are never successful.
+ return false;
+}
+
+RenderObject* BaseButtonInputType::createRenderer(RenderArena* arena, RenderStyle*) const
+{
+ return new (arena) RenderButton(element());
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/BaseButtonInputType.h b/WebCore/html/BaseButtonInputType.h
new file mode 100644
index 0000000..e7f683b
--- /dev/null
+++ b/WebCore/html/BaseButtonInputType.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BaseButtonInputType_h
+#define BaseButtonInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+// Base of button, file, image, reset, and submit types.
+class BaseButtonInputType : public InputType {
+protected:
+ BaseButtonInputType(HTMLInputElement* element) : InputType(element) { }
+
+private:
+ virtual bool appendFormData(FormDataList&, bool) const;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
+};
+
+} // namespace WebCore
+
+#endif // BaseButtonInputType_h
diff --git a/WebCore/html/BaseCheckableInputType.cpp b/WebCore/html/BaseCheckableInputType.cpp
new file mode 100644
index 0000000..009e8e4
--- /dev/null
+++ b/WebCore/html/BaseCheckableInputType.cpp
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "BaseCheckableInputType.h"
+
+#include "FormDataList.h"
+#include "HTMLInputElement.h"
+#include "HTMLNames.h"
+#include "RegularExpression.h"
+
+namespace WebCore {
+
+bool BaseCheckableInputType::saveFormControlState(String& result) const
+{
+ result = element()->checked() ? "on" : "off";
+ return true;
+}
+
+void BaseCheckableInputType::restoreFormControlState(const String& state) const
+{
+ element()->setChecked(state == "on");
+}
+
+bool BaseCheckableInputType::appendFormData(FormDataList& encoding, bool) const
+{
+ if (!element()->checked())
+ return false;
+ encoding.appendData(element()->name(), element()->value());
+ return true;
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/BaseCheckableInputType.h b/WebCore/html/BaseCheckableInputType.h
new file mode 100644
index 0000000..02edf29
--- /dev/null
+++ b/WebCore/html/BaseCheckableInputType.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BaseCheckableInputType_h
+#define BaseCheckableInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+// Base of checkbox and radio types.
+class BaseCheckableInputType : public InputType {
+protected:
+ BaseCheckableInputType(HTMLInputElement* element) : InputType(element) { }
+
+private:
+ virtual bool saveFormControlState(String&) const;
+ virtual void restoreFormControlState(const String&) const;
+ virtual bool appendFormData(FormDataList&, bool) const;
+};
+
+} // namespace WebCore
+
+#endif // BaseCheckableInputType_h
diff --git a/WebCore/html/ButtonInputType.h b/WebCore/html/ButtonInputType.h
index 7efbad2..f016114 100644
--- a/WebCore/html/ButtonInputType.h
+++ b/WebCore/html/ButtonInputType.h
@@ -31,16 +31,16 @@
#ifndef ButtonInputType_h
#define ButtonInputType_h
-#include "InputType.h"
+#include "BaseButtonInputType.h"
namespace WebCore {
-class ButtonInputType : public InputType {
+class ButtonInputType : public BaseButtonInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- ButtonInputType(HTMLInputElement* element) : InputType(element) { }
+ ButtonInputType(HTMLInputElement* element) : BaseButtonInputType(element) { }
virtual const AtomicString& formControlType() const;
virtual bool supportsValidation() const;
};
diff --git a/WebCore/html/CheckboxInputType.h b/WebCore/html/CheckboxInputType.h
index e041a07..b68e14d 100644
--- a/WebCore/html/CheckboxInputType.h
+++ b/WebCore/html/CheckboxInputType.h
@@ -31,16 +31,16 @@
#ifndef CheckboxInputType_h
#define CheckboxInputType_h
-#include "InputType.h"
+#include "BaseCheckableInputType.h"
namespace WebCore {
-class CheckboxInputType : public InputType {
+class CheckboxInputType : public BaseCheckableInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- CheckboxInputType(HTMLInputElement* element) : InputType(element) { }
+ CheckboxInputType(HTMLInputElement* element) : BaseCheckableInputType(element) { }
virtual const AtomicString& formControlType() const;
virtual bool valueMissing(const String&) const;
};
diff --git a/WebCore/html/ClassList.cpp b/WebCore/html/ClassList.cpp
new file mode 100644
index 0000000..578601b
--- /dev/null
+++ b/WebCore/html/ClassList.cpp
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ClassList.h"
+
+#include "Element.h"
+#include "HTMLNames.h"
+#include "HTMLParserIdioms.h"
+#include "SpaceSplitString.h"
+#include <wtf/text/StringBuilder.h>
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+ClassList::ClassList(Element* element)
+ : m_element(element)
+{
+ if (m_element->document()->inQuirksMode())
+ m_classNamesForQuirksMode.set(m_element->fastGetAttribute(classAttr), false);
+}
+
+void ClassList::ref()
+{
+ m_element->ref();
+}
+
+void ClassList::deref()
+{
+ m_element->deref();
+}
+
+unsigned ClassList::length() const
+{
+ return m_element->hasClass() ? classNames().size() : 0;
+}
+
+const AtomicString ClassList::item(unsigned index) const
+{
+ if (index >= length())
+ return AtomicString();
+ return classNames()[index];
+}
+
+bool ClassList::contains(const AtomicString& token, ExceptionCode& ec) const
+{
+ if (!validateToken(token, ec))
+ return false;
+ return containsInternal(token);
+}
+
+bool ClassList::containsInternal(const AtomicString& token) const
+{
+ return m_element->hasClass() && classNames().contains(token);
+}
+
+void ClassList::add(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return;
+ addInternal(token);
+}
+
+void ClassList::addInternal(const AtomicString& token)
+{
+ const AtomicString& oldClassName(m_element->fastGetAttribute(classAttr));
+ if (oldClassName.isEmpty())
+ m_element->setAttribute(classAttr, token);
+ else if (!containsInternal(token)) {
+ const AtomicString& newClassName(addToken(oldClassName, token));
+ m_element->setAttribute(classAttr, newClassName);
+ }
+}
+
+void ClassList::remove(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return;
+ removeInternal(token);
+}
+
+void ClassList::removeInternal(const AtomicString& token)
+{
+ // Check using contains first since it uses AtomicString comparisons instead
+ // of character by character testing.
+ if (!containsInternal(token))
+ return;
+ const AtomicString& newClassName(removeToken(m_element->fastGetAttribute(classAttr), token));
+ m_element->setAttribute(classAttr, newClassName);
+}
+
+bool ClassList::toggle(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return false;
+
+ if (containsInternal(token)) {
+ removeInternal(token);
+ return false;
+ }
+ addInternal(token);
+ return true;
+}
+
+String ClassList::toString() const
+{
+ return m_element->fastGetAttribute(classAttr);
+}
+
+void ClassList::reset(const String& newClassName)
+{
+ if (!m_classNamesForQuirksMode.isNull())
+ m_classNamesForQuirksMode.set(newClassName, false);
+}
+
+const SpaceSplitString& ClassList::classNames() const
+{
+ ASSERT(m_element->hasClass());
+ if (!m_classNamesForQuirksMode.isNull())
+ return m_classNamesForQuirksMode;
+ return m_element->attributeMap()->classNames();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/ClassList.h b/WebCore/html/ClassList.h
new file mode 100644
index 0000000..93aea60
--- /dev/null
+++ b/WebCore/html/ClassList.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ClassList_h
+#define ClassList_h
+
+#include "DOMTokenList.h"
+#include "ExceptionCode.h"
+#include "SpaceSplitString.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class Element;
+
+class ClassList : public DOMTokenList {
+public:
+ static PassOwnPtr<ClassList> create(Element* element)
+ {
+ return adoptPtr(new ClassList(element));
+ }
+
+ virtual void ref();
+ virtual void deref();
+
+ virtual unsigned length() const;
+ virtual const AtomicString item(unsigned index) const;
+ virtual bool contains(const AtomicString&, ExceptionCode&) const;
+ virtual void add(const AtomicString&, ExceptionCode&);
+ virtual void remove(const AtomicString&, ExceptionCode&);
+ virtual bool toggle(const AtomicString&, ExceptionCode&);
+ virtual String toString() const;
+
+ virtual Element* element() { return m_element; }
+
+ void reset(const String&);
+
+private:
+ ClassList(Element*);
+
+ void addInternal(const AtomicString&);
+ bool containsInternal(const AtomicString&) const;
+ void removeInternal(const AtomicString&);
+
+ const SpaceSplitString& classNames() const;
+
+ Element* m_element;
+ SpaceSplitString m_classNamesForQuirksMode;
+};
+
+} // namespace WebCore
+
+#endif // ClassList_h
diff --git a/WebCore/html/DOMSettableTokenList.cpp b/WebCore/html/DOMSettableTokenList.cpp
new file mode 100644
index 0000000..2636bd3
--- /dev/null
+++ b/WebCore/html/DOMSettableTokenList.cpp
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DOMSettableTokenList.h"
+
+namespace WebCore {
+
+DOMSettableTokenList::DOMSettableTokenList()
+ : m_value()
+ , m_tokens()
+{
+}
+
+DOMSettableTokenList::~DOMSettableTokenList()
+{
+}
+
+const AtomicString DOMSettableTokenList::item(unsigned index) const
+{
+ if (index >= length())
+ return AtomicString("");
+ return m_tokens[index];
+}
+
+bool DOMSettableTokenList::contains(const AtomicString& token, ExceptionCode& ec) const
+{
+ if (!validateToken(token, ec))
+ return false;
+ return m_tokens.contains(token);
+}
+
+void DOMSettableTokenList::add(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec) || m_tokens.contains(token))
+ return;
+ addInternal(token);
+}
+
+void DOMSettableTokenList::addInternal(const AtomicString& token)
+{
+ m_value = addToken(m_value, token);
+ m_tokens.add(token);
+}
+
+void DOMSettableTokenList::remove(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec) || !m_tokens.contains(token))
+ return;
+ removeInternal(token);
+}
+
+void DOMSettableTokenList::removeInternal(const AtomicString& token)
+{
+ m_value = removeToken(m_value, token);
+ m_tokens.remove(token);
+}
+
+bool DOMSettableTokenList::toggle(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return false;
+ if (m_tokens.contains(token)) {
+ removeInternal(token);
+ return false;
+ }
+ addInternal(token);
+ return true;
+}
+
+void DOMSettableTokenList::setValue(const String& value)
+{
+ m_value = value;
+ m_tokens.set(value, true);
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/DOMSettableTokenList.h b/WebCore/html/DOMSettableTokenList.h
new file mode 100644
index 0000000..2b711b4
--- /dev/null
+++ b/WebCore/html/DOMSettableTokenList.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DOMSettableTokenList_h
+#define DOMSettableTokenList_h
+
+#include "DOMTokenList.h"
+#include "ExceptionCode.h"
+#include "SpaceSplitString.h"
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/text/AtomicString.h>
+
+namespace WebCore {
+
+class DOMSettableTokenList : public DOMTokenList, public RefCounted<DOMSettableTokenList> {
+public:
+ static PassRefPtr<DOMSettableTokenList> create()
+ {
+ return adoptRef(new DOMSettableTokenList());
+ }
+ virtual ~DOMSettableTokenList();
+
+ virtual void ref() { RefCounted<DOMSettableTokenList>::ref(); }
+ virtual void deref() { RefCounted<DOMSettableTokenList>::deref(); }
+
+ virtual unsigned length() const { return m_tokens.size(); }
+ virtual const AtomicString item(unsigned index) const;
+ virtual bool contains(const AtomicString&, ExceptionCode&) const;
+ virtual void add(const AtomicString&, ExceptionCode&);
+ virtual void remove(const AtomicString&, ExceptionCode&);
+ virtual bool toggle(const AtomicString&, ExceptionCode&);
+ virtual String toString() const { return value(); }
+
+ String value() const { return m_value; }
+ void setValue(const String&);
+
+private:
+ DOMSettableTokenList();
+
+ void removeInternal(const AtomicString&);
+ void addInternal(const AtomicString&);
+
+ String m_value;
+ SpaceSplitString m_tokens;
+};
+
+} // namespace WebCore
+
+#endif // DOMSettableTokenList_h
diff --git a/WebCore/html/DOMSettableTokenList.idl b/WebCore/html/DOMSettableTokenList.idl
new file mode 100644
index 0000000..6260623
--- /dev/null
+++ b/WebCore/html/DOMSettableTokenList.idl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module core {
+
+ interface [
+ GenerateConstructor,
+ HasIndexGetter,
+ GenerateToJS
+ ] DOMSettableTokenList : DOMTokenList {
+ attribute DOMString value;
+ };
+
+}
diff --git a/WebCore/html/DOMTokenList.cpp b/WebCore/html/DOMTokenList.cpp
index aa0a74b..3c91f20 100644
--- a/WebCore/html/DOMTokenList.cpp
+++ b/WebCore/html/DOMTokenList.cpp
@@ -25,17 +25,12 @@
#include "config.h"
#include "DOMTokenList.h"
-#include "Element.h"
-#include "HTMLNames.h"
#include "HTMLParserIdioms.h"
-#include "SpaceSplitString.h"
#include <wtf/text/StringBuilder.h>
namespace WebCore {
-using namespace HTMLNames;
-
-static bool validateToken(const AtomicString& token, ExceptionCode& ec)
+bool DOMTokenList::validateToken(const AtomicString& token, ExceptionCode& ec)
{
if (token.isEmpty()) {
ec = SYNTAX_ERR;
@@ -53,86 +48,23 @@ static bool validateToken(const AtomicString& token, ExceptionCode& ec)
return true;
}
-DOMTokenList::DOMTokenList(Element* element)
- : m_element(element)
-{
- if (m_element->document()->inQuirksMode())
- m_classNamesForQuirksMode.set(m_element->fastGetAttribute(classAttr), false);
-}
-
-void DOMTokenList::ref()
-{
- m_element->ref();
-}
-
-void DOMTokenList::deref()
-{
- m_element->deref();
-}
-
-unsigned DOMTokenList::length() const
-{
- return m_element->hasClass() ? classNames().size() : 0;
-}
-
-const AtomicString DOMTokenList::item(unsigned index) const
-{
- if (index >= length())
- return AtomicString();
- return classNames()[index];
-}
-
-bool DOMTokenList::contains(const AtomicString& token, ExceptionCode& ec) const
-{
- if (!validateToken(token, ec))
- return false;
- return containsInternal(token);
-}
-
-bool DOMTokenList::containsInternal(const AtomicString& token) const
+String DOMTokenList::addToken(const AtomicString& input, const AtomicString& token)
{
- return m_element->hasClass() && classNames().contains(token);
-}
+ if (input.isEmpty())
+ return token;
-void DOMTokenList::add(const AtomicString& token, ExceptionCode& ec)
-{
- if (!validateToken(token, ec))
- return;
- addInternal(token);
+ StringBuilder builder;
+ builder.append(input);
+ if (input[input.length()-1] != ' ')
+ builder.append(' ');
+ builder.append(token);
+ return builder.toString();
}
-void DOMTokenList::addInternal(const AtomicString& token) const
+String DOMTokenList::removeToken(const AtomicString& input, const AtomicString& token)
{
- const AtomicString& oldClassName(m_element->fastGetAttribute(classAttr));
- if (oldClassName.isEmpty())
- m_element->setAttribute(classAttr, token);
- else if (!containsInternal(token)) {
- StringBuilder builder;
- builder.append(oldClassName);
- if (oldClassName[oldClassName.length() - 1] != ' ')
- builder.append(' ');
- builder.append(token);
- m_element->setAttribute(classAttr, builder.toString());
- }
-}
-
-void DOMTokenList::remove(const AtomicString& token, ExceptionCode& ec)
-{
- if (!validateToken(token, ec))
- return;
- removeInternal(token);
-}
-
-void DOMTokenList::removeInternal(const AtomicString& token) const
-{
- // Check using contains first since it uses AtomicString comparisons instead
- // of character by character testing.
- if (!containsInternal(token))
- return;
-
// Algorithm defined at http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#remove-a-token-from-a-string
- const AtomicString& input = m_element->fastGetAttribute(classAttr);
unsigned inputLength = input.length();
Vector<UChar> output; // 3
output.reserveCapacity(inputLength);
@@ -170,39 +102,7 @@ void DOMTokenList::removeInternal(const AtomicString& token) const
}
output.shrinkToFit();
- m_element->setAttribute(classAttr, String::adopt(output));
-}
-
-bool DOMTokenList::toggle(const AtomicString& token, ExceptionCode& ec)
-{
- if (!validateToken(token, ec))
- return false;
-
- if (containsInternal(token)) {
- removeInternal(token);
- return false;
- }
- addInternal(token);
- return true;
-}
-
-String DOMTokenList::toString() const
-{
- return m_element->fastGetAttribute(classAttr);
-}
-
-void DOMTokenList::reset(const String& newClassName)
-{
- if (!m_classNamesForQuirksMode.isNull())
- m_classNamesForQuirksMode.set(newClassName, false);
-}
-
-const SpaceSplitString& DOMTokenList::classNames() const
-{
- ASSERT(m_element->hasClass());
- if (!m_classNamesForQuirksMode.isNull())
- return m_classNamesForQuirksMode;
- return m_element->attributeMap()->classNames();
+ return String::adopt(output);
}
} // namespace WebCore
diff --git a/WebCore/html/DOMTokenList.h b/WebCore/html/DOMTokenList.h
index fad69ca..5df2ede 100644
--- a/WebCore/html/DOMTokenList.h
+++ b/WebCore/html/DOMTokenList.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010, Google Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,9 +26,9 @@
#define DOMTokenList_h
#include "ExceptionCode.h"
-#include "SpaceSplitString.h"
+#include <wtf/text/AtomicString.h>
#include <wtf/Noncopyable.h>
-#include <wtf/PassOwnPtr.h>
+#include <wtf/Vector.h>
namespace WebCore {
@@ -36,37 +36,25 @@ class Element;
class DOMTokenList : public Noncopyable {
public:
- static PassOwnPtr<DOMTokenList> create(Element* element)
- {
- return adoptPtr(new DOMTokenList(element));
- }
+ virtual ~DOMTokenList() {};
- void ref();
- void deref();
+ virtual void ref() = 0;
+ virtual void deref() = 0;
- unsigned length() const;
- const AtomicString item(unsigned index) const;
- bool contains(const AtomicString&, ExceptionCode&) const;
- void add(const AtomicString&, ExceptionCode&);
- void remove(const AtomicString&, ExceptionCode&);
- bool toggle(const AtomicString&, ExceptionCode&);
- String toString() const;
+ virtual unsigned length() const = 0;
+ virtual const AtomicString item(unsigned index) const = 0;
+ virtual bool contains(const AtomicString&, ExceptionCode&) const = 0;
+ virtual void add(const AtomicString&, ExceptionCode&) = 0;
+ virtual void remove(const AtomicString&, ExceptionCode&) = 0;
+ virtual bool toggle(const AtomicString&, ExceptionCode&) = 0;
+ virtual String toString() const = 0;
- void reset(const String&);
+ virtual Element* element() { return 0; }
- Element* element() { return m_element; }
-
-private:
- DOMTokenList(Element*);
-
- void addInternal(const AtomicString&) const;
- bool containsInternal(const AtomicString&) const;
- void removeInternal(const AtomicString&) const;
-
- const SpaceSplitString& classNames() const;
-
- Element* m_element;
- SpaceSplitString m_classNamesForQuirksMode;
+protected:
+ static bool validateToken(const AtomicString&, ExceptionCode&);
+ static String addToken(const AtomicString&, const AtomicString&);
+ static String removeToken(const AtomicString&, const AtomicString&);
};
} // namespace WebCore
diff --git a/WebCore/html/FileInputType.cpp b/WebCore/html/FileInputType.cpp
index 6cb17f2..d98d3b6 100644
--- a/WebCore/html/FileInputType.cpp
+++ b/WebCore/html/FileInputType.cpp
@@ -1,36 +1,32 @@
/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2010 Google Inc. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "FileInputType.h"
+#include "File.h"
+#include "FileList.h"
+#include "FormDataList.h"
+#include "HTMLInputElement.h"
+#include "RenderFileUploadControl.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/text/WTFString.h>
@@ -46,9 +42,43 @@ const AtomicString& FileInputType::formControlType() const
return InputTypeNames::file();
}
+bool FileInputType::appendFormData(FormDataList& encoding, bool multipart) const
+{
+ FileList* fileList = element()->files();
+ unsigned numFiles = fileList->length();
+ if (!multipart) {
+ // Send only the basenames.
+ // 4.10.16.4 and 4.10.16.6 sections in HTML5.
+
+ // Unlike the multipart case, we have no special handling for the empty
+ // fileList because Netscape doesn't support for non-multipart
+ // submission of file inputs, and Firefox doesn't add "name=" query
+ // parameter.
+ for (unsigned i = 0; i < numFiles; ++i)
+ encoding.appendData(element()->name(), fileList->item(i)->fileName());
+ return true;
+ }
+
+ // If no filename at all is entered, return successful but empty.
+ // Null would be more logical, but Netscape posts an empty file. Argh.
+ if (!numFiles) {
+ encoding.appendBlob(element()->name(), File::create(""));
+ return true;
+ }
+
+ for (unsigned i = 0; i < numFiles; ++i)
+ encoding.appendBlob(element()->name(), fileList->item(i));
+ return true;
+}
+
bool FileInputType::valueMissing(const String& value) const
{
return value.isEmpty();
}
+RenderObject* FileInputType::createRenderer(RenderArena* arena, RenderStyle*) const
+{
+ return new (arena) RenderFileUploadControl(element());
+}
+
} // namespace WebCore
diff --git a/WebCore/html/FileInputType.h b/WebCore/html/FileInputType.h
index 2cbfe67..24430fb 100644
--- a/WebCore/html/FileInputType.h
+++ b/WebCore/html/FileInputType.h
@@ -31,18 +31,20 @@
#ifndef FileInputType_h
#define FileInputType_h
-#include "InputType.h"
+#include "BaseButtonInputType.h"
namespace WebCore {
-class FileInputType : public InputType {
+class FileInputType : public BaseButtonInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- FileInputType(HTMLInputElement* element) : InputType(element) { }
+ FileInputType(HTMLInputElement* element) : BaseButtonInputType(element) { }
virtual const AtomicString& formControlType() const;
+ virtual bool appendFormData(FormDataList&, bool) const;
virtual bool valueMissing(const String&) const;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
};
} // namespace WebCore
diff --git a/WebCore/html/HTMLAttributeNames.in b/WebCore/html/HTMLAttributeNames.in
index d5c48c4..d9759fc 100644
--- a/WebCore/html/HTMLAttributeNames.in
+++ b/WebCore/html/HTMLAttributeNames.in
@@ -260,6 +260,7 @@ sortable
sortdirection
span
x-webkit-speech
+x-webkit-grammar
spellcheck
src
standby
diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp
index e20e729..84ad706 100644
--- a/WebCore/html/HTMLDocument.cpp
+++ b/WebCore/html/HTMLDocument.cpp
@@ -439,7 +439,7 @@ void HTMLDocument::clear()
bool HTMLDocument::isFrameSet() const
{
HTMLElement* bodyElement = body();
- return bodyElement && bodyElement->renderer() && bodyElement->hasTagName(framesetTag);
+ return bodyElement && bodyElement->hasTagName(framesetTag);
}
#ifdef ANDROID_INSTRUMENT
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index 1483fbc..bc4bf07 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -725,6 +725,17 @@ void HTMLElement::setDraggable(bool value)
setAttribute(draggableAttr, value ? "true" : "false");
}
+bool HTMLElement::spellcheck() const
+{
+ return isSpellCheckingEnabled();
+}
+
+void HTMLElement::setSpellcheck(bool enable)
+{
+ setAttribute(spellcheckAttr, enable ? "true" : "false");
+}
+
+
void HTMLElement::click()
{
dispatchSimulatedClick(0, false, false);
diff --git a/WebCore/html/HTMLElement.h b/WebCore/html/HTMLElement.h
index 52e9ecf..1660e2a 100644
--- a/WebCore/html/HTMLElement.h
+++ b/WebCore/html/HTMLElement.h
@@ -66,6 +66,9 @@ public:
virtual bool draggable() const;
void setDraggable(bool);
+ bool spellcheck() const;
+ void setSpellcheck(bool);
+
void click();
virtual void accessKeyAction(bool sendToAnyElement);
diff --git a/WebCore/html/HTMLElement.idl b/WebCore/html/HTMLElement.idl
index b127c51..77423fc 100644
--- a/WebCore/html/HTMLElement.idl
+++ b/WebCore/html/HTMLElement.idl
@@ -62,6 +62,8 @@ module html {
attribute [ConvertNullToNullString] DOMString contentEditable;
readonly attribute boolean isContentEditable;
+ attribute boolean spellcheck;
+
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
readonly attribute DOMString titleDisplayString;
#endif
diff --git a/WebCore/html/HTMLFormControlElement.cpp b/WebCore/html/HTMLFormControlElement.cpp
index 51b9e20..710cda1 100644
--- a/WebCore/html/HTMLFormControlElement.cpp
+++ b/WebCore/html/HTMLFormControlElement.cpp
@@ -46,11 +46,13 @@
#include "RenderTheme.h"
#include "ScriptEventListener.h"
#include "ValidityState.h"
+#include <limits>
#include <wtf/Vector.h>
namespace WebCore {
using namespace HTMLNames;
+using namespace std;
HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
: HTMLElement(tagName, document)
@@ -548,26 +550,22 @@ RenderTextControl* HTMLTextFormControlElement::textRendererAfterUpdateLayout()
void HTMLTextFormControlElement::setSelectionStart(int start)
{
- if (RenderTextControl* renderer = textRendererAfterUpdateLayout())
- renderer->setSelectionStart(start);
+ setSelectionRange(start, max(start, selectionEnd()));
}
void HTMLTextFormControlElement::setSelectionEnd(int end)
{
- if (RenderTextControl* renderer = textRendererAfterUpdateLayout())
- renderer->setSelectionEnd(end);
+ setSelectionRange(min(end, selectionStart()), end);
}
void HTMLTextFormControlElement::select()
{
- if (RenderTextControl* renderer = textRendererAfterUpdateLayout())
- renderer->select();
+ setSelectionRange(0, numeric_limits<int>::max());
}
void HTMLTextFormControlElement::setSelectionRange(int start, int end)
{
- if (RenderTextControl* renderer = textRendererAfterUpdateLayout())
- renderer->setSelectionRange(start, end);
+ WebCore::setSelectionRange(this, start, end);
}
int HTMLTextFormControlElement::selectionStart()
diff --git a/WebCore/html/HTMLFormControlElement.h b/WebCore/html/HTMLFormControlElement.h
index 4792dba..8b721d8 100644
--- a/WebCore/html/HTMLFormControlElement.h
+++ b/WebCore/html/HTMLFormControlElement.h
@@ -180,6 +180,7 @@ public:
// The derived class should return true if placeholder processing is needed.
virtual bool supportsPlaceholder() const = 0;
String strippedPlaceholder() const;
+ bool placeholderShouldBeVisible() const;
int selectionStart();
int selectionEnd();
@@ -192,7 +193,6 @@ public:
protected:
HTMLTextFormControlElement(const QualifiedName&, Document*, HTMLFormElement*);
- bool placeholderShouldBeVisible() const;
void updatePlaceholderVisibility(bool);
virtual void parseMappedAttribute(Attribute*);
diff --git a/WebCore/html/HTMLFrameElementBase.cpp b/WebCore/html/HTMLFrameElementBase.cpp
index f8d682c..d153845 100644
--- a/WebCore/html/HTMLFrameElementBase.cpp
+++ b/WebCore/html/HTMLFrameElementBase.cpp
@@ -166,11 +166,6 @@ void HTMLFrameElementBase::setNameAndOpenURL()
openURL();
}
-void HTMLFrameElementBase::setNameAndOpenURLCallback(Node* n)
-{
- static_cast<HTMLFrameElementBase*>(n)->setNameAndOpenURL();
-}
-
void HTMLFrameElementBase::updateOnReparenting()
{
ASSERT(m_remainsAliveOnRemovalFromTree);
diff --git a/WebCore/html/HTMLFrameElementBase.h b/WebCore/html/HTMLFrameElementBase.h
index ae41e75..ef25f30 100644
--- a/WebCore/html/HTMLFrameElementBase.h
+++ b/WebCore/html/HTMLFrameElementBase.h
@@ -70,8 +70,6 @@ private:
void setNameAndOpenURL();
void openURL(bool lockHistory = true, bool lockBackForwardList = true);
- static void setNameAndOpenURLCallback(Node*);
-
AtomicString m_URL;
AtomicString m_frameName;
diff --git a/WebCore/html/HTMLFrameSetElement.cpp b/WebCore/html/HTMLFrameSetElement.cpp
index d7a47d7..0bb6c56 100644
--- a/WebCore/html/HTMLFrameSetElement.cpp
+++ b/WebCore/html/HTMLFrameSetElement.cpp
@@ -29,6 +29,8 @@
#include "Document.h"
#include "Event.h"
#include "EventNames.h"
+#include "Frame.h"
+#include "FrameLoaderClient.h"
#include "HTMLNames.h"
#include "Length.h"
#include "MouseEvent.h"
@@ -207,4 +209,18 @@ void HTMLFrameSetElement::recalcStyle(StyleChange ch)
HTMLElement::recalcStyle(ch);
}
+void HTMLFrameSetElement::insertedIntoDocument()
+{
+ HTMLElement::insertedIntoDocument();
+ if (Frame* frame = document()->frame())
+ frame->loader()->client()->dispatchDidBecomeFrameset(document()->isFrameSet());
+}
+
+void HTMLFrameSetElement::removedFromDocument()
+{
+ HTMLElement::removedFromDocument();
+ if (Frame* frame = document()->frame())
+ frame->loader()->client()->dispatchDidBecomeFrameset(document()->isFrameSet());
+}
+
} // namespace WebCore
diff --git a/WebCore/html/HTMLFrameSetElement.h b/WebCore/html/HTMLFrameSetElement.h
index c761414..bdbec6a 100644
--- a/WebCore/html/HTMLFrameSetElement.h
+++ b/WebCore/html/HTMLFrameSetElement.h
@@ -77,7 +77,10 @@ private:
virtual void defaultEventHandler(Event*);
virtual void recalcStyle(StyleChange);
-
+
+ virtual void insertedIntoDocument();
+ virtual void removedFromDocument();
+
OwnArrayPtr<Length> m_rowLengths;
OwnArrayPtr<Length> m_colLengths;
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index f572f4c..cd826bf 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -56,13 +56,12 @@
#include "LocalizedStrings.h"
#include "MouseEvent.h"
#include "Page.h"
-#include "RenderButton.h"
#include "RenderFileUploadControl.h"
#include "RenderImage.h"
#include "RenderSlider.h"
-#include "RenderText.h"
#include "RenderTextControlSingleLine.h"
#include "RenderTheme.h"
+#include "RuntimeEnabledFeatures.h"
#include "ScriptEventListener.h"
#include "Settings.h"
#include "StepRange.h"
@@ -536,79 +535,12 @@ const AtomicString& HTMLInputElement::formControlType() const
bool HTMLInputElement::saveFormControlState(String& result) const
{
- switch (deprecatedInputType()) {
- case BUTTON:
- case COLOR:
- case DATE:
- case DATETIME:
- case DATETIMELOCAL:
- case EMAIL:
- case FILE:
- case HIDDEN:
- case IMAGE:
- case ISINDEX:
- case MONTH:
- case NUMBER:
- case RANGE:
- case RESET:
- case SEARCH:
- case SUBMIT:
- case TELEPHONE:
- case TEXT:
- case TIME:
- case URL:
- case WEEK: {
- String currentValue = value();
- if (currentValue == defaultValue())
- return false;
- result = currentValue;
- return true;
- }
- case CHECKBOX:
- case RADIO:
- result = checked() ? "on" : "off";
- return true;
- case PASSWORD:
- return false;
- }
- ASSERT_NOT_REACHED();
- return false;
+ return m_inputType->saveFormControlState(result);
}
void HTMLInputElement::restoreFormControlState(const String& state)
{
- ASSERT(deprecatedInputType() != PASSWORD); // should never save/restore password fields
- switch (deprecatedInputType()) {
- case BUTTON:
- case COLOR:
- case DATE:
- case DATETIME:
- case DATETIMELOCAL:
- case EMAIL:
- case FILE:
- case HIDDEN:
- case IMAGE:
- case ISINDEX:
- case MONTH:
- case NUMBER:
- case RANGE:
- case RESET:
- case SEARCH:
- case SUBMIT:
- case TELEPHONE:
- case TEXT:
- case TIME:
- case URL:
- case WEEK:
- setValue(state);
- break;
- case CHECKBOX:
- case RADIO:
- setChecked(state == "on");
- break;
- case PASSWORD:
- break;
- }
+ m_inputType->restoreFormControlState(state);
}
bool HTMLInputElement::canStartSelection() const
@@ -803,46 +735,9 @@ bool HTMLInputElement::rendererIsNeeded(RenderStyle *style)
return HTMLFormControlElementWithState::rendererIsNeeded(style);
}
-RenderObject* HTMLInputElement::createRenderer(RenderArena *arena, RenderStyle *style)
+RenderObject* HTMLInputElement::createRenderer(RenderArena* arena, RenderStyle* style)
{
- switch (deprecatedInputType()) {
- case BUTTON:
- case RESET:
- case SUBMIT:
- return new (arena) RenderButton(this);
- case CHECKBOX:
- case RADIO:
- return RenderObject::createObject(this, style);
- case FILE:
- return new (arena) RenderFileUploadControl(this);
- case HIDDEN:
- break;
- case IMAGE: {
- RenderImage* image = new (arena) RenderImage(this);
- image->setImageResource(RenderImageResource::create());
- return image;
- }
- case RANGE:
- return new (arena) RenderSlider(this);
- case COLOR:
- case DATE:
- case DATETIME:
- case DATETIMELOCAL:
- case EMAIL:
- case ISINDEX:
- case MONTH:
- case NUMBER:
- case PASSWORD:
- case SEARCH:
- case TELEPHONE:
- case TEXT:
- case TIME:
- case URL:
- case WEEK:
- return new (arena) RenderTextControlSingleLine(this, placeholderShouldBeVisible());
- }
- ASSERT(false);
- return 0;
+ return m_inputType->createRenderer(arena, style);
}
void HTMLInputElement::attach()
@@ -919,93 +814,7 @@ void HTMLInputElement::setActivatedSubmit(bool flag)
bool HTMLInputElement::appendFormData(FormDataList& encoding, bool multipart)
{
- // image generates its own names, but for other types there is no form data unless there's a name
- if (name().isEmpty() && deprecatedInputType() != IMAGE)
- return false;
-
- switch (deprecatedInputType()) {
- case COLOR:
- case DATE:
- case DATETIME:
- case DATETIMELOCAL:
- case EMAIL:
- case HIDDEN:
- case ISINDEX:
- case MONTH:
- case NUMBER:
- case PASSWORD:
- case RANGE:
- case SEARCH:
- case TELEPHONE:
- case TEXT:
- case TIME:
- case URL:
- case WEEK:
- // always successful
- encoding.appendData(name(), value());
- return true;
-
- case CHECKBOX:
- case RADIO:
- if (checked()) {
- encoding.appendData(name(), value());
- return true;
- }
- break;
-
- case BUTTON:
- case RESET:
- // these types of buttons are never successful
- return false;
-
- case IMAGE:
- if (m_activeSubmit) {
- encoding.appendData(name().isEmpty() ? "x" : (name() + ".x"), m_xPos);
- encoding.appendData(name().isEmpty() ? "y" : (name() + ".y"), m_yPos);
- if (!name().isEmpty() && !value().isEmpty())
- encoding.appendData(name(), value());
- return true;
- }
- break;
-
- case SUBMIT:
- if (m_activeSubmit) {
- String encstr = valueWithDefault();
- encoding.appendData(name(), encstr);
- return true;
- }
- break;
-
- case FILE: {
- unsigned numFiles = m_fileList->length();
- if (!multipart) {
- // Send only the basenames.
- // 4.10.16.4 and 4.10.16.6 sections in HTML5.
-
- // Unlike the multipart case, we have no special
- // handling for the empty fileList because Netscape
- // doesn't support for non-multipart submission of
- // file inputs, and Firefox doesn't add "name=" query
- // parameter.
-
- for (unsigned i = 0; i < numFiles; ++i)
- encoding.appendData(name(), m_fileList->item(i)->fileName());
- return true;
- }
-
- // If no filename at all is entered, return successful but empty.
- // Null would be more logical, but Netscape posts an empty file. Argh.
- if (!numFiles) {
- encoding.appendBlob(name(), File::create(""));
- return true;
- }
-
- for (unsigned i = 0; i < numFiles; ++i)
- encoding.appendBlob(name(), m_fileList->item(i));
- return true;
- }
- }
- return false;
+ return m_inputType->isFormDataAppendable() && m_inputType->appendFormData(encoding, multipart);
}
void HTMLInputElement::reset()
@@ -2154,7 +1963,7 @@ bool HTMLInputElement::isSpeechEnabled() const
case SEARCH:
case TELEPHONE:
case TEXT:
- return hasAttribute(webkitspeechAttr);
+ return RuntimeEnabledFeatures::speechInputEnabled() && hasAttribute(webkitspeechAttr);
case BUTTON:
case CHECKBOX:
case COLOR:
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index e584a78..1a0490e 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -203,6 +203,10 @@ public:
return document()->checkedRadioButtons();
}
+ // FIXME: We should move m_xPos and m_yPos to ImageInputType class.
+ int xPosition() const { return m_xPos; }
+ int yPosition() const { return m_yPos; }
+
protected:
HTMLInputElement(const QualifiedName&, Document*, HTMLFormElement* = 0);
diff --git a/WebCore/html/HTMLInputElement.idl b/WebCore/html/HTMLInputElement.idl
index 1ca7d6c..b873826 100644
--- a/WebCore/html/HTMLInputElement.idl
+++ b/WebCore/html/HTMLInputElement.idl
@@ -101,6 +101,7 @@ module html {
#if defined(ENABLE_INPUT_SPEECH) && ENABLE_INPUT_SPEECH
attribute [Reflect, EnabledAtRuntime] boolean webkitSpeech;
+ attribute [Reflect, EnabledAtRuntime] boolean webkitGrammar;
attribute [DontEnum] EventListener onwebkitspeechchange;
#endif
};
diff --git a/WebCore/html/HTMLMeterElement.cpp b/WebCore/html/HTMLMeterElement.cpp
index 5419a22..3de69df 100644
--- a/WebCore/html/HTMLMeterElement.cpp
+++ b/WebCore/html/HTMLMeterElement.cpp
@@ -172,7 +172,7 @@ HTMLMeterElement::GaugeRegion HTMLMeterElement::gaugeRegion() const
double theValue = value();
double optimumValue = optimum();
- if (optimumValue <= lowValue) {
+ if (optimumValue < lowValue) {
// The optimum range stays under low
if (theValue <= lowValue)
return GaugeRegionOptimum;
@@ -181,7 +181,7 @@ HTMLMeterElement::GaugeRegion HTMLMeterElement::gaugeRegion() const
return GaugeRegionEvenLessGood;
}
- if (highValue <= optimumValue) {
+ if (highValue < optimumValue) {
// The optimum range stays over high
if (highValue <= theValue)
return GaugeRegionOptimum;
@@ -190,11 +190,11 @@ HTMLMeterElement::GaugeRegion HTMLMeterElement::gaugeRegion() const
return GaugeRegionEvenLessGood;
}
- // The optimum range stays between high and low
- if (lowValue < theValue && theValue < highValue)
+ // The optimum range stays between high and low.
+ // According to the standard, <meter> never show GaugeRegionEvenLessGood in this case
+ // because the value is never less or greater than min or max.
+ if (lowValue <= theValue && theValue <= highValue)
return GaugeRegionOptimum;
- if (theValue == min() || max() == theValue)
- return GaugeRegionEvenLessGood;
return GaugeRegionSuboptimal;
}
diff --git a/WebCore/html/HTMLObjectElement.cpp b/WebCore/html/HTMLObjectElement.cpp
index 2b51286..7020517 100644
--- a/WebCore/html/HTMLObjectElement.cpp
+++ b/WebCore/html/HTMLObjectElement.cpp
@@ -116,31 +116,6 @@ void HTMLObjectElement::parseMappedAttribute(Attribute* attr)
HTMLPlugInImageElement::parseMappedAttribute(attr);
}
-typedef HashMap<String, String, CaseFoldingHash> ClassIdToTypeMap;
-
-static ClassIdToTypeMap* createClassIdToTypeMap()
-{
- ClassIdToTypeMap* map = new ClassIdToTypeMap;
- map->add("clsid:D27CDB6E-AE6D-11CF-96B8-444553540000", "application/x-shockwave-flash");
- map->add("clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA", "audio/x-pn-realaudio-plugin");
- map->add("clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B", "video/quicktime");
- map->add("clsid:166B1BCA-3F9C-11CF-8075-444553540000", "application/x-director");
- map->add("clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6", "application/x-mplayer2");
- map->add("clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95", "application/x-mplayer2");
- return map;
-}
-
-static String serviceTypeForClassId(const String& classId)
-{
- // Return early if classId is empty (since we won't do anything below).
- // Furthermore, if classId is null, calling get() below will crash.
- if (classId.isEmpty())
- return String();
-
- static ClassIdToTypeMap* map = createClassIdToTypeMap();
- return map->get(classId);
-}
-
static void mapDataParamToSrc(Vector<String>* paramNames, Vector<String>* paramValues)
{
// Some plugins don't understand the "data" attribute of the OBJECT tag (i.e. Real and WMP
@@ -242,6 +217,19 @@ bool HTMLObjectElement::hasFallbackContent() const
}
return false;
}
+
+bool HTMLObjectElement::hasValidClassId()
+{
+ // HTML5 says that fallback content should be rendered if a non-empty
+ // classid is specified for which the UA can't find a suitable plug-in.
+ // WebKit supports no classids, with the exception of Qt plug-ins, which use
+ // classid to specify which QObject to load.
+#if PLATFORM(QT)
+ return classId().isEmpty() || equalIgnoringCase(serviceType(), "application/x-qt-plugin");
+#else
+ return classId().isEmpty();
+#endif
+}
// FIXME: This should be unified with HTMLEmbedElement::updateWidget and
// moved down into HTMLPluginImageElement.cpp
@@ -255,14 +243,9 @@ void HTMLObjectElement::updateWidget(bool onlyCreateNonNetscapePlugins)
// FIXME: This should ASSERT isFinishedParsingChildren() instead.
if (!isFinishedParsingChildren())
return;
-
- String url = this->url();
- // If the object does not specify a MIME type via a type attribute, but does
- // contain a classid attribute, try to map the classid to a MIME type.
+ String url = this->url();
String serviceType = this->serviceType();
- if (serviceType.isEmpty())
- serviceType = serviceTypeForClassId(classId());
// FIXME: These should be joined into a PluginParameters class.
Vector<String> paramNames;
@@ -292,7 +275,7 @@ void HTMLObjectElement::updateWidget(bool onlyCreateNonNetscapePlugins)
return;
SubframeLoader* loader = document()->frame()->loader()->subframeLoader();
- bool success = beforeLoadAllowedLoad && loader->requestObject(this, url, getAttribute(nameAttr), serviceType, paramNames, paramValues);
+ bool success = beforeLoadAllowedLoad && hasValidClassId() && loader->requestObject(this, url, getAttribute(nameAttr), serviceType, paramNames, paramValues);
if (!success && fallbackContent)
renderFallbackContent();
diff --git a/WebCore/html/HTMLObjectElement.h b/WebCore/html/HTMLObjectElement.h
index 2d416c3..a4609cb 100644
--- a/WebCore/html/HTMLObjectElement.h
+++ b/WebCore/html/HTMLObjectElement.h
@@ -66,6 +66,8 @@ private:
// FIXME: This function should not deal with url or serviceType
// so that we can better share code between <object> and <embed>.
void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType);
+
+ bool hasValidClassId();
AtomicString m_id;
String m_classId;
diff --git a/WebCore/html/HiddenInputType.cpp b/WebCore/html/HiddenInputType.cpp
index 76742ae..6e083e6 100644
--- a/WebCore/html/HiddenInputType.cpp
+++ b/WebCore/html/HiddenInputType.cpp
@@ -49,4 +49,10 @@ bool HiddenInputType::supportsValidation() const
return false;
}
+RenderObject* HiddenInputType::createRenderer(RenderArena*, RenderStyle*) const
+{
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
} // namespace WebCore
diff --git a/WebCore/html/HiddenInputType.h b/WebCore/html/HiddenInputType.h
index cc49f98..1617371 100644
--- a/WebCore/html/HiddenInputType.h
+++ b/WebCore/html/HiddenInputType.h
@@ -43,6 +43,7 @@ private:
HiddenInputType(HTMLInputElement* element) : InputType(element) { }
virtual const AtomicString& formControlType() const;
virtual bool supportsValidation() const;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
};
} // namespace WebCore
diff --git a/WebCore/html/ImageDocument.cpp b/WebCore/html/ImageDocument.cpp
index 6361f43..a42ccc8 100644
--- a/WebCore/html/ImageDocument.cpp
+++ b/WebCore/html/ImageDocument.cpp
@@ -387,7 +387,7 @@ void ImageEventListener::handleEvent(ScriptExecutionContext*, Event* event)
{
if (event->type() == eventNames().resizeEvent)
m_doc->windowSizeChanged();
- else if (event->type() == eventNames().clickEvent) {
+ else if (event->type() == eventNames().clickEvent && event->isMouseEvent()) {
MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
m_doc->imageClicked(mouseEvent->x(), mouseEvent->y());
}
diff --git a/WebCore/html/ImageInputType.cpp b/WebCore/html/ImageInputType.cpp
index 604b052..de24188 100644
--- a/WebCore/html/ImageInputType.cpp
+++ b/WebCore/html/ImageInputType.cpp
@@ -1,36 +1,30 @@
/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2010 Google Inc. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "ImageInputType.h"
+#include "FormDataList.h"
+#include "HTMLInputElement.h"
+#include "RenderImage.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -45,9 +39,33 @@ const AtomicString& ImageInputType::formControlType() const
return InputTypeNames::image();
}
+bool ImageInputType::isFormDataAppendable() const
+{
+ return true;
+}
+
+bool ImageInputType::appendFormData(FormDataList& encoding, bool) const
+{
+ if (!element()->isActivatedSubmit())
+ return false;
+ const AtomicString& name = element()->name();
+ encoding.appendData(name.isEmpty() ? "x" : (name + ".x"), element()->xPosition());
+ encoding.appendData(name.isEmpty() ? "y" : (name + ".y"), element()->yPosition());
+ if (!name.isEmpty() && !element()->value().isEmpty())
+ encoding.appendData(name, element()->value());
+ return true;
+}
+
bool ImageInputType::supportsValidation() const
{
return false;
}
+RenderObject* ImageInputType::createRenderer(RenderArena* arena, RenderStyle*) const
+{
+ RenderImage* image = new (arena) RenderImage(element());
+ image->setImageResource(RenderImageResource::create());
+ return image;
+}
+
} // namespace WebCore
diff --git a/WebCore/html/ImageInputType.h b/WebCore/html/ImageInputType.h
index be308b3..cd76e72 100644
--- a/WebCore/html/ImageInputType.h
+++ b/WebCore/html/ImageInputType.h
@@ -31,18 +31,21 @@
#ifndef ImageInputType_h
#define ImageInputType_h
-#include "InputType.h"
+#include "BaseButtonInputType.h"
namespace WebCore {
-class ImageInputType : public InputType {
+class ImageInputType : public BaseButtonInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- ImageInputType(HTMLInputElement* element) : InputType(element) { }
+ ImageInputType(HTMLInputElement* element) : BaseButtonInputType(element) { }
virtual const AtomicString& formControlType() const;
+ virtual bool isFormDataAppendable() const;
+ virtual bool appendFormData(FormDataList&, bool) const;
virtual bool supportsValidation() const;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
};
} // namespace WebCore
diff --git a/WebCore/html/InputType.cpp b/WebCore/html/InputType.cpp
index 1b2303a..c870c69 100644
--- a/WebCore/html/InputType.cpp
+++ b/WebCore/html/InputType.cpp
@@ -36,6 +36,7 @@
#include "DateTimeLocalInputType.h"
#include "EmailInputType.h"
#include "FileInputType.h"
+#include "FormDataList.h"
#include "HTMLInputElement.h"
#include "HiddenInputType.h"
#include "ImageInputType.h"
@@ -46,6 +47,7 @@
#include "RadioInputType.h"
#include "RangeInputType.h"
#include "RegularExpression.h"
+#include "RenderObject.h"
#include "ResetInputType.h"
#include "SearchInputType.h"
#include "SubmitInputType.h"
@@ -122,6 +124,33 @@ bool InputType::isTextType() const
return false;
}
+bool InputType::saveFormControlState(String& result) const
+{
+ String currentValue = element()->value();
+ if (currentValue == element()->defaultValue())
+ return false;
+ result = currentValue;
+ return true;
+}
+
+void InputType::restoreFormControlState(const String& state) const
+{
+ element()->setValue(state);
+}
+
+bool InputType::isFormDataAppendable() const
+{
+ // There is no form data unless there's a name for non-image types.
+ return !element()->name().isEmpty();
+}
+
+bool InputType::appendFormData(FormDataList& encoding, bool) const
+{
+ // Always successful.
+ encoding.appendData(element()->name(), element()->value());
+ return true;
+}
+
double InputType::valueAsDate() const
{
return DateComponents::invalidMilliseconds();
@@ -228,6 +257,11 @@ bool InputType::scaledStepValeuShouldBeInteger() const
return false;
}
+RenderObject* InputType::createRenderer(RenderArena*, RenderStyle* style) const
+{
+ return RenderObject::createObject(element(), style);
+}
+
double InputType::parseToDouble(const String&, double defaultValue) const
{
return defaultValue;
diff --git a/WebCore/html/InputType.h b/WebCore/html/InputType.h
index 953b123..f601051 100644
--- a/WebCore/html/InputType.h
+++ b/WebCore/html/InputType.h
@@ -38,24 +38,42 @@
namespace WebCore {
class DateComponents;
+class FormDataList;
class HTMLInputElement;
+class RenderArena;
+class RenderObject;
+class RenderStyle;
+// An InputType object represents the type-specific part of an HTMLInputElement.
+// Do not expose instances of InputType and classes derived from it to classes
+// other than HTMLInputElement.
class InputType : public Noncopyable {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*, const AtomicString&);
static PassOwnPtr<InputType> createText(HTMLInputElement*);
virtual ~InputType();
+ // Type query functions
+
virtual bool isTextField() const;
virtual bool isTextType() const;
virtual const AtomicString& formControlType() const = 0;
+ // Form value functions
+
+ virtual bool saveFormControlState(String&) const;
+ virtual void restoreFormControlState(const String&) const;
+ virtual bool isFormDataAppendable() const;
+ virtual bool appendFormData(FormDataList&, bool multipart) const;
+
+ // DOM property functions
+
virtual double valueAsDate() const;
virtual void setValueAsDate(double, ExceptionCode&) const;
virtual double valueAsNumber() const;
virtual void setValueAsNumber(double, ExceptionCode&) const;
- // Validation-related functions
+ // Validation functions
virtual bool supportsValidation() const;
virtual bool typeMismatchFor(const String&) const;
@@ -77,6 +95,10 @@ public:
virtual bool parsedStepValueShouldBeInteger() const;
virtual bool scaledStepValeuShouldBeInteger() const;
+ // Miscellaneous functions
+
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
+
// Parses the specified string for the type, and return
// the double value for the parsing result if the parsing
// succeeds; Returns defaultValue otherwise. This function can
diff --git a/WebCore/html/NumberInputType.cpp b/WebCore/html/NumberInputType.cpp
index a4e118c..28f510c 100644
--- a/WebCore/html/NumberInputType.cpp
+++ b/WebCore/html/NumberInputType.cpp
@@ -43,11 +43,8 @@ namespace WebCore {
using namespace HTMLNames;
using namespace std;
-// FIXME: Number values should be in the range of IEEE 754 single-precision
-// floating point number.
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#real-numbers
-static const double numberDefaultMinimum = -DBL_MAX;
-static const double numberDefaultMaximum = DBL_MAX;
+static const double numberDefaultMinimum = -FLT_MAX;
+static const double numberDefaultMaximum = FLT_MAX;
static const double numberDefaultStep = 1.0;
static const double numberStepScaleFactor = 1.0;
@@ -67,8 +64,16 @@ double NumberInputType::valueAsNumber() const
return parseToDouble(element()->value(), numeric_limits<double>::quiet_NaN());
}
-void NumberInputType::setValueAsNumber(double newValue, ExceptionCode&) const
+void NumberInputType::setValueAsNumber(double newValue, ExceptionCode& ec) const
{
+ if (newValue < numberDefaultMinimum) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+ if (newValue > numberDefaultMaximum) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
element()->setValue(serialize(newValue));
}
@@ -116,12 +121,17 @@ bool NumberInputType::stepMismatch(const String& value, double step) const
if (isinf(doubleValue))
return false;
// double's fractional part size is DBL_MAN_DIG-bit. If the current value
- // is greater than step*2^DBL_MANT_DIG, the following fmod() makes no sense.
+ // is greater than step*2^DBL_MANT_DIG, the following computation for
+ // remainder makes no sense.
if (doubleValue / pow(2.0, DBL_MANT_DIG) > step)
return false;
- double remainder = fmod(doubleValue, step);
- // Accepts errors in lower 7-bit.
- double acceptableError = step / pow(2.0, DBL_MANT_DIG - 7);
+ // The computation follows HTML5 4.10.7.2.10 `The step attribute' :
+ // ... that number subtracted from the step base is not an integral multiple
+ // of the allowed value step, the element is suffering from a step mismatch.
+ double remainder = fabs(doubleValue - step * round(doubleValue / step));
+ // Accepts erros in lower fractional part which IEEE 754 single-precision
+ // can't represent.
+ double acceptableError = step / pow(2.0, FLT_MANT_DIG);
return acceptableError < remainder && remainder < (step - acceptableError);
}
diff --git a/WebCore/html/PasswordInputType.cpp b/WebCore/html/PasswordInputType.cpp
index a645f96..cda689b 100644
--- a/WebCore/html/PasswordInputType.cpp
+++ b/WebCore/html/PasswordInputType.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "PasswordInputType.h"
+#include <wtf/Assertions.h>
#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -45,4 +46,16 @@ const AtomicString& PasswordInputType::formControlType() const
return InputTypeNames::password();
}
+bool PasswordInputType::saveFormControlState(String&) const
+{
+ // Should never save/restore password fields.
+ return false;
+}
+
+void PasswordInputType::restoreFormControlState(const String&) const
+{
+ // Should never save/restore password fields.
+ ASSERT_NOT_REACHED();
+}
+
} // namespace WebCore
diff --git a/WebCore/html/PasswordInputType.h b/WebCore/html/PasswordInputType.h
index db13449..cf25525 100644
--- a/WebCore/html/PasswordInputType.h
+++ b/WebCore/html/PasswordInputType.h
@@ -42,6 +42,8 @@ public:
private:
PasswordInputType(HTMLInputElement* element) : BaseTextInputType(element) { }
virtual const AtomicString& formControlType() const;
+ virtual bool saveFormControlState(String&) const;
+ virtual void restoreFormControlState(const String&) const;
};
} // namespace WebCore
diff --git a/WebCore/html/RadioInputType.h b/WebCore/html/RadioInputType.h
index 2ff2c41..9e7ab00 100644
--- a/WebCore/html/RadioInputType.h
+++ b/WebCore/html/RadioInputType.h
@@ -31,16 +31,16 @@
#ifndef RadioInputType_h
#define RadioInputType_h
-#include "InputType.h"
+#include "BaseCheckableInputType.h"
namespace WebCore {
-class RadioInputType : public InputType {
+class RadioInputType : public BaseCheckableInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- RadioInputType(HTMLInputElement* element) : InputType(element) { }
+ RadioInputType(HTMLInputElement* element) : BaseCheckableInputType(element) { }
virtual const AtomicString& formControlType() const;
virtual bool valueMissing(const String&) const;
};
diff --git a/WebCore/html/RangeInputType.cpp b/WebCore/html/RangeInputType.cpp
index 7448071..176d73b 100644
--- a/WebCore/html/RangeInputType.cpp
+++ b/WebCore/html/RangeInputType.cpp
@@ -34,6 +34,7 @@
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "HTMLParserIdioms.h"
+#include "RenderSlider.h"
#include <limits>
#include <wtf/MathExtras.h>
#include <wtf/PassOwnPtr.h>
@@ -126,6 +127,11 @@ double RangeInputType::stepScaleFactor() const
return rangeStepScaleFactor;
}
+RenderObject* RangeInputType::createRenderer(RenderArena* arena, RenderStyle*) const
+{
+ return new (arena) RenderSlider(element());
+}
+
double RangeInputType::parseToDouble(const String& src, double defaultValue) const
{
double numberValue;
diff --git a/WebCore/html/RangeInputType.h b/WebCore/html/RangeInputType.h
index 0ff6f60..64548f6 100644
--- a/WebCore/html/RangeInputType.h
+++ b/WebCore/html/RangeInputType.h
@@ -53,6 +53,7 @@ private:
virtual double stepBase() const;
virtual double defaultStep() const;
virtual double stepScaleFactor() const;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
virtual double parseToDouble(const String&, double) const;
virtual String serialize(double) const;
};
diff --git a/WebCore/html/ResetInputType.h b/WebCore/html/ResetInputType.h
index 3f883a3..ad940b4 100644
--- a/WebCore/html/ResetInputType.h
+++ b/WebCore/html/ResetInputType.h
@@ -31,16 +31,16 @@
#ifndef ResetInputType_h
#define ResetInputType_h
-#include "InputType.h"
+#include "BaseButtonInputType.h"
namespace WebCore {
-class ResetInputType : public InputType {
+class ResetInputType : public BaseButtonInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- ResetInputType(HTMLInputElement* element) : InputType(element) { }
+ ResetInputType(HTMLInputElement* element) : BaseButtonInputType(element) { }
virtual const AtomicString& formControlType() const;
virtual bool supportsValidation() const;
};
diff --git a/WebCore/html/SubmitInputType.cpp b/WebCore/html/SubmitInputType.cpp
index 65934f9..99c808e 100644
--- a/WebCore/html/SubmitInputType.cpp
+++ b/WebCore/html/SubmitInputType.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "SubmitInputType.h"
+#include "FormDataList.h"
+#include "HTMLInputElement.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -45,6 +47,14 @@ const AtomicString& SubmitInputType::formControlType() const
return InputTypeNames::submit();
}
+bool SubmitInputType::appendFormData(FormDataList& encoding, bool) const
+{
+ if (!element()->isActivatedSubmit())
+ return false;
+ encoding.appendData(element()->name(), element()->valueWithDefault());
+ return true;
+}
+
bool SubmitInputType::supportsValidation() const
{
return false;
diff --git a/WebCore/html/SubmitInputType.h b/WebCore/html/SubmitInputType.h
index 83fa5e5..2fe7ace 100644
--- a/WebCore/html/SubmitInputType.h
+++ b/WebCore/html/SubmitInputType.h
@@ -31,17 +31,18 @@
#ifndef SubmitInputType_h
#define SubmitInputType_h
-#include "InputType.h"
+#include "BaseButtonInputType.h"
namespace WebCore {
-class SubmitInputType : public InputType {
+class SubmitInputType : public BaseButtonInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- SubmitInputType(HTMLInputElement* element) : InputType(element) { }
+ SubmitInputType(HTMLInputElement* element) : BaseButtonInputType(element) { }
virtual const AtomicString& formControlType() const;
+ virtual bool appendFormData(FormDataList&, bool) const;
virtual bool supportsValidation() const;
};
diff --git a/WebCore/html/TextFieldInputType.cpp b/WebCore/html/TextFieldInputType.cpp
index 82382ef..926d0ac 100644
--- a/WebCore/html/TextFieldInputType.cpp
+++ b/WebCore/html/TextFieldInputType.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "TextFieldInputType.h"
+#include "HTMLInputElement.h"
+#include "RenderTextControlSingleLine.h"
#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -45,4 +47,9 @@ bool TextFieldInputType::valueMissing(const String& value) const
return value.isEmpty();
}
+RenderObject* TextFieldInputType::createRenderer(RenderArena* arena, RenderStyle*) const
+{
+ return new (arena) RenderTextControlSingleLine(element(), element()->placeholderShouldBeVisible());
+}
+
} // namespace WebCore
diff --git a/WebCore/html/TextFieldInputType.h b/WebCore/html/TextFieldInputType.h
index 9108c42..78bec1d 100644
--- a/WebCore/html/TextFieldInputType.h
+++ b/WebCore/html/TextFieldInputType.h
@@ -42,6 +42,7 @@ protected:
TextFieldInputType(HTMLInputElement* element) : InputType(element) { }
virtual bool isTextField() const;
virtual bool valueMissing(const String&) const;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
};
} // namespace WebCore
diff --git a/WebCore/html/canvas/ArrayBuffer.cpp b/WebCore/html/canvas/ArrayBuffer.cpp
index 014cc1e..ee8f149 100644
--- a/WebCore/html/canvas/ArrayBuffer.cpp
+++ b/WebCore/html/canvas/ArrayBuffer.cpp
@@ -43,11 +43,16 @@ PassRefPtr<ArrayBuffer> ArrayBuffer::create(unsigned numElements, unsigned eleme
PassRefPtr<ArrayBuffer> ArrayBuffer::create(ArrayBuffer* other)
{
- void* data = tryAllocate(other->byteLength(), 1);
+ return ArrayBuffer::create(other->data(), other->byteLength());
+}
+
+PassRefPtr<ArrayBuffer> ArrayBuffer::create(void* source, unsigned byteLength)
+{
+ void* data = tryAllocate(byteLength, 1);
if (!data)
return 0;
- RefPtr<ArrayBuffer> buffer = adoptRef(new ArrayBuffer(data, other->byteLength()));
- memcpy(buffer->data(), other->data(), other->byteLength());
+ RefPtr<ArrayBuffer> buffer = adoptRef(new ArrayBuffer(data, byteLength));
+ memcpy(buffer->data(), source, byteLength);
return buffer.release();
}
diff --git a/WebCore/html/canvas/ArrayBuffer.h b/WebCore/html/canvas/ArrayBuffer.h
index f538080..ff5e599 100644
--- a/WebCore/html/canvas/ArrayBuffer.h
+++ b/WebCore/html/canvas/ArrayBuffer.h
@@ -35,6 +35,7 @@ class ArrayBuffer : public RefCounted<ArrayBuffer> {
public:
static PassRefPtr<ArrayBuffer> create(unsigned numElements, unsigned elementByteSize);
static PassRefPtr<ArrayBuffer> create(ArrayBuffer*);
+ static PassRefPtr<ArrayBuffer> create(void* source, unsigned byteLength);
void* data();
const void* data() const;
diff --git a/WebCore/html/canvas/WebGLFramebuffer.cpp b/WebCore/html/canvas/WebGLFramebuffer.cpp
index a709341..0fdcb99 100644
--- a/WebCore/html/canvas/WebGLFramebuffer.cpp
+++ b/WebCore/html/canvas/WebGLFramebuffer.cpp
@@ -177,7 +177,8 @@ void WebGLFramebuffer::initializeRenderbuffers()
float colorClearValue[] = {0, 0, 0, 0}, depthClearValue = 0;
int stencilClearValue = 0;
- unsigned char colorMask[] = {1, 1, 1, 1}, depthMask = 1, stencilMask = 1;
+ unsigned char colorMask[] = {1, 1, 1, 1}, depthMask = 1;
+ unsigned int stencilMask = 0xffffffff;
bool isScissorEnabled = false;
bool isDitherEnabled = false;
if (initColor) {
@@ -194,9 +195,9 @@ void WebGLFramebuffer::initializeRenderbuffers()
}
if (initStencil) {
g3d->getIntegerv(GraphicsContext3D::STENCIL_CLEAR_VALUE, &stencilClearValue);
- g3d->getBooleanv(GraphicsContext3D::STENCIL_WRITEMASK, &stencilMask);
+ g3d->getIntegerv(GraphicsContext3D::STENCIL_WRITEMASK, reinterpret_cast<int*>(&stencilMask));
g3d->clearStencil(0);
- g3d->stencilMask(true);
+ g3d->stencilMask(0xffffffff);
}
isScissorEnabled = g3d->isEnabled(GraphicsContext3D::SCISSOR_TEST);
g3d->disable(GraphicsContext3D::SCISSOR_TEST);
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index a8751da..0b89cce 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -878,6 +878,9 @@ bool WebGLRenderingContext::validateRenderingState(long numElementsRequired)
return false;
}
+ if (numElementsRequired <= 0)
+ return true;
+
// Look in each consumed vertex attrib (by the current program) and find the smallest buffer size
long smallestNumElements = LONG_MAX;
int numActiveAttribLocations = m_currentProgram->numActiveAttribLocations();
@@ -930,6 +933,9 @@ void WebGLRenderingContext::drawArrays(unsigned long mode, long first, long coun
return;
}
+ if (!count)
+ return;
+
if (!isErrorGeneratedOnOutOfBoundsAccesses()) {
// Ensure we have a valid rendering state
CheckedInt<int32_t> checkedFirst(first);
@@ -939,6 +945,11 @@ void WebGLRenderingContext::drawArrays(unsigned long mode, long first, long coun
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
+ } else {
+ if (!validateRenderingState(0)) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return;
+ }
}
bool vertexAttrib0Simulated = false;
@@ -975,6 +986,9 @@ void WebGLRenderingContext::drawElements(unsigned long mode, long count, unsigne
return;
}
+ if (!count)
+ return;
+
long numElements = 0;
if (!isErrorGeneratedOnOutOfBoundsAccesses()) {
// Ensure we have a valid rendering state
@@ -990,6 +1004,11 @@ void WebGLRenderingContext::drawElements(unsigned long mode, long count, unsigne
return;
}
}
+ } else {
+ if (!validateRenderingState(0)) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return;
+ }
}
bool vertexAttrib0Simulated = false;
@@ -1138,7 +1157,20 @@ void WebGLRenderingContext::generateMipmap(unsigned long target)
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
+ // generateMipmap won't work properly if minFilter is not NEAREST_MIPMAP_LINEAR
+ // on Mac. Remove the hack once this driver bug is fixed.
+#if OS(DARWIN)
+ bool needToResetMinFilter = false;
+ if (tex->getMinFilter() != GraphicsContext3D::NEAREST_MIPMAP_LINEAR) {
+ m_context->texParameteri(target, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::NEAREST_MIPMAP_LINEAR);
+ needToResetMinFilter = true;
+ }
+#endif
m_context->generateMipmap(target);
+#if OS(DARWIN)
+ if (needToResetMinFilter)
+ m_context->texParameteri(target, GraphicsContext3D::TEXTURE_MIN_FILTER, tex->getMinFilter());
+#endif
tex->generateMipmapLevelInfo();
cleanupAfterGraphicsCall(false);
}
@@ -1266,6 +1298,8 @@ WebGLGetInfo WebGLRenderingContext::getFramebufferAttachmentParameter(unsigned l
WebGLStateRestorer(this, false);
int type = 0;
m_context->getFramebufferAttachmentParameteriv(target, attachment, GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &type);
+ if (!type)
+ return WebGLGetInfo();
int value = 0;
m_context->getFramebufferAttachmentParameteriv(target, attachment, GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &value);
switch (type) {
diff --git a/WebCore/html/canvas/WebGLRenderingContext.h b/WebCore/html/canvas/WebGLRenderingContext.h
index c4c856c..ce66f6a 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/WebCore/html/canvas/WebGLRenderingContext.h
@@ -323,6 +323,7 @@ public:
// Precise but slow index validation -- only done if conservative checks fail
bool validateIndexArrayPrecise(unsigned long count, unsigned long type, long offset, long& numElementsRequired);
+ // If numElements <= 0, we only check if each enabled vertex attribute is bound to a buffer.
bool validateRenderingState(long numElements);
bool validateWebGLObject(WebGLObject* object);
diff --git a/WebCore/html/canvas/WebGLTexture.h b/WebCore/html/canvas/WebGLTexture.h
index 191957d..6ee3dcc 100644
--- a/WebCore/html/canvas/WebGLTexture.h
+++ b/WebCore/html/canvas/WebGLTexture.h
@@ -44,6 +44,8 @@ public:
void setParameteri(unsigned long pname, int param);
void setParameterf(unsigned long pname, float param);
+ int getMinFilter() const { return m_minFilter; }
+
void setLevelInfo(unsigned long target, int level, unsigned long internalFormat, int width, int height, unsigned long type);
bool canGenerateMipmaps();
diff --git a/WebCore/html/parser/HTMLElementStack.cpp b/WebCore/html/parser/HTMLElementStack.cpp
index 6b96291..6aab0f7 100644
--- a/WebCore/html/parser/HTMLElementStack.cpp
+++ b/WebCore/html/parser/HTMLElementStack.cpp
@@ -32,10 +32,6 @@
#include "SVGNames.h"
#include <wtf/PassOwnPtr.h>
-#if ENABLE(SVG)
-#include "SVGNames.h"
-#endif
-
namespace WebCore {
using namespace HTMLNames;
@@ -56,15 +52,21 @@ inline bool isScopeMarker(Element* element)
{
return element->hasTagName(appletTag)
|| element->hasTagName(captionTag)
-#if ENABLE(SVG_FOREIGN_OBJECT)
- || element->hasTagName(SVGNames::foreignObjectTag)
-#endif
|| element->hasTagName(htmlTag)
|| element->hasTagName(marqueeTag)
|| element->hasTagName(objectTag)
|| element->hasTagName(tableTag)
|| element->hasTagName(tdTag)
- || element->hasTagName(thTag);
+ || element->hasTagName(thTag)
+ || element->hasTagName(MathMLNames::miTag)
+ || element->hasTagName(MathMLNames::moTag)
+ || element->hasTagName(MathMLNames::mnTag)
+ || element->hasTagName(MathMLNames::msTag)
+ || element->hasTagName(MathMLNames::mtextTag)
+ || element->hasTagName(MathMLNames::annotation_xmlTag)
+ || element->hasTagName(SVGNames::foreignObjectTag)
+ || element->hasTagName(SVGNames::descTag)
+ || element->hasTagName(SVGNames::titleTag);
}
inline bool isListItemScopeMarker(Element* element)
diff --git a/WebCore/html/parser/HTMLParserIdioms.cpp b/WebCore/html/parser/HTMLParserIdioms.cpp
index f093eb2..0ce5e4d 100644
--- a/WebCore/html/parser/HTMLParserIdioms.cpp
+++ b/WebCore/html/parser/HTMLParserIdioms.cpp
@@ -83,6 +83,11 @@ bool parseToDoubleForNumberType(const String& string, double* result)
if (!isfinite(value))
return false;
+ // Numbers are considered finite IEEE 754 single-precision floating point values.
+ // See HTML5 2.4.4.3 `Real numbers.'
+ if (-FLT_MAX > value || value > FLT_MAX)
+ return false;
+
if (result) {
// The following expression converts -0 to +0.
*result = value ? value : 0;
diff --git a/WebCore/html/parser/HTMLScriptRunner.cpp b/WebCore/html/parser/HTMLScriptRunner.cpp
index 4f54f42..75db644 100644
--- a/WebCore/html/parser/HTMLScriptRunner.cpp
+++ b/WebCore/html/parser/HTMLScriptRunner.cpp
@@ -35,6 +35,7 @@
#include "HTMLScriptRunnerHost.h"
#include "HTMLInputStream.h"
#include "HTMLNames.h"
+#include "IgnoreDestructiveWriteCountIncrementer.h"
#include "NestingLevelIncrementer.h"
#include "NotImplemented.h"
#include "ScriptElement.h"
@@ -135,6 +136,7 @@ void HTMLScriptRunner::executePendingScriptAndDispatchEvent(PendingScript& pendi
RefPtr<Element> scriptElement = pendingScript.releaseElementAndClear();
{
NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel);
+ IgnoreDestructiveWriteCountIncrementer ignoreDestructiveWriteCountIncrementer(m_document);
if (errorOccurred)
scriptElement->dispatchEvent(createScriptErrorEvent());
else {
diff --git a/WebCore/html/parser/HTMLTreeBuilder.cpp b/WebCore/html/parser/HTMLTreeBuilder.cpp
index 5f90285..310ff60 100644
--- a/WebCore/html/parser/HTMLTreeBuilder.cpp
+++ b/WebCore/html/parser/HTMLTreeBuilder.cpp
@@ -105,7 +105,15 @@ bool isTableBodyContextTag(const AtomicString& tagName)
// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#special
bool isSpecialNode(Node* node)
{
- if (node->hasTagName(SVGNames::foreignObjectTag))
+ if (node->hasTagName(MathMLNames::miTag)
+ || node->hasTagName(MathMLNames::moTag)
+ || node->hasTagName(MathMLNames::mnTag)
+ || node->hasTagName(MathMLNames::msTag)
+ || node->hasTagName(MathMLNames::mtextTag)
+ || node->hasTagName(MathMLNames::annotation_xmlTag)
+ || node->hasTagName(SVGNames::foreignObjectTag)
+ || node->hasTagName(SVGNames::descTag)
+ || node->hasTagName(SVGNames::titleTag))
return true;
if (node->namespaceURI() != xhtmlNamespaceURI)
return false;
@@ -331,11 +339,11 @@ HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, HTMLDocument* documen
, m_isPaused(false)
, m_insertionMode(InitialMode)
, m_originalInsertionMode(InitialMode)
- , m_secondaryInsertionMode(InitialMode)
, m_tokenizer(tokenizer)
, m_scriptToProcessStartLine(uninitializedLineNumberValue)
, m_lastScriptElementStartLine(uninitializedLineNumberValue)
, m_usePreHTML5ParserQuirks(usePreHTML5ParserQuirks)
+ , m_hasPendingForeignInsertionModeSteps(false)
{
}
@@ -350,11 +358,11 @@ HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, DocumentFragment* fra
, m_isPaused(false)
, m_insertionMode(InitialMode)
, m_originalInsertionMode(InitialMode)
- , m_secondaryInsertionMode(InitialMode)
, m_tokenizer(tokenizer)
, m_scriptToProcessStartLine(uninitializedLineNumberValue)
, m_lastScriptElementStartLine(uninitializedLineNumberValue)
, m_usePreHTML5ParserQuirks(usePreHTML5ParserQuirks)
+ , m_hasPendingForeignInsertionModeSteps(false)
{
if (contextElement) {
// Steps 4.2-4.6 of the HTML5 Fragment Case parsing algorithm:
@@ -815,7 +823,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
if (m_tree.openElements()->inScope(buttonTag)) {
parseError(token);
processFakeEndTag(buttonTag);
- processStartTag(token); // FIXME: Could we just fall through here?
+ reprocessStartTag(token); // FIXME: Could we just fall through here?
return;
}
m_tree.reconstructTheActiveFormattingElements();
@@ -872,6 +880,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
parseError(token);
// Apparently we're not supposed to ask.
token.setName(imgTag.localName());
+ prepareToReprocessToken();
// Note the fall through to the imgTag handling below!
}
if (token.name() == areaTag
@@ -971,10 +980,8 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
adjustMathMLAttributes(token);
adjustForeignAttributes(token);
m_tree.insertForeignElement(token, MathMLNames::mathmlNamespaceURI);
- if (m_insertionMode != InForeignContentMode) {
- setSecondaryInsertionMode(m_insertionMode);
+ if (m_insertionMode != InForeignContentMode)
setInsertionMode(InForeignContentMode);
- }
return;
}
if (token.name() == SVGNames::svgTag.localName()) {
@@ -982,10 +989,8 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
adjustSVGAttributes(token);
adjustForeignAttributes(token);
m_tree.insertForeignElement(token, SVGNames::svgNamespaceURI);
- if (m_insertionMode != InForeignContentMode) {
- setSecondaryInsertionMode(m_insertionMode);
+ if (m_insertionMode != InForeignContentMode)
setInsertionMode(InForeignContentMode);
- }
return;
}
if (isCaptionColOrColgroupTag(token.name())
@@ -1046,7 +1051,7 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token)
if (token.name() == colTag) {
processFakeStartTag(colgroupTag);
ASSERT(InColumnGroupMode);
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
if (isTableBodyContextTag(token.name())) {
@@ -1059,7 +1064,7 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token)
|| token.name() == trTag) {
processFakeStartTag(tbodyTag);
ASSERT(insertionMode() == InTableBodyMode);
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
if (token.name() == tableTag) {
@@ -1068,7 +1073,7 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token)
ASSERT(isParsingFragment());
return;
}
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
if (token.name() == styleTag || token.name() == scriptTag) {
@@ -1099,7 +1104,7 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token)
namespace {
-bool shouldProcessUsingSecondaryInsertionMode(AtomicHTMLToken& token, Element* currentElement)
+bool shouldProcessForeignContentUsingInBodyInsertionMode(AtomicHTMLToken& token, Element* currentElement)
{
ASSERT(token.type() == HTMLToken::StartTag);
if (currentElement->hasTagName(MathMLNames::miTag)
@@ -1215,7 +1220,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
ASSERT(isParsingFragment());
return;
}
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
processStartTagForInBody(token);
@@ -1234,7 +1239,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
ASSERT(isParsingFragment());
return;
}
- processStartTag(token);
+ reprocessStartTag(token);
break;
case InTableBodyMode:
ASSERT(insertionMode() == InTableBodyMode);
@@ -1248,7 +1253,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
parseError(token);
processFakeStartTag(trTag);
ASSERT(insertionMode() == InRowMode);
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
if (isCaptionColOrColgroupTag(token.name()) || isTableBodyContextTag(token.name())) {
@@ -1261,7 +1266,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
m_tree.openElements()->popUntilTableBodyScopeMarker();
ASSERT(isTableBodyContextTag(m_tree.currentElement()->localName()));
processFakeEndTag(m_tree.currentElement()->tagQName());
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
processStartTagForInTable(token);
@@ -1283,7 +1288,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
return;
}
ASSERT(insertionMode() == InTableBodyMode);
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
processStartTagForInTable(token);
@@ -1301,7 +1306,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
return;
}
closeTheCell();
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
processStartTagForInBody(token);
@@ -1314,7 +1319,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
return;
}
setInsertionMode(InBodyMode);
- processStartTag(token);
+ reprocessStartTag(token);
break;
case InHeadNoscriptMode:
ASSERT(insertionMode() == InHeadNoscriptMode);
@@ -1382,7 +1387,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
parseError(token);
AtomicHTMLToken endSelect(HTMLToken::EndTag, selectTag.localName());
processEndTag(endSelect);
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
// Fall through
@@ -1428,7 +1433,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
}
AtomicHTMLToken endSelect(HTMLToken::EndTag, selectTag.localName());
processEndTag(endSelect);
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
if (token.name() == scriptTag) {
@@ -1442,8 +1447,8 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
processStartTag(token);
break;
case InForeignContentMode: {
- if (shouldProcessUsingSecondaryInsertionMode(token, m_tree.currentElement())) {
- processUsingSecondaryInsertionModeAndAdjustInsertionMode(token);
+ if (shouldProcessForeignContentUsingInBodyInsertionMode(token, m_tree.currentElement())) {
+ processForeignContentUsingInBodyModeAndResetMode(token);
return;
}
if (token.name() == bTag
@@ -1488,15 +1493,14 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
|| (token.name() == fontTag && (token.getAttributeItem(colorAttr) || token.getAttributeItem(faceAttr) || token.getAttributeItem(sizeAttr)))) {
parseError(token);
m_tree.openElements()->popUntilForeignContentScopeMarker();
- if (insertionMode() == InForeignContentMode && m_tree.openElements()->hasOnlyHTMLElementsInScope())
- setInsertionMode(m_secondaryInsertionMode);
- processStartTag(token);
+ resetInsertionModeAppropriately();
+ reprocessStartTag(token);
return;
}
const AtomicString& currentNamespace = m_tree.currentElement()->namespaceURI();
if (currentNamespace == MathMLNames::mathmlNamespaceURI)
adjustMathMLAttributes(token);
- if (currentNamespace == SVGNames::svgNamespaceURI) {
+ if (currentNamespace == SVGNames::svgNamespaceURI) {
adjustSVGTagNameCase(token);
adjustSVGAttributes(token);
}
@@ -1679,26 +1683,10 @@ void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
}
}
-void HTMLTreeBuilder::setSecondaryInsertionMode(InsertionMode mode)
-{
- ASSERT(mode != InForeignContentMode);
- m_secondaryInsertionMode = mode;
-}
-
-void HTMLTreeBuilder::setInsertionModeAndEnd(InsertionMode newInsertionMode, bool foreign)
-{
- setInsertionMode(newInsertionMode);
- if (foreign) {
- setSecondaryInsertionMode(m_insertionMode);
- setInsertionMode(InForeignContentMode);
- }
-}
-
void HTMLTreeBuilder::resetInsertionModeAppropriately()
{
// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#reset-the-insertion-mode-appropriately
bool last = false;
- bool foreign = false;
HTMLElementStack::ElementRecord* nodeRecord = m_tree.openElements()->topRecord();
while (1) {
Element* node = nodeRecord->element();
@@ -1709,42 +1697,42 @@ void HTMLTreeBuilder::resetInsertionModeAppropriately()
}
if (node->hasTagName(selectTag)) {
ASSERT(isParsingFragment());
- return setInsertionModeAndEnd(InSelectMode, foreign);
+ return setInsertionMode(InSelectMode);
}
if (node->hasTagName(tdTag) || node->hasTagName(thTag))
- return setInsertionModeAndEnd(InCellMode, foreign);
+ return setInsertionMode(InCellMode);
if (node->hasTagName(trTag))
- return setInsertionModeAndEnd(InRowMode, foreign);
- if (isTableBodyContextTag(node->localName()))
- return setInsertionModeAndEnd(InTableBodyMode, foreign);
+ return setInsertionMode(InRowMode);
+ if (node->hasTagName(tbodyTag) || node->hasTagName(theadTag) || node->hasTagName(tfootTag))
+ return setInsertionMode(InTableBodyMode);
if (node->hasTagName(captionTag))
- return setInsertionModeAndEnd(InCaptionMode, foreign);
+ return setInsertionMode(InCaptionMode);
if (node->hasTagName(colgroupTag)) {
ASSERT(isParsingFragment());
- return setInsertionModeAndEnd(InColumnGroupMode, foreign);
+ return setInsertionMode(InColumnGroupMode);
}
if (node->hasTagName(tableTag))
- return setInsertionModeAndEnd(InTableMode, foreign);
+ return setInsertionMode(InTableMode);
if (node->hasTagName(headTag)) {
ASSERT(isParsingFragment());
- return setInsertionModeAndEnd(InBodyMode, foreign);
+ return setInsertionMode(InBodyMode);
}
if (node->hasTagName(bodyTag))
- return setInsertionModeAndEnd(InBodyMode, foreign);
+ return setInsertionMode(InBodyMode);
if (node->hasTagName(framesetTag)) {
ASSERT(isParsingFragment());
- return setInsertionModeAndEnd(InFramesetMode, foreign);
+ return setInsertionMode(InFramesetMode);
}
if (node->hasTagName(htmlTag)) {
ASSERT(isParsingFragment());
- return setInsertionModeAndEnd(BeforeHeadMode, foreign);
+ return setInsertionMode(BeforeHeadMode);
}
if (node->namespaceURI() == SVGNames::svgNamespaceURI
|| node->namespaceURI() == MathMLNames::mathmlNamespaceURI)
- foreign = true;
+ return setInsertionMode(InForeignContentMode);
if (last) {
ASSERT(isParsingFragment());
- return setInsertionModeAndEnd(InBodyMode, foreign);
+ return setInsertionMode(InBodyMode);
}
nodeRecord = nodeRecord->next();
}
@@ -1773,7 +1761,7 @@ void HTMLTreeBuilder::processEndTagForInTableBody(AtomicHTMLToken& token)
m_tree.openElements()->popUntilTableBodyScopeMarker();
ASSERT(isTableBodyContextTag(m_tree.currentElement()->localName()));
processFakeEndTag(m_tree.currentElement()->tagQName());
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
if (token.name() == bodyTag
@@ -1800,7 +1788,7 @@ void HTMLTreeBuilder::processEndTagForInRow(AtomicHTMLToken& token)
return;
}
ASSERT(insertionMode() == InTableBodyMode);
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
if (isTableBodyContextTag(token.name())) {
@@ -1810,7 +1798,7 @@ void HTMLTreeBuilder::processEndTagForInRow(AtomicHTMLToken& token)
}
processFakeEndTag(trTag);
ASSERT(insertionMode() == InTableBodyMode);
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
if (token.name() == bodyTag
@@ -1854,7 +1842,7 @@ void HTMLTreeBuilder::processEndTagForInCell(AtomicHTMLToken& token)
return;
}
closeTheCell();
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
processEndTagForInBody(token);
@@ -1870,7 +1858,7 @@ void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken& token)
if (token.name() == htmlTag) {
AtomicHTMLToken endBody(HTMLToken::EndTag, bodyTag.localName());
if (processBodyEndTagForInBody(endBody))
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
if (token.name() == addressTag
@@ -1923,7 +1911,7 @@ void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken& token)
parseError(token);
processFakeStartTag(pTag);
ASSERT(m_tree.openElements()->inScope(token.name()));
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
m_tree.generateImpliedEndTagsWithExclusion(token.name());
@@ -2119,7 +2107,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
ASSERT(isParsingFragment());
return;
}
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
if (token.name() == bodyTag
@@ -2148,7 +2136,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
ASSERT(isParsingFragment());
return;
}
- processEndTag(token);
+ reprocessEndTag(token);
break;
case InRowMode:
ASSERT(insertionMode() == InRowMode);
@@ -2172,12 +2160,13 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
setInsertionMode(AfterAfterBodyMode);
return;
}
+ prepareToReprocessToken();
// Fall through.
case AfterAfterBodyMode:
ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
parseError(token);
setInsertionMode(InBodyMode);
- processEndTag(token);
+ reprocessEndTag(token);
break;
case InHeadNoscriptMode:
ASSERT(insertionMode() == InHeadNoscriptMode);
@@ -2253,7 +2242,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
if (m_tree.openElements()->inTableScope(token.name())) {
AtomicHTMLToken endSelect(HTMLToken::EndTag, selectTag.localName());
processEndTag(endSelect);
- processEndTag(token);
+ reprocessEndTag(token);
}
return;
}
@@ -2314,11 +2303,31 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
}
}
// Any other end tag (also the last two steps of "An end tag, if the current node is not an element in the HTML namespace."
- processUsingSecondaryInsertionModeAndAdjustInsertionMode(token);
+ processForeignContentUsingInBodyModeAndResetMode(token);
break;
}
}
+void HTMLTreeBuilder::prepareToReprocessToken()
+{
+ if (m_hasPendingForeignInsertionModeSteps) {
+ resetForeignInsertionMode();
+ m_hasPendingForeignInsertionModeSteps = false;
+ }
+}
+
+void HTMLTreeBuilder::reprocessStartTag(AtomicHTMLToken& token)
+{
+ prepareToReprocessToken();
+ processStartTag(token);
+}
+
+void HTMLTreeBuilder::reprocessEndTag(AtomicHTMLToken& token)
+{
+ prepareToReprocessToken();
+ processEndTag(token);
+}
+
class HTMLTreeBuilder::FakeInsertionMode : public Noncopyable {
public:
FakeInsertionMode(HTMLTreeBuilder* treeBuilder, InsertionMode mode)
@@ -2339,18 +2348,21 @@ private:
InsertionMode m_originalMode;
};
-// This handles both secondary insertion mode processing, as well as updating
-// the insertion mode. These are separate steps in the spec, but always occur
-// right after one another.
-void HTMLTreeBuilder::processUsingSecondaryInsertionModeAndAdjustInsertionMode(AtomicHTMLToken& token)
+void HTMLTreeBuilder::processForeignContentUsingInBodyModeAndResetMode(AtomicHTMLToken& token)
{
- ASSERT(token.type() == HTMLToken::StartTag || token.type() == HTMLToken::EndTag);
+ m_hasPendingForeignInsertionModeSteps = true;
{
- FakeInsertionMode fakeMode(this, m_secondaryInsertionMode);
+ FakeInsertionMode fakeMode(this, InBodyMode);
processToken(token);
}
- if (insertionMode() == InForeignContentMode && m_tree.openElements()->hasOnlyHTMLElementsInScope())
- setInsertionMode(m_secondaryInsertionMode);
+ if (m_hasPendingForeignInsertionModeSteps)
+ resetForeignInsertionMode();
+}
+
+void HTMLTreeBuilder::resetForeignInsertionMode()
+{
+ if (insertionMode() == InForeignContentMode)
+ resetInsertionModeAppropriately();
}
void HTMLTreeBuilder::processComment(AtomicHTMLToken& token)
@@ -2448,6 +2460,7 @@ ReprocessBuffer:
ASSERT(m_pendingTableCharacters.isEmpty());
m_originalInsertionMode = m_insertionMode;
setInsertionMode(InTableTextMode);
+ prepareToReprocessToken();
// Fall through.
}
case InTableTextMode: {
@@ -2468,6 +2481,7 @@ ReprocessBuffer:
if (buffer.isEmpty())
return;
}
+ prepareToReprocessToken();
goto ReprocessBuffer;
}
case AfterBodyMode:
@@ -2475,6 +2489,7 @@ ReprocessBuffer:
ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
// FIXME: parse error
setInsertionMode(InBodyMode);
+ prepareToReprocessToken();
goto ReprocessBuffer;
break;
}
@@ -2593,16 +2608,11 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
ASSERT(isParsingFragment());
return;
}
+ prepareToReprocessToken();
processEndOfFile(token);
return;
case InForeignContentMode:
- parseError(token);
- m_tree.openElements()->popUntilForeignContentScopeMarker();
- // FIXME: The spec adds the following condition before setting the
- // insertion mode. However, this condition causes an infinite loop.
- // See http://www.w3.org/Bugs/Public/show_bug.cgi?id=10621
- // if (insertionMode() == InForeignContentMode && m_tree.openElements()->hasOnlyHTMLElementsInScope())
- setInsertionMode(m_secondaryInsertionMode);
+ setInsertionMode(InBodyMode);
processEndOfFile(token);
return;
case InTableTextMode:
@@ -2615,6 +2625,7 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
notImplemented(); // mark the script element as "already started".
m_tree.openElements()->pop();
setInsertionMode(m_originalInsertionMode);
+ prepareToReprocessToken();
processEndOfFile(token);
return;
}
@@ -2629,6 +2640,7 @@ void HTMLTreeBuilder::defaultForInitial()
m_document->setCompatibilityMode(Document::QuirksMode);
// FIXME: parse error
setInsertionMode(BeforeHTMLMode);
+ prepareToReprocessToken();
}
void HTMLTreeBuilder::defaultForBeforeHTML()
@@ -2636,24 +2648,28 @@ void HTMLTreeBuilder::defaultForBeforeHTML()
AtomicHTMLToken startHTML(HTMLToken::StartTag, htmlTag.localName());
m_tree.insertHTMLHtmlStartTagBeforeHTML(startHTML);
setInsertionMode(BeforeHeadMode);
+ prepareToReprocessToken();
}
void HTMLTreeBuilder::defaultForBeforeHead()
{
AtomicHTMLToken startHead(HTMLToken::StartTag, headTag.localName());
processStartTag(startHead);
+ prepareToReprocessToken();
}
void HTMLTreeBuilder::defaultForInHead()
{
AtomicHTMLToken endHead(HTMLToken::EndTag, headTag.localName());
processEndTag(endHead);
+ prepareToReprocessToken();
}
void HTMLTreeBuilder::defaultForInHeadNoscript()
{
AtomicHTMLToken endNoscript(HTMLToken::EndTag, noscriptTag.localName());
processEndTag(endNoscript);
+ prepareToReprocessToken();
}
void HTMLTreeBuilder::defaultForAfterHead()
@@ -2661,6 +2677,7 @@ void HTMLTreeBuilder::defaultForAfterHead()
AtomicHTMLToken startBody(HTMLToken::StartTag, bodyTag.localName());
processStartTag(startBody);
m_framesetOk = true;
+ prepareToReprocessToken();
}
void HTMLTreeBuilder::defaultForInTableText()
@@ -2673,10 +2690,12 @@ void HTMLTreeBuilder::defaultForInTableText()
m_tree.insertTextNode(characters);
m_framesetOk = false;
setInsertionMode(m_originalInsertionMode);
+ prepareToReprocessToken();
return;
}
m_tree.insertTextNode(characters);
setInsertionMode(m_originalInsertionMode);
+ prepareToReprocessToken();
}
bool HTMLTreeBuilder::processStartTagForInHead(AtomicHTMLToken& token)
diff --git a/WebCore/html/parser/HTMLTreeBuilder.h b/WebCore/html/parser/HTMLTreeBuilder.h
index e61fe73..c6fcdfd 100644
--- a/WebCore/html/parser/HTMLTreeBuilder.h
+++ b/WebCore/html/parser/HTMLTreeBuilder.h
@@ -163,7 +163,10 @@ private:
void defaultForAfterHead();
void defaultForInTableText();
- void processUsingSecondaryInsertionModeAndAdjustInsertionMode(AtomicHTMLToken&);
+ void prepareToReprocessToken();
+
+ void reprocessStartTag(AtomicHTMLToken&);
+ void reprocessEndTag(AtomicHTMLToken&);
PassRefPtr<NamedNodeMap> attributesForIsindexInput(AtomicHTMLToken&);
@@ -194,11 +197,11 @@ private:
m_isFakeInsertionMode = true;
}
- void setSecondaryInsertionMode(InsertionMode);
-
- void setInsertionModeAndEnd(InsertionMode, bool foreign); // Helper for resetInsertionModeAppropriately
void resetInsertionModeAppropriately();
+ void processForeignContentUsingInBodyModeAndResetMode(AtomicHTMLToken& token);
+ void resetForeignInsertionMode();
+
class FragmentParsingContext : public Noncopyable {
public:
FragmentParsingContext();
@@ -236,7 +239,6 @@ private:
// setInsertionMode and never set m_insertionMode directly.
InsertionMode m_insertionMode;
InsertionMode m_originalInsertionMode;
- InsertionMode m_secondaryInsertionMode;
// http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#pending-table-character-tokens
Vector<UChar> m_pendingTableCharacters;
@@ -252,8 +254,10 @@ private:
// created to service the legacy tree builder, but it seems to be used for
// some other things now.
int m_lastScriptElementStartLine;
-
+
bool m_usePreHTML5ParserQuirks;
+
+ bool m_hasPendingForeignInsertionModeSteps;
};
}
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index 85c30a8..331e504 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -94,12 +94,7 @@ module core {
// This method is going to be broken down into smaller parts.
[handler=Controller] void populateScriptObjects();
- [handler=Controller] void getSettings(out Object settings);
[handler=Controller] void getInspectorState(out Object state);
- [handler=Controller] void storeLastActivePanel(in String panelName);
-
- [handler=Controller] void saveApplicationSettings(in String settings);
- [handler=Controller] void saveSessionSettings(in String settings);
[handler=Controller] void setSearchingForNode(in boolean enabled, out boolean newState);
@@ -112,19 +107,19 @@ module core {
[handler=Controller] void startTimelineProfiler();
[handler=Controller] void stopTimelineProfiler();
- [handler=Resource] void cachedResources(out Array resources);
- [handler=Resource] void resourceContent(in unsigned long frameID, in String url, out String content);
- [notify] void identifierForInitialRequest(out long identifier, out String url, out unsigned long frameID, out boolean isMainResource);
+ [handler=Resource] void cachedResources(out Object resources);
+ [handler=Resource] void resourceContent(in unsigned long frameId, in String url, in boolean base64Encode, out String content);
+ [notify] void identifierForInitialRequest(out long identifier, out String url, out Object loader);
[notify] void willSendRequest(out long identifier, out double time, out Object request, out Object redirectResponse);
[notify] void markResourceAsCached(out long identifier);
[notify] void didReceiveResponse(out long identifier, out double time, out String resourceType, out Object response);
[notify] void didReceiveContentLength(out long identifier, out double time, out long lengthReceived);
[notify] void didFinishLoading(out long identifier, out double finishTime);
[notify] void didFailLoading(out long identifier, out double time, out String localizedDescription);
- [notify] void didLoadResourceFromMemoryCache(out double time, out unsigned long frameID, out Object resource);
+ [notify] void didLoadResourceFromMemoryCache(out double time, out Object resource);
[notify] void setOverrideContent(out long identifier, out String sourceString, out String type);
- [notify] void didCommitLoad(out unsigned long frameID);
- [notify] void frameDetachedFromParent(out unsigned long frameID);
+ [notify] void didCommitLoadForFrame(out unsigned long parentFrameId, out Object loader);
+ [notify] void frameDetachedFromParent(out unsigned long frameId);
[notify] void didCreateWebSocket(out unsigned long identifier, out String requestURL);
[notify] void willSendWebSocketHandshakeRequest(out unsigned long identifier, out double time, out Object request);
diff --git a/WebCore/inspector/InspectorCSSAgent.cpp b/WebCore/inspector/InspectorCSSAgent.cpp
index e0fab85..d1f7412 100644
--- a/WebCore/inspector/InspectorCSSAgent.cpp
+++ b/WebCore/inspector/InspectorCSSAgent.cpp
@@ -49,7 +49,8 @@
#include <wtf/Vector.h>
#include <wtf/text/CString.h>
-
+// Currently implemented model:
+//
// cssProperty = {
// name : <string>,
// value : <string>,
@@ -62,85 +63,57 @@
// endOffset : <number>, // Optional - property text end offset in enclosing style declaration. Absent for computed styles and such.
// }
//
+// name + value + priority : present when the property is enabled
+// text : present when the property is disabled
+//
+// For disabled properties, startOffset === endOffset === insertion point for the property.
+//
// status:
// "disabled" == property disabled by user
// "active" == property participates in the computed style calculation
// "inactive" == property does no participate in the computed style calculation (i.e. overridden by a subsequent property with the same name)
// "style" == property is active and originates from the WebCore CSSStyleDeclaration rather than CSS source code (e.g. implicit longhand properties)
//
-//
// cssStyle = {
-// styleId : <number>, // Optional
-// styleSheetId : <number>, // Parent: -1 for inline styles (<foo style="..">)
-// cssProperties : [
+// styleId : <string>, // Optional
+// cssProperties : [
// #cssProperty,
// ...
// #cssProperty
-// ],
-// shorthandValues : {
+// ],
+// shorthandValues : {
// shorthandName1 : shorthandValue1,
// shorthandName2 : shorthandValue2
-// },
-// cssText : <string>, // declaration text
-// properties : { } // ???
+// },
+// cssText : <string>, // Optional - declaration text
+// properties : { width, height }
// }
//
-// // TODO:
-// // - convert disabledProperties to enabled flag.
-// // - convert width, height to properties
-//
// cssRule = {
-// ruleId : <number>,
-// selectorText : <string>
-// sourceURL : <string>
-// sourceLine : <string>
-// styleSheetId : <number> // also found in style
-// origin : <string> // "" || "user-agent" || "user" || "inspector"
+// ruleId : <string>, // Optional
+// selectorText : <string>,
+// sourceURL : <string>,
+// sourceLine : <string>,
+// origin : <string>, // "" || "user-agent" || "user" || "inspector"
// style : #cssStyle
// }
//
-// // TODO:
-// // - fix origin
-// // - add sourceURL
-// // - fix parentStyleSheetId
-//
// cssStyleSheet = {
// styleSheetId : <number>
-// href : <string>
+// sourceURL : <string>
// title : <string>
// disabled : <boolean>
-// documentNodeId : <number>
// rules : [
// #cssRule,
// ...
// #cssRule
// ]
+// text : <string> // Optional - whenever the text is available for a text-based stylesheet
// }
namespace WebCore {
// static
-PassRefPtr<InspectorObject> InspectorCSSAgent::buildObjectForStyle(CSSStyleDeclaration* style, const String& fullStyleId, CSSStyleSourceData* sourceData)
-{
- RefPtr<InspectorObject> result = InspectorObject::create();
- if (!fullStyleId.isEmpty())
- result->setString("id", fullStyleId);
-
- result->setString("width", style->getPropertyValue("width"));
- result->setString("height", style->getPropertyValue("height"));
- Vector<CSSPropertySourceData>* propertyData = 0;
-
- if (sourceData) {
- result->setNumber("startOffset", sourceData->styleBodyRange.start);
- result->setNumber("endOffset", sourceData->styleBodyRange.end);
- propertyData = &sourceData->propertyData;
- }
- populateObjectWithStyleProperties(style, result.get(), propertyData);
-
- return result.release();
-}
-
-// static
CSSStyleSheet* InspectorCSSAgent::parentStyleSheet(StyleBase* styleBase)
{
if (!styleBase)
@@ -164,7 +137,6 @@ CSSStyleRule* InspectorCSSAgent::asCSSStyleRule(StyleBase* styleBase)
return static_cast<CSSStyleRule*>(rule);
}
-
InspectorCSSAgent::InspectorCSSAgent(InspectorDOMAgent* domAgent, InspectorFrontend* frontend)
: m_domAgent(domAgent)
, m_frontend(frontend)
@@ -246,7 +218,10 @@ void InspectorCSSAgent::getComputedStyleForNode2(long nodeId, RefPtr<InspectorVa
if (!defaultView)
return;
- *style = buildObjectForStyle(defaultView->getComputedStyle(element, "").get(), "");
+ RefPtr<CSSStyleDeclaration> computedStyle = defaultView->getComputedStyle(element, "");
+ Vector<InspectorStyleProperty> properties;
+ RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSId(), computedStyle.get(), 0);
+ *style = inspectorStyle->buildObjectForStyle();
}
void InspectorCSSAgent::getInheritedStylesForNode2(long nodeId, RefPtr<InspectorArray>* style)
@@ -263,7 +238,7 @@ void InspectorCSSAgent::getInheritedStylesForNode2(long nodeId, RefPtr<Inspector
if (parentElement->style() && parentElement->style()->length()) {
InspectorStyleSheetForInlineStyle* styleSheet = asInspectorStyleSheet(element);
if (styleSheet)
- parentStyle->setObject("inlineStyle", styleSheet->buildObjectForStyle(styleSheet->styleForId("0")));
+ parentStyle->setObject("inlineStyle", styleSheet->buildObjectForStyle(styleSheet->styleForId(InspectorCSSId::createFromParts(styleSheet->id(), "0"))));
}
CSSStyleSelector* parentSelector = parentElement->ownerDocument()->styleSelector();
@@ -308,43 +283,48 @@ void InspectorCSSAgent::setStyleSheetText2(const String& styleSheetId, const Str
inspectorStyleSheet->setText(text);
}
-void InspectorCSSAgent::setStyleText2(const String& fullStyleId, const String& text, RefPtr<InspectorValue>* result)
+void InspectorCSSAgent::setPropertyText2(const String& fullStyleId, long propertyIndex, const String& text, bool overwrite, RefPtr<InspectorValue>* result)
{
- Vector<String> idParts;
- fullStyleId.split(':', idParts);
- ASSERT(idParts.size() == 2);
+ InspectorCSSId compoundId(fullStyleId);
+ ASSERT(!compoundId.isEmpty());
- InspectorStyleSheet* inspectorStyleSheet = styleSheetForId(idParts.at(0));
+ InspectorStyleSheet* inspectorStyleSheet = styleSheetForId(compoundId.styleSheetId());
if (!inspectorStyleSheet)
return;
- if (!inspectorStyleSheet->setStyleText(idParts.at(1), text))
- return;
-
- *result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(idParts.at(1)));
+ bool success = inspectorStyleSheet->setPropertyText(compoundId, propertyIndex, text, overwrite);
+ if (success)
+ *result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
}
-void InspectorCSSAgent::toggleProperty2(const String&, long, bool)
+void InspectorCSSAgent::toggleProperty2(const String& fullStyleId, long propertyIndex, bool disable, RefPtr<InspectorValue>* result)
{
- // FIXME(apavlov): implement
+ InspectorCSSId compoundId(fullStyleId);
+ ASSERT(!compoundId.isEmpty());
+
+ InspectorStyleSheet* inspectorStyleSheet = styleSheetForId(compoundId.styleSheetId());
+ if (!inspectorStyleSheet)
+ return;
+
+ bool success = inspectorStyleSheet->toggleProperty(compoundId, propertyIndex, disable);
+ if (success)
+ *result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
}
void InspectorCSSAgent::setRuleSelector2(const String& fullRuleId, const String& selector, RefPtr<InspectorValue>* result)
{
- Vector<String> idParts;
- fullRuleId.split(':', idParts);
- ASSERT(idParts.size() == 2);
+ InspectorCSSId compoundId(fullRuleId);
+ ASSERT(!compoundId.isEmpty());
- InspectorStyleSheet* inspectorStyleSheet = styleSheetForId(idParts.at(0));
+ InspectorStyleSheet* inspectorStyleSheet = styleSheetForId(compoundId.styleSheetId());
if (!inspectorStyleSheet)
return;
- const String& ruleId = idParts.at(1);
- bool success = inspectorStyleSheet->setRuleSelector(ruleId, selector);
+ bool success = inspectorStyleSheet->setRuleSelector(compoundId, selector);
if (!success)
return;
- *result = inspectorStyleSheet->buildObjectForRule(inspectorStyleSheet->ruleForId(ruleId));
+ *result = inspectorStyleSheet->buildObjectForRule(inspectorStyleSheet->ruleForId(compoundId));
}
void InspectorCSSAgent::addRule2(const long contextNodeId, const String& selector, RefPtr<InspectorValue>* result)
@@ -379,130 +359,6 @@ Element* InspectorCSSAgent::inlineStyleElement(CSSStyleDeclaration* style)
return static_cast<Element*>(node);
}
-// static
-void InspectorCSSAgent::populateObjectWithStyleProperties(CSSStyleDeclaration* style, InspectorObject* result, Vector<CSSPropertySourceData>* propertyData)
-{
- RefPtr<InspectorArray> properties = InspectorArray::create();
- RefPtr<InspectorObject> shorthandValues = InspectorObject::create();
- HashMap<String, RefPtr<InspectorObject> > propertyNameToPreviousActiveProperty;
- HashSet<String> foundShorthands;
- HashSet<String> sourcePropertyNames;
- if (propertyData) {
- for (Vector<CSSPropertySourceData>::const_iterator it = propertyData->begin(); it != propertyData->end(); ++it) {
- const CSSPropertySourceData& propertyEntry = *it;
- RefPtr<InspectorObject> property = InspectorObject::create();
- properties->pushObject(property);
- const String& name = propertyEntry.name;
- sourcePropertyNames.add(name);
- property->setString("name", name);
- property->setString("value", propertyEntry.value);
- property->setString("priority", propertyEntry.important ? "important" : "");
- property->setString("status", "active");
- property->setBoolean("parsedOk", propertyEntry.parsedOk);
- property->setNumber("startOffset", propertyEntry.range.start);
- property->setNumber("endOffset", propertyEntry.range.end);
- if (propertyEntry.parsedOk) {
- property->setBoolean("implicit", false);
- String shorthand = style->getPropertyShorthand(name);
- property->setString("shorthandName", shorthand);
- if (!shorthand.isEmpty() && !foundShorthands.contains(shorthand)) {
- foundShorthands.add(shorthand);
- shorthandValues->setString(shorthand, shorthandValue(style, shorthand));
- }
- } else {
- property->setBoolean("implicit", false);
- property->setString("shorthandName", "");
- }
- HashMap<String, RefPtr<InspectorObject> >::iterator activeIt = propertyNameToPreviousActiveProperty.find(name);
- if (activeIt != propertyNameToPreviousActiveProperty.end()) {
- activeIt->second->setString("status", "inactive");
- activeIt->second->setString("shorthandName", "");
- }
- propertyNameToPreviousActiveProperty.set(name, property);
- }
- }
-
- for (int i = 0, size = style->length(); i < size; ++i) {
- String name = style->item(i);
- if (sourcePropertyNames.contains(name))
- continue;
-
- sourcePropertyNames.add(name);
- RefPtr<InspectorObject> property = InspectorObject::create();
- properties->pushObject(property);
- property->setString("name", name);
- property->setString("value", style->getPropertyValue(name));
- property->setString("priority", style->getPropertyPriority("name"));
- property->setBoolean("implicit", style->isPropertyImplicit(name));
- property->setBoolean("parsedOk", true);
- property->setString("status", "style");
- String shorthand = style->getPropertyShorthand(name);
- property->setString("shorthandName", shorthand);
- if (!shorthand.isEmpty() && !foundShorthands.contains(shorthand)) {
- foundShorthands.add(shorthand);
- shorthandValues->setString(shorthand, shorthandValue(style, shorthand));
- }
- }
-
- result->setArray("properties", properties);
- result->setObject("shorthandValues", shorthandValues);
-}
-
-// static
-String InspectorCSSAgent::shorthandValue(CSSStyleDeclaration* style, const String& shorthandProperty)
-{
- String value = style->getPropertyValue(shorthandProperty);
- if (value.isEmpty()) {
- for (unsigned i = 0; i < style->length(); ++i) {
- String individualProperty = style->item(i);
- if (style->getPropertyShorthand(individualProperty) != shorthandProperty)
- continue;
- if (style->isPropertyImplicit(individualProperty))
- continue;
- String individualValue = style->getPropertyValue(individualProperty);
- if (individualValue == "initial")
- continue;
- if (value.length())
- value.append(" ");
- value.append(individualValue);
- }
- }
- return value;
-}
-
-// static
-String InspectorCSSAgent::shorthandPriority(CSSStyleDeclaration* style, const String& shorthandProperty)
-{
- String priority = style->getPropertyPriority(shorthandProperty);
- if (priority.isEmpty()) {
- for (unsigned i = 0; i < style->length(); ++i) {
- String individualProperty = style->item(i);
- if (style->getPropertyShorthand(individualProperty) != shorthandProperty)
- continue;
- priority = style->getPropertyPriority(individualProperty);
- break;
- }
- }
- return priority;
-}
-
-
-// static
-Vector<String> InspectorCSSAgent::longhandProperties(CSSStyleDeclaration* style, const String& shorthandProperty)
-{
- Vector<String> properties;
- HashSet<String> foundProperties;
- for (unsigned i = 0; i < style->length(); ++i) {
- String individualProperty = style->item(i);
- if (foundProperties.contains(individualProperty) || style->getPropertyShorthand(individualProperty) != shorthandProperty)
- continue;
-
- foundProperties.add(individualProperty);
- properties.append(individualProperty);
- }
- return properties;
-}
-
InspectorStyleSheetForInlineStyle* InspectorCSSAgent::asInspectorStyleSheet(Element* element)
{
NodeToInspectorStyleSheet::iterator it = m_nodeToInspectorStyleSheet.find(element);
@@ -622,7 +478,8 @@ PassRefPtr<InspectorObject> InspectorCSSAgent::buildObjectForAttributeStyles(Ele
Attribute* attribute = attributes->attributeItem(i);
if (attribute->style()) {
String attributeName = attribute->localName();
- styleAttributes->setObject(attributeName.utf8().data(), buildObjectForStyle(attribute->style(), ""));
+ RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSId(), attribute->style(), 0);
+ styleAttributes->setObject(attributeName.utf8().data(), inspectorStyle->buildObjectForStyle());
}
}
diff --git a/WebCore/inspector/InspectorCSSAgent.h b/WebCore/inspector/InspectorCSSAgent.h
index eb6013b..341d09a 100644
--- a/WebCore/inspector/InspectorCSSAgent.h
+++ b/WebCore/inspector/InspectorCSSAgent.h
@@ -56,7 +56,6 @@ public:
return adoptRef(new InspectorCSSAgent(domAgent, frontend));
}
- static PassRefPtr<InspectorObject> buildObjectForStyle(CSSStyleDeclaration*, const String& fullStyleId, CSSStyleSourceData* = 0);
static CSSStyleSheet* parentStyleSheet(StyleBase*);
static CSSStyleRule* asCSSStyleRule(StyleBase*);
@@ -73,8 +72,8 @@ public:
void getAllStyles2(RefPtr<InspectorArray>* styles);
void getStyleSheet2(const String& styleSheetId, RefPtr<InspectorValue>* result);
void setStyleSheetText2(const String& styleSheetId, const String& text);
- void setStyleText2(const String& styleId, const String& text, RefPtr<InspectorValue>* result);
- void toggleProperty2(const String& styleId, long propertyOrdinal, bool disabled);
+ void setPropertyText2(const String& styleId, long propertyIndex, const String& text, bool overwrite, RefPtr<InspectorValue>* result);
+ void toggleProperty2(const String& styleId, long propertyIndex, bool disable, RefPtr<InspectorValue>* result);
void setRuleSelector2(const String& ruleId, const String& selector, RefPtr<InspectorValue>* result);
void addRule2(const long contextNodeId, const String& selector, RefPtr<InspectorValue>* result);
void getSupportedCSSProperties(RefPtr<InspectorArray>* result);
@@ -82,21 +81,17 @@ public:
private:
typedef HashMap<String, RefPtr<InspectorStyleSheet> > IdToInspectorStyleSheet;
typedef HashMap<CSSStyleSheet*, RefPtr<InspectorStyleSheet> > CSSStyleSheetToInspectorStyleSheet;
- typedef HashMap<Node*, RefPtr<InspectorStyleSheetForInlineStyle> > NodeToInspectorStyleSheet; // for bogus "stylesheets" with inline node styles
+ typedef HashMap<Node*, RefPtr<InspectorStyleSheetForInlineStyle> > NodeToInspectorStyleSheet; // bogus "stylesheets" with elements' inline styles
typedef HashMap<RefPtr<Document>, RefPtr<InspectorStyleSheet> > DocumentToViaInspectorStyleSheet; // "via inspector" stylesheets
static Element* inlineStyleElement(CSSStyleDeclaration*);
- static void populateObjectWithStyleProperties(CSSStyleDeclaration*, InspectorObject* result, Vector<CSSPropertySourceData>* propertyData);
- static String shorthandValue(CSSStyleDeclaration*, const String& shorthandProperty);
- static String shorthandPriority(CSSStyleDeclaration*, const String& shorthandProperty);
- static Vector<String> longhandProperties(CSSStyleDeclaration*, const String& shorthandProperty);
InspectorStyleSheetForInlineStyle* asInspectorStyleSheet(Element* element);
Element* elementForId(long nodeId);
InspectorStyleSheet* bindStyleSheet(CSSStyleSheet*);
InspectorStyleSheet* viaInspectorStyleSheet(Document*, bool createIfAbsent);
- InspectorStyleSheet* styleSheetForId(const String& styleSheetId);
+ InspectorStyleSheet* styleSheetForId(const String&);
String detectOrigin(CSSStyleSheet* pageStyleSheet, Document* ownerDocument);
PassRefPtr<InspectorArray> buildArrayForRuleList(CSSRuleList* ruleList);
diff --git a/WebCore/inspector/InspectorCSSStore.cpp b/WebCore/inspector/InspectorCSSStore.cpp
index e0b658f..b75f11b 100644
--- a/WebCore/inspector/InspectorCSSStore.cpp
+++ b/WebCore/inspector/InspectorCSSStore.cpp
@@ -44,6 +44,7 @@
#include "HTMLHeadElement.h"
#include "InspectorController.h"
#include "InspectorResource.h"
+#include "InspectorResourceAgent.h"
#include "Node.h"
#include "PlatformString.h"
#include "SharedBuffer.h"
@@ -142,7 +143,7 @@ String InspectorCSSStore::styleSheetText(long styleSheetId)
bool InspectorCSSStore::resourceStyleSheetText(CSSStyleSheet* styleSheet, String* result)
{
- return m_inspectorController->resourceContentForURL(styleSheet->finalURL(), styleSheet->document(), result);
+ return InspectorResourceAgent::resourceContent(styleSheet->document()->frame(), styleSheet->finalURL(), result);
}
String InspectorCSSStore::inlineStyleSheetText(CSSStyleSheet* styleSheet)
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index f99d487..956ef7e 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -24,7 +24,7 @@
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
@@ -68,7 +68,6 @@
#include "InspectorFrontendClient.h"
#include "InspectorInstrumentation.h"
#include "InspectorProfilerAgent.h"
-#include "InspectorResource.h"
#include "InspectorResourceAgent.h"
#include "InspectorState.h"
#include "InspectorStorageAgent.h"
@@ -101,6 +100,11 @@
#include <wtf/ListHashSet.h>
#include <wtf/RefCounted.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/UnusedParam.h>
+
+#if LEGACY_RESOURCE_TRACKING_ENABLED
+#include "InspectorResource.h"
+#endif
#if ENABLE(DATABASE)
#include "Database.h"
@@ -123,8 +127,6 @@ static const char* const domNativeBreakpointType = "DOM";
static const char* const eventListenerNativeBreakpointType = "EventListener";
static const char* const xhrNativeBreakpointType = "XHR";
-// FIXME: move last panel setting to the front-end
-const char* const InspectorController::LastActivePanel = "lastActivePanel";
const char* const InspectorController::ElementsPanel = "elements";
const char* const InspectorController::ConsolePanel = "console";
const char* const InspectorController::ScriptsPanel = "scripts";
@@ -140,11 +142,10 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)
, m_client(client)
, m_openingFrontend(false)
, m_cssStore(new InspectorCSSStore(this))
+ , m_mainResourceIdentifier(0)
, m_loadEventTime(-1.0)
, m_domContentEventTime(-1.0)
, m_expiredConsoleMessageCount(0)
- , m_showAfterVisible(LastActivePanel)
- , m_sessionSettings(InspectorObject::create())
, m_groupLevel(0)
, m_previousMessage(0)
, m_settingsLoaded(false)
@@ -169,7 +170,9 @@ InspectorController::~InspectorController()
ASSERT(!m_inspectedPage);
ASSERT(!m_highlightedNode);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
deleteAllValues(m_frameResources);
+#endif
releaseFrontendLifetimeAgents();
@@ -226,20 +229,12 @@ bool InspectorController::searchingForNodeInPage() const
return m_state->getBoolean(InspectorState::searchingForNode);
}
+#if LEGACY_RESOURCE_TRACKING_ENABLED
bool InspectorController::resourceTrackingEnabled() const
{
return m_state->getBoolean(InspectorState::resourceTrackingEnabled);
}
-
-void InspectorController::saveApplicationSettings(const String& settings)
-{
- m_state->setString(InspectorState::frontendSettings, settings);
-}
-
-void InspectorController::saveSessionSettings(const String& settingsJSON)
-{
- m_sessionSettings = InspectorValue::parseJSON(settingsJSON);
-}
+#endif
void InspectorController::getInspectorState(RefPtr<InspectorObject>* state)
{
@@ -257,13 +252,6 @@ void InspectorController::restoreInspectorStateFromCookie(const String& inspecto
startTimelineProfiler();
}
-void InspectorController::getSettings(RefPtr<InspectorObject>* settings)
-{
- *settings = InspectorObject::create();
- (*settings)->setString("application", m_state->getString(InspectorState::frontendSettings));
- (*settings)->setString("session", m_sessionSettings->toJSONString());
-}
-
void InspectorController::inspect(Node* node)
{
if (!enabled())
@@ -275,10 +263,8 @@ void InspectorController::inspect(Node* node)
node = node->parentNode();
m_nodeToFocus = node;
- if (!m_frontend) {
- m_showAfterVisible = ElementsPanel;
+ if (!m_frontend)
return;
- }
focusNode();
}
@@ -414,11 +400,6 @@ void InspectorController::markTimeline(const String& message)
timelineAgent()->didMarkTimeline(message);
}
-void InspectorController::storeLastActivePanel(const String& panelName)
-{
- m_state->setString(InspectorState::lastActivePanel, panelName);
-}
-
void InspectorController::mouseDidMoveOverElement(const HitTestResult& result, unsigned)
{
if (!enabled() || !searchingForNodeInPage())
@@ -500,8 +481,10 @@ void InspectorController::connectFrontend()
releaseFrontendLifetimeAgents();
m_frontend = new InspectorFrontend(m_client);
m_domAgent = InspectorDOMAgent::create(m_cssStore.get(), m_frontend.get());
- // FIXME: enable resource agent once front-end is ready.
- // m_resourceAgent = InspectorResourceAgent::create(m_inspectedPage, m_frontend.get());
+
+#if !LEGACY_RESOURCE_TRACKING_ENABLED
+ m_resourceAgent = InspectorResourceAgent::create(m_inspectedPage, m_frontend.get());
+#endif
#if ENABLE(DATABASE)
m_storageAgent = InspectorStorageAgent::create(m_frontend.get());
@@ -556,10 +539,6 @@ void InspectorController::showPanel(const String& panel)
m_showAfterVisible = panel;
return;
}
-
- if (panel == LastActivePanel)
- return;
-
m_frontend->showPanel(panel);
}
@@ -576,8 +555,6 @@ void InspectorController::disconnectFrontend()
if (!m_frontend)
return;
- setConsoleMessagesEnabled(false);
-
m_frontend.clear();
InspectorInstrumentation::frontendDeleted();
@@ -596,8 +573,6 @@ void InspectorController::disconnectFrontend()
unbindAllResources();
stopTimelineProfiler();
- m_showAfterVisible = LastActivePanel;
-
hideHighlight();
#if ENABLE(JAVASCRIPT_DEBUGGER)
@@ -611,7 +586,9 @@ void InspectorController::disconnectFrontend()
void InspectorController::releaseFrontendLifetimeAgents()
{
+#if !LEGACY_RESOURCE_TRACKING_ENABLED
m_resourceAgent.clear();
+#endif
// m_domAgent is RefPtr. Remove DOM listeners first to ensure that there are
// no references to the DOM agent from the DOM tree.
@@ -636,19 +613,22 @@ void InspectorController::populateScriptObjects()
if (!m_frontend)
return;
- if (m_showAfterVisible == LastActivePanel)
- m_showAfterVisible = m_state->getString(InspectorState::lastActivePanel);
-
- showPanel(m_showAfterVisible);
+ if (!m_showAfterVisible.isEmpty()) {
+ showPanel(m_showAfterVisible);
+ m_showAfterVisible = "";
+ }
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (m_profilerAgent->enabled())
m_frontend->profilerWasEnabled();
#endif
+#if LEGACY_RESOURCE_TRACKING_ENABLED
ResourcesMap::iterator resourcesEnd = m_resources.end();
for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it)
it->second->updateScriptObject(m_frontend.get());
+#endif
+
if (m_domContentEventTime != -1.0)
m_frontend->domContentEventFired(m_domContentEventTime);
if (m_loadEventTime != -1.0)
@@ -711,10 +691,12 @@ void InspectorController::restoreProfiler()
void InspectorController::unbindAllResources()
{
+#if LEGACY_RESOURCE_TRACKING_ENABLED
ResourcesMap::iterator resourcesEnd = m_resources.end();
for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it)
it->second->releaseScriptObject(0);
-
+#endif
+
#if ENABLE(DATABASE)
DatabaseResourcesMap::iterator databasesEnd = m_databaseResources.end();
for (DatabaseResourcesMap::iterator it = m_databaseResources.begin(); it != databasesEnd; ++it)
@@ -729,6 +711,7 @@ void InspectorController::unbindAllResources()
m_timelineAgent->reset();
}
+#if LEGACY_RESOURCE_TRACKING_ENABLED
void InspectorController::pruneResources(ResourcesMap* resourceMap, DocumentLoader* loaderToKeep)
{
ASSERT_ARG(resourceMap, resourceMap);
@@ -747,15 +730,18 @@ void InspectorController::pruneResources(ResourcesMap* resourceMap, DocumentLoad
}
}
}
+#endif
void InspectorController::didCommitLoad(DocumentLoader* loader)
{
if (!enabled())
return;
+#if !LEGACY_RESOURCE_TRACKING_ENABLED
if (m_resourceAgent)
m_resourceAgent->didCommitLoad(loader);
-
+#endif
+
ASSERT(m_inspectedPage);
if (loader->frame() == m_inspectedPage->mainFrame()) {
@@ -787,7 +773,6 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)
unbindAllResources();
m_cssStore->reset();
- m_sessionSettings = InspectorObject::create();
if (m_frontend) {
m_frontend->reset();
m_domAgent->reset();
@@ -803,6 +788,7 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)
#endif
if (m_frontend) {
+#if LEGACY_RESOURCE_TRACKING_ENABLED
if (!loader->frameLoader()->isLoadingFromCachedPage()) {
ASSERT(m_mainResource && m_mainResource->isSameLoader(loader));
// We don't add the main resource until its load is committed. This is
@@ -816,28 +802,36 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)
// identifierForInitialRequest.
m_mainResource = 0;
}
+#endif
+ m_mainResourceIdentifier = 0;
m_frontend->didCommitLoad();
m_domAgent->setDocument(m_inspectedPage->mainFrame()->document());
}
}
+#if LEGACY_RESOURCE_TRACKING_ENABLED
for (Frame* frame = loader->frame(); frame; frame = frame->tree()->traverseNext(loader->frame()))
if (ResourcesMap* resourceMap = m_frameResources.get(frame))
pruneResources(resourceMap, loader);
+#endif
}
-void InspectorController::frameDetachedFromParent(Frame* frame)
+void InspectorController::frameDetachedFromParent(Frame* rootFrame)
{
if (!enabled())
return;
+#if LEGACY_RESOURCE_TRACKING_ENABLED
+ for (Frame* frame = rootFrame; frame; frame = frame->tree()->traverseNext(rootFrame))
+ if (ResourcesMap* resourceMap = m_frameResources.get(frame))
+ removeAllResources(resourceMap);
+#else
if (m_resourceAgent)
- m_resourceAgent->frameDetachedFromParent(frame);
-
- if (ResourcesMap* resourceMap = m_frameResources.get(frame))
- removeAllResources(resourceMap);
+ m_resourceAgent->frameDetachedFromParent(rootFrame);
+#endif
}
+#if LEGACY_RESOURCE_TRACKING_ENABLED
void InspectorController::addResource(InspectorResource* resource)
{
m_resources.set(resource->identifier(), resource);
@@ -893,24 +887,14 @@ InspectorResource* InspectorController::getTrackedResource(unsigned long identif
return 0;
}
-
-InspectorResource* InspectorController::resourceForURL(const String& url)
-{
- for (InspectorController::ResourcesMap::iterator resIt = m_resources.begin(); resIt != m_resources.end(); ++resIt) {
- if (resIt->second->requestURL().string() == url)
- return resIt->second.get();
- }
- return 0;
-}
+#endif
void InspectorController::didLoadResourceFromMemoryCache(DocumentLoader* loader, const CachedResource* cachedResource)
{
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->didLoadResourceFromMemoryCache(loader, cachedResource);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
// If the resource URL is already known, we don't need to add it again since this is just a cached load.
if (m_knownResources.contains(cachedResource->url()))
return;
@@ -932,6 +916,10 @@ void InspectorController::didLoadResourceFromMemoryCache(DocumentLoader* loader,
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didLoadResourceFromMemoryCache(loader, cachedResource);
+#endif
}
void InspectorController::identifierForInitialRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request)
@@ -941,9 +929,10 @@ void InspectorController::identifierForInitialRequest(unsigned long identifier,
ASSERT(m_inspectedPage);
bool isMainResource = isMainResourceLoader(loader, request.url());
+ if (isMainResource)
+ m_mainResourceIdentifier = identifier;
- if (m_resourceAgent)
- m_resourceAgent->identifierForInitialRequest(identifier, request.url(), loader, isMainResource);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
ensureSettingsLoaded();
if (!isMainResource && !resourceTrackingEnabled())
@@ -960,6 +949,10 @@ void InspectorController::identifierForInitialRequest(unsigned long identifier,
if (m_frontend && loader->frameLoader()->isLoadingFromCachedPage() && resource == m_mainResource)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->identifierForInitialRequest(identifier, request.url(), loader);
+#endif
}
void InspectorController::mainResourceFiredDOMContentEvent(DocumentLoader* loader, const KURL& url)
@@ -996,23 +989,22 @@ void InspectorController::willSendRequest(unsigned long identifier, ResourceRequ
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->willSendRequest(identifier, request, redirectResponse);
+ request.setReportLoadTiming(true);
+ // Only enable raw headers if front-end is attached, as otherwise we may lack
+ // permissions to fetch the headers.
+ if (m_frontend)
+ request.setReportRawHeaders(true);
+
+ bool isMainResource = m_mainResourceIdentifier == identifier;
- bool isMainResource = (m_mainResource && m_mainResource->identifier() == identifier);
if (m_timelineAgent)
m_timelineAgent->willSendResourceRequest(identifier, isMainResource, request);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
- request.setReportLoadTiming(true);
- // Only enable raw headers if front-end is attached, as otherwise we may lack
- // permissions to fetch the headers.
- if (m_frontend)
- request.setReportRawHeaders(true);
-
if (!redirectResponse.isNull()) {
// Redirect may have empty URL and we'd like to not crash with invalid HashMap entry.
// See http/tests/misc/will-send-request-returns-null-on-redirect.html
@@ -1038,6 +1030,10 @@ void InspectorController::willSendRequest(unsigned long identifier, ResourceRequ
if (resource != m_mainResource && m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->willSendRequest(identifier, request, redirectResponse);
+#endif
}
void InspectorController::markResourceAsCached(unsigned long identifier)
@@ -1045,11 +1041,13 @@ void InspectorController::markResourceAsCached(unsigned long identifier)
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->markResourceAsCached(identifier);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
if (RefPtr<InspectorResource> resource = getTrackedResource(identifier))
resource->markAsCached();
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->markResourceAsCached(identifier);
+#endif
}
void InspectorController::didReceiveResponse(unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response)
@@ -1057,15 +1055,19 @@ void InspectorController::didReceiveResponse(unsigned long identifier, DocumentL
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->didReceiveResponse(identifier, loader, response);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
if (RefPtr<InspectorResource> resource = getTrackedResource(identifier)) {
resource->updateResponse(response);
if (resource != m_mainResource && m_frontend)
resource->updateScriptObject(m_frontend.get());
}
+ UNUSED_PARAM(loader);
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didReceiveResponse(identifier, loader, response);
+#endif
+
if (response.httpStatusCode() >= 400) {
String message = makeString("Failed to load resource: the server responded with a status of ", String::number(response.httpStatusCode()), " (", response.httpStatusText(), ')');
addMessageToConsole(OtherMessageSource, LogMessageType, ErrorMessageLevel, message, 0, response.url().string());
@@ -1077,9 +1079,7 @@ void InspectorController::didReceiveContentLength(unsigned long identifier, int
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->didReceiveContentLength(identifier, lengthReceived);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
@@ -1088,6 +1088,10 @@ void InspectorController::didReceiveContentLength(unsigned long identifier, int
if (resource != m_mainResource && m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didReceiveContentLength(identifier, lengthReceived);
+#endif
}
void InspectorController::didFinishLoading(unsigned long identifier, double finishTime)
@@ -1095,12 +1099,10 @@ void InspectorController::didFinishLoading(unsigned long identifier, double fini
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->didFinishLoading(identifier, finishTime);
-
if (m_timelineAgent)
m_timelineAgent->didFinishLoadingResource(identifier, false, finishTime);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
@@ -1110,6 +1112,10 @@ void InspectorController::didFinishLoading(unsigned long identifier, double fini
// No need to mute this event for main resource since it happens after did commit load.
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didFinishLoading(identifier, finishTime);
+#endif
}
void InspectorController::didFailLoading(unsigned long identifier, const ResourceError& error)
@@ -1117,27 +1123,29 @@ void InspectorController::didFailLoading(unsigned long identifier, const Resourc
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->didFailLoading(identifier, error);
-
if (m_timelineAgent)
m_timelineAgent->didFinishLoadingResource(identifier, true, 0);
String message = "Failed to load resource";
- if (!error.localizedDescription().isEmpty())
- message += ": " + error.localizedDescription();
- addMessageToConsole(OtherMessageSource, LogMessageType, ErrorMessageLevel, message, 0, error.failingURL());
+ if (!error.localizedDescription().isEmpty())
+ message += ": " + error.localizedDescription();
+ addMessageToConsole(OtherMessageSource, LogMessageType, ErrorMessageLevel, message, 0, error.failingURL());
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
- resource->markFailed();
+ resource->markFailed(error.localizedDescription());
resource->endTiming(0);
// No need to mute this event for main resource since it happens after did commit load.
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didFailLoading(identifier, error);
+#endif
}
void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber)
@@ -1145,12 +1153,10 @@ void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identi
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->setOverrideContent(identifier, sourceString, InspectorResource::XHR);
-
if (m_state->getBoolean(InspectorState::monitoringXHR))
addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, "XHR finished loading: \"" + url + "\".", sendLineNumber, sendURL);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
if (!resourceTrackingEnabled())
return;
@@ -1162,6 +1168,10 @@ void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identi
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->setOverrideContent(identifier, sourceString, InspectorResource::XHR);
+#endif
}
void InspectorController::scriptImported(unsigned long identifier, const String& sourceString)
@@ -1169,9 +1179,7 @@ void InspectorController::scriptImported(unsigned long identifier, const String&
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->setOverrideContent(identifier, sourceString, InspectorResource::Script);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
if (!resourceTrackingEnabled())
return;
@@ -1183,8 +1191,13 @@ void InspectorController::scriptImported(unsigned long identifier, const String&
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->setOverrideContent(identifier, sourceString, InspectorResource::Script);
+#endif
}
+#if LEGACY_RESOURCE_TRACKING_ENABLED
void InspectorController::setResourceTrackingEnabled(bool enable)
{
if (!enabled())
@@ -1193,9 +1206,11 @@ void InspectorController::setResourceTrackingEnabled(bool enable)
ASSERT(m_inspectedPage);
m_state->setBoolean(InspectorState::resourceTrackingEnabled, enable);
}
+#endif
void InspectorController::setResourceTrackingEnabled(bool enable, bool always, bool* newState)
{
+#if LEGACY_RESOURCE_TRACKING_ENABLED
*newState = enable;
if (always)
@@ -1209,6 +1224,11 @@ void InspectorController::setResourceTrackingEnabled(bool enable, bool always, b
if (enable)
reloadPage();
+#else
+ UNUSED_PARAM(enable);
+ UNUSED_PARAM(always);
+ UNUSED_PARAM(newState);
+#endif
}
void InspectorController::ensureSettingsLoaded()
@@ -1368,33 +1388,35 @@ void InspectorController::getCookies(RefPtr<InspectorArray>* cookies, WTF::Strin
// always return the same true/false value.
bool rawCookiesImplemented = false;
- ResourcesMap::iterator resourcesEnd = m_resources.end();
- for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it) {
- Document* document = it->second->frame()->document();
- Vector<Cookie> docCookiesList;
- rawCookiesImplemented = getRawCookies(document, it->second->requestURL(), docCookiesList);
-
- if (!rawCookiesImplemented) {
- // FIXME: We need duplication checking for the String representation of cookies.
- ExceptionCode ec = 0;
- stringCookiesList += document->cookie(ec);
- // Exceptions are thrown by cookie() in sandboxed frames. That won't happen here
- // because "document" is the document of the main frame of the page.
- ASSERT(!ec);
- } else {
- int cookiesSize = docCookiesList.size();
- for (int i = 0; i < cookiesSize; i++) {
- if (!rawCookiesList.contains(docCookiesList[i]))
- rawCookiesList.add(docCookiesList[i]);
+ for (Frame* frame = m_inspectedPage->mainFrame(); frame; frame = frame->tree()->traverseNext(m_inspectedPage->mainFrame())) {
+ Document* document = frame->document();
+ const CachedResourceLoader::DocumentResourceMap& allResources = document->cachedResourceLoader()->allCachedResources();
+ CachedResourceLoader::DocumentResourceMap::const_iterator end = allResources.end();
+ for (CachedResourceLoader::DocumentResourceMap::const_iterator it = allResources.begin(); it != end; ++it) {
+ Vector<Cookie> docCookiesList;
+ rawCookiesImplemented = getRawCookies(document, KURL(ParsedURLString, it->second->url()), docCookiesList);
+
+ if (!rawCookiesImplemented) {
+ // FIXME: We need duplication checking for the String representation of cookies.
+ ExceptionCode ec = 0;
+ stringCookiesList += document->cookie(ec);
+ // Exceptions are thrown by cookie() in sandboxed frames. That won't happen here
+ // because "document" is the document of the main frame of the page.
+ ASSERT(!ec);
+ } else {
+ int cookiesSize = docCookiesList.size();
+ for (int i = 0; i < cookiesSize; i++) {
+ if (!rawCookiesList.contains(docCookiesList[i]))
+ rawCookiesList.add(docCookiesList[i]);
+ }
}
}
}
if (rawCookiesImplemented)
*cookies = buildArrayForCookies(rawCookiesList);
- else {
+ else
*cookiesString = stringCookiesList;
- }
}
PassRefPtr<InspectorArray> InspectorController::buildArrayForCookies(ListHashSet<Cookie>& cookiesList)
@@ -1426,11 +1448,14 @@ PassRefPtr<InspectorObject> InspectorController::buildObjectForCookie(const Cook
void InspectorController::deleteCookie(const String& cookieName, const String& domain)
{
- ResourcesMap::iterator resourcesEnd = m_resources.end();
- for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it) {
- Document* document = it->second->frame()->document();
- if (document->url().host() == domain)
- WebCore::deleteCookie(document, it->second->requestURL(), cookieName);
+ for (Frame* frame = m_inspectedPage->mainFrame(); frame; frame = frame->tree()->traverseNext(m_inspectedPage->mainFrame())) {
+ Document* document = frame->document();
+ if (document->url().host() != domain)
+ continue;
+ const CachedResourceLoader::DocumentResourceMap& allResources = document->cachedResourceLoader()->allCachedResources();
+ CachedResourceLoader::DocumentResourceMap::const_iterator end = allResources.end();
+ for (CachedResourceLoader::DocumentResourceMap::const_iterator it = allResources.begin(); it != end; ++it)
+ WebCore::deleteCookie(document, KURL(ParsedURLString, it->second->url()), cookieName);
}
}
@@ -1528,21 +1553,22 @@ void InspectorController::didCreateWebSocket(unsigned long identifier, const KUR
return;
ASSERT(m_inspectedPage);
- if (m_resourceAgent)
- m_resourceAgent->didCreateWebSocket(identifier, requestURL);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = InspectorResource::createWebSocket(identifier, requestURL, documentURL);
addResource(resource.get());
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didCreateWebSocket(identifier, requestURL);
+ UNUSED_PARAM(documentURL);
+#endif
}
void InspectorController::willSendWebSocketHandshakeRequest(unsigned long identifier, const WebSocketHandshakeRequest& request)
{
- if (m_resourceAgent)
- m_resourceAgent->willSendWebSocketHandshakeRequest(identifier, request);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
@@ -1550,13 +1576,15 @@ void InspectorController::willSendWebSocketHandshakeRequest(unsigned long identi
resource->updateWebSocketRequest(request);
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->willSendWebSocketHandshakeRequest(identifier, request);
+#endif
}
void InspectorController::didReceiveWebSocketHandshakeResponse(unsigned long identifier, const WebSocketHandshakeResponse& response)
{
- if (m_resourceAgent)
- m_resourceAgent->didReceiveWebSocketHandshakeResponse(identifier, response);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
@@ -1566,13 +1594,15 @@ void InspectorController::didReceiveWebSocketHandshakeResponse(unsigned long ide
resource->updateWebSocketResponse(response);
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didReceiveWebSocketHandshakeResponse(identifier, response);
+#endif
}
void InspectorController::didCloseWebSocket(unsigned long identifier)
{
- if (m_resourceAgent)
- m_resourceAgent->didCloseWebSocket(identifier);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
@@ -1580,6 +1610,10 @@ void InspectorController::didCloseWebSocket(unsigned long identifier)
resource->endTiming(0);
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didCloseWebSocket(identifier);
+#endif
}
#endif // ENABLE(WEB_SOCKETS)
@@ -1793,9 +1827,7 @@ void InspectorController::didEvaluateForTestInFrontend(long callId, const String
String InspectorController::breakpointsSettingKey()
{
DEFINE_STATIC_LOCAL(String, keyPrefix, ("breakpoints:"));
- if (!m_mainResource)
- return "";
- return keyPrefix + InspectorDebuggerAgent::md5Base16(m_mainResource->requestURL());
+ return keyPrefix + InspectorDebuggerAgent::md5Base16(m_inspectedPage->mainFrame()->loader()->url().string());
}
PassRefPtr<InspectorValue> InspectorController::loadBreakpoints()
@@ -2127,55 +2159,18 @@ void InspectorController::setInspectorExtensionAPI(const String& source)
void InspectorController::getResourceContent(unsigned long identifier, bool encode, String* content)
{
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = m_resources.get(identifier);
if (!resource) {
*content = String();
return;
}
*content = encode ? resource->sourceBytes() : resource->sourceString();
-}
-
-bool InspectorController::resourceContentForURL(const KURL& url, Document* frameDocument, String* result)
-{
- if (!frameDocument)
- return false;
-
- String textEncodingName;
- RefPtr<SharedBuffer> buffer;
- if (equalIgnoringFragmentIdentifier(url, frameDocument->frame()->loader()->documentLoader()->requestURL())) {
- textEncodingName = frameDocument->inputEncoding();
- buffer = frameDocument->frame()->loader()->provisionalDocumentLoader()->mainResourceData();
- } else {
- const String& urlString = url.string();
- CachedResource* cachedResource = frameDocument->cachedResourceLoader()->cachedResource(urlString);
- if (!cachedResource)
- cachedResource = cache()->resourceForURL(urlString);
-
- ASSERT(cachedResource); // FIXME(apavlov): This might be too aggressive.
-
- bool isUnpurgeable = true;
- if (cachedResource->isPurgeable()) {
- // If the resource is purgeable then make it unpurgeable to get
- // its data. This might fail, in which case we return an
- // empty String.
- if (!cachedResource->makePurgeable(false))
- isUnpurgeable = false;
- }
- if (isUnpurgeable) {
- textEncodingName = cachedResource->encoding();
- buffer = cachedResource->data();
- }
- }
-
- if (buffer) {
- TextEncoding encoding(textEncodingName);
- if (!encoding.isValid())
- encoding = WindowsLatin1Encoding();
- *result = encoding.decode(buffer->data(), buffer->size());
- return true;
- }
-
- return false;
+#else
+ UNUSED_PARAM(identifier);
+ UNUSED_PARAM(encode);
+ UNUSED_PARAM(content);
+#endif
}
void InspectorController::reloadPage()
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 6d4d9e0..80d094f 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -67,7 +67,6 @@ class InspectorFrontend;
class InspectorFrontendClient;
class InspectorObject;
class InspectorProfilerAgent;
-class InspectorResource;
class InspectorResourceAgent;
class InspectorState;
class InspectorStorageAgent;
@@ -87,6 +86,12 @@ class SharedBuffer;
class Storage;
class StorageArea;
+#define LEGACY_RESOURCE_TRACKING_ENABLED 1
+
+#if LEGACY_RESOURCE_TRACKING_ENABLED
+class InspectorResource;
+#endif
+
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
class InspectorApplicationCacheAgent;
#endif
@@ -98,12 +103,13 @@ class WebSocketHandshakeResponse;
class InspectorController : public Noncopyable {
public:
+#if LEGACY_RESOURCE_TRACKING_ENABLED
typedef HashMap<unsigned long, RefPtr<InspectorResource> > ResourcesMap;
typedef HashMap<RefPtr<Frame>, ResourcesMap*> FrameResourcesMap;
+#endif
typedef HashMap<int, RefPtr<InspectorDatabaseResource> > DatabaseResourcesMap;
typedef HashMap<int, RefPtr<InspectorDOMStorageResource> > DOMStorageResourcesMap;
- static const char* const LastActivePanel;
static const char* const ConsolePanel;
static const char* const ElementsPanel;
static const char* const ProfilesPanel;
@@ -124,10 +130,6 @@ public:
Page* inspectedPage() const { return m_inspectedPage; }
void reloadPage();
- void saveApplicationSettings(const String& settings);
- void saveSessionSettings(const String&);
- void getSettings(RefPtr<InspectorObject>*);
-
void restoreInspectorStateFromCookie(const String& inspectorCookie);
void inspect(Node*);
@@ -173,9 +175,11 @@ public:
void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
void scriptImported(unsigned long identifier, const String& sourceString);
- void setResourceTrackingEnabled(bool enabled);
void setResourceTrackingEnabled(bool enabled, bool always, bool* newState);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
+ void setResourceTrackingEnabled(bool enabled);
bool resourceTrackingEnabled() const;
+#endif
void ensureSettingsLoaded();
@@ -218,9 +222,10 @@ public:
void didCloseWebSocket(unsigned long identifier);
#endif
+#if LEGACY_RESOURCE_TRACKING_ENABLED
const ResourcesMap& resources() const { return m_resources; }
- InspectorResource* resourceForURL(const String& url);
- bool resourceContentForURL(const KURL& url, Document* loaderDocument, String* result);
+#endif
+
bool hasFrontend() const { return m_frontend; }
void drawNodeHighlight(GraphicsContext&) const;
@@ -294,7 +299,6 @@ private:
void setSearchingForNode(bool enabled, bool* newState);
void setMonitoringXHREnabled(bool enabled, bool* newState);
- void storeLastActivePanel(const String& panelName);
InspectorDOMAgent* domAgent() { return m_domAgent.get(); }
void releaseFrontendLifetimeAgents();
@@ -320,13 +324,14 @@ private:
void addConsoleMessage(PassOwnPtr<ConsoleMessage>);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
void addResource(InspectorResource*);
void removeResource(InspectorResource*);
InspectorResource* getTrackedResource(unsigned long identifier);
- void getResourceContent(unsigned long identifier, bool encode, String* content);
-
void pruneResources(ResourcesMap*, DocumentLoader* loaderToKeep = 0);
void removeAllResources(ResourcesMap* map) { pruneResources(map); }
+#endif
+ void getResourceContent(unsigned long identifier, bool encode, String* content);
bool isMainResourceLoader(DocumentLoader* loader, const KURL& requestUrl);
@@ -345,7 +350,6 @@ private:
bool m_openingFrontend;
OwnPtr<InspectorFrontend> m_frontend;
RefPtr<InspectorDOMAgent> m_domAgent;
- RefPtr<InspectorResourceAgent> m_resourceAgent;
RefPtr<InspectorStorageAgent> m_storageAgent;
OwnPtr<InspectorCSSStore> m_cssStore;
OwnPtr<InspectorTimelineAgent> m_timelineAgent;
@@ -354,12 +358,15 @@ private:
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
OwnPtr<InspectorApplicationCacheAgent> m_applicationCacheAgent;
#endif
-
RefPtr<Node> m_nodeToFocus;
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> m_mainResource;
ResourcesMap m_resources;
HashSet<String> m_knownResources;
FrameResourcesMap m_frameResources;
+#endif
+ RefPtr<InspectorResourceAgent> m_resourceAgent;
+ unsigned long m_mainResourceIdentifier;
double m_loadEventTime;
double m_domContentEventTime;
Vector<OwnPtr<ConsoleMessage> > m_consoleMessages;
@@ -374,9 +381,6 @@ private:
#endif
String m_showAfterVisible;
RefPtr<Node> m_highlightedNode;
-#if ENABLE(INSPECTOR)
- RefPtr<InspectorValue> m_sessionSettings;
-#endif
unsigned m_groupLevel;
ConsoleMessage* m_previousMessage;
bool m_settingsLoaded;
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index f5c5f8b..cfb55fc 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -1219,11 +1219,11 @@ void InspectorDOMAgent::getStyles(long nodeId, bool authorOnly, RefPtr<Inspector
result->setObject("styleAttributes", buildObjectForAttributeStyles(element));
result->setArray("pseudoElements", buildArrayForPseudoElements(element, authorOnly));
- RefPtr<InspectorObject> currentStyle = result;
+ RefPtr<InspectorArray> inheritedStyles = InspectorArray::create();
Element* parentElement = element->parentElement();
while (parentElement) {
RefPtr<InspectorObject> parentStyle = InspectorObject::create();
- currentStyle->setObject("parent", parentStyle);
+ inheritedStyles->pushObject(parentStyle);
if (parentElement->style() && parentElement->style()->length())
parentStyle->setObject("inlineStyle", buildObjectForStyle(parentElement->style(), true));
@@ -1232,8 +1232,8 @@ void InspectorDOMAgent::getStyles(long nodeId, bool authorOnly, RefPtr<Inspector
parentStyle->setArray("matchedCSSRules", buildArrayForCSSRules(parentElement->ownerDocument(), parentMatchedRules.get()));
parentElement = parentElement->parentElement();
- currentStyle = parentStyle;
}
+ result->setArray("inherited", inheritedStyles);
*styles = result.release();
}
@@ -1396,6 +1396,7 @@ void InspectorDOMAgent::applyStyleText(long styleId, const String& styleText, co
// Notify caller that the property was successfully deleted.
if (!styleTextLength) {
*success = true;
+ *styleObject = buildObjectForStyle(style, true);
return;
}
@@ -1544,18 +1545,15 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForStyle(CSSStyleDecla
{
RefPtr<InspectorObject> result = InspectorObject::create();
if (bind) {
- long styleId = cssStore()->bindStyle(style);
- result->setNumber("id", styleId);
- CSSStyleSheet* parentStyleSheet = InspectorCSSStore::getParentStyleSheet(style);
- if (parentStyleSheet)
- result->setNumber("parentStyleSheetId", cssStore()->bindStyleSheet(parentStyleSheet));
-
- DisabledStyleDeclaration* disabledStyle = cssStore()->disabledStyleForId(styleId, false);
- if (disabledStyle)
- result->setArray("disabled", buildArrayForDisabledStyleProperties(disabledStyle));
+ result->setNumber("styleId", cssStore()->bindStyle(style));
+ CSSStyleSheet* styleSheet = InspectorCSSStore::getParentStyleSheet(style);
+ if (styleSheet)
+ result->setNumber("styleSheetId", cssStore()->bindStyleSheet(styleSheet));
}
- result->setString("width", style->getPropertyValue("width"));
- result->setString("height", style->getPropertyValue("height"));
+ RefPtr<InspectorObject> properties = InspectorObject::create();
+ properties->setString("width", style->getPropertyValue("width"));
+ properties->setString("height", style->getPropertyValue("height"));
+ result->setObject("properties", properties);
populateObjectWithStyleProperties(style, result.get());
return result.release();
}
@@ -1569,44 +1567,55 @@ void InspectorDOMAgent::populateObjectWithStyleProperties(CSSStyleDeclaration* s
for (unsigned i = 0; i < style->length(); ++i) {
RefPtr<InspectorObject> property = InspectorObject::create();
String name = style->item(i);
+ String value = style->getPropertyValue(name);
+ String priority = style->getPropertyPriority(name);
property->setString("name", name);
- property->setString("priority", style->getPropertyPriority(name));
+ property->setString("value", value);
+ property->setString("priority", priority);
+ property->setString("text", name + ": " + value + (priority.length() ? " !" + priority : "") + ";");
property->setBoolean("implicit", style->isPropertyImplicit(name));
+ property->setBoolean("parsedOk", true);
+ property->setString("status", "style");
String shorthand = style->getPropertyShorthand(name);
- property->setString("shorthand", shorthand);
+ property->setString("shorthandName", shorthand);
if (!shorthand.isEmpty() && !foundShorthands.contains(shorthand)) {
foundShorthands.add(shorthand);
shorthandValues->setString(shorthand, shorthandValue(style, shorthand));
}
- property->setString("value", style->getPropertyValue(name));
properties->pushObject(property.release());
}
- result->setArray("properties", properties);
+ result->setArray("cssProperties", properties);
+ result->setString("cssText", style->cssText());
result->setObject("shorthandValues", shorthandValues);
-}
-PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForDisabledStyleProperties(DisabledStyleDeclaration* declaration)
-{
- RefPtr<InspectorArray> properties = InspectorArray::create();
- for (DisabledStyleDeclaration::iterator it = declaration->begin(); it != declaration->end(); ++it) {
+ DisabledStyleDeclaration* disabledStyle = cssStore()->disabledStyleForId(cssStore()->bindStyle(style), false);
+ if (!disabledStyle)
+ return;
+
+ for (DisabledStyleDeclaration::iterator it = disabledStyle->begin(); it != disabledStyle->end(); ++it) {
RefPtr<InspectorObject> property = InspectorObject::create();
- property->setString("name", it->first);
- property->setString("value", it->second.first);
- property->setString("priority", it->second.second);
+ String name = it->first;
+ String value = it->second.first;
+ String priority = it->second.second;
+ property->setString("name", name);
+ property->setString("value", value);
+ property->setString("priority", priority);
+ property->setString("text", name + ": " + value + (priority.length() ? " !" + priority : "") + ";");
+ property->setBoolean("implicit", false);
+ property->setBoolean("parsedOk", true);
+ property->setString("status", "disabled");
properties->pushObject(property.release());
}
- return properties.release();
}
PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForStyleSheet(Document* ownerDocument, CSSStyleSheet* styleSheet)
{
RefPtr<InspectorObject> result = InspectorObject::create();
long id = cssStore()->bindStyleSheet(styleSheet);
- result->setNumber("id", id);
- result->setBoolean("disabled", styleSheet->disabled());
- result->setString("href", styleSheet->href());
+ result->setNumber("styleSheetId", id);
+ result->setString("sourceURL", styleSheet->href());
result->setString("title", styleSheet->title());
- result->setNumber("documentElementId", m_documentNodeToIdMap.get(styleSheet->document()));
+ result->setBoolean("disabled", styleSheet->disabled());
RefPtr<InspectorArray> cssRules = InspectorArray::create();
PassRefPtr<CSSRuleList> cssRuleList = CSSRuleList::create(styleSheet, true);
if (cssRuleList) {
@@ -1616,7 +1625,7 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForStyleSheet(Document
cssRules->pushObject(buildObjectForRule(ownerDocument, static_cast<CSSStyleRule*>(rule)));
}
}
- result->setArray("cssRules", cssRules.release());
+ result->setArray("rules", cssRules.release());
return result.release();
}
@@ -1626,27 +1635,28 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForRule(Document* owne
RefPtr<InspectorObject> result = InspectorObject::create();
result->setString("selectorText", rule->selectorText());
- result->setString("cssText", rule->cssText());
result->setNumber("sourceLine", rule->sourceLine());
- result->setString("documentURL", documentURLString(ownerDocument));
- if (parentStyleSheet) {
- RefPtr<InspectorObject> parentStyleSheetValue = InspectorObject::create();
- parentStyleSheetValue->setString("href", parentStyleSheet->href());
- parentStyleSheetValue->setNumber("id", cssStore()->bindStyleSheet(parentStyleSheet));
- result->setObject("parentStyleSheet", parentStyleSheetValue.release());
- }
- bool isUserAgent = parentStyleSheet && !parentStyleSheet->ownerNode() && parentStyleSheet->href().isEmpty();
- bool isUser = parentStyleSheet && parentStyleSheet->ownerNode() && parentStyleSheet->ownerNode()->nodeName() == "#document";
- result->setBoolean("isUserAgent", isUserAgent);
- result->setBoolean("isUser", isUser);
- result->setBoolean("isViaInspector", rule->parentStyleSheet() == cssStore()->inspectorStyleSheet(ownerDocument, false));
+
+ String origin;
+ bool canBind = true;
+ if (parentStyleSheet && !parentStyleSheet->ownerNode() && parentStyleSheet->href().isEmpty()) {
+ origin = "user-agent";
+ canBind = false;
+ } else if (parentStyleSheet && parentStyleSheet->ownerNode() && parentStyleSheet->ownerNode()->nodeName() == "#document") {
+ origin = "user";
+ canBind = false;
+ } else if (rule->parentStyleSheet() == cssStore()->inspectorStyleSheet(ownerDocument, false))
+ origin = "inspector";
+ result->setString("origin", origin);
+
+ if (origin.isEmpty())
+ result->setString("sourceURL", parentStyleSheet && !parentStyleSheet->href().isEmpty() ? parentStyleSheet->href() : (ownerDocument ? ownerDocument->url().string() : ""));
// Bind editable scripts only.
- bool bind = !isUserAgent && !isUser;
- result->setObject("style", buildObjectForStyle(rule->style(), bind));
+ result->setObject("style", buildObjectForStyle(rule->style(), canBind));
- if (bind)
- result->setNumber("id", cssStore()->bindRule(rule));
+ if (canBind)
+ result->setNumber("ruleId", cssStore()->bindRule(rule));
return result.release();
}
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index 03e4d8d..6c5fd4b 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -207,7 +207,6 @@ namespace WebCore {
PassRefPtr<InspectorObject> buildObjectForStyle(CSSStyleDeclaration*, bool bind);
void populateObjectWithStyleProperties(CSSStyleDeclaration*, InspectorObject* result);
- PassRefPtr<InspectorArray> buildArrayForDisabledStyleProperties(DisabledStyleDeclaration*);
PassRefPtr<InspectorObject> buildObjectForRule(Document* ownerDocument, CSSStyleRule*);
PassRefPtr<InspectorObject> buildObjectForStyleSheet(Document* ownerDocument, CSSStyleSheet*);
Vector<String> longhandProperties(CSSStyleDeclaration*, const String& shorthandProperty);
diff --git a/WebCore/inspector/InspectorDOMStorageResource.cpp b/WebCore/inspector/InspectorDOMStorageResource.cpp
index c8d76ba..cfd5f9f 100644
--- a/WebCore/inspector/InspectorDOMStorageResource.cpp
+++ b/WebCore/inspector/InspectorDOMStorageResource.cpp
@@ -100,7 +100,9 @@ void InspectorDOMStorageResource::startReportingChangesToFrontend()
void InspectorDOMStorageResource::handleEvent(ScriptExecutionContext*, Event* event)
{
ASSERT(m_frontend);
- ASSERT(eventNames().storageEvent == event->type());
+ if (event->type() != eventNames().storageEvent || !event->isStorageEvent())
+ return;
+
StorageEvent* storageEvent = static_cast<StorageEvent*>(event);
Storage* storage = storageEvent->storageArea();
ExceptionCode ec = 0;
diff --git a/WebCore/inspector/InspectorDebuggerAgent.cpp b/WebCore/inspector/InspectorDebuggerAgent.cpp
index a7eacf6..ebd03e6 100644
--- a/WebCore/inspector/InspectorDebuggerAgent.cpp
+++ b/WebCore/inspector/InspectorDebuggerAgent.cpp
@@ -62,6 +62,7 @@ InspectorDebuggerAgent::InspectorDebuggerAgent(InspectorController* inspectorCon
, m_frontend(frontend)
, m_pausedScriptState(0)
, m_breakpointsLoaded(false)
+ , m_javaScriptPauseScheduled(false)
{
}
@@ -144,6 +145,8 @@ void InspectorDebuggerAgent::getScriptSource(const String& sourceID, String* scr
void InspectorDebuggerAgent::schedulePauseOnNextStatement(DebuggerEventType type, PassRefPtr<InspectorValue> data)
{
+ if (m_javaScriptPauseScheduled)
+ return;
m_breakProgramDetails = InspectorObject::create();
m_breakProgramDetails->setNumber("eventType", type);
m_breakProgramDetails->setValue("eventData", data);
@@ -152,6 +155,8 @@ void InspectorDebuggerAgent::schedulePauseOnNextStatement(DebuggerEventType type
void InspectorDebuggerAgent::cancelPauseOnNextStatement()
{
+ if (m_javaScriptPauseScheduled)
+ return;
m_breakProgramDetails = 0;
ScriptDebugServer::shared().setPauseOnNextStatement(false);
}
@@ -159,6 +164,7 @@ void InspectorDebuggerAgent::cancelPauseOnNextStatement()
void InspectorDebuggerAgent::pause()
{
schedulePauseOnNextStatement(JavaScriptPauseEventType, InspectorObject::create());
+ m_javaScriptPauseScheduled = true;
}
void InspectorDebuggerAgent::resume()
@@ -309,6 +315,7 @@ void InspectorDebuggerAgent::didPause(ScriptState* scriptState)
m_breakProgramDetails->setValue("callFrames", currentCallFrames());
m_frontend->pausedScript(m_breakProgramDetails);
+ m_javaScriptPauseScheduled = false;
}
void InspectorDebuggerAgent::didContinue()
diff --git a/WebCore/inspector/InspectorDebuggerAgent.h b/WebCore/inspector/InspectorDebuggerAgent.h
index 3825042..9501ac8 100644
--- a/WebCore/inspector/InspectorDebuggerAgent.h
+++ b/WebCore/inspector/InspectorDebuggerAgent.h
@@ -106,6 +106,7 @@ private:
bool m_breakpointsLoaded;
static InspectorDebuggerAgent* s_debuggerAgentOnBreakpoint;
RefPtr<InspectorObject> m_breakProgramDetails;
+ bool m_javaScriptPauseScheduled;
};
} // namespace WebCore
diff --git a/WebCore/inspector/InspectorInstrumentation.cpp b/WebCore/inspector/InspectorInstrumentation.cpp
index ae89266..94202c1 100644
--- a/WebCore/inspector/InspectorInstrumentation.cpp
+++ b/WebCore/inspector/InspectorInstrumentation.cpp
@@ -412,6 +412,28 @@ void InspectorInstrumentation::didWriteHTMLImpl(const InspectorInstrumentationCo
timelineAgent->didWriteHTML(endLine);
}
+#if ENABLE(WEB_SOCKETS)
+void InspectorInstrumentation::didCreateWebSocketImpl(InspectorController* inspectorController, unsigned long identifier, const KURL& requestURL, const KURL& documentURL)
+{
+ inspectorController->didCreateWebSocket(identifier, requestURL, documentURL);
+}
+
+void InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl(InspectorController* inspectorController, unsigned long identifier, const WebSocketHandshakeRequest& request)
+{
+ inspectorController->willSendWebSocketHandshakeRequest(identifier, request);
+}
+
+void InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl(InspectorController* inspectorController, unsigned long identifier, const WebSocketHandshakeResponse& response)
+{
+ inspectorController->didReceiveWebSocketHandshakeResponse(identifier, response);
+}
+
+void InspectorInstrumentation::didCloseWebSocketImpl(InspectorController* inspectorController, unsigned long identifier)
+{
+ inspectorController->didCloseWebSocket(identifier);
+}
+#endif
+
bool InspectorInstrumentation::hasFrontend(InspectorController* inspectorController)
{
return inspectorController->hasFrontend();
diff --git a/WebCore/inspector/InspectorInstrumentation.h b/WebCore/inspector/InspectorInstrumentation.h
index e728a5e..1b62ecb 100644
--- a/WebCore/inspector/InspectorInstrumentation.h
+++ b/WebCore/inspector/InspectorInstrumentation.h
@@ -42,11 +42,17 @@ class CharacterData;
class Element;
class InspectorController;
class InspectorTimelineAgent;
+class KURL;
class Node;
class ResourceRequest;
class ResourceResponse;
class XMLHttpRequest;
+#if ENABLE(WEB_SOCKETS)
+class WebSocketHandshakeRequest;
+class WebSocketHandshakeResponse;
+#endif
+
typedef pair<InspectorController*, int> InspectorInstrumentationCookie;
class InspectorInstrumentation {
@@ -90,6 +96,13 @@ public:
static InspectorInstrumentationCookie willWriteHTML(Document*, unsigned int length, unsigned int startLine);
static void didWriteHTML(const InspectorInstrumentationCookie&, unsigned int endLine);
+#if ENABLE(WEB_SOCKETS)
+ static void didCreateWebSocket(ScriptExecutionContext*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
+ static void willSendWebSocketHandshakeRequest(ScriptExecutionContext*, unsigned long identifier, const WebSocketHandshakeRequest&);
+ static void didReceiveWebSocketHandshakeResponse(ScriptExecutionContext*, unsigned long identifier, const WebSocketHandshakeResponse&);
+ static void didCloseWebSocket(ScriptExecutionContext*, unsigned long identifier);
+#endif
+
#if ENABLE(INSPECTOR)
static void frontendCreated() { s_frontendCounter += 1; }
static void frontendDeleted() { s_frontendCounter -= 1; }
@@ -140,6 +153,13 @@ private:
static InspectorInstrumentationCookie willWriteHTMLImpl(InspectorController*, unsigned int length, unsigned int startLine);
static void didWriteHTMLImpl(const InspectorInstrumentationCookie&, unsigned int endLine);
+#if ENABLE(WEB_SOCKETS)
+ static void didCreateWebSocketImpl(InspectorController*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
+ static void willSendWebSocketHandshakeRequestImpl(InspectorController*, unsigned long identifier, const WebSocketHandshakeRequest&);
+ static void didReceiveWebSocketHandshakeResponseImpl(InspectorController*, unsigned long identifier, const WebSocketHandshakeResponse&);
+ static void didCloseWebSocketImpl(InspectorController*, unsigned long identifier);
+#endif
+
static InspectorController* inspectorControllerForContext(ScriptExecutionContext*);
static InspectorController* inspectorControllerForDocument(Document*);
static InspectorController* inspectorControllerForFrame(Frame*);
@@ -460,6 +480,39 @@ inline void InspectorInstrumentation::didWriteHTML(const InspectorInstrumentatio
#endif
}
+#if ENABLE(WEB_SOCKETS)
+inline void InspectorInstrumentation::didCreateWebSocket(ScriptExecutionContext* context, unsigned long identifier, const KURL& requestURL, const KURL& documentURL)
+{
+#if ENABLE(INSPECTOR)
+ if (InspectorController* inspectorController = inspectorControllerForContext(context))
+ didCreateWebSocketImpl(inspectorController, identifier, requestURL, documentURL);
+#endif
+}
+
+inline void InspectorInstrumentation::willSendWebSocketHandshakeRequest(ScriptExecutionContext* context, unsigned long identifier, const WebSocketHandshakeRequest& request)
+{
+#if ENABLE(INSPECTOR)
+ if (InspectorController* inspectorController = inspectorControllerForContext(context))
+ willSendWebSocketHandshakeRequestImpl(inspectorController, identifier, request);
+#endif
+}
+
+inline void InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(ScriptExecutionContext* context, unsigned long identifier, const WebSocketHandshakeResponse& response)
+{
+#if ENABLE(INSPECTOR)
+ if (InspectorController* inspectorController = inspectorControllerForContext(context))
+ didReceiveWebSocketHandshakeResponseImpl(inspectorController, identifier, response);
+#endif
+}
+
+inline void InspectorInstrumentation::didCloseWebSocket(ScriptExecutionContext* context, unsigned long identifier)
+{
+#if ENABLE(INSPECTOR)
+ if (InspectorController* inspectorController = inspectorControllerForContext(context))
+ didCloseWebSocketImpl(inspectorController, identifier);
+#endif
+}
+#endif
#if ENABLE(INSPECTOR)
inline InspectorController* InspectorInstrumentation::inspectorControllerForContext(ScriptExecutionContext* context)
diff --git a/WebCore/inspector/InspectorResource.cpp b/WebCore/inspector/InspectorResource.cpp
index 05b1bff..9b3f95d 100644
--- a/WebCore/inspector/InspectorResource.cpp
+++ b/WebCore/inspector/InspectorResource.cpp
@@ -302,6 +302,7 @@ void InspectorResource::updateScriptObject(InspectorFrontend* frontend)
if (m_changes.hasChange(CompletionChange)) {
jsonObject->setBoolean("failed", m_failed);
+ jsonObject->setString("localizedFailDescription", m_localizedFailDescription);
jsonObject->setBoolean("finished", m_finished);
jsonObject->setBoolean("didCompletionChange", true);
}
@@ -436,9 +437,10 @@ void InspectorResource::endTiming(double actualEndTime)
m_changes.set(CompletionChange);
}
-void InspectorResource::markFailed()
+void InspectorResource::markFailed(const String& localizedDescription)
{
m_failed = true;
+ m_localizedFailDescription = localizedDescription;
m_changes.set(CompletionChange);
}
diff --git a/WebCore/inspector/InspectorResource.h b/WebCore/inspector/InspectorResource.h
index aa6001f..aa4c3b1 100644
--- a/WebCore/inspector/InspectorResource.h
+++ b/WebCore/inspector/InspectorResource.h
@@ -116,7 +116,7 @@ namespace WebCore {
void startTiming();
void endTiming(double actualEndTime);
- void markFailed();
+ void markFailed(const String& localizedDescription);
void addLength(int lengthReceived);
private:
@@ -175,6 +175,7 @@ namespace WebCore {
bool m_cached;
bool m_finished;
bool m_failed;
+ String m_localizedFailDescription;
int m_length;
int m_responseStatusCode;
String m_responseStatusText;
diff --git a/WebCore/inspector/InspectorResourceAgent.cpp b/WebCore/inspector/InspectorResourceAgent.cpp
index f49e1d7..2e965b6 100644
--- a/WebCore/inspector/InspectorResourceAgent.cpp
+++ b/WebCore/inspector/InspectorResourceAgent.cpp
@@ -199,17 +199,23 @@ static PassRefPtr<InspectorObject> buildObjectForResourceResponse(const Resource
return responseObject;
}
-static PassRefPtr<InspectorObject> buildObjectForMainResource(Frame* frame)
+static PassRefPtr<InspectorObject> buildObjectForDocumentLoader(DocumentLoader* loader)
+{
+ RefPtr<InspectorObject> documentLoaderObject = InspectorObject::create();
+ documentLoaderObject->setNumber("frameId", reinterpret_cast<uintptr_t>(loader->frame()));
+ documentLoaderObject->setNumber("loaderId", reinterpret_cast<uintptr_t>(loader));
+ documentLoaderObject->setString("url", loader->requestURL().string());
+ return documentLoaderObject;
+}
+
+static PassRefPtr<InspectorObject> buildObjectForFrameResource(Frame* frame)
{
FrameLoader* frameLoader = frame->loader();
DocumentLoader* loader = frameLoader->documentLoader();
RefPtr<InspectorObject> resourceObject = InspectorObject::create();
resourceObject->setString("url", loader->url().string());
- resourceObject->setString("host", loader->url().host());
- resourceObject->setString("path", loader->url().path());
- resourceObject->setString("lastPathComponent", loader->url().lastPathComponent());
- resourceObject->setString("type", "Document");
+ resourceObject->setObject("loader", buildObjectForDocumentLoader(loader));
resourceObject->setObject("request", buildObjectForResourceRequest(loader->request()));
resourceObject->setObject("response", buildObjectForResourceResponse(loader->response()));
return resourceObject;
@@ -236,21 +242,20 @@ static String cachedResourceTypeString(const CachedResource& cachedResource)
}
}
-static PassRefPtr<InspectorObject> buildObjectForCachedResource(const CachedResource& cachedResource)
+static PassRefPtr<InspectorObject> buildObjectForCachedResource(DocumentLoader* loader, const CachedResource& cachedResource)
{
RefPtr<InspectorObject> resourceObject = InspectorObject::create();
resourceObject->setString("url", cachedResource.url());
resourceObject->setString("type", cachedResourceTypeString(cachedResource));
resourceObject->setNumber("encodedSize", cachedResource.encodedSize());
resourceObject->setObject("response", buildObjectForResourceResponse(cachedResource.response()));
+ resourceObject->setObject("loader", buildObjectForDocumentLoader(loader));
return resourceObject;
}
-static PassRefPtr<InspectorObject> buildObjectForFrameResources(Frame* frame)
+static void populateObjectWithFrameResources(Frame* frame, PassRefPtr<InspectorObject> frameResources)
{
- RefPtr<InspectorObject> frameResources = InspectorObject::create();
- frameResources->setNumber("frameID", reinterpret_cast<uintptr_t>(frame));
- frameResources->setObject("mainResource", buildObjectForMainResource(frame));
+ frameResources->setObject("resource", buildObjectForFrameResource(frame));
RefPtr<InspectorArray> subresources = InspectorArray::create();
frameResources->setArray("subresources", subresources);
@@ -258,19 +263,19 @@ static PassRefPtr<InspectorObject> buildObjectForFrameResources(Frame* frame)
CachedResourceLoader::DocumentResourceMap::const_iterator end = allResources.end();
for (CachedResourceLoader::DocumentResourceMap::const_iterator it = allResources.begin(); it != end; ++it) {
CachedResource* cachedResource = it->second.get();
- if (cachedResource)
- subresources->pushValue(buildObjectForCachedResource(*cachedResource));
+ RefPtr<InspectorObject> cachedResourceObject = buildObjectForCachedResource(frame->loader()->documentLoader(), *cachedResource);
+ subresources->pushValue(cachedResourceObject);
}
- return frameResources;
}
InspectorResourceAgent::~InspectorResourceAgent()
{
}
-void InspectorResourceAgent::identifierForInitialRequest(unsigned long identifier, const KURL& url, DocumentLoader* loader, bool isMainResource)
+void InspectorResourceAgent::identifierForInitialRequest(unsigned long identifier, const KURL& url, DocumentLoader* loader)
{
- m_frontend->identifierForInitialRequest(identifier, url.string(), reinterpret_cast<uintptr_t>(loader->frame()), isMainResource);
+ RefPtr<InspectorObject> loaderObject = buildObjectForDocumentLoader(loader);
+ m_frontend->identifierForInitialRequest(identifier, url.string(), loaderObject);
}
void InspectorResourceAgent::willSendRequest(unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
@@ -321,8 +326,7 @@ void InspectorResourceAgent::didFailLoading(unsigned long identifier, const Reso
void InspectorResourceAgent::didLoadResourceFromMemoryCache(DocumentLoader* loader, const CachedResource* resource)
{
- Frame* frame = loader->frame();
- m_frontend->didLoadResourceFromMemoryCache(currentTime(), reinterpret_cast<uintptr_t>(frame), buildObjectForCachedResource(*resource));
+ m_frontend->didLoadResourceFromMemoryCache(currentTime(), buildObjectForCachedResource(loader, *resource));
}
void InspectorResourceAgent::setOverrideContent(unsigned long identifier, const String& sourceString, InspectorResource::Type type)
@@ -342,10 +346,28 @@ void InspectorResourceAgent::setOverrideContent(unsigned long identifier, const
m_frontend->setOverrideContent(identifier, sourceString, typeString);
}
+static PassRefPtr<InspectorObject> buildObjectForFrameTree(Frame* frame, bool dumpResources)
+{
+ RefPtr<InspectorObject> frameObject = InspectorObject::create();
+ frameObject->setNumber("parentId", reinterpret_cast<uintptr_t>(frame->tree()->parent()));
+ frameObject->setNumber("id", reinterpret_cast<uintptr_t>(frame));
+ if (dumpResources)
+ populateObjectWithFrameResources(frame, frameObject);
+ RefPtr<InspectorArray> childrenArray;
+ for (Frame* child = frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
+ if (!childrenArray) {
+ childrenArray = InspectorArray::create();
+ frameObject->setArray("children", childrenArray);
+ }
+ childrenArray->pushObject(buildObjectForFrameTree(child, dumpResources));
+ }
+ return frameObject;
+}
+
void InspectorResourceAgent::didCommitLoad(DocumentLoader* loader)
{
- Frame* frame = loader->frame();
- m_frontend->didCommitLoad(reinterpret_cast<uintptr_t>(frame));
+ Frame* parentFrame = loader->frame()->tree()->parent();
+ m_frontend->didCommitLoadForFrame(reinterpret_cast<uintptr_t>(parentFrame), buildObjectForDocumentLoader(loader));
}
void InspectorResourceAgent::frameDetachedFromParent(Frame* frame)
@@ -353,7 +375,6 @@ void InspectorResourceAgent::frameDetachedFromParent(Frame* frame)
m_frontend->frameDetachedFromParent(reinterpret_cast<uintptr_t>(frame));
}
-
#if ENABLE(WEB_SOCKETS)
// FIXME: More this into the front-end?
@@ -404,19 +425,20 @@ void InspectorResourceAgent::didCloseWebSocket(unsigned long identifier)
}
#endif // ENABLE(WEB_SOCKETS)
-void InspectorResourceAgent::cachedResources(RefPtr<InspectorArray>* resources)
+void InspectorResourceAgent::cachedResources(RefPtr<InspectorObject>* object)
{
- for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext(m_page->mainFrame()))
- (*resources)->pushObject(buildObjectForFrameResources(frame));
+ *object = buildObjectForFrameTree(m_page->mainFrame(), true);
}
-void InspectorResourceAgent::resourceContent(unsigned long frameID, const String& url, String* content)
+void InspectorResourceAgent::resourceContent(unsigned long frameId, const String& url, bool base64Encode, String* content)
{
- RefPtr<InspectorArray> frameResources = InspectorArray::create();
for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext(m_page->mainFrame())) {
- if (reinterpret_cast<uintptr_t>(frame) != frameID)
+ if (reinterpret_cast<uintptr_t>(frame) != frameId)
continue;
- InspectorResourceAgent::resourceContent(frame, KURL(ParsedURLString, url), content);
+ if (base64Encode)
+ InspectorResourceAgent::resourceContentBase64(frame, KURL(ParsedURLString, url), content);
+ else
+ InspectorResourceAgent::resourceContent(frame, KURL(ParsedURLString, url), content);
break;
}
}
diff --git a/WebCore/inspector/InspectorResourceAgent.h b/WebCore/inspector/InspectorResourceAgent.h
index f0bead8..1cdd292 100644
--- a/WebCore/inspector/InspectorResourceAgent.h
+++ b/WebCore/inspector/InspectorResourceAgent.h
@@ -77,7 +77,7 @@ public:
~InspectorResourceAgent();
- void identifierForInitialRequest(unsigned long identifier, const KURL&, DocumentLoader*, bool isMainResource);
+ void identifierForInitialRequest(unsigned long identifier, const KURL&, DocumentLoader*);
void willSendRequest(unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse);
void markResourceAsCached(unsigned long identifier);
void didReceiveResponse(unsigned long identifier, DocumentLoader* laoder, const ResourceResponse&);
@@ -97,8 +97,8 @@ public:
#endif
// Called from frontend
- void cachedResources(RefPtr<InspectorArray>*);
- void resourceContent(unsigned long frameID, const String& url, String* content);
+ void cachedResources(RefPtr<InspectorObject>*);
+ void resourceContent(unsigned long frameID, const String& url, bool base64Encode, String* content);
private:
InspectorResourceAgent(Page* page, InspectorFrontend* frontend);
diff --git a/WebCore/inspector/InspectorState.cpp b/WebCore/inspector/InspectorState.cpp
index 44065c0..e6d3044 100644
--- a/WebCore/inspector/InspectorState.cpp
+++ b/WebCore/inspector/InspectorState.cpp
@@ -45,9 +45,7 @@ InspectorState::InspectorState(InspectorClient* client)
registerBoolean(timelineProfilerEnabled, false, "timelineProfilerEnabled", (const char*)0);
registerBoolean(searchingForNode, false, "searchingForNodeEnabled", (const char*)0);
registerBoolean(profilerAlwaysEnabled, false, (const char*)0, "profilerEnabled");
- registerString(frontendSettings, "", (const char*)0, "frontendSettings");
registerBoolean(debuggerAlwaysEnabled, false, (const char*)0, "debuggerEnabled");
- registerString(lastActivePanel, InspectorController::LastActivePanel, (const char*)0, "lastActivePanel");
registerBoolean(inspectorStartsAttached, true, (const char*)0, "InspectorStartsAttached");
registerLong(inspectorAttachedHeight, InspectorController::defaultAttachedHeight, (const char*)0, "inspectorAttachedHeight");
registerLong(pauseOnExceptionsState, 0, "pauseOnExceptionsState", (const char*)0);
diff --git a/WebCore/inspector/InspectorState.h b/WebCore/inspector/InspectorState.h
index 5707600..387f3c7 100644
--- a/WebCore/inspector/InspectorState.h
+++ b/WebCore/inspector/InspectorState.h
@@ -1,101 +1,100 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef InspectorState_h
-#define InspectorState_h
-
-#if ENABLE(INSPECTOR)
-
-#include "InspectorValues.h"
-#include "PlatformString.h"
-
-#include <wtf/HashMap.h>
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-class InspectorClient;
-
-class InspectorState {
-public:
- enum InspectorPropertyId {
- monitoringXHR = 1,
- resourceTrackingEnabled,
- resourceTrackingAlwaysEnabled,
- timelineProfilerEnabled,
- searchingForNode,
- profilerAlwaysEnabled,
- frontendSettings,
- debuggerAlwaysEnabled,
- lastActivePanel,
- inspectorStartsAttached,
- inspectorAttachedHeight,
- pauseOnExceptionsState,
- consoleMessagesEnabled,
- lastPropertyId
- };
-
- InspectorState(InspectorClient* client);
-
- PassRefPtr<InspectorObject> generateStateObjectForFrontend();
- void restoreFromInspectorCookie(const String& jsonString);
- void loadFromSettings();
- String getFrontendAlias(InspectorPropertyId propertyId);
-
- bool getBoolean(InspectorPropertyId propertyId);
- String getString(InspectorPropertyId propertyId);
- long getLong(InspectorPropertyId propertyId);
-
- void setBoolean(InspectorPropertyId propertyId, bool value) { setValue(propertyId, InspectorBasicValue::create(value), value ? "true" : "false"); }
- void setString(InspectorPropertyId propertyId, const String& value) { setValue(propertyId, InspectorString::create(value), value); }
- void setLong(InspectorPropertyId propertyId, long value) { setValue(propertyId, InspectorBasicValue::create((double)value), String::number(value)); }
-
-private:
- void updateCookie();
- void setValue(InspectorPropertyId propertyId, PassRefPtr<InspectorValue> value, const String& stringValue);
-
- struct Property {
- static Property create(PassRefPtr<InspectorValue> value, const String& frontendAlias, const String& preferenceName);
- String m_frontendAlias;
- String m_preferenceName;
- RefPtr<InspectorValue> m_value;
- };
- typedef HashMap<long, Property> PropertyMap;
- PropertyMap m_properties;
-
- void registerBoolean(InspectorPropertyId propertyId, bool value, const String& frontendAlias, const String& preferenceName);
- void registerString(InspectorPropertyId propertyId, const String& value, const String& frontendAlias, const String& preferenceName);
- void registerLong(InspectorPropertyId propertyId, long value, const String& frontendAlias, const String& preferenceName);
-
- InspectorClient* m_client;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)
-#endif // !defined(InspectorState_h)
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InspectorState_h
+#define InspectorState_h
+
+#if ENABLE(INSPECTOR)
+
+#include "InspectorValues.h"
+#include "PlatformString.h"
+
+#include <wtf/HashMap.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class InspectorClient;
+
+class InspectorState {
+public:
+ enum InspectorPropertyId {
+ monitoringXHR = 1,
+ resourceTrackingEnabled,
+ resourceTrackingAlwaysEnabled,
+ timelineProfilerEnabled,
+ searchingForNode,
+ profilerAlwaysEnabled,
+ debuggerAlwaysEnabled,
+ lastActivePanel,
+ inspectorStartsAttached,
+ inspectorAttachedHeight,
+ pauseOnExceptionsState,
+ consoleMessagesEnabled,
+ lastPropertyId
+ };
+
+ InspectorState(InspectorClient* client);
+
+ PassRefPtr<InspectorObject> generateStateObjectForFrontend();
+ void restoreFromInspectorCookie(const String& jsonString);
+ void loadFromSettings();
+ String getFrontendAlias(InspectorPropertyId propertyId);
+
+ bool getBoolean(InspectorPropertyId propertyId);
+ String getString(InspectorPropertyId propertyId);
+ long getLong(InspectorPropertyId propertyId);
+
+ void setBoolean(InspectorPropertyId propertyId, bool value) { setValue(propertyId, InspectorBasicValue::create(value), value ? "true" : "false"); }
+ void setString(InspectorPropertyId propertyId, const String& value) { setValue(propertyId, InspectorString::create(value), value); }
+ void setLong(InspectorPropertyId propertyId, long value) { setValue(propertyId, InspectorBasicValue::create((double)value), String::number(value)); }
+
+private:
+ void updateCookie();
+ void setValue(InspectorPropertyId propertyId, PassRefPtr<InspectorValue> value, const String& stringValue);
+
+ struct Property {
+ static Property create(PassRefPtr<InspectorValue> value, const String& frontendAlias, const String& preferenceName);
+ String m_frontendAlias;
+ String m_preferenceName;
+ RefPtr<InspectorValue> m_value;
+ };
+ typedef HashMap<long, Property> PropertyMap;
+ PropertyMap m_properties;
+
+ void registerBoolean(InspectorPropertyId propertyId, bool value, const String& frontendAlias, const String& preferenceName);
+ void registerString(InspectorPropertyId propertyId, const String& value, const String& frontendAlias, const String& preferenceName);
+ void registerLong(InspectorPropertyId propertyId, long value, const String& frontendAlias, const String& preferenceName);
+
+ InspectorClient* m_client;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
+#endif // !defined(InspectorState_h)
diff --git a/WebCore/inspector/InspectorStyleSheet.cpp b/WebCore/inspector/InspectorStyleSheet.cpp
index 11cd649..dc2a47a 100644
--- a/WebCore/inspector/InspectorStyleSheet.cpp
+++ b/WebCore/inspector/InspectorStyleSheet.cpp
@@ -98,6 +98,369 @@ RefPtr<WebCore::CSSRuleSourceData> ParsedStyleSheet::ruleSourceDataAt(unsigned i
namespace WebCore {
+PassRefPtr<InspectorObject> InspectorStyle::buildObjectForStyle() const
+{
+ RefPtr<InspectorObject> result = InspectorObject::create();
+ if (!m_styleId.isEmpty())
+ result->setString("styleId", m_styleId.asString());
+
+ RefPtr<InspectorObject> propertiesObject = InspectorObject::create();
+ propertiesObject->setString("width", m_style->getPropertyValue("width"));
+ propertiesObject->setString("height", m_style->getPropertyValue("height"));
+
+ RefPtr<CSSRuleSourceData> sourceData = m_parentStyleSheet ? m_parentStyleSheet->ruleSourceDataFor(m_style) : 0;
+ if (sourceData) {
+ propertiesObject->setNumber("startOffset", sourceData->styleSourceData->styleBodyRange.start);
+ propertiesObject->setNumber("endOffset", sourceData->styleSourceData->styleBodyRange.end);
+ }
+ result->setObject("properties", propertiesObject);
+
+ populateObjectWithStyleProperties(result.get());
+
+ return result.release();
+}
+
+bool InspectorStyle::setPropertyText(unsigned index, const String& propertyText, bool overwrite)
+{
+ ASSERT(m_parentStyleSheet);
+ if (!m_parentStyleSheet->ensureParsedDataReady())
+ return false;
+
+ Vector<InspectorStyleProperty> allProperties;
+ populateAllProperties(&allProperties);
+
+ unsigned propertyStart = 0; // Need to initialize to make the compiler happy.
+ long propertyLengthDelta;
+
+ if (overwrite) {
+ ASSERT(index < allProperties.size());
+ InspectorStyleProperty& property = allProperties.at(index);
+ propertyStart = property.sourceData.range.start;
+ unsigned propertyEnd = property.sourceData.range.end;
+ unsigned oldLength = propertyEnd - propertyStart;
+ unsigned newLength = propertyText.length();
+ propertyLengthDelta = newLength - oldLength;
+
+ if (!property.disabled) {
+ bool success = replacePropertyInStyleText(property, propertyText);
+ if (!success)
+ return false;
+ } else {
+ property.rawText = propertyText;
+ if (!propertyText.length()) {
+ bool success = enableProperty(index, allProperties);
+ return success;
+ }
+ }
+ } else {
+ // Insert at index.
+ RefPtr<CSSRuleSourceData> sourceData = m_parentStyleSheet->ruleSourceDataFor(m_style);
+ if (!sourceData)
+ return false;
+ String text;
+ bool success = styleText(&text);
+ if (!success)
+ return false;
+ propertyLengthDelta = propertyText.length();
+
+ bool insertLast = true;
+ if (index < allProperties.size()) {
+ InspectorStyleProperty& property = allProperties.at(index);
+ if (property.hasSource) {
+ propertyStart = property.sourceData.range.start;
+ // If inserting before a disabled property, it should be shifted, too.
+ insertLast = false;
+ }
+ }
+ if (insertLast)
+ propertyStart = sourceData->styleSourceData->styleBodyRange.end;
+
+ text.insert(propertyText, propertyStart);
+ m_parentStyleSheet->setStyleText(m_style, text);
+ }
+
+ // Recompute subsequent disabled property ranges.
+ shiftDisabledProperties(disabledIndexByOrdinal(index, true, allProperties), propertyLengthDelta);
+
+ return true;
+}
+
+bool InspectorStyle::toggleProperty(unsigned index, bool disable)
+{
+ ASSERT(m_parentStyleSheet);
+ if (!m_parentStyleSheet->ensureParsedDataReady())
+ return false; // Can toggle only source-based properties.
+ RefPtr<CSSRuleSourceData> sourceData = m_parentStyleSheet->ruleSourceDataFor(m_style);
+ if (!sourceData)
+ return false; // No source data for the style.
+
+ Vector<InspectorStyleProperty> allProperties;
+ populateAllProperties(&allProperties);
+ if (index >= allProperties.size())
+ return false; // Outside of property range.
+
+ InspectorStyleProperty& property = allProperties.at(index);
+ if (property.disabled == disable)
+ return true; // Idempotent operation.
+
+ bool success;
+ if (!disable)
+ success = enableProperty(index, allProperties);
+ else
+ success = disableProperty(index, allProperties);
+
+ return success;
+}
+
+// static
+unsigned InspectorStyle::disabledIndexByOrdinal(unsigned ordinal, bool canUseSubsequent, Vector<InspectorStyleProperty>& allProperties)
+{
+ unsigned disabledIndex = 0;
+ for (unsigned i = 0, size = allProperties.size(); i < size; ++i) {
+ InspectorStyleProperty& property = allProperties.at(i);
+ if (property.disabled) {
+ if (i == ordinal || (canUseSubsequent && i > ordinal))
+ return disabledIndex;
+ ++disabledIndex;
+ }
+ }
+
+ return UINT_MAX;
+}
+
+bool InspectorStyle::styleText(String* result)
+{
+ // Precondition: m_parentStyleSheet->ensureParsedDataReady() has been called successfully.
+ RefPtr<CSSRuleSourceData> sourceData = m_parentStyleSheet->ruleSourceDataFor(m_style);
+ if (!sourceData)
+ return false;
+
+ String styleSheetText;
+ bool success = m_parentStyleSheet->text(&styleSheetText);
+ if (!success)
+ return false;
+
+ SourceRange& bodyRange = sourceData->styleSourceData->styleBodyRange;
+ *result = styleSheetText.substring(bodyRange.start, bodyRange.end - bodyRange.start);
+ return true;
+}
+
+bool InspectorStyle::disableProperty(unsigned indexToDisable, Vector<InspectorStyleProperty>& allProperties)
+{
+ // Precondition: |indexToEnable| points to an enabled property.
+ const InspectorStyleProperty& property = allProperties.at(indexToDisable);
+ InspectorStyleProperty disabledProperty(property);
+ disabledProperty.disabled = true;
+ unsigned propertyStart = property.sourceData.range.start;
+ // This may have to be negated below.
+ long propertyLength = property.sourceData.range.end - propertyStart;
+ disabledProperty.sourceData.range.end = propertyStart;
+ String oldStyleText;
+ bool success = styleText(&oldStyleText);
+ if (!success)
+ return false;
+ disabledProperty.rawText = oldStyleText.substring(propertyStart, propertyLength);
+ success = replacePropertyInStyleText(property, "");
+ if (!success)
+ return false;
+
+ // Add disabled property at correct position.
+ unsigned insertionIndex = disabledIndexByOrdinal(indexToDisable, true, allProperties);
+ if (insertionIndex == UINT_MAX)
+ m_disabledProperties.append(disabledProperty);
+ else {
+ m_disabledProperties.insert(insertionIndex, disabledProperty);
+ shiftDisabledProperties(insertionIndex + 1, -propertyLength); // Property removed from text - shift these back.
+ }
+ return true;
+}
+
+bool InspectorStyle::enableProperty(unsigned indexToEnable, Vector<InspectorStyleProperty>& allProperties)
+{
+ // Precondition: |indexToEnable| points to a disabled property.
+ unsigned disabledIndex = disabledIndexByOrdinal(indexToEnable, false, allProperties);
+ if (disabledIndex == UINT_MAX)
+ return false;
+
+ InspectorStyleProperty disabledProperty = m_disabledProperties.at(disabledIndex);
+ m_disabledProperties.remove(disabledIndex);
+ bool success = replacePropertyInStyleText(disabledProperty, disabledProperty.rawText);
+ if (success)
+ shiftDisabledProperties(disabledIndex, disabledProperty.rawText.length());
+ return success;
+}
+
+bool InspectorStyle::populateAllProperties(Vector<InspectorStyleProperty>* result) const
+{
+ HashSet<String> foundShorthands;
+ HashSet<String> sourcePropertyNames;
+ unsigned disabledIndex = 0;
+ unsigned disabledLength = m_disabledProperties.size();
+ InspectorStyleProperty disabledProperty;
+ if (disabledIndex < disabledLength)
+ disabledProperty = m_disabledProperties.at(disabledIndex);
+
+ RefPtr<CSSRuleSourceData> sourceData = (m_parentStyleSheet && m_parentStyleSheet->ensureParsedDataReady()) ? m_parentStyleSheet->ruleSourceDataFor(m_style) : 0;
+ Vector<CSSPropertySourceData>* sourcePropertyData = sourceData ? &(sourceData->styleSourceData->propertyData) : 0;
+ if (sourcePropertyData) {
+ for (Vector<CSSPropertySourceData>::const_iterator it = sourcePropertyData->begin(); it != sourcePropertyData->end(); ++it) {
+ while (disabledIndex < disabledLength && disabledProperty.sourceData.range.start <= it->range.start) {
+ result->append(disabledProperty);
+ if (++disabledIndex < disabledLength)
+ disabledProperty = m_disabledProperties.at(disabledIndex);
+ }
+ result->append(InspectorStyleProperty(*it, true, false));
+ sourcePropertyNames.add(it->name);
+ }
+ }
+
+ while (disabledIndex < disabledLength) {
+ disabledProperty = m_disabledProperties.at(disabledIndex++);
+ result->append(disabledProperty);
+ }
+
+ for (int i = 0, size = m_style->length(); i < size; ++i) {
+ String name = m_style->item(i);
+ if (sourcePropertyNames.contains(name))
+ continue;
+
+ sourcePropertyNames.add(name);
+ result->append(InspectorStyleProperty(CSSPropertySourceData(name, m_style->getPropertyValue(name), !m_style->getPropertyPriority(name).isEmpty(), true, SourceRange()), false, false));
+ }
+
+ return true;
+}
+
+void InspectorStyle::populateObjectWithStyleProperties(InspectorObject* result) const
+{
+ Vector<InspectorStyleProperty> properties;
+ populateAllProperties(&properties);
+
+ RefPtr<InspectorArray> propertiesObject = InspectorArray::create();
+ RefPtr<InspectorObject> shorthandValues = InspectorObject::create();
+ HashMap<String, RefPtr<InspectorObject> > propertyNameToPreviousActiveProperty;
+ HashSet<String> foundShorthands;
+
+ for (Vector<InspectorStyleProperty>::iterator it = properties.begin(), itEnd = properties.end(); it != itEnd; ++it) {
+ const CSSPropertySourceData& propertyEntry = it->sourceData;
+ const String& name = propertyEntry.name;
+
+ RefPtr<InspectorObject> property = InspectorObject::create();
+ propertiesObject->pushObject(property);
+ property->setString("status", it->disabled ? "disabled" : "active");
+ property->setBoolean("parsedOk", propertyEntry.parsedOk);
+ if (!it->disabled) {
+ property->setString("name", name);
+ property->setString("value", propertyEntry.value);
+ property->setString("priority", propertyEntry.important ? "important" : "");
+ if (it->hasSource) {
+ property->setBoolean("implicit", false);
+ property->setNumber("startOffset", propertyEntry.range.start);
+ property->setNumber("endOffset", propertyEntry.range.end);
+
+ HashMap<String, RefPtr<InspectorObject> >::iterator activeIt = propertyNameToPreviousActiveProperty.find(name);
+ if (activeIt != propertyNameToPreviousActiveProperty.end()) {
+ activeIt->second->setString("status", "inactive");
+ activeIt->second->setString("shorthandName", "");
+ }
+ propertyNameToPreviousActiveProperty.set(name, property);
+ } else {
+ property->setBoolean("implicit", m_style->isPropertyImplicit(name));
+ property->setString("status", "style");
+ }
+ } else
+ property->setString("text", it->rawText);
+
+ if (propertyEntry.parsedOk) {
+ // Both for style-originated and parsed source properties.
+ String shorthand = m_style->getPropertyShorthand(name);
+ property->setString("shorthandName", shorthand);
+ if (!shorthand.isEmpty() && !foundShorthands.contains(shorthand)) {
+ foundShorthands.add(shorthand);
+ shorthandValues->setString(shorthand, shorthandValue(shorthand));
+ }
+ } else
+ property->setString("shorthandName", "");
+ }
+
+ result->setArray("cssProperties", propertiesObject);
+ result->setObject("shorthandValues", shorthandValues);
+}
+
+
+void InspectorStyle::shiftDisabledProperties(unsigned fromIndex, long delta)
+{
+ for (unsigned i = fromIndex, size = m_disabledProperties.size(); i < size; ++i) {
+ SourceRange& range = m_disabledProperties.at(i).sourceData.range;
+ range.start += delta;
+ range.end += delta;
+ }
+}
+
+bool InspectorStyle::replacePropertyInStyleText(const InspectorStyleProperty& property, const String& newText)
+{
+ // Precondition: m_parentStyleSheet->ensureParsedDataReady() has been called successfully.
+ String text;
+ bool success = styleText(&text);
+ if (!success)
+ return false;
+ const SourceRange& range = property.sourceData.range;
+ text.replace(range.start, range.end - range.start, newText);
+ success = m_parentStyleSheet->setStyleText(m_style, text);
+ return success;
+}
+
+String InspectorStyle::shorthandValue(const String& shorthandProperty) const
+{
+ String value = m_style->getPropertyValue(shorthandProperty);
+ if (value.isEmpty()) {
+ for (unsigned i = 0; i < m_style->length(); ++i) {
+ String individualProperty = m_style->item(i);
+ if (m_style->getPropertyShorthand(individualProperty) != shorthandProperty)
+ continue;
+ if (m_style->isPropertyImplicit(individualProperty))
+ continue;
+ String individualValue = m_style->getPropertyValue(individualProperty);
+ if (individualValue == "initial")
+ continue;
+ if (value.length())
+ value.append(" ");
+ value.append(individualValue);
+ }
+ }
+ return value;
+}
+
+String InspectorStyle::shorthandPriority(const String& shorthandProperty) const
+{
+ String priority = m_style->getPropertyPriority(shorthandProperty);
+ if (priority.isEmpty()) {
+ for (unsigned i = 0; i < m_style->length(); ++i) {
+ String individualProperty = m_style->item(i);
+ if (m_style->getPropertyShorthand(individualProperty) != shorthandProperty)
+ continue;
+ priority = m_style->getPropertyPriority(individualProperty);
+ break;
+ }
+ }
+ return priority;
+}
+
+Vector<String> InspectorStyle::longhandProperties(const String& shorthandProperty) const
+{
+ Vector<String> properties;
+ HashSet<String> foundProperties;
+ for (unsigned i = 0; i < m_style->length(); ++i) {
+ String individualProperty = m_style->item(i);
+ if (foundProperties.contains(individualProperty) || m_style->getPropertyShorthand(individualProperty) != shorthandProperty)
+ continue;
+
+ foundProperties.add(individualProperty);
+ properties.append(individualProperty);
+ }
+ return properties;
+}
+
InspectorStyleSheet::InspectorStyleSheet(const String& id, CSSStyleSheet* pageStyleSheet, const String& origin, const String& documentURL)
: m_id(id)
, m_pageStyleSheet(pageStyleSheet)
@@ -121,14 +484,15 @@ bool InspectorStyleSheet::setText(const String& text)
m_parsedStyleSheet->setText(text);
for (unsigned i = 0, size = m_pageStyleSheet->length(); i < size; ++i)
m_pageStyleSheet->remove(i);
+ m_inspectorStyles.clear();
m_pageStyleSheet->parseString(text, m_pageStyleSheet->useStrictParsing());
return true;
}
-bool InspectorStyleSheet::setRuleSelector(const String& ruleId, const String& selector)
+bool InspectorStyleSheet::setRuleSelector(const InspectorCSSId& id, const String& selector)
{
- CSSStyleRule* rule = ruleForId(ruleId);
+ CSSStyleRule* rule = ruleForId(id);
if (!rule)
return false;
CSSStyleSheet* styleSheet = InspectorCSSAgent::parentStyleSheet(rule);
@@ -140,18 +504,16 @@ bool InspectorStyleSheet::setRuleSelector(const String& ruleId, const String& se
if (!sourceData)
return false;
- const String& sheetText = m_parsedStyleSheet->text();
- String newStyleSheetText = sheetText.substring(0, sourceData->selectorListRange.start);
- newStyleSheetText += selector;
- newStyleSheetText += sheetText.right(sheetText.length() - sourceData->selectorListRange.end);
- m_parsedStyleSheet->setText(newStyleSheetText);
+ String sheetText = m_parsedStyleSheet->text();
+ sheetText.replace(sourceData->selectorListRange.start, sourceData->selectorListRange.end - sourceData->selectorListRange.start, selector);
+ m_parsedStyleSheet->setText(sheetText);
return true;
}
CSSStyleRule* InspectorStyleSheet::addRule(const String& selector)
{
- String text;
- bool success = styleSheetText(&text);
+ String styleSheetText;
+ bool success = text(&styleSheetText);
if (!success)
return 0;
@@ -164,23 +526,24 @@ CSSStyleRule* InspectorStyleSheet::addRule(const String& selector)
CSSStyleRule* rule = InspectorCSSAgent::asCSSStyleRule(rules->item(rules->length() - 1));
ASSERT(rule);
- if (text.length())
- text += "\n";
+ if (styleSheetText.length())
+ styleSheetText += "\n";
- text += selector;
- text += " {}";
- m_parsedStyleSheet->setText(text);
+ styleSheetText += selector;
+ styleSheetText += " {}";
+ m_parsedStyleSheet->setText(styleSheetText);
return rule;
}
-CSSStyleRule* InspectorStyleSheet::ruleForId(const String& id) const
+CSSStyleRule* InspectorStyleSheet::ruleForId(const InspectorCSSId& id) const
{
if (!m_pageStyleSheet)
return 0;
+ ASSERT(!id.isEmpty());
bool ok;
- unsigned index = id.toUInt(&ok);
+ unsigned index = id.ordinal().toUInt(&ok);
if (!ok)
return 0;
@@ -204,19 +567,20 @@ PassRefPtr<InspectorObject> InspectorStyleSheet::buildObjectForStyleSheet()
return 0;
RefPtr<InspectorObject> result = InspectorObject::create();
- result->setString("id", id());
result->setBoolean("disabled", styleSheet->disabled());
- result->setString("href", styleSheet->href());
+ result->setString("sourceURL", styleSheet->href());
result->setString("title", styleSheet->title());
RefPtr<CSSRuleList> cssRuleList = CSSRuleList::create(styleSheet, true);
RefPtr<InspectorArray> cssRules = buildArrayForRuleList(cssRuleList.get());
- result->setArray("cssRules", cssRules.release());
+ result->setArray("rules", cssRules.release());
String styleSheetText;
bool success = text(&styleSheetText);
if (success)
result->setString("text", styleSheetText);
+ result->setString("styleSheetId", id());
+
return result.release();
}
@@ -228,27 +592,13 @@ PassRefPtr<InspectorObject> InspectorStyleSheet::buildObjectForRule(CSSStyleRule
RefPtr<InspectorObject> result = InspectorObject::create();
result->setString("selectorText", rule->selectorText());
- result->setString("cssText", rule->cssText());
+ result->setString("sourceURL", !styleSheet->href().isEmpty() ? styleSheet->href() : m_documentURL);
result->setNumber("sourceLine", rule->sourceLine());
- result->setString("documentURL", m_documentURL);
-
- RefPtr<InspectorObject> parentStyleSheetValue = InspectorObject::create();
- parentStyleSheetValue->setString("id", id());
- parentStyleSheetValue->setString("href", styleSheet->href());
- result->setObject("parentStyleSheet", parentStyleSheetValue.release());
result->setString("origin", m_origin);
- RefPtr<CSSRuleSourceData> sourceData;
- if (ensureParsedDataReady())
- sourceData = ruleSourceDataFor(rule->style());
- if (sourceData) {
- result->setNumber("selectorStartOffset", sourceData->selectorListRange.start);
- result->setNumber("selectorEndOffset", sourceData->selectorListRange.end);
- }
-
result->setObject("style", buildObjectForStyle(rule->style()));
if (canBind())
- result->setString("id", fullRuleId(rule));
+ result->setString("ruleId", ruleId(rule).asString());
return result.release();
}
@@ -259,12 +609,48 @@ PassRefPtr<InspectorObject> InspectorStyleSheet::buildObjectForStyle(CSSStyleDec
if (ensureParsedDataReady())
sourceData = ruleSourceDataFor(style);
- RefPtr<InspectorObject> result = InspectorCSSAgent::buildObjectForStyle(style, fullStyleId(style), sourceData ? sourceData->styleSourceData.get() : 0);
- result->setString("parentStyleSheetId", id());
+ RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(ruleOrStyleId(style));
+ RefPtr<InspectorObject> result = inspectorStyle->buildObjectForStyle();
+
+ // Style text cannot be retrieved without stylesheet, so set cssText here.
+ if (sourceData) {
+ String sheetText;
+ bool success = text(&sheetText);
+ if (success) {
+ const SourceRange& bodyRange = sourceData->styleSourceData->styleBodyRange;
+ result->setString("cssText", sheetText.substring(bodyRange.start, bodyRange.end - bodyRange.start));
+ }
+ }
+
return result.release();
}
-CSSStyleDeclaration* InspectorStyleSheet::styleForId(const String& id) const
+bool InspectorStyleSheet::setPropertyText(const InspectorCSSId& id, unsigned propertyIndex, const String& text, bool overwrite)
+{
+ RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id);
+ if (!inspectorStyle)
+ return false;
+
+ return inspectorStyle->setPropertyText(propertyIndex, text, overwrite);
+}
+
+bool InspectorStyleSheet::toggleProperty(const InspectorCSSId& id, unsigned propertyIndex, bool disable)
+{
+ RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id);
+ if (!inspectorStyle)
+ return false;
+
+ bool success = inspectorStyle->toggleProperty(propertyIndex, disable);
+ if (success) {
+ if (disable)
+ rememberInspectorStyle(inspectorStyle);
+ else if (!inspectorStyle->hasDisabledProperties())
+ forgetInspectorStyle(inspectorStyle->cssStyle());
+ }
+ return success;
+}
+
+CSSStyleDeclaration* InspectorStyleSheet::styleForId(const InspectorCSSId& id) const
{
CSSStyleRule* rule = ruleForId(id);
if (!rule)
@@ -273,13 +659,36 @@ CSSStyleDeclaration* InspectorStyleSheet::styleForId(const String& id) const
return rule->style();
}
-bool InspectorStyleSheet::setStyleText(const String& styleId, const String& newText)
+PassRefPtr<InspectorStyle> InspectorStyleSheet::inspectorStyleForId(const InspectorCSSId& id)
{
- CSSStyleDeclaration* style = styleForId(styleId);
+ CSSStyleDeclaration* style = styleForId(id);
if (!style)
- return false;
+ return 0;
+
+ InspectorStyleMap::iterator it = m_inspectorStyles.find(style);
+ if (it == m_inspectorStyles.end()) {
+ RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(id, style, this);
+ return inspectorStyle.release();
+ }
+ return it->second;
+}
- return innerSetStyleText(style, newText);
+void InspectorStyleSheet::rememberInspectorStyle(RefPtr<InspectorStyle> inspectorStyle)
+{
+ m_inspectorStyles.set(inspectorStyle->cssStyle(), inspectorStyle);
+}
+
+void InspectorStyleSheet::forgetInspectorStyle(CSSStyleDeclaration* style)
+{
+ m_inspectorStyles.remove(style);
+}
+
+InspectorCSSId InspectorStyleSheet::ruleOrStyleId(CSSStyleDeclaration* style) const
+{
+ unsigned index = ruleIndexByStyle(style);
+ if (index != UINT_MAX)
+ return InspectorCSSId::createFromParts(id(), String::number(index));
+ return InspectorCSSId();
}
Document* InspectorStyleSheet::ownerDocument() const
@@ -328,7 +737,7 @@ bool InspectorStyleSheet::ensureText() const
return true;
String text;
- bool success = styleSheetText(&text);
+ bool success = originalStyleSheetText(&text);
if (success)
m_parsedStyleSheet->setText(text);
@@ -362,12 +771,7 @@ bool InspectorStyleSheet::ensureSourceData(Node* ownerNode)
return m_parsedStyleSheet->hasSourceData();
}
-void InspectorStyleSheet::innerSetStyleSheetText(const String& newText)
-{
- m_parsedStyleSheet->setText(newText);
-}
-
-bool InspectorStyleSheet::innerSetStyleText(CSSStyleDeclaration* style, const String& text)
+bool InspectorStyleSheet::setStyleText(CSSStyleDeclaration* style, const String& text)
{
if (!pageStyleSheet())
return false;
@@ -379,14 +783,14 @@ bool InspectorStyleSheet::innerSetStyleText(CSSStyleDeclaration* style, const St
if (!success)
return false;
- String id = ruleOrStyleId(style);
+ InspectorCSSId id = ruleOrStyleId(style);
if (id.isEmpty())
return false;
ExceptionCode ec = 0;
style->setCssText(text, ec);
if (!ec)
- innerSetStyleSheetText(patchedStyleSheetText);
+ m_parsedStyleSheet->setText(patchedStyleSheetText);
return !ec;
}
@@ -407,10 +811,8 @@ bool InspectorStyleSheet::styleSheetTextWithChangedStyle(CSSStyleDeclaration* st
String text = m_parsedStyleSheet->text();
ASSERT(bodyEnd <= text.length()); // bodyEnd is exclusive
- String patchedText = text.substring(0, bodyStart);
- patchedText += newStyleText;
- patchedText += text.substring(bodyEnd, text.length());
- *result = patchedText;
+ text.replace(bodyStart, bodyEnd - bodyStart, newStyleText);
+ *result = text;
return true;
}
@@ -426,9 +828,9 @@ CSSStyleRule* InspectorStyleSheet::findPageRuleWithStyle(CSSStyleDeclaration* st
return 0;
}
-String InspectorStyleSheet::fullRuleId(CSSStyleRule* rule) const
+InspectorCSSId InspectorStyleSheet::ruleId(CSSStyleRule* rule) const
{
- return fullRuleOrStyleId(rule->style());
+ return ruleOrStyleId(rule->style());
}
void InspectorStyleSheet::revalidateStyle(CSSStyleDeclaration* pageStyle)
@@ -444,15 +846,18 @@ void InspectorStyleSheet::revalidateStyle(CSSStyleDeclaration* pageStyle)
if (!parsedRule)
continue;
if (parsedRule->style() == pageStyle) {
- if (parsedRule->style()->cssText() != pageStyle->cssText())
- innerSetStyleText(pageStyle, pageStyle->cssText());
+ if (parsedRule->style()->cssText() != pageStyle->cssText()) {
+ // Clear the disabled properties for the invalid style here.
+ m_inspectorStyles.remove(pageStyle);
+ setStyleText(pageStyle, pageStyle->cssText());
+ }
break;
}
}
m_isRevalidating = false;
}
-bool InspectorStyleSheet::styleSheetText(String* result) const
+bool InspectorStyleSheet::originalStyleSheetText(String* result) const
{
String text;
bool success = inlineStyleSheetText(&text);
@@ -465,7 +870,7 @@ bool InspectorStyleSheet::styleSheetText(String* result) const
bool InspectorStyleSheet::resourceStyleSheetText(String* result) const
{
- if (!m_pageStyleSheet)
+ if (!m_pageStyleSheet || !ownerDocument())
return false;
return InspectorResourceAgent::resourceContent(ownerDocument()->frame(), m_pageStyleSheet->finalURL(), result);
@@ -509,12 +914,12 @@ InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle(const Strin
, m_ruleSourceData(0)
{
ASSERT(element);
+ m_inspectorStyle = InspectorStyle::create(InspectorCSSId::createFromParts(id, "0"), inlineStyle(), this);
}
-bool InspectorStyleSheetForInlineStyle::setStyleText(const String& styleId, const String& text)
+bool InspectorStyleSheetForInlineStyle::setStyleText(CSSStyleDeclaration* style, const String& text)
{
- ASSERT(styleId == "0");
- UNUSED_PARAM(styleId);
+ ASSERT_UNUSED(style, style == inlineStyle());
ExceptionCode ec = 0;
m_element->setAttribute("style", text, ec);
m_ruleSourceData.clear();
@@ -541,6 +946,12 @@ bool InspectorStyleSheetForInlineStyle::ensureParsedDataReady()
return true;
}
+PassRefPtr<InspectorStyle> InspectorStyleSheetForInlineStyle::inspectorStyleForId(const InspectorCSSId& id)
+{
+ ASSERT_UNUSED(id, id.ordinal() == "0");
+ return m_inspectorStyle;
+}
+
CSSStyleDeclaration* InspectorStyleSheetForInlineStyle::inlineStyle() const
{
return m_element->style();
diff --git a/WebCore/inspector/InspectorStyleSheet.h b/WebCore/inspector/InspectorStyleSheet.h
index 38ab777..06c4093 100644
--- a/WebCore/inspector/InspectorStyleSheet.h
+++ b/WebCore/inspector/InspectorStyleSheet.h
@@ -26,16 +26,14 @@
#define InspectorStyleSheet_h
#include "CSSPropertySourceData.h"
-#include "Document.h"
#include "InspectorValues.h"
#include "PlatformString.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
-#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
-#include <wtf/UnusedParam.h>
+#include <wtf/Vector.h>
class ParsedStyleSheet;
@@ -43,13 +41,102 @@ namespace WebCore {
class CSSRuleList;
class CSSStyleDeclaration;
+class CSSStyleSheet;
+class Document;
class Element;
+class InspectorStyleSheet;
class Node;
#if ENABLE(INSPECTOR)
+class InspectorCSSId {
+public:
+ static InspectorCSSId createFromParts(const String& styleSheetId, const String& ordinal) { return InspectorCSSId(styleSheetId + ":" + ordinal); }
+
+ InspectorCSSId() { }
+ explicit InspectorCSSId(const String& id)
+ {
+ id.split(':', m_idParts);
+ ASSERT(m_idParts.size() == 2);
+ }
+
+ const String& styleSheetId() const { ASSERT(m_idParts.size() == 2); return m_idParts.at(0); }
+ const String& ordinal() const { ASSERT(m_idParts.size() == 2); return m_idParts.at(1); }
+ bool isEmpty() const { return m_idParts.isEmpty(); }
+ String asString() const
+ {
+ if (isEmpty())
+ return String();
+
+ return m_idParts.at(0) + ":" + m_idParts.at(1);
+ }
+
+private:
+ Vector<String> m_idParts;
+};
+
+struct InspectorStyleProperty {
+ InspectorStyleProperty()
+ {
+ }
+
+ InspectorStyleProperty(CSSPropertySourceData sourceData, bool hasSource, bool disabled)
+ : sourceData(sourceData)
+ , hasSource(hasSource)
+ , disabled(disabled)
+ {
+ }
+
+ CSSPropertySourceData sourceData;
+ bool hasSource;
+ bool disabled;
+ String rawText;
+};
+
+class InspectorStyle : public RefCounted<InspectorStyle> {
+public:
+ static PassRefPtr<InspectorStyle> create(const InspectorCSSId& styleId, CSSStyleDeclaration* style, InspectorStyleSheet* parentStyleSheet)
+ {
+ return adoptRef(new InspectorStyle(styleId, style, parentStyleSheet));
+ }
+
+ InspectorStyle(const InspectorCSSId& styleId, CSSStyleDeclaration* style, InspectorStyleSheet* parentStyleSheet)
+ : m_styleId(styleId)
+ , m_style(style)
+ , m_parentStyleSheet(parentStyleSheet)
+ {
+ ASSERT(style);
+ }
+
+ CSSStyleDeclaration* cssStyle() const { return m_style; }
+ PassRefPtr<InspectorObject> buildObjectForStyle() const;
+ bool hasDisabledProperties() const { return !m_disabledProperties.isEmpty(); }
+ bool setPropertyText(unsigned index, const String& text, bool overwrite);
+ bool toggleProperty(unsigned index, bool disable);
+
+private:
+ static unsigned disabledIndexByOrdinal(unsigned ordinal, bool canUseSubsequent, Vector<InspectorStyleProperty>& allProperties);
+
+ bool styleText(String* result);
+ bool disableProperty(unsigned indexToDisable, Vector<InspectorStyleProperty>& allProperties);
+ bool enableProperty(unsigned indexToEnable, Vector<InspectorStyleProperty>& allProperties);
+ bool populateAllProperties(Vector<InspectorStyleProperty>* result) const;
+ void populateObjectWithStyleProperties(InspectorObject* result) const;
+ void shiftDisabledProperties(unsigned fromIndex, long offset);
+ bool replacePropertyInStyleText(const InspectorStyleProperty& property, const String& newText);
+ String shorthandValue(const String& shorthandProperty) const;
+ String shorthandPriority(const String& shorthandProperty) const;
+ Vector<String> longhandProperties(const String& shorthandProperty) const;
+
+ InspectorCSSId m_styleId;
+ CSSStyleDeclaration* m_style;
+ InspectorStyleSheet* m_parentStyleSheet;
+ Vector<InspectorStyleProperty> m_disabledProperties;
+};
+
class InspectorStyleSheet : public RefCounted<InspectorStyleSheet> {
public:
+ typedef HashMap<CSSStyleDeclaration*, RefPtr<InspectorStyle> > InspectorStyleMap;
static PassRefPtr<InspectorStyleSheet> create(const String& id, CSSStyleSheet* pageStyleSheet, const String& origin, const String& documentURL)
{
return adoptRef(new InspectorStyleSheet(id, pageStyleSheet, origin, documentURL));
@@ -61,46 +148,55 @@ public:
const String& id() const { return m_id; }
CSSStyleSheet* pageStyleSheet() const { return m_pageStyleSheet; }
bool setText(const String&);
- bool setRuleSelector(const String& ruleId, const String& selector);
+ bool setRuleSelector(const InspectorCSSId&, const String& selector);
CSSStyleRule* addRule(const String& selector);
- CSSStyleRule* ruleForId(const String&) const;
+ CSSStyleRule* ruleForId(const InspectorCSSId&) const;
PassRefPtr<InspectorObject> buildObjectForStyleSheet();
PassRefPtr<InspectorObject> buildObjectForRule(CSSStyleRule*);
PassRefPtr<InspectorObject> buildObjectForStyle(CSSStyleDeclaration*);
- virtual CSSStyleDeclaration* styleForId(const String&) const;
- virtual bool setStyleText(const String& styleId, const String& text);
+ bool setPropertyText(const InspectorCSSId&, unsigned propertyIndex, const String& text, bool overwrite);
+ bool toggleProperty(const InspectorCSSId&, unsigned propertyIndex, bool disable);
+
+ virtual CSSStyleDeclaration* styleForId(const InspectorCSSId&) const;
protected:
bool canBind() const { return m_origin != "userAgent" && m_origin != "user"; }
- String fullRuleOrStyleId(CSSStyleDeclaration* style) const { return id() + ":" + ruleOrStyleId(style); }
- String ruleOrStyleId(CSSStyleDeclaration* style) const { unsigned index = ruleIndexByStyle(style); return index == UINT_MAX ? "" : String::number(index); }
+ InspectorCSSId ruleOrStyleId(CSSStyleDeclaration* style) const;
virtual Document* ownerDocument() const;
virtual RefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration* style) const;
virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const;
virtual bool ensureParsedDataReady();
+ virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&);
+ virtual void rememberInspectorStyle(RefPtr<InspectorStyle> inspectorStyle);
+ virtual void forgetInspectorStyle(CSSStyleDeclaration* style);
+
+ // Also accessed by friend class InspectorStyle.
+ virtual bool setStyleText(CSSStyleDeclaration*, const String&);
private:
bool text(String* result) const;
bool ensureText() const;
bool ensureSourceData(Node* ownerNode);
- void innerSetStyleSheetText(const String& newText);
- bool innerSetStyleText(CSSStyleDeclaration*, const String&);
bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newStyleText, String* result);
CSSStyleRule* findPageRuleWithStyle(CSSStyleDeclaration*);
- String fullRuleId(CSSStyleRule* rule) const;
- String fullStyleId(CSSStyleDeclaration* style) const { return fullRuleOrStyleId(style); }
+ InspectorCSSId ruleId(CSSStyleRule* rule) const;
+ InspectorCSSId styleId(CSSStyleDeclaration* style) const { return ruleOrStyleId(style); }
void revalidateStyle(CSSStyleDeclaration*);
- bool styleSheetText(String* result) const;
+ bool originalStyleSheetText(String* result) const;
bool resourceStyleSheetText(String* result) const;
bool inlineStyleSheetText(String* result) const;
PassRefPtr<InspectorArray> buildArrayForRuleList(CSSRuleList*);
+
String m_id;
CSSStyleSheet* m_pageStyleSheet;
String m_origin;
String m_documentURL;
bool m_isRevalidating;
ParsedStyleSheet* m_parsedStyleSheet;
+ InspectorStyleMap m_inspectorStyles;
+
+ friend class InspectorStyle;
};
class InspectorStyleSheetForInlineStyle : public InspectorStyleSheet {
@@ -111,14 +207,19 @@ public:
}
InspectorStyleSheetForInlineStyle(const String& id, Element* element, const String& origin);
- virtual CSSStyleDeclaration* styleForId(const String& id) const { ASSERT(id == "0"); UNUSED_PARAM(id); return inlineStyle(); }
- virtual bool setStyleText(const String& styleId, const String& text);
+ virtual CSSStyleDeclaration* styleForId(const InspectorCSSId& id) const { ASSERT_UNUSED(id, id.ordinal() == "0"); return inlineStyle(); }
protected:
virtual Document* ownerDocument() const;
- virtual RefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration* style) const { ASSERT(style == inlineStyle()); UNUSED_PARAM(style); return m_ruleSourceData; }
+ virtual RefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration* style) const { ASSERT_UNUSED(style, style == inlineStyle()); return m_ruleSourceData; }
virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const { return 0; }
virtual bool ensureParsedDataReady();
+ virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&);
+ virtual void rememberInspectorStyle(RefPtr<InspectorStyle>) { }
+ virtual void forgetInspectorStyle(CSSStyleDeclaration*) { }
+
+ // Also accessed by friend class InspectorStyle.
+ virtual bool setStyleText(CSSStyleDeclaration*, const String&);
private:
CSSStyleDeclaration* inlineStyle() const;
@@ -126,6 +227,7 @@ private:
Element* m_element;
RefPtr<CSSRuleSourceData> m_ruleSourceData;
+ RefPtr<InspectorStyle> m_inspectorStyle;
};
#endif
diff --git a/WebCore/inspector/front-end/ApplicationCacheItemsView.js b/WebCore/inspector/front-end/ApplicationCacheItemsView.js
index f450938..f5147e3 100644
--- a/WebCore/inspector/front-end/ApplicationCacheItemsView.js
+++ b/WebCore/inspector/front-end/ApplicationCacheItemsView.js
@@ -64,7 +64,7 @@ WebInspector.ApplicationCacheItemsView = function(treeElement, appcacheDomain)
this._appcacheDomain = appcacheDomain;
this._emptyMsgElement = document.createElement("div");
- this._emptyMsgElement.className = "storage-table-empty";
+ this._emptyMsgElement.className = "storage-empty-view";
this._emptyMsgElement.textContent = WebInspector.UIString("No Application Cache information available.");
this.element.appendChild(this._emptyMsgElement);
diff --git a/WebCore/inspector/front-end/AuditLauncherView.js b/WebCore/inspector/front-end/AuditLauncherView.js
index a922715..d4bbf90 100644
--- a/WebCore/inspector/front-end/AuditLauncherView.js
+++ b/WebCore/inspector/front-end/AuditLauncherView.js
@@ -269,6 +269,7 @@ WebInspector.AuditLauncherView.prototype = {
this._selectAllClicked(this._selectAllCheckboxElement.checked);
this.updateResourceTrackingState();
this._updateButton();
+ this._updateResourceProgress();
},
_updateResourceProgress: function()
diff --git a/WebCore/inspector/front-end/AuditRules.js b/WebCore/inspector/front-end/AuditRules.js
index cd9f13e..515ce8e 100644
--- a/WebCore/inspector/front-end/AuditRules.js
+++ b/WebCore/inspector/front-end/AuditRules.js
@@ -286,8 +286,8 @@ WebInspector.AuditRules.UnusedCssRule.prototype = {
var testedSelectors = {};
for (var i = 0; i < styleSheets.length; ++i) {
var styleSheet = styleSheets[i];
- for (var curRule = 0; curRule < styleSheet.cssRules.length; ++curRule) {
- var rule = styleSheet.cssRules[curRule];
+ for (var curRule = 0; curRule < styleSheet.rules.length; ++curRule) {
+ var rule = styleSheet.rules[curRule];
if (rule.selectorText.match(pseudoSelectorRegexp))
continue;
selectors.push(rule.selectorText);
@@ -307,9 +307,10 @@ WebInspector.AuditRules.UnusedCssRule.prototype = {
var stylesheetSize = 0;
var unusedStylesheetSize = 0;
var unusedRules = [];
- for (var curRule = 0; curRule < styleSheet.cssRules.length; ++curRule) {
- var rule = styleSheet.cssRules[curRule];
- var textLength = rule.cssText ? rule.cssText.length : 0;
+ for (var curRule = 0; curRule < styleSheet.rules.length; ++curRule) {
+ var rule = styleSheet.rules[curRule];
+ // FIXME: replace this by an exact computation once source ranges are available
+ var textLength = rule.style.cssText ? rule.style.cssText.length + rule.selectorText.length : 0;
stylesheetSize += textLength;
if (!testedSelectors[rule.selectorText] || foundSelectors[rule.selectorText])
continue;
@@ -322,7 +323,7 @@ WebInspector.AuditRules.UnusedCssRule.prototype = {
if (!unusedRules.length)
continue;
- var url = styleSheet.href ? WebInspector.AuditRuleResult.linkifyDisplayName(styleSheet.href) : String.sprintf("Inline block #%d", ++inlineBlockOrdinal);
+ var url = styleSheet.sourceURL ? WebInspector.AuditRuleResult.linkifyDisplayName(styleSheet.sourceURL) : String.sprintf("Inline block #%d", ++inlineBlockOrdinal);
var pctUnused = Math.round(100 * unusedStylesheetSize / stylesheetSize);
if (!summary)
summary = result.addChild("", true);
@@ -657,7 +658,7 @@ WebInspector.AuditRules.ImageDimensionsRule.prototype = {
if (completeSrc)
src = completeSrc;
- const computedStyle = new WebInspector.CSSStyleDeclaration(styles.computedStyle);
+ const computedStyle = WebInspector.CSSStyleDeclaration.parsePayload(styles.computedStyle);
if (computedStyle.getPropertyValue("position") === "absolute") {
if (!context.imagesLeft)
doneCallback(context);
@@ -668,7 +669,7 @@ WebInspector.AuditRules.ImageDimensionsRule.prototype = {
var heightFound = "height" in styles.styleAttributes;
for (var i = styles.matchedCSSRules.length - 1; i >= 0 && !(widthFound && heightFound); --i) {
- var style = WebInspector.CSSStyleDeclaration.parseRule(styles.matchedCSSRules[i]).style;
+ var style = WebInspector.CSSRule.parsePayload(styles.matchedCSSRules[i]).style;
if (style.getPropertyValue("width") !== "")
widthFound = true;
if (style.getPropertyValue("height") !== "")
diff --git a/WebCore/inspector/front-end/AuditsPanel.js b/WebCore/inspector/front-end/AuditsPanel.js
index f6cbed0..b4eb202 100644
--- a/WebCore/inspector/front-end/AuditsPanel.js
+++ b/WebCore/inspector/front-end/AuditsPanel.js
@@ -130,8 +130,8 @@ WebInspector.AuditsPanel.prototype = {
_executeAudit: function(categories, resultCallback)
{
var resources = [];
- for (var id in WebInspector.resources)
- resources.push(WebInspector.resources[id]);
+ for (var id in WebInspector.networkResources)
+ resources.push(WebInspector.networkResources[id]);
var rulesRemaining = 0;
for (var i = 0; i < categories.length; ++i)
@@ -205,8 +205,8 @@ WebInspector.AuditsPanel.prototype = {
{
this._resourceTrackingCallback = callback;
- if (!WebInspector.panels.resources.resourceTrackingEnabled) {
- InspectorBackend.enableResourceTracking(false);
+ if (WebInspector.panels.resources && !WebInspector.panels.resources.resourceTrackingEnabled) {
+ WebInspector.panels.resources.toggleResourceTracking(false);
this._updateLauncherViewControls(true);
} else
InspectorBackend.reloadPage();
@@ -256,7 +256,7 @@ WebInspector.AuditsPanel.prototype = {
show: function()
{
WebInspector.Panel.prototype.show.call(this);
- this._updateLauncherViewControls(WebInspector.panels.resources.resourceTrackingEnabled);
+ this._updateLauncherViewControls(!WebInspector.panels.resources || WebInspector.panels.resources.resourceTrackingEnabled);
},
reset: function()
diff --git a/WebCore/inspector/front-end/CSSStyleModel.js b/WebCore/inspector/front-end/CSSStyleModel.js
index e3e9b4f..702c923 100644
--- a/WebCore/inspector/front-end/CSSStyleModel.js
+++ b/WebCore/inspector/front-end/CSSStyleModel.js
@@ -32,15 +32,84 @@ WebInspector.CSSStyleModel = function()
{
}
+WebInspector.CSSStyleModel.parseRuleArrayPayload = function(ruleArray)
+{
+ var result = [];
+ for (var i = 0; i < ruleArray.length; ++i)
+ result.push(WebInspector.CSSRule.parsePayload(ruleArray[i]));
+ return result;
+}
+
WebInspector.CSSStyleModel.prototype = {
- getStylesAsync: function(nodeId, authOnly, userCallback)
+ getStylesAsync: function(nodeId, userCallback)
{
- InspectorBackend.getStyles(nodeId, authOnly, userCallback);
+ function callback(userCallback, payload)
+ {
+ if (!payload) {
+ if (userCallback)
+ userCallback(null);
+ return;
+ }
+
+ var result = {};
+ if ("inlineStyle" in payload)
+ result.inlineStyle = WebInspector.CSSStyleDeclaration.parsePayload(payload.inlineStyle);
+
+ result.computedStyle = WebInspector.CSSStyleDeclaration.parsePayload(payload.computedStyle);
+ result.matchedCSSRules = WebInspector.CSSStyleModel.parseRuleArrayPayload(payload.matchedCSSRules);
+
+ result.styleAttributes = {};
+ for (var name in payload.styleAttributes)
+ result.styleAttributes[name] = WebInspector.CSSStyleDeclaration.parsePayload(payload.styleAttributes[name]);
+
+ result.pseudoElements = [];
+ for (var i = 0; i < payload.pseudoElements.length; ++i) {
+ var entryPayload = payload.pseudoElements[i];
+ result.pseudoElements.push({ pseudoId: entryPayload.pseudoId, rules: WebInspector.CSSStyleModel.parseRuleArrayPayload(entryPayload.rules) });
+ }
+
+ result.inherited = [];
+ for (var i = 0; i < payload.inherited.length; ++i) {
+ var entryPayload = payload.inherited[i];
+ var entry = {};
+ if ("inlineStyle" in entryPayload)
+ entry.inlineStyle = WebInspector.CSSStyleDeclaration.parsePayload(entryPayload.inlineStyle);
+ if ("matchedCSSRules" in entryPayload)
+ entry.matchedCSSRules = WebInspector.CSSStyleModel.parseRuleArrayPayload(entryPayload.matchedCSSRules);
+ result.inherited.push(entry);
+ }
+
+ if (userCallback)
+ userCallback(result);
+ }
+
+ InspectorBackend.getStyles(nodeId, false, callback.bind(null, userCallback));
},
getComputedStyleAsync: function(nodeId, userCallback)
{
- InspectorBackend.getComputedStyle(nodeId, userCallback);
+ function callback(userCallback, stylePayload)
+ {
+ if (!stylePayload)
+ userCallback(null);
+ else
+ userCallback(WebInspector.CSSStyleDeclaration.parsePayload(stylePayload));
+ }
+
+ InspectorBackend.getComputedStyle(nodeId, callback.bind(null, userCallback));
+ },
+
+ getInlineStyleAsync: function(nodeId, userCallback)
+ {
+ function callback(userCallback, stylePayload)
+ {
+ if (!stylePayload)
+ userCallback(null);
+ else
+ userCallback(WebInspector.CSSStyleDeclaration.parsePayload(stylePayload));
+ }
+
+ InspectorBackend.getInlineStyle(nodeId, callback.bind(null, userCallback));
},
setRuleSelector: function(ruleId, newContent, nodeId, successCallback, failureCallback)
@@ -73,39 +142,8 @@ WebInspector.CSSStyleModel.prototype = {
InspectorBackend.addRule(newContent, nodeId, callback);
},
- toggleStyleEnabled: function(styleId, propertyName, disabled, userCallback)
- {
- function callback(newPayload)
- {
- if (!newPayload) {
- userCallback(null);
- return;
- }
-
- var newStyle = WebInspector.CSSStyleDeclaration.parseStyle(newPayload);
- userCallback(newStyle);
- }
-
- InspectorBackend.toggleStyleEnabled(styleId, propertyName, disabled, callback);
- },
-
setCSSText: function(styleId, cssText)
{
InspectorBackend.setStyleText(styleId, cssText);
- },
-
- applyStyleText: function(styleId, styleText, propertyName, successCallback, failureCallback)
- {
- function callback(success, newPayload)
- {
- if (!success)
- failureCallback();
- else {
- var newStyle = newPayload ? WebInspector.CSSStyleDeclaration.parseStyle(newPayload) : null;
- successCallback(newStyle);
- }
- }
-
- InspectorBackend.applyStyleText(styleId, styleText, propertyName, callback);
}
}
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index 8cd5d52..deca21c 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -48,7 +48,7 @@ WebInspector.ConsoleView = function(drawer)
this.promptElement.className = "source-code";
this.promptElement.addEventListener("keydown", this._promptKeyDown.bind(this), true);
this.prompt = new WebInspector.TextPrompt(this.promptElement, this.completions.bind(this), ExpressionStopCharacters + ".");
- WebInspector.applicationSettings.addEventListener("loaded", this._settingsLoaded, this);
+ this.prompt.history = WebInspector.applicationSettings.consoleHistory;
this.topGroup = new WebInspector.ConsoleGroup(null, 0);
this.messagesElement.insertBefore(this.topGroup.element, this.promptElement);
@@ -102,11 +102,6 @@ WebInspector.ConsoleView = function(drawer)
}
WebInspector.ConsoleView.prototype = {
- _settingsLoaded: function()
- {
- this.prompt.history = WebInspector.applicationSettings.consoleHistory;
- },
-
_updateFilter: function(e)
{
var isMac = WebInspector.isMac();
@@ -225,11 +220,15 @@ WebInspector.ConsoleView.prototype = {
this._incrementErrorWarningCount(msg);
// Add message to the resource panel
- if (msg.url in WebInspector.resourceURLMap) {
- msg.resource = WebInspector.resourceURLMap[msg.url];
- if (WebInspector.panels.resources)
- WebInspector.panels.resources.addMessageToResource(msg.resource, msg);
- }
+ if (!Preferences.networkPanelEnabled) {
+ var resource = WebInspector.resourceForURL(msg.url);
+ if (resource) {
+ msg.resource = resource;
+ if (WebInspector.panels.resources)
+ WebInspector.panels.resources.addMessageToResource(msg.resource, msg);
+ }
+ } else
+ WebInspector.resourceManager.addConsoleMessage(msg);
this.commandSincePreviousMessage = false;
this.previousMessage = msg;
@@ -303,6 +302,8 @@ WebInspector.ConsoleView.prototype = {
{
if (WebInspector.panels.resources)
WebInspector.panels.resources.clearMessages();
+ if (WebInspector.resourceManager)
+ WebInspector.resourceManager.clearConsoleMessages();
this.messages = [];
@@ -678,7 +679,7 @@ WebInspector.ConsoleMessage.prototype = {
case WebInspector.ConsoleMessage.MessageType.Trace:
case WebInspector.ConsoleMessage.MessageType.UncaughtException:
var ol = document.createElement("ol");
- ol.addStyleClass("stack-trace");
+ ol.className = "outline-disclosure";
var treeOutline = new TreeOutline(ol);
var messageText;
if (this.type === WebInspector.ConsoleMessage.MessageType.Assert)
diff --git a/WebCore/inspector/front-end/CookieItemsView.js b/WebCore/inspector/front-end/CookieItemsView.js
index 88cbe05..b2da875 100644
--- a/WebCore/inspector/front-end/CookieItemsView.js
+++ b/WebCore/inspector/front-end/CookieItemsView.js
@@ -27,12 +27,141 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-WebInspector.CookieItemsView = function(treeElement, cookieDomain)
+WebInspector.CookiesTable = function()
{
WebInspector.View.call(this);
- this.element.addStyleClass("storage-view");
this.element.addStyleClass("table");
+}
+
+WebInspector.CookiesTable.prototype = {
+ resize: function()
+ {
+ if (!this._dataGrid)
+ return;
+
+ if (this._autoSizingDone)
+ this._dataGrid.updateWidths();
+ else {
+ this._autoSizingDone = true;
+ this._dataGrid.autoSizeColumns(4, 45, 1);
+ }
+ },
+
+ _createDataGrid: function(expandable)
+ {
+ var columns = { 0: {}, 1: {}, 2: {}, 3: {}, 4: {}, 5: {}, 6: {}, 7: {} };
+ columns[0].title = WebInspector.UIString("Name");
+ columns[0].sortable = true;
+ columns[0].disclosure = expandable;
+ columns[1].title = WebInspector.UIString("Value");
+ columns[1].sortable = true;
+ columns[2].title = WebInspector.UIString("Domain");
+ columns[2].sortable = true;
+ columns[3].title = WebInspector.UIString("Path");
+ columns[3].sortable = true;
+ columns[4].title = WebInspector.UIString("Expires");
+ columns[4].sortable = true;
+ columns[5].title = WebInspector.UIString("Size");
+ columns[5].aligned = "right";
+ columns[5].sortable = true;
+ columns[6].title = WebInspector.UIString("HTTP");
+ columns[6].aligned = "centered";
+ columns[6].sortable = true;
+ columns[7].title = WebInspector.UIString("Secure");
+ columns[7].aligned = "centered";
+ columns[7].sortable = true;
+
+ var deleteCallback = this._deleteCookieCallback ? this._deleteCookieCallback.bind(this) : null;
+ this._dataGrid = new WebInspector.DataGrid(columns, null, deleteCallback);
+ this._dataGrid.addEventListener("sorting changed", this._populateDataGrid, this);
+ this.element.appendChild(this._dataGrid.element);
+ },
+
+ _populateCookies: function(parentNode, cookies)
+ {
+ var selectedCookie = this._dataGrid.selectedNode ? this._dataGrid.selectedNode.cookie : null;
+ parentNode.removeChildren();
+ if (!cookies)
+ return;
+ this._sortCookies(cookies);
+ var totalSize = 0;
+ for (var i = 0; i < cookies.length; ++i) {
+ var cookieNode = this._createGridNode(cookies[i]);
+ parentNode.appendChild(cookieNode);
+ if (selectedCookie === cookies[i])
+ cookieNode.selected = true;
+ }
+ },
+
+ _sortCookies: function(cookies)
+ {
+ var sortDirection = this._dataGrid.sortOrder === "ascending" ? 1 : -1;
+
+ function localeCompare(field, cookie1, cookie2)
+ {
+ return sortDirection * (cookie1[field] + "").localeCompare(cookie2[field] + "")
+ }
+
+ function numberCompare(field, cookie1, cookie2)
+ {
+ return sortDirection * (cookie1[field] - cookie2[field]);
+ }
+
+ function expiresCompare(cookie1, cookie2)
+ {
+ if (cookie1.session !== cookie2.session)
+ return sortDirection * (cookie1.session ? 1 : -1);
+
+ if (cookie1.session)
+ return 0;
+
+ return sortDirection * (cookie1.expires - cookie2.expires);
+ }
+
+ var comparator;
+ switch (parseInt(this._dataGrid.sortColumnIdentifier)) {
+ case 0: comparator = localeCompare.bind(this, "name"); break;
+ case 1: comparator = localeCompare.bind(this, "value"); break;
+ case 2: comparator = localeCompare.bind(this, "domain"); break;
+ case 3: comparator = localeCompare.bind(this, "path"); break;
+ case 4: comparator = expiresCompare; break;
+ case 5: comparator = numberCompare.bind(this, "size"); break;
+ case 6: comparator = localeCompare.bind(this, "httpOnly"); break;
+ case 7: comparator = localeCompare.bind(this, "secure"); break;
+ default: localeCompare.bind(this, "name");
+ }
+
+ cookies.sort(comparator);
+ },
+
+ _createGridNode: function(cookie)
+ {
+ var data = {};
+ data[0] = cookie.name;
+ data[1] = cookie.value;
+ data[2] = cookie.domain || "";
+ data[3] = cookie.path || "";
+ data[4] = cookie.type === WebInspector.Cookie.Type.Request ? "" :
+ (cookie.session ? WebInspector.UIString("Session") : new Date(cookie.expires).toGMTString());
+ data[5] = cookie.size;
+ data[6] = (cookie.httpOnly ? "\u2713" : ""); // Checkmark
+ data[7] = (cookie.secure ? "\u2713" : ""); // Checkmark
+
+ var node = new WebInspector.DataGridNode(data);
+ node.cookie = cookie;
+ node.selectable = true;
+ return node;
+ }
+};
+
+WebInspector.CookiesTable.prototype.__proto__ = WebInspector.View.prototype;
+
+WebInspector.CookieItemsView = function(treeElement, cookieDomain)
+{
+ WebInspector.CookiesTable.call(this);
+
+ this.element.addStyleClass("storage-view");
this.deleteButton = new WebInspector.StatusBarButton(WebInspector.UIString("Delete"), "delete-storage-status-bar-item");
this.deleteButton.visible = false;
@@ -45,7 +174,7 @@ WebInspector.CookieItemsView = function(treeElement, cookieDomain)
this._cookieDomain = cookieDomain;
this._emptyMsgElement = document.createElement("div");
- this._emptyMsgElement.className = "storage-table-empty";
+ this._emptyMsgElement.className = "storage-empty-view";
this._emptyMsgElement.textContent = WebInspector.UIString("This site has no cookies.");
this.element.appendChild(this._emptyMsgElement);
}
@@ -79,7 +208,6 @@ WebInspector.CookieItemsView.prototype = {
this._filterCookiesForDomain(allCookies);
else
this._cookies = allCookies;
-
if (!this._cookies.length) {
// Nothing to show.
this._emptyMsgElement.removeStyleClass("hidden");
@@ -120,12 +248,13 @@ WebInspector.CookieItemsView.prototype = {
var resourceURLsForDocumentURL = [];
this._totalSize = 0;
- for (var id in WebInspector.resources) {
- var resource = WebInspector.resources[id];
+ function populateResourcesForDocuments(resource)
+ {
var url = resource.documentURL.asParsedURL();
if (url && url.host == this._cookieDomain)
resourceURLsForDocumentURL.push(resource.url);
}
+ WebInspector.forAllResources(populateResourcesForDocuments.bind(this));
for (var i = 0; i < allCookies.length; ++i) {
var pushed = false;
@@ -143,101 +272,9 @@ WebInspector.CookieItemsView.prototype = {
}
},
- _createDataGrid: function()
- {
- var columns = { 0: {}, 1: {}, 2: {}, 3: {}, 4: {}, 5: {}, 6: {}, 7: {} };
- columns[0].title = WebInspector.UIString("Name");
- columns[0].sortable = true;
- columns[1].title = WebInspector.UIString("Value");
- columns[1].sortable = true;
- columns[2].title = WebInspector.UIString("Domain");
- columns[2].sortable = true;
- columns[3].title = WebInspector.UIString("Path");
- columns[3].sortable = true;
- columns[4].title = WebInspector.UIString("Expires");
- columns[4].sortable = true;
- columns[5].title = WebInspector.UIString("Size");
- columns[5].aligned = "right";
- columns[5].sortable = true;
- columns[6].title = WebInspector.UIString("HTTP");
- columns[6].aligned = "centered";
- columns[6].sortable = true;
- columns[7].title = WebInspector.UIString("Secure");
- columns[7].aligned = "centered";
- columns[7].sortable = true;
-
- this._dataGrid = new WebInspector.DataGrid(columns, null, this._deleteCookieCallback.bind(this));
- this._dataGrid.addEventListener("sorting changed", this._populateDataGrid, this);
- this.element.appendChild(this._dataGrid.element);
- this._dataGrid.updateWidths();
- },
-
_populateDataGrid: function()
{
- var selectedCookie = this._dataGrid.selectedNode ? this._dataGrid.selectedNode.cookie : null;
- var sortDirection = this._dataGrid.sortOrder === "ascending" ? 1 : -1;
-
- function localeCompare(field, cookie1, cookie2)
- {
- return sortDirection * (cookie1[field] + "").localeCompare(cookie2[field] + "")
- }
-
- function numberCompare(field, cookie1, cookie2)
- {
- return sortDirection * (cookie1[field] - cookie2[field]);
- }
-
- function expiresCompare(cookie1, cookie2)
- {
- if (cookie1.session !== cookie2.session)
- return sortDirection * (cookie1.session ? 1 : -1);
-
- if (cookie1.session)
- return 0;
-
- return sortDirection * (cookie1.expires - cookie2.expires);
- }
-
- var comparator;
- switch (parseInt(this._dataGrid.sortColumnIdentifier)) {
- case 0: comparator = localeCompare.bind(this, "name"); break;
- case 1: comparator = localeCompare.bind(this, "value"); break;
- case 2: comparator = localeCompare.bind(this, "domain"); break;
- case 3: comparator = localeCompare.bind(this, "path"); break;
- case 4: comparator = expiresCompare; break;
- case 5: comparator = numberCompare.bind(this, "size"); break;
- case 6: comparator = localeCompare.bind(this, "httpOnly"); break;
- case 7: comparator = localeCompare.bind(this, "secure"); break;
- default: localeCompare.bind(this, "name");
- }
-
- this._cookies.sort(comparator);
-
- this._dataGrid.removeChildren();
- var nodeToSelect;
- for (var i = 0; i < this._cookies.length; ++i) {
- var data = {};
- var cookie = this._cookies[i];
- data[0] = cookie.name;
- data[1] = cookie.value;
- data[2] = cookie.domain;
- data[3] = cookie.path;
- data[4] = (cookie.session ? WebInspector.UIString("Session") : new Date(cookie.expires).toGMTString());
- data[5] = Number.bytesToString(cookie.size, WebInspector.UIString);
- data[6] = (cookie.httpOnly ? "\u2713" : ""); // Checkmark
- data[7] = (cookie.secure ? "\u2713" : ""); // Checkmark
-
- var node = new WebInspector.DataGridNode(data);
- node.cookie = cookie;
- node.selectable = true;
- this._dataGrid.appendChild(node);
- if (cookie === selectedCookie)
- nodeToSelect = node;
- }
- if (nodeToSelect)
- nodeToSelect.selected = true;
- else
- this._dataGrid.children[0].selected = true;
+ this._populateCookies(this._dataGrid, this._cookies);
},
_createSimpleDataGrid: function()
@@ -273,12 +310,6 @@ WebInspector.CookieItemsView.prototype = {
this._dataGrid.children[0].selected = true;
},
- resize: function()
- {
- if (this._dataGrid)
- this._dataGrid.updateWidths();
- },
-
_deleteButtonClicked: function(event)
{
if (!this._dataGrid || !this._dataGrid.selectedNode)
@@ -300,4 +331,5 @@ WebInspector.CookieItemsView.prototype = {
}
}
-WebInspector.CookieItemsView.prototype.__proto__ = WebInspector.View.prototype;
+WebInspector.CookieItemsView.prototype.__proto__ = WebInspector.CookiesTable.prototype;
+
diff --git a/WebCore/inspector/front-end/CookieParser.js b/WebCore/inspector/front-end/CookieParser.js
index 2be5df7..f96be0b 100755
--- a/WebCore/inspector/front-end/CookieParser.js
+++ b/WebCore/inspector/front-end/CookieParser.js
@@ -54,7 +54,7 @@ WebInspector.CookieParser.prototype = {
if (kv.key.charAt(0) === "$" && this._lastCookie)
this._lastCookie.addAttribute(kv.key.slice(1), kv.value);
else if (kv.key.toLowerCase() !== "$version" && typeof kv.value === "string")
- this._addCookie(kv);
+ this._addCookie(kv, WebInspector.Cookie.Type.Request);
this._advanceAndCheckCookieDelimiter();
}
this._flushCookie();
@@ -69,7 +69,7 @@ WebInspector.CookieParser.prototype = {
if (this._lastCookie)
this._lastCookie.addAttribute(kv.key, kv.value);
else
- this._addCookie(kv);
+ this._addCookie(kv, WebInspector.Cookie.Type.Response);
if (this._advanceAndCheckCookieDelimiter())
this._flushCookie();
}
@@ -128,14 +128,14 @@ WebInspector.CookieParser.prototype = {
return match[0].match("\n") !== null;
},
- _addCookie: function(keyValue)
+ _addCookie: function(keyValue, type)
{
if (this._lastCookie)
this._lastCookie.size = keyValue.position - this._lastCookiePosition;
- // Mozilla bug 169091: Mozilla, IE and Chrome treat signle token (w/o "=") as
+ // Mozilla bug 169091: Mozilla, IE and Chrome treat single token (w/o "=") as
// specifying a value for a cookie with empty name.
- this._lastCookie = keyValue.value ? new WebInspector.Cookie(keyValue.key, keyValue.value) :
- new WebInspector.Cookie("", keyValue.key);
+ this._lastCookie = keyValue.value ? new WebInspector.Cookie(keyValue.key, keyValue.value, type) :
+ new WebInspector.Cookie("", keyValue.key, type);
this._lastCookiePosition = keyValue.position;
this._cookies.push(this._lastCookie);
}
@@ -151,10 +151,11 @@ WebInspector.CookieParser.parseSetCookie = function(header)
return (new WebInspector.CookieParser()).parseSetCookie(header);
}
-WebInspector.Cookie = function(name, value)
+WebInspector.Cookie = function(name, value, type)
{
this.name = name;
this.value = value;
+ this.type = type;
this._attributes = {};
}
@@ -202,3 +203,8 @@ WebInspector.Cookie.prototype = {
this._attributes[key.toLowerCase()] = value;
}
}
+
+WebInspector.Cookie.Type = {
+ Request: 0,
+ Response: 1
+};
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index 5153fb1..470e775 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -526,90 +526,78 @@ WebInspector.EventListeners.getEventListenersForNodeAsync = function(node, callb
WebInspector.CSSStyleDeclaration = function(payload)
{
- this.id = payload.id;
- this.parentStyleSheetId = payload.parentStyleSheetId;
- this.width = payload.width;
- this.height = payload.height;
- this.__disabledProperties = {};
- this.__disabledPropertyValues = {};
- this.__disabledPropertyPriorities = {};
- if (payload.disabled) {
- for (var i = 0; i < payload.disabled.length; ++i) {
- var property = payload.disabled[i];
- this.__disabledProperties[property.name] = true;
- this.__disabledPropertyValues[property.name] = property.value;
- this.__disabledPropertyPriorities[property.name] = property.priority;
- }
- }
-
+ this.id = payload.styleId;
+ this.properties = payload.properties;
this._shorthandValues = payload.shorthandValues;
- this._propertyMap = {};
- this._longhandProperties = {};
- this.length = payload.properties.length;
-
- for (var i = 0; i < this.length; ++i) {
- var property = payload.properties[i];
+ this._livePropertyMap = {}; // LIVE properties (source-based or style-based) : { name -> CSSProperty }
+ this._allProperties = []; // ALL properties: [ CSSProperty ]
+ this._longhandProperties = {}; // shorthandName -> [ CSSProperty ]
+ this.__disabledProperties = {}; // DISABLED properties: { index -> CSSProperty }
+ var payloadPropertyCount = payload.cssProperties.length;
+
+ var propertyIndex = 0;
+ for (var i = 0; i < payloadPropertyCount; ++i) {
+ var property = new WebInspector.CSSProperty.parsePayload(this, i, payload.cssProperties[i]);
+ this._allProperties.push(property);
+ if (property.disabled)
+ this.__disabledProperties[i] = property;
+ if (!property.active && !property.styleBased)
+ continue;
var name = property.name;
- this[i] = name;
- this._propertyMap[name] = property;
+ this[propertyIndex] = name;
+ this._livePropertyMap[name] = property;
// Index longhand properties.
- if (property.shorthand) {
+ if (property.shorthand) { // only for parsed
var longhands = this._longhandProperties[property.shorthand];
if (!longhands) {
longhands = [];
this._longhandProperties[property.shorthand] = longhands;
}
- longhands.push(name);
+ longhands.push(property);
}
+ ++propertyIndex;
}
+ this.length = propertyIndex;
}
-WebInspector.CSSStyleDeclaration.parseStyle = function(payload)
+WebInspector.CSSStyleDeclaration.parsePayload = function(payload)
{
return new WebInspector.CSSStyleDeclaration(payload);
}
-WebInspector.CSSStyleDeclaration.parseRule = function(payload)
-{
- var rule = {};
- rule.id = payload.id;
- rule.selectorText = payload.selectorText;
- rule.style = new WebInspector.CSSStyleDeclaration(payload.style);
- rule.style.parentRule = rule;
- rule.isUserAgent = payload.isUserAgent;
- rule.isUser = payload.isUser;
- rule.isViaInspector = payload.isViaInspector;
- rule.sourceLine = payload.sourceLine;
- rule.documentURL = payload.documentURL;
- if (payload.parentStyleSheet)
- rule.parentStyleSheet = { href: payload.parentStyleSheet.href };
-
- return rule;
-}
-
WebInspector.CSSStyleDeclaration.prototype = {
+ get allProperties()
+ {
+ return this._allProperties;
+ },
+
+ getLiveProperty: function(name)
+ {
+ return this._livePropertyMap[name];
+ },
+
getPropertyValue: function(name)
{
- var property = this._propertyMap[name];
+ var property = this._livePropertyMap[name];
return property ? property.value : "";
},
getPropertyPriority: function(name)
{
- var property = this._propertyMap[name];
+ var property = this._livePropertyMap[name];
return property ? property.priority : "";
},
getPropertyShorthand: function(name)
{
- var property = this._propertyMap[name];
+ var property = this._livePropertyMap[name];
return property ? property.shorthand : "";
},
isPropertyImplicit: function(name)
{
- var property = this._propertyMap[name];
+ var property = this._livePropertyMap[name];
return property ? property.implicit : "";
},
@@ -651,7 +639,8 @@ WebInspector.CSSStyleDeclaration.prototype = {
getShorthandValue: function(shorthandProperty)
{
- return this._shorthandValues[shorthandProperty];
+ var property = this.getLiveProperty(shorthandProperty);
+ return property ? property.value : this._shorthandValues[shorthandProperty];
},
getShorthandPriority: function(shorthandProperty)
@@ -662,6 +651,166 @@ WebInspector.CSSStyleDeclaration.prototype = {
var longhands = this._longhandProperties[shorthandProperty];
return longhands ? this.getPropertyPriority(longhands[0]) : null;
+ },
+
+ appendProperty: function(propertyName, propertyValue, userCallback)
+ {
+ function setPropertyCallback(userCallback, success, stylePayload)
+ {
+ if (!success)
+ userCallback(null);
+ else
+ userCallback(WebInspector.CSSStyleDeclaration.parsePayload(stylePayload));
+ }
+
+ // FIXME(apavlov): this should be migrated to the new InspectorCSSAgent API once it is enabled.
+ InspectorBackend.applyStyleText(this.id, propertyName + ": " + propertyValue + ";", propertyName, setPropertyCallback.bind(this, userCallback));
+ },
+
+ propertyAt: function(index)
+ {
+ return (index < this.allProperties.length) ? this.allProperties[index] : null;
+ }
+}
+
+WebInspector.CSSRule = function(payload)
+{
+ this.id = payload.ruleId;
+ this.selectorText = payload.selectorText;
+ this.sourceLine = payload.sourceLine;
+ this.sourceURL = payload.sourceURL;
+ this.origin = payload.origin;
+ this.style = WebInspector.CSSStyleDeclaration.parsePayload(payload.style);
+ this.style.parentRule = this;
+}
+
+WebInspector.CSSRule.parsePayload = function(payload)
+{
+ return new WebInspector.CSSRule(payload);
+}
+
+WebInspector.CSSRule.prototype = {
+ get isUserAgent()
+ {
+ return this.origin === "user-agent";
+ },
+
+ get isUser()
+ {
+ return this.origin === "user";
+ },
+
+ get isViaInspector()
+ {
+ return this.origin === "inspector";
+ },
+
+ get isRegular()
+ {
+ return this.origin === "";
+ }
+}
+
+WebInspector.CSSProperty = function(ownerStyle, index, name, value, priority, status, parsedOk, implicit, shorthand, text)
+{
+ this.ownerStyle = ownerStyle;
+ this.index = index;
+ this.name = name;
+ this.value = value;
+ this.priority = priority;
+ this.status = status;
+ this.parsedOk = parsedOk;
+ this.implicit = implicit;
+ this.shorthand = shorthand;
+ this.text = text;
+}
+
+WebInspector.CSSProperty.parsePayload = function(ownerStyle, index, payload)
+{
+ var result = new WebInspector.CSSProperty(
+ ownerStyle, index, payload.name, payload.value, payload.priority, payload.status, payload.parsedOk, payload.implicit, payload.shorthandName, payload.text);
+ return result;
+}
+
+WebInspector.CSSProperty.prototype = {
+ get propertyText()
+ {
+ if (this.text !== undefined)
+ return this.text;
+
+ return this.name + ": " + this.value + (this.priority ? " !" + this.priority : "") + ";";
+ },
+
+ get isLive()
+ {
+ return this.active || this.styleBased;
+ },
+
+ get active()
+ {
+ return this.status === "active";
+ },
+
+ get styleBased()
+ {
+ return this.status === "style";
+ },
+
+ get inactive()
+ {
+ return this.status === "inactive";
+ },
+
+ get disabled()
+ {
+ return this.status === "disabled";
+ },
+
+ // Replaces "propertyName: propertyValue [!important];" in the stylesheet by an arbitrary propertyText.
+ setText: function(propertyText, userCallback)
+ {
+ function callback(userCallback, success, stylePayload)
+ {
+ if (!userCallback)
+ return;
+ if (!success)
+ userCallback(null);
+ else {
+ var style = WebInspector.CSSStyleDeclaration.parsePayload(stylePayload);
+ userCallback(style);
+ }
+ }
+
+ if (!this.ownerStyle)
+ throw "No ownerStyle for property";
+ InspectorBackend.applyStyleText(this.ownerStyle.id, propertyText, this.name, callback.bind(this, userCallback));
+ },
+
+ setValue: function(newValue, userCallback)
+ {
+ var text = this.name + ": " + newValue + (this.priority ? " !" + this.priority : "") + ";"
+ this.setText(text, userCallback);
+ },
+
+ setDisabled: function(disabled, userCallback)
+ {
+ if (!this.ownerStyle && userCallback)
+ userCallback(null);
+ if (disabled === this.disabled && userCallback)
+ userCallback(this.ownerStyle);
+
+ function callback(userCallback, stylePayload)
+ {
+ if (!userCallback)
+ return;
+ if (!stylePayload)
+ userCallback(null);
+ else {
+ var style = WebInspector.CSSStyleDeclaration.parsePayload(stylePayload);
+ userCallback(style);
+ }
+ }
+ InspectorBackend.toggleStyleEnabled(this.ownerStyle.id, this.name, disabled, callback.bind(this, userCallback));
}
}
diff --git a/WebCore/inspector/front-end/DataGrid.js b/WebCore/inspector/front-end/DataGrid.js
index 3007497..bc429d9 100644
--- a/WebCore/inspector/front-end/DataGrid.js
+++ b/WebCore/inspector/front-end/DataGrid.js
@@ -308,7 +308,7 @@ WebInspector.DataGrid.prototype = {
return this._dataTableBody;
},
- autoSizeColumns: function(minPercent, maxPercent)
+ autoSizeColumns: function(minPercent, maxPercent, maxDescentLevel)
{
if (minPercent)
minPercent = Math.min(minPercent, Math.floor(100 / this._columnCount));
@@ -317,8 +317,9 @@ WebInspector.DataGrid.prototype = {
for (var columnIdentifier in columns)
widths[columnIdentifier] = (columns[columnIdentifier].title || "").length;
- for (var i = 0; i < this.children.length; ++i) {
- var node = this.children[i];
+ var children = maxDescentLevel ? this._enumerateChildren(this, [], maxDescentLevel + 1) : this.children;
+ for (var i = 0; i < children.length; ++i) {
+ var node = children[i];
for (var columnIdentifier in columns) {
var text = node.data[columnIdentifier] || "";
if (text.length > widths[columnIdentifier])
@@ -371,6 +372,17 @@ WebInspector.DataGrid.prototype = {
this.updateWidths();
},
+ _enumerateChildren: function(rootNode, result, maxLevel)
+ {
+ if (!rootNode.root)
+ result.push(rootNode);
+ if (!maxLevel)
+ return;
+ for (var i = 0; i < rootNode.children.length; ++i)
+ this._enumerateChildren(rootNode.children[i], result, maxLevel - 1);
+ return result;
+ },
+
// Updates the widths of the table, including the positions of the column
// resizers.
//
@@ -388,7 +400,8 @@ WebInspector.DataGrid.prototype = {
var tableWidth = this._dataTable.offsetWidth;
var numColumns = headerTableColumns.length;
- if (!this._columnWidthsInitialized) {
+ // Do not attempt to use offsetes if we're not attached to the document tree yet.
+ if (!this._columnWidthsInitialized && this.element.offsetWidth) {
// Give all the columns initial widths now so that during a resize,
// when the two columns that get resized get a percent value for
// their widths, all the other columns already have percent values
diff --git a/WebCore/inspector/front-end/DatabaseTableView.js b/WebCore/inspector/front-end/DatabaseTableView.js
index 5440763..b234b9a 100644
--- a/WebCore/inspector/front-end/DatabaseTableView.js
+++ b/WebCore/inspector/front-end/DatabaseTableView.js
@@ -61,7 +61,7 @@ WebInspector.DatabaseTableView.prototype = {
var dataGrid = WebInspector.panels.storage.dataGridForResult(columnNames, values);
if (!dataGrid) {
var emptyMsgElement = document.createElement("div");
- emptyMsgElement.className = "storage-table-empty";
+ emptyMsgElement.className = "storage-empty-view";
emptyMsgElement.textContent = WebInspector.UIString("The “%s”\ntable is empty.", this.tableName);
this.element.appendChild(emptyMsgElement);
return;
diff --git a/WebCore/inspector/front-end/EventListenersSidebarPane.js b/WebCore/inspector/front-end/EventListenersSidebarPane.js
index e2ad259..3354191 100644
--- a/WebCore/inspector/front-end/EventListenersSidebarPane.js
+++ b/WebCore/inspector/front-end/EventListenersSidebarPane.js
@@ -46,7 +46,11 @@ WebInspector.EventListenersSidebarPane = function()
option.label = WebInspector.UIString("Selected Node Only");
this.settingsSelectElement.appendChild(option);
- WebInspector.applicationSettings.addEventListener("loaded", this._settingsLoaded, this);
+ var filter = WebInspector.applicationSettings.eventListenersFilter;
+ if (filter === "all")
+ this.settingsSelectElement[0].selected = true;
+ else if (filter === "selected")
+ this.settingsSelectElement[1].selected = true;
this.settingsSelectElement.addEventListener("click", function(event) { event.stopPropagation() }, false);
this.settingsSelectElement.addEventListener("change", this._changeSetting.bind(this), false);
@@ -54,15 +58,6 @@ WebInspector.EventListenersSidebarPane = function()
}
WebInspector.EventListenersSidebarPane.prototype = {
- _settingsLoaded: function()
- {
- var filter = WebInspector.applicationSettings.eventListenersFilter;
- if (filter === "all")
- this.settingsSelectElement[0].selected = true;
- if (filter === "selected")
- this.settingsSelectElement[1].selected = true;
- },
-
update: function(node)
{
var body = this.bodyElement;
diff --git a/WebCore/inspector/front-end/ExtensionServer.js b/WebCore/inspector/front-end/ExtensionServer.js
index 9ab4c0c..5e593f7 100644
--- a/WebCore/inspector/front-end/ExtensionServer.js
+++ b/WebCore/inspector/front-end/ExtensionServer.js
@@ -240,11 +240,16 @@ WebInspector.ExtensionServer.prototype = {
var id = message.id;
var resource = null;
- resource = WebInspector.resources[id] || WebInspector.resourceForURL(id);
+ resource = WebInspector.networkResources[id] || WebInspector.resourceForURL(id);
if (!resource)
return this._status.E_NOTFOUND(typeof id + ": " + id);
- WebInspector.panels.resources.showResource(resource, message.line);
- WebInspector.showPanel("resources");
+ if (Preferences.networkPanelEnabled) {
+ WebInspector.panels.storage.showResource(resource, message.line);
+ WebInspector.showPanel("storage");
+ } else {
+ WebInspector.panels.resources.showResource(resource, message.line);
+ WebInspector.showPanel("resources");
+ }
},
_dispatchCallback: function(requestId, port, result)
@@ -256,14 +261,14 @@ WebInspector.ExtensionServer.prototype = {
{
function resourceWrapper(id)
{
- return WebInspector.extensionServer._convertResource(WebInspector.resources[id]);
+ return WebInspector.extensionServer._convertResource(WebInspector.networkResources[id]);
}
var response;
if (request.id)
- response = WebInspector.resources[request.id] ? resourceWrapper(request.id) : this._status.E_NOTFOUND(request.id);
+ response = WebInspector.networkResources[request.id] ? resourceWrapper(request.id) : this._status.E_NOTFOUND(request.id);
else
- response = Object.keys(WebInspector.resources).map(resourceWrapper);
+ response = Object.keys(WebInspector.networkResources).map(resourceWrapper);
return response;
},
@@ -272,7 +277,7 @@ WebInspector.ExtensionServer.prototype = {
var ids;
var response = [];
- function onContentAvailable(id, encoded, content)
+ function onContentAvailable(id, content, encoded)
{
var resourceContent = {
id: id,
@@ -293,13 +298,12 @@ WebInspector.ExtensionServer.prototype = {
for (var i = 0; i < ids.length; ++i) {
var id = ids[i];
- var resource = WebInspector.resources[id];
+ var resource = WebInspector.networkResources[id];
+
if (!resource)
response.push(this._status.E_NOTFOUND(id));
- else {
- var encode = !WebInspector.Resource.Type.isTextType(resource.type);
- WebInspector.getEncodedResourceContent(id, encode, onContentAvailable.bind(this, id, encode));
- }
+ else
+ resource.getContent(onContentAvailable.bind(this, id));
}
if (response.length === ids.length)
this._dispatchCallback(message.requestId, port, response);
@@ -446,8 +450,3 @@ WebInspector.addExtensions = function(extensions)
}
WebInspector.extensionServer = new WebInspector.ExtensionServer();
-
-WebInspector.getEncodedResourceContent = function(identifier, encode, callback)
-{
- InspectorBackend.getResourceContent(identifier, encode, callback);
-}
diff --git a/WebCore/inspector/front-end/FontView.js b/WebCore/inspector/front-end/FontView.js
index b011204..78a7e70 100644
--- a/WebCore/inspector/front-end/FontView.js
+++ b/WebCore/inspector/front-end/FontView.js
@@ -69,6 +69,7 @@ WebInspector.FontView.prototype = {
resize: function()
{
this.updateFontPreviewSize();
+ WebInspector.ResourceView.prototype.resize.call(this);
},
updateFontPreviewSize: function()
diff --git a/WebCore/inspector/front-end/HAREntry.js b/WebCore/inspector/front-end/HAREntry.js
index 2b8f41b..f3bfb06 100644
--- a/WebCore/inspector/front-end/HAREntry.js
+++ b/WebCore/inspector/front-end/HAREntry.js
@@ -180,7 +180,7 @@ WebInspector.HAREntry.prototype = {
var startTime = timing[start];
return typeof startTime !== "number" || startTime === -1 ? -1 : Math.round(timing[end] - startTime);
}
-};
+}
WebInspector.HAREntry._toMilliseconds = function(time)
{
@@ -203,7 +203,7 @@ WebInspector.HARLog.prototype = {
version: webKitVersion ? webKitVersion[1] : "n/a"
},
pages: this._buildPages(),
- entries: Object.keys(WebInspector.resources).map(this._convertResource)
+ entries: Object.keys(WebInspector.networkResources).map(this._convertResource)
}
},
@@ -221,17 +221,15 @@ WebInspector.HARLog.prototype = {
buildMainResourceTimings: function()
{
- var resourcesPanel = WebInspector.panels.resources;
- var startTime = WebInspector.mainResource.startTime;
return {
- onContentLoad: this._pageEventTime(resourcesPanel.mainResourceDOMContentTime),
- onLoad: this._pageEventTime(resourcesPanel.mainResourceLoadTime),
+ onContentLoad: this._pageEventTime(WebInspector.mainResourceDOMContentTime),
+ onLoad: this._pageEventTime(WebInspector.mainResourceLoadTime),
}
},
_convertResource: function(id)
{
- return (new WebInspector.HAREntry(WebInspector.resources[id])).build();
+ return (new WebInspector.HAREntry(WebInspector.networkResources[id])).build();
},
_pageEventTime: function(time)
@@ -241,4 +239,4 @@ WebInspector.HARLog.prototype = {
return -1;
return WebInspector.HAREntry._toMilliseconds(time - startTime);
}
-};
+}
diff --git a/WebCore/inspector/front-end/ImageView.js b/WebCore/inspector/front-end/ImageView.js
index 06ca4a4..7cff056 100644
--- a/WebCore/inspector/front-end/ImageView.js
+++ b/WebCore/inspector/front-end/ImageView.js
@@ -49,10 +49,14 @@ WebInspector.ImageView.prototype = {
this.imagePreviewElement = document.createElement("img");
this.imagePreviewElement.addStyleClass("resource-image-view");
- this.imagePreviewElement.setAttribute("src", this.resource.url);
-
this._container.appendChild(this.imagePreviewElement);
+ function onResourceContent(element, content)
+ {
+ this.imagePreviewElement.setAttribute("src", this.resource.contentURL);
+ }
+ this.resource.getContent(onResourceContent.bind(this));
+
this._container = document.createElement("div");
this._container.className = "info";
this.contentElement.appendChild(this._container);
diff --git a/WebCore/inspector/front-end/Images/frame.png b/WebCore/inspector/front-end/Images/frame.png
new file mode 100644
index 0000000..0d1953c
--- /dev/null
+++ b/WebCore/inspector/front-end/Images/frame.png
Binary files differ
diff --git a/WebCore/inspector/front-end/Images/networkIcon.png b/WebCore/inspector/front-end/Images/networkIcon.png
index 982424d..ba10bba 100644
--- a/WebCore/inspector/front-end/Images/networkIcon.png
+++ b/WebCore/inspector/front-end/Images/networkIcon.png
Binary files differ
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index 24b270b..2d60f69 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -268,7 +268,7 @@ InjectedScript.prototype = {
// We don't want local variables to be shadowed by global ones when evaluating on CallFrame.
if (!isEvalOnCallFrame)
expression = "with (window) {\n" + expression + "\n} ";
- expression = "with (window.console._commandLineAPI) {\n" + expression + "\n}";
+ expression = "with (window ? window.console._commandLineAPI : {}) {\n" + expression + "\n}";
var value = evalFunction.call(object, expression);
delete inspectedWindow.console._commandLineAPI;
diff --git a/WebCore/inspector/front-end/MetricsSidebarPane.js b/WebCore/inspector/front-end/MetricsSidebarPane.js
index 18bc240..3784ce8 100644
--- a/WebCore/inspector/front-end/MetricsSidebarPane.js
+++ b/WebCore/inspector/front-end/MetricsSidebarPane.js
@@ -46,24 +46,24 @@ WebInspector.MetricsSidebarPane.prototype = {
}
var self = this;
- var callback = function(stylePayload) {
- if (!stylePayload)
+ var callback = function(style) {
+ if (!style)
return;
- var style = WebInspector.CSSStyleDeclaration.parseStyle(stylePayload);
self._update(style);
};
- InspectorBackend.getComputedStyle(node.id, callback);
+ WebInspector.cssModel.getComputedStyleAsync(node.id, callback);
- var inlineStyleCallback = function(stylePayload) {
- if (!stylePayload)
+ var inlineStyleCallback = function(style) {
+ if (!style)
return;
- self._inlineStyleId = stylePayload.id;
+ self.inlineStyle = style;
};
- InspectorBackend.getInlineStyle(node.id, inlineStyleCallback);
+ WebInspector.cssModel.getInlineStyleAsync(node.id, inlineStyleCallback);
},
_update: function(style)
{
+ // Updating with computed style.
var metricsElement = document.createElement("div");
metricsElement.className = "metrics";
@@ -116,23 +116,23 @@ WebInspector.MetricsSidebarPane.prototype = {
for (var i = 0; i < boxes.length; ++i) {
var name = boxes[i];
- if (name === "margin" && noMarginDisplayType[style.display])
+ if (name === "margin" && noMarginDisplayType[style.getPropertyValue("display")])
continue;
- if (name === "padding" && noPaddingDisplayType[style.display])
+ if (name === "padding" && noPaddingDisplayType[style.getPropertyValue("display")])
continue;
- if (name === "position" && noPositionType[style.position])
+ if (name === "position" && noPositionType[style.getPropertyValue("position")])
continue;
var boxElement = document.createElement("div");
boxElement.className = name;
if (name === "content") {
- var width = style.width.replace(/px$/, "");
+ var width = style.getPropertyValue("width").replace(/px$/, "");
var widthElement = document.createElement("span");
widthElement.textContent = width;
widthElement.addEventListener("dblclick", this.startEditing.bind(this, widthElement, "width", "width"), false);
- var height = style.height.replace(/px$/, "");
+ var height = style.getPropertyValue("height").replace(/px$/, "");
var heightElement = document.createElement("span");
heightElement.textContent = height;
heightElement.addEventListener("dblclick", this.startEditing.bind(this, heightElement, "height", "height"), false);
@@ -185,7 +185,7 @@ WebInspector.MetricsSidebarPane.prototype = {
editingCommitted: function(element, userInput, previousContent, context)
{
- if (!this._inlineStyleId) {
+ if (!this.inlineStyle) {
// Element has no renderer.
return this.editingCancelled(element, context); // nothing changed, so cancel
}
@@ -203,14 +203,36 @@ WebInspector.MetricsSidebarPane.prototype = {
userInput += "px";
var self = this;
- var callback = function(success) {
- if (!success)
+ var callback = function(style) {
+ if (!style)
return;
+ self.inlineStyle = style;
self.dispatchEventToListeners("metrics edited");
self.update();
};
- InspectorBackend.setStyleProperty(this._inlineStyleId, context.styleProperty, userInput, callback);
+ function setEnabledValueCallback(context, style)
+ {
+ var property = style.getLiveProperty(context.styleProperty);
+ if (!property)
+ style.appendProperty(context.styleProperty, userInput, callback);
+ else
+ property.setValue(userInput, callback);
+ }
+
+ var allProperties = this.inlineStyle.allProperties;
+ for (var i = 0; i < allProperties.length; ++i) {
+ var property = allProperties[i];
+ if (property.name !== context.styleProperty || property.inactive)
+ continue;
+ if (property.disabled)
+ property.setDisabled(false, setEnabledValueCallback.bind(null, context));
+ else
+ property.setValue(userInput, callback);
+ return;
+ }
+
+ this.inlineStyle.appendProperty(context.styleProperty, userInput, callback);
}
}
diff --git a/WebCore/inspector/front-end/NetworkPanel.js b/WebCore/inspector/front-end/NetworkPanel.js
index 8eed425..c666e54 100644
--- a/WebCore/inspector/front-end/NetworkPanel.js
+++ b/WebCore/inspector/front-end/NetworkPanel.js
@@ -36,6 +36,8 @@ WebInspector.NetworkPanel = function()
this.sidebarElement.className = "network-sidebar";
this._resources = [];
+ this._resourcesById = {};
+ this._lastIdentifier = 0;
this._staleResources = [];
this._resourceGridNodes = {};
this._mainResourceLoadTime = -1;
@@ -51,9 +53,13 @@ WebInspector.NetworkPanel = function()
this._viewsContainerElement = document.createElement("div");
this._viewsContainerElement.id = "network-views";
this._viewsContainerElement.className = "hidden";
-
this.element.appendChild(this._viewsContainerElement);
+ var closeButtonElement = document.createElement("button");
+ closeButtonElement.className = "network-close-button";
+ closeButtonElement.addEventListener("click", this._toggleGridMode.bind(this), false);
+ this._viewsContainerElement.appendChild(closeButtonElement);
+
this._createSortingFunctions();
this._createTable();
this._createTimelineGrid();
@@ -180,7 +186,7 @@ WebInspector.NetworkPanel.prototype = {
columns.type.title = WebInspector.UIString("Type");
columns.type.sortable = true;
- columns.type.width = "7%";
+ columns.type.width = "10%";
columns.size.titleDOMFragment = this._makeHeaderFragment(WebInspector.UIString("Size"), WebInspector.UIString("Transfer"));
columns.size.sortable = true;
@@ -194,7 +200,7 @@ WebInspector.NetworkPanel.prototype = {
columns.timeline.title = "";
columns.timeline.sortable = false;
- columns.timeline.width = "40%";
+ columns.timeline.width = "37%";
columns.timeline.sort = "ascending";
this._dataGrid = new WebInspector.DataGrid(columns);
@@ -251,7 +257,7 @@ WebInspector.NetworkPanel.prototype = {
timelineSorting.appendChild(option);
var header = this._dataGrid.headerTableHeader("timeline");
- header.firstChild.appendChild(timelineSorting);
+ header.replaceChild(timelineSorting, header.firstChild);
timelineSorting.addEventListener("click", function(event) { event.stopPropagation() }, false);
timelineSorting.addEventListener("change", this._sortByTimeline.bind(this), false);
@@ -609,15 +615,10 @@ WebInspector.NetworkPanel.prototype = {
this._clearButton.addEventListener("click", this._reset.bind(this), false);
this._largerResourcesButton = new WebInspector.StatusBarButton(WebInspector.UIString("Use small resource rows."), "network-larger-resources-status-bar-item");
- WebInspector.applicationSettings.addEventListener("loaded", this._settingsLoaded, this);
- this._largerResourcesButton.addEventListener("click", this._toggleLargerResources.bind(this), false);
- },
-
- _settingsLoaded: function()
- {
this._largerResourcesButton.toggled = WebInspector.applicationSettings.resourcesLargeRows;
if (!WebInspector.applicationSettings.resourcesLargeRows)
this._setLargerResources(WebInspector.applicationSettings.resourcesLargeRows);
+ this._largerResourcesButton.addEventListener("click", this._toggleLargerResources.bind(this), false);
},
set mainResourceLoadTime(x)
@@ -758,6 +759,7 @@ WebInspector.NetworkPanel.prototype = {
this._calculator.reset();
this._resources = [];
+ this._resourcesById = {};
this._staleResources = [];
this._resourceGridNodes = {};
@@ -773,9 +775,17 @@ WebInspector.NetworkPanel.prototype = {
this._resetSummaryBar();
},
+ get resources()
+ {
+ return this._resourcesById;
+ },
+
addResource: function(resource)
{
this._resources.push(resource);
+ if (!resource.identifier)
+ resource.identifier = "network:" + this._lastIdentifier++;
+ this._resourcesById[resource.identifier] = resource;
this.refreshResource(resource);
},
@@ -787,12 +797,9 @@ WebInspector.NetworkPanel.prototype = {
if (!resource || !resource._resourcesView)
return;
- if (this._resourceViewTypeMatchesResource(resource, resource._resourcesView))
- return;
-
- var newView = this._createResourceView(resource);
- if (newView.__proto__ === resource._resourcesView.__proto__)
+ if (WebInspector.ResourceManager.resourceViewTypeMatchesResource(resource, resource._resourcesView))
return;
+ var newView = WebInspector.ResourceManager.createResourceView(resource);
var oldView = resource._resourcesView;
var oldViewParentNode = oldView.visible ? oldView.element.parentNode : null;
@@ -831,7 +838,7 @@ WebInspector.NetworkPanel.prototype = {
if (this.visibleResource && this.visibleResource._resourcesView)
this.visibleResource._resourcesView.hide();
- var view = this._resourceViewForResource(resource);
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
view.headersVisible = true;
view.show(this._viewsContainerElement);
@@ -861,15 +868,6 @@ WebInspector.NetworkPanel.prototype = {
this.updateSidebarWidth();
},
- _resourceViewForResource: function(resource)
- {
- if (!resource)
- return null;
- if (!resource._resourcesView)
- resource._resourcesView = this._createResourceView(resource);
- return resource._resourcesView;
- },
-
_toggleLargerResources: function()
{
WebInspector.applicationSettings.resourcesLargeRows = !WebInspector.applicationSettings.resourcesLargeRows;
@@ -883,48 +881,15 @@ WebInspector.NetworkPanel.prototype = {
this._largerResourcesButton.title = WebInspector.UIString("Use large resource rows.");
this._dataGrid.element.addStyleClass("small");
this._timelineGrid.element.addStyleClass("small");
+ this._viewsContainerElement.addStyleClass("small");
} else {
this._largerResourcesButton.title = WebInspector.UIString("Use small resource rows.");
this._dataGrid.element.removeStyleClass("small");
this._timelineGrid.element.removeStyleClass("small");
+ this._viewsContainerElement.removeStyleClass("small");
}
},
- _createResourceView: function(resource)
- {
- switch (resource.category) {
- case WebInspector.resourceCategories.documents:
- case WebInspector.resourceCategories.stylesheets:
- case WebInspector.resourceCategories.scripts:
- case WebInspector.resourceCategories.xhr:
- return new WebInspector.SourceView(resource);
- case WebInspector.resourceCategories.images:
- return new WebInspector.ImageView(resource);
- case WebInspector.resourceCategories.fonts:
- return new WebInspector.FontView(resource);
- default:
- return new WebInspector.ResourceView(resource);
- }
- },
-
- _resourceViewTypeMatchesResource: function(resource, resourceView)
- {
- switch (resource.category) {
- case WebInspector.resourceCategories.documents:
- case WebInspector.resourceCategories.stylesheets:
- case WebInspector.resourceCategories.scripts:
- case WebInspector.resourceCategories.xhr:
- return resourceView instanceof WebInspector.SourceView;
- case WebInspector.resourceCategories.images:
- return resourceView instanceof WebInspector.ImageView;
- case WebInspector.resourceCategories.fonts:
- return resourceView instanceof WebInspector.FontView;
- default:
- return resourceView instanceof WebInspector.ResourceView;
- }
- return false;
- },
-
_getPopoverAnchor: function(element)
{
var anchor = element.enclosingNodeOrSelfWithClass("network-graph-bar") || element.enclosingNodeOrSelfWithClass("network-graph-label");
@@ -1060,10 +1025,10 @@ WebInspector.NetworkPanel.prototype = {
widths.name = 20;
widths.method = 7;
widths.status = 8;
- widths.type = 7;
+ widths.type = 10;
widths.size = 10;
widths.time = 10;
- widths.timeline = 40;
+ widths.timeline = 37;
}
this._dataGrid.showColumn("timeline");
@@ -1496,7 +1461,15 @@ WebInspector.NetworkDataGridNode.prototype = {
if (this._resource.category === WebInspector.resourceCategories.images) {
var previewImage = document.createElement("img");
previewImage.className = "image-network-icon-preview";
- previewImage.src = this._resource.url;
+
+ function onResourceContent()
+ {
+ previewImage.src = this._resource.contentURL;
+ }
+ if (Preferences.useDataURLForResourceImageIcons)
+ this._resource.getContent(onResourceContent.bind(this));
+ else
+ previewImage.src = this._resource.url;
var iconElement = document.createElement("div");
iconElement.className = "icon";
diff --git a/WebCore/inspector/front-end/Panel.js b/WebCore/inspector/front-end/Panel.js
index 2a4104f..ec9250c 100644
--- a/WebCore/inspector/front-end/Panel.js
+++ b/WebCore/inspector/front-end/Panel.js
@@ -34,7 +34,7 @@ WebInspector.Panel = function(name)
this.element.addStyleClass(name);
this._panelName = name;
- WebInspector.applicationSettings.installSetting(this._sidebarWidthSettingName(), this._panelName + "-sidebar-width", undefined);
+ WebInspector.applicationSettings.installApplicationSetting(this._sidebarWidthSettingName(), undefined);
}
// Should by in sync with style declarations.
diff --git a/WebCore/inspector/front-end/Resource.js b/WebCore/inspector/front-end/Resource.js
index fe2f7d2..1a2ce96 100644
--- a/WebCore/inspector/front-end/Resource.js
+++ b/WebCore/inspector/front-end/Resource.js
@@ -34,6 +34,7 @@ WebInspector.Resource = function(identifier, url)
this._endTime = -1;
this._requestMethod = "";
this._category = WebInspector.resourceCategories.other;
+ this._pendingContentCallbacks = [];
}
// Keep these in sync with WebCore::InspectorResource::Type
@@ -74,11 +75,11 @@ WebInspector.Resource.Type = {
case this.Script:
return "script";
case this.XHR:
- return "XHR";
+ return "xhr";
case this.Media:
return "media";
case this.WebSocket:
- return "WebSocket";
+ return "websocket";
case this.Other:
default:
return "other";
@@ -105,9 +106,16 @@ WebInspector.Resource.prototype = {
this.path = parsedURL ? parsedURL.path : "";
this.lastPathComponent = "";
if (parsedURL && parsedURL.path) {
- var lastSlashIndex = parsedURL.path.lastIndexOf("/");
+ // First cut the query params.
+ var path = parsedURL.path;
+ var indexOfQuery = path.indexOf("?");
+ if (indexOfQuery !== -1)
+ path = path.substring(0, indexOfQuery);
+
+ // Then take last path component.
+ var lastSlashIndex = path.lastIndexOf("/");
if (lastSlashIndex !== -1)
- this.lastPathComponent = parsedURL.path.substring(lastSlashIndex + 1);
+ this.lastPathComponent = path.substring(lastSlashIndex + 1);
}
this.lastPathComponentLowerCase = this.lastPathComponent.toLowerCase();
},
@@ -247,6 +255,8 @@ WebInspector.Resource.prototype = {
if (x) {
this._checkWarnings();
this.dispatchEventToListeners("finished");
+ if (this._pendingContentCallbacks.length)
+ this._requestContent();
}
},
@@ -267,17 +277,7 @@ WebInspector.Resource.prototype = {
set category(x)
{
- if (this._category === x)
- return;
-
- var oldCategory = this._category;
- if (oldCategory)
- oldCategory.removeResource(this);
-
this._category = x;
-
- if (this._category)
- this._category.addResource(this);
},
get cached()
@@ -530,6 +530,7 @@ WebInspector.Resource.prototype = {
set errors(x)
{
this._errors = x;
+ this.dispatchEventToListeners("errors-warnings-updated");
},
get warnings()
@@ -540,6 +541,14 @@ WebInspector.Resource.prototype = {
set warnings(x)
{
this._warnings = x;
+ this.dispatchEventToListeners("errors-warnings-updated");
+ },
+
+ clearErrorsAndWarnings: function()
+ {
+ this._warnings = 0;
+ this._errors = 0;
+ this.dispatchEventToListeners("errors-warnings-updated");
},
_mimeTypeIsConsistentWithType: function()
@@ -556,6 +565,9 @@ WebInspector.Resource.prototype = {
|| this.type === WebInspector.Resource.Type.WebSocket)
return true;
+ if (!this.mimeType)
+ return true; // Might be not known for cached resources with null responses.
+
if (this.mimeType in WebInspector.MIMETypes)
return this.type in WebInspector.MIMETypes[this.mimeType];
@@ -575,7 +587,7 @@ WebInspector.Resource.prototype = {
case WebInspector.Warnings.IncorrectMIMEType.id:
if (!this._mimeTypeIsConsistentWithType())
msg = new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.MessageSource.Other,
- WebInspector.ConsoleMessage.MessageType.Log,
+ WebInspector.ConsoleMessage.MessageType.Log,
WebInspector.ConsoleMessage.MessageLevel.Warning,
-1,
this.url,
@@ -591,13 +603,48 @@ WebInspector.Resource.prototype = {
WebInspector.console.addMessage(msg);
},
- getContents: function(callback)
+ set content(content)
+ {
+ this._content = content;
+ },
+
+ getContent: function(callback)
+ {
+ if (this._content) {
+ callback(this._content, this._contentEncoded);
+ return;
+ }
+ this._pendingContentCallbacks.push(callback);
+ if (this.finished)
+ this._requestContent();
+ },
+
+ get contentURL()
+ {
+ const maxDataUrlSize = 1024 * 1024;
+ // If resource content is not available or won't fit a data URL, fall back to using original URL.
+ if (!this._content || this._content.length > maxDataUrlSize)
+ return this.url;
+
+ return "data:" + this.mimeType + (this._contentEncoded ? ";base64," : ",") + this._content;
+ },
+
+ _requestContent: function()
{
- // FIXME: eventually, cached resources will have no identifiers.
- if (this.frameID)
- InspectorBackend.resourceContent(this.frameID, this.url, callback);
- else
- InspectorBackend.getResourceContent(this.identifier, false, callback);
+ if (this._contentRequested)
+ return;
+ this._contentRequested = true;
+ this._contentEncoded = !WebInspector.Resource.Type.isTextType(this.type);
+
+ function onResourceContent(data)
+ {
+ this._content = data;
+ var callbacks = this._pendingContentCallbacks.slice();
+ for (var i = 0; i < callbacks.length; ++i)
+ callbacks[i](this._content, this._contentEncoded);
+ this._pendingContentCallbacks.length = 0;
+ }
+ WebInspector.ResourceManager.getContent(this, this._contentEncoded, onResourceContent.bind(this));
}
}
diff --git a/WebCore/inspector/front-end/ResourceCategory.js b/WebCore/inspector/front-end/ResourceCategory.js
index 7d95a1f..43c7c2b 100644
--- a/WebCore/inspector/front-end/ResourceCategory.js
+++ b/WebCore/inspector/front-end/ResourceCategory.js
@@ -31,40 +31,11 @@ WebInspector.ResourceCategory = function(name, title, color)
this.name = name;
this.title = title;
this.color = color;
- this.resources = [];
}
WebInspector.ResourceCategory.prototype = {
-
toString: function()
{
return this.title;
- },
-
- addResource: function(resource)
- {
- var a = resource;
- var resourcesLength = this.resources.length;
- for (var i = 0; i < resourcesLength; ++i) {
- var b = this.resources[i];
- if (a.lastPathComponentLowerCase && b.lastPathComponentLowerCase)
- if (a.lastPathComponentLowerCase < b.lastPathComponentLowerCase)
- break;
- else if (a.name && b.name)
- if (a.name < b.name)
- break;
- }
-
- this.resources.splice(i, 0, resource);
- },
-
- removeResource: function(resource)
- {
- this.resources.remove(resource, true);
- },
-
- removeAllResources: function(resource)
- {
- this.resources = [];
}
}
diff --git a/WebCore/inspector/front-end/ResourceManager.js b/WebCore/inspector/front-end/ResourceManager.js
index 7244cea..62273ee 100644
--- a/WebCore/inspector/front-end/ResourceManager.js
+++ b/WebCore/inspector/front-end/ResourceManager.js
@@ -40,16 +40,17 @@ WebInspector.ResourceManager = function()
"didFailLoading",
"didLoadResourceFromMemoryCache",
"setOverrideContent",
- "didCommitLoad",
+ "didCommitLoadForFrame",
"frameDetachedFromParent",
"didCreateWebSocket",
"willSendWebSocketHandshakeRequest",
"didReceiveWebSocketHandshakeResponse",
"didCloseWebSocket");
- this._resources = {};
- this._resourcesByFrame = {};
- this._lastCachedId = 0;
+ this._resourcesById = {};
+ this._resourcesByURL = {};
+ this._resourceTreeModel = new WebInspector.ResourceTreeModel();
+ InspectorBackend.cachedResources(this._processCachedResources.bind(this));
}
WebInspector.ResourceManager.prototype = {
@@ -59,62 +60,69 @@ WebInspector.ResourceManager.prototype = {
WebInspector[arguments[i]] = this[arguments[i]].bind(this);
},
- identifierForInitialRequest: function(identifier, url, frameID, isMainResource)
+ identifierForInitialRequest: function(identifier, url, loader)
{
- var resource = new WebInspector.Resource(identifier, url);
- if (isMainResource)
+ var resource = this._createResource(identifier, url, loader);
+ if (loader.url === url) {
resource.isMainResource = true;
- this._resources[identifier] = resource;
-
- if (frameID) {
- resource.frameID = frameID;
- var resourcesForFrame = this._resourcesByFrame[frameID];
- if (!resourcesForFrame) {
- resourcesForFrame = [];
- this._resourcesByFrame[frameID] = resourcesForFrame;
- }
- resourcesForFrame.push(resource);
+ WebInspector.mainResource = resource;
}
- if (WebInspector.panels.network)
- WebInspector.panels.network.addResource(resource);
+ // It is important to bind resource url early (before scripts compile).
+ this._bindResourceURL(resource);
+
+ WebInspector.panels.network.addResource(resource);
+ WebInspector.panels.audits.resourceStarted(resource);
+ },
+
+ _createResource: function(identifier, url, loader)
+ {
+ var resource = new WebInspector.Resource(identifier, url);
+ resource.loader = loader;
+ resource.documentURL = loader.url;
+
+ this._resourcesById[identifier] = resource;
+ return resource;
},
willSendRequest: function(identifier, time, request, redirectResponse)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
// Redirect may have empty URL and we'd like to not crash with invalid HashMap entry.
// See http/tests/misc/will-send-request-returns-null-on-redirect.html
- if (!redirectResponse.isNull && request.url.length) {
+ var isRedirect = !redirectResponse.isNull && request.url.length;
+ if (isRedirect) {
resource.endTime = time;
this.didReceiveResponse(identifier, time, "Other", redirectResponse);
resource = this._appendRedirect(resource.identifier, request.url);
}
- resource.requestMethod = request.httpMethod;
- resource.requestHeaders = request.httpHeaderFields;
- resource.requestFormData = request.requestFormData;
+ this._updateResourceWithRequest(resource, request);
resource.startTime = time;
- if (WebInspector.panels.network)
+ if (isRedirect) {
+ WebInspector.panels.network.addResource(resource);
+ WebInspector.panels.audits.resourceStarted(resource);
+ } else
WebInspector.panels.network.refreshResource(resource);
},
- _appendRedirect: function(identifier, redirectURL)
+ _updateResourceWithRequest: function(resource, request)
{
- // We always store last redirect by the original id key. Rest of the redirects are referenced from within the last one.
-
- var originalResource = this._resources[identifier];
- var redirectIdentifier = originalResource.identifier + ":" + (originalResource.redirects ? originalResource.redirects.length : 0);
- originalResource.identifier = redirectIdentifier;
- this._resources[redirectIdentifier] = originalResource;
+ resource.requestMethod = request.httpMethod;
+ resource.requestHeaders = request.httpHeaderFields;
+ resource.requestFormData = request.requestFormData;
+ },
- this.identifierForInitialRequest(identifier, redirectURL, originalResource.frameID);
+ _appendRedirect: function(identifier, redirectURL)
+ {
+ var originalResource = this._resourcesById[identifier];
+ originalResource.identifier = null;
- var newResource = this._resources[identifier];
+ var newResource = this._createResource(identifier, redirectURL, originalResource.loader);
newResource.redirects = originalResource.redirects || [];
delete originalResource.redirects;
newResource.redirects.push(originalResource);
@@ -123,23 +131,32 @@ WebInspector.ResourceManager.prototype = {
markResourceAsCached: function(identifier)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
resource.cached = true;
-
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
},
didReceiveResponse: function(identifier, time, resourceType, response)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
-
+ this._updateResourceWithResponse(resource, response);
resource.type = WebInspector.Resource.Type[resourceType];
+ resource.responseReceivedTime = time;
+
+ WebInspector.panels.network.refreshResource(resource);
+ this._resourceTreeModel.addResourceToFrame(resource.loader.frameId, resource);
+ },
+
+ _updateResourceWithResponse: function(resource, response)
+ {
+ if (resource.isNull)
+ return;
+
resource.mimeType = response.mimeType;
resource.expectedContentLength = response.expectedContentLength;
resource.textEncodingName = response.textEncodingName;
@@ -150,7 +167,6 @@ WebInspector.ResourceManager.prototype = {
resource.responseHeaders = response.httpHeaderFields;
resource.connectionReused = response.connectionReused;
resource.connectionID = response.connectionID;
- resource.responseReceivedTime = time;
if (response.wasCached)
resource.cached = true;
@@ -161,101 +177,105 @@ WebInspector.ResourceManager.prototype = {
resource.requestHeaders = response.rawHeaders.requestHeaders;
resource.responseHeaders = response.rawHeaders.responseHeaders;
}
-
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
},
didReceiveContentLength: function(identifier, time, lengthReceived)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
resource.resourceSize += lengthReceived;
resource.endTime = time;
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
},
didFinishLoading: function(identifier, finishTime)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
resource.finished = true;
resource.endTime = finishTime;
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.audits.resourceFinished(resource);
+ WebInspector.extensionServer.notifyResourceFinished(resource);
+ delete this._resourcesById[identifier];
},
didFailLoading: function(identifier, time, localizedDescription)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
resource.failed = true;
+ resource.localizedFailDescription = localizedDescription;
+ resource.finished = true;
resource.endTime = time;
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.audits.resourceFinished(resource);
+ WebInspector.extensionServer.notifyResourceFinished(resource);
+ delete this._resourcesById[identifier];
},
- didLoadResourceFromMemoryCache: function(time, frameID, cachedResource)
+ didLoadResourceFromMemoryCache: function(time, cachedResource)
{
- var identifier = "cached:" + this._lastCachedId++;
- this.identifierForInitialRequest(identifier, cachedResource.url, frameID);
-
- var resource = this._resources[identifier];
+ var resource = this._createResource(null, cachedResource.url, cachedResource.loader);
+ this._updateResourceWithCachedResource(resource, cachedResource);
resource.cached = true;
- resource.startTime = resource.responseReceivedTime = time;
- resource.resourceSize = cachedResource.encodedSize();
+ resource.startTime = resource.responseReceivedTime = resource.endTime = time;
- this.didReceiveResponse(identifier, time, cachedResource.response);
+ WebInspector.panels.network.addResource(resource);
+ WebInspector.panels.audits.resourceStarted(resource);
+ WebInspector.panels.audits.resourceFinished(resource);
+ this._resourceTreeModel.addResourceToFrame(resource.loader.frameId, resource);
+ },
+
+ _updateResourceWithCachedResource: function(resource, cachedResource)
+ {
+ resource.type = WebInspector.Resource.Type[cachedResource.type];
+ resource.resourceSize = cachedResource.encodedSize;
+ this._updateResourceWithResponse(resource, cachedResource.response);
},
setOverrideContent: function(identifier, sourceString, type)
{
- var resource = this._resources[identifier];
+ var resource = WebInspector.panels.network.resources[identifier];
if (!resource)
return;
resource.type = WebInspector.Resource.Type[type];
- resource.overridenContent = sourceString;
-
- if (WebInspector.panels.network)
- WebInspector.panels.network.addResource(resource);
+ resource.content = sourceString;
+ WebInspector.panels.network.refreshResource(resource);
},
- didCommitLoad: function(frameID)
+ didCommitLoadForFrame: function(parentFrameId, loader)
{
+ this._resourceTreeModel.didCommitLoadForFrame(parentFrameId, loader);
},
- frameDetachedFromParent: function(frameID)
+ frameDetachedFromParent: function(frameId)
{
- var resourcesForFrame = this._resourcesByFrame[frameID];
- for (var i = 0; resourcesForFrame && i < resourcesForFrame.length; ++i)
- delete this._resources[resourcesForFrame[i].identifier];
- delete this._resourcesByFrame[frameID];
+ this._resourceTreeModel.frameDetachedFromParent(frameId);
},
didCreateWebSocket: function(identifier, requestURL)
{
this.identifierForInitialRequest(identifier, requestURL);
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
resource.type = WebInspector.Resource.Type.WebSocket;
- if (WebInspector.panels.network)
- WebInspector.panels.network.addResource(resource);
+ WebInspector.panels.network.addResource(resource);
},
willSendWebSocketHandshakeRequest: function(identifier, time, request)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
@@ -264,13 +284,12 @@ WebInspector.ResourceManager.prototype = {
resource.webSocketRequestKey3 = request.webSocketRequestKey3;
resource.startTime = time;
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
},
didReceiveWebSocketHandshakeResponse: function(identifier, time, response)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
@@ -280,18 +299,293 @@ WebInspector.ResourceManager.prototype = {
resource.webSocketChallengeResponse = response.webSocketChallengeResponse;
resource.responseReceivedTime = time;
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
},
didCloseWebSocket: function(identifier, time)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
resource.endTime = time;
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
+ },
+
+ _processCachedResources: function(mainFramePayload)
+ {
+ var mainResource = this._addFramesRecursively(null, mainFramePayload);
+ WebInspector.mainResource = mainResource;
+ mainResource.isMainResource = true;
+ },
+
+ _addFramesRecursively: function(parentFrameId, framePayload)
+ {
+ var frameResource = this._createResource(null, framePayload.resource.url, framePayload.resource.loader);
+ this._updateResourceWithRequest(frameResource, framePayload.resource.request);
+ this._updateResourceWithResponse(frameResource, framePayload.resource.response);
+ frameResource.type = WebInspector.Resource.Type["Document"];
+ frameResource.finished = true;
+ this._bindResourceURL(frameResource);
+
+ this._resourceTreeModel.addOrUpdateFrame(parentFrameId, framePayload.id, frameResource.displayName);
+ this._resourceTreeModel.addResourceToFrame(framePayload.id, frameResource);
+
+ for (var i = 0; framePayload.children && i < framePayload.children.length; ++i)
+ this._addFramesRecursively(framePayload.id, framePayload.children[i]);
+
+ if (!framePayload.subresources)
+ return;
+
+ for (var i = 0; i < framePayload.subresources.length; ++i) {
+ var cachedResource = framePayload.subresources[i];
+ var resource = this._createResource(null, cachedResource.url, cachedResource.loader);
+ this._updateResourceWithCachedResource(resource, cachedResource);
+ resource.finished = true;
+ this._bindResourceURL(resource);
+ this._resourceTreeModel.addResourceToFrame(framePayload.id, resource);
+ }
+ return frameResource;
+ },
+
+ resourceForURL: function(url)
+ {
+ // FIXME: receive frameId here.
+ var entry = this._resourcesByURL[url];
+ if (entry instanceof Array)
+ return entry[0];
+ return entry;
+ },
+
+ addConsoleMessage: function(msg)
+ {
+ var resource = this.resourceForURL(msg.url);
+ if (!resource)
+ return;
+
+ switch (msg.level) {
+ case WebInspector.ConsoleMessage.MessageLevel.Warning:
+ resource.warnings += msg.repeatDelta;
+ break;
+ case WebInspector.ConsoleMessage.MessageLevel.Error:
+ resource.errors += msg.repeatDelta;
+ break;
+ }
+
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
+ if (view.addMessage)
+ view.addMessage(msg);
+ },
+
+ clearConsoleMessages: function()
+ {
+ function callback(resource)
+ {
+ resource.clearErrorsAndWarnings();
+ }
+ this._resourceTreeModel.forAllResources(callback);
+ },
+
+ forAllResources: function(callback)
+ {
+ this._resourceTreeModel.forAllResources(callback);
+ },
+
+ _bindResourceURL: function(resource)
+ {
+ var resourceForURL = this._resourcesByURL[resource.url];
+ if (!resourceForURL)
+ this._resourcesByURL[resource.url] = resource;
+ else if (resourceForURL instanceof Array)
+ resourceForURL.push(resource);
+ else
+ this._resourcesByURL[resource.url] = [resourceForURL];
+ },
+
+ _unbindResourceURL: function(resource)
+ {
+ var resourceForURL = this._resourcesByURL[resource.url];
+ if (!resourceForURL)
+ return;
+
+ if (resourceForURL instanceof Array) {
+ resourceForURL.remove(resource, true);
+ if (resourceForURL.length === 1)
+ this._resourcesByURL[resource.url] = resourceForURL[0];
+ return;
+ }
+
+ delete this._resourcesByURL[resource.url];
+ }
+}
+
+WebInspector.ResourceManager.createResourceView = function(resource)
+{
+ switch (resource.category) {
+ case WebInspector.resourceCategories.documents:
+ case WebInspector.resourceCategories.stylesheets:
+ case WebInspector.resourceCategories.scripts:
+ case WebInspector.resourceCategories.xhr:
+ return new WebInspector.SourceView(resource);
+ case WebInspector.resourceCategories.images:
+ return new WebInspector.ImageView(resource);
+ case WebInspector.resourceCategories.fonts:
+ return new WebInspector.FontView(resource);
+ default:
+ return new WebInspector.ResourceView(resource);
+ }
+}
+
+WebInspector.ResourceManager.resourceViewTypeMatchesResource = function(resource, resourceView)
+{
+ switch (resource.category) {
+ case WebInspector.resourceCategories.documents:
+ case WebInspector.resourceCategories.stylesheets:
+ case WebInspector.resourceCategories.scripts:
+ case WebInspector.resourceCategories.xhr:
+ return resourceView.__proto__ === WebInspector.SourceView.prototype;
+ case WebInspector.resourceCategories.images:
+ return resourceView.__proto__ === WebInspector.ImageView.prototype;
+ case WebInspector.resourceCategories.fonts:
+ return resourceView.__proto__ === WebInspector.FontView.prototype;
+ default:
+ return resourceView.__proto__ === WebInspector.ResourceView.prototype;
+ }
+}
+
+WebInspector.ResourceManager.resourceViewForResource = function(resource)
+{
+ if (!resource)
+ return null;
+ if (!resource._resourcesView)
+ resource._resourcesView = WebInspector.ResourceManager.createResourceView(resource);
+ return resource._resourcesView;
+}
+
+WebInspector.ResourceManager.existingResourceViewForResource = function(resource)
+{
+ if (!resource)
+ return null;
+ return resource._resourcesView;
+}
+
+WebInspector.ResourceManager.getContent = function(resource, base64Encode, callback)
+{
+ // FIXME: eventually, cached resources will have no identifiers.
+ if (resource.loader)
+ InspectorBackend.resourceContent(resource.loader.frameId, resource.url, base64Encode, callback);
+ else
+ InspectorBackend.getResourceContent(resource.identifier, base64Encode, callback);
+}
+
+WebInspector.ResourceTreeModel = function()
+{
+ this._resourcesByFrameId = {};
+ this._subframes = {};
+}
+
+WebInspector.ResourceTreeModel.prototype = {
+ addOrUpdateFrame: function(parentFrameId, frameId, displayName)
+ {
+ WebInspector.panels.storage.addOrUpdateFrame(parentFrameId, frameId, displayName);
+ var subframes = this._subframes[parentFrameId];
+ if (!subframes) {
+ subframes = {};
+ this._subframes[parentFrameId || 0] = subframes;
+ }
+ subframes[frameId] = true;
+ },
+
+ didCommitLoadForFrame: function(parentFrameId, loader)
+ {
+ // parentFrameId === 0 is when main frame navigation happens.
+ this._clearChildFramesAndResources(parentFrameId ? loader.frameId : 0, loader.loaderId);
+
+ var tmpResource = new WebInspector.Resource(null, loader.url);
+ this.addOrUpdateFrame(parentFrameId, loader.frameId, tmpResource.displayName);
+
+ var resourcesForFrame = this._resourcesByFrameId[loader.frameId];
+ for (var i = 0; resourcesForFrame && i < resourcesForFrame.length; ++i) {
+ WebInspector.resourceManager._bindResourceURL(resourcesForFrame[i]);
+ WebInspector.panels.storage.addResourceToFrame(loader.frameId, resourcesForFrame[i]);
+ }
+ },
+
+ frameDetachedFromParent: function(frameId)
+ {
+ this._clearChildFramesAndResources(frameId, 0);
+ WebInspector.panels.storage.removeFrame(frameId);
+ },
+
+ _clearChildFramesAndResources: function(frameId, loaderId)
+ {
+ WebInspector.panels.storage.removeResourcesFromFrame(frameId);
+
+ this._clearResources(frameId, loaderId);
+ var subframes = this._subframes[frameId];
+ if (!subframes)
+ return;
+
+ for (var childFrameId in subframes) {
+ WebInspector.panels.storage.removeFrame(childFrameId);
+ this._clearChildFramesAndResources(childFrameId, loaderId);
+ }
+ delete this._subframes[frameId];
+ },
+
+ addResourceToFrame: function(frameId, resource)
+ {
+ var resourcesForFrame = this._resourcesByFrameId[frameId];
+ if (!resourcesForFrame) {
+ resourcesForFrame = [];
+ this._resourcesByFrameId[frameId] = resourcesForFrame;
+ }
+ resourcesForFrame.push(resource);
+
+ WebInspector.panels.storage.addResourceToFrame(frameId, resource);
+ },
+
+ _clearResources: function(frameId, loaderToPreserveId)
+ {
+ var resourcesForFrame = this._resourcesByFrameId[frameId];
+ if (!resourcesForFrame)
+ return;
+
+ var preservedResourcesForFrame = [];
+ for (var i = 0; i < resourcesForFrame.length; ++i) {
+ var resource = resourcesForFrame[i];
+ if (resource.loader.loaderId === loaderToPreserveId) {
+ preservedResourcesForFrame.push(resource);
+ continue;
+ }
+ WebInspector.resourceManager._unbindResourceURL(resource);
+ }
+
+ delete this._resourcesByFrameId[frameId];
+ if (preservedResourcesForFrame.length)
+ this._resourcesByFrameId[frameId] = preservedResourcesForFrame;
+ },
+
+ forAllResources: function(callback)
+ {
+ this._callForFrameResources(0, callback);
+ },
+
+ _callForFrameResources: function(frameId, callback)
+ {
+ var resources = this._resourcesByFrameId[frameId];
+ for (var i = 0; resources && i < resources.length; ++i) {
+ if (callback(resources[i]))
+ return true;
+ }
+
+ var frames = this._subframes[frameId];
+ if (frames) {
+ for (var id in frames) {
+ if (this._callForFrameResources(id, callback))
+ return true;
+ }
+ }
+ return false;
}
}
diff --git a/WebCore/inspector/front-end/ResourceView.js b/WebCore/inspector/front-end/ResourceView.js
index 862569f..ffb229d 100644
--- a/WebCore/inspector/front-end/ResourceView.js
+++ b/WebCore/inspector/front-end/ResourceView.js
@@ -139,14 +139,20 @@ WebInspector.ResourceView.prototype = {
this._selectTab();
},
+ resize: function()
+ {
+ if (this._cookiesView && !this._cookiesView.element.hasStyleClass("hidden"))
+ this._cookiesView.resize();
+ },
+
_selectTab: function()
{
- if (this._headersVisible) {
- if (!this.hasContentTab() || WebInspector.applicationSettings.resourceViewTab === "headers")
- this._selectHeadersTab();
- else
- this.selectContentTab();
- } else
+ var preferredTab = WebInspector.applicationSettings.resourceViewTab;
+ if (this._headersVisible && this._cookiesView && preferredTab === "cookies")
+ this._selectCookiesTab();
+ else if (this._headersVisible && (!this.hasContentTab() || preferredTab === "headers"))
+ this._selectHeadersTab();
+ else
this._innerSelectContentTab();
},
@@ -170,11 +176,18 @@ WebInspector.ResourceView.prototype = {
return false;
},
+ _selectCookiesTab: function(updatePrefs)
+ {
+ if (updatePrefs)
+ WebInspector.applicationSettings.resourceViewTab = "cookies";
+ this.tabbedPane.selectTabById("cookies");
+ this._cookiesView.resize();
+ },
+
_innerSelectContentTab: function()
{
this.tabbedPane.selectTabById("content");
- if ("resize" in this)
- this.resize();
+ this.resize();
if (this.hasContentTab())
this.contentTabSelected();
},
@@ -283,6 +296,7 @@ WebInspector.ResourceView.prototype = {
additionalRow = {header: "(Key3)", value: this.resource.webSocketRequestKey3};
this._refreshHeaders(WebInspector.UIString("Request Headers"), this.resource.sortedRequestHeaders, additionalRow, this.requestHeadersTreeElement);
this._refreshFormData();
+ this._refreshCookies();
},
_refreshResponseHeaders: function()
@@ -291,6 +305,7 @@ WebInspector.ResourceView.prototype = {
if (typeof this.resource.webSocketChallengeResponse !== "undefined")
additionalRow = {header: "(Challenge Response)", value: this.resource.webSocketChallengeResponse};
this._refreshHeaders(WebInspector.UIString("Response Headers"), this.resource.sortedResponseHeaders, additionalRow, this.responseHeadersTreeElement);
+ this._refreshCookies();
},
_refreshHTTPInformation: function()
@@ -347,7 +362,80 @@ WebInspector.ResourceView.prototype = {
headerTreeElement.selectable = false;
headersTreeElement.appendChild(headerTreeElement);
}
+ },
+
+ _refreshCookies: function()
+ {
+ if (!this._cookiesView) {
+ if (!this.resource.requestCookies && !this.resource.responseCookies)
+ return;
+ this._cookiesView = new WebInspector.ResourceCookiesTab();
+ this.tabbedPane.appendTab("cookies", WebInspector.UIString("Cookies"), this._cookiesView.element, this._selectCookiesTab.bind(this, true));
+ }
+ this._cookiesView.requestCookies = this.resource.requestCookies;
+ this._cookiesView.responseCookies = this.resource.responseCookies;
}
}
WebInspector.ResourceView.prototype.__proto__ = WebInspector.View.prototype;
+
+WebInspector.ResourceCookiesTab = function()
+{
+ WebInspector.CookiesTable.call(this);
+ this.element.addStyleClass("resource-view-cookies");
+ this._requestCookies = [];
+ this._responseCookies = [];
+ this._createDataGrid(true);
+ this._requestCookiesNode = this._createFolder(WebInspector.UIString("Request Cookies"));
+ this._responseCookiesNode = this._createFolder(WebInspector.UIString("Response Cookies"));
+}
+
+WebInspector.ResourceCookiesTab.prototype = {
+ set requestCookies(cookies)
+ {
+ if (this._requestCookies === cookies)
+ return;
+ this._requestCookies = cookies;
+ this._populateCookies(this._requestCookiesNode, this._requestCookies);
+ },
+
+ set responseCookies(cookies)
+ {
+ if (this._responseCookies === cookies)
+ return;
+ this._responseCookies = cookies;
+ this._populateCookies(this._responseCookiesNode, this._responseCookies);
+ },
+
+ _populateDataGrid: function()
+ {
+ this._populateCookies(this._requestCookiesNode, this._requestCookies);
+ this._populateCookies(this._responseCookiesNode, this._responseCookies);
+ },
+
+ _populateCookies: function(parentNode, cookies)
+ {
+ WebInspector.CookiesTable.prototype._populateCookies.call(this, parentNode, cookies);
+ var totalSize = 0;
+ if (cookies) {
+ for (var i = 0; i < cookies.length; ++i)
+ totalSize += cookies[i].size;
+ }
+ parentNode.expanded = true;
+ parentNode.data[5] = totalSize;
+ parentNode.refresh();
+ },
+
+ _createFolder: function(name)
+ {
+ var data = [ name, "", "", "", "", 0, "", "" ];
+ var node = new WebInspector.DataGridNode(data);
+ node.selectable = true;
+ node.expanded = true;
+ this._dataGrid.appendChild(node);
+ node.element.addStyleClass("row-group");
+ return node;
+ }
+};
+
+WebInspector.ResourceCookiesTab.prototype.__proto__ = WebInspector.CookiesTable.prototype;
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index ae67bef..b35fc4b 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -30,7 +30,7 @@
WebInspector.ResourcesPanel = function()
{
WebInspector.Panel.call(this, "resources");
-
+ this.resourceURLMap = {};
this._items = [];
this._staleItems = [];
@@ -439,26 +439,22 @@ WebInspector.ResourcesPanel.prototype = {
this.element.appendChild(this.panelEnablerView.element);
this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
- this.enableToggleButton.addEventListener("click", this._toggleResourceTracking.bind(this), false);
+ this.enableToggleButton.addEventListener("click", this.toggleResourceTracking.bind(this), false);
},
_createStatusbarButtons: function()
{
this.largerResourcesButton = new WebInspector.StatusBarButton(WebInspector.UIString("Use small resource rows."), "resources-larger-resources-status-bar-item");
- WebInspector.applicationSettings.addEventListener("loaded", this._settingsLoaded, this);
- this.largerResourcesButton.addEventListener("click", this._toggleLargerResources.bind(this), false);
- this.sortingSelectElement = document.createElement("select");
- this.sortingSelectElement.className = "status-bar-item";
- this.sortingSelectElement.addEventListener("change", this._changeSortingFunction.bind(this), false);
- },
-
- _settingsLoaded: function()
- {
this.largerResourcesButton.toggled = WebInspector.applicationSettings.resourcesLargeRows;
if (!WebInspector.applicationSettings.resourcesLargeRows)
this._setLargerResources(WebInspector.applicationSettings.resourcesLargeRows);
this._loadSortOptions();
+
+ this.largerResourcesButton.addEventListener("click", this._toggleLargerResources.bind(this), false);
+ this.sortingSelectElement = document.createElement("select");
+ this.sortingSelectElement.className = "status-bar-item";
+ this.sortingSelectElement.addEventListener("change", this._changeSortingFunction.bind(this), false);
},
_loadSortOptions: function()
@@ -557,7 +553,7 @@ WebInspector.ResourcesPanel.prototype = {
var resource = this._resources[i];
if (!resource._itemsTreeElement || !resource._itemsTreeElement.selectable)
continue;
- var resourceView = this.resourceViewForResource(resource);
+ var resourceView = WebInspector.ResourceManager.resourceViewForResource(resource);
if (!resourceView.performSearch || resourceView === visibleView)
continue;
views.push(resourceView);
@@ -752,10 +748,12 @@ WebInspector.ResourcesPanel.prototype = {
this.sortingSelectElement.addStyleClass("hidden");
this.panelEnablerView.visible = true;
}
+ this.resourceURLMap = {};
},
addResource: function(resource)
{
+ this.resourceURLMap[resource.url] = resource;
this._resources.push(resource);
},
@@ -770,6 +768,7 @@ WebInspector.ResourcesPanel.prototype = {
resource.errors = 0;
delete resource._resourcesView;
+ delete this.resourceURLMap[resource.url];
},
addMessageToResource: function(resource, msg)
@@ -789,7 +788,7 @@ WebInspector.ResourcesPanel.prototype = {
if (!this.currentQuery && resource._itemsTreeElement)
resource._itemsTreeElement.updateErrorsAndWarnings();
- var view = this.resourceViewForResource(resource);
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
if (view.addMessage)
view.addMessage(msg);
},
@@ -823,10 +822,10 @@ WebInspector.ResourcesPanel.prototype = {
if (!resource || !resource._resourcesView)
return;
- if (this._resourceViewIsConsistentWithCategory(resource, resource._resourcesView))
+ if (WebInspector.ResourceManager.resourceViewTypeMatchesResource(resource, resource._resourcesView))
return;
+ var newView = WebInspector.ResourceManager.createResourceView(resource);
- var newView = this._createResourceView(resource);
if (!this.currentQuery && resource._itemsTreeElement)
resource._itemsTreeElement.updateErrorsAndWarnings();
@@ -868,7 +867,7 @@ WebInspector.ResourcesPanel.prototype = {
if (this.visibleResource && this.visibleResource._resourcesView)
this.visibleResource._resourcesView.hide();
- var view = this.resourceViewForResource(resource);
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
view.headersVisible = true;
view.show(this.viewsContainerElement);
@@ -909,32 +908,6 @@ WebInspector.ResourcesPanel.prototype = {
this.updateSidebarWidth();
},
- resourceViewForResource: function(resource)
- {
- if (!resource)
- return null;
- if (!resource._resourcesView)
- resource._resourcesView = this._createResourceView(resource);
- return resource._resourcesView;
- },
-
- sourceFrameForResource: function(resource)
- {
- var view = this.resourceViewForResource(resource);
- if (!view)
- return null;
-
- if (!view.setupSourceFrameIfNeeded)
- return null;
-
- // Setting up the source frame requires that we be attached.
- if (!this.element.parentNode)
- this.attach();
-
- view.setupSourceFrameIfNeeded();
- return view.sourceFrame;
- },
-
_sortResourcesIfNeeded: function()
{
this.sortItems(this.sortingFunction);
@@ -1068,40 +1041,6 @@ WebInspector.ResourcesPanel.prototype = {
this.calculator = this.summaryBar.calculator = selectedOption.calculator;
},
- _resourceViewIsConsistentWithCategory: function(resource, resourceView)
- {
- switch (resource.category) {
- case WebInspector.resourceCategories.documents:
- case WebInspector.resourceCategories.stylesheets:
- case WebInspector.resourceCategories.scripts:
- case WebInspector.resourceCategories.xhr:
- return resourceView.__proto__ === WebInspector.SourceView.prototype;
- case WebInspector.resourceCategories.images:
- return resourceView.__proto__ === WebInspector.ImageView.prototype;
- case WebInspector.resourceCategories.fonts:
- return resourceView.__proto__ === WebInspector.FontView.prototype;
- default:
- return resourceView.__proto__ === WebInspector.ResourceView.prototype;
- }
- },
-
- _createResourceView: function(resource)
- {
- switch (resource.category) {
- case WebInspector.resourceCategories.documents:
- case WebInspector.resourceCategories.stylesheets:
- case WebInspector.resourceCategories.scripts:
- case WebInspector.resourceCategories.xhr:
- return new WebInspector.SourceView(resource);
- case WebInspector.resourceCategories.images:
- return new WebInspector.ImageView(resource);
- case WebInspector.resourceCategories.fonts:
- return new WebInspector.FontView(resource);
- default:
- return new WebInspector.ResourceView(resource);
- }
- },
-
setSidebarWidth: function(width)
{
if (this.visibleResource) {
@@ -1126,10 +1065,10 @@ WebInspector.ResourcesPanel.prototype = {
{
if (this._resourceTrackingEnabled)
return;
- this._toggleResourceTracking(this.panelEnablerView.alwaysEnabled);
+ this.toggleResourceTracking(this.panelEnablerView.alwaysEnabled);
},
- _toggleResourceTracking: function(optionalAlways)
+ toggleResourceTracking: function(optionalAlways)
{
function callback(newState) {
if (newState)
@@ -1142,7 +1081,7 @@ WebInspector.ResourcesPanel.prototype = {
this.largerResourcesButton.visible = false;
this.sortingSelectElement.visible = false;
WebInspector.resources = {};
- WebInspector.resourceURLMap = {};
+ this.resourceURLMap = {};
InspectorBackend.setResourceTrackingEnabled(false, true, callback);
} else {
this.largerResourcesButton.visible = true;
@@ -1723,7 +1662,15 @@ WebInspector.ResourceSidebarTreeElement.prototype = {
if (this.resource.category === WebInspector.resourceCategories.images) {
var previewImage = document.createElement("img");
previewImage.className = "image-resource-icon-preview";
- previewImage.src = this.resource.url;
+
+ function onResourceContent()
+ {
+ previewImage.src = this.resource.contentURL;
+ }
+ if (Preferences.useDataURLForResourceImageIcons)
+ this.resource.getContent(onResourceContent.bind(this));
+ else
+ previewImage.src = this.resource.url;
this.iconElement = document.createElement("div");
this.iconElement.className = "icon";
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 0a653c9..8125c1e 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -241,7 +241,7 @@ WebInspector.ScriptsPanel.prototype = {
var script = new WebInspector.Script(sourceID, sourceURL, source, startingLine, errorLine, errorMessage, scriptWorldType);
this._sourceIDMap[sourceID] = script;
- var resource = WebInspector.resourceURLMap[sourceURL];
+ var resource = WebInspector.resourceForURL(sourceURL);
if (resource) {
if (resource.finished) {
// Resource is finished, bind the script right away.
@@ -289,7 +289,7 @@ WebInspector.ScriptsPanel.prototype = {
var sourceFrame;
if (breakpoint.url) {
- var resource = WebInspector.resourceURLMap[breakpoint.url];
+ var resource = WebInspector.resourceForURL(breakpoint.url);
if (resource && resource.finished)
sourceFrame = this._sourceFrameForScriptOrResource(resource);
}
@@ -570,11 +570,24 @@ WebInspector.ScriptsPanel.prototype = {
_sourceFrameForScriptOrResource: function(scriptOrResource)
{
if (scriptOrResource instanceof WebInspector.Resource)
- return WebInspector.panels.resources.sourceFrameForResource(scriptOrResource);
+ return this._sourceFrameForResource(scriptOrResource);
if (scriptOrResource instanceof WebInspector.Script)
return this.sourceFrameForScript(scriptOrResource);
},
+ _sourceFrameForResource: function(resource)
+ {
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
+ if (!view)
+ return null;
+
+ if (!view.setupSourceFrameIfNeeded)
+ return null;
+
+ view.setupSourceFrameIfNeeded();
+ return view.sourceFrame;
+ },
+
_showScriptOrResource: function(scriptOrResource, options)
{
// options = {line:, shouldHighlightLine:, fromBackForwardAction:, initialLoad:}
@@ -585,9 +598,7 @@ WebInspector.ScriptsPanel.prototype = {
var view;
if (scriptOrResource instanceof WebInspector.Resource) {
- if (!WebInspector.panels.resources)
- return null;
- view = WebInspector.panels.resources.resourceViewForResource(scriptOrResource);
+ view = WebInspector.ResourceManager.resourceViewForResource(scriptOrResource);
view.headersVisible = false;
} else if (scriptOrResource instanceof WebInspector.Script)
view = this.scriptViewForScript(scriptOrResource);
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js
index c6da14d..3fb81f5 100644
--- a/WebCore/inspector/front-end/Settings.js
+++ b/WebCore/inspector/front-end/Settings.js
@@ -45,96 +45,74 @@ var Preferences = {
onlineDetectionEnabled: true,
nativeInstrumentationEnabled: false,
resourceExportEnabled: false,
- networkPanelEnabled: false
+ networkPanelEnabled: false,
+ useDataURLForResourceImageIcons: true
}
-WebInspector.Settings = function(sessionScope)
+WebInspector.Settings = function()
{
- this._sessionScope = sessionScope;
- this._store = {};
-}
+ this.installApplicationSetting("colorFormat", "hex");
+ this.installApplicationSetting("consoleHistory", []);
+ this.installApplicationSetting("eventListenersFilter", "all");
+ this.installApplicationSetting("lastViewedScriptFile", "application");
+ this.installApplicationSetting("resourcesLargeRows", true);
+ this.installApplicationSetting("resourcesSortOptions", {timeOption: "responseTime", sizeOption: "transferSize"});
+ this.installApplicationSetting("resourceViewTab", "content");
+ this.installApplicationSetting("showInheritedComputedStyleProperties", false);
+ this.installApplicationSetting("showUserAgentStyles", true);
+ this.installApplicationSetting("watchExpressions", []);
+ this.installApplicationSetting("lastActivePanel", "elements");
-WebInspector.Settings.initialize = function()
-{
- WebInspector.applicationSettings = new WebInspector.Settings(false);
- WebInspector.sessionSettings = new WebInspector.Settings(true);
+ this.installProjectSetting("breakpoints", {});
+}
- function populateApplicationSettings(settingsString)
+WebInspector.Settings.prototype = {
+ installApplicationSetting: function(key, defaultValue)
{
- WebInspector.applicationSettings._load(settingsString);
- WebInspector.applicationSettings.installSetting("eventListenersFilter", "event-listeners-filter", "all");
- WebInspector.applicationSettings.installSetting("colorFormat", "color-format", "hex");
- WebInspector.applicationSettings.installSetting("resourcesLargeRows", "resources-large-rows", true);
- WebInspector.applicationSettings.installSetting("watchExpressions", "watch-expressions", []);
- WebInspector.applicationSettings.installSetting("lastViewedScriptFile", "last-viewed-script-file");
- WebInspector.applicationSettings.installSetting("showInheritedComputedStyleProperties", "show-inherited-computed-style-properties", false);
- WebInspector.applicationSettings.installSetting("showUserAgentStyles", "show-user-agent-styles", true);
- WebInspector.applicationSettings.installSetting("resourceViewTab", "resource-view-tab", "content");
- WebInspector.applicationSettings.installSetting("consoleHistory", "console-history", []);
- WebInspector.applicationSettings.installSetting("resourcesSortOptions", "resources-sort-options", {timeOption: "responseTime", sizeOption: "transferSize"});
-
- WebInspector.applicationSettings.dispatchEventToListeners("loaded");
- }
+ this.__defineGetter__(key, this._get.bind(this, key, defaultValue));
+ this.__defineSetter__(key, this._set.bind(this, key));
+ },
- function populateSessionSettings(settingsString)
+ installProjectSetting: function(key, defaultValue)
{
- WebInspector.sessionSettings._load(settingsString);
- WebInspector.sessionSettings.dispatchEventToListeners("loaded");
- }
-
- InspectorBackend.getSettings(function(settings) {
- populateApplicationSettings(settings.application);
- populateSessionSettings(settings.session);
- });
-}
+ this.__defineGetter__(key, this._getProjectSetting.bind(this, key, defaultValue));
+ this.__defineSetter__(key, this._setProjectSetting.bind(this, key));
+ },
-WebInspector.Settings.prototype = {
- reset: function()
+ _get: function(key, defaultValue)
{
- this._store = {};
- // FIXME: restore default values (bug 42820)
- this.dispatchEventToListeners("loaded");
+ if (key in window.localStorage) {
+ try {
+ return JSON.parse(window.localStorage[key]);
+ } catch(e) {
+ window.localStorage.removeItem(key);
+ }
+ }
+ return defaultValue;
},
- _load: function(settingsString)
+ _set: function(key, value)
{
- try {
- var loadedStore = JSON.parse(settingsString);
- } catch (e) {
- // May fail;
- loadedStore = {};
- }
- if (!loadedStore)
- return;
- for (var propertyName in loadedStore)
- this._store[propertyName] = loadedStore[propertyName];
+ window.localStorage[key] = JSON.stringify(value);
},
- installSetting: function(name, propertyName, defaultValue)
+ _getProjectSetting: function(key, defaultValue)
{
- this.__defineGetter__(name, this._get.bind(this, propertyName));
- this.__defineSetter__(name, this._set.bind(this, propertyName));
- if (!(propertyName in this._store))
- this._store[propertyName] = defaultValue;
+ return this._get(this._formatProjectKey(key), defaultValue);
},
- _get: function(propertyName)
+ _setProjectSetting: function(key, value)
{
- return this._store[propertyName];
+ return this._set(this._formatProjectKey(key), value);
},
- _set: function(propertyName, newValue)
+ _formatProjectKey: function(key)
{
- this._store[propertyName] = newValue;
- try {
- var store = JSON.stringify(this._store);
- if (this._sessionScope)
- InspectorBackend.saveSessionSettings(store);
- else
- InspectorBackend.saveApplicationSettings(store);
- } catch (e) {
- // May fail;
- }
+ var url = this._mainResourceURL;
+ var fragmentIndex = url.indexOf("#");
+ if (fragmentIndex !== -1)
+ url = url.substring(0, fragmentIndex);
+ return key + "." + url;
}
}
diff --git a/WebCore/inspector/front-end/SourceView.js b/WebCore/inspector/front-end/SourceView.js
index 8092505..bfdc058 100644
--- a/WebCore/inspector/front-end/SourceView.js
+++ b/WebCore/inspector/front-end/SourceView.js
@@ -73,6 +73,7 @@ WebInspector.SourceView.prototype = {
this.sourceFrame.resize();
if (this.localSourceFrame)
this.localSourceFrame.resize();
+ WebInspector.ResourceView.prototype.resize.call(this);
},
setupSourceFrameIfNeeded: function()
@@ -83,7 +84,7 @@ WebInspector.SourceView.prototype = {
this.attach();
delete this._frameNeedsSetup;
- this.resource.getContents(this._contentLoaded.bind(this));
+ this.resource.getContent(this._contentLoaded.bind(this));
},
hasContentTab: function()
diff --git a/WebCore/inspector/front-end/StoragePanel.js b/WebCore/inspector/front-end/StoragePanel.js
index e033b57..2fa54c2 100644
--- a/WebCore/inspector/front-end/StoragePanel.js
+++ b/WebCore/inspector/front-end/StoragePanel.js
@@ -32,28 +32,36 @@ WebInspector.StoragePanel = function(database)
WebInspector.Panel.call(this, "storage");
this.createSidebar();
+ this.sidebarElement.addStyleClass("outline-disclosure filter-all children small");
+ this.sidebarTreeElement.removeStyleClass("sidebar-tree");
+
+ if (Preferences.networkPanelEnabled) {
+ this.resourcesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Frames"), "frame-storage-tree-item");
+ this.sidebarTree.appendChild(this.resourcesListTreeElement);
+ this.resourcesListTreeElement.expand();
+ this._treeElementForFrameId = {};
+ }
- this.databasesListTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("DATABASES"), {}, true);
+ this.databasesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Databases"), "database-storage-tree-item");
this.sidebarTree.appendChild(this.databasesListTreeElement);
this.databasesListTreeElement.expand();
- this.localStorageListTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("LOCAL STORAGE"), {}, true);
+ this.localStorageListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Local Storage"), "domstorage-storage-tree-item local-storage");
this.sidebarTree.appendChild(this.localStorageListTreeElement);
this.localStorageListTreeElement.expand();
- this.sessionStorageListTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("SESSION STORAGE"), {}, true);
+ this.sessionStorageListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Session Storage"), "domstorage-storage-tree-item session-storage");
this.sidebarTree.appendChild(this.sessionStorageListTreeElement);
this.sessionStorageListTreeElement.expand();
- this.cookieListTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("COOKIES"), {}, true);
+ this.cookieListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Cookies"), "cookie-storage-tree-item");
this.sidebarTree.appendChild(this.cookieListTreeElement);
this.cookieListTreeElement.expand();
-
- this.applicationCacheListTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("APPLICATION CACHE"), {}, true);
+ this.applicationCacheListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Application Cache"), "application-cache-storage-tree-item");
this.sidebarTree.appendChild(this.applicationCacheListTreeElement);
this.applicationCacheListTreeElement.expand();
-
+
this.storageViews = document.createElement("div");
this.storageViews.id = "storage-views";
this.element.appendChild(this.storageViews);
@@ -61,13 +69,15 @@ WebInspector.StoragePanel = function(database)
this.storageViewStatusBarItemsContainer = document.createElement("div");
this.storageViewStatusBarItemsContainer.className = "status-bar-items";
- this.reset();
+ this._databases = [];
+ this._domStorage = [];
+ this._cookieViews = {};
}
WebInspector.StoragePanel.prototype = {
get toolbarItemLabel()
{
- return WebInspector.UIString("Storage");
+ return Preferences.networkPanelEnabled ? WebInspector.UIString("Resources") : WebInspector.UIString("Storage");
},
get statusBarItems()
@@ -77,27 +87,18 @@ WebInspector.StoragePanel.prototype = {
reset: function()
{
- if (this._databases) {
- var databasesLength = this._databases.length;
- for (var i = 0; i < databasesLength; ++i) {
- var database = this._databases[i];
-
- delete database._tableViews;
- delete database._queryView;
- }
+ for (var i = 0; i < this._databases.length; ++i) {
+ var database = this._databases[i];
+ delete database._tableViews;
+ delete database._queryView;
}
-
this._databases = [];
- if (this._domStorage) {
- var domStorageLength = this._domStorage.length;
- for (var i = 0; i < domStorageLength; ++i) {
- var domStorage = this._domStorage[i];
-
- delete domStorage._domStorageView;
- }
+ var domStorageLength = this._domStorage.length;
+ for (var i = 0; i < this._domStorage.length; ++i) {
+ var domStorage = this._domStorage[i];
+ delete domStorage._domStorageView;
}
-
this._domStorage = [];
this._cookieViews = {};
@@ -109,36 +110,112 @@ WebInspector.StoragePanel.prototype = {
this.localStorageListTreeElement.removeChildren();
this.sessionStorageListTreeElement.removeChildren();
this.cookieListTreeElement.removeChildren();
-
this.applicationCacheListTreeElement.removeChildren();
this.storageViews.removeChildren();
this.storageViewStatusBarItemsContainer.removeChildren();
-
+
if (this.sidebarTree.selectedTreeElement)
this.sidebarTree.selectedTreeElement.deselect();
},
+ addOrUpdateFrame: function(parentFrameId, frameId, displayName)
+ {
+ var frameTreeElement = this._treeElementForFrameId[frameId];
+ if (frameTreeElement) {
+ frameTreeElement.displayName = displayName;
+ return;
+ }
+
+ var parentTreeElement = parentFrameId ? this._treeElementForFrameId[parentFrameId] : this.resourcesListTreeElement;
+ if (!parentTreeElement) {
+ console.warning("No frame with id:" + parentFrameId + " to route " + displayName + " to.")
+ return;
+ }
+
+ var frameTreeElement = new WebInspector.FrameTreeElement(this, frameId, displayName);
+ this._treeElementForFrameId[frameId] = frameTreeElement;
+
+ // Insert in the alphabetical order, first frames, then resources.
+ var children = parentTreeElement.children;
+ for (var i = 0; i < children.length; ++i) {
+ var child = children[i];
+ if (!(child instanceof WebInspector.FrameTreeElement)) {
+ parentTreeElement.insertChild(frameTreeElement, i);
+ return;
+ }
+ if (child.displayName.localeCompare(frameTreeElement.displayName) > 0) {
+ parentTreeElement.insertChild(frameTreeElement, i);
+ return;
+ }
+ }
+ parentTreeElement.appendChild(frameTreeElement);
+ },
+
+ removeFrame: function(frameId)
+ {
+ var frameTreeElement = this._treeElementForFrameId[frameId];
+ if (!frameTreeElement)
+ return;
+ delete this._treeElementForFrameId[frameId];
+ if (frameTreeElement.parent)
+ frameTreeElement.parent.removeChild(frameTreeElement);
+ },
+
+ addResourceToFrame: function(frameId, resource)
+ {
+ var frameTreeElement = this._treeElementForFrameId[frameId];
+ if (!frameTreeElement) {
+ // This is a frame's main resource, it will be retained
+ // and re-added by the resource manager;
+ return;
+ }
+
+ var resourceTreeElement = new WebInspector.FrameResourceTreeElement(this, resource);
+
+ // Insert in the alphabetical order, first frames, then resources. Document resource goes first.
+ var children = frameTreeElement.children;
+ for (var i = 0; i < children.length; ++i) {
+ var child = children[i];
+ if (!(child instanceof WebInspector.FrameResourceTreeElement))
+ continue;
+
+ if (resource.type === WebInspector.Resource.Type.Document ||
+ (child._resource.type !== WebInspector.Resource.Type.Document && child._resource.displayName.localeCompare(resource.displayName) > 0)) {
+ frameTreeElement.insertChild(resourceTreeElement, i);
+ return;
+ }
+ }
+ frameTreeElement.appendChild(resourceTreeElement);
+ },
+
+ removeResourcesFromFrame: function(frameId)
+ {
+ var frameTreeElement = this._treeElementForFrameId[frameId];
+ if (frameTreeElement)
+ frameTreeElement.removeChildren();
+ },
+
addDatabase: function(database)
{
this._databases.push(database);
- var databaseTreeElement = new WebInspector.DatabaseSidebarTreeElement(database);
+ var databaseTreeElement = new WebInspector.DatabaseTreeElement(this, database);
database._databasesTreeElement = databaseTreeElement;
this.databasesListTreeElement.appendChild(databaseTreeElement);
},
addCookieDomain: function(domain)
{
- var cookieDomainTreeElement = new WebInspector.CookieSidebarTreeElement(domain);
+ var cookieDomainTreeElement = new WebInspector.CookieTreeElement(this, domain);
this.cookieListTreeElement.appendChild(cookieDomainTreeElement);
},
addDOMStorage: function(domStorage)
{
this._domStorage.push(domStorage);
- var domStorageTreeElement = new WebInspector.DOMStorageSidebarTreeElement(domStorage, (domStorage.isLocalStorage ? "local-storage" : "session-storage"));
+ var domStorageTreeElement = new WebInspector.DOMStorageTreeElement(this, domStorage, (domStorage.isLocalStorage ? "local-storage" : "session-storage"));
domStorage._domStorageTreeElement = domStorageTreeElement;
if (domStorage.isLocalStorage)
this.localStorageListTreeElement.appendChild(domStorageTreeElement);
@@ -148,7 +225,7 @@ WebInspector.StoragePanel.prototype = {
addApplicationCache: function(domain)
{
- var applicationCacheTreeElement = new WebInspector.ApplicationCacheSidebarTreeElement(domain);
+ var applicationCacheTreeElement = new WebInspector.ApplicationCacheTreeElement(this, domain);
this.applicationCacheListTreeElement.appendChild(applicationCacheTreeElement);
},
@@ -174,14 +251,47 @@ WebInspector.StoragePanel.prototype = {
}
},
+ canShowSourceLine: function(url, line)
+ {
+ return !!WebInspector.resourceManager.resourceForURL(url);
+ },
+
+ showSourceLine: function(url, line)
+ {
+ this.showResource(WebInspector.resourceManager.resourceForURL(url), line);
+ },
+
+ showResource: function(resource, line)
+ {
+ var resourceTreeElement = this._findTreeElementForResource(resource);
+ if (resourceTreeElement) {
+ resourceTreeElement.reveal();
+ resourceTreeElement.select();
+ }
+
+ if (line) {
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
+ view.selectContentTab(true);
+ if (view.revealLine)
+ view.revealLine(line);
+ if (view.highlightLine)
+ view.highlightLine(line);
+ }
+ return true;
+ },
+
+ _showResourceView: function(resource)
+ {
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
+ view.headersVisible = false;
+ this._innerShowView(view);
+ },
+
showDatabase: function(database, tableName)
{
if (!database)
return;
- if (this.visibleView)
- this.visibleView.hide();
-
var view;
if (tableName) {
if (!("_tableViews" in database))
@@ -199,7 +309,7 @@ WebInspector.StoragePanel.prototype = {
}
}
- this._genericViewSetup(view);
+ this._innerShowView(view);
},
showDOMStorage: function(domStorage)
@@ -207,9 +317,6 @@ WebInspector.StoragePanel.prototype = {
if (!domStorage)
return;
- if (this.visibleView)
- this.visibleView.hide();
-
var view;
view = domStorage._domStorageView;
if (!view) {
@@ -217,42 +324,47 @@ WebInspector.StoragePanel.prototype = {
domStorage._domStorageView = view;
}
- this._genericViewSetup(view);
+ this._innerShowView(view);
},
showCookies: function(treeElement, cookieDomain)
{
- if (this.visibleView)
- this.visibleView.hide();
-
var view = this._cookieViews[cookieDomain];
if (!view) {
view = new WebInspector.CookieItemsView(treeElement, cookieDomain);
this._cookieViews[cookieDomain] = view;
}
- this._genericViewSetup(view);
+ this._innerShowView(view);
},
showApplicationCache: function(treeElement, appcacheDomain)
{
- if (this.visibleView)
- this.visibleView.hide();
-
var view = this._applicationCacheView;
if (!view) {
view = new WebInspector.ApplicationCacheItemsView(treeElement, appcacheDomain);
this._applicationCacheView = view;
}
- this._genericViewSetup(view);
+ this._innerShowView(view);
if ("_cachedApplicationCacheViewStatus" in this)
this._applicationCacheView.updateStatus(this._cachedApplicationCacheViewStatus);
},
- _genericViewSetup: function(view)
+ showCategoryView: function(categoryName)
+ {
+ if (!this._categoryView)
+ this._categoryView = new WebInspector.StorageCategoryView();
+ this._categoryView.setText(categoryName);
+ this._innerShowView(this._categoryView);
+ },
+
+ _innerShowView: function(view)
{
+ if (this.visibleView)
+ this.visibleView.hide();
+
view.show(this.storageViews);
this.visibleView = view;
@@ -418,201 +530,413 @@ WebInspector.StoragePanel.prototype = {
this.storageViews.style.left = width + "px";
this.storageViewStatusBarItemsContainer.style.left = width + "px";
this.resize();
- }
-}
+ },
-WebInspector.StoragePanel.prototype.__proto__ = WebInspector.Panel.prototype;
+ get searchableViews()
+ {
+ var views = [];
-WebInspector.DatabaseSidebarTreeElement = function(database)
-{
- this.database = database;
+ if (!Preferences.networkPanelEnabled)
+ return views;
- WebInspector.SidebarTreeElement.call(this, "database-sidebar-tree-item", "", "", database, true);
+ const visibleView = this.visibleView;
+ if (visibleView instanceof WebInspector.ResourceView && visibleView.performSearch)
+ views.push(visibleView);
- this.refreshTitles();
-}
+ function callback(resourceTreeElement)
+ {
+ var resource = resourceTreeElement._resource;
+ var resourceView = WebInspector.ResourceManager.resourceViewForResource(resource);
+ if (resourceView.performSearch && resourceView !== visibleView)
+ views.push(resourceView);
+ }
+ this._forAllResourceTreeElements(callback);
+ return views;
+ },
-WebInspector.DatabaseSidebarTreeElement.prototype = {
- onselect: function()
+ _forAllResourceTreeElements: function(callback)
{
- WebInspector.panels.storage.showDatabase(this.database);
+ var stop = false;
+ for (var treeElement = this.resourcesListTreeElement; !stop && treeElement; treeElement = treeElement.traverseNextTreeElement(false, this.resourcesListTreeElement, true)) {
+ if (treeElement instanceof WebInspector.FrameResourceTreeElement)
+ stop = callback(treeElement);
+ }
},
- oncollapse: function()
+ searchMatchFound: function(view, matches)
{
- // Request a refresh after every collapse so the next
- // expand will have an updated table list.
- this.shouldRefreshChildren = true;
+ if (!view.resource)
+ return;
+ var treeElement = this._findTreeElementForResource(view.resource);
+ if (treeElement)
+ treeElement.searchMatchFound(matches);
},
- onpopulate: function()
+ _findTreeElementForResource: function(resource)
{
- this.removeChildren();
+ function isAncestor(ancestor, object)
+ {
+ console.error("There should be no calls to isAncestor, but there was one for ", object);
+ return false;
+ }
- var self = this;
- function tableNamesCallback(tableNames)
+ function getParent(object)
{
- var tableNamesLength = tableNames.length;
- for (var i = 0; i < tableNamesLength; ++i)
- self.appendChild(new WebInspector.SidebarDatabaseTableTreeElement(self.database, tableNames[i]));
+ console.error("There should be no calls to getParent, but there was one for ", object);
+ return null;
+ }
+
+ return this.sidebarTree.findTreeElement(resource, isAncestor, getParent);
+ },
+
+ searchCanceled: function(startingNewSearch)
+ {
+ WebInspector.Panel.prototype.searchCanceled.call(this, startingNewSearch);
+
+ if (startingNewSearch)
+ return;
+
+ function callback(resourceTreeElement)
+ {
+ resourceTreeElement._errorsWarningsUpdated();
+ }
+ this._forAllResourceTreeElements(callback);
+ },
+
+ performSearch: function(query)
+ {
+ function callback(resourceTreeElement)
+ {
+ resourceTreeElement._resetBubble();
}
- this.database.getTableNames(tableNamesCallback);
+ this._forAllResourceTreeElements(callback);
+ WebInspector.Panel.prototype.performSearch.call(this, query);
},
- get mainTitle()
+ showView: function(view)
+ {
+ if (view)
+ this.showResource(view.resource);
+ }
+}
+
+WebInspector.StoragePanel.prototype.__proto__ = WebInspector.Panel.prototype;
+
+WebInspector.BaseStorageTreeElement = function(storagePanel, representedObject, title, iconClass, hasChildren)
+{
+ TreeElement.call(this, "", representedObject, hasChildren);
+ this._storagePanel = storagePanel;
+ this._titleText = title;
+ this._iconClass = iconClass;
+}
+
+WebInspector.BaseStorageTreeElement.prototype = {
+ onattach: function()
{
- return this.database.name;
+ this.listItemElement.removeChildren();
+ this.listItemElement.addStyleClass(this._iconClass);
+
+ var selectionElement = document.createElement("div");
+ selectionElement.className = "selection";
+ this.listItemElement.appendChild(selectionElement);
+
+ this.imageElement = document.createElement("img");
+ this.imageElement.className = "icon";
+ this.listItemElement.appendChild(this.imageElement);
+
+ this.titleElement = document.createElement("div");
+ this.titleElement.className = "base-storage-tree-element-title";
+ this.titleElement.textContent = this._titleText;
+ this.listItemElement.appendChild(this.titleElement);
},
- set mainTitle(x)
+ onreveal: function()
{
- // Do nothing.
+ if (this.listItemElement)
+ this.listItemElement.scrollIntoViewIfNeeded(false);
},
- get subtitle()
+ set titleText(titleText)
{
- return this.database.displayDomain;
+ this._titleText = titleText;
+ this.titleElement.textContent = this._titleText;
},
- set subtitle(x)
+ isEventWithinDisclosureTriangle: function()
{
- // Do nothing.
+ // Override it since we use margin-left in place of treeoutline's text-indent.
+ // Hence we need to take padding into consideration. This all is needed for leading
+ // icons in the tree.
+ const paddingLeft = 14;
+ var left = this.listItemElement.totalOffsetLeft + paddingLeft;
+ return event.pageX >= left && event.pageX <= left + this.arrowToggleWidth && this.hasChildren;
}
}
-WebInspector.DatabaseSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
+WebInspector.BaseStorageTreeElement.prototype.__proto__ = TreeElement.prototype;
-WebInspector.SidebarDatabaseTableTreeElement = function(database, tableName)
+WebInspector.StorageCategoryTreeElement = function(storagePanel, categoryName, iconClass)
{
- this.database = database;
- this.tableName = tableName;
-
- WebInspector.SidebarTreeElement.call(this, "database-table-sidebar-tree-item small", tableName, "", null, false);
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, categoryName, iconClass, true);
+ this._categoryName = categoryName;
}
-WebInspector.SidebarDatabaseTableTreeElement.prototype = {
+WebInspector.StorageCategoryTreeElement.prototype = {
onselect: function()
{
- WebInspector.panels.storage.showDatabase(this.database, this.tableName);
+ this._storagePanel.showCategoryView(this._categoryName);
}
}
+WebInspector.StorageCategoryTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
-WebInspector.SidebarDatabaseTableTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
-
-WebInspector.DOMStorageSidebarTreeElement = function(domStorage, className)
+WebInspector.FrameTreeElement = function(storagePanel, frameId, displayName)
{
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, displayName, "frame-storage-tree-item");
+ this._frameId = frameId;
+ this._displayName = displayName;
+}
- this.domStorage = domStorage;
+WebInspector.FrameTreeElement.prototype = {
+ onselect: function()
+ {
+ this._storagePanel.showCategoryView(this._displayName);
+ },
- WebInspector.SidebarTreeElement.call(this, "domstorage-sidebar-tree-item " + className, domStorage, "", null, false);
+ get displayName()
+ {
+ return this._displayName;
+ },
- this.refreshTitles();
+ set displayName(displayName)
+ {
+ this._displayName = displayName;
+ this.titleText = displayName;
+ }
+}
+WebInspector.FrameTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
+
+WebInspector.FrameResourceTreeElement = function(storagePanel, resource)
+{
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, resource, resource.displayName, "resource-sidebar-tree-item resources-category-" + resource.category.name);
+ this._resource = resource;
+ this._resource.addEventListener("errors-warnings-updated", this._errorsWarningsUpdated, this);
+ this.tooltip = resource.url;
}
-WebInspector.DOMStorageSidebarTreeElement.prototype = {
+WebInspector.FrameResourceTreeElement.prototype = {
onselect: function()
{
- WebInspector.panels.storage.showDOMStorage(this.domStorage);
+ this._storagePanel._showResourceView(this._resource);
},
- get mainTitle()
+ ondblclick: function(event)
{
- return this.domStorage.domain ? this.domStorage.domain : WebInspector.UIString("Local Files");
+ InspectorBackend.openInInspectedWindow(this._resource.url);
},
- set mainTitle(x)
+ onattach: function()
{
- // Do nothing.
+ WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);
+
+ if (this._resource.category === WebInspector.resourceCategories.images) {
+ var previewImage = document.createElement("img");
+ previewImage.className = "image-resource-icon-preview";
+ previewImage.src = this._resource.url;
+
+ var iconElement = document.createElement("div");
+ iconElement.className = "icon";
+ iconElement.appendChild(previewImage);
+ this.listItemElement.replaceChild(iconElement, this.imageElement);
+ }
+
+ this._statusElement = document.createElement("div");
+ this._statusElement.className = "status";
+ this.listItemElement.insertBefore(this._statusElement, this.titleElement);
+
+ this.listItemElement.draggable = true;
+ this.listItemElement.addEventListener("dragstart", this._ondragstart.bind(this), false);
},
- get subtitle()
+ _ondragstart: function(event)
{
- return ""; //this.database.displayDomain;
+ event.dataTransfer.setData("text/plain", this._resource.url);
+ event.dataTransfer.setData("text/uri-list", this._resource.url + "\r\n");
+ event.dataTransfer.effectAllowed = "copy";
+ return true;
+ },
+
+ _setBubbleText: function(x)
+ {
+ if (!this._bubbleElement) {
+ this._bubbleElement = document.createElement("div");
+ this._bubbleElement.className = "bubble";
+ this._statusElement.appendChild(this._bubbleElement);
+ }
+
+ this._bubbleElement.textContent = x;
+ },
+
+ _resetBubble: function()
+ {
+ if (this._bubbleElement) {
+ this._bubbleElement.textContent = "";
+ this._bubbleElement.removeStyleClass("search-matches");
+ this._bubbleElement.removeStyleClass("warning");
+ this._bubbleElement.removeStyleClass("error");
+ }
+ },
+
+ searchMatchFound: function(matches)
+ {
+ this._resetBubble();
+
+ this._setBubbleText(matches);
+ this._bubbleElement.addStyleClass("search-matches");
+
+ // Expand, do not scroll into view.
+ var currentAncestor = this.parent;
+ while (currentAncestor && !currentAncestor.root) {
+ if (!currentAncestor.expanded)
+ currentAncestor.expand();
+ currentAncestor = currentAncestor.parent;
+ }
},
- set subtitle(x)
+ _errorsWarningsUpdated: function()
{
- // Do nothing.
+ // FIXME: move to the Script/SourceView.
+ if (!this._resource.warnings && !this._resource.errors) {
+ var view = WebInspector.ResourceManager.existingResourceViewForResource(this._resource);
+ if (view && view.clearMessages)
+ view.clearMessages();
+ }
+
+ if (this._storagePanel.currentQuery)
+ return;
+
+ this._resetBubble();
+
+ if (this._resource.warnings || this._resource.errors)
+ this._setBubbleText(this._resource.warnings + this._resource.errors);
+
+ if (this._resource.warnings)
+ this._bubbleElement.addStyleClass("warning");
+
+ if (this._resource.errors)
+ this._bubbleElement.addStyleClass("error");
}
}
-WebInspector.DOMStorageSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
+WebInspector.FrameResourceTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
-WebInspector.CookieSidebarTreeElement = function(cookieDomain)
+WebInspector.DatabaseTreeElement = function(storagePanel, database)
{
- WebInspector.SidebarTreeElement.call(this, "cookie-sidebar-tree-item", cookieDomain, "", null, false);
- this._cookieDomain = cookieDomain;
- this._subtitle = "";
-
- this.refreshTitles();
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, database.name, "database-storage-tree-item", true);
+ this._database = database;
}
-WebInspector.CookieSidebarTreeElement.prototype = {
+WebInspector.DatabaseTreeElement.prototype = {
onselect: function()
{
- WebInspector.panels.storage.showCookies(this, this._cookieDomain);
+ this._storagePanel.showDatabase(this._database);
},
- get mainTitle()
+ oncollapse: function()
{
- return this._cookieDomain ? this._cookieDomain : WebInspector.UIString("Local Files");
+ // Request a refresh after every collapse so the next
+ // expand will have an updated table list.
+ this.shouldRefreshChildren = true;
},
- set mainTitle(x)
+ onpopulate: function()
{
- // Do nothing.
- },
+ this.removeChildren();
+
+ function tableNamesCallback(tableNames)
+ {
+ var tableNamesLength = tableNames.length;
+ for (var i = 0; i < tableNamesLength; ++i)
+ this.appendChild(new WebInspector.DatabaseTableTreeElement(this._storagePanel, this._database, tableNames[i]));
+ }
+ this._database.getTableNames(tableNamesCallback.bind(this));
+ }
+
+}
+WebInspector.DatabaseTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
+
+WebInspector.DatabaseTableTreeElement = function(storagePanel, database, tableName)
+{
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, tableName, "database-storage-tree-item");
+ this._database = database;
+ this._tableName = tableName;
+}
- get subtitle()
+WebInspector.DatabaseTableTreeElement.prototype = {
+ onselect: function()
{
- return this._subtitle;
- },
+ this._storagePanel.showDatabase(this._database, this._tableName);
+ }
+}
+WebInspector.DatabaseTableTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
+
+WebInspector.DOMStorageTreeElement = function(storagePanel, domStorage, className)
+{
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, domStorage.domain ? domStorage.domain : WebInspector.UIString("Local Files"), "domstorage-storage-tree-item " + className);
+ this._domStorage = domStorage;
+}
- set subtitle(x)
+WebInspector.DOMStorageTreeElement.prototype = {
+ onselect: function()
{
- this._subtitle = x;
- this.refreshTitles();
+ this._storagePanel.showDOMStorage(this._domStorage);
}
}
+WebInspector.DOMStorageTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
-WebInspector.CookieSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
+WebInspector.CookieTreeElement = function(storagePanel, cookieDomain)
+{
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, cookieDomain ? cookieDomain : WebInspector.UIString("Local Files"), "cookie-storage-tree-item");
+ this._cookieDomain = cookieDomain;
+}
-WebInspector.ApplicationCacheSidebarTreeElement = function(appcacheDomain)
+WebInspector.CookieTreeElement.prototype = {
+ onselect: function()
+ {
+ this._storagePanel.showCookies(this, this._cookieDomain);
+ }
+}
+WebInspector.CookieTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
+
+WebInspector.ApplicationCacheTreeElement = function(storagePanel, appcacheDomain)
{
- WebInspector.SidebarTreeElement.call(this, "application-cache-sidebar-tree-item", appcacheDomain, "", null, false);
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, appcacheDomain ? appcacheDomain : WebInspector.UIString("Local Files"), "application-cache-storage-tree-item");
this._appcacheDomain = appcacheDomain;
- this._subtitle = "";
- this._mainTitle = this._appcacheDomain;
- this.refreshTitles();
}
-WebInspector.ApplicationCacheSidebarTreeElement.prototype = {
+WebInspector.ApplicationCacheTreeElement.prototype = {
onselect: function()
{
- WebInspector.panels.storage.showApplicationCache(this, this._appcacheDomain);
- },
+ this._storagePanel.showApplicationCache(this, this._appcacheDomain);
+ }
+}
+WebInspector.ApplicationCacheTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
- get mainTitle()
- {
- return this._mainTitle;
- },
+WebInspector.StorageCategoryView = function()
+{
+ WebInspector.View.call(this);
- set mainTitle(x)
- {
- this._mainTitle = x;
- this.refreshTitles();
- },
+ this.element.addStyleClass("storage-view");
- get subtitle()
- {
- return this._subtitle;
- },
+ this._emptyMsgElement = document.createElement("div");
+ this._emptyMsgElement.className = "storage-empty-view";
+ this.element.appendChild(this._emptyMsgElement);
+}
- set subtitle(x)
+WebInspector.StorageCategoryView.prototype = {
+ setText: function(text)
{
- this._subtitle = x;
- this.refreshTitles();
+ this._emptyMsgElement.textContent = text;
}
}
-WebInspector.ApplicationCacheSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
+WebInspector.StorageCategoryView.prototype.__proto__ = WebInspector.View.prototype;
diff --git a/WebCore/inspector/front-end/StylesSidebarPane.js b/WebCore/inspector/front-end/StylesSidebarPane.js
index 36d854c..cc97520 100644
--- a/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -60,7 +60,13 @@ WebInspector.StylesSidebarPane = function(computedStylePane)
this.settingsSelectElement.addEventListener("click", function(event) { event.stopPropagation() }, false);
this.settingsSelectElement.addEventListener("change", this._changeSetting.bind(this), false);
- WebInspector.applicationSettings.addEventListener("loaded", this._settingsLoaded, this);
+ var format = WebInspector.applicationSettings.colorFormat;
+ if (format === "hex")
+ this.settingsSelectElement[0].selected = true;
+ else if (format === "rgb")
+ this.settingsSelectElement[1].selected = true;
+ else if (format === "hsl")
+ this.settingsSelectElement[2].selected = true;
this.titleElement.appendChild(this.settingsSelectElement);
this._computedStylePane = computedStylePane;
@@ -95,17 +101,6 @@ WebInspector.StylesSidebarPane.PseudoIdNames = [
];
WebInspector.StylesSidebarPane.prototype = {
- _settingsLoaded: function()
- {
- var format = WebInspector.applicationSettings.colorFormat;
- if (format === "hex")
- this.settingsSelectElement[0].selected = true;
- if (format === "rgb")
- this.settingsSelectElement[1].selected = true;
- if (format === "hsl")
- this.settingsSelectElement[2].selected = true;
- },
-
_contextMenuEventFired: function(event)
{
var href = event.target.enclosingNodeOrSelfWithClass("webkit-html-resource-link") || event.target.enclosingNodeOrSelfWithClass("webkit-html-external-link");
@@ -160,7 +155,7 @@ WebInspector.StylesSidebarPane.prototype = {
if (refresh)
WebInspector.cssModel.getComputedStyleAsync(node.id, computedStyleCallback.bind(this));
else
- WebInspector.cssModel.getStylesAsync(node.id, !WebInspector.applicationSettings.showUserAgentStyles, stylesCallback.bind(this));
+ WebInspector.cssModel.getStylesAsync(node.id, stylesCallback.bind(this));
},
_refreshUpdate: function(node, computedStyle, editedSection)
@@ -201,8 +196,8 @@ WebInspector.StylesSidebarPane.prototype = {
// Add rules in reverse order to match the cascade order.
for (var j = pseudoElementCSSRules.rules.length - 1; j >= 0; --j) {
- var rule = WebInspector.CSSStyleDeclaration.parseRule(pseudoElementCSSRules.rules[j]);
- styleRules.push({ style: rule.style, selectorText: rule.selectorText, parentStyleSheet: rule.parentStyleSheet, rule: rule });
+ var rule = pseudoElementCSSRules.rules[j];
+ styleRules.push({ style: rule.style, selectorText: rule.selectorText, sourceURL: rule.sourceURL, rule: rule });
}
usedProperties = {};
disabledComputedProperties = {};
@@ -213,7 +208,7 @@ WebInspector.StylesSidebarPane.prototype = {
_refreshStyleRules: function(sections, computedStyle)
{
- var nodeComputedStyle = new WebInspector.CSSStyleDeclaration(computedStyle);
+ var nodeComputedStyle = computedStyle;
var styleRules = [];
for (var i = 0; sections && i < sections.length; ++i) {
var section = sections[i];
@@ -229,7 +224,7 @@ WebInspector.StylesSidebarPane.prototype = {
_rebuildStyleRules: function(node, styles)
{
- var nodeComputedStyle = new WebInspector.CSSStyleDeclaration(styles.computedStyle);
+ var nodeComputedStyle = styles.computedStyle;
this.sections = {};
var styleRules = [];
@@ -238,7 +233,7 @@ WebInspector.StylesSidebarPane.prototype = {
var styleAttributes = {};
for (var name in styles.styleAttributes) {
- var attrStyle = { style: new WebInspector.CSSStyleDeclaration(styles.styleAttributes[name]), editable: false };
+ var attrStyle = { style: styles.styleAttributes[name], editable: false };
attrStyle.selectorText = WebInspector.panels.elements.treeOutline.nodeNameToCorrectCase(node.nodeName) + "[" + name;
if (node.getAttribute(name))
attrStyle.selectorText += "=" + node.getAttribute(name);
@@ -248,7 +243,7 @@ WebInspector.StylesSidebarPane.prototype = {
// Show element's Style Attributes
if (styles.inlineStyle && node.nodeType === Node.ELEMENT_NODE) {
- var inlineStyle = { selectorText: "element.style", style: new WebInspector.CSSStyleDeclaration(styles.inlineStyle), isAttribute: true };
+ var inlineStyle = { selectorText: "element.style", style: styles.inlineStyle, isAttribute: true };
styleRules.push(inlineStyle);
}
@@ -256,12 +251,11 @@ WebInspector.StylesSidebarPane.prototype = {
if (styles.matchedCSSRules.length)
styleRules.push({ isStyleSeparator: true, text: WebInspector.UIString("Matched CSS Rules") });
for (var i = styles.matchedCSSRules.length - 1; i >= 0; --i) {
- var rule = WebInspector.CSSStyleDeclaration.parseRule(styles.matchedCSSRules[i]);
- styleRules.push({ style: rule.style, selectorText: rule.selectorText, parentStyleSheet: rule.parentStyleSheet, rule: rule });
+ var rule = styles.matchedCSSRules[i];
+ styleRules.push({ style: rule.style, selectorText: rule.selectorText, sourceURL: rule.sourceURL, rule: rule });
}
// Walk the node structure and identify styles with inherited properties.
- var parentStyles = styles.parent;
var parentNode = node.parentNode;
function insertInheritedNodeSeparator(node)
{
@@ -271,11 +265,12 @@ WebInspector.StylesSidebarPane.prototype = {
styleRules.push(entry);
}
- while (parentStyles) {
+ for (var parentOrdinal = 0; parentOrdinal < styles.inherited.length; ++parentOrdinal) {
+ var parentStyles = styles.inherited[parentOrdinal];
var separatorInserted = false;
if (parentStyles.inlineStyle) {
if (this._containsInherited(parentStyles.inlineStyle)) {
- var inlineStyle = { selectorText: WebInspector.UIString("Style Attribute"), style: new WebInspector.CSSStyleDeclaration(parentStyles.inlineStyle), isAttribute: true, isInherited: true };
+ var inlineStyle = { selectorText: WebInspector.UIString("Style Attribute"), style: parentStyles.inlineStyle, isAttribute: true, isInherited: true };
if (!separatorInserted) {
insertInheritedNodeSeparator(parentNode);
separatorInserted = true;
@@ -288,14 +283,13 @@ WebInspector.StylesSidebarPane.prototype = {
var rulePayload = parentStyles.matchedCSSRules[i];
if (!this._containsInherited(rulePayload.style))
continue;
- var rule = WebInspector.CSSStyleDeclaration.parseRule(rulePayload);
+ var rule = rulePayload;
if (!separatorInserted) {
insertInheritedNodeSeparator(parentNode);
separatorInserted = true;
}
- styleRules.push({ style: rule.style, selectorText: rule.selectorText, parentStyleSheet: rule.parentStyleSheet, rule: rule, isInherited: true });
+ styleRules.push({ style: rule.style, selectorText: rule.selectorText, sourceURL: rule.sourceURL, rule: rule, isInherited: true });
}
- parentStyles = parentStyles.parent;
parentNode = parentNode.parentNode;
}
return styleRules;
@@ -303,18 +297,6 @@ WebInspector.StylesSidebarPane.prototype = {
_markUsedProperties: function(styleRules, usedProperties, disabledComputedProperties)
{
- function deleteDisabledProperty(style, name)
- {
- if (!style || !name)
- return;
- if (style.__disabledPropertyValues)
- delete style.__disabledPropertyValues[name];
- if (style.__disabledPropertyPriorities)
- delete style.__disabledPropertyPriorities[name];
- if (style.__disabledProperties)
- delete style.__disabledProperties[name];
- }
-
var priorityUsed = false;
// Walk the style rules and make a list of all used and overloaded properties.
@@ -328,10 +310,14 @@ WebInspector.StylesSidebarPane.prototype = {
styleRule.usedProperties = {};
var style = styleRule.style;
- for (var j = 0; j < style.length; ++j) {
- var name = style[j];
+ var allProperties = style.allProperties;
+ for (var j = 0; j < allProperties.length; ++j) {
+ var property = allProperties[j];
+ if (!property.isLive)
+ continue;
+ var name = property.name;
- if (!priorityUsed && style.getPropertyPriority(name).length)
+ if (!priorityUsed && property.priority.length)
priorityUsed = true;
// If the property name is already used by another rule then this rule's
@@ -350,22 +336,12 @@ WebInspector.StylesSidebarPane.prototype = {
styleRule.usedProperties["font-weight"] = true;
styleRule.usedProperties["line-height"] = true;
}
-
- // Delete any disabled properties, since the property does exist.
- // This prevents it from showing twice.
- deleteDisabledProperty(style, name);
- deleteDisabledProperty(style, style.getPropertyShorthand(name));
}
// Add all the properties found in this style to the used properties list.
// Do this here so only future rules are affect by properties used in this rule.
for (var name in styleRules[i].usedProperties)
usedProperties[name] = true;
-
- // Remember all disabled properties so they show up in computed style.
- if (style.__disabledProperties)
- for (var name in style.__disabledProperties)
- disabledComputedProperties[name] = true;
}
if (priorityUsed) {
@@ -378,9 +354,13 @@ WebInspector.StylesSidebarPane.prototype = {
continue;
var style = styleRules[i].style;
- for (var j = 0; j < style.length; ++j) {
- var name = style[j];
- if (style.getPropertyPriority(name).length) {
+ var allProperties = style.allProperties;
+ for (var j = 0; j < allProperties.length; ++j) {
+ var property = allProperties[j];
+ if (!property.isLive)
+ continue;
+ var name = property.name;
+ if (property.priority.length) {
if (!(name in foundPriorityProperties))
styleRules[i].usedProperties[name] = true;
else
@@ -464,21 +444,13 @@ WebInspector.StylesSidebarPane.prototype = {
return sections;
},
- _containsInherited: function(payload)
- {
- if (this._arrayContainsInheritedProperty(payload.properties))
- return true;
- if (payload.disabled && this._arrayContainsInheritedProperty(payload.disabled))
- return true;
- return false;
- },
-
- _arrayContainsInheritedProperty: function(properties)
+ _containsInherited: function(style)
{
+ var properties = style.allProperties;
for (var i = 0; i < properties.length; ++i) {
var property = properties[i];
// Does this style contain non-overridden inherited property?
- if (property.name in WebInspector.StylesSidebarPane.InheritedProperties)
+ if (property.isLive && property.name in WebInspector.StylesSidebarPane.InheritedProperties)
return true;
}
return false;
@@ -590,16 +562,11 @@ WebInspector.ComputedStyleSidebarPane = function()
var showInheritedCheckbox = new WebInspector.Checkbox(WebInspector.UIString("Show inherited"), "sidebar-pane-subtitle");
this.titleElement.appendChild(showInheritedCheckbox.element);
- function settingsLoaded()
- {
- if (WebInspector.applicationSettings.showInheritedComputedStyleProperties) {
- this.bodyElement.addStyleClass("show-inherited");
- showInheritedCheckbox.checked = true;
- }
+ if (WebInspector.applicationSettings.showInheritedComputedStyleProperties) {
+ this.bodyElement.addStyleClass("show-inherited");
+ showInheritedCheckbox.checked = true;
}
- WebInspector.applicationSettings.addEventListener("loaded", settingsLoaded.bind(this));
-
function showInheritedToggleFunction(event)
{
WebInspector.applicationSettings.showInheritedComputedStyleProperties = showInheritedCheckbox.checked;
@@ -661,16 +628,16 @@ WebInspector.StylePropertiesSection = function(styleRule, editable, isInherited,
}
var subtitle = "";
- if (this.styleRule.parentStyleSheet && this.styleRule.parentStyleSheet.href)
- this.subtitleElement.appendChild(linkifyUncopyable(this.styleRule.parentStyleSheet.href, this.rule.sourceLine));
+ if (this.styleRule.sourceURL)
+ this.subtitleElement.appendChild(linkifyUncopyable(this.styleRule.sourceURL, this.rule.sourceLine));
else if (isUserAgent)
subtitle = WebInspector.UIString("user agent stylesheet");
else if (isUser)
subtitle = WebInspector.UIString("user stylesheet");
else if (isViaInspector)
subtitle = WebInspector.UIString("via inspector");
- else if (this.rule && this.rule.documentURL)
- this.subtitleElement.appendChild(linkifyUncopyable(this.rule.documentURL, this.rule.sourceLine));
+ else if (this.rule && this.rule.sourceURL)
+ this.subtitleElement.appendChild(linkifyUncopyable(this.rule.sourceURL, this.rule.sourceLine));
if (isInherited)
this.element.addStyleClass("show-inherited"); // This one is related to inherited rules, not compted style.
@@ -691,49 +658,42 @@ WebInspector.StylePropertiesSection.prototype = {
// Overriding with empty body.
},
- isPropertyInherited: function(property)
+ isPropertyInherited: function(propertyName)
{
if (this.isInherited) {
// While rendering inherited stylesheet, reverse meaning of this property.
// Render truly inherited properties with black, i.e. return them as non-inherited.
- return !(property in WebInspector.StylesSidebarPane.InheritedProperties);
+ return !(propertyName in WebInspector.StylesSidebarPane.InheritedProperties);
}
return false;
},
- isPropertyOverloaded: function(property, shorthand)
+ isPropertyOverloaded: function(propertyName, shorthand)
{
if (!this._usedProperties || this.noAffect)
return false;
- if (this.isInherited && !(property in WebInspector.StylesSidebarPane.InheritedProperties)) {
+ if (this.isInherited && !(propertyName in WebInspector.StylesSidebarPane.InheritedProperties)) {
// In the inherited sections, only show overrides for the potentially inherited properties.
return false;
}
- var used = (property in this._usedProperties);
+ var used = (propertyName in this._usedProperties);
if (used || !shorthand)
return !used;
// Find out if any of the individual longhand properties of the shorthand
// are used, if none are then the shorthand is overloaded too.
- var longhandProperties = this.styleRule.style.getLonghandProperties(property);
+ var longhandProperties = this.styleRule.style.getLonghandProperties(propertyName);
for (var j = 0; j < longhandProperties.length; ++j) {
var individualProperty = longhandProperties[j];
- if (individualProperty in this._usedProperties)
+ if (individualProperty.name in this._usedProperties)
return false;
}
return true;
},
- isPropertyDisabled: function(property)
- {
- if (!this.styleRule.style.__disabledPropertyValues)
- return false;
- return property in this.styleRule.style.__disabledPropertyValues;
- },
-
update: function(full)
{
if (full) {
@@ -759,39 +719,56 @@ WebInspector.StylePropertiesSection.prototype = {
onpopulate: function()
{
+ function sorter(a, b)
+ {
+ return a.name.localeCompare(b.name);
+ }
+
var style = this.styleRule.style;
- var foundShorthands = {};
- var disabledProperties = style.__disabledPropertyValues || {};
+ var handledProperties = {};
+ var shorthandNames = {};
this.uniqueProperties = [];
- for (var i = 0; i < style.length; ++i)
- this.uniqueProperties.push(style[i]);
+ var allProperties = style.allProperties;
+ for (var i = 0; i < allProperties.length; ++i)
+ this.uniqueProperties.push(allProperties[i]);
- for (var name in disabledProperties)
- this.uniqueProperties.push(name);
+ this.uniqueProperties.sort(sorter);
- this.uniqueProperties.sort();
+ // Collect all shorthand names.
+ for (var i = 0; i < this.uniqueProperties.length; ++i) {
+ var property = this.uniqueProperties[i];
+ if (property.disabled)
+ continue;
+ if (property.shorthand)
+ shorthandNames[property.shorthand] = true;
+ }
for (var i = 0; i < this.uniqueProperties.length; ++i) {
- var name = this.uniqueProperties[i];
- var disabled = name in disabledProperties;
- var shorthand = !disabled ? style.getPropertyShorthand(name) : null;
+ var property = this.uniqueProperties[i];
+ var disabled = property.disabled;
+ if (!disabled && this.disabledComputedProperties && !(property.name in this.usedProperties) && property.name in this.disabledComputedProperties)
+ disabled = true;
- if (shorthand && shorthand in foundShorthands)
+ var shorthand = !disabled ? property.shorthand : null;
+
+ if (shorthand && shorthand in handledProperties)
continue;
if (shorthand) {
- foundShorthands[shorthand] = true;
- name = shorthand;
+ property = style.getLiveProperty(shorthand);
+ if (!property)
+ property = new WebInspector.CSSProperty(style, style.allProperties.length, shorthand, style.getShorthandValue(shorthand), style.getShorthandPriority(shorthand), "style", true, true, "");
}
- var isShorthand = (shorthand ? true : false);
- var inherited = this.isPropertyInherited(name);
- var overloaded = this.isPropertyOverloaded(name, isShorthand);
+ var isShorthand = !!(property.isLive && (shorthand || shorthandNames[property.name]));
+ var inherited = this.isPropertyInherited(property.name);
+ var overloaded = this.isPropertyOverloaded(property.name, isShorthand);
- var item = new WebInspector.StylePropertyTreeElement(this.styleRule, style, name, isShorthand, inherited, overloaded, disabled);
+ var item = new WebInspector.StylePropertyTreeElement(this.styleRule, style, property, isShorthand, inherited, overloaded);
this.propertiesTreeOutline.appendChild(item);
+ handledProperties[property.name] = property;
}
},
@@ -808,7 +785,9 @@ WebInspector.StylePropertiesSection.prototype = {
addNewBlankProperty: function()
{
- var item = new WebInspector.StylePropertyTreeElement(this.styleRule, this.styleRule.style, "", false, false, false, false);
+ var style = this.styleRule.style;
+ var property = new WebInspector.CSSProperty(style, style.allProperties.length, "", "", "", "style", true, false, false, undefined);
+ var item = new WebInspector.StylePropertyTreeElement(this.styleRule, style, property, false, false, false);
this.propertiesTreeOutline.appendChild(item);
item.listItemElement.textContent = "";
item._newProperty = true;
@@ -894,7 +873,7 @@ WebInspector.StylePropertiesSection.prototype = {
}
self.rule = newRule;
- self.styleRule = { section: self, style: newRule.style, selectorText: newRule.selectorText, parentStyleSheet: newRule.parentStyleSheet, rule: newRule };
+ self.styleRule = { section: self, style: newRule.style, selectorText: newRule.selectorText, sourceURL: newRule.sourceURL, rule: newRule };
var oldIdentifier = this.identifier;
self.identifier = newRule.selectorText + ":" + self.subtitleElement.textContent;
@@ -937,9 +916,9 @@ WebInspector.ComputedStylePropertiesSection.prototype = {
// Overriding with empty body.
},
- _isPropertyInherited: function(property)
+ _isPropertyInherited: function(propertyName)
{
- return !(property in this._usedProperties) && !(property in this._alwaysShowComputedProperties) && !(property in this._disabledComputedProperties);
+ return !(propertyName in this._usedProperties) && !(propertyName in this._alwaysShowComputedProperties) && !(propertyName in this._disabledComputedProperties);
},
update: function()
@@ -956,19 +935,25 @@ WebInspector.ComputedStylePropertiesSection.prototype = {
onpopulate: function()
{
+ function sorter(a, b)
+ {
+ return a.name.localeCompare(b.name);
+ }
+
var style = this.styleRule.style;
var uniqueProperties = [];
- for (var i = 0; i < style.length; ++i)
- uniqueProperties.push(style[i]);
- uniqueProperties.sort();
+ var allProperties = style.allProperties;
+ for (var i = 0; i < allProperties.length; ++i)
+ uniqueProperties.push(allProperties[i]);
+ uniqueProperties.sort(sorter);
this._propertyTreeElements = {};
for (var i = 0; i < uniqueProperties.length; ++i) {
- var name = uniqueProperties[i];
- var inherited = this._isPropertyInherited(name);
- var item = new WebInspector.StylePropertyTreeElement(this.styleRule, style, name, false, inherited, false, false);
+ var property = uniqueProperties[i];
+ var inherited = this._isPropertyInherited(property.name);
+ var item = new WebInspector.StylePropertyTreeElement(this.styleRule, style, property, false, inherited, false);
this.propertiesTreeOutline.appendChild(item);
- this._propertyTreeElements[name] = item;
+ this._propertyTreeElements[property.name] = item;
}
},
@@ -980,21 +965,21 @@ WebInspector.ComputedStylePropertiesSection.prototype = {
continue;
for (var j = 0; j < section.uniqueProperties.length; ++j) {
- var name = section.uniqueProperties[j];
- if (section.isPropertyDisabled(name))
+ var property = section.uniqueProperties[j];
+ if (property.disabled)
continue;
- if (section.isInherited && !(name in WebInspector.StylesSidebarPane.InheritedProperties))
+ if (section.isInherited && !(property.name in WebInspector.StylesSidebarPane.InheritedProperties))
continue;
- var treeElement = this._propertyTreeElements[name];
+ var treeElement = this._propertyTreeElements[property.name];
if (treeElement) {
var selectorText = section.styleRule.selectorText;
- var value = section.styleRule.style.getPropertyValue(name);
+ var value = property.value;
var title = "<span style='color: gray'>" + selectorText + "</span> - " + value;
var subtitle = " <span style='float:right'>" + section.subtitleElement.innerHTML + "</span>";
var childElement = new TreeElement(title + subtitle, null, false);
treeElement.appendChild(childElement);
- if (section.isPropertyOverloaded(name))
+ if (section.isPropertyOverloaded(property.name))
childElement.listItemElement.addStyleClass("overloaded");
}
}
@@ -1060,15 +1045,14 @@ WebInspector.BlankStylePropertiesSection.prototype = {
WebInspector.BlankStylePropertiesSection.prototype.__proto__ = WebInspector.StylePropertiesSection.prototype;
-WebInspector.StylePropertyTreeElement = function(styleRule, style, name, shorthand, inherited, overloaded, disabled)
+WebInspector.StylePropertyTreeElement = function(styleRule, style, property, shorthand, inherited, overloaded)
{
this._styleRule = styleRule;
this.style = style;
- this.name = name;
+ this.property = property;
this.shorthand = shorthand;
this._inherited = inherited;
this._overloaded = overloaded;
- this._disabled = disabled;
// Pass an empty title, the title gets made later in onattach.
TreeElement.call(this, "", null, shorthand);
@@ -1103,29 +1087,31 @@ WebInspector.StylePropertyTreeElement.prototype = {
get disabled()
{
- return this._disabled;
+ return this.property.disabled;
},
- set disabled(x)
+ get name()
{
- if (x === this._disabled)
- return;
- this._disabled = x;
- this.updateState();
+ return this.property.name;
},
get priority()
{
- if (this.disabled && this.style.__disabledPropertyPriorities && this.name in this.style.__disabledPropertyPriorities)
- return this.style.__disabledPropertyPriorities[this.name];
- return (this.shorthand ? this.style.getShorthandPriority(this.name) : this.style.getPropertyPriority(this.name));
+ if (this.disabled)
+ return this.property.priority;
+ return (this.shorthand ? this.style.getShorthandPriority(this.name) : this.property.priority);
},
get value()
{
- if (this.disabled && this.style.__disabledPropertyValues && this.name in this.style.__disabledPropertyValues)
- return this.style.__disabledPropertyValues[this.name];
- return (this.shorthand ? this.style.getShorthandValue(this.name) : this.style.getPropertyValue(this.name));
+ if (this.disabled)
+ return this.property.value;
+ return (this.shorthand ? this.style.getShorthandValue(this.name) : this.property.value);
+ },
+
+ get parsedOk()
+ {
+ return this.property.parsedOk;
},
onattach: function()
@@ -1145,11 +1131,14 @@ WebInspector.StylePropertyTreeElement.prototype = {
this.updateState();
- var enabledCheckboxElement = document.createElement("input");
- enabledCheckboxElement.className = "enabled-button";
- enabledCheckboxElement.type = "checkbox";
- enabledCheckboxElement.checked = !this.disabled;
- enabledCheckboxElement.addEventListener("change", this.toggleEnabled.bind(this), false);
+ var enabledCheckboxElement;
+ if (this.parsedOk) {
+ enabledCheckboxElement = document.createElement("input");
+ enabledCheckboxElement.className = "enabled-button";
+ enabledCheckboxElement.type = "checkbox";
+ enabledCheckboxElement.checked = !this.disabled;
+ enabledCheckboxElement.addEventListener("change", this.toggleEnabled.bind(this), false);
+ }
var nameElement = document.createElement("span");
nameElement.className = "webkit-css-property";
@@ -1186,7 +1175,8 @@ WebInspector.StylePropertyTreeElement.prototype = {
{
var container = document.createDocumentFragment();
container.appendChild(document.createTextNode("url("));
- container.appendChild(WebInspector.linkifyURLAsNode(url, url, null, (url in WebInspector.resourceURLMap)));
+ var hasResource = !!WebInspector.resourceForURL(url);
+ container.appendChild(WebInspector.linkifyURLAsNode(url, url, null, hasResource));
container.appendChild(document.createTextNode(")"));
return container;
}
@@ -1297,7 +1287,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
return;
// Append the checkbox for root elements of an editable section.
- if (this.treeOutline.section && this.treeOutline.section.editable && this.parent.root)
+ if (enabledCheckboxElement && this.treeOutline.section && this.treeOutline.section.editable && this.parent.root)
this.listItemElement.appendChild(enabledCheckboxElement);
this.listItemElement.appendChild(nameElement);
this.listItemElement.appendChild(document.createTextNode(": "));
@@ -1310,7 +1300,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
this.listItemElement.appendChild(document.createTextNode(";"));
- this.tooltip = this.name + ": " + valueElement.textContent + (priority ? " " + priority : "");
+ this.tooltip = this.property.propertyText;
},
updateAll: function(updateAllRules)
@@ -1322,33 +1312,28 @@ WebInspector.StylePropertyTreeElement.prototype = {
else if (this.treeOutline.section)
this.treeOutline.section.update(true);
else
- this.updateTitle(); // FIXME: this will not show new properties. But we don't hit his case yet.
+ this.updateTitle(); // FIXME: this will not show new properties. But we don't hit this case yet.
},
toggleEnabled: function(event)
{
var disabled = !event.target.checked;
- var self = this;
function callback(newStyle)
{
if (!newStyle)
return;
- self.style = newStyle;
- self._styleRule.style = self.style;
-
- // Set the disabled property here, since the code above replies on it not changing
- // until after the value and priority are retrieved.
- self.disabled = disabled;
+ this.style = newStyle;
+ this._styleRule.style = newStyle;
- if (self.treeOutline.section && self.treeOutline.section.pane)
- self.treeOutline.section.pane.dispatchEventToListeners("style property toggled");
+ if (this.treeOutline.section && this.treeOutline.section.pane)
+ this.treeOutline.section.pane.dispatchEventToListeners("style property toggled");
- self.updateAll(true);
+ this.updateAll(true);
}
- WebInspector.cssModel.toggleStyleEnabled(this.style.id, this.name, disabled, callback);
+ this.property.setDisabled(disabled, callback.bind(this));
},
updateState: function()
@@ -1385,14 +1370,16 @@ WebInspector.StylePropertyTreeElement.prototype = {
var longhandProperties = this.style.getLonghandProperties(this.name);
for (var i = 0; i < longhandProperties.length; ++i) {
- var name = longhandProperties[i];
+ var name = longhandProperties[i].name;
+
if (this.treeOutline.section) {
var inherited = this.treeOutline.section.isPropertyInherited(name);
var overloaded = this.treeOutline.section.isPropertyOverloaded(name);
}
- var item = new WebInspector.StylePropertyTreeElement(this._styleRule, this.style, name, false, inherited, overloaded);
+ var liveProperty = this.style.getLiveProperty(name);
+ var item = new WebInspector.StylePropertyTreeElement(this._styleRule, this.style, liveProperty, false, inherited, overloaded);
this.appendChild(item);
}
},
@@ -1680,39 +1667,37 @@ WebInspector.StylePropertyTreeElement.prototype = {
}
}
- var self = this;
-
- function failureCallback()
+ function callback(newStyle)
{
- // The user typed something, but it didn't parse. Just abort and restore
- // the original title for this property. If this was a new attribute and
- // we couldn't parse, then just remove it.
- if (self._newProperty) {
- self.parent.removeChild(self);
+ if (!newStyle) {
+ // The user typed something, but it didn't parse. Just abort and restore
+ // the original title for this property. If this was a new attribute and
+ // we couldn't parse, then just remove it.
+ if (this._newProperty) {
+ this.parent.removeChild(this);
+ return;
+ }
+ if (updateInterface)
+ this.updateTitle();
return;
}
- if (updateInterface)
- self.updateTitle();
- }
- function successCallback(newStyle)
- {
if (!styleTextLength) {
// Do remove ourselves from UI when the property removal is confirmed.
- self.parent.removeChild(self);
+ this.parent.removeChild(this);
} else {
- self.style = newStyle;
- self._styleRule.style = self.style;
+ this.style = newStyle;
+ this._styleRule.style = this.style;
}
if (section && section.pane)
section.pane.dispatchEventToListeners("style edited");
if (updateInterface)
- self.updateAll(true);
+ this.updateAll(true);
}
- WebInspector.cssModel.applyStyleText(this.style.id, styleText, this.name, successCallback, failureCallback);
+ this.property.setText(styleText, callback.bind(this));
}
}
diff --git a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
index 28dad23..11b0e03 100644
--- a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
+++ b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
@@ -31,11 +31,11 @@
WebInspector.WatchExpressionsSidebarPane = function()
{
WebInspector.SidebarPane.call(this, WebInspector.UIString("Watch Expressions"));
- WebInspector.applicationSettings.addEventListener("loaded", this._settingsLoaded, this);
+ this.reset();
}
WebInspector.WatchExpressionsSidebarPane.prototype = {
- _settingsLoaded: function()
+ reset: function()
{
this.bodyElement.removeChildren();
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index 1e5a508..481f8b3 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -158,6 +158,7 @@
<file>Images/excludeButtonGlyph.png</file>
<file>Images/focusButtonGlyph.png</file>
<file>Images/forward.png</file>
+ <file>Images/frame.png</file>
<file>Images/gearButtonGlyph.png</file>
<file>Images/glossyHeader.png</file>
<file>Images/glossyHeaderPressed.png</file>
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index 0662954..429e749 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -715,11 +715,6 @@ body.platform-linux .monospace, body.platform-linux .source-code {
content: url(Images/treeDownTriangleBlack.png);
}
-.console-message.repeated-message > ol.stack-trace {
- margin-top: -14px;
- margin-left: 18px;
-}
-
.console-group-messages .section .header .title {
color: black;
font-weight: normal;
@@ -903,6 +898,29 @@ body.platform-linux .monospace, body.platform-linux .source-code {
top: 20px;
}
+.resource-view .resource-view-cookies {
+ position: absolute;
+ top: 0;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ overflow: auto;
+ padding: 12px;
+}
+
+.resource-view.headers-visible .resource-view-cookies {
+ top: 20px;
+}
+
+.resource-view-cookies.table .data-grid {
+ height: 100%;
+}
+
+.resource-view-cookies .data-grid .row-group {
+ font-weight: bold;
+ font-size: 11px;
+}
+
.webkit-line-gutter-backdrop {
/* Keep this in sync with view-source.css (.webkit-line-gutter-backdrop) */
width: 31px;
@@ -1190,7 +1208,6 @@ body.platform-linux .monospace, body.platform-linux .source-code {
margin-left: -12px;
}
-.stack-trace li.parent::before,
.outline-disclosure li.parent::before {
content: url(Images/treeRightTriangleBlack.png);
float: left;
@@ -1200,32 +1217,26 @@ body.platform-linux .monospace, body.platform-linux .source-code {
padding-right: 2px;
}
-.stack-trace li.parent::before,
.outline-disclosure li.parent::before {
content: url(Images/treeRightTriangleBlack.png);
}
-.stack-trace ol:focus li.parent.selected::before,
.outline-disclosure ol:focus li.parent.selected::before {
content: url(Images/treeRightTriangleWhite.png);
}
-.stack-trace li.parent.expanded::before,
.outline-disclosure li.parent.expanded::before {
content: url(Images/treeDownTriangleBlack.png);
}
-.stack-trace ol:focus li.parent.expanded.selected::before,
.outline-disclosure ol:focus li.parent.expanded.selected::before {
content: url(Images/treeDownTriangleWhite.png);
}
-.stack-trace ol.children,
.outline-disclosure ol.children {
display: none;
}
-.stack-trace ol.children.expanded,
.outline-disclosure ol.children.expanded {
display: block;
}
@@ -1430,21 +1441,17 @@ body.inactive .placard.selected {
padding-bottom: 3px;
}
-.properties-tree ol, .stack-trace ol, ol.stack-trace {
+.properties-tree ol {
display: none;
margin: 0;
-webkit-padding-start: 12px;
list-style: none;
}
-.properties-tree ol.expanded, .stack-trace ol, ol.stack-trace {
+.properties-tree ol.expanded {
display: block;
}
-ol.stack-trace {
- -webkit-padding-start: 0px;
-}
-
.event-listener-breakpoints .event-category {
font-size: 12px;
font-weight: bold;
@@ -1897,27 +1904,31 @@ body.inactive .sidebar {
background-color: rgb(232, 232, 232);
}
-.database-sidebar-tree-item .icon {
+.frame-storage-tree-item .icon {
+ content: url(Images/frame.png);
+}
+
+.database-storage-tree-item .icon {
content: url(Images/database.png);
}
-.database-table-sidebar-tree-item .icon {
+.database-table-storage-tree-item .icon {
content: url(Images/databaseTable.png);
}
-.domstorage-sidebar-tree-item.local-storage .icon {
+.domstorage-storage-tree-item.local-storage .icon {
content: url(Images/localStorage.png);
}
-.domstorage-sidebar-tree-item.session-storage .icon {
+.domstorage-storage-tree-item.session-storage .icon {
content: url(Images/sessionStorage.png);
}
-.cookie-sidebar-tree-item .icon {
+.cookie-storage-tree-item .icon {
content: url(Images/cookie.png);
}
-.application-cache-sidebar-tree-item .icon {
+.application-cache-storage-tree-item .icon {
content: url(Images/applicationCache.png);
}
@@ -1929,6 +1940,72 @@ body.inactive .sidebar {
bottom: 0;
}
+.storage.panel .sidebar {
+ padding-left: 0;
+ z-index: 10;
+}
+
+.storage.panel .sidebar li {
+ height: 17px;
+ white-space: nowrap;
+ text-indent: 0;
+ margin-left: -2px;
+}
+
+.storage.panel .sidebar li.parent {
+ text-indent: 0;
+ margin-left: -12px;
+}
+
+.storage.panel .sidebar li.selected {
+ color: white;
+ text-shadow: rgba(0, 0, 0, 0.33) 0 1px 0;
+ font-weight: bold;
+}
+
+.storage.panel .sidebar li .selection {
+ background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(162, 177, 207)), to(rgb(120, 138, 177)));
+ border-top: 1px solid #979797;
+ height: 17px;
+}
+
+.storage.panel .sidebar :focus li .selection {
+ background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(92, 147, 213)), to(rgb(21, 83, 170)));
+ border-top: 1px solid rgb(68, 128, 200);
+}
+
+body.inactive .storage.panel .sidebar li .selection {
+ background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(180, 180, 180)), to(rgb(138, 138, 138)));
+ border-top: 1px solid rgb(151, 151, 151);
+}
+
+.storage.panel .sidebar .icon {
+ width: 16px;
+ height: 16px;
+ float: left;
+}
+
+.storage.panel .base-storage-tree-element-title {
+ overflow: hidden;
+ position: relative;
+ text-overflow: ellipsis;
+ padding-left: 2px;
+ top: 1px;
+}
+
+.storage.panel .status {
+ float: right;
+ height: 16px;
+ margin-top: 1px;
+ margin-left: 4px;
+ line-height: 1em;
+}
+
+.storage.panel li .status .bubble {
+ height: 13px;
+ padding-top: 0;
+}
+
.storage-view {
display: none;
overflow: hidden;
@@ -1952,7 +2029,7 @@ body.inactive .sidebar {
height: 100%;
}
-.storage-view.table .storage-table-empty, .storage-view.table .storage-table-error {
+.storage-empty-view, .storage-view.table .storage-table-error {
position: absolute;
top: 0;
bottom: 25%;
@@ -3167,7 +3244,7 @@ body.inactive .sidebar-tree-item .disclosure-button:active {
margin-right: 3px;
}
-.sidebar-tree-item .status {
+li .status {
float: right;
height: 16px;
margin-top: 9px;
@@ -3175,11 +3252,11 @@ body.inactive .sidebar-tree-item .disclosure-button:active {
line-height: 1em;
}
-.sidebar-tree-item .status:empty {
+li .status:empty {
display: none;
}
-.sidebar-tree-item .status .bubble {
+li .status .bubble {
display: inline-block;
height: 14px;
min-width: 16px;
@@ -3198,20 +3275,20 @@ body.inactive .sidebar-tree-item .disclosure-button:active {
-webkit-border-radius: 7px;
}
-.sidebar-tree-item .status .bubble:empty {
+li .status .bubble:empty {
display: none;
}
-.sidebar-tree-item.selected .status .bubble {
+li.selected .status .bubble {
background-color: white !important;
color: rgb(132, 154, 190) !important;
}
-:focus .sidebar-tree-item.selected .status .bubble {
+:focus li.selected .status .bubble {
color: rgb(36, 98, 172) !important;
}
-body.inactive .sidebar-tree-item.selected .status .bubble {
+body.inactive li.selected .status .bubble {
color: rgb(159, 159, 159) !important;
}
@@ -3362,7 +3439,7 @@ body.inactive .sidebar-tree-item.selected {
content: "";
}
-.resource-sidebar-tree-item.resources-category-images .image-resource-icon-preview {
+.resources-category-images .image-resource-icon-preview {
position: absolute;
margin: auto;
top: 3px;
@@ -3380,7 +3457,7 @@ body.inactive .sidebar-tree-item.selected {
content: "";
}
-.children.small .resource-sidebar-tree-item.resources-category-images .image-resource-icon-preview {
+.children.small .resources-category-images .image-resource-icon-preview {
top: 2px;
bottom: 1px;
left: 3px;
@@ -3432,15 +3509,15 @@ body.inactive .sidebar-tree-item.selected {
padding-left: 13px !important;
}
-.sidebar-tree-item.selected .bubble.search-matches {
+li.selected .bubble.search-matches {
background-image: url(Images/searchSmallBlue.png);
}
-:focus .sidebar-tree-item.selected .bubble.search-matches {
+:focus li.selected .bubble.search-matches {
background-image: url(Images/searchSmallBrightBlue.png);
}
-body.inactive .sidebar-tree-item.selected .bubble.search-matches {
+body.inactive li.selected .bubble.search-matches {
background-image: url(Images/searchSmallGray.png);
}
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 9bd88d6..f5a70c8 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -50,7 +50,6 @@
var WebInspector = {
resources: {},
- resourceURLMap: {},
cookieDomains: {},
applicationCacheDomains: {},
missingLocalizedStrings: {},
@@ -182,7 +181,7 @@ var WebInspector = {
for (var panelName in WebInspector.panels) {
if (WebInspector.panels[panelName] === x) {
- InspectorBackend.storeLastActivePanel(panelName);
+ WebInspector.applicationSettings.lastActivePanel = panelName;
this._panelHistory.setPanel(panelName);
}
}
@@ -226,10 +225,17 @@ var WebInspector = {
var hiddenPanels = (InspectorFrontendHost.hiddenPanels() || "").split(',');
if (hiddenPanels.indexOf("elements") === -1)
this.panels.elements = new WebInspector.ElementsPanel();
+
+ if (Preferences.networkPanelEnabled) {
+ if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
+ this.panels.storage = new WebInspector.StoragePanel();
+ if (hiddenPanels.indexOf("network") === -1)
+ this.panels.network = new WebInspector.NetworkPanel();
+ } else if (hiddenPanels.indexOf("resources") === -1)
+ this.panels.resources = new WebInspector.ResourcesPanel();
+
if (Preferences.networkPanelEnabled && hiddenPanels.indexOf("network") === -1)
this.panels.network = new WebInspector.NetworkPanel();
- if (hiddenPanels.indexOf("resources") === -1)
- this.panels.resources = new WebInspector.ResourcesPanel();
if (hiddenPanels.indexOf("scripts") === -1)
this.panels.scripts = new WebInspector.ScriptsPanel();
if (hiddenPanels.indexOf("timeline") === -1)
@@ -240,8 +246,12 @@ var WebInspector = {
if (Preferences.heapProfilerPresent)
this.panels.profiles.registerProfileType(new WebInspector.HeapSnapshotProfileType());
}
- if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
- this.panels.storage = new WebInspector.StoragePanel();
+
+ if (!Preferences.networkPanelEnabled) {
+ if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
+ this.panels.storage = new WebInspector.StoragePanel();
+ }
+
if (hiddenPanels.indexOf("audits") === -1)
this.panels.audits = new WebInspector.AuditsPanel();
if (hiddenPanels.indexOf("console") === -1)
@@ -441,6 +451,33 @@ var WebInspector = {
{
this.currentPanel = this.panels.elements;
this.panels.elements.updateFocusedNode(nodeId);
+ },
+
+ get networkResources()
+ {
+ if (Preferences.networkPanelEnabled)
+ return this.panels.network.resources;
+ else
+ return this.resources;
+ },
+
+ forAllResources: function(callback)
+ {
+ if (Preferences.networkPanelEnabled)
+ WebInspector.resourceManager.forAllResources(callback);
+ else {
+ for (var id in this.resources) {
+ if (callback(this.resources[id]))
+ return;
+ }
+ }
+ },
+
+ resourceForURL: function(url)
+ {
+ if (Preferences.networkPanelEnabled)
+ return this.resourceManager.resourceForURL(url);
+ return this.panels.resources.resourceURLMap[url];
}
}
@@ -493,8 +530,8 @@ WebInspector.doLoadedDone = function()
document.body.addStyleClass("port-" + port);
InspectorFrontendHost.loaded();
- WebInspector.Settings.initialize();
-
+ WebInspector.applicationSettings = new WebInspector.Settings();
+
this._registerShortcuts();
// set order of some sections explicitly
@@ -507,8 +544,8 @@ WebInspector.doLoadedDone = function()
// this.changes = new WebInspector.ChangesView(this.drawer);
// TODO: Remove class="hidden" from inspector.html on button#changes-status-bar-item
this.drawer.visibleView = this.console;
- // FIXME: uncomment when ready.
- // this.resourceManager = new WebInspector.ResourceManager();
+ if (Preferences.networkPanelEnabled)
+ this.resourceManager = new WebInspector.ResourceManager();
this.domAgent = new WebInspector.DOMAgent();
this.resourceCategories = {
@@ -536,6 +573,11 @@ WebInspector.doLoadedDone = function()
for (var panelName in this.panels)
previousToolbarItem = WebInspector.addPanelToolbarIcon(toolbarElement, this.panels[panelName], previousToolbarItem);
+ if (Preferences.networkPanelEnabled) {
+ this.panels.storage._toolbarItem.removeStyleClass("storage");
+ this.panels.storage._toolbarItem.addStyleClass("resources");
+ }
+
this.Tips = {
ResourceNotCompressed: {id: 0, message: WebInspector.UIString("You could save bandwidth by having your web server compress this transfer with gzip or zlib.")}
};
@@ -588,14 +630,22 @@ WebInspector.doLoadedDone = function()
WebInspector.monitoringXHREnabled = inspectorState.monitoringXHREnabled;
if ("pauseOnExceptionsState" in inspectorState)
WebInspector.panels.scripts.updatePauseOnExceptionsState(inspectorState.pauseOnExceptionsState);
- if (inspectorState.resourceTrackingEnabled)
- WebInspector.panels.resources.resourceTrackingWasEnabled();
- else
- WebInspector.panels.resources.resourceTrackingWasDisabled();
+ if (WebInspector.panels.resources) {
+ if (inspectorState.resourceTrackingEnabled)
+ WebInspector.panels.resources.resourceTrackingWasEnabled();
+ else
+ WebInspector.panels.resources.resourceTrackingWasDisabled();
+ }
}
InspectorBackend.getInspectorState(populateInspectorState);
- InspectorBackend.populateScriptObjects();
+ function onPopulateScriptObjects()
+ {
+ if (!WebInspector.currentPanel)
+ WebInspector.showPanel(WebInspector.applicationSettings.lastActivePanel);
+ }
+ InspectorBackend.populateScriptObjects(onPopulateScriptObjects);
+
InspectorBackend.setConsoleMessagesEnabled(true);
// As a DOMAgent method, this needs to happen after the frontend has loaded and the agent is available.
@@ -768,7 +818,7 @@ WebInspector.documentClick = function(event)
if (parsedURL.host === "show-panel") {
var panel = parsedURL.path.substring(1);
if (WebInspector.panels[panel])
- WebInspector.currentPanel = WebInspector.panels[panel];
+ WebInspector.showPanel(panel);
}
return;
}
@@ -794,8 +844,13 @@ WebInspector.openResource = function(resourceURL, inResourcesPanel)
{
var resource = WebInspector.resourceForURL(resourceURL);
if (inResourcesPanel && resource) {
- WebInspector.panels.resources.showResource(resource);
- WebInspector.showPanel("resources");
+ if (Preferences.networkPanelEnabled) {
+ WebInspector.panels.storage.showResource(resource);
+ WebInspector.showPanel("storage");
+ } else {
+ WebInspector.panels.resources.showResource(resource);
+ WebInspector.showPanel("resources");
+ }
} else
InspectorBackend.openInInspectedWindow(resource ? resource.url : resourceURL);
}
@@ -1214,12 +1269,14 @@ WebInspector.selectDOMStorage = function(o)
WebInspector.updateResource = function(payload)
{
+ if (Preferences.networkPanelEnabled)
+ return;
+
var identifier = payload.id;
var resource = this.resources[identifier];
if (!resource) {
resource = new WebInspector.Resource(identifier, payload.url);
this.resources[identifier] = resource;
- this.resourceURLMap[resource.url] = resource;
this.panels.resources.addResource(resource);
this.panels.audits.resourceStarted(resource);
}
@@ -1267,6 +1324,7 @@ WebInspector.updateResource = function(payload)
if (payload.didCompletionChange) {
resource.failed = payload.failed;
+ resource.localizedFailDescription = payload.localizedFailDescription;
resource.finished = payload.finished;
if (this.panels.audits)
this.panels.audits.resourceFinished(resource);
@@ -1286,28 +1344,33 @@ WebInspector.updateResource = function(payload)
WebInspector.domContentEventFired = function(time)
{
- this.panels.resources.mainResourceDOMContentTime = time;
+ if (this.panels.resources)
+ this.panels.resources.mainResourceDOMContentTime = time;
this.panels.audits.mainResourceDOMContentTime = time;
if (this.panels.network)
this.panels.network.mainResourceDOMContentTime = time;
+ this.mainResourceDOMContentTime = time;
}
WebInspector.loadEventFired = function(time)
{
- this.panels.resources.mainResourceLoadTime = time;
+ if (this.panels.resources)
+ this.panels.resources.mainResourceLoadTime = time;
this.panels.audits.mainResourceLoadTime = time;
if (this.panels.network)
this.panels.network.mainResourceLoadTime = time;
+ this.mainResourceLoadTime = time;
}
WebInspector.removeResource = function(identifier)
{
+ if (Preferences.networkPanelEnabled)
+ return;
+
var resource = this.resources[identifier];
if (!resource)
return;
- resource.category.removeResource(resource);
- delete this.resourceURLMap[resource.url];
delete this.resources[identifier];
if (this.panels.resources)
@@ -1449,18 +1512,13 @@ WebInspector.reset = function()
panel.reset();
}
- this.sessionSettings.reset();
-
- for (var category in this.resourceCategories)
- this.resourceCategories[category].removeAllResources();
-
this.resources = {};
- this.resourceURLMap = {};
this.cookieDomains = {};
this.applicationCacheDomains = {};
this.highlightDOMNode(0);
- delete this.mainResource;
+ if (!Preferences.networkPanelEnabled)
+ delete this.mainResource;
this.console.clearMessages();
this.extensionServer.notifyInspectorReset();
@@ -1669,7 +1727,8 @@ WebInspector.displayNameForURL = function(url)
{
if (!url)
return "";
- var resource = this.resourceURLMap[url];
+
+ var resource = this.resourceForURL(url);
if (resource)
return resource.displayName;
@@ -1687,28 +1746,16 @@ WebInspector.displayNameForURL = function(url)
return url.trimURL(WebInspector.mainResource.domain);
}
-WebInspector.resourceForURL = function(url)
-{
- if (url in this.resourceURLMap)
- return this.resourceURLMap[url];
-
- // No direct match found. Search for resources that contain
- // a substring of the URL.
- for (var resourceURL in this.resourceURLMap) {
- if (resourceURL.hasSubstring(url))
- return this.resourceURLMap[resourceURL];
- }
-
- return null;
-}
-
WebInspector._choosePanelToShowSourceLine = function(url, line, preferredPanel)
{
preferredPanel = preferredPanel || "resources";
+ if (Preferences.networkPanelEnabled && preferredPanel === "resources")
+ preferredPanel = "storage";
+
var panel = this.panels[preferredPanel];
if (panel && panel.canShowSourceLine(url, line))
return panel;
- panel = this.panels.resources;
+ panel = Preferences.networkPanelEnabled ? this.panels.storage : this.panels.resources;
return panel.canShowSourceLine(url, line) ? panel : null;
}
@@ -1747,7 +1794,8 @@ WebInspector.linkifyStringAsFragment = function(string)
title = WebInspector.panels.profiles.displayTitleForProfileLink(profileStringMatches[2], profileStringMatches[1]);
var realURL = (linkString.indexOf("www.") === 0 ? "http://" + linkString : linkString);
- container.appendChild(WebInspector.linkifyURLAsNode(realURL, title, null, (realURL in WebInspector.resourceURLMap)));
+ var hasResourceWithURL = !!WebInspector.resourceForURL(realURL);
+ container.appendChild(WebInspector.linkifyURLAsNode(realURL, title, null, hasResourceWithURL));
string = string.substring(linkIndex + linkString.length, string.length);
}
@@ -1815,13 +1863,17 @@ WebInspector.resourceURLForRelatedNode = function(node, url)
}
// documentURL not found or has bad value
- for (var resourceURL in WebInspector.resourceURLMap) {
- var parsedURL = resourceURL.asParsedURL();
- if (parsedURL && parsedURL.path === url)
- return resourceURL;
+ var resourceURL = url;
+ function callback(resource)
+ {
+ if (resource.path === url) {
+ resourceURL = resource.url;
+ return true;
+ }
}
- return url;
-},
+ WebInspector.forAllResources(callback);
+ return resourceURL;
+}
WebInspector.completeURL = function(baseURL, href)
{
@@ -1918,9 +1970,10 @@ WebInspector.doPerformSearch = function(query, forceSearch, isBackwardSearch, re
for (var panelName in this.panels) {
var panel = this.panels[panelName];
- if (panel.currentQuery && panel.searchCanceled)
- panel.searchCanceled();
+ var hadCurrentQuery = !!panel.currentQuery;
delete panel.currentQuery;
+ if (hadCurrentQuery && panel.searchCanceled)
+ panel.searchCanceled();
}
this.updateSearchMatchesCount();
diff --git a/WebCore/inspector/front-end/networkPanel.css b/WebCore/inspector/front-end/networkPanel.css
index 773fe99..215681f 100644
--- a/WebCore/inspector/front-end/networkPanel.css
+++ b/WebCore/inspector/front-end/networkPanel.css
@@ -24,11 +24,16 @@
.network.panel .data-grid td {
line-height: 17px;
+ height: 37px;
border-right: 1px solid rgb(210, 210, 210);
-webkit-user-select: none;
vertical-align: middle;
}
+.network.panel .data-grid.small td {
+ height: 17px;
+}
+
.network.panel .data-grid th {
border-bottom: 1px solid rgb(64%, 64%, 64%);
height: 30px;
@@ -414,6 +419,10 @@
background-color: rgba(0, 0, 255, 0.5);
}
+.network.panel .resources-dividers {
+ z-index: 0;
+}
+
.network.panel .resources-dividers-label-bar {
background-color: transparent;
border: none;
@@ -535,6 +544,19 @@
left: 0;
}
+.network-close-button {
+ position: absolute;
+ width: 14px;
+ height: 14px;
+ background-image: url(Images/closeButtons.png);
+ background-position: 0 0;
+ background-color: transparent;
+ border: 0 none transparent;
+ top: 4px;
+ right: 5px;
+ z-index: 10;
+}
+
.network.panel .data-grid.full-grid-mode .viewer-column {
display: none;
}
@@ -582,7 +604,19 @@
padding-top: 5px;
}
-.network.panel .resource-view.headers-visible .resource-view-content {
+#network-views .resource-view.headers-visible .resource-view-content {
+ top: 31px;
+}
+
+#network-views.small .resource-view.headers-visible .resource-view-content {
+ top: 23px;
+}
+
+#network-views .resource-view-headers {
+ top: 31px;
+}
+
+#network-views.small .resource-view-headers {
top: 23px;
}
@@ -591,7 +625,12 @@
color: black;
}
-.network.panel .resource-view .tabbed-pane-header {
+#network-views .resource-view .tabbed-pane-header {
+ height: 31px;
+ padding-top: 11px;
+}
+
+#network-views.small .resource-view .tabbed-pane-header {
height: 23px;
padding-top: 3px;
}
diff --git a/WebCore/loader/Cache.cpp b/WebCore/loader/Cache.cpp
index 6ef65c0..7dc8a32 100644
--- a/WebCore/loader/Cache.cpp
+++ b/WebCore/loader/Cache.cpp
@@ -754,16 +754,16 @@ void Cache::setDisabled(bool disabled)
void Cache::dumpStats()
{
Statistics s = getStatistics();
- printf("%-11s %-11s %-11s %-11s %-11s %-11s %-11s\n", "", "Count", "Size", "LiveSize", "DecodedSize", "PurgeableSize", "PurgedSize");
- printf("%-11s %-11s %-11s %-11s %-11s %-11s %-11s\n", "-----------", "-----------", "-----------", "-----------", "-----------", "-----------", "-----------");
- printf("%-11s %11d %11d %11d %11d %11d %11d\n", "Images", s.images.count, s.images.size, s.images.liveSize, s.images.decodedSize, s.images.purgeableSize, s.images.purgedSize);
- printf("%-11s %11d %11d %11d %11d %11d %11d\n", "CSS", s.cssStyleSheets.count, s.cssStyleSheets.size, s.cssStyleSheets.liveSize, s.cssStyleSheets.decodedSize, s.cssStyleSheets.purgeableSize, s.cssStyleSheets.purgedSize);
+ printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n", "", "Count", "Size", "LiveSize", "DecodedSize", "PurgeableSize", "PurgedSize");
+ printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n", "-------------", "-------------", "-------------", "-------------", "-------------", "-------------", "-------------");
+ printf("%-13s %13d %13d %13d %13d %13d %13d\n", "Images", s.images.count, s.images.size, s.images.liveSize, s.images.decodedSize, s.images.purgeableSize, s.images.purgedSize);
+ printf("%-13s %13d %13d %13d %13d %13d %13d\n", "CSS", s.cssStyleSheets.count, s.cssStyleSheets.size, s.cssStyleSheets.liveSize, s.cssStyleSheets.decodedSize, s.cssStyleSheets.purgeableSize, s.cssStyleSheets.purgedSize);
#if ENABLE(XSLT)
- printf("%-11s %11d %11d %11d %11d %11d %11d\n", "XSL", s.xslStyleSheets.count, s.xslStyleSheets.size, s.xslStyleSheets.liveSize, s.xslStyleSheets.decodedSize, s.xslStyleSheets.purgeableSize, s.xslStyleSheets.purgedSize);
+ printf("%-13s %13d %13d %13d %13d %13d %13d\n", "XSL", s.xslStyleSheets.count, s.xslStyleSheets.size, s.xslStyleSheets.liveSize, s.xslStyleSheets.decodedSize, s.xslStyleSheets.purgeableSize, s.xslStyleSheets.purgedSize);
#endif
- printf("%-11s %11d %11d %11d %11d %11d %11d\n", "JavaScript", s.scripts.count, s.scripts.size, s.scripts.liveSize, s.scripts.decodedSize, s.scripts.purgeableSize, s.scripts.purgedSize);
- printf("%-11s %11d %11d %11d %11d %11d %11d\n", "Fonts", s.fonts.count, s.fonts.size, s.fonts.liveSize, s.fonts.decodedSize, s.fonts.purgeableSize, s.fonts.purgedSize);
- printf("%-11s %-11s %-11s %-11s %-11s %-11s %-11s\n\n", "-----------", "-----------", "-----------", "-----------", "-----------", "-----------", "-----------");
+ printf("%-13s %13d %13d %13d %13d %13d %13d\n", "JavaScript", s.scripts.count, s.scripts.size, s.scripts.liveSize, s.scripts.decodedSize, s.scripts.purgeableSize, s.scripts.purgedSize);
+ printf("%-13s %13d %13d %13d %13d %13d %13d\n", "Fonts", s.fonts.count, s.fonts.size, s.fonts.liveSize, s.fonts.decodedSize, s.fonts.purgeableSize, s.fonts.purgedSize);
+ printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n\n", "-------------", "-------------", "-------------", "-------------", "-------------", "-------------", "-------------");
}
void Cache::dumpLRULists(bool includeLive) const
diff --git a/WebCore/loader/CachedFont.cpp b/WebCore/loader/CachedFont.cpp
index ef88af8..e8db6c6 100644
--- a/WebCore/loader/CachedFont.cpp
+++ b/WebCore/loader/CachedFont.cpp
@@ -27,7 +27,7 @@
#include "config.h"
#include "CachedFont.h"
-#if PLATFORM(CG) || PLATFORM(QT) || PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (OS(WINDOWS) || OS(LINUX) || OS(FREEBSD))) || PLATFORM(HAIKU) || OS(WINCE) || PLATFORM(ANDROID)
+#if PLATFORM(CG) || PLATFORM(QT) || PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (OS(WINDOWS) || OS(LINUX) || OS(FREEBSD))) || PLATFORM(HAIKU) || OS(WINCE) || PLATFORM(ANDROID) || PLATFORM(BREWMP)
#define STORE_FONT_CUSTOM_PLATFORM_DATA
#endif
@@ -117,7 +117,7 @@ bool CachedFont::ensureCustomFontData()
return m_fontData;
}
-FontPlatformData CachedFont::platformDataFromCustomData(float size, bool bold, bool italic, FontRenderingMode renderingMode)
+FontPlatformData CachedFont::platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation orientation, FontRenderingMode renderingMode)
{
#if ENABLE(SVG_FONTS)
if (m_externalSVGDocument)
@@ -125,7 +125,7 @@ FontPlatformData CachedFont::platformDataFromCustomData(float size, bool bold, b
#endif
#ifdef STORE_FONT_CUSTOM_PLATFORM_DATA
ASSERT(m_fontData);
- return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, renderingMode);
+ return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, orientation, renderingMode);
#else
return FontPlatformData();
#endif
diff --git a/WebCore/loader/CachedFont.h b/WebCore/loader/CachedFont.h
index 95c2423..8dc8874 100644
--- a/WebCore/loader/CachedFont.h
+++ b/WebCore/loader/CachedFont.h
@@ -27,6 +27,7 @@
#define CachedFont_h
#include "CachedResource.h"
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <wtf/Vector.h>
@@ -62,7 +63,7 @@ public:
void beginLoadIfNeeded(CachedResourceLoader* dl);
bool ensureCustomFontData();
- FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
#if ENABLE(SVG_FONTS)
bool isSVGFont() const { return m_isSVGFont; }
diff --git a/WebCore/loader/CachedImage.cpp b/WebCore/loader/CachedImage.cpp
index 641ce94..30eaf9d 100644
--- a/WebCore/loader/CachedImage.cpp
+++ b/WebCore/loader/CachedImage.cpp
@@ -241,7 +241,7 @@ inline void CachedImage::createImage()
// Create the image if it doesn't yet exist.
if (m_image)
return;
-#if PLATFORM(CG)
+#if PLATFORM(CG) && !USE(WEBKIT_IMAGE_DECODERS)
if (m_response.mimeType() == "application/pdf") {
m_image = PDFDocumentImage::create();
return;
diff --git a/WebCore/loader/DocumentLoader.cpp b/WebCore/loader/DocumentLoader.cpp
index 2c113c3..5707530 100644
--- a/WebCore/loader/DocumentLoader.cpp
+++ b/WebCore/loader/DocumentLoader.cpp
@@ -799,6 +799,27 @@ void DocumentLoader::subresourceLoaderFinishedLoadingOnePart(ResourceLoader* loa
frame->loader()->checkLoadComplete();
}
+void DocumentLoader::transferLoadingResourcesFromPage(Page* oldPage)
+{
+ ASSERT(oldPage != m_frame->page());
+
+ FrameLoaderClient* frameLoaderClient = frameLoader()->client();
+ const ResourceRequest& request = originalRequest();
+ if (isLoadingMainResource()) {
+ frameLoaderClient->transferLoadingResourceFromPage(
+ m_mainResourceLoader->identifier(), this, request, oldPage);
+ }
+
+ if (isLoadingSubresources()) {
+ ResourceLoaderSet::const_iterator it = m_subresourceLoaders.begin();
+ ResourceLoaderSet::const_iterator end = m_subresourceLoaders.end();
+ for (; it != end; ++it) {
+ frameLoaderClient->transferLoadingResourceFromPage(
+ (*it)->identifier(), this, request, oldPage);
+ }
+ }
+}
+
void DocumentLoader::iconLoadDecisionAvailable()
{
if (m_frame)
diff --git a/WebCore/loader/DocumentLoader.h b/WebCore/loader/DocumentLoader.h
index ebb6525..2328160 100644
--- a/WebCore/loader/DocumentLoader.h
+++ b/WebCore/loader/DocumentLoader.h
@@ -48,6 +48,7 @@ namespace WebCore {
class Frame;
class FrameLoader;
class MainResourceLoader;
+ class Page;
class ResourceLoader;
class SchedulePair;
class SharedBuffer;
@@ -199,7 +200,9 @@ namespace WebCore {
void removePlugInStreamLoader(ResourceLoader*);
void subresourceLoaderFinishedLoadingOnePart(ResourceLoader*);
-
+
+ void transferLoadingResourcesFromPage(Page*);
+
void setDeferMainResourceDataLoad(bool defer) { m_deferMainResourceDataLoad = defer; }
bool deferMainResourceDataLoad() const { return m_deferMainResourceDataLoad; }
diff --git a/WebCore/loader/EmptyClients.h b/WebCore/loader/EmptyClients.h
index 6fb003e..59be8b1 100644
--- a/WebCore/loader/EmptyClients.h
+++ b/WebCore/loader/EmptyClients.h
@@ -107,7 +107,7 @@ public:
virtual void focusedNodeChanged(Node*) { }
- virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&) { return 0; }
+ virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) { return 0; }
virtual void show() { }
virtual bool canRunModal() { return false; }
@@ -263,7 +263,7 @@ public:
virtual void dispatchDidFirstLayout() { }
virtual void dispatchDidFirstVisuallyNonEmptyLayout() { }
- virtual Frame* dispatchCreatePage() { return 0; }
+ virtual Frame* dispatchCreatePage(const NavigationAction&) { return 0; }
virtual void dispatchShow() { }
virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction, const String&, const ResourceRequest&) { }
@@ -329,6 +329,8 @@ public:
virtual void transitionToCommittedFromCachedFrame(CachedFrame*) { }
virtual void transitionToCommittedForNewPage() { }
+ virtual void dispatchDidBecomeFrameset(bool) { }
+
virtual void updateGlobalHistory() { }
virtual void updateGlobalHistoryRedirectLinks() { }
virtual bool shouldGoToHistoryItem(HistoryItem*) const { return false; }
@@ -341,6 +343,7 @@ public:
virtual void didRunInsecureContent(SecurityOrigin*) { }
virtual PassRefPtr<Frame> createFrame(const KURL&, const String&, HTMLFrameOwnerElement*, const String&, bool, int, int) { return 0; }
virtual void didTransferChildFrameToNewDocument(Page*) { }
+ virtual void transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*) { }
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool) { return 0; }
virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, const Vector<String>&, const Vector<String>&) { return 0; }
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 03b6ab1..8a2adee 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -1453,6 +1453,9 @@ void FrameLoader::load(DocumentLoader* newDocumentLoader)
void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType type, PassRefPtr<FormState> prpFormState)
{
+ // Retain because dispatchBeforeLoadEvent may release the last reference to it.
+ RefPtr<Frame> protect(m_frame);
+
ASSERT(m_client->hasWebView());
// Unfortunately the view must be non-nil, this is ultimately due
@@ -1761,6 +1764,13 @@ bool FrameLoader::frameHasLoaded() const
return m_stateMachine.committedFirstRealDocumentLoad() || (m_provisionalDocumentLoader && !m_stateMachine.creatingInitialEmptyDocument());
}
+void FrameLoader::transferLoadingResourcesFromPage(Page* oldPage)
+{
+ ASSERT(oldPage != m_frame->page());
+ if (isLoading())
+ activeDocumentLoader()->transferLoadingResourcesFromPage(oldPage);
+}
+
void FrameLoader::setDocumentLoader(DocumentLoader* loader)
{
if (!loader && !m_documentLoader)
@@ -2994,20 +3004,20 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest&, Pass
}
void FrameLoader::callContinueLoadAfterNewWindowPolicy(void* argument,
- const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, bool shouldContinue)
+ const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, const NavigationAction& action, bool shouldContinue)
{
FrameLoader* loader = static_cast<FrameLoader*>(argument);
- loader->continueLoadAfterNewWindowPolicy(request, formState, frameName, shouldContinue);
+ loader->continueLoadAfterNewWindowPolicy(request, formState, frameName, action, shouldContinue);
}
void FrameLoader::continueLoadAfterNewWindowPolicy(const ResourceRequest& request,
- PassRefPtr<FormState> formState, const String& frameName, bool shouldContinue)
+ PassRefPtr<FormState> formState, const String& frameName, const NavigationAction& action, bool shouldContinue)
{
if (!shouldContinue)
return;
RefPtr<Frame> frame = m_frame;
- RefPtr<Frame> mainFrame = m_client->dispatchCreatePage();
+ RefPtr<Frame> mainFrame = m_client->dispatchCreatePage(action);
if (!mainFrame)
return;
@@ -3134,7 +3144,7 @@ void FrameLoader::checkDidPerformFirstNavigation()
if (!page)
return;
- if (!m_didPerformFirstNavigation && page->backForwardList()->entries().size() == 1) {
+ if (!m_didPerformFirstNavigation && page->backForwardList()->currentItem() && !page->backForwardList()->backItem() && !page->backForwardList()->forwardItem()) {
m_didPerformFirstNavigation = true;
m_client->didPerformFirstNavigation();
}
@@ -3506,7 +3516,8 @@ Frame* createWindow(Frame* openerFrame, Frame* lookupFrame, const FrameLoadReque
if (!oldPage)
return 0;
- Page* page = oldPage->chrome()->createWindow(openerFrame, requestWithReferrer, features);
+ NavigationAction action;
+ Page* page = oldPage->chrome()->createWindow(openerFrame, requestWithReferrer, features, action);
if (!page)
return 0;
diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h
index 63730bf..b07ed27 100644
--- a/WebCore/loader/FrameLoader.h
+++ b/WebCore/loader/FrameLoader.h
@@ -70,6 +70,7 @@ class HTMLFormElement;
class IconLoader;
class NavigationAction;
class NetworkingContext;
+class Page;
class ProtectionSpace;
class ResourceError;
class ResourceLoader;
@@ -136,6 +137,7 @@ public:
bool isLoadingMainResource() const { return m_isLoadingMainResource; }
bool isLoading() const;
bool frameHasLoaded() const;
+ void transferLoadingResourcesFromPage(Page*);
int numPendingOrLoadingRequests(bool recurse) const;
String referrer() const;
@@ -368,11 +370,11 @@ private:
void setLoadType(FrameLoadType);
static void callContinueLoadAfterNavigationPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue);
- static void callContinueLoadAfterNewWindowPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, bool shouldContinue);
+ static void callContinueLoadAfterNewWindowPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, const NavigationAction&, bool shouldContinue);
static void callContinueFragmentScrollAfterNavigationPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue);
void continueLoadAfterNavigationPolicy(const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue);
- void continueLoadAfterNewWindowPolicy(const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, bool shouldContinue);
+ void continueLoadAfterNewWindowPolicy(const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, const NavigationAction&, bool shouldContinue);
void continueFragmentScrollAfterNavigationPolicy(const ResourceRequest&, bool shouldContinue);
bool shouldScrollToAnchor(bool isFormSubmission, FrameLoadType, const KURL&);
diff --git a/WebCore/loader/FrameLoaderClient.h b/WebCore/loader/FrameLoaderClient.h
index 1855d5a..7348293 100644
--- a/WebCore/loader/FrameLoaderClient.h
+++ b/WebCore/loader/FrameLoaderClient.h
@@ -140,7 +140,7 @@ namespace WebCore {
virtual void dispatchDidFirstLayout() = 0;
virtual void dispatchDidFirstVisuallyNonEmptyLayout() = 0;
- virtual Frame* dispatchCreatePage() = 0;
+ virtual Frame* dispatchCreatePage(const NavigationAction&) = 0;
virtual void dispatchShow() = 0;
virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction, const String& MIMEType, const ResourceRequest&) = 0;
@@ -224,12 +224,15 @@ namespace WebCore {
virtual void transitionToCommittedFromCachedFrame(CachedFrame*) = 0;
virtual void transitionToCommittedForNewPage() = 0;
+ virtual void dispatchDidBecomeFrameset(bool) = 0; // Can change due to navigation or DOM modification.
+
virtual bool canCachePage() const = 0;
virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&) = 0;
virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) = 0;
virtual void didTransferChildFrameToNewDocument(Page* oldPage) = 0;
+ virtual void transferLoadingResourceFromPage(unsigned long identifier, DocumentLoader*, const ResourceRequest&, Page* oldPage) = 0;
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) = 0;
virtual void redirectDataToPlugin(Widget* pluginWidget) = 0;
diff --git a/WebCore/loader/MainResourceLoader.cpp b/WebCore/loader/MainResourceLoader.cpp
index af30a11..7e5eb90 100644
--- a/WebCore/loader/MainResourceLoader.cpp
+++ b/WebCore/loader/MainResourceLoader.cpp
@@ -202,9 +202,8 @@ void MainResourceLoader::willSendRequest(ResourceRequest& newRequest, const Reso
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
if (!redirectResponse.isNull()) {
// We checked application cache for initial URL, now we need to check it for redirected one.
- ASSERT(documentLoader()->applicationCacheHost()->status() == ApplicationCacheHost::UNCACHED);
ASSERT(!m_substituteData.isValid());
- documentLoader()->applicationCacheHost()->maybeLoadMainResource(newRequest, m_substituteData);
+ documentLoader()->applicationCacheHost()->maybeLoadMainResourceForRedirect(newRequest, m_substituteData);
}
#endif
diff --git a/WebCore/loader/PolicyCallback.cpp b/WebCore/loader/PolicyCallback.cpp
index 14799cf..4ec2c84 100644
--- a/WebCore/loader/PolicyCallback.cpp
+++ b/WebCore/loader/PolicyCallback.cpp
@@ -71,11 +71,12 @@ void PolicyCallback::set(const ResourceRequest& request, PassRefPtr<FormState> f
}
void PolicyCallback::set(const ResourceRequest& request, PassRefPtr<FormState> formState,
- const String& frameName, NewWindowPolicyDecisionFunction function, void* argument)
+ const String& frameName, const NavigationAction& navigationAction, NewWindowPolicyDecisionFunction function, void* argument)
{
m_request = request;
m_formState = formState;
m_frameName = frameName;
+ m_navigationAction = navigationAction;
m_navigationFunction = 0;
m_newWindowFunction = function;
@@ -100,7 +101,7 @@ void PolicyCallback::call(bool shouldContinue)
if (m_navigationFunction)
m_navigationFunction(m_argument, m_request, m_formState.get(), shouldContinue);
if (m_newWindowFunction)
- m_newWindowFunction(m_argument, m_request, m_formState.get(), m_frameName, shouldContinue);
+ m_newWindowFunction(m_argument, m_request, m_formState.get(), m_frameName, m_navigationAction, shouldContinue);
ASSERT(!m_contentFunction);
}
@@ -125,7 +126,7 @@ void PolicyCallback::cancel()
if (m_navigationFunction)
m_navigationFunction(m_argument, m_request, m_formState.get(), false);
if (m_newWindowFunction)
- m_newWindowFunction(m_argument, m_request, m_formState.get(), m_frameName, false);
+ m_newWindowFunction(m_argument, m_request, m_formState.get(), m_frameName, m_navigationAction, false);
if (m_contentFunction)
m_contentFunction(m_argument, PolicyIgnore);
}
diff --git a/WebCore/loader/PolicyCallback.h b/WebCore/loader/PolicyCallback.h
index 757fff8..415a3e3 100644
--- a/WebCore/loader/PolicyCallback.h
+++ b/WebCore/loader/PolicyCallback.h
@@ -31,9 +31,10 @@
#define PolicyCallback_h
#include "FrameLoaderTypes.h"
-#include "PlatformString.h"
+#include "NavigationAction.h"
#include "ResourceRequest.h"
#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -42,7 +43,7 @@ class FormState;
typedef void (*NavigationPolicyDecisionFunction)(void* argument,
const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue);
typedef void (*NewWindowPolicyDecisionFunction)(void* argument,
- const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, bool shouldContinue);
+ const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, const NavigationAction&, bool shouldContinue);
typedef void (*ContentPolicyDecisionFunction)(void* argument, PolicyAction);
class PolicyCallback {
@@ -53,7 +54,7 @@ public:
void clear();
void set(const ResourceRequest&, PassRefPtr<FormState>,
NavigationPolicyDecisionFunction, void* argument);
- void set(const ResourceRequest&, PassRefPtr<FormState>, const String& frameName,
+ void set(const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, const NavigationAction&,
NewWindowPolicyDecisionFunction, void* argument);
void set(ContentPolicyDecisionFunction, void* argument);
@@ -68,6 +69,7 @@ private:
ResourceRequest m_request;
RefPtr<FormState> m_formState;
String m_frameName;
+ NavigationAction m_navigationAction;
NavigationPolicyDecisionFunction m_navigationFunction;
NewWindowPolicyDecisionFunction m_newWindowFunction;
diff --git a/WebCore/loader/PolicyChecker.cpp b/WebCore/loader/PolicyChecker.cpp
index 196ab4f..2680386 100644
--- a/WebCore/loader/PolicyChecker.cpp
+++ b/WebCore/loader/PolicyChecker.cpp
@@ -92,7 +92,7 @@ void PolicyChecker::checkNavigationPolicy(const ResourceRequest& request, Docume
void PolicyChecker::checkNewWindowPolicy(const NavigationAction& action, NewWindowPolicyDecisionFunction function,
const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, void* argument)
{
- m_callback.set(request, formState, frameName, function, argument);
+ m_callback.set(request, formState, frameName, action, function, argument);
m_frame->loader()->client()->dispatchDecidePolicyForNewWindowAction(&PolicyChecker::continueAfterNewWindowPolicy,
action, request, formState, frameName);
}
diff --git a/WebCore/loader/ThreadableLoaderClient.h b/WebCore/loader/ThreadableLoaderClient.h
index b8a6584..bcf68be 100644
--- a/WebCore/loader/ThreadableLoaderClient.h
+++ b/WebCore/loader/ThreadableLoaderClient.h
@@ -31,6 +31,8 @@
#ifndef ThreadableLoaderClient_h
#define ThreadableLoaderClient_h
+#include <wtf/Noncopyable.h>
+
namespace WebCore {
class ResourceError;
diff --git a/WebCore/loader/appcache/ApplicationCacheHost.cpp b/WebCore/loader/appcache/ApplicationCacheHost.cpp
index f613729..d5707cf 100644
--- a/WebCore/loader/appcache/ApplicationCacheHost.cpp
+++ b/WebCore/loader/appcache/ApplicationCacheHost.cpp
@@ -91,6 +91,12 @@ void ApplicationCacheHost::maybeLoadMainResource(ResourceRequest& request, Subst
}
}
+void ApplicationCacheHost::maybeLoadMainResourceForRedirect(ResourceRequest& request, SubstituteData& substituteData)
+{
+ ASSERT(status() == UNCACHED);
+ maybeLoadMainResource(request, substituteData);
+}
+
bool ApplicationCacheHost::maybeLoadFallbackForMainResponse(const ResourceRequest& request, const ResourceResponse& r)
{
if (r.httpStatusCode() / 100 == 4 || r.httpStatusCode() / 100 == 5) {
diff --git a/WebCore/loader/appcache/ApplicationCacheHost.h b/WebCore/loader/appcache/ApplicationCacheHost.h
index 667205d..8ac5357 100644
--- a/WebCore/loader/appcache/ApplicationCacheHost.h
+++ b/WebCore/loader/appcache/ApplicationCacheHost.h
@@ -122,6 +122,7 @@ namespace WebCore {
void selectCacheWithManifest(const KURL& manifestURL);
void maybeLoadMainResource(ResourceRequest&, SubstituteData&);
+ void maybeLoadMainResourceForRedirect(ResourceRequest&, SubstituteData&);
bool maybeLoadFallbackForMainResponse(const ResourceRequest&, const ResourceResponse&);
bool maybeLoadFallbackForMainError(const ResourceRequest&, const ResourceError&);
void mainResourceDataReceived(const char* data, int length, long long lengthReceived, bool allAtOnce);
diff --git a/WebCore/manual-tests/autocorrection/autocorrection-cancelled-by-ESC.html b/WebCore/manual-tests/autocorrection/autocorrection-cancelled-by-ESC.html
new file mode 100644
index 0000000..185e5c6
--- /dev/null
+++ b/WebCore/manual-tests/autocorrection/autocorrection-cancelled-by-ESC.html
@@ -0,0 +1,50 @@
+<html>
+<head>
+
+<style>
+.editing {
+ border: 2px solid red;
+ padding: 12px;
+ font-size: 24px;
+}
+</style>
+<script src=../../../LayoutTests/editing/editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+function editingTest() {
+ typeCharacterCommand('t');
+ typeCharacterCommand('h');
+ typeCharacterCommand('e');
+ typeCharacterCommand(' ');
+ typeCharacterCommand('c');
+ typeCharacterCommand('o');
+ typeCharacterCommand('l');
+ typeCharacterCommand('l');
+ typeCharacterCommand('a');
+ typeCharacterCommand('p');
+ typeCharacterCommand('s');
+}
+
+</script>
+
+<title>Autocorrection Cancellation By ESC Test</title>
+</head>
+<body>
+<div><p>This test verifies that autocorrection is not applied when user dismisses correction panel by pressing
+ESC key.</p>
+<p>After seeing the correction panel, press ESC key, then press space. You should see the phrase "the collaps"
+where "collaps" has red mispell underline. </p>
+<p style="color:green">Note, this test can fail due to user specific spell checking data. If the user has previously
+dismissed 'collapse' as the correct spelling of 'collaps' several times, the spell checker will not provide
+'collapse' as a suggestion anymore. To fix this, remove all files in ~/Library/Spelling.</p>
+<div contenteditable id="root" class="editing">
+<span id="test"></span>
+</div>
+
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/WebCore/manual-tests/compositing/show-composited-iframe-on-back-button.html b/WebCore/manual-tests/compositing/show-composited-iframe-on-back-button.html
new file mode 100644
index 0000000..fff8888
--- /dev/null
+++ b/WebCore/manual-tests/compositing/show-composited-iframe-on-back-button.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <!--
+ This content was originally intended as a layout test, but the sequencing performed by
+ queueBackNavigation/queueForwardNavigation differs somehow from what occurs when hitting
+ the back and forward buttons, so the error does not occur. I've left all the LayoutTestController
+ logic in the test in case this is fixed in the future.
+ -->
+
+ <title>Show composited iframe contents when navigating back to page</title>
+ <style type="text/css" media="screen">
+ #box {
+ background-color: red;
+ width: 100px;
+ height: 100px;
+ -webkit-transform: translateZ(0);
+ }
+ iframe {
+ margin: 20px;
+ height: 250px;
+ width: 250px;
+ border: 1px solid black;
+ }
+
+ .composited {
+ -webkit-transform: translateZ(0);
+ }
+
+ </style>
+ <script type="text/javascript" charset="utf-8">
+ var dumpLayerTree = function()
+ {
+ if (window.layoutTestController) {
+ document.getElementById('layers').innerHTML += "Layer Tree after\n\n"+layoutTestController.layerTreeAsText()+"\n\n";
+ }
+ }
+
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ }
+
+ function onPageShow(evt)
+ {
+ if (!evt.persisted && window.layoutTestController) {
+ // this is the first time the page has been loaded, then setup the
+ // to-be-tested scenario.
+ document.getElementById('layers').innerHTML = "Layer Tree before\n\n"+layoutTestController.layerTreeAsText()+"\n\n";
+ layoutTestController.queueLoad("resources/subframe.html");
+ layoutTestController.queueBackNavigation(1);
+ layoutTestController.queueForwardNavigation(1);
+ layoutTestController.queueBackNavigation(1);
+ layoutTestController.queueNonLoadingScript("dumpLayerTree()");
+ }
+ }
+
+ window.onpageshow = onPageShow;
+ </script>
+</head>
+<body>
+<p>
+ This page has a composited iframe. When navigating to a new page and then back to this one, the iframe contents should show up.
+</p>
+ Click on the following URL and then click back. When navigating back to this page, the blue box inside the black rectangle
+ should show up.
+</p>
+<pre>
+ <a href="http://apple.com">http://apple.com</a>
+</pre>
+ <div id=box></div>
+ <iframe id="iframe" scrolling="no" src="resources/composited-subframe.html"></iframe>
+<br>
+<pre id="layers"></pre>
+</body>
+</html>
diff --git a/WebCore/manual-tests/cursor-empty-url.html b/WebCore/manual-tests/cursor-empty-url.html
new file mode 100644
index 0000000..a336100
--- /dev/null
+++ b/WebCore/manual-tests/cursor-empty-url.html
@@ -0,0 +1,3 @@
+<div>Mousing over the grey block should not cause a crash.</div>
+<link rel="stylesheet" href="resources/cursor-empty-url.css"></link>
+<div id="target" style="width: 50px; height: 50px; margin: 10px; background: #ddd"></div>
diff --git a/WebCore/manual-tests/indexed-database.html b/WebCore/manual-tests/indexed-database.html
deleted file mode 100644
index da2a1e1..0000000
--- a/WebCore/manual-tests/indexed-database.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<html>
-<body>
-<p>This is a test that only applies to IndexedDB. <span id=enabled>Our test for whether you have it enabled seems to have failed.</span></p>
-
-<p>Please follow these steps in order:</p>
-
-<p>First, click <a href="javascript: doOpen(true)">here</a> to open an indexedDB database. Look in the proper place in your file system (the place being specific to each port) and verify a file was created. You should be able to open the file up with sqlite and examine it that way as well.</p>
-
-<p>Next, close the browser, delete the file, replace it with some garbage, and make it read only to the user the browser is running as. Now click <a href="javascript: doOpen(false)">here</a>. You should get some sort of error.</p>
-
-<p>Close the browser, delete the file you made, and click <a href="javascript: doOpen(true)">here</a>. All should be well again.</p>
-
-<p>Status: <span id=status>...</span></p>
-
-<script>
-
-if (!('indexedDB' in window))
- document.getElementById("enabled").innerHTML = "<font color=red>Your build does NOT seem to have it enabled. So all code on this page is disabled.</font>";
-else
- document.getElementById("enabled").innerHTML = "<font color=green>Your build seems to have it enabled.</font>";
-
-function status(str, color)
-{
- if (color)
- str = "<font color='" + color + "'>" + str + "</font>";
- document.getElementById("status").innerHTML = str;
-}
-
-function doOpen(expectSuccess)
-{
- status("Calling open");
- request = indexedDB.open("xyz");
- request.onsuccess = function() {
- if (expectSuccess)
- status("Open successful", "green");
- else
- status("Open was successful...but shouldn't have been", "red");
- };
- request.onerror = function() {
- if (expectSuccess)
- status("Unexpected error: " + event.message, "red");
- else
- status("Expected error: " + event.message, "green");
- };
-}
-
-</script>
-</body>
-</html>
diff --git a/WebCore/manual-tests/indexeddb-persists.html b/WebCore/manual-tests/indexeddb-persists.html
new file mode 100644
index 0000000..6f5e036
--- /dev/null
+++ b/WebCore/manual-tests/indexeddb-persists.html
@@ -0,0 +1,69 @@
+<html>
+<body>
+<p>This is a test that only applies to IndexedDB. <span id=enabled>Our test for whether you have it enabled seems to have failed.</span></p>
+
+<p>Please follow these steps in order:</p>
+
+<p>First, click <a href="javascript: setData()">here</a> to open a database and set some data within it.</p>
+
+<p>Next, close the browser and then re-open this page.</p>
+
+<p>Lastly, click <a href="javascript: verifyData()">here</a> to verify the data was there</p>
+
+<p>Status: <span id=status>...</span></p>
+
+<script>
+
+if (!('webkitIndexedDB' in window))
+ document.getElementById("enabled").innerHTML = "<font color=red>Your build does NOT seem to have it enabled. So all code on this page is disabled.</font>";
+else
+ document.getElementById("enabled").innerHTML = "<font color=green>Your build seems to have it enabled.</font>";
+
+function status(str, color)
+{
+ if (color)
+ str = "<font color='" + color + "'>" + str + "</font>";
+ document.getElementById("status").innerHTML = str;
+}
+
+function setData()
+{
+ status("Something must have gone wrong (or we're still working)...", "red");
+
+ webkitIndexedDB.open("someDB", "some description").onsuccess = function() {
+ event.result.setVersion("some version").onsuccess = function() {
+ var db = event.source;
+ while (db.objectStores.length)
+ db.removeObjectStore(db.objectStores[0]);
+ db.createObjectStore("test").put("value", "key").onsuccess = function() {
+ status("Value set", "green");
+ }
+ }
+ }
+}
+
+function verifyData()
+{
+ status("Something must have gone wrong (or we're still working)...", "red");
+
+ webkitIndexedDB.open("someDB", "some description").onsuccess = function() {
+ try {
+ var result = event.result.transaction([]).objectStore("test").get("key");
+ result.onsuccess = function() {
+ if (event.result == "value")
+ status("Value verified", "green");
+ else
+ status("Value incorrect!", "red");
+ }
+ result.onerror = function() {
+ status("An error occurred: " + event.code + " " + event.message, "red");
+ }
+ } catch (e) {
+ status("An exception occurred: " + e, "red");
+ }
+ }
+}
+
+</script>
+</body>
+</html>
diff --git a/WebCore/manual-tests/plugins/windowed.html b/WebCore/manual-tests/plugins/windowed.html
index 808a0ad..56a02f4 100644
--- a/WebCore/manual-tests/plugins/windowed.html
+++ b/WebCore/manual-tests/plugins/windowed.html
@@ -62,7 +62,7 @@
<body>
<b> Verify the following tests with and without the page scrolled (including seeming unrelated test cases like printing). <br/>
- For the Qt port, test with both QtLauncher and QGVLauncher </b> <br/><br/>
+ For the Qt port, test with QGraphicsView enabled and disabled</b> <br/><br/>
<!-- <embed id="flashPlugin" src="http://www.youtube.com/v/loXfcsXRB-w&#038;hl=en&#038;fs=1" --!>
<embed id="flashPlugin" src="test.swf"
@@ -91,7 +91,7 @@
<input type="checkbox" name="zoomCheckBox"> Verify if elements in flash are correctly painted and clickable after zooming <br/>
- <input type="checkbox" name="screenshotBox"> Verify if taking a screenshot from QtLauncher display flash <br/>
+ <input type="checkbox" name="screenshotBox"> Verify if taking a screenshot from QtTestBrowser displays flash <br/>
<input type="checkbox" name="paintSystemsCheckBox"> Verify if flash is displayed with graphicssystems - raster, opengl <br/>
diff --git a/WebCore/manual-tests/plugins/windowless.html b/WebCore/manual-tests/plugins/windowless.html
index 1020abb..27e8a82 100644
--- a/WebCore/manual-tests/plugins/windowless.html
+++ b/WebCore/manual-tests/plugins/windowless.html
@@ -62,7 +62,7 @@
<body>
<b> Verify the following tests with and without the page scrolled (including seeming unrelated test cases like printing). <br/>
- For the Qt port, test with both QtLauncher and QGVLauncher </b> <br/><br/>
+ For the Qt port, test with QGraphicsView enabled and disabled</b> <br/><br/>
<!-- <embed id="flashPlugin" src="http://www.youtube.com/v/loXfcsXRB-w&#038;hl=en&#038;fs=1" --!>
<embed id="flashPlugin" src="test.swf"
@@ -92,7 +92,7 @@
<input type="checkbox" name="zoomCheckBox"> Verify if elements in flash are correctly painted and clickable after zooming <br/>
- <input type="checkbox" name="screenshotBox"> Verify if taking a screenshot from QtLauncher display flash <br/>
+ <input type="checkbox" name="screenshotBox"> Verify if taking a screenshot from QtTestBrowser displays flash <br/>
<input type="checkbox" name="paintSystemsCheckBox"> Verify if flash is displayed with graphicssystems - raster, opengl <br/>
diff --git a/WebCore/manual-tests/resources/cursor-empty-url.css b/WebCore/manual-tests/resources/cursor-empty-url.css
new file mode 100644
index 0000000..0479af1
--- /dev/null
+++ b/WebCore/manual-tests/resources/cursor-empty-url.css
@@ -0,0 +1 @@
+#target { cursor: url(''), auto; }
diff --git a/WebCore/mathml/RenderMathMLFenced.cpp b/WebCore/mathml/RenderMathMLFenced.cpp
index a304fa4..f7bbf71 100644
--- a/WebCore/mathml/RenderMathMLFenced.cpp
+++ b/WebCore/mathml/RenderMathMLFenced.cpp
@@ -142,26 +142,6 @@ void RenderMathMLFenced::addChild(RenderObject* child, RenderObject*)
RenderBlock::addChild(child, lastChild());
}
-void RenderMathMLFenced::layout()
-{
- RenderMathMLRow::layout();
-
- int width = 0;
- for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
- if (current->isBoxModelObject()) {
- RenderBoxModelObject* box = toRenderBoxModelObject(current);
- width += box->offsetWidth();
- }
- }
- width++;
- style()->setWidth(Length(width, Fixed));
-
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
- RenderBlock::layout();
-
- setNeedsLayout(false);
-}
}
#endif
diff --git a/WebCore/mathml/RenderMathMLFenced.h b/WebCore/mathml/RenderMathMLFenced.h
index 63cdaa8..64e4d90 100644
--- a/WebCore/mathml/RenderMathMLFenced.h
+++ b/WebCore/mathml/RenderMathMLFenced.h
@@ -38,9 +38,6 @@ public:
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
virtual void updateFromElement();
-protected:
- virtual void layout();
-
private:
void makeFences();
RefPtr<RenderStyle> makeOperatorStyle();
diff --git a/WebCore/mathml/RenderMathMLFraction.cpp b/WebCore/mathml/RenderMathMLFraction.cpp
index 92c8101..1000604 100644
--- a/WebCore/mathml/RenderMathMLFraction.cpp
+++ b/WebCore/mathml/RenderMathMLFraction.cpp
@@ -129,13 +129,6 @@ void RenderMathMLFraction::layout()
RenderBlock::layout();
- // The row layout can affect the numerator/denominator width.
- // FIXME: This is probably only needed if one of the children
- // contains an mrow.
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
-
- RenderBlock::layout();
}
void RenderMathMLFraction::paint(PaintInfo& info, int tx, int ty)
diff --git a/WebCore/mathml/RenderMathMLOperator.cpp b/WebCore/mathml/RenderMathMLOperator.cpp
index 1e3b429..9f35480 100644
--- a/WebCore/mathml/RenderMathMLOperator.cpp
+++ b/WebCore/mathml/RenderMathMLOperator.cpp
@@ -67,8 +67,7 @@ void RenderMathMLOperator::stretchToHeight(int height)
m_stretchHeight = static_cast<int>(height * gOperatorExpansion);
updateBoxModelInfoFromStyle();
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
+ setNeedsLayout(true);
}
void RenderMathMLOperator::layout()
diff --git a/WebCore/mathml/RenderMathMLRoot.cpp b/WebCore/mathml/RenderMathMLRoot.cpp
index ab15c80..ba60c9f 100644
--- a/WebCore/mathml/RenderMathMLRoot.cpp
+++ b/WebCore/mathml/RenderMathMLRoot.cpp
@@ -246,14 +246,14 @@ void RenderMathMLRoot::layout()
if (rootMarginTop > 0)
style()->setPaddingTop(Length(rootMarginTop + static_cast<int>(gRootPadding * style()->fontSize()), Fixed));
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
+ setNeedsLayout(true);
+ setPreferredLogicalWidthsDirty(true, false);
RenderBlock::layout();
indexBox->style()->setBottom(Length(radicalHeight + style()->paddingBottom().value(), Fixed));
// Now that we've potentially changed its position, we need layout the index again.
- indexBox->setNeedsLayoutAndPrefWidthsRecalc();
+ indexBox->setNeedsLayout(true);
indexBox->layout();
}
diff --git a/WebCore/mathml/RenderMathMLRow.cpp b/WebCore/mathml/RenderMathMLRow.cpp
index 632b794..ae911fc 100644
--- a/WebCore/mathml/RenderMathMLRow.cpp
+++ b/WebCore/mathml/RenderMathMLRow.cpp
@@ -66,42 +66,27 @@ void RenderMathMLRow::layout()
{
RenderBlock::layout();
- // Calculate the maximum height of the row without the operators.
- int maxHeight = nonOperatorHeight();
-
- // Notify contained operators they may need to re-layout their stretched operators.
- // We need to keep track of the number of children and operators because a row of
- // operators needs some special handling.
+ int maxHeight = 0;
int childCount = 0;
int operatorCount = 0;
- for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
- childCount++;
- if (current->isRenderMathMLBlock()) {
- RenderMathMLBlock* block = toRenderMathMLBlock(current);
- block->stretchToHeight(maxHeight);
- if (block->isRenderMathMLOperator())
- operatorCount++;
- }
- }
-
- // Layout the non-operators which have just been stretched.
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
- RenderBlock::layout();
- // Make a second pass with the real height of the operators.
+ // Calculate the non-operator max height of the row.
int operatorHeight = 0;
for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+ childCount++;
if (current->isRenderMathMLBlock()) {
RenderMathMLBlock* block = toRenderMathMLBlock(current);
- if (!block->hasBase() && !block->isRenderMathMLOperator()) {
- // Check to see if this box has a larger height.
- if (block->offsetHeight() > maxHeight)
- maxHeight = block->offsetHeight();
- }
- if (block->isRenderMathMLOperator())
+ // Check to see if the non-operator block has a greater height.
+ if (!block->hasBase() && !block->isRenderMathMLOperator() && block->offsetHeight() > maxHeight)
+ maxHeight = block->offsetHeight();
+ if (block->hasBase() && block->nonOperatorHeight() > maxHeight)
+ maxHeight = block->nonOperatorHeight();
+ // If the block is an operator, capture the maximum height and increment the count.
+ if (block->isRenderMathMLOperator()) {
if (block->offsetHeight() > operatorHeight)
operatorHeight = block->offsetHeight();
+ operatorCount++;
+ }
} else if (current->isBoxModelObject()) {
RenderBoxModelObject* box = toRenderBoxModelObject(current);
// Check to see if this box has a larger height.
@@ -115,34 +100,23 @@ void RenderMathMLRow::layout()
maxHeight = operatorHeight;
}
- int stretchHeight = maxHeight;
-
- // Stretch the operators again and re-calculate the row height.
- for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
- if (current->isRenderMathMLBlock()) {
- RenderMathMLBlock* block = toRenderMathMLBlock(current);
- if (block->isRenderMathMLOperator()) {
- RenderMathMLOperator* mathop = toRenderMathMLOperator(block);
- mathop->stretchToHeight(stretchHeight);
- } else {
- block->stretchToHeight(stretchHeight);
- RenderBoxModelObject* box = toRenderBoxModelObject(current);
- // Check to see if this box has a larger height
- if (box->offsetHeight() > maxHeight)
- maxHeight = box->offsetHeight();
+ // Stretch everything to the same height (blocks can ignore the request).
+ if (maxHeight > 0) {
+ bool didStretch = false;
+ for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+ if (current->isRenderMathMLBlock()) {
+ RenderMathMLBlock* block = toRenderMathMLBlock(current);
+ block->stretchToHeight(maxHeight);
+ didStretch = true;
}
- } else if (current->isBoxModelObject()) {
- RenderBoxModelObject* box = toRenderBoxModelObject(current);
- // Check to see if this box has a larger height
- if (box->offsetHeight() > maxHeight)
- maxHeight = box->offsetHeight();
+ }
+ if (didStretch) {
+ setNeedsLayout(true);
+ setPreferredLogicalWidthsDirty(true, false);
+ RenderBlock::layout();
}
}
- // Mark outself as needing layout and do the final layout of the row.
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
- RenderBlock::layout();
}
int RenderMathMLRow::baselinePosition(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
diff --git a/WebCore/mathml/RenderMathMLRow.h b/WebCore/mathml/RenderMathMLRow.h
index b363b1b..c877561 100644
--- a/WebCore/mathml/RenderMathMLRow.h
+++ b/WebCore/mathml/RenderMathMLRow.h
@@ -38,6 +38,7 @@ public:
virtual bool isRenderMathMLRow() const { return true; }
virtual int nonOperatorHeight() const;
virtual int baselinePosition(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
+ virtual void stretchToHeight(int) {}
protected:
virtual void layout();
};
diff --git a/WebCore/mathml/RenderMathMLSubSup.cpp b/WebCore/mathml/RenderMathMLSubSup.cpp
index 8add254..6c9c6b9 100644
--- a/WebCore/mathml/RenderMathMLSubSup.cpp
+++ b/WebCore/mathml/RenderMathMLSubSup.cpp
@@ -95,10 +95,11 @@ void RenderMathMLSubSup::addChild(RenderObject* child, RenderObject* beforeChild
RefPtr<RenderStyle> wrapperStyle = RenderStyle::create();
wrapperStyle->inheritFrom(style());
wrapperStyle->setDisplay(INLINE_BLOCK);
- wrapperStyle->setVerticalAlign(TOP);
+ wrapperStyle->setVerticalAlign(BASELINE);
wrapper->setStyle(wrapperStyle.release());
RenderMathMLBlock::addChild(wrapper, beforeChild);
wrapper->addChild(child);
+
}
}
@@ -111,6 +112,8 @@ void RenderMathMLSubSup::stretchToHeight(int height)
if (base->firstChild()->isRenderMathMLBlock()) {
RenderMathMLBlock* block = toRenderMathMLBlock(base->firstChild());
block->stretchToHeight(static_cast<int>(gSubSupStretch * height));
+
+ // Adjust the script placement after we stretch
if (height > 0 && m_kind == SubSup && m_scripts) {
RenderObject* script = m_scripts->firstChild();
if (script) {
@@ -124,31 +127,28 @@ void RenderMathMLSubSup::stretchToHeight(int height)
RenderBoxModelObject* topBox = toRenderBoxModelObject(top);
topBox->updateBoxModelInfoFromStyle();
}
- m_scripts->setNeedsLayoutAndPrefWidthsRecalc();
- m_scripts->markContainingBlocksForLayout();
+ m_scripts->setNeedsLayout(true);
+ setNeedsLayout(true);
}
}
+
}
- updateBoxModelInfoFromStyle();
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
}
int RenderMathMLSubSup::nonOperatorHeight() const
{
- return 0;
+ if (m_kind == SubSup)
+ return static_cast<int>(style()->fontSize()*gSubSupStretch);
+ return static_cast<int>(style()->fontSize());
}
void RenderMathMLSubSup::layout()
{
- if (firstChild()) {
- firstChild()->setNeedsLayoutAndPrefWidthsRecalc();
- firstChild()->markContainingBlocksForLayout();
- }
- if (m_scripts) {
- m_scripts->setNeedsLayoutAndPrefWidthsRecalc();
- m_scripts->markContainingBlocksForLayout();
- }
+ if (firstChild())
+ firstChild()->setNeedsLayout(true);
+ if (m_scripts)
+ m_scripts->setNeedsLayout(true);
+
RenderBlock::layout();
if (m_kind == SubSup) {
@@ -165,10 +165,10 @@ void RenderMathMLSubSup::layout()
int heightDiff = m_scripts ? (m_scripts->offsetHeight() - maxHeight) / 2 : 0;
if (heightDiff < 0)
heightDiff = 0;
- base->style()->setMarginTop(Length(heightDiff, Fixed));
+ base->style()->setPaddingTop(Length(heightDiff, Fixed));
}
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
+ setNeedsLayout(true);
+ base->setNeedsLayout(true);
RenderBlock::layout();
}
}
@@ -178,17 +178,17 @@ int RenderMathMLSubSup::baselinePosition(bool firstLine, LineDirectionMode direc
RenderObject* base = firstChild();
if (!base)
return offsetHeight();
- base = base->firstChild();
int baseline = offsetHeight();
if (!base || !base->isBoxModelObject())
return baseline;
- RenderBoxModelObject* box = toRenderBoxModelObject(base);
-
switch (m_kind) {
case SubSup:
- if (m_scripts) {
+ base = base->firstChild();
+ if (m_scripts && base->isBoxModelObject()) {
+ RenderBoxModelObject* box = toRenderBoxModelObject(base);
+
int topAdjust = (m_scripts->offsetHeight() - box->offsetHeight()) / 2;
// FIXME: The last bit of this calculation should be more exact. Why is the 2-3px scaled for zoom necessary?
@@ -197,22 +197,10 @@ int RenderMathMLSubSup::baselinePosition(bool firstLine, LineDirectionMode direc
return topAdjust + box->baselinePosition(firstLine, direction, linePositionMode) + static_cast<int>((zoomFactor > 1.25 ? 2 : 3) * zoomFactor);
}
break;
- case Sup: {
- baseline = box->baselinePosition(firstLine, direction, linePositionMode) + 4;
- // FIXME: The extra amount of the superscript ascending above the base's box
- // isn't taken into account. This should be calculated in a more reliable
- // way.
- RenderObject* sup = base->nextSibling();
- if (sup && sup->isBoxModelObject()) {
- RenderBoxModelObject* box = toRenderBoxModelObject(sup);
- // we'll take half of the sup's box height into account in the baseline
- baseline += static_cast<int>(box->offsetHeight() * 0.5);
- }
- baseline++;
- break;
- }
+ case Sup:
case Sub:
- baseline = box->baselinePosition(true, direction) + 4;
+ RenderBoxModelObject* box = toRenderBoxModelObject(base);
+ baseline = box->baselinePosition(firstLine, direction, linePositionMode);
break;
}
diff --git a/WebCore/mathml/RenderMathMLUnderOver.cpp b/WebCore/mathml/RenderMathMLUnderOver.cpp
index 69f2c57..a76f6b1 100644
--- a/WebCore/mathml/RenderMathMLUnderOver.cpp
+++ b/WebCore/mathml/RenderMathMLUnderOver.cpp
@@ -118,7 +118,7 @@ inline int getOffsetHeight(RenderObject* obj)
return 0;
}
-void RenderMathMLUnderOver::stretchToHeight(int height)
+void RenderMathMLUnderOver::stretchToHeight(int height)
{
RenderObject* base = firstChild();
@@ -138,9 +138,7 @@ void RenderMathMLUnderOver::stretchToHeight(int height)
if (base && base->isRenderMathMLBlock()) {
RenderMathMLBlock* block = toRenderMathMLBlock(base);
block->stretchToHeight(height);
- updateBoxModelInfoFromStyle();
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
+ setNeedsLayout(true);
}
}
@@ -241,7 +239,7 @@ void RenderMathMLUnderOver::layout()
}
break;
}
- setNeedsLayoutAndPrefWidthsRecalc();
+ setNeedsLayout(true);
RenderBlock::layout();
}
@@ -282,7 +280,17 @@ int RenderMathMLUnderOver::baselinePosition(bool firstLine, LineDirectionMode di
int RenderMathMLUnderOver::nonOperatorHeight() const
{
- return 0;
+ int nonOperators = 0;
+ for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+ if (current->firstChild()->isRenderMathMLBlock()) {
+ RenderMathMLBlock* block = toRenderMathMLBlock(current->firstChild());
+ if (!block->isRenderMathMLOperator())
+ nonOperators += getOffsetHeight(current);
+ } else {
+ nonOperators += getOffsetHeight(current);
+ }
+ }
+ return nonOperators;
}
}
diff --git a/WebCore/mathml/mathtags.in b/WebCore/mathml/mathtags.in
index 5bb369a..b2dcb93 100644
--- a/WebCore/mathml/mathtags.in
+++ b/WebCore/mathml/mathtags.in
@@ -16,8 +16,8 @@ mi interfaceName=MathMLTextElement
mn interfaceName=MathMLTextElement
mo interfaceName=MathMLTextElement
mtext interfaceName=MathMLTextElement
-msub interfaceName=MathMLElement
-msup interfaceName=MathMLElement
+msub interfaceName=MathMLInlineContainerElement
+msup interfaceName=MathMLInlineContainerElement
#if 0 // Curently only for MathMLNames used by HTMLTreeBuilder.
ms
diff --git a/WebCore/page/Chrome.cpp b/WebCore/page/Chrome.cpp
index 944f32f..762b087 100644
--- a/WebCore/page/Chrome.cpp
+++ b/WebCore/page/Chrome.cpp
@@ -163,9 +163,9 @@ void Chrome::focusedNodeChanged(Node* node) const
m_client->focusedNodeChanged(node);
}
-Page* Chrome::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& features) const
+Page* Chrome::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction& action) const
{
- Page* newPage = m_client->createWindow(frame, request, features);
+ Page* newPage = m_client->createWindow(frame, request, features, action);
#if ENABLE(DOM_STORAGE)
if (newPage) {
diff --git a/WebCore/page/Chrome.h b/WebCore/page/Chrome.h
index 1897b79..9f43b11 100644
--- a/WebCore/page/Chrome.h
+++ b/WebCore/page/Chrome.h
@@ -45,6 +45,7 @@ namespace WebCore {
class Geolocation;
class HitTestResult;
class IntRect;
+ class NavigationAction;
class Node;
class Page;
class PopupMenuClient;
@@ -94,7 +95,7 @@ namespace WebCore {
void focusedNodeChanged(Node*) const;
- Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&) const;
+ Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) const;
void show() const;
bool canRunModal() const;
diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.h
index 29a54c9..3e6f8d9 100644
--- a/WebCore/page/ChromeClient.h
+++ b/WebCore/page/ChromeClient.h
@@ -56,11 +56,12 @@ namespace WebCore {
class HTMLParserQuirks;
class HitTestResult;
class IntRect;
+ class NavigationAction;
class Node;
class Page;
+ class PopupMenuClient;
class SecurityOrigin;
class SharedGraphicsContext3D;
- class PopupMenuClient;
class Widget;
struct FrameLoadRequest;
@@ -98,7 +99,7 @@ namespace WebCore {
// Frame wants to create the new Page. Also, the newly created window
// should not be shown to the user until the ChromeClient of the newly
// created Page has its show method called.
- virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&) = 0;
+ virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) = 0;
virtual void show() = 0;
virtual bool canRunModal() = 0;
diff --git a/WebCore/page/ContextMenuController.cpp b/WebCore/page/ContextMenuController.cpp
index de64988..08c3d2e 100644
--- a/WebCore/page/ContextMenuController.cpp
+++ b/WebCore/page/ContextMenuController.cpp
@@ -50,6 +50,7 @@
#include "HitTestResult.h"
#include "InspectorController.h"
#include "MouseEvent.h"
+#include "NavigationAction.h"
#include "Node.h"
#include "Page.h"
#include "RenderLayer.h"
@@ -139,7 +140,7 @@ static void openNewWindow(const KURL& urlToLoad, Frame* frame)
{
if (Page* oldPage = frame->page()) {
WindowFeatures features;
- if (Page* newPage = oldPage->chrome()->createWindow(frame, FrameLoadRequest(ResourceRequest(urlToLoad, frame->loader()->outgoingReferrer())), features))
+ if (Page* newPage = oldPage->chrome()->createWindow(frame, FrameLoadRequest(ResourceRequest(urlToLoad, frame->loader()->outgoingReferrer())), features, NavigationAction()))
newPage->chrome()->show();
}
}
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 1c811cc..c7b8911 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -38,6 +38,7 @@
#include "DocumentLoader.h"
#include "DOMApplicationCache.h"
#include "DOMSelection.h"
+#include "DOMSettableTokenList.h"
#include "DOMStringList.h"
#include "DOMTimer.h"
#include "DOMTokenList.h"
@@ -730,13 +731,13 @@ void DOMWindow::requestFileSystem(int type, long long size, PassRefPtr<FileSyste
return;
if (!AsyncFileSystem::isAvailable() || !document->securityOrigin()->canAccessFileSystem()) {
- DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(SECURITY_ERR));
+ DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::SECURITY_ERR));
return;
}
AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type);
if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent) {
- DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(INVALID_MODIFICATION_ERR));
+ DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
return;
}
@@ -1270,8 +1271,8 @@ PassRefPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* elt, const String
if (!m_frame)
return 0;
- Document* doc = m_frame->document();
- return doc->styleSelector()->styleRulesForElement(elt, authorOnly);
+ Settings* settings = m_frame->settings();
+ return m_frame->document()->styleSelector()->styleRulesForElement(elt, authorOnly, false, settings && settings->crossOriginCheckInGetMatchedCSSRulesDisabled() ? AllCSSRules : SameOriginCSSRulesOnly);
}
PassRefPtr<WebKitPoint> DOMWindow::webkitConvertPointFromNodeToPage(Node* node, const WebKitPoint* p) const
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index cb504b9..4db0944 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -147,9 +147,11 @@ module window {
in DOMString pseudoElement);
// WebKit extensions
+#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
CSSRuleList getMatchedCSSRules(in Element element,
- in DOMString pseudoElement,
- in [Optional] boolean authorOnly);
+ in DOMString pseudoElement);
+#endif
+
attribute [Replaceable] double devicePixelRatio;
WebKitPoint webkitConvertPointFromPageToNode(in Node node, in WebKitPoint p);
@@ -379,6 +381,7 @@ module window {
// attribute DOMImplementationListConstructor DOMImplementationList;
// attribute DOMImplementationSourceConstructor DOMImplementationSource;
attribute DOMImplementationConstructor DOMImplementation;
+ attribute DOMSettableTokenListConstructor DOMSettableTokenList;
attribute DOMTokenListConstructor DOMTokenList;
attribute DocumentFragmentConstructor DocumentFragment;
attribute DocumentConstructor Document;
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index b0c3911..4046bd8 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -1063,15 +1063,18 @@ static bool nodeIsNotBeingEdited(Node* node, Frame* frame)
Cursor EventHandler::selectCursor(const MouseEventWithHitTestResults& event, Scrollbar* scrollbar)
{
- // During selection, use an I-beam no matter what we're over.
- // If you're capturing mouse events for a particular node, don't treat this as a selection.
- if (m_mousePressed && m_mouseDownMayStartSelect && m_frame->selection()->isCaretOrRange() && !m_capturingMouseEventsNode)
- return iBeamCursor();
-
Node* node = event.targetNode();
RenderObject* renderer = node ? node->renderer() : 0;
RenderStyle* style = renderer ? renderer->style() : 0;
+ bool horizontalText = !style || style->isHorizontalWritingMode();
+ const Cursor& iBeam = horizontalText ? iBeamCursor() : verticalTextCursor();
+
+ // During selection, use an I-beam no matter what we're over.
+ // If you're capturing mouse events for a particular node, don't treat this as a selection.
+ if (m_mousePressed && m_mouseDownMayStartSelect && m_frame->selection()->isCaretOrRange() && !m_capturingMouseEventsNode)
+ return iBeam;
+
if (renderer && renderer->isFrameSet()) {
RenderFrameSet* frameSetRenderer = toRenderFrameSet(renderer);
if (frameSetRenderer->canResizeRow(event.localPoint()))
@@ -1085,7 +1088,7 @@ Cursor EventHandler::selectCursor(const MouseEventWithHitTestResults& event, Scr
for (unsigned i = 0; i < cursors->size(); ++i) {
const CachedImage* cimage = 0;
StyleImage* image = (*cursors)[i].image();
- if (image->isCachedImage())
+ if (image && image->isCachedImage())
cimage = static_cast<StyleCachedImage*>(image)->cachedImage();
if (!cimage)
continue;
@@ -1140,7 +1143,7 @@ Cursor EventHandler::selectCursor(const MouseEventWithHitTestResults& event, Scr
}
}
if ((editable || (renderer && renderer->isText() && node->canStartSelection())) && !inResizer && !scrollbar)
- return iBeamCursor();
+ return iBeam;
return pointerCursor();
}
case CURSOR_CROSS:
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index 1b476a0..a4d33a3 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -163,6 +163,7 @@ inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoader
, m_lifeSupportTimer(this, &Frame::lifeSupportTimerFired)
, m_pageZoomFactor(parentPageZoomFactor(this))
, m_textZoomFactor(parentTextZoomFactor(this))
+ , m_pageScaleFactor(1)
#if ENABLE(ORIENTATION_EVENTS)
, m_orientation(0)
#endif
@@ -748,6 +749,10 @@ void Frame::transferChildFrameToNewDocument()
// Let external clients update themselves.
loader()->client()->didTransferChildFrameToNewDocument(oldPage);
+ // Update resource tracking now that frame could be in a different page.
+ if (oldPage != newPage)
+ loader()->transferLoadingResourcesFromPage(oldPage);
+
// Do the same for all the children.
for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling())
child->transferChildFrameToNewDocument();
@@ -883,6 +888,13 @@ IntRect Frame::tiledBackingStoreVisibleRect()
return IntRect();
return m_page->chrome()->client()->visibleRectForTiledBackingStore();
}
+
+Color Frame::tiledBackingStoreBackgroundColor() const
+{
+ if (!m_view)
+ return Color();
+ return m_view->baseBackgroundColor();
+}
#endif
String Frame::layerTreeAsText() const
@@ -956,4 +968,26 @@ void Frame::setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor
}
}
+void Frame::scalePage(float scale)
+{
+ if (m_pageScaleFactor == scale)
+ return;
+
+ m_pageScaleFactor = scale;
+
+ Document* document = this->document();
+ if (!document)
+ return;
+
+ if (document->renderer())
+ document->renderer()->setNeedsLayout(true);
+
+ document->recalcStyle(Node::Force);
+
+ if (FrameView* view = this->view()) {
+ if (document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
+ view->layout();
+ }
+}
+
} // namespace WebCore
diff --git a/WebCore/page/Frame.h b/WebCore/page/Frame.h
index b48f5c8..59e1556 100644
--- a/WebCore/page/Frame.h
+++ b/WebCore/page/Frame.h
@@ -144,6 +144,9 @@ namespace WebCore {
float textZoomFactor() const { return m_textZoomFactor; }
void setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor);
+ void scalePage(float scale);
+ float pageScaleFactor() const { return m_pageScaleFactor; }
+
#if ENABLE(ORIENTATION_EVENTS)
// Orientation is the interface orientation in degrees. Some examples are:
// 0 is straight up; -90 is when the device is rotated 90 clockwise;
@@ -215,6 +218,8 @@ namespace WebCore {
float m_pageZoomFactor;
float m_textZoomFactor;
+ float m_pageScaleFactor;
+
#if ENABLE(ORIENTATION_EVENTS)
int m_orientation;
#endif
@@ -237,6 +242,7 @@ namespace WebCore {
virtual void tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea);
virtual IntRect tiledBackingStoreContentsRect();
virtual IntRect tiledBackingStoreVisibleRect();
+ virtual Color tiledBackingStoreBackgroundColor() const;
OwnPtr<TiledBackingStore> m_tiledBackingStore;
#endif
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 6abb07c..7bc29d5 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -509,8 +509,6 @@ void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, Scrollbar
hMode = ScrollbarAlwaysOff;
#endif
} else if (body->hasTagName(bodyTag)) {
- if (!m_firstLayout && m_size.height() != layoutHeight() && body->renderer()->enclosingBox()->stretchesToViewport())
- body->renderer()->setChildNeedsLayout(true);
// It's sufficient to just check the X overflow,
// since it's illegal to have visible in only one direction.
RenderObject* o = rootRenderer->style()->overflowX() == OVISIBLE && document->documentElement()->hasTagName(htmlTag) ? body->renderer() : rootRenderer;
@@ -770,8 +768,17 @@ void FrameView::layout(bool allowSubtree)
m_size = IntSize(layoutWidth(), layoutHeight());
- if (oldSize != m_size)
+ if (oldSize != m_size) {
m_doFullRepaint = true;
+ if (!m_firstLayout) {
+ RenderBox* rootRenderer = document->documentElement() ? document->documentElement()->renderBox() : 0;
+ RenderBox* bodyRenderer = rootRenderer && document->body() ? document->body()->renderBox() : 0;
+ if (bodyRenderer && bodyRenderer->stretchesToViewport())
+ bodyRenderer->setChildNeedsLayout(true);
+ else if (rootRenderer && rootRenderer->stretchesToViewport())
+ rootRenderer->setChildNeedsLayout(true);
+ }
+ }
}
RenderLayer* layer = root->enclosingLayer();
@@ -1020,6 +1027,23 @@ bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
return false;
}
+void FrameView::scrollContentsSlowPath(const IntRect& updateRect)
+{
+#if USE(ACCELERATED_COMPOSITING)
+ if (RenderPart* frameRenderer = m_frame->ownerRenderer()) {
+ if (frameRenderer->containerForRepaint()) {
+ IntRect rect(frameRenderer->borderLeft() + frameRenderer->paddingLeft(),
+ frameRenderer->borderTop() + frameRenderer->paddingTop(),
+ visibleWidth(), visibleHeight());
+ frameRenderer->repaintRectangle(rect);
+ return;
+ }
+ }
+#endif
+
+ ScrollView::scrollContentsSlowPath(updateRect);
+}
+
// Note that this gets called at painting time.
void FrameView::setIsOverlapped(bool isOverlapped)
{
diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h
index 1518233..f9212c1 100644
--- a/WebCore/page/FrameView.h
+++ b/WebCore/page/FrameView.h
@@ -242,7 +242,8 @@ public:
protected:
virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
-
+ virtual void scrollContentsSlowPath(const IntRect& updateRect);
+
private:
FrameView(Frame*);
diff --git a/WebCore/page/SecurityOriginHash.h b/WebCore/page/SecurityOriginHash.h
index 1915fc7..c2ebdd1 100644
--- a/WebCore/page/SecurityOriginHash.h
+++ b/WebCore/page/SecurityOriginHash.h
@@ -43,7 +43,7 @@ struct SecurityOriginHash {
origin->host().impl() ? origin->host().impl()->hash() : 0,
origin->port()
};
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
static unsigned hash(const RefPtr<SecurityOrigin>& origin)
{
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index aa758c4..66ffcf0 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -28,6 +28,7 @@
#include "BackForwardList.h"
#include "CachedResourceLoader.h"
+#include "CookieStorage.h"
#include "DOMTimer.h"
#include "Database.h"
#include "Frame.h"
@@ -160,12 +161,16 @@ Settings::Settings(Page* page)
, m_interactiveFormValidation(false)
, m_usePreHTML5ParserQuirks(false)
, m_hyperlinkAuditingEnabled(false)
-#ifdef ANDROID_PLUGINS
- , m_pluginsOnDemand(false)
-#endif
+<<<<<<< HEAD
#if ENABLE(WEB_AUTOFILL)
, m_autoFillEnabled(false)
#endif
+#ifdef ANDROID_PLUGINS
+ , m_pluginsOnDemand(false)
+#endif
+=======
+ , m_crossOriginCheckInGetMatchedCSSRulesDisabled(false)
+>>>>>>> webkit.org at r70949
{
// A Frame may not have been created yet, so we initialize the AtomicString
// hash before trying to use it.
@@ -341,6 +346,9 @@ void Settings::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
if (m_privateBrowsingEnabled == privateBrowsingEnabled)
return;
+ // FIXME: We can only enable cookie private browsing mode globally, so it's misleading to have it as a per-page setting.
+ setCookieStoragePrivateBrowsingEnabled(privateBrowsingEnabled);
+
m_privateBrowsingEnabled = privateBrowsingEnabled;
m_page->privateBrowsingStateChanged();
}
@@ -448,9 +456,10 @@ void Settings::setUsesPageCache(bool usesPageCache)
m_usesPageCache = usesPageCache;
if (!m_usesPageCache) {
- HistoryItemVector& historyItems = m_page->backForwardList()->entries();
- for (unsigned i = 0; i < historyItems.size(); i++)
- pageCache()->remove(historyItems[i].get());
+ int first = -m_page->backForwardList()->backListCount();
+ int last = m_page->backForwardList()->forwardListCount();
+ for (int i = first; i <= last; i++)
+ pageCache()->remove(m_page->backForwardList()->itemAtIndex(i));
pageCache()->releaseAutoreleasedPagesNow();
}
}
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index 3401428..8324e2f 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -175,6 +175,8 @@ namespace WebCore {
// - Application Cache
// - Back/Forward Page History
// - Page Search Results
+ // - HTTP Cookies
+ // - Plug-ins (that support NPNVprivateModeBool)
void setPrivateBrowsingEnabled(bool);
bool privateBrowsingEnabled() const { return m_privateBrowsingEnabled; }
@@ -398,10 +400,15 @@ namespace WebCore {
void setHyperlinkAuditingEnabled(bool flag) { m_hyperlinkAuditingEnabled = flag; }
bool hyperlinkAuditingEnabled() const { return m_hyperlinkAuditingEnabled; }
+<<<<<<< HEAD
#if ENABLE(WEB_AUTOFILL)
void setAutoFillEnabled(bool flag) { m_autoFillEnabled = flag; }
bool autoFillEnabled() { return m_autoFillEnabled; }
#endif
+=======
+ void setCrossOriginCheckInGetMatchedCSSRulesDisabled(bool flag) { m_crossOriginCheckInGetMatchedCSSRulesDisabled = flag; }
+ bool crossOriginCheckInGetMatchedCSSRulesDisabled() const { return m_crossOriginCheckInGetMatchedCSSRulesDisabled; }
+>>>>>>> webkit.org at r70949
private:
Page* m_page;
@@ -528,12 +535,16 @@ namespace WebCore {
bool m_interactiveFormValidation: 1;
bool m_usePreHTML5ParserQuirks: 1;
bool m_hyperlinkAuditingEnabled : 1;
+<<<<<<< HEAD
#ifdef ANDROID_PLUGINS
bool m_pluginsOnDemand : 1;
#endif
#if ENABLE(WEB_AUTOFILL)
bool m_autoFillEnabled: 1;
#endif
+=======
+ bool m_crossOriginCheckInGetMatchedCSSRulesDisabled : 1;
+>>>>>>> webkit.org at r70949
#if USE(SAFARI_THEME)
static bool gShouldPaintNativeControls;
diff --git a/WebCore/page/SpeechInput.cpp b/WebCore/page/SpeechInput.cpp
index 234791b..f36ed4d 100644
--- a/WebCore/page/SpeechInput.cpp
+++ b/WebCore/page/SpeechInput.cpp
@@ -85,7 +85,7 @@ void SpeechInput::didCompleteRecognition(int listenerId)
m_listeners.get(listenerId)->didCompleteRecognition(listenerId);
}
-void SpeechInput::setRecognitionResult(int listenerId, const String& result)
+void SpeechInput::setRecognitionResult(int listenerId, const SpeechInputResultArray& result)
{
// Don't assert if not present as the element might have been removed by the page while
// this event was on the way.
@@ -93,10 +93,10 @@ void SpeechInput::setRecognitionResult(int listenerId, const String& result)
m_listeners.get(listenerId)->setRecognitionResult(listenerId, result);
}
-bool SpeechInput::startRecognition(int listenerId, const IntRect& elementRect)
+bool SpeechInput::startRecognition(int listenerId, const IntRect& elementRect, const AtomicString& language, const String& grammar)
{
ASSERT(m_listeners.contains(listenerId));
- return m_client->startRecognition(listenerId, elementRect);
+ return m_client->startRecognition(listenerId, elementRect, language, grammar);
}
void SpeechInput::stopRecording(int listenerId)
diff --git a/WebCore/page/SpeechInput.h b/WebCore/page/SpeechInput.h
index d10b789..4532d49 100644
--- a/WebCore/page/SpeechInput.h
+++ b/WebCore/page/SpeechInput.h
@@ -61,14 +61,14 @@ public:
void unregisterListener(int);
// Methods invoked by the input elements.
- bool startRecognition(int, const IntRect&);
+ bool startRecognition(int listenerId, const IntRect& elementRect, const AtomicString& language, const String& grammar);
void stopRecording(int);
void cancelRecognition(int);
// SpeechInputListener methods.
virtual void didCompleteRecording(int);
virtual void didCompleteRecognition(int);
- virtual void setRecognitionResult(int, const String&);
+ virtual void setRecognitionResult(int, const SpeechInputResultArray&);
private:
SpeechInputClient* m_client;
diff --git a/WebCore/page/SpeechInputClient.h b/WebCore/page/SpeechInputClient.h
index d5fda17..2a2e160 100644
--- a/WebCore/page/SpeechInputClient.h
+++ b/WebCore/page/SpeechInputClient.h
@@ -31,6 +31,8 @@
#ifndef SpeechInputClient_h
#define SpeechInputClient_h
+#include <wtf/Forward.h>
+
#if ENABLE(INPUT_SPEECH)
namespace WebCore {
@@ -48,7 +50,7 @@ public:
virtual void setListener(SpeechInputListener*) = 0;
// Starts speech recognition and audio recording.
- virtual bool startRecognition(int requestId, const IntRect& elementRect) = 0;
+ virtual bool startRecognition(int requestId, const IntRect& elementRect, const AtomicString& language, const String& grammar) = 0;
// Stops audio recording and performs recognition with the audio recorded until now
// (does not discard audio).
diff --git a/WebCore/page/SpeechInputListener.h b/WebCore/page/SpeechInputListener.h
index 36060fc..568b1b7 100644
--- a/WebCore/page/SpeechInputListener.h
+++ b/WebCore/page/SpeechInputListener.h
@@ -33,10 +33,13 @@
#if ENABLE(INPUT_SPEECH)
+#include "SpeechInputResult.h"
#include <wtf/Forward.h>
namespace WebCore {
+typedef Vector<RefPtr<SpeechInputResult> > SpeechInputResultArray;
+
// Interface to be implemented by the element which invokes SpeechInput.
class SpeechInputListener {
public:
@@ -53,7 +56,7 @@ public:
// This method can potentially get called multiple times if there are partial results
// available as the user keeps speaking. If the speech could not be recognized properly
// or if there was any other errors in the process, this method may never be called.
- virtual void setRecognitionResult(int requestId, const String& result) = 0;
+ virtual void setRecognitionResult(int requestId, const SpeechInputResultArray&) = 0;
protected:
virtual ~SpeechInputListener() { }
diff --git a/WebCore/page/SpeechInputResult.cpp b/WebCore/page/SpeechInputResult.cpp
new file mode 100644
index 0000000..f5b6972
--- /dev/null
+++ b/WebCore/page/SpeechInputResult.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SpeechInputResult.h"
+
+#if ENABLE(INPUT_SPEECH)
+
+namespace WebCore {
+
+PassRefPtr<SpeechInputResult> SpeechInputResult::create(const String& utterance, double confidence)
+{
+ return adoptRef(new SpeechInputResult(utterance, confidence));
+}
+
+SpeechInputResult::SpeechInputResult(const String& utterance, double confidence)
+ : m_utterance(utterance)
+ , m_confidence(confidence)
+{
+}
+
+double SpeechInputResult::confidence() const
+{
+ return m_confidence;
+}
+
+const String& SpeechInputResult::utterance() const
+{
+ return m_utterance;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
diff --git a/WebCore/page/SpeechInputResult.h b/WebCore/page/SpeechInputResult.h
new file mode 100644
index 0000000..ef9fd10
--- /dev/null
+++ b/WebCore/page/SpeechInputResult.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SpeechInputResult_h
+#define SpeechInputResult_h
+
+#if ENABLE(INPUT_SPEECH)
+
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+// This class holds one speech recognition result including the text and other related
+// fields, as received from the embedder.
+class SpeechInputResult : public RefCounted<SpeechInputResult> {
+public:
+ static PassRefPtr<SpeechInputResult> create(const String& utterance, double confidence);
+
+ double confidence() const;
+ const String& utterance() const;
+
+private:
+ SpeechInputResult(const String& utterance, double confidence);
+
+ String m_utterance;
+ double m_confidence;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
+
+#endif // SpeechInputResult_h
diff --git a/WebCore/page/animation/KeyframeAnimation.cpp b/WebCore/page/animation/KeyframeAnimation.cpp
index df963fb..84d6b97 100644
--- a/WebCore/page/animation/KeyframeAnimation.cpp
+++ b/WebCore/page/animation/KeyframeAnimation.cpp
@@ -47,6 +47,7 @@ KeyframeAnimation::KeyframeAnimation(const Animation* animation, RenderObject* r
: AnimationBase(animation, renderer, compAnim)
, m_keyframes(renderer, animation->name())
, m_index(index)
+ , m_startEventDispatched(false)
, m_unanimatedStyle(unanimatedStyle)
{
// Get the keyframe RenderStyles
@@ -323,6 +324,9 @@ bool KeyframeAnimation::sendAnimationEvent(const AtomicString& eventType, double
listenerType = Document::ANIMATIONEND_LISTENER;
else {
ASSERT(eventType == eventNames().webkitAnimationStartEvent);
+ if (m_startEventDispatched)
+ return false;
+ m_startEventDispatched = true;
listenerType = Document::ANIMATIONSTART_LISTENER;
}
diff --git a/WebCore/page/animation/KeyframeAnimation.h b/WebCore/page/animation/KeyframeAnimation.h
index a187f35..5099b50 100644
--- a/WebCore/page/animation/KeyframeAnimation.h
+++ b/WebCore/page/animation/KeyframeAnimation.h
@@ -90,6 +90,7 @@ private:
// The order in which this animation appears in the animation-name style.
int m_index;
+ bool m_startEventDispatched;
// The style just before we started animation
RefPtr<RenderStyle> m_unanimatedStyle;
diff --git a/WebCore/platform/AsyncFileSystemCallbacks.h b/WebCore/platform/AsyncFileSystemCallbacks.h
index 451aead..290a669 100644
--- a/WebCore/platform/AsyncFileSystemCallbacks.h
+++ b/WebCore/platform/AsyncFileSystemCallbacks.h
@@ -39,6 +39,7 @@ namespace WebCore {
class AsyncFileSystem;
class AsyncFileWriter;
+struct FileMetadata;
class AsyncFileSystemCallbacks : public Noncopyable {
public:
@@ -49,7 +50,7 @@ public:
virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>) = 0;
// Called when a file metadata is read successfully.
- virtual void didReadMetadata(double modificationTime) = 0;
+ virtual void didReadMetadata(const FileMetadata&) = 0;
// Called when a directory entry is read.
virtual void didReadDirectoryEntry(const String& name, bool isDirectory) = 0;
diff --git a/WebCore/platform/ContextMenu.cpp b/WebCore/platform/ContextMenu.cpp
index ca1f719..369f9ce 100644
--- a/WebCore/platform/ContextMenu.cpp
+++ b/WebCore/platform/ContextMenu.cpp
@@ -428,7 +428,7 @@ void ContextMenu::populate()
} else { // Make an editing context menu
SelectionController* selection = frame->selection();
bool inPasswordField = selection->isInPasswordField();
- bool spellCheckingEnabled = frame->editor()->spellCheckingEnabledInFocusedNode();
+ bool spellCheckingEnabled = frame->editor()->isSpellCheckingEnabledInFocusedNode();
if (!inPasswordField && spellCheckingEnabled) {
// Consider adding spelling-related or grammar-related context menu items (never both, since a single selected range
diff --git a/WebCore/platform/FileMetadata.h b/WebCore/platform/FileMetadata.h
new file mode 100644
index 0000000..9b7d09b
--- /dev/null
+++ b/WebCore/platform/FileMetadata.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FileMetadata_h
+#define FileMetadata_h
+
+#if ENABLE(FILE_SYSTEM)
+
+namespace WebCore {
+
+struct FileMetadata {
+ // The last modification time of the file, in seconds.
+ // The value 0.0 means that the time is not set.
+ double modificationTime;
+
+ // The length of the file in bytes.
+ // The value -1 means that the length is not set.
+ long long length;
+
+ enum Type {
+ TypeUnknown = 0,
+ TypeFile,
+ TypeDirectory
+ };
+
+ Type type;
+
+ FileMetadata() : modificationTime(0.0), length(-1), type(TypeUnknown) { }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
+
+#endif // FileMetadata_h
diff --git a/WebCore/platform/MIMETypeRegistry.cpp b/WebCore/platform/MIMETypeRegistry.cpp
index 0ae1389..1e986a7 100644
--- a/WebCore/platform/MIMETypeRegistry.cpp
+++ b/WebCore/platform/MIMETypeRegistry.cpp
@@ -337,7 +337,10 @@ static MediaMIMETypeMap& mediaMIMETypeMap()
// CoreAudio File
{ "audio/x-caf", "caf" },
- { "audio/x-gsm", "gsm" }
+ { "audio/x-gsm", "gsm" },
+
+ // ADPCM
+ { "audio/x-wav", "wav" }
};
DEFINE_STATIC_LOCAL(MediaMIMETypeMap, mediaMIMETypeForExtensionMap, ());
@@ -355,7 +358,7 @@ static MediaMIMETypeMap& mediaMIMETypeMap()
// If there is a system specific type for this extension, add it as the first type so
// getMediaMIMETypeForExtension will always return it.
- String systemType = MIMETypeRegistry::getMIMETypeForExtension(pairs[ndx].type);
+ String systemType = MIMETypeRegistry::getMIMETypeForExtension(pairs[ndx].extension);
if (!systemType.isEmpty() && pairs[ndx].type != systemType)
synonyms->append(systemType);
synonyms->append(pairs[ndx].type);
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index fac37d7..5f745b8 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -565,6 +565,8 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)
hostWindow()->invalidateWindow(updateRect, false /*immediate*/);
if (m_drawPanScrollIcon) {
+ // FIXME: the pan icon is broken when accelerated compositing is on, since it will draw under the compositing layers.
+ // https://bugs.webkit.org/show_bug.cgi?id=47837
int panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scrollDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's necessary
IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2));
IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation , IntSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength));
@@ -575,11 +577,11 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)
if (canBlitOnScroll()) { // The main frame can just blit the WebView window
// FIXME: Find a way to scroll subframes with this faster path
if (!scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect))
- hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
+ scrollContentsSlowPath(updateRect);
} else {
// We need to go ahead and repaint the entire backing store. Do it now before moving the
// windowed plugins.
- hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
+ scrollContentsSlowPath(updateRect);
}
// This call will move children with native widgets (plugins) and invalidate them as well.
@@ -595,6 +597,11 @@ bool ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRec
return true;
}
+void ScrollView::scrollContentsSlowPath(const IntRect& updateRect)
+{
+ hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
+}
+
IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const
{
IntPoint viewPoint = convertFromContainingWindow(windowPoint);
diff --git a/WebCore/platform/ScrollView.h b/WebCore/platform/ScrollView.h
index 1744963..739e1ac 100644
--- a/WebCore/platform/ScrollView.h
+++ b/WebCore/platform/ScrollView.h
@@ -271,8 +271,10 @@ protected:
virtual void updateScrollCorner();
virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
- // Scroll the content by blitting the pixels
+ // Scroll the content by blitting the pixels.
virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+ // Scroll the content by invalidating everything.
+ virtual void scrollContentsSlowPath(const IntRect& updateRect);
private:
RefPtr<Scrollbar> m_horizontalScrollbar;
@@ -353,6 +355,8 @@ private:
#if PLATFORM(GTK)
public:
void setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, bool resetValues = true);
+ void setHorizontalAdjustment(GtkAdjustment* hadj, bool resetValues = true);
+ void setVerticalAdjustment(GtkAdjustment* vadj, bool resetValues = true);
void setScrollOffset(const IntSize& offset) { m_scrollOffset = offset; }
private:
diff --git a/WebCore/platform/UUID.cpp b/WebCore/platform/UUID.cpp
index fdbf601..5208bee 100644
--- a/WebCore/platform/UUID.cpp
+++ b/WebCore/platform/UUID.cpp
@@ -44,8 +44,11 @@
#endif
#elif OS(DARWIN)
#include <CoreFoundation/CoreFoundation.h>
-#elif OS(LINUX)
+#elif OS(LINUX) && !PLATFORM(CHROMIUM)
#include <stdio.h>
+#elif OS(LINUX) && PLATFORM(CHROMIUM)
+#include <wtf/RandomNumber.h>
+#include <wtf/text/StringBuilder.h>
#endif
namespace WebCore {
@@ -80,7 +83,8 @@ String createCanonicalUUIDString()
String canonicalUuidStr = uuidStr.lower(); // make it lower.
ASSERT(canonicalUuidStr[uuidVersionIdentifierIndex] == uuidVersionRequired);
return canonicalUuidStr;
-#elif OS(LINUX)
+#elif OS(LINUX) && !PLATFORM(CHROMIUM)
+ // This does not work for the linux system that turns on sandbox.
FILE* fptr = fopen("/proc/sys/kernel/random/uuid", "r");
if (!fptr)
return String();
@@ -92,10 +96,29 @@ String createCanonicalUUIDString()
String canonicalUuidStr = String(uuidStr).lower(); // make it lower.
ASSERT(canonicalUuidStr[uuidVersionIdentifierIndex] == uuidVersionRequired);
return canonicalUuidStr;
+#elif OS(LINUX) && PLATFORM(CHROMIUM)
+ unsigned randomData[4];
+ for (size_t i = 0; i < sizeof(randomData) / sizeof(randomData[0]); ++i)
+ randomData[i] = static_cast<unsigned>(randomNumber() * (std::numeric_limits<unsigned>::max() + 1.0));
+
+ // Format as Version 4 UUID.
+ StringBuilder builder;
+ builder.append(String::format("%08x", randomData[0]));
+ builder.append("-");
+ builder.append(String::format("%04x", randomData[1] >> 16));
+ builder.append("-4");
+ builder.append(String::format("%03x", randomData[1] & 0x00000fff));
+ builder.append("-");
+ builder.append(String::format("%x", (randomData[2] >> 30) | 0x8)); // Condense this byte to 8, 9, a, and b.
+ builder.append(String::format("%03x", (randomData[2] >> 16) & 0x00000fff));
+ builder.append("-");
+ builder.append(String::format("%04x", randomData[2] & 0x0000ffff));
+ builder.append(String::format("%08x", randomData[3]));
+ return builder.toString();
#else
notImplemented();
return String();
-#endif
+#endif
}
}
diff --git a/WebCore/platform/android/TemporaryLinkStubs.cpp b/WebCore/platform/android/TemporaryLinkStubs.cpp
index 3997739..53640b6 100644
--- a/WebCore/platform/android/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/android/TemporaryLinkStubs.cpp
@@ -36,6 +36,7 @@
#include "ContextMenu.h"
#include "ContextMenuItem.h"
#include "CookieJar.h"
+#include "CookieStorage.h"
#include "Cursor.h"
#include "Database.h"
#include "DocumentFragment.h"
@@ -487,4 +488,9 @@ OpaqueJSClassContextData::~OpaqueJSClassContextData()
notImplemented();
}
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
#endif
diff --git a/WebCore/platform/audio/AudioBus.cpp b/WebCore/platform/audio/AudioBus.cpp
index 6b7ec3f..dd4746d 100644
--- a/WebCore/platform/audio/AudioBus.cpp
+++ b/WebCore/platform/audio/AudioBus.cpp
@@ -32,7 +32,7 @@
#include "AudioBus.h"
-#include "Accelerate.h"
+#include "VectorMath.h"
#include <algorithm>
#include <assert.h>
#include <math.h>
@@ -41,6 +41,8 @@
namespace WebCore {
+using namespace VectorMath;
+
AudioBus::AudioBus(unsigned numberOfChannels, size_t length, bool allocate)
: m_length(length)
, m_busGain(1.0)
diff --git a/WebCore/platform/audio/AudioChannel.cpp b/WebCore/platform/audio/AudioChannel.cpp
index ad38219..a962deb 100644
--- a/WebCore/platform/audio/AudioChannel.cpp
+++ b/WebCore/platform/audio/AudioChannel.cpp
@@ -32,13 +32,15 @@
#include "AudioChannel.h"
-#include "Accelerate.h"
+#include "VectorMath.h"
#include <algorithm>
#include <math.h>
#include <wtf/OwnPtr.h>
namespace WebCore {
+using namespace VectorMath;
+
void AudioChannel::scale(double scale)
{
float s = static_cast<float>(scale);
diff --git a/WebCore/platform/audio/AudioDSPKernel.h b/WebCore/platform/audio/AudioDSPKernel.h
index d9be6dc..d0719c5 100644
--- a/WebCore/platform/audio/AudioDSPKernel.h
+++ b/WebCore/platform/audio/AudioDSPKernel.h
@@ -41,6 +41,13 @@ class AudioDSPKernel {
public:
AudioDSPKernel(AudioDSPKernelProcessor* kernelProcessor)
: m_kernelProcessor(kernelProcessor)
+ , m_sampleRate(kernelProcessor->sampleRate())
+ {
+ }
+
+ AudioDSPKernel(double sampleRate)
+ : m_kernelProcessor(0)
+ , m_sampleRate(sampleRate)
{
}
@@ -50,7 +57,7 @@ public:
virtual void process(const float* source, float* destination, size_t framesToProcess) = 0;
virtual void reset() = 0;
- double sampleRate() const { return processor()->sampleRate(); }
+ double sampleRate() const { return m_sampleRate; }
double nyquist() const { return 0.5 * sampleRate(); }
AudioDSPKernelProcessor* processor() { return m_kernelProcessor; }
@@ -58,6 +65,7 @@ public:
protected:
AudioDSPKernelProcessor* m_kernelProcessor;
+ double m_sampleRate;
};
} // namespace WebCore
diff --git a/WebCore/platform/audio/AudioResamplerKernel.cpp b/WebCore/platform/audio/AudioResamplerKernel.cpp
new file mode 100644
index 0000000..7b99997
--- /dev/null
+++ b/WebCore/platform/audio/AudioResamplerKernel.cpp
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioResamplerKernel.h"
+
+#include "AudioResampler.h"
+#include <algorithm>
+
+using namespace std;
+
+namespace WebCore {
+
+const size_t AudioResamplerKernel::MaxFramesToProcess = 128;
+
+AudioResamplerKernel::AudioResamplerKernel(AudioResampler* resampler)
+ : m_resampler(resampler)
+ // The buffer size must be large enough to hold up to two extra sample frames for the linear interpolation.
+ , m_sourceBuffer(2 + static_cast<int>(MaxFramesToProcess * AudioResampler::MaxRate))
+ , m_virtualReadIndex(0.0)
+ , m_fillIndex(0)
+{
+ m_lastValues[0] = 0.0f;
+ m_lastValues[1] = 0.0f;
+}
+
+float* AudioResamplerKernel::getSourcePointer(size_t framesToProcess, size_t* numberOfSourceFramesNeededP)
+{
+ ASSERT(framesToProcess <= MaxFramesToProcess);
+
+ // Calculate the next "virtual" index. After process() is called, m_virtualReadIndex will equal this value.
+ double nextFractionalIndex = m_virtualReadIndex + framesToProcess * rate();
+
+ // Because we're linearly interpolating between the previous and next sample we need to round up so we include the next sample.
+ int endIndex = static_cast<int>(nextFractionalIndex + 1.0); // round up to next integer index
+
+ // Determine how many input frames we'll need.
+ // We need to fill the buffer up to and including endIndex (so add 1) but we've already buffered m_fillIndex frames from last time.
+ size_t framesNeeded = 1 + endIndex - m_fillIndex;
+ if (numberOfSourceFramesNeededP)
+ *numberOfSourceFramesNeededP = framesNeeded;
+
+ // Do bounds checking for the source buffer.
+ bool isGood = m_fillIndex < m_sourceBuffer.size() && m_fillIndex + framesNeeded <= m_sourceBuffer.size();
+ ASSERT(isGood);
+ if (!isGood)
+ return 0;
+
+ return m_sourceBuffer.data() + m_fillIndex;
+}
+
+void AudioResamplerKernel::process(float* destination, size_t framesToProcess)
+{
+ ASSERT(framesToProcess <= MaxFramesToProcess);
+
+ float* source = m_sourceBuffer.data();
+
+ double rate = this->rate();
+ rate = max(0.0, rate);
+ rate = min(AudioResampler::MaxRate, rate);
+
+ // Start out with the previous saved values (if any).
+ if (m_fillIndex > 0) {
+ source[0] = m_lastValues[0];
+ source[1] = m_lastValues[1];
+ }
+
+ // Make a local copy.
+ double virtualReadIndex = m_virtualReadIndex;
+
+ // Sanity check source buffer access.
+ ASSERT(framesToProcess > 0);
+ ASSERT(virtualReadIndex >= 0 && 1 + static_cast<unsigned>(virtualReadIndex + (framesToProcess - 1) * rate) < m_sourceBuffer.size());
+
+ // Do the linear interpolation.
+ int n = framesToProcess;
+ while (n--) {
+ unsigned readIndex = static_cast<unsigned>(virtualReadIndex);
+ double interpolationFactor = virtualReadIndex - readIndex;
+
+ double sample1 = source[readIndex];
+ double sample2 = source[readIndex + 1];
+
+ double sample = (1.0 - interpolationFactor) * sample1 + interpolationFactor * sample2;
+
+ *destination++ = static_cast<float>(sample);
+
+ virtualReadIndex += rate;
+ }
+
+ // Save the last two sample-frames which will later be used at the beginning of the source buffer the next time around.
+ int readIndex = static_cast<int>(virtualReadIndex);
+ m_lastValues[0] = source[readIndex];
+ m_lastValues[1] = source[readIndex + 1];
+ m_fillIndex = 2;
+
+ // Wrap the virtual read index back to the start of the buffer.
+ virtualReadIndex -= readIndex;
+
+ // Put local copy back into member variable.
+ m_virtualReadIndex = virtualReadIndex;
+}
+
+void AudioResamplerKernel::reset()
+{
+ m_virtualReadIndex = 0.0;
+ m_fillIndex = 0;
+ m_lastValues[0] = 0.0f;
+ m_lastValues[1] = 0.0f;
+}
+
+double AudioResamplerKernel::rate() const
+{
+ return m_resampler->rate();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/platform/audio/AudioResamplerKernel.h b/WebCore/platform/audio/AudioResamplerKernel.h
new file mode 100644
index 0000000..99d877b
--- /dev/null
+++ b/WebCore/platform/audio/AudioResamplerKernel.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AudioResamplerKernel_h
+#define AudioResamplerKernel_h
+
+#include "AudioArray.h"
+
+namespace WebCore {
+
+class AudioResampler;
+
+// AudioResamplerKernel does resampling on a single mono channel.
+// It uses a simple linear interpolation for good performance.
+
+class AudioResamplerKernel {
+public:
+ AudioResamplerKernel(AudioResampler*);
+
+ // getSourcePointer() should be called each time before process() is called.
+ // Given a number of frames to process (for subsequent call to process()), it returns a pointer and numberOfSourceFramesNeeded
+ // where sample data should be copied. This sample data provides the input to the resampler when process() is called.
+ // framesToProcess must be less than or equal to MaxFramesToProcess.
+ float* getSourcePointer(size_t framesToProcess, size_t* numberOfSourceFramesNeeded);
+
+ // process() resamples framesToProcess frames from the source into destination.
+ // Each call to process() must be preceded by a call to getSourcePointer() so that source input may be supplied.
+ // framesToProcess must be less than or equal to MaxFramesToProcess.
+ void process(float* destination, size_t framesToProcess);
+
+ // Resets the processing state.
+ void reset();
+
+ static const size_t MaxFramesToProcess;
+
+private:
+ double rate() const;
+
+ AudioResampler* m_resampler;
+ AudioFloatArray m_sourceBuffer;
+
+ // This is a (floating point) read index on the input stream.
+ double m_virtualReadIndex;
+
+ // We need to have continuity from one call of process() to the next.
+ // m_lastValues stores the last two sample values from the last call to process().
+ // m_fillIndex represents how many buffered samples we have which can be as many as 2.
+ // For the first call to process() (or after reset()) there will be no buffered samples.
+ float m_lastValues[2];
+ unsigned m_fillIndex;
+};
+
+} // namespace WebCore
+
+#endif // AudioResamplerKernel_h
diff --git a/WebCore/platform/audio/Biquad.cpp b/WebCore/platform/audio/Biquad.cpp
index 6918dd6..49f010b 100644
--- a/WebCore/platform/audio/Biquad.cpp
+++ b/WebCore/platform/audio/Biquad.cpp
@@ -32,12 +32,15 @@
#include "Biquad.h"
-#include "Accelerate.h"
#include <algorithm>
#include <float.h>
#include <math.h>
#include <stdio.h>
+#if OS(DARWIN)
+#include <Accelerate/Accelerate.h>
+#endif
+
namespace WebCore {
const int kBufferSize = 1024;
diff --git a/WebCore/platform/audio/FFTConvolver.cpp b/WebCore/platform/audio/FFTConvolver.cpp
index b0211fd..9093433 100644
--- a/WebCore/platform/audio/FFTConvolver.cpp
+++ b/WebCore/platform/audio/FFTConvolver.cpp
@@ -32,10 +32,12 @@
#include "FFTConvolver.h"
-#include "Accelerate.h"
+#include "VectorMath.h"
namespace WebCore {
+using namespace VectorMath;
+
FFTConvolver::FFTConvolver(size_t fftSize)
: m_frame(fftSize)
, m_readWriteIndex(0)
diff --git a/WebCore/platform/audio/FFTConvolver.h b/WebCore/platform/audio/FFTConvolver.h
index 0eec7c1..c1b5002 100644
--- a/WebCore/platform/audio/FFTConvolver.h
+++ b/WebCore/platform/audio/FFTConvolver.h
@@ -29,7 +29,7 @@
#ifndef FFTConvolver_h
#define FFTConvolver_h
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
#include "FFTFrame.h"
namespace WebCore {
diff --git a/WebCore/platform/audio/Panner.cpp b/WebCore/platform/audio/Panner.cpp
index 29a1fbe..a300786 100644
--- a/WebCore/platform/audio/Panner.cpp
+++ b/WebCore/platform/audio/Panner.cpp
@@ -45,7 +45,7 @@ PassOwnPtr<Panner> Panner::create(PanningModel model, double sampleRate)
switch (model) {
case PanningModelEqualPower:
- panner = adoptPtr(new EqualPowerPanner());
+ panner = adoptPtr(new EqualPowerPanner(sampleRate));
break;
case PanningModelHRTF:
diff --git a/WebCore/platform/audio/Reverb.cpp b/WebCore/platform/audio/Reverb.cpp
index 886a553..e59ff46 100644
--- a/WebCore/platform/audio/Reverb.cpp
+++ b/WebCore/platform/audio/Reverb.cpp
@@ -56,12 +56,12 @@ static double calculateNormalizationScale(AudioBus* response)
{
// Normalize by RMS power
size_t numberOfChannels = response->numberOfChannels();
- size_t frameSize = response->frameSize();
+ size_t length = response->length();
double power = 0.0;
for (size_t i = 0; i < numberOfChannels; ++i) {
- int n = frameSize;
+ int n = length;
float* p = response->channel(i)->data();
while (n--) {
@@ -70,7 +70,7 @@ static double calculateNormalizationScale(AudioBus* response)
}
}
- power = sqrt(power / (numberOfChannels * frameSize));
+ power = sqrt(power / (numberOfChannels * length));
// Protect against accidental overload
if (isinf(power) || isnan(power) || power < MinPower)
@@ -102,7 +102,7 @@ Reverb::Reverb(AudioBus* impulseResponse, size_t renderSliceSize, size_t maxFFTS
void Reverb::initialize(AudioBus* impulseResponseBuffer, size_t renderSliceSize, size_t maxFFTSize, size_t numberOfChannels, bool useBackgroundThreads)
{
- m_impulseResponseLength = impulseResponseBuffer->frameSize();
+ m_impulseResponseLength = impulseResponseBuffer->length();
// The reverb can handle a mono impulse response and still do stereo processing
size_t numResponseChannels = impulseResponseBuffer->numberOfChannels();
@@ -112,8 +112,8 @@ void Reverb::initialize(AudioBus* impulseResponseBuffer, size_t renderSliceSize,
for (size_t i = 0; i < numResponseChannels; ++i) {
AudioChannel* channel = impulseResponseBuffer->channel(i);
- ReverbConvolver* convolver = new ReverbConvolver(channel, renderSliceSize, maxFFTSize, convolverRenderPhase, useBackgroundThreads);
- m_convolvers.append(convolver);
+ OwnPtr<ReverbConvolver> convolver = adoptPtr(new ReverbConvolver(channel, renderSliceSize, maxFFTSize, convolverRenderPhase, useBackgroundThreads));
+ m_convolvers.append(convolver.release());
convolverRenderPhase += renderSliceSize;
}
@@ -129,7 +129,7 @@ void Reverb::process(AudioBus* sourceBus, AudioBus* destinationBus, size_t frame
// Do a fairly comprehensive sanity check.
// If these conditions are satisfied, all of the source and destination pointers will be valid for the various matrixing cases.
bool isSafeToProcess = sourceBus && destinationBus && sourceBus->numberOfChannels() > 0 && destinationBus->numberOfChannels() > 0
- && framesToProcess <= MaxFrameSize && framesToProcess <= sourceBus->frameSize() && framesToProcess <= destinationBus->frameSize();
+ && framesToProcess <= MaxFrameSize && framesToProcess <= sourceBus->length() && framesToProcess <= destinationBus->length();
ASSERT(isSafeToProcess);
if (!isSafeToProcess)
@@ -167,7 +167,7 @@ void Reverb::process(AudioBus* sourceBus, AudioBus* destinationBus, size_t frame
// simply copy L -> R
AudioChannel* destinationChannelR = destinationBus->channel(1);
- bool isCopySafe = destinationChannelL->data() && destinationChannelR->data() && destinationChannelL->frameSize() >= framesToProcess && destinationChannelR->frameSize() >= framesToProcess;
+ bool isCopySafe = destinationChannelL->data() && destinationChannelR->data() && destinationChannelL->length() >= framesToProcess && destinationChannelR->length() >= framesToProcess;
ASSERT(isCopySafe);
if (!isCopySafe)
return;
diff --git a/WebCore/platform/audio/ReverbAccumulationBuffer.cpp b/WebCore/platform/audio/ReverbAccumulationBuffer.cpp
index 7b1c63b..3d694d1 100644
--- a/WebCore/platform/audio/ReverbAccumulationBuffer.cpp
+++ b/WebCore/platform/audio/ReverbAccumulationBuffer.cpp
@@ -32,10 +32,12 @@
#include "ReverbAccumulationBuffer.h"
-#include "Accelerate.h"
+#include "VectorMath.h"
namespace WebCore {
+using namespace VectorMath;
+
ReverbAccumulationBuffer::ReverbAccumulationBuffer(size_t length)
: m_buffer(length)
, m_readIndex(0)
diff --git a/WebCore/platform/audio/ReverbAccumulationBuffer.h b/WebCore/platform/audio/ReverbAccumulationBuffer.h
index 44a0773..f5ead2a 100644
--- a/WebCore/platform/audio/ReverbAccumulationBuffer.h
+++ b/WebCore/platform/audio/ReverbAccumulationBuffer.h
@@ -29,7 +29,7 @@
#ifndef ReverbAccumulationBuffer_h
#define ReverbAccumulationBuffer_h
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
namespace WebCore {
diff --git a/WebCore/platform/audio/ReverbConvolver.cpp b/WebCore/platform/audio/ReverbConvolver.cpp
index 719e586..120c9f2 100644
--- a/WebCore/platform/audio/ReverbConvolver.cpp
+++ b/WebCore/platform/audio/ReverbConvolver.cpp
@@ -32,11 +32,13 @@
#include "ReverbConvolver.h"
-#include "Accelerate.h"
+#include "VectorMath.h"
#include "AudioBus.h"
namespace WebCore {
+using namespace VectorMath;
+
const int InputBufferSize = 8 * 16384;
// We only process the leading portion of the impulse response in the real-time thread. We don't exceed this length.
@@ -59,8 +61,8 @@ static void* backgroundThreadEntry(void* threadData)
}
ReverbConvolver::ReverbConvolver(AudioChannel* impulseResponse, size_t renderSliceSize, size_t maxFFTSize, size_t convolverRenderPhase, bool useBackgroundThreads)
- : m_impulseResponseLength(impulseResponse->frameSize())
- , m_accumulationBuffer(impulseResponse->frameSize() + renderSliceSize)
+ : m_impulseResponseLength(impulseResponse->length())
+ , m_accumulationBuffer(impulseResponse->length() + renderSliceSize)
, m_inputBuffer(InputBufferSize)
, m_renderSliceSize(renderSliceSize)
, m_minFFTSize(MinFFTSize) // First stage will have this size - successive stages will double in size each time
@@ -81,7 +83,7 @@ ReverbConvolver::ReverbConvolver(AudioChannel* impulseResponse, size_t renderSli
bool hasRealtimeConstraint = useBackgroundThreads;
float* response = impulseResponse->data();
- size_t totalResponseLength = impulseResponse->frameSize();
+ size_t totalResponseLength = impulseResponse->length();
// Because we're not using direct-convolution in the leading portion, the reverb has an overall latency of half the first-stage FFT size
size_t reverbTotalLatency = m_minFFTSize / 2;
@@ -175,7 +177,7 @@ void ReverbConvolver::backgroundThreadEntry()
void ReverbConvolver::process(AudioChannel* sourceChannel, AudioChannel* destinationChannel, size_t framesToProcess)
{
- bool isSafe = sourceChannel && destinationChannel && sourceChannel->frameSize() >= framesToProcess && destinationChannel->frameSize() >= framesToProcess;
+ bool isSafe = sourceChannel && destinationChannel && sourceChannel->length() >= framesToProcess && destinationChannel->length() >= framesToProcess;
ASSERT(isSafe);
if (!isSafe)
return;
diff --git a/WebCore/platform/audio/ReverbConvolver.h b/WebCore/platform/audio/ReverbConvolver.h
index 34f77d3..013b684 100644
--- a/WebCore/platform/audio/ReverbConvolver.h
+++ b/WebCore/platform/audio/ReverbConvolver.h
@@ -29,7 +29,7 @@
#ifndef ReverbConvolver_h
#define ReverbConvolver_h
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
#include "FFTConvolver.h"
#include "ReverbAccumulationBuffer.h"
#include "ReverbConvolverStage.h"
diff --git a/WebCore/platform/audio/ReverbConvolverStage.cpp b/WebCore/platform/audio/ReverbConvolverStage.cpp
index 8606502..e722813 100644
--- a/WebCore/platform/audio/ReverbConvolverStage.cpp
+++ b/WebCore/platform/audio/ReverbConvolverStage.cpp
@@ -32,7 +32,7 @@
#include "ReverbConvolverStage.h"
-#include "Accelerate.h"
+#include "VectorMath.h"
#include "ReverbAccumulationBuffer.h"
#include "ReverbConvolver.h"
#include "ReverbInputBuffer.h"
@@ -41,6 +41,8 @@
namespace WebCore {
+using namespace VectorMath;
+
ReverbConvolverStage::ReverbConvolverStage(float* impulseResponse, size_t responseLength, size_t reverbTotalLatency, size_t stageOffset, size_t stageLength,
size_t fftSize, size_t renderPhase, size_t renderSliceSize, ReverbAccumulationBuffer* accumulationBuffer)
: m_fftKernel(fftSize)
@@ -53,8 +55,8 @@ ReverbConvolverStage::ReverbConvolverStage(float* impulseResponse, size_t respon
ASSERT(accumulationBuffer);
m_fftKernel.doPaddedFFT(impulseResponse + stageOffset, stageLength);
- m_convolver = new FFTConvolver(fftSize);
- m_temporaryBuffer.allocate(renderSliceSize);
+ m_convolver = adoptPtr(new FFTConvolver(fftSize));
+ m_temporaryBuffer.resize(renderSliceSize);
// The convolution stage at offset stageOffset needs to have a corresponding delay to cancel out the offset.
size_t totalDelay = stageOffset + reverbTotalLatency;
@@ -76,7 +78,7 @@ ReverbConvolverStage::ReverbConvolverStage(float* impulseResponse, size_t respon
m_preReadWriteIndex = 0;
m_framesProcessed = 0; // total frames processed so far
- m_preDelayBuffer.allocate(m_preDelayLength < fftSize ? fftSize : m_preDelayLength);
+ m_preDelayBuffer.resize(m_preDelayLength < fftSize ? fftSize : m_preDelayLength);
}
void ReverbConvolverStage::processInBackground(ReverbConvolver* convolver, size_t framesToProcess)
diff --git a/WebCore/platform/audio/ReverbConvolverStage.h b/WebCore/platform/audio/ReverbConvolverStage.h
index 88351af..fc05a0e 100644
--- a/WebCore/platform/audio/ReverbConvolverStage.h
+++ b/WebCore/platform/audio/ReverbConvolverStage.h
@@ -29,7 +29,7 @@
#ifndef ReverbConvolverStage_h
#define ReverbConvolverStage_h
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
#include "FFTFrame.h"
#include <wtf/OwnPtr.h>
diff --git a/WebCore/platform/audio/ReverbInputBuffer.h b/WebCore/platform/audio/ReverbInputBuffer.h
index aa9cf41..15a2818 100644
--- a/WebCore/platform/audio/ReverbInputBuffer.h
+++ b/WebCore/platform/audio/ReverbInputBuffer.h
@@ -29,7 +29,7 @@
#ifndef ReverbInputBuffer_h
#define ReverbInputBuffer_h
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
namespace WebCore {
diff --git a/WebCore/platform/audio/VectorMath.cpp b/WebCore/platform/audio/VectorMath.cpp
new file mode 100644
index 0000000..faf5431
--- /dev/null
+++ b/WebCore/platform/audio/VectorMath.cpp
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "VectorMath.h"
+
+#if OS(DARWIN)
+#include <Accelerate/Accelerate.h>
+#endif
+
+namespace WebCore {
+
+namespace VectorMath {
+
+#if OS(DARWIN)
+// On the Mac we use the highly optimized versions in Accelerate.framework
+
+void vsmul(const float* sourceP, int sourceStride, const float* scale, float* destP, int destStride, size_t framesToProcess)
+{
+ vDSP_vsmul(sourceP, sourceStride, scale, destP, destStride, framesToProcess);
+}
+
+void vadd(const float* source1P, int sourceStride1, const float* source2P, int sourceStride2, float* destP, int destStride, size_t framesToProcess)
+{
+ vDSP_vadd(source1P, sourceStride1, source2P, sourceStride2, destP, destStride, framesToProcess);
+}
+
+#else
+
+void vsmul(const float* sourceP, int sourceStride, const float* scale, float* destP, int destStride, size_t framesToProcess)
+{
+ // FIXME: optimize for SSE
+ int n = framesToProcess;
+ float k = *scale;
+ while (n--) {
+ *destP = k * *sourceP;
+ sourceP += sourceStride;
+ destP += destStride;
+ }
+}
+
+void vadd(const float* source1P, int sourceStride1, const float* source2P, int sourceStride2, float* destP, int destStride, size_t framesToProcess)
+{
+ // FIXME: optimize for SSE
+ int n = framesToProcess;
+ while (n--) {
+ *destP = *source1P + *source2P;
+ source1P += sourceStride1;
+ source2P += sourceStride2;
+ destP += destStride;
+ }
+}
+
+#endif // OS(DARWIN)
+
+} // namespace VectorMath
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/platform/audio/VectorMath.h b/WebCore/platform/audio/VectorMath.h
new file mode 100644
index 0000000..0360bdb
--- /dev/null
+++ b/WebCore/platform/audio/VectorMath.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef VectorMath_h
+#define VectorMath_h
+
+// Defines the interface for several vector math functions whose implementation will ideally be optimized.
+
+namespace WebCore {
+
+namespace VectorMath {
+
+void vsmul(const float* sourceP, int sourceStride, const float* scale, float* destP, int destStride, size_t framesToProcess);
+void vadd(const float* source1P, int sourceStride1, const float* source2P, int sourceStride2, float* destP, int destStride, size_t framesToProcess);
+
+} // namespace VectorMath
+
+} // namespace WebCore
+
+#endif // VectorMath_h
diff --git a/WebCore/platform/brew/LanguageBrew.cpp b/WebCore/platform/brew/LanguageBrew.cpp
new file mode 100644
index 0000000..ce41973
--- /dev/null
+++ b/WebCore/platform/brew/LanguageBrew.cpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 Company 100, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Language.h"
+
+#include "NotImplemented.h"
+#include "PlatformString.h"
+
+namespace WebCore {
+
+String platformDefaultLanguage()
+{
+ notImplemented();
+ return String();
+}
+
+}
diff --git a/WebCore/platform/brew/LocalizedStringsBrew.cpp b/WebCore/platform/brew/LocalizedStringsBrew.cpp
index 2dfd12b..7c6c564 100644
--- a/WebCore/platform/brew/LocalizedStringsBrew.cpp
+++ b/WebCore/platform/brew/LocalizedStringsBrew.cpp
@@ -46,11 +46,6 @@ String resetButtonDefaultLabel()
return "Reset";
}
-String defaultLanguage()
-{
- return "en";
-}
-
String searchableIndexIntroduction()
{
return "Searchable Index";
diff --git a/WebCore/platform/brew/TemporaryLinkStubs.cpp b/WebCore/platform/brew/TemporaryLinkStubs.cpp
new file mode 100644
index 0000000..d75c224
--- /dev/null
+++ b/WebCore/platform/brew/TemporaryLinkStubs.cpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 Company 100, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "NotImplemented.h"
+
+using namespace WebCore;
+
+namespace WebCore {
+
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
+}
+
diff --git a/WebCore/platform/cf/SchedulePair.h b/WebCore/platform/cf/SchedulePair.h
index ed58406..8361856 100644
--- a/WebCore/platform/cf/SchedulePair.h
+++ b/WebCore/platform/cf/SchedulePair.h
@@ -73,7 +73,7 @@ struct SchedulePairHash {
static unsigned hash(const RefPtr<SchedulePair>& pair)
{
uintptr_t hashCodes[2] = { reinterpret_cast<uintptr_t>(pair->runLoop()), pair->mode() ? CFHash(pair->mode()) : 0 };
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
static bool equal(const RefPtr<SchedulePair>& a, const RefPtr<SchedulePair>& b) { return a == b; }
diff --git a/WebCore/platform/chromium/TemporaryLinkStubs.cpp b/WebCore/platform/chromium/TemporaryLinkStubs.cpp
index 1f60d95..3c747d0 100644
--- a/WebCore/platform/chromium/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/chromium/TemporaryLinkStubs.cpp
@@ -30,6 +30,7 @@
#include "config.h"
+#include "CookieStorage.h"
#include "KURL.h"
#include "NotImplemented.h"
#include "SharedBuffer.h"
@@ -48,4 +49,9 @@ PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String&)
return 0;
}
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
} // namespace WebCore
diff --git a/WebCore/platform/efl/LanguageEfl.cpp b/WebCore/platform/efl/LanguageEfl.cpp
index 4b765a6..efed862 100644
--- a/WebCore/platform/efl/LanguageEfl.cpp
+++ b/WebCore/platform/efl/LanguageEfl.cpp
@@ -29,15 +29,25 @@
#include "config.h"
#include "Language.h"
-#include "NotImplemented.h"
#include "PlatformString.h"
+#include <locale.h>
+
namespace WebCore {
String platformDefaultLanguage()
{
- notImplemented();
- return String();
+ char* localeDefault = setlocale(LC_CTYPE, 0);
+
+ if (!localeDefault)
+ return String("c");
+
+ char* ptr = strchr(localeDefault, '_');
+
+ if (ptr)
+ *ptr = '-';
+
+ return String(localeDefault);
}
}
diff --git a/WebCore/platform/efl/TemporaryLinkStubs.cpp b/WebCore/platform/efl/TemporaryLinkStubs.cpp
index 24f1111..ef6e6f7 100644
--- a/WebCore/platform/efl/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/efl/TemporaryLinkStubs.cpp
@@ -30,6 +30,7 @@
#include "config.h"
#include "AXObjectCache.h"
+#include "CookieStorage.h"
#include "Editor.h"
#include "FTPDirectoryDocument.h"
#include "FrameView.h"
@@ -61,5 +62,10 @@ float userIdleTime()
return FLT_MAX;
}
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
}
diff --git a/WebCore/platform/graphics/FontCache.cpp b/WebCore/platform/graphics/FontCache.cpp
index ff865c2..149ea79 100644
--- a/WebCore/platform/graphics/FontCache.cpp
+++ b/WebCore/platform/graphics/FontCache.cpp
@@ -55,13 +55,14 @@ FontCache::FontCache()
struct FontPlatformDataCacheKey : FastAllocBase {
FontPlatformDataCacheKey(const AtomicString& family = AtomicString(), unsigned size = 0, unsigned weight = 0, bool italic = false,
- bool isPrinterFont = false, FontRenderingMode renderingMode = NormalRenderingMode)
+ bool isPrinterFont = false, FontRenderingMode renderingMode = NormalRenderingMode, FontOrientation orientation = Horizontal)
: m_size(size)
, m_weight(weight)
, m_family(family)
, m_italic(italic)
, m_printerFont(isPrinterFont)
, m_renderingMode(renderingMode)
+ , m_orientation(orientation)
{
}
@@ -72,7 +73,7 @@ struct FontPlatformDataCacheKey : FastAllocBase {
{
return equalIgnoringCase(m_family, other.m_family) && m_size == other.m_size &&
m_weight == other.m_weight && m_italic == other.m_italic && m_printerFont == other.m_printerFont &&
- m_renderingMode == other.m_renderingMode;
+ m_renderingMode == other.m_renderingMode && m_orientation == other.m_orientation;
}
unsigned m_size;
@@ -81,6 +82,7 @@ struct FontPlatformDataCacheKey : FastAllocBase {
bool m_italic;
bool m_printerFont;
FontRenderingMode m_renderingMode;
+ FontOrientation m_orientation;
private:
static unsigned hashTableDeletedSize() { return 0xFFFFFFFFU; }
@@ -92,9 +94,9 @@ inline unsigned computeHash(const FontPlatformDataCacheKey& fontKey)
CaseFoldingHash::hash(fontKey.m_family),
fontKey.m_size,
fontKey.m_weight,
- static_cast<unsigned>(fontKey.m_italic) << 2 | static_cast<unsigned>(fontKey.m_printerFont) << 1 | static_cast<unsigned>(fontKey.m_renderingMode)
+ static_cast<unsigned>(fontKey.m_orientation) << 3 | static_cast<unsigned>(fontKey.m_italic) << 2 | static_cast<unsigned>(fontKey.m_printerFont) << 1 | static_cast<unsigned>(fontKey.m_renderingMode)
};
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
struct FontPlatformDataCacheKeyHash {
@@ -191,7 +193,7 @@ FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fo
}
FontPlatformDataCacheKey key(familyName, fontDescription.computedPixelSize(), fontDescription.weight(), fontDescription.italic(),
- fontDescription.usePrinterFont(), fontDescription.renderingMode());
+ fontDescription.usePrinterFont(), fontDescription.renderingMode(), fontDescription.orientation());
FontPlatformData* result = 0;
bool foundResult;
FontPlatformDataCache::iterator it = gFontPlatformDataCache->find(key);
diff --git a/WebCore/platform/graphics/FontDescription.h b/WebCore/platform/graphics/FontDescription.h
index 48fcaad..12900bf 100644
--- a/WebCore/platform/graphics/FontDescription.h
+++ b/WebCore/platform/graphics/FontDescription.h
@@ -26,6 +26,7 @@
#define FontDescription_h
#include "FontFamily.h"
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include "FontSmoothingMode.h"
#include "FontTraitsMask.h"
@@ -55,6 +56,7 @@ public:
FontDescription()
: m_specifiedSize(0)
, m_computedSize(0)
+ , m_orientation(Horizontal)
, m_italic(false)
, m_smallCaps(false)
, m_isAbsoluteSize(false)
@@ -94,6 +96,7 @@ public:
FontTraitsMask traitsMask() const;
bool isSpecifiedFont() const { return m_isSpecifiedFont; }
+ FontOrientation orientation() const { return m_orientation; }
void setFamily(const FontFamily& family) { m_familyList = family; }
void setComputedSize(float s) { m_computedSize = s; }
@@ -113,6 +116,7 @@ public:
void setFontSmoothing(FontSmoothingMode smoothing) { m_fontSmoothing = smoothing; }
void setTextRenderingMode(TextRenderingMode rendering) { m_textRendering = rendering; }
void setIsSpecifiedFont(bool isSpecifiedFont) { m_isSpecifiedFont = isSpecifiedFont; }
+ void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
private:
FontFamily m_familyList; // The list of font families to be used.
@@ -121,6 +125,8 @@ private:
// rounding, minimum font sizes, and zooming.
float m_computedSize; // Computed size adjusted for the minimum font size and the zoom factor.
+ FontOrientation m_orientation;
+
bool m_italic : 1;
bool m_smallCaps : 1;
bool m_isAbsoluteSize : 1; // Whether or not CSS specified an explicit size
@@ -155,7 +161,8 @@ inline bool FontDescription::operator==(const FontDescription& other) const
&& m_keywordSize == other.m_keywordSize
&& m_fontSmoothing == other.m_fontSmoothing
&& m_textRendering == other.m_textRendering
- && m_isSpecifiedFont == other.m_isSpecifiedFont;
+ && m_isSpecifiedFont == other.m_isSpecifiedFont
+ && m_orientation == other.m_orientation;
}
}
diff --git a/WebCore/platform/graphics/FontOrientation.h b/WebCore/platform/graphics/FontOrientation.h
new file mode 100644
index 0000000..12cf5c1
--- /dev/null
+++ b/WebCore/platform/graphics/FontOrientation.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FontOrientation_h
+#define FontOrientation_h
+
+namespace WebCore {
+
+enum FontOrientation { Horizontal, Vertical };
+
+} // namespace WebCore
+
+#endif // FontOrientation_h
diff --git a/WebCore/platform/graphics/Gradient.cpp b/WebCore/platform/graphics/Gradient.cpp
index f9427fb..6cb0ef1 100644
--- a/WebCore/platform/graphics/Gradient.cpp
+++ b/WebCore/platform/graphics/Gradient.cpp
@@ -196,6 +196,16 @@ int Gradient::findStop(float value) const
return m_lastStop;
}
+bool Gradient::hasAlpha() const
+{
+ for (size_t i = 0; i < m_stops.size(); i++) {
+ if (m_stops[i].alpha < 1)
+ return true;
+ }
+
+ return false;
+}
+
void Gradient::setSpreadMethod(GradientSpreadMethod spreadMethod)
{
// FIXME: Should it become necessary, allow calls to this method after m_gradient has been set.
diff --git a/WebCore/platform/graphics/Gradient.h b/WebCore/platform/graphics/Gradient.h
index 0a69fa2..153e1e9 100644
--- a/WebCore/platform/graphics/Gradient.h
+++ b/WebCore/platform/graphics/Gradient.h
@@ -92,6 +92,7 @@ namespace WebCore {
void addColorStop(float, const Color&);
void getColor(float value, float* r, float* g, float* b, float* a) const;
+ bool hasAlpha() const;
bool isRadial() const { return m_radial; }
bool isZeroSize() const { return m_p0.x() == m_p1.x() && m_p0.y() == m_p1.y() && (!m_radial || m_r0 == m_r1); }
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index d2e9057..b8c66d5 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -945,6 +945,8 @@ static void doPacking(const void* sourceData,
doUnpackingAndPacking<uint16_t, DestType, unpackA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
+ default:
+ ASSERT(false);
}
}
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index d74c97c..20b4e2d 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -540,7 +540,7 @@ public:
// uploading. This enum must be public because it is accessed
// by non-member functions.
enum SourceDataFormat {
- kSourceFormatRGBA8,
+ kSourceFormatRGBA8 = 0,
kSourceFormatRGBA16Little,
kSourceFormatRGBA16Big,
kSourceFormatRGB8,
@@ -566,7 +566,8 @@ public:
kSourceFormatAR16Big,
kSourceFormatA8,
kSourceFormatA16Little,
- kSourceFormatA16Big
+ kSourceFormatA16Big,
+ kSourceFormatNumFormats
};
//----------------------------------------------------------------------
diff --git a/WebCore/platform/graphics/GraphicsLayer.h b/WebCore/platform/graphics/GraphicsLayer.h
index ad4d056..991ca32 100644
--- a/WebCore/platform/graphics/GraphicsLayer.h
+++ b/WebCore/platform/graphics/GraphicsLayer.h
@@ -40,6 +40,10 @@
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
+#if USE(TEXTURE_MAPPER)
+#include "texmap/TextureMapperPlatformLayer.h"
+#endif
+
#if PLATFORM(MAC)
#ifdef __OBJC__
@class WebLayer;
@@ -57,11 +61,21 @@ typedef WKCACFLayer PlatformLayer;
typedef void* NativeLayer;
}
#elif PLATFORM(QT)
+#if USE(TEXTURE_MAPPER)
+namespace WebCore {
+class TextureMapperPlatformLayer;
+typedef TextureMapperPlatformLayer PlatformLayer;
+typedef TextureMapperPlatformLayer* NativeLayer;
+};
+#else
QT_BEGIN_NAMESPACE
-class QGraphicsItem;
+class QGraphicsObject;
QT_END_NAMESPACE
-typedef QGraphicsItem PlatformLayer;
-typedef QGraphicsItem* NativeLayer;
+namespace WebCore {
+typedef QGraphicsObject PlatformLayer;
+typedef QGraphicsObject* NativeLayer;
+}
+#endif
#elif PLATFORM(CHROMIUM)
namespace WebCore {
class LayerChromium;
diff --git a/WebCore/platform/graphics/ImageSource.h b/WebCore/platform/graphics/ImageSource.h
index 189f0f5..4d50253 100644
--- a/WebCore/platform/graphics/ImageSource.h
+++ b/WebCore/platform/graphics/ImageSource.h
@@ -69,7 +69,12 @@ class IntSize;
class SharedBuffer;
#if PLATFORM(CG)
+#if USE(WEBKIT_IMAGE_DECODERS)
+class ImageDecoder;
+typedef ImageDecoder* NativeImageSourcePtr;
+#else
typedef CGImageSourceRef NativeImageSourcePtr;
+#endif
typedef CGImageRef NativeImagePtr;
#elif PLATFORM(OPENVG)
class ImageDecoder;
diff --git a/WebCore/platform/graphics/SimpleFontData.h b/WebCore/platform/graphics/SimpleFontData.h
index 535554f..7bd58ad 100644
--- a/WebCore/platform/graphics/SimpleFontData.h
+++ b/WebCore/platform/graphics/SimpleFontData.h
@@ -37,7 +37,7 @@
typedef struct OpaqueATSUStyle* ATSUStyle;
#endif
-#if USE(CORE_TEXT)
+#if PLATFORM(MAC) || USE(CORE_TEXT)
#include <wtf/RetainPtr.h>
#endif
@@ -130,7 +130,7 @@ public:
NSFont* getNSFont() const { return m_platformData.nsFont(); }
#endif
-#if USE(CORE_TEXT)
+#if PLATFORM(MAC) || USE(CORE_TEXT)
CFDictionaryRef getCFStringAttributes(TypesettingFeatures) const;
#endif
@@ -234,7 +234,7 @@ public:
private:
#endif
-#if USE(CORE_TEXT)
+#if PLATFORM(MAC) || USE(CORE_TEXT)
mutable HashMap<unsigned, RetainPtr<CFDictionaryRef> > m_CFStringAttributes;
#endif
diff --git a/WebCore/platform/graphics/TiledBackingStoreClient.h b/WebCore/platform/graphics/TiledBackingStoreClient.h
index c5845b9..6087ec3 100644
--- a/WebCore/platform/graphics/TiledBackingStoreClient.h
+++ b/WebCore/platform/graphics/TiledBackingStoreClient.h
@@ -30,6 +30,7 @@ public:
virtual void tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea) = 0;
virtual IntRect tiledBackingStoreContentsRect() = 0;
virtual IntRect tiledBackingStoreVisibleRect() = 0;
+ virtual Color tiledBackingStoreBackgroundColor() const = 0;
};
#else
diff --git a/WebCore/platform/graphics/WOFFFileFormat.cpp b/WebCore/platform/graphics/WOFFFileFormat.cpp
index 25b3b00..5391f30 100644
--- a/WebCore/platform/graphics/WOFFFileFormat.cpp
+++ b/WebCore/platform/graphics/WOFFFileFormat.cpp
@@ -25,16 +25,16 @@
#include "config.h"
#include "WOFFFileFormat.h"
+#include <zlib.h>
#if !ENABLE(OPENTYPE_SANITIZER)
#include "SharedBuffer.h"
-#if !PLATFORM(WIN)
#if OS(UNIX)
#include <netinet/in.h>
#endif
-#include <zlib.h>
+
#if PLATFORM(BREWMP)
#include <AEEStdLib.h>
#define htonl(x) HTONL(x)
@@ -42,17 +42,8 @@
#define ntohl(x) NTOHL(x)
#define ntohs(x) NTOHS(x)
#endif
-#else
-#include "SoftLinking.h"
-
-typedef unsigned char Bytef;
-typedef unsigned long uLong;
-typedef unsigned long uLongf;
-#define Z_OK 0
-
-SOFT_LINK_LIBRARY(zlib1);
-SOFT_LINK(zlib1, uncompress, int, __cdecl, (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen), (dest, destLen, source, sourceLen));
+#if PLATFORM(WIN)
#if CPU(BIG_ENDIAN)
#define ntohs(x) ((uint16_t)(x))
#define htons(x) ((uint16_t)(x))
@@ -70,7 +61,6 @@ SOFT_LINK(zlib1, uncompress, int, __cdecl, (Bytef *dest, uLongf *destLen, const
(((uint32_t)(x) & 0x0000ff00) << 8) | (((uint32_t)(x) & 0x000000ff) << 24)))
#define htonl(x) ntohl(x)
#endif
-
#endif // PLATFORM(WIN)
namespace WebCore {
@@ -123,10 +113,6 @@ bool isWOFF(SharedBuffer* buffer)
bool convertWOFFToSfnt(SharedBuffer* woff, Vector<char>& sfnt)
{
-#if PLATFORM(WINDOWS)
- if (!zlib1Library())
- return false;
-#endif
ASSERT_ARG(sfnt, sfnt.isEmpty());
size_t offset = 0;
diff --git a/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp b/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp
index 5dca010..cd9ee46 100644
--- a/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp
+++ b/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp
@@ -41,33 +41,63 @@ void FontCache::platformInit()
ASSERT_NOT_REACHED();
}
-const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
+FcPattern* createFontConfigPatternForCharacters(const UChar* characters, int length)
{
- FcResult fresult;
- FontPlatformData* prim = const_cast<FontPlatformData*>(&font.primaryFont()->platformData());
+ FcPattern* pattern = FcPatternCreate();
+
+ FcCharSet* fontConfigCharSet = FcCharSetCreate();
+ for (int i = 0; i < length; ++i) {
+ if (U16_IS_SURROGATE(characters[i]) && U16_IS_SURROGATE_LEAD(characters[i])
+ && i != length - 1 && U16_IS_TRAIL(characters[i + 1])) {
+ FcCharSetAddChar(fontConfigCharSet, U16_GET_SUPPLEMENTARY(characters[i], characters[i+1]));
+ i++;
+ } else
+ FcCharSetAddChar(fontConfigCharSet, characters[i]);
+ }
+ FcPatternAddCharSet(pattern, FC_CHARSET, fontConfigCharSet);
+ FcCharSetDestroy(fontConfigCharSet);
- // FIXME: This should not happen, apparently. We are null-checking
- // for now just to avoid crashing.
- if (!prim || !prim->m_pattern)
+ FcPatternAddBool(pattern, FC_SCALABLE, FcTrue);
+ FcConfigSubstitute(0, pattern, FcMatchPattern);
+ FcDefaultSubstitute(pattern);
+ return pattern;
+}
+
+FcPattern* findBestFontGivenFallbacks(const FontPlatformData& fontData, FcPattern* pattern)
+{
+ if (!fontData.m_pattern)
return 0;
- if (!prim->m_fallbacks)
- prim->m_fallbacks = FcFontSort(0, prim->m_pattern.get(), FcTrue, 0, &fresult);
+ if (!fontData.m_fallbacks) {
+ FcResult fontConfigResult;
+ fontData.m_fallbacks = FcFontSort(0, fontData.m_pattern.get(), FcTrue, 0, &fontConfigResult);
+ }
- FcFontSet* fs = prim->m_fallbacks;
+ if (!fontData.m_fallbacks)
+ return 0;
- for (int i = 0; i < fs->nfont; i++) {
- PlatformRefPtr<FcPattern> fin = adoptPlatformRef(FcFontRenderPrepare(0, prim->m_pattern.get(), fs->fonts[i]));
- cairo_font_face_t* fontFace = cairo_ft_font_face_create_for_pattern(fin.get());
- FontPlatformData alternateFont(fontFace, font.fontDescription().computedPixelSize(), false, false);
- cairo_font_face_destroy(fontFace);
- alternateFont.m_pattern = fin;
- SimpleFontData* sfd = getCachedFontData(&alternateFont);
- if (sfd->containsCharacters(characters, length))
- return sfd;
+ FcFontSet* sets[] = { fontData.m_fallbacks };
+ FcResult fontConfigResult;
+ return FcFontSetMatch(0, sets, 1, pattern, &fontConfigResult);
+}
+
+const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
+{
+ PlatformRefPtr<FcPattern> pattern = adoptPlatformRef(createFontConfigPatternForCharacters(characters, length));
+ const FontPlatformData& fontData = font.primaryFont()->platformData();
+
+ PlatformRefPtr<FcPattern> fallbackPattern = adoptPlatformRef(findBestFontGivenFallbacks(fontData, pattern.get()));
+ if (fallbackPattern) {
+ FontPlatformData alternateFontData(fallbackPattern.get(), font.fontDescription());
+ return getCachedFontData(&alternateFontData);
}
- return 0;
+ FcResult fontConfigResult;
+ PlatformRefPtr<FcPattern> resultPattern = adoptPlatformRef(FcFontMatch(0, pattern.get(), &fontConfigResult));
+ if (!resultPattern)
+ return 0;
+ FontPlatformData alternateFontData(resultPattern.get(), font.fontDescription());
+ return getCachedFontData(&alternateFontData);
}
SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
diff --git a/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp b/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp
index 0d195cb..800907a 100644
--- a/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp
@@ -58,7 +58,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
cairo_font_face_destroy(m_fontFace);
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
{
return FontPlatformData(m_fontFace, size, bold, italic);
}
diff --git a/WebCore/platform/graphics/cairo/FontCustomPlatformData.h b/WebCore/platform/graphics/cairo/FontCustomPlatformData.h
index c48d110..dac31f8 100644
--- a/WebCore/platform/graphics/cairo/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/cairo/FontCustomPlatformData.h
@@ -22,6 +22,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
@@ -38,7 +39,7 @@ struct FontCustomPlatformData : Noncopyable {
public:
FontCustomPlatformData(FT_Face, SharedBuffer*);
~FontCustomPlatformData();
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
static bool supportsFormat(const String&);
private:
diff --git a/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h
index 7d3ff99..d47d556 100644
--- a/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h
+++ b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h
@@ -86,7 +86,7 @@ public:
#endif
PlatformRefPtr<FcPattern> m_pattern;
- FcFontSet* m_fallbacks;
+ mutable FcFontSet* m_fallbacks; // Initialized lazily.
float m_size;
bool m_syntheticBold;
bool m_syntheticOblique;
diff --git a/WebCore/platform/graphics/cairo/PathCairo.cpp b/WebCore/platform/graphics/cairo/PathCairo.cpp
index d5045be..03f1d10 100644
--- a/WebCore/platform/graphics/cairo/PathCairo.cpp
+++ b/WebCore/platform/graphics/cairo/PathCairo.cpp
@@ -274,6 +274,8 @@ FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
bool Path::contains(const FloatPoint& point, WindRule rule) const
{
+ if (!isfinite(point.x()) || !isfinite(point.y()))
+ return false;
cairo_t* cr = platformPath()->context();
cairo_fill_rule_t cur = cairo_get_fill_rule(cr);
cairo_set_fill_rule(cr, rule == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
diff --git a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
index fe4fc7f..a1cc805 100644
--- a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
@@ -41,6 +41,56 @@
namespace WebCore {
+enum SourceDataFormatBase {
+ SourceFormatBaseR = 0,
+ SourceFormatBaseA,
+ SourceFormatBaseRA,
+ SourceFormatBaseAR,
+ SourceFormatBaseRGB,
+ SourceFormatBaseRGBA,
+ SourceFormatBaseARGB,
+ SourceFormatBaseNumFormats
+};
+
+enum AlphaFormat {
+ AlphaFormatNone = 0,
+ AlphaFormatFirst,
+ AlphaFormatLast,
+ AlphaFormatNumFormats
+};
+
+// This returns kSourceFormatNumFormats if the combination of input parameters is unsupported.
+static GraphicsContext3D::SourceDataFormat getSourceDataFormat(unsigned int componentsPerPixel, AlphaFormat alphaFormat, bool is16BitFormat, bool bigEndian)
+{
+ const static SourceDataFormatBase formatTableBase[4][AlphaFormatNumFormats] = { // componentsPerPixel x AlphaFormat
+ // AlphaFormatNone AlphaFormatFirst AlphaFormatLast
+ { SourceFormatBaseR, SourceFormatBaseA, SourceFormatBaseA }, // 1 componentsPerPixel
+ { SourceFormatBaseNumFormats, SourceFormatBaseAR, SourceFormatBaseRA }, // 2 componentsPerPixel
+ { SourceFormatBaseRGB, SourceFormatBaseNumFormats, SourceFormatBaseNumFormats }, // 3 componentsPerPixel
+ { SourceFormatBaseNumFormats, SourceFormatBaseARGB, SourceFormatBaseRGBA } // 4 componentsPerPixel
+ };
+ const static GraphicsContext3D::SourceDataFormat formatTable[SourceFormatBaseNumFormats][3] = { // SourceDataFormatBase x bitsPerComponentAndEndian
+ // 8bits 16bits, little endian 16bits, big endian
+ { GraphicsContext3D::kSourceFormatR8, GraphicsContext3D::kSourceFormatR16Little, GraphicsContext3D::kSourceFormatR16Big },
+ { GraphicsContext3D::kSourceFormatA8, GraphicsContext3D::kSourceFormatA16Little, GraphicsContext3D::kSourceFormatA16Big },
+ { GraphicsContext3D::kSourceFormatRA8, GraphicsContext3D::kSourceFormatRA16Little, GraphicsContext3D::kSourceFormatRA16Big },
+ { GraphicsContext3D::kSourceFormatAR8, GraphicsContext3D::kSourceFormatAR16Little, GraphicsContext3D::kSourceFormatAR16Big },
+ { GraphicsContext3D::kSourceFormatRGB8, GraphicsContext3D::kSourceFormatRGB16Little, GraphicsContext3D::kSourceFormatRGB16Big },
+ { GraphicsContext3D::kSourceFormatRGBA8, GraphicsContext3D::kSourceFormatRGBA16Little, GraphicsContext3D::kSourceFormatRGBA16Big },
+ { GraphicsContext3D::kSourceFormatARGB8, GraphicsContext3D::kSourceFormatARGB16Little, GraphicsContext3D::kSourceFormatARGB16Big }
+ };
+
+ ASSERT(componentsPerPixel <= 4 && componentsPerPixel > 0);
+ SourceDataFormatBase formatBase = formatTableBase[componentsPerPixel - 1][alphaFormat];
+ if (formatBase == SourceFormatBaseNumFormats)
+ return GraphicsContext3D::kSourceFormatNumFormats;
+ if (!is16BitFormat)
+ return formatTable[formatBase][0];
+ if (!bigEndian)
+ return formatTable[formatBase][1];
+ return formatTable[formatBase][2];
+}
+
bool GraphicsContext3D::getImageData(Image* image,
unsigned int format,
unsigned int type,
@@ -62,6 +112,7 @@ bool GraphicsContext3D::getImageData(Image* image,
cgImage = image->nativeImageForCurrentFrame();
if (!cgImage)
return false;
+
size_t width = CGImageGetWidth(cgImage);
size_t height = CGImageGetHeight(cgImage);
if (!width || !height)
@@ -73,6 +124,7 @@ bool GraphicsContext3D::getImageData(Image* image,
if (bitsPerPixel % bitsPerComponent)
return false;
size_t componentsPerPixel = bitsPerPixel / bitsPerComponent;
+
bool srcByteOrder16Big = false;
if (bitsPerComponent == 16) {
CGBitmapInfo bitInfo = CGImageGetBitmapInfo(cgImage);
@@ -93,8 +145,9 @@ bool GraphicsContext3D::getImageData(Image* image,
return false;
}
}
- SourceDataFormat srcDataFormat = kSourceFormatRGBA8;
+
AlphaOp neededAlphaOp = kAlphaDoNothing;
+ AlphaFormat alphaFormat = AlphaFormatNone;
switch (CGImageGetAlphaInfo(cgImage)) {
case kCGImageAlphaPremultipliedFirst:
// This path is only accessible for MacOS earlier than 10.6.4.
@@ -103,68 +156,17 @@ bool GraphicsContext3D::getImageData(Image* image,
ASSERT(!image->data());
if (!premultiplyAlpha)
neededAlphaOp = kAlphaDoUnmultiply;
- switch (componentsPerPixel) {
- case 2:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatAR8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatAR16Big : kSourceFormatAR16Little;
- break;
- case 4:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatARGB8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatARGB16Big : kSourceFormatARGB16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaFirst:
// This path is only accessible for MacOS earlier than 10.6.4.
if (premultiplyAlpha)
neededAlphaOp = kAlphaDoPremultiply;
- switch (componentsPerPixel) {
- case 1:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatA16Big : kSourceFormatA16Little;
- break;
- case 2:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatAR8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatAR16Big : kSourceFormatAR16Little;
- break;
- case 4:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatARGB8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatARGB16Big : kSourceFormatARGB16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaNoneSkipFirst:
// This path is only accessible for MacOS earlier than 10.6.4.
- switch (componentsPerPixel) {
- case 2:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatAR8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatAR16Big : kSourceFormatAR16Little;
- break;
- case 4:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatARGB8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatARGB16Big : kSourceFormatARGB16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaPremultipliedLast:
// This is a special case for texImage2D with HTMLCanvasElement input,
@@ -172,88 +174,26 @@ bool GraphicsContext3D::getImageData(Image* image,
ASSERT(!image->data());
if (!premultiplyAlpha)
neededAlphaOp = kAlphaDoUnmultiply;
- switch (componentsPerPixel) {
- case 2:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRA16Big : kSourceFormatRA16Little;
- break;
- case 4:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRGBA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRGBA16Big : kSourceFormatRGBA16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaLast:
if (premultiplyAlpha)
neededAlphaOp = kAlphaDoPremultiply;
- switch (componentsPerPixel) {
- case 1:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatA16Big : kSourceFormatA16Little;
- break;
- case 2:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRA16Big : kSourceFormatRA16Little;
- break;
- case 4:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRGBA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRGBA16Big : kSourceFormatRGBA16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaNoneSkipLast:
- switch (componentsPerPixel) {
- case 2:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRA16Big : kSourceFormatRA16Little;
- break;
- case 4:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRGBA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRGBA16Big : kSourceFormatRGBA16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaNone:
- switch (componentsPerPixel) {
- case 1:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatR8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatR16Big : kSourceFormatR16Little;
- break;
- case 3:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRGB8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRGB16Big : kSourceFormatRGB16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatNone;
break;
default:
return false;
}
+ SourceDataFormat srcDataFormat = getSourceDataFormat(componentsPerPixel, alphaFormat, bitsPerComponent == 16, srcByteOrder16Big);
+ if (srcDataFormat == kSourceFormatNumFormats)
+ return false;
+
RetainPtr<CFDataRef> pixelData;
pixelData.adoptCF(CGDataProviderCopyData(CGImageGetDataProvider(cgImage)));
if (!pixelData)
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp
index f38273c..e73747f 100644
--- a/WebCore/platform/graphics/chromium/FontLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontLinux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2008, Google Inc. All rights reserved.
+ * Copyright (c) 2007, 2008, 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -220,8 +220,6 @@ public:
const FontPlatformData* fontPlatformDataForScriptRun() { return reinterpret_cast<FontPlatformData*>(m_item.font->userData); }
private:
- const TextRun& getTextRun(const TextRun&);
- const TextRun& getNormalizedTextRun(const TextRun&);
void setupFontForScriptRun();
HB_FontRec* allocHarfbuzzFont();
void deleteGlyphArrays();
@@ -229,7 +227,9 @@ private:
void resetGlyphArrays();
void shapeGlyphs();
void setGlyphXPositions(bool);
- void mirrorCharacters(UChar*, const UChar*, int) const;
+
+ static void normalizeSpacesAndMirrorChars(const UChar* source, bool rtl, UChar* destination, int length);
+ static const TextRun& getNormalizedTextRun(const TextRun& originalRun, OwnPtr<TextRun>& normalizedRun, OwnArrayPtr<UChar>& normalizedBuffer);
// This matches the logic in RenderBlock::findNextLineBreak
static bool isCodepointSpace(HB_UChar16 c) { return c == ' ' || c == '\t'; }
@@ -264,11 +264,13 @@ TextRunWalker::TextRunWalker(const TextRun& run, unsigned startingX, const Font*
: m_font(font)
, m_startingX(startingX)
, m_offsetX(m_startingX)
- , m_run(getTextRun(run))
+ , m_run(getNormalizedTextRun(run, m_normalizedRun, m_normalizedBuffer))
, m_iterateBackwards(m_run.rtl())
, m_wordSpacingAdjustment(0)
, m_padding(0)
+ , m_padPerWordBreak(0)
, m_padError(0)
+ , m_letterSpacing(0)
{
// Do not use |run| inside this constructor. Use |m_run| instead.
@@ -286,17 +288,8 @@ TextRunWalker::TextRunWalker(const TextRun& run, unsigned startingX, const Font*
m_item.item.bidiLevel = m_run.rtl();
- int length = m_run.length();
- m_item.stringLength = length;
-
- if (!m_item.item.bidiLevel)
- m_item.string = m_run.characters();
- else {
- // Assume mirrored character is in the same Unicode multilingual plane as the original one.
- UChar* string = new UChar[length];
- mirrorCharacters(string, m_run.characters(), length);
- m_item.string = string;
- }
+ m_item.string = m_run.characters();
+ m_item.stringLength = m_run.length();
reset();
}
@@ -306,8 +299,6 @@ TextRunWalker::~TextRunWalker()
fastFree(m_item.font);
deleteGlyphArrays();
delete[] m_item.log_clusters;
- if (m_item.item.bidiLevel)
- delete[] m_item.string;
}
bool TextRunWalker::isWordBreak(unsigned index, bool isRTL)
@@ -408,51 +399,6 @@ float TextRunWalker::widthOfFullRun()
return widthSum;
}
-const TextRun& TextRunWalker::getTextRun(const TextRun& originalRun)
-{
- // Normalize the text run in two ways:
- // 1) Convert the |originalRun| to NFC normalized form if combining diacritical marks
- // (U+0300..) are used in the run. This conversion is necessary since most OpenType
- // fonts (e.g., Arial) don't have substitution rules for the diacritical marks in
- // their GSUB tables.
- //
- // Note that we don't use the icu::Normalizer::isNormalized(UNORM_NFC) API here since
- // the API returns FALSE (= not normalized) for complex runs that don't require NFC
- // normalization (e.g., Arabic text). Unless the run contains the diacritical marks,
- // Harfbuzz will do the same thing for us using the GSUB table.
- // 2) Convert spacing characters into plain spaces, as some fonts will provide glyphs
- // for characters like '\n' otherwise.
- for (int i = 0; i < originalRun.length(); ++i) {
- UChar ch = originalRun[i];
- UBlockCode block = ::ublock_getCode(ch);
- if (block == UBLOCK_COMBINING_DIACRITICAL_MARKS || (Font::treatAsSpace(ch) && ch != ' '))
- return getNormalizedTextRun(originalRun);
- }
- return originalRun;
-}
-
-const TextRun& TextRunWalker::getNormalizedTextRun(const TextRun& originalRun)
-{
- icu::UnicodeString normalizedString;
- UErrorCode error = U_ZERO_ERROR;
- icu::Normalizer::normalize(icu::UnicodeString(originalRun.characters(), originalRun.length()), UNORM_NFC, 0 /* no options */, normalizedString, error);
- if (U_FAILURE(error))
- return originalRun;
-
- m_normalizedBuffer.set(new UChar[normalizedString.length() + 1]);
- normalizedString.extract(m_normalizedBuffer.get(), normalizedString.length() + 1, error);
- ASSERT(U_SUCCESS(error));
-
- for (int i = 0; i < normalizedString.length(); ++i) {
- if (Font::treatAsSpace(m_normalizedBuffer[i]))
- m_normalizedBuffer[i] = ' ';
- }
-
- m_normalizedRun.set(new TextRun(originalRun));
- m_normalizedRun->setText(m_normalizedBuffer.get(), normalizedString.length());
- return *m_normalizedRun;
-}
-
void TextRunWalker::setupFontForScriptRun()
{
const FontData* fontData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos], false, false).fontData;
@@ -595,7 +541,7 @@ void TextRunWalker::setGlyphXPositions(bool isRTL)
m_offsetX += m_pixelWidth;
}
-void TextRunWalker::mirrorCharacters(UChar* destination, const UChar* source, int length) const
+void TextRunWalker::normalizeSpacesAndMirrorChars(const UChar* source, bool rtl, UChar* destination, int length)
{
int position = 0;
bool error = false;
@@ -604,13 +550,68 @@ void TextRunWalker::mirrorCharacters(UChar* destination, const UChar* source, in
UChar32 character;
int nextPosition = position;
U16_NEXT(source, nextPosition, length, character);
- character = u_charMirror(character);
+ if (Font::treatAsSpace(character))
+ character = ' ';
+ else if (rtl)
+ character = u_charMirror(character);
U16_APPEND(destination, position, length, character, error);
ASSERT(!error);
position = nextPosition;
}
}
+const TextRun& TextRunWalker::getNormalizedTextRun(const TextRun& originalRun, OwnPtr<TextRun>& normalizedRun, OwnArrayPtr<UChar>& normalizedBuffer)
+{
+ // Normalize the text run in three ways:
+ // 1) Convert the |originalRun| to NFC normalized form if combining diacritical marks
+ // (U+0300..) are used in the run. This conversion is necessary since most OpenType
+ // fonts (e.g., Arial) don't have substitution rules for the diacritical marks in
+ // their GSUB tables.
+ //
+ // Note that we don't use the icu::Normalizer::isNormalized(UNORM_NFC) API here since
+ // the API returns FALSE (= not normalized) for complex runs that don't require NFC
+ // normalization (e.g., Arabic text). Unless the run contains the diacritical marks,
+ // Harfbuzz will do the same thing for us using the GSUB table.
+ // 2) Convert spacing characters into plain spaces, as some fonts will provide glyphs
+ // for characters like '\n' otherwise.
+ // 3) Convert mirrored characters such as parenthesis for rtl text.
+
+ // Convert to NFC form if the text has diacritical marks.
+ icu::UnicodeString normalizedString;
+ UErrorCode error = U_ZERO_ERROR;
+
+ for (int16_t i = 0; i < originalRun.length(); ++i) {
+ UChar ch = originalRun[i];
+ if (::ublock_getCode(ch) == UBLOCK_COMBINING_DIACRITICAL_MARKS) {
+ icu::Normalizer::normalize(icu::UnicodeString(originalRun.characters(),
+ originalRun.length()), UNORM_NFC, 0 /* no options */,
+ normalizedString, error);
+ if (U_FAILURE(error))
+ return originalRun;
+ break;
+ }
+ }
+
+ // Normalize space and mirror parenthesis for rtl text.
+ int normalizedBufferLength;
+ const UChar* sourceText;
+ if (normalizedString.isEmpty()) {
+ normalizedBufferLength = originalRun.length();
+ sourceText = originalRun.characters();
+ } else {
+ normalizedBufferLength = normalizedString.length();
+ sourceText = normalizedString.getBuffer();
+ }
+
+ normalizedBuffer.set(new UChar[normalizedBufferLength + 1]);
+
+ normalizeSpacesAndMirrorChars(sourceText, originalRun.rtl(), normalizedBuffer.get(), normalizedBufferLength);
+
+ normalizedRun.set(new TextRun(originalRun));
+ normalizedRun->setText(normalizedBuffer.get(), normalizedBufferLength);
+ return *normalizedRun;
+}
+
static void setupForTextPainting(SkPaint* paint, SkColor color)
{
paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding);
diff --git a/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h b/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
index beac0bf..c59cb56 100644
--- a/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
+++ b/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
@@ -102,7 +102,7 @@ private:
HFONT hfont() const { return m_hfont; }
unsigned hash() const
{
- return StringImpl::computeHash(reinterpret_cast<const UChar*>(&m_hfont), sizeof(HFONT) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(HFONT)>(&m_hfont);
}
bool operator==(const RefCountedHFONT& other) const
diff --git a/WebCore/platform/graphics/chromium/LayerChromium.cpp b/WebCore/platform/graphics/chromium/LayerChromium.cpp
index 79f18f0..f668bbf 100644
--- a/WebCore/platform/graphics/chromium/LayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/LayerChromium.cpp
@@ -176,8 +176,10 @@ void LayerChromium::setLayerRenderer(LayerRendererChromium* renderer)
{
// If we're changing layer renderers then we need to free up any resources
// allocated by the old renderer.
- if (layerRenderer() && layerRenderer() != renderer)
+ if (layerRenderer() && layerRenderer() != renderer) {
cleanupResources();
+ setNeedsDisplay();
+ }
m_layerRenderer = renderer;
}
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
index 6a06105..b2a32ee 100644
--- a/WebCore/platform/graphics/chromium/LayerRendererChromium.h
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
@@ -82,6 +82,7 @@ public:
void setRootLayer(PassRefPtr<LayerChromium> layer) { m_rootLayer = layer; }
LayerChromium* rootLayer() { return m_rootLayer.get(); }
+ void transferRootLayer(LayerRendererChromium* other) { other->m_rootLayer = m_rootLayer.release(); }
bool hardwareCompositing() const { return m_hardwareCompositing; }
diff --git a/WebCore/platform/graphics/cocoa/FontPlatformData.h b/WebCore/platform/graphics/cocoa/FontPlatformData.h
index 034e23b..17ae4b5 100644
--- a/WebCore/platform/graphics/cocoa/FontPlatformData.h
+++ b/WebCore/platform/graphics/cocoa/FontPlatformData.h
@@ -24,6 +24,7 @@
#ifndef FontPlatformData_h
#define FontPlatformData_h
+#include "FontOrientation.h"
#include <wtf/text/StringImpl.h>
#ifdef __OBJC__
@@ -58,9 +59,10 @@ inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef
class FontPlatformData {
public:
- FontPlatformData(float size, bool syntheticBold, bool syntheticOblique)
+ FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation = Horizontal)
: m_syntheticBold(syntheticBold)
, m_syntheticOblique(syntheticOblique)
+ , m_orientation(orientation)
, m_atsuFontID(0)
, m_size(size)
, m_font(0)
@@ -71,11 +73,12 @@ class FontPlatformData {
{
}
- FontPlatformData(NSFont *nsFont, bool syntheticBold = false, bool syntheticOblique = false);
+ FontPlatformData(NSFont *nsFont, bool syntheticBold = false, bool syntheticOblique = false, FontOrientation = Horizontal);
- FontPlatformData(CGFontRef cgFont, ATSUFontID fontID, float size, bool syntheticBold, bool syntheticOblique)
+ FontPlatformData(CGFontRef cgFont, ATSUFontID fontID, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation)
: m_syntheticBold(syntheticBold)
, m_syntheticOblique(syntheticOblique)
+ , m_orientation(orientation)
, m_atsuFontID(fontID)
, m_size(size)
, m_font(0)
@@ -94,9 +97,11 @@ class FontPlatformData {
float size() const { return m_size; }
bool syntheticBold() const { return m_syntheticBold; }
bool syntheticOblique() const { return m_syntheticOblique; }
+ FontOrientation orientation() const { return m_orientation; }
bool m_syntheticBold;
bool m_syntheticOblique;
+ FontOrientation m_orientation;
ATSUFontID m_atsuFontID;
float m_size;
@@ -104,8 +109,8 @@ class FontPlatformData {
unsigned hash() const
{
ASSERT(m_font != 0 || m_cgFont == 0);
- uintptr_t hashCodes[2] = { (uintptr_t)m_font, m_syntheticBold << 1 | m_syntheticOblique };
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ uintptr_t hashCodes[2] = { (uintptr_t)m_font, m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique };
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
const FontPlatformData& operator=(const FontPlatformData& f);
@@ -113,15 +118,13 @@ class FontPlatformData {
bool operator==(const FontPlatformData& other) const
{
return m_font == other.m_font && m_syntheticBold == other.m_syntheticBold && m_syntheticOblique == other.m_syntheticOblique &&
- m_cgFont == other.m_cgFont && m_size == other.m_size && m_atsuFontID == other.m_atsuFontID;
+ m_cgFont == other.m_cgFont && m_size == other.m_size && m_atsuFontID == other.m_atsuFontID && m_orientation == other.m_orientation;
}
NSFont *font() const { return m_font; }
void setFont(NSFont *font);
-#if USE(CORE_TEXT)
CTFontRef ctFont() const;
-#endif
bool roundsGlyphAdvances() const;
bool allowsLigatures() const;
@@ -157,9 +160,7 @@ private:
CGFontRef m_cgFont; // It is not necessary to refcount this, since either an NSFont owns it or some CachedFont has it referenced.
#endif
-#if USE(CORE_TEXT)
mutable RetainPtr<CTFontRef> m_CTFont;
-#endif
bool m_isColorBitmapFont;
diff --git a/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm b/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
index bd49dcc..dbfec5f 100644
--- a/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
+++ b/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
@@ -44,7 +44,7 @@ void FontPlatformData::loadFont(NSFont* nsFont, float, NSFont*& outNSFont, CGFon
}
#endif // PLATFORM(MAC)
-FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool syntheticOblique)
+FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool syntheticOblique, FontOrientation orientation)
: m_syntheticBold(syntheticBold)
, m_syntheticOblique(syntheticOblique)
, m_font(nsFont)
@@ -63,6 +63,26 @@ FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool synt
CGFontRef cgFont = 0;
loadFont(nsFont, m_size, m_font, cgFont, m_atsuFontID);
+ if (orientation == Vertical) {
+ // Ignore vertical orientation when the font doesn't support vertical metrics.
+ // The check doesn't look neat but this is what AppKit does for vertical writing...
+ RetainPtr<CFArrayRef> tableTags(AdoptCF, CTFontCopyAvailableTables(ctFont(), kCTFontTableOptionExcludeSynthetic));
+ CFIndex numTables = CFArrayGetCount(tableTags.get());
+ bool found = false;
+ for (CFIndex index = 0; index < numTables; ++index) {
+ CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tableTags.get(), index);
+ if (tag == kCTFontTableVhea || tag == kCTFontTableVORG) {
+ found = true;
+ break;
+ }
+ }
+
+ if (found == false)
+ orientation = Horizontal;
+ }
+
+ m_orientation = orientation;
+
if (m_font)
CFRetain(m_font);
@@ -83,9 +103,8 @@ FontPlatformData::FontPlatformData(const FontPlatformData& f)
m_cgFont = f.m_cgFont;
m_atsuFontID = f.m_atsuFontID;
m_isColorBitmapFont = f.m_isColorBitmapFont;
-#if USE(CORE_TEXT)
+ m_orientation = f.m_orientation;
m_CTFont = f.m_CTFont;
-#endif
#if PLATFORM(CHROMIUM) && OS(DARWIN)
m_inMemoryFont = f.m_inMemoryFont;
#endif
@@ -112,9 +131,8 @@ const FontPlatformData& FontPlatformData::operator=(const FontPlatformData& f)
CFRelease(m_font);
m_font = f.m_font;
m_isColorBitmapFont = f.m_isColorBitmapFont;
-#if USE(CORE_TEXT)
+ m_orientation = f.m_orientation;
m_CTFont = f.m_CTFont;
-#endif
#if PLATFORM(CHROMIUM) && OS(DARWIN)
m_inMemoryFont = f.m_inMemoryFont;
#endif
@@ -157,9 +175,7 @@ void FontPlatformData::setFont(NSFont *font)
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
m_isColorBitmapFont = CTFontGetSymbolicTraits(toCTFontRef(m_font)) & kCTFontColorGlyphsTrait;
#endif
-#if USE(CORE_TEXT)
m_CTFont = 0;
-#endif
}
bool FontPlatformData::roundsGlyphAdvances() const
@@ -169,10 +185,9 @@ bool FontPlatformData::roundsGlyphAdvances() const
bool FontPlatformData::allowsLigatures() const
{
- return ![[m_font coveredCharacterSet] characterIsMember:'a'];
+ return m_orientation == Horizontal && ![[m_font coveredCharacterSet] characterIsMember:'a'];
}
-#if USE(CORE_TEXT)
CTFontRef FontPlatformData::ctFont() const
{
if (m_font)
@@ -181,13 +196,13 @@ CTFontRef FontPlatformData::ctFont() const
m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, 0));
return m_CTFont.get();
}
-#endif // USE(CORE_TEXT)
#ifndef NDEBUG
String FontPlatformData::description() const
{
RetainPtr<CFStringRef> cgFontDescription(AdoptCF, CFCopyDescription(cgFont()));
- return String(cgFontDescription.get()) + " " + String::number(m_size) + (m_syntheticBold ? " synthetic bold" : "") + (m_syntheticOblique ? " synthetic oblique" : "");
+ return String(cgFontDescription.get()) + " " + String::number(m_size)
+ + (m_syntheticBold ? " synthetic bold" : "") + (m_syntheticOblique ? " synthetic oblique" : "") + (m_orientation ? " vertical orientation" : "");
}
#endif
diff --git a/WebCore/platform/graphics/filters/FEBlend.cpp b/WebCore/platform/graphics/filters/FEBlend.cpp
index 1a40027..03b95c3 100644
--- a/WebCore/platform/graphics/filters/FEBlend.cpp
+++ b/WebCore/platform/graphics/filters/FEBlend.cpp
@@ -95,26 +95,30 @@ void FEBlend::apply(Filter* filter)
if (!in->resultImage() || !in2->resultImage())
return;
- if (m_mode == FEBLEND_MODE_UNKNOWN)
+ if (m_mode <= FEBLEND_MODE_UNKNOWN || m_mode > FEBLEND_MODE_LIGHTEN)
return;
if (!effectContext(filter))
return;
IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
- RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
+ RefPtr<ImageData> srcImageDataA = in->resultImage()->getPremultipliedImageData(effectADrawingRect);
+ ByteArray* srcPixelArrayA = srcImageDataA->data()->data();
IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
- RefPtr<CanvasPixelArray> srcPixelArrayB(in2->resultImage()->getPremultipliedImageData(effectBDrawingRect)->data());
+ RefPtr<ImageData> srcImageDataB = in2->resultImage()->getPremultipliedImageData(effectBDrawingRect);
+ ByteArray* srcPixelArrayB = srcImageDataB->data()->data();
IntRect imageRect(IntPoint(), resultImage()->size());
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
+ ByteArray* dstPixelArray = imageData->data()->data();
// Keep synchronized with BlendModeType
static const BlendType callEffect[] = {unknown, normal, multiply, screen, darken, lighten};
- ASSERT(srcPixelArrayA->length() == srcPixelArrayB->length());
- for (unsigned pixelOffset = 0; pixelOffset < srcPixelArrayA->length(); pixelOffset += 4) {
+ unsigned pixelArrayLength = srcPixelArrayA->length();
+ ASSERT(pixelArrayLength == srcPixelArrayB->length());
+ for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
unsigned char alphaA = srcPixelArrayA->get(pixelOffset + 3);
unsigned char alphaB = srcPixelArrayB->get(pixelOffset + 3);
for (unsigned channel = 0; channel < 3; ++channel) {
@@ -122,10 +126,10 @@ void FEBlend::apply(Filter* filter)
unsigned char colorB = srcPixelArrayB->get(pixelOffset + channel);
unsigned char result = (*callEffect[m_mode])(colorA, colorB, alphaA, alphaB);
- imageData->data()->set(pixelOffset + channel, result);
+ dstPixelArray->set(pixelOffset + channel, result);
}
unsigned char alphaR = 255 - ((255 - alphaA) * (255 - alphaB)) / 255;
- imageData->data()->set(pixelOffset + 3, alphaR);
+ dstPixelArray->set(pixelOffset + 3, alphaR);
}
resultImage()->putPremultipliedImageData(imageData.get(), imageRect, IntPoint());
diff --git a/WebCore/platform/graphics/filters/FEColorMatrix.cpp b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
index b41d5ad..acf7d4a 100644
--- a/WebCore/platform/graphics/filters/FEColorMatrix.cpp
+++ b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
@@ -25,11 +25,10 @@
#if ENABLE(FILTERS)
#include "FEColorMatrix.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "GraphicsContext.h"
#include "ImageData.h"
-#include <math.h>
+
#include <wtf/MathExtras.h>
namespace WebCore {
@@ -112,25 +111,21 @@ inline void huerotate(double& red, double& green, double& blue, const float& hue
inline void luminance(double& red, double& green, double& blue, double& alpha)
{
alpha = 0.2125 * red + 0.7154 * green + 0.0721 * blue;
- red = 0.;
- green = 0.;
- blue = 0.;
+ red = 0;
+ green = 0;
+ blue = 0;
}
template<ColorMatrixType filterType>
-void effectType(const PassRefPtr<CanvasPixelArray>& srcPixelArray, PassRefPtr<ImageData>& imageData, const Vector<float>& values)
+void effectType(ByteArray* pixelArray, const Vector<float>& values)
{
- for (unsigned pixelOffset = 0; pixelOffset < srcPixelArray->length(); pixelOffset++) {
- unsigned pixelByteOffset = pixelOffset * 4;
-
- unsigned char r = 0, g = 0, b = 0, a = 0;
- srcPixelArray->get(pixelByteOffset, r);
- srcPixelArray->get(pixelByteOffset + 1, g);
- srcPixelArray->get(pixelByteOffset + 2, b);
- srcPixelArray->get(pixelByteOffset + 3, a);
+ unsigned pixelArrayLength = pixelArray->length();
+ for (unsigned pixelByteOffset = 0; pixelByteOffset < pixelArrayLength; pixelByteOffset += 4) {
+ double red = pixelArray->get(pixelByteOffset);
+ double green = pixelArray->get(pixelByteOffset + 1);
+ double blue = pixelArray->get(pixelByteOffset + 2);
+ double alpha = pixelArray->get(pixelByteOffset + 3);
- double red = r, green = g, blue = b, alpha = a;
-
switch (filterType) {
case FECOLORMATRIX_TYPE_MATRIX:
matrix(red, green, blue, alpha, values);
@@ -146,10 +141,10 @@ void effectType(const PassRefPtr<CanvasPixelArray>& srcPixelArray, PassRefPtr<Im
break;
}
- imageData->data()->set(pixelByteOffset, red);
- imageData->data()->set(pixelByteOffset + 1, green);
- imageData->data()->set(pixelByteOffset + 2, blue);
- imageData->data()->set(pixelByteOffset + 3, alpha);
+ pixelArray->set(pixelByteOffset, red);
+ pixelArray->set(pixelByteOffset + 1, green);
+ pixelArray->set(pixelByteOffset + 2, blue);
+ pixelArray->set(pixelByteOffset + 3, alpha);
}
}
@@ -167,23 +162,23 @@ void FEColorMatrix::apply(Filter* filter)
filterContext->drawImageBuffer(in->resultImage(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
IntRect imageRect(IntPoint(), resultImage()->size());
- PassRefPtr<ImageData> imageData(resultImage()->getUnmultipliedImageData(imageRect));
- PassRefPtr<CanvasPixelArray> srcPixelArray(imageData->data());
+ RefPtr<ImageData> imageData = resultImage()->getUnmultipliedImageData(imageRect);
+ ByteArray* pixelArray = imageData->data()->data();
switch (m_type) {
case FECOLORMATRIX_TYPE_UNKNOWN:
break;
case FECOLORMATRIX_TYPE_MATRIX:
- effectType<FECOLORMATRIX_TYPE_MATRIX>(srcPixelArray, imageData, m_values);
+ effectType<FECOLORMATRIX_TYPE_MATRIX>(pixelArray, m_values);
break;
case FECOLORMATRIX_TYPE_SATURATE:
- effectType<FECOLORMATRIX_TYPE_SATURATE>(srcPixelArray, imageData, m_values);
+ effectType<FECOLORMATRIX_TYPE_SATURATE>(pixelArray, m_values);
break;
case FECOLORMATRIX_TYPE_HUEROTATE:
- effectType<FECOLORMATRIX_TYPE_HUEROTATE>(srcPixelArray, imageData, m_values);
+ effectType<FECOLORMATRIX_TYPE_HUEROTATE>(pixelArray, m_values);
break;
case FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
- effectType<FECOLORMATRIX_TYPE_LUMINANCETOALPHA>(srcPixelArray, imageData, m_values);
+ effectType<FECOLORMATRIX_TYPE_LUMINANCETOALPHA>(pixelArray, m_values);
setIsAlphaImage(true);
break;
}
diff --git a/WebCore/platform/graphics/filters/FEComponentTransfer.cpp b/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
index 08d0b1f..5cffac7 100644
--- a/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
+++ b/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
@@ -26,11 +26,11 @@
#if ENABLE(FILTERS)
#include "FEComponentTransfer.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "GraphicsContext.h"
#include "ImageData.h"
-#include <math.h>
+
+#include <wtf/MathExtras.h>
namespace WebCore {
@@ -168,13 +168,14 @@ void FEComponentTransfer::apply(Filter* filter)
(*callEffect[transferFunction[channel].type])(tables[channel], transferFunction[channel]);
IntRect drawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
- RefPtr<ImageData> imageData(in->resultImage()->getUnmultipliedImageData(drawingRect));
- CanvasPixelArray* srcPixelArray(imageData->data());
+ RefPtr<ImageData> imageData = in->resultImage()->getUnmultipliedImageData(drawingRect);
+ ByteArray* pixelArray = imageData->data()->data();
- for (unsigned pixelOffset = 0; pixelOffset < srcPixelArray->length(); pixelOffset += 4) {
+ unsigned pixelArrayLength = pixelArray->length();
+ for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
for (unsigned channel = 0; channel < 4; ++channel) {
- unsigned char c = srcPixelArray->get(pixelOffset + channel);
- imageData->data()->set(pixelOffset + channel, tables[channel][c]);
+ unsigned char c = pixelArray->get(pixelOffset + channel);
+ pixelArray->set(pixelOffset + channel, tables[channel][c]);
}
}
diff --git a/WebCore/platform/graphics/filters/FEComposite.cpp b/WebCore/platform/graphics/filters/FEComposite.cpp
index 2326966..aad71e3 100644
--- a/WebCore/platform/graphics/filters/FEComposite.cpp
+++ b/WebCore/platform/graphics/filters/FEComposite.cpp
@@ -26,7 +26,6 @@
#if ENABLE(FILTERS)
#include "FEComposite.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "GraphicsContext.h"
#include "ImageData.h"
@@ -98,12 +97,13 @@ void FEComposite::setK4(float k4)
m_k4 = k4;
}
-inline void arithmetic(const RefPtr<CanvasPixelArray>& srcPixelArrayA, CanvasPixelArray*& srcPixelArrayB,
+inline void arithmetic(const ByteArray* srcPixelArrayA, ByteArray* srcPixelArrayB,
float k1, float k2, float k3, float k4)
{
float scaledK1 = k1 / 255.f;
float scaledK4 = k4 * 255.f;
- for (unsigned pixelOffset = 0; pixelOffset < srcPixelArrayA->length(); pixelOffset += 4) {
+ unsigned pixelArrayLength = srcPixelArrayA->length();
+ for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
for (unsigned channel = 0; channel < 4; ++channel) {
unsigned char i1 = srcPixelArrayA->get(pixelOffset + channel);
unsigned char i2 = srcPixelArrayB->get(pixelOffset + channel);
@@ -174,11 +174,12 @@ void FEComposite::apply(Filter* filter)
break;
case FECOMPOSITE_OPERATOR_ARITHMETIC: {
IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
- RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
+ RefPtr<ImageData> srcImageData = in->resultImage()->getPremultipliedImageData(effectADrawingRect);
+ ByteArray* srcPixelArrayA = srcImageData->data()->data();
IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
- RefPtr<ImageData> imageData(in2->resultImage()->getPremultipliedImageData(effectBDrawingRect));
- CanvasPixelArray* srcPixelArrayB(imageData->data());
+ RefPtr<ImageData> imageData = in2->resultImage()->getPremultipliedImageData(effectBDrawingRect);
+ ByteArray* srcPixelArrayB = imageData->data()->data();
arithmetic(srcPixelArrayA, srcPixelArrayB, m_k1, m_k2, m_k3, m_k4);
resultImage()->putPremultipliedImageData(imageData.get(), IntRect(IntPoint(), resultImage()->size()), IntPoint());
diff --git a/WebCore/platform/graphics/filters/FEDisplacementMap.cpp b/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
index 0c53241..4c62ca7 100644
--- a/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
+++ b/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
@@ -26,7 +26,6 @@
#if ENABLE(FILTERS)
#include "FEDisplacementMap.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "GraphicsContext.h"
#include "ImageData.h"
@@ -93,13 +92,16 @@ void FEDisplacementMap::apply(Filter* filter)
return;
IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
- RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
+ RefPtr<ImageData> srcImageDataA = in->resultImage()->getPremultipliedImageData(effectADrawingRect);
+ ByteArray* srcPixelArrayA = srcImageDataA->data()->data() ;
IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
- RefPtr<CanvasPixelArray> srcPixelArrayB(in2->resultImage()->getUnmultipliedImageData(effectBDrawingRect)->data());
+ RefPtr<ImageData> srcImageDataB = in2->resultImage()->getUnmultipliedImageData(effectBDrawingRect);
+ ByteArray* srcPixelArrayB = srcImageDataB->data()->data();
IntRect imageRect(IntPoint(), resultImage()->size());
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
+ ByteArray* dstPixelArray = imageData->data()->data();
ASSERT(srcPixelArrayA->length() == srcPixelArrayB->length());
@@ -116,10 +118,10 @@ void FEDisplacementMap::apply(Filter* filter)
int srcY = y + static_cast<int>(scaleY * srcPixelArrayB->get(dstIndex + m_yChannelSelector - 1) + scaleAdjustmentY);
for (unsigned channel = 0; channel < 4; ++channel) {
if (srcX < 0 || srcX >= imageRect.width() || srcY < 0 || srcY >= imageRect.height())
- imageData->data()->set(dstIndex + channel, static_cast<unsigned char>(0));
+ dstPixelArray->set(dstIndex + channel, static_cast<unsigned char>(0));
else {
unsigned char pixelValue = srcPixelArrayA->get(srcY * stride + srcX * 4 + channel);
- imageData->data()->set(dstIndex + channel, pixelValue);
+ dstPixelArray->set(dstIndex + channel, pixelValue);
}
}
diff --git a/WebCore/platform/graphics/filters/FEGaussianBlur.cpp b/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
index 1f36ba7..bb70537 100644
--- a/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
+++ b/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
@@ -27,10 +27,10 @@
#if ENABLE(FILTERS)
#include "FEGaussianBlur.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "GraphicsContext.h"
#include "ImageData.h"
+
#include <wtf/MathExtras.h>
using std::max;
@@ -72,7 +72,7 @@ void FEGaussianBlur::setStdDeviationY(float y)
m_stdY = y;
}
-static void boxBlur(CanvasPixelArray*& srcPixelArray, CanvasPixelArray*& dstPixelArray,
+inline void boxBlur(ByteArray* srcPixelArray, ByteArray* dstPixelArray,
unsigned dx, int dxLeft, int dxRight, int stride, int strideLine, int effectWidth, int effectHeight, bool alphaImage)
{
for (int y = 0; y < effectHeight; ++y) {
@@ -175,7 +175,7 @@ void FEGaussianBlur::apply(Filter* filter)
setIsAlphaImage(in->isAlphaImage());
IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
- RefPtr<ImageData> srcImageData(in->resultImage()->getPremultipliedImageData(effectDrawingRect));
+ RefPtr<ImageData> srcImageData = in->resultImage()->getPremultipliedImageData(effectDrawingRect);
IntRect imageRect(IntPoint(), resultImage()->size());
if (!m_stdX && !m_stdY) {
@@ -187,9 +187,9 @@ void FEGaussianBlur::apply(Filter* filter)
unsigned kernelSizeY = 0;
calculateKernelSize(filter, kernelSizeX, kernelSizeY, m_stdX, m_stdY);
- CanvasPixelArray* srcPixelArray(srcImageData->data());
+ ByteArray* srcPixelArray = srcImageData->data()->data();
RefPtr<ImageData> tmpImageData = ImageData::create(imageRect.width(), imageRect.height());
- CanvasPixelArray* tmpPixelArray(tmpImageData->data());
+ ByteArray* tmpPixelArray = tmpImageData->data()->data();
int stride = 4 * imageRect.width();
int dxLeft = 0;
@@ -201,7 +201,7 @@ void FEGaussianBlur::apply(Filter* filter)
kernelPosition(i, kernelSizeX, dxLeft, dxRight);
boxBlur(srcPixelArray, tmpPixelArray, kernelSizeX, dxLeft, dxRight, 4, stride, imageRect.width(), imageRect.height(), isAlphaImage());
} else {
- CanvasPixelArray* auxPixelArray = tmpPixelArray;
+ ByteArray* auxPixelArray = tmpPixelArray;
tmpPixelArray = srcPixelArray;
srcPixelArray = auxPixelArray;
}
@@ -210,7 +210,7 @@ void FEGaussianBlur::apply(Filter* filter)
kernelPosition(i, kernelSizeY, dyLeft, dyRight);
boxBlur(tmpPixelArray, srcPixelArray, kernelSizeY, dyLeft, dyRight, stride, 4, imageRect.height(), imageRect.width(), isAlphaImage());
} else {
- CanvasPixelArray* auxPixelArray = tmpPixelArray;
+ ByteArray* auxPixelArray = tmpPixelArray;
tmpPixelArray = srcPixelArray;
srcPixelArray = auxPixelArray;
}
diff --git a/WebCore/platform/graphics/filters/FEMorphology.cpp b/WebCore/platform/graphics/filters/FEMorphology.cpp
index ac26441..0b67f9a 100644
--- a/WebCore/platform/graphics/filters/FEMorphology.cpp
+++ b/WebCore/platform/graphics/filters/FEMorphology.cpp
@@ -26,7 +26,6 @@
#if ENABLE(FILTERS)
#include "FEMorphology.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "ImageData.h"
@@ -108,8 +107,10 @@ void FEMorphology::apply(Filter* filter)
IntRect imageRect(IntPoint(), resultImage()->size());
IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
- RefPtr<CanvasPixelArray> srcPixelArray(in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data());
+ RefPtr<ImageData> srcImageData = in->resultImage()->getPremultipliedImageData(effectDrawingRect);
+ ByteArray* srcPixelArray = srcImageData->data()->data();
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
+ ByteArray* dstPixelArray = imageData->data()->data();
int effectWidth = effectDrawingRect.width() * 4;
@@ -155,7 +156,7 @@ void FEMorphology::apply(Filter* filter)
(m_type == FEMORPHOLOGY_OPERATOR_DILATE && extrema[kernelIndex] >= entireExtrema))
entireExtrema = extrema[kernelIndex];
}
- imageData->data()->set(y * effectWidth + 4 * x + channel, entireExtrema);
+ dstPixelArray->set(y * effectWidth + 4 * x + channel, entireExtrema);
}
}
}
diff --git a/WebCore/platform/graphics/filters/FETile.cpp b/WebCore/platform/graphics/filters/FETile.cpp
index a695d3b..57160ed 100644
--- a/WebCore/platform/graphics/filters/FETile.cpp
+++ b/WebCore/platform/graphics/filters/FETile.cpp
@@ -41,14 +41,6 @@ PassRefPtr<FETile> FETile::create()
return adoptRef(new FETile);
}
-FloatRect FETile::determineFilterPrimitiveSubregion(Filter* filter)
-{
- inputEffect(0)->determineFilterPrimitiveSubregion(filter);
-
- filter->determineFilterPrimitiveSubregion(this, filter->filterRegionInUserSpace());
- return filterPrimitiveSubregion();
-}
-
void FETile::apply(Filter* filter)
{
// FIXME: See bug 47315. This is a hack to work around a compile failure, but is incorrect behavior otherwise.
diff --git a/WebCore/platform/graphics/filters/FETile.h b/WebCore/platform/graphics/filters/FETile.h
index 8562c90..5f21433 100644
--- a/WebCore/platform/graphics/filters/FETile.h
+++ b/WebCore/platform/graphics/filters/FETile.h
@@ -37,10 +37,10 @@ public:
virtual void determineAbsolutePaintRect(Filter*) { setAbsolutePaintRect(maxEffectRect()); }
+ virtual FilterEffectType filterEffectType() const { return FilterEffectTypeTile; }
+
virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
-
private:
FETile();
};
diff --git a/WebCore/platform/graphics/filters/FETurbulence.cpp b/WebCore/platform/graphics/filters/FETurbulence.cpp
index b1494a5..9ad27cf 100644
--- a/WebCore/platform/graphics/filters/FETurbulence.cpp
+++ b/WebCore/platform/graphics/filters/FETurbulence.cpp
@@ -26,7 +26,6 @@
#if ENABLE(FILTERS)
#include "FETurbulence.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "ImageData.h"
@@ -329,6 +328,7 @@ void FETurbulence::apply(Filter* filter)
return;
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
+ ByteArray* pixelArray = imageData->data()->data();
PaintingData paintingData(m_seed, roundedIntSize(filterPrimitiveSubregion().size()));
initPaint(paintingData);
@@ -342,7 +342,7 @@ void FETurbulence::apply(Filter* filter)
for (int x = 0; x < imageRect.width(); ++x) {
point.setX(point.x() + 1);
for (paintingData.channel = 0; paintingData.channel < 4; ++paintingData.channel, ++indexOfPixelChannel)
- imageData->data()->set(indexOfPixelChannel, calculateTurbulenceValueForPoint(paintingData, filter->mapAbsolutePointToLocalPoint(point)));
+ pixelArray->set(indexOfPixelChannel, calculateTurbulenceValueForPoint(paintingData, filter->mapAbsolutePointToLocalPoint(point)));
}
}
resultImage()->putUnmultipliedImageData(imageData.get(), imageRect, IntPoint());
diff --git a/WebCore/platform/graphics/filters/Filter.h b/WebCore/platform/graphics/filters/Filter.h
index 121e389..33cf724 100644
--- a/WebCore/platform/graphics/filters/Filter.h
+++ b/WebCore/platform/graphics/filters/Filter.h
@@ -52,12 +52,8 @@ namespace WebCore {
virtual FloatPoint mapAbsolutePointToLocalPoint(const FloatPoint&) const { return FloatPoint(); }
- // SVG specific
- virtual void determineFilterPrimitiveSubregion(FilterEffect*, const FloatRect&) { }
-
virtual FloatRect filterRegionInUserSpace() const { return FloatRect(); }
- virtual FloatSize maxImageSize() const = 0;
virtual bool effectBoundingBoxMode() const = 0;
private:
diff --git a/WebCore/platform/graphics/filters/FilterEffect.cpp b/WebCore/platform/graphics/filters/FilterEffect.cpp
index 121b921..ad351a5 100644
--- a/WebCore/platform/graphics/filters/FilterEffect.cpp
+++ b/WebCore/platform/graphics/filters/FilterEffect.cpp
@@ -39,23 +39,6 @@ FilterEffect::~FilterEffect()
{
}
-FloatRect FilterEffect::determineFilterPrimitiveSubregion(Filter* filter)
-{
- FloatRect uniteRect;
- unsigned size = m_inputEffects.size();
-
- // FETurbulence, FEImage and FEFlood don't have input effects, take the filter region as unite rect.
- if (!size)
- uniteRect = filter->filterRegionInUserSpace();
- else {
- for (unsigned i = 0; i < size; ++i)
- uniteRect.unite(m_inputEffects.at(i)->determineFilterPrimitiveSubregion(filter));
- }
-
- filter->determineFilterPrimitiveSubregion(this, uniteRect);
- return m_filterPrimitiveSubregion;
-}
-
void FilterEffect::determineAbsolutePaintRect(Filter*)
{
m_absolutePaintRect = IntRect();
diff --git a/WebCore/platform/graphics/filters/FilterEffect.h b/WebCore/platform/graphics/filters/FilterEffect.h
index a614b59..25db57b 100644
--- a/WebCore/platform/graphics/filters/FilterEffect.h
+++ b/WebCore/platform/graphics/filters/FilterEffect.h
@@ -99,9 +99,6 @@ public:
bool hasHeight() const { return m_hasHeight; }
void setHasHeight(bool value) { m_hasHeight = value; }
- // FIXME: FETile still needs special handling.
- virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
-
FloatRect filterPrimitiveSubregion() const { return m_filterPrimitiveSubregion; }
void setFilterPrimitiveSubregion(const FloatRect& filterPrimitiveSubregion) { m_filterPrimitiveSubregion = filterPrimitiveSubregion; }
diff --git a/WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp b/WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp
index d5f3173..a158689 100644
--- a/WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp
+++ b/WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp
@@ -30,7 +30,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
{
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
{
return FontPlatformData(m_fontFace, size, bold, italic);
}
diff --git a/WebCore/platform/graphics/gtk/FontPlatformDataPango.h b/WebCore/platform/graphics/gtk/FontPlatformDataPango.h
index 7b1e51f..c42af7f 100644
--- a/WebCore/platform/graphics/gtk/FontPlatformDataPango.h
+++ b/WebCore/platform/graphics/gtk/FontPlatformDataPango.h
@@ -71,7 +71,7 @@ public:
unsigned hash() const
{
uintptr_t hashCodes[1] = { reinterpret_cast<uintptr_t>(m_scaledFont) };
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
bool operator==(const FontPlatformData&) const;
diff --git a/WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp b/WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp
index 4b39fdd..ce7ec46 100644
--- a/WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp
@@ -31,7 +31,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
{
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
{
return FontPlatformData(size, bold, italic);
}
diff --git a/WebCore/platform/graphics/haiku/FontCustomPlatformData.h b/WebCore/platform/graphics/haiku/FontCustomPlatformData.h
index a7dfe37..cc348e3 100644
--- a/WebCore/platform/graphics/haiku/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/haiku/FontCustomPlatformData.h
@@ -21,6 +21,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
@@ -37,7 +38,7 @@ namespace WebCore {
static bool supportsFormat(const String&);
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
};
FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer*);
diff --git a/WebCore/platform/graphics/mac/FontCacheMac.mm b/WebCore/platform/graphics/mac/FontCacheMac.mm
index 0747dd7..313db1c 100644
--- a/WebCore/platform/graphics/mac/FontCacheMac.mm
+++ b/WebCore/platform/graphics/mac/FontCacheMac.mm
@@ -142,7 +142,8 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons
FontPlatformData alternateFont(substituteFont,
!font.isPlatformFont() && isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(substituteFontWeight),
- !font.isPlatformFont() && (traits & NSFontItalicTrait) && !(substituteFontTraits & NSFontItalicTrait));
+ !font.isPlatformFont() && (traits & NSFontItalicTrait) && !(substituteFontTraits & NSFontItalicTrait),
+ platformData.m_orientation);
return getCachedFontData(&alternateFont);
}
@@ -210,7 +211,7 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
bool syntheticBold = isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(actualWeight);
bool syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait);
- return new FontPlatformData(platformFont, syntheticBold, syntheticOblique);
+ return new FontPlatformData(platformFont, syntheticBold, syntheticOblique, fontDescription.orientation());
}
} // namespace WebCore
diff --git a/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp b/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
index a600d73..cead71b 100644
--- a/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
@@ -38,9 +38,9 @@ FontCustomPlatformData::~FontCustomPlatformData()
CGFontRelease(m_cgFont);
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation orientation, FontRenderingMode)
{
- return FontPlatformData(m_cgFont, (ATSUFontID)m_atsFont, size, bold, italic);
+ return FontPlatformData(m_cgFont, (ATSUFontID)m_atsFont, size, bold, italic, orientation);
}
FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
diff --git a/WebCore/platform/graphics/mac/FontCustomPlatformData.h b/WebCore/platform/graphics/mac/FontCustomPlatformData.h
index 90440d5..7702457 100644
--- a/WebCore/platform/graphics/mac/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/mac/FontCustomPlatformData.h
@@ -21,6 +21,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <CoreFoundation/CFBase.h>
#include <wtf/Forward.h>
@@ -41,7 +42,7 @@ struct FontCustomPlatformData : Noncopyable {
{}
~FontCustomPlatformData();
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
static bool supportsFormat(const String&);
diff --git a/WebCore/platform/graphics/mac/FontMac.mm b/WebCore/platform/graphics/mac/FontMac.mm
index 33a930b..d760f5a 100644
--- a/WebCore/platform/graphics/mac/FontMac.mm
+++ b/WebCore/platform/graphics/mac/FontMac.mm
@@ -47,10 +47,29 @@ bool Font::canReturnFallbackFontsForComplexText()
return true;
}
-static void showGlyphsWithAdvances(const FontPlatformData& font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)
+static void showGlyphsWithAdvances(const SimpleFontData* font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)
{
- if (!font.isColorBitmapFont())
+ const FontPlatformData& platformData = font->platformData();
+ if (!platformData.isColorBitmapFont()) {
+ CGAffineTransform savedMatrix;
+ bool isVertical = platformData.orientation() == Vertical;
+
+ if (isVertical) {
+ CGAffineTransform rotateLeftTransform = CGAffineTransformMake(0, -1, 1, 0, 0, 0);
+
+ savedMatrix = CGContextGetTextMatrix(context);
+ CGAffineTransform runMatrix = CGAffineTransformConcat(savedMatrix, rotateLeftTransform);
+ // Move start point to put glyphs into original region.
+ runMatrix.tx = savedMatrix.tx + font->ascent();
+ runMatrix.ty = savedMatrix.ty + font->descent();
+ CGContextSetTextMatrix(context, runMatrix);
+ }
+
CGContextShowGlyphsWithAdvances(context, glyphs, advances, count);
+
+ if (isVertical)
+ CGContextSetTextMatrix(context, savedMatrix);
+ }
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
else {
if (!count)
@@ -64,7 +83,7 @@ static void showGlyphsWithAdvances(const FontPlatformData& font, CGContextRef co
positions[i].x = positions[i - 1].x + advance.width;
positions[i].y = positions[i - 1].y + advance.height;
}
- CTFontDrawGlyphs(font.ctFont(), glyphs, positions.data(), count, context);
+ CTFontDrawGlyphs(platformData.ctFont(), glyphs, positions.data(), count, context);
}
#endif
}
@@ -149,19 +168,19 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255);
context->setFillColor(shadowFillColor, fillColorSpace);
CGContextSetTextPosition(cgContext, point.x() + shadowOffset.width(), point.y() + shadowOffset.height());
- showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+ showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
if (font->syntheticBoldOffset()) {
CGContextSetTextPosition(cgContext, point.x() + shadowOffset.width() + font->syntheticBoldOffset(), point.y() + shadowOffset.height());
- showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+ showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
}
context->setFillColor(fillColor, fillColorSpace);
}
CGContextSetTextPosition(cgContext, point.x(), point.y());
- showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+ showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
if (font->syntheticBoldOffset()) {
CGContextSetTextPosition(cgContext, point.x() + font->syntheticBoldOffset(), point.y());
- showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+ showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
}
if (hasSimpleShadow)
diff --git a/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp b/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
index 143e665..48ad1c0 100644
--- a/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
+++ b/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
@@ -40,15 +40,70 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
bool haveGlyphs = false;
#ifndef BUILDING_ON_TIGER
- Vector<CGGlyph, 512> glyphs(bufferLength);
- wkGetGlyphsForCharacters(fontData->platformData().cgFont(), buffer, glyphs.data(), bufferLength);
+ if (fontData->platformData().orientation() == Horizontal) {
+ Vector<CGGlyph, 512> glyphs(bufferLength);
+ wkGetGlyphsForCharacters(fontData->platformData().cgFont(), buffer, glyphs.data(), bufferLength);
+ for (unsigned i = 0; i < length; ++i) {
+ if (!glyphs[i])
+ setGlyphDataForIndex(offset + i, 0, 0);
+ else {
+ setGlyphDataForIndex(offset + i, glyphs[i], fontData);
+ haveGlyphs = true;
+ }
+ }
+ } else {
+ // We ask CoreText for possible vertical variant glyphs
+ RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, buffer, bufferLength, kCFAllocatorNull));
+ RetainPtr<CFAttributedStringRef> attributedString(AdoptCF, CFAttributedStringCreate(kCFAllocatorDefault, string.get(), fontData->getCFStringAttributes(0)));
+ RetainPtr<CTLineRef> line(AdoptCF, CTLineCreateWithAttributedString(attributedString.get()));
- for (unsigned i = 0; i < length; ++i) {
- if (!glyphs[i])
- setGlyphDataForIndex(offset + i, 0, 0);
- else {
- setGlyphDataForIndex(offset + i, glyphs[i], fontData);
- haveGlyphs = true;
+ CFArrayRef runArray = CTLineGetGlyphRuns(line.get());
+ CFIndex runCount = CFArrayGetCount(runArray);
+
+ // Initialize glyph entries
+ for (unsigned index = 0; index < length; ++index)
+ setGlyphDataForIndex(offset + index, 0, 0);
+
+ Vector<CGGlyph, 512> glyphVector;
+ Vector<CFIndex, 512> indexVector;
+ bool done = false;
+ for (CFIndex r = 0; r < runCount && !done ; ++r) {
+ // CTLine could map characters over multiple fonts using its own font fallback list.
+ // We need to pick runs that use the exact font we need, i.e., fontData->platformData().ctFont().
+ CTRunRef ctRun = static_cast<CTRunRef>(CFArrayGetValueAtIndex(runArray, r));
+ ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID());
+
+ CFDictionaryRef attributes = CTRunGetAttributes(ctRun);
+ CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(attributes, kCTFontAttributeName));
+ RetainPtr<CGFontRef> runCGFont(AdoptCF, CTFontCopyGraphicsFont(runFont, 0));
+ // Use CGFont here as CFEqual for CTFont counts all attributes for font.
+ if (CFEqual(fontData->platformData().cgFont(), runCGFont.get())) {
+ // This run uses the font we want. Extract glyphs.
+ CFIndex glyphCount = CTRunGetGlyphCount(ctRun);
+ const CGGlyph* glyphs = CTRunGetGlyphsPtr(ctRun);
+ if (!glyphs) {
+ glyphVector.resize(glyphCount);
+ CTRunGetGlyphs(ctRun, CFRangeMake(0, 0), glyphVector.data());
+ glyphs = glyphVector.data();
+ }
+ const CFIndex* stringIndices = CTRunGetStringIndicesPtr(ctRun);
+ if (!stringIndices) {
+ indexVector.resize(glyphCount);
+ CTRunGetStringIndices(ctRun, CFRangeMake(0, 0), indexVector.data());
+ stringIndices = indexVector.data();
+ }
+
+ for (CFIndex i = 0; i < glyphCount; ++i) {
+ if (stringIndices[i] >= static_cast<CFIndex>(length)) {
+ done = true;
+ break;
+ }
+ if (glyphs[i]) {
+ setGlyphDataForIndex(offset + stringIndices[i], glyphs[i], fontData);
+ haveGlyphs = true;
+ }
+ }
+ }
}
}
#else
diff --git a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
index e079b44..78d004a 100644
--- a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
+++ b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
@@ -210,6 +210,8 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWi
m_compiler.setResources(ANGLEResources);
::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
+ ::glEnable(GL_POINT_SPRITE);
+
::glClearColor(0, 0, 0, 0);
}
diff --git a/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp b/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
index 4fb525f..01d75ee 100644
--- a/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
+++ b/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
@@ -30,8 +30,6 @@
#import "config.h"
#import "SimpleFontData.h"
-#if USE(CORE_TEXT)
-
#import "Font.h"
#import "FontCache.h"
#import "FontDescription.h"
@@ -60,16 +58,16 @@ CFDictionaryRef SimpleFontData::getCFStringAttributes(TypesettingFeatures typese
if (!(typesettingFeatures & Kerning)) {
static const float kerningAdjustmentValue = 0;
static CFNumberRef kerningAdjustment = CFNumberCreate(kCFAllocatorDefault, kCFNumberFloatType, &kerningAdjustmentValue);
- static const void* keysWithKerningDisabled[] = { kCTFontAttributeName, kCTKernAttributeName, kCTLigatureAttributeName };
+ static const void* keysWithKerningDisabled[] = { kCTFontAttributeName, kCTKernAttributeName, kCTLigatureAttributeName, kCTVerticalFormsAttributeName };
const void* valuesWithKerningDisabled[] = { platformData().ctFont(), kerningAdjustment, allowLigatures
- ? ligaturesAllowed : ligaturesNotAllowed };
+ ? ligaturesAllowed : ligaturesNotAllowed, platformData().orientation() == Vertical ? kCFBooleanTrue : kCFBooleanFalse };
attributesDictionary.adoptCF(CFDictionaryCreate(0, keysWithKerningDisabled, valuesWithKerningDisabled,
sizeof(keysWithKerningDisabled) / sizeof(*keysWithKerningDisabled),
&kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
} else {
// By omitting the kCTKernAttributeName attribute, we get Core Text's standard kerning.
- static const void* keysWithKerningEnabled[] = { kCTFontAttributeName, kCTLigatureAttributeName };
- const void* valuesWithKerningEnabled[] = { platformData().ctFont(), allowLigatures ? ligaturesAllowed : ligaturesNotAllowed };
+ static const void* keysWithKerningEnabled[] = { kCTFontAttributeName, kCTLigatureAttributeName, kCTVerticalFormsAttributeName };
+ const void* valuesWithKerningEnabled[] = { platformData().ctFont(), allowLigatures ? ligaturesAllowed : ligaturesNotAllowed, platformData().orientation() == Vertical ? kCFBooleanTrue : kCFBooleanFalse };
attributesDictionary.adoptCF(CFDictionaryCreate(0, keysWithKerningEnabled, valuesWithKerningEnabled,
sizeof(keysWithKerningEnabled) / sizeof(*keysWithKerningEnabled),
&kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
@@ -79,5 +77,3 @@ CFDictionaryRef SimpleFontData::getCFStringAttributes(TypesettingFeatures typese
}
} // namespace WebCore
-
-#endif
diff --git a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
index 94fcc5e..fd57630 100644
--- a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
+++ b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
@@ -277,6 +277,11 @@ void SimpleFontData::platformInit()
#else
m_xHeight = m_platformData.font() ? [m_platformData.font() xHeight] : 0;
#endif
+ // CGFontGetXHeight() returns a wrong value for "Apple Symbols" font (a float close to 0, but not strictly 0).
+ // The following code makes a guess for m_xHeight in that case.
+ // The int cast is a workaround for the "almost" zero value returned by CGFontGetXHeight().
+ if (!static_cast<int>(m_xHeight) && fAscent)
+ m_xHeight = 2 * fAscent / 3;
}
}
@@ -417,11 +422,9 @@ FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
{
FloatRect boundingBox;
#ifndef BUILDING_ON_TIGER
- CGRect box;
- CGFontGetGlyphBBoxes(platformData().cgFont(), &glyph, 1, &box);
- float pointSize = platformData().m_size;
- CGFloat scale = pointSize / unitsPerEm();
- boundingBox = CGRectApplyAffineTransform(box, CGAffineTransformMakeScale(scale, -scale));
+ boundingBox = CTFontGetBoundingRectsForGlyphs(m_platformData.ctFont(),
+ m_platformData.orientation() == Vertical ? kCTFontVerticalOrientation : kCTFontHorizontalOrientation, &glyph, 0, 1);
+ boundingBox.setY(-boundingBox.bottom());
#else
// FIXME: Custom fonts don't have NSFonts, so this function doesn't compute correct bounds for these on Tiger.
if (!m_platformData.font())
@@ -437,14 +440,18 @@ FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
{
- NSFont* font = platformData().font();
- float pointSize = platformData().m_size;
- CGAffineTransform m = CGAffineTransformMakeScale(pointSize, pointSize);
CGSize advance;
- if (!wkGetGlyphTransformedAdvances(platformData().cgFont(), font, &m, &glyph, &advance)) {
- LOG_ERROR("Unable to cache glyph widths for %@ %f", [font displayName], pointSize);
- advance.width = 0;
- }
+ if (m_platformData.orientation() == Horizontal) {
+ NSFont* font = platformData().font();
+ float pointSize = platformData().m_size;
+ CGAffineTransform m = CGAffineTransformMakeScale(pointSize, pointSize);
+ if (!wkGetGlyphTransformedAdvances(platformData().cgFont(), font, &m, &glyph, &advance)) {
+ LOG_ERROR("Unable to cache glyph widths for %@ %f", [font displayName], pointSize);
+ advance.width = 0;
+ }
+ } else
+ CTFontGetAdvancesForGlyphs(m_platformData.ctFont(), kCTFontVerticalOrientation, &glyph, &advance, 1);
+
return advance.width + m_syntheticBoldOffset;
}
diff --git a/WebCore/platform/graphics/opengl/TextureMapperGL.cpp b/WebCore/platform/graphics/opengl/TextureMapperGL.cpp
new file mode 100644
index 0000000..6527ce4
--- /dev/null
+++ b/WebCore/platform/graphics/opengl/TextureMapperGL.cpp
@@ -0,0 +1,591 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "TextureMapperGL.h"
+
+#include "GraphicsContext.h"
+#include "HashMap.h"
+#include "Image.h"
+#include "PassRefPtr.h"
+#include "RefCounted.h"
+#include "Timer.h"
+
+#if defined(TEXMAP_OPENGL_ES_2)
+#include <GLES2/gl2.h>
+#elif OS(MAC_OS_X)
+#include <gl.h>
+#else
+#include <GL/gl.h>
+#endif
+
+#ifndef TEXMAP_OPENGL_ES2
+extern "C" {
+ void glUniform1f(GLint, GLfloat);
+ void glUniform1i(GLint, GLint);
+ void glVertexAttribPointer(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid*);
+ void glUniform4f(GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+ void glShaderSource(GLuint, GLsizei, const char**, const GLint*);
+ GLuint glCreateShader(GLenum);
+ void glShaderSource(GLuint, GLsizei, const char**, const GLint*);
+ void glCompileShader(GLuint);
+ void glDeleteShader(GLuint);
+ void glUniformMatrix4fv(GLint, GLsizei, GLboolean, const GLfloat*);
+ GLuint glCreateProgram();
+ void glAttachShader(GLuint, GLuint);
+ void glLinkProgram(GLuint);
+ void glUseProgram(GLuint);
+ void glDisableVertexAttribArray(GLuint);
+ void glEnableVertexAttribArray(GLuint);
+ void glBindFramebuffer(GLenum target, GLuint framebuffer);
+ void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
+ void glGenFramebuffers(GLsizei n, GLuint* framebuffers);
+ void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+ void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+ void glBindBuffer(GLenum, GLuint);
+ void glDeleteBuffers(GLsizei, const GLuint*);
+ void glGenBuffers(GLsizei, GLuint*);
+ void glBufferData(GLenum, GLsizeiptr, const GLvoid*, GLenum);
+ void glBufferSubData(GLenum, GLsizeiptr, GLsizeiptr, const GLvoid*);
+ void glGetProgramInfoLog(GLuint program, GLsizei, GLsizei*, GLchar*);
+
+#if !OS(MAC_OS_X)
+ GLint glGetUniformLocation(GLuint, const GLchar*);
+ GLint glBindAttribLocation(GLuint, GLuint, const GLchar*);
+#endif
+}
+#endif
+
+namespace WebCore {
+
+inline static void debugGLCommand(const char* command, int line)
+{
+ const GLenum err = glGetError();
+ if (!err)
+ return;
+ WTFReportError(__FILE__, line, WTF_PRETTY_FUNCTION, "[TextureMapper GL] Command failed: %s (%x)\n", command, err);
+}
+
+#define DEBUG_GL_COMMANDS
+
+#ifdef DEBUG_GL_COMMANDS
+#define GL_CMD(x) {x, debugGLCommand(#x, __LINE__); }
+#else
+#define GL_CMD(x) x
+#endif
+
+class BitmapTextureGL : public BitmapTexture {
+public:
+ virtual void destroy();
+ virtual IntSize size() const;
+ virtual bool isValid() const;
+ virtual void reset(const IntSize&, bool opaque);
+ virtual PlatformGraphicsContext* beginPaint(const IntRect& dirtyRect);
+ virtual void endPaint();
+ virtual void setContentsToImage(Image*);
+
+private:
+ GLuint m_id;
+ NativeImagePtr m_image;
+ FloatSize m_relativeSize;
+ bool m_opaque;
+ IntSize m_textureSize;
+ RefPtr<RGBA32PremultimpliedBuffer> m_buffer;
+ IntRect m_dirtyRect;
+ GLuint m_fbo;
+ IntSize m_actualSize;
+ bool m_surfaceNeedsReset;
+ BitmapTextureGL()
+ : m_id(0)
+ , m_image(0)
+ , m_opaque(false)
+ , m_fbo(0)
+ , m_surfaceNeedsReset(true)
+ {
+ }
+
+ friend class TextureMapperGL;
+};
+
+static struct TexmapShaderInfo {
+ enum ShaderProgramIndex {
+ SimpleProgram,
+ OpacityAndMaskProgram,
+ TargetProgram,
+ NumPrograms
+ };
+
+ enum ShaderVariableIndex {
+ InMatrixVariable,
+ InSourceMatrixVariable,
+ InMaskMatrixVariable,
+ InVertexVariable,
+
+ OpacityVariable,
+ SourceTextureVariable,
+ MaskTextureVariable,
+ NumVariables
+ };
+
+ struct ProgramInfo {
+ GLuint id;
+ GLint vars[NumVariables];
+ };
+
+ GLint getUniformLocation(ShaderProgramIndex prog, ShaderVariableIndex var, const char* name)
+ {
+ return programs[prog].vars[var] = glGetUniformLocation(programs[prog].id, name);
+ }
+
+ void createShaderProgram(const char* vertexShaderSource, const char* fragmentShaderSource, ShaderProgramIndex index)
+ {
+ GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER);
+ GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
+ GL_CMD(glShaderSource(vertexShader, 1, &vertexShaderSource, 0))
+ GL_CMD(glShaderSource(fragmentShader, 1, &fragmentShaderSource, 0))
+ GLuint programID = glCreateProgram();
+ GL_CMD(glCompileShader(vertexShader))
+ GL_CMD(glCompileShader(fragmentShader))
+ GL_CMD(glAttachShader(programID, vertexShader))
+ GL_CMD(glAttachShader(programID, fragmentShader))
+ GL_CMD(glBindAttribLocation(programID, 0, "InVertex"))
+ GL_CMD(glLinkProgram(programID))
+ programs[index].id = programID;
+ }
+
+ ProgramInfo programs[NumPrograms];
+
+} gShaderInfo;
+
+#define TEXMAP_GET_SHADER_VAR_LOCATION(prog, var) \
+ if (gShaderInfo.getUniformLocation(TexmapShaderInfo::prog##Program, TexmapShaderInfo::var##Variable, #var) < 0) \
+ LOG_ERROR("Couldn't find variable "#var" in program "#prog"\n");
+#define TEXMAP_BUILD_SHADER(program) gShaderInfo.createShaderProgram(vertexShaderSource##program, fragmentShaderSource##program, TexmapShaderInfo::program##Program);
+
+TextureMapperGL::TextureMapperGL(GraphicsContext* context)
+ : TextureMapper(context)
+ , m_currentProgram(TexmapShaderInfo::TargetProgram)
+{
+ static bool shadersCompiled = false;
+ if (shadersCompiled)
+ return;
+ shadersCompiled = true;
+#ifndef TEXMAP_OPENGL_ES2
+#define OES2_PRECISION_DEFINITIONS \
+ "#define lowp\n#define highp\n"
+#else
+#define OES2_PRECISION_DEFINITIONS
+#endif
+
+ const char* fragmentShaderSourceOpacityAndMask =
+ OES2_PRECISION_DEFINITIONS
+" uniform sampler2D SourceTexture, MaskTexture; \n"
+" uniform lowp float Opacity; \n"
+" varying highp vec2 OutTexCoordSource, OutTexCoordMask; \n"
+" void main(void) \n"
+" { \n"
+" lowp vec4 color = texture2D(SourceTexture, OutTexCoordSource); \n"
+" lowp vec4 maskColor = texture2D(MaskTexture, OutTexCoordMask); \n"
+" lowp float o = Opacity * maskColor.a; \n"
+" gl_FragColor = vec4(color.rgb * o, color.a * o); \n"
+" } \n";
+
+ const char* vertexShaderSourceOpacityAndMask =
+ OES2_PRECISION_DEFINITIONS
+" uniform mat4 InMatrix, InSourceMatrix, InMaskMatrix; \n"
+" attribute vec4 InVertex; \n"
+" varying highp vec2 OutTexCoordSource, OutTexCoordMask; \n"
+" void main(void) \n"
+" { \n"
+" OutTexCoordSource = vec2(InSourceMatrix * InVertex); \n"
+" OutTexCoordMask = vec2(InMaskMatrix * InVertex); \n"
+" gl_Position = InMatrix * InVertex; \n"
+" } \n";
+
+ const char* fragmentShaderSourceSimple =
+ OES2_PRECISION_DEFINITIONS
+" uniform sampler2D SourceTexture; \n"
+" uniform lowp float Opacity; \n"
+" varying highp vec2 OutTexCoordSource; \n"
+" void main(void) \n"
+" { \n"
+" lowp vec4 color = texture2D(SourceTexture, OutTexCoordSource); \n"
+" gl_FragColor = vec4(color.rgb * Opacity, color.a * Opacity); \n"
+" } \n";
+
+ const char* vertexShaderSourceSimple =
+ OES2_PRECISION_DEFINITIONS
+" uniform mat4 InMatrix, InSourceMatrix; \n"
+" attribute vec4 InVertex; \n"
+" varying highp vec2 OutTexCoordSource; \n"
+" void main(void) \n"
+" { \n"
+" OutTexCoordSource = vec2(InSourceMatrix * InVertex); \n"
+" gl_Position = InMatrix * InVertex; \n"
+" } \n";
+
+ const char* fragmentShaderSourceTarget =
+ OES2_PRECISION_DEFINITIONS
+" uniform sampler2D SourceTexture; \n"
+" uniform lowp float Opacity; \n"
+" varying highp vec2 OutTexCoordSource; \n"
+" void main(void) \n"
+" { \n"
+" lowp vec4 color = texture2D(SourceTexture, OutTexCoordSource); \n"
+" gl_FragColor = vec4(color.bgr * Opacity, color.a * Opacity); \n"
+" } \n";
+
+ const char* vertexShaderSourceTarget = vertexShaderSourceSimple;
+
+ TEXMAP_BUILD_SHADER(Simple)
+ TEXMAP_BUILD_SHADER(OpacityAndMask)
+ TEXMAP_BUILD_SHADER(Target)
+
+ TEXMAP_GET_SHADER_VAR_LOCATION(OpacityAndMask, InMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(OpacityAndMask, InSourceMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(OpacityAndMask, InMaskMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(OpacityAndMask, SourceTexture)
+ TEXMAP_GET_SHADER_VAR_LOCATION(OpacityAndMask, MaskTexture)
+ TEXMAP_GET_SHADER_VAR_LOCATION(OpacityAndMask, Opacity)
+
+ TEXMAP_GET_SHADER_VAR_LOCATION(Simple, InSourceMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(Simple, InMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(Simple, SourceTexture)
+ TEXMAP_GET_SHADER_VAR_LOCATION(Simple, Opacity)
+
+ TEXMAP_GET_SHADER_VAR_LOCATION(Target, InSourceMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(Target, InMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(Target, SourceTexture)
+ TEXMAP_GET_SHADER_VAR_LOCATION(Target, Opacity)
+}
+
+void TextureMapperGL::drawTexture(const BitmapTexture& texture, const IntRect& targetRect, const TransformationMatrix& modelViewMatrix, float opacity, const BitmapTexture* maskTexture)
+{
+ if (!texture.isValid())
+ return;
+
+ const BitmapTextureGL& textureGL = static_cast<const BitmapTextureGL&>(texture);
+
+ TexmapShaderInfo::ShaderProgramIndex program;
+ if (maskTexture)
+ program = TexmapShaderInfo::OpacityAndMaskProgram;
+ else
+ program = TexmapShaderInfo::SimpleProgram;
+
+ const TexmapShaderInfo::ProgramInfo& programInfo = gShaderInfo.programs[program];
+ if (m_currentProgram != program) {
+ GL_CMD(glUseProgram(programInfo.id))
+ GL_CMD(glDisableVertexAttribArray(gShaderInfo.programs[m_currentProgram].vars[TexmapShaderInfo::InVertexVariable]))
+ m_currentProgram = program;
+ GL_CMD(glEnableVertexAttribArray(programInfo.vars[TexmapShaderInfo::InVertexVariable]))
+ }
+
+ GL_CMD(glDisable(GL_DEPTH_TEST))
+ GL_CMD(glDisable(GL_STENCIL_TEST))
+
+ GL_CMD(glActiveTexture(GL_TEXTURE0))
+ GL_CMD(glBindTexture(GL_TEXTURE_2D, textureGL.m_id))
+ GL_CMD(glBindBuffer(GL_ARRAY_BUFFER, 0))
+ const GLfloat unitRect[] = {0, 0, 1, 0, 1, 1, 0, 1};
+ GL_CMD(glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, unitRect))
+
+ TransformationMatrix matrix = TransformationMatrix(m_projectionMatrix).multLeft(modelViewMatrix).multLeft(TransformationMatrix(
+ targetRect.width(), 0, 0, 0,
+ 0, targetRect.height(), 0, 0,
+ 0, 0, 1, 0,
+ targetRect.x(), targetRect.y(), 0, 1));
+
+ const GLfloat m4[] = {
+ matrix.m11(), matrix.m12(), matrix.m13(), matrix.m14(),
+ matrix.m21(), matrix.m22(), matrix.m23(), matrix.m24(),
+ matrix.m31(), matrix.m32(), matrix.m33(), matrix.m34(),
+ matrix.m41(), matrix.m42(), matrix.m43(), matrix.m44()
+ };
+ const GLfloat m4src[] = {textureGL.m_relativeSize.width(), 0, 0, 0,
+ 0, textureGL.m_relativeSize.height(), 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1};
+ GL_CMD(glUniformMatrix4fv(programInfo.vars[TexmapShaderInfo::InMatrixVariable], 1, GL_FALSE, m4))
+ GL_CMD(glUniformMatrix4fv(programInfo.vars[TexmapShaderInfo::InSourceMatrixVariable], 1, GL_FALSE, m4src))
+ GL_CMD(glUniform1i(programInfo.vars[TexmapShaderInfo::SourceTextureVariable], 0))
+ GL_CMD(glUniform1f(programInfo.vars[TexmapShaderInfo::OpacityVariable], opacity))
+
+ if (maskTexture && maskTexture->isValid()) {
+ const BitmapTextureGL* maskTextureGL = static_cast<const BitmapTextureGL*>(maskTexture);
+ GL_CMD(glActiveTexture(GL_TEXTURE1))
+ GL_CMD(glBindTexture(GL_TEXTURE_2D, maskTextureGL->m_id))
+ const GLfloat m4mask[] = {maskTextureGL->m_relativeSize.width(), 0, 0, 0,
+ 0, maskTextureGL->m_relativeSize.height(), 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1};
+ glUniformMatrix4fv(programInfo.vars[TexmapShaderInfo::InMaskMatrixVariable], 1, GL_FALSE, m4mask);
+ GL_CMD(glUniform1i(programInfo.vars[TexmapShaderInfo::MaskTextureVariable], 1))
+ GL_CMD(glActiveTexture(GL_TEXTURE0))
+ }
+
+
+ if (textureGL.m_opaque && opacity > 0.99 && !maskTexture)
+ GL_CMD(glDisable(GL_BLEND))
+ else {
+ GL_CMD(glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA))
+ GL_CMD(glEnable(GL_BLEND))
+ }
+
+ GL_CMD(glDrawArrays(GL_TRIANGLE_FAN, 0, 4))
+}
+
+
+const char* TextureMapperGL::type() const
+{
+ return "OpenGL";
+}
+
+void BitmapTextureGL::reset(const IntSize& newSize, bool opaque)
+{
+ BitmapTexture::reset(newSize, opaque);
+ m_image = 0;
+ IntSize newTextureSize = nextPowerOfTwo(newSize);
+ bool justCreated = false;
+ if (!m_id) {
+ GL_CMD(glGenTextures(1, &m_id))
+ justCreated = true;
+ }
+
+ if (justCreated || newTextureSize.width() > m_textureSize.width() || newTextureSize.height() > m_textureSize.height()) {
+ m_textureSize = newTextureSize;
+ GL_CMD(glBindTexture(GL_TEXTURE_2D, m_id))
+ GL_CMD(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR))
+ GL_CMD(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR))
+ GL_CMD(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE))
+ GL_CMD(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE))
+ GL_CMD(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_textureSize.width(), m_textureSize.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0))
+ }
+ m_actualSize = newSize;
+ m_relativeSize = FloatSize(float(newSize.width()) / m_textureSize.width(), float(newSize.height()) / m_textureSize.height());
+ m_opaque = opaque;
+ m_surfaceNeedsReset = true;
+}
+
+PlatformGraphicsContext* BitmapTextureGL::beginPaint(const IntRect& dirtyRect)
+{
+ m_buffer = RGBA32PremultimpliedBuffer::create();
+ m_dirtyRect = dirtyRect;
+ return m_buffer->beginPaint(dirtyRect, m_opaque);
+}
+
+void BitmapTextureGL::endPaint()
+{
+ if (!m_buffer)
+ return;
+ m_buffer->endPaint();
+ GL_CMD(glBindTexture(GL_TEXTURE_2D, m_id))
+ GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, m_dirtyRect.x(), m_dirtyRect.y(), m_dirtyRect.width(), m_dirtyRect.height(), GL_RGBA, GL_UNSIGNED_BYTE, m_buffer->data()))
+ m_buffer.clear();
+}
+
+struct TexmapGLShaderTextures {
+ struct Entry {
+ GLuint texture;
+ int refCount;
+ };
+ HashMap<NativeImagePtr, Entry> imageToTexture;
+ GLuint findOrCreate(NativeImagePtr image, bool& found)
+ {
+ HashMap<NativeImagePtr, Entry>::iterator it = imageToTexture.find(image);
+ found = false;
+ if (it != imageToTexture.end()) {
+ it->second.refCount++;
+ found = true;
+ return it->second.texture;
+ }
+ Entry entry;
+ GL_CMD(glGenTextures(1, &entry.texture));
+ entry.refCount = 1;
+ imageToTexture.add(image, entry);
+ return entry.texture;
+ }
+
+ bool deref(NativeImagePtr image)
+ {
+ HashMap<NativeImagePtr, Entry>::iterator it = imageToTexture.find(image);
+ if (it != imageToTexture.end()) {
+ if (it->second.refCount < 2) {
+ imageToTexture.remove(it);
+ return false;
+ }
+ }
+ return true;
+ }
+};
+
+static TexmapGLShaderTextures gTextureRepository;
+
+void BitmapTextureGL::setContentsToImage(Image* image)
+{
+ NativeImagePtr nativeImage = image ? image->nativeImageForCurrentFrame() : 0;
+ if (!image || !nativeImage) {
+ if (m_image)
+ destroy();
+ return;
+ }
+
+ if (nativeImage == m_image)
+ return;
+ bool found = false;
+ GLuint newTextureID = gTextureRepository.findOrCreate(nativeImage, found);
+ if (newTextureID != m_id) {
+ destroy();
+ m_id = newTextureID;
+ reset(image->size(), false);
+ m_image = nativeImage;
+ if (!found) {
+ GraphicsContext context(beginPaint(IntRect(0, 0, m_textureSize.width(), m_textureSize.height())));
+ context.drawImage(image, ColorSpaceDeviceRGB, IntPoint(0, 0), CompositeCopy);
+ endPaint();
+ }
+ }
+}
+
+void BitmapTextureGL::destroy()
+{
+ if (m_id && (!m_image || !gTextureRepository.deref(m_image)))
+ GL_CMD(glDeleteTextures(1, &m_id))
+ if (m_fbo)
+ GL_CMD(glDeleteFramebuffers(1, &m_fbo))
+
+ m_fbo = 0;
+ m_id = 0;
+ m_textureSize = IntSize();
+ m_relativeSize = FloatSize(1, 1);
+}
+
+bool BitmapTextureGL::isValid() const
+{
+ return m_id;
+}
+
+IntSize BitmapTextureGL::size() const
+{
+ return m_textureSize;
+}
+
+static inline TransformationMatrix createProjectionMatrix(const IntSize& size, bool flip)
+{
+ return TransformationMatrix(2.0 / float(size.width()), 0, 0, 0,
+ 0, (flip ? -2.0 : 2.0) / float(size.height()), 0, 0,
+ 0, 0, -0.000001, 0,
+ -1, flip ? 1 : -1, 0, 1);
+}
+
+void TextureMapperGL::cleanup()
+{
+}
+
+void TextureMapperGL::bindSurface(BitmapTexture *surfacePointer)
+{
+ BitmapTextureGL* surface = static_cast<BitmapTextureGL*>(surfacePointer);
+
+ if (!surface)
+ return;
+ TransformationMatrix matrix = createProjectionMatrix(surface->size(), false);
+ matrix.translate(-surface->offset().x(), -surface->offset().y());
+
+ if (surface->m_surfaceNeedsReset || !surface->m_fbo) {
+ if (!surface->m_fbo)
+ GL_CMD(glGenFramebuffers(1, &surface->m_fbo))
+ GL_CMD(glBindFramebuffer(GL_FRAMEBUFFER, surface->m_fbo))
+ GL_CMD(glBindTexture(GL_TEXTURE_2D, 0))
+ GL_CMD(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, surface->m_id, 0))
+ GL_CMD(glClearColor(0, 0, 0, 0))
+ GL_CMD(glClear(GL_COLOR_BUFFER_BIT))
+ surface->m_surfaceNeedsReset = false;
+ } else {
+ GL_CMD(glBindFramebuffer(GL_FRAMEBUFFER, surface->m_fbo))
+ }
+
+ GL_CMD(glViewport(0, 0, surface->size().width(), surface->size().height()))
+ m_projectionMatrix = matrix;
+}
+
+void TextureMapperGL::setClip(const IntRect& rect)
+{
+ GL_CMD(glScissor(rect.x(), rect.y(), rect.width(), rect.height()))
+ GL_CMD(glEnable(GL_SCISSOR_TEST))
+}
+
+
+void TextureMapperGL::paintToTarget(const BitmapTexture& aSurface, const IntSize& surfaceSize, const TransformationMatrix& transform, float opacity, const IntRect& visibleRect)
+{
+ const BitmapTextureGL& surface = static_cast<const BitmapTextureGL&>(aSurface);
+
+ // Create the model-view-projection matrix to display on screen.
+ TransformationMatrix matrix = createProjectionMatrix(surfaceSize, true).multLeft(transform).multLeft(
+ TransformationMatrix(
+ surface.m_actualSize.width(), 0, 0, 0,
+ 0, surface.m_actualSize.height(), 0, 0,
+ 0, 0, 1, 0,
+ surface.offset().x(), surface.offset().y(), 0, 1
+ )
+ );
+
+ const GLfloat m4[] = {
+ matrix.m11(), matrix.m12(), matrix.m13(), matrix.m14(),
+ matrix.m21(), matrix.m22(), matrix.m23(), matrix.m24(),
+ matrix.m31(), matrix.m32(), matrix.m33(), matrix.m34(),
+ matrix.m41(), matrix.m42(), matrix.m43(), matrix.m44()
+ };
+
+ const GLfloat m4src[] = {surface.m_relativeSize.width(), 0, 0, 0,
+ 0, surface.m_relativeSize.height(), 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1};
+
+ // We already blended the alpha in; the result is premultiplied.
+ GL_CMD(glUseProgram(gShaderInfo.programs[TexmapShaderInfo::TargetProgram].id))
+ GL_CMD(glBindFramebuffer(GL_FRAMEBUFFER, 0))
+ GL_CMD(glViewport(0, 0, surfaceSize.width(), surfaceSize.height()))
+ GL_CMD(glDisable(GL_STENCIL_TEST))
+ const TexmapShaderInfo::ProgramInfo& programInfo = gShaderInfo.programs[TexmapShaderInfo::TargetProgram];
+ GL_CMD(glUniform1f(programInfo.vars[TexmapShaderInfo::OpacityVariable], opacity))
+ GL_CMD(glActiveTexture(GL_TEXTURE0))
+ GL_CMD(glBindTexture(GL_TEXTURE_2D, surface.m_id))
+ GL_CMD(glUniform1i(programInfo.vars[TexmapShaderInfo::SourceTextureVariable], 0))
+ GL_CMD(glEnableVertexAttribArray(programInfo.vars[TexmapShaderInfo::InVertexVariable]))
+ GL_CMD(glUniformMatrix4fv(programInfo.vars[TexmapShaderInfo::InMatrixVariable], 1, GL_FALSE, m4))
+ GL_CMD(glUniformMatrix4fv(programInfo.vars[TexmapShaderInfo::InSourceMatrixVariable], 1, GL_FALSE, m4src))
+ GL_CMD(glBindBuffer(GL_ARRAY_BUFFER, 0))
+ const GLfloat unitRect[] = {0, 0, 1, 0, 1, 1, 0, 1};
+ GL_CMD(glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, unitRect))
+ GL_CMD(glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA))
+ GL_CMD(glEnable(GL_BLEND))
+ setClip(visibleRect);
+
+ GL_CMD(glDrawArrays(GL_TRIANGLE_FAN, 0, 4))
+ GL_CMD(glDisableVertexAttribArray(programInfo.vars[TexmapShaderInfo::InVertexVariable]))
+ GL_CMD(glUseProgram(0))
+ GL_CMD(glBindBuffer(GL_ARRAY_BUFFER, 0))
+ m_currentProgram = TexmapShaderInfo::TargetProgram;
+}
+
+PassRefPtr<BitmapTexture> TextureMapperGL::createTexture()
+{
+ return adoptRef(new BitmapTextureGL());
+}
+
+};
diff --git a/WebCore/platform/graphics/opengl/TextureMapperGL.h b/WebCore/platform/graphics/opengl/TextureMapperGL.h
new file mode 100644
index 0000000..7a12c72
--- /dev/null
+++ b/WebCore/platform/graphics/opengl/TextureMapperGL.h
@@ -0,0 +1,83 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ */
+
+#ifndef TextureMapperGL_h
+#define TextureMapperGL_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "FloatQuad.h"
+#include "IntSize.h"
+#include "TransformationMatrix.h"
+#include "texmap/TextureMapper.h"
+
+namespace WebCore {
+
+// An OpenGL-ES2 implementation of TextureMapper.
+class TextureMapperGL : public TextureMapper {
+public:
+ TextureMapperGL(GraphicsContext* gc);
+ virtual ~TextureMapperGL() {}
+
+ // reimps from TextureMapper
+ virtual void drawTexture(const BitmapTexture& texture, const IntRect&, const TransformationMatrix& transform, float opacity, const BitmapTexture* maskTexture);
+ virtual void bindSurface(BitmapTexture* surface);
+ virtual void setClip(const IntRect&);
+ virtual void paintToTarget(const BitmapTexture&, const IntSize&, const TransformationMatrix&, float opacity, const IntRect& visibleRect);
+ virtual bool allowSurfaceForRoot() const { return true; }
+ virtual PassRefPtr<BitmapTexture> createTexture();
+ virtual const char* type() const;
+ virtual void cleanup();
+
+private:
+ TransformationMatrix m_projectionMatrix;
+ int m_currentProgram;
+};
+
+// An offscreen buffer to be rendered by software.
+class RGBA32PremultimpliedBuffer : public RefCounted<RGBA32PremultimpliedBuffer> {
+public:
+ virtual ~RGBA32PremultimpliedBuffer() {}
+ virtual PlatformGraphicsContext* beginPaint(const IntRect& dirtyRect, bool opaque) = 0;
+ virtual void endPaint() = 0;
+ virtual const void* data() const = 0;
+ static PassRefPtr<RGBA32PremultimpliedBuffer> create();
+};
+
+static inline int nextPowerOfTwo(int num)
+{
+ for (int i = 0x10000000; i > 0; i >>= 1) {
+ if (num == i)
+ return num;
+ if (num & i)
+ return (i << 1);
+ }
+ return 1;
+}
+
+static inline IntSize nextPowerOfTwo(const IntSize& size)
+{
+ return IntSize(nextPowerOfTwo(size.width()), nextPowerOfTwo(size.height()));
+}
+
+};
+
+#endif
+
+#endif
diff --git a/WebCore/platform/graphics/qt/FontCustomPlatformData.h b/WebCore/platform/graphics/qt/FontCustomPlatformData.h
index 019a6bc..6c41d47 100644
--- a/WebCore/platform/graphics/qt/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/qt/FontCustomPlatformData.h
@@ -22,6 +22,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
@@ -37,7 +38,7 @@ struct FontCustomPlatformData : Noncopyable {
// for use with QFontDatabase::addApplicationFont/removeApplicationFont
int m_handle;
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
static bool supportsFormat(const String&);
};
diff --git a/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp b/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
index dbf0b16..e2f009b 100644
--- a/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
+++ b/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
@@ -34,7 +34,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
QFontDatabase::removeApplicationFont(m_handle);
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
{
QFont font;
font.setFamily(QFontDatabase::applicationFontFamilies(m_handle)[0]);
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 8b34f51..50971b5 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -171,7 +171,7 @@ static inline Qt::FillRule toQtFillRule(WindRule rule)
class GraphicsContextPlatformPrivate : public Noncopyable {
public:
- GraphicsContextPlatformPrivate(QPainter* painter);
+ GraphicsContextPlatformPrivate(QPainter*, const QColor& initialSolidColor);
~GraphicsContextPlatformPrivate();
inline QPainter* p() const
@@ -225,42 +225,42 @@ private:
};
-GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate(QPainter* p)
+GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate(QPainter* p, const QColor& initialSolidColor)
+ : antiAliasingForRectsAndLines(false)
+ , layerCount(0)
+ , solidColor(initialSolidColor)
+ , imageInterpolationQuality(InterpolationDefault)
+ , painter(p)
{
- painter = p;
- layerCount = 0;
-
- solidColor = QBrush(Qt::black);
+ if (!painter)
+ return;
- imageInterpolationQuality = InterpolationDefault;
+ // Use the default the QPainter was constructed with.
+ antiAliasingForRectsAndLines = painter->testRenderHint(QPainter::Antialiasing);
- if (painter) {
- // use the default the QPainter was constructed with
- antiAliasingForRectsAndLines = painter->testRenderHint(QPainter::Antialiasing);
- // FIXME: Maybe only enable in SVG mode?
- painter->setRenderHint(QPainter::Antialiasing, true);
- painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
- } else
- antiAliasingForRectsAndLines = false;
+ painter->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, true);
}
GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate()
{
}
-GraphicsContext::GraphicsContext(PlatformGraphicsContext* context)
+GraphicsContext::GraphicsContext(PlatformGraphicsContext* painter)
: m_common(createGraphicsContextPrivate())
- , m_data(new GraphicsContextPlatformPrivate(context))
+ , m_data(new GraphicsContextPlatformPrivate(painter, fillColor()))
{
- setPaintingDisabled(!context);
- if (context) {
- // Make sure the context starts in sync with our state.
- setPlatformFillColor(fillColor(), ColorSpaceDeviceRGB);
- setPlatformStrokeColor(strokeColor(), ColorSpaceDeviceRGB);
+ setPaintingDisabled(!painter);
- // Make sure we start with the correct join mode.
- setLineJoin(MiterJoin);
- }
+ if (!painter)
+ return;
+
+ // solidColor is initialized with the fillColor().
+ painter->setBrush(m_data->solidColor);
+
+ QPen pen(painter->pen());
+ pen.setColor(strokeColor());
+ pen.setJoinStyle(toQtLineJoin(MiterJoin));
+ painter->setPen(pen);
}
GraphicsContext::~GraphicsContext()
diff --git a/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp b/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
index e0941f5..aa7ed2f 100644
--- a/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
@@ -200,6 +200,7 @@ public:
TransformationMatrix m_transformRelativeToRootLayer;
bool m_transformAnimationRunning;
bool m_opacityAnimationRunning;
+ bool m_blockNotifySyncRequired;
#ifndef QT_NO_GRAPHICSEFFECT
QWeakPointer<MaskEffectQt> m_maskEffect;
#endif
@@ -300,6 +301,7 @@ GraphicsLayerQtImpl::GraphicsLayerQtImpl(GraphicsLayerQt* newLayer)
, m_layer(newLayer)
, m_transformAnimationRunning(false)
, m_opacityAnimationRunning(false)
+ , m_blockNotifySyncRequired(false)
, m_changeMask(NoChanges)
#if ENABLE(3D_CANVAS)
, m_gc3D(0)
@@ -593,6 +595,8 @@ void GraphicsLayerQtImpl::paint(QPainter* painter, const QStyleOptionGraphicsIte
void GraphicsLayerQtImpl::notifySyncRequired()
{
+ m_blockNotifySyncRequired = false;
+
if (m_layer->client())
m_layer->client()->notifySyncRequired(m_layer);
}
@@ -600,8 +604,14 @@ void GraphicsLayerQtImpl::notifySyncRequired()
void GraphicsLayerQtImpl::notifyChange(ChangeMask changeMask)
{
m_changeMask |= changeMask;
+
+ if (m_blockNotifySyncRequired)
+ return;
+
static QMetaMethod syncMethod = staticMetaObject.method(staticMetaObject.indexOfMethod("notifySyncRequired()"));
syncMethod.invoke(this, Qt::QueuedConnection);
+
+ m_blockNotifySyncRequired = true;
}
void GraphicsLayerQtImpl::flushChanges(bool recursive, bool forceUpdateTransform)
diff --git a/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index 0cdc894..de23297 100644
--- a/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -157,14 +157,17 @@ void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
QImage image = m_data.m_pixmap.toImage().convertToFormat(QImage::Format_ARGB32);
ASSERT(!image.isNull());
+ uchar* bits = image.bits();
+ const int bytesPerLine = image.bytesPerLine();
+
for (int y = 0; y < m_size.height(); ++y) {
- for (int x = 0; x < m_size.width(); x++) {
- QRgb value = image.pixel(x, y);
- value = qRgba(lookUpTable[qRed(value)],
- lookUpTable[qGreen(value)],
- lookUpTable[qBlue(value)],
- qAlpha(value));
- image.setPixel(x, y, value);
+ quint32* scanLine = reinterpret_cast_ptr<quint32*>(bits + y * bytesPerLine);
+ for (int x = 0; x < m_size.width(); ++x) {
+ QRgb& pixel = scanLine[x];
+ pixel = qRgba(lookUpTable[qRed(pixel)],
+ lookUpTable[qGreen(pixel)],
+ lookUpTable[qBlue(pixel)],
+ qAlpha(pixel));
}
}
diff --git a/WebCore/platform/graphics/qt/TileQt.cpp b/WebCore/platform/graphics/qt/TileQt.cpp
index 9628448..096ce14 100644
--- a/WebCore/platform/graphics/qt/TileQt.cpp
+++ b/WebCore/platform/graphics/qt/TileQt.cpp
@@ -97,9 +97,10 @@ void Tile::updateBackBuffer()
return;
if (!m_backBuffer) {
- if (!m_buffer)
+ if (!m_buffer) {
m_backBuffer = new QPixmap(m_backingStore->m_tileSize.width(), m_backingStore->m_tileSize.height());
- else {
+ m_backBuffer->fill(m_backingStore->m_client->tiledBackingStoreBackgroundColor());
+ } else {
// Currently all buffers are updated synchronously at the same time so there is no real need
// to have separate back and front buffers. Just use the existing buffer.
m_backBuffer = m_buffer;
diff --git a/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp b/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
index 8301871..2ea568b 100644
--- a/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2007 Apple Computer, Inc.
* Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved.
+ * Copyright (C) 2010 Company 100, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -36,7 +37,7 @@
#include "Base64.h"
#include "ChromiumBridge.h"
#include "OpenTypeUtilities.h"
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
#include "SkStream.h"
#endif
@@ -47,7 +48,7 @@
#if OS(WINDOWS)
#include <objbase.h>
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
#include <cstring>
#endif
@@ -58,13 +59,13 @@ FontCustomPlatformData::~FontCustomPlatformData()
#if OS(WINDOWS)
if (m_fontReference)
RemoveFontMemResourceEx(m_fontReference);
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
if (m_fontReference)
m_fontReference->unref();
#endif
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode mode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode mode)
{
#if OS(WINDOWS)
ASSERT(m_fontReference);
@@ -99,7 +100,7 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, b
HFONT hfont = CreateFontIndirect(&logFont);
return FontPlatformData(hfont, size);
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
ASSERT(m_fontReference);
return FontPlatformData(m_fontReference, "", size, bold && !m_fontReference->isBold(), italic && !m_fontReference->isItalic());
#else
@@ -123,7 +124,7 @@ static String createUniqueFontName()
}
#endif
-#if OS(LINUX) || OS(FREEBSD)
+#if OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
class RemoteFontStream : public SkStream {
public:
explicit RemoteFontStream(PassRefPtr<SharedBuffer> buffer)
@@ -189,7 +190,7 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
if (!fontReference)
return 0;
return new FontCustomPlatformData(fontReference, fontName);
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
RemoteFontStream* stream = new RemoteFontStream(buffer);
SkTypeface* typeface = SkTypeface::CreateFromStream(stream);
if (!typeface)
diff --git a/WebCore/platform/graphics/skia/FontCustomPlatformData.h b/WebCore/platform/graphics/skia/FontCustomPlatformData.h
index 94d7ec3..e51b6b6 100644
--- a/WebCore/platform/graphics/skia/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/skia/FontCustomPlatformData.h
@@ -32,6 +32,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
@@ -39,7 +40,7 @@
#if OS(WINDOWS)
#include "PlatformString.h"
#include <windows.h>
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
#include "SkTypeface.h"
#endif
@@ -54,7 +55,7 @@ struct FontCustomPlatformData : Noncopyable {
: m_fontReference(fontReference)
, m_name(name)
{}
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
explicit FontCustomPlatformData(SkTypeface* typeface)
: m_fontReference(typeface)
{}
@@ -62,7 +63,7 @@ struct FontCustomPlatformData : Noncopyable {
~FontCustomPlatformData();
- FontPlatformData fontPlatformData(int size, bool bold, bool italic,
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal,
FontRenderingMode = NormalRenderingMode);
static bool supportsFormat(const String&);
@@ -70,7 +71,7 @@ struct FontCustomPlatformData : Noncopyable {
#if OS(WINDOWS)
HANDLE m_fontReference;
String m_name;
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
SkTypeface* m_fontReference;
#endif
};
diff --git a/WebCore/platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp b/WebCore/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp
index 6024d43..6024d43 100644
--- a/WebCore/platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp
+++ b/WebCore/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp
diff --git a/WebCore/platform/graphics/skia/ImageSkia.cpp b/WebCore/platform/graphics/skia/ImageSkia.cpp
index 23e7be6..ae2653a 100644
--- a/WebCore/platform/graphics/skia/ImageSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageSkia.cpp
@@ -236,12 +236,7 @@ static void paintSkBitmap(PlatformContextSkia* platformContext, const NativeImag
SkPaint paint;
paint.setXfermodeMode(compOp);
paint.setFilterBitmap(true);
- int alpha = roundf(platformContext->getAlpha() * 256);
- if (alpha > 255)
- alpha = 255;
- else if (alpha < 0)
- alpha = 0;
- paint.setAlpha(alpha);
+ paint.setAlpha(platformContext->getNormalizedAlpha());
skia::PlatformCanvas* canvas = platformContext->canvas();
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index 3f9e4c1..6204597 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -510,6 +510,16 @@ float PlatformContextSkia::getAlpha() const
return m_state->m_alpha;
}
+int PlatformContextSkia::getNormalizedAlpha() const
+{
+ int alpha = roundf(m_state->m_alpha * 256);
+ if (alpha > 255)
+ alpha = 255;
+ else if (alpha < 0)
+ alpha = 0;
+ return alpha;
+}
+
void PlatformContextSkia::setTextDrawingMode(int mode)
{
// cTextClip is never used, so we assert that it isn't set:
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.h b/WebCore/platform/graphics/skia/PlatformContextSkia.h
index 84e5d78..110085d 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.h
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.h
@@ -134,6 +134,7 @@ public:
float getStrokeThickness() const;
int getTextDrawingMode() const;
float getAlpha() const;
+ int getNormalizedAlpha() const;
void beginPath();
void addPath(const SkPath&);
diff --git a/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp b/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
index cf90cb1..057bcfc 100644
--- a/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
+++ b/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
@@ -683,7 +683,6 @@ void TextureMapperNode::uploadTextureFromContent(TextureMapper* textureMapper, c
|| (!m_currentContent.needsDisplay && m_currentContent.needsDisplayRect.isEmpty() && !needsReset))
return;
- WTF::StopWatch stopWatch;
IntRect dirtyRect = IntRect(0, 0, m_size.width(), m_size.height());
if (!needsReset && !m_currentContent.needsDisplay)
dirtyRect.intersect(m_currentContent.needsDisplayRect);
@@ -701,15 +700,6 @@ void TextureMapperNode::uploadTextureFromContent(TextureMapper* textureMapper, c
m_layer->paintGraphicsLayerContents(context, dirtyRect);
}
m_texture->endPaint();
- {
-#if 0
- LOG("[TextureMapper] Re-render(%d) layer(%p) %d::%d::%d (%dx%d) [%dms]\n", ++renderCount, this,
- needsReset, m_currentContent.needsDisplay, !m_currentContent.needsDisplayRect.isEmpty(),
- dirtyRect.width(), dirtyRect.height(), int(stopWatch.elapsed() * 1000));
- static int renderCount = 0;
- m_texture->save(String().format("/tmp/layer_%d.png", renderCount));
-#endif
- }
m_currentContent.needsDisplay = false;
}
@@ -739,8 +729,6 @@ void TextureMapperNode::paintSelf(const TexmapPaintOptions& options)
void TextureMapperNode::paintRecursive(TexmapPaintOptions options)
{
- WTF::StopWatch stopWatch;
-
bool isDirty = m_state.dirty;
m_state.dirty = false;
diff --git a/WebCore/platform/graphics/win/FontCustomPlatformData.cpp b/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
index 6e59ad7..9cae99b 100644
--- a/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
@@ -59,7 +59,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
}
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode renderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode renderingMode)
{
ASSERT(m_fontReference);
ASSERT(T2embedLibrary());
diff --git a/WebCore/platform/graphics/win/FontCustomPlatformData.h b/WebCore/platform/graphics/win/FontCustomPlatformData.h
index d19a8a5..1bdf270 100644
--- a/WebCore/platform/graphics/win/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/win/FontCustomPlatformData.h
@@ -21,6 +21,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include "PlatformString.h"
#include <wtf/Forward.h>
@@ -42,7 +43,7 @@ struct FontCustomPlatformData : Noncopyable {
~FontCustomPlatformData();
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
static bool supportsFormat(const String&);
diff --git a/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp b/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp
index 02c5b99..c3decbf 100644
--- a/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp
+++ b/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp
@@ -32,7 +32,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
cairo_font_face_destroy(m_fontFace);
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation)
{
return FontPlatformData(m_fontFace, size, bold, italic);
}
diff --git a/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h b/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h
index 525957f..3ab52b8 100644
--- a/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h
+++ b/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h
@@ -22,6 +22,7 @@
#ifndef FontCustomPlatformDataCairo_h
#define FontCustomPlatformDataCairo_h
+#include "FontDescription.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
@@ -39,7 +40,7 @@ struct FontCustomPlatformData : Noncopyable {
}
~FontCustomPlatformData();
- FontPlatformData fontPlatformData(int size, bool bold, bool italic);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal);
static bool supportsFormat(const String&);
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
index 1b4f1d9..5544229 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
@@ -36,6 +36,7 @@
#include "KURL.h"
#include "MediaPlayerPrivateTaskTimer.h"
#include "QTCFDictionary.h"
+#include "QTDecompressionSession.h"
#include "QTMovie.h"
#include "QTMovieTask.h"
#include "QTMovieVisualContext.h"
@@ -728,12 +729,24 @@ void MediaPlayerPrivateQuickTimeVisualContext::paint(GraphicsContext* p, const I
if (currentMode == MediaRenderingSoftwareRenderer && !m_visualContext)
return;
-#if USE(ACCELERATED_COMPOSITING)
- if (m_qtVideoLayer)
- return;
-#endif
QTPixelBuffer buffer = m_visualContext->imageForTime(0);
if (buffer.pixelBufferRef()) {
+#if USE(ACCELERATED_COMPOSITING)
+ if (m_qtVideoLayer) {
+ // We are probably being asked to render the video into a canvas, but
+ // there's a good chance the QTPixelBuffer is not ARGB and thus can't be
+ // drawn using CG. If so, fire up an ICMDecompressionSession and convert
+ // the current frame into something which can be rendered by CG.
+ if (!buffer.pixelFormatIs32ARGB() && !buffer.pixelFormatIs32BGRA()) {
+ // The decompression session will only decompress a specific pixelFormat
+ // at a specific width and height; if these differ, the session must be
+ // recreated with the new parameters.
+ if (!m_decompressionSession || !m_decompressionSession->canDecompress(buffer))
+ m_decompressionSession = QTDecompressionSession::create(buffer.pixelFormatType(), buffer.width(), buffer.height());
+ buffer = m_decompressionSession->decompress(buffer);
+ }
+ }
+#endif
CGImageRef image = CreateCGImageFromPixelBuffer(buffer);
CGContextRef context = p->platformContext();
@@ -1089,7 +1102,7 @@ void MediaPlayerPrivateQuickTimeVisualContext::setUpVideoRendering()
m_player->mediaPlayerClient()->mediaPlayerRenderingModeChanged(m_player);
#endif
- QTMovieVisualContext::Type contextType = requiredDllsAvailable() && preferredMode == MediaRenderingMovieLayer ? QTMovieVisualContext::ConfigureForCAImageQueue : QTMovieVisualContext::ConfigureForCGImage;
+ QTPixelBuffer::Type contextType = requiredDllsAvailable() && preferredMode == MediaRenderingMovieLayer ? QTPixelBuffer::ConfigureForCAImageQueue : QTPixelBuffer::ConfigureForCGImage;
m_visualContext = QTMovieVisualContext::create(m_visualContextClient.get(), contextType);
m_visualContext->setMovie(m_movie.get());
}
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
index 4c62558..109fd0b 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
@@ -42,6 +42,7 @@
typedef struct CGImage *CGImageRef;
class QTMovie;
class QTMovieVisualContext;
+class QTDecompressionSession;
namespace WebCore {
@@ -178,6 +179,7 @@ private:
RefPtr<WKCACFLayer> m_qtVideoLayer;
OwnPtr<GraphicsLayer> m_transformLayer;
OwnPtr<WKCAImageQueue> m_imageQueue;
+ OwnPtr<QTDecompressionSession> m_decompressionSession;
CGAffineTransform m_movieTransform;
#endif
RefPtr<QTMovieVisualContext> m_visualContext;
diff --git a/WebCore/platform/graphics/win/QTDecompressionSession.cpp b/WebCore/platform/graphics/win/QTDecompressionSession.cpp
new file mode 100644
index 0000000..eeb3ca7
--- /dev/null
+++ b/WebCore/platform/graphics/win/QTDecompressionSession.cpp
@@ -0,0 +1,170 @@
+/*
+ * Copyright (C) 2010 Apple, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+
+#include "QTDecompressionSession.h"
+
+#include <ImageCompression.h>
+#include <algorithm>
+
+class QTDecompressionSessionClient {
+public:
+ static void trackingCallback(void *decompressionTrackingRefCon, OSStatus,
+ ICMDecompressionTrackingFlags decompressionTrackingFlags, CVPixelBufferRef pixelBuffer,
+ TimeValue64, TimeValue64, ICMValidTimeFlags, void *, void *)
+ {
+ QTDecompressionSession* session = static_cast<QTDecompressionSession*>(decompressionTrackingRefCon);
+ ASSERT(session);
+
+ if (decompressionTrackingFlags & kICMDecompressionTracking_FrameDecoded)
+ session->m_latestFrame = QTPixelBuffer(pixelBuffer);
+ }
+};
+
+PassOwnPtr<QTDecompressionSession> QTDecompressionSession::create(unsigned long pixelFormat, size_t width, size_t height)
+{
+ return adoptPtr(new QTDecompressionSession(pixelFormat, width, height));
+}
+
+QTDecompressionSession::QTDecompressionSession(unsigned long pixelFormat, size_t width, size_t height)
+ : m_session(0)
+ , m_pixelFormat(pixelFormat)
+ , m_width(width)
+ , m_height(height)
+{
+ initializeSession();
+}
+
+QTDecompressionSession::~QTDecompressionSession()
+{
+ if (m_session)
+ ICMDecompressionSessionRelease(m_session);
+}
+
+void QTDecompressionSession::initializeSession()
+{
+ if (m_session)
+ return;
+
+ ICMPixelFormatInfo pixelFormatInfo = {sizeof(ICMPixelFormatInfo), 0};
+ if (ICMGetPixelFormatInfo(m_pixelFormat, &pixelFormatInfo) != noErr) {
+ // The ICM does not know anything about the pixelFormat contained in
+ // the pixel buffer, so it won't be able to convert it to RGBA.
+ return;
+ }
+
+ // The depth and cType fields of the ImageDescriptionHandle are filled
+ // out according to the instructions in Technical Q&A QA1183:
+ // http://developer.apple.com/library/mac/#qa/qa2001/qa1183.html
+ bool isIndexed = pixelFormatInfo.formatFlags & kICMPixelFormatIsIndexed;
+ bool isQD = pixelFormatInfo.formatFlags & kICMPixelFormatIsSupportedByQD;
+ bool isMonochrome = pixelFormatInfo.formatFlags & kICMPixelFormatIsMonochrome;
+ bool hasAlpha = pixelFormatInfo.formatFlags & kICMPixelFormatHasAlphaChannel;
+
+ unsigned int depth = 24; // The default depth is 24.
+ if (hasAlpha)
+ depth = 32; // Any pixel format with alpha gets a depth of 32.
+ else if (isMonochrome) {
+ // Grayscale pixel formats get depths 33 through 40, depending
+ // on their bits per pixel. Yes, this means that 16-bit grayscale
+ // and 8-bit grayscale have the same pixel depth.
+ depth = 32 + std::min<unsigned int>(8, pixelFormatInfo.bitsPerPixel[0]);
+ } else if (isIndexed) {
+ // Indexed pixel formats get a depth of 1 through 8, depending on
+ // the their bits per pixel.
+ depth = pixelFormatInfo.bitsPerPixel[0];
+ }
+
+ // If QuickDraw supports the given pixel format, the cType should be kRawCodecType.
+ // Otherwise, use the pixel format code for the cType. We are assuming the pixel
+ // buffer is uncompressed.
+ unsigned long cType = isQD ? kRawCodecType : m_pixelFormat;
+
+ ImageDescriptionHandle description = (ImageDescriptionHandle)NewHandleClear(sizeof(ImageDescription));
+ (**description).idSize = sizeof(ImageDescription);
+ (**description).cType = cType;
+ (**description).version = 2;
+ (**description).spatialQuality = codecLosslessQuality;
+ (**description).width = m_width;
+ (**description).height = m_height;
+ (**description).hRes = 72 << 16; // 72 DPI as a fixed-point number
+ (**description).vRes = 72 << 16; // 72 DPI as a fixed-point number
+ (**description).frameCount = 1;
+ (**description).depth = depth;
+ (**description).clutID = -1;
+
+ // Create the mandatory ICMDecompressionSessionOptions, but leave
+ // all the default values.
+ ICMDecompressionSessionOptionsRef options = 0;
+ ICMDecompressionSessionOptionsCreate(kCFAllocatorDefault, &options);
+
+ CFDictionaryRef pixelBufferAttributes = QTPixelBuffer::createPixelBufferAttributesDictionary(QTPixelBuffer::ConfigureForCGImage);
+
+ ICMDecompressionTrackingCallbackRecord callback = {
+ QTDecompressionSessionClient::trackingCallback,
+ this,
+ };
+
+ ICMDecompressionSessionCreate(kCFAllocatorDefault,
+ description,
+ options,
+ pixelBufferAttributes,
+ &callback,
+ &m_session);
+
+ if (pixelBufferAttributes)
+ CFRelease(pixelBufferAttributes);
+
+ ICMDecompressionSessionOptionsRelease(options);
+ DisposeHandle((Handle)description);
+}
+
+bool QTDecompressionSession::canDecompress(QTPixelBuffer inBuffer)
+{
+ return m_session
+ && inBuffer.pixelFormatType() == m_pixelFormat
+ && inBuffer.width() == m_width
+ && inBuffer.height() == m_height;
+}
+
+QTPixelBuffer QTDecompressionSession::decompress(QTPixelBuffer inBuffer)
+{
+ if (!canDecompress(inBuffer))
+ return QTPixelBuffer();
+
+ inBuffer.lockBaseAddress();
+ ICMDecompressionSessionDecodeFrame(m_session,
+ static_cast<UInt8*>(inBuffer.baseAddress()),
+ inBuffer.dataSize(),
+ 0, // frameOptions
+ 0, // frameTime
+ 0); // sourceFrameRefCon
+
+ // Because we passed in 0 for frameTime, the above function
+ // is synchronous, and the client callback will have been
+ // called before the function returns, and m_latestFrame
+ // will contain the newly decompressed frame.
+ return m_latestFrame;
+}
diff --git a/WebCore/platform/graphics/win/QTDecompressionSession.h b/WebCore/platform/graphics/win/QTDecompressionSession.h
new file mode 100644
index 0000000..67b6635
--- /dev/null
+++ b/WebCore/platform/graphics/win/QTDecompressionSession.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Apple, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef QTDecompressionSession_h
+#define QTDecompressionSession_h
+
+#ifdef QTMOVIEWIN_EXPORTS
+#define QTMOVIEWIN_API __declspec(dllexport)
+#else
+#define QTMOVIEWIN_API __declspec(dllimport)
+#endif
+
+#include "QTPixelBuffer.h"
+
+#include <WTF/PassOwnPtr.h>
+
+class QTDecompressionSessionClient;
+typedef struct OpaqueICMDecompressionSession* ICMDecompressionSessionRef;
+
+class QTMOVIEWIN_API QTDecompressionSession {
+public:
+ static PassOwnPtr<QTDecompressionSession> create(unsigned long pixelFormat, size_t width, size_t height);
+ ~QTDecompressionSession();
+
+ bool canDecompress(QTPixelBuffer);
+
+ // The resulting QTPixelBuffer will be a CG compatable ARGB pixel buffer.
+ QTPixelBuffer decompress(QTPixelBuffer);
+
+private:
+ friend class QTDecompressionSessionClient;
+ QTDecompressionSession(unsigned long pixelFormat, size_t width, size_t height);
+ void initializeSession();
+
+ unsigned long m_pixelFormat;
+ size_t m_width;
+ size_t m_height;
+ QTPixelBuffer m_latestFrame;
+ ICMDecompressionSessionRef m_session;
+};
+
+#endif
diff --git a/WebCore/platform/graphics/win/QTMovieVisualContext.cpp b/WebCore/platform/graphics/win/QTMovieVisualContext.cpp
index 0232d3b..0fcc7e2 100644
--- a/WebCore/platform/graphics/win/QTMovieVisualContext.cpp
+++ b/WebCore/platform/graphics/win/QTMovieVisualContext.cpp
@@ -39,7 +39,7 @@ struct QTCVTimeStamp {
class QTMovieVisualContextPriv {
public:
- QTMovieVisualContextPriv(QTMovieVisualContext* parent, QTMovieVisualContextClient* client, QTMovieVisualContext::Type contextType);
+ QTMovieVisualContextPriv(QTMovieVisualContext* parent, QTMovieVisualContextClient* client, QTPixelBuffer::Type contextType);
~QTMovieVisualContextPriv();
bool isImageAvailableForTime(const QTCVTimeStamp*) const;
@@ -61,61 +61,28 @@ private:
};
-static OSStatus SetNumberValue(CFMutableDictionaryRef inDict, CFStringRef inKey, SInt32 inValue)
+static CFDictionaryRef createPixelBufferOptionsDictionary(QTPixelBuffer::Type contextType)
{
- CFNumberRef number;
-
- number = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &inValue);
- if (!number)
- return coreFoundationUnknownErr;
-
- CFDictionarySetValue(inDict, inKey, number);
- CFRelease(number);
-
- return noErr;
-}
-
-static CFDictionaryRef createPixelBufferOptionsDictionary(QTMovieVisualContext::Type contextType)
-{
- static const CFStringRef kDirect3DCompatibilityKey = CFSTR("Direct3DCompatibility");
-
- CFMutableDictionaryRef pixelBufferOptions = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
-
- CFMutableDictionaryRef pixelBufferAttributes = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
- if (contextType == QTMovieVisualContext::ConfigureForCAImageQueue) {
- // Ask for D3D compatible pixel buffers so no further work is needed.
- CFDictionarySetValue(pixelBufferAttributes, kDirect3DCompatibilityKey, kCFBooleanTrue);
- } else {
- // Use the k32BGRAPixelFormat, as QuartzCore will be able to use the pixels directly,
- // without needing an additional copy or rendering pass.
- SetNumberValue(pixelBufferAttributes, kCVPixelBufferPixelFormatTypeKey, k32BGRAPixelFormat);
-
- // Set kCVPixelBufferBytesPerRowAlignmentKey to 16 to ensure that each row of pixels
- // starts at a 16 byte aligned address for most efficient data reading.
- SetNumberValue(pixelBufferAttributes, kCVPixelBufferBytesPerRowAlignmentKey, 16);
- CFDictionarySetValue(pixelBufferAttributes, kCVPixelBufferCGImageCompatibilityKey, kCFBooleanTrue);
- }
-
- CFDictionarySetValue(pixelBufferOptions, kQTVisualContextPixelBufferAttributesKey, pixelBufferAttributes);
-
- CFRelease(pixelBufferAttributes);
-
+ const void* key = kQTVisualContextPixelBufferAttributesKey;
+ const void* value = QTPixelBuffer::createPixelBufferAttributesDictionary(contextType);
+ CFDictionaryRef pixelBufferOptions = CFDictionaryCreate(kCFAllocatorDefault, &key, &value, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ CFRelease(value);
return pixelBufferOptions;
}
-static CFDictionaryRef pixelBufferCreationOptions(QTMovieVisualContext::Type contextType)
+static CFDictionaryRef pixelBufferCreationOptions(QTPixelBuffer::Type contextType)
{
- if (contextType == QTMovieVisualContext::ConfigureForCAImageQueue) {
+ if (contextType == QTPixelBuffer::ConfigureForCAImageQueue) {
static CFDictionaryRef imageQueueOptions = createPixelBufferOptionsDictionary(contextType);
return imageQueueOptions;
}
- ASSERT(contextType == QTMovieVisualContext::ConfigureForCGImage);
+ ASSERT(contextType == QTPixelBuffer::ConfigureForCGImage);
static CFDictionaryRef cgImageOptions = createPixelBufferOptionsDictionary(contextType);
return cgImageOptions;
}
-QTMovieVisualContextPriv::QTMovieVisualContextPriv(QTMovieVisualContext* parent, QTMovieVisualContextClient* client, QTMovieVisualContext::Type contextType)
+QTMovieVisualContextPriv::QTMovieVisualContextPriv(QTMovieVisualContext* parent, QTMovieVisualContextClient* client, QTPixelBuffer::Type contextType)
: m_parent(parent)
, m_client(client)
, m_visualContext(0)
@@ -206,12 +173,12 @@ void QTMovieVisualContextPriv::imageAvailableCallback(QTVisualContextRef visualC
vc->m_client->imageAvailableForTime(reinterpret_cast<const QTCVTimeStamp*>(timeStamp));
}
-PassRefPtr<QTMovieVisualContext> QTMovieVisualContext::create(QTMovieVisualContextClient* client, Type contextType)
+PassRefPtr<QTMovieVisualContext> QTMovieVisualContext::create(QTMovieVisualContextClient* client, QTPixelBuffer::Type contextType)
{
return adoptRef(new QTMovieVisualContext(client, contextType));
}
-QTMovieVisualContext::QTMovieVisualContext(QTMovieVisualContextClient* client, Type contextType)
+QTMovieVisualContext::QTMovieVisualContext(QTMovieVisualContextClient* client, QTPixelBuffer::Type contextType)
: m_private(new QTMovieVisualContextPriv(this, client, contextType))
{
}
diff --git a/WebCore/platform/graphics/win/QTMovieVisualContext.h b/WebCore/platform/graphics/win/QTMovieVisualContext.h
index 057031e..8410208 100644
--- a/WebCore/platform/graphics/win/QTMovieVisualContext.h
+++ b/WebCore/platform/graphics/win/QTMovieVisualContext.h
@@ -54,9 +54,7 @@ public:
class QTMOVIEWIN_API QTMovieVisualContext : public RefCounted<QTMovieVisualContext> {
public:
- enum Type { ConfigureForCGImage, ConfigureForCAImageQueue };
-
- static PassRefPtr<QTMovieVisualContext> create(QTMovieVisualContextClient*, Type);
+ static PassRefPtr<QTMovieVisualContext> create(QTMovieVisualContextClient*, QTPixelBuffer::Type);
~QTMovieVisualContext();
bool isImageAvailableForTime(const QTCVTimeStamp*) const;
@@ -71,7 +69,7 @@ public:
static double currentHostTime();
protected:
- QTMovieVisualContext(QTMovieVisualContextClient*, Type);
+ QTMovieVisualContext(QTMovieVisualContextClient*, QTPixelBuffer::Type);
void setupVisualContext();
friend class QTMovieVisualContextPriv;
diff --git a/WebCore/platform/graphics/win/QTPixelBuffer.cpp b/WebCore/platform/graphics/win/QTPixelBuffer.cpp
index 657b68e..44a1b0e 100644
--- a/WebCore/platform/graphics/win/QTPixelBuffer.cpp
+++ b/WebCore/platform/graphics/win/QTPixelBuffer.cpp
@@ -26,6 +26,7 @@
#include "QTPixelBuffer.h"
+#include <CFNumber.h>
#include <CFString.h>
#include <CGColorSpace.h>
#include <CGImage.h>
@@ -33,6 +34,41 @@
#include <QuickDraw.h>
#include <memory.h>
+static OSStatus SetNumberValue(CFMutableDictionaryRef inDict, CFStringRef inKey, SInt32 inValue)
+{
+ CFNumberRef number;
+
+ number = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &inValue);
+ if (!number)
+ return coreFoundationUnknownErr;
+
+ CFDictionarySetValue(inDict, inKey, number);
+ CFRelease(number);
+
+ return noErr;
+}
+
+CFDictionaryRef QTPixelBuffer::createPixelBufferAttributesDictionary(QTPixelBuffer::Type contextType)
+{
+ static const CFStringRef kDirect3DCompatibilityKey = CFSTR("Direct3DCompatibility");
+
+ CFMutableDictionaryRef pixelBufferAttributes = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ if (contextType == QTPixelBuffer::ConfigureForCAImageQueue) {
+ // Ask for D3D compatible pixel buffers so no further work is needed.
+ CFDictionarySetValue(pixelBufferAttributes, kDirect3DCompatibilityKey, kCFBooleanTrue);
+ } else {
+ // Use the k32BGRAPixelFormat, as QuartzCore will be able to use the pixels directly,
+ // without needing an additional copy or rendering pass.
+ SetNumberValue(pixelBufferAttributes, kCVPixelBufferPixelFormatTypeKey, k32BGRAPixelFormat);
+
+ // Set kCVPixelBufferBytesPerRowAlignmentKey to 16 to ensure that each row of pixels
+ // starts at a 16 byte aligned address for most efficient data reading.
+ SetNumberValue(pixelBufferAttributes, kCVPixelBufferBytesPerRowAlignmentKey, 16);
+ CFDictionarySetValue(pixelBufferAttributes, kCVPixelBufferCGImageCompatibilityKey, kCFBooleanTrue);
+ }
+ return pixelBufferAttributes;
+}
+
QTPixelBuffer::QTPixelBuffer()
: m_pixelBuffer(0)
{
diff --git a/WebCore/platform/graphics/win/QTPixelBuffer.h b/WebCore/platform/graphics/win/QTPixelBuffer.h
index 22f8ba4..13630da 100644
--- a/WebCore/platform/graphics/win/QTPixelBuffer.h
+++ b/WebCore/platform/graphics/win/QTPixelBuffer.h
@@ -44,6 +44,9 @@ typedef const struct __CFDictionary * CFDictionaryRef;
// safe to call within WebKit.
class QTMOVIEWIN_API QTPixelBuffer {
public:
+ enum Type { ConfigureForCGImage, ConfigureForCAImageQueue };
+ static CFDictionaryRef createPixelBufferAttributesDictionary(Type);
+
QTPixelBuffer();
QTPixelBuffer(const QTPixelBuffer&);
QTPixelBuffer(CVPixelBufferRef);
diff --git a/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp b/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp
index 3605c72..f61ae8e 100644
--- a/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp
@@ -45,7 +45,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
g_customFontCache->unregisterFont(m_name);
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode renderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode renderingMode)
{
FontDescription fontDesc;
fontDesc.setComputedSize(size);
diff --git a/WebCore/platform/graphics/wince/FontCustomPlatformData.h b/WebCore/platform/graphics/wince/FontCustomPlatformData.h
index 5ce0ea6..abdc0f2 100644
--- a/WebCore/platform/graphics/wince/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/wince/FontCustomPlatformData.h
@@ -21,6 +21,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontDescription.h"
#include "FontRenderingMode.h"
#include "PlatformString.h"
#include <wtf/Noncopyable.h>
@@ -44,7 +45,7 @@ namespace WebCore {
~FontCustomPlatformData();
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation fontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
static bool supportsFormat(const String&);
diff --git a/WebCore/platform/graphics/wince/FontPlatformData.cpp b/WebCore/platform/graphics/wince/FontPlatformData.cpp
index d84a7cc..d9d8a72 100644
--- a/WebCore/platform/graphics/wince/FontPlatformData.cpp
+++ b/WebCore/platform/graphics/wince/FontPlatformData.cpp
@@ -148,7 +148,7 @@ struct FixedSizeFontDataKeyHash {
font.m_weight,
// static_cast<unsigned>(font.m_italic);
};
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
static bool equal(const FixedSizeFontDataKey& a, const FixedSizeFontDataKey& b)
diff --git a/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp b/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
index a0c10fc..a11b8d8 100644
--- a/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
+++ b/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
@@ -283,7 +283,7 @@ public:
return 0;
}
- RefPtr<SharedBitmap> bmp = SharedBitmap::createInstance(alphaPaint == AlphaPaintNone, origRect.width(), origRect.height(), false);
+ RefPtr<SharedBitmap> bmp = SharedBitmap::create(origRect.size(), alphaPaint == AlphaPaintNone ? BitmapInfo::BitCount16 : BitmapInfo::BitCount32, false);
SetRect(&bmpRect, 0, 0, origRect.width(), origRect.height());
if (bmp) {
switch (alphaPaint) {
@@ -523,7 +523,7 @@ TransparentLayerDC::TransparentLayerDC(GraphicsContextPlatformPrivate* data, Int
origRect.inflateX(stableRound((width - origRect.width()) * 0.5));
origRect.inflateY(stableRound((height - origRect.height()) * 0.5));
- m_bitmap = SharedBitmap::createInstance(m_rotatedBitmap->is16bit(), m_origRect.width(), m_origRect.height(), true);
+ m_bitmap = SharedBitmap::create(m_origRect.size(), m_rotatedBitmap->is16bit() ? BitmapInfo::BitCount16 : BitmapInfo::BitCount32, true);
if (m_bitmap)
rotateBitmap(m_bitmap.get(), m_rotatedBitmap.get(), -m_rotation);
else
@@ -608,15 +608,13 @@ void GraphicsContext::setBitmap(PassRefPtr<SharedBitmap> bmp)
HDC GraphicsContext::getWindowsContext(const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap)
{
- notImplemented();
- ASSERT_NOT_REACHED();
- return 0;
+ // FIXME: Add support for AlphaBlend.
+ ASSERT(!supportAlphaBlend);
+ return m_data->m_dc;
}
void GraphicsContext::releaseWindowsContext(HDC hdc, const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap)
{
- notImplemented();
- ASSERT_NOT_REACHED();
}
void GraphicsContext::savePlatformState()
@@ -1779,7 +1777,7 @@ void GraphicsContext::drawFrameControl(const IntRect& rect, unsigned type, unsig
RECT rectWin = trRect;
if ((rectWin.right - rectWin.left) < boxWidthBest) {
- RefPtr<SharedBitmap> bmp = SharedBitmap::createInstance(true, boxWidthBest, boxHeightBest, true);
+ RefPtr<SharedBitmap> bmp = SharedBitmap::create(IntSize(boxWidthBest, boxHeightBest), BitmapInfo::BitCount16, true);
SharedBitmap::DCHolder memDC(bmp.get());
if (memDC.get()) {
RECT tempRect = {0, 0, boxWidthBest, boxHeightBest};
diff --git a/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp b/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp
index 15720f3..ec8517b 100644
--- a/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp
+++ b/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp
@@ -64,7 +64,7 @@ void BufferedImage::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect
}
ImageBufferData::ImageBufferData(const IntSize& size)
-: m_bitmap(SharedBitmap::createInstance(false, size.width(), size.height(), false))
+ : m_bitmap(SharedBitmap::create(size, BitmapInfo::BitCount32, false))
{
// http://www.w3.org/TR/2009/WD-html5-20090212/the-canvas-element.html#canvaspixelarray
// "When the canvas is initialized it must be set to fully transparent black."
@@ -72,7 +72,7 @@ ImageBufferData::ImageBufferData(const IntSize& size)
m_bitmap->setHasAlpha(true);
}
-ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace colorSpace, bool& success)
+ImageBuffer::ImageBuffer(const IntSize& size, ColorSpace colorSpace, bool& success)
: m_data(size)
, m_size(size)
{
diff --git a/WebCore/platform/graphics/wince/ImageWinCE.cpp b/WebCore/platform/graphics/wince/ImageWinCE.cpp
index 53b9b68..ec7403e 100644
--- a/WebCore/platform/graphics/wince/ImageWinCE.cpp
+++ b/WebCore/platform/graphics/wince/ImageWinCE.cpp
@@ -43,11 +43,7 @@ namespace WebCore {
NativeImagePtr RGBA32Buffer::asNewNativeImage() const
{
- NativeImagePtr image = SharedBitmap::createInstance(false, width(), height(), false);
-
- memcpy(image->bytes(), m_bytes.data(), m_bytes.size() * sizeof(PixelData));
-
- return image;
+ return SharedBitmap::create(m_bytes, m_size, hasAlpha());
}
bool FrameData::clear(bool clearMetaData)
diff --git a/WebCore/platform/graphics/wx/FontCustomPlatformData.cpp b/WebCore/platform/graphics/wx/FontCustomPlatformData.cpp
index 4cebe43..6133372 100644
--- a/WebCore/platform/graphics/wx/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/wx/FontCustomPlatformData.cpp
@@ -31,7 +31,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
{
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
{
return FontPlatformData(size, bold, italic);
}
diff --git a/WebCore/platform/graphics/wx/FontCustomPlatformData.h b/WebCore/platform/graphics/wx/FontCustomPlatformData.h
index a7dfe37..cc348e3 100644
--- a/WebCore/platform/graphics/wx/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/wx/FontCustomPlatformData.h
@@ -21,6 +21,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
@@ -37,7 +38,7 @@ namespace WebCore {
static bool supportsFormat(const String&);
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
};
FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer*);
diff --git a/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp b/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
index b77a03b..66c69ee 100644
--- a/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
+++ b/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
@@ -111,20 +111,25 @@ FontPlatformData::FontPlatformData(const FontDescription& desc, const AtomicStri
m_size = desc.computedPixelSize();
m_fontState = VALID;
m_size = desc.computedPixelSize();
-
}
-unsigned FontPlatformData::computeHash() const {
- wxFont* thisFont = m_font->font();
- ASSERT(thisFont && thisFont->IsOk());
-
- // make a hash that is unique for this font, but not globally unique - that is,
- // a font whose properties are equal should generate the same hash
- uintptr_t hashCodes[6] = { thisFont->GetPointSize(), thisFont->GetFamily(), thisFont->GetStyle(),
- thisFont->GetWeight(), thisFont->GetUnderlined(),
- StringImpl::computeHash(thisFont->GetFaceName().utf8_str()) };
-
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+unsigned FontPlatformData::computeHash() const
+{
+ wxFont* thisFont = m_font->font();
+ ASSERT(thisFont && thisFont->IsOk());
+
+ // make a hash that is unique for this font, but not globally unique - that is,
+ // a font whose properties are equal should generate the same hash
+ uintptr_t hashCodes[6] = {
+ thisFont->GetPointSize(),
+ thisFont->GetFamily(),
+ thisFont->GetStyle(),
+ thisFont->GetWeight(),
+ thisFont->GetUnderlined(),
+ StringImpl::computeHash(thisFont->GetFaceName().utf8_str())
+ };
+
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
FontPlatformData::~FontPlatformData()
diff --git a/WebCore/platform/gtk/RenderThemeGtk.cpp b/WebCore/platform/gtk/RenderThemeGtk.cpp
index b2e3fd2..8df5cda 100644
--- a/WebCore/platform/gtk/RenderThemeGtk.cpp
+++ b/WebCore/platform/gtk/RenderThemeGtk.cpp
@@ -450,13 +450,56 @@ bool RenderThemeGtk::paintButton(RenderObject* o, const PaintInfo& i, const IntR
return paintRenderObject(MOZ_GTK_BUTTON, o, i.context, rect, GTK_RELIEF_NORMAL);
}
-void RenderThemeGtk::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, WebCore::Element* e) const
+static void getComboBoxPadding(RenderStyle* style, int& left, int& top, int& right, int& bottom)
{
- style->resetBorder();
- style->resetPadding();
- style->setHeight(Length(Auto));
- style->setWhiteSpace(PRE);
- adjustMozillaStyle(this, style, MOZ_GTK_DROPDOWN);
+ // If this menu list button isn't drawn using the native theme, we
+ // don't add any extra padding beyond what WebCore already uses.
+ if (style->appearance() == NoControlPart)
+ return;
+ moz_gtk_get_widget_border(MOZ_GTK_DROPDOWN, &left, &top, &right, &bottom,
+ gtkTextDirection(style->direction()), TRUE);
+}
+
+int RenderThemeGtk::popupInternalPaddingLeft(RenderStyle* style) const
+{
+ int left = 0, top = 0, right = 0, bottom = 0;
+ getComboBoxPadding(style, left, top, right, bottom);
+ return left;
+}
+
+int RenderThemeGtk::popupInternalPaddingRight(RenderStyle* style) const
+{
+ int left = 0, top = 0, right = 0, bottom = 0;
+ getComboBoxPadding(style, left, top, right, bottom);
+ return right;
+}
+
+int RenderThemeGtk::popupInternalPaddingTop(RenderStyle* style) const
+{
+ int left = 0, top = 0, right = 0, bottom = 0;
+ getComboBoxPadding(style, left, top, right, bottom);
+ return top;
+}
+
+int RenderThemeGtk::popupInternalPaddingBottom(RenderStyle* style) const
+{
+ int left = 0, top = 0, right = 0, bottom = 0;
+ getComboBoxPadding(style, left, top, right, bottom);
+ return bottom;
+}
+
+void RenderThemeGtk::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+ // The tests check explicitly that select menu buttons ignore line height.
+ style->setLineHeight(RenderStyle::initialLineHeight());
+
+ // We cannot give a proper rendering when border radius is active, unfortunately.
+ style->resetBorderRadius();
+}
+
+void RenderThemeGtk::adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+ adjustMenuListStyle(selector, style, e);
}
bool RenderThemeGtk::paintMenuList(RenderObject* o, const PaintInfo& i, const IntRect& rect)
@@ -464,6 +507,11 @@ bool RenderThemeGtk::paintMenuList(RenderObject* o, const PaintInfo& i, const In
return paintRenderObject(MOZ_GTK_DROPDOWN, o, i.context, rect);
}
+bool RenderThemeGtk::paintMenuListButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+{
+ return paintMenuList(object, info, rect);
+}
+
void RenderThemeGtk::adjustTextFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
{
style->resetBorder();
diff --git a/WebCore/platform/gtk/RenderThemeGtk.h b/WebCore/platform/gtk/RenderThemeGtk.h
index 4e24c97..6d324b6 100644
--- a/WebCore/platform/gtk/RenderThemeGtk.h
+++ b/WebCore/platform/gtk/RenderThemeGtk.h
@@ -5,7 +5,7 @@
* Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
* Copyright (C) 2007 Holger Hans Peter Freyther
* Copyright (C) 2007 Alp Toker <alp@atoker.com>
- * Copyright (C) 2009 Kenneth Rohde Christiansen
+ * Copyright (C) 2010 Igalia S.L.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or
@@ -102,8 +102,19 @@ protected:
virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
+ int popupInternalPaddingLeft(RenderStyle*) const;
+ int popupInternalPaddingRight(RenderStyle*) const;
+ int popupInternalPaddingTop(RenderStyle*) const;
+ int popupInternalPaddingBottom(RenderStyle*) const;
+
+ // The Mac port differentiates between the "menu list" and the "menu list button."
+ // The former is used when a menu list button has been styled. This is used to ensure
+ // Aqua themed controls whenever possible. We always want to use GTK+ theming, so
+ // we don't maintain this differentiation.
virtual void adjustMenuListStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+ virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element* e) const;
virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
+ virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInfo&, const IntRect&);
diff --git a/WebCore/platform/gtk/ScrollViewGtk.cpp b/WebCore/platform/gtk/ScrollViewGtk.cpp
index ebcdaa1..a8c7562 100644
--- a/WebCore/platform/gtk/ScrollViewGtk.cpp
+++ b/WebCore/platform/gtk/ScrollViewGtk.cpp
@@ -78,48 +78,29 @@ PassRefPtr<Scrollbar> ScrollView::createScrollbar(ScrollbarOrientation orientati
return MainFrameScrollbarGtk::create(this, orientation, m_verticalAdjustment.get());
}
-/*
- * The following is assumed:
- * (hadj && vadj) || (!hadj && !vadj)
- */
-void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, bool resetValues)
+void ScrollView::setHorizontalAdjustment(GtkAdjustment* hadj, bool resetValues)
{
- ASSERT(!hadj == !vadj);
-
- // If this is a non-main frame ScrollView, we do not want to set the
- // m_horizontalAdjustments & m_verticalAdjustments members. At the same
- // time we want to to allow FrameLoaderClientGtk.cpp to call
- // ScrollView::setGtkAdjustments(0, 0) unconditionally.
ASSERT(!parent() || !hadj);
if (parent())
return;
m_horizontalAdjustment = hadj;
- m_verticalAdjustment = vadj;
if (!m_horizontalAdjustment) {
MainFrameScrollbarGtk* hScrollbar = reinterpret_cast<MainFrameScrollbarGtk*>(horizontalScrollbar());
if (hScrollbar)
hScrollbar->detachAdjustment();
- MainFrameScrollbarGtk* vScrollbar = reinterpret_cast<MainFrameScrollbarGtk*>(verticalScrollbar());
- if (vScrollbar)
- vScrollbar->detachAdjustment();
-
return;
}
// We may be lacking scrollbars when returning to a cached
// page, this kicks the page to recreate the scrollbars.
- setHasVerticalScrollbar(true);
setHasHorizontalScrollbar(true);
MainFrameScrollbarGtk* hScrollbar = reinterpret_cast<MainFrameScrollbarGtk*>(horizontalScrollbar());
hScrollbar->attachAdjustment(m_horizontalAdjustment.get());
- MainFrameScrollbarGtk* vScrollbar = reinterpret_cast<MainFrameScrollbarGtk*>(verticalScrollbar());
- vScrollbar->attachAdjustment(m_verticalAdjustment.get());
-
// We used to reset everything to 0 here, but when page cache
// is enabled we reuse FrameViews that are cached. Since their
// size is not going to change when being restored, (which is
@@ -127,7 +108,6 @@ void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, boo
// set in the normal case), we make sure they are up-to-date
// here. This is needed for the parent scrolling widget to be
// able to report correct values.
-
int horizontalPageStep = max(max<int>(frameRect().width() * Scrollbar::minFractionToStepWhenPaging(), frameRect().width() - Scrollbar::maxOverlapBetweenPages()), 1);
gtk_adjustment_configure(m_horizontalAdjustment.get(),
resetValues ? 0 : scrollOffset().width(), 0,
@@ -135,8 +115,39 @@ void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, boo
resetValues ? 0 : Scrollbar::pixelsPerLineStep(),
resetValues ? 0 : horizontalPageStep,
resetValues ? 0 : frameRect().width());
+}
+
+void ScrollView::setVerticalAdjustment(GtkAdjustment* vadj, bool resetValues)
+{
+ ASSERT(!parent() || !vadj);
+ if (parent())
+ return;
+
+ m_verticalAdjustment = vadj;
+
+ if (!m_verticalAdjustment) {
+ MainFrameScrollbarGtk* vScrollbar = reinterpret_cast<MainFrameScrollbarGtk*>(verticalScrollbar());
+ if (vScrollbar)
+ vScrollbar->detachAdjustment();
+
+ return;
+ }
+
+ // We may be lacking scrollbars when returning to a cached
+ // page, this kicks the page to recreate the scrollbars.
+ setHasVerticalScrollbar(true);
+
+ MainFrameScrollbarGtk* vScrollbar = reinterpret_cast<MainFrameScrollbarGtk*>(verticalScrollbar());
+ vScrollbar->attachAdjustment(m_verticalAdjustment.get());
- int verticalPageStep = max(max<int>(frameRect().height() * Scrollbar::minFractionToStepWhenPaging(), frameRect().height() - Scrollbar::maxOverlapBetweenPages()), 1);
+ // We used to reset everything to 0 here, but when page cache
+ // is enabled we reuse FrameViews that are cached. Since their
+ // size is not going to change when being restored, (which is
+ // what would cause the upper limit in the adjusments to be
+ // set in the normal case), we make sure they are up-to-date
+ // here. This is needed for the parent scrolling widget to be
+ // able to report correct values.
+ int verticalPageStep = max(max<int>(frameRect().width() * Scrollbar::minFractionToStepWhenPaging(), frameRect().width() - Scrollbar::maxOverlapBetweenPages()), 1);
gtk_adjustment_configure(m_verticalAdjustment.get(),
resetValues ? 0 : scrollOffset().height(), 0,
resetValues ? 0 : contentsSize().height(),
@@ -145,6 +156,12 @@ void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, boo
resetValues ? 0 : frameRect().height());
}
+void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, bool resetValues)
+{
+ setHorizontalAdjustment(hadj, resetValues);
+ setVerticalAdjustment(vadj, resetValues);
+}
+
void ScrollView::platformAddChild(Widget* child)
{
}
diff --git a/WebCore/platform/gtk/TemporaryLinkStubs.cpp b/WebCore/platform/gtk/TemporaryLinkStubs.cpp
index 8c12fcb..5c27080 100644
--- a/WebCore/platform/gtk/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/gtk/TemporaryLinkStubs.cpp
@@ -28,6 +28,7 @@
#include "config.h"
#include "AXObjectCache.h"
+#include "CookieStorage.h"
#include "DNS.h"
#include "Editor.h"
#include "FrameView.h"
@@ -46,5 +47,6 @@ namespace WebCore {
void getSupportedKeySizes(Vector<String>&) { notImplemented(); }
String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url) { return String(); }
float userIdleTime() { notImplemented(); return FLT_MAX; } // return an arbitrarily high userIdleTime so that releasing pages from the page cache isn't postponed
+void setCookieStoragePrivateBrowsingEnabled(bool) { notImplemented(); }
}
diff --git a/WebCore/platform/haiku/TemporaryLinkStubs.cpp b/WebCore/platform/haiku/TemporaryLinkStubs.cpp
index aa3d538..58ab873 100644
--- a/WebCore/platform/haiku/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/haiku/TemporaryLinkStubs.cpp
@@ -33,6 +33,7 @@
#include "config.h"
+#include "CookieStorage.h"
#include "KURL.h"
#include "NotImplemented.h"
#include "PlatformString.h"
@@ -76,5 +77,10 @@ String KURL::fileSystemPath() const
return String();
}
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
} // namespace WebCore
diff --git a/WebCore/platform/image-decoders/ImageDecoder.cpp b/WebCore/platform/image-decoders/ImageDecoder.cpp
index 10c0b3b..fa61871 100644
--- a/WebCore/platform/image-decoders/ImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/ImageDecoder.cpp
@@ -122,7 +122,7 @@ RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
if (this == &other)
return *this;
- copyBitmapData(other);
+ copyReferenceToBitmapData(other);
setRect(other.rect());
setStatus(other.status());
setDuration(other.duration());
@@ -133,7 +133,8 @@ RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
void RGBA32Buffer::clear()
{
- m_bytes.clear();
+ m_backingStore.clear();
+ m_bytes = 0;
m_status = FrameEmpty;
// NOTE: Do not reset other members here; clearFrameBufferCache() calls this
// to free the bitmap data, but other functions like initFrameBuffer() and
@@ -143,16 +144,25 @@ void RGBA32Buffer::clear()
void RGBA32Buffer::zeroFill()
{
- m_bytes.fill(0);
+ memset(m_bytes, 0, m_size.width() * m_size.height() * sizeof(PixelData));
m_hasAlpha = true;
}
+#if !PLATFORM(CF)
+
+void RGBA32Buffer::copyReferenceToBitmapData(const RGBA32Buffer& other)
+{
+ ASSERT(this != &other);
+ copyBitmapData(other);
+}
+
bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
{
if (this == &other)
return true;
- m_bytes = other.m_bytes;
+ m_backingStore = other.m_backingStore;
+ m_bytes = m_backingStore.data();
m_size = other.m_size;
setHasAlpha(other.m_hasAlpha);
return true;
@@ -162,7 +172,8 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight)
{
// NOTE: This has no way to check for allocation failure if the requested
// size was too big...
- m_bytes.resize(newWidth * newHeight);
+ m_backingStore.resize(newWidth * newHeight);
+ m_bytes = m_backingStore.data();
m_size = IntSize(newWidth, newHeight);
// Zero the image.
@@ -171,6 +182,8 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight)
return true;
}
+#endif
+
bool RGBA32Buffer::hasAlpha() const
{
return m_hasAlpha;
diff --git a/WebCore/platform/image-decoders/ImageDecoder.h b/WebCore/platform/image-decoders/ImageDecoder.h
index 90e8ae2..9fe0e6b 100644
--- a/WebCore/platform/image-decoders/ImageDecoder.h
+++ b/WebCore/platform/image-decoders/ImageDecoder.h
@@ -86,7 +86,11 @@ namespace WebCore {
// Creates a new copy of the image data in |other|, so the two images
// can be modified independently. Returns whether the copy succeeded.
- bool copyBitmapData(const RGBA32Buffer& other);
+ bool copyBitmapData(const RGBA32Buffer&);
+
+ // Creates a new reference to the image data in |other|. The two images
+ // share a common backing store.
+ void copyReferenceToBitmapData(const RGBA32Buffer&);
// Copies the pixel data at [(startX, startY), (endX, startY)) to the
// same X-coordinates on each subsequent row up to but not including
@@ -143,6 +147,12 @@ namespace WebCore {
#endif
private:
+#if PLATFORM(CF)
+ typedef RetainPtr<CFMutableDataRef> NativeBackingStore;
+#else
+ typedef Vector<PixelData> NativeBackingStore;
+#endif
+
int width() const;
int height() const;
@@ -155,7 +165,7 @@ namespace WebCore {
m_pixmap = QPixmap();
return reinterpret_cast_ptr<QRgb*>(m_image.scanLine(y)) + x;
#else
- return m_bytes.data() + (y * width()) + x;
+ return m_bytes + (y * width()) + x;
#endif
}
@@ -186,26 +196,25 @@ namespace WebCore {
bool m_hasAlpha;
IntSize m_size;
#else
- Vector<PixelData> m_bytes;
- IntSize m_size; // The size of the buffer. This should be the
- // same as ImageDecoder::m_size.
- bool m_hasAlpha; // Whether or not any of the pixels in the buffer
- // have transparency.
+ NativeBackingStore m_backingStore;
+ PixelData* m_bytes; // The memory is backed by m_backingStore.
+ IntSize m_size; // The size of the buffer. This should be the
+ // same as ImageDecoder::m_size.
+ bool m_hasAlpha; // Whether or not any of the pixels in the buffer
+ // have transparency.
#endif
- IntRect m_rect; // The rect of the original specified frame within
- // the overall buffer. This will always just be
- // the entire buffer except for GIF frames whose
- // original rect was smaller than the overall
- // image size.
+ IntRect m_rect; // The rect of the original specified frame within
+ // the overall buffer. This will always just be
+ // the entire buffer except for GIF frames whose
+ // original rect was smaller than the overall
+ // image size.
FrameStatus m_status; // Whether or not this frame is completely
// finished decoding.
- unsigned m_duration; // The animation delay.
- FrameDisposalMethod m_disposalMethod;
- // What to do with this frame's data when
- // initializing the next frame.
- bool m_premultiplyAlpha;
- // Whether to premultiply alpha into R, G, B
- // channels; by default it's true.
+ unsigned m_duration; // The animation delay.
+ FrameDisposalMethod m_disposalMethod; // What to do with this frame's data when
+ // initializing the next frame.
+ bool m_premultiplyAlpha; // Whether to premultiply alpha into R, G, B
+ // channels; by default it's true.
};
// The ImageDecoder class represents a base class for specific image format
diff --git a/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp b/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp
index 203205d..d741882 100644
--- a/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp
+++ b/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp
@@ -34,7 +34,7 @@ NativeImagePtr RGBA32Buffer::asNewNativeImage() const
{
return cairo_image_surface_create_for_data(
reinterpret_cast<unsigned char*>(const_cast<PixelData*>(
- m_bytes.data())), CAIRO_FORMAT_ARGB32, width(), height(),
+ m_bytes)), CAIRO_FORMAT_ARGB32, width(), height(),
width() * sizeof(PixelData));
}
diff --git a/WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp b/WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp
new file mode 100644
index 0000000..2fac7da
--- /dev/null
+++ b/WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2010 Google, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ImageDecoder.h"
+
+#include <CoreGraphics/CGColorSpace.h>
+#include <CoreGraphics/CGImage.h>
+
+namespace WebCore {
+
+void RGBA32Buffer::copyReferenceToBitmapData(const RGBA32Buffer& other)
+{
+ ASSERT(this != &other);
+ m_backingStore = other.m_backingStore;
+ m_bytes = reinterpret_cast<PixelData*>(CFDataGetMutableBytePtr(m_backingStore.get()));
+ // FIXME: The rest of this function seems redundant with RGBA32Buffer::copyBitmapData.
+ m_size = other.m_size;
+ setHasAlpha(other.m_hasAlpha);
+}
+
+bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
+{
+ if (this == &other)
+ return true;
+
+ m_backingStore.adoptCF(CFDataCreateMutableCopy(kCFAllocatorDefault, 0, other.m_backingStore.get()));
+ m_bytes = reinterpret_cast<PixelData*>(CFDataGetMutableBytePtr(m_backingStore.get()));
+ m_size = other.m_size;
+ setHasAlpha(other.m_hasAlpha);
+ return true;
+}
+
+bool RGBA32Buffer::setSize(int newWidth, int newHeight)
+{
+ m_backingStore.adoptCF(CFDataCreateMutable(kCFAllocatorDefault, 0));
+ CFDataSetLength(m_backingStore.get(), newWidth * newHeight * sizeof(PixelData));
+ m_bytes = reinterpret_cast<PixelData*>(CFDataGetMutableBytePtr(m_backingStore.get()));
+ m_size = IntSize(newWidth, newHeight);
+
+ zeroFill();
+ return true;
+}
+
+NativeImagePtr RGBA32Buffer::asNewNativeImage() const
+{
+ // FIXME: Figure out the right color space.
+ DEFINE_STATIC_LOCAL(RetainPtr<CGColorSpaceRef>, deviceColorSpace, (AdoptCF, CGColorSpaceCreateDeviceRGB()));
+ RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithCFData(m_backingStore.get()));
+
+ CGImageAlphaInfo alphaInfo = m_premultiplyAlpha ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaFirst;
+
+ return CGImageCreate(width(), height(), 8, 32, width() * sizeof(PixelData), deviceColorSpace.get(),
+ alphaInfo | kCGBitmapByteOrder32Host, dataProvider.get(), 0, false, kCGRenderingIntentDefault);
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/image-decoders/gif/GIFImageDecoder.h b/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
index 0a88ffd..b011e1e 100644
--- a/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
+++ b/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
@@ -20,7 +20,7 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef GIFImageDecoder_h
@@ -29,7 +29,7 @@
#include "ImageDecoder.h"
#include <wtf/OwnPtr.h>
-class GIFImageReader;
+struct GIFImageReader;
namespace WebCore {
diff --git a/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp b/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp
index 7f00db2..47302f7 100644
--- a/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp
+++ b/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp
@@ -36,7 +36,7 @@ NativeImagePtr RGBA32Buffer::asNewNativeImage() const
int bytesPerRow = width() * sizeof(PixelData);
OwnPtr<BBitmap> bitmap(new BBitmap(BRect(0, 0, width() - 1, height() - 1), 0, B_RGBA32, bytesPerRow));
- const uint8* source = reinterpret_cast<const uint8*>(m_bytes.data());
+ const uint8* source = reinterpret_cast<const uint8*>(m_bytes);
uint8* destination = reinterpret_cast<uint8*>(bitmap->Bits());
int h = height();
int w = width();
diff --git a/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp b/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp
index 3d8f749..061c5ab 100644
--- a/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp
+++ b/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp
@@ -59,7 +59,7 @@ NativeImagePtr RGBA32Buffer::asNewNativeImage() const
tileRect.width(), tileRect.height(), VG_IMAGE_QUALITY_FASTER);
ASSERT_VG_NO_ERROR();
- PixelData* pixelData = const_cast<PixelData*>(m_bytes.data());
+ PixelData* pixelData = const_cast<PixelData*>(m_bytes);
pixelData += (tileRect.y() * width()) + tileRect.x();
vgImageSubData(image, reinterpret_cast<unsigned char*>(pixelData),
diff --git a/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp b/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
index 5794fd6..2275fc7 100644
--- a/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -86,14 +86,15 @@ bool WEBPImageDecoder::decode(bool onlySize)
return true;
if (!WebPGetInfo(dataBytes, dataSize, &width, &height))
return setFailed();
+ if (!ImageDecoder::isSizeAvailable() && !setSize(width, height))
+ return setFailed();
if (onlySize)
- return setSize(width, height) || setFailed();
+ return true;
// FIXME: Add support for progressive decoding.
if (!isAllDataReceived())
return true;
- if (m_frameBufferCache.isEmpty())
- return true;
+ ASSERT(!m_frameBufferCache.isEmpty());
RGBA32Buffer& buffer = m_frameBufferCache[0];
if (buffer.status() == RGBA32Buffer::FrameEmpty) {
ASSERT(width == size().width());
@@ -103,8 +104,8 @@ bool WEBPImageDecoder::decode(bool onlySize)
}
const int stride = width * bytesPerPixel;
Vector<uint8_t> rgb;
- rgb.reserveCapacity(height * stride);
- if (!WebPDecodeBGRInto(dataBytes, dataSize, &rgb[0], height * stride, stride))
+ rgb.resize(height * stride);
+ if (!WebPDecodeBGRInto(dataBytes, dataSize, rgb.data(), rgb.size(), stride))
return setFailed();
// FIXME: remove this data copy.
for (int y = 0; y < height; ++y) {
diff --git a/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp b/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp
index e6e45b7..966eb90 100644
--- a/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp
+++ b/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp
@@ -48,12 +48,12 @@ NativeImagePtr RGBA32Buffer::asNewNativeImage() const
// NB: It appears that the data is in BGRA format instead of RGBA format.
// This code works properly on both ppc and intel, meaning the issue is
// likely not an issue of byte order getting mixed up on different archs.
- const unsigned char* bytes = (const unsigned char*)m_bytes.data();
+ const unsigned char* bytes = (const unsigned char*)m_bytes;
int rowCounter = 0;
long pixelCounter = 0;
WxPixelData::Iterator p(data);
WxPixelData::Iterator rowStart = p;
- for (size_t i = 0; i < m_bytes.size() * sizeof(PixelData); i += sizeof(PixelData)) {
+ for (size_t i = 0; i < m_size.width() * m_size.height() * sizeof(PixelData); i += sizeof(PixelData)) {
p.Red() = bytes[i + 2];
p.Green() = bytes[i + 1];
p.Blue() = bytes[i + 0];
diff --git a/WebCore/platform/mac/WebCoreSystemInterface.h b/WebCore/platform/mac/WebCoreSystemInterface.h
index 7cac443..758639d 100644
--- a/WebCore/platform/mac/WebCoreSystemInterface.h
+++ b/WebCore/platform/mac/WebCoreSystemInterface.h
@@ -48,7 +48,6 @@ typedef struct _NSRect NSRect;
@class NSFont;
@class NSImage;
@class NSMenu;
-@class NSMutableArray;
@class NSMutableURLRequest;
@class NSString;
@class NSTextFieldCell;
@@ -132,6 +131,7 @@ extern void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL);
extern void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
extern void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
+extern void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
extern void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
@@ -171,10 +171,8 @@ extern BOOL (*wkSupportsMultipartXMixedReplace)(NSMutableURLRequest *);
extern BOOL (*wkUseSharedMediaUI)();
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
-extern NSMutableArray *(*wkNoteOpenPanelFiles)(NSArray *);
extern void* wkGetHyphenationLocationBeforeIndex;
#else
-extern void* wkNoteOpenPanelFiles;
extern CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index);
#endif
diff --git a/WebCore/platform/mac/WebCoreSystemInterface.mm b/WebCore/platform/mac/WebCoreSystemInterface.mm
index 52e0064..1882674 100644
--- a/WebCore/platform/mac/WebCoreSystemInterface.mm
+++ b/WebCore/platform/mac/WebCoreSystemInterface.mm
@@ -67,6 +67,7 @@ void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL);
void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
+void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
void (*wkSetDragImage)(NSImage*, NSPoint offset);
void (*wkSetPatternBaseCTM)(CGContextRef, CGAffineTransform);
void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
@@ -113,9 +114,7 @@ BOOL (*wkSupportsMultipartXMixedReplace)(NSMutableURLRequest *);
#endif
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
-NSMutableArray *(*wkNoteOpenPanelFiles)(NSArray *);
void* wkGetHyphenationLocationBeforeIndex;
#else
-void* wkNoteOpenPanelFiles;
CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index);
#endif
diff --git a/WebCore/platform/mock/SpeechInputClientMock.cpp b/WebCore/platform/mock/SpeechInputClientMock.cpp
index 6b64942..331209c 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.cpp
+++ b/WebCore/platform/mock/SpeechInputClientMock.cpp
@@ -50,12 +50,13 @@ void SpeechInputClientMock::setListener(SpeechInputListener* listener)
m_listener = listener;
}
-bool SpeechInputClientMock::startRecognition(int requestId, const IntRect&)
+bool SpeechInputClientMock::startRecognition(int requestId, const IntRect& elementRect, const AtomicString& language, const String& grammar)
{
if (m_timer.isActive())
return false;
m_requestId = requestId;
m_recording = true;
+ m_language = language;
m_timer.startOneShot(0);
return true;
}
@@ -80,9 +81,12 @@ void SpeechInputClientMock::cancelRecognition(int requestId)
}
}
-void SpeechInputClientMock::setRecognitionResult(const String& result)
+void SpeechInputClientMock::setRecognitionResult(const String& result, const AtomicString& language)
{
- m_recognitionResult = result;
+ if (language.isEmpty())
+ m_resultForEmptyLanguage = result;
+ else
+ m_recognitionResult.set(language, result);
}
void SpeechInputClientMock::timerFired(WebCore::Timer<SpeechInputClientMock>*)
@@ -92,7 +96,32 @@ void SpeechInputClientMock::timerFired(WebCore::Timer<SpeechInputClientMock>*)
m_listener->didCompleteRecording(m_requestId);
m_timer.startOneShot(0);
} else {
- m_listener->setRecognitionResult(m_requestId, m_recognitionResult);
+ SpeechInputResultArray results;
+ bool noResultsFound = false;
+
+ // Empty language case must be handled separately to avoid problems with HashMap and empty keys.
+ if (m_language.isEmpty()) {
+ if (!m_resultForEmptyLanguage.isNull())
+ results.append(SpeechInputResult::create(m_resultForEmptyLanguage, 1.0));
+ else
+ noResultsFound = true;
+ } else {
+ if (m_recognitionResult.contains(m_language))
+ results.append(SpeechInputResult::create(m_recognitionResult.get(m_language), 1.0));
+ else
+ noResultsFound = true;
+ }
+
+ if (noResultsFound) {
+ // Can't avoid setting a result even if no result was set for the given language.
+ // This would avoid generating the events used to check the results and the test would timeout.
+ String error("error: no result found for language '");
+ error.append(m_language);
+ error.append("'");
+ results.append(SpeechInputResult::create(error, 1.0));
+ }
+
+ m_listener->setRecognitionResult(m_requestId, results);
m_listener->didCompleteRecognition(m_requestId);
m_requestId = 0;
}
diff --git a/WebCore/platform/mock/SpeechInputClientMock.h b/WebCore/platform/mock/SpeechInputClientMock.h
index ce83d3b..0e3c456 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.h
+++ b/WebCore/platform/mock/SpeechInputClientMock.h
@@ -34,6 +34,8 @@
#include "PlatformString.h"
#include "SpeechInputClient.h"
#include "Timer.h"
+#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
#if ENABLE(INPUT_SPEECH)
@@ -46,11 +48,11 @@ class SpeechInputClientMock : public SpeechInputClient {
public:
SpeechInputClientMock();
- void setRecognitionResult(const String& result);
+ void setRecognitionResult(const String& result, const AtomicString& language);
// SpeechInputClient methods.
void setListener(SpeechInputListener*);
- bool startRecognition(int, const IntRect&);
+ bool startRecognition(int requestId, const IntRect& elementRect, const AtomicString& language, const String& grammar);
void stopRecording(int);
void cancelRecognition(int);
@@ -61,7 +63,10 @@ private:
Timer<SpeechInputClientMock> m_timer;
SpeechInputListener* m_listener;
int m_requestId;
- String m_recognitionResult;
+
+ HashMap<String, String> m_recognitionResult;
+ AtomicString m_language;
+ String m_resultForEmptyLanguage;
};
} // namespace WebCore
diff --git a/WebCore/platform/network/CookieStorage.h b/WebCore/platform/network/CookieStorage.h
new file mode 100644
index 0000000..56ca5dc
--- /dev/null
+++ b/WebCore/platform/network/CookieStorage.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CookieStorage_h
+#define CookieStorage_h
+
+namespace WebCore {
+
+void setCookieStoragePrivateBrowsingEnabled(bool);
+
+}
+
+#endif
diff --git a/WebCore/platform/network/cf/AuthenticationChallenge.h b/WebCore/platform/network/cf/AuthenticationChallenge.h
index 58fb836..e7d66de 100644
--- a/WebCore/platform/network/cf/AuthenticationChallenge.h
+++ b/WebCore/platform/network/cf/AuthenticationChallenge.h
@@ -22,6 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
#ifndef AuthenticationChallenge_h
#define AuthenticationChallenge_h
diff --git a/WebCore/platform/network/win/CookieJarCFNetWin.cpp b/WebCore/platform/network/cf/CookieJarCFNet.cpp
index d431289..d3fc06d 100644
--- a/WebCore/platform/network/win/CookieJarCFNetWin.cpp
+++ b/WebCore/platform/network/cf/CookieJarCFNet.cpp
@@ -27,7 +27,7 @@
#include "CookieJar.h"
#include "Cookie.h"
-#include "CookieStorageWin.h"
+#include "CookieStorageCFNet.h"
#include "Document.h"
#include "KURL.h"
#include "PlatformString.h"
diff --git a/WebCore/platform/network/win/CookieStorageWin.cpp b/WebCore/platform/network/cf/CookieStorageCFNet.cpp
index 5e74c17..93819e1 100644
--- a/WebCore/platform/network/win/CookieStorageWin.cpp
+++ b/WebCore/platform/network/cf/CookieStorageCFNet.cpp
@@ -24,11 +24,11 @@
*/
#include "config.h"
-
-#include "CookieStorageWin.h"
+#include "CookieStorageCFNet.h"
#include <CFNetwork/CFHTTPCookiesPriv.h>
#include <WebKitSystemInterface/WebKitSystemInterface.h>
+#include <wtf/MainThread.h>
#include <wtf/RetainPtr.h>
namespace WebCore {
@@ -37,6 +37,8 @@ static RetainPtr<CFHTTPCookieStorageRef> s_cookieStorage;
CFHTTPCookieStorageRef currentCookieStorage()
{
+ ASSERT(isMainThread());
+
if (s_cookieStorage)
return s_cookieStorage.get();
return wkGetDefaultHTTPCookieStorage();
@@ -44,7 +46,19 @@ CFHTTPCookieStorageRef currentCookieStorage()
void setCurrentCookieStorage(CFHTTPCookieStorageRef cookieStorage)
{
+ ASSERT(isMainThread());
+
s_cookieStorage = cookieStorage;
}
+void setCookieStoragePrivateBrowsingEnabled(bool enabled)
+{
+ ASSERT(isMainThread());
+
+ if (enabled)
+ s_cookieStorage.adoptCF(wkCreatePrivateHTTPCookieStorage());
+ else
+ s_cookieStorage = 0;
+}
+
}
diff --git a/WebCore/platform/network/win/CookieStorageWin.h b/WebCore/platform/network/cf/CookieStorageCFNet.h
index 4350b72..fc980c5 100644
--- a/WebCore/platform/network/win/CookieStorageWin.h
+++ b/WebCore/platform/network/cf/CookieStorageCFNet.h
@@ -23,17 +23,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CookieStorageWin_h
-#define CookieStorageWin_h
+#ifndef CookieStorageCFNet_h
+#define CookieStorageCFNet_h
typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
namespace WebCore {
CFHTTPCookieStorageRef currentCookieStorage();
-
+
+ // Needed for WebKit1 API only.
void setCurrentCookieStorage(CFHTTPCookieStorageRef cookieStorage);
}
-#endif // CookieStorageWin_h
+#endif // CookieStorageCFNet_h
diff --git a/WebCore/platform/network/cf/ResourceError.h b/WebCore/platform/network/cf/ResourceError.h
index 10f1208..83f298c 100644
--- a/WebCore/platform/network/cf/ResourceError.h
+++ b/WebCore/platform/network/cf/ResourceError.h
@@ -70,4 +70,4 @@ private:
} // namespace WebCore
-#endif // ResourceError_h_
+#endif // ResourceError_h
diff --git a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
index 13412c1..e48bd2d 100644
--- a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
+++ b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
@@ -32,7 +32,7 @@
#include "AuthenticationCF.h"
#include "AuthenticationChallenge.h"
#include "Base64.h"
-#include "CookieStorageWin.h"
+#include "CookieStorageCFNet.h"
#include "CredentialStorage.h"
#include "CachedResourceLoader.h"
#include "FormDataStreamCFNet.h"
diff --git a/WebCore/platform/network/cf/ResourceRequest.h b/WebCore/platform/network/cf/ResourceRequest.h
index 9ed79f2..0f330d1 100644
--- a/WebCore/platform/network/cf/ResourceRequest.h
+++ b/WebCore/platform/network/cf/ResourceRequest.h
@@ -21,7 +21,7 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ResourceRequest_h
diff --git a/WebCore/platform/network/cf/ResourceResponse.h b/WebCore/platform/network/cf/ResourceResponse.h
index 5e27670..a586a16 100644
--- a/WebCore/platform/network/cf/ResourceResponse.h
+++ b/WebCore/platform/network/cf/ResourceResponse.h
@@ -22,6 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
#ifndef ResourceResponse_h
#define ResourceResponse_h
diff --git a/WebCore/platform/network/cf/SocketStreamError.h b/WebCore/platform/network/cf/SocketStreamError.h
index f9641ad..6a0b441 100644
--- a/WebCore/platform/network/cf/SocketStreamError.h
+++ b/WebCore/platform/network/cf/SocketStreamError.h
@@ -35,15 +35,15 @@
namespace WebCore {
- class SocketStreamError : public SocketStreamErrorBase {
- public:
- SocketStreamError() { }
- explicit SocketStreamError(int errorCode)
- : SocketStreamErrorBase(errorCode)
- {
- }
+class SocketStreamError : public SocketStreamErrorBase {
+public:
+ SocketStreamError() { }
+ explicit SocketStreamError(int errorCode)
+ : SocketStreamErrorBase(errorCode)
+ {
+ }
- };
+};
} // namespace WebCore
diff --git a/WebCore/platform/network/cf/SocketStreamHandle.h b/WebCore/platform/network/cf/SocketStreamHandle.h
index 8643db7..41d543a 100644
--- a/WebCore/platform/network/cf/SocketStreamHandle.h
+++ b/WebCore/platform/network/cf/SocketStreamHandle.h
@@ -39,74 +39,74 @@
namespace WebCore {
- class AuthenticationChallenge;
- class Credential;
- class SocketStreamHandleClient;
+class AuthenticationChallenge;
+class Credential;
+class SocketStreamHandleClient;
- class SocketStreamHandle : public RefCounted<SocketStreamHandle>, public SocketStreamHandleBase, public AuthenticationClient {
- public:
- static PassRefPtr<SocketStreamHandle> create(const KURL& url, SocketStreamHandleClient* client) { return adoptRef(new SocketStreamHandle(url, client)); }
+class SocketStreamHandle : public RefCounted<SocketStreamHandle>, public SocketStreamHandleBase, public AuthenticationClient {
+public:
+ static PassRefPtr<SocketStreamHandle> create(const KURL& url, SocketStreamHandleClient* client) { return adoptRef(new SocketStreamHandle(url, client)); }
- virtual ~SocketStreamHandle();
+ virtual ~SocketStreamHandle();
- using RefCounted<SocketStreamHandle>::ref;
- using RefCounted<SocketStreamHandle>::deref;
+ using RefCounted<SocketStreamHandle>::ref;
+ using RefCounted<SocketStreamHandle>::deref;
- private:
- virtual int platformSend(const char* data, int length);
- virtual void platformClose();
+private:
+ virtual int platformSend(const char* data, int length);
+ virtual void platformClose();
- SocketStreamHandle(const KURL&, SocketStreamHandleClient*);
- void createStreams();
- void scheduleStreams();
- void chooseProxy();
+ SocketStreamHandle(const KURL&, SocketStreamHandleClient*);
+ void createStreams();
+ void scheduleStreams();
+ void chooseProxy();
#ifndef BUILDING_ON_TIGER
- void chooseProxyFromArray(CFArrayRef);
- void executePACFileURL(CFURLRef);
- void removePACRunLoopSource();
- RetainPtr<CFRunLoopSourceRef> m_pacRunLoopSource;
- static void pacExecutionCallback(void* client, CFArrayRef proxyList, CFErrorRef error);
- static void pacExecutionCallbackMainThread(void*);
- static CFStringRef copyPACExecutionDescription(void*);
+ void chooseProxyFromArray(CFArrayRef);
+ void executePACFileURL(CFURLRef);
+ void removePACRunLoopSource();
+ RetainPtr<CFRunLoopSourceRef> m_pacRunLoopSource;
+ static void pacExecutionCallback(void* client, CFArrayRef proxyList, CFErrorRef error);
+ static void pacExecutionCallbackMainThread(void*);
+ static CFStringRef copyPACExecutionDescription(void*);
#endif
- bool shouldUseSSL() const { return m_url.protocolIs("wss"); }
+ bool shouldUseSSL() const { return m_url.protocolIs("wss"); }
- void addCONNECTCredentials(CFHTTPMessageRef response);
+ void addCONNECTCredentials(CFHTTPMessageRef response);
- static CFStringRef copyCFStreamDescription(void* );
- static void readStreamCallback(CFReadStreamRef, CFStreamEventType, void*);
- static void writeStreamCallback(CFWriteStreamRef, CFStreamEventType, void*);
+ static CFStringRef copyCFStreamDescription(void* );
+ static void readStreamCallback(CFReadStreamRef, CFStreamEventType, void*);
+ static void writeStreamCallback(CFWriteStreamRef, CFStreamEventType, void*);
#if PLATFORM(WIN)
- static void readStreamCallbackMainThread(void*);
- static void writeStreamCallbackMainThread(void*);
+ static void readStreamCallbackMainThread(void*);
+ static void writeStreamCallbackMainThread(void*);
#endif
- void readStreamCallback(CFStreamEventType);
- void writeStreamCallback(CFStreamEventType);
+ void readStreamCallback(CFStreamEventType);
+ void writeStreamCallback(CFStreamEventType);
- // No authentication for streams per se, but proxy may ask for credentials.
- virtual void receivedCredential(const AuthenticationChallenge&, const Credential&);
- virtual void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
- virtual void receivedCancellation(const AuthenticationChallenge&);
+ // No authentication for streams per se, but proxy may ask for credentials.
+ virtual void receivedCredential(const AuthenticationChallenge&, const Credential&);
+ virtual void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
+ virtual void receivedCancellation(const AuthenticationChallenge&);
- virtual void refAuthenticationClient() { ref(); }
- virtual void derefAuthenticationClient() { deref(); }
+ virtual void refAuthenticationClient() { ref(); }
+ virtual void derefAuthenticationClient() { deref(); }
- enum ConnectingSubstate { New, ExecutingPACFile, WaitingForCredentials, WaitingForConnect, Connected };
- ConnectingSubstate m_connectingSubstate;
+ enum ConnectingSubstate { New, ExecutingPACFile, WaitingForCredentials, WaitingForConnect, Connected };
+ ConnectingSubstate m_connectingSubstate;
- enum ConnectionType { Unknown, Direct, SOCKSProxy, CONNECTProxy };
- ConnectionType m_connectionType;
- RetainPtr<CFStringRef> m_proxyHost;
- RetainPtr<CFNumberRef> m_proxyPort;
+ enum ConnectionType { Unknown, Direct, SOCKSProxy, CONNECTProxy };
+ ConnectionType m_connectionType;
+ RetainPtr<CFStringRef> m_proxyHost;
+ RetainPtr<CFNumberRef> m_proxyPort;
- RetainPtr<CFHTTPMessageRef> m_proxyResponseMessage;
- bool m_sentStoredCredentials;
- RetainPtr<CFReadStreamRef> m_readStream;
- RetainPtr<CFWriteStreamRef> m_writeStream;
+ RetainPtr<CFHTTPMessageRef> m_proxyResponseMessage;
+ bool m_sentStoredCredentials;
+ RetainPtr<CFReadStreamRef> m_readStream;
+ RetainPtr<CFWriteStreamRef> m_writeStream;
- RetainPtr<CFURLRef> m_httpsURL; // ws(s): replaced with https:
- };
+ RetainPtr<CFURLRef> m_httpsURL; // ws(s): replaced with https:
+};
} // namespace WebCore
diff --git a/WebCore/platform/network/curl/CookieJarCurl.cpp b/WebCore/platform/network/curl/CookieJarCurl.cpp
index e05947c..6f8a6b7 100644
--- a/WebCore/platform/network/curl/CookieJarCurl.cpp
+++ b/WebCore/platform/network/curl/CookieJarCurl.cpp
@@ -61,4 +61,9 @@ void deleteCookie(const Document*, const KURL&, const String&)
// FIXME: Not yet implemented
}
+void setCookieStoragePrivateBrowsingEnabled(bool enabled)
+{
+ // FIXME: Not yet implemented
+}
+
}
diff --git a/WebCore/platform/network/mac/CookieStorageMac.mm b/WebCore/platform/network/mac/CookieStorageMac.mm
new file mode 100644
index 0000000..ab26f7b
--- /dev/null
+++ b/WebCore/platform/network/mac/CookieStorageMac.mm
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CookieStorage.h"
+
+#import "WebCoreSystemInterface.h"
+
+namespace WebCore {
+
+void setCookieStoragePrivateBrowsingEnabled(bool enabled)
+{
+ wkSetCookieStoragePrivateBrowsingEnabled(enabled);
+}
+
+}
diff --git a/WebCore/platform/network/mac/FormDataStreamMac.mm b/WebCore/platform/network/mac/FormDataStreamMac.mm
index 9b5884f..69af91a 100644
--- a/WebCore/platform/network/mac/FormDataStreamMac.mm
+++ b/WebCore/platform/network/mac/FormDataStreamMac.mm
@@ -46,6 +46,12 @@
#import <wtf/StdLibExtras.h>
#import <wtf/Threading.h>
+#if PLATFORM(IOS)
+#import <MacErrors.h>
+#else
+#import <CoreServices/CoreServices.h>
+#endif
+
namespace WebCore {
typedef HashMap<CFReadStreamRef, RefPtr<FormData> > StreamFormDataMap;
diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index 05c659f..0f97867 100644
--- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -672,6 +672,15 @@ bool ResourceHandle::start(NetworkingContext* context)
if (context && !context->isValid())
return false;
+ if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) {
+ // If credentials were specified for this request, add them to the url,
+ // so that they will be passed to NetworkRequest.
+ KURL urlWithCredentials(firstRequest().url());
+ urlWithCredentials.setUser(d->m_user);
+ urlWithCredentials.setPass(d->m_pass);
+ d->m_firstRequest.setURL(urlWithCredentials);
+ }
+
KURL url = firstRequest().url();
String urlString = url.string();
String protocol = url.protocol();
diff --git a/WebCore/platform/network/soup/ResourceRequestSoup.cpp b/WebCore/platform/network/soup/ResourceRequestSoup.cpp
index 380fc84..d46e47b 100644
--- a/WebCore/platform/network/soup/ResourceRequestSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceRequestSoup.cpp
@@ -25,6 +25,7 @@
#include "HTTPParsers.h"
#include "MIMETypeRegistry.h"
#include "PlatformString.h"
+#include "SoupURIUtils.h"
#include <wtf/text/CString.h>
#include <libsoup/soup.h>
@@ -88,9 +89,7 @@ SoupMessage* ResourceRequest::toSoupMessage() const
void ResourceRequest::updateFromSoupMessage(SoupMessage* soupMessage)
{
- SoupURI* soupURI = soup_message_get_uri(soupMessage);
- GOwnPtr<gchar> uri(soup_uri_to_string(soupURI, FALSE));
- m_url = KURL(KURL(), String::fromUTF8(uri.get()));
+ m_url = soupURIToKURL(soup_message_get_uri(soupMessage));
m_httpMethod = String::fromUTF8(soupMessage->method);
@@ -107,10 +106,8 @@ void ResourceRequest::updateFromSoupMessage(SoupMessage* soupMessage)
#ifdef HAVE_LIBSOUP_2_29_90
SoupURI* firstParty = soup_message_get_first_party(soupMessage);
- if (firstParty) {
- GOwnPtr<gchar> firstPartyURI(soup_uri_to_string(firstParty, FALSE));
- m_firstPartyForCookies = KURL(KURL(), String::fromUTF8(firstPartyURI.get()));
- }
+ if (firstParty)
+ m_firstPartyForCookies = soupURIToKURL(firstParty);
#endif
m_soupFlags = soup_message_get_flags(soupMessage);
diff --git a/WebCore/platform/network/soup/ResourceResponseSoup.cpp b/WebCore/platform/network/soup/ResourceResponseSoup.cpp
index cdbdc67..3bcdcc4 100644
--- a/WebCore/platform/network/soup/ResourceResponseSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceResponseSoup.cpp
@@ -25,6 +25,7 @@
#include "HTTPParsers.h"
#include "MIMETypeRegistry.h"
#include "PlatformString.h"
+#include "SoupURIUtils.h"
#include <wtf/text/CString.h>
using namespace std;
@@ -56,9 +57,7 @@ SoupMessage* ResourceResponse::toSoupMessage() const
void ResourceResponse::updateFromSoupMessage(SoupMessage* soupMessage)
{
- SoupURI* soupURI = soup_message_get_uri(soupMessage);
- GOwnPtr<gchar> uri(soup_uri_to_string(soupURI, FALSE));
- m_url = KURL(KURL(), String::fromUTF8(uri.get()));
+ m_url = soupURIToKURL(soup_message_get_uri(soupMessage));
m_httpStatusCode = soupMessage->status_code;
diff --git a/WebCore/platform/network/soup/SoupURIUtils.cpp b/WebCore/platform/network/soup/SoupURIUtils.cpp
new file mode 100644
index 0000000..1f65615
--- /dev/null
+++ b/WebCore/platform/network/soup/SoupURIUtils.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 20010 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "SoupURIUtils.h"
+
+#include "GOwnPtr.h"
+#include <libsoup/soup.h>
+
+namespace WebCore {
+
+// Motivated by https://bugs.webkit.org/show_bug.cgi?id=38956. libsoup
+// does not add the password to the URL when calling
+// soup_uri_to_string, and thus the requests are not properly
+// built. Fixing soup_uri_to_string is a no-no as the maintainer does
+// not want to break compatibility with previous implementations
+KURL soupURIToKURL(SoupURI* soupURI)
+{
+ GOwnPtr<gchar> urlString(soup_uri_to_string(soupURI, FALSE));
+ KURL url(KURL(), String::fromUTF8(urlString.get()));
+
+ if (!soupURI->password)
+ return url;
+
+ url.setPass(String::fromUTF8(soupURI->password));
+ return url;
+}
+
+}
diff --git a/WebCore/platform/network/soup/SoupURIUtils.h b/WebCore/platform/network/soup/SoupURIUtils.h
new file mode 100644
index 0000000..69772e7
--- /dev/null
+++ b/WebCore/platform/network/soup/SoupURIUtils.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SoupURIUtils_h
+#define SoupURIUtils_h
+
+#include "KURL.h"
+
+typedef struct _SoupURI SoupURI;
+
+namespace WebCore {
+KURL soupURIToKURL(SoupURI* soupURI);
+}
+
+#endif
diff --git a/WebCore/platform/network/win/AuthenticationChallenge.h b/WebCore/platform/network/win/AuthenticationChallenge.h
new file mode 100644
index 0000000..7463539
--- /dev/null
+++ b/WebCore/platform/network/win/AuthenticationChallenge.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AuthenticationChallenge_h
+#define AuthenticationChallenge_h
+
+#include "AuthenticationChallengeBase.h"
+
+namespace WebCore {
+
+class AuthenticationChallenge : public AuthenticationChallengeBase {
+public:
+ AuthenticationChallenge()
+ {
+ }
+
+ AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error)
+ : AuthenticationChallengeBase(protectionSpace, proposedCredential, previousFailureCount, response, error)
+ {
+ }
+};
+
+} // namespace WebCore
+
+#endif // AuthenticationChallenge_h
diff --git a/WebCore/platform/network/win/NetworkStateNotifierWin.cpp b/WebCore/platform/network/win/NetworkStateNotifierWin.cpp
index 1620669..e600e41 100644
--- a/WebCore/platform/network/win/NetworkStateNotifierWin.cpp
+++ b/WebCore/platform/network/win/NetworkStateNotifierWin.cpp
@@ -109,11 +109,14 @@ NetworkStateNotifier::NetworkStateNotifier()
memset(&m_overlapped, 0, sizeof(m_overlapped));
+// FIXME: Check m_overlapped on WinCE.
+#if !OS(WINCE)
m_overlapped.hEvent = ::CreateEvent(0, false, false, 0);
::RegisterWaitForSingleObject(&m_waitHandle, m_overlapped.hEvent, addrChangeCallback, this, INFINITE, 0);
registerForAddressChange();
+#endif
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/network/win/ResourceError.h b/WebCore/platform/network/win/ResourceError.h
new file mode 100644
index 0000000..a09c227
--- /dev/null
+++ b/WebCore/platform/network/win/ResourceError.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ResourceError_h
+#define ResourceError_h
+
+#include "ResourceErrorBase.h"
+
+namespace WebCore {
+
+class ResourceError : public ResourceErrorBase {
+public:
+ ResourceError()
+ {
+ }
+
+ ResourceError(const String& domain, int errorCode, const String& failingURL, const String& localizedDescription)
+ : ResourceErrorBase(domain, errorCode, failingURL, localizedDescription)
+ {
+ }
+};
+
+} // namespace WebCore
+
+#endif // ResourceError_h
diff --git a/WebCore/platform/network/win/ResourceHandleWin.cpp b/WebCore/platform/network/win/ResourceHandleWin.cpp
index 28035b9..38d9cd1 100644
--- a/WebCore/platform/network/win/ResourceHandleWin.cpp
+++ b/WebCore/platform/network/win/ResourceHandleWin.cpp
@@ -277,7 +277,9 @@ bool ResourceHandle::start(NetworkingContext* context)
DWORD flags = INTERNET_FLAG_KEEP_CONNECTION
| INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS
- | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP;
+ | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP
+ | INTERNET_FLAG_DONT_CACHE
+ | INTERNET_FLAG_RELOAD;
d->m_connectHandle = InternetConnectW(d->m_internetHandle, firstRequest().url().host().charactersWithNullTermination(), firstRequest().url().port(),
0, 0, INTERNET_SERVICE_HTTP, flags, reinterpret_cast<DWORD_PTR>(this));
diff --git a/WebCore/platform/network/win/ResourceRequest.h b/WebCore/platform/network/win/ResourceRequest.h
new file mode 100644
index 0000000..cd50311
--- /dev/null
+++ b/WebCore/platform/network/win/ResourceRequest.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ResourceRequest_h
+#define ResourceRequest_h
+
+#include "ResourceRequestBase.h"
+
+namespace WebCore {
+
+class ResourceRequest : public ResourceRequestBase {
+public:
+ ResourceRequest(const String& url)
+ : ResourceRequestBase(KURL(ParsedURLString, url), UseProtocolCachePolicy)
+ {
+ }
+
+ ResourceRequest(const KURL& url)
+ : ResourceRequestBase(url, UseProtocolCachePolicy)
+ {
+ }
+
+ ResourceRequest(const KURL& url, const String& referrer, ResourceRequestCachePolicy policy = UseProtocolCachePolicy)
+ : ResourceRequestBase(url, policy)
+ {
+ setHTTPReferrer(referrer);
+ }
+
+ ResourceRequest()
+ : ResourceRequestBase(KURL(), UseProtocolCachePolicy)
+ {
+ }
+
+private:
+ friend struct ResourceRequestBase;
+
+ void doUpdatePlatformRequest() { }
+ void doUpdateResourceRequest() { }
+
+ PassOwnPtr<CrossThreadResourceRequestData> doPlatformCopyData(PassOwnPtr<CrossThreadResourceRequestData> data) const { return data; }
+ void doPlatformAdopt(PassOwnPtr<CrossThreadResourceRequestData>) { }
+};
+
+struct CrossThreadResourceRequestData : public CrossThreadResourceRequestDataBase {
+};
+
+} // namespace WebCore
+
+#endif // ResourceRequest_h
diff --git a/WebCore/platform/network/win/ResourceResponse.h b/WebCore/platform/network/win/ResourceResponse.h
new file mode 100644
index 0000000..b74a1e8
--- /dev/null
+++ b/WebCore/platform/network/win/ResourceResponse.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ResourceResponse_h
+#define ResourceResponse_h
+
+#include "ResourceResponseBase.h"
+
+namespace WebCore {
+
+class ResourceResponse : public ResourceResponseBase {
+public:
+ ResourceResponse()
+ {
+ }
+
+ ResourceResponse(const KURL& url, const String& mimeType, long long expectedLength, const String& textEncodingName, const String& filename)
+ : ResourceResponseBase(url, mimeType, expectedLength, textEncodingName, filename)
+ {
+ }
+
+private:
+ friend class ResourceResponseBase;
+
+ PassOwnPtr<CrossThreadResourceResponseData> doPlatformCopyData(PassOwnPtr<CrossThreadResourceResponseData> data) const { return data; }
+ void doPlatformAdopt(PassOwnPtr<CrossThreadResourceResponseData>) { }
+};
+
+struct CrossThreadResourceResponseData : public CrossThreadResourceResponseDataBase {
+};
+
+} // namespace WebCore
+
+#endif // ResourceResponse_h
diff --git a/WebCore/platform/network/win/SocketStreamError.h b/WebCore/platform/network/win/SocketStreamError.h
new file mode 100644
index 0000000..80dfa39
--- /dev/null
+++ b/WebCore/platform/network/win/SocketStreamError.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SocketStreamError_h
+#define SocketStreamError_h
+
+#include "SocketStreamErrorBase.h"
+
+namespace WebCore {
+
+class SocketStreamError : public SocketStreamErrorBase {
+public:
+ SocketStreamError() { }
+ explicit SocketStreamError(int errorCode)
+ : SocketStreamErrorBase(errorCode)
+ {
+ }
+
+};
+
+} // namespace WebCore
+
+#endif // SocketStreamError_h
diff --git a/WebCore/platform/network/win/SocketStreamHandle.h b/WebCore/platform/network/win/SocketStreamHandle.h
new file mode 100644
index 0000000..62808ec
--- /dev/null
+++ b/WebCore/platform/network/win/SocketStreamHandle.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SocketStreamHandle_h
+#define SocketStreamHandle_h
+
+#include "SocketStreamHandleBase.h"
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class AuthenticationChallenge;
+class Credential;
+class SocketStreamHandleClient;
+
+class SocketStreamHandle : public RefCounted<SocketStreamHandle>, public SocketStreamHandleBase {
+public:
+ static PassRefPtr<SocketStreamHandle> create(const KURL& url, SocketStreamHandleClient* client) { return adoptRef(new SocketStreamHandle(url, client)); }
+
+ virtual ~SocketStreamHandle();
+
+protected:
+ virtual int platformSend(const char* data, int length);
+ virtual void platformClose();
+
+private:
+ SocketStreamHandle(const KURL&, SocketStreamHandleClient*);
+
+ // No authentication for streams per se, but proxy may ask for credentials.
+ void didReceiveAuthenticationChallenge(const AuthenticationChallenge&);
+ void receivedCredential(const AuthenticationChallenge&, const Credential&);
+ void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
+ void receivedCancellation(const AuthenticationChallenge&);
+};
+
+} // namespace WebCore
+
+#endif // SocketStreamHandle_h
diff --git a/WebCore/platform/network/win/SocketStreamHandleWin.cpp b/WebCore/platform/network/win/SocketStreamHandleWin.cpp
new file mode 100644
index 0000000..b2b540f
--- /dev/null
+++ b/WebCore/platform/network/win/SocketStreamHandleWin.cpp
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2009 Brent Fulgham. All rights reserved.
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SocketStreamHandle.h"
+
+#include "KURL.h"
+#include "Logging.h"
+#include "NotImplemented.h"
+#include "SocketStreamHandleClient.h"
+
+namespace WebCore {
+
+SocketStreamHandle::SocketStreamHandle(const KURL& url, SocketStreamHandleClient* client)
+ : SocketStreamHandleBase(url, client)
+{
+ LOG(Network, "SocketStreamHandle %p new client %p", this, m_client);
+ notImplemented();
+}
+
+SocketStreamHandle::~SocketStreamHandle()
+{
+ LOG(Network, "SocketStreamHandle %p delete", this);
+ setClient(0);
+ notImplemented();
+}
+
+int SocketStreamHandle::platformSend(const char*, int)
+{
+ LOG(Network, "SocketStreamHandle %p platformSend", this);
+ notImplemented();
+ return 0;
+}
+
+void SocketStreamHandle::platformClose()
+{
+ LOG(Network, "SocketStreamHandle %p platformClose", this);
+ notImplemented();
+}
+
+void SocketStreamHandle::didReceiveAuthenticationChallenge(const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void SocketStreamHandle::receivedCredential(const AuthenticationChallenge&, const Credential&)
+{
+ notImplemented();
+}
+
+void SocketStreamHandle::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void SocketStreamHandle::receivedCancellation(const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/qt/QWebPageClient.h b/WebCore/platform/qt/QWebPageClient.h
index f5d8c1b..d8f4171 100644
--- a/WebCore/platform/qt/QWebPageClient.h
+++ b/WebCore/platform/qt/QWebPageClient.h
@@ -30,11 +30,14 @@
#include <QCursor>
#endif
+#if USE(ACCELERATED_COMPOSITING)
+#include <GraphicsLayer.h>
+#endif
+
#include <QPalette>
#include <QRect>
QT_BEGIN_NAMESPACE
-class QGraphicsItem;
class QStyle;
QT_END_NAMESPACE
@@ -49,8 +52,7 @@ public:
virtual void setInputMethodEnabled(bool enable) = 0;
virtual bool inputMethodEnabled() const = 0;
#if USE(ACCELERATED_COMPOSITING)
- // this gets called when we start/stop compositing.
- virtual void setRootGraphicsLayer(QGraphicsItem* layer) {}
+ virtual void setRootGraphicsLayer(WebCore::PlatformLayer* layer) { }
// this gets called when the compositor wants us to sync the layers
// if scheduleSync is true, we schedule a sync ourselves. otherwise,
diff --git a/WebCore/platform/qt/RenderThemeQt.cpp b/WebCore/platform/qt/RenderThemeQt.cpp
index 50b5de6..7ef4ab7 100644
--- a/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/WebCore/platform/qt/RenderThemeQt.cpp
@@ -80,6 +80,19 @@ namespace WebCore {
using namespace HTMLNames;
+inline static void initStyleOption(QWidget *widget, QStyleOption& option)
+{
+ if (widget)
+ option.initFrom(widget);
+ else {
+ /*
+ If a widget is not directly available for rendering, we fallback to default
+ value for an active widget.
+ */
+ option.state = QStyle::State_Active | QStyle::State_Enabled;
+ }
+}
+
StylePainter::StylePainter(RenderThemeQt* theme, const PaintInfo& paintInfo)
{
@@ -538,9 +551,7 @@ bool RenderThemeQt::paintButton(RenderObject* o, const PaintInfo& i, const IntRe
return true;
QStyleOptionButton option;
- if (p.widget)
- option.initFrom(p.widget);
-
+ initStyleOption(p.widget, option);
option.rect = r;
option.state |= QStyle::State_Small;
@@ -571,9 +582,7 @@ bool RenderThemeQt::paintTextField(RenderObject* o, const PaintInfo& i, const In
return true;
QStyleOptionFrameV2 panel;
- if (p.widget)
- panel.initFrom(p.widget);
-
+ initStyleOption(p.widget, panel);
panel.rect = r;
panel.lineWidth = findFrameLineWidth(qStyle());
panel.state |= QStyle::State_Sunken;
@@ -640,8 +649,7 @@ bool RenderThemeQt::paintMenuList(RenderObject* o, const PaintInfo& i, const Int
return true;
QtStyleOptionWebComboBox opt(o);
- if (p.widget)
- opt.initFrom(p.widget);
+ initStyleOption(p.widget, opt);
initializeCommonQStyleOptions(opt, o);
const QPoint topLeft = r.topLeft();
@@ -684,8 +692,7 @@ bool RenderThemeQt::paintMenuListButton(RenderObject* o, const PaintInfo& i,
return true;
QtStyleOptionWebComboBox option(o);
- if (p.widget)
- option.initFrom(p.widget);
+ initStyleOption(p.widget, option);
initializeCommonQStyleOptions(option, o);
option.rect = r;
@@ -735,8 +742,7 @@ bool RenderThemeQt::paintProgressBar(RenderObject* o, const PaintInfo& pi, const
return true;
QStyleOptionProgressBarV2 option;
- if (p.widget)
- option.initFrom(p.widget);
+ initStyleOption(p.widget, option);
initializeCommonQStyleOptions(option, o);
RenderProgress* renderProgress = toRenderProgress(o);
@@ -777,8 +783,7 @@ bool RenderThemeQt::paintSliderTrack(RenderObject* o, const PaintInfo& pi,
return true;
QStyleOptionSlider option;
- if (p.widget)
- option.initFrom(p.widget);
+ initStyleOption(p.widget, option);
option.subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderHandle;
ControlPart appearance = initializeCommonQStyleOptions(option, o);
diff --git a/WebCore/platform/qt/TemporaryLinkStubsQt.cpp b/WebCore/platform/qt/TemporaryLinkStubsQt.cpp
index 15933e8..d7b5104 100644
--- a/WebCore/platform/qt/TemporaryLinkStubsQt.cpp
+++ b/WebCore/platform/qt/TemporaryLinkStubsQt.cpp
@@ -35,6 +35,7 @@
#include "AXObjectCache.h"
#include "CachedResource.h"
#include "CookieJar.h"
+#include "CookieStorage.h"
#include "Cursor.h"
#include "DNS.h"
#include "FTPDirectoryDocument.h"
@@ -123,6 +124,11 @@ float userIdleTime()
}
#endif
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
}
// vim: ts=4 sw=4 et
diff --git a/WebCore/platform/sql/SQLiteDatabase.cpp b/WebCore/platform/sql/SQLiteDatabase.cpp
index b9e7639..fb25889 100644
--- a/WebCore/platform/sql/SQLiteDatabase.cpp
+++ b/WebCore/platform/sql/SQLiteDatabase.cpp
@@ -72,6 +72,12 @@ bool SQLiteDatabase::open(const String& filename, bool forWebSQLDatabase)
m_db = 0;
return false;
}
+ if (sqlite3_extended_result_codes(m_db, 1) != SQLITE_OK) {
+ LOG_ERROR("SQLite database error when enabling extended errors - %s", sqlite3_errmsg(m_db));
+ sqlite3_close(m_db);
+ m_db = 0;
+ return false;
+ }
if (isOpen())
m_openingThread = currentThread();
diff --git a/WebCore/platform/text/TextEncoding.cpp b/WebCore/platform/text/TextEncoding.cpp
index 921ceeb..58e691f 100644
--- a/WebCore/platform/text/TextEncoding.cpp
+++ b/WebCore/platform/text/TextEncoding.cpp
@@ -120,6 +120,10 @@ CString TextEncoding::encode(const UChar* characters, size_t length, Unencodable
#elif USE(GLIB_UNICODE)
GOwnPtr<char> UTF8Source;
UTF8Source.set(g_utf16_to_utf8(characters, length, 0, 0, 0));
+ if (!UTF8Source) {
+ // If conversion to UTF-8 failed, try with the string without normalization
+ return newTextCodec(*this)->encode(characters, length, handling);
+ }
GOwnPtr<char> UTF8Normalized;
UTF8Normalized.set(g_utf8_normalize(UTF8Source.get(), -1, G_NORMALIZE_NFC));
diff --git a/WebCore/platform/text/brew/StringBrew.cpp b/WebCore/platform/text/brew/StringBrew.cpp
new file mode 100644
index 0000000..7869e0f
--- /dev/null
+++ b/WebCore/platform/text/brew/StringBrew.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2010 Company 100, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformString.h"
+
+#include <AEEStdLib.h>
+
+namespace WTF {
+
+// String conversions
+String::String(const AECHAR* string)
+{
+ // It is safe to cast AECHAR to UChar as both of them use 16 bits representation.
+ const UChar* str = reinterpret_cast<const UChar*>(string);
+ const size_t len = WSTRLEN(string);
+
+ m_impl = StringImpl::create(str, len);
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp b/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp
index 3be0c70..be3f302 100644
--- a/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp
+++ b/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp
@@ -3,6 +3,7 @@
* Copyright (C) 2007 Apple Inc. All rights reserved.
* Copyright (C) 2008 Jürg Billeter <j@bitron.ch>
* Copyright (C) 2008 Dominik Röttsches <dominik.roettsches@access-company.com>
+ * Copyright (C) 2010 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -22,13 +23,160 @@
*/
#include "config.h"
-#include "GOwnPtr.h"
+
#include "TextBreakIterator.h"
+#include "GOwnPtr.h"
#include <pango/pango.h>
+using namespace std;
+
+#define UTF8_IS_SURROGATE(character) (character >= 0x10000 && character <= 0x10FFFF)
namespace WebCore {
+class CharacterIterator {
+public:
+ bool setText(const UChar* string, int length);
+ const gchar* getText() { return m_utf8.get(); }
+ int getLength() { return m_length; }
+ glong getSize() { return m_size; }
+ void setIndex(int index);
+ int getIndex() { return m_index; }
+ void setUTF16Index(int index);
+ int getUTF16Index() { return m_utf16Index; }
+ int getUTF16Length() { return m_utf16Length; }
+ int first();
+ int last();
+ int next();
+ int previous();
+private:
+ int characterSize(int index);
+
+ GOwnPtr<char> m_utf8;
+ int m_length;
+ long m_size;
+ int m_index;
+ int m_utf16Index;
+ int m_utf16Length;
+};
+
+int CharacterIterator::characterSize(int index)
+{
+ if (index == m_length || index < 0)
+ return 0;
+ if (m_length == m_utf16Length)
+ return 1;
+
+ gchar* indexPtr = g_utf8_offset_to_pointer(m_utf8.get(), index);
+ gunichar character = g_utf8_get_char(indexPtr);
+ return UTF8_IS_SURROGATE(character) ? 2 : 1;
+}
+
+bool CharacterIterator::setText(const UChar* string, int length)
+{
+ long utf8Size = 0;
+ m_utf8.set(g_utf16_to_utf8(string, length, 0, &utf8Size, 0));
+ if (!utf8Size)
+ return false;
+
+ m_utf16Length = length;
+ m_length = g_utf8_strlen(m_utf8.get(), utf8Size);
+ m_size = utf8Size;
+ m_index = 0;
+ m_utf16Index = 0;
+
+ return true;
+}
+
+void CharacterIterator::setIndex(int index)
+{
+ if (index == m_index)
+ return;
+ if (index <= 0)
+ m_index = m_utf16Index = 0;
+ else if (index >= m_length) {
+ m_index = m_length;
+ m_utf16Index = m_utf16Length;
+ } else if (m_length == m_utf16Length)
+ m_index = m_utf16Index = index;
+ else {
+ m_index = index;
+ int utf16Index = 0;
+ int utf8Index = 0;
+ while (utf8Index < index) {
+ utf16Index += characterSize(utf8Index);
+ utf8Index++;
+ }
+ m_utf16Index = utf16Index;
+ }
+}
+
+void CharacterIterator::setUTF16Index(int index)
+{
+ if (index == m_utf16Index)
+ return;
+ if (index <= 0)
+ m_utf16Index = m_index = 0;
+ else if (index >= m_utf16Length) {
+ m_utf16Index = m_utf16Length;
+ m_index = m_length;
+ } else if (m_length == m_utf16Length)
+ m_utf16Index = m_index = index;
+ else {
+ m_utf16Index = index;
+ int utf16Index = 0;
+ int utf8Index = 0;
+ while (utf16Index < index) {
+ utf16Index += characterSize(utf8Index);
+ utf8Index++;
+ }
+ m_index = utf8Index;
+ }
+}
+
+int CharacterIterator::first()
+{
+ m_index = m_utf16Index = 0;
+ return m_index;
+}
+
+int CharacterIterator::last()
+{
+ m_index = m_length;
+ m_utf16Index = m_utf16Length;
+ return m_index;
+}
+
+int CharacterIterator::next()
+{
+ int next = m_index + 1;
+
+ if (next <= m_length) {
+ m_utf16Index = min(m_utf16Index + characterSize(m_index), m_utf16Length);
+ m_index = next;
+ } else {
+ m_index = TextBreakDone;
+ m_utf16Index = TextBreakDone;
+ }
+
+ return m_index;
+}
+
+int CharacterIterator::previous()
+{
+ int previous = m_index - 1;
+
+ if (previous >= 0) {
+ m_utf16Index = max(m_utf16Index - characterSize(previous), 0);
+ m_index = previous;
+ } else {
+ m_index = TextBreakDone;
+ m_utf16Index = TextBreakDone;
+ }
+
+ return m_index;
+}
+
enum UBreakIteratorType {
UBRK_CHARACTER,
UBRK_WORD,
@@ -39,9 +187,8 @@ enum UBreakIteratorType {
class TextBreakIterator {
public:
UBreakIteratorType m_type;
- int m_length;
PangoLogAttr* m_logAttrs;
- int m_index;
+ CharacterIterator m_charIterator;
};
static TextBreakIterator* setUpIterator(bool& createdIterator, TextBreakIterator*& iterator,
@@ -57,19 +204,17 @@ static TextBreakIterator* setUpIterator(bool& createdIterator, TextBreakIterator
if (!iterator)
return 0;
- long utf8len;
- GOwnPtr<char> utf8;
- utf8.set(g_utf16_to_utf8(string, length, 0, &utf8len, 0));
+ if (!iterator->m_charIterator.setText(string, length))
+ return 0;
- // FIXME: assumes no surrogate pairs
+ int charLength = iterator->m_charIterator.getLength();
iterator->m_type = type;
- iterator->m_length = length;
if (createdIterator)
g_free(iterator->m_logAttrs);
- iterator->m_logAttrs = g_new0(PangoLogAttr, length + 1);
- iterator->m_index = -1;
- pango_get_log_attrs(utf8.get(), utf8len, -1, 0, iterator->m_logAttrs, length + 1);
+ iterator->m_logAttrs = g_new0(PangoLogAttr, charLength + 1);
+ pango_get_log_attrs(iterator->m_charIterator.getText(), iterator->m_charIterator.getSize(),
+ -1, 0, iterator->m_logAttrs, charLength + 1);
return iterator;
}
@@ -108,21 +253,13 @@ TextBreakIterator* sentenceBreakIterator(const UChar* string, int length)
return setUpIterator(createdSentenceBreakIterator, staticSentenceBreakIterator, UBRK_SENTENCE, string, length);
}
-int textBreakFirst(TextBreakIterator* bi)
+int textBreakFirst(TextBreakIterator* iterator)
{
- // see textBreakLast
-
- int firstCursorPosition = -1;
- int pos = 0;
- while (pos <= bi->m_length && (firstCursorPosition < 0)) {
- if (bi->m_logAttrs[pos].is_cursor_position)
- firstCursorPosition = pos;
- }
- bi->m_index = firstCursorPosition;
- return firstCursorPosition;
+ iterator->m_charIterator.first();
+ return iterator->m_charIterator.getUTF16Index();
}
-int textBreakLast(TextBreakIterator* bi)
+int textBreakLast(TextBreakIterator* iterator)
{
// TextBreakLast is not meant to find just any break according to bi->m_type
// but really the one near the last character.
@@ -137,81 +274,92 @@ int textBreakLast(TextBreakIterator* bi)
// Otherwise return m_length, as "the first character beyond the last" is outside our string.
bool whiteSpaceAtTheEnd = true;
- int nextWhiteSpacePos = bi->m_length;
-
- int pos = bi->m_length;
+ int nextWhiteSpacePos = iterator->m_charIterator.getLength();
+
+ int pos = iterator->m_charIterator.last();
while (pos >= 0 && whiteSpaceAtTheEnd) {
- if (bi->m_logAttrs[pos].is_cursor_position) {
- if (whiteSpaceAtTheEnd = bi->m_logAttrs[pos].is_white)
+ if (iterator->m_logAttrs[pos].is_cursor_position) {
+ if (whiteSpaceAtTheEnd = iterator->m_logAttrs[pos].is_white)
nextWhiteSpacePos = pos;
}
- pos--;
+ pos = iterator->m_charIterator.previous();
}
- bi->m_index = nextWhiteSpacePos;
- return nextWhiteSpacePos;
+ iterator->m_charIterator.setIndex(nextWhiteSpacePos);
+ return iterator->m_charIterator.getUTF16Index();
}
-int textBreakNext(TextBreakIterator* bi)
+int textBreakNext(TextBreakIterator* iterator)
{
- for (int i = bi->m_index + 1; i <= bi->m_length; i++) {
+ while (iterator->m_charIterator.next() != TextBreakDone) {
+ int index = iterator->m_charIterator.getIndex();
// FIXME: UBRK_WORD case: Single multibyte characters (i.e. white space around them), such as the euro symbol €,
// are not marked as word_start & word_end as opposed to the way ICU does it.
// This leads to - for example - different word selection behaviour when right clicking.
- if ((bi->m_type == UBRK_LINE && bi->m_logAttrs[i].is_line_break)
- || (bi->m_type == UBRK_WORD && (bi->m_logAttrs[i].is_word_start || bi->m_logAttrs[i].is_word_end))
- || (bi->m_type == UBRK_CHARACTER && bi->m_logAttrs[i].is_cursor_position)
- || (bi->m_type == UBRK_SENTENCE && (bi->m_logAttrs[i].is_sentence_start || bi->m_logAttrs[i].is_sentence_end)) ) {
- bi->m_index = i;
- return i;
+ if ((iterator->m_type == UBRK_LINE && iterator->m_logAttrs[index].is_line_break)
+ || (iterator->m_type == UBRK_WORD && (iterator->m_logAttrs[index].is_word_start || iterator->m_logAttrs[index].is_word_end))
+ || (iterator->m_type == UBRK_CHARACTER && iterator->m_logAttrs[index].is_cursor_position)
+ || (iterator->m_type == UBRK_SENTENCE && (iterator->m_logAttrs[index].is_sentence_start || iterator->m_logAttrs[index].is_sentence_end)) ) {
+ break;
}
}
- return TextBreakDone;
+ return iterator->m_charIterator.getUTF16Index();
}
-int textBreakPrevious(TextBreakIterator* bi)
+int textBreakPrevious(TextBreakIterator* iterator)
{
- for (int i = bi->m_index - 1; i >= 0; i--) {
- if ((bi->m_type == UBRK_LINE && bi->m_logAttrs[i].is_line_break)
- || (bi->m_type == UBRK_WORD && (bi->m_logAttrs[i].is_word_start || bi->m_logAttrs[i].is_word_end))
- || (bi->m_type == UBRK_CHARACTER && bi->m_logAttrs[i].is_cursor_position)
- || (bi->m_type == UBRK_SENTENCE && (bi->m_logAttrs[i].is_sentence_start || bi->m_logAttrs[i].is_sentence_end)) ) {
- bi->m_index = i;
- return i;
+ while (iterator->m_charIterator.previous() != TextBreakDone) {
+ int index = iterator->m_charIterator.getIndex();
+
+ if ((iterator->m_type == UBRK_LINE && iterator->m_logAttrs[index].is_line_break)
+ || (iterator->m_type == UBRK_WORD && (iterator->m_logAttrs[index].is_word_start || iterator->m_logAttrs[index].is_word_end))
+ || (iterator->m_type == UBRK_CHARACTER && iterator->m_logAttrs[index].is_cursor_position)
+ || (iterator->m_type == UBRK_SENTENCE && (iterator->m_logAttrs[index].is_sentence_start || iterator->m_logAttrs[index].is_sentence_end)) ) {
+ break;
}
}
- return textBreakFirst(bi);
+ return iterator->m_charIterator.getUTF16Index();
}
-int textBreakPreceding(TextBreakIterator* bi, int pos)
+int textBreakPreceding(TextBreakIterator* iterator, int offset)
{
- bi->m_index = pos;
- return textBreakPrevious(bi);
+ if (offset > iterator->m_charIterator.getUTF16Length())
+ return TextBreakDone;
+ if (offset < 0)
+ return 0;
+ iterator->m_charIterator.setUTF16Index(offset);
+ return textBreakPrevious(iterator);
}
-int textBreakFollowing(TextBreakIterator* bi, int pos)
+int textBreakFollowing(TextBreakIterator* iterator, int offset)
{
- if (pos < 0)
- pos = -1;
- bi->m_index = pos;
- return textBreakNext(bi);
+ if (offset > iterator->m_charIterator.getUTF16Length())
+ return TextBreakDone;
+ if (offset < 0)
+ return 0;
+ iterator->m_charIterator.setUTF16Index(offset);
+ return textBreakNext(iterator);
}
-int textBreakCurrent(TextBreakIterator* bi)
+int textBreakCurrent(TextBreakIterator* iterator)
{
- return bi->m_index;
+ return iterator->m_charIterator.getUTF16Index();
}
-bool isTextBreak(TextBreakIterator* bi, int pos)
+bool isTextBreak(TextBreakIterator* iterator, int offset)
{
- if (bi->m_index < 0)
+ if (!offset)
+ return true;
+ if (offset > iterator->m_charIterator.getUTF16Length())
return false;
- return ((bi->m_type == UBRK_LINE && bi->m_logAttrs[bi->m_index].is_line_break)
- || (bi->m_type == UBRK_WORD && bi->m_logAttrs[bi->m_index].is_word_end)
- || (bi->m_type == UBRK_CHARACTER && bi->m_logAttrs[bi->m_index].is_char_break)
- || (bi->m_type == UBRK_SENTENCE && bi->m_logAttrs[bi->m_index].is_sentence_end) );
+ iterator->m_charIterator.setUTF16Index(offset);
+
+ int index = iterator->m_charIterator.getIndex();
+ iterator->m_charIterator.previous();
+ textBreakNext(iterator);
+ return iterator->m_charIterator.getIndex() == index;
}
}
diff --git a/WebCore/platform/text/gtk/TextCodecGtk.cpp b/WebCore/platform/text/gtk/TextCodecGtk.cpp
index 4224c0c..bf6afcd 100644
--- a/WebCore/platform/text/gtk/TextCodecGtk.cpp
+++ b/WebCore/platform/text/gtk/TextCodecGtk.cpp
@@ -29,6 +29,7 @@
#include "config.h"
#include "TextCodecGtk.h"
+#include <gio/gio.h>
#include "GOwnPtr.h"
#include "Logging.h"
#include "PlatformString.h"
@@ -45,164 +46,12 @@ namespace WebCore {
// This can be achieved by specifying the UTF-16 codecs' endianness explicitly when initializing GLib.
#if (G_BYTE_ORDER == G_BIG_ENDIAN)
- const gchar* WebCore::TextCodecGtk::m_internalEncodingName = "UTF-16BE";
-#else
- const gchar* WebCore::TextCodecGtk::m_internalEncodingName = "UTF-16LE";
+static const gchar* internalEncodingName = "UTF-16BE";
+#else
+static const gchar* internalEncodingName = "UTF-16LE";
#endif
-// We're specifying the list of text codecs and their aliases here.
-// For each codec the first entry is the canonical name, remaining ones are used as aliases.
-// Each alias list must be terminated by a 0.
-
-// Unicode
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_UTF_8 = { "UTF-8", 0 };
-
-// Western
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_1 = { "ISO-8859-1", "CP819", "IBM819", "ISO-IR-100", "ISO8859-1", "ISO_8859-1", "ISO_8859-1:1987", "L1", "LATIN1", "CSISOLATIN1", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_MACROMAN = { "MACROMAN", "MAC", "MACINTOSH", "CSMACINTOSH", 0 };
-
-// Japanese
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_SHIFT_JIS = { "Shift_JIS", "MS_KANJI", "SHIFT-JIS", "SJIS", "CSSHIFTJIS", 0 };
- TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_EUC_JP = { "EUC-JP", "EUC_JP", "EUCJP", "EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE", "CSEUCPKDFMTJAPANESE", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_2022_JP = { "ISO-2022-JP", 0 };
-
-// Traditional Chinese
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_BIG5 = { "BIG5", "BIG-5", "BIG-FIVE", "BIG5", "BIGFIVE", "CN-BIG5", "CSBIG5", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_BIG5_HKSCS = { "BIG5-HKSCS", "BIG5-HKSCS:2004", "BIG5HKSCS", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP950 = { "CP950", 0 };
-
-// Korean
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_2022_KR = { "ISO-2022-KR", "CSISO2022KR", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP949 = { "CP949", "UHC", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_EUC_KR = { "EUC-KR", "CSEUCKR", 0 };
-
-// Arabic
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_6 = { "ISO-8859-6", "ARABIC", "ASMO-708", "ECMA-114", "ISO-IR-127", "ISO8859-6", "ISO_8859-6", "ISO_8859-6:1987", "CSISOLATINARABIC", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1256 = { "windows-1256", "CP1256", "MS-ARAB", 0 }; // rearranged, windows-1256 now declared the canonical name and put to lowercase to fix /fast/encoding/ahram-org-eg.html test case
-
-// Hebrew
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_8 = { "ISO-8859-8", "HEBREW", "ISO-8859-8", "ISO-IR-138", "ISO8859-8", "ISO_8859-8", "ISO_8859-8:1988", "CSISOLATINHEBREW", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1255 = { "windows-1255", "CP1255", "MS-HEBR", 0 }; // rearranged, moved windows-1255 as canonical and lowercased, fixing /fast/encoding/meta-charset.html
-
-// Greek
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_7 = { "ISO-8859-7", "ECMA-118", "ELOT_928", "GREEK", "GREEK8", "ISO-IR-126", "ISO8859-7", "ISO_8859-7", "ISO_8859-7:1987", "ISO_8859-7:2003", "CSI", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP869 = { "CP869", "869", "CP-GR", "IBM869", "CSIBM869", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_WINDOWS_1253 = { "WINDOWS-1253", 0 };
-
-// Cyrillic
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_5 = { "ISO-8859-5", "CYRILLIC", "ISO-IR-144", "ISO8859-5", "ISO_8859-5", "ISO_8859-5:1988", "CSISOLATINCYRILLIC", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_KOI8_R = { "KOI8-R", "CSKOI8R", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP866 = { "CP866", "866", "IBM866", "CSIBM866", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_KOI8_U = { "KOI8-U", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_WINDOWS_1251 = { "windows-1251", "CP1251", 0 }; // CP1251 added to pass /fast/encoding/charset-cp1251.html
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_MACCYRILLIC = { "mac-cyrillic", "MACCYRILLIC", "x-mac-cyrillic", 0 };
-
-// Thai
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP874 = { "CP874", "WINDOWS-874", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_TIS_620 = { "TIS-620", 0 };
-
-// Simplified Chinese
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_GBK = { "GBK", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_HZ = { "HZ", "HZ-GB-2312", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_GB18030 = { "GB18030", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_EUC_CN = { "EUC-CN", "EUCCN", "GB2312", "CN-GB", "CSGB2312", "EUC_CN", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_2312_80 = { "GB_2312-80", "CHINESE", "csISO58GB231280", "GB2312.1980-0", "ISO-IR-58" };
-
-// Central European
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_2 = { "ISO-8859-2", "ISO-IR-101", "ISO8859-2", "ISO_8859-2", "ISO_8859-2:1987", "L2", "LATIN2", "CSISOLATIN2", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1250 = { "CP1250", "MS-EE", "WINDOWS-1250", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_MACCENTRALEUROPE = { "MAC-CENTRALEUROPE", 0 };
-
-// Vietnamese
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1258 = { "CP1258", "WINDOWS-1258", 0 };
-
-// Turkish
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1254 = { "CP1254", "MS-TURK", "WINDOWS-1254", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_9 = { "ISO-8859-9", "ISO-IR-148", "ISO8859-9", "ISO_8859-9", "ISO_8859-9:1989", "L5", "LATIN5", "CSISOLATIN5", 0 };
-
-// Baltic
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1257 = { "CP1257", "WINBALTRIM", "WINDOWS-1257", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_4 = { "ISO-8859-4", "ISO-IR-110", "ISO8859-4", "ISO_8859-4", "ISO_8859-4:1988", "L4", "LATIN4", "CSISOLATIN4", 0 };
-
-gconstpointer const TextCodecGtk::m_iconvBaseCodecList[] = {
- // Unicode
- &m_codecAliases_UTF_8,
-
- // Western
- &m_codecAliases_ISO_8859_1
-};
-
-gconstpointer const TextCodecGtk::m_iconvExtendedCodecList[] =
-{
- // Western
- &m_codecAliases_MACROMAN,
-
- // Japanese
- &m_codecAliases_SHIFT_JIS,
- &m_codecAliases_EUC_JP,
- &m_codecAliases_ISO_2022_JP,
-
- // Simplified Chinese
- &m_codecAliases_BIG5,
- &m_codecAliases_BIG5_HKSCS,
- &m_codecAliases_CP950,
-
- // Korean
- &m_codecAliases_ISO_2022_KR,
- &m_codecAliases_CP949,
- &m_codecAliases_EUC_KR,
-
- // Arabic
- &m_codecAliases_ISO_8859_6,
- &m_codecAliases_CP1256,
-
- // Hebrew
- &m_codecAliases_ISO_8859_8,
- &m_codecAliases_CP1255,
-
- // Greek
- &m_codecAliases_ISO_8859_7,
- &m_codecAliases_CP869,
- &m_codecAliases_WINDOWS_1253,
-
- // Cyrillic
- &m_codecAliases_ISO_8859_5,
- &m_codecAliases_KOI8_R,
- &m_codecAliases_CP866,
- &m_codecAliases_KOI8_U,
- &m_codecAliases_WINDOWS_1251,
- &m_codecAliases_MACCYRILLIC,
-
- // Thai
- &m_codecAliases_CP874,
- &m_codecAliases_TIS_620,
-
- // Traditional Chinese
- &m_codecAliases_GBK,
- &m_codecAliases_HZ,
- &m_codecAliases_GB18030,
- &m_codecAliases_EUC_CN,
- &m_codecAliases_2312_80,
-
- // Central European
- &m_codecAliases_ISO_8859_2,
- &m_codecAliases_CP1250,
- &m_codecAliases_MACCENTRALEUROPE,
-
- // Vietnamese
- &m_codecAliases_CP1258,
-
- // Turkish
- &m_codecAliases_CP1254,
- &m_codecAliases_ISO_8859_9,
-
- // Baltic
- &m_codecAliases_CP1257,
- &m_codecAliases_ISO_8859_4
-};
-
-
const size_t ConversionBufferSize = 16384;
@@ -211,17 +60,17 @@ static PassOwnPtr<TextCodec> newTextCodecGtk(const TextEncoding& encoding, const
return new TextCodecGtk(encoding);
}
-gboolean TextCodecGtk::isEncodingAvailable(const gchar* encName)
+static bool isEncodingAvailable(const gchar* encodingName)
{
GIConv tester;
// test decoding
- tester = g_iconv_open(m_internalEncodingName, encName);
+ tester = g_iconv_open(internalEncodingName, encodingName);
if (tester == reinterpret_cast<GIConv>(-1)) {
return false;
} else {
g_iconv_close(tester);
// test encoding
- tester = g_iconv_open(encName, m_internalEncodingName);
+ tester = g_iconv_open(encodingName, internalEncodingName);
if (tester == reinterpret_cast<GIConv>(-1)) {
return false;
} else {
@@ -231,186 +80,435 @@ gboolean TextCodecGtk::isEncodingAvailable(const gchar* encName)
}
}
-void TextCodecGtk::registerEncodingNames(EncodingNameRegistrar registrar, bool extended)
+static bool registerEncodingNameIfAvailable(EncodingNameRegistrar registrar, const char* canonicalName)
{
- const void* const* encodingList;
- unsigned int listLength = 0;
- if (extended) {
- encodingList = m_iconvExtendedCodecList;
- listLength = sizeof(m_iconvExtendedCodecList)/sizeof(gpointer);
- } else {
- encodingList = m_iconvBaseCodecList;
- listLength = sizeof(m_iconvBaseCodecList)/sizeof(gpointer);
- }
-
- for (unsigned int i = 0; i < listLength; ++i) {
- codecAliasList *codecAliases = static_cast<codecAliasList*>(encodingList[i]);
-
- // Our convention is, the first entry in codecAliases is the canonical name,
- // see above in the list of declarations.
- // Probe GLib for this one first. If it's not available, we skip the whole group of aliases.
-
- int codecCount = 0;
- const char *canonicalName;
- canonicalName = (*codecAliases)[codecCount];
-
- if (!isEncodingAvailable(canonicalName))
- continue;
+ if (isEncodingAvailable(canonicalName)) {
registrar(canonicalName, canonicalName);
-
- const char *currentAlias;
- while ((currentAlias = (*codecAliases)[++codecCount])) {
- if (isEncodingAvailable(currentAlias))
- registrar(currentAlias, canonicalName);
- }
-
+ return true;
}
+
+ return false;
}
-void TextCodecGtk::registerCodecs(TextCodecRegistrar registrar, bool extended)
+static void registerEncodingAliasIfAvailable(EncodingNameRegistrar registrar, const char* canonicalName, const char* aliasName)
{
- const void* const* encodingList;
- unsigned int listLength = 0;
- if (extended) {
- encodingList = m_iconvExtendedCodecList;
- listLength = sizeof(m_iconvExtendedCodecList)/sizeof(gpointer);
- } else {
- encodingList = m_iconvBaseCodecList;
- listLength = sizeof(m_iconvBaseCodecList)/sizeof(gpointer);
- }
+ if (isEncodingAvailable(aliasName))
+ registrar(aliasName, canonicalName);
+}
- for (unsigned int i = 0; i < listLength; ++i) {
- codecAliasList *codecAliases = static_cast<codecAliasList*>(encodingList[i]);
- // by convention, the first "alias" should be the canonical name, see the definition of the alias lists
- const gchar *codecName = (*codecAliases)[0];
- if (isEncodingAvailable(codecName))
- registrar(codecName, newTextCodecGtk, 0);
- }
+static void registerCodecIfAvailable(TextCodecRegistrar registrar, const char* codecName)
+{
+ if (isEncodingAvailable(codecName))
+ registrar(codecName, newTextCodecGtk, 0);
}
void TextCodecGtk::registerBaseEncodingNames(EncodingNameRegistrar registrar)
{
- registerEncodingNames(registrar, false);
+ // Unicode
+ registerEncodingNameIfAvailable(registrar, "UTF-8");
+ registerEncodingNameIfAvailable(registrar, "UTF-32");
+ registerEncodingNameIfAvailable(registrar, "UTF-32BE");
+ registerEncodingNameIfAvailable(registrar, "UTF-32LE");
+
+ // Western
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-1")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "CP819");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "IBM819");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "ISO-IR-100");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "ISO8859-1");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "ISO_8859-1");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "ISO_8859-1:1987");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "L1");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "LATIN1");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "CSISOLATIN1");
+ }
}
void TextCodecGtk::registerBaseCodecs(TextCodecRegistrar registrar)
{
- registerCodecs(registrar, false);
+ // Unicode
+ registerCodecIfAvailable(registrar, "UTF-8");
+ registerCodecIfAvailable(registrar, "UTF-32");
+ registerCodecIfAvailable(registrar, "UTF-32BE");
+ registerCodecIfAvailable(registrar, "UTF-32LE");
+
+ // Western
+ registerCodecIfAvailable(registrar, "ISO-8859-1");
}
void TextCodecGtk::registerExtendedEncodingNames(EncodingNameRegistrar registrar)
{
- registerEncodingNames(registrar, true);
+ // Western
+ if (registerEncodingNameIfAvailable(registrar, "MACROMAN")) {
+ registerEncodingAliasIfAvailable(registrar, "MACROMAN", "MAC");
+ registerEncodingAliasIfAvailable(registrar, "MACROMAN", "MACINTOSH");
+ registerEncodingAliasIfAvailable(registrar, "MACROMAN", "CSMACINTOSH");
+ }
+
+ // Japanese
+ if (registerEncodingNameIfAvailable(registrar, "Shift_JIS")) {
+ registerEncodingAliasIfAvailable(registrar, "Shift_JIS", "MS_KANJI");
+ registerEncodingAliasIfAvailable(registrar, "Shift_JIS", "SHIFT-JIS");
+ registerEncodingAliasIfAvailable(registrar, "Shift_JIS", "SJIS");
+ registerEncodingAliasIfAvailable(registrar, "Shift_JIS", "CSSHIFTJIS");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "EUC-JP")) {
+ registerEncodingAliasIfAvailable(registrar, "EUC-JP", "EUC_JP");
+ registerEncodingAliasIfAvailable(registrar, "EUC-JP", "EUCJP");
+ registerEncodingAliasIfAvailable(registrar, "EUC-JP", "EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE");
+ registerEncodingAliasIfAvailable(registrar, "EUC-JP", "CSEUCPKDFMTJAPANESE");
+ }
+ registerEncodingNameIfAvailable(registrar, "ISO-2022-JP");
+
+ // Traditional Chinese
+ if (registerEncodingNameIfAvailable(registrar, "BIG5")) {
+ registerEncodingAliasIfAvailable(registrar, "BIG5", "BIG-5");
+ registerEncodingAliasIfAvailable(registrar, "BIG5", "BIG-FIVE");
+ registerEncodingAliasIfAvailable(registrar, "BIG5", "BIGFIVE");
+ registerEncodingAliasIfAvailable(registrar, "BIG5", "CN-BIG5");
+ registerEncodingAliasIfAvailable(registrar, "BIG5", "CSBIG5");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "BIG5-HKSCS")) {
+ registerEncodingAliasIfAvailable(registrar, "BIG5-HKSCS", "BIG5-HKSCS:2004");
+ registerEncodingAliasIfAvailable(registrar, "BIG5-HKSCS", "BIG5HKSCS");
+ }
+ registerEncodingNameIfAvailable(registrar, "CP950");
+
+ // Korean
+ if (registerEncodingNameIfAvailable(registrar, "ISO-2022-KR"))
+ registerEncodingAliasIfAvailable(registrar, "ISO-2022-KR", "CSISO2022KR");
+ if (registerEncodingNameIfAvailable(registrar, "CP949"))
+ registerEncodingAliasIfAvailable(registrar, "CP949", "UHC");
+ if (registerEncodingNameIfAvailable(registrar, "EUC-KR"))
+ registerEncodingAliasIfAvailable(registrar, "EUC-KR", "CSEUCKR");
+
+ // Arabic
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-6")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ARABIC");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ASMO-708");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ECMA-114");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ISO-IR-127");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ISO8859-6");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ISO_8859-6");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ISO_8859-6:1987");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "CSISOLATINARABIC");
+ }
+ // rearranged, windows-1256 now declared the canonical name and put to lowercase to fix /fast/encoding/ahram-org-eg.html test case
+ if (registerEncodingNameIfAvailable(registrar, "windows-1256")) {
+ registerEncodingAliasIfAvailable(registrar, "windows-1256", "CP1256");
+ registerEncodingAliasIfAvailable(registrar, "windows-1256", "MS-ARAB");
+ }
+
+ // Hebrew
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-8")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "HEBREW");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO-8859-8");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO-IR-138");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO8859-8");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO_8859-8");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO_8859-8:1988");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "CSISOLATINHEBREW");
+ }
+ // rearranged, moved windows-1255 as canonical and lowercased, fixing /fast/encoding/meta-charset.html
+ if (registerEncodingNameIfAvailable(registrar, "windows-1255")) {
+ registerEncodingAliasIfAvailable(registrar, "windows-1255", "CP1255");
+ registerEncodingAliasIfAvailable(registrar, "windows-1255", "MS-HEBR");
+ }
+
+ // Greek
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-7")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ECMA-118");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ELOT_928");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "GREEK");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "GREEK8");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO-IR-126");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO8859-7");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO_8859-7");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO_8859-7:1987");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO_8859-7:2003");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "CSI");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "CP869")) {
+ registerEncodingAliasIfAvailable(registrar, "CP869", "869");
+ registerEncodingAliasIfAvailable(registrar, "CP869", "CP-GR");
+ registerEncodingAliasIfAvailable(registrar, "CP869", "IBM869");
+ registerEncodingAliasIfAvailable(registrar, "CP869", "CSIBM869");
+ }
+ registerEncodingNameIfAvailable(registrar, "WINDOWS-1253");
+
+ // Cyrillic
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-5")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "CYRILLIC");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "ISO-IR-144");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "ISO8859-5");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "ISO_8859-5");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "ISO_8859-5:1988");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "CSISOLATINCYRILLIC");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "KOI8-R"))
+ registerEncodingAliasIfAvailable(registrar, "KOI8-R", "CSKOI8R");
+ if (registerEncodingNameIfAvailable(registrar, "CP866")) {
+ registerEncodingAliasIfAvailable(registrar, "CP866", "866");
+ registerEncodingAliasIfAvailable(registrar, "CP866", "IBM866");
+ registerEncodingAliasIfAvailable(registrar, "CP866", "CSIBM866");
+ }
+ registerEncodingNameIfAvailable(registrar, "KOI8-U");
+ // CP1251 added to pass /fast/encoding/charset-cp1251.html
+ if (registerEncodingNameIfAvailable(registrar, "windows-1251"))
+ registerEncodingAliasIfAvailable(registrar, "windows-1251", "CP1251");
+ if (registerEncodingNameIfAvailable(registrar, "mac-cyrillic")) {
+ registerEncodingAliasIfAvailable(registrar, "mac-cyrillic", "MACCYRILLIC");
+ registerEncodingAliasIfAvailable(registrar, "mac-cyrillic", "x-mac-cyrillic");
+ }
+
+ // Thai
+ if (registerEncodingNameIfAvailable(registrar, "CP874"))
+ registerEncodingAliasIfAvailable(registrar, "CP874", "WINDOWS-874");
+ registerEncodingNameIfAvailable(registrar, "TIS-620");
+
+ // Simplified Chinese
+ registerEncodingNameIfAvailable(registrar, "GBK");
+ if (registerEncodingNameIfAvailable(registrar, "HZ"))
+ registerEncodingAliasIfAvailable(registrar, "HZ", "HZ-GB-2312");
+ registerEncodingNameIfAvailable(registrar, "GB18030");
+ if (registerEncodingNameIfAvailable(registrar, "EUC-CN")) {
+ registerEncodingAliasIfAvailable(registrar, "EUC-CN", "EUCCN");
+ registerEncodingAliasIfAvailable(registrar, "EUC-CN", "GB2312");
+ registerEncodingAliasIfAvailable(registrar, "EUC-CN", "CN-GB");
+ registerEncodingAliasIfAvailable(registrar, "EUC-CN", "CSGB2312");
+ registerEncodingAliasIfAvailable(registrar, "EUC-CN", "EUC_CN");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "GB_2312-80")) {
+ registerEncodingAliasIfAvailable(registrar, "GB_2312-80", "CHINESE");
+ registerEncodingAliasIfAvailable(registrar, "GB_2312-80", "csISO58GB231280");
+ registerEncodingAliasIfAvailable(registrar, "GB_2312-80", "GB2312.1980-0");
+ registerEncodingAliasIfAvailable(registrar, "GB_2312-80", "ISO-IR-58");
+ }
+
+ // Central European
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-2")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "ISO-IR-101");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "ISO8859-2");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "ISO_8859-2");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "ISO_8859-2:1987");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "L2");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "LATIN2");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "CSISOLATIN2");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "CP1250")) {
+ registerEncodingAliasIfAvailable(registrar, "CP1250", "MS-EE");
+ registerEncodingAliasIfAvailable(registrar, "CP1250", "WINDOWS-1250");
+ }
+ registerEncodingNameIfAvailable(registrar, "MAC-CENTRALEUROPE");
+
+ // Vietnamese
+ if (registerEncodingNameIfAvailable(registrar, "CP1258"))
+ registerEncodingAliasIfAvailable(registrar, "CP1258", "WINDOWS-1258");
+
+ // Turkish
+ if (registerEncodingNameIfAvailable(registrar, "CP1254")) {
+ registerEncodingAliasIfAvailable(registrar, "CP1254", "MS-TURK");
+ registerEncodingAliasIfAvailable(registrar, "CP1254", "WINDOWS-1254");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-9")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "ISO-IR-148");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "ISO8859-9");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "ISO_8859-9");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "ISO_8859-9:1989");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "L5");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "LATIN5");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "CSISOLATIN5");
+ }
+
+ // Baltic
+ if (registerEncodingNameIfAvailable(registrar, "CP1257")) {
+ registerEncodingAliasIfAvailable(registrar, "CP1257", "WINBALTRIM");
+ registerEncodingAliasIfAvailable(registrar, "CP1257", "WINDOWS-1257");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-4")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "ISO-IR-110");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "ISO8859-4");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "ISO_8859-4");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "ISO_8859-4:1988");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "L4");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "LATIN4");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "CSISOLATIN4");
+ }
}
void TextCodecGtk::registerExtendedCodecs(TextCodecRegistrar registrar)
{
- registerCodecs(registrar, true);
+ // Western
+ registerCodecIfAvailable(registrar, "MACROMAN");
+
+ // Japanese
+ registerCodecIfAvailable(registrar, "Shift_JIS");
+ registerCodecIfAvailable(registrar, "EUC-JP");
+ registerCodecIfAvailable(registrar, "ISO-2022-JP");
+
+ // Traditional Chinese
+ registerCodecIfAvailable(registrar, "BIG5");
+ registerCodecIfAvailable(registrar, "BIG5-HKSCS");
+ registerCodecIfAvailable(registrar, "CP950");
+
+ // Korean
+ registerCodecIfAvailable(registrar, "ISO-2022-KR");
+ registerCodecIfAvailable(registrar, "CP949");
+ registerCodecIfAvailable(registrar, "EUC-KR");
+
+ // Arabic
+ registerCodecIfAvailable(registrar, "ISO-8859-6");
+ // rearranged, windows-1256 now declared the canonical name and put to lowercase to fix /fast/encoding/ahram-org-eg.html test case
+ registerCodecIfAvailable(registrar, "windows-1256");
+
+ // Hebrew
+ registerCodecIfAvailable(registrar, "ISO-8859-8");
+ // rearranged, moved windows-1255 as canonical and lowercased, fixing /fast/encoding/meta-charset.html
+ registerCodecIfAvailable(registrar, "windows-1255");
+
+ // Greek
+ registerCodecIfAvailable(registrar, "ISO-8859-7");
+ registerCodecIfAvailable(registrar, "CP869");
+ registerCodecIfAvailable(registrar, "WINDOWS-1253");
+
+ // Cyrillic
+ registerCodecIfAvailable(registrar, "ISO-8859-5");
+ registerCodecIfAvailable(registrar, "KOI8-R");
+ registerCodecIfAvailable(registrar, "CP866");
+ registerCodecIfAvailable(registrar, "KOI8-U");
+ // CP1251 added to pass /fast/encoding/charset-cp1251.html
+ registerCodecIfAvailable(registrar, "windows-1251");
+ registerCodecIfAvailable(registrar, "mac-cyrillic");
+
+ // Thai
+ registerCodecIfAvailable(registrar, "CP874");
+ registerCodecIfAvailable(registrar, "TIS-620");
+
+ // Simplified Chinese
+ registerCodecIfAvailable(registrar, "GBK");
+ registerCodecIfAvailable(registrar, "HZ");
+ registerCodecIfAvailable(registrar, "GB18030");
+ registerCodecIfAvailable(registrar, "EUC-CN");
+ registerCodecIfAvailable(registrar, "GB_2312-80");
+
+ // Central European
+ registerCodecIfAvailable(registrar, "ISO-8859-2");
+ registerCodecIfAvailable(registrar, "CP1250");
+ registerCodecIfAvailable(registrar, "MAC-CENTRALEUROPE");
+
+ // Vietnamese
+ registerCodecIfAvailable(registrar, "CP1258");
+
+ // Turkish
+ registerCodecIfAvailable(registrar, "CP1254");
+ registerCodecIfAvailable(registrar, "ISO-8859-9");
+
+ // Baltic
+ registerCodecIfAvailable(registrar, "CP1257");
+ registerCodecIfAvailable(registrar, "ISO-8859-4");
}
TextCodecGtk::TextCodecGtk(const TextEncoding& encoding)
: m_encoding(encoding)
, m_numBufferedBytes(0)
- , m_iconvDecoder(reinterpret_cast<GIConv>(-1))
- , m_iconvEncoder(reinterpret_cast<GIConv>(-1))
{
}
TextCodecGtk::~TextCodecGtk()
{
- if (m_iconvDecoder != reinterpret_cast<GIConv>(-1)) {
- g_iconv_close(m_iconvDecoder);
- m_iconvDecoder = reinterpret_cast<GIConv>(-1);
- }
- if (m_iconvEncoder != reinterpret_cast<GIConv>(-1)) {
- g_iconv_close(m_iconvEncoder);
- m_iconvEncoder = reinterpret_cast<GIConv>(-1);
- }
}
void TextCodecGtk::createIConvDecoder() const
{
- ASSERT(m_iconvDecoder == reinterpret_cast<GIConv>(-1));
+ ASSERT(!m_iconvDecoder);
- m_iconvDecoder = g_iconv_open(m_internalEncodingName, m_encoding.name());
+ m_iconvDecoder = adoptPlatformRef(g_charset_converter_new(internalEncodingName, m_encoding.name(), 0));
}
void TextCodecGtk::createIConvEncoder() const
{
- ASSERT(m_iconvDecoder == reinterpret_cast<GIConv>(-1));
+ ASSERT(!m_iconvEncoder);
- m_iconvEncoder = g_iconv_open(m_encoding.name(), m_internalEncodingName);
+ m_iconvEncoder = adoptPlatformRef(g_charset_converter_new(m_encoding.name(), internalEncodingName, 0));
}
String TextCodecGtk::decode(const char* bytes, size_t length, bool flush, bool stopOnError, bool& sawError)
{
// Get a converter for the passed-in encoding.
- if (m_iconvDecoder == reinterpret_cast<GIConv>(-1)) {
+ if (!m_iconvDecoder)
createIConvDecoder();
- ASSERT(m_iconvDecoder != reinterpret_cast<GIConv>(-1));
- if (m_iconvDecoder == reinterpret_cast<GIConv>(-1)) {
- LOG_ERROR("Error creating IConv encoder even though encoding was in table.");
- return String();
- }
+ if (!m_iconvDecoder) {
+ LOG_ERROR("Error creating IConv encoder even though encoding was in table.");
+ return String();
}
- size_t countWritten, countRead, conversionLength;
- const char* conversionBytes;
+ Vector<UChar> result;
+
+ gsize bytesRead = 0;
+ gsize bytesWritten = 0;
+ const gchar* input = bytes;
+ gsize inputLength = length;
+ gchar buffer[ConversionBufferSize];
+ int flags = !length ? G_CONVERTER_INPUT_AT_END : G_CONVERTER_NO_FLAGS;
+ if (flush)
+ flags |= G_CONVERTER_FLUSH;
+
+ bool bufferWasFull = false;
char* prefixedBytes = 0;
if (m_numBufferedBytes) {
- conversionLength = length + m_numBufferedBytes;
- prefixedBytes = static_cast<char*>(fastMalloc(conversionLength));
+ inputLength = length + m_numBufferedBytes;
+ prefixedBytes = static_cast<char*>(fastMalloc(inputLength));
memcpy(prefixedBytes, m_bufferedBytes, m_numBufferedBytes);
memcpy(prefixedBytes + m_numBufferedBytes, bytes, length);
-
- conversionBytes = prefixedBytes;
-
+
+ input = prefixedBytes;
+
// all buffered bytes are consumed now
m_numBufferedBytes = 0;
- } else {
- // no previously buffered partial data,
- // just convert the data that was passed in
- conversionBytes = bytes;
- conversionLength = length;
}
- GOwnPtr<GError> err;
- GOwnPtr<UChar> buffer;
-
- buffer.outPtr() = reinterpret_cast<UChar*>(g_convert_with_iconv(conversionBytes, conversionLength, m_iconvDecoder, &countRead, &countWritten, &err.outPtr()));
-
-
- if (err) {
- LOG_ERROR("GIConv conversion error, Code %d: \"%s\"", err->code, err->message);
- m_numBufferedBytes = 0; // reset state for subsequent calls to decode
- fastFree(prefixedBytes);
- sawError = true;
- return String();
- }
-
- // Partial input at the end of the string may not result in an error being raised.
- // From the gnome library documentation on g_convert_with_iconv:
- // "Even if the conversion was successful, this may be less than len if there were partial characters at the end of the input."
- // That's why we need to compare conversionLength against countRead
-
- m_numBufferedBytes = conversionLength - countRead;
- if (m_numBufferedBytes > 0) {
- if (flush) {
- LOG_ERROR("Partial bytes at end of input while flush requested.");
- m_numBufferedBytes = 0; // reset state for subsequent calls to decode
- fastFree(prefixedBytes);
- sawError = true;
- return String();
+ do {
+ GOwnPtr<GError> error;
+ GConverterResult res = g_converter_convert(G_CONVERTER(m_iconvDecoder.get()),
+ input, inputLength,
+ buffer, sizeof(buffer),
+ static_cast<GConverterFlags>(flags),
+ &bytesRead, &bytesWritten,
+ &error.outPtr());
+ input += bytesRead;
+ inputLength -= bytesRead;
+
+ if (res == G_CONVERTER_ERROR) {
+ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_PARTIAL_INPUT)) {
+ // There is not enough input to fully determine what the conversion should produce,
+ // save it to a buffer to prepend it to the next input.
+ memcpy(m_bufferedBytes, input, inputLength);
+ m_numBufferedBytes = inputLength;
+ inputLength = 0;
+ } else if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_NO_SPACE))
+ bufferWasFull = true;
+ else if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
+ if (stopOnError)
+ sawError = true;
+ if (inputLength) {
+ // Ignore invalid character.
+ input += 1;
+ inputLength -= 1;
+ }
+ } else {
+ sawError = true;
+ LOG_ERROR("GIConv conversion error, Code %d: \"%s\"", error->code, error->message);
+ m_numBufferedBytes = 0; // Reset state for subsequent calls to decode.
+ fastFree(prefixedBytes);
+ return String();
+ }
}
- memcpy(m_bufferedBytes, conversionBytes + countRead, m_numBufferedBytes);
- }
- fastFree(prefixedBytes);
-
- Vector<UChar> result;
+ result.append(reinterpret_cast<UChar*>(buffer), bytesWritten / sizeof(UChar));
+ } while ((inputLength || bufferWasFull) && !sawError);
- result.append(buffer.get(), countWritten / sizeof(UChar));
+ fastFree(prefixedBytes);
return String::adopt(result);
}
@@ -420,23 +518,42 @@ CString TextCodecGtk::encode(const UChar* characters, size_t length, Unencodable
if (!length)
return "";
- if (m_iconvEncoder == reinterpret_cast<GIConv>(-1))
+ if (!m_iconvEncoder)
createIConvEncoder();
- if (m_iconvEncoder == reinterpret_cast<GIConv>(-1))
+ if (!m_iconvEncoder) {
+ LOG_ERROR("Error creating IConv encoder even though encoding was in table.");
return CString();
+ }
- size_t count;
-
- GOwnPtr<GError> err;
- GOwnPtr<char> buffer;
-
- buffer.outPtr() = g_convert_with_iconv(reinterpret_cast<const char*>(characters), length * sizeof(UChar), m_iconvEncoder, 0, &count, &err.outPtr());
- if (err) {
- LOG_ERROR("GIConv conversion error, Code %d: \"%s\"", err->code, err->message);
+ gsize bytesRead = 0;
+ gsize bytesWritten = 0;
+ const gchar* input = reinterpret_cast<const char*>(characters);
+ gsize inputLength = length * sizeof(UChar);
+ gchar buffer[ConversionBufferSize];
+ Vector<char> result;
+ GOwnPtr<GError> error;
+
+ size_t size = 0;
+ do {
+ g_converter_convert(G_CONVERTER(m_iconvEncoder.get()),
+ input, inputLength,
+ buffer, sizeof(buffer),
+ G_CONVERTER_INPUT_AT_END,
+ &bytesRead, &bytesWritten,
+ &error.outPtr());
+ input += bytesRead;
+ inputLength -= bytesRead;
+ result.grow(size + bytesWritten);
+ memcpy(result.data() + size, buffer, bytesWritten);
+ size += bytesWritten;
+ } while (inputLength && !error.get());
+
+ if (error) {
+ LOG_ERROR("GIConv conversion error, Code %d: \"%s\"", error->code, error->message);
return CString();
}
- return CString(buffer.get(), count);
+ return CString(result.data(), size);
}
} // namespace WebCore
diff --git a/WebCore/platform/text/gtk/TextCodecGtk.h b/WebCore/platform/text/gtk/TextCodecGtk.h
index a8af752..1fb8df9 100644
--- a/WebCore/platform/text/gtk/TextCodecGtk.h
+++ b/WebCore/platform/text/gtk/TextCodecGtk.h
@@ -29,6 +29,7 @@
#ifndef TextCodecGTK_h
#define TextCodecGTK_h
+#include "GRefPtr.h"
#include <glib.h>
#include "TextCodec.h"
#include "TextEncoding.h"
@@ -53,93 +54,11 @@ namespace WebCore {
void createIConvDecoder() const;
void createIConvEncoder() const;
- static void registerEncodingNames(EncodingNameRegistrar registrar, bool extended);
- static void registerCodecs(TextCodecRegistrar registrar, bool extended);
- static gboolean isEncodingAvailable(const gchar*);
-
TextEncoding m_encoding;
size_t m_numBufferedBytes;
unsigned char m_bufferedBytes[16]; // bigger than any single multi-byte character
- mutable GIConv m_iconvDecoder;
- mutable GIConv m_iconvEncoder;
-
- static const gchar* m_internalEncodingName;
-
- typedef const gchar* const codecAliasList[];
-
- // Unicode
- static codecAliasList m_codecAliases_UTF_8;
-
- // Western
- static codecAliasList m_codecAliases_ISO_8859_1;
- static codecAliasList m_codecAliases_MACROMAN;
-
- // Japanese
- static codecAliasList m_codecAliases_SHIFT_JIS;
- static codecAliasList m_codecAliases_EUC_JP;
- static codecAliasList m_codecAliases_ISO_2022_JP;
-
- // Traditional Chinese
- static codecAliasList m_codecAliases_BIG5;
- static codecAliasList m_codecAliases_BIG5_HKSCS;
- static codecAliasList m_codecAliases_CP950;
-
- // Korean
- static codecAliasList m_codecAliases_ISO_2022_KR;
- static codecAliasList m_codecAliases_CP949;
- static codecAliasList m_codecAliases_EUC_KR;
-
- // Arabic
- static codecAliasList m_codecAliases_ISO_8859_6;
- static codecAliasList m_codecAliases_CP1256;
-
- // Hebrew
- static codecAliasList m_codecAliases_ISO_8859_8;
- static codecAliasList m_codecAliases_CP1255;
-
- // Greek
- static codecAliasList m_codecAliases_ISO_8859_7;
- static codecAliasList m_codecAliases_CP869;
- static codecAliasList m_codecAliases_WINDOWS_1253;
-
- // Cyrillic
- static codecAliasList m_codecAliases_ISO_8859_5;
- static codecAliasList m_codecAliases_KOI8_R;
- static codecAliasList m_codecAliases_CP866;
- static codecAliasList m_codecAliases_KOI8_U;
- static codecAliasList m_codecAliases_WINDOWS_1251;
- static codecAliasList m_codecAliases_MACCYRILLIC;
-
- // Thai
- static codecAliasList m_codecAliases_CP874;
- static codecAliasList m_codecAliases_TIS_620;
-
- // Simplified Chinese
- static codecAliasList m_codecAliases_GBK;
- static codecAliasList m_codecAliases_HZ;
- static codecAliasList m_codecAliases_GB18030;
- static codecAliasList m_codecAliases_EUC_CN;
- static codecAliasList m_codecAliases_2312_80;
-
- // Central European
- static codecAliasList m_codecAliases_ISO_8859_2;
- static codecAliasList m_codecAliases_CP1250;
- static codecAliasList m_codecAliases_MACCENTRALEUROPE;
-
- // Vietnamese
- static codecAliasList m_codecAliases_CP1258;
-
- // Turkish
- static codecAliasList m_codecAliases_CP1254;
- static codecAliasList m_codecAliases_ISO_8859_9;
-
- // Baltic
- static codecAliasList m_codecAliases_CP1257;
- static codecAliasList m_codecAliases_ISO_8859_4;
-
- static gconstpointer const m_iconvBaseCodecList[];
- static gconstpointer const m_iconvExtendedCodecList[];
-
+ mutable PlatformRefPtr<GCharsetConverter> m_iconvDecoder;
+ mutable PlatformRefPtr<GCharsetConverter> m_iconvEncoder;
};
} // namespace WebCore
diff --git a/WebCore/platform/win/COMPtr.h b/WebCore/platform/win/COMPtr.h
index 6b84256..95b53af 100644
--- a/WebCore/platform/win/COMPtr.h
+++ b/WebCore/platform/win/COMPtr.h
@@ -30,10 +30,13 @@
#define NOMINMAX
#endif
-#include <guiddef.h>
#include <unknwn.h>
-#include <WTF/Assertions.h>
-#include <WTF/HashTraits.h>
+#include <wtf/Assertions.h>
+#include <wtf/HashTraits.h>
+
+#if !OS(WINCE)
+#include <guiddef.h>
+#endif
typedef long HRESULT;
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp
index 7a54737..f467d65 100644
--- a/WebCore/platform/win/ClipboardWin.cpp
+++ b/WebCore/platform/win/ClipboardWin.cpp
@@ -56,6 +56,7 @@
#include <wininet.h>
#include <wtf/RefPtr.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringConcatenate.h>
#include <wtf/text/StringHash.h>
using namespace std;
@@ -64,9 +65,6 @@ namespace WebCore {
using namespace HTMLNames;
-// format string for
-static const char szShellDotUrlTemplate[] = "[InternetShortcut]\r\nURL=%s\r\n";
-
// We provide the IE clipboard types (URL and Text), and the clipboard types specified in the WHATWG Web Applications 1.0 draft
// see http://www.whatwg.org/specs/web-apps/current-work/ Section 6.3.5.3
@@ -163,36 +161,19 @@ static String filesystemPathFromUrlOrTitle(const String& url, const String& titl
return result;
}
-static HGLOBAL createGlobalURLContent(const String& url, int estimatedFileSize)
+static HGLOBAL createGlobalURLContent(const CString& content)
{
HRESULT hr = S_OK;
HGLOBAL memObj = 0;
char* fileContents;
- char ansiUrl[INTERNET_MAX_URL_LENGTH + 1];
- // Used to generate the buffer. This is null terminated whereas the fileContents won't be.
- char contentGenerationBuffer[INTERNET_MAX_URL_LENGTH + ARRAYSIZE(szShellDotUrlTemplate) + 1];
-
- if (estimatedFileSize > 0 && estimatedFileSize > ARRAYSIZE(contentGenerationBuffer))
- return 0;
-
- int ansiUrlSize = ::WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)url.characters(), url.length(), ansiUrl, ARRAYSIZE(ansiUrl) - 1, 0, 0);
- if (!ansiUrlSize)
- return 0;
- ansiUrl[ansiUrlSize] = 0;
-
- int fileSize = (int) (ansiUrlSize+strlen(szShellDotUrlTemplate)-2); // -2 to remove the %s
- ASSERT(estimatedFileSize < 0 || fileSize == estimatedFileSize);
-
- memObj = GlobalAlloc(GPTR, fileSize);
+ memObj = GlobalAlloc(GPTR, content.length());
if (!memObj)
return 0;
fileContents = (PSTR)GlobalLock(memObj);
-
- sprintf_s(contentGenerationBuffer, ARRAYSIZE(contentGenerationBuffer), szShellDotUrlTemplate, ansiUrl);
- CopyMemory(fileContents, contentGenerationBuffer, fileSize);
+ CopyMemory(fileContents, content.data(), content.length());
GlobalUnlock(memObj);
@@ -277,7 +258,7 @@ static HGLOBAL createGlobalHDropContent(const KURL& url, String& fileName, Share
return memObj;
}
-static HGLOBAL createGlobalUrlFileDescriptor(const String& url, const String& title, int& /*out*/ estimatedSize)
+static HGLOBAL createGlobalUrlFileDescriptor(const String& url, const String& title, const CString& content)
{
HRESULT hr = S_OK;
HGLOBAL memObj = 0;
@@ -290,10 +271,7 @@ static HGLOBAL createGlobalUrlFileDescriptor(const String& url, const String& ti
memset(fgd, 0, sizeof(FILEGROUPDESCRIPTOR));
fgd->cItems = 1;
fgd->fgd[0].dwFlags = FD_FILESIZE;
- int fileSize = ::WideCharToMultiByte(CP_ACP, 0, url.characters(), url.length(), 0, 0, 0, 0);
- fileSize += strlen(szShellDotUrlTemplate) - 2; // -2 is for getting rid of %s in the template string
- fgd->fgd[0].nFileSizeLow = fileSize;
- estimatedSize = fileSize;
+ fgd->fgd[0].nFileSizeLow = content.length();
fsPath = filesystemPathFromUrlOrTitle(url, title, L".URL", true);
if (fsPath.length() <= 0) {
@@ -744,13 +722,15 @@ void ClipboardWin::writeURL(const KURL& kurl, const String& titleStr, Frame*)
return;
WebCore::writeURL(m_writableDataObject.get(), kurl, titleStr, true, true);
- int estimatedSize = 0;
String url = kurl.string();
+ ASSERT(url.containsOnlyASCII()); // KURL::string() is URL encoded.
+
+ CString content = makeString("[InternetShortcut]\r\nURL=", url, "\r\n").ascii();
- HGLOBAL urlFileDescriptor = createGlobalUrlFileDescriptor(url, titleStr, estimatedSize);
+ HGLOBAL urlFileDescriptor = createGlobalUrlFileDescriptor(url, titleStr, content);
if (!urlFileDescriptor)
return;
- HGLOBAL urlFileContent = createGlobalURLContent(url, estimatedSize);
+ HGLOBAL urlFileContent = createGlobalURLContent(content);
if (!urlFileContent) {
GlobalFree(urlFileDescriptor);
return;
diff --git a/WebCore/platform/win/ContextMenuItemWin.cpp b/WebCore/platform/win/ContextMenuItemWin.cpp
index e265c96..ade0db0 100644
--- a/WebCore/platform/win/ContextMenuItemWin.cpp
+++ b/WebCore/platform/win/ContextMenuItemWin.cpp
@@ -31,6 +31,18 @@
#include <wtf/text/CString.h>
#include <windows.h>
+#if OS(WINCE)
+#ifndef MFS_DISABLED
+#define MFS_DISABLED MF_GRAYED
+#endif
+#ifndef MIIM_FTYPE
+#define MIIM_FTYPE MIIM_TYPE
+#endif
+#ifndef MIIM_STRING
+#define MIIM_STRING 0
+#endif
+#endif
+
namespace WebCore {
ContextMenuItem::ContextMenuItem(LPMENUITEMINFO item)
diff --git a/WebCore/platform/win/FileSystemWin.cpp b/WebCore/platform/win/FileSystemWin.cpp
index 4b7a692..2cca08c 100644
--- a/WebCore/platform/win/FileSystemWin.cpp
+++ b/WebCore/platform/win/FileSystemWin.cpp
@@ -192,8 +192,8 @@ CString openTemporaryFile(const char*, PlatformFileHandle& handle)
handle = INVALID_HANDLE_VALUE;
char tempPath[MAX_PATH];
- int tempPathLength = ::GetTempPathA(_countof(tempPath), tempPath);
- if (tempPathLength <= 0 || tempPathLength > _countof(tempPath))
+ int tempPathLength = ::GetTempPathA(WTF_ARRAY_LENGTH(tempPath), tempPath);
+ if (tempPathLength <= 0 || tempPathLength > WTF_ARRAY_LENGTH(tempPath))
return CString();
HCRYPTPROV hCryptProv = 0;
diff --git a/WebCore/platform/wince/FileSystemWinCE.cpp b/WebCore/platform/wince/FileSystemWinCE.cpp
index 2a27089..90b278e 100644
--- a/WebCore/platform/wince/FileSystemWinCE.cpp
+++ b/WebCore/platform/wince/FileSystemWinCE.cpp
@@ -174,8 +174,8 @@ CString openTemporaryFile(const char*, PlatformFileHandle& handle)
handle = INVALID_HANDLE_VALUE;
wchar_t tempPath[MAX_PATH];
- int tempPathLength = ::GetTempPath(_countof(tempPath), tempPath);
- if (tempPathLength <= 0 || tempPathLength > _countof(tempPath))
+ int tempPathLength = ::GetTempPath(WTF_ARRAY_LENGTH(tempPath), tempPath);
+ if (tempPathLength <= 0 || tempPathLength > WTF_ARRAY_LENGTH(tempPath))
return CString();
HCRYPTPROV hCryptProv = 0;
diff --git a/WebCore/platform/wince/TemporaryLinkStubs.cpp b/WebCore/platform/wince/TemporaryLinkStubs.cpp
new file mode 100644
index 0000000..dbd62dc
--- /dev/null
+++ b/WebCore/platform/wince/TemporaryLinkStubs.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "CookieStorage.h"
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
+} // namespace WebCore
diff --git a/WebCore/plugins/PluginDatabase.cpp b/WebCore/plugins/PluginDatabase.cpp
index 368c83e..b9e154a 100644
--- a/WebCore/plugins/PluginDatabase.cpp
+++ b/WebCore/plugins/PluginDatabase.cpp
@@ -284,26 +284,26 @@ String PluginDatabase::MIMETypeForExtension(const String& extension) const
PluginPackage* PluginDatabase::findPlugin(const KURL& url, String& mimeType)
{
- PluginPackage* plugin = pluginForMIMEType(mimeType);
- String filename = url.string();
-
+ if (!mimeType.isEmpty())
+ return pluginForMIMEType(mimeType);
+
+ String filename = url.lastPathComponent();
+ if (filename.endsWith("/"))
+ return 0;
+
+ int extensionPos = filename.reverseFind('.');
+ if (extensionPos == -1)
+ return 0;
+
+ String mimeTypeForExtension = MIMETypeForExtension(filename.substring(extensionPos + 1));
+ PluginPackage* plugin = pluginForMIMEType(mimeTypeForExtension);
if (!plugin) {
- String filename = url.lastPathComponent();
- if (!filename.endsWith("/")) {
- int extensionPos = filename.reverseFind('.');
- if (extensionPos != -1) {
- String extension = filename.substring(extensionPos + 1);
-
- String mimeTypeForExtension = MIMETypeForExtension(extension);
- if ((plugin = pluginForMIMEType(mimeTypeForExtension)))
- mimeType = mimeTypeForExtension;
- }
- }
+ // FIXME: if no plugin could be found, query Windows for the mime type
+ // corresponding to the extension.
+ return 0;
}
-
- // FIXME: if no plugin could be found, query Windows for the mime type
- // corresponding to the extension.
-
+
+ mimeType = mimeTypeForExtension;
return plugin;
}
diff --git a/WebCore/plugins/PluginPackage.cpp b/WebCore/plugins/PluginPackage.cpp
index 2e0308b..10149bf 100644
--- a/WebCore/plugins/PluginPackage.cpp
+++ b/WebCore/plugins/PluginPackage.cpp
@@ -348,7 +348,7 @@ unsigned PluginPackage::hash() const
m_lastModified
};
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
bool PluginPackage::equal(const PluginPackage& a, const PluginPackage& b)
diff --git a/WebCore/plugins/PluginStream.cpp b/WebCore/plugins/PluginStream.cpp
index a6486c9..4d73789 100644
--- a/WebCore/plugins/PluginStream.cpp
+++ b/WebCore/plugins/PluginStream.cpp
@@ -428,7 +428,6 @@ void PluginStream::didReceiveResponse(NetscapePlugInStreamLoader* loader, const
void PluginStream::didReceiveData(NetscapePlugInStreamLoader* loader, const char* data, int length)
{
ASSERT(loader == m_loader);
- ASSERT(length > 0);
ASSERT(m_streamState == StreamStarted);
// If the plug-in cancels the stream in deliverData it could be deleted,
diff --git a/WebCore/plugins/gtk/PluginViewGtk.cpp b/WebCore/plugins/gtk/PluginViewGtk.cpp
index 6954af3..80641a1 100644
--- a/WebCore/plugins/gtk/PluginViewGtk.cpp
+++ b/WebCore/plugins/gtk/PluginViewGtk.cpp
@@ -790,7 +790,7 @@ bool PluginView::platformStart()
g_signal_connect(platformPluginWidget(), "plug-added", G_CALLBACK(plugAddedCallback), this);
g_signal_connect(platformPluginWidget(), "plug-removed", G_CALLBACK(plugRemovedCallback), NULL);
} else
- setPlatformWidget(gtk_xtbin_new(gtk_widget_get_window(pageClient), 0));
+ setPlatformWidget(gtk_xtbin_new(pageClient, 0));
#else
setPlatformWidget(gtk_socket_new());
gtk_container_add(GTK_CONTAINER(pageClient), platformPluginWidget());
diff --git a/WebCore/plugins/gtk/gtk2xtbin.c b/WebCore/plugins/gtk/gtk2xtbin.c
index 31c564f..f668bff 100644
--- a/WebCore/plugins/gtk/gtk2xtbin.c
+++ b/WebCore/plugins/gtk/gtk2xtbin.c
@@ -322,13 +322,14 @@ gtk_xtbin_realize (GtkWidget *widget)
GtkWidget*
-gtk_xtbin_new (GdkWindow *parent_window, String * f)
+gtk_xtbin_new (GtkWidget *parent_widget, String *f)
{
GtkXtBin *xtbin;
gpointer user_data;
GdkScreen *screen;
GdkVisual* visual;
Colormap colormap;
+ GdkWindow* parent_window = gtk_widget_get_window(parent_widget);
assert(parent_window != NULL);
xtbin = g_object_new (GTK_TYPE_XTBIN, NULL);
@@ -342,7 +343,7 @@ gtk_xtbin_new (GdkWindow *parent_window, String * f)
/* Initialize the Xt toolkit */
xtbin->parent_window = parent_window;
- screen = gtk_widget_get_screen(GTK_WIDGET(parent_window));
+ screen = gtk_widget_get_screen(parent_widget);
visual = gdk_screen_get_system_visual(screen);
colormap = XCreateColormap(GDK_DISPLAY_XDISPLAY(gdk_screen_get_display(screen)),
GDK_WINDOW_XWINDOW(gdk_screen_get_root_window(screen)),
diff --git a/WebCore/plugins/gtk/gtk2xtbin.h b/WebCore/plugins/gtk/gtk2xtbin.h
index 7bcfab6..11f6e06 100644
--- a/WebCore/plugins/gtk/gtk2xtbin.h
+++ b/WebCore/plugins/gtk/gtk2xtbin.h
@@ -101,7 +101,7 @@ struct _GtkXtBinClass
};
GTKXTBIN_API(GType) gtk_xtbin_get_type (void);
-GTKXTBIN_API(GtkWidget *) gtk_xtbin_new (GdkWindow *parent_window, String *f);
+GTKXTBIN_API(GtkWidget *) gtk_xtbin_new (GtkWidget *parent_widget, String *f);
GTKXTBIN_API(void) gtk_xtbin_set_position (GtkXtBin *xtbin,
gint x,
gint y);
diff --git a/WebCore/plugins/win/PluginDatabaseWin.cpp b/WebCore/plugins/win/PluginDatabaseWin.cpp
index 6cbcdc8..27121c6 100644
--- a/WebCore/plugins/win/PluginDatabaseWin.cpp
+++ b/WebCore/plugins/win/PluginDatabaseWin.cpp
@@ -34,10 +34,6 @@
#include <windows.h>
#include <shlwapi.h>
-#if COMPILER(MINGW)
-#define _countof(x) (sizeof(x)/sizeof(x[0]))
-#endif
-
#if OS(WINCE)
// WINCE doesn't support Registry Key Access Rights. The parameter should always be 0
#ifndef KEY_ENUMERATE_SUB_KEYS
@@ -96,7 +92,7 @@ static inline void addPluginPathsFromRegistry(HKEY rootKey, HashSet<String>& pat
// Enumerate subkeys
for (int i = 0;; i++) {
- DWORD nameLen = _countof(name);
+ DWORD nameLen = WTF_ARRAY_LENGTH(name);
result = RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, &lastModified);
if (result != ERROR_SUCCESS)
@@ -257,9 +253,9 @@ static inline void addWindowsMediaPlayerPluginDirectory(Vector<String>& director
#if !OS(WINCE)
// The new WMP Firefox plugin is installed in \PFiles\Plugins if it can't find any Firefox installs
WCHAR pluginDirectoryStr[_MAX_PATH + 1];
- DWORD pluginDirectorySize = ::ExpandEnvironmentStringsW(TEXT("%SYSTEMDRIVE%\\PFiles\\Plugins"), pluginDirectoryStr, _countof(pluginDirectoryStr));
+ DWORD pluginDirectorySize = ::ExpandEnvironmentStringsW(TEXT("%SYSTEMDRIVE%\\PFiles\\Plugins"), pluginDirectoryStr, WTF_ARRAY_LENGTH(pluginDirectoryStr));
- if (pluginDirectorySize > 0 && pluginDirectorySize <= _countof(pluginDirectoryStr))
+ if (pluginDirectorySize > 0 && pluginDirectorySize <= WTF_ARRAY_LENGTH(pluginDirectoryStr))
directories.append(String(pluginDirectoryStr, pluginDirectorySize - 1));
#endif
@@ -410,7 +406,7 @@ static inline void addMacromediaPluginDirectories(Vector<String>& directories)
#if !OS(WINCE)
WCHAR systemDirectoryStr[MAX_PATH];
- if (GetSystemDirectory(systemDirectoryStr, _countof(systemDirectoryStr)) == 0)
+ if (!GetSystemDirectory(systemDirectoryStr, WTF_ARRAY_LENGTH(systemDirectoryStr)))
return;
WCHAR macromediaDirectoryStr[MAX_PATH];
diff --git a/WebCore/plugins/win/PluginPackageWin.cpp b/WebCore/plugins/win/PluginPackageWin.cpp
index f3dd781..74bd2a9 100644
--- a/WebCore/plugins/win/PluginPackageWin.cpp
+++ b/WebCore/plugins/win/PluginPackageWin.cpp
@@ -312,7 +312,7 @@ unsigned PluginPackage::hash() const
m_mimeToExtensions.size()
};
- return StringImpl::computeHash(reinterpret_cast<const UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
bool PluginPackage::equal(const PluginPackage& a, const PluginPackage& b)
diff --git a/WebCore/rendering/InlineBox.cpp b/WebCore/rendering/InlineBox.cpp
index 2028d4e..1ce68f9 100644
--- a/WebCore/rendering/InlineBox.cpp
+++ b/WebCore/rendering/InlineBox.cpp
@@ -23,7 +23,7 @@
#include "HitTestResult.h"
#include "InlineFlowBox.h"
#include "RenderArena.h"
-#include "RenderBox.h"
+#include "RenderBlock.h"
#include "RootInlineBox.h"
using namespace std;
@@ -279,6 +279,30 @@ int InlineBox::placeEllipsisBox(bool, int, int, int, bool&)
return -1;
}
+void InlineBox::adjustForFlippedBlocksWritingMode(IntPoint& point)
+{
+ if (!renderer()->style()->isFlippedBlocksWritingMode())
+ return;
+
+ RenderBlock* block = root()->block();
+ if (block->style()->isHorizontalWritingMode())
+ point.setY(block->height() - height() - point.y());
+ else
+ point.setX(block->width() - width() - point.x());
+}
+
+void InlineBox::adjustForFlippedBlocksWritingMode(IntRect& rect)
+{
+ if (!renderer()->style()->isFlippedBlocksWritingMode())
+ return;
+
+ RenderBlock* block = root()->block();
+ if (block->style()->isHorizontalWritingMode())
+ rect.setY(block->height() - rect.bottom());
+ else
+ rect.setX(block->width() - rect.right());
+}
+
} // namespace WebCore
#ifndef NDEBUG
diff --git a/WebCore/rendering/InlineBox.h b/WebCore/rendering/InlineBox.h
index 38a7805..1e4b8bf 100644
--- a/WebCore/rendering/InlineBox.h
+++ b/WebCore/rendering/InlineBox.h
@@ -216,6 +216,9 @@ public:
void setY(int y) { m_y = y; }
int y() const { return m_y; }
+ int width() const { return m_isVertical ? logicalHeight() : logicalWidth(); }
+ int height() const { return m_isVertical ? logicalWidth() : logicalHeight(); }
+
// The logicalLeft position is the left edge of the line box in a horizontal line and the top edge in a vertical line.
int logicalLeft() const { return !m_isVertical ? m_x : m_y; }
int logicalRight() const { return logicalLeft() + logicalWidth(); }
@@ -229,6 +232,7 @@ public:
// The logicalTop[ position is the top edge of the line box in a horizontal line and the left edge in a vertical line.
int logicalTop() const { return !m_isVertical ? m_y : m_x; }
+ int logicalBottom() const { return logicalTop() + logicalHeight(); }
void setLogicalTop(int top)
{
if (!m_isVertical)
@@ -286,6 +290,9 @@ public:
return 0;
}
+ void adjustForFlippedBlocksWritingMode(IntPoint&);
+ void adjustForFlippedBlocksWritingMode(IntRect&);
+
private:
InlineBox* m_next; // The next element on the same line as us.
InlineBox* m_prev; // The previous element on the same line as us.
diff --git a/WebCore/rendering/InlineFlowBox.cpp b/WebCore/rendering/InlineFlowBox.cpp
index 79c571d..d165231 100644
--- a/WebCore/rendering/InlineFlowBox.cpp
+++ b/WebCore/rendering/InlineFlowBox.cpp
@@ -299,8 +299,8 @@ int InlineFlowBox::placeBoxesInInlineDirection(int logicalLeft, bool& needsWordS
int textShadowLogicalLeft;
int textShadowLogicalRight;
rt->style(m_firstLine)->getTextShadowInlineDirectionExtent(textShadowLogicalLeft, textShadowLogicalRight);
- childOverflowLogicalLeft = min(childOverflowLogicalLeft, textShadowLogicalLeft);
- childOverflowLogicalRight = max(childOverflowLogicalRight, textShadowLogicalRight);
+ childOverflowLogicalLeft = min(childOverflowLogicalLeft, textShadowLogicalLeft + logicalLeftGlyphOverflow);
+ childOverflowLogicalRight = max(childOverflowLogicalRight, textShadowLogicalRight + logicalRightGlyphOverflow);
logicalLeftVisualOverflow = min(logicalLeft + childOverflowLogicalLeft, logicalLeftVisualOverflow);
logicalRightVisualOverflow = max(logicalLeft + text->logicalWidth() + childOverflowLogicalRight, logicalRightVisualOverflow);
@@ -562,12 +562,14 @@ void InlineFlowBox::flipLinesInBlockDirection(int lineTop, int lineBottom)
void InlineFlowBox::computeBlockDirectionOverflow(int lineTop, int lineBottom, bool strictMode, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
{
+ bool isFlippedLine = renderer()->style(m_firstLine)->isFlippedLinesWritingMode();
+
int boxHeight = logicalHeight();
// Any spillage outside of the line top and bottom is not considered overflow. We just ignore this, since it only happens
// from the "your ascent/descent don't affect the line" quirk.
- int topOverflow = max(y(), lineTop);
- int bottomOverflow = min(y() + boxHeight, lineBottom);
+ int topOverflow = max(logicalTop(), lineTop);
+ int bottomOverflow = min(logicalTop() + boxHeight, lineBottom);
int topLayoutOverflow = topOverflow;
int bottomLayoutOverflow = bottomOverflow;
@@ -579,10 +581,10 @@ void InlineFlowBox::computeBlockDirectionOverflow(int lineTop, int lineBottom, b
if (parent()) {
int boxShadowTop;
int boxShadowBottom;
- renderer()->style(m_firstLine)->getBoxShadowVerticalExtent(boxShadowTop, boxShadowBottom);
+ renderer()->style(m_firstLine)->getBoxShadowBlockDirectionExtent(boxShadowTop, boxShadowBottom);
- topVisualOverflow = min(y() + boxShadowTop, topVisualOverflow);
- bottomVisualOverflow = max(y() + boxHeight + boxShadowBottom, bottomVisualOverflow);
+ topVisualOverflow = min(logicalTop() + boxShadowTop, topVisualOverflow);
+ bottomVisualOverflow = max(logicalTop() + boxHeight + boxShadowBottom, bottomVisualOverflow);
}
for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
@@ -600,39 +602,53 @@ void InlineFlowBox::computeBlockDirectionOverflow(int lineTop, int lineBottom, b
GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.find(static_cast<InlineTextBox*>(curr));
GlyphOverflow* glyphOverflow = it == textBoxDataMap.end() ? 0 : &it->second.second;
- int topGlyphOverflow = -strokeOverflow - (glyphOverflow ? glyphOverflow->top : 0);
- int bottomGlyphOverflow = strokeOverflow + (glyphOverflow ? glyphOverflow->bottom : 0);
+ int topGlyphEdge = glyphOverflow ? (isFlippedLine ? glyphOverflow->bottom : glyphOverflow->top) : 0;
+ int bottomGlyphEdge = glyphOverflow ? (isFlippedLine ? glyphOverflow->top : glyphOverflow->bottom) : 0;
- int childOverflowTop = topGlyphOverflow;
- int childOverflowBottom = bottomGlyphOverflow;
- for (const ShadowData* shadow = rt->style()->textShadow(); shadow; shadow = shadow->next()) {
- childOverflowTop = min(childOverflowTop, shadow->y() - shadow->blur() + topGlyphOverflow);
- childOverflowBottom = max(childOverflowBottom, shadow->y() + shadow->blur() + bottomGlyphOverflow);
- }
-
- topVisualOverflow = min(curr->y() + childOverflowTop, topVisualOverflow);
- bottomVisualOverflow = max(curr->y() + text->logicalHeight() + childOverflowBottom, bottomVisualOverflow);
+ int topGlyphOverflow = -strokeOverflow - topGlyphEdge;
+ int bottomGlyphOverflow = strokeOverflow + bottomGlyphEdge;
+
+ int textShadowTop;
+ int textShadowBottom;
+ curr->renderer()->style(m_firstLine)->getTextShadowBlockDirectionExtent(textShadowTop, textShadowBottom);
+
+ int childOverflowTop = min(textShadowTop + topGlyphOverflow, topGlyphOverflow);
+ int childOverflowBottom = max(textShadowBottom + bottomGlyphOverflow, bottomGlyphOverflow);
+
+ topVisualOverflow = min(curr->logicalTop() + childOverflowTop, topVisualOverflow);
+ bottomVisualOverflow = max(curr->logicalTop() + text->logicalHeight() + childOverflowBottom, bottomVisualOverflow);
} else if (curr->renderer()->isRenderInline()) {
InlineFlowBox* flow = static_cast<InlineFlowBox*>(curr);
flow->computeBlockDirectionOverflow(lineTop, lineBottom, strictMode, textBoxDataMap);
- topLayoutOverflow = min(topLayoutOverflow, flow->topLayoutOverflow());
- bottomLayoutOverflow = max(bottomLayoutOverflow, flow->bottomLayoutOverflow());
- topVisualOverflow = min(topVisualOverflow, flow->topVisualOverflow());
- bottomVisualOverflow = max(bottomVisualOverflow, flow->bottomVisualOverflow());
+ topLayoutOverflow = min(topLayoutOverflow, flow->logicalTopLayoutOverflow());
+ bottomLayoutOverflow = max(bottomLayoutOverflow, flow->logicalBottomLayoutOverflow());
+ topVisualOverflow = min(topVisualOverflow, flow->logicalTopVisualOverflow());
+ bottomVisualOverflow = max(bottomVisualOverflow, flow->logicalBottomVisualOverflow());
} else if (!curr->boxModelObject()->hasSelfPaintingLayer()){
// Only include overflow from replaced inlines if they do not paint themselves.
+ int boxLogicalTop = curr->logicalTop();
+ int childTopLayoutOverflow;
+ int childBottomLayoutOverflow;
+ int childTopVisualOverflow;
+ int childBottomVisualOverflow;
+
RenderBox* box = toRenderBox(curr->renderer());
- int boxY = curr->y();
- int childTopOverflow = box->hasOverflowClip() ? 0 : box->topLayoutOverflow();
- int childBottomOverflow = box->hasOverflowClip() ? curr->logicalHeight() : box->bottomLayoutOverflow();
- topLayoutOverflow = min(boxY + childTopOverflow, topLayoutOverflow);
- bottomLayoutOverflow = max(boxY + childBottomOverflow, bottomLayoutOverflow);
- topVisualOverflow = min(boxY + box->topVisualOverflow(), topVisualOverflow);
- bottomVisualOverflow = max(boxY + box->bottomVisualOverflow(), bottomVisualOverflow);
+ box->blockDirectionOverflow(isVertical(), childTopLayoutOverflow, childBottomLayoutOverflow,
+ childTopVisualOverflow, childBottomVisualOverflow);
+
+ if (box->hasOverflowClip()) {
+ childTopLayoutOverflow = 0;
+ childBottomLayoutOverflow = curr->logicalHeight();
+ }
+
+ topLayoutOverflow = min(boxLogicalTop + childTopLayoutOverflow, topLayoutOverflow);
+ bottomLayoutOverflow = max(boxLogicalTop + childBottomLayoutOverflow, bottomLayoutOverflow);
+ topVisualOverflow = min(boxLogicalTop + childTopVisualOverflow, topVisualOverflow);
+ bottomVisualOverflow = max(boxLogicalTop + childBottomVisualOverflow, bottomVisualOverflow);
}
}
- setBlockDirectionOverflowPositions(topLayoutOverflow, bottomLayoutOverflow, topVisualOverflow, bottomVisualOverflow, boxHeight);
+ setBlockDirectionOverflowPositions(topLayoutOverflow, bottomLayoutOverflow, topVisualOverflow, bottomVisualOverflow);
}
bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty)
@@ -651,7 +667,7 @@ bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
}
// Now check ourselves.
- IntRect rect(tx + m_x, ty + m_y, m_logicalWidth, logicalHeight());
+ IntRect rect(tx + m_x, ty + m_y, width(), height());
if (visibleToHitTesting() && rect.intersects(result.rectForPoint(x, y))) {
renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty)); // Don't add in m_x or m_y here, we want coords in the containing block's space.
if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, rect))
@@ -665,6 +681,7 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, int tx, int ty)
{
IntRect overflowRect(visibleOverflowRect());
overflowRect.inflate(renderer()->maximalOutlineSize(paintInfo.phase));
+ adjustForFlippedBlocksWritingMode(overflowRect);
overflowRect.move(tx, ty);
if (!paintInfo.rect.intersects(overflowRect))
@@ -701,11 +718,8 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, int tx, int ty)
paintMask(paintInfo, tx, ty);
return;
} else {
- // 1. Paint our background, border and box-shadow.
+ // Paint our background, border and box-shadow.
paintBoxDecorations(paintInfo, tx, ty);
-
- // 2. Paint our underline and overline.
- paintTextDecorations(paintInfo, tx, ty, false);
}
}
@@ -717,17 +731,13 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, int tx, int ty)
childInfo.phase = paintPhase;
childInfo.updatePaintingRootForChildren(renderer());
- // 3. Paint our children.
+ // Paint our children.
if (paintPhase != PaintPhaseSelfOutline) {
for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
if (curr->renderer()->isText() || !curr->boxModelObject()->hasSelfPaintingLayer())
curr->paint(childInfo, tx, ty);
}
}
-
- // 4. Paint our strike-through
- if (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)
- paintTextDecorations(paintInfo, tx, ty, true);
}
void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, int _tx, int _ty, int w, int h, CompositeOperator op)
@@ -746,23 +756,26 @@ void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, c
boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, tx, ty, w, h, this, op);
else {
// We have a fill image that spans multiple lines.
- // We need to adjust _tx and _ty by the width of all previous lines.
+ // We need to adjust tx and ty by the width of all previous lines.
// Think of background painting on inlines as though you had one long line, a single continuous
// strip. Even though that strip has been broken up across multiple lines, you still paint it
// as though you had one single line. This means each line has to pick up the background where
// the previous line left off.
// FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
// but it isn't even clear how this should work at all.
- int xOffsetOnLine = 0;
+ int logicalOffsetOnLine = 0;
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
- xOffsetOnLine += curr->logicalWidth();
- int startX = tx - xOffsetOnLine;
- int totalWidth = xOffsetOnLine;
+ logicalOffsetOnLine += curr->logicalWidth();
+ int totalLogicalWidth = logicalOffsetOnLine;
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
- totalWidth += curr->logicalWidth();
+ totalLogicalWidth += curr->logicalWidth();
+ int stripX = tx - (isVertical() ? 0 : logicalOffsetOnLine);
+ int stripY = ty - (isVertical() ? logicalOffsetOnLine : 0);
+ int stripWidth = isVertical() ? width() : totalLogicalWidth;
+ int stripHeight = isVertical() ? totalLogicalWidth : height();
paintInfo.context->save();
- paintInfo.context->clip(IntRect(tx, ty, logicalWidth(), logicalHeight()));
- boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, startX, ty, totalWidth, h, this, op);
+ paintInfo.context->clip(IntRect(tx, ty, width(), height()));
+ boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, stripX, stripY, stripWidth, stripHeight, this, op);
paintInfo.context->restore();
}
}
@@ -800,8 +813,10 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
}
// Move x/y to our coordinates.
- tx += x;
- ty += y;
+ IntPoint localPoint(x, y);
+ adjustForFlippedBlocksWritingMode(localPoint);
+ tx += localPoint.x();
+ ty += localPoint.y();
GraphicsContext* context = paintInfo.context;
@@ -833,23 +848,26 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
boxModelObject()->paintBorder(context, tx, ty, w, h, renderer()->style(), includeLogicalLeftEdge(), includeLogicalRightEdge());
else {
// We have a border image that spans multiple lines.
- // We need to adjust _tx and _ty by the width of all previous lines.
+ // We need to adjust tx and ty by the width of all previous lines.
// Think of border image painting on inlines as though you had one long line, a single continuous
// strip. Even though that strip has been broken up across multiple lines, you still paint it
// as though you had one single line. This means each line has to pick up the image where
// the previous line left off.
// FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
// but it isn't even clear how this should work at all.
- int xOffsetOnLine = 0;
+ int logicalOffsetOnLine = 0;
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
- xOffsetOnLine += curr->logicalWidth();
- int startX = tx - xOffsetOnLine;
- int totalWidth = xOffsetOnLine;
+ logicalOffsetOnLine += curr->logicalWidth();
+ int totalLogicalWidth = logicalOffsetOnLine;
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
- totalWidth += curr->logicalWidth();
+ totalLogicalWidth += curr->logicalWidth();
+ int stripX = tx - (isVertical() ? 0 : logicalOffsetOnLine);
+ int stripY = ty - (isVertical() ? logicalOffsetOnLine : 0);
+ int stripWidth = isVertical() ? w : totalLogicalWidth;
+ int stripHeight = isVertical() ? totalLogicalWidth : h;
context->save();
context->clip(IntRect(tx, ty, w, h));
- boxModelObject()->paintBorder(context, startX, ty, totalWidth, h, renderer()->style());
+ boxModelObject()->paintBorder(context, stripX, stripY, stripWidth, stripHeight, renderer()->style());
context->restore();
}
}
@@ -878,8 +896,10 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
}
// Move x/y to our coordinates.
- tx += x;
- ty += y;
+ IntPoint localPoint(x, y);
+ adjustForFlippedBlocksWritingMode(localPoint);
+ tx += localPoint.x();
+ ty += localPoint.y();
const NinePieceImage& maskNinePieceImage = renderer()->style()->maskBoxImage();
StyleImage* maskBoxImage = renderer()->style()->maskBoxImage().image();
@@ -913,16 +933,19 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
} else {
// We have a mask image that spans multiple lines.
// We need to adjust _tx and _ty by the width of all previous lines.
- int xOffsetOnLine = 0;
+ int logicalOffsetOnLine = 0;
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
- xOffsetOnLine += curr->logicalWidth();
- int startX = tx - xOffsetOnLine;
- int totalWidth = xOffsetOnLine;
+ logicalOffsetOnLine += curr->logicalWidth();
+ int totalLogicalWidth = logicalOffsetOnLine;
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
- totalWidth += curr->logicalWidth();
+ totalLogicalWidth += curr->logicalWidth();
+ int stripX = tx - (isVertical() ? 0 : logicalOffsetOnLine);
+ int stripY = ty - (isVertical() ? logicalOffsetOnLine : 0);
+ int stripWidth = isVertical() ? w : totalLogicalWidth;
+ int stripHeight = isVertical() ? totalLogicalWidth : h;
paintInfo.context->save();
paintInfo.context->clip(IntRect(tx, ty, w, h));
- boxModelObject()->paintNinePieceImage(paintInfo.context, startX, ty, totalWidth, h, renderer()->style(), maskNinePieceImage, compositeOp);
+ boxModelObject()->paintNinePieceImage(paintInfo.context, stripX, stripY, stripWidth, stripHeight, renderer()->style(), maskNinePieceImage, compositeOp);
paintInfo.context->restore();
}
@@ -930,163 +953,6 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
paintInfo.context->endTransparencyLayer();
}
-static bool shouldDrawTextDecoration(RenderObject* obj)
-{
- for (RenderObject* curr = obj->firstChild(); curr; curr = curr->nextSibling()) {
- if (curr->isRenderInline())
- return true;
- if (curr->isText() && !curr->isBR()) {
- if (!curr->style()->collapseWhiteSpace())
- return true;
- Node* currElement = curr->node();
- if (!currElement)
- return true;
- if (!currElement->isTextNode())
- return true;
- if (!static_cast<Text*>(currElement)->containsOnlyWhitespace())
- return true;
- }
- }
- return false;
-}
-
-void InlineFlowBox::paintTextDecorations(PaintInfo& paintInfo, int tx, int ty, bool paintedChildren)
-{
- // Paint text decorations like underlines/overlines. We only do this if we aren't in quirks mode (i.e., in
- // almost-strict mode or strict mode).
- if (renderer()->document()->inQuirksMode() || !paintInfo.shouldPaintWithinRoot(renderer()) ||
- renderer()->style()->visibility() != VISIBLE)
- return;
-
- // We don't want underlines or other decorations when we're trying to draw nothing but the selection as white text.
- if (paintInfo.phase == PaintPhaseSelection && paintInfo.forceBlackText)
- return;
-
- GraphicsContext* context = paintInfo.context;
- tx += m_x;
- ty += m_y;
- RenderStyle* styleToUse = renderer()->style(m_firstLine);
- int deco = parent() ? styleToUse->textDecoration() : styleToUse->textDecorationsInEffect();
- if (deco != TDNONE &&
- ((!paintedChildren && ((deco & UNDERLINE) || (deco & OVERLINE))) || (paintedChildren && (deco & LINE_THROUGH))) &&
- shouldDrawTextDecoration(renderer())) {
- int x = m_x + borderLogicalLeft() + paddingLogicalLeft();
- int w = m_logicalWidth - (borderLogicalLeft() + paddingLogicalLeft() + borderLogicalRight() + paddingLogicalRight());
- RootInlineBox* rootLine = root();
- if (rootLine->ellipsisBox()) {
- int ellipsisX = m_x + rootLine->ellipsisBox()->x();
- int ellipsisWidth = rootLine->ellipsisBox()->logicalWidth();
- bool ltr = renderer()->style()->isLeftToRightDirection();
- if (rootLine == this) {
- // Trim w and x so that the underline isn't drawn underneath the ellipsis.
- // ltr: is our right edge farther right than the right edge of the ellipsis.
- // rtl: is the left edge of our box farther left than the left edge of the ellipsis.
- bool ltrTruncation = ltr && (x + w >= ellipsisX + ellipsisWidth);
- bool rtlTruncation = !ltr && (x <= ellipsisX + ellipsisWidth);
- if (ltrTruncation)
- w -= (x + w) - (ellipsisX + ellipsisWidth);
- else if (rtlTruncation) {
- int dx = m_x - ((ellipsisX - m_x) + ellipsisWidth);
- tx -= dx;
- w += dx;
- }
- } else {
- bool ltrPastEllipsis = ltr && x >= ellipsisX;
- bool rtlPastEllipsis = !ltr && (x + w) <= (ellipsisX + ellipsisWidth);
- if (ltrPastEllipsis || rtlPastEllipsis)
- return;
-
- bool ltrTruncation = ltr && x + w >= ellipsisX;
- bool rtlTruncation = !ltr && x <= ellipsisX;
- if (ltrTruncation)
- w -= (x + w - ellipsisX);
- else if (rtlTruncation) {
- int dx = m_x - ((ellipsisX - m_x) + ellipsisWidth);
- tx -= dx;
- w += dx;
- }
- }
- }
-
- // We must have child boxes and have decorations defined.
- tx += borderLogicalLeft() + paddingLogicalLeft();
-
- Color underline, overline, linethrough;
- underline = overline = linethrough = styleToUse->visitedDependentColor(CSSPropertyColor);
- if (!parent())
- renderer()->getTextDecorationColors(deco, underline, overline, linethrough);
-
- bool isPrinting = renderer()->document()->printing();
- context->setStrokeThickness(1.0f); // FIXME: We should improve this rule and not always just assume 1.
-
- bool paintUnderline = deco & UNDERLINE && !paintedChildren;
- bool paintOverline = deco & OVERLINE && !paintedChildren;
- bool paintLineThrough = deco & LINE_THROUGH && paintedChildren;
-
- bool linesAreOpaque = !isPrinting && (!paintUnderline || underline.alpha() == 255) && (!paintOverline || overline.alpha() == 255) && (!paintLineThrough || linethrough.alpha() == 255);
-
- int baselinePos = renderer()->style(m_firstLine)->font().ascent();
- if (!isRootInlineBox())
- baselinePos += boxModelObject()->borderTop() + boxModelObject()->paddingTop();
-
- bool setClip = false;
- int extraOffset = 0;
- const ShadowData* shadow = styleToUse->textShadow();
- if (!linesAreOpaque && shadow && shadow->next()) {
- IntRect clipRect(tx, ty, w, baselinePos + 2);
- for (const ShadowData* s = shadow; s; s = s->next()) {
- IntRect shadowRect(tx, ty, w, baselinePos + 2);
- shadowRect.inflate(s->blur());
- shadowRect.move(s->x(), s->y());
- clipRect.unite(shadowRect);
- extraOffset = max(extraOffset, max(0, s->y()) + s->blur());
- }
- context->save();
- context->clip(clipRect);
- extraOffset += baselinePos + 2;
- ty += extraOffset;
- setClip = true;
- }
-
- ColorSpace colorSpace = renderer()->style()->colorSpace();
- bool setShadow = false;
- do {
- if (shadow) {
- if (!shadow->next()) {
- // The last set of lines paints normally inside the clip.
- ty -= extraOffset;
- extraOffset = 0;
- }
- context->setShadow(IntSize(shadow->x(), shadow->y() - extraOffset), shadow->blur(), shadow->color(), colorSpace);
- setShadow = true;
- shadow = shadow->next();
- }
-
- if (paintUnderline) {
- context->setStrokeColor(underline, colorSpace);
- context->setStrokeStyle(SolidStroke);
- // Leave one pixel of white between the baseline and the underline.
- context->drawLineForText(IntPoint(tx, ty + baselinePos + 1), w, isPrinting);
- }
- if (paintOverline) {
- context->setStrokeColor(overline, colorSpace);
- context->setStrokeStyle(SolidStroke);
- context->drawLineForText(IntPoint(tx, ty), w, isPrinting);
- }
- if (paintLineThrough) {
- context->setStrokeColor(linethrough, colorSpace);
- context->setStrokeStyle(SolidStroke);
- context->drawLineForText(IntPoint(tx, ty + 2 * baselinePos / 3), w, isPrinting);
- }
- } while (shadow);
-
- if (setClip)
- context->restore();
- else if (setShadow)
- context->clearShadow();
- }
-}
-
InlineBox* InlineFlowBox::firstLeafChild() const
{
InlineBox* leaf = 0;
diff --git a/WebCore/rendering/InlineFlowBox.h b/WebCore/rendering/InlineFlowBox.h
index ee16a0f..a168f98 100644
--- a/WebCore/rendering/InlineFlowBox.h
+++ b/WebCore/rendering/InlineFlowBox.h
@@ -96,7 +96,6 @@ public:
void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, int tx, int ty, int w, int h, CompositeOperator = CompositeSourceOver);
void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, int tx, int ty, int w, int h, CompositeOperator = CompositeSourceOver);
void paintBoxShadow(GraphicsContext*, RenderStyle*, ShadowStyle, int tx, int ty, int w, int h);
- virtual void paintTextDecorations(PaintInfo&, int tx, int ty, bool paintedChildren = false);
virtual void paint(PaintInfo&, int tx, int ty);
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty);
@@ -175,32 +174,43 @@ public:
void checkConsistency() const;
void setHasBadChildList();
+ // Line visual and layout overflow are in the coordinate space of the block. This means that - unlike other unprefixed uses of the words
+ // top/right/bottom/left in the code - these aren't purely physical directions. For horizontal-tb and vertical-lr they will match physical
+ // directions, but for horizontal-bt and vertical-rl, the top/bottom and left/right respectively are inverted when compared to
+ // their physical counterparts.
int topVisibleOverflow() const { return std::min(topLayoutOverflow(), topVisualOverflow()); }
int bottomVisibleOverflow() const { return std::max(bottomLayoutOverflow(), bottomVisualOverflow()); }
int leftVisibleOverflow() const { return std::min(leftLayoutOverflow(), leftVisualOverflow()); }
int rightVisibleOverflow() const { return std::max(rightLayoutOverflow(), rightVisualOverflow()); }
- IntRect visibleOverflowRect() const { return m_overflow ? m_overflow->visibleOverflowRect() : IntRect(m_x, m_y, m_logicalWidth, logicalHeight()); }
+ int logicalTopVisibleOverflow() const { return std::min(logicalTopLayoutOverflow(), logicalTopVisualOverflow()); }
+ int logicalBottomVisibleOverflow() const { return std::max(logicalBottomLayoutOverflow(), logicalBottomVisualOverflow()); }
+
+ IntRect visibleOverflowRect() const { return m_overflow ? m_overflow->visibleOverflowRect() : IntRect(m_x, m_y, width(), height()); }
int topLayoutOverflow() const { return m_overflow ? m_overflow->topLayoutOverflow() : m_y; }
int bottomLayoutOverflow() const { return m_overflow ? m_overflow->bottomLayoutOverflow() : m_y + logicalHeight(); }
int leftLayoutOverflow() const { return m_overflow ? m_overflow->leftLayoutOverflow() : m_x; }
int rightLayoutOverflow() const { return m_overflow ? m_overflow->rightLayoutOverflow() : m_x + m_logicalWidth; }
- IntRect layoutOverflowRect() const { return m_overflow ? m_overflow->layoutOverflowRect() : IntRect(m_x, m_y, m_logicalWidth, logicalHeight()); }
+ IntRect layoutOverflowRect() const { return m_overflow ? m_overflow->layoutOverflowRect() : IntRect(m_x, m_y, width(), height()); }
int logicalLeftLayoutOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? leftLayoutOverflow() : topLayoutOverflow(); }
int logicalRightLayoutOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? rightLayoutOverflow() : bottomLayoutOverflow(); }
-
+ int logicalTopLayoutOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? topVisualOverflow() : leftVisualOverflow(); }
+ int logicalBottomLayoutOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? bottomLayoutOverflow() : rightLayoutOverflow(); }
+
int topVisualOverflow() const { return m_overflow ? m_overflow->topVisualOverflow() : m_y; }
int bottomVisualOverflow() const { return m_overflow ? m_overflow->bottomVisualOverflow() : m_y + logicalHeight(); }
int leftVisualOverflow() const { return m_overflow ? m_overflow->leftVisualOverflow() : m_x; }
int rightVisualOverflow() const { return m_overflow ? m_overflow->rightVisualOverflow() : m_x + m_logicalWidth; }
- IntRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : IntRect(m_x, m_y, m_logicalWidth, logicalHeight()); }
+ IntRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : IntRect(m_x, m_y, width(), height()); }
int logicalLeftVisualOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? leftVisualOverflow() : topVisualOverflow(); }
int logicalRightVisualOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? rightVisualOverflow() : bottomVisualOverflow(); }
-
+ int logicalTopVisualOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? topVisualOverflow() : leftVisualOverflow(); }
+ int logicalBottomVisualOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? bottomVisualOverflow() : rightVisualOverflow(); }
+
void setInlineDirectionOverflowPositions(int logicalLeftLayoutOverflow, int logicalRightLayoutOverflow,
int logicalLeftVisualOverflow, int logicalRightVisualOverflow);
void setBlockDirectionOverflowPositions(int logicalTopLayoutOverflow, int logicalBottomLayoutOverflow,
- int logicalTopVisualOverflow, int logicalBottomVisualOverflow, int boxLogicalHeight);
+ int logicalTopVisualOverflow, int logicalBottomVisualOverflow);
protected:
OwnPtr<RenderOverflow> m_overflow;
@@ -230,8 +240,8 @@ inline void InlineFlowBox::setInlineDirectionOverflowPositions(int logicalLeftLa
&& logicalLeftVisualOverflow == logicalLeft() && logicalRightVisualOverflow == logicalRight())
return;
- int width = isVertical() ? m_renderer->style(m_firstLine)->font().height() : logicalWidth();
- int height = isVertical() ? logicalWidth() : m_renderer->style(m_firstLine)->font().height();
+ int width = isVertical() ? logicalHeight() : logicalWidth();
+ int height = isVertical() ? logicalWidth() : logicalHeight();
m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, width, height)));
}
@@ -249,18 +259,31 @@ inline void InlineFlowBox::setInlineDirectionOverflowPositions(int logicalLeftLa
}
}
-inline void InlineFlowBox::setBlockDirectionOverflowPositions(int topLayoutOverflow, int bottomLayoutOverflow, int topVisualOverflow, int bottomVisualOverflow, int boxHeight)
+inline void InlineFlowBox::setBlockDirectionOverflowPositions(int logicalTopLayoutOverflow, int logicalBottomLayoutOverflow,
+ int logicalTopVisualOverflow, int logicalBottomVisualOverflow)
{
if (!m_overflow) {
- if (topLayoutOverflow == m_y && bottomLayoutOverflow == m_y + boxHeight && topVisualOverflow == m_y && bottomVisualOverflow == m_y + boxHeight)
+ if (logicalTopLayoutOverflow == logicalTop() && logicalBottomLayoutOverflow == logicalBottom()
+ && logicalTopVisualOverflow == logicalTop() && logicalBottomVisualOverflow == logicalBottom())
return;
- m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, m_logicalWidth, boxHeight)));
+
+ int width = isVertical() ? logicalHeight() : logicalWidth();
+ int height = isVertical() ? logicalWidth() : logicalHeight();
+
+ m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, width, height)));
}
- m_overflow->setTopLayoutOverflow(topLayoutOverflow);
- m_overflow->setBottomLayoutOverflow(bottomLayoutOverflow);
- m_overflow->setTopVisualOverflow(topVisualOverflow);
- m_overflow->setBottomVisualOverflow(bottomVisualOverflow);
+ if (!isVertical()) {
+ m_overflow->setTopLayoutOverflow(logicalTopLayoutOverflow);
+ m_overflow->setBottomLayoutOverflow(logicalBottomLayoutOverflow);
+ m_overflow->setTopVisualOverflow(logicalTopVisualOverflow);
+ m_overflow->setBottomVisualOverflow(logicalBottomVisualOverflow);
+ } else {
+ m_overflow->setLeftLayoutOverflow(logicalTopLayoutOverflow);
+ m_overflow->setRightLayoutOverflow(logicalBottomLayoutOverflow);
+ m_overflow->setLeftVisualOverflow(logicalTopVisualOverflow);
+ m_overflow->setRightVisualOverflow(logicalBottomVisualOverflow);
+ }
}
#ifdef NDEBUG
diff --git a/WebCore/rendering/InlineTextBox.cpp b/WebCore/rendering/InlineTextBox.cpp
index cf100e0..43b025a 100644
--- a/WebCore/rendering/InlineTextBox.cpp
+++ b/WebCore/rendering/InlineTextBox.cpp
@@ -154,12 +154,19 @@ IntRect InlineTextBox::selectionRect(int tx, int ty, int startPos, int endPos)
}
IntRect r = enclosingIntRect(f.selectionRectForText(TextRun(characters, len, textObj->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride),
- IntPoint(tx + m_x, ty + selTop), selHeight, sPos, ePos));
- if (r.x() > tx + m_x + m_logicalWidth)
- r.setWidth(0);
- else if (r.right() - 1 > tx + m_x + m_logicalWidth)
- r.setWidth(tx + m_x + m_logicalWidth - r.x());
- return r;
+ IntPoint(), selHeight, sPos, ePos));
+
+ int logicalWidth = r.width();
+ if (r.x() > m_logicalWidth)
+ logicalWidth = 0;
+ else if (r.right() > m_logicalWidth)
+ logicalWidth = m_logicalWidth - r.x();
+
+ IntPoint topPoint = m_isVertical ? IntPoint(tx + selTop, ty + m_y + r.x()) : IntPoint(tx + m_x + r.x(), ty + selTop);
+ int width = m_isVertical ? selHeight : logicalWidth;
+ int height = m_isVertical ? logicalWidth : selHeight;
+
+ return IntRect(topPoint, IntSize(width, height));
}
void InlineTextBox::deleteLine(RenderArena* arena)
@@ -302,7 +309,7 @@ bool InlineTextBox::nodeAtPoint(const HitTestRequest&, HitTestResult& result, in
if (isLineBreak())
return false;
- IntRect rect(tx + m_x, ty + m_y, m_logicalWidth, logicalHeight());
+ IntRect rect(tx + m_x, ty + m_y, width(), height());
if (m_truncation != cFullTruncation && visibleToHitTesting() && rect.intersects(result.rectForPoint(x, y))) {
renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty));
if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, rect))
@@ -311,13 +318,15 @@ bool InlineTextBox::nodeAtPoint(const HitTestRequest&, HitTestResult& result, in
return false;
}
-FloatSize InlineTextBox::applyShadowToGraphicsContext(GraphicsContext* context, const ShadowData* shadow, const FloatRect& textRect, bool stroked, bool opaque)
+FloatSize InlineTextBox::applyShadowToGraphicsContext(GraphicsContext* context, const ShadowData* shadow, const FloatRect& textRect, bool stroked, bool opaque, bool vertical)
{
if (!shadow)
return FloatSize();
FloatSize extraOffset;
- FloatSize shadowOffset(shadow->x(), shadow->y());
+ int shadowX = vertical ? shadow->y() : shadow->x();
+ int shadowY = vertical ? -shadow->x() : shadow->y();
+ FloatSize shadowOffset(shadowX, shadowY);
int shadowBlur = shadow->blur();
const Color& shadowColor = shadow->color();
@@ -336,7 +345,8 @@ FloatSize InlineTextBox::applyShadowToGraphicsContext(GraphicsContext* context,
return extraOffset;
}
-static void paintTextWithShadows(GraphicsContext* context, const Font& font, const TextRun& textRun, int startOffset, int endOffset, int truncationPoint, const IntPoint& textOrigin, int x, int y, int w, int h, const ShadowData* shadow, bool stroked)
+static void paintTextWithShadows(GraphicsContext* context, const Font& font, const TextRun& textRun, int startOffset, int endOffset, int truncationPoint, const IntPoint& textOrigin,
+ const IntRect& boxRect, const ShadowData* shadow, bool stroked, bool vertical)
{
Color fillColor = context->fillColor();
ColorSpace fillColorSpace = context->fillColorSpace();
@@ -347,7 +357,7 @@ static void paintTextWithShadows(GraphicsContext* context, const Font& font, con
do {
IntSize extraOffset;
if (shadow)
- extraOffset = roundedIntSize(InlineTextBox::applyShadowToGraphicsContext(context, shadow, FloatRect(x, y, w, h), stroked, opaque));
+ extraOffset = roundedIntSize(InlineTextBox::applyShadowToGraphicsContext(context, shadow, boxRect, stroked, opaque, vertical));
else if (!opaque)
context->setFillColor(fillColor, fillColorSpace);
@@ -375,18 +385,22 @@ static void paintTextWithShadows(GraphicsContext* context, const Font& font, con
void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
{
if (isLineBreak() || !paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE ||
- m_truncation == cFullTruncation || paintInfo.phase == PaintPhaseOutline)
+ m_truncation == cFullTruncation || paintInfo.phase == PaintPhaseOutline || !m_len)
return;
ASSERT(paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintPhaseChildOutlines);
// FIXME: Technically we're potentially incorporating other visual overflow that had nothing to do with us.
// Would it be simpler to just check our own shadow and stroke overflow by hand here?
- int leftOverflow = parent()->x() - parent()->leftVisualOverflow();
- int rightOverflow = parent()->rightVisualOverflow() - (parent()->x() + parent()->logicalWidth());
- int xPos = tx + m_x - leftOverflow;
- int w = logicalWidth() + leftOverflow + rightOverflow;
- if (xPos >= paintInfo.rect.right() || xPos + w <= paintInfo.rect.x())
+ int logicalLeftOverflow = parent()->logicalLeft() - parent()->logicalLeftVisualOverflow();
+ int logicalRightOverflow = parent()->logicalRightVisualOverflow() - (parent()->logicalLeft() + parent()->logicalWidth());
+ int logicalStart = logicalLeft() - logicalLeftOverflow + (isVertical() ? ty : tx);
+ int logicalExtent = logicalWidth() + logicalLeftOverflow + logicalRightOverflow;
+
+ int paintEnd = isVertical() ? paintInfo.rect.bottom() : paintInfo.rect.right();
+ int paintStart = isVertical() ? paintInfo.rect.y() : paintInfo.rect.x();
+
+ if (logicalStart >= paintEnd || logicalStart + logicalExtent <= paintStart)
return;
bool isPrinting = textRenderer()->document()->printing();
@@ -410,18 +424,39 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
int widthOfVisibleText = toRenderText(renderer())->width(m_start, m_truncation, textPos(), m_firstLine);
int widthOfHiddenText = m_logicalWidth - widthOfVisibleText;
// FIXME: The hit testing logic also needs to take this translation int account.
- tx += isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText;
+ if (!m_isVertical)
+ tx += isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText;
+ else
+ ty += isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText;
}
}
GraphicsContext* context = paintInfo.context;
+ RenderStyle* styleToUse = renderer()->style(m_firstLine);
+
+ ty -= styleToUse->isHorizontalWritingMode() ? 0 : logicalHeight();
+
+ IntPoint boxOrigin(m_x, m_y);
+ adjustForFlippedBlocksWritingMode(boxOrigin);
+ boxOrigin.move(tx, ty);
+
+ IntPoint textOrigin = IntPoint(boxOrigin.x(), boxOrigin.y() + styleToUse->font().ascent());
+ IntRect boxRect(boxOrigin, IntSize(logicalWidth(), logicalHeight()));
+
+ if (m_isVertical) {
+ context->save();
+ context->translate(boxRect.x(), boxRect.bottom());
+ context->rotate(static_cast<float>(deg2rad(90.)));
+ context->translate(-boxRect.x(), -boxRect.bottom());
+ }
+
+
// Determine whether or not we have composition underlines to draw.
bool containsComposition = renderer()->node() && renderer()->frame()->editor()->compositionNode() == renderer()->node();
bool useCustomUnderlines = containsComposition && renderer()->frame()->editor()->compositionUsesCustomUnderlines();
// Set our font.
- RenderStyle* styleToUse = renderer()->style(m_firstLine);
int d = styleToUse->textDecorationsInEffect();
const Font& font = styleToUse->font();
@@ -435,20 +470,17 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
#endif
if (containsComposition && !useCustomUnderlines)
- paintCompositionBackground(context, tx, ty, styleToUse, font,
+ paintCompositionBackground(context, boxOrigin, styleToUse, font,
renderer()->frame()->editor()->compositionStart(),
renderer()->frame()->editor()->compositionEnd());
- paintDocumentMarkers(context, tx, ty, styleToUse, font, true);
+ paintDocumentMarkers(context, boxOrigin, styleToUse, font, true);
if (haveSelection && !useCustomUnderlines)
- paintSelection(context, tx, ty, styleToUse, font);
+ paintSelection(context, boxOrigin, styleToUse, font);
}
// 2. Now paint the foreground, including text and decorations like underline/overline (in quirks mode only).
- if (m_len <= 0)
- return;
-
Color textFillColor;
Color textStrokeColor;
float textStrokeWidth = styleToUse->textStrokeWidth();
@@ -517,8 +549,6 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
if (hasHyphen())
adjustCharactersAndLengthForHyphen(charactersWithHyphen, styleToUse, characters, length);
- int baseline = renderer()->style(m_firstLine)->font().ascent();
- IntPoint textOrigin(m_x + tx, m_y + ty + baseline);
TextRun textRun(characters, length, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || styleToUse->visuallyOrdered());
int sPos = 0;
@@ -541,9 +571,9 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
updateGraphicsContext(context, textFillColor, textStrokeColor, textStrokeWidth, styleToUse->colorSpace());
if (!paintSelectedTextSeparately || ePos <= sPos) {
// FIXME: Truncate right-to-left text correctly.
- paintTextWithShadows(context, font, textRun, 0, length, length, textOrigin, m_x + tx, m_y + ty, logicalWidth(), logicalHeight(), textShadow, textStrokeWidth > 0);
+ paintTextWithShadows(context, font, textRun, 0, length, length, textOrigin, boxRect, textShadow, textStrokeWidth > 0, m_isVertical);
} else
- paintTextWithShadows(context, font, textRun, ePos, sPos, length, textOrigin, m_x + tx, m_y + ty, logicalWidth(), logicalHeight(), textShadow, textStrokeWidth > 0);
+ paintTextWithShadows(context, font, textRun, ePos, sPos, length, textOrigin, boxRect, textShadow, textStrokeWidth > 0, m_isVertical);
if (textStrokeWidth > 0)
context->restore();
@@ -555,20 +585,20 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
context->save();
updateGraphicsContext(context, selectionFillColor, selectionStrokeColor, selectionStrokeWidth, styleToUse->colorSpace());
- paintTextWithShadows(context, font, textRun, sPos, ePos, length, textOrigin, m_x + tx, m_y + ty, logicalWidth(), logicalHeight(), selectionShadow, selectionStrokeWidth > 0);
+ paintTextWithShadows(context, font, textRun, sPos, ePos, length, textOrigin, boxRect, selectionShadow, selectionStrokeWidth > 0, m_isVertical);
if (selectionStrokeWidth > 0)
context->restore();
}
// Paint decorations
- if (d != TDNONE && paintInfo.phase != PaintPhaseSelection && renderer()->document()->inQuirksMode()) {
- context->setStrokeColor(styleToUse->visitedDependentColor(CSSPropertyColor), styleToUse->colorSpace());
- paintDecoration(context, tx, ty, d, textShadow);
+ if (d != TDNONE && paintInfo.phase != PaintPhaseSelection) {
+ updateGraphicsContext(context, textFillColor, textStrokeColor, textStrokeWidth, styleToUse->colorSpace());
+ paintDecoration(context, boxOrigin, d, textShadow);
}
if (paintInfo.phase == PaintPhaseForeground) {
- paintDocumentMarkers(context, tx, ty, styleToUse, font, false);
+ paintDocumentMarkers(context, boxOrigin, styleToUse, font, false);
if (useCustomUnderlines) {
const Vector<CompositionUnderline>& underlines = renderer()->frame()->editor()->customCompositionUnderlines();
@@ -585,7 +615,7 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
if (underline.startOffset <= end()) {
// underline intersects this run. Paint it.
- paintCompositionUnderline(context, tx, ty, underline);
+ paintCompositionUnderline(context, boxOrigin, underline);
if (underline.endOffset > end() + 1)
// underline also runs into the next run. Bail now, no more marker advancement.
break;
@@ -595,6 +625,9 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
}
}
}
+
+ if (m_isVertical)
+ context->restore();
}
void InlineTextBox::selectionStartEnd(int& sPos, int& ePos)
@@ -615,7 +648,7 @@ void InlineTextBox::selectionStartEnd(int& sPos, int& ePos)
ePos = min(endPos - m_start, (int)m_len);
}
-void InlineTextBox::paintSelection(GraphicsContext* context, int tx, int ty, RenderStyle* style, const Font& font)
+void InlineTextBox::paintSelection(GraphicsContext* context, const IntPoint& boxOrigin, RenderStyle* style, const Font& font)
{
// See if we have a selection to paint at all.
int sPos, ePos;
@@ -635,8 +668,7 @@ void InlineTextBox::paintSelection(GraphicsContext* context, int tx, int ty, Ren
context->save();
updateGraphicsContext(context, c, c, 0, style->colorSpace()); // Don't draw text at all!
- int y = selectionTop();
- int h = selectionHeight();
+
// If the text is truncated, let the thing being painted in the truncation
// draw its own highlight.
int length = m_truncation != cNoTruncation ? m_truncation : m_len;
@@ -648,14 +680,17 @@ void InlineTextBox::paintSelection(GraphicsContext* context, int tx, int ty, Ren
ePos = length;
}
- context->clip(IntRect(m_x + tx, y + ty, m_logicalWidth, h));
+ int deltaY = logicalTop() - selectionTop();
+ int selHeight = selectionHeight();
+ IntPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY);
+ context->clip(IntRect(localOrigin, IntSize(m_logicalWidth, selHeight)));
context->drawHighlightForText(font, TextRun(characters, length, textRenderer()->allowTabs(), textPos(), m_toAdd,
!isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered()),
- IntPoint(m_x + tx, y + ty), h, c, style->colorSpace(), sPos, ePos);
+ localOrigin, selHeight, c, style->colorSpace(), sPos, ePos);
context->restore();
}
-void InlineTextBox::paintCompositionBackground(GraphicsContext* context, int tx, int ty, RenderStyle* style, const Font& font, int startPos, int endPos)
+void InlineTextBox::paintCompositionBackground(GraphicsContext* context, const IntPoint& boxOrigin, RenderStyle* style, const Font& font, int startPos, int endPos)
{
int offset = m_start;
int sPos = max(startPos - offset, 0);
@@ -670,11 +705,12 @@ void InlineTextBox::paintCompositionBackground(GraphicsContext* context, int tx,
updateGraphicsContext(context, c, c, 0, style->colorSpace()); // Don't draw text at all!
- int y = selectionTop();
- int h = selectionHeight();
+ int deltaY = logicalTop() - selectionTop();
+ int selHeight = selectionHeight();
+ IntPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY);
context->drawHighlightForText(font, TextRun(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd,
!isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered()),
- IntPoint(m_x + tx, y + ty), h, c, style->colorSpace(), sPos, ePos);
+ localOrigin, selHeight, c, style->colorSpace(), sPos, ePos);
context->restore();
}
@@ -698,19 +734,18 @@ void InlineTextBox::paintCustomHighlight(int tx, int ty, const AtomicString& typ
#endif
-void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, int deco, const ShadowData* shadow)
+void InlineTextBox::paintDecoration(GraphicsContext* context, const IntPoint& boxOrigin, int deco, const ShadowData* shadow)
{
- tx += m_x;
- ty += m_y;
-
if (m_truncation == cFullTruncation)
return;
+ IntPoint localOrigin = boxOrigin;
+
int width = m_logicalWidth;
if (m_truncation != cNoTruncation) {
width = toRenderText(renderer())->width(m_start, m_truncation, textPos(), m_firstLine);
if (!isLeftToRightDirection())
- tx += (m_logicalWidth - width);
+ localOrigin.move(m_logicalWidth - width, 0);
}
// Get the text decoration colors.
@@ -723,24 +758,27 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, in
bool linesAreOpaque = !isPrinting && (!(deco & UNDERLINE) || underline.alpha() == 255) && (!(deco & OVERLINE) || overline.alpha() == 255) && (!(deco & LINE_THROUGH) || linethrough.alpha() == 255);
- int baseline = renderer()->style(m_firstLine)->font().ascent();
+ RenderStyle* styleToUse = renderer()->style(m_firstLine);
+ int baseline = styleToUse->font().ascent();
bool setClip = false;
int extraOffset = 0;
if (!linesAreOpaque && shadow && shadow->next()) {
context->save();
- IntRect clipRect(tx, ty, width, baseline + 2);
+ IntRect clipRect(localOrigin, IntSize(width, baseline + 2));
for (const ShadowData* s = shadow; s; s = s->next()) {
- IntRect shadowRect(tx, ty, width, baseline + 2);
+ IntRect shadowRect(localOrigin, IntSize(width, baseline + 2));
shadowRect.inflate(s->blur());
- shadowRect.move(s->x(), s->y());
+ int shadowX = m_isVertical ? s->y() : s->x();
+ int shadowY = m_isVertical ? -s->x() : s->y();
+ shadowRect.move(shadowX, shadowY);
clipRect.unite(shadowRect);
- extraOffset = max(extraOffset, max(0, s->y()) + s->blur());
+ extraOffset = max(extraOffset, max(0, shadowY) + s->blur());
}
context->save();
context->clip(clipRect);
extraOffset += baseline + 2;
- ty += extraOffset;
+ localOrigin.move(0, extraOffset);
setClip = true;
}
@@ -751,10 +789,12 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, in
if (shadow) {
if (!shadow->next()) {
// The last set of lines paints normally inside the clip.
- ty -= extraOffset;
+ localOrigin.move(0, -extraOffset);
extraOffset = 0;
}
- context->setShadow(IntSize(shadow->x(), shadow->y() - extraOffset), shadow->blur(), shadow->color(), colorSpace);
+ int shadowX = m_isVertical ? shadow->y() : shadow->x();
+ int shadowY = m_isVertical ? -shadow->x() : shadow->y();
+ context->setShadow(IntSize(shadowX, shadowY - extraOffset), shadow->blur(), shadow->color(), colorSpace);
setShadow = true;
shadow = shadow->next();
}
@@ -763,17 +803,17 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, in
context->setStrokeColor(underline, colorSpace);
context->setStrokeStyle(SolidStroke);
// Leave one pixel of white between the baseline and the underline.
- context->drawLineForText(IntPoint(tx, ty + baseline + 1), width, isPrinting);
+ context->drawLineForText(IntPoint(localOrigin.x(), localOrigin.y() + baseline + 1), width, isPrinting);
}
if (deco & OVERLINE) {
context->setStrokeColor(overline, colorSpace);
context->setStrokeStyle(SolidStroke);
- context->drawLineForText(IntPoint(tx, ty), width, isPrinting);
+ context->drawLineForText(localOrigin, width, isPrinting);
}
if (deco & LINE_THROUGH) {
context->setStrokeColor(linethrough, colorSpace);
context->setStrokeStyle(SolidStroke);
- context->drawLineForText(IntPoint(tx, ty + 2 * baseline / 3), width, isPrinting);
+ context->drawLineForText(IntPoint(localOrigin.x(), localOrigin.y() + 2 * baseline / 3), width, isPrinting);
}
} while (shadow);
@@ -798,7 +838,7 @@ static GraphicsContext::TextCheckingLineStyle textCheckingLineStyleForMarkerType
}
}
-void InlineTextBox::paintSpellingOrGrammarMarker(GraphicsContext* pt, int tx, int ty, const DocumentMarker& marker, RenderStyle* style, const Font& font, bool grammar)
+void InlineTextBox::paintSpellingOrGrammarMarker(GraphicsContext* pt, const IntPoint& boxOrigin, const DocumentMarker& marker, RenderStyle* style, const Font& font, bool grammar)
{
// Never print spelling/grammar markers (5327887)
if (textRenderer()->document()->printing())
@@ -827,18 +867,19 @@ void InlineTextBox::paintSpellingOrGrammarMarker(GraphicsContext* pt, int tx, in
endPosition = min<int>(endPosition, m_truncation);
// Calculate start & width
- IntPoint startPoint(tx + m_x, ty + selectionTop());
+ int deltaY = logicalTop() - selectionTop();
+ int selHeight = selectionHeight();
+ IntPoint startPoint(boxOrigin.x(), boxOrigin.y() - deltaY);
TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
- int h = selectionHeight();
-
- IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, startPoint, h, startPosition, endPosition));
+
+ IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, startPoint, selHeight, startPosition, endPosition));
start = markerRect.x() - startPoint.x();
width = markerRect.width();
// Store rendered rects for bad grammar markers, so we can hit-test against it elsewhere in order to
// display a toolTip. We don't do this for misspelling markers.
if (grammar) {
- markerRect.move(-tx, -ty);
+ markerRect.move(-boxOrigin.x(), -boxOrigin.y());
markerRect = renderer()->localToAbsoluteQuad(FloatRect(markerRect)).enclosingBoundingBox();
renderer()->document()->markers()->setRenderedRectForMarker(renderer()->node(), marker, markerRect);
}
@@ -861,25 +902,25 @@ void InlineTextBox::paintSpellingOrGrammarMarker(GraphicsContext* pt, int tx, in
// In larger fonts, though, place the underline up near the baseline to prevent a big gap.
underlineOffset = baseline + 2;
}
- pt->drawLineForTextChecking(IntPoint(tx + m_x + start, ty + m_y + underlineOffset), width, textCheckingLineStyleForMarkerType(marker.type));
+ pt->drawLineForTextChecking(IntPoint(boxOrigin.x() + start, boxOrigin.y() + underlineOffset), width, textCheckingLineStyleForMarkerType(marker.type));
}
-void InlineTextBox::paintTextMatchMarker(GraphicsContext* pt, int tx, int ty, const DocumentMarker& marker, RenderStyle* style, const Font& font)
+void InlineTextBox::paintTextMatchMarker(GraphicsContext* pt, const IntPoint& boxOrigin, const DocumentMarker& marker, RenderStyle* style, const Font& font)
{
// Use same y positioning and height as for selection, so that when the selection and this highlight are on
// the same word there are no pieces sticking out.
- int y = selectionTop();
- int h = selectionHeight();
-
+ int deltaY = logicalTop() - selectionTop();
+ int selHeight = selectionHeight();
+
int sPos = max(marker.startOffset - m_start, (unsigned)0);
int ePos = min(marker.endOffset - m_start, (unsigned)m_len);
TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
// Always compute and store the rect associated with this marker. The computed rect is in absolute coordinates.
- IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, IntPoint(m_x, y), h, sPos, ePos));
+ IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, IntPoint(m_x, selectionTop()), selHeight, sPos, ePos));
markerRect = renderer()->localToAbsoluteQuad(FloatRect(markerRect)).enclosingBoundingBox();
renderer()->document()->markers()->setRenderedRectForMarker(renderer()->node(), marker, markerRect);
-
+
// Optionally highlight the text
if (renderer()->frame()->editor()->markedTextMatchesAreHighlighted()) {
Color color = marker.activeMatch ?
@@ -887,13 +928,13 @@ void InlineTextBox::paintTextMatchMarker(GraphicsContext* pt, int tx, int ty, co
renderer()->theme()->platformInactiveTextSearchHighlightColor();
pt->save();
updateGraphicsContext(pt, color, color, 0, style->colorSpace()); // Don't draw text at all!
- pt->clip(IntRect(tx + m_x, ty + y, m_logicalWidth, h));
- pt->drawHighlightForText(font, run, IntPoint(m_x + tx, y + ty), h, color, style->colorSpace(), sPos, ePos);
+ pt->clip(IntRect(boxOrigin.x(), boxOrigin.y() - deltaY, m_logicalWidth, selHeight));
+ pt->drawHighlightForText(font, run, IntPoint(boxOrigin.x(), boxOrigin.y() - deltaY), selHeight, color, style->colorSpace(), sPos, ePos);
pt->restore();
}
}
-void InlineTextBox::computeRectForReplacementMarker(int /*tx*/, int /*ty*/, const DocumentMarker& marker, RenderStyle* style, const Font& font)
+void InlineTextBox::computeRectForReplacementMarker(const DocumentMarker& marker, RenderStyle* style, const Font& font)
{
// Replacement markers are not actually drawn, but their rects need to be computed for hit testing.
int y = selectionTop();
@@ -910,7 +951,7 @@ void InlineTextBox::computeRectForReplacementMarker(int /*tx*/, int /*ty*/, cons
renderer()->document()->markers()->setRenderedRectForMarker(renderer()->node(), marker, markerRect);
}
-void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, int tx, int ty, RenderStyle* style, const Font& font, bool background)
+void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, const IntPoint& boxOrigin, RenderStyle* style, const Font& font, bool background)
{
if (!renderer()->node())
return;
@@ -954,17 +995,17 @@ void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, int tx, int ty, Re
// marker intersects this run. Paint it.
switch (marker.type) {
case DocumentMarker::Spelling:
- paintSpellingOrGrammarMarker(pt, tx, ty, marker, style, font, false);
+ paintSpellingOrGrammarMarker(pt, boxOrigin, marker, style, font, false);
break;
case DocumentMarker::Grammar:
- paintSpellingOrGrammarMarker(pt, tx, ty, marker, style, font, true);
+ paintSpellingOrGrammarMarker(pt, boxOrigin, marker, style, font, true);
break;
case DocumentMarker::TextMatch:
- paintTextMatchMarker(pt, tx, ty, marker, style, font);
+ paintTextMatchMarker(pt, boxOrigin, marker, style, font);
break;
case DocumentMarker::CorrectionIndicator:
- computeRectForReplacementMarker(tx, ty, marker, style, font);
- paintSpellingOrGrammarMarker(pt, tx, ty, marker, style, font, false);
+ computeRectForReplacementMarker(marker, style, font);
+ paintSpellingOrGrammarMarker(pt, boxOrigin, marker, style, font, false);
break;
case DocumentMarker::Replacement:
case DocumentMarker::RejectedCorrection:
@@ -977,11 +1018,8 @@ void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, int tx, int ty, Re
}
-void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, int tx, int ty, const CompositionUnderline& underline)
+void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, const IntPoint& boxOrigin, const CompositionUnderline& underline)
{
- tx += m_x;
- ty += m_y;
-
if (m_truncation == cFullTruncation)
return;
@@ -1022,7 +1060,7 @@ void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, int tx, int
ctx->setStrokeColor(underline.color, renderer()->style()->colorSpace());
ctx->setStrokeThickness(lineThickness);
- ctx->drawLineForText(IntPoint(tx + start, ty + logicalHeight() - lineThickness), width, textRenderer()->document()->printing());
+ ctx->drawLineForText(IntPoint(boxOrigin.x() + start, boxOrigin.y() + logicalHeight() - lineThickness), width, textRenderer()->document()->printing());
}
int InlineTextBox::caretMinOffset() const
diff --git a/WebCore/rendering/InlineTextBox.h b/WebCore/rendering/InlineTextBox.h
index f010c39..9c4c72f 100644
--- a/WebCore/rendering/InlineTextBox.h
+++ b/WebCore/rendering/InlineTextBox.h
@@ -127,7 +127,7 @@ public:
bool containsCaretOffset(int offset) const; // false for offset after line break
// Needs to be public, so the static paintTextWithShadows() function can use it.
- static FloatSize applyShadowToGraphicsContext(GraphicsContext*, const ShadowData*, const FloatRect& textRect, bool stroked, bool opaque);
+ static FloatSize applyShadowToGraphicsContext(GraphicsContext*, const ShadowData*, const FloatRect& textRect, bool stroked, bool opaque, bool vertical);
private:
InlineTextBox* m_prevTextBox; // The previous box that also uses our RenderObject
@@ -140,19 +140,19 @@ private:
// denote no truncation (the whole run paints) and full truncation (nothing paints at all).
protected:
- void paintCompositionBackground(GraphicsContext*, int tx, int ty, RenderStyle*, const Font&, int startPos, int endPos);
- void paintDocumentMarkers(GraphicsContext*, int tx, int ty, RenderStyle*, const Font&, bool background);
- void paintCompositionUnderline(GraphicsContext*, int tx, int ty, const CompositionUnderline&);
+ void paintCompositionBackground(GraphicsContext*, const IntPoint& boxOrigin, RenderStyle*, const Font&, int startPos, int endPos);
+ void paintDocumentMarkers(GraphicsContext*, const IntPoint& boxOrigin, RenderStyle*, const Font&, bool background);
+ void paintCompositionUnderline(GraphicsContext*, const IntPoint& boxOrigin, const CompositionUnderline&);
#if PLATFORM(MAC)
void paintCustomHighlight(int tx, int ty, const AtomicString& type);
#endif
private:
- void paintDecoration(GraphicsContext*, int tx, int ty, int decoration, const ShadowData*);
- void paintSelection(GraphicsContext*, int tx, int ty, RenderStyle*, const Font&);
- void paintSpellingOrGrammarMarker(GraphicsContext*, int tx, int ty, const DocumentMarker&, RenderStyle*, const Font&, bool grammar);
- void paintTextMatchMarker(GraphicsContext*, int tx, int ty, const DocumentMarker&, RenderStyle*, const Font&);
- void computeRectForReplacementMarker(int tx, int ty, const DocumentMarker&, RenderStyle*, const Font&);
+ void paintDecoration(GraphicsContext*, const IntPoint& boxOrigin, int decoration, const ShadowData*);
+ void paintSelection(GraphicsContext*, const IntPoint& boxOrigin, RenderStyle*, const Font&);
+ void paintSpellingOrGrammarMarker(GraphicsContext*, const IntPoint& boxOrigin, const DocumentMarker&, RenderStyle*, const Font&, bool grammar);
+ void paintTextMatchMarker(GraphicsContext*, const IntPoint& boxOrigin, const DocumentMarker&, RenderStyle*, const Font&);
+ void computeRectForReplacementMarker(const DocumentMarker&, RenderStyle*, const Font&);
};
inline RenderText* InlineTextBox::textRenderer() const
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index d951277..e4ac673 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -260,7 +260,6 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
updateBeforeAfterContent(BEFORE);
updateBeforeAfterContent(AFTER);
}
- updateFirstLetter();
}
void RenderBlock::updateBeforeAfterContent(PseudoId pseudoId)
@@ -2284,8 +2283,10 @@ void RenderBlock::paintChildren(PaintInfo& paintInfo, int tx, int ty)
}
}
+ IntPoint childPoint(tx, ty);
+ adjustForFlippedBlocksWritingMode(child, childPoint, ParentToChildFlippingAdjustment);
if (!child->hasSelfPaintingLayer() && !child->isFloating())
- child->paint(info, tx, ty);
+ child->paint(info, childPoint.x(), childPoint.y());
// Check for page-break-after: always, and if it's set, break and bail.
bool checkAfterAlways = !childrenInline() && (usePrintRect && child->style()->pageBreakAfter() == PBALWAYS);
@@ -2418,18 +2419,19 @@ void RenderBlock::paintFloats(PaintInfo& paintInfo, int tx, int ty, bool preserv
if (r->m_shouldPaint && !r->m_renderer->hasSelfPaintingLayer()) {
PaintInfo currentPaintInfo(paintInfo);
currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
- int currentTX = tx + r->left() - r->m_renderer->x() + r->m_renderer->marginLeft();
- int currentTY = ty + r->top() - r->m_renderer->y() + r->m_renderer->marginTop();
- r->m_renderer->paint(currentPaintInfo, currentTX, currentTY);
+ IntPoint childPoint(tx + r->left() + r->m_renderer->marginLeft() - r->m_renderer->x(),
+ ty + r->top() + r->m_renderer->marginTop() - r->m_renderer->y());
+ adjustForFlippedBlocksWritingMode(r->m_renderer, childPoint, ParentToChildFlippingAdjustment);
+ r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y());
if (!preservePhase) {
currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds;
- r->m_renderer->paint(currentPaintInfo, currentTX, currentTY);
+ r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y());
currentPaintInfo.phase = PaintPhaseFloat;
- r->m_renderer->paint(currentPaintInfo, currentTX, currentTY);
+ r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y());
currentPaintInfo.phase = PaintPhaseForeground;
- r->m_renderer->paint(currentPaintInfo, currentTX, currentTY);
+ r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y());
currentPaintInfo.phase = PaintPhaseOutline;
- r->m_renderer->paint(currentPaintInfo, currentTX, currentTY);
+ r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y());
}
}
}
@@ -4052,14 +4054,10 @@ int RenderBlock::getClearDelta(RenderBox* child, int yPos)
// We also clear floats if we are too big to sit on the same line as a float (and wish to avoid floats by default).
int result = clearSet ? max(0, bottom - yPos) : 0;
if (!result && child->avoidsFloats()) {
- int availableWidth = availableLogicalWidth();
- if (child->minPreferredLogicalWidth() > availableWidth)
- return 0;
-
int y = yPos;
while (true) {
int widthAtY = availableLogicalWidthForLine(y, false);
- if (widthAtY == availableWidth)
+ if (widthAtY == availableLogicalWidth())
return y - yPos;
int oldChildY = child->y();
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index 66c8659..4956fc0 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -181,6 +181,8 @@ public:
int collapsedMarginBeforeForChild(RenderBox* child) const;
int collapsedMarginAfterForChild(RenderBox* child) const;
+ virtual void updateFirstLetter();
+
class MarginValues {
public:
MarginValues(int beforePos, int beforeNeg, int afterPos, int afterNeg)
@@ -269,8 +271,6 @@ protected:
virtual int firstLineBoxBaseline() const;
virtual int lastLineBoxBaseline() const;
- virtual void updateFirstLetter();
-
virtual void updateHitTestResult(HitTestResult&, const IntPoint&);
// Delay update scrollbar until finishDelayRepaint() will be
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index ce84d31..0b2387d 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -215,6 +215,7 @@ InlineFlowBox* RenderBlock::createLineBoxes(RenderObject* obj, bool firstLine)
ASSERT(newBox->isInlineFlowBox());
parentBox = static_cast<InlineFlowBox*>(newBox);
parentBox->setFirstLineStyleBit(firstLine);
+ parentBox->setIsVertical(!style()->isHorizontalWritingMode());
constructedNewBox = true;
}
@@ -1013,7 +1014,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintLogica
trailingFloatsLineBox->setConstructed();
GlyphOverflowAndFallbackFontsMap textBoxDataMap;
trailingFloatsLineBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap);
- trailingFloatsLineBox->setBlockDirectionOverflowPositions(logicalHeight(), bottomLayoutOverflow, logicalHeight(), bottomVisualOverflow, 0);
+ trailingFloatsLineBox->setBlockDirectionOverflowPositions(logicalHeight(), bottomLayoutOverflow, logicalHeight(), bottomVisualOverflow);
trailingFloatsLineBox->setBlockLogicalHeight(logicalHeight());
}
if (lastFloat) {
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index ac40ee9..ebd965f 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -309,19 +309,29 @@ void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle
}
}
+ bool isBodyRenderer = isBody();
+ bool isRootRenderer = isRoot();
+
// Set the text color if we're the body.
- if (isBody())
+ if (isBodyRenderer)
document()->setTextColor(style()->visitedDependentColor(CSSPropertyColor));
- else if (isRoot() && (!oldStyle || oldStyle->writingMode() != style()->writingMode() || oldStyle->direction() != style()->direction())) {
- // Propagate the new block flow and direction up to the RenderView.
- // FIXME: WinIE seems to propagate from the <body> as well. We may want to consider doing that at some point.
+
+ if ((isRootRenderer || isBodyRenderer) && (!oldStyle || oldStyle->writingMode() != style()->writingMode() || oldStyle->direction() != style()->direction())) {
+ // Propagate the new writing mode and direction up to the RenderView.
RenderView* viewRenderer = view();
RenderStyle* viewStyle = viewRenderer->style();
- if (viewStyle->writingMode() != style()->writingMode() || viewStyle->direction() != style()->direction()) {
- viewStyle->setWritingMode(style()->writingMode());
+ if (isRootRenderer || !document()->directionSetOnDocumentElement()) {
viewStyle->setDirection(style()->direction());
- viewRenderer->setNeedsLayoutAndPrefWidthsRecalc();
+ if (isBodyRenderer)
+ document()->documentElement()->renderer()->style()->setDirection(style()->direction());
}
+
+ if (isRootRenderer || !document()->writingModeSetOnDocumentElement()) {
+ viewStyle->setWritingMode(style()->writingMode());
+ if (isBodyRenderer)
+ document()->documentElement()->renderer()->style()->setWritingMode(style()->writingMode());
+ }
+ setNeedsLayoutAndPrefWidthsRecalc();
}
}
@@ -3243,4 +3253,51 @@ int RenderBox::baselinePosition(bool /*firstLine*/, LineDirectionMode direction,
return 0;
}
+void RenderBox::blockDirectionOverflow(bool isLineVertical, int& logicalTopLayoutOverflow, int& logicalBottomLayoutOverflow,
+ int& logicalTopVisualOverflow, int& logicalBottomVisualOverflow)
+{
+ if (isLineVertical) {
+ logicalTopLayoutOverflow = leftLayoutOverflow();
+ logicalBottomLayoutOverflow = rightLayoutOverflow();
+ logicalTopVisualOverflow = leftVisualOverflow();
+ logicalBottomVisualOverflow = rightVisualOverflow();
+ } else {
+ logicalTopLayoutOverflow = topLayoutOverflow();
+ logicalBottomLayoutOverflow = bottomLayoutOverflow();
+ logicalTopVisualOverflow = topVisualOverflow();
+ logicalBottomVisualOverflow = bottomVisualOverflow();
+ }
+}
+
+void RenderBox::adjustForFlippedBlocksWritingMode(RenderBox* child, IntPoint& point, FlippingAdjustment adjustment)
+{
+ if (!style()->isFlippedBlocksWritingMode())
+ return;
+
+ // The child is going to add in its x() and y(), so we have to make sure it ends up in
+ // the right place.
+ if (style()->isHorizontalWritingMode())
+ point.move(0, height() - child->height() - child->y() - (adjustment == ParentToChildFlippingAdjustment ? child->y() : 0));
+ else
+ point.move(width() - child->width() - child->x() - (adjustment == ParentToChildFlippingAdjustment ? child->x() : 0), 0);
+}
+
+int RenderBox::convertFromFlippedWritingMode(int logicalPosition)
+{
+ if (!style()->isFlippedBlocksWritingMode())
+ return logicalPosition;
+ return logicalHeight() - logicalPosition;
+}
+
+IntSize RenderBox::locationOffsetIncludingFlipping()
+{
+ if (!parent() || !parent()->isBox())
+ return locationOffset();
+
+ RenderBox* parent = parentBox();
+ IntPoint localPoint(x(), y());
+ parent->adjustForFlippedBlocksWritingMode(this, localPoint, ChildToParentFlippingAdjustment);
+ return IntSize(localPoint.x(), localPoint.y());
+}
+
} // namespace WebCore
diff --git a/WebCore/rendering/RenderBox.h b/WebCore/rendering/RenderBox.h
index 2e37657..bcf95e9 100644
--- a/WebCore/rendering/RenderBox.h
+++ b/WebCore/rendering/RenderBox.h
@@ -155,6 +155,9 @@ public:
void addOverflowFromChild(RenderBox* child, const IntSize& delta);
void clearLayoutOverflow();
+ void blockDirectionOverflow(bool isLineVertical, int& logicalTopLayoutOverflow, int& logicalBottomLayoutOverflow,
+ int& logicalTopVisualOverflow, int& logicalBottomVisualOverflow);
+
int contentWidth() const { return clientWidth() - paddingLeft() - paddingRight(); }
int contentHeight() const { return clientHeight() - paddingTop() - paddingBottom(); }
int contentLogicalWidth() const { return style()->isHorizontalWritingMode() ? contentWidth() : contentHeight(); }
@@ -281,7 +284,7 @@ public:
bool stretchesToViewport() const
{
- return document()->inQuirksMode() && style()->logicalHeight().isAuto() && !isFloatingOrPositioned() && (isRoot() || isBody()) && !isWritingModeRoot();
+ return document()->inQuirksMode() && style()->logicalHeight().isAuto() && !isFloatingOrPositioned() && (isRoot() || isBody());
}
virtual IntSize intrinsicSize() const { return IntSize(); }
@@ -374,9 +377,16 @@ public:
virtual int lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
virtual int baselinePosition(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
+<<<<<<< HEAD
#ifdef ANDROID_LAYOUT
int getVisibleWidth() const { return m_visibleWidth; }
#endif
+=======
+ enum FlippingAdjustment { ChildToParentFlippingAdjustment, ParentToChildFlippingAdjustment };
+ void adjustForFlippedBlocksWritingMode(RenderBox* child, IntPoint&, FlippingAdjustment);
+ int convertFromFlippedWritingMode(int position);
+ IntSize locationOffsetIncludingFlipping();
+>>>>>>> webkit.org at r70949
protected:
virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index ec065a6..e83b709 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -524,10 +524,23 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
IntSize topLeft, topRight, bottomLeft, bottomRight;
style()->getBorderRadiiForRect(borderRect, topLeft, topRight, bottomLeft, bottomRight);
- context->addRoundedRectClip(borderRect, includeLeftEdge ? topLeft : IntSize(),
- includeRightEdge ? topRight : IntSize(),
- includeLeftEdge ? bottomLeft : IntSize(),
- includeRightEdge ? bottomRight : IntSize());
+ if (!includeLeftEdge) {
+ topLeft = IntSize();
+ if (box->isVertical())
+ topRight = IntSize();
+ else
+ bottomLeft = IntSize();
+ }
+
+ if (!includeRightEdge) {
+ if (box->isVertical())
+ bottomLeft = IntSize();
+ else
+ topRight = IntSize();
+ bottomRight = IntSize();
+ }
+
+ context->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
clippedToBorderRadius = true;
}
@@ -1002,7 +1015,7 @@ static bool borderWillArcInnerEdge(const IntSize& firstRadius, const IntSize& se
}
void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,
- const RenderStyle* style, bool begin, bool end)
+ const RenderStyle* style, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
if (paintNinePieceImage(graphicsContext, tx, ty, w, h, style, style->borderImage()))
return;
@@ -1025,10 +1038,12 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
EBorderStyle leftStyle = style->borderLeftStyle();
EBorderStyle rightStyle = style->borderRightStyle();
- bool renderTop = topStyle > BHIDDEN && !topTransparent;
- bool renderLeft = leftStyle > BHIDDEN && begin && !leftTransparent;
- bool renderRight = rightStyle > BHIDDEN && end && !rightTransparent;
- bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent;
+ bool horizontal = style->isHorizontalWritingMode();
+
+ bool renderTop = topStyle > BHIDDEN && !topTransparent && (horizontal || includeLogicalLeftEdge);
+ bool renderLeft = leftStyle > BHIDDEN && !leftTransparent && (!horizontal || includeLogicalLeftEdge);
+ bool renderRight = rightStyle > BHIDDEN && !rightTransparent && (!horizontal || includeLogicalRightEdge);
+ bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent && (horizontal || includeLogicalRightEdge);
bool renderRadii = false;
Path roundedPath;
@@ -1039,32 +1054,52 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
IntSize topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius;
style->getBorderRadiiForRect(borderRect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
- IntRect innerBorderRect = borderInnerRect(borderRect, style->borderTopWidth(), style->borderBottomWidth(),
- style->borderLeftWidth(), style->borderRightWidth());
+ int leftWidth = (!horizontal || includeLogicalLeftEdge) ? style->borderLeftWidth() : 0;
+ int rightWidth = (!horizontal || includeLogicalRightEdge) ? style->borderRightWidth() : 0;
+ int topWidth = (horizontal || includeLogicalLeftEdge) ? style->borderTopWidth() : 0;
+ int bottomWidth = (horizontal || includeLogicalRightEdge) ? style->borderBottomWidth() : 0;
+ IntRect innerBorderRect = borderInnerRect(borderRect, topWidth, bottomWidth, leftWidth, rightWidth);
IntSize innerTopLeftRadius, innerTopRightRadius, innerBottomLeftRadius, innerBottomRightRadius;
- style->getInnerBorderRadiiForRectWithBorderWidths(innerBorderRect, style->borderTopWidth(), style->borderBottomWidth(),
- style->borderLeftWidth(), style->borderRightWidth(), innerTopLeftRadius, innerTopRightRadius,
- innerBottomLeftRadius, innerBottomRightRadius);
+
+ style->getInnerBorderRadiiForRectWithBorderWidths(innerBorderRect, topWidth, bottomWidth, leftWidth, rightWidth, innerTopLeftRadius, innerTopRightRadius, innerBottomLeftRadius, innerBottomRightRadius);
+
+ IntSize innerTopLeft, innerTopRight, innerBottomLeft, innerBottomRight;
- if (begin) {
+ if (includeLogicalLeftEdge) {
topLeft = topLeftRadius;
- bottomLeft = bottomLeftRadius;
+ innerTopLeft = innerTopLeftRadius;
+ if (horizontal) {
+ bottomLeft = bottomLeftRadius;
+ innerBottomLeft = innerBottomLeftRadius;
+ } else {
+ topRight = topRightRadius;
+ innerTopRight = innerTopRightRadius;
+ }
}
- if (end) {
- topRight = topRightRadius;
+
+ if (includeLogicalRightEdge) {
+ if (horizontal) {
+ topRight = topRightRadius;
+ innerTopRight = innerTopRightRadius;
+ } else {
+ bottomLeft = bottomLeftRadius;
+ innerBottomLeft = innerBottomLeftRadius;
+ }
bottomRight = bottomRightRadius;
+ innerBottomRight = innerBottomRightRadius;
}
- renderRadii = true;
-
- // Clip to the inner and outer radii rects.
- graphicsContext->save();
- graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
- graphicsContext->clipOutRoundedRect(innerBorderRect, innerTopLeftRadius, innerTopRightRadius, innerBottomLeftRadius, innerBottomRightRadius);
-
- roundedPath.addRoundedRect(borderRect, topLeft, topRight, bottomLeft, bottomRight);
- graphicsContext->addPath(roundedPath);
+ renderRadii = !topLeft.isZero() || !topRight.isZero() || !bottomLeft.isZero() || !bottomRight.isZero();
+
+ if (renderRadii) {
+ // Clip to the inner and outer radii rects.
+ graphicsContext->save();
+ graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+ graphicsContext->clipOutRoundedRect(innerBorderRect, innerTopLeft, innerTopRight, innerBottomLeft, innerBottomRight);
+ roundedPath.addRoundedRect(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+ graphicsContext->addPath(roundedPath);
+ }
}
bool upperLeftBorderStylesMatch = renderLeft && (topStyle == leftStyle) && (topColor == leftColor);
@@ -1078,7 +1113,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRadii && borderWillArcInnerEdge(topLeft, topRight, style->borderLeftWidth(), style->borderRightWidth(), style->borderTopWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSTop, upperLeftBorderStylesMatch, upperRightBorderStylesMatch, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSTop, upperLeftBorderStylesMatch, upperRightBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
float thickness = max(max(style->borderTopWidth(), style->borderLeftWidth()), style->borderRightWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderTopWidth(), thickness, BSTop, style, topColor, topStyle);
graphicsContext->restore();
@@ -1099,7 +1134,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRadii && borderWillArcInnerEdge(bottomLeft, bottomRight, style->borderLeftWidth(), style->borderRightWidth(), style->borderBottomWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSBottom, lowerLeftBorderStylesMatch, lowerRightBorderStylesMatch, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSBottom, lowerLeftBorderStylesMatch, lowerRightBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
float thickness = max(max(style->borderBottomWidth(), style->borderLeftWidth()), style->borderRightWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderBottomWidth(), thickness, BSBottom, style, bottomColor, bottomStyle);
graphicsContext->restore();
@@ -1122,7 +1157,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRadii && borderWillArcInnerEdge(bottomLeft, topLeft, style->borderBottomWidth(), style->borderTopWidth(), style->borderLeftWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSLeft, upperLeftBorderStylesMatch, lowerLeftBorderStylesMatch, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSLeft, upperLeftBorderStylesMatch, lowerLeftBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
float thickness = max(max(style->borderLeftWidth(), style->borderTopWidth()), style->borderBottomWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderLeftWidth(), thickness, BSLeft, style, leftColor, leftStyle);
graphicsContext->restore();
@@ -1141,7 +1176,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRight) {
if (renderRadii && borderWillArcInnerEdge(bottomRight, topRight, style->borderBottomWidth(), style->borderTopWidth(), style->borderRightWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSRight, upperRightBorderStylesMatch, lowerRightBorderStylesMatch, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSRight, upperRightBorderStylesMatch, lowerRightBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
float thickness = max(max(style->borderRightWidth(), style->borderTopWidth()), style->borderBottomWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderRightWidth(), thickness, BSRight, style, rightColor, rightStyle);
graphicsContext->restore();
@@ -1168,7 +1203,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
}
#else
void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,
- const RenderStyle* style, bool begin, bool end)
+ const RenderStyle* style, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
// FIXME: This old version of paintBorder should be removed when all ports implement
// GraphicsContext::clipConvexPolygon()!! This should happen soon.
@@ -1190,10 +1225,11 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
EBorderStyle leftStyle = style->borderLeftStyle();
EBorderStyle rightStyle = style->borderRightStyle();
- bool renderTop = topStyle > BHIDDEN && !topTransparent;
- bool renderLeft = leftStyle > BHIDDEN && begin && !leftTransparent;
- bool renderRight = rightStyle > BHIDDEN && end && !rightTransparent;
- bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent;
+ bool horizontal = style->isHorizontalWritingMode();
+ bool renderTop = topStyle > BHIDDEN && !topTransparent && (horizontal || includeLogicalLeftEdge);
+ bool renderLeft = leftStyle > BHIDDEN && !leftTransparent && (!horizontal || includeLogicalLeftEdge);
+ bool renderRight = rightStyle > BHIDDEN && !rightTransparent && (!horizontal || includeLogicalRightEdge);
+ bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent && (horizontal || includeLogicalRightEdge);
bool renderRadii = false;
IntSize topLeft, topRight, bottomLeft, bottomRight;
@@ -1204,20 +1240,29 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
IntSize topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius;
style->getBorderRadiiForRect(borderRect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
- if (begin) {
+ if (includeLogicalLeftEdge) {
topLeft = topLeftRadius;
- bottomLeft = bottomLeftRadius;
+ if (horizontal)
+ bottomLeft = bottomLeftRadius;
+ else
+ topRight = topRightRadius;
}
- if (end) {
- topRight = topRightRadius;
+
+ if (includeLogicalRightEdge) {
+ if (horizontal)
+ topRight = topRightRadius;
+ else
+ bottomLeft = bottomLeftRadius;
bottomRight = bottomRightRadius;
}
- renderRadii = true;
-
- // Clip to the rounded rectangle.
- graphicsContext->save();
- graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+ renderRadii = !topLeft.isZero() || !topRight.isZero() || !bottomLeft.isZero() || !bottomRight.isZero();
+
+ if (renderRadii) {
+ // Clip to the rounded rectangle.
+ graphicsContext->save();
+ graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+ }
}
int firstAngleStart, secondAngleStart, firstAngleSpan, secondAngleSpan;
@@ -1519,7 +1564,9 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
}
#endif
-void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContext, const IntRect& box, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style)
+void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContext, const IntRect& box, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight,
+ const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style,
+ bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
FloatPoint quad[4];
int tx = box.x();
@@ -1527,47 +1574,37 @@ void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContex
int w = box.width();
int h = box.height();
+ bool horizontal = style->isHorizontalWritingMode();
+ int leftWidth = (!horizontal || includeLogicalLeftEdge) ? style->borderLeftWidth() : 0;
+ int rightWidth = (!horizontal || includeLogicalRightEdge) ? style->borderRightWidth() : 0;
+ int topWidth = (horizontal || includeLogicalLeftEdge) ? style->borderTopWidth() : 0;
+ int bottomWidth = (horizontal || includeLogicalRightEdge) ? style->borderBottomWidth() : 0;
+
// For each side, create an array of FloatPoints where each point is based on whichever value in each corner
// is larger -- the radius width/height or the border width/height -- as appropriate.
switch (side) {
case BSTop:
quad[0] = FloatPoint(tx, ty);
- quad[1] = FloatPoint(
- tx + max(topLeft.width(), (int) style->borderLeftWidth()),
- ty + max(topLeft.height(), (int) style->borderTopWidth()));
- quad[2] = FloatPoint(
- tx + w - max(topRight.width(), (int) style->borderRightWidth()),
- ty + max(topRight.height(), (int)style->borderTopWidth()));
+ quad[1] = FloatPoint(tx + max(topLeft.width(), leftWidth), ty + max(topLeft.height(), topWidth));
+ quad[2] = FloatPoint(tx + w - max(topRight.width(), rightWidth), ty + max(topRight.height(), topWidth));
quad[3] = FloatPoint(tx + w, ty);
break;
case BSLeft:
quad[0] = FloatPoint(tx, ty);
- quad[1] = FloatPoint(
- tx + max(topLeft.width(), (int) style->borderLeftWidth()),
- ty + max(topLeft.height(), (int) style->borderTopWidth()));
- quad[2] = FloatPoint(
- tx + max(bottomLeft.width(), (int) style->borderLeftWidth()),
- ty + h - max(bottomLeft.height(), (int)style->borderBottomWidth()));
+ quad[1] = FloatPoint(tx + max(topLeft.width(), leftWidth), ty + max(topLeft.height(), topWidth));
+ quad[2] = FloatPoint(tx + max(bottomLeft.width(), leftWidth), ty + h - max(bottomLeft.height(), bottomWidth));
quad[3] = FloatPoint(tx, ty + h);
break;
case BSBottom:
quad[0] = FloatPoint(tx, ty + h);
- quad[1] = FloatPoint(
- tx + max(bottomLeft.width(), (int) style->borderLeftWidth()),
- ty + h - max(bottomLeft.height(), (int)style->borderBottomWidth()));
- quad[2] = FloatPoint(
- tx + w - max(bottomRight.width(), (int) style->borderRightWidth()),
- ty + h - max(bottomRight.height(), (int)style->borderBottomWidth()));
+ quad[1] = FloatPoint(tx + max(bottomLeft.width(), leftWidth), ty + h - max(bottomLeft.height(), bottomWidth));
+ quad[2] = FloatPoint(tx + w - max(bottomRight.width(), rightWidth), ty + h - max(bottomRight.height(), bottomWidth));
quad[3] = FloatPoint(tx + w, ty + h);
break;
case BSRight:
quad[0] = FloatPoint(tx + w, ty);
- quad[1] = FloatPoint(
- tx + w - max(topRight.width(), (int) style->borderRightWidth()),
- ty + max(topRight.height(), (int) style->borderTopWidth()));
- quad[2] = FloatPoint(
- tx + w - max(bottomRight.width(), (int) style->borderRightWidth()),
- ty + h - max(bottomRight.height(), (int)style->borderBottomWidth()));
+ quad[1] = FloatPoint(tx + w - max(topRight.width(), rightWidth), ty + max(topRight.height(), topWidth));
+ quad[2] = FloatPoint(tx + w - max(bottomRight.width(), rightWidth), ty + h - max(bottomRight.height(), bottomWidth));
quad[3] = FloatPoint(tx + w, ty + h);
break;
default:
@@ -1610,7 +1647,7 @@ static inline void uniformlyExpandBorderRadii(int delta, IntSize& topLeft, IntSi
bottomRight.clampNegativeToZero();
}
-void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int ty, int w, int h, const RenderStyle* s, ShadowStyle shadowStyle, bool begin, bool end)
+void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int ty, int w, int h, const RenderStyle* s, ShadowStyle shadowStyle, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
// FIXME: Deal with border-image. Would be great to use border-image as a mask.
@@ -1624,36 +1661,53 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
IntSize bottomRight;
bool hasBorderRadius = s->hasBorderRadius();
- if (hasBorderRadius && (begin || end)) {
+ bool isHorizontal = s->isHorizontalWritingMode();
+ if (hasBorderRadius && (includeLogicalLeftEdge || includeLogicalRightEdge)) {
IntSize topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius;
s->getBorderRadiiForRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
- if (begin) {
+ if (includeLogicalLeftEdge) {
if (shadowStyle == Inset) {
topLeftRadius.expand(-borderLeft(), -borderTop());
topLeftRadius.clampNegativeToZero();
- bottomLeftRadius.expand(-borderLeft(), -borderBottom());
- bottomLeftRadius.clampNegativeToZero();
+ if (isHorizontal) {
+ bottomLeftRadius.expand(-borderLeft(), -borderBottom());
+ bottomLeftRadius.clampNegativeToZero();
+ } else {
+ topRightRadius.expand(-borderRight(), -borderTop());
+ topRightRadius.clampNegativeToZero();
+ }
}
topLeft = topLeftRadius;
- bottomLeft = bottomLeftRadius;
+ if (isHorizontal)
+ bottomLeft = bottomLeftRadius;
+ else
+ topRight = topRightRadius;
}
- if (end) {
+ if (includeLogicalRightEdge) {
if (shadowStyle == Inset) {
- topRightRadius.expand(-borderRight(), -borderTop());
- topRightRadius.clampNegativeToZero();
+ if (isHorizontal) {
+ topRightRadius.expand(-borderRight(), -borderTop());
+ topRightRadius.clampNegativeToZero();
+ } else {
+ bottomLeftRadius.expand(-borderLeft(), -borderBottom());
+ bottomLeftRadius.clampNegativeToZero();
+ }
bottomRightRadius.expand(-borderRight(), -borderBottom());
bottomRightRadius.clampNegativeToZero();
}
- topRight = topRightRadius;
+ if (isHorizontal)
+ topRight = topRightRadius;
+ else
+ bottomLeft = bottomLeftRadius;
bottomRight = bottomRightRadius;
}
}
if (shadowStyle == Inset) {
- rect.move(begin ? borderLeft() : 0, borderTop());
- rect.setWidth(rect.width() - (begin ? borderLeft() : 0) - (end ? borderRight() : 0));
- rect.setHeight(rect.height() - borderTop() - borderBottom());
+ rect.move(includeLogicalLeftEdge || !isHorizontal ? borderLeft() : 0, includeLogicalLeftEdge || isHorizontal ? borderTop() : 0);
+ rect.setWidth(rect.width() - ((includeLogicalLeftEdge || !isHorizontal) ? borderLeft() : 0) - ((includeLogicalRightEdge || !isHorizontal) ? borderRight() : 0));
+ rect.setHeight(rect.height() - ((includeLogicalLeftEdge || isHorizontal) ? borderTop() : 0) - ((includeLogicalRightEdge || isHorizontal) ? borderBottom() : 0));
}
bool hasOpaqueBackground = s->visitedDependentColor(CSSPropertyBackgroundColor).isValid() && s->visitedDependentColor(CSSPropertyBackgroundColor).alpha() == 255;
@@ -1739,12 +1793,22 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
context->fillRect(rect, shadowColor, s->colorSpace());
continue;
}
- if (!begin) {
- holeRect.move(-max(shadowOffset.width(), 0) - shadowBlur, 0);
- holeRect.setWidth(holeRect.width() + max(shadowOffset.width(), 0) + shadowBlur);
+
+ if (!includeLogicalLeftEdge) {
+ if (isHorizontal) {
+ holeRect.move(-max(shadowOffset.width(), 0) - shadowBlur, 0);
+ holeRect.setWidth(holeRect.width() + max(shadowOffset.width(), 0) + shadowBlur);
+ } else {
+ holeRect.move(0, -max(shadowOffset.height(), 0) - shadowBlur);
+ holeRect.setHeight(holeRect.height() + max(shadowOffset.height(), 0) + shadowBlur);
+ }
+ }
+ if (!includeLogicalRightEdge) {
+ if (isHorizontal)
+ holeRect.setWidth(holeRect.width() - min(shadowOffset.width(), 0) + shadowBlur);
+ else
+ holeRect.setHeight(holeRect.height() - min(shadowOffset.height(), 0) + shadowBlur);
}
- if (!end)
- holeRect.setWidth(holeRect.width() - min(shadowOffset.width(), 0) + shadowBlur);
Color fillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), 255);
diff --git a/WebCore/rendering/RenderBoxModelObject.h b/WebCore/rendering/RenderBoxModelObject.h
index 33d7ca2..121601f 100644
--- a/WebCore/rendering/RenderBoxModelObject.h
+++ b/WebCore/rendering/RenderBoxModelObject.h
@@ -109,9 +109,9 @@ public:
virtual void childBecameNonInline(RenderObject* /*child*/) { }
- void paintBorder(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, bool begin = true, bool end = true);
+ void paintBorder(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
bool paintNinePieceImage(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver);
- void paintBoxShadow(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, ShadowStyle, bool begin = true, bool end = true);
+ void paintBoxShadow(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer*, int tx, int ty, int width, int height, InlineFlowBox* = 0, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
// The difference between this inline's baseline position and the line's baseline position.
@@ -137,7 +137,9 @@ private:
IntSize calculateFillTileSize(const FillLayer*, IntSize scaledSize) const;
- void clipBorderSidePolygon(GraphicsContext*, const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style);
+ void clipBorderSidePolygon(GraphicsContext*, const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft,
+ const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style,
+ bool includeLogicalLeftEdge, bool includeLogicalRightEdge);
friend class RenderView;
diff --git a/WebCore/rendering/RenderFlexibleBox.cpp b/WebCore/rendering/RenderFlexibleBox.cpp
index 83ec721..d4dc75a 100644
--- a/WebCore/rendering/RenderFlexibleBox.cpp
+++ b/WebCore/rendering/RenderFlexibleBox.cpp
@@ -926,7 +926,7 @@ void RenderFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool relayoutC
continue;
if (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))
- || (child->style()->height().isAuto() && child->isBlockFlow() && !child->needsLayout())) {
+ || (child->style()->height().isAuto() && child->isBlockFlow())) {
child->setChildNeedsLayout(true, false);
// Dirty all the positioned objects.
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index a160381..11ae66f 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -524,8 +524,13 @@ void RenderLayer::setHasVisibleContent(bool b)
RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint();
m_repaintRect = renderer()->clippedOverflowRectForRepaint(repaintContainer);
m_outlineBox = renderer()->outlineBoundsForRepaint(repaintContainer);
- if (!isNormalFlowOnly())
- dirtyStackingContextZOrderLists();
+ if (!isNormalFlowOnly()) {
+ for (RenderLayer* sc = stackingContext(); sc; sc = sc->stackingContext()) {
+ sc->dirtyZOrderLists();
+ if (sc->hasVisibleContent())
+ break;
+ }
+ }
}
if (parent())
parent()->childVisibilityChanged(m_hasVisibleContent);
@@ -672,7 +677,7 @@ void RenderLayer::updateLayerPosition()
setHeight(box->bottomLayoutOverflow());
}
- localPoint += box->locationOffset();
+ localPoint += box->locationOffsetIncludingFlipping();
}
// Clear our cached clip rect information.
@@ -686,13 +691,13 @@ void RenderLayer::updateLayerPosition()
if (curr->isBox() && !curr->isTableRow()) {
// Rows and cells share the same coordinate space (that of the section).
// Omit them when computing our xpos/ypos.
- localPoint += toRenderBox(curr)->locationOffset();
+ localPoint += toRenderBox(curr)->locationOffsetIncludingFlipping();
}
curr = curr->parent();
}
if (curr->isBox() && curr->isTableRow()) {
// Put ourselves into the row coordinate space.
- localPoint -= toRenderBox(curr)->locationOffset();
+ localPoint -= toRenderBox(curr)->locationOffsetIncludingFlipping();
}
}
@@ -2472,7 +2477,7 @@ void RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* p,
if (paintingRoot && !renderer()->isDescendantOf(paintingRoot))
paintingRootForRenderer = paintingRoot;
- if (overlapTestRequests)
+ if (overlapTestRequests && isSelfPaintingLayer())
performOverlapTests(*overlapTestRequests, layerBounds);
// We want to paint our layer, but only if we intersect the damage rect.
diff --git a/WebCore/rendering/RenderLayer.h b/WebCore/rendering/RenderLayer.h
index 3d9445d..060c7c6 100644
--- a/WebCore/rendering/RenderLayer.h
+++ b/WebCore/rendering/RenderLayer.h
@@ -47,22 +47,17 @@
#include "RenderBox.h"
#include "ScrollBehavior.h"
#include "ScrollbarClient.h"
-#include "Timer.h"
#include <wtf/OwnPtr.h>
namespace WebCore {
-class CachedResource;
class HitTestRequest;
class HitTestResult;
class HitTestingTransformState;
-class RenderFrameSet;
class RenderMarquee;
class RenderReplica;
class RenderScrollbarPart;
class RenderStyle;
-class RenderTable;
-class RenderText;
class RenderView;
class Scrollbar;
class TransformationMatrix;
diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
index 52a814c..ce7690a 100644
--- a/WebCore/rendering/RenderLayerBacking.cpp
+++ b/WebCore/rendering/RenderLayerBacking.cpp
@@ -1166,13 +1166,14 @@ bool RenderLayerBacking::startAnimation(double timeOffset, const Animation* anim
if (!keyframeStyle)
continue;
- // get timing function
+ // Get timing function.
RefPtr<TimingFunction> tf = keyframeStyle->hasAnimations() ? (*keyframeStyle->animations()).animation(0)->timingFunction() : 0;
- if (currentKeyframe.containsProperty(CSSPropertyWebkitTransform))
+ bool isFirstOrLastKeyframe = key == 0 || key == 1;
+ if ((hasTransform && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyWebkitTransform))
transformVector.insert(new TransformAnimationValue(key, &(keyframeStyle->transform()), tf));
- if (currentKeyframe.containsProperty(CSSPropertyOpacity))
+ if ((hasOpacity && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyOpacity))
opacityVector.insert(new FloatAnimationValue(key, keyframeStyle->opacity(), tf));
}
diff --git a/WebCore/rendering/RenderLineBoxList.cpp b/WebCore/rendering/RenderLineBoxList.cpp
index 1e58e63..e5fc791 100644
--- a/WebCore/rendering/RenderLineBoxList.cpp
+++ b/WebCore/rendering/RenderLineBoxList.cpp
@@ -145,6 +145,57 @@ void RenderLineBoxList::dirtyLineBoxes()
curr->dirtyLineBoxes();
}
+bool RenderLineBoxList::rangeIntersectsDirtyRect(RenderBoxModelObject* renderer, int logicalTop, int logicalBottom, const PaintInfo& paintInfo, int tx, int ty) const
+{
+ RenderBox* block;
+ if (renderer->isBox())
+ block = toRenderBox(renderer);
+ else
+ block = renderer->containingBlock();
+ int physicalStart = block->convertFromFlippedWritingMode(logicalTop);
+ int physicalEnd = block->convertFromFlippedWritingMode(logicalBottom);
+ int physicalExtent = abs(physicalEnd - physicalStart);
+ physicalStart = min(physicalStart, physicalEnd);
+
+ if (renderer->style()->isHorizontalWritingMode()) {
+ physicalStart += ty;
+ if (physicalStart >= paintInfo.rect.bottom() || physicalStart + physicalExtent <= paintInfo.rect.y())
+ return false;
+ } else {
+ physicalStart += tx;
+ if (physicalStart >= paintInfo.rect.right() || physicalStart + physicalExtent <= paintInfo.rect.x())
+ return false;
+ }
+
+ return true;
+}
+
+bool RenderLineBoxList::anyLineIntersectsDirtyRect(RenderBoxModelObject* renderer, const PaintInfo& paintInfo, int tx, int ty, bool usePrintRect) const
+{
+ // We can check the first box and last box and avoid painting if we don't
+ // intersect. This is a quick short-circuit that we can take to avoid walking any lines.
+ // FIXME: This check is flawed in the following extremely obscure way:
+ // if some line in the middle has a huge overflow, it might actually extend below the last line.
+ int firstLineTop = firstLineBox()->topVisibleOverflow();
+ if (usePrintRect && !firstLineBox()->parent())
+ firstLineTop = min(firstLineTop, firstLineBox()->root()->lineTop());
+ int lastLineBottom = lastLineBox()->bottomVisibleOverflow();
+ if (usePrintRect && !lastLineBox()->parent())
+ lastLineBottom = max(lastLineBottom, lastLineBox()->root()->lineBottom());
+ int logicalTop = firstLineTop - renderer->maximalOutlineSize(paintInfo.phase);
+ int logicalBottom = renderer->maximalOutlineSize(paintInfo.phase) + lastLineBottom;
+
+ return rangeIntersectsDirtyRect(renderer, logicalTop, logicalBottom, paintInfo, tx, ty);
+}
+
+bool RenderLineBoxList::lineIntersectsDirtyRect(RenderBoxModelObject* renderer, InlineFlowBox* box, const PaintInfo& paintInfo, int tx, int ty) const
+{
+ int logicalTop = min(box->topVisibleOverflow(), box->root()->selectionTop()) - renderer->maximalOutlineSize(paintInfo.phase);
+ int logicalBottom = box->bottomVisibleOverflow() + renderer->maximalOutlineSize(paintInfo.phase);
+
+ return rangeIntersectsDirtyRect(renderer, logicalTop, logicalBottom, paintInfo, tx, ty);
+}
+
void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintInfo, int tx, int ty) const
{
// Only paint during the foreground/selection phases.
@@ -164,20 +215,7 @@ void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn
RenderView* v = renderer->view();
bool usePrintRect = !v->printRect().isEmpty();
- // We can check the first box and last box and avoid painting if we don't
- // intersect. This is a quick short-circuit that we can take to avoid walking any lines.
- // FIXME: This check is flawed in the following extremely obscure way:
- // if some line in the middle has a huge overflow, it might actually extend below the last line.
- int firstLineTop = firstLineBox()->topVisibleOverflow();
- if (usePrintRect && !firstLineBox()->parent())
- firstLineTop = min(firstLineTop, firstLineBox()->root()->lineTop());
- int lastLineBottom = lastLineBox()->bottomVisibleOverflow();
- if (usePrintRect && !lastLineBox()->parent())
- lastLineBottom = max(lastLineBottom, lastLineBox()->root()->lineBottom());
- int yPos = firstLineTop - renderer->maximalOutlineSize(paintInfo.phase);
- int h = renderer->maximalOutlineSize(paintInfo.phase) + lastLineBottom - yPos;
- yPos += ty;
- if (yPos >= paintInfo.rect.bottom() || yPos + h <= paintInfo.rect.y())
+ if (!anyLineIntersectsDirtyRect(renderer, paintInfo, tx, ty, usePrintRect))
return;
PaintInfo info(paintInfo);
@@ -189,11 +227,9 @@ void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn
// based off positions of our first line box or our last line box.
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
if (usePrintRect) {
- // FIXME: This is a feeble effort to avoid splitting a line across two pages.
- // It is utterly inadequate, and this should not be done at paint time at all.
- // The whole way objects break across pages needs to be redone.
- // Try to avoid splitting a line vertically, but only if it's less than the height
- // of the entire page.
+ // FIXME: This is the deprecated pagination model that is still needed
+ // for embedded views inside AppKit. AppKit is incapable of paginating vertical
+ // text pages, so we don't have to deal with vertical lines at all here.
int topForPaginationCheck = curr->topVisibleOverflow();
int bottomForPaginationCheck = curr->bottomVisibleOverflow();
if (!curr->parent()) {
@@ -216,11 +252,7 @@ void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn
}
}
- int top = min(curr->topVisibleOverflow(), curr->root()->selectionTop()) - renderer->maximalOutlineSize(info.phase);
- int bottom = curr->bottomVisibleOverflow() + renderer->maximalOutlineSize(info.phase);
- h = bottom - top;
- yPos = ty + top;
- if (yPos < info.rect.bottom() && yPos + h > info.rect.y())
+ if (lineIntersectsDirtyRect(renderer, curr, info, tx, ty))
curr->paint(info, tx, ty);
}
@@ -246,20 +278,26 @@ bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, const HitTestReq
if (!firstLineBox())
return false;
+ bool isVertical = firstLineBox()->isVertical();
+
+ int logicalPointStart = isVertical ? x - result.leftPadding() : y - result.topPadding();
+ int logicalPointEnd = isVertical ? x + result.rightPadding() : y + result.bottomPadding();
+ int offset = isVertical ? tx : ty;
+
// We can check the first box and last box and avoid hit testing if we don't
// contain the point. This is a quick short-circuit that we can take to avoid walking any lines.
// FIXME: This check is flawed in the following extremely obscure way:
// if some line in the middle has a huge overflow, it might actually extend below the last line.
- if (y - result.topPadding() >= ty + lastLineBox()->root()->bottomVisibleOverflow()
- || y + result.bottomPadding() < ty + firstLineBox()->root()->topVisibleOverflow())
+ if (logicalPointStart >= offset + lastLineBox()->root()->logicalBottomVisibleOverflow()
+ || logicalPointEnd < offset + firstLineBox()->root()->logicalTopVisibleOverflow())
return false;
// See if our root lines contain the point. If so, then we hit test
// them further. Note that boxes can easily overlap, so we can't make any assumptions
// based off positions of our first line box or our last line box.
for (InlineFlowBox* curr = lastLineBox(); curr; curr = curr->prevLineBox()) {
- if (y + result.bottomPadding() >= ty + curr->root()->topVisibleOverflow()
- && y - result.topPadding() < ty + curr->root()->bottomVisibleOverflow()) {
+ if (logicalPointEnd >= offset + curr->root()->logicalTopVisibleOverflow()
+ && logicalPointStart < offset + curr->root()->logicalBottomVisibleOverflow()) {
bool inside = curr->nodeAtPoint(request, result, x, y, tx, ty);
if (inside) {
renderer->updateHitTestResult(result, IntPoint(x - tx, y - ty));
diff --git a/WebCore/rendering/RenderLineBoxList.h b/WebCore/rendering/RenderLineBoxList.h
index f7d9960..9ffacdf 100644
--- a/WebCore/rendering/RenderLineBoxList.h
+++ b/WebCore/rendering/RenderLineBoxList.h
@@ -67,6 +67,10 @@ public:
bool hitTest(RenderBoxModelObject*, const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction) const;
private:
+ bool anyLineIntersectsDirtyRect(RenderBoxModelObject*, const PaintInfo&, int x, int y, bool usePrintRect) const;
+ bool lineIntersectsDirtyRect(RenderBoxModelObject*, InlineFlowBox*, const PaintInfo&, int x, int y) const;
+ bool rangeIntersectsDirtyRect(RenderBoxModelObject*, int logicalTop, int logicalBottom, const PaintInfo&, int x, int y) const;
+
// For block flows, each box represents the root inline box for a line in the
// paragraph.
// For inline flows, each box represents a portion of that inline.
diff --git a/WebCore/rendering/RenderMeter.h b/WebCore/rendering/RenderMeter.h
index 6d4c53b..e776186 100644
--- a/WebCore/rendering/RenderMeter.h
+++ b/WebCore/rendering/RenderMeter.h
@@ -23,7 +23,7 @@
#if ENABLE(METER_TAG)
#include "RenderBlock.h"
-#include "RenderProgress.h"
+#include "RenderIndicator.h"
#include "RenderWidget.h"
diff --git a/WebCore/rendering/RenderSVGImage.cpp b/WebCore/rendering/RenderSVGImage.cpp
index a569759..237dbaa 100644
--- a/WebCore/rendering/RenderSVGImage.cpp
+++ b/WebCore/rendering/RenderSVGImage.cpp
@@ -100,6 +100,7 @@ void RenderSVGImage::updateFromElement()
m_updateCachedRepaintRect = true;
setNeedsLayout(true);
}
+ RenderSVGModelObject::updateFromElement();
}
void RenderSVGImage::paint(PaintInfo& paintInfo, int, int)
diff --git a/WebCore/rendering/RenderSVGResourceFilter.cpp b/WebCore/rendering/RenderSVGResourceFilter.cpp
index 3203ddf..50cf68e 100644
--- a/WebCore/rendering/RenderSVGResourceFilter.cpp
+++ b/WebCore/rendering/RenderSVGResourceFilter.cpp
@@ -35,6 +35,7 @@
#include "ImageData.h"
#include "IntRect.h"
#include "RenderSVGResource.h"
+#include "RenderSVGResourceFilterPrimitive.h"
#include "SVGElement.h"
#include "SVGFilter.h"
#include "SVGFilterElement.h"
@@ -205,13 +206,13 @@ bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*,
if (!lastEffect)
return false;
- // Determine the filter primitive subregions of every effect.
- lastEffect->determineFilterPrimitiveSubregion(filterData->filter.get());
- if (!fitsInMaximumImageSize(filterData->filter->maxImageSize(), scale)) {
- // At least one FilterEffect has a too big image size,
- // recalculate the effect sizes with new scale factor.
+ RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion(lastEffect, filterData->filter.get());
+ FloatRect subRegion = lastEffect->maxEffectRect();
+ // At least one FilterEffect has a too big image size,
+ // recalculate the effect sizes with new scale factors.
+ if (!fitsInMaximumImageSize(subRegion.size(), scale)) {
filterData->filter->setFilterResolution(scale);
- lastEffect->determineFilterPrimitiveSubregion(filterData->filter.get());
+ RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion(lastEffect, filterData->filter.get());
}
// If the drawingRegion is empty, we have something like <g filter=".."/>.
diff --git a/WebCore/rendering/RenderSVGResourceFilterPrimitive.cpp b/WebCore/rendering/RenderSVGResourceFilterPrimitive.cpp
index f7381fa..bf2ef6e 100644
--- a/WebCore/rendering/RenderSVGResourceFilterPrimitive.cpp
+++ b/WebCore/rendering/RenderSVGResourceFilterPrimitive.cpp
@@ -28,12 +28,76 @@
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "RenderSVGResourceFilterPrimitive.h"
+#include "SVGFEImage.h"
namespace WebCore {
-RenderSVGResourceFilterPrimitive::RenderSVGResourceFilterPrimitive(SVGFilterPrimitiveStandardAttributes* filterPrimitiveElement)
- : RenderSVGHiddenContainer(filterPrimitiveElement)
+FloatRect RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion(FilterEffect* effect, SVGFilter* filter)
{
+ FloatRect uniteRect;
+ FloatRect subregionBoundingBox = effect->effectBoundaries();
+ FloatRect subregion = subregionBoundingBox;
+
+ if (effect->filterEffectType() != FilterEffectTypeTile) {
+ // FETurbulence, FEImage and FEFlood don't have input effects, take the filter region as unite rect.
+ if (unsigned numberOfInputEffects = effect->inputEffects().size()) {
+ for (unsigned i = 0; i < numberOfInputEffects; ++i)
+ uniteRect.unite(determineFilterPrimitiveSubregion(effect->inputEffect(i), filter));
+ } else
+ uniteRect = filter->filterRegionInUserSpace();
+ } else {
+ determineFilterPrimitiveSubregion(effect->inputEffect(0), filter);
+ uniteRect = filter->filterRegionInUserSpace();
+ }
+
+ if (filter->effectBoundingBoxMode()) {
+ subregion = uniteRect;
+ // Avoid the calling of a virtual method several times.
+ FloatRect targetBoundingBox = filter->targetBoundingBox();
+
+ if (effect->hasX())
+ subregion.setX(targetBoundingBox.x() + subregionBoundingBox.x() * targetBoundingBox.width());
+
+ if (effect->hasY())
+ subregion.setY(targetBoundingBox.y() + subregionBoundingBox.y() * targetBoundingBox.height());
+
+ if (effect->hasWidth())
+ subregion.setWidth(subregionBoundingBox.width() * targetBoundingBox.width());
+
+ if (effect->hasHeight())
+ subregion.setHeight(subregionBoundingBox.height() * targetBoundingBox.height());
+ } else {
+ if (!effect->hasX())
+ subregion.setX(uniteRect.x());
+
+ if (!effect->hasY())
+ subregion.setY(uniteRect.y());
+
+ if (!effect->hasWidth())
+ subregion.setWidth(uniteRect.width());
+
+ if (!effect->hasHeight())
+ subregion.setHeight(uniteRect.height());
+ }
+
+ effect->setFilterPrimitiveSubregion(subregion);
+
+ FloatRect absoluteSubregion = filter->mapLocalRectToAbsoluteRect(subregion);
+ FloatSize filterResolution = filter->filterResolution();
+ absoluteSubregion.scale(filterResolution.width(), filterResolution.height());
+
+ // FEImage needs the unclipped subregion in absolute coordinates to determine the correct
+ // destination rect in combination with preserveAspectRatio.
+ if (effect->filterEffectType() == FilterEffectTypeImage)
+ reinterpret_cast<FEImage*>(effect)->setAbsoluteSubregion(absoluteSubregion);
+
+ // Clip every filter effect to the filter region.
+ FloatRect absoluteScaledFilterRegion = filter->filterRegion();
+ absoluteScaledFilterRegion.scale(filterResolution.width(), filterResolution.height());
+ absoluteSubregion.intersect(absoluteScaledFilterRegion);
+
+ effect->setMaxEffectRect(enclosingIntRect(absoluteSubregion));
+ return subregion;
}
} // namespace WebCore
diff --git a/WebCore/rendering/RenderSVGResourceFilterPrimitive.h b/WebCore/rendering/RenderSVGResourceFilterPrimitive.h
index b054203..c890ffe 100644
--- a/WebCore/rendering/RenderSVGResourceFilterPrimitive.h
+++ b/WebCore/rendering/RenderSVGResourceFilterPrimitive.h
@@ -31,12 +31,20 @@
#include "RenderSVGHiddenContainer.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
+#include "SVGFilter.h"
namespace WebCore {
class RenderSVGResourceFilterPrimitive : public RenderSVGHiddenContainer {
public:
- explicit RenderSVGResourceFilterPrimitive(SVGFilterPrimitiveStandardAttributes* filterPrimitiveElement);
+
+ explicit RenderSVGResourceFilterPrimitive(SVGFilterPrimitiveStandardAttributes* filterPrimitiveElement)
+ : RenderSVGHiddenContainer(filterPrimitiveElement)
+ {
+ }
+
+ // They depend on the RenderObject argument of RenderSVGResourceFilter::applyResource.
+ static FloatRect determineFilterPrimitiveSubregion(FilterEffect* effect, SVGFilter* filter);
private:
virtual const char* renderName() const { return "RenderSVGResourceFilterPrimitive"; }
diff --git a/WebCore/rendering/RenderSVGResourceMasker.cpp b/WebCore/rendering/RenderSVGResourceMasker.cpp
index 10133b2..ed27899 100644
--- a/WebCore/rendering/RenderSVGResourceMasker.cpp
+++ b/WebCore/rendering/RenderSVGResourceMasker.cpp
@@ -161,10 +161,11 @@ void RenderSVGResourceMasker::drawContentIntoMaskImage(MaskerData* maskerData, c
// Create the luminance mask.
IntRect maskImageRect(IntPoint(), maskerData->maskImage->size());
- RefPtr<ImageData> imageData(maskerData->maskImage->getUnmultipliedImageData(maskImageRect));
- CanvasPixelArray* srcPixelArray(imageData->data());
+ RefPtr<ImageData> imageData = maskerData->maskImage->getUnmultipliedImageData(maskImageRect);
+ ByteArray* srcPixelArray = imageData->data()->data();
- for (unsigned pixelOffset = 0; pixelOffset < srcPixelArray->length(); pixelOffset += 4) {
+ unsigned pixelArrayLength = srcPixelArray->length();
+ for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
unsigned char a = srcPixelArray->get(pixelOffset + 3);
if (!a)
continue;
diff --git a/WebCore/rendering/RenderScrollbar.cpp b/WebCore/rendering/RenderScrollbar.cpp
index e7a70a4..44a0126 100644
--- a/WebCore/rendering/RenderScrollbar.cpp
+++ b/WebCore/rendering/RenderScrollbar.cpp
@@ -47,13 +47,19 @@ RenderScrollbar::RenderScrollbar(ScrollbarClient* client, ScrollbarOrientation o
// FIXME: We need to do this because RenderScrollbar::styleChanged is called as soon as the scrollbar is created.
// Update the scrollbar size.
+ int width = 0;
+ int height = 0;
updateScrollbarPart(ScrollbarBGPart);
- RenderScrollbarPart* part = m_parts.get(ScrollbarBGPart);
- if (!part)
- return;
-
- part->layout();
- setFrameRect(IntRect(0, 0, part->width(), part->height()));
+ if (RenderScrollbarPart* part = m_parts.get(ScrollbarBGPart)) {
+ part->layout();
+ width = part->width();
+ height = part->height();
+ } else if (this->orientation() == HorizontalScrollbar)
+ width = this->width();
+ else
+ height = this->height();
+
+ setFrameRect(IntRect(0, 0, width, height));
}
RenderScrollbar::~RenderScrollbar()
diff --git a/WebCore/rendering/RenderTextControl.cpp b/WebCore/rendering/RenderTextControl.cpp
index 4855bab..3d6b04b 100644
--- a/WebCore/rendering/RenderTextControl.cpp
+++ b/WebCore/rendering/RenderTextControl.cpp
@@ -216,49 +216,43 @@ int RenderTextControl::selectionEnd()
return indexForVisiblePosition(frame->selection()->end());
}
-void RenderTextControl::setSelectionStart(int start)
+bool RenderTextControl::hasVisibleTextArea() const
{
- HTMLTextFormControlElement* element = static_cast<HTMLTextFormControlElement*>(node());
- setSelectionRange(start, max(start, element->selectionEnd()));
+ return style()->visibility() == HIDDEN || !m_innerText || !m_innerText->renderer() || !m_innerText->renderBox()->height();
}
-void RenderTextControl::setSelectionEnd(int end)
+void setSelectionRange(Node* node, int start, int end)
{
- HTMLTextFormControlElement* element = static_cast<HTMLTextFormControlElement*>(node());
- setSelectionRange(min(end, element->selectionStart()), end);
-}
+ ASSERT(node);
+ node->document()->updateLayoutIgnorePendingStylesheets();
-void RenderTextControl::select()
-{
- setSelectionRange(0, text().length());
-}
+ if (!node->renderer() || !node->renderer()->isTextControl())
+ return;
-void RenderTextControl::setSelectionRange(int start, int end)
-{
end = max(end, 0);
start = min(max(start, 0), end);
- ASSERT(!document()->childNeedsAndNotInStyleRecalc());
+ RenderTextControl* control = toRenderTextControl(node->renderer());
- if (style()->visibility() == HIDDEN || !m_innerText || !m_innerText->renderer() || !m_innerText->renderBox()->height()) {
- cacheSelection(start, end);
+ if (control->hasVisibleTextArea()) {
+ control->cacheSelection(start, end);
return;
}
- VisiblePosition startPosition = visiblePositionForIndex(start);
+ VisiblePosition startPosition = control->visiblePositionForIndex(start);
VisiblePosition endPosition;
if (start == end)
endPosition = startPosition;
else
- endPosition = visiblePositionForIndex(end);
+ endPosition = control->visiblePositionForIndex(end);
// startPosition and endPosition can be null position for example when
// "-webkit-user-select: none" style attribute is specified.
if (startPosition.isNotNull() && endPosition.isNotNull()) {
- ASSERT(startPosition.deepEquivalent().node()->shadowAncestorNode() == node() && endPosition.deepEquivalent().node()->shadowAncestorNode() == node());
+ ASSERT(startPosition.deepEquivalent().node()->shadowAncestorNode() == node && endPosition.deepEquivalent().node()->shadowAncestorNode() == node);
}
VisibleSelection newSelection = VisibleSelection(startPosition, endPosition);
- if (Frame* frame = this->frame())
+ if (Frame* frame = node->document()->frame())
frame->selection()->setSelection(newSelection);
}
diff --git a/WebCore/rendering/RenderTextControl.h b/WebCore/rendering/RenderTextControl.h
index 84d7b0b..b75de0e 100644
--- a/WebCore/rendering/RenderTextControl.h
+++ b/WebCore/rendering/RenderTextControl.h
@@ -42,10 +42,6 @@ public:
int selectionStart();
int selectionEnd();
- void setSelectionStart(int);
- void setSelectionEnd(int);
- void select();
- void setSelectionRange(int start, int end);
PassRefPtr<Range> selection(int start, int end) const;
virtual void subtreeHasChanged();
@@ -109,11 +105,16 @@ private:
String finishText(Vector<UChar>&) const;
+ bool hasVisibleTextArea() const;
+ friend void setSelectionRange(Node*, int start, int end);
+
bool m_wasChangedSinceLastChangeEvent;
bool m_lastChangeWasUserEdit;
RefPtr<TextControlInnerTextElement> m_innerText;
};
+void setSelectionRange(Node*, int start, int end);
+
inline RenderTextControl* toRenderTextControl(RenderObject* object)
{
ASSERT(!object || object->isTextControl());
diff --git a/WebCore/rendering/RenderTextFragment.cpp b/WebCore/rendering/RenderTextFragment.cpp
index 705c095..ec62d85 100644
--- a/WebCore/rendering/RenderTextFragment.cpp
+++ b/WebCore/rendering/RenderTextFragment.cpp
@@ -23,6 +23,7 @@
#include "config.h"
#include "RenderTextFragment.h"
+#include "RenderBlock.h"
#include "Text.h"
namespace WebCore {
@@ -57,6 +58,16 @@ PassRefPtr<StringImpl> RenderTextFragment::originalText() const
return result->substring(start(), end());
}
+void RenderTextFragment::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
+{
+ RenderText::styleDidChange(diff, oldStyle);
+
+ if (RenderBlock* block = blockForAccompanyingFirstLetter()) {
+ block->style()->removeCachedPseudoStyle(FIRST_LETTER);
+ block->updateFirstLetter();
+ }
+}
+
void RenderTextFragment::destroy()
{
if (m_firstLetter)
@@ -92,4 +103,15 @@ UChar RenderTextFragment::previousCharacter() const
return RenderText::previousCharacter();
}
+RenderBlock* RenderTextFragment::blockForAccompanyingFirstLetter() const
+{
+ if (!m_firstLetter)
+ return 0;
+ for (RenderObject* block = m_firstLetter->parent(); block; block = block->parent()) {
+ if (block->style()->hasPseudoStyle(FIRST_LETTER) && block->canHaveChildren() && block->isRenderBlock())
+ return toRenderBlock(block);
+ }
+ return 0;
+}
+
} // namespace WebCore
diff --git a/WebCore/rendering/RenderTextFragment.h b/WebCore/rendering/RenderTextFragment.h
index abb3fa4..c251f81 100644
--- a/WebCore/rendering/RenderTextFragment.h
+++ b/WebCore/rendering/RenderTextFragment.h
@@ -50,9 +50,13 @@ public:
StringImpl* contentString() const { return m_contentString.get(); }
virtual PassRefPtr<StringImpl> originalText() const;
+protected:
+ virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
+
private:
virtual void setTextInternal(PassRefPtr<StringImpl>);
virtual UChar previousCharacter() const;
+ RenderBlock* blockForAccompanyingFirstLetter() const;
unsigned m_start;
unsigned m_end;
diff --git a/WebCore/rendering/RenderView.cpp b/WebCore/rendering/RenderView.cpp
index 0538d99..3349403 100644
--- a/WebCore/rendering/RenderView.cpp
+++ b/WebCore/rendering/RenderView.cpp
@@ -105,6 +105,11 @@ void RenderView::computePreferredLogicalWidths()
m_maxPreferredLogicalWidth = m_minPreferredLogicalWidth;
}
+bool RenderView::isChildAllowed(RenderObject* child, RenderStyle*) const
+{
+ return child->isBox();
+}
+
void RenderView::layout()
{
if (!document()->paginated())
diff --git a/WebCore/rendering/RenderView.h b/WebCore/rendering/RenderView.h
index 8f64766..81cb686 100644
--- a/WebCore/rendering/RenderView.h
+++ b/WebCore/rendering/RenderView.h
@@ -46,6 +46,8 @@ public:
virtual bool requiresLayer() const { return true; }
+ virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
+
virtual void layout();
virtual void computeLogicalWidth();
virtual void computeLogicalHeight();
diff --git a/WebCore/rendering/RootInlineBox.cpp b/WebCore/rendering/RootInlineBox.cpp
index c7fcaeb..178b1ad 100644
--- a/WebCore/rendering/RootInlineBox.cpp
+++ b/WebCore/rendering/RootInlineBox.cpp
@@ -149,7 +149,7 @@ void RootInlineBox::addHighlightOverflow()
FloatRect rootRect(0, selectionTop(), logicalWidth(), selectionHeight());
IntRect inflatedRect = enclosingIntRect(page->chrome()->client()->customHighlightRect(renderer()->node(), renderer()->style()->highlight(), rootRect));
setInlineDirectionOverflowPositions(leftLayoutOverflow(), rightLayoutOverflow(), min(leftVisualOverflow(), inflatedRect.x()), max(rightVisualOverflow(), inflatedRect.right()));
- setBlockDirectionOverflowPositions(topLayoutOverflow(), bottomLayoutOverflow(), min(topVisualOverflow(), inflatedRect.y()), max(bottomVisualOverflow(), inflatedRect.bottom()), logicalHeight());
+ setBlockDirectionOverflowPositions(topLayoutOverflow(), bottomLayoutOverflow(), min(topVisualOverflow(), inflatedRect.y()), max(bottomVisualOverflow(), inflatedRect.bottom()));
}
void RootInlineBox::paintCustomHighlight(PaintInfo& paintInfo, int tx, int ty, const AtomicString& highlightType)
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index 5d5b8b3..f9641f4 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -21,9 +21,9 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+
#include "config.h"
#include "TextControlInnerElements.h"
@@ -107,18 +107,18 @@ void TextControlInnerElement::attachInnerElement(Node* parent, PassRefPtr<Render
setRenderer(renderer);
renderer->setStyle(style);
}
-
+
// Set these explicitly since this normally happens during an attach()
setAttached();
setInDocument();
-
+
// For elements without a shadow parent, add the node to the DOM normally.
if (!m_shadowParent) {
// FIXME: This code seems very wrong. Why are we magically adding |this| to the DOM here?
// We shouldn't be calling parser API methods outside of the parser!
parent->deprecatedParserAddChild(this);
}
-
+
// Add the renderer to the render tree
if (renderer)
parent->renderer()->addChild(renderer);
@@ -208,7 +208,7 @@ void SearchFieldCancelButtonElement::detach()
{
if (m_capturing) {
if (Frame* frame = document()->frame())
- frame->eventHandler()->setCapturingMouseEventsNode(0);
+ frame->eventHandler()->setCapturingMouseEventsNode(0);
}
TextControlInnerElement::detach();
}
@@ -281,9 +281,9 @@ void SpinButtonElement::defaultEventHandler(Event* event)
if (!box) {
if (!event->defaultHandled())
HTMLDivElement::defaultEventHandler(event);
- return;
+ return;
}
-
+
HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
if (input->disabled() || input->isReadOnlyFormControl()) {
if (!event->defaultHandled())
@@ -431,7 +431,7 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
if (event->type() == eventNames().clickEvent) {
switch (m_state) {
case Idle:
- if (speechInput()->startRecognition(m_listenerId, input->renderer()->absoluteBoundingBoxRect()))
+ if (speechInput()->startRecognition(m_listenerId, input->renderer()->absoluteBoundingBoxRect(), input->computeInheritedLanguage(), input->getAttribute(webkitgrammarAttr)))
setState(Recording);
break;
case Recording:
@@ -471,14 +471,16 @@ void InputFieldSpeechButtonElement::didCompleteRecognition(int)
setState(Idle);
}
-void InputFieldSpeechButtonElement::setRecognitionResult(int, const String& result)
+void InputFieldSpeechButtonElement::setRecognitionResult(int, const SpeechInputResultArray& results)
{
+ m_results = results;
+
HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
// The call to setValue() below dispatches an event, and an event handler in the page might
// remove the input element from DOM. To make sure it remains valid until we finish our work
// here, we take a temporary reference.
RefPtr<HTMLInputElement> holdRef(input);
- input->setValue(result);
+ input->setValue(results.isEmpty() ? "" : results[0]->utterance());
input->dispatchWebkitSpeechChangeEvent();
renderer()->repaint();
}
@@ -487,7 +489,7 @@ void InputFieldSpeechButtonElement::detach()
{
if (m_capturing) {
if (Frame* frame = document()->frame())
- frame->eventHandler()->setCapturingMouseEventsNode(0);
+ frame->eventHandler()->setCapturingMouseEventsNode(0);
}
if (m_state != Idle)
diff --git a/WebCore/rendering/TextControlInnerElements.h b/WebCore/rendering/TextControlInnerElements.h
index c146a42..46c1c8e 100644
--- a/WebCore/rendering/TextControlInnerElements.h
+++ b/WebCore/rendering/TextControlInnerElements.h
@@ -141,7 +141,7 @@ public:
// SpeechInputListener methods.
void didCompleteRecording(int);
void didCompleteRecognition(int);
- void setRecognitionResult(int, const String& result);
+ void setRecognitionResult(int, const SpeechInputResultArray&);
private:
InputFieldSpeechButtonElement(HTMLElement*);
@@ -151,6 +151,7 @@ private:
bool m_capturing;
SpeechInputState m_state;
int m_listenerId;
+ SpeechInputResultArray m_results;
};
#endif // ENABLE(INPUT_SPEECH)
diff --git a/WebCore/rendering/style/CursorList.h b/WebCore/rendering/style/CursorList.h
index 1b82684..a1d1fe7 100644
--- a/WebCore/rendering/style/CursorList.h
+++ b/WebCore/rendering/style/CursorList.h
@@ -40,6 +40,8 @@ public:
const CursorData& operator[](int i) const { return m_vector[i]; }
CursorData& operator[](int i) { return m_vector[i]; }
+ const CursorData& at(size_t i) const { return m_vector.at(i); }
+ CursorData& at(size_t i) { return m_vector.at(i); }
bool operator==(const CursorList& o) const { return m_vector == o.m_vector; }
bool operator!=(const CursorList& o) const { return m_vector != o.m_vector; }
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp
index b56bb1e..ec77367 100644
--- a/WebCore/rendering/style/RenderStyle.cpp
+++ b/WebCore/rendering/style/RenderStyle.cpp
@@ -27,6 +27,7 @@
#include "FontSelector.h"
#include "RenderArena.h"
#include "RenderObject.h"
+#include "ScaleTransformOperation.h"
#include "StyleImage.h"
#include <wtf/StdLibExtras.h>
#include <algorithm>
@@ -244,6 +245,19 @@ RenderStyle* RenderStyle::addCachedPseudoStyle(PassRefPtr<RenderStyle> pseudo)
return result;
}
+void RenderStyle::removeCachedPseudoStyle(PseudoId pid)
+{
+ if (!m_cachedPseudoStyles)
+ return;
+ for (size_t i = 0; i < m_cachedPseudoStyles->size(); ++i) {
+ RenderStyle* pseudoStyle = m_cachedPseudoStyles->at(i).get();
+ if (pseudoStyle->styleType() == pid) {
+ m_cachedPseudoStyles->remove(i);
+ return;
+ }
+ }
+}
+
bool RenderStyle::inheritedNotEqual(const RenderStyle* other) const
{
return inherited_flags != other->inherited_flags ||
@@ -680,6 +694,17 @@ void RenderStyle::applyTransform(TransformationMatrix& transform, const IntSize&
}
}
+void RenderStyle::setPageScaleTransform(float scale)
+{
+ if (scale == 1)
+ return;
+ TransformOperations transform;
+ transform.operations().append(ScaleTransformOperation::create(scale, scale, ScaleTransformOperation::SCALE));
+ setTransform(transform);
+ setTransformOriginX(Length(0, Fixed));
+ setTransformOriginY(Length(0, Fixed));
+}
+
void RenderStyle::setTextShadow(ShadowData* val, bool add)
{
ASSERT(!val || (!val->spread() && val->style() == Normal));
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index 96645cf..f14e8f5 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -325,6 +325,7 @@ public:
RenderStyle* getCachedPseudoStyle(PseudoId) const;
RenderStyle* addCachedPseudoStyle(PassRefPtr<RenderStyle>);
+ void removeCachedPseudoStyle(PseudoId);
const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); }
@@ -641,6 +642,7 @@ public:
void getTextShadowHorizontalExtent(int& left, int& right) const { getShadowHorizontalExtent(textShadow(), left, right); }
void getTextShadowVerticalExtent(int& top, int& bottom) const { getShadowVerticalExtent(textShadow(), top, bottom); }
void getTextShadowInlineDirectionExtent(int& logicalLeft, int& logicalRight) { getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); }
+ void getTextShadowBlockDirectionExtent(int& logicalTop, int& logicalBottom) { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); }
float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; }
ColorSpace colorSpace() const { return static_cast<ColorSpace>(rareInheritedData->colorSpace); }
@@ -660,6 +662,7 @@ public:
void getBoxShadowHorizontalExtent(int& left, int& right) const { getShadowHorizontalExtent(boxShadow(), left, right); }
void getBoxShadowVerticalExtent(int& top, int& bottom) const { getShadowVerticalExtent(boxShadow(), top, bottom); }
void getBoxShadowInlineDirectionExtent(int& logicalLeft, int& logicalRight) { getShadowInlineDirectionExtent(boxShadow(), logicalLeft, logicalRight); }
+ void getBoxShadowBlockDirectionExtent(int& logicalTop, int& logicalBottom) { getShadowBlockDirectionExtent(boxShadow(), logicalTop, logicalBottom); }
StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxReflect.get(); }
EBoxSizing boxSizing() const { return m_box->boxSizing(); }
@@ -711,6 +714,7 @@ public:
enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
void applyTransform(TransformationMatrix&, const IntSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const;
+ void setPageScaleTransform(float);
bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
// End CSS3 Getters
@@ -752,6 +756,7 @@ public:
WritingMode writingMode() const { return static_cast<WritingMode>(inherited_flags.m_writingMode); }
bool isHorizontalWritingMode() const { return writingMode() == TopToBottomWritingMode || writingMode() == BottomToTopWritingMode; }
bool isFlippedLinesWritingMode() const { return writingMode() == LeftToRightWritingMode || writingMode() == BottomToTopWritingMode; }
+ bool isFlippedBlocksWritingMode() const { return writingMode() == RightToLeftWritingMode || writingMode() == BottomToTopWritingMode; }
ESpeak speak() { return static_cast<ESpeak>(rareInheritedData->speak); }
@@ -1327,6 +1332,10 @@ private:
{
return isHorizontalWritingMode() ? getShadowHorizontalExtent(shadow, logicalLeft, logicalRight) : getShadowVerticalExtent(shadow, logicalLeft, logicalRight);
}
+ void getShadowBlockDirectionExtent(const ShadowData* shadow, int& logicalTop, int& logicalBottom) const
+ {
+ return isHorizontalWritingMode() ? getShadowVerticalExtent(shadow, logicalTop, logicalBottom) : getShadowHorizontalExtent(shadow, logicalTop, logicalBottom);
+ }
// Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
const Color& borderLeftColor() const { return surround->border.left().color(); }
diff --git a/WebCore/rendering/svg/SVGInlineTextBox.cpp b/WebCore/rendering/svg/SVGInlineTextBox.cpp
index 0458af5..7dd779a 100644
--- a/WebCore/rendering/svg/SVGInlineTextBox.cpp
+++ b/WebCore/rendering/svg/SVGInlineTextBox.cpp
@@ -523,7 +523,7 @@ void SVGInlineTextBox::paintTextWithShadows(GraphicsContext* context, RenderStyl
FloatSize extraOffset;
if (shadow)
- extraOffset = applyShadowToGraphicsContext(context, shadow, shadowRect, false /* stroked */, true /* opaque */);
+ extraOffset = applyShadowToGraphicsContext(context, shadow, shadowRect, false /* stroked */, true /* opaque */, false /* vertical */);
font.drawText(context, textRun, textOrigin + extraOffset, startPosition, endPosition);
restoreGraphicsContextAfterTextPainting(context, textRun);
diff --git a/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp b/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
index c3f4b6a..2474a5c 100644
--- a/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
+++ b/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
@@ -57,20 +57,17 @@ void SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextSubtree(RenderS
propagateLayoutAttributes(textRoot, atCharacter, lastCharacter);
}
-static inline void extractFloatValuesFromSVGLengthList(SVGElement* lengthContext, SVGLengthList* list, Vector<float>& floatValues, unsigned textContentLength)
+static inline void extractFloatValuesFromSVGLengthList(SVGElement* lengthContext, const SVGLengthList& list, Vector<float>& floatValues, unsigned textContentLength)
{
ASSERT(lengthContext);
- ASSERT(list);
- unsigned length = list->numberOfItems();
+ unsigned length = list.size();
if (length > textContentLength)
length = textContentLength;
floatValues.reserveCapacity(length);
- ExceptionCode ec = 0;
for (unsigned i = 0; i < length; ++i) {
- SVGLength length = list->getItem(i, ec);
- ASSERT(!ec);
+ const SVGLength& length = list.at(i);
floatValues.append(length.value(lengthContext));
}
}
diff --git a/WebCore/storage/IDBDatabaseBackendImpl.cpp b/WebCore/storage/IDBDatabaseBackendImpl.cpp
index dc61e22..020ddb9 100644
--- a/WebCore/storage/IDBDatabaseBackendImpl.cpp
+++ b/WebCore/storage/IDBDatabaseBackendImpl.cpp
@@ -32,60 +32,65 @@
#include "DOMStringList.h"
#include "IDBDatabaseException.h"
#include "IDBObjectStoreBackendImpl.h"
+#include "IDBSQLiteDatabase.h"
#include "IDBTransactionBackendInterface.h"
#include "IDBTransactionCoordinator.h"
-#include "SQLiteDatabase.h"
#include "SQLiteStatement.h"
#include "SQLiteTransaction.h"
namespace WebCore {
-static bool extractMetaData(SQLiteDatabase* sqliteDatabase, const String& expectedName, String& foundVersion)
+static bool extractMetaData(SQLiteDatabase& sqliteDatabase, const String& name, String& foundVersion, int64& foundId)
{
- SQLiteStatement metaDataQuery(*sqliteDatabase, "SELECT name, version FROM MetaData");
- if (metaDataQuery.prepare() != SQLResultOk || metaDataQuery.step() != SQLResultRow)
- return false;
-
- if (metaDataQuery.getColumnText(0) != expectedName) {
- LOG_ERROR("Name in MetaData (%s) doesn't match expected (%s) for IndexedDB", metaDataQuery.getColumnText(0).utf8().data(), expectedName.utf8().data());
+ SQLiteStatement databaseQuery(sqliteDatabase, "SELECT id, version FROM Databases WHERE name = ?");
+ if (databaseQuery.prepare() != SQLResultOk) {
ASSERT_NOT_REACHED();
+ return false;
}
- foundVersion = metaDataQuery.getColumnText(1);
+ databaseQuery.bindText(1, name);
+ if (databaseQuery.step() != SQLResultRow)
+ return false;
- if (metaDataQuery.step() == SQLResultRow) {
- LOG_ERROR("More than one row found in MetaData table");
- ASSERT_NOT_REACHED();
- }
+ foundId = databaseQuery.getColumnInt64(0);
+ foundVersion = databaseQuery.getColumnText(1);
+ if (databaseQuery.step() == SQLResultRow)
+ ASSERT_NOT_REACHED();
return true;
}
-static bool setMetaData(SQLiteDatabase* sqliteDatabase, const String& name, const String& description, const String& version)
+static bool setMetaData(SQLiteDatabase& sqliteDatabase, const String& name, const String& description, const String& version, int64_t& rowId)
{
- ASSERT(!name.isNull() && !description.isNull() && !version.isNull());
-
- sqliteDatabase->executeCommand("DELETE FROM MetaData");
-
- SQLiteStatement insert(*sqliteDatabase, "INSERT INTO MetaData (name, description, version) VALUES (?, ?, ?)");
- if (insert.prepare() != SQLResultOk) {
- LOG_ERROR("Failed to prepare MetaData insert statement for IndexedDB");
+ ASSERT(!name.isNull());
+ ASSERT(!description.isNull());
+ ASSERT(!version.isNull());
+
+ String sql = rowId != IDBDatabaseBackendImpl::InvalidId ? "UPDATE Databases SET name = ?, description = ?, version = ? WHERE id = ?"
+ : "INSERT INTO Databases (name, description, version) VALUES (?, ?, ?)";
+ SQLiteStatement query(sqliteDatabase, sql);
+ if (query.prepare() != SQLResultOk) {
+ ASSERT_NOT_REACHED();
return false;
}
- insert.bindText(1, name);
- insert.bindText(2, description);
- insert.bindText(3, version);
+ query.bindText(1, name);
+ query.bindText(2, description);
+ query.bindText(3, version);
+ if (rowId != IDBDatabaseBackendImpl::InvalidId)
+ query.bindInt64(4, rowId);
- if (insert.step() != SQLResultDone) {
- LOG_ERROR("Failed to insert row into MetaData for IndexedDB");
+ if (query.step() != SQLResultDone)
return false;
- }
+
+ if (rowId == IDBDatabaseBackendImpl::InvalidId)
+ rowId = sqliteDatabase.lastInsertRowID();
return true;
}
-IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, const String& description, PassOwnPtr<SQLiteDatabase> sqliteDatabase, IDBTransactionCoordinator* coordinator)
+IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, const String& description, IDBSQLiteDatabase* sqliteDatabase, IDBTransactionCoordinator* coordinator)
: m_sqliteDatabase(sqliteDatabase)
+ , m_id(InvalidId)
, m_name(name)
, m_description(description)
, m_version("")
@@ -94,9 +99,10 @@ IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, const String&
ASSERT(!m_name.isNull());
ASSERT(!m_description.isNull());
- extractMetaData(m_sqliteDatabase.get(), m_name, m_version);
- setMetaData(m_sqliteDatabase.get(), m_name, m_description, m_version);
-
+ bool success = extractMetaData(m_sqliteDatabase->db(), m_name, m_version, m_id);
+ ASSERT_UNUSED(success, success == (m_id != InvalidId));
+ if (!setMetaData(m_sqliteDatabase->db(), m_name, m_description, m_version, m_id))
+ ASSERT_NOT_REACHED(); // FIXME: Need better error handling.
loadObjectStores();
}
@@ -110,7 +116,12 @@ void IDBDatabaseBackendImpl::setDescription(const String& description)
return;
m_description = description;
- setMetaData(m_sqliteDatabase.get(), m_name, m_description, m_version);
+ setMetaData(m_sqliteDatabase->db(), m_name, m_description, m_version, m_id);
+}
+
+SQLiteDatabase& IDBDatabaseBackendImpl::sqliteDatabase() const
+{
+ return m_sqliteDatabase->db();
}
PassRefPtr<DOMStringList> IDBDatabaseBackendImpl::objectStores() const
@@ -144,7 +155,7 @@ PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendImpl::createObject
void IDBDatabaseBackendImpl::createObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBTransactionBackendInterface> transaction)
{
- SQLiteStatement insert(database->sqliteDatabase(), "INSERT INTO ObjectStores (name, keyPath, doAutoIncrement) VALUES (?, ?, ?)");
+ SQLiteStatement insert(database->sqliteDatabase(), "INSERT INTO ObjectStores (name, keyPath, doAutoIncrement, databaseId) VALUES (?, ?, ?, ?)");
if (insert.prepare() != SQLResultOk) {
transaction->abort();
return;
@@ -152,6 +163,7 @@ void IDBDatabaseBackendImpl::createObjectStoreInternal(ScriptExecutionContext*,
insert.bindText(1, objectStore->name());
insert.bindText(2, objectStore->keyPath());
insert.bindInt(3, static_cast<int>(objectStore->autoIncrement()));
+ insert.bindInt64(4, database->id());
if (insert.step() != SQLResultDone) {
transaction->abort();
return;
@@ -217,8 +229,9 @@ void IDBDatabaseBackendImpl::setVersion(const String& version, PassRefPtr<IDBCal
void IDBDatabaseBackendImpl::setVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
{
+ int64_t databaseId = database->id();
database->m_version = version;
- if (!setMetaData(database->m_sqliteDatabase.get(), database->m_name, database->m_description, database->m_version)) {
+ if (!setMetaData(database->m_sqliteDatabase->db(), database->m_name, database->m_description, database->m_version, databaseId)) {
// FIXME: The Indexed Database specification does not have an error code dedicated to I/O errors.
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
transaction->abort();
@@ -240,10 +253,12 @@ void IDBDatabaseBackendImpl::close()
void IDBDatabaseBackendImpl::loadObjectStores()
{
- SQLiteStatement objectStoresQuery(sqliteDatabase(), "SELECT id, name, keyPath, doAutoIncrement FROM ObjectStores");
+ SQLiteStatement objectStoresQuery(sqliteDatabase(), "SELECT id, name, keyPath, doAutoIncrement FROM ObjectStores WHERE databaseId = ?");
bool ok = objectStoresQuery.prepare() == SQLResultOk;
ASSERT_UNUSED(ok, ok); // FIXME: Better error handling?
+ objectStoresQuery.bindInt64(1, m_id);
+
while (objectStoresQuery.step() == SQLResultRow) {
int64_t id = objectStoresQuery.getColumnInt64(0);
String name = objectStoresQuery.getColumnText(1);
diff --git a/WebCore/storage/IDBDatabaseBackendImpl.h b/WebCore/storage/IDBDatabaseBackendImpl.h
index bb6429c..53e1a5f 100644
--- a/WebCore/storage/IDBDatabaseBackendImpl.h
+++ b/WebCore/storage/IDBDatabaseBackendImpl.h
@@ -36,19 +36,23 @@
namespace WebCore {
class IDBObjectStoreBackendImpl;
+class IDBSQLiteDatabase;
class IDBTransactionCoordinator;
class SQLiteDatabase;
class IDBDatabaseBackendImpl : public IDBDatabaseBackendInterface {
public:
- static PassRefPtr<IDBDatabaseBackendImpl> create(const String& name, const String& description, PassOwnPtr<SQLiteDatabase> database, IDBTransactionCoordinator* coordinator)
+ static PassRefPtr<IDBDatabaseBackendImpl> create(const String& name, const String& description, IDBSQLiteDatabase* database, IDBTransactionCoordinator* coordinator)
{
return adoptRef(new IDBDatabaseBackendImpl(name, description, database, coordinator));
}
virtual ~IDBDatabaseBackendImpl();
void setDescription(const String& description);
- SQLiteDatabase& sqliteDatabase() const { return *m_sqliteDatabase.get(); }
+ SQLiteDatabase& sqliteDatabase() const;
+
+ static const int64_t InvalidId = 0;
+ int64_t id() const { return m_id; }
virtual String name() const { return m_name; }
virtual String description() const { return m_description; }
@@ -65,7 +69,7 @@ public:
IDBTransactionCoordinator* transactionCoordinator() const { return m_transactionCoordinator.get(); }
private:
- IDBDatabaseBackendImpl(const String& name, const String& description, PassOwnPtr<SQLiteDatabase> database, IDBTransactionCoordinator*);
+ IDBDatabaseBackendImpl(const String& name, const String& description, IDBSQLiteDatabase* database, IDBTransactionCoordinator*);
void loadObjectStores();
@@ -78,7 +82,8 @@ private:
static void addObjectStoreToMap(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, PassRefPtr<IDBObjectStoreBackendImpl>);
static void resetVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, const String& version);
- OwnPtr<SQLiteDatabase> m_sqliteDatabase;
+ RefPtr<IDBSQLiteDatabase> m_sqliteDatabase;
+ int64 m_id;
String m_name;
String m_description;
String m_version;
diff --git a/WebCore/storage/IDBDatabaseException.h b/WebCore/storage/IDBDatabaseException.h
index 251cfc9..945773c 100644
--- a/WebCore/storage/IDBDatabaseException.h
+++ b/WebCore/storage/IDBDatabaseException.h
@@ -42,9 +42,8 @@ public:
}
~IDBDatabaseException() { }
- // Keep in sync with what's in the .idl file.
enum ErrorCode {
- UNKNOWN_ERR = 0,
+ UNKNOWN_ERR = 1,
NON_TRANSIENT_ERR = 1,
NOT_FOUND_ERR = 2,
CONSTRAINT_ERR = 3,
diff --git a/WebCore/storage/IDBDatabaseException.idl b/WebCore/storage/IDBDatabaseException.idl
index 88e6e7e..1f15fc0 100644
--- a/WebCore/storage/IDBDatabaseException.idl
+++ b/WebCore/storage/IDBDatabaseException.idl
@@ -28,7 +28,8 @@ module storage {
interface [
Conditional=INDEXED_DATABASE
] IDBDatabaseException {
- const unsigned short UNKNOWN_ERR = 0;
+ // FIXME: These error codes conflict with others.
+ const unsigned short UNKNOWN_ERR = 1;
const unsigned short NON_TRANSIENT_ERR = 1;
const unsigned short NOT_FOUND_ERR = 2;
const unsigned short CONSTRAINT_ERR = 3;
diff --git a/WebCore/storage/IDBFactoryBackendImpl.cpp b/WebCore/storage/IDBFactoryBackendImpl.cpp
index c18294d..1905c0c 100644
--- a/WebCore/storage/IDBFactoryBackendImpl.cpp
+++ b/WebCore/storage/IDBFactoryBackendImpl.cpp
@@ -33,8 +33,8 @@
#include "FileSystem.h"
#include "IDBDatabaseBackendImpl.h"
#include "IDBDatabaseException.h"
+#include "IDBSQLiteDatabase.h"
#include "IDBTransactionCoordinator.h"
-#include "SQLiteDatabase.h"
#include "SecurityOrigin.h"
#include <wtf/Threading.h>
#include <wtf/UnusedParam.h>
@@ -52,7 +52,13 @@ IDBFactoryBackendImpl::~IDBFactoryBackendImpl()
{
}
-static PassOwnPtr<SQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOrigin, String name, const String& pathBase, int64_t maximumSize)
+void IDBFactoryBackendImpl::removeSQLiteDatabase(const String& filePath)
+{
+ ASSERT(m_sqliteDatabaseMap.contains(filePath));
+ m_sqliteDatabaseMap.remove(filePath);
+}
+
+static PassRefPtr<IDBSQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOrigin, const String& pathBase, int64_t maximumSize, const String& fileIdentifier, IDBFactoryBackendImpl* factory)
{
String path = ":memory:";
if (!pathBase.isEmpty()) {
@@ -62,54 +68,46 @@ static PassOwnPtr<SQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOri
return 0;
}
- path = pathByAppendingComponent(pathBase, IDBFactoryBackendImpl::databaseFileName(name, securityOrigin));
+ path = pathByAppendingComponent(pathBase, IDBFactoryBackendImpl::databaseFileName(securityOrigin));
}
- OwnPtr<SQLiteDatabase> sqliteDatabase = adoptPtr(new SQLiteDatabase());
- if (!sqliteDatabase->open(path)) {
+ RefPtr<IDBSQLiteDatabase> sqliteDatabase = IDBSQLiteDatabase::create(fileIdentifier, factory);
+ if (!sqliteDatabase->db().open(path)) {
// FIXME: Is there any other thing we could possibly do to recover at this point? If so, do it rather than just erroring out.
LOG_ERROR("Failed to open database file %s for IndexedDB", path.utf8().data());
return 0;
}
- sqliteDatabase->setMaximumSize(maximumSize);
+ // FIXME: Error checking?
+ sqliteDatabase->db().setMaximumSize(maximumSize);
+ sqliteDatabase->db().turnOnIncrementalAutoVacuum();
+
return sqliteDatabase.release();
}
-static bool createTables(SQLiteDatabase* sqliteDatabase)
+static bool createTables(SQLiteDatabase& sqliteDatabase)
{
- // FIXME: Remove all the drop table commands once the on disk structure stabilizes.
static const char* commands[] = {
- "DROP TABLE IF EXISTS MetaData",
- "CREATE TABLE IF NOT EXISTS MetaData (id INTEGER PRIMARY KEY, name TEXT NOT NULL, description TEXT NOT NULL, version TEXT NOT NULL)",
+ "CREATE TABLE IF NOT EXISTS Databases (id INTEGER PRIMARY KEY, name TEXT NOT NULL, description TEXT NOT NULL, version TEXT NOT NULL)",
+ "CREATE UNIQUE INDEX IF NOT EXISTS Databases_name ON Databases(name)",
- "DROP TABLE IF EXISTS ObjectStores",
- "CREATE TABLE IF NOT EXISTS ObjectStores (id INTEGER PRIMARY KEY, name TEXT NOT NULL UNIQUE, keyPath TEXT, doAutoIncrement INTEGER NOT NULL)",
- "DROP INDEX IF EXISTS ObjectStores_name",
- "CREATE UNIQUE INDEX IF NOT EXISTS ObjectStores_name ON ObjectStores(name)",
+ "CREATE TABLE IF NOT EXISTS ObjectStores (id INTEGER PRIMARY KEY, name TEXT NOT NULL, keyPath TEXT, doAutoIncrement INTEGER NOT NULL, databaseId INTEGER NOT NULL REFERENCES Databases(id))",
+ "CREATE UNIQUE INDEX IF NOT EXISTS ObjectStores_composit ON ObjectStores(databaseId, name)",
- "DROP TABLE IF EXISTS Indexes",
- "CREATE TABLE IF NOT EXISTS Indexes (id INTEGER PRIMARY KEY, objectStoreId INTEGER NOT NULL REFERENCES ObjectStore(id), name TEXT NOT NULL UNIQUE, keyPath TEXT, isUnique INTEGER NOT NULL)",
- "DROP INDEX IF EXISTS Indexes_composit",
+ "CREATE TABLE IF NOT EXISTS Indexes (id INTEGER PRIMARY KEY, objectStoreId INTEGER NOT NULL REFERENCES ObjectStore(id), name TEXT NOT NULL, keyPath TEXT, isUnique INTEGER NOT NULL)",
"CREATE UNIQUE INDEX IF NOT EXISTS Indexes_composit ON Indexes(objectStoreId, name)",
- "DROP TABLE IF EXISTS ObjectStoreData",
- "CREATE TABLE IF NOT EXISTS ObjectStoreData (id INTEGER PRIMARY KEY, objectStoreId INTEGER NOT NULL REFERENCES ObjectStore(id), keyString TEXT UNIQUE, keyDate INTEGER UNIQUE, keyNumber INTEGER UNIQUE, value TEXT NOT NULL)",
- "DROP INDEX IF EXISTS ObjectStoreData_composit",
+ "CREATE TABLE IF NOT EXISTS ObjectStoreData (id INTEGER PRIMARY KEY, objectStoreId INTEGER NOT NULL REFERENCES ObjectStore(id), keyString TEXT, keyDate INTEGER, keyNumber INTEGER, value TEXT NOT NULL)",
"CREATE UNIQUE INDEX IF NOT EXISTS ObjectStoreData_composit ON ObjectStoreData(keyString, keyDate, keyNumber, objectStoreId)",
- "DROP TABLE IF EXISTS IndexData",
"CREATE TABLE IF NOT EXISTS IndexData (id INTEGER PRIMARY KEY, indexId INTEGER NOT NULL REFERENCES Indexes(id), keyString TEXT, keyDate INTEGER, keyNumber INTEGER, objectStoreDataId INTEGER NOT NULL REFERENCES ObjectStoreData(id))",
- "DROP INDEX IF EXISTS IndexData_composit",
"CREATE INDEX IF NOT EXISTS IndexData_composit ON IndexData(keyString, keyDate, keyNumber, indexId)",
- "DROP INDEX IF EXISTS IndexData_objectStoreDataId",
"CREATE INDEX IF NOT EXISTS IndexData_objectStoreDataId ON IndexData(objectStoreDataId)",
- "DROP INDEX IF EXISTS IndexData_indexId",
"CREATE INDEX IF NOT EXISTS IndexData_indexId ON IndexData(indexId)"
};
for (size_t i = 0; i < arraysize(commands); ++i) {
- if (!sqliteDatabase->executeCommand(commands[i])) {
+ if (!sqliteDatabase.executeCommand(commands[i])) {
// FIXME: We should try to recover from this situation. Maybe nuke the database and start over?
LOG_ERROR("Failed to run the following command for IndexedDB: %s", commands[i]);
return false;
@@ -120,7 +118,9 @@ static bool createTables(SQLiteDatabase* sqliteDatabase)
void IDBFactoryBackendImpl::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> securityOrigin, Frame*, const String& dataDir, int64_t maximumSize)
{
- IDBDatabaseBackendMap::iterator it = m_databaseBackendMap.find(name);
+ String fileIdentifier = securityOrigin->databaseIdentifier();
+ String uniqueIdentifier = fileIdentifier + "@" + name;
+ IDBDatabaseBackendMap::iterator it = m_databaseBackendMap.find(uniqueIdentifier);
if (it != m_databaseBackendMap.end()) {
if (!description.isNull())
it->second->setDescription(description); // The description may have changed.
@@ -130,22 +130,29 @@ void IDBFactoryBackendImpl::open(const String& name, const String& description,
// FIXME: Everything from now on should be done on another thread.
- OwnPtr<SQLiteDatabase> sqliteDatabase = openSQLiteDatabase(securityOrigin.get(), name, dataDir, maximumSize);
- if (!sqliteDatabase || !createTables(sqliteDatabase.get())) {
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
- return;
+ RefPtr<IDBSQLiteDatabase> sqliteDatabase;
+ SQLiteDatabaseMap::iterator it2 = m_sqliteDatabaseMap.find(fileIdentifier);
+ if (it2 != m_sqliteDatabaseMap.end())
+ sqliteDatabase = it2->second;
+ else {
+ sqliteDatabase = openSQLiteDatabase(securityOrigin.get(), dataDir, maximumSize, fileIdentifier, this);
+
+ if (!sqliteDatabase || !createTables(sqliteDatabase->db())) {
+ callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
+ return;
+ }
+ m_sqliteDatabaseMap.set(fileIdentifier, sqliteDatabase.get());
}
- RefPtr<IDBDatabaseBackendImpl> databaseBackend = IDBDatabaseBackendImpl::create(name, description, sqliteDatabase.release(), m_transactionCoordinator.get());
+ RefPtr<IDBDatabaseBackendImpl> databaseBackend = IDBDatabaseBackendImpl::create(name, description, sqliteDatabase.get(), m_transactionCoordinator.get());
callbacks->onSuccess(databaseBackend.get());
- m_databaseBackendMap.set(name, databaseBackend.release());
+ m_databaseBackendMap.set(uniqueIdentifier, databaseBackend.release());
}
-String IDBFactoryBackendImpl::databaseFileName(const String& name, SecurityOrigin* securityOrigin)
+String IDBFactoryBackendImpl::databaseFileName(SecurityOrigin* securityOrigin)
{
String databaseIdentifier = securityOrigin->databaseIdentifier();
- String santizedName = encodeForFileName(name);
- return databaseIdentifier + "@" + santizedName + ".indexeddb";
+ return databaseIdentifier + ".indexeddb";
}
} // namespace WebCore
diff --git a/WebCore/storage/IDBFactoryBackendImpl.h b/WebCore/storage/IDBFactoryBackendImpl.h
index 211b7fa..381c402 100644
--- a/WebCore/storage/IDBFactoryBackendImpl.h
+++ b/WebCore/storage/IDBFactoryBackendImpl.h
@@ -39,6 +39,7 @@ namespace WebCore {
class DOMStringList;
class IDBDatabaseBackendImpl;
+class IDBSQLiteDatabase;
class IDBTransactionCoordinator;
class IDBFactoryBackendImpl : public IDBFactoryBackendInterface {
@@ -49,18 +50,26 @@ public:
}
virtual ~IDBFactoryBackendImpl();
+ // IDBSQLiteDatabase's lifetime may be shorter than ours, so we need notification when it dies.
+ void removeSQLiteDatabase(const String& filePath);
+
virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize);
- static String databaseFileName(const String& name, SecurityOrigin*);
+ static String databaseFileName(SecurityOrigin*);
private:
IDBFactoryBackendImpl();
+ // FIXME: Just hold a weak pointer.
typedef HashMap<String, RefPtr<IDBDatabaseBackendImpl> > IDBDatabaseBackendMap;
IDBDatabaseBackendMap m_databaseBackendMap;
+
+ typedef HashMap<String, IDBSQLiteDatabase*> SQLiteDatabaseMap;
+ SQLiteDatabaseMap m_sqliteDatabaseMap;
+
RefPtr<IDBTransactionCoordinator> m_transactionCoordinator;
- // We only create one instance of this class at a time.
+ // Only one instance of the factory should exist at any given time.
static IDBFactoryBackendImpl* idbFactoryBackendImpl;
};
diff --git a/WebCore/storage/IDBObjectStoreBackendImpl.cpp b/WebCore/storage/IDBObjectStoreBackendImpl.cpp
index f3aee91..4892556 100644
--- a/WebCore/storage/IDBObjectStoreBackendImpl.cpp
+++ b/WebCore/storage/IDBObjectStoreBackendImpl.cpp
@@ -131,25 +131,25 @@ static PassRefPtr<IDBKey> fetchKeyFromKeyPath(SerializedScriptValue* value, cons
return keys[0].release();
}
-static bool putObjectStoreData(SQLiteDatabase& db, IDBKey* key, SerializedScriptValue* value, int64_t objectStoreId, int64_t* dataRowId)
+static bool putObjectStoreData(SQLiteDatabase& db, IDBKey* key, SerializedScriptValue* value, int64_t objectStoreId, int64_t& dataRowId)
{
- String sql = *dataRowId != -1 ? "UPDATE ObjectStoreData SET keyString = ?, keyDate = ?, keyNumber = ?, value = ? WHERE id = ?"
- : "INSERT INTO ObjectStoreData (keyString, keyDate, keyNumber, value, objectStoreId) VALUES (?, ?, ?, ?, ?)";
+ String sql = dataRowId != IDBObjectStoreBackendImpl::InvalidId ? "UPDATE ObjectStoreData SET keyString = ?, keyDate = ?, keyNumber = ?, value = ? WHERE id = ?"
+ : "INSERT INTO ObjectStoreData (keyString, keyDate, keyNumber, value, objectStoreId) VALUES (?, ?, ?, ?, ?)";
SQLiteStatement query(db, sql);
if (query.prepare() != SQLResultOk)
return false;
key->bindWithNulls(query, 1);
query.bindText(4, value->toWireString());
- if (*dataRowId != -1)
- query.bindInt(5, *dataRowId);
+ if (dataRowId != IDBDatabaseBackendImpl::InvalidId)
+ query.bindInt64(5, dataRowId);
else
query.bindInt64(5, objectStoreId);
if (query.step() != SQLResultDone)
return false;
- if (*dataRowId == -1)
- *dataRowId = db.lastInsertRowID();
+ if (dataRowId == IDBDatabaseBackendImpl::InvalidId)
+ dataRowId = db.lastInsertRowID();
return true;
}
@@ -238,8 +238,8 @@ void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<
// Before this point, don't do any mutation. After this point, rollback the transaction in case of error.
- int64_t dataRowId = isExistingValue ? getQuery.getColumnInt(0) : -1;
- if (!putObjectStoreData(objectStore->sqliteDatabase(), key.get(), value.get(), objectStore->id(), &dataRowId)) {
+ int64_t dataRowId = isExistingValue ? getQuery.getColumnInt(0) : InvalidId;
+ if (!putObjectStoreData(objectStore->sqliteDatabase(), key.get(), value.get(), objectStore->id(), dataRowId)) {
// FIXME: The Indexed Database specification does not have an error code dedicated to I/O errors.
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
transaction->abort();
@@ -394,11 +394,14 @@ void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> prpRange, uns
void IDBObjectStoreBackendImpl::openCursorInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> range, unsigned short tmpDirection, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
{
+ bool leftBound = range && (range->flags() & IDBKeyRange::LEFT_BOUND || range->flags() == IDBKeyRange::SINGLE);
+ bool rightBound = range && (range->flags() & IDBKeyRange::RIGHT_BOUND || range->flags() == IDBKeyRange::SINGLE);
+
// Several files depend on this order of selects.
String sql = "SELECT id, keyString, keyDate, keyNumber, value FROM ObjectStoreData WHERE ";
- if (range->flags() & IDBKeyRange::LEFT_BOUND || range->flags() == IDBKeyRange::SINGLE)
+ if (leftBound)
sql += range->left()->leftCursorWhereFragment(range->leftWhereClauseComparisonOperator());
- if (range->flags() & IDBKeyRange::RIGHT_BOUND || range->flags() == IDBKeyRange::SINGLE)
+ if (rightBound)
sql += range->right()->rightCursorWhereFragment(range->rightWhereClauseComparisonOperator());
sql += "objectStoreId = ? ORDER BY ";
@@ -413,9 +416,9 @@ void IDBObjectStoreBackendImpl::openCursorInternal(ScriptExecutionContext*, Pass
ASSERT_UNUSED(ok, ok); // FIXME: Better error handling?
int currentColumn = 1;
- if (range->flags() & IDBKeyRange::LEFT_BOUND || range->flags() == IDBKeyRange::SINGLE)
+ if (leftBound)
currentColumn += range->left()->bind(*query, currentColumn);
- if (range->flags() & IDBKeyRange::RIGHT_BOUND || range->flags() == IDBKeyRange::SINGLE)
+ if (rightBound)
currentColumn += range->right()->bind(*query, currentColumn);
query->bindInt64(currentColumn, objectStore->id());
diff --git a/WebCore/storage/IDBObjectStoreBackendImpl.h b/WebCore/storage/IDBObjectStoreBackendImpl.h
index 09223b1..60e011f 100644
--- a/WebCore/storage/IDBObjectStoreBackendImpl.h
+++ b/WebCore/storage/IDBObjectStoreBackendImpl.h
@@ -52,6 +52,7 @@ public:
}
virtual ~IDBObjectStoreBackendImpl();
+ static const int64_t InvalidId = 0;
int64_t id() const
{
ASSERT(m_id != InvalidId);
@@ -94,8 +95,6 @@ private:
static void removeIndexFromMap(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>);
static void addIndexToMap(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>);
- static const int64_t InvalidId = 0;
-
RefPtr<IDBDatabaseBackendImpl> m_database;
int64_t m_id;
diff --git a/WebCore/storage/IDBRequest.cpp b/WebCore/storage/IDBRequest.cpp
index c67e379..cbd635c 100644
--- a/WebCore/storage/IDBRequest.cpp
+++ b/WebCore/storage/IDBRequest.cpp
@@ -59,15 +59,6 @@ IDBRequest::IDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> sourc
IDBRequest::~IDBRequest()
{
- // The transaction pointer is used to notify the transaction once the JS events were
- // dispatched by this request object. If no new tasks were added by the event JS callbacks,
- // the transaction can commit. Otherwise, it can continue executing the new tasks.
- // It is important to guarantee that the transaction is notified after the events are
- // dispatched, as the transaction cannot commit or execute new tasks in the absence
- // of these notifications. We clear the transaction pointer once the events have dispatched,
- // so having a non-zero pointer at IDBRequest destruction time shows that the events have not
- // yet fired and there is a transaction waiting to be notified. This is an error.
- ASSERT(!m_transaction);
}
bool IDBRequest::resetReadyState(IDBTransactionBackendInterface* transaction)
@@ -159,6 +150,7 @@ void IDBRequest::timerFired(Timer<IDBRequest>*)
{
ASSERT(m_selfRef);
ASSERT(m_pendingEvents.size());
+ // FIXME: We should handle the stop event and stop any timers when we see it. We can then assert here that scriptExecutionContext is non-null.
// We need to keep self-referencing ourself, otherwise it's possible we'll be deleted.
// But in some cases, suspend() could be called while we're dispatching an event, so we
@@ -172,6 +164,10 @@ void IDBRequest::timerFired(Timer<IDBRequest>*)
Vector<PendingEvent> pendingEvents;
pendingEvents.swap(m_pendingEvents);
for (size_t i = 0; i < pendingEvents.size(); ++i) {
+ // It's possible we've navigated in which case we'll crash.
+ if (!scriptExecutionContext())
+ return;
+
if (pendingEvents[i].m_error) {
ASSERT(!pendingEvents[i].m_result);
dispatchEvent(IDBErrorEvent::create(m_source, *pendingEvents[i].m_error));
diff --git a/WebCore/storage/IDBSQLiteDatabase.cpp b/WebCore/storage/IDBSQLiteDatabase.cpp
new file mode 100644
index 0000000..e881917
--- /dev/null
+++ b/WebCore/storage/IDBSQLiteDatabase.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "IDBSQLiteDatabase.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBFactoryBackendImpl.h"
+
+namespace WebCore {
+
+IDBSQLiteDatabase::IDBSQLiteDatabase(String identifier, IDBFactoryBackendImpl* factory)
+ : m_identifier(identifier)
+ , m_factory(factory)
+{
+}
+
+IDBSQLiteDatabase::~IDBSQLiteDatabase()
+{
+ m_factory->removeSQLiteDatabase(m_identifier);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebCore/storage/IDBSQLiteDatabase.h b/WebCore/storage/IDBSQLiteDatabase.h
new file mode 100644
index 0000000..0556506
--- /dev/null
+++ b/WebCore/storage/IDBSQLiteDatabase.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IDBSQLiteDatabase_h
+#define IDBSQLiteDatabase_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "SQLiteDatabase.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class IDBFactoryBackendImpl;
+
+class IDBSQLiteDatabase : public RefCounted<IDBSQLiteDatabase> {
+public:
+ static PassRefPtr<IDBSQLiteDatabase> create(String identifier, IDBFactoryBackendImpl* factory)
+ {
+ return adoptRef(new IDBSQLiteDatabase(identifier, factory));
+ }
+ ~IDBSQLiteDatabase();
+
+ SQLiteDatabase& db() { return m_db; }
+
+private:
+ IDBSQLiteDatabase(String identifier, IDBFactoryBackendImpl* factory);
+
+ SQLiteDatabase m_db;
+ String m_identifier;
+ RefPtr<IDBFactoryBackendImpl> m_factory;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IDBSQLiteDatabase_h
diff --git a/WebCore/storage/IDBTransactionBackendImpl.cpp b/WebCore/storage/IDBTransactionBackendImpl.cpp
index 5016a3f..2b1f732 100644
--- a/WebCore/storage/IDBTransactionBackendImpl.cpp
+++ b/WebCore/storage/IDBTransactionBackendImpl.cpp
@@ -147,7 +147,7 @@ void IDBTransactionBackendImpl::taskTimerFired(Timer<IDBTransactionBackendImpl>*
TaskQueue queue;
queue.swap(m_taskQueue);
- while (!queue.isEmpty()) {
+ while (!queue.isEmpty() && m_state != Finished) {
OwnPtr<ScriptExecutionContext::Task> task(queue.first().release());
queue.removeFirst();
m_pendingEvents++;
diff --git a/WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h b/WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h
index a660198..ab23bae 100644
--- a/WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h
+++ b/WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h
@@ -22,11 +22,7 @@
#define DeprecatedSVGAnimatedPropertyTraits_h
#if ENABLE(SVG)
-#include "FloatRect.h"
#include "PlatformString.h"
-#include "SVGAngle.h"
-#include "SVGLength.h"
-#include "SVGLengthList.h"
#include "SVGNumberList.h"
#include "SVGPreserveAspectRatio.h"
#include "SVGTransformList.h"
@@ -36,78 +32,6 @@ namespace WebCore {
template<typename Type>
struct DeprecatedSVGAnimatedPropertyTraits : public Noncopyable { };
-// SVGAnimatedAngle
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<SVGAngle> : public Noncopyable {
- typedef const SVGAngle& PassType;
- typedef SVGAngle ReturnType;
- typedef SVGAngle StoredType;
-
- static ReturnType null() { return SVGAngle(); }
- static ReturnType toReturnType(const StoredType& type) { return type; }
- static String toString(PassType type) { return type.valueAsString(); }
-};
-
-// SVGAnimatedBoolean
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<bool> : public Noncopyable {
- typedef const bool& PassType;
- typedef bool ReturnType;
- typedef bool StoredType;
-
- static ReturnType null() { return false; }
- static ReturnType toReturnType(const StoredType& type) { return type; }
- static String toString(PassType type) { return type ? "true" : "false"; }
-};
-
-// SVGAnimatedEnumeration
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<int> : public Noncopyable {
- typedef const int& PassType;
- typedef int ReturnType;
- typedef int StoredType;
-
- static ReturnType null() { return 0; }
- static ReturnType toReturnType(const StoredType& type) { return type; }
- static String toString(PassType type) { return String::number(type); }
-};
-
-// SVGAnimatedInteger
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<long> : public Noncopyable {
- typedef const long& PassType;
- typedef long ReturnType;
- typedef long StoredType;
-
- static ReturnType null() { return 0l; }
- static ReturnType toReturnType(const StoredType& type) { return type; }
- static String toString(PassType type) { return String::number(type); }
-};
-
-// SVGAnimatedLength
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<SVGLength> : public Noncopyable {
- typedef const SVGLength& PassType;
- typedef SVGLength ReturnType;
- typedef SVGLength StoredType;
-
- static ReturnType null() { return SVGLength(); }
- static ReturnType toReturnType(const StoredType& type) { return type; }
- static String toString(PassType type) { return type.valueAsString(); }
-};
-
-// SVGAnimatedLengthList
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<SVGLengthList*> : public Noncopyable {
- typedef SVGLengthList* PassType;
- typedef SVGLengthList* ReturnType;
- typedef RefPtr<SVGLengthList> StoredType;
-
- static ReturnType null() { return 0; }
- static ReturnType toReturnType(const StoredType& type) { return type.get(); }
- static String toString(PassType type) { return type ? type->valueAsString() : String(); }
-};
-
// SVGAnimatedNumber
template<>
struct DeprecatedSVGAnimatedPropertyTraits<float> : public Noncopyable {
@@ -144,18 +68,6 @@ struct DeprecatedSVGAnimatedPropertyTraits<SVGPreserveAspectRatio> : public Nonc
static String toString(PassType type) { return type.valueAsString(); }
};
-// SVGAnimatedRect
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<FloatRect> : public Noncopyable {
- typedef const FloatRect& PassType;
- typedef FloatRect ReturnType;
- typedef FloatRect StoredType;
-
- static ReturnType null() { return FloatRect(); }
- static ReturnType toReturnType(const StoredType& type) { return type; }
- static String toString(PassType type) { return String::format("%f %f %f %f", type.x(), type.y(), type.width(), type.height()); }
-};
-
// SVGAnimatedString
template<>
struct DeprecatedSVGAnimatedPropertyTraits<String> : public Noncopyable {
diff --git a/WebCore/svg/DeprecatedSVGAnimatedTemplate.h b/WebCore/svg/DeprecatedSVGAnimatedTemplate.h
index 8e29f50..939db59 100644
--- a/WebCore/svg/DeprecatedSVGAnimatedTemplate.h
+++ b/WebCore/svg/DeprecatedSVGAnimatedTemplate.h
@@ -28,9 +28,7 @@
namespace WebCore {
- class SVGAngle;
class SVGElement;
- class SVGLengthList;
class SVGNumberList;
class SVGPreserveAspectRatio;
class SVGTransformList;
@@ -74,7 +72,7 @@ namespace WebCore {
struct DeprecatedSVGAnimatedTypeWrapperKeyHash {
static unsigned hash(const DeprecatedSVGAnimatedTypeWrapperKey& key)
{
- return StringImpl::computeHash(reinterpret_cast<const UChar*>(&key), sizeof(DeprecatedSVGAnimatedTypeWrapperKey) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(DeprecatedSVGAnimatedTypeWrapperKey)>(&key);
}
static bool equal(const DeprecatedSVGAnimatedTypeWrapperKey& a, const DeprecatedSVGAnimatedTypeWrapperKey& b)
@@ -156,16 +154,9 @@ namespace WebCore {
}
// Common type definitions, to ease IDL generation.
- typedef DeprecatedSVGAnimatedTemplate<SVGAngle> SVGAnimatedAngle;
- typedef DeprecatedSVGAnimatedTemplate<bool> SVGAnimatedBoolean;
- typedef DeprecatedSVGAnimatedTemplate<int> SVGAnimatedEnumeration;
- typedef DeprecatedSVGAnimatedTemplate<long> SVGAnimatedInteger;
- typedef DeprecatedSVGAnimatedTemplate<SVGLength> SVGAnimatedLength;
- typedef DeprecatedSVGAnimatedTemplate<SVGLengthList*> SVGAnimatedLengthList;
typedef DeprecatedSVGAnimatedTemplate<float> SVGAnimatedNumber;
typedef DeprecatedSVGAnimatedTemplate<SVGNumberList*> SVGAnimatedNumberList;
typedef DeprecatedSVGAnimatedTemplate<SVGPreserveAspectRatio> SVGAnimatedPreserveAspectRatio;
- typedef DeprecatedSVGAnimatedTemplate<FloatRect> SVGAnimatedRect;
typedef DeprecatedSVGAnimatedTemplate<String> SVGAnimatedString;
typedef DeprecatedSVGAnimatedTemplate<SVGTransformList*> SVGAnimatedTransformList;
diff --git a/WebCore/svg/SVGAElement.h b/WebCore/svg/SVGAElement.h
index b43f192..0effda2 100644
--- a/WebCore/svg/SVGAElement.h
+++ b/WebCore/svg/SVGAElement.h
@@ -23,7 +23,7 @@
#define SVGAElement_h
#if ENABLE(SVG)
-
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -68,7 +68,7 @@ namespace WebCore {
DECLARE_ANIMATED_PROPERTY(SVGAElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGAElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGAElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGAngle.cpp b/WebCore/svg/SVGAngle.cpp
index 6702904..6475064 100644
--- a/WebCore/svg/SVGAngle.cpp
+++ b/WebCore/svg/SVGAngle.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -19,111 +20,217 @@
*/
#include "config.h"
-#include "SVGAngle.h"
#if ENABLE(SVG)
+#include "SVGAngle.h"
+#include "SVGParserUtilities.h"
+#include <wtf/text/StringConcatenate.h>
#include <wtf/MathExtras.h>
namespace WebCore {
SVGAngle::SVGAngle()
- : m_unitType(SVG_ANGLETYPE_UNKNOWN)
- , m_value(0)
+ : m_unitType(SVG_ANGLETYPE_UNSPECIFIED)
, m_valueInSpecifiedUnits(0)
{
}
+float SVGAngle::value() const
+{
+ switch (m_unitType) {
+ case SVG_ANGLETYPE_GRAD:
+ return grad2deg(m_valueInSpecifiedUnits);
+ case SVG_ANGLETYPE_RAD:
+ return rad2deg(m_valueInSpecifiedUnits);
+ case SVG_ANGLETYPE_UNSPECIFIED:
+ case SVG_ANGLETYPE_UNKNOWN:
+ case SVG_ANGLETYPE_DEG:
+ return m_valueInSpecifiedUnits;
+ }
+
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
void SVGAngle::setValue(float value)
{
- m_value = value;
+ switch (m_unitType) {
+ case SVG_ANGLETYPE_GRAD:
+ m_valueInSpecifiedUnits = deg2grad(value);
+ break;
+ case SVG_ANGLETYPE_RAD:
+ m_valueInSpecifiedUnits = deg2rad(value);
+ break;
+ case SVG_ANGLETYPE_UNSPECIFIED:
+ case SVG_ANGLETYPE_UNKNOWN:
+ case SVG_ANGLETYPE_DEG:
+ m_valueInSpecifiedUnits = value;
+ break;
+ }
+}
+
+inline SVGAngle::SVGAngleType stringToAngleType(const UChar*& ptr, const UChar* end)
+{
+ // If there's no unit given, the angle type is unspecified.
+ if (ptr == end)
+ return SVGAngle::SVG_ANGLETYPE_UNSPECIFIED;
+
+ const UChar firstChar = *ptr;
+
+ // If the unit contains only one character, the angle type is unknown.
+ ++ptr;
+ if (ptr == end)
+ return SVGAngle::SVG_ANGLETYPE_UNKNOWN;
+
+ const UChar secondChar = *ptr;
+
+ // If the unit contains only two characters, the angle type is unknown.
+ ++ptr;
+ if (ptr == end)
+ return SVGAngle::SVG_ANGLETYPE_UNKNOWN;
+
+ const UChar thirdChar = *ptr;
+ if (firstChar == 'd' && secondChar == 'e' && thirdChar == 'g')
+ return SVGAngle::SVG_ANGLETYPE_DEG;
+ if (firstChar == 'r' && secondChar == 'a' && thirdChar == 'd')
+ return SVGAngle::SVG_ANGLETYPE_RAD;
+
+ // If the unit contains three characters, but is not deg or rad, then it's unknown.
+ ++ptr;
+ if (ptr == end)
+ return SVGAngle::SVG_ANGLETYPE_UNKNOWN;
+
+ const UChar fourthChar = *ptr;
+
+ if (firstChar == 'g' && secondChar == 'r' && thirdChar == 'a' && fourthChar == 'd')
+ return SVGAngle::SVG_ANGLETYPE_GRAD;
+
+ return SVGAngle::SVG_ANGLETYPE_UNKNOWN;
}
-// calc m_value
-void SVGAngle::calculate()
+String SVGAngle::valueAsString() const
{
- if (m_unitType == SVG_ANGLETYPE_GRAD)
- m_value = grad2deg(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_RAD)
- m_value = rad2deg(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_UNSPECIFIED || m_unitType == SVG_ANGLETYPE_DEG)
- m_value = m_valueInSpecifiedUnits;
+ switch (m_unitType) {
+ case SVG_ANGLETYPE_DEG:
+ return makeString(String::number(m_valueInSpecifiedUnits), "deg");
+ case SVG_ANGLETYPE_RAD:
+ return makeString(String::number(m_valueInSpecifiedUnits), "rad");
+ case SVG_ANGLETYPE_GRAD:
+ return makeString(String::number(m_valueInSpecifiedUnits), "grad");
+ case SVG_ANGLETYPE_UNSPECIFIED:
+ case SVG_ANGLETYPE_UNKNOWN:
+ return makeString(String::number(m_valueInSpecifiedUnits));
+ }
+
+ ASSERT_NOT_REACHED();
+ return String();
}
-void SVGAngle::setValueInSpecifiedUnits(float valueInSpecifiedUnits)
+void SVGAngle::setValueAsString(const String& value, ExceptionCode& ec)
{
+ if (value.isEmpty()) {
+ m_unitType = SVG_ANGLETYPE_UNSPECIFIED;
+ return;
+ }
+
+ float valueInSpecifiedUnits = 0;
+ const UChar* ptr = value.characters();
+ const UChar* end = ptr + value.length();
+
+ if (!parseNumber(ptr, end, valueInSpecifiedUnits, false)) {
+ ec = SYNTAX_ERR;
+ return;
+ }
+
+ SVGAngleType unitType = stringToAngleType(ptr, end);
+ if (unitType == SVG_ANGLETYPE_UNKNOWN) {
+ ec = SYNTAX_ERR;
+ return;
+ }
+
+ m_unitType = unitType;
m_valueInSpecifiedUnits = valueInSpecifiedUnits;
- calculate();
}
-void SVGAngle::setValueAsString(const String& s)
+void SVGAngle::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits, ExceptionCode& ec)
{
- m_valueAsString = s;
-
- bool bOK;
- m_valueInSpecifiedUnits = m_valueAsString.toFloat(&bOK);
- m_unitType = SVG_ANGLETYPE_UNSPECIFIED;
-
- if (!bOK) {
- if (m_valueAsString.endsWith("deg"))
- m_unitType = SVG_ANGLETYPE_DEG;
- else if (m_valueAsString.endsWith("grad"))
- m_unitType = SVG_ANGLETYPE_GRAD;
- else if (m_valueAsString.endsWith("rad"))
- m_unitType = SVG_ANGLETYPE_RAD;
+ if (unitType == SVG_ANGLETYPE_UNKNOWN || unitType > SVG_ANGLETYPE_GRAD) {
+ ec = NOT_SUPPORTED_ERR;
+ return;
}
-
- calculate();
+
+ if (unitType != m_unitType)
+ m_unitType = static_cast<SVGAngleType>(unitType);
+
+ m_valueInSpecifiedUnits = valueInSpecifiedUnits;
}
-String SVGAngle::valueAsString() const
+void SVGAngle::convertToSpecifiedUnits(unsigned short unitType, ExceptionCode& ec)
{
- m_valueAsString = String::number(m_valueInSpecifiedUnits);
+ if (unitType == SVG_ANGLETYPE_UNKNOWN || m_unitType == SVG_ANGLETYPE_UNKNOWN || unitType > SVG_ANGLETYPE_GRAD) {
+ ec = NOT_SUPPORTED_ERR;
+ return;
+ }
+
+ if (unitType == m_unitType)
+ return;
switch (m_unitType) {
+ case SVG_ANGLETYPE_RAD:
+ switch (unitType) {
+ case SVG_ANGLETYPE_GRAD:
+ m_valueInSpecifiedUnits = rad2grad(m_valueInSpecifiedUnits);
+ break;
+ case SVG_ANGLETYPE_UNSPECIFIED:
+ case SVG_ANGLETYPE_DEG:
+ m_valueInSpecifiedUnits = rad2deg(m_valueInSpecifiedUnits);
+ break;
+ case SVG_ANGLETYPE_RAD:
+ case SVG_ANGLETYPE_UNKNOWN:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ break;
+ case SVG_ANGLETYPE_GRAD:
+ switch (unitType) {
+ case SVG_ANGLETYPE_RAD:
+ m_valueInSpecifiedUnits = grad2rad(m_valueInSpecifiedUnits);
+ break;
case SVG_ANGLETYPE_UNSPECIFIED:
case SVG_ANGLETYPE_DEG:
- m_valueAsString += "deg";
+ m_valueInSpecifiedUnits = grad2deg(m_valueInSpecifiedUnits);
+ break;
+ case SVG_ANGLETYPE_GRAD:
+ case SVG_ANGLETYPE_UNKNOWN:
+ ASSERT_NOT_REACHED();
break;
+ }
+ break;
+ case SVG_ANGLETYPE_UNSPECIFIED:
+ // Spec: For angles, a unitless value is treated the same as if degrees were specified.
+ case SVG_ANGLETYPE_DEG:
+ switch (unitType) {
case SVG_ANGLETYPE_RAD:
- m_valueAsString += "rad";
+ m_valueInSpecifiedUnits = deg2rad(m_valueInSpecifiedUnits);
break;
case SVG_ANGLETYPE_GRAD:
- m_valueAsString += "grad";
+ m_valueInSpecifiedUnits = deg2grad(m_valueInSpecifiedUnits);
break;
+ case SVG_ANGLETYPE_UNSPECIFIED:
+ break;
+ case SVG_ANGLETYPE_DEG:
case SVG_ANGLETYPE_UNKNOWN:
+ ASSERT_NOT_REACHED();
break;
+ }
+ break;
+ case SVG_ANGLETYPE_UNKNOWN:
+ ASSERT_NOT_REACHED();
+ break;
}
-
- return m_valueAsString;
-}
-
-void SVGAngle::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits)
-{
- m_unitType = (SVGAngleType)unitType;
- m_valueInSpecifiedUnits = valueInSpecifiedUnits;
- calculate();
-}
-
-void SVGAngle::convertToSpecifiedUnits(unsigned short unitType)
-{
- if (m_unitType == unitType)
- return;
- if (m_unitType == SVG_ANGLETYPE_DEG && unitType == SVG_ANGLETYPE_RAD)
- m_valueInSpecifiedUnits = deg2rad(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_GRAD && unitType == SVG_ANGLETYPE_RAD)
- m_valueInSpecifiedUnits = grad2rad(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_DEG && unitType == SVG_ANGLETYPE_GRAD)
- m_valueInSpecifiedUnits = deg2grad(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_RAD && unitType == SVG_ANGLETYPE_GRAD)
- m_valueInSpecifiedUnits = rad2grad(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_RAD && unitType == SVG_ANGLETYPE_DEG)
- m_valueInSpecifiedUnits = rad2deg(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_GRAD && unitType == SVG_ANGLETYPE_DEG)
- m_valueInSpecifiedUnits = grad2deg(m_valueInSpecifiedUnits);
-
- m_unitType = (SVGAngleType)unitType;
+ m_unitType = static_cast<SVGAngleType>(unitType);
}
}
diff --git a/WebCore/svg/SVGAngle.h b/WebCore/svg/SVGAngle.h
index de5c3ce..4afaa4b 100644
--- a/WebCore/svg/SVGAngle.h
+++ b/WebCore/svg/SVGAngle.h
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -22,44 +23,41 @@
#define SVGAngle_h
#if ENABLE(SVG)
-#include "PlatformString.h"
+#include "ExceptionCode.h"
+#include <wtf/text/WTFString.h>
namespace WebCore {
- class SVGAngle {
- public:
- SVGAngle();
+class SVGAngle {
+public:
+ SVGAngle();
- enum SVGAngleType {
- SVG_ANGLETYPE_UNKNOWN = 0,
- SVG_ANGLETYPE_UNSPECIFIED = 1,
- SVG_ANGLETYPE_DEG = 2,
- SVG_ANGLETYPE_RAD = 3,
- SVG_ANGLETYPE_GRAD = 4
- };
-
- SVGAngleType unitType() const { return m_unitType; }
+ enum SVGAngleType {
+ SVG_ANGLETYPE_UNKNOWN = 0,
+ SVG_ANGLETYPE_UNSPECIFIED = 1,
+ SVG_ANGLETYPE_DEG = 2,
+ SVG_ANGLETYPE_RAD = 3,
+ SVG_ANGLETYPE_GRAD = 4
+ };
- void setValue(float);
- float value() const { return m_value; }
+ SVGAngleType unitType() const { return m_unitType; }
- void setValueInSpecifiedUnits(float valueInSpecifiedUnits);
- float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; }
+ void setValue(float);
+ float value() const;
- void setValueAsString(const String&);
- String valueAsString() const;
+ void setValueInSpecifiedUnits(float valueInSpecifiedUnits) { m_valueInSpecifiedUnits = valueInSpecifiedUnits; }
+ float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; }
- void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits);
- void convertToSpecifiedUnits(unsigned short unitType);
+ void setValueAsString(const String&, ExceptionCode&);
+ String valueAsString() const;
- private:
- SVGAngleType m_unitType;
- float m_value;
- float m_valueInSpecifiedUnits;
- mutable String m_valueAsString;
+ void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits, ExceptionCode&);
+ void convertToSpecifiedUnits(unsigned short unitType, ExceptionCode&);
- void calculate();
- };
+private:
+ SVGAngleType m_unitType;
+ float m_valueInSpecifiedUnits;
+};
} // namespace WebCore
diff --git a/WebCore/svg/SVGAngle.idl b/WebCore/svg/SVGAngle.idl
index cb5148c..b36670a 100644
--- a/WebCore/svg/SVGAngle.idl
+++ b/WebCore/svg/SVGAngle.idl
@@ -22,22 +22,26 @@
module svg {
- interface [Conditional=SVG, PODType=SVGAngle] SVGAngle {
+ interface [Conditional=SVG] SVGAngle {
// Angle Unit Types
- const unsigned short SVG_ANGLETYPE_UNKNOWN = 0;
+ const unsigned short SVG_ANGLETYPE_UNKNOWN = 0;
const unsigned short SVG_ANGLETYPE_UNSPECIFIED = 1;
- const unsigned short SVG_ANGLETYPE_DEG = 2;
- const unsigned short SVG_ANGLETYPE_RAD = 3;
- const unsigned short SVG_ANGLETYPE_GRAD = 4;
-
+ const unsigned short SVG_ANGLETYPE_DEG = 2;
+ const unsigned short SVG_ANGLETYPE_RAD = 3;
+ const unsigned short SVG_ANGLETYPE_GRAD = 4;
+
readonly attribute unsigned short unitType;
- attribute float value;
- attribute float valueInSpecifiedUnits;
- attribute [ConvertNullToNullString] DOMString valueAsString;
-
- void newValueSpecifiedUnits(in unsigned short unitType,
- in float valueInSpecifiedUnits);
- void convertToSpecifiedUnits(in unsigned short unitType);
+ attribute [StrictTypeChecking] float value;
+ attribute [StrictTypeChecking] float valueInSpecifiedUnits;
+
+ attribute [ConvertNullToNullString] DOMString valueAsString
+ setter raises(DOMException);
+
+ void newValueSpecifiedUnits(in unsigned short unitType, in float valueInSpecifiedUnits)
+ raises(DOMException);
+
+ void convertToSpecifiedUnits(in unsigned short unitType)
+ raises(DOMException);
};
}
diff --git a/WebCore/svg/SVGAnimatedAngle.h b/WebCore/svg/SVGAnimatedAngle.h
new file mode 100644
index 0000000..bda7a36
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedAngle.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimatedAngle_h
+#define SVGAnimatedAngle_h
+
+#if ENABLE(SVG)
+#include "SVGAngle.h"
+#include "SVGAnimatedPropertyTearOff.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedPropertyTearOff<SVGAngle> SVGAnimatedAngle;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimatedBoolean.h b/WebCore/svg/SVGAnimatedBoolean.h
new file mode 100644
index 0000000..b316e21
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedBoolean.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimatedBoolean_h
+#define SVGAnimatedBoolean_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedStaticPropertyTearOff.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedStaticPropertyTearOff<bool> SVGAnimatedBoolean;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimatedBoolean.idl b/WebCore/svg/SVGAnimatedBoolean.idl
index e4b831e..2591c50 100644
--- a/WebCore/svg/SVGAnimatedBoolean.idl
+++ b/WebCore/svg/SVGAnimatedBoolean.idl
@@ -26,9 +26,8 @@
module svg {
interface [Conditional=SVG] SVGAnimatedBoolean {
- attribute boolean baseVal
- /*setter raises(DOMException)*/;
- readonly attribute boolean animVal;
+ attribute [StrictTypeChecking] boolean baseVal;
+ readonly attribute [StrictTypeChecking] boolean animVal;
};
}
diff --git a/WebCore/svg/SVGAnimatedEnumeration.h b/WebCore/svg/SVGAnimatedEnumeration.h
new file mode 100644
index 0000000..4e5f073
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedEnumeration.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimatedEnumeration_h
+#define SVGAnimatedEnumeration_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedStaticPropertyTearOff.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedStaticPropertyTearOff<int> SVGAnimatedEnumeration;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimatedEnumeration.idl b/WebCore/svg/SVGAnimatedEnumeration.idl
index 26d5064..8a9d3b4 100644
--- a/WebCore/svg/SVGAnimatedEnumeration.idl
+++ b/WebCore/svg/SVGAnimatedEnumeration.idl
@@ -26,8 +26,7 @@
module svg {
interface [Conditional=SVG] SVGAnimatedEnumeration {
- attribute unsigned short baseVal
- /*setter raises(DOMException)*/;
+ attribute unsigned short baseVal;
readonly attribute unsigned short animVal;
};
diff --git a/WebCore/svg/SVGAnimatedInteger.h b/WebCore/svg/SVGAnimatedInteger.h
new file mode 100644
index 0000000..6d1c85d
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedInteger.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimatedInteger_h
+#define SVGAnimatedInteger_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedStaticPropertyTearOff.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedStaticPropertyTearOff<long> SVGAnimatedInteger;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimatedLength.h b/WebCore/svg/SVGAnimatedLength.h
new file mode 100644
index 0000000..0504fd7
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedLength.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimatedLength_h
+#define SVGAnimatedLength_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedPropertyTearOff.h"
+#include "SVGLength.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedPropertyTearOff<SVGLength> SVGAnimatedLength;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimatedLengthList.h b/WebCore/svg/SVGAnimatedLengthList.h
new file mode 100644
index 0000000..fcd8197
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedLengthList.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimatedLengthList_h
+#define SVGAnimatedLengthList_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedListPropertyTearOff.h"
+#include "SVGLengthList.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedListPropertyTearOff<SVGLengthList> SVGAnimatedLengthList;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimatedRect.h b/WebCore/svg/SVGAnimatedRect.h
new file mode 100644
index 0000000..ee94352
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedRect.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimatedRect_h
+#define SVGAnimatedRect_h
+
+#if ENABLE(SVG)
+#include "FloatRect.h"
+#include "SVGAnimatedPropertyTearOff.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedPropertyTearOff<FloatRect> SVGAnimatedRect;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimationElement.h b/WebCore/svg/SVGAnimationElement.h
index da48dd6..2e11fe6 100644
--- a/WebCore/svg/SVGAnimationElement.h
+++ b/WebCore/svg/SVGAnimationElement.h
@@ -24,10 +24,10 @@
#ifndef SVGAnimationElement_h
#define SVGAnimationElement_h
#if ENABLE(SVG_ANIMATION)
-
#include "ElementTimeControl.h"
#include "Path.h"
#include "SMILTime.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGSMILElement.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGStringList.h"
@@ -106,7 +106,7 @@ namespace WebCore {
float calculatePercentForSpline(float percent, unsigned splineIndex) const;
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGAnimationElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGAnimationElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
bool m_animationValid;
diff --git a/WebCore/svg/SVGCircleElement.h b/WebCore/svg/SVGCircleElement.h
index 4eb9262..5c3a62f 100644
--- a/WebCore/svg/SVGCircleElement.h
+++ b/WebCore/svg/SVGCircleElement.h
@@ -22,6 +22,8 @@
#define SVGCircleElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -49,12 +51,12 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGCircleElement, SVGNames::cxAttr, SVGLength, Cx, cx)
- DECLARE_ANIMATED_PROPERTY(SVGCircleElement, SVGNames::cyAttr, SVGLength, Cy, cy)
- DECLARE_ANIMATED_PROPERTY(SVGCircleElement, SVGNames::rAttr, SVGLength, R, r)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGCircleElement, SVGNames::cxAttr, SVGLength, Cx, cx)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGCircleElement, SVGNames::cyAttr, SVGLength, Cy, cy)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGCircleElement, SVGNames::rAttr, SVGLength, R, r)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGCircleElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGCircleElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGClipPathElement.h b/WebCore/svg/SVGClipPathElement.h
index 7d8ada2..f28915a 100644
--- a/WebCore/svg/SVGClipPathElement.h
+++ b/WebCore/svg/SVGClipPathElement.h
@@ -22,7 +22,7 @@
#define SVGClipPathElement_h
#if ENABLE(SVG)
-#include "RenderObject.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -30,6 +30,8 @@
namespace WebCore {
+class RenderObject;
+
class SVGClipPathElement : public SVGStyledTransformableElement,
public SVGTests,
public SVGLangSpace,
@@ -50,10 +52,10 @@ private:
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
- DECLARE_ANIMATED_PROPERTY(SVGClipPathElement, SVGNames::clipPathUnitsAttr, int, ClipPathUnits, clipPathUnits)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGClipPathElement, SVGNames::clipPathUnitsAttr, int, ClipPathUnits, clipPathUnits)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGClipPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGClipPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
}
diff --git a/WebCore/svg/SVGComponentTransferFunctionElement.h b/WebCore/svg/SVGComponentTransferFunctionElement.h
index 8b888af..d46668b 100644
--- a/WebCore/svg/SVGComponentTransferFunctionElement.h
+++ b/WebCore/svg/SVGComponentTransferFunctionElement.h
@@ -22,8 +22,7 @@
#define SVGComponentTransferFunctionElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGElement.h"
-#include "SVGNames.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGNumberList.h"
#include "FEComponentTransfer.h"
@@ -40,7 +39,7 @@ namespace WebCore {
virtual void synchronizeProperty(const QualifiedName&);
private:
- DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::typeAttr, int, Type, type)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGComponentTransferFunctionElement, SVGNames::typeAttr, int, Type, type)
DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::tableValuesAttr, SVGNumberList*, TableValues, tableValues)
DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::slopeAttr, float, Slope, slope)
DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::interceptAttr, float, Intercept, intercept)
diff --git a/WebCore/svg/SVGCursorElement.h b/WebCore/svg/SVGCursorElement.h
index ce4d129..e09739a 100644
--- a/WebCore/svg/SVGCursorElement.h
+++ b/WebCore/svg/SVGCursorElement.h
@@ -22,7 +22,8 @@
#define SVGCursorElement_h
#if ENABLE(SVG)
-#include "SVGLength.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGElement.h"
#include "SVGTests.h"
#include "SVGURIReference.h"
@@ -53,14 +54,14 @@ namespace WebCore {
virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
- DECLARE_ANIMATED_PROPERTY(SVGCursorElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGCursorElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGCursorElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGCursorElement, SVGNames::yAttr, SVGLength, Y, y)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGCursorElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGCursorElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGCursorElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
HashSet<SVGElement*> m_clients;
};
diff --git a/WebCore/svg/SVGDefsElement.h b/WebCore/svg/SVGDefsElement.h
index 4a60bb5..ecf2d69 100644
--- a/WebCore/svg/SVGDefsElement.h
+++ b/WebCore/svg/SVGDefsElement.h
@@ -22,6 +22,7 @@
#define SVGDefsElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -45,7 +46,7 @@ namespace WebCore {
virtual void synchronizeProperty(const QualifiedName&);
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGDefsElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGDefsElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGElement.cpp b/WebCore/svg/SVGElement.cpp
index ea79e78..6c2c4a2 100644
--- a/WebCore/svg/SVGElement.cpp
+++ b/WebCore/svg/SVGElement.cpp
@@ -42,6 +42,8 @@
#include "SVGElementRareData.h"
#include "SVGNames.h"
#include "SVGSVGElement.h"
+#include "SVGStyledLocatableElement.h"
+#include "SVGTextElement.h"
#include "SVGURIReference.h"
#include "SVGUseElement.h"
#include "ScriptEventListener.h"
@@ -179,6 +181,19 @@ const HashSet<SVGElementInstance*>& SVGElement::instancesForElement() const
return rareSVGData()->elementInstances();
}
+bool SVGElement::boundingBox(FloatRect& rect, SVGLocatable::StyleUpdateStrategy styleUpdateStrategy) const
+{
+ if (isStyledLocatable()) {
+ rect = static_cast<const SVGStyledLocatableElement*>(this)->getBBox(styleUpdateStrategy);
+ return true;
+ }
+ if (hasTagName(SVGNames::textTag)) {
+ rect = static_cast<const SVGTextElement*>(this)->getBBox(styleUpdateStrategy);
+ return true;
+ }
+ return false;
+}
+
void SVGElement::setCursorElement(SVGCursorElement* cursorElement)
{
ensureRareSVGData()->setCursorElement(cursorElement);
diff --git a/WebCore/svg/SVGElement.h b/WebCore/svg/SVGElement.h
index 5681284..517515f 100644
--- a/WebCore/svg/SVGElement.h
+++ b/WebCore/svg/SVGElement.h
@@ -24,6 +24,7 @@
#if ENABLE(SVG)
#include "SVGDocumentExtensions.h"
+#include "SVGLocatable.h"
#include "StyledElement.h"
namespace WebCore {
@@ -71,6 +72,8 @@ namespace WebCore {
const HashSet<SVGElementInstance*>& instancesForElement() const;
+ bool boundingBox(FloatRect&, SVGLocatable::StyleUpdateStrategy = SVGLocatable::AllowStyleUpdate) const;
+
void setCursorElement(SVGCursorElement*);
void setCursorImageValue(CSSCursorImageValue*);
diff --git a/WebCore/svg/SVGEllipseElement.h b/WebCore/svg/SVGEllipseElement.h
index cad329e..3bd7a50 100644
--- a/WebCore/svg/SVGEllipseElement.h
+++ b/WebCore/svg/SVGEllipseElement.h
@@ -22,6 +22,8 @@
#define SVGEllipseElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -49,13 +51,13 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGEllipseElement, SVGNames::cxAttr, SVGLength, Cx, cx)
- DECLARE_ANIMATED_PROPERTY(SVGEllipseElement, SVGNames::cyAttr, SVGLength, Cy, cy)
- DECLARE_ANIMATED_PROPERTY(SVGEllipseElement, SVGNames::rxAttr, SVGLength, Rx, rx)
- DECLARE_ANIMATED_PROPERTY(SVGEllipseElement, SVGNames::ryAttr, SVGLength, Ry, ry)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGEllipseElement, SVGNames::cxAttr, SVGLength, Cx, cx)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGEllipseElement, SVGNames::cyAttr, SVGLength, Cy, cy)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGEllipseElement, SVGNames::rxAttr, SVGLength, Rx, rx)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGEllipseElement, SVGNames::ryAttr, SVGLength, Ry, ry)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGEllipseElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGEllipseElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGExternalResourcesRequired.cpp b/WebCore/svg/SVGExternalResourcesRequired.cpp
index c976b0f..beae203 100644
--- a/WebCore/svg/SVGExternalResourcesRequired.cpp
+++ b/WebCore/svg/SVGExternalResourcesRequired.cpp
@@ -24,6 +24,7 @@
#include "SVGExternalResourcesRequired.h"
#include "Attr.h"
+#include "SVGNames.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGExternalResourcesRequired.h b/WebCore/svg/SVGExternalResourcesRequired.h
index 5f0d8e9..7a37267 100644
--- a/WebCore/svg/SVGExternalResourcesRequired.h
+++ b/WebCore/svg/SVGExternalResourcesRequired.h
@@ -22,28 +22,26 @@
#define SVGExternalResourcesRequired_h
#if ENABLE(SVG)
-#include "SVGElement.h"
-#include "SVGNames.h"
-
namespace WebCore {
- class Attribute;
+class Attribute;
+class QualifiedName;
- // Notes on a SVG 1.1 spec discrepancy:
- // The SVG DOM defines the attribute externalResourcesRequired as being of type SVGAnimatedBoolean, whereas the
- // SVG language definition says that externalResourcesRequired is not animated. Because the SVG language definition
- // states that externalResourcesRequired cannot be animated, the animVal will always be the same as the baseVal.
- // FIXME: When implementing animVal support, make sure that animVal==baseVal for externalResourcesRequired
- class SVGExternalResourcesRequired {
- public:
- virtual ~SVGExternalResourcesRequired() { }
+// Notes on a SVG 1.1 spec discrepancy:
+// The SVG DOM defines the attribute externalResourcesRequired as being of type SVGAnimatedBoolean, whereas the
+// SVG language definition says that externalResourcesRequired is not animated. Because the SVG language definition
+// states that externalResourcesRequired cannot be animated, the animVal will always be the same as the baseVal.
+// FIXME: When implementing animVal support, make sure that animVal==baseVal for externalResourcesRequired
+class SVGExternalResourcesRequired {
+public:
+ virtual ~SVGExternalResourcesRequired() { }
- bool parseMappedAttribute(Attribute*);
- bool isKnownAttribute(const QualifiedName&);
+ bool parseMappedAttribute(Attribute*);
+ bool isKnownAttribute(const QualifiedName&);
- protected:
- virtual void setExternalResourcesRequiredBaseValue(DeprecatedSVGAnimatedPropertyTraits<bool>::PassType) = 0;
- };
+protected:
+ virtual void setExternalResourcesRequiredBaseValue(const bool&) = 0;
+};
} // namespace WebCore
diff --git a/WebCore/svg/SVGFEBlendElement.h b/WebCore/svg/SVGFEBlendElement.h
index c8c5deb..a0010be 100644
--- a/WebCore/svg/SVGFEBlendElement.h
+++ b/WebCore/svg/SVGFEBlendElement.h
@@ -40,7 +40,7 @@ private:
DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::inAttr, String, In1, in1)
DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::in2Attr, String, In2, in2)
- DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::modeAttr, int, Mode, mode)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEBlendElement, SVGNames::modeAttr, int, Mode, mode)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGFEColorMatrixElement.h b/WebCore/svg/SVGFEColorMatrixElement.h
index 5d626a2..5ec301f 100644
--- a/WebCore/svg/SVGFEColorMatrixElement.h
+++ b/WebCore/svg/SVGFEColorMatrixElement.h
@@ -41,7 +41,7 @@ private:
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::inAttr, String, In1, in1)
- DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::typeAttr, int, Type, type)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEColorMatrixElement, SVGNames::typeAttr, int, Type, type)
DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::valuesAttr, SVGNumberList*, Values, values)
};
diff --git a/WebCore/svg/SVGFECompositeElement.h b/WebCore/svg/SVGFECompositeElement.h
index 6d47cac..95443e4 100644
--- a/WebCore/svg/SVGFECompositeElement.h
+++ b/WebCore/svg/SVGFECompositeElement.h
@@ -41,7 +41,7 @@ private:
DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::inAttr, String, In1, in1)
DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::in2Attr, String, In2, in2)
- DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::operatorAttr, int, _operator, _operator)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFECompositeElement, SVGNames::operatorAttr, int, _operator, _operator)
DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k1Attr, float, K1, k1)
DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k2Attr, float, K2, k2)
DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k3Attr, float, K3, k3)
diff --git a/WebCore/svg/SVGFEConvolveMatrixElement.h b/WebCore/svg/SVGFEConvolveMatrixElement.h
index 5c4e8c4..cb31949 100644
--- a/WebCore/svg/SVGFEConvolveMatrixElement.h
+++ b/WebCore/svg/SVGFEConvolveMatrixElement.h
@@ -42,17 +42,17 @@ private:
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::inAttr, String, In1, in1)
- DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::orderXAttr, long, OrderX, orderX)
- DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::orderYAttr, long, OrderY, orderY)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::orderXAttr, long, OrderX, orderX)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::orderYAttr, long, OrderY, orderY)
DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::kernelMatrixAttr, SVGNumberList*, KernelMatrix, kernelMatrix)
DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::divisorAttr, float, Divisor, divisor)
DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::biasAttr, float, Bias, bias)
- DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::targetXAttr, long, TargetX, targetX)
- DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::targetYAttr, long, TargetY, targetY)
- DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::operatorAttr, int, EdgeMode, edgeMode)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::targetXAttr, long, TargetX, targetX)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::targetYAttr, long, TargetY, targetY)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::operatorAttr, int, EdgeMode, edgeMode)
DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthXIdentifier, float, KernelUnitLengthX, kernelUnitLengthX)
DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthYIdentifier, float, KernelUnitLengthY, kernelUnitLengthY)
- DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::preserveAlphaAttr, bool, PreserveAlpha, preserveAlpha)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::preserveAlphaAttr, bool, PreserveAlpha, preserveAlpha)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
index d2e15f8..ccdf8a0 100644
--- a/WebCore/svg/SVGFEDiffuseLightingElement.cpp
+++ b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
@@ -32,9 +32,6 @@
namespace WebCore {
-char SVGKernelUnitLengthXIdentifier[] = "SVGKernelUnitLengthX";
-char SVGKernelUnitLengthYIdentifier[] = "SVGKernelUnitLengthY";
-
inline SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const QualifiedName& tagName, Document* document)
: SVGFilterPrimitiveStandardAttributes(tagName, document)
, m_diffuseConstant(1)
@@ -47,6 +44,18 @@ PassRefPtr<SVGFEDiffuseLightingElement> SVGFEDiffuseLightingElement::create(cons
return adoptRef(new SVGFEDiffuseLightingElement(tagName, document));
}
+const AtomicString& SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthX"));
+ return s_identifier;
+}
+
+const AtomicString& SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthY"));
+ return s_identifier;
+}
+
void SVGFEDiffuseLightingElement::parseMappedAttribute(Attribute* attr)
{
const String& value = attr->value();
diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.h b/WebCore/svg/SVGFEDiffuseLightingElement.h
index e0dbfc4..b8f56a6 100644
--- a/WebCore/svg/SVGFEDiffuseLightingElement.h
+++ b/WebCore/svg/SVGFEDiffuseLightingElement.h
@@ -28,9 +28,6 @@
namespace WebCore {
-extern char SVGKernelUnitLengthXIdentifier[];
-extern char SVGKernelUnitLengthYIdentifier[];
-
class FEDiffuseLighting;
class SVGColor;
@@ -46,11 +43,14 @@ private:
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+ static const AtomicString& kernelUnitLengthXIdentifier();
+ static const AtomicString& kernelUnitLengthYIdentifier();
+
DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::inAttr, String, In1, in1)
DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::diffuseConstantAttr, float, DiffuseConstant, diffuseConstant)
DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthXIdentifier, float, KernelUnitLengthX, kernelUnitLengthX)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthYIdentifier, float, KernelUnitLengthY, kernelUnitLengthY)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), float, KernelUnitLengthX, kernelUnitLengthX)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), float, KernelUnitLengthY, kernelUnitLengthY)
PassRefPtr<LightSource> findLights() const;
};
diff --git a/WebCore/svg/SVGFEDisplacementMapElement.h b/WebCore/svg/SVGFEDisplacementMapElement.h
index 21fd83f..c42783c 100644
--- a/WebCore/svg/SVGFEDisplacementMapElement.h
+++ b/WebCore/svg/SVGFEDisplacementMapElement.h
@@ -41,8 +41,8 @@ private:
DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::inAttr, String, In1, in1)
DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::in2Attr, String, In2, in2)
- DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::xChannelSelectorAttr, int, XChannelSelector, xChannelSelector)
- DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, int, YChannelSelector, yChannelSelector)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDisplacementMapElement, SVGNames::xChannelSelectorAttr, int, XChannelSelector, xChannelSelector)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, int, YChannelSelector, yChannelSelector)
DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::scaleAttr, float, Scale, scale)
};
diff --git a/WebCore/svg/SVGFEGaussianBlurElement.cpp b/WebCore/svg/SVGFEGaussianBlurElement.cpp
index a9fef61..e307a8ea 100644
--- a/WebCore/svg/SVGFEGaussianBlurElement.cpp
+++ b/WebCore/svg/SVGFEGaussianBlurElement.cpp
@@ -29,9 +29,6 @@
namespace WebCore {
-char SVGStdDeviationXAttrIdentifier[] = "SVGStdDeviationXAttr";
-char SVGStdDeviationYAttrIdentifier[] = "SVGStdDeviationYAttr";
-
inline SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(const QualifiedName& tagName, Document* document)
: SVGFilterPrimitiveStandardAttributes(tagName, document)
{
@@ -42,6 +39,18 @@ PassRefPtr<SVGFEGaussianBlurElement> SVGFEGaussianBlurElement::create(const Qual
return adoptRef(new SVGFEGaussianBlurElement(tagName, document));
}
+const AtomicString& SVGFEGaussianBlurElement::stdDeviationXIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGStdDeviationX"));
+ return s_identifier;
+}
+
+const AtomicString& SVGFEGaussianBlurElement::stdDeviationYIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGStdDeviationY"));
+ return s_identifier;
+}
+
void SVGFEGaussianBlurElement::setStdDeviation(float x, float y)
{
setStdDeviationXBaseValue(x);
diff --git a/WebCore/svg/SVGFEGaussianBlurElement.h b/WebCore/svg/SVGFEGaussianBlurElement.h
index 90f956c..d1579a5 100644
--- a/WebCore/svg/SVGFEGaussianBlurElement.h
+++ b/WebCore/svg/SVGFEGaussianBlurElement.h
@@ -27,9 +27,6 @@
namespace WebCore {
-extern char SVGStdDeviationXAttrIdentifier[];
-extern char SVGStdDeviationYAttrIdentifier[];
-
class SVGFEGaussianBlurElement : public SVGFilterPrimitiveStandardAttributes {
public:
static PassRefPtr<SVGFEGaussianBlurElement> create(const QualifiedName&, Document*);
@@ -44,9 +41,12 @@ private:
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+ static const AtomicString& stdDeviationXIdentifier();
+ static const AtomicString& stdDeviationYIdentifier();
+
DECLARE_ANIMATED_PROPERTY(SVGFEGaussianBlurElement, SVGNames::inAttr, String, In1, in1)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, SVGStdDeviationXAttrIdentifier, float, StdDeviationX, stdDeviationX)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, SVGStdDeviationYAttrIdentifier, float, StdDeviationY, stdDeviationY)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationXIdentifier(), float, StdDeviationX, stdDeviationX)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationYIdentifier(), float, StdDeviationY, stdDeviationY)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGFEImageElement.h b/WebCore/svg/SVGFEImageElement.h
index b5fad48..901cb19 100644
--- a/WebCore/svg/SVGFEImageElement.h
+++ b/WebCore/svg/SVGFEImageElement.h
@@ -62,7 +62,7 @@ private:
DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEImageElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
CachedResourceHandle<CachedImage> m_cachedImage;
OwnPtr<ImageBuffer> m_targetImage;
diff --git a/WebCore/svg/SVGFEMorphologyElement.h b/WebCore/svg/SVGFEMorphologyElement.h
index 6bbc20c..671e7f0 100644
--- a/WebCore/svg/SVGFEMorphologyElement.h
+++ b/WebCore/svg/SVGFEMorphologyElement.h
@@ -43,8 +43,11 @@ private:
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+ static const AtomicString& radiusXIdentifier();
+ static const AtomicString& radiusYIdentifier();
+
DECLARE_ANIMATED_PROPERTY(SVGFEMorphologyElement, SVGNames::inAttr, String, In1, in1)
- DECLARE_ANIMATED_PROPERTY(SVGFEMorphologyElement, SVGNames::operatorAttr, int, _operator, _operator)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEMorphologyElement, SVGNames::operatorAttr, int, _operator, _operator)
DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, SVGRadiusXAttrIdentifier, float, RadiusX, radiusX)
DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, SVGRadiusYAttrIdentifier, float, RadiusY, radiusY)
};
diff --git a/WebCore/svg/SVGFESpecularLightingElement.cpp b/WebCore/svg/SVGFESpecularLightingElement.cpp
index 1647525..949b183 100644
--- a/WebCore/svg/SVGFESpecularLightingElement.cpp
+++ b/WebCore/svg/SVGFESpecularLightingElement.cpp
@@ -45,6 +45,18 @@ PassRefPtr<SVGFESpecularLightingElement> SVGFESpecularLightingElement::create(co
return adoptRef(new SVGFESpecularLightingElement(tagName, document));
}
+const AtomicString& SVGFESpecularLightingElement::kernelUnitLengthXIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthX"));
+ return s_identifier;
+}
+
+const AtomicString& SVGFESpecularLightingElement::kernelUnitLengthYIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthY"));
+ return s_identifier;
+}
+
void SVGFESpecularLightingElement::parseMappedAttribute(Attribute* attr)
{
const String& value = attr->value();
diff --git a/WebCore/svg/SVGFESpecularLightingElement.h b/WebCore/svg/SVGFESpecularLightingElement.h
index 378bc49..82093eb 100644
--- a/WebCore/svg/SVGFESpecularLightingElement.h
+++ b/WebCore/svg/SVGFESpecularLightingElement.h
@@ -28,9 +28,6 @@
namespace WebCore {
-extern char SVGKernelUnitLengthXIdentifier[];
-extern char SVGKernelUnitLengthYIdentifier[];
-
class SVGFESpecularLightingElement : public SVGFilterPrimitiveStandardAttributes {
public:
static PassRefPtr<SVGFESpecularLightingElement> create(const QualifiedName&, Document*);
@@ -42,12 +39,15 @@ private:
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+ static const AtomicString& kernelUnitLengthXIdentifier();
+ static const AtomicString& kernelUnitLengthYIdentifier();
+
DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::inAttr, String, In1, in1)
DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::specularConstantAttr, float, SpecularConstant, specularConstant)
DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::specularExponentAttr, float, SpecularExponent, specularExponent)
DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthXIdentifier, float, KernelUnitLengthX, kernelUnitLengthX)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthYIdentifier, float, KernelUnitLengthY, kernelUnitLengthY)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), float, KernelUnitLengthX, kernelUnitLengthX)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), float, KernelUnitLengthY, kernelUnitLengthY)
PassRefPtr<LightSource> findLights() const;
};
diff --git a/WebCore/svg/SVGFETurbulenceElement.cpp b/WebCore/svg/SVGFETurbulenceElement.cpp
index 5339e02..7a4d7d4 100644
--- a/WebCore/svg/SVGFETurbulenceElement.cpp
+++ b/WebCore/svg/SVGFETurbulenceElement.cpp
@@ -28,9 +28,6 @@
namespace WebCore {
-char SVGBaseFrequencyXIdentifier[] = "SVGBaseFrequencyX";
-char SVGBaseFrequencyYIdentifier[] = "SVGBaseFrequencyY";
-
inline SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagName, Document* document)
: SVGFilterPrimitiveStandardAttributes(tagName, document)
, m_numOctaves(1)
@@ -44,6 +41,18 @@ PassRefPtr<SVGFETurbulenceElement> SVGFETurbulenceElement::create(const Qualifie
return adoptRef(new SVGFETurbulenceElement(tagName, document));
}
+const AtomicString& SVGFETurbulenceElement::baseFrequencyXIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGBaseFrequencyX"));
+ return s_identifier;
+}
+
+const AtomicString& SVGFETurbulenceElement::baseFrequencyYIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGBaseFrequencyY"));
+ return s_identifier;
+}
+
void SVGFETurbulenceElement::parseMappedAttribute(Attribute* attr)
{
const String& value = attr->value();
diff --git a/WebCore/svg/SVGFETurbulenceElement.h b/WebCore/svg/SVGFETurbulenceElement.h
index 20e9ed6..cbe0643 100644
--- a/WebCore/svg/SVGFETurbulenceElement.h
+++ b/WebCore/svg/SVGFETurbulenceElement.h
@@ -27,9 +27,6 @@
namespace WebCore {
-extern char SVGBaseFrequencyXIdentifier[];
-extern char SVGBaseFrequencyYIdentifier[];
-
enum SVGStitchOptions {
SVG_STITCHTYPE_UNKNOWN = 0,
SVG_STITCHTYPE_STITCH = 1,
@@ -48,12 +45,15 @@ private:
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, SVGBaseFrequencyXIdentifier, float, BaseFrequencyX, baseFrequencyX)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, SVGBaseFrequencyYIdentifier, float, BaseFrequencyY, baseFrequencyY)
- DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::numOctavesAttr, long, NumOctaves, numOctaves)
+ static const AtomicString& baseFrequencyXIdentifier();
+ static const AtomicString& baseFrequencyYIdentifier();
+
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, baseFrequencyXIdentifier(), float, BaseFrequencyX, baseFrequencyX)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, baseFrequencyYIdentifier(), float, BaseFrequencyY, baseFrequencyY)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFETurbulenceElement, SVGNames::numOctavesAttr, long, NumOctaves, numOctaves)
DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::seedAttr, float, Seed, seed)
- DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::stitchTilesAttr, int, StitchTiles, stitchTiles)
- DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::typeAttr, int, Type, type)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFETurbulenceElement, SVGNames::stitchTilesAttr, int, StitchTiles, stitchTiles)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFETurbulenceElement, SVGNames::typeAttr, int, Type, type)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGFilterElement.cpp b/WebCore/svg/SVGFilterElement.cpp
index 3418b9d..8c56c46 100644
--- a/WebCore/svg/SVGFilterElement.cpp
+++ b/WebCore/svg/SVGFilterElement.cpp
@@ -39,9 +39,6 @@
namespace WebCore {
-char SVGFilterResXIdentifier[] = "SVGFilterResX";
-char SVGFilterResYIdentifier[] = "SVGFilterResY";
-
inline SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document* document)
: SVGStyledElement(tagName, document)
, SVGURIReference()
@@ -63,6 +60,18 @@ PassRefPtr<SVGFilterElement> SVGFilterElement::create(const QualifiedName& tagNa
return adoptRef(new SVGFilterElement(tagName, document));
}
+const AtomicString& SVGFilterElement::filterResXIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGFilterResX"));
+ return s_identifier;
+}
+
+const AtomicString& SVGFilterElement::filterResYIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGFilterResY"));
+ return s_identifier;
+}
+
void SVGFilterElement::setFilterRes(unsigned long filterResX, unsigned long filterResY)
{
setFilterResXBaseValue(filterResX);
diff --git a/WebCore/svg/SVGFilterElement.h b/WebCore/svg/SVGFilterElement.h
index c228fe7..ce9f75e 100644
--- a/WebCore/svg/SVGFilterElement.h
+++ b/WebCore/svg/SVGFilterElement.h
@@ -24,6 +24,8 @@
#define SVGFilterElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "RenderObject.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
@@ -32,9 +34,6 @@
namespace WebCore {
-extern char SVGFilterResXIdentifier[];
-extern char SVGFilterResYIdentifier[];
-
class SVGFilterElement : public SVGStyledElement,
public SVGURIReference,
public SVGLangSpace,
@@ -59,20 +58,24 @@ private:
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::filterUnitsAttr, int, FilterUnits, filterUnits)
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::primitiveUnitsAttr, int, PrimitiveUnits, primitiveUnits)
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::heightAttr, SVGLength, Height, height)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFilterElement, SVGNames::filterResAttr, SVGFilterResXIdentifier, long, FilterResX, filterResX)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFilterElement, SVGNames::filterResAttr, SVGFilterResYIdentifier, long, FilterResY, filterResY)
+ static const AtomicString& filterResXIdentifier();
+ static const AtomicString& filterResYIdentifier();
+
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFilterElement, SVGNames::filterUnitsAttr, int, FilterUnits, filterUnits)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFilterElement, SVGNames::primitiveUnitsAttr, int, PrimitiveUnits, primitiveUnits)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterElement, SVGNames::heightAttr, SVGLength, Height, height)
+
+ DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFilterElement, SVGNames::filterResAttr, filterResXIdentifier(), long, FilterResX, filterResX)
+ DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFilterElement, SVGNames::filterResAttr, filterResYIdentifier(), long, FilterResY, filterResY)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGFilterElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFilterElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
}
diff --git a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
index 0ffa1c9..6202888 100644
--- a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
+++ b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
@@ -24,6 +24,8 @@
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "FilterEffect.h"
#include "RenderSVGResource.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGFilterBuilder.h"
#include "SVGFilterElement.h"
#include "SVGNames.h"
@@ -60,10 +62,10 @@ private:
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
- DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::heightAttr, SVGLength, Height, height)
DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::resultAttr, String, Result, result)
};
diff --git a/WebCore/svg/SVGFitToViewBox.h b/WebCore/svg/SVGFitToViewBox.h
index ecc89bb..df41fce 100644
--- a/WebCore/svg/SVGFitToViewBox.h
+++ b/WebCore/svg/SVGFitToViewBox.h
@@ -39,7 +39,7 @@ public:
bool parseMappedAttribute(Document*, Attribute*);
bool isKnownAttribute(const QualifiedName&);
- virtual void setViewBoxBaseValue(DeprecatedSVGAnimatedPropertyTraits<FloatRect>::PassType) = 0;
+ virtual void setViewBoxBaseValue(const FloatRect&) = 0;
virtual void setPreserveAspectRatioBaseValue(DeprecatedSVGAnimatedPropertyTraits<SVGPreserveAspectRatio>::PassType) = 0;
private:
diff --git a/WebCore/svg/SVGFontElement.h b/WebCore/svg/SVGFontElement.h
index 98bf766..e81ac61 100644
--- a/WebCore/svg/SVGFontElement.h
+++ b/WebCore/svg/SVGFontElement.h
@@ -23,6 +23,7 @@
#define SVGFontElement_h
#if ENABLE(SVG_FONTS)
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGGlyphElement.h"
#include "SVGGlyphMap.h"
@@ -74,7 +75,7 @@ private:
void ensureGlyphCache() const;
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGFontElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFontElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
mutable KerningPairVector m_horizontalKerningPairs;
mutable KerningPairVector m_verticalKerningPairs;
diff --git a/WebCore/svg/SVGFontFaceElement.cpp b/WebCore/svg/SVGFontFaceElement.cpp
index 4884074..0c74d08 100644
--- a/WebCore/svg/SVGFontFaceElement.cpp
+++ b/WebCore/svg/SVGFontFaceElement.cpp
@@ -288,7 +288,7 @@ void SVGFontFaceElement::rebuildFontFace()
list = srcElement->srcValue();
}
- if (!list)
+ if (!list || !list->length())
return;
// Parse in-memory CSS rules
diff --git a/WebCore/svg/SVGFontFaceSrcElement.cpp b/WebCore/svg/SVGFontFaceSrcElement.cpp
index 891ddcd..e003944 100644
--- a/WebCore/svg/SVGFontFaceSrcElement.cpp
+++ b/WebCore/svg/SVGFontFaceSrcElement.cpp
@@ -47,10 +47,13 @@ PassRefPtr<CSSValueList> SVGFontFaceSrcElement::srcValue() const
{
RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
for (Node* child = firstChild(); child; child = child->nextSibling()) {
+ RefPtr<CSSFontFaceSrcValue> srcValue;
if (child->hasTagName(font_face_uriTag))
- list->append(static_cast<SVGFontFaceUriElement*>(child)->srcValue());
+ srcValue = static_cast<SVGFontFaceUriElement*>(child)->srcValue();
else if (child->hasTagName(font_face_nameTag))
- list->append(static_cast<SVGFontFaceNameElement*>(child)->srcValue());
+ srcValue = static_cast<SVGFontFaceNameElement*>(child)->srcValue();
+ if (srcValue && srcValue->resource().length())
+ list->append(srcValue);
}
return list;
}
diff --git a/WebCore/svg/SVGForeignObjectElement.h b/WebCore/svg/SVGForeignObjectElement.h
index a587134..55ddb3c 100644
--- a/WebCore/svg/SVGForeignObjectElement.h
+++ b/WebCore/svg/SVGForeignObjectElement.h
@@ -21,6 +21,8 @@
#define SVGForeignObjectElement_h
#if ENABLE(SVG) && ENABLE(SVG_FOREIGN_OBJECT)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGTests.h"
#include "SVGLangSpace.h"
#include "SVGURIReference.h"
@@ -50,16 +52,16 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGForeignObjectElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGForeignObjectElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGForeignObjectElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGForeignObjectElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::heightAttr, SVGLength, Height, height)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGForeignObjectElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGForeignObjectElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGGElement.h b/WebCore/svg/SVGGElement.h
index b47eaba..b0003d1 100644
--- a/WebCore/svg/SVGGElement.h
+++ b/WebCore/svg/SVGGElement.h
@@ -22,6 +22,7 @@
#define SVGGElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -53,7 +54,7 @@ namespace WebCore {
virtual bool rendererIsNeeded(RenderStyle*);
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGGElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGGElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGGradientElement.h b/WebCore/svg/SVGGradientElement.h
index d1e7914..fdfb72c 100644
--- a/WebCore/svg/SVGGradientElement.h
+++ b/WebCore/svg/SVGGradientElement.h
@@ -23,6 +23,7 @@
#if ENABLE(SVG)
#include "Gradient.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGStyledElement.h"
#include "SVGTransformList.h"
@@ -48,15 +49,15 @@ namespace WebCore {
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
- DECLARE_ANIMATED_PROPERTY(SVGGradientElement, SVGNames::spreadMethodAttr, int, SpreadMethod, spreadMethod)
- DECLARE_ANIMATED_PROPERTY(SVGGradientElement, SVGNames::gradientUnitsAttr, int, GradientUnits, gradientUnits)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGGradientElement, SVGNames::spreadMethodAttr, int, SpreadMethod, spreadMethod)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGGradientElement, SVGNames::gradientUnitsAttr, int, GradientUnits, gradientUnits)
DECLARE_ANIMATED_PROPERTY(SVGGradientElement, SVGNames::gradientTransformAttr, SVGTransformList*, GradientTransform, gradientTransform)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGGradientElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGGradientElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGGradientElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGImageElement.h b/WebCore/svg/SVGImageElement.h
index 9024415..ee105d2 100644
--- a/WebCore/svg/SVGImageElement.h
+++ b/WebCore/svg/SVGImageElement.h
@@ -22,6 +22,8 @@
#define SVGImageElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGImageLoader.h"
@@ -64,17 +66,17 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
virtual void willMoveToNewOwnerDocument();
- DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGImageElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGImageElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGImageElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGImageElement, SVGNames::heightAttr, SVGLength, Height, height)
DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGImageElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGImageElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
SVGImageLoader m_imageLoader;
};
diff --git a/WebCore/svg/SVGLength.idl b/WebCore/svg/SVGLength.idl
index d1cb572..166019e 100644
--- a/WebCore/svg/SVGLength.idl
+++ b/WebCore/svg/SVGLength.idl
@@ -22,7 +22,7 @@
module svg {
- interface [Conditional=SVG, PODType=SVGLength] SVGLength {
+ interface [Conditional=SVG] SVGLength {
// Length Unit Types
const unsigned short SVG_LENGTHTYPE_UNKNOWN = 0;
const unsigned short SVG_LENGTHTYPE_NUMBER = 1;
diff --git a/WebCore/svg/SVGLengthList.cpp b/WebCore/svg/SVGLengthList.cpp
index 2149e04..3ab7c1a 100644
--- a/WebCore/svg/SVGLengthList.cpp
+++ b/WebCore/svg/SVGLengthList.cpp
@@ -24,18 +24,13 @@
#include "SVGLengthList.h"
#include "SVGParserUtilities.h"
+#include <wtf/text/StringBuilder.h>
namespace WebCore {
-SVGLengthList::SVGLengthList(const QualifiedName& attributeName)
- : SVGPODList<SVGLength>(attributeName)
-{
-}
-
void SVGLengthList::parse(const String& value, SVGLengthMode mode)
{
- ExceptionCode ec = 0;
- clear(ec);
+ clear();
const UChar* ptr = value.characters();
const UChar* end = ptr + value.length();
@@ -48,25 +43,24 @@ void SVGLengthList::parse(const String& value, SVGLengthMode mode)
SVGLength length(mode);
if (!length.setValueAsString(String(start, ptr - start)))
return;
- appendItem(length, ec);
+ append(length);
skipOptionalSpacesOrDelimiter(ptr, end);
}
}
String SVGLengthList::valueAsString() const
{
- String result;
+ StringBuilder builder;
- ExceptionCode ec = 0;
- for (unsigned int i = 0; i < numberOfItems(); ++i) {
+ unsigned size = this->size();
+ for (unsigned i = 0; i < size; ++i) {
if (i > 0)
- result += ", ";
+ builder.append(", ");
- result += getItem(i, ec).valueAsString();
- ASSERT(ec == 0);
+ builder.append(at(i).valueAsString());
}
- return result;
+ return builder.toString();
}
}
diff --git a/WebCore/svg/SVGLengthList.h b/WebCore/svg/SVGLengthList.h
index 27b958f..8b08557 100644
--- a/WebCore/svg/SVGLengthList.h
+++ b/WebCore/svg/SVGLengthList.h
@@ -23,21 +23,17 @@
#if ENABLE(SVG)
#include "SVGLength.h"
-#include "SVGList.h"
+#include <wtf/Vector.h>
namespace WebCore {
- class SVGLengthList : public SVGPODList<SVGLength> {
- public:
- static PassRefPtr<SVGLengthList> create(const QualifiedName& attributeName) { return adoptRef(new SVGLengthList(attributeName)); }
+class SVGLengthList : public Vector<SVGLength> {
+public:
+ SVGLengthList() { }
- void parse(const String& value, SVGLengthMode);
-
- String valueAsString() const;
-
- private:
- SVGLengthList(const QualifiedName&);
- };
+ void parse(const String& value, SVGLengthMode);
+ String valueAsString() const;
+};
} // namespace WebCore
diff --git a/WebCore/svg/SVGLengthList.idl b/WebCore/svg/SVGLengthList.idl
index a5771d2..73a8d21 100644
--- a/WebCore/svg/SVGLengthList.idl
+++ b/WebCore/svg/SVGLengthList.idl
@@ -26,7 +26,7 @@
module svg {
- interface [Conditional=SVG] SVGLengthList {
+ interface [Conditional=SVG, SVGListProperty=SVGLengthList] SVGLengthList {
readonly attribute unsigned long numberOfItems;
void clear()
diff --git a/WebCore/svg/SVGLineElement.h b/WebCore/svg/SVGLineElement.h
index 55a268c..4e876e1 100644
--- a/WebCore/svg/SVGLineElement.h
+++ b/WebCore/svg/SVGLineElement.h
@@ -22,6 +22,8 @@
#define SVGLineElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -53,13 +55,13 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGLineElement, SVGNames::x1Attr, SVGLength, X1, x1)
- DECLARE_ANIMATED_PROPERTY(SVGLineElement, SVGNames::y1Attr, SVGLength, Y1, y1)
- DECLARE_ANIMATED_PROPERTY(SVGLineElement, SVGNames::x2Attr, SVGLength, X2, x2)
- DECLARE_ANIMATED_PROPERTY(SVGLineElement, SVGNames::y2Attr, SVGLength, Y2, y2)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLineElement, SVGNames::x1Attr, SVGLength, X1, x1)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLineElement, SVGNames::y1Attr, SVGLength, Y1, y1)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLineElement, SVGNames::x2Attr, SVGLength, X2, x2)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLineElement, SVGNames::y2Attr, SVGLength, Y2, y2)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGLineElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGLineElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGLinearGradientElement.h b/WebCore/svg/SVGLinearGradientElement.h
index 86bebf3..4ebe9f6 100644
--- a/WebCore/svg/SVGLinearGradientElement.h
+++ b/WebCore/svg/SVGLinearGradientElement.h
@@ -22,6 +22,8 @@
#define SVGLinearGradientElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGGradientElement.h"
namespace WebCore {
@@ -47,10 +49,10 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGLinearGradientElement, SVGNames::x1Attr, SVGLength, X1, x1)
- DECLARE_ANIMATED_PROPERTY(SVGLinearGradientElement, SVGNames::y1Attr, SVGLength, Y1, y1)
- DECLARE_ANIMATED_PROPERTY(SVGLinearGradientElement, SVGNames::x2Attr, SVGLength, X2, x2)
- DECLARE_ANIMATED_PROPERTY(SVGLinearGradientElement, SVGNames::y2Attr, SVGLength, Y2, y2)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLinearGradientElement, SVGNames::x1Attr, SVGLength, X1, x1)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLinearGradientElement, SVGNames::y1Attr, SVGLength, Y1, y1)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLinearGradientElement, SVGNames::x2Attr, SVGLength, X2, x2)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLinearGradientElement, SVGNames::y2Attr, SVGLength, Y2, y2)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGMPathElement.h b/WebCore/svg/SVGMPathElement.h
index 1bbe7d3..c025cf9 100644
--- a/WebCore/svg/SVGMPathElement.h
+++ b/WebCore/svg/SVGMPathElement.h
@@ -21,8 +21,9 @@
#define SVGMPathElement_h
#if ENABLE(SVG)
-#include "SVGURIReference.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
+#include "SVGURIReference.h"
namespace WebCore {
@@ -46,7 +47,7 @@ namespace WebCore {
DECLARE_ANIMATED_PROPERTY(SVGMPathElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGMPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGMPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGMarkerElement.cpp b/WebCore/svg/SVGMarkerElement.cpp
index 4ff420d..ef2b3dd 100644
--- a/WebCore/svg/SVGMarkerElement.cpp
+++ b/WebCore/svg/SVGMarkerElement.cpp
@@ -35,9 +35,6 @@
namespace WebCore {
-char SVGOrientTypeAttrIdentifier[] = "SVGOrientTypeAttr";
-char SVGOrientAngleAttrIdentifier[] = "SVGOrientAngleAttr";
-
SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document* document)
: SVGStyledElement(tagName, document)
, m_refX(LengthModeWidth)
@@ -55,6 +52,18 @@ PassRefPtr<SVGMarkerElement> SVGMarkerElement::create(const QualifiedName& tagNa
return adoptRef(new SVGMarkerElement(tagName, document));
}
+const AtomicString& SVGMarkerElement::orientTypeIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGOrientType"));
+ return s_identifier;
+}
+
+const AtomicString& SVGMarkerElement::orientAngleIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGOrientAngle"));
+ return s_identifier;
+}
+
AffineTransform SVGMarkerElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const
{
return SVGFitToViewBox::viewBoxToViewTransform(viewBox(), preserveAspectRatio(), viewWidth, viewHeight);
@@ -81,7 +90,8 @@ void SVGMarkerElement::parseMappedAttribute(Attribute* attr)
if (attr->value() == "auto")
setOrientTypeBaseValue(SVG_MARKER_ORIENT_AUTO);
else {
- angle.setValueAsString(attr->value());
+ ExceptionCode ec = 0;
+ angle.setValueAsString(attr->value(), ec);
setOrientTypeBaseValue(SVG_MARKER_ORIENT_ANGLE);
}
diff --git a/WebCore/svg/SVGMarkerElement.h b/WebCore/svg/SVGMarkerElement.h
index 7782739..fd67cfc 100644
--- a/WebCore/svg/SVGMarkerElement.h
+++ b/WebCore/svg/SVGMarkerElement.h
@@ -24,6 +24,8 @@
#if ENABLE(SVG)
#include "RenderObject.h"
#include "SVGAngle.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
#include "SVGLangSpace.h"
@@ -33,9 +35,6 @@ namespace WebCore {
class Document;
-extern char SVGOrientTypeAttrIdentifier[];
-extern char SVGOrientAngleAttrIdentifier[];
-
class SVGMarkerElement : public SVGStyledElement,
public SVGLangSpace,
public SVGExternalResourcesRequired,
@@ -74,19 +73,22 @@ private:
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::refXAttr, SVGLength, RefX, refX)
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::refYAttr, SVGLength, RefY, refY)
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::markerWidthAttr, SVGLength, MarkerWidth, markerWidth)
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::markerHeightAttr, SVGLength, MarkerHeight, markerHeight)
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::markerUnitsAttr, int, MarkerUnits, markerUnits)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGMarkerElement, SVGNames::orientAttr, SVGOrientTypeAttrIdentifier, int, OrientType, orientType)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGMarkerElement, SVGNames::orientAttr, SVGOrientAngleAttrIdentifier, SVGAngle, OrientAngle, orientAngle)
+ static const AtomicString& orientTypeIdentifier();
+ static const AtomicString& orientAngleIdentifier();
+
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::refXAttr, SVGLength, RefX, refX)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::refYAttr, SVGLength, RefY, refY)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::markerWidthAttr, SVGLength, MarkerWidth, markerWidth)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::markerHeightAttr, SVGLength, MarkerHeight, markerHeight)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGMarkerElement, SVGNames::markerUnitsAttr, int, MarkerUnits, markerUnits)
+ DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGMarkerElement, SVGNames::orientAttr, orientTypeIdentifier(), int, OrientType, orientType)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGMarkerElement, SVGNames::orientAttr, orientAngleIdentifier(), SVGAngle, OrientAngle, orientAngle)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGMarkerElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
// SVGFitToViewBox
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
};
diff --git a/WebCore/svg/SVGMaskElement.h b/WebCore/svg/SVGMaskElement.h
index c951beb..599d184 100644
--- a/WebCore/svg/SVGMaskElement.h
+++ b/WebCore/svg/SVGMaskElement.h
@@ -22,6 +22,8 @@
#if ENABLE(SVG)
#include "RenderObject.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledLocatableElement.h"
@@ -55,15 +57,15 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::maskUnitsAttr, int, MaskUnits, maskUnits)
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::maskContentUnitsAttr, int, MaskContentUnits, maskContentUnits)
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGMaskElement, SVGNames::maskUnitsAttr, int, MaskUnits, maskUnits)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGMaskElement, SVGNames::maskContentUnitsAttr, int, MaskContentUnits, maskContentUnits)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMaskElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMaskElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMaskElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMaskElement, SVGNames::heightAttr, SVGLength, Height, height)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGMaskElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
}
diff --git a/WebCore/svg/SVGNumber.idl b/WebCore/svg/SVGNumber.idl
index f57ff40..32e9620 100644
--- a/WebCore/svg/SVGNumber.idl
+++ b/WebCore/svg/SVGNumber.idl
@@ -23,8 +23,7 @@
module svg {
interface [Conditional=SVG, PODType=float] SVGNumber {
- attribute float value
- setter raises(DOMException);
+ attribute float value;
};
}
diff --git a/WebCore/svg/SVGPathElement.h b/WebCore/svg/SVGPathElement.h
index 394983d..f4e2b8a 100644
--- a/WebCore/svg/SVGPathElement.h
+++ b/WebCore/svg/SVGPathElement.h
@@ -23,6 +23,7 @@
#if ENABLE(SVG)
#include "SVGAnimatedPathData.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -107,7 +108,7 @@ namespace WebCore {
DECLARE_ANIMATED_PROPERTY(SVGPathElement, SVGNames::pathLengthAttr, float, PathLength, pathLength)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGPatternElement.h b/WebCore/svg/SVGPatternElement.h
index a93c54c..84e0415 100644
--- a/WebCore/svg/SVGPatternElement.h
+++ b/WebCore/svg/SVGPatternElement.h
@@ -22,6 +22,8 @@
#define SVGPatternElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
#include "SVGLangSpace.h"
@@ -62,22 +64,22 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::heightAttr, SVGLength, Height, height)
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::patternUnitsAttr, int, PatternUnits, patternUnits)
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::patternContentUnitsAttr, int, PatternContentUnits, patternContentUnits)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPatternElement, SVGNames::patternUnitsAttr, int, PatternUnits, patternUnits)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPatternElement, SVGNames::patternContentUnitsAttr, int, PatternContentUnits, patternContentUnits)
DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::patternTransformAttr, SVGTransformList*, PatternTransform, patternTransform)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGPatternElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPatternElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
// SVGPatternElement
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
};
diff --git a/WebCore/svg/SVGPoint.idl b/WebCore/svg/SVGPoint.idl
index e93baf1..46ca671 100644
--- a/WebCore/svg/SVGPoint.idl
+++ b/WebCore/svg/SVGPoint.idl
@@ -23,10 +23,8 @@
module svg {
interface [Conditional=SVG, PODType=FloatPoint] SVGPoint {
- attribute float x
- setter raises(DOMException);
- attribute float y
- setter raises(DOMException);
+ attribute float x;
+ attribute float y;
SVGPoint matrixTransform(in SVGMatrix matrix);
};
diff --git a/WebCore/svg/SVGPolyElement.h b/WebCore/svg/SVGPolyElement.h
index 6d36f4b..64d4abb 100644
--- a/WebCore/svg/SVGPolyElement.h
+++ b/WebCore/svg/SVGPolyElement.h
@@ -23,6 +23,7 @@
#if ENABLE(SVG)
#include "SVGAnimatedPoints.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -52,7 +53,7 @@ namespace WebCore {
virtual bool supportsMarkers() const { return true; }
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGPolyElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPolyElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
mutable RefPtr<SVGPointList> m_points;
};
diff --git a/WebCore/svg/SVGRadialGradientElement.h b/WebCore/svg/SVGRadialGradientElement.h
index 61333af..f223514 100644
--- a/WebCore/svg/SVGRadialGradientElement.h
+++ b/WebCore/svg/SVGRadialGradientElement.h
@@ -22,6 +22,8 @@
#define SVGRadialGradientElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGGradientElement.h"
namespace WebCore {
@@ -47,11 +49,11 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGRadialGradientElement, SVGNames::cxAttr, SVGLength, Cx, cx)
- DECLARE_ANIMATED_PROPERTY(SVGRadialGradientElement, SVGNames::cyAttr, SVGLength, Cy, cy)
- DECLARE_ANIMATED_PROPERTY(SVGRadialGradientElement, SVGNames::rAttr, SVGLength, R, r)
- DECLARE_ANIMATED_PROPERTY(SVGRadialGradientElement, SVGNames::fxAttr, SVGLength, Fx, fx)
- DECLARE_ANIMATED_PROPERTY(SVGRadialGradientElement, SVGNames::fyAttr, SVGLength, Fy, fy)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::cxAttr, SVGLength, Cx, cx)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::cyAttr, SVGLength, Cy, cy)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::rAttr, SVGLength, R, r)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::fxAttr, SVGLength, Fx, fx)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::fyAttr, SVGLength, Fy, fy)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGRect.idl b/WebCore/svg/SVGRect.idl
index 2f8799c..4231ac0 100644
--- a/WebCore/svg/SVGRect.idl
+++ b/WebCore/svg/SVGRect.idl
@@ -22,15 +22,11 @@
module svg {
- interface [Conditional=SVG, PODType=FloatRect] SVGRect {
- attribute float x
- setter raises(DOMException);
- attribute float y
- setter raises(DOMException);
- attribute float width
- setter raises(DOMException);
- attribute float height
- setter raises(DOMException);
+ interface [Conditional=SVG] SVGRect {
+ attribute [StrictTypeChecking] float x;
+ attribute [StrictTypeChecking] float y;
+ attribute [StrictTypeChecking] float width;
+ attribute [StrictTypeChecking] float height;
};
}
diff --git a/WebCore/svg/SVGRectElement.h b/WebCore/svg/SVGRectElement.h
index 668366b..8cc262f 100644
--- a/WebCore/svg/SVGRectElement.h
+++ b/WebCore/svg/SVGRectElement.h
@@ -22,6 +22,8 @@
#define SVGRectElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -49,15 +51,15 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::heightAttr, SVGLength, Height, height)
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::rxAttr, SVGLength, Rx, rx)
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::ryAttr, SVGLength, Ry, ry)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::rxAttr, SVGLength, Rx, rx)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::ryAttr, SVGLength, Ry, ry)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGRectElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index 7de880c..2354b27 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -186,7 +186,7 @@ void SVGSVGElement::setUseCurrentView(bool currentView)
SVGViewSpec* SVGSVGElement::currentView() const
{
if (!m_viewSpec)
- m_viewSpec = adoptPtr(new SVGViewSpec(this));
+ m_viewSpec = adoptPtr(new SVGViewSpec(const_cast<SVGSVGElement*>(this)));
return m_viewSpec.get();
}
@@ -580,9 +580,9 @@ void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement)
{
setUseCurrentView(true);
if (viewElement->hasAttribute(SVGNames::viewBoxAttr))
- currentView()->setViewBox(viewElement->viewBox());
+ currentView()->setViewBoxBaseValue(viewElement->viewBox());
else
- currentView()->setViewBox(viewBox());
+ currentView()->setViewBoxBaseValue(viewBox());
SVGPreserveAspectRatio aspectRatio;
if (viewElement->hasAttribute(SVGNames::preserveAspectRatioAttr))
diff --git a/WebCore/svg/SVGSVGElement.h b/WebCore/svg/SVGSVGElement.h
index b5b10b1..b2a5812 100644
--- a/WebCore/svg/SVGSVGElement.h
+++ b/WebCore/svg/SVGSVGElement.h
@@ -22,8 +22,9 @@
#define SVGSVGElement_h
#if ENABLE(SVG)
-
#include "IntSize.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
#include "SVGLangSpace.h"
@@ -136,16 +137,16 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::heightAttr, SVGLength, Height, height)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGSVGElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
// SVGFitToViewBox
- DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
virtual void documentWillBecomeInactive();
diff --git a/WebCore/svg/SVGSVGElement.idl b/WebCore/svg/SVGSVGElement.idl
index bcf9236..39912ec 100644
--- a/WebCore/svg/SVGSVGElement.idl
+++ b/WebCore/svg/SVGSVGElement.idl
@@ -41,14 +41,14 @@ module svg {
/*setter raises(DOMException)*/;
attribute DOMString contentStyleType
/*setter raises(DOMException)*/;
- readonly attribute [Immutable] SVGRect viewport;
+ readonly attribute SVGRect viewport;
readonly attribute float pixelUnitToMillimeterX;
readonly attribute float pixelUnitToMillimeterY;
readonly attribute float screenPixelToMillimeterX;
readonly attribute float screenPixelToMillimeterY;
attribute boolean useCurrentView
/*setter raises(DOMException)*/;
- // TODO readonly attribute [Immutable] SVGViewSpec currentView;
+ // TODO readonly attribute SVGViewSpec currentView;
attribute float currentScale
/*setter raises(DOMException)*/;
readonly attribute SVGPoint currentTranslate;
diff --git a/WebCore/svg/SVGScriptElement.h b/WebCore/svg/SVGScriptElement.h
index 6dffea6..d4eb61d 100644
--- a/WebCore/svg/SVGScriptElement.h
+++ b/WebCore/svg/SVGScriptElement.h
@@ -22,10 +22,11 @@
#define SVGScriptElement_h
#if ENABLE(SVG)
-#include "ScriptElement.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGElement.h"
-#include "SVGURIReference.h"
#include "SVGExternalResourcesRequired.h"
+#include "SVGURIReference.h"
+#include "ScriptElement.h"
namespace WebCore {
@@ -78,7 +79,7 @@ namespace WebCore {
DECLARE_ANIMATED_PROPERTY(SVGScriptElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGScriptElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGScriptElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
ScriptElementData m_data;
String m_type;
diff --git a/WebCore/svg/SVGStyledElement.cpp b/WebCore/svg/SVGStyledElement.cpp
index d4fa89c..64030bc 100644
--- a/WebCore/svg/SVGStyledElement.cpp
+++ b/WebCore/svg/SVGStyledElement.cpp
@@ -66,10 +66,13 @@ SVGStyledElement::~SVGStyledElement()
String SVGStyledElement::title() const
{
- // According to spec, we should not return titles when hovering over <svg> elements (those
+ // According to spec, we should not return titles when hovering over root <svg> elements (those
// <title> elements are the title of the document, not a tooltip) so we instantly return.
- if (hasTagName(SVGNames::svgTag))
- return String();
+ if (hasTagName(SVGNames::svgTag)) {
+ const SVGSVGElement* svg = static_cast<const SVGSVGElement*>(this);
+ if (svg->isOutermostSVG())
+ return String();
+ }
// Walk up the tree, to find out whether we're inside a <use> shadow tree, to find the right title.
Node* parent = const_cast<SVGStyledElement*>(this);
diff --git a/WebCore/svg/SVGSwitchElement.h b/WebCore/svg/SVGSwitchElement.h
index 970cc1f..1b006ec 100644
--- a/WebCore/svg/SVGSwitchElement.h
+++ b/WebCore/svg/SVGSwitchElement.h
@@ -22,6 +22,7 @@
#define SVGSwitchElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -46,7 +47,7 @@ namespace WebCore {
virtual void synchronizeProperty(const QualifiedName&);
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGSwitchElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGSwitchElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGSymbolElement.h b/WebCore/svg/SVGSymbolElement.h
index 1f310f8..6c561f2 100644
--- a/WebCore/svg/SVGSymbolElement.h
+++ b/WebCore/svg/SVGSymbolElement.h
@@ -22,6 +22,7 @@
#define SVGSymbolElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
#include "SVGLangSpace.h"
@@ -47,10 +48,10 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGSymbolElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGSymbolElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
// SVGFitToViewBox
- DECLARE_ANIMATED_PROPERTY(SVGSymbolElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGSymbolElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
DECLARE_ANIMATED_PROPERTY(SVGSymbolElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
};
diff --git a/WebCore/svg/SVGTextContentElement.h b/WebCore/svg/SVGTextContentElement.h
index a63e27a..d3aa061 100644
--- a/WebCore/svg/SVGTextContentElement.h
+++ b/WebCore/svg/SVGTextContentElement.h
@@ -22,6 +22,8 @@
#define SVGTextContentElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledElement.h"
@@ -69,11 +71,11 @@ namespace WebCore {
private:
virtual bool isTextContent() const { return true; }
- DECLARE_ANIMATED_PROPERTY(SVGTextContentElement, SVGNames::textLengthAttr, SVGLength, TextLength, textLength)
- DECLARE_ANIMATED_PROPERTY(SVGTextContentElement, SVGNames::lengthAdjustAttr, int, LengthAdjust, lengthAdjust)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGTextContentElement, SVGNames::textLengthAttr, SVGLength, TextLength, textLength)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGTextContentElement, SVGNames::lengthAdjustAttr, int, LengthAdjust, lengthAdjust)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGTextContentElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGTextContentElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGTextPathElement.h b/WebCore/svg/SVGTextPathElement.h
index b87dfa5..b06c2bf 100644
--- a/WebCore/svg/SVGTextPathElement.h
+++ b/WebCore/svg/SVGTextPathElement.h
@@ -67,9 +67,9 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, SVGNames::startOffsetAttr, SVGLength, StartOffset, startOffset)
- DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, SVGNames::methodAttr, int, Method, method)
- DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, SVGNames::spacingAttr, int, Spacing, spacing)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGTextPathElement, SVGNames::startOffsetAttr, SVGLength, StartOffset, startOffset)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGTextPathElement, SVGNames::methodAttr, int, Method, method)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGTextPathElement, SVGNames::spacingAttr, int, Spacing, spacing)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, XLinkNames::hrefAttr, String, Href, href)
diff --git a/WebCore/svg/SVGTextPositioningElement.cpp b/WebCore/svg/SVGTextPositioningElement.cpp
index cbc324d..d64dd1f 100644
--- a/WebCore/svg/SVGTextPositioningElement.cpp
+++ b/WebCore/svg/SVGTextPositioningElement.cpp
@@ -34,25 +34,33 @@ namespace WebCore {
SVGTextPositioningElement::SVGTextPositioningElement(const QualifiedName& tagName, Document* document)
: SVGTextContentElement(tagName, document)
- , m_x(SVGLengthList::create(SVGNames::xAttr))
- , m_y(SVGLengthList::create(SVGNames::yAttr))
- , m_dx(SVGLengthList::create(SVGNames::dxAttr))
- , m_dy(SVGLengthList::create(SVGNames::dyAttr))
, m_rotate(SVGNumberList::create(SVGNames::rotateAttr))
{
}
void SVGTextPositioningElement::parseMappedAttribute(Attribute* attr)
{
- if (attr->name() == SVGNames::xAttr)
- xBaseValue()->parse(attr->value(), LengthModeWidth);
- else if (attr->name() == SVGNames::yAttr)
- yBaseValue()->parse(attr->value(), LengthModeHeight);
- else if (attr->name() == SVGNames::dxAttr)
- dxBaseValue()->parse(attr->value(), LengthModeWidth);
- else if (attr->name() == SVGNames::dyAttr)
- dyBaseValue()->parse(attr->value(), LengthModeHeight);
- else if (attr->name() == SVGNames::rotateAttr)
+ if (attr->name() == SVGNames::xAttr) {
+ SVGLengthList newList;
+ newList.parse(attr->value(), LengthModeWidth);
+ detachAnimatedXListWrappers(newList.size());
+ xBaseValue() = newList;
+ } else if (attr->name() == SVGNames::yAttr) {
+ SVGLengthList newList;
+ newList.parse(attr->value(), LengthModeHeight);
+ detachAnimatedYListWrappers(newList.size());
+ yBaseValue() = newList;
+ } else if (attr->name() == SVGNames::dxAttr) {
+ SVGLengthList newList;
+ newList.parse(attr->value(), LengthModeWidth);
+ detachAnimatedDxListWrappers(newList.size());
+ dxBaseValue() = newList;
+ } else if (attr->name() == SVGNames::dyAttr) {
+ SVGLengthList newList;
+ newList.parse(attr->value(), LengthModeHeight);
+ detachAnimatedDyListWrappers(newList.size());
+ dyBaseValue() = newList;
+ } else if (attr->name() == SVGNames::rotateAttr)
rotateBaseValue()->parse(attr->value());
else
SVGTextContentElement::parseMappedAttribute(attr);
@@ -144,17 +152,11 @@ void SVGTextPositioningElement::synchronizeProperty(const QualifiedName& attrNam
synchronizeRotate();
}
-static inline bool listContainsRelativeValue(SVGLengthList* list)
+static inline bool listContainsRelativeValue(const SVGLengthList& list)
{
- if (!list)
- return false;
-
- ExceptionCode ec = 0;
- int length = list->numberOfItems();
- for (int i = 0; i < length; ++i) {
- SVGLength length(list->getItem(i, ec));
- ASSERT(!ec);
-
+ unsigned size = list.size();
+ for (unsigned i = 0; i < size; ++i) {
+ const SVGLength& length = list.at(i);
if (length.isRelative())
return true;
}
@@ -200,7 +202,6 @@ SVGTextPositioningElement* SVGTextPositioningElement::elementFromRenderer(Render
return static_cast<SVGTextPositioningElement*>(node);
}
-
}
#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGTextPositioningElement.h b/WebCore/svg/SVGTextPositioningElement.h
index 41de9f3..1fb1c3c 100644
--- a/WebCore/svg/SVGTextPositioningElement.h
+++ b/WebCore/svg/SVGTextPositioningElement.h
@@ -42,10 +42,10 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGTextPositioningElement, SVGNames::xAttr, SVGLengthList*, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGTextPositioningElement, SVGNames::yAttr, SVGLengthList*, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGTextPositioningElement, SVGNames::dxAttr, SVGLengthList*, Dx, dx)
- DECLARE_ANIMATED_PROPERTY(SVGTextPositioningElement, SVGNames::dyAttr, SVGLengthList*, Dy, dy)
+ DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::xAttr, SVGLengthList, X, x)
+ DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::yAttr, SVGLengthList, Y, y)
+ DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::dxAttr, SVGLengthList, Dx, dx)
+ DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::dyAttr, SVGLengthList, Dy, dy)
DECLARE_ANIMATED_PROPERTY(SVGTextPositioningElement, SVGNames::rotateAttr, SVGNumberList*, Rotate, rotate)
};
diff --git a/WebCore/svg/SVGUseElement.h b/WebCore/svg/SVGUseElement.h
index b8ba71d..bb7e6d0 100644
--- a/WebCore/svg/SVGUseElement.h
+++ b/WebCore/svg/SVGUseElement.h
@@ -22,6 +22,8 @@
#define SVGUseElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -79,16 +81,16 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGUseElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGUseElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGUseElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGUseElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGUseElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGUseElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGUseElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGUseElement, SVGNames::heightAttr, SVGLength, Height, height)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGUseElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGUseElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGUseElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
// Instance tree handling
void buildInstanceTree(SVGElement* target, SVGElementInstance* targetInstance, bool& foundCycle);
diff --git a/WebCore/svg/SVGViewElement.h b/WebCore/svg/SVGViewElement.h
index b483236..f0e756f 100644
--- a/WebCore/svg/SVGViewElement.h
+++ b/WebCore/svg/SVGViewElement.h
@@ -22,6 +22,7 @@
#define SVGViewElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGStyledElement.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
@@ -48,10 +49,10 @@ namespace WebCore {
virtual bool rendererIsNeeded(RenderStyle*) { return false; }
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGViewElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGViewElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
// SVGFitToViewBox
- DECLARE_ANIMATED_PROPERTY(SVGViewElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGViewElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
DECLARE_ANIMATED_PROPERTY(SVGViewElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
mutable RefPtr<SVGStringList> m_viewTarget;
diff --git a/WebCore/svg/SVGViewSpec.cpp b/WebCore/svg/SVGViewSpec.cpp
index 20c58ac..2eafff1 100644
--- a/WebCore/svg/SVGViewSpec.cpp
+++ b/WebCore/svg/SVGViewSpec.cpp
@@ -31,7 +31,7 @@
namespace WebCore {
-SVGViewSpec::SVGViewSpec(const SVGSVGElement* contextElement)
+SVGViewSpec::SVGViewSpec(SVGElement* contextElement)
: m_contextElement(contextElement)
, m_transform(SVGTransformList::create(SVGNames::transformAttr))
{
diff --git a/WebCore/svg/SVGViewSpec.h b/WebCore/svg/SVGViewSpec.h
index cf64bca..6fcc94e 100644
--- a/WebCore/svg/SVGViewSpec.h
+++ b/WebCore/svg/SVGViewSpec.h
@@ -21,6 +21,8 @@
#define SVGViewSpec_h
#if ENABLE(SVG)
+#include "SVGAnimatedPropertyMacros.h"
+#include "SVGElement.h"
#include "SVGFitToViewBox.h"
#include "SVGZoomAndPan.h"
@@ -29,14 +31,13 @@
namespace WebCore {
class SVGElement;
- class SVGSVGElement;
class SVGTransformList;
class SVGViewSpec : public SVGFitToViewBox,
public SVGZoomAndPan,
public Noncopyable {
public:
- SVGViewSpec(const SVGSVGElement*);
+ SVGViewSpec(SVGElement*);
bool parseViewSpec(const String&);
@@ -51,13 +52,13 @@ namespace WebCore {
String viewTargetString() const { return m_viewTargetString; }
SVGElement* viewTarget() const;
- SVGSVGElement* contextElement() const { return const_cast<SVGSVGElement*>(m_contextElement); }
+ SVGElement* contextElement() const { return const_cast<SVGElement*>(m_contextElement); }
private:
- const SVGSVGElement* m_contextElement;
+ SVGElement* m_contextElement;
// SVGFitToViewBox
- DECLARE_ANIMATED_PROPERTY(SVGViewSpec, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGViewSpec, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
DECLARE_ANIMATED_PROPERTY(SVGViewSpec, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
mutable RefPtr<SVGTransformList> m_transform;
diff --git a/WebCore/svg/SVGZoomEvent.idl b/WebCore/svg/SVGZoomEvent.idl
index 520f202..7ddd08f 100644
--- a/WebCore/svg/SVGZoomEvent.idl
+++ b/WebCore/svg/SVGZoomEvent.idl
@@ -26,7 +26,7 @@
module svg {
interface [Conditional=SVG] SVGZoomEvent : UIEvent {
- readonly attribute [Immutable] SVGRect zoomRectScreen;
+ readonly attribute SVGRect zoomRectScreen;
readonly attribute float previousScale;
readonly attribute [Immutable] SVGPoint previousTranslate;
readonly attribute float newScale;
diff --git a/WebCore/svg/graphics/filters/SVGFilter.cpp b/WebCore/svg/graphics/filters/SVGFilter.cpp
index dfdccd7..e7b61db 100644
--- a/WebCore/svg/graphics/filters/SVGFilter.cpp
+++ b/WebCore/svg/graphics/filters/SVGFilter.cpp
@@ -23,8 +23,6 @@
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "SVGFilter.h"
-#include "SVGFEImage.h"
-
namespace WebCore {
SVGFilter::SVGFilter(const AffineTransform& absoluteTransform, const FloatRect& absoluteSourceDrawingRegion, const FloatRect& targetBoundingBox, const FloatRect& filterRegion, bool effectBBoxMode)
@@ -38,64 +36,6 @@ SVGFilter::SVGFilter(const AffineTransform& absoluteTransform, const FloatRect&
m_absoluteFilterRegion = absoluteTransform.mapRect(filterRegion);
}
-void SVGFilter::determineFilterPrimitiveSubregion(FilterEffect* effect, const FloatRect& unionOfPreviousPrimitiveSubregions)
-{
- FloatRect subRegionBBox = effect->effectBoundaries();
- FloatRect newSubRegion = subRegionBBox;
-
- if (m_effectBBoxMode) {
- newSubRegion = unionOfPreviousPrimitiveSubregions;
-
- if (effect->hasX())
- newSubRegion.setX(m_targetBoundingBox.x() + subRegionBBox.x() * m_targetBoundingBox.width());
-
- if (effect->hasY())
- newSubRegion.setY(m_targetBoundingBox.y() + subRegionBBox.y() * m_targetBoundingBox.height());
-
- if (effect->hasWidth())
- newSubRegion.setWidth(subRegionBBox.width() * m_targetBoundingBox.width());
-
- if (effect->hasHeight())
- newSubRegion.setHeight(subRegionBBox.height() * m_targetBoundingBox.height());
- } else {
- if (!effect->hasX())
- newSubRegion.setX(unionOfPreviousPrimitiveSubregions.x());
-
- if (!effect->hasY())
- newSubRegion.setY(unionOfPreviousPrimitiveSubregions.y());
-
- if (!effect->hasWidth())
- newSubRegion.setWidth(unionOfPreviousPrimitiveSubregions.width());
-
- if (!effect->hasHeight())
- newSubRegion.setHeight(unionOfPreviousPrimitiveSubregions.height());
- }
-
- effect->setFilterPrimitiveSubregion(newSubRegion);
- // TODO: Everything above should be moved to a first phase of layout in RenderSVGResourceFilterPrimitive.
- // The scaling of the subregion to the repaint rect should be merged with a more intelligent repaint logic
- // and moved to the second phase of layout in RenderSVGResourceFilterPrimitive.
- // See bug https://bugs.webkit.org/show_bug.cgi?id=45614.
- newSubRegion = m_absoluteTransform.mapRect(newSubRegion);
- newSubRegion.scale(filterResolution().width(), filterResolution().height());
-
- // FEImage needs the unclipped subregion in absolute coordinates to determine the correct
- // destination rect in combination with preserveAspectRatio.
- if (effect->filterEffectType() == FilterEffectTypeImage) {
- FEImage* imageEffect = static_cast<FEImage*>(effect);
- imageEffect->setAbsoluteSubregion(newSubRegion);
- }
-
- // Clip every filter effect to the filter region.
- FloatRect absoluteScaledFilterRegion = m_absoluteFilterRegion;
- absoluteScaledFilterRegion.scale(filterResolution().width(), filterResolution().height());
- newSubRegion.intersect(absoluteScaledFilterRegion);
-
- effect->setMaxEffectRect(enclosingIntRect(newSubRegion));
- if (effect->filterEffectType() != FilterEffectTypeSourceInput)
- m_maxImageSize = m_maxImageSize.expandedTo(newSubRegion.size());
-}
-
float SVGFilter::applyHorizontalScale(float value) const
{
if (m_effectBBoxMode)
diff --git a/WebCore/svg/graphics/filters/SVGFilter.h b/WebCore/svg/graphics/filters/SVGFilter.h
index 1b19e9f..6465f9f 100644
--- a/WebCore/svg/graphics/filters/SVGFilter.h
+++ b/WebCore/svg/graphics/filters/SVGFilter.h
@@ -43,14 +43,13 @@ public:
virtual FloatRect filterRegion() const { return m_absoluteFilterRegion; }
virtual FloatPoint mapAbsolutePointToLocalPoint(const FloatPoint& point) const { return m_absoluteTransform.inverse().mapPoint(point); }
+ FloatRect mapLocalRectToAbsoluteRect(const FloatRect& rect) const { return m_absoluteTransform.mapRect(rect); }
virtual float applyHorizontalScale(float value) const;
virtual float applyVerticalScale(float value) const;
virtual FloatRect sourceImageRect() const { return m_absoluteSourceDrawingRegion; }
-
- virtual FloatSize maxImageSize() const { return m_maxImageSize; }
- virtual void determineFilterPrimitiveSubregion(FilterEffect*, const FloatRect&);
+ FloatRect targetBoundingBox() const { return m_targetBoundingBox; }
private:
SVGFilter(const AffineTransform& absoluteTransform, const FloatRect& absoluteSourceDrawingRegion, const FloatRect& targetBoundingBox, const FloatRect& filterRegion, bool effectBBoxMode);
@@ -61,7 +60,6 @@ private:
FloatRect m_absoluteFilterRegion;
FloatRect m_filterRegion;
bool m_effectBBoxMode;
- FloatSize m_maxImageSize;
};
} // namespace WebCore
diff --git a/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h b/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h
new file mode 100644
index 0000000..c002d09
--- /dev/null
+++ b/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimatedListPropertyTearOff_h
+#define SVGAnimatedListPropertyTearOff_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedProperty.h"
+#include "SVGListPropertyTearOff.h"
+
+namespace WebCore {
+
+template<typename PropertyType>
+class SVGPropertyTearOff;
+
+template<typename PropertyType>
+class SVGAnimatedListPropertyTearOff : public SVGAnimatedProperty {
+public:
+ SVGProperty* baseVal()
+ {
+ if (!m_baseVal)
+ m_baseVal = SVGListPropertyTearOff<PropertyType>::create(this, BaseValRole, m_property);
+ return m_baseVal.get();
+ }
+
+ SVGProperty* animVal()
+ {
+ if (!m_animVal)
+ m_animVal = SVGListPropertyTearOff<PropertyType>::create(this, AnimValRole, m_property);
+ return m_animVal.get();
+ }
+
+ virtual bool isAnimatedListTearOff() const { return true; }
+
+ int removeItemFromList(SVGProperty* property, bool shouldSynchronizeWrappers)
+ {
+ // FIXME: No animVal support.
+ if (!m_baseVal)
+ return -1;
+
+ typedef SVGPropertyTearOff<typename SVGPropertyTraits<PropertyType>::ListItemType> ListItemTearOff;
+ return static_pointer_cast<SVGListPropertyTearOff<PropertyType> >(m_baseVal)->removeItemFromList(static_cast<ListItemTearOff*>(property), shouldSynchronizeWrappers);
+ }
+
+ void detachListWrappers(unsigned newListSize)
+ {
+ if (m_baseVal)
+ static_pointer_cast<SVGListPropertyTearOff<PropertyType> >(m_baseVal)->detachListWrappers(newListSize);
+ if (m_animVal)
+ static_pointer_cast<SVGListPropertyTearOff<PropertyType> >(m_animVal)->detachListWrappers(newListSize);
+ }
+
+private:
+ friend class SVGAnimatedProperty;
+
+ static PassRefPtr<SVGAnimatedListPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
+ {
+ ASSERT(contextElement);
+ return adoptRef(new SVGAnimatedListPropertyTearOff<PropertyType>(contextElement, attributeName, property));
+ }
+
+ SVGAnimatedListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
+ : SVGAnimatedProperty(contextElement, attributeName)
+ , m_property(property)
+ {
+ }
+
+private:
+ PropertyType& m_property;
+
+ RefPtr<SVGProperty> m_baseVal;
+ RefPtr<SVGProperty> m_animVal;
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGAnimatedListPropertyTearOff_h
diff --git a/WebCore/svg/properties/SVGAnimatedProperty.h b/WebCore/svg/properties/SVGAnimatedProperty.h
new file mode 100644
index 0000000..1c25935
--- /dev/null
+++ b/WebCore/svg/properties/SVGAnimatedProperty.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimatedProperty_h
+#define SVGAnimatedProperty_h
+
+#if ENABLE(SVG)
+#include "QualifiedName.h"
+#include "SVGAnimatedPropertyDescription.h"
+#include "SVGElement.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class SVGElement;
+class SVGProperty;
+
+class SVGAnimatedProperty : public RefCounted<SVGAnimatedProperty> {
+public:
+ SVGElement* contextElement() const { return m_contextElement.get(); }
+ const QualifiedName& attributeName() const { return m_attributeName; }
+
+ void commitChange()
+ {
+ ASSERT(m_contextElement);
+ m_contextElement->invalidateSVGAttributes();
+ m_contextElement->svgAttributeChanged(m_attributeName);
+ }
+
+ virtual bool isAnimatedListTearOff() const { return false; }
+
+ // Caching facilities.
+ typedef HashMap<SVGAnimatedPropertyDescription, RefPtr<SVGAnimatedProperty>, SVGAnimatedPropertyDescriptionHash, SVGAnimatedPropertyDescriptionHashTraits> Cache;
+
+ virtual ~SVGAnimatedProperty()
+ {
+ // Remove wrapper from cache.
+ Cache* cache = animatedPropertyCache();
+ const Cache::const_iterator end = cache->end();
+ for (Cache::const_iterator it = cache->begin(); it != end; ++it) {
+ if (it->second == this) {
+ cache->remove(it->first);
+ break;
+ }
+ }
+ }
+
+ template<typename TearOffType, typename PropertyType>
+ static PassRefPtr<TearOffType> lookupOrCreateWrapper(SVGElement* element, const QualifiedName& attributeName, const AtomicString& attributeIdentifier, PropertyType& property)
+ {
+ SVGAnimatedPropertyDescription key(element, attributeIdentifier);
+ RefPtr<SVGAnimatedProperty> wrapper = animatedPropertyCache()->get(key);
+ if (!wrapper) {
+ wrapper = TearOffType::create(element, attributeName, property);
+ animatedPropertyCache()->set(key, wrapper);
+ }
+
+ return static_pointer_cast<TearOffType>(wrapper).release();
+ }
+
+ template<typename TearOffType>
+ static TearOffType* lookupWrapper(SVGElement* element, const AtomicString& attributeIdentifier)
+ {
+ SVGAnimatedPropertyDescription key(element, attributeIdentifier);
+ return static_pointer_cast<TearOffType>(animatedPropertyCache()->get(key)).get();
+ }
+
+protected:
+ SVGAnimatedProperty(SVGElement* contextElement, const QualifiedName& attributeName)
+ : m_contextElement(contextElement)
+ , m_attributeName(attributeName)
+ {
+ }
+
+private:
+ static Cache* animatedPropertyCache()
+ {
+ static Cache* s_cache = new Cache;
+ return s_cache;
+ }
+
+ RefPtr<SVGElement> m_contextElement;
+ const QualifiedName& m_attributeName;
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGAnimatedProperty_h
diff --git a/WebCore/svg/properties/SVGAnimatedPropertyDescription.h b/WebCore/svg/properties/SVGAnimatedPropertyDescription.h
new file mode 100644
index 0000000..6fb5e66
--- /dev/null
+++ b/WebCore/svg/properties/SVGAnimatedPropertyDescription.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimatedPropertyDescription_h
+#define SVGAnimatedPropertyDescription_h
+
+#if ENABLE(SVG)
+#include <wtf/HashMap.h>
+#include <wtf/text/AtomicString.h>
+
+namespace WebCore {
+
+class SVGElement;
+
+struct SVGAnimatedPropertyDescription {
+ // Empty value
+ SVGAnimatedPropertyDescription()
+ : m_element(0)
+ , m_attributeName(0)
+ {
+ }
+
+ // Deleted value
+ SVGAnimatedPropertyDescription(WTF::HashTableDeletedValueType)
+ : m_element(reinterpret_cast<SVGElement*>(-1))
+ {
+ }
+
+ bool isHashTableDeletedValue() const
+ {
+ return m_element == reinterpret_cast<SVGElement*>(-1);
+ }
+
+ SVGAnimatedPropertyDescription(SVGElement* element, const AtomicString& attributeName)
+ : m_element(element)
+ , m_attributeName(attributeName.impl())
+ {
+ ASSERT(m_element);
+ ASSERT(m_attributeName);
+ }
+
+ bool operator==(const SVGAnimatedPropertyDescription& other) const
+ {
+ return m_element == other.m_element && m_attributeName == other.m_attributeName;
+ }
+
+ SVGElement* m_element;
+ AtomicStringImpl* m_attributeName;
+};
+
+struct SVGAnimatedPropertyDescriptionHash {
+ static unsigned hash(const SVGAnimatedPropertyDescription& key)
+ {
+ return WTF::StringHasher::createBlobHash<sizeof(SVGAnimatedPropertyDescription)>(&key);
+ }
+
+ static bool equal(const SVGAnimatedPropertyDescription& a, const SVGAnimatedPropertyDescription& b)
+ {
+ return a == b;
+ }
+
+ static const bool safeToCompareToEmptyOrDeleted = true;
+};
+
+struct SVGAnimatedPropertyDescriptionHashTraits : WTF::GenericHashTraits<SVGAnimatedPropertyDescription> {
+ static const bool emptyValueIsZero = true;
+
+ static void constructDeletedValue(SVGAnimatedPropertyDescription& slot)
+ {
+ new (&slot) SVGAnimatedPropertyDescription(WTF::HashTableDeletedValue);
+ }
+
+ static bool isDeletedValue(const SVGAnimatedPropertyDescription& value)
+ {
+ return value.isHashTableDeletedValue();
+ }
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGAnimatedPropertyDescription_h
diff --git a/WebCore/svg/properties/SVGAnimatedPropertyMacros.h b/WebCore/svg/properties/SVGAnimatedPropertyMacros.h
new file mode 100644
index 0000000..12d0565
--- /dev/null
+++ b/WebCore/svg/properties/SVGAnimatedPropertyMacros.h
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimatedPropertyMacros_h
+#define SVGAnimatedPropertyMacros_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedListPropertyTearOff.h"
+#include "SVGAnimatedStaticPropertyTearOff.h"
+#include "SVGAnimatedPropertySynchronizer.h"
+#include "SVGAnimatedPropertyTearOff.h"
+#include "SVGNames.h" // FIXME: Temporary hack, until we expand the macros in all files, so we don't need a global SVGNames.h include
+#include "SVGPropertyTraits.h"
+
+namespace WebCore {
+
+template<typename PropertyType>
+struct SVGSynchronizableAnimatedProperty {
+ SVGSynchronizableAnimatedProperty()
+ : value(SVGPropertyTraits<PropertyType>::initialValue())
+ , shouldSynchronize(false)
+ {
+ }
+
+ template<typename ConstructorParameter1>
+ SVGSynchronizableAnimatedProperty(const ConstructorParameter1& value1)
+ : value(value1)
+ , shouldSynchronize(false)
+ {
+ }
+
+ template<typename ConstructorParameter1, typename ConstructorParameter2>
+ SVGSynchronizableAnimatedProperty(const ConstructorParameter1& value1, const ConstructorParameter2& value2)
+ : value(value1, value2)
+ , shouldSynchronize(false)
+ {
+ }
+
+ PropertyType value;
+ bool shouldSynchronize : 1;
+};
+
+// FIXME: These macros should be removed, after the transition to the new SVGAnimatedProperty concept is finished.
+#define DECLARE_ANIMATED_PROPERTY_NEW_SHARED(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, TearOffType, PropertyType, UpperProperty, LowerProperty) \
+public: \
+PropertyType& LowerProperty() const \
+{ \
+ return m_##LowerProperty.value; \
+} \
+\
+PropertyType& LowerProperty##BaseValue() const \
+{ \
+ return m_##LowerProperty.value; \
+} \
+\
+void set##UpperProperty##BaseValue(const PropertyType& type) \
+{ \
+ m_##LowerProperty.value = type; \
+ SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \
+ contextElement->invalidateSVGAttributes(); \
+} \
+\
+void synchronize##UpperProperty() \
+{ \
+ if (!m_##LowerProperty.shouldSynchronize) \
+ return; \
+ AtomicString value(SVGPropertyTraits<PropertyType>::toString(LowerProperty##BaseValue())); \
+ SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \
+ SVGAnimatedPropertySynchronizer<IsDerivedFromSVGElement<OwnerType>::value>::synchronize(contextElement, DOMAttribute, value); \
+} \
+\
+PassRefPtr<TearOffType> LowerProperty##Animated() \
+{ \
+ m_##LowerProperty.shouldSynchronize = true; \
+ SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \
+ return SVGAnimatedProperty::lookupOrCreateWrapper<TearOffType, PropertyType>(contextElement, DOMAttribute, SVGDOMAttributeIdentifier, m_##LowerProperty.value); \
+} \
+private: \
+ mutable SVGSynchronizableAnimatedProperty<PropertyType> m_##LowerProperty;
+
+#define DECLARE_ANIMATED_PROPERTY_NEW(OwnerType, DOMAttribute, PropertyType, UpperProperty, LowerProperty) \
+DECLARE_ANIMATED_PROPERTY_NEW_SHARED(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedPropertyTearOff<PropertyType>, PropertyType, UpperProperty, LowerProperty)
+
+#define DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS_NEW(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, PropertyType, UpperProperty, LowerProperty) \
+DECLARE_ANIMATED_PROPERTY_NEW_SHARED(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedPropertyTearOff<PropertyType>, PropertyType, UpperProperty, LowerProperty)
+
+#define DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, PropertyType, UpperProperty, LowerProperty) \
+DECLARE_ANIMATED_PROPERTY_NEW_SHARED(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedStaticPropertyTearOff<PropertyType>, PropertyType, UpperProperty, LowerProperty)
+
+#define DECLARE_ANIMATED_STATIC_PROPERTY_NEW(OwnerType, DOMAttribute, PropertyType, UpperProperty, LowerProperty) \
+DECLARE_ANIMATED_PROPERTY_NEW_SHARED(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedStaticPropertyTearOff<PropertyType>, PropertyType, UpperProperty, LowerProperty)
+
+#define DECLARE_ANIMATED_LIST_PROPERTY_NEW(OwnerType, DOMAttribute, PropertyType, UpperProperty, LowerProperty) \
+DECLARE_ANIMATED_PROPERTY_NEW_SHARED(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedListPropertyTearOff<PropertyType>, PropertyType, UpperProperty, LowerProperty) \
+\
+void detachAnimated##UpperProperty##ListWrappers(unsigned newListSize) \
+{ \
+ SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \
+ SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<SVGAnimatedListPropertyTearOff<PropertyType> >(contextElement, DOMAttribute.localName()); \
+ if (!wrapper) \
+ return; \
+ static_cast<SVGAnimatedListPropertyTearOff<PropertyType>*>(wrapper)->detachListWrappers(newListSize); \
+}
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGAnimatedPropertyMacros_h
diff --git a/WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h b/WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h
index 476f1fd..2b816ab 100644
--- a/WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h
+++ b/WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h
@@ -20,8 +20,6 @@
#ifndef SVGAnimatedPropertySynchronizer_h
#define SVGAnimatedPropertySynchronizer_h
-#include "DeprecatedSVGAnimatedPropertyTraits.h"
-
#if ENABLE(SVG)
namespace WebCore {
diff --git a/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h b/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h
new file mode 100644
index 0000000..252a4b4
--- /dev/null
+++ b/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimatedPropertyTearOff_h
+#define SVGAnimatedPropertyTearOff_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedProperty.h"
+#include "SVGPropertyTearOff.h"
+
+namespace WebCore {
+
+template<typename PropertyType>
+class SVGAnimatedPropertyTearOff : public SVGAnimatedProperty {
+public:
+ SVGProperty* baseVal()
+ {
+ if (!m_baseVal)
+ m_baseVal = SVGPropertyTearOff<PropertyType>::create(this, BaseValRole, m_property);
+ return m_baseVal.get();
+ }
+
+ SVGProperty* animVal()
+ {
+ if (!m_animVal)
+ m_animVal = SVGPropertyTearOff<PropertyType>::create(this, AnimValRole, m_property);
+ return m_animVal.get();
+ }
+
+private:
+ friend class SVGAnimatedProperty;
+
+ static PassRefPtr<SVGAnimatedPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
+ {
+ ASSERT(contextElement);
+ return adoptRef(new SVGAnimatedPropertyTearOff<PropertyType>(contextElement, attributeName, property));
+ }
+
+ SVGAnimatedPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
+ : SVGAnimatedProperty(contextElement, attributeName)
+ , m_property(property)
+ {
+ }
+
+private:
+ PropertyType& m_property;
+
+ RefPtr<SVGProperty> m_baseVal;
+ RefPtr<SVGProperty> m_animVal;
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGAnimatedPropertyTearOff_h
diff --git a/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h b/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h
new file mode 100644
index 0000000..930569e
--- /dev/null
+++ b/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimatedStaticPropertyTearOff_h
+#define SVGAnimatedStaticPropertyTearOff_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedProperty.h"
+
+namespace WebCore {
+
+template<typename PropertyType>
+class SVGAnimatedStaticPropertyTearOff : public SVGAnimatedProperty {
+public:
+ PropertyType& baseVal()
+ {
+ return m_property;
+ }
+
+ PropertyType& animVal()
+ {
+ // FIXME: No animVal support.
+ return m_property;
+ }
+
+ void setBaseVal(const PropertyType& property)
+ {
+ m_property = property;
+ commitChange();
+ }
+
+ // FIXME: No animVal support.
+ void setAnimVal(const PropertyType&) { }
+
+private:
+ friend class SVGAnimatedProperty;
+
+ static PassRefPtr<SVGAnimatedStaticPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
+ {
+ ASSERT(contextElement);
+ return adoptRef(new SVGAnimatedStaticPropertyTearOff<PropertyType>(contextElement, attributeName, property));
+ }
+
+ SVGAnimatedStaticPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
+ : SVGAnimatedProperty(contextElement, attributeName)
+ , m_property(property)
+ {
+ }
+
+private:
+ PropertyType& m_property;
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGAnimatedStaticPropertyTearOff_h
diff --git a/WebCore/svg/properties/SVGListPropertyTearOff.h b/WebCore/svg/properties/SVGListPropertyTearOff.h
new file mode 100644
index 0000000..2801168
--- /dev/null
+++ b/WebCore/svg/properties/SVGListPropertyTearOff.h
@@ -0,0 +1,382 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGListPropertyTearOff_h
+#define SVGListPropertyTearOff_h
+
+#if ENABLE(SVG)
+#include "ExceptionCode.h"
+#include "SVGAnimatedProperty.h"
+#include "SVGPropertyTearOff.h"
+#include "SVGPropertyTraits.h"
+
+namespace WebCore {
+
+template<typename PropertyType>
+class SVGAnimatedListPropertyTearOff;
+
+template<typename PropertyType>
+class SVGListPropertyTearOff : public SVGProperty {
+public:
+ typedef SVGListPropertyTearOff<PropertyType> Self;
+
+ typedef typename SVGPropertyTraits<PropertyType>::ListItemType ListItemType;
+ typedef SVGPropertyTearOff<ListItemType> ListItemTearOff;
+ typedef PassRefPtr<ListItemTearOff> PassListItemTearOff;
+ typedef Vector<RefPtr<ListItemTearOff> > ListWrapperCache;
+
+ // Used for [SVGAnimatedProperty] types (for example: SVGAnimatedLengthList::baseVal())
+ static PassRefPtr<Self> create(SVGAnimatedProperty* animatedProperty, SVGPropertyRole role, PropertyType& values)
+ {
+ ASSERT(animatedProperty);
+ return adoptRef(new Self(animatedProperty, role, values));
+ }
+
+ // Used for non-animated POD types (for example: SVGStringList).
+ static PassRefPtr<Self> create(const PropertyType& initialValue)
+ {
+ return adoptRef(new Self(initialValue));
+ }
+
+ int removeItemFromList(ListItemTearOff* removeItem, bool shouldSynchronizeWrappers)
+ {
+ // Lookup item in cache and remove its corresponding wrapper.
+ unsigned size = m_wrappers.size();
+ ASSERT(size == m_values->size());
+ for (unsigned i = 0; i < size; ++i) {
+ RefPtr<ListItemTearOff>& item = m_wrappers.at(i);
+ if (item != removeItem)
+ continue;
+
+ item->detachWrapper();
+ m_wrappers.remove(i);
+ m_values->remove(i);
+
+ if (shouldSynchronizeWrappers)
+ commitChange();
+
+ return i;
+ }
+
+ return -1;
+ }
+
+ void detachListWrappers(unsigned newListSize)
+ {
+ // See SVGPropertyTearOff::detachWrapper() for an explaination what's happening here.
+ unsigned size = m_wrappers.size();
+ ASSERT(size == m_values->size());
+ for (unsigned i = 0; i < size; ++i) {
+ RefPtr<ListItemTearOff>& item = m_wrappers.at(i);
+ if (!item)
+ continue;
+ item->detachWrapper();
+ }
+
+ // Reinitialize the wrapper cache to be equal to the new values size, after the XML DOM changed the list.
+ if (newListSize)
+ m_wrappers.fill(0, newListSize);
+ else
+ m_wrappers.clear();
+ }
+
+ // SVGList API
+ void clear(ExceptionCode& ec)
+ {
+ if (m_role == AnimValRole) {
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return;
+ }
+
+ detachListWrappers(0);
+ m_values->clear();
+ }
+
+ unsigned numberOfItems() const
+ {
+ return m_values->size();
+ }
+
+ PassListItemTearOff initialize(PassListItemTearOff passNewItem, ExceptionCode& ec)
+ {
+ if (m_role == AnimValRole) {
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return 0;
+ }
+
+ // Not specified, but FF/Opera do it this way, and it's just sane.
+ if (!passNewItem) {
+ ec = TYPE_MISMATCH_ERR;
+ return 0;
+ }
+
+ RefPtr<ListItemTearOff> newItem = passNewItem;
+ ASSERT(m_values->size() == m_wrappers.size());
+
+ // Spec: If the inserted item is already in a list, it is removed from its previous list before it is inserted into this list.
+ removeItemFromListIfNeeded(newItem.get(), 0);
+
+ // Spec: Clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter.
+ detachListWrappers(0);
+ m_values->clear();
+
+ m_values->append(newItem->propertyReference());
+ m_wrappers.append(newItem);
+
+ commitChange();
+ return newItem.release();
+ }
+
+ PassListItemTearOff getItem(unsigned index, ExceptionCode& ec)
+ {
+ if (index >= m_values->size()) {
+ ec = INDEX_SIZE_ERR;
+ return 0;
+ }
+
+ // Spec: Returns the specified item from the list. The returned item is the item itself and not a copy.
+ // Any changes made to the item are immediately reflected in the list.
+ ASSERT(m_values->size() == m_wrappers.size());
+ RefPtr<ListItemTearOff> wrapper = m_wrappers.at(index);
+ if (!wrapper) {
+ // Create new wrapper, which is allowed to directly modify the item in the list, w/o copying and cache the wrapper in our map.
+ // It is also associated with our animated property, so it can notify the SVG Element which holds the SVGAnimated*List
+ // that it has been modified (and thus can call svgAttributeChanged(associatedAttributeName)).
+ wrapper = ListItemTearOff::create(m_animatedProperty.get(), UndefinedRole, m_values->at(index));
+ m_wrappers.at(index) = wrapper;
+ }
+
+ return wrapper.release();
+ }
+
+ PassListItemTearOff insertItemBefore(PassListItemTearOff passNewItem, unsigned index, ExceptionCode& ec)
+ {
+ if (m_role == AnimValRole) {
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return 0;
+ }
+
+ // Not specified, but FF/Opera do it this way, and it's just sane.
+ if (!passNewItem) {
+ ec = TYPE_MISMATCH_ERR;
+ return 0;
+ }
+
+ // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
+ if (index > m_values->size())
+ index = m_values->size();
+
+ RefPtr<ListItemTearOff> newItem = passNewItem;
+ ASSERT(m_values->size() == m_wrappers.size());
+
+ // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
+ removeItemFromListIfNeeded(newItem.get(), &index);
+
+ // Spec: Inserts a new item into the list at the specified position. The index of the item before which the new item is to be
+ // inserted. The first item is number 0. If the index is equal to 0, then the new item is inserted at the front of the list.
+ m_values->insert(index, newItem->propertyReference());
+
+ // Store new wrapper at position 'index', change its underlying value, so mutations of newItem, directly affect the item in the list.
+ m_wrappers.insert(index, newItem);
+
+ commitChange();
+ return newItem.release();
+ }
+
+ PassListItemTearOff replaceItem(PassListItemTearOff passNewItem, unsigned index, ExceptionCode& ec)
+ {
+ if (m_role == AnimValRole) {
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return 0;
+ }
+
+ if (index >= m_values->size()) {
+ ec = INDEX_SIZE_ERR;
+ return 0;
+ }
+
+ // Not specified, but FF/Opera do it this way, and it's just sane.
+ if (!passNewItem) {
+ ec = TYPE_MISMATCH_ERR;
+ return 0;
+ }
+
+ RefPtr<ListItemTearOff> newItem = passNewItem;
+ ASSERT(m_values->size() == m_wrappers.size());
+
+ // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
+ // Spec: If the item is already in this list, note that the index of the item to replace is before the removal of the item.
+ removeItemFromListIfNeeded(newItem.get(), &index);
+
+ // Detach the existing wrapper.
+ RefPtr<ListItemTearOff>& oldItem = m_wrappers.at(index);
+ if (oldItem)
+ oldItem->detachWrapper();
+
+ // Update the value and the wrapper at the desired position 'index'.
+ m_values->at(index) = newItem->propertyReference();
+ m_wrappers.at(index) = newItem;
+
+ commitChange();
+ return newItem.release();
+ }
+
+ PassListItemTearOff removeItem(unsigned index, ExceptionCode& ec)
+ {
+ if (m_role == AnimValRole) {
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return 0;
+ }
+
+ if (index >= m_values->size()) {
+ ec = INDEX_SIZE_ERR;
+ return 0;
+ }
+
+ ASSERT(m_values->size() == m_wrappers.size());
+
+ // Detach the existing wrapper.
+ RefPtr<ListItemTearOff>& oldItem = m_wrappers.at(index);
+ if (oldItem) {
+ oldItem->detachWrapper();
+ m_wrappers.remove(index);
+ }
+
+ m_values->remove(index);
+
+ commitChange();
+ return oldItem.release();
+ }
+
+ PassListItemTearOff appendItem(PassListItemTearOff passNewItem, ExceptionCode& ec)
+ {
+ if (m_role == AnimValRole) {
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return 0;
+ }
+
+ // Not specified, but FF/Opera do it this way, and it's just sane.
+ if (!passNewItem) {
+ ec = TYPE_MISMATCH_ERR;
+ return 0;
+ }
+
+ RefPtr<ListItemTearOff> newItem = passNewItem;
+ ASSERT(m_values->size() == m_wrappers.size());
+
+ // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
+ removeItemFromListIfNeeded(newItem.get(), 0);
+
+ // Append the value and wrapper at the end of the list.
+ m_values->append(newItem->propertyReference());
+ m_wrappers.append(newItem);
+
+ commitChange();
+ return newItem.release();
+ }
+
+private:
+ SVGListPropertyTearOff(SVGAnimatedProperty* animatedProperty, SVGPropertyRole role, PropertyType& values)
+ : m_animatedProperty(animatedProperty)
+ , m_role(role)
+ , m_values(&values)
+ , m_valuesIsCopy(false)
+ {
+ // Using operator & is completly fine, as SVGAnimatedProperty owns this reference,
+ // and we're guaranteed to live as long as SVGAnimatedProperty does.
+ if (!values.isEmpty())
+ m_wrappers.fill(0, values.size());
+ }
+
+ SVGListPropertyTearOff(const PropertyType& initialValue)
+ : m_animatedProperty(0)
+ , m_role(UndefinedRole)
+ , m_values(new PropertyType(initialValue))
+ , m_valuesIsCopy(true)
+ {
+ }
+
+ virtual ~SVGListPropertyTearOff()
+ {
+ if (m_valuesIsCopy)
+ delete m_values;
+ }
+
+ void commitChange()
+ {
+ // Update existing wrappers, as the index in the m_values list has changed.
+ unsigned size = m_wrappers.size();
+ ASSERT(size == m_values->size());
+ for (unsigned i = 0; i < size; ++i) {
+ RefPtr<ListItemTearOff>& item = m_wrappers.at(i);
+ if (!item)
+ continue;
+ item->setAnimatedProperty(m_animatedProperty.get());
+ item->setValue(m_values->at(i));
+ }
+
+ ASSERT(!m_valuesIsCopy);
+ ASSERT(m_animatedProperty);
+ m_animatedProperty->commitChange();
+ }
+
+ void removeItemFromListIfNeeded(ListItemTearOff* newItem, unsigned* indexToModify)
+ {
+ // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
+ SVGAnimatedProperty* animatedPropertyOfItem = newItem->animatedProperty();
+ if (!animatedPropertyOfItem || !animatedPropertyOfItem->isAnimatedListTearOff())
+ return;
+
+ // 'newItem' is already living in another list. If it's not our list, synchronize the other lists wrappers after the removal.
+ bool livesInOtherList = animatedPropertyOfItem != m_animatedProperty;
+ int removedIndex = static_cast<SVGAnimatedListPropertyTearOff<PropertyType>*>(animatedPropertyOfItem)->removeItemFromList(newItem, livesInOtherList);
+ ASSERT(removedIndex != -1);
+
+ if (!indexToModify)
+ return;
+
+ // If the item lived in our list, adjust the insertion index.
+ if (!livesInOtherList) {
+ unsigned& index = *indexToModify;
+ // Spec: If the item is already in this list, note that the index of the item to (replace|insert before) is before the removal of the item.
+ if (static_cast<unsigned>(removedIndex) < index)
+ --index;
+ }
+ }
+
+private:
+ // Back pointer to the animated property that created us
+ // For example (text.x.baseVal): m_animatedProperty points to the 'x' SVGAnimatedLengthList object
+ RefPtr<SVGAnimatedProperty> m_animatedProperty;
+
+ // The role of this property (baseVal or animVal)
+ SVGPropertyRole m_role;
+
+ // For the example above (text.x.baseVal): A reference to the SVGLengthList& stored in the SVGTextElement, which we can directly modify
+ PropertyType* m_values;
+ bool m_valuesIsCopy : 1;
+
+ // A list of wrappers, which is always in sync between m_values.
+ ListWrapperCache m_wrappers;
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGListPropertyTearOff_h
diff --git a/WebCore/svg/properties/SVGProperty.h b/WebCore/svg/properties/SVGProperty.h
new file mode 100644
index 0000000..43167b7
--- /dev/null
+++ b/WebCore/svg/properties/SVGProperty.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGProperty_h
+#define SVGProperty_h
+
+#if ENABLE(SVG)
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+enum SVGPropertyRole {
+ UndefinedRole,
+ BaseValRole,
+ AnimValRole
+};
+
+class SVGProperty : public RefCounted<SVGProperty> {
+public:
+ virtual ~SVGProperty() { }
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGProperty_h
diff --git a/WebCore/svg/properties/SVGPropertyTearOff.h b/WebCore/svg/properties/SVGPropertyTearOff.h
new file mode 100644
index 0000000..17588b4
--- /dev/null
+++ b/WebCore/svg/properties/SVGPropertyTearOff.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGPropertyTearOff_h
+#define SVGPropertyTearOff_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedProperty.h"
+#include "SVGElement.h"
+#include "SVGProperty.h"
+
+namespace WebCore {
+
+template<typename PropertyType>
+class SVGPropertyTearOff : public SVGProperty {
+public:
+ typedef SVGPropertyTearOff<PropertyType> Self;
+
+ // Used for [SVGAnimatedProperty] types (for example: SVGAnimatedLength::baseVal()).
+ // Also used for list tear offs (for example: text.x.baseVal.getItem(0)).
+ static PassRefPtr<Self> create(SVGAnimatedProperty* animatedProperty, SVGPropertyRole, PropertyType& value)
+ {
+ ASSERT(animatedProperty);
+ return adoptRef(new Self(animatedProperty, value));
+ }
+
+ // Used for non-animated POD types (for example: SVGLength).
+ static PassRefPtr<Self> create(const PropertyType& initialValue)
+ {
+ return adoptRef(new Self(initialValue));
+ }
+
+ PropertyType& propertyReference() { return *m_value; }
+ SVGAnimatedProperty* animatedProperty() const { return m_animatedProperty.get(); }
+
+ virtual int removeItemFromList(SVGAnimatedProperty*) { return -1; }
+
+ // Used only by the list tear offs!
+ void setValue(PropertyType& value)
+ {
+ if (m_valueIsCopy)
+ delete m_value;
+ m_valueIsCopy = false;
+ m_value = &value;
+ }
+
+ void setAnimatedProperty(SVGAnimatedProperty* animatedProperty) { m_animatedProperty = animatedProperty; }
+
+ SVGElement* contextElement() const
+ {
+ if (!m_animatedProperty || m_valueIsCopy)
+ return 0;
+ return m_animatedProperty->contextElement();
+ }
+
+ void detachWrapper()
+ {
+ // Switch from a live value, to a non-live value.
+ // For example: <text x="50"/>
+ // var item = text.x.baseVal.getItem(0);
+ // text.setAttribute("x", "100");
+ // item.value still has to report '50' and it has to be possible to modify 'item'
+ // w/o changing the "new item" (with x=100) in the text element.
+ // Whenever the XML DOM modifies the "x" attribute, all existing wrappers are detached, using this function.
+ ASSERT(!m_valueIsCopy);
+ m_value = new PropertyType(*m_value);
+ m_valueIsCopy = true;
+ }
+
+ void commitChange()
+ {
+ if (!m_animatedProperty || m_valueIsCopy)
+ return;
+ m_animatedProperty->commitChange();
+ }
+
+private:
+ SVGPropertyTearOff(SVGAnimatedProperty* animatedProperty, PropertyType& value)
+ : m_animatedProperty(animatedProperty)
+ , m_value(&value)
+ , m_valueIsCopy(false)
+ {
+ // Using operator & is completly fine, as SVGAnimatedProperty owns this reference,
+ // and we're guaranteed to live as long as SVGAnimatedProperty does.
+ }
+
+ SVGPropertyTearOff(const PropertyType& initialValue)
+ : m_animatedProperty(0)
+ , m_value(new PropertyType(initialValue))
+ , m_valueIsCopy(true)
+ {
+ }
+
+ virtual ~SVGPropertyTearOff()
+ {
+ if (m_valueIsCopy)
+ delete m_value;
+ }
+
+ RefPtr<SVGAnimatedProperty> m_animatedProperty;
+ PropertyType* m_value;
+ bool m_valueIsCopy : 1;
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGPropertyTearOff_h
diff --git a/WebCore/svg/properties/SVGPropertyTraits.h b/WebCore/svg/properties/SVGPropertyTraits.h
new file mode 100644
index 0000000..8d82a61
--- /dev/null
+++ b/WebCore/svg/properties/SVGPropertyTraits.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGPropertyTraits_h
+#define SVGPropertyTraits_h
+
+#if ENABLE(SVG)
+#include "FloatRect.h"
+#include "SVGAngle.h"
+#include "SVGLength.h"
+#include "SVGLengthList.h"
+#include "SVGPreserveAspectRatio.h"
+#include <wtf/text/StringBuilder.h>
+
+namespace WebCore {
+
+template<typename PropertyType>
+struct SVGPropertyTraits { };
+
+template<>
+struct SVGPropertyTraits<SVGAngle> {
+ static SVGAngle initialValue() { return SVGAngle(); }
+ static String toString(const SVGAngle& type) { return type.valueAsString(); }
+};
+
+template<>
+struct SVGPropertyTraits<bool> {
+ static bool initialValue() { return false; }
+ static String toString(bool type) { return type ? "true" : "false"; }
+};
+
+template<>
+struct SVGPropertyTraits<int> {
+ static int initialValue() { return 0; }
+ static String toString(int type) { return String::number(type); }
+};
+
+template<>
+struct SVGPropertyTraits<long> {
+ static long initialValue() { return 0; }
+ static String toString(long type) { return String::number(type); }
+};
+
+template<>
+struct SVGPropertyTraits<SVGLength> {
+ static SVGLength initialValue() { return SVGLength(); }
+ static String toString(const SVGLength& type) { return type.valueAsString(); }
+};
+
+template<>
+struct SVGPropertyTraits<SVGLengthList> {
+ typedef SVGLength ListItemType;
+
+ static SVGLengthList initialValue() { return SVGLengthList(); }
+ static String toString(const SVGLengthList& type) { return type.valueAsString(); }
+};
+
+template<>
+struct SVGPropertyTraits<float> {
+ static float initialValue() { return 0; }
+ static String toString(float type) { return String::number(type); }
+};
+
+template<>
+struct SVGPropertyTraits<SVGPreserveAspectRatio> {
+ static SVGPreserveAspectRatio initialValue() { return SVGPreserveAspectRatio(); }
+ static String toString(const SVGPreserveAspectRatio& type) { return type.valueAsString(); }
+};
+
+template<>
+struct SVGPropertyTraits<FloatRect> {
+ static FloatRect initialValue() { return FloatRect(); }
+ static String toString(const FloatRect& type)
+ {
+ StringBuilder builder;
+ builder.append(String::number(type.x()));
+ builder.append(' ');
+ builder.append(String::number(type.y()));
+ builder.append(' ');
+ builder.append(String::number(type.width()));
+ builder.append(' ');
+ builder.append(String::number(type.height()));
+ builder.append(' ');
+ return builder.toString();
+ }
+};
+
+template<>
+struct SVGPropertyTraits<String> {
+ static String initialValue() { return String(); }
+ static String toString(const String& type) { return type; }
+};
+
+}
+
+#endif
+#endif
diff --git a/WebCore/webaudio/AudioContext.cpp b/WebCore/webaudio/AudioContext.cpp
index f971e6a..da7df1b 100644
--- a/WebCore/webaudio/AudioContext.cpp
+++ b/WebCore/webaudio/AudioContext.cpp
@@ -34,6 +34,8 @@
#include "AudioChannelSplitter.h"
#include "AudioGainNode.h"
#include "AudioListener.h"
+#include "AudioNodeInput.h"
+#include "AudioNodeOutput.h"
#include "AudioPannerNode.h"
#include "CachedAudio.h"
#include "ConvolverNode.h"
@@ -390,12 +392,12 @@ void AudioContext::unlock()
m_contextGraphMutex.unlock();
}
-bool AudioContext::isAudioThread()
+bool AudioContext::isAudioThread() const
{
return currentThread() == m_audioThread;
}
-bool AudioContext::isGraphOwner()
+bool AudioContext::isGraphOwner() const
{
return currentThread() == m_graphOwnerThread;
}
@@ -406,6 +408,23 @@ void AudioContext::addDeferredFinishDeref(AudioNode* node, AudioNode::RefType re
m_deferredFinishDerefList.append(AudioContext::RefInfo(node, refType));
}
+void AudioContext::handlePreRenderTasks()
+{
+ ASSERT(isAudioThread());
+
+ // At the beginning of every render quantum, try to update the internal rendering graph state (from main thread changes).
+ // It's OK if the tryLock() fails, we'll just take slightly longer to pick up the changes.
+ bool mustReleaseLock;
+ if (tryLock(mustReleaseLock)) {
+ // Fixup the state of any dirty AudioNodeInputs and AudioNodeOutputs.
+ handleDirtyAudioNodeInputs();
+ handleDirtyAudioNodeOutputs();
+
+ if (mustReleaseLock)
+ unlock();
+ }
+}
+
void AudioContext::handlePostRenderTasks()
{
ASSERT(isAudioThread());
@@ -424,6 +443,10 @@ void AudioContext::handlePostRenderTasks()
// Finally actually delete.
deleteMarkedNodes();
+ // Fixup the state of any dirty AudioNodeInputs and AudioNodeOutputs.
+ handleDirtyAudioNodeInputs();
+ handleDirtyAudioNodeOutputs();
+
if (mustReleaseLock)
unlock();
}
@@ -456,6 +479,18 @@ void AudioContext::deleteMarkedNodes()
while (size_t n = m_nodesToDelete.size()) {
AudioNode* node = m_nodesToDelete[n - 1];
m_nodesToDelete.removeLast();
+
+ // Before deleting the node, clear out any AudioNodeInputs from m_dirtyAudioNodeInputs.
+ unsigned numberOfInputs = node->numberOfInputs();
+ for (unsigned i = 0; i < numberOfInputs; ++i)
+ m_dirtyAudioNodeInputs.remove(node->input(i));
+
+ // Before deleting the node, clear out any AudioNodeOutputs from m_dirtyAudioNodeOutputs.
+ unsigned numberOfOutputs = node->numberOfOutputs();
+ for (unsigned i = 0; i < numberOfOutputs; ++i)
+ m_dirtyAudioNodeOutputs.remove(node->output(i));
+
+ // Finally, delete it.
delete node;
// Don't delete too many nodes per render quantum since we don't want to do too much work in the realtime audio thread.
@@ -464,6 +499,39 @@ void AudioContext::deleteMarkedNodes()
}
}
+void AudioContext::markAudioNodeInputDirty(AudioNodeInput* input)
+{
+ ASSERT(isGraphOwner());
+ m_dirtyAudioNodeInputs.add(input);
+}
+
+void AudioContext::markAudioNodeOutputDirty(AudioNodeOutput* output)
+{
+ ASSERT(isGraphOwner());
+ m_dirtyAudioNodeOutputs.add(output);
+}
+
+void AudioContext::handleDirtyAudioNodeInputs()
+{
+ ASSERT(isGraphOwner());
+
+ for (HashSet<AudioNodeInput*>::iterator i = m_dirtyAudioNodeInputs.begin(); i != m_dirtyAudioNodeInputs.end(); ++i)
+ (*i)->updateRenderingState();
+
+ m_dirtyAudioNodeInputs.clear();
+}
+
+void AudioContext::handleDirtyAudioNodeOutputs()
+{
+ ASSERT(isGraphOwner());
+
+ for (HashSet<AudioNodeOutput*>::iterator i = m_dirtyAudioNodeOutputs.begin(); i != m_dirtyAudioNodeOutputs.end(); ++i)
+ (*i)->updateRenderingState();
+
+ m_dirtyAudioNodeOutputs.clear();
+}
+
+
} // namespace WebCore
#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/AudioContext.h b/WebCore/webaudio/AudioContext.h
index 9fe1347..b79cd14 100644
--- a/WebCore/webaudio/AudioContext.h
+++ b/WebCore/webaudio/AudioContext.h
@@ -29,6 +29,7 @@
#include "AudioBus.h"
#include "AudioDestinationNode.h"
#include "HRTFDatabaseLoader.h"
+#include <wtf/HashSet.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -107,6 +108,9 @@ public:
// When a source node has no more processing to do (has finished playing), then it tells the context to dereference it.
void notifyNodeFinishedProcessing(AudioNode*);
+ // Called at the start of each render quantum.
+ void handlePreRenderTasks();
+
// Called at the end of each render quantum.
void handlePostRenderTasks();
@@ -132,7 +136,7 @@ public:
void setAudioThread(ThreadIdentifier thread) { m_audioThread = thread; } // FIXME: check either not initialized or the same
ThreadIdentifier audioThread() const { return m_audioThread; }
- bool isAudioThread();
+ bool isAudioThread() const;
// Returns true only after the audio thread has been started and then shutdown.
bool isAudioThreadFinished() { return m_isAudioThreadFinished; }
@@ -147,7 +151,7 @@ public:
void unlock();
// Returns true if this thread owns the context's lock.
- bool isGraphOwner();
+ bool isGraphOwner() const;
class AutoLocker {
public:
@@ -173,6 +177,10 @@ public:
// In the audio thread at the start of each render cycle, we'll call handleDeferredFinishDerefs().
void handleDeferredFinishDerefs();
+
+ // Only accessed when the graph lock is held.
+ void markAudioNodeInputDirty(AudioNodeInput*);
+ void markAudioNodeOutputDirty(AudioNodeOutput*);
private:
AudioContext(Document*);
@@ -214,6 +222,12 @@ private:
Vector<AudioNode*> m_nodesToDelete;
Vector<RefPtr<CachedAudio> > m_cachedAudioReferences;
+
+ // Only accessed when the graph lock is held.
+ HashSet<AudioNodeInput*> m_dirtyAudioNodeInputs;
+ HashSet<AudioNodeOutput*> m_dirtyAudioNodeOutputs;
+ void handleDirtyAudioNodeInputs();
+ void handleDirtyAudioNodeOutputs();
OwnPtr<AudioBus> m_temporaryMonoBus;
OwnPtr<AudioBus> m_temporaryStereoBus;
diff --git a/WebCore/webaudio/AudioNode.cpp b/WebCore/webaudio/AudioNode.cpp
index 9335c10..18ddd3b 100644
--- a/WebCore/webaudio/AudioNode.cpp
+++ b/WebCore/webaudio/AudioNode.cpp
@@ -1,29 +1,25 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2010, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
diff --git a/WebCore/webaudio/AudioNode.h b/WebCore/webaudio/AudioNode.h
index 52f886d..069407d 100644
--- a/WebCore/webaudio/AudioNode.h
+++ b/WebCore/webaudio/AudioNode.h
@@ -1,29 +1,25 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2010, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef AudioNode_h
@@ -134,6 +130,8 @@ public:
static void printNodeCounts();
#endif
+ bool isMarkedForDeletion() const { return m_isMarkedForDeletion; }
+
protected:
// Inputs and outputs must be created before the AudioNode is initialized.
void addInput(PassOwnPtr<AudioNodeInput>);
diff --git a/WebCore/webaudio/AudioNode.idl b/WebCore/webaudio/AudioNode.idl
index 5ed47cb..dad5454 100644
--- a/WebCore/webaudio/AudioNode.idl
+++ b/WebCore/webaudio/AudioNode.idl
@@ -1,29 +1,25 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2010, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module audio {
diff --git a/WebCore/webaudio/AudioNodeInput.cpp b/WebCore/webaudio/AudioNodeInput.cpp
new file mode 100644
index 0000000..9fd1852
--- /dev/null
+++ b/WebCore/webaudio/AudioNodeInput.cpp
@@ -0,0 +1,270 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioNodeInput.h"
+
+#include "AudioContext.h"
+#include "AudioNode.h"
+#include "AudioNodeOutput.h"
+#include <algorithm>
+
+using namespace std;
+
+namespace WebCore {
+
+AudioNodeInput::AudioNodeInput(AudioNode* node)
+ : m_node(node)
+ , m_renderingStateNeedUpdating(false)
+{
+ m_monoSummingBus = adoptPtr(new AudioBus(1, AudioNode::ProcessingSizeInFrames));
+ m_stereoSummingBus = adoptPtr(new AudioBus(2, AudioNode::ProcessingSizeInFrames));
+}
+
+void AudioNodeInput::connect(AudioNodeOutput* output)
+{
+ ASSERT(context()->isGraphOwner());
+
+ ASSERT(output && node());
+ if (!output || !node())
+ return;
+
+ // Check if we're already connected to this output.
+ if (m_outputs.contains(output))
+ return;
+
+ output->addInput(this);
+ m_outputs.add(output);
+ changedOutputs();
+
+ // Sombody has just connected to us, so count it as a reference.
+ node()->ref(AudioNode::RefTypeConnection);
+}
+
+void AudioNodeInput::disconnect(AudioNodeOutput* output)
+{
+ ASSERT(context()->isGraphOwner());
+
+ ASSERT(output && node());
+ if (!output || !node())
+ return;
+
+ // First try to disconnect from "active" connections.
+ if (m_outputs.contains(output)) {
+ m_outputs.remove(output);
+ changedOutputs();
+ output->removeInput(this);
+ node()->deref(AudioNode::RefTypeConnection); // Note: it's important to return immediately after all deref() calls since the node may be deleted.
+ return;
+ }
+
+ // Otherwise, try to disconnect from disabled connections.
+ if (m_disabledOutputs.contains(output)) {
+ m_disabledOutputs.remove(output);
+ output->removeInput(this);
+ node()->deref(AudioNode::RefTypeDisabled); // Note: it's important to return immediately after all deref() calls since the node may be deleted.
+ return;
+ }
+
+ ASSERT_NOT_REACHED();
+}
+
+void AudioNodeInput::disable(AudioNodeOutput* output)
+{
+ ASSERT(context()->isGraphOwner());
+
+ ASSERT(output && node());
+ if (!output || !node())
+ return;
+
+ ASSERT(m_outputs.contains(output));
+
+ m_disabledOutputs.add(output);
+ m_outputs.remove(output);
+ changedOutputs();
+
+ node()->ref(AudioNode::RefTypeDisabled);
+ node()->deref(AudioNode::RefTypeConnection); // Note: it's important to return immediately after all deref() calls since the node may be deleted.
+}
+
+void AudioNodeInput::enable(AudioNodeOutput* output)
+{
+ ASSERT(context()->isGraphOwner());
+
+ ASSERT(output && node());
+ if (!output || !node())
+ return;
+
+ ASSERT(m_disabledOutputs.contains(output));
+
+ // Move output from disabled list to active list.
+ m_outputs.add(output);
+ m_disabledOutputs.remove(output);
+ changedOutputs();
+
+ node()->ref(AudioNode::RefTypeConnection);
+ node()->deref(AudioNode::RefTypeDisabled); // Note: it's important to return immediately after all deref() calls since the node may be deleted.
+}
+
+void AudioNodeInput::changedOutputs()
+{
+ ASSERT(context()->isGraphOwner());
+ if (!m_renderingStateNeedUpdating && !node()->isMarkedForDeletion()) {
+ context()->markAudioNodeInputDirty(this);
+ m_renderingStateNeedUpdating = true;
+ }
+}
+
+void AudioNodeInput::updateRenderingState()
+{
+ ASSERT(context()->isAudioThread() && context()->isGraphOwner());
+
+ if (m_renderingStateNeedUpdating && !node()->isMarkedForDeletion()) {
+ // Copy from m_outputs to m_renderingOutputs.
+ m_renderingOutputs.resize(m_outputs.size());
+ unsigned j = 0;
+ for (HashSet<AudioNodeOutput*>::iterator i = m_outputs.begin(); i != m_outputs.end(); ++i, ++j) {
+ AudioNodeOutput* output = *i;
+ m_renderingOutputs[j] = output;
+ output->updateRenderingState();
+ }
+
+ node()->checkNumberOfChannelsForInput(this);
+
+ m_renderingStateNeedUpdating = false;
+ }
+}
+
+unsigned AudioNodeInput::numberOfChannels() const
+{
+ // Find the number of channels of the connection with the largest number of channels.
+ unsigned maxChannels = 1; // one channel is the minimum allowed
+
+ for (HashSet<AudioNodeOutput*>::iterator i = m_outputs.begin(); i != m_outputs.end(); ++i) {
+ AudioNodeOutput* output = *i;
+ maxChannels = max(maxChannels, output->bus()->numberOfChannels());
+ }
+
+ return maxChannels;
+}
+
+unsigned AudioNodeInput::numberOfRenderingChannels()
+{
+ ASSERT(context()->isAudioThread());
+
+ // Find the number of channels of the rendering connection with the largest number of channels.
+ unsigned maxChannels = 1; // one channel is the minimum allowed
+
+ for (unsigned i = 0; i < numberOfRenderingConnections(); ++i)
+ maxChannels = max(maxChannels, renderingOutput(i)->bus()->numberOfChannels());
+
+ return maxChannels;
+}
+
+AudioBus* AudioNodeInput::bus()
+{
+ ASSERT(context()->isAudioThread());
+
+ // Handle single connection specially to allow for in-place processing.
+ if (numberOfRenderingConnections() == 1)
+ return renderingOutput(0)->bus();
+
+ // Multiple connections case (or no connections).
+ return internalSummingBus();
+}
+
+AudioBus* AudioNodeInput::internalSummingBus()
+{
+ ASSERT(context()->isAudioThread());
+
+ // We must pick a summing bus which is the right size to handle the largest connection.
+ switch (numberOfRenderingChannels()) {
+ case 1:
+ return m_monoSummingBus.get();
+ case 2:
+ return m_stereoSummingBus.get();
+ // FIXME: could implement more than just mono and stereo mixing in the future
+ }
+
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
+void AudioNodeInput::sumAllConnections(AudioBus* summingBus, size_t framesToProcess)
+{
+ ASSERT(context()->isAudioThread());
+
+ // We shouldn't be calling this method if there's only one connection, since it's less efficient.
+ ASSERT(numberOfRenderingConnections() > 1);
+
+ ASSERT(summingBus);
+ if (!summingBus)
+ return;
+
+ summingBus->zero();
+
+ for (unsigned i = 0; i < numberOfRenderingConnections(); ++i) {
+ AudioNodeOutput* output = renderingOutput(i);
+ ASSERT(output);
+
+ // Render audio from this output.
+ AudioBus* connectionBus = output->pull(0, framesToProcess);
+
+ // Sum, with unity-gain.
+ summingBus->sumFrom(*connectionBus);
+ }
+}
+
+AudioBus* AudioNodeInput::pull(AudioBus* inPlaceBus, size_t framesToProcess)
+{
+ ASSERT(context()->isAudioThread());
+
+ // Handle single connection case.
+ if (numberOfRenderingConnections() == 1) {
+ // The output will optimize processing using inPlaceBus if it's able.
+ AudioNodeOutput* output = this->renderingOutput(0);
+ return output->pull(inPlaceBus, framesToProcess);
+ }
+
+ AudioBus* internalSummingBus = this->internalSummingBus();
+
+ if (!numberOfRenderingConnections()) {
+ // At least, generate silence if we're not connected to anything.
+ // FIXME: if we wanted to get fancy, we could propagate a 'silent hint' here to optimize the downstream graph processing.
+ internalSummingBus->zero();
+ return internalSummingBus;
+ }
+
+ // Handle multiple connections case.
+ sumAllConnections(internalSummingBus, framesToProcess);
+
+ return internalSummingBus;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/AudioNodeInput.h b/WebCore/webaudio/AudioNodeInput.h
new file mode 100644
index 0000000..1d90986
--- /dev/null
+++ b/WebCore/webaudio/AudioNodeInput.h
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AudioNodeInput_h
+#define AudioNodeInput_h
+
+#include "AudioBus.h"
+#include "AudioNode.h"
+#include <wtf/HashSet.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class AudioNode;
+class AudioNodeOutput;
+
+// An AudioNodeInput represents an input to an AudioNode and can be connected from one or more AudioNodeOutputs.
+// In the case of multiple connections, the input will act as a unity-gain summing junction, mixing all the outputs.
+// The number of channels of the input's bus is the maximum of the number of channels of all its connections.
+
+class AudioNodeInput {
+public:
+ AudioNodeInput(AudioNode*);
+
+ // Can be called from any thread.
+ AudioNode* node() const { return m_node; }
+ AudioContext* context() { return m_node->context(); }
+
+ // Must be called with the context's graph lock.
+ void connect(AudioNodeOutput*);
+ void disconnect(AudioNodeOutput*);
+
+ // disable() will take the output out of the active connections list and set aside in a disabled list.
+ // enable() will put the output back into the active connections list.
+ // Must be called with the context's graph lock.
+ void enable(AudioNodeOutput*);
+ void disable(AudioNodeOutput*);
+
+ // pull() processes all of the AudioNodes connected to us.
+ // In the case of multiple connections it sums the result into an internal summing bus.
+ // In the single connection case, it allows in-place processing where possible using inPlaceBus.
+ // It returns the bus which it rendered into, returning inPlaceBus if in-place processing was performed.
+ // Called from context's audio thread.
+ AudioBus* pull(AudioBus* inPlaceBus, size_t framesToProcess);
+
+ // bus() contains the rendered audio after pull() has been called for each time quantum.
+ // Called from context's audio thread.
+ AudioBus* bus();
+
+ // This copies m_outputs to m_renderingOutputs. Please see comments for these lists below.
+ // This must be called when we own the context's graph lock in the audio thread at the very start or end of the render quantum.
+ void updateRenderingState();
+
+ // Rendering code accesses its version of the current connections here.
+ unsigned numberOfRenderingConnections() const { return m_renderingOutputs.size(); }
+ AudioNodeOutput* renderingOutput(unsigned i) { return m_renderingOutputs[i]; }
+ const AudioNodeOutput* renderingOutput(unsigned i) const { return m_renderingOutputs[i]; }
+ bool isConnected() const { return numberOfRenderingConnections() > 0; }
+
+ // The number of channels of the connection with the largest number of channels.
+ unsigned numberOfChannels() const;
+
+private:
+ AudioNode* m_node;
+
+ // m_outputs contains the AudioNodeOutputs representing current connections which are not disabled.
+ // The rendering code should never use this directly, but instead uses m_renderingOutputs.
+ HashSet<AudioNodeOutput*> m_outputs;
+
+ // numberOfConnections() should never be called from the audio rendering thread.
+ // Instead numberOfRenderingConnections() and renderingOutput() should be used.
+ unsigned numberOfConnections() const { return m_outputs.size(); }
+
+ // This must be called whenever we modify m_outputs.
+ void changedOutputs();
+
+ // m_renderingOutputs is a copy of m_outputs which will never be modified during the graph rendering on the audio thread.
+ // This is the list which is used by the rendering code.
+ // Whenever m_outputs is modified, the context is told so it can later update m_renderingOutputs from m_outputs at a safe time.
+ // Most of the time, m_renderingOutputs is identical to m_outputs.
+ Vector<AudioNodeOutput*> m_renderingOutputs;
+
+ // m_renderingStateNeedUpdating keeps track if m_outputs is modified.
+ bool m_renderingStateNeedUpdating;
+
+ // The number of channels of the rendering connection with the largest number of channels.
+ unsigned numberOfRenderingChannels();
+
+ // m_disabledOutputs contains the AudioNodeOutputs which are disabled (will not be processed) by the audio graph rendering.
+ // But, from JavaScript's perspective, these outputs are still connected to us.
+ // Generally, these represent disabled connections from "notes" which have finished playing but are not yet garbage collected.
+ HashSet<AudioNodeOutput*> m_disabledOutputs;
+
+ // Called from context's audio thread.
+ AudioBus* internalSummingBus();
+ void sumAllConnections(AudioBus* summingBus, size_t framesToProcess);
+
+ OwnPtr<AudioBus> m_monoSummingBus;
+ OwnPtr<AudioBus> m_stereoSummingBus;
+};
+
+} // namespace WebCore
+
+#endif // AudioNodeInput_h
diff --git a/WebCore/webaudio/AudioNodeOutput.cpp b/WebCore/webaudio/AudioNodeOutput.cpp
new file mode 100644
index 0000000..4c777e6
--- /dev/null
+++ b/WebCore/webaudio/AudioNodeOutput.cpp
@@ -0,0 +1,216 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioNodeOutput.h"
+
+#include "AudioBus.h"
+#include "AudioContext.h"
+#include "AudioNodeInput.h"
+#include <wtf/Threading.h>
+
+namespace WebCore {
+
+AudioNodeOutput::AudioNodeOutput(AudioNode* node, unsigned numberOfChannels)
+ : m_node(node)
+ , m_numberOfChannels(numberOfChannels)
+ , m_desiredNumberOfChannels(numberOfChannels)
+ , m_internalOutputBus(0)
+ , m_actualDestinationBus(0)
+ , m_isEnabled(true)
+ , m_renderingFanOutCount(0)
+{
+ m_monoInternalBus = adoptPtr(new AudioBus(1, AudioNode::ProcessingSizeInFrames));
+ m_stereoInternalBus = adoptPtr(new AudioBus(2, AudioNode::ProcessingSizeInFrames));
+ setInternalBus();
+}
+
+void AudioNodeOutput::setNumberOfChannels(unsigned numberOfChannels)
+{
+ ASSERT(context()->isGraphOwner());
+
+ m_desiredNumberOfChannels = numberOfChannels;
+
+ if (context()->isAudioThread()) {
+ // If we're in the audio thread then we can take care of it right away (we should be at the very start or end of a rendering quantum).
+ updateNumberOfChannels();
+ } else {
+ // Let the context take care of it in the audio thread in the pre and post render tasks.
+ context()->markAudioNodeOutputDirty(this);
+ }
+}
+
+void AudioNodeOutput::setInternalBus()
+{
+ switch (m_numberOfChannels) {
+ case 0:
+ case 1:
+ m_internalOutputBus = m_monoInternalBus.get();
+ break;
+ case 2:
+ m_internalOutputBus = m_stereoInternalBus.get();
+ break;
+ default:
+ // FIXME: later we can fully implement more than stereo, 5.1, etc.
+ ASSERT_NOT_REACHED();
+ }
+
+ // This may later be changed in pull() to point to an in-place bus with the same number of channels.
+ m_actualDestinationBus = m_internalOutputBus;
+}
+
+void AudioNodeOutput::updateRenderingState()
+{
+ updateNumberOfChannels();
+ m_renderingFanOutCount = fanOutCount();
+}
+
+void AudioNodeOutput::updateNumberOfChannels()
+{
+ ASSERT(context()->isAudioThread() && context()->isGraphOwner());
+
+ if (m_numberOfChannels != m_desiredNumberOfChannels) {
+ m_numberOfChannels = m_desiredNumberOfChannels;
+ setInternalBus();
+ propagateChannelCount();
+ }
+}
+
+void AudioNodeOutput::propagateChannelCount()
+{
+ ASSERT(context()->isAudioThread() && context()->isGraphOwner());
+
+ if (isChannelCountKnown()) {
+ // Announce to any nodes we're connected to that we changed our channel count for its input.
+ for (InputsIterator i = m_inputs.begin(); i != m_inputs.end(); ++i) {
+ AudioNodeInput* input = *i;
+ AudioNode* connectionNode = input->node();
+ connectionNode->checkNumberOfChannelsForInput(input);
+ }
+ }
+}
+
+AudioBus* AudioNodeOutput::pull(AudioBus* inPlaceBus, size_t framesToProcess)
+{
+ ASSERT(context()->isAudioThread());
+ ASSERT(m_renderingFanOutCount > 0);
+
+ // Causes our AudioNode to process if it hasn't already for this render quantum.
+ // We try to do in-place processing (using inPlaceBus) if at all possible,
+ // but we can't process in-place if we're connected to more than one input (fan-out > 1).
+ // In this case pull() is called multiple times per rendering quantum, and the processIfNecessary() call below will
+ // cause our node to process() only the first time, caching the output in m_internalOutputBus for subsequent calls.
+
+ bool isInPlace = inPlaceBus && inPlaceBus->numberOfChannels() == numberOfChannels() && m_renderingFanOutCount == 1;
+
+ // Setup the actual destination bus for processing when our node's process() method gets called in processIfNecessary() below.
+ m_actualDestinationBus = isInPlace ? inPlaceBus : m_internalOutputBus;
+
+ node()->processIfNecessary(framesToProcess);
+ return m_actualDestinationBus;
+}
+
+AudioBus* AudioNodeOutput::bus() const
+{
+ ASSERT(const_cast<AudioNodeOutput*>(this)->context()->isAudioThread());
+ ASSERT(m_actualDestinationBus);
+ return m_actualDestinationBus;
+}
+
+unsigned AudioNodeOutput::renderingFanOutCount() const
+{
+ return m_renderingFanOutCount;
+}
+
+unsigned AudioNodeOutput::fanOutCount()
+{
+ ASSERT(context()->isGraphOwner());
+ return m_inputs.size();
+}
+
+void AudioNodeOutput::addInput(AudioNodeInput* input)
+{
+ ASSERT(context()->isGraphOwner());
+
+ ASSERT(input);
+ if (!input)
+ return;
+
+ m_inputs.add(input);
+}
+
+void AudioNodeOutput::removeInput(AudioNodeInput* input)
+{
+ ASSERT(context()->isGraphOwner());
+
+ ASSERT(input);
+ if (!input)
+ return;
+
+ m_inputs.remove(input);
+}
+
+void AudioNodeOutput::disconnectAllInputs()
+{
+ ASSERT(context()->isGraphOwner());
+
+ // AudioNodeInput::disconnect() changes m_inputs by calling removeInput().
+ while (!m_inputs.isEmpty()) {
+ AudioNodeInput* input = *m_inputs.begin();
+ input->disconnect(this);
+ }
+}
+
+void AudioNodeOutput::disable()
+{
+ ASSERT(context()->isGraphOwner());
+
+ if (m_isEnabled) {
+ for (InputsIterator i = m_inputs.begin(); i != m_inputs.end(); ++i) {
+ AudioNodeInput* input = *i;
+ input->disable(this);
+ }
+ m_isEnabled = false;
+ }
+}
+
+void AudioNodeOutput::enable()
+{
+ ASSERT(context()->isGraphOwner());
+
+ if (!m_isEnabled) {
+ for (InputsIterator i = m_inputs.begin(); i != m_inputs.end(); ++i) {
+ AudioNodeInput* input = *i;
+ input->enable(this);
+ }
+ m_isEnabled = true;
+ }
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/AudioNodeOutput.h b/WebCore/webaudio/AudioNodeOutput.h
new file mode 100644
index 0000000..7114b38
--- /dev/null
+++ b/WebCore/webaudio/AudioNodeOutput.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AudioNodeOutput_h
+#define AudioNodeOutput_h
+
+#include "AudioBus.h"
+#include "AudioNode.h"
+#include <wtf/HashSet.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class AudioContext;
+class AudioNodeInput;
+
+// AudioNodeOutput represents a single output for an AudioNode.
+// It may be connected to one or more AudioNodeInputs.
+
+class AudioNodeOutput {
+public:
+ // It's OK to pass 0 for numberOfChannels in which case setNumberOfChannels() must be called later on.
+ AudioNodeOutput(AudioNode*, unsigned numberOfChannels);
+
+ // Can be called from any thread.
+ AudioNode* node() const { return m_node; }
+ AudioContext* context() { return m_node->context(); }
+
+ // Causes our AudioNode to process if it hasn't already for this render quantum.
+ // It returns the bus containing the processed audio for this output, returning inPlaceBus if in-place processing was possible.
+ // Called from context's audio thread.
+ AudioBus* pull(AudioBus* inPlaceBus, size_t framesToProcess);
+
+ // bus() will contain the rendered audio after pull() is called for each rendering time quantum.
+ // Called from context's audio thread.
+ AudioBus* bus() const;
+
+ // fanOutCount() is the number of AudioNodeInputs that we're connected to.
+ // This function should not be called in audio thread rendering code, instead renderingFanOutCount() should be used.
+ // It must be called with the context's graph lock.
+ unsigned fanOutCount();
+
+ // renderingFanOutCount() is the number of AudioNodeInputs that we're connected to during rendering.
+ // Unlike fanOutCount() it will not change during the course of a render quantum.
+ unsigned renderingFanOutCount() const;
+
+ // It must be called with the context's graph lock.
+ void disconnectAllInputs();
+
+ void setNumberOfChannels(unsigned);
+ unsigned numberOfChannels() const { return m_numberOfChannels; }
+ bool isChannelCountKnown() const { return numberOfChannels() > 0; }
+
+ // Disable/Enable happens when there are still JavaScript references to a node, but it has otherwise "finished" its work.
+ // For example, when a note has finished playing. It is kept around, because it may be played again at a later time.
+ // They must be called with the context's graph lock.
+ void disable();
+ void enable();
+
+ // updateRenderingState() is called in the audio thread at the start or end of the render quantum to handle any recent changes to the graph state.
+ // It must be called with the context's graph lock.
+ void updateRenderingState();
+
+private:
+ AudioNode* m_node;
+
+ friend class AudioNodeInput;
+
+ // These are called from AudioNodeInput.
+ // They must be called with the context's graph lock.
+ void addInput(AudioNodeInput*);
+ void removeInput(AudioNodeInput*);
+
+ // setInternalBus() sets m_internalOutputBus appropriately for the number of channels.
+ // It is called in the constructor or in the audio thread with the context's graph lock.
+ void setInternalBus();
+
+ // Announce to any nodes we're connected to that we changed our channel count for its input.
+ // It must be called in the audio thread with the context's graph lock.
+ void propagateChannelCount();
+
+ // updateNumberOfChannels() is called in the audio thread at the start or end of the render quantum to pick up channel changes.
+ // It must be called with the context's graph lock.
+ void updateNumberOfChannels();
+
+ // m_numberOfChannels will only be changed in the audio thread.
+ // The main thread sets m_desiredNumberOfChannels which will later get picked up in the audio thread in updateNumberOfChannels().
+ unsigned m_numberOfChannels;
+ unsigned m_desiredNumberOfChannels;
+
+ // m_internalOutputBus will point to either m_monoInternalBus or m_stereoInternalBus.
+ // It must only be changed in the audio thread (or constructor).
+ AudioBus* m_internalOutputBus;
+ OwnPtr<AudioBus> m_monoInternalBus;
+ OwnPtr<AudioBus> m_stereoInternalBus;
+
+ // m_actualDestinationBus is set in pull() and will either point to one of our internal busses or to the in-place bus.
+ // It must only be changed in the audio thread (or constructor).
+ AudioBus* m_actualDestinationBus;
+
+ HashSet<AudioNodeInput*> m_inputs;
+ typedef HashSet<AudioNodeInput*>::iterator InputsIterator;
+ bool m_isEnabled;
+
+ // For the purposes of rendering, keeps track of the number of inputs we're connected to.
+ // This value should only be changed at the very start or end of the rendering quantum.
+ unsigned m_renderingFanOutCount;
+};
+
+} // namespace WebCore
+
+#endif // AudioNodeOutput_h
diff --git a/WebCore/webaudio/DelayNode.cpp b/WebCore/webaudio/DelayNode.cpp
new file mode 100644
index 0000000..29fceae
--- /dev/null
+++ b/WebCore/webaudio/DelayNode.cpp
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "DelayNode.h"
+
+namespace WebCore {
+
+DelayNode::DelayNode(AudioContext* context, double sampleRate)
+ : AudioBasicProcessorNode(context, sampleRate)
+{
+ m_processor = adoptPtr(new DelayProcessor(sampleRate, 1));
+ setType(NodeTypeDelay);
+}
+
+AudioParam* DelayNode::delayTime()
+{
+ return delayProcessor()->delayTime();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/DelayNode.h b/WebCore/webaudio/DelayNode.h
new file mode 100644
index 0000000..93ad227
--- /dev/null
+++ b/WebCore/webaudio/DelayNode.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DelayNode_h
+#define DelayNode_h
+
+#include "AudioBasicProcessorNode.h"
+#include "DelayProcessor.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class AudioParam;
+
+class DelayNode : public AudioBasicProcessorNode {
+public:
+ static PassRefPtr<DelayNode> create(AudioContext* context, double sampleRate)
+ {
+ return adoptRef(new DelayNode(context, sampleRate));
+ }
+
+ AudioParam* delayTime();
+
+private:
+ DelayNode(AudioContext*, double sampleRate);
+
+ DelayProcessor* delayProcessor() { return static_cast<DelayProcessor*>(processor()); }
+};
+
+} // namespace WebCore
+
+#endif // DelayNode_h
diff --git a/WebCore/webaudio/DelayNode.idl b/WebCore/webaudio/DelayNode.idl
new file mode 100644
index 0000000..7756627
--- /dev/null
+++ b/WebCore/webaudio/DelayNode.idl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module audio {
+ interface [
+ Conditional=WEB_AUDIO,
+ GenerateToJS
+ ] DelayNode : AudioNode {
+ readonly attribute AudioParam delayTime;
+ };
+}
diff --git a/WebCore/webaudio/DelayProcessor.cpp b/WebCore/webaudio/DelayProcessor.cpp
new file mode 100644
index 0000000..5fdc8df
--- /dev/null
+++ b/WebCore/webaudio/DelayProcessor.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "DelayProcessor.h"
+
+#include "DelayDSPKernel.h"
+
+namespace WebCore {
+
+DelayProcessor::DelayProcessor(double sampleRate, unsigned numberOfChannels)
+ : AudioDSPKernelProcessor(sampleRate, numberOfChannels)
+{
+ m_delayTime = AudioParam::create("delayTime", 0.0, 0.0, 1.0);
+}
+
+DelayProcessor::~DelayProcessor()
+{
+ if (isInitialized())
+ uninitialize();
+}
+
+PassOwnPtr<AudioDSPKernel> DelayProcessor::createKernel()
+{
+ return adoptPtr(new DelayDSPKernel(this));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/DelayProcessor.h b/WebCore/webaudio/DelayProcessor.h
new file mode 100644
index 0000000..4844c4b
--- /dev/null
+++ b/WebCore/webaudio/DelayProcessor.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DelayProcessor_h
+#define DelayProcessor_h
+
+#include "AudioDSPKernelProcessor.h"
+#include "AudioParam.h"
+
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class AudioDSPKernel;
+
+class DelayProcessor : public AudioDSPKernelProcessor {
+public:
+ DelayProcessor(double sampleRate, unsigned numberOfChannels);
+ virtual ~DelayProcessor();
+
+ virtual PassOwnPtr<AudioDSPKernel> createKernel();
+
+ AudioParam* delayTime() const { return m_delayTime.get(); }
+
+private:
+ RefPtr<AudioParam> m_delayTime;
+};
+
+} // namespace WebCore
+
+#endif // DelayProcessor_h
diff --git a/WebCore/websockets/WebSocketChannel.cpp b/WebCore/websockets/WebSocketChannel.cpp
index 45bb206..01c2bef 100644
--- a/WebCore/websockets/WebSocketChannel.cpp
+++ b/WebCore/websockets/WebSocketChannel.cpp
@@ -36,7 +36,7 @@
#include "CookieJar.h"
#include "Document.h"
-#include "InspectorController.h"
+#include "InspectorInstrumentation.h"
#include "Logging.h"
#include "Page.h"
#include "PlatformString.h"
@@ -67,14 +67,14 @@ WebSocketChannel::WebSocketChannel(ScriptExecutionContext* context, WebSocketCha
, m_closed(false)
, m_shouldDiscardReceivedData(false)
, m_unhandledBufferedAmount(0)
-#if ENABLE(INSPECTOR)
, m_identifier(0)
-#endif
{
-#if ENABLE(INSPECTOR)
- if (InspectorController* controller = m_context->inspectorController())
- controller->didCreateWebSocket(identifier(), url, m_context->url());
-#endif
+ if (m_context->isDocument())
+ if (Page* page = static_cast<Document*>(m_context)->page())
+ m_identifier = page->progress()->createUniqueIdentifier();
+
+ if (m_identifier)
+ InspectorInstrumentation::didCreateWebSocket(m_context, m_identifier, url, m_context->url());
}
WebSocketChannel::~WebSocketChannel()
@@ -124,11 +124,8 @@ void WebSocketChannel::close()
void WebSocketChannel::disconnect()
{
LOG(Network, "WebSocketChannel %p disconnect", this);
-#if ENABLE(INSPECTOR)
- if (m_context)
- if (InspectorController* controller = m_context->inspectorController())
- controller->didCloseWebSocket(identifier());
-#endif
+ if (m_identifier && m_context)
+ InspectorInstrumentation::didCloseWebSocket(m_context, m_identifier);
m_handshake.clearScriptExecutionContext();
m_client = 0;
m_context = 0;
@@ -154,10 +151,8 @@ void WebSocketChannel::didOpen(SocketStreamHandle* handle)
ASSERT(handle == m_handle);
if (!m_context)
return;
-#if ENABLE(INSPECTOR)
- if (InspectorController* controller = m_context->inspectorController())
- controller->willSendWebSocketHandshakeRequest(identifier(), m_handshake.clientHandshakeRequest());
-#endif
+ if (m_identifier)
+ InspectorInstrumentation::willSendWebSocketHandshakeRequest(m_context, m_identifier, m_handshake.clientHandshakeRequest());
CString handshakeMessage = m_handshake.clientHandshakeMessage();
if (!handle->send(handshakeMessage.data(), handshakeMessage.length())) {
m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error sending handshake message.", 0, m_handshake.clientOrigin());
@@ -168,11 +163,8 @@ void WebSocketChannel::didOpen(SocketStreamHandle* handle)
void WebSocketChannel::didClose(SocketStreamHandle* handle)
{
LOG(Network, "WebSocketChannel %p didClose", this);
-#if ENABLE(INSPECTOR)
- if (m_context)
- if (InspectorController* controller = m_context->inspectorController())
- controller->didCloseWebSocket(identifier());
-#endif
+ if (m_identifier && m_context)
+ InspectorInstrumentation::didCloseWebSocket(m_context, m_identifier);
ASSERT_UNUSED(handle, handle == m_handle || !m_handle);
m_closed = true;
if (m_handle) {
@@ -276,10 +268,8 @@ bool WebSocketChannel::processBuffer()
if (headerLength <= 0)
return false;
if (m_handshake.mode() == WebSocketHandshake::Connected) {
-#if ENABLE(INSPECTOR)
- if (InspectorController* controller = m_context->inspectorController())
- controller->didReceiveWebSocketHandshakeResponse(identifier(), m_handshake.serverHandshakeResponse());
-#endif
+ if (m_identifier)
+ InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(m_context, m_identifier, m_handshake.serverHandshakeResponse());
if (!m_handshake.serverSetCookie().isEmpty()) {
if (m_context->isDocument()) {
Document* document = static_cast<Document*>(m_context);
@@ -397,21 +387,6 @@ void WebSocketChannel::resumeTimerFired(Timer<WebSocketChannel>* timer)
didClose(m_handle.get());
}
-#if ENABLE(INSPECTOR)
-unsigned long WebSocketChannel::identifier()
-{
- if (m_identifier)
- return m_identifier;
-
- if (InspectorController* controller = m_context->inspectorController())
- if (Page* page = controller->inspectedPage())
- m_identifier = page->progress()->createUniqueIdentifier();
-
- ASSERT(m_identifier);
- return m_identifier;
-}
-#endif // ENABLE(INSPECTOR)
-
} // namespace WebCore
#endif // ENABLE(WEB_SOCKETS)
diff --git a/WebCore/websockets/WebSocketChannel.h b/WebCore/websockets/WebSocketChannel.h
index a08e6bb..9c52377 100644
--- a/WebCore/websockets/WebSocketChannel.h
+++ b/WebCore/websockets/WebSocketChannel.h
@@ -84,10 +84,6 @@ namespace WebCore {
bool processBuffer();
void resumeTimerFired(Timer<WebSocketChannel>* timer);
-#if ENABLE(INSPECTOR)
- unsigned long identifier();
-#endif
-
ScriptExecutionContext* m_context;
WebSocketChannelClient* m_client;
WebSocketHandshake m_handshake;
@@ -101,9 +97,7 @@ namespace WebCore {
bool m_shouldDiscardReceivedData;
unsigned long m_unhandledBufferedAmount;
-#if ENABLE(INSPECTOR)
- unsigned long m_identifier;
-#endif
+ unsigned long m_identifier; // m_identifier == 0 means that we could not obtain a valid identifier.
};
} // namespace WebCore
diff --git a/WebCore/workers/WorkerContext.cpp b/WebCore/workers/WorkerContext.cpp
index a535191..345e5b7 100644
--- a/WebCore/workers/WorkerContext.cpp
+++ b/WebCore/workers/WorkerContext.cpp
@@ -69,6 +69,7 @@
#include "DOMFileSystemSync.h"
#include "ErrorCallback.h"
#include "FileError.h"
+#include "FileException.h"
#include "FileSystemCallback.h"
#include "FileSystemCallbacks.h"
#include "LocalFileSystem.h"
@@ -355,13 +356,13 @@ void WorkerContext::revokeObjectURL(const String& blobURLString)
void WorkerContext::requestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
if (!AsyncFileSystem::isAvailable() || !securityOrigin()->canAccessFileSystem()) {
- DOMFileSystem::scheduleCallback(this, errorCallback, FileError::create(SECURITY_ERR));
+ DOMFileSystem::scheduleCallback(this, errorCallback, FileError::create(FileError::SECURITY_ERR));
return;
}
AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type);
if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent) {
- DOMFileSystem::scheduleCallback(this, errorCallback, FileError::create(INVALID_MODIFICATION_ERR));
+ DOMFileSystem::scheduleCallback(this, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
return;
}
@@ -372,13 +373,13 @@ PassRefPtr<DOMFileSystemSync> WorkerContext::requestFileSystemSync(int type, lon
{
ec = 0;
if (!AsyncFileSystem::isAvailable() || !securityOrigin()->canAccessFileSystem()) {
- ec = SECURITY_ERR;
+ ec = FileException::SECURITY_ERR;
return 0;
}
AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type);
if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
diff --git a/WebCore/xml/XSLTProcessor.cpp b/WebCore/xml/XSLTProcessor.cpp
index bdae0cd..5fd009c 100644
--- a/WebCore/xml/XSLTProcessor.cpp
+++ b/WebCore/xml/XSLTProcessor.cpp
@@ -90,7 +90,6 @@ PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc
result->setDecoder(decoder.release());
result->write(documentSource);
- result->finishParsing();
result->close();
return result.release();