summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/Android.jscbindings.mk9
-rw-r--r--WebCore/Android.mk9
-rw-r--r--WebCore/Android.v8bindings.mk1
-rw-r--r--WebCore/CMakeLists.txt32
-rw-r--r--WebCore/ChangeLog5758
-rw-r--r--WebCore/Configurations/FeatureDefines.xcconfig1
-rw-r--r--WebCore/DerivedSources.make8
-rw-r--r--WebCore/English.lproj/localizedStrings.jsbin42592 -> 42440 bytes
-rw-r--r--WebCore/GNUmakefile.am1414
-rw-r--r--WebCore/WebCore.exp.in47
-rw-r--r--WebCore/WebCore.gyp/WebCore.gyp17
-rw-r--r--WebCore/WebCore.gyp/scripts/rule_binding.py17
-rw-r--r--WebCore/WebCore.gypi26
-rw-r--r--WebCore/WebCore.order2
-rw-r--r--WebCore/WebCore.pri111
-rw-r--r--WebCore/WebCore.pro228
-rw-r--r--WebCore/WebCore.vcproj/WebCore.vcproj1226
-rw-r--r--WebCore/WebCore.vcproj/WebCoreCommon.vsprops50
-rw-r--r--WebCore/WebCore.xcodeproj/project.pbxproj357
-rw-r--r--WebCore/WebCorePrefix.h12
-rw-r--r--WebCore/accessibility/AccessibilityImageMapLink.cpp16
-rw-r--r--WebCore/accessibility/AccessibilityImageMapLink.h1
-rw-r--r--WebCore/accessibility/AccessibilityListBoxOption.cpp9
-rw-r--r--WebCore/accessibility/AccessibilityListBoxOption.h3
-rw-r--r--WebCore/accessibility/AccessibilityObject.cpp52
-rw-r--r--WebCore/accessibility/AccessibilityObject.h17
-rw-r--r--WebCore/accessibility/AccessibilityRenderObject.cpp101
-rw-r--r--WebCore/accessibility/AccessibilityRenderObject.h10
-rw-r--r--WebCore/accessibility/AccessibilityTable.cpp30
-rw-r--r--WebCore/accessibility/AccessibilityTableCell.cpp7
-rw-r--r--WebCore/accessibility/AccessibilityTableColumn.cpp3
-rw-r--r--WebCore/bindings/generic/RuntimeEnabledFeatures.cpp1
-rw-r--r--WebCore/bindings/generic/RuntimeEnabledFeatures.h6
-rw-r--r--WebCore/bindings/js/JSBindingsAllInOne.cpp1
-rw-r--r--WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp17
-rw-r--r--WebCore/bindings/js/JSConsoleCustom.cpp7
-rw-r--r--WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp83
-rw-r--r--WebCore/bindings/js/ScriptArray.cpp15
-rw-r--r--WebCore/bindings/js/ScriptArray.h36
-rw-r--r--WebCore/bindings/js/ScriptCallStack.cpp20
-rw-r--r--WebCore/bindings/js/ScriptController.cpp6
-rw-r--r--WebCore/bindings/js/ScriptController.h4
-rw-r--r--WebCore/bindings/js/ScriptDebugServer.cpp2
-rw-r--r--WebCore/bindings/js/ScriptDebugServer.h4
-rw-r--r--WebCore/bindings/js/StringSourceProvider.h4
-rw-r--r--WebCore/bindings/objc/WebScriptObject.mm21
-rw-r--r--WebCore/bindings/objc/WebScriptObjectPrivate.h10
-rw-r--r--WebCore/bindings/scripts/CodeGenerator.pm28
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorCPP.pm1
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorJS.pm3
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorObjC.pm1
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorV8.pm34
-rw-r--r--WebCore/bindings/scripts/IDLParser.pm8
-rw-r--r--WebCore/bindings/scripts/IDLStructure.pm3
-rwxr-xr-xWebCore/bindings/scripts/generate-bindings.pl9
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h8
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestObj.cpp56
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestObj.h7
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestObj.h8
-rw-r--r--WebCore/bindings/scripts/test/TestObj.idl7
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestObj.cpp15
-rw-r--r--WebCore/bindings/v8/DOMData.h15
-rw-r--r--WebCore/bindings/v8/DOMDataStore.cpp9
-rw-r--r--WebCore/bindings/v8/ScriptArray.cpp19
-rw-r--r--WebCore/bindings/v8/ScriptArray.h38
-rw-r--r--WebCore/bindings/v8/ScriptCallFrame.cpp9
-rw-r--r--WebCore/bindings/v8/ScriptCallFrame.h1
-rw-r--r--WebCore/bindings/v8/ScriptCallStack.cpp124
-rw-r--r--WebCore/bindings/v8/ScriptCallStack.h18
-rw-r--r--WebCore/bindings/v8/ScriptController.cpp10
-rw-r--r--WebCore/bindings/v8/ScriptController.h4
-rw-r--r--WebCore/bindings/v8/ScriptDebugServer.cpp41
-rw-r--r--WebCore/bindings/v8/ScriptDebugServer.h6
-rw-r--r--WebCore/bindings/v8/ScriptSourceCode.h8
-rw-r--r--WebCore/bindings/v8/V8ConsoleMessage.cpp34
-rw-r--r--WebCore/bindings/v8/V8ConsoleMessage.h5
-rw-r--r--WebCore/bindings/v8/V8DOMMap.h9
-rw-r--r--WebCore/bindings/v8/V8DOMWindowShell.cpp44
-rw-r--r--WebCore/bindings/v8/V8DOMWindowShell.h5
-rw-r--r--WebCore/bindings/v8/V8DOMWrapper.cpp2
-rw-r--r--WebCore/bindings/v8/custom/V8ConsoleCustom.cpp25
-rw-r--r--WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp90
-rw-r--r--WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp78
-rw-r--r--WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp5
-rw-r--r--WebCore/bridge/qt/qt_runtime.cpp2
-rw-r--r--WebCore/css/CSSComputedStyleDeclaration.cpp8
-rw-r--r--WebCore/css/CSSParser.cpp72
-rw-r--r--WebCore/css/CSSProperty.cpp20
-rw-r--r--WebCore/css/CSSPropertyNames.in9
-rw-r--r--WebCore/css/CSSSegmentedFontFace.cpp19
-rw-r--r--WebCore/css/CSSSegmentedFontFace.h3
-rw-r--r--WebCore/css/CSSSelector.cpp75
-rw-r--r--WebCore/css/CSSSelector.h10
-rw-r--r--WebCore/css/CSSStyleSelector.cpp27
-rw-r--r--WebCore/css/CSSStyleSelector.h8
-rw-r--r--WebCore/css/WebKitCSSTransformValue.idl3
-rw-r--r--WebCore/dom/CharacterData.cpp29
-rw-r--r--WebCore/dom/CharacterData.h3
-rw-r--r--WebCore/dom/ContainerNode.cpp20
-rw-r--r--WebCore/dom/DOMCoreException.idl3
-rw-r--r--WebCore/dom/DeviceOrientation.cpp89
-rw-r--r--WebCore/dom/DeviceOrientation.h60
-rw-r--r--WebCore/dom/DeviceOrientationClient.h3
-rw-r--r--WebCore/dom/DeviceOrientationController.cpp50
-rw-r--r--WebCore/dom/DeviceOrientationController.h12
-rw-r--r--WebCore/dom/DeviceOrientationEvent.cpp25
-rw-r--r--WebCore/dom/DeviceOrientationEvent.h20
-rw-r--r--WebCore/dom/DeviceOrientationEvent.idl8
-rw-r--r--WebCore/dom/EventException.idl3
-rw-r--r--WebCore/dom/Node.cpp3
-rw-r--r--WebCore/dom/Node.idl3
-rw-r--r--WebCore/dom/NodeRareData.h12
-rw-r--r--WebCore/dom/OverflowEvent.idl4
-rw-r--r--WebCore/dom/RangeException.idl2
-rw-r--r--WebCore/dom/TreeWalker.cpp8
-rw-r--r--WebCore/editing/DeleteSelectionCommand.cpp4
-rw-r--r--WebCore/editing/InsertLineBreakCommand.cpp5
-rw-r--r--WebCore/editing/InsertListCommand.cpp99
-rw-r--r--WebCore/editing/InsertListCommand.h2
-rw-r--r--WebCore/editing/InsertParagraphSeparatorCommand.cpp6
-rw-r--r--WebCore/html/Blob.cpp5
-rw-r--r--WebCore/html/Blob.h1
-rw-r--r--WebCore/html/BlobBuilder.cpp33
-rw-r--r--WebCore/html/File.cpp20
-rw-r--r--WebCore/html/File.h16
-rw-r--r--WebCore/html/File.idl3
-rw-r--r--WebCore/html/FileError.idl3
-rw-r--r--WebCore/html/FileReader.idl3
-rw-r--r--WebCore/html/FormDataList.cpp5
-rw-r--r--WebCore/html/HTMLAttributeNames.in1
-rw-r--r--WebCore/html/HTMLCanvasElement.cpp22
-rw-r--r--WebCore/html/HTMLCanvasElement.h8
-rw-r--r--WebCore/html/HTMLConstructionSite.cpp137
-rw-r--r--WebCore/html/HTMLConstructionSite.h23
-rw-r--r--WebCore/html/HTMLElementStack.cpp16
-rw-r--r--WebCore/html/HTMLElementStack.h2
-rw-r--r--WebCore/html/HTMLFormElement.cpp7
-rw-r--r--WebCore/html/HTMLFormElement.h4
-rw-r--r--WebCore/html/HTMLFormattingElementList.cpp45
-rw-r--r--WebCore/html/HTMLFormattingElementList.h25
-rw-r--r--WebCore/html/HTMLInputElement.cpp89
-rw-r--r--WebCore/html/HTMLInputElement.h5
-rw-r--r--WebCore/html/HTMLInputElement.idl7
-rw-r--r--WebCore/html/HTMLLinkElement.cpp4
-rw-r--r--WebCore/html/HTMLLinkElement.h1
-rw-r--r--WebCore/html/HTMLMediaElement.cpp103
-rw-r--r--WebCore/html/HTMLMediaElement.h3
-rw-r--r--WebCore/html/HTMLMediaElement.idl3
-rw-r--r--WebCore/html/HTMLToken.h23
-rw-r--r--WebCore/html/HTMLTreeBuilder.cpp334
-rw-r--r--WebCore/html/HTMLTreeBuilder.h18
-rw-r--r--WebCore/html/LegacyHTMLTreeBuilder.cpp46
-rw-r--r--WebCore/html/LegacyHTMLTreeBuilder.h1
-rw-r--r--WebCore/html/TimeRanges.cpp22
-rw-r--r--WebCore/html/TimeRanges.h2
-rw-r--r--WebCore/html/canvas/CanvasRenderingContext2D.cpp78
-rw-r--r--WebCore/html/canvas/CanvasRenderingContext2D.h2
-rw-r--r--WebCore/html/canvas/CanvasStyle.cpp24
-rw-r--r--WebCore/html/canvas/CanvasStyle.h2
-rw-r--r--WebCore/html/canvas/Float32Array.idl3
-rw-r--r--WebCore/html/canvas/Int16Array.idl3
-rw-r--r--WebCore/html/canvas/Int32Array.idl3
-rw-r--r--WebCore/html/canvas/Int8Array.idl3
-rw-r--r--WebCore/html/canvas/Uint16Array.idl3
-rw-r--r--WebCore/html/canvas/Uint32Array.idl3
-rw-r--r--WebCore/html/canvas/Uint8Array.idl3
-rw-r--r--WebCore/html/canvas/WebGLBuffer.cpp62
-rw-r--r--WebCore/html/canvas/WebGLBuffer.h2
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.cpp184
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.h17
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.idl6
-rw-r--r--WebCore/html/canvas/WebGLTexture.cpp212
-rw-r--r--WebCore/html/canvas/WebGLTexture.h57
-rw-r--r--WebCore/inspector/CodeGeneratorInspector.pm243
-rw-r--r--WebCore/inspector/ConsoleMessage.cpp57
-rw-r--r--WebCore/inspector/ConsoleMessage.h21
-rw-r--r--WebCore/inspector/Inspector.idl158
-rw-r--r--WebCore/inspector/InspectorBackend.cpp77
-rw-r--r--WebCore/inspector/InspectorBackend.h10
-rw-r--r--WebCore/inspector/InspectorBackend.idl10
-rw-r--r--WebCore/inspector/InspectorCSSStore.cpp6
-rw-r--r--WebCore/inspector/InspectorController.cpp78
-rw-r--r--WebCore/inspector/InspectorController.h32
-rw-r--r--WebCore/inspector/InspectorDOMAgent.cpp37
-rw-r--r--WebCore/inspector/InspectorDOMAgent.h13
-rw-r--r--WebCore/inspector/InspectorFrontend.cpp18
-rw-r--r--WebCore/inspector/InspectorFrontend.h2
-rw-r--r--WebCore/inspector/InspectorFrontend2.idl39
-rw-r--r--WebCore/inspector/InspectorResource.cpp5
-rw-r--r--WebCore/inspector/InspectorResource.h1
-rw-r--r--WebCore/inspector/InspectorTimelineAgent.cpp6
-rw-r--r--WebCore/inspector/InspectorTimelineAgent.h8
-rw-r--r--WebCore/inspector/InspectorValues.cpp7
-rw-r--r--WebCore/inspector/InspectorValues.h4
-rw-r--r--WebCore/inspector/JavaScriptCallFrame.idl6
-rw-r--r--WebCore/inspector/front-end/AbstractTimelinePanel.js3
-rw-r--r--WebCore/inspector/front-end/ConsoleView.js129
-rw-r--r--WebCore/inspector/front-end/ElementsPanel.js8
-rw-r--r--WebCore/inspector/front-end/ElementsTreeOutline.js3
-rw-r--r--WebCore/inspector/front-end/InjectedScript.js2
-rw-r--r--WebCore/inspector/front-end/InjectedScriptAccess.js2
-rw-r--r--WebCore/inspector/front-end/InspectorBackendStub.js10
-rw-r--r--WebCore/inspector/front-end/Resource.js22
-rw-r--r--WebCore/inspector/front-end/ResourcesPanel.js63
-rw-r--r--WebCore/inspector/front-end/ScriptsPanel.js12
-rw-r--r--WebCore/inspector/front-end/Settings.js3
-rw-r--r--WebCore/inspector/front-end/SourceCSSTokenizer.js6
-rw-r--r--WebCore/inspector/front-end/StoragePanel.js14
-rw-r--r--WebCore/inspector/front-end/TimelinePanel.js50
-rw-r--r--WebCore/inspector/front-end/inspector.css31
-rw-r--r--WebCore/inspector/front-end/inspector.js41
-rw-r--r--WebCore/inspector/front-end/treeoutline.js19
-rw-r--r--WebCore/inspector/front-end/utilities.js5
-rw-r--r--WebCore/loader/CachedScript.cpp7
-rw-r--r--WebCore/loader/CachedScript.h1
-rw-r--r--WebCore/loader/DocumentLoader.h4
-rw-r--r--WebCore/loader/DocumentThreadableLoader.cpp10
-rw-r--r--WebCore/loader/EmptyClients.h8
-rw-r--r--WebCore/loader/FrameLoader.cpp63
-rw-r--r--WebCore/loader/FrameLoader.h2
-rw-r--r--WebCore/loader/FrameLoaderClient.h2
-rw-r--r--WebCore/loader/FrameLoaderTypes.h23
-rw-r--r--WebCore/loader/MainResourceLoader.cpp22
-rw-r--r--WebCore/loader/SubframeLoader.cpp15
-rw-r--r--WebCore/loader/SubresourceLoader.cpp10
-rw-r--r--WebCore/loader/appcache/ApplicationCacheGroup.cpp25
-rw-r--r--WebCore/loader/appcache/DOMApplicationCache.idl3
-rw-r--r--WebCore/loader/icon/IconLoader.cpp6
-rw-r--r--WebCore/loader/loader.cpp2
-rw-r--r--WebCore/manual-tests/css3-background-layer-count.html38
-rw-r--r--WebCore/manual-tests/win/contextmenu-key2.html13
-rw-r--r--WebCore/notifications/NotificationCenter.cpp5
-rw-r--r--WebCore/page/Chrome.cpp4
-rw-r--r--WebCore/page/Chrome.h3
-rw-r--r--WebCore/page/ChromeClient.h14
-rw-r--r--WebCore/page/Console.cpp24
-rw-r--r--WebCore/page/Console.h11
-rw-r--r--WebCore/page/Console.idl6
-rw-r--r--WebCore/page/DOMWindow.cpp38
-rw-r--r--WebCore/page/DOMWindow.h2
-rw-r--r--WebCore/page/DOMWindow.idl4
-rw-r--r--WebCore/page/EditorClient.h2
-rw-r--r--WebCore/page/EventHandler.cpp44
-rw-r--r--WebCore/page/EventHandler.h6
-rw-r--r--WebCore/page/FocusController.cpp9
-rw-r--r--WebCore/page/Frame.cpp24
-rw-r--r--WebCore/page/FrameView.cpp2
-rw-r--r--WebCore/page/FrameView.h2
-rw-r--r--WebCore/page/Geolocation.cpp17
-rw-r--r--WebCore/page/Geolocation.h3
-rw-r--r--WebCore/page/MemoryInfo.cpp8
-rw-r--r--WebCore/page/MemoryInfo.h6
-rw-r--r--WebCore/page/Navigation.cpp16
-rw-r--r--WebCore/page/Navigation.h13
-rw-r--r--WebCore/page/Page.cpp7
-rw-r--r--WebCore/page/Page.h8
-rw-r--r--WebCore/page/PageGroup.cpp39
-rw-r--r--WebCore/page/PageGroup.h3
-rw-r--r--WebCore/page/Performance.cpp9
-rw-r--r--WebCore/page/Performance.h3
-rw-r--r--WebCore/page/Performance.idl1
-rw-r--r--WebCore/page/PrintContext.cpp48
-rw-r--r--WebCore/page/PrintContext.h4
-rw-r--r--WebCore/page/Settings.cpp4
-rw-r--r--WebCore/page/Settings.h7
-rw-r--r--WebCore/page/SpatialNavigation.cpp11
-rw-r--r--WebCore/page/SpeechInput.cpp67
-rw-r--r--WebCore/page/SpeechInput.h72
-rw-r--r--WebCore/page/SpeechInputClient.h53
-rw-r--r--WebCore/page/SpeechInputClientListener.h54
-rw-r--r--WebCore/page/SpeechInputListener.h54
-rw-r--r--WebCore/page/Timing.cpp224
-rw-r--r--WebCore/page/Timing.h19
-rw-r--r--WebCore/page/Timing.idl23
-rw-r--r--WebCore/page/animation/AnimationBase.cpp12
-rw-r--r--WebCore/page/animation/AnimationBase.h9
-rw-r--r--WebCore/page/animation/AnimationController.cpp22
-rw-r--r--WebCore/page/animation/AnimationController.h3
-rw-r--r--WebCore/page/animation/AnimationControllerPrivate.h3
-rw-r--r--WebCore/page/animation/CompositeAnimation.cpp8
-rw-r--r--WebCore/page/animation/CompositeAnimation.h4
-rw-r--r--WebCore/page/animation/ImplicitAnimation.cpp2
-rw-r--r--WebCore/page/animation/KeyframeAnimation.cpp2
-rw-r--r--WebCore/page/chromium/ChromeClientChromium.h10
-rw-r--r--WebCore/page/mac/EventHandlerMac.mm6
-rw-r--r--WebCore/platform/BlobItem.cpp142
-rw-r--r--WebCore/platform/BlobItem.h25
-rw-r--r--WebCore/platform/Cursor.cpp473
-rw-r--r--WebCore/platform/Cursor.h96
-rw-r--r--WebCore/platform/FileChooser.h6
-rw-r--r--WebCore/platform/HostWindow.h5
-rw-r--r--WebCore/platform/KURLGoogle.cpp53
-rw-r--r--WebCore/platform/MIMETypeRegistry.cpp1
-rw-r--r--WebCore/platform/PopupMenuClient.h1
-rw-r--r--WebCore/platform/Widget.h4
-rw-r--r--WebCore/platform/brew/PopupMenuBrew.cpp3
-rw-r--r--WebCore/platform/chromium/ChromiumBridge.h2
-rw-r--r--WebCore/platform/chromium/CursorChromium.cpp8
-rw-r--r--WebCore/platform/chromium/GLES2Context.h12
-rw-r--r--WebCore/platform/chromium/PlatformThemeChromiumGtk.cpp221
-rw-r--r--WebCore/platform/chromium/PlatformThemeChromiumGtk.h71
-rw-r--r--WebCore/platform/chromium/PopupMenuChromium.cpp54
-rw-r--r--WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp216
-rw-r--r--WebCore/platform/chromium/ThemeChromiumMac.mm132
-rw-r--r--WebCore/platform/efl/CursorEfl.cpp18
-rw-r--r--WebCore/platform/efl/PopupMenuEfl.cpp3
-rw-r--r--WebCore/platform/efl/SoundEfl.cpp4
-rw-r--r--WebCore/platform/efl/WidgetEfl.cpp24
-rw-r--r--WebCore/platform/graphics/Color.h13
-rw-r--r--WebCore/platform/graphics/FloatPoint.h22
-rw-r--r--WebCore/platform/graphics/Font.cpp3
-rw-r--r--WebCore/platform/graphics/Font.h4
-rw-r--r--WebCore/platform/graphics/GraphicsContext3D.h16
-rw-r--r--WebCore/platform/graphics/GraphicsLayer.h5
-rw-r--r--WebCore/platform/graphics/ImageBuffer.h5
-rw-r--r--WebCore/platform/graphics/MediaPlayer.cpp16
-rw-r--r--WebCore/platform/graphics/MediaPlayer.h7
-rw-r--r--WebCore/platform/graphics/MediaPlayerPrivate.h3
-rw-r--r--WebCore/platform/graphics/Path.h1
-rw-r--r--WebCore/platform/graphics/WidthIterator.cpp23
-rw-r--r--WebCore/platform/graphics/cairo/FontCairo.cpp4
-rw-r--r--WebCore/platform/graphics/cairo/PathCairo.cpp9
-rw-r--r--WebCore/platform/graphics/cg/ColorCG.cpp11
-rw-r--r--WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp37
-rw-r--r--WebCore/platform/graphics/cg/PathCG.cpp8
-rw-r--r--WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp3
-rw-r--r--WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp25
-rw-r--r--WebCore/platform/graphics/chromium/GraphicsLayerChromium.h2
-rw-r--r--WebCore/platform/graphics/chromium/LayerRendererChromium.cpp21
-rw-r--r--WebCore/platform/graphics/chromium/LayerRendererChromium.h9
-rw-r--r--WebCore/platform/graphics/chromium/VideoLayerChromium.cpp50
-rw-r--r--WebCore/platform/graphics/chromium/VideoLayerChromium.h54
-rw-r--r--WebCore/platform/graphics/haiku/PathHaiku.cpp8
-rw-r--r--WebCore/platform/graphics/mac/ComplexTextController.cpp18
-rw-r--r--WebCore/platform/graphics/mac/GraphicsContext3DMac.mm87
-rw-r--r--WebCore/platform/graphics/mac/GraphicsLayerCA.h1
-rw-r--r--WebCore/platform/graphics/mac/GraphicsLayerCA.mm8
-rw-r--r--WebCore/platform/graphics/mac/WebLayer.h8
-rw-r--r--WebCore/platform/graphics/mac/WebLayer.mm51
-rw-r--r--WebCore/platform/graphics/mac/WebTiledLayer.mm22
-rw-r--r--WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp4
-rw-r--r--WebCore/platform/graphics/openvg/PathOpenVG.cpp7
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp13
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContextQt.cpp157
-rw-r--r--WebCore/platform/graphics/qt/ImageBufferQt.cpp15
-rw-r--r--WebCore/platform/graphics/qt/ImageQt.cpp4
-rw-r--r--WebCore/platform/graphics/qt/PathQt.cpp35
-rw-r--r--WebCore/platform/graphics/qt/StillImageQt.cpp74
-rw-r--r--WebCore/platform/graphics/qt/StillImageQt.h10
-rw-r--r--WebCore/platform/graphics/skia/ImageBufferSkia.cpp5
-rw-r--r--WebCore/platform/graphics/skia/PathSkia.cpp7
-rw-r--r--WebCore/platform/graphics/skia/SkiaUtils.cpp12
-rw-r--r--WebCore/platform/graphics/win/GraphicsLayerCACF.cpp2
-rw-r--r--WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp1
-rw-r--r--WebCore/platform/graphics/wince/PathWince.cpp7
-rw-r--r--WebCore/platform/graphics/wx/PathWx.cpp7
-rw-r--r--WebCore/platform/gtk/CursorGtk.cpp22
-rw-r--r--WebCore/platform/gtk/FileSystemGtk.cpp32
-rw-r--r--WebCore/platform/gtk/PasteboardHelper.cpp1
-rw-r--r--WebCore/platform/gtk/RenderThemeGtk.cpp7
-rw-r--r--WebCore/platform/haiku/CursorHaiku.cpp12
-rw-r--r--WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp69
-rw-r--r--WebCore/platform/mac/CursorMac.mm403
-rw-r--r--WebCore/platform/mac/FileSystemMac.mm25
-rw-r--r--WebCore/platform/mac/ThemeMac.mm2
-rw-r--r--WebCore/platform/mac/WidgetMac.mm9
-rw-r--r--WebCore/platform/network/Credential.cpp2
-rw-r--r--WebCore/platform/network/Credential.h2
-rw-r--r--WebCore/platform/network/CredentialStorage.cpp5
-rw-r--r--WebCore/platform/network/CredentialStorage.h1
-rw-r--r--WebCore/platform/network/FormData.cpp5
-rw-r--r--WebCore/platform/network/ResourceHandle.cpp37
-rw-r--r--WebCore/platform/network/ResourceHandle.h16
-rw-r--r--WebCore/platform/network/ResourceHandleInternal.h8
-rw-r--r--WebCore/platform/network/ResourceResponseBase.cpp16
-rw-r--r--WebCore/platform/network/ResourceResponseBase.h6
-rw-r--r--WebCore/platform/network/cf/ResourceErrorCF.cpp2
-rw-r--r--WebCore/platform/network/cf/ResourceHandleCFNet.cpp338
-rw-r--r--WebCore/platform/network/cf/ResourceRequestCFNet.cpp5
-rw-r--r--WebCore/platform/network/curl/FormDataStreamCurl.cpp8
-rw-r--r--WebCore/platform/network/curl/ResourceHandleManager.cpp34
-rw-r--r--WebCore/platform/network/mac/ResourceHandleMac.mm495
-rw-r--r--WebCore/platform/network/qt/QNetworkReplyHandler.cpp14
-rw-r--r--WebCore/platform/network/qt/ResourceHandleQt.cpp9
-rw-r--r--WebCore/platform/network/soup/ResourceHandleSoup.cpp18
-rw-r--r--WebCore/platform/qt/CursorQt.cpp8
-rw-r--r--WebCore/platform/qt/GeolocationServiceQt.cpp12
-rw-r--r--WebCore/platform/qt/RenderThemeQt.cpp2
-rw-r--r--WebCore/platform/qt/WidgetQt.cpp5
-rw-r--r--WebCore/platform/text/LineEnding.cpp150
-rw-r--r--WebCore/platform/text/LineEnding.h56
-rw-r--r--WebCore/platform/win/ClipboardUtilitiesWin.cpp82
-rw-r--r--WebCore/platform/win/ClipboardUtilitiesWin.h6
-rw-r--r--WebCore/platform/win/ClipboardWin.cpp25
-rw-r--r--WebCore/platform/win/ClipboardWin.h106
-rw-r--r--WebCore/platform/win/CursorWin.cpp433
-rw-r--r--WebCore/platform/win/PasteboardWin.cpp24
-rw-r--r--WebCore/platform/win/WidgetWin.cpp25
-rw-r--r--WebCore/platform/wince/CursorWince.cpp8
-rw-r--r--WebCore/platform/wx/CursorWx.cpp10
-rw-r--r--WebCore/plugins/PluginStream.cpp2
-rw-r--r--WebCore/plugins/PluginViewBase.h (renamed from WebCore/plugins/PluginWidget.h)21
-rw-r--r--WebCore/plugins/mac/PluginWidgetMac.mm49
-rw-r--r--WebCore/plugins/win/PluginViewWin.cpp6
-rw-r--r--WebCore/rendering/RenderBlock.cpp5
-rw-r--r--WebCore/rendering/RenderBox.cpp6
-rw-r--r--WebCore/rendering/RenderEmbeddedObject.cpp8
-rw-r--r--WebCore/rendering/RenderFileUploadControl.cpp13
-rw-r--r--WebCore/rendering/RenderFileUploadControl.h3
-rw-r--r--WebCore/rendering/RenderForeignObject.cpp7
-rw-r--r--WebCore/rendering/RenderLayer.cpp2
-rw-r--r--WebCore/rendering/RenderLayerBacking.cpp106
-rw-r--r--WebCore/rendering/RenderLayerBacking.h10
-rw-r--r--WebCore/rendering/RenderLayerCompositor.cpp12
-rw-r--r--WebCore/rendering/RenderMenuList.cpp8
-rw-r--r--WebCore/rendering/RenderMenuList.h1
-rw-r--r--WebCore/rendering/RenderObject.cpp14
-rw-r--r--WebCore/rendering/RenderObjectChildList.cpp16
-rw-r--r--WebCore/rendering/RenderPath.cpp6
-rw-r--r--WebCore/rendering/RenderSVGContainer.cpp6
-rw-r--r--WebCore/rendering/RenderSVGImage.cpp8
-rw-r--r--WebCore/rendering/RenderSVGModelObject.cpp8
-rw-r--r--WebCore/rendering/RenderSVGModelObject.h1
-rw-r--r--WebCore/rendering/RenderSVGResource.cpp30
-rw-r--r--WebCore/rendering/RenderSVGResource.h3
-rw-r--r--WebCore/rendering/RenderSVGResourceClipper.cpp48
-rw-r--r--WebCore/rendering/RenderSVGResourceClipper.h3
-rw-r--r--WebCore/rendering/RenderSVGResourceContainer.h53
-rw-r--r--WebCore/rendering/RenderSVGResourceFilter.cpp13
-rw-r--r--WebCore/rendering/RenderSVGResourceGradient.cpp13
-rw-r--r--WebCore/rendering/RenderSVGResourceMarker.cpp12
-rw-r--r--WebCore/rendering/RenderSVGResourceMasker.cpp32
-rw-r--r--WebCore/rendering/RenderSVGResourceMasker.h2
-rw-r--r--WebCore/rendering/RenderSVGResourcePattern.cpp29
-rw-r--r--WebCore/rendering/RenderSVGResourcePattern.h2
-rw-r--r--WebCore/rendering/RenderSVGRoot.cpp2
-rw-r--r--WebCore/rendering/RenderSVGShadowTreeRootContainer.cpp5
-rw-r--r--WebCore/rendering/RenderSVGShadowTreeRootContainer.h2
-rw-r--r--WebCore/rendering/RenderSVGText.cpp6
-rw-r--r--WebCore/rendering/RenderTextControlSingleLine.cpp42
-rw-r--r--WebCore/rendering/RenderTextControlSingleLine.h3
-rw-r--r--WebCore/rendering/RenderTheme.cpp15
-rw-r--r--WebCore/rendering/RenderThemeChromiumLinux.cpp32
-rw-r--r--WebCore/rendering/RenderThemeChromiumLinux.h14
-rw-r--r--WebCore/rendering/RenderThemeChromiumWin.cpp150
-rw-r--r--WebCore/rendering/RenderThemeChromiumWin.h14
-rw-r--r--WebCore/rendering/RenderThemeMac.mm9
-rw-r--r--WebCore/rendering/RenderTreeAsText.cpp32
-rw-r--r--WebCore/rendering/RenderTreeAsText.h3
-rw-r--r--WebCore/rendering/RenderView.cpp19
-rw-r--r--WebCore/rendering/TextControlInnerElements.cpp97
-rw-r--r--WebCore/rendering/TextControlInnerElements.h33
-rw-r--r--WebCore/rendering/style/FillLayer.cpp35
-rw-r--r--WebCore/rendering/style/RenderStyle.h4
-rw-r--r--WebCore/storage/AbstractDatabase.cpp14
-rw-r--r--WebCore/storage/AbstractDatabase.h11
-rw-r--r--WebCore/storage/ChangeVersionWrapper.cpp6
-rw-r--r--WebCore/storage/Database.cpp33
-rw-r--r--WebCore/storage/Database.h5
-rw-r--r--WebCore/storage/DatabaseAuthorizer.cpp4
-rw-r--r--WebCore/storage/DatabaseCallback.h2
-rw-r--r--WebCore/storage/DatabaseSync.cpp91
-rw-r--r--WebCore/storage/DatabaseSync.h44
-rw-r--r--WebCore/storage/DatabaseSync.idl42
-rw-r--r--WebCore/storage/DatabaseTracker.cpp1
-rw-r--r--WebCore/storage/IDBAny.h7
-rw-r--r--WebCore/storage/IDBDatabaseRequest.cpp6
-rw-r--r--WebCore/storage/IDBDatabaseRequest.h1
-rw-r--r--WebCore/storage/IDBKeyRange.cpp6
-rw-r--r--WebCore/storage/IDBKeyRange.h8
-rw-r--r--WebCore/storage/IDBObjectStoreRequest.cpp14
-rw-r--r--WebCore/storage/IDBObjectStoreRequest.h1
-rw-r--r--WebCore/storage/IndexedDatabaseRequest.cpp4
-rw-r--r--WebCore/storage/IndexedDatabaseRequest.h1
-rw-r--r--WebCore/storage/SQLError.h2
-rw-r--r--WebCore/storage/SQLException.idl3
-rw-r--r--WebCore/storage/SQLResultSet.cpp3
-rw-r--r--WebCore/storage/SQLResultSet.h5
-rw-r--r--WebCore/storage/SQLStatementCallback.h2
-rw-r--r--WebCore/storage/SQLStatementErrorCallback.h2
-rw-r--r--WebCore/storage/SQLStatementSync.cpp127
-rw-r--r--WebCore/storage/SQLStatementSync.h63
-rw-r--r--WebCore/storage/SQLTransaction.cpp7
-rw-r--r--WebCore/storage/SQLTransaction.h6
-rw-r--r--WebCore/storage/SQLTransactionCallback.h2
-rw-r--r--WebCore/storage/SQLTransactionClient.cpp25
-rw-r--r--WebCore/storage/SQLTransactionClient.h21
-rw-r--r--WebCore/storage/SQLTransactionErrorCallback.h2
-rw-r--r--WebCore/storage/SQLTransactionSync.cpp179
-rw-r--r--WebCore/storage/SQLTransactionSync.h57
-rw-r--r--WebCore/storage/SQLTransactionSync.idl42
-rw-r--r--WebCore/storage/SQLTransactionSyncCallback.h45
-rw-r--r--WebCore/storage/SQLTransactionSyncCallback.idl42
-rw-r--r--WebCore/storage/chromium/DatabaseTrackerChromium.cpp6
-rw-r--r--WebCore/storage/chromium/SQLTransactionClientChromium.cpp30
-rw-r--r--WebCore/svg/SVGAllInOne.cpp3
-rw-r--r--WebCore/svg/SVGAnimateElement.cpp7
-rw-r--r--WebCore/svg/SVGAnimateMotionElement.cpp19
-rw-r--r--WebCore/svg/SVGAnimateTransformElement.cpp8
-rw-r--r--WebCore/svg/SVGCircleElement.cpp7
-rw-r--r--WebCore/svg/SVGComponentTransferFunctionElement.idl5
-rw-r--r--WebCore/svg/SVGEllipseElement.cpp7
-rw-r--r--WebCore/svg/SVGException.idl3
-rw-r--r--WebCore/svg/SVGFEBlendElement.idl7
-rw-r--r--WebCore/svg/SVGFEColorMatrixElement.idl7
-rw-r--r--WebCore/svg/SVGFECompositeElement.idl7
-rw-r--r--WebCore/svg/SVGFEConvolveMatrixElement.idl8
-rw-r--r--WebCore/svg/SVGFEDisplacementMapElement.idl7
-rw-r--r--WebCore/svg/SVGFEImageElement.cpp12
-rw-r--r--WebCore/svg/SVGFEMorphologyElement.idl7
-rw-r--r--WebCore/svg/SVGFETurbulenceElement.idl7
-rw-r--r--WebCore/svg/SVGFilterElement.cpp17
-rw-r--r--WebCore/svg/SVGFilterElement.h3
-rw-r--r--WebCore/svg/SVGFont.cpp2
-rw-r--r--WebCore/svg/SVGForeignObjectElement.cpp5
-rw-r--r--WebCore/svg/SVGGElement.cpp5
-rw-r--r--WebCore/svg/SVGGlyphElement.cpp6
-rw-r--r--WebCore/svg/SVGGradientElement.idl13
-rw-r--r--WebCore/svg/SVGImageElement.cpp5
-rw-r--r--WebCore/svg/SVGLineElement.cpp7
-rw-r--r--WebCore/svg/SVGPaint.cpp15
-rw-r--r--WebCore/svg/SVGPaint.h6
-rw-r--r--WebCore/svg/SVGParserUtilities.cpp658
-rw-r--r--WebCore/svg/SVGParserUtilities.h5
-rw-r--r--WebCore/svg/SVGPathBuilder.cpp77
-rw-r--r--WebCore/svg/SVGPathBuilder.h63
-rw-r--r--WebCore/svg/SVGPathConsumer.h68
-rw-r--r--WebCore/svg/SVGPathElement.cpp12
-rw-r--r--WebCore/svg/SVGPathParser.cpp509
-rw-r--r--WebCore/svg/SVGPathParser.h69
-rw-r--r--WebCore/svg/SVGPathSegListBuilder.cpp160
-rw-r--r--WebCore/svg/SVGPathSegListBuilder.h62
-rw-r--r--WebCore/svg/SVGPolyElement.cpp7
-rw-r--r--WebCore/svg/SVGRectElement.cpp7
-rw-r--r--WebCore/svg/SVGSVGElement.cpp11
-rw-r--r--WebCore/svg/SVGStopElement.cpp14
-rw-r--r--WebCore/svg/SVGStopElement.h1
-rw-r--r--WebCore/svg/SVGStyledElement.cpp30
-rw-r--r--WebCore/svg/SVGStyledElement.h1
-rw-r--r--WebCore/svg/SVGTRefElement.cpp3
-rw-r--r--WebCore/svg/SVGTextElement.cpp3
-rw-r--r--WebCore/svg/SVGTextPathElement.cpp3
-rw-r--r--WebCore/svg/SVGTextPositioningElement.cpp3
-rw-r--r--WebCore/svg/SVGUseElement.cpp16
-rw-r--r--WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp44
-rw-r--r--WebCore/websockets/WebSocket.cpp4
-rw-r--r--WebCore/websockets/WebSocket.h2
-rw-r--r--WebCore/xml/XMLHttpRequest.cpp9
-rw-r--r--WebCore/xml/XMLHttpRequestException.idl3
-rw-r--r--WebCore/xml/XPathException.idl3
550 files changed, 18249 insertions, 6496 deletions
diff --git a/WebCore/Android.jscbindings.mk b/WebCore/Android.jscbindings.mk
index d79ea79..f67fe16 100644
--- a/WebCore/Android.jscbindings.mk
+++ b/WebCore/Android.jscbindings.mk
@@ -81,7 +81,10 @@ LOCAL_SRC_FILES += \
bindings/js/JSCustomPositionErrorCallback.cpp \
bindings/js/JSCustomSQLStatementErrorCallback.cpp \
bindings/js/JSCustomVoidCallback.cpp \
+<<<<<<< HEAD:WebCore/Android.jscbindings.mk
bindings/js/JSDesktopNotificationsCustom.cpp \
+=======
+>>>>>>> webkit.org at r63859:WebCore/Android.jscbindings.mk
bindings/js/JSDOMApplicationCacheCustom.cpp \
bindings/js/JSDOMBinding.cpp \
bindings/js/JSDOMFormDataCustom.cpp \
@@ -93,12 +96,18 @@ LOCAL_SRC_FILES += \
bindings/js/JSDOMWindowBase.cpp \
bindings/js/JSDOMWindowCustom.cpp \
bindings/js/JSDOMWindowShell.cpp \
+<<<<<<< HEAD:WebCore/Android.jscbindings.mk
bindings/js/JSDOMWrapper.cpp \
+=======
+ bindings/js/JSDatabaseCallback.cpp \
+>>>>>>> webkit.org at r63859:WebCore/Android.jscbindings.mk
bindings/js/JSDataGridColumnListCustom.cpp \
bindings/js/JSDataGridDataSource.cpp \
bindings/js/JSDatabaseCustom.cpp \
bindings/js/JSDatabaseSyncCustom.cpp \
bindings/js/JSDedicatedWorkerContextCustom.cpp \
+ bindings/js/JSDesktopNotificationsCustom.cpp \
+ bindings/js/JSDeviceOrientationEventCustom.cpp \
bindings/js/JSDocumentCustom.cpp \
bindings/js/JSElementCustom.cpp \
bindings/js/JSEventCustom.cpp \
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index df10d8c..a0dafa3 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -24,7 +24,11 @@
##
LOCAL_SRC_FILES := \
+<<<<<<< HEAD:WebCore/Android.mk
bindings/generic/BindingSecurityBase.cpp \
+=======
+ bindings/generic/RuntimeEnabledFeatures.cpp \
+>>>>>>> webkit.org at r63859:WebCore/Android.mk
\
css/CSSBorderImageValue.cpp \
css/CSSCanvasValue.cpp \
@@ -154,6 +158,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
dom/Notation.cpp \
dom/OptionElement.cpp \
dom/OptionGroupElement.cpp \
+ dom/DeviceOrientation.cpp \
dom/DeviceOrientationController.cpp \
dom/DeviceOrientationEvent.cpp \
dom/OverflowEvent.cpp \
@@ -400,6 +405,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
page/SecurityOrigin.cpp \
page/Settings.cpp \
page/SpatialNavigation.cpp \
+ page/SpeechInput.cpp \
page/SuspendableTimer.cpp \
page/Timing.cpp \
page/UserContentURLPattern.cpp \
@@ -918,7 +924,9 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
svg/SVGNumberList.cpp \
svg/SVGPaint.cpp \
svg/SVGParserUtilities.cpp \
+ svg/SVGPathBuilder.cpp \
svg/SVGPathElement.cpp \
+ svg/SVGPathParser.cpp \
svg/SVGPathSegArc.cpp \
svg/SVGPathSegClosePath.cpp \
svg/SVGPathSegCurvetoCubic.cpp \
@@ -929,6 +937,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
svg/SVGPathSegLinetoHorizontal.cpp \
svg/SVGPathSegLinetoVertical.cpp \
svg/SVGPathSegList.cpp \
+ svg/SVGPathSegListBuilder.cpp \
svg/SVGPathSegMoveto.cpp \
svg/SVGPatternElement.cpp \
svg/SVGPointList.cpp \
diff --git a/WebCore/Android.v8bindings.mk b/WebCore/Android.v8bindings.mk
index a64d75e..017bf98 100644
--- a/WebCore/Android.v8bindings.mk
+++ b/WebCore/Android.v8bindings.mk
@@ -119,6 +119,7 @@ LOCAL_SRC_FILES += \
bindings/v8/custom/V8DatabaseCustom.cpp \
bindings/v8/custom/V8DatabaseSyncCustom.cpp \
bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp \
+ bindings/v8/custom/V8DeviceOrientationEventCustom.cpp \
bindings/v8/custom/V8DocumentCustom.cpp \
bindings/v8/custom/V8DocumentLocationCustom.cpp \
bindings/v8/custom/V8ElementCustom.cpp \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 957b770..7919317 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -2,6 +2,7 @@ SET(WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}"
"${WEBCORE_DIR}/accessibility"
"${WEBCORE_DIR}/bindings"
+ "${WEBCORE_DIR}/bindings/generic"
"${WEBCORE_DIR}/bindings/js"
"${WEBCORE_DIR}/bridge"
"${WEBCORE_DIR}/bridge/c"
@@ -19,6 +20,7 @@ SET(WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/loader/appcache"
"${WEBCORE_DIR}/loader/archive"
"${WEBCORE_DIR}/loader/icon"
+ "${WEBCORE_DIR}/mathml"
"${WEBCORE_DIR}/notifications"
"${WEBCORE_DIR}/page"
"${WEBCORE_DIR}/page/animation"
@@ -46,6 +48,7 @@ SET(WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/svg/animation"
"${WEBCORE_DIR}/svg/graphics"
"${WEBCORE_DIR}/svg/graphics/filters"
+ "${WEBCORE_DIR}/websockets"
"${WEBCORE_DIR}/workers"
"${WEBCORE_DIR}/xml"
"${JAVASCRIPTCORE_DIR}"
@@ -526,6 +529,8 @@ SET(WebCore_SOURCES
${DERIVED_SOURCES_DIR}/HTMLEntityNames.cpp
${DERIVED_SOURCES_DIR}/HTMLNames.cpp
${DERIVED_SOURCES_DIR}/JSHTMLElementWrapperFactory.cpp
+ ${DERIVED_SOURCES_DIR}/MathMLElementFactory.cpp
+ ${DERIVED_SOURCES_DIR}/MathMLNames.cpp
${DERIVED_SOURCES_DIR}/UserAgentStyleSheetsData.cpp
${DERIVED_SOURCES_DIR}/XMLNames.cpp
${DERIVED_SOURCES_DIR}/XMLNSNames.cpp
@@ -555,6 +560,8 @@ SET(WebCore_SOURCES
bindings/ScriptControllerBase.cpp
+ bindings/generic/RuntimeEnabledFeatures.cpp
+
bindings/js/DOMObjectHashTableMap.cpp
bindings/js/DOMWrapperWorld.cpp
bindings/js/GCController.cpp
@@ -584,6 +591,7 @@ SET(WebCore_SOURCES
bindings/js/JSDataGridDataSource.cpp
bindings/js/JSDebugWrapperSet.cpp
bindings/js/JSDedicatedWorkerContextCustom.cpp
+ bindings/js/JSDeviceOrientationEventCustom.cpp
bindings/js/JSDocumentCustom.cpp
bindings/js/JSDOMApplicationCacheCustom.cpp
bindings/js/JSDOMBinding.cpp
@@ -778,6 +786,7 @@ SET(WebCore_SOURCES
dom/CustomEvent.cpp
dom/DatasetDOMStringMap.cpp
dom/DecodedDataDocumentParser.cpp
+ dom/DeviceOrientation.cpp
dom/DeviceOrientationController.cpp
dom/DeviceOrientationEvent.cpp
dom/Document.cpp
@@ -1110,6 +1119,20 @@ SET(WebCore_SOURCES
loader/icon/PageURLRecord.cpp
loader/loader.cpp
+ mathml/MathMLElement.cpp
+ mathml/MathMLInlineContainerElement.cpp
+ mathml/MathMLMathElement.cpp
+ mathml/MathMLTextElement.cpp
+ mathml/RenderMathMLBlock.cpp
+ mathml/RenderMathMLFraction.cpp
+ mathml/RenderMathMLMath.cpp
+ mathml/RenderMathMLOperator.cpp
+ mathml/RenderMathMLRoot.cpp
+ mathml/RenderMathMLRow.cpp
+ mathml/RenderMathMLSquareRoot.cpp
+ mathml/RenderMathMLSubSup.cpp
+ mathml/RenderMathMLUnderOver.cpp
+
page/BarInfo.cpp
page/Chrome.cpp
page/Console.cpp
@@ -1273,6 +1296,7 @@ SET(WebCore_SOURCES
platform/text/Base64.cpp
platform/text/BidiContext.cpp
+ platform/text/LineEnding.cpp
platform/text/Hyphenation.cpp
platform/text/RegularExpression.cpp
platform/text/SegmentedString.cpp
@@ -1426,6 +1450,7 @@ SET(WebCore_SOURCES
storage/SQLResultSet.cpp
storage/SQLResultSetRowList.cpp
storage/SQLStatement.cpp
+ storage/SQLStatementSync.cpp
storage/SQLTransaction.cpp
storage/SQLTransactionClient.cpp
storage/SQLTransactionCoordinator.cpp
@@ -1629,7 +1654,9 @@ IF (ENABLE_SVG)
svg/SVGNumberList.cpp
svg/SVGPaint.cpp
svg/SVGParserUtilities.cpp
+ svg/SVGPathBuilder.cpp
svg/SVGPathElement.cpp
+ svg/SVGPathParser.cpp
svg/SVGPathSegArc.cpp
svg/SVGPathSegClosePath.cpp
svg/SVGPathSegCurvetoCubic.cpp
@@ -1640,6 +1667,7 @@ IF (ENABLE_SVG)
svg/SVGPathSegLinetoHorizontal.cpp
svg/SVGPathSegLinetoVertical.cpp
svg/SVGPathSegList.cpp
+ svg/SVGPathSegListBuilder.cpp
svg/SVGPathSegMoveto.cpp
svg/SVGPatternElement.cpp
svg/SVGPointList.cpp
@@ -1715,7 +1743,7 @@ FOREACH (_file ${WebCore_IDL_PURE_FILES})
GENERATE_JS_FROM_IDL_PURE(${_file})
ENDFOREACH ()
-GENERATE_INSPECTOR_FROM_IDL(inspector/InspectorFrontend2.idl)
+GENERATE_INSPECTOR_FROM_IDL(inspector/Inspector.idl)
LIST(APPEND WebCore_SOURCES ${JS_IDL_FILES} ${Inspector_IDL_FILES})
@@ -1740,9 +1768,11 @@ ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/platform/graphics/Color.cpp Color
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSParser.cpp tokenizer.cpp)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/LegacyPreloadScanner.cpp HTMLEntityNames.cpp)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLEntityParser.cpp HTMLEntityNames.cpp)
+ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLTreeBuilder.cpp MathMLNames.cpp)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSStyleSelector.cpp UserAgentStyleSheetsData.cpp UserAgentStyleSheets.h)
GENERATE_DOM_NAMES_FACTORY(HTML ${WEBCORE_DIR}/html/HTMLTagNames.in ${WEBCORE_DIR}/html/HTMLAttributeNames.in "${HTML_FEATURES}")
+GENERATE_DOM_NAMES_FACTORY(MathML ${WEBCORE_DIR}/mathml/mathtags.in ${WEBCORE_DIR}/mathml/mathattrs.in "${MATHML_FEATURES}")
GENERATE_DOM_NAMES_FACTORY(SVG ${WEBCORE_DIR}/svg/svgtags.in ${WEBCORE_DIR}/svg/svgattrs.in "${SVG_FEATURES}")
GENERATE_DOM_NAMES_ONLY(XLink ${WEBCORE_DIR}/svg/xlinkattrs.in)
GENERATE_DOM_NAMES_ONLY(XMLNS ${WEBCORE_DIR}/xml/xmlnsattrs.in)
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e0d5843..79eb390 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,5761 @@
+2010-07-21 Bo Liu <boliu@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Add chromium WebMediaPlayer to PlatformMedia
+ https://bugs.webkit.org/show_bug.cgi?id=41295
+
+ * platform/graphics/MediaPlayer.h:
+ (WebCore::PlatformMedia::):
+
+2010-07-21 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Composited layers don't scroll in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=42771
+
+ Prep work: FrameView::scrollPositionChanged() sounds like a generic "did scroll" bottleneck,
+ but this is deceiving. It's only every called on one platform (Mac) when the NSScrollView gets
+ scrolled, so rename it to FrameView::scrollPositionChangedViaPlatformWidget().
+
+ * WebCore.exp.in:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::scrollPositionChangedViaPlatformWidget):
+ * page/FrameView.h:
+
+2010-07-21 Peter Beverloo <peter@lvp-media.com>
+
+ Reviewed by Eric Carlson.
+
+ Removed support for the -khtml CSS vendor prefix and limit the
+ -apple prefix to two properties (dashboard-region and line-clamp).
+
+ Test: fast/css/limited-vendor-prefix-behavior.html
+
+ * css/CSSParser.cpp:
+ (WebCore::cssPropertyID):
+
+2010-07-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix the last tree HTML5 tree builder crashes
+ https://bugs.webkit.org/show_bug.cgi?id=42773
+
+ This patch changes the internal representation of a bookmark to handle
+ the case where one of the adjecent entries in the list of active
+ formatting elements is actually a marker.
+
+ After this patch, the bookmarking mechanism isn't as general, but it
+ works for the cases we need in the adoption agency.
+
+ Also, after this patch, there aren't any more known crashers in the
+ HTML5 tree builder. :)
+
+ * html/HTMLFormattingElementList.cpp:
+ (WebCore::HTMLFormattingElementList::bookmarkFor):
+ (WebCore::HTMLFormattingElementList::swapTo):
+ * html/HTMLFormattingElementList.h:
+ (WebCore::HTMLFormattingElementList::Bookmark::Bookmark):
+ (WebCore::HTMLFormattingElementList::Bookmark::moveToAfter):
+ (WebCore::HTMLFormattingElementList::Bookmark::hasBeenMoved):
+ (WebCore::HTMLFormattingElementList::Bookmark::mark):
+ (WebCore::HTMLFormattingElementList::first):
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
+
+2010-07-21 Tony Gentilcore <tonyg@chromium.org>
+
+ Unreviewed build fix.
+
+ Disable overzealous ASSERT
+ https://bugs.webkit.org/show_bug.cgi?id=42775
+
+ No new tests because no changed functionality.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::stopLoading):
+
+2010-07-21 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ Crash in Notification::disconnectFrame() triggered by Frame::lifeSupportTimerFired()
+ https://bugs.webkit.org/show_bug.cgi?id=42534
+
+ Call NotificationsCenter::disconnectFrame() when the frame is disconnected from the page.
+ Calling it from the destructor of Frame is too late and sometimes causes access violation.
+ I was not able to reproduce this crash, so did not add new tests.
+ This patch is based on the error reported in
+ http://code.google.com/p/chromium/issues/detail?id=49323.
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::pageDestroyed):
+ * page/DOMWindow.h:
+ * page/Frame.cpp:
+ (WebCore::Frame::pageDestroyed):
+
+2010-07-21 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Don't assert when clicking on a plug-in in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=42762
+
+ Remove a now invalid assert and return false instead.
+
+ * page/mac/EventHandlerMac.mm:
+ (WebCore::EventHandler::passMouseDownEventToWidget):
+
+2010-07-21 Anton Muhin <antonm@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ [v8] Revert r60670 as it introduced a regression: in some cases named children couldn't be retrieved.
+ https://bugs.webkit.org/show_bug.cgi?id=42766
+
+ See http://code.google.com/p/chromium/issues/detail?id=48804 for more details.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::namedItemAdded):
+ (WebCore::ScriptController::namedItemRemoved):
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::V8DOMWindowShell::updateDocumentWrapperCache):
+ * bindings/v8/V8DOMWindowShell.h:
+ * bindings/v8/V8DOMWrapper.cpp:
+ (WebCore::V8DOMWrapper::instantiateV8Object):
+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+ (WebCore::V8HTMLDocument::namedPropertyDeleter):
+ (WebCore::V8HTMLDocument::namedPropertyGetter):
+ (WebCore::V8HTMLDocument::indexedPropertyGetter):
+ (WebCore::V8HTMLDocument::allAccessorSetter):
+ (WebCore::toV8):
+
+2010-07-21 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Update plug-in proxy backed <video> and <audio> elements.
+ https://bugs.webkit.org/show_bug.cgi?id=42770
+ <rdar://problem/7963467>
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::attributeChanged): Only call m_player->setControls when
+ the 'controls' attribute changes.
+ (WebCore::HTMLMediaElement::createRenderer):
+ (WebCore::HTMLMediaElement::attach): If we have a proxy widget, call the WebFrameLoaderClient's
+ 'hide' and 'show' methods for the media proxy plug-in to make sure we remove and re-add the
+ plug-in's view to the global list of plugin views.
+ (WebCore::HTMLMediaElement::createMediaPlayerProxy): Bail if m_proxyWidget is non-NULL
+
+ * loader/EmptyClients.h:
+ (WebCore::EmptyFrameLoaderClient::hideMediaPlayerProxyPlugin): Empty stub method.
+ (WebCore::EmptyFrameLoaderClient::showMediaPlayerProxyPlugin): Ditto.
+
+ * loader/FrameLoader.cpp:
+ * loader/FrameLoaderClient.h:
+ * loader/SubframeLoader.cpp:
+ (WebCore::FrameLoader::loadMediaPlayerProxyPlugin): Always set m_containsPlugIns in loadMediaPlayerProxyPlugin(),
+ even when we don't have a renderer.
+ (WebCore::FrameLoader::hideMediaPlayerProxyPlugin): New, call hideMediaPlayerProxyPlugin.
+ (WebCore::FrameLoader::showMediaPlayerProxyPlugin): New, call showMediaPlayerProxyPlugin.
+
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::NullMediaPlayerPrivate::setControls):
+ (WebCore::MediaPlayer::setControls): New, pass through to media engine.
+ (WebCore::MediaPlayer::enterFullscreen): Ditto.
+ (WebCore::MediaPlayer::exitFullscreen): Ditto.
+ * platform/graphics/MediaPlayer.h:
+ * platform/graphics/MediaPlayerPrivate.h:
+ (WebCore::MediaPlayerPrivateInterface::setControls):
+ (WebCore::MediaPlayerPrivateInterface::enterFullscreen):
+ (WebCore::MediaPlayerPrivateInterface::exitFullscreen):
+
+2010-07-21 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Make more members of CSSStyleSelector private.
+ https://bugs.webkit.org/show_bug.cgi?id=42757
+
+ No change in behavior, so no new tests.
+
+ * css/CSSStyleSelector.h: Made a publicly-unused methods private.
+
+2010-07-21 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: consider jQuery object to be of array nature.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42758
+
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+
+2010-07-21 Alexey Proskuryakov <ap@apple.com>
+
+ Unreviewed Windows build fix.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42717
+ <rdar://problem/7062824> A wrong password entered for site or proxy auth remains in WebCore
+ credential storage, and is sent with subsequent requests
+
+ * platform/network/cf/ResourceHandleCFNet.cpp:
+ (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Don't use that direct a
+ copy/paste, oops!
+
+2010-07-21 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Darin Adler.
+
+ When GraphicsLayer::contentsOrientation() is CompositingCoordinatesBottomUp, need to flip repaint rects
+ https://bugs.webkit.org/show_bug.cgi?id=42662
+
+ If the contentsOrientation() on a GraphicsLayer is CompositingCoordinatesBottomUp, then we
+ need to flip the rects passed to setNeedsDisplayInRect:.
+
+ Avoid writing this code twice by making a bare function to share code
+ between WebLayer and WebTiledLayer. Convert the existing +drawContents:ofLayer:intoContext:
+ class method into a bare function, because the Obj-C calling overhead doesn't buy us anything.
+
+ Take out an assertion in GraphicsLayerCA::updateContentsTransform() that is not
+ correct.
+
+ No new tests because no layers use bottom-up contents at present.
+
+ * platform/graphics/mac/GraphicsLayerCA.mm:
+ (WebCore::GraphicsLayerCA::updateContentsTransform):
+ * platform/graphics/mac/WebLayer.h:
+ * platform/graphics/mac/WebLayer.mm:
+ (drawLayerContents):
+ (setLayerNeedsDisplayInRect):
+ (-[WebLayer setNeedsDisplayInRect:]):
+ (-[WebLayer drawInContext:]):
+ * platform/graphics/mac/WebTiledLayer.mm:
+ (-[WebTiledLayer setNeedsDisplayInRect:]):
+ (-[WebTiledLayer drawInContext:]):
+
+2010-07-20 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42717
+ <rdar://problem/7062824> A wrong password entered for site or proxy auth remains in WebCore
+ credential storage, and is sent with subsequent requests
+
+ Tests: http/tests/security/401-logout/401-logout.php
+ http/tests/xmlhttprequest/remember-bad-password.html
+
+ * platform/network/CredentialStorage.cpp: (WebCore::CredentialStorage::remove):
+ * platform/network/CredentialStorage.h:
+ Added a way to remove stored credentials for a given protection space.
+
+ * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
+ * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
+ Remove stored credentials if they didn't work the first time.
+
+2010-07-20 Steve Falkenburg <sfalken@apple.com>
+
+ Reviewed by Adam Roben.
+
+ WebKit on Windows should build optionally with an unversioned ICU DLL
+ https://bugs.webkit.org/show_bug.cgi?id=42722
+ <rdar://problem/8211767> WebKit needs to link against unversioned ICU
+
+ To get the proper value for U_DISABLE_RENAMING into all source files, we force
+ the include of ICUVersion.h (our generated header) via the compiler options.
+
+ * WebCore.vcproj/WebCore.vcproj:
+ Add forced include of ICUVersion.h.
+ * WebCore.vcproj/WebCoreCommon.vsprops: Add forced include of ICUVersion.h.
+
+2010-07-21 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ WebInspector: Serialization to JSON in InspectorValue works incorrect
+ if comma is assigned as decimal separator. Windows with Russian locale.
+ https://bugs.webkit.org/show_bug.cgi?id=42755
+
+ * inspector/InspectorValues.cpp:
+ (WebCore::InspectorBasicValue::writeJSON):
+
+2010-07-20 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ CSS rotation transform can cause elements with certain styles to vanish during rotation.
+ https://bugs.webkit.org/show_bug.cgi?id=42579
+
+ Remove some untested, broken code that, as far as I can tell, could never get hit.
+ Use the correct rect for the PaintInfo so that zero-sized elements with overflow:hidden
+ but a border paint correctly.
+
+ Test: compositing/overflow/zero-size-overflow.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::paintIntoLayer):
+
+2010-07-21 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [QT] Leak and few more fixes to qt port of geolocation
+ https://bugs.webkit.org/show_bug.cgi?id=42753
+
+ Fixes memory leak and default values set to attributes.
+
+ Memory leak fix no new test case added.
+
+ * platform/qt/GeolocationServiceQt.cpp: Added.
+ (WebCore::GeolocationServiceQt::~GeolocationServiceQt):
+ (WebCore::GeolocationServiceQt::positionUpdated):
+
+2010-07-21 Kristian Amlie <kristian.amlie@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Added automatic sqlite extraction for Symbian to QtWebKit.
+
+ Also added sqlite detection in case sqlite is not present in the SDK.
+ This is possible if WebKit is compiled standalone.
+
+ The inclusion part is a consequence of commit c578c6c1d6d in the Qt
+ repository. It will not work on Qt versions < 4.7.1, but that is ok,
+ since the only build system it will affect is marked as experimental
+ in the whole 4.7 series.
+
+ * WebCore.pro:
+
+2010-07-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Associate elements with the active form
+ https://bugs.webkit.org/show_bug.cgi?id=42728
+
+ This patch fixes fast/forms/formmove3.html. The test still doesn't
+ pass due to some render tree differences, but it works as intended now.
+
+ To fix this test, I needed to deviate from the spec slight. Minefield
+ seems to have the same deviation:
+ - http://www.w3.org/Bugs/Public/show_bug.cgi?id=10216
+
+ * html/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::takeForm):
+ (WebCore::HTMLConstructionSite::setForm):
+ (WebCore::HTMLConstructionSite::createHTMLElement):
+ * html/HTMLConstructionSite.h:
+ (WebCore::HTMLConstructionSite::form):
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processStartTagForInBody):
+
+2010-07-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ The adoption agency doesn't properly attach()
+ https://bugs.webkit.org/show_bug.cgi?id=42727
+
+ The adoption agency is transliterated rather directly from the spec,
+ but it misses some of the WebKit-specific machinations, such as
+ attaching to the render tree.
+
+ The algorithm, as written, is a minor layer violation. I've added to
+ the problem by calling attach() from HTMLTreeBuilder (even though
+ that's the job of the HTMLConstructionSite). We'll need to clean up
+ the layering a bit at some point.
+
+ This patch half fixes fast/forms/formmove3.html. Hopefully I'll finish
+ fixing it in the next patch.
+
+ * html/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::createHTMLElementFromSavedElement):
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
+
+2010-07-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ <input> elements with no type attribute should be foster parented
+ https://bugs.webkit.org/show_bug.cgi?id=42725
+
+ Fix spec transcription error.
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processStartTagForInTable):
+
+2010-07-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix fast/css/last-child-style-sharing.html
+ https://bugs.webkit.org/show_bug.cgi?id=42731
+
+ Prior to this patch, we weren't calling finishParsingChildren on the
+ body element. We need a more systematic way of catching these bugs.
+
+ * html/HTMLElementStack.cpp:
+ (WebCore::HTMLElementStack::popAll):
+ * html/HTMLElementStack.h:
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processEndOfFile):
+
+2010-07-21 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Runtime feature switch for device orientation
+ https://bugs.webkit.org/show_bug.cgi?id=42265
+
+ Add a runtime feature switch that decides whether device orientation
+ events are available or not. Defaults to true.
+
+ * WebCore.vcproj/WebCoreCommon.vsprops: Add bindings/generic to include path.
+ * bindings/generic/RuntimeEnabledFeatures.cpp:
+ * bindings/generic/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::setDeviceOrientationEnabled):
+ (WebCore::RuntimeEnabledFeatures::deviceOrientationEnabled):
+ (WebCore::RuntimeEnabledFeatures::deviceOrientationEventEnabled):
+ (WebCore::RuntimeEnabledFeatures::ondeviceorientationEnabled):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::addEventListener):
+ (WebCore::DOMWindow::removeEventListener):
+ (WebCore::DOMWindow::removeAllEventListeners):
+ * page/DOMWindow.idl:
+ * page/Page.cpp:
+ (WebCore::Page::Page):
+
+2010-07-21 Zoltan Herczeg <zherczeg@webkit.org>
+
+ Reviewed Nikolas Zimmermann.
+
+ SVGFilterElement & SVGFE*Element don't support dynamic invalidation, when attributes change
+ https://bugs.webkit.org/show_bug.cgi?id=42244
+
+ The implementation was done by Nikolas Zimmermann before, but
+ there was no tests for it. The patch also implements the simple
+ setFilterRes method.
+
+ Tests: svg/dynamic-updates/SVGFilterElement-dom-filterRes-attr.html
+ svg/dynamic-updates/SVGFilterElement-dom-filterUnits-attr.html
+ svg/dynamic-updates/SVGFilterElement-dom-height-attr.html
+ svg/dynamic-updates/SVGFilterElement-dom-primitiveUnits-attr.html
+ svg/dynamic-updates/SVGFilterElement-dom-width-attr.html
+ svg/dynamic-updates/SVGFilterElement-dom-x-attr.html
+ svg/dynamic-updates/SVGFilterElement-dom-y-attr.html
+ svg/dynamic-updates/SVGFilterElement-svgdom-filterRes-call.html
+ svg/dynamic-updates/SVGFilterElement-svgdom-filterResX-prop.html
+ svg/dynamic-updates/SVGFilterElement-svgdom-filterResY-prop.html
+ svg/dynamic-updates/SVGFilterElement-svgdom-filterUnits-prop.html
+ svg/dynamic-updates/SVGFilterElement-svgdom-height-prop.html
+ svg/dynamic-updates/SVGFilterElement-svgdom-primitiveUnits-prop.html
+ svg/dynamic-updates/SVGFilterElement-svgdom-width-prop.html
+ svg/dynamic-updates/SVGFilterElement-svgdom-x-prop.html
+ svg/dynamic-updates/SVGFilterElement-svgdom-y-prop.html
+
+ * svg/SVGFilterElement.cpp:
+ (WebCore::SVGFilterElement::setFilterRes):
+ (WebCore::SVGFilterElement::svgAttributeChanged):
+ (WebCore::SVGFilterElement::childrenChanged):
+ * svg/SVGFilterElement.h:
+
+2010-07-21 Ben Murdoch <benm@google.com>
+
+ Unreviewed, build fix.
+
+ Forgot to update the role of HitTestRequest.h in
+ the xcode project after landing patch from
+ https://bugs.webkit.org/show_bug.cgi?id=39493
+
+ * WebCore.xcodeproj/project.pbxproj: Make HitTestRequest.h
+ private so it can be included in WebKit by EventHandler.h
+ which is already private..
+
+2010-07-20 Ben Murdoch <benm@google.com>
+
+ Reviewed by Steve Block.
+
+ Touch events do not affect the :active CSS state
+ https://bugs.webkit.org/show_bug.cgi?id=39493
+
+ Test: fast/events/touch/touch-active-state.html
+
+ * WebCore.exp.in: Update exports for new signature of
+ hitTestResultAtPoint.
+ * WebCore.order: ditto.
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::EventHandler):
+ (WebCore::EventHandler::hitTestResultAtPoint): Pass the type
+ of the hit test to perform as a parameter with a default
+ value rather than harcoding it in the function body.
+ (WebCore::EventHandler::handleMouseMoveEvent): Do not modiify
+ the active element during a mouse move if the user is
+ touching the screen.
+ (WebCore::EventHandler::handleTouchEvent): Set the correct
+ type of hit test to perform depending on the type of the
+ touch event we are handling.
+ * page/EventHandler.h: Update the signature of hitTestResultAtPoint.
+
+2010-07-20 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ console.assert should include stack trace with line numbers.
+ https://bugs.webkit.org/show_bug.cgi?id=22556
+
+ Test: inspector/console-assert.html
+
+ * bindings/v8/ScriptCallStack.cpp:
+ (WebCore::getTopFrameLocation):
+ (WebCore::toScriptCallFramesVector):
+ (WebCore::ScriptCallStack::create):
+ (WebCore::ScriptCallStack::ScriptCallStack):
+ * bindings/v8/ScriptCallStack.h:
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::setCaptureCallStackForUncaughtExceptions):
+ * bindings/v8/custom/V8ConsoleCustom.cpp:
+ (WebCore::V8Console::traceCallback):
+ (WebCore::V8Console::assertCallback):
+ * inspector/ConsoleMessage.cpp:
+ (WebCore::ConsoleMessage::ConsoleMessage):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::addMessageToConsole):
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleMessage.prototype._formatMessage):
+ (WebInspector.ConsoleMessage.prototype.toMessageElement):
+ * page/Console.cpp:
+ (WebCore::Console::lastWMLErrorMessage):
+ * page/Console.idl:
+
+2010-07-20 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Kent Tamura.
+
+ [EFL] Use log functions instead of fprintf
+ https://bugs.webkit.org/show_bug.cgi?id=42576
+
+ Use LOG and LOG_ERROR instead of fprintf.
+
+ No new tests, no new functionality.
+
+ * platform/efl/WidgetEfl.cpp:
+ (WebCore::Widget::applyFallbackCursor):
+
+2010-07-20 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ WebInspector: the bindings generation helper script can be
+ simplified a bit. Chromium.
+ https://bugs.webkit.org/show_bug.cgi?id=42523
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gyp/scripts/rule_binding.py:
+ * bindings/scripts/CodeGenerator.pm:
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorObjC.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/scripts/generate-bindings.pl:
+ * inspector/CodeGeneratorInspector.pm:
+
+2010-07-20 Steve Falkenburg <sfalken@apple.com>
+
+ Re-save vsprops file after no-op edit in Visual Studio
+ to fix manual edit issues.
+
+ * WebCore.vcproj/WebCoreCommon.vsprops:
+
+2010-07-20 Steve Falkenburg <sfalken@apple.com>
+
+ Re-save vcproj file after no-op edit in Visual Studio
+ to fix manual edit issues.
+
+ * WebCore.vcproj/WebCore.vcproj:
+
+2010-07-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Include attributes when reconstructing elements in HTML5 tree builder
+ https://bugs.webkit.org/show_bug.cgi?id=42594
+
+ Remove FIXME now that we have a test.
+
+ * html/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::createHTMLElementFromElementRecord):
+
+2010-07-20 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Brady Eidson.
+
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=42719
+ Make Acid2 pass in WebKit2
+
+ * WebCore.exp.in: Update exported functions.
+
+2010-07-20 Gavin Peters <gavinp@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ prefetch categorization is exactly wrong
+ https://bugs.webkit.org/show_bug.cgi?id=42651
+
+ While I was in the area, I saw that CachedResource::schedule() was dead, so I have removed it.
+
+ Test: fast/dom/HTMLLinkElement/onload-completion-test.html
+
+ * loader/CachedCSSStyleSheet.h:
+ * loader/CachedFont.h:
+ * loader/CachedImage.h:
+ * loader/CachedResource.cpp:
+ * loader/CachedResource.h:
+ (WebCore::CachedResource::isPrefetch):
+ * loader/CachedScript.h:
+ * loader/CachedXBLDocument.h:
+ * loader/CachedXSLStyleSheet.h:
+
+2010-07-20 James Hawkins <jhawkins@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Expose the form submission trigger on the HTMLFormElement object. This
+ is used to verify that the user submitted the form instead of JS when
+ saving form data in Chrome AutoFill.
+ https://bugs.webkit.org/show_bug.cgi?id=42479
+
+ No new tests as this is only used by the Chromium WebKit API.
+
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::HTMLFormElement):
+ (WebCore::HTMLFormElement::submit):
+ (WebCore::HTMLFormElement::reset):
+ (WebCore::HTMLFormElement::submissionTrigger):
+ * html/HTMLFormElement.h:
+
+2010-07-20 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Fix fast/dom/title-content-write-set.html for HTML5 tree builder
+ https://bugs.webkit.org/show_bug.cgi?id=42668
+
+ Address some late-breaking review comments.
+
+ * dom/CharacterData.cpp:
+ (WebCore::CharacterData::appendDataCommon):
+ (WebCore::CharacterData::parserAppendData):
+ (WebCore::CharacterData::appendData):
+ (WebCore::CharacterData::insertData):
+ (WebCore::CharacterData::replaceData):
+ * dom/CharacterData.h:
+
+2010-07-20 Daniel Erat <derat@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Subpixel rendering always disabled for Chromium Linux
+ https://bugs.webkit.org/show_bug.cgi?id=42220
+
+ Explicitly initialize global Chromium Linux isSkiaSubpixelGlyphs
+ flag to false for clarity.
+
+ * platform/graphics/chromium/FontPlatformDataLinux.cpp:
+
+2010-07-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Fix fast/dom/title-content-write-set.html for HTML5 tree builder
+ https://bugs.webkit.org/show_bug.cgi?id=42668
+
+ When I split parserAppendData from appendData, it was tempting to cut
+ the function at dispatchModifiedEvent, but that's not quite right. We
+ still need to notify the parent that it's children have changed.
+
+ * dom/CharacterData.cpp:
+ (WebCore::CharacterData::appendDataCommon):
+ (WebCore::CharacterData::parserAppendData):
+ (WebCore::CharacterData::appendData):
+ * dom/CharacterData.h:
+
+2010-07-20 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ CrashTracer: [USER] 300 crashes in Safari at com.apple.WebCore: WebCore::AccessibilityTable::isTableExposableThroughAccessibility + 573
+ https://bugs.webkit.org/show_bug.cgi?id=42652
+
+ When a table cell accesses its parent table, we should not use getOrCreate, because creating an AXTable inspects its render tree state
+ which may be out of date, leading to a crash.
+ By using only get(), it implies that the AXTable must be created before AXTableCells. This should
+ always be the case when AT clients access a table.
+
+ Test: accessibility/updating-attribute-in-table-causes-crash.html
+
+ * accessibility/AccessibilityTableCell.cpp:
+ (WebCore::AccessibilityTableCell::parentTable):
+
+2010-07-20 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by David Hyatt.
+
+ Check the node is a text node before doing the static cast
+ for editing commands.
+ https://bugs.webkit.org/show_bug.cgi?id=42655
+
+ Test: editing/execCommand/editing-nontext-node-crash.xhtml
+
+ * editing/DeleteSelectionCommand.cpp:
+ (WebCore::DeleteSelectionCommand::fixupWhitespace):
+ * editing/InsertLineBreakCommand.cpp:
+ (WebCore::InsertLineBreakCommand::doApply):
+ * editing/InsertParagraphSeparatorCommand.cpp:
+ (WebCore::InsertParagraphSeparatorCommand::doApply):
+
+2010-07-20 Leo Yang <leo.yang@torchmobile.com.cn>
+
+ Reviewed by David Hyatt.
+
+ Don't merge Anonymous block whose first child is inline run-in.
+ Make run-in recalculate its style after its renderer is destroyed.
+ https://bugs.webkit.org/show_bug.cgi?id=41375.
+
+ Test: fast/runin/crash-when-reparent-sibling.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::canMergeContiguousAnonymousBlocks):
+ * rendering/RenderObjectChildList.cpp:
+ (WebCore::RenderObjectChildList::destroyLeftoverChildren):
+
+2010-07-20 Steve Block <steveblock@google.com>
+
+ Unreviewed Qt test fix.
+
+ Qt should not use PREEMPT_GEOLOCATION_PERMISSION until Bug 42027 is fixed.
+ https://bugs.webkit.org/show_bug.cgi?id=42068
+
+ No new tests, test fix only.
+
+ * WebCore.pro:
+
+2010-07-20 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r63764.
+ http://trac.webkit.org/changeset/63764
+ https://bugs.webkit.org/show_bug.cgi?id=42658
+
+ have broken Chromium linux build (Requested by loislo on
+ #webkit).
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gyp/scripts/rule_binding.py:
+ * bindings/scripts/CodeGenerator.pm:
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorObjC.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/scripts/generate-bindings.pl:
+ * inspector/CodeGeneratorInspector.pm:
+
+2010-07-20 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Brady Eidson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41531
+ Asynchronous cross origin XMLHttpRequest doesn't expose 401 response when withCredentials is false
+
+ This doesn't match Firefox, but it matches our sync case, XHR2 spec and common sense.
+
+ Test: http/tests/xmlhttprequest/cross-origin-no-authorization.html (updated results).
+
+ * loader/DocumentThreadableLoader.cpp:
+ (WebCore::DocumentThreadableLoader::didReceiveAuthenticationChallenge): Instead of canceling
+ the request, continue without credentials - if the platform has a necessary method on
+ ResourceHandle.
+
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::didReceiveAuthenticationChallenge): Don't ask resource loader
+ client for credentials if subresource loader client already took care of those.
+
+ * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::hasAuthenticationChallenge):
+ * platform/network/ResourceHandle.h:
+ Added an accessor to check whether ResourceHandle is currently waiting for credentials.
+
+2010-07-20 Leandro Pereira <leandro@profusion.mobi>
+
+ [EFL] Unreviewed build fix.
+
+ Build SVGPathBuilder, SVGPathParser and SVGPathSegListBuilder.
+ Add websockets include directory.
+
+ The EFL port doesn't yet support automated tests.
+
+ * CMakeLists.txt:
+
+2010-07-20 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ WebInspector: the bindings generation helper script can be
+ simplified a bit. Chromium.
+ https://bugs.webkit.org/show_bug.cgi?id=42523
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gyp/scripts/rule_binding.py:
+ * bindings/scripts/CodeGenerator.pm:
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorObjC.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/scripts/generate-bindings.pl:
+ * inspector/CodeGeneratorInspector.pm:
+
+2010-07-20 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by Geoffrey Garen.
+
+ WebScriptObject Should Allow Safely Checking For Key Existence
+ https://bugs.webkit.org/show_bug.cgi?id=42613
+
+ Test: platform/mac/fast/objc/webScriptObject-hasWebScriptKey.html
+
+ Add private API "hasWebScriptKey" to check for key existence in
+ a WebScriptObject. Like JavaScript's `in` syntax. This is intended
+ to be made public eventually.
+
+ * bindings/objc/WebScriptObject.mm:
+ (-[WebScriptObject hasWebScriptKey:]):
+ * bindings/objc/WebScriptObjectPrivate.h:
+
+2010-07-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ HTML5 tree builder needs to call dispatchDocumentElementAvailable
+ https://bugs.webkit.org/show_bug.cgi?id=42654
+
+ This patch fixes the follout LayoutTests with --html5-treebuilder:
+ - userscripts/script-not-run-for-fragments.html
+ - userscripts/script-run-at-start.html
+
+ * html/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::HTMLConstructionSite):
+ (WebCore::HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded):
+ (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
+ (WebCore::HTMLConstructionSite::insertHTMLHtmlElement):
+ * html/HTMLConstructionSite.h:
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+
+2010-07-20 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
+
+ Reviewed by Steve Block.
+
+ Need to be able to configure Geolocation policy regarding user permissions
+ https://bugs.webkit.org/show_bug.cgi?id=42068
+
+ Introducing new USE() flag PREEMPT_GEOLOCATION_PREMISSION using which
+ acquires user permission first before starting location service
+
+ This change does not introduce any change in behavior for any platform. So there are no new tests
+ added.
+
+ * WebCore.pro:
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::startRequest):
+ (WebCore::Geolocation::setIsAllowed):
+ (WebCore::Geolocation::startUpdating):
+ * page/Geolocation.h:
+
+2010-07-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ HTML5 tree builder should restore form state
+ https://bugs.webkit.org/show_bug.cgi?id=42644
+
+ We need to tell self-closing tags that we're done parsing their
+ children. This patch fixes the following LayoutTests when run with
+ --html5-treebuilder:
+
+ fast/forms/button-state-restore.html
+ fast/forms/state-restore-to-non-autocomplete-form.html
+ fast/forms/state-restore-to-non-edited-controls.html
+ fast/history/saves-state-after-fragment-nav.html
+ http/tests/navigation/restore-form-state-https.html
+
+ * html/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::insertSelfClosingHTMLElement):
+
+2010-07-20 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r63750.
+ http://trac.webkit.org/changeset/63750
+ https://bugs.webkit.org/show_bug.cgi?id=42648
+
+ This revision breaks the windows builds (Requested by
+ hwennborg on #webkit).
+
+ * bindings/generic/RuntimeEnabledFeatures.cpp:
+ * bindings/generic/RuntimeEnabledFeatures.h:
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::addEventListener):
+ (WebCore::DOMWindow::removeEventListener):
+ (WebCore::DOMWindow::removeAllEventListeners):
+ * page/DOMWindow.idl:
+ * page/Page.cpp:
+ (WebCore::Page::Page):
+
+2010-07-20 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ WebInspector: It is possible to show full call stack instead of top frame for Caller
+ and Call Site properties in Timeline panel.
+ https://bugs.webkit.org/show_bug.cgi?id=42620
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/TimelinePanel.js:
+ (WebInspector.TimelinePanel.FormattedRecord):
+ (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
+ (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):
+ (WebInspector.TimelinePanel.PopupContentHelper.prototype._appendElementRow):
+ (WebInspector.TimelinePanel.PopupContentHelper.prototype._appendLinkRow):
+ (WebInspector.TimelinePanel.PopupContentHelper.prototype._appendStackTrace):
+ * inspector/front-end/inspector.css:
+ (.timeline-details):
+ (.timeline-function-name):
+ (.timeline-stacktrace-title):
+
+2010-07-20 Leon Clarke <leonclarke@google.com>
+
+ Reviewed by Pavel Feldman.
+
+ Make things compile again when the inspector is disabled, following
+ recent inspector improvements.
+ https://bugs.webkit.org/show_bug.cgi?id=42632
+
+ No new tests. Fixing a build break.
+
+
+ * bindings/v8/ScriptCallStack.cpp:
+ (WebCore::ScriptCallStack::stackTrace):
+ * inspector/InspectorController.h:
+ (WebCore::InspectorController::didInsertDOMNode):
+ (WebCore::InspectorController::didRemoveDOMNode):
+ (WebCore::InspectorController::didModifyDOMAttr):
+ * inspector/InspectorDOMAgent.h:
+ * loader/appcache/ApplicationCacheGroup.cpp:
+
+2010-07-20 Anton Muhin <antonm@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ [v8] Allow handles to be disposed and WebKit objects to be dereferenced even if their map is already destroyed.
+ https://bugs.webkit.org/show_bug.cgi?id=42634
+
+ Currently DOMDataStore could be destroyed even if it has some mappings (it gets destroyed
+ when its isolated context gets GCed). However in this case, handles allocated for
+ such objects would never be disposed as we require presence of mapping from wrapped
+ WebKit object to handle being collected in the map and now map is gone. That leads to
+ zombie objects in both WebKit (wrapped WebKit object doesn't get dereferenced) and V8
+ (both handle and V8 wrapper object could not be destroyed).
+
+ See http://code.google.com/p/chromium/issues/detail?id=47125 for further discussion.
+
+ * bindings/v8/DOMData.h:
+ (WebCore::DOMData::handleWeakObject):
+ * bindings/v8/DOMDataStore.cpp:
+ (WebCore::DOMDataStore::weakNodeCallback):
+ * bindings/v8/V8DOMMap.h:
+ (WebCore::WeakReferenceMap::~WeakReferenceMap):
+
+2010-07-20 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Runtime feature switch for device orientation
+ https://bugs.webkit.org/show_bug.cgi?id=42265
+
+ Add a runtime feature switch that decides whether device orientation
+ events are available or not. Defaults to true.
+
+ * bindings/generic/RuntimeEnabledFeatures.cpp:
+ * bindings/generic/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::setDeviceOrientationEnabled):
+ (WebCore::RuntimeEnabledFeatures::deviceOrientationEnabled):
+ (WebCore::RuntimeEnabledFeatures::deviceOrientationEventEnabled):
+ (WebCore::RuntimeEnabledFeatures::ondeviceorientationEnabled):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::addEventListener):
+ (WebCore::DOMWindow::removeEventListener):
+ (WebCore::DOMWindow::removeAllEventListeners):
+ * page/DOMWindow.idl:
+ * page/Page.cpp:
+ (WebCore::Page::Page):
+
+2010-07-20 Hayato Ito <hayato@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Fixed a crash when deeply nested CSS selector is used.
+ https://bugs.webkit.org/show_bug.cgi?id=41129
+
+ This patch deletes CSSSelectors iteratively so that it doesn't cause stack overflow.
+
+ Test: fast/css/css-selector-deeply-nested.html
+
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelectorBag::~CSSSelectorBag):
+ (WebCore::CSSSelectorBag::isEmpty):
+ (WebCore::CSSSelectorBag::append):
+ (WebCore::CSSSelectorBag::takeAny):
+ (WebCore::CSSSelector::~CSSSelector):
+ (WebCore::CSSSelector::specificity):
+ * css/CSSSelector.h:
+
+2010-07-20 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ [v8] Web Inspector: inspected page renderer crashes when inspected page has JS syntax error
+ https://bugs.webkit.org/show_bug.cgi?id=42642
+
+ * bindings/v8/V8ConsoleMessage.cpp:
+ (WebCore::V8ConsoleMessage::handler):
+
+2010-07-20 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r63742.
+ http://trac.webkit.org/changeset/63742
+ https://bugs.webkit.org/show_bug.cgi?id=42641
+
+ Broke Leopard Intel build. (Requested by bbandix on #webkit).
+
+ * WebCore.pro:
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::startRequest):
+ (WebCore::Geolocation::setIsAllowed):
+ (WebCore::Geolocation::startUpdating):
+ * page/Geolocation.h:
+
+2010-07-20 Adam Roben <aroben@apple.com>
+
+ Windows build fix
+
+ * WebCore.vcproj/WebCore.vcproj: Fixed case of "Name" attribute.
+
+2010-07-20 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
+
+ Reviewed by Steve Block.
+
+ Need to be able to configure Geolocation policy regarding user permissions
+ https://bugs.webkit.org/show_bug.cgi?id=42068
+
+ Introducing new USE() flag PREEMPT_GEOLOCATION_PREMISSION using which
+ acquires user permission first before starting location service
+
+ This change does not introduce any change in behavior for any platform. So there are no new tests
+ added.
+
+ * WebCore.pro:
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::startRequest):
+ (WebCore::Geolocation::setIsAllowed):
+ (WebCore::Geolocation::startUpdating):
+ * page/Geolocation.h:
+
+2010-07-20 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Inspector: Resources Search Should Search Only Filtered Resources
+ https://bugs.webkit.org/show_bug.cgi?id=28290
+
+ * inspector/front-end/AbstractTimelinePanel.js:
+ (WebInspector.AbstractTimelinePanel.prototype._updateFilter):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype.get searchableViews):
+ * inspector/front-end/inspector.js:
+ (WebInspector.performSearch):
+ (WebInspector.doPerformSearch):
+
+2010-07-20 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Incorrect absolute URLs in tooltips of links in the ElementsTreeOutline
+ https://bugs.webkit.org/show_bug.cgi?id=42626
+
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeElement.prototype._attributeHTML):
+
+2010-07-20 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Unreviewed comment fix. The comment in IDL should be //, not # .
+
+ Code generator: ensure generated constants match their corresponding enums.
+ https://bugs.webkit.org/show_bug.cgi?id=42250
+
+ * dom/OverflowEvent.idl:
+
+2010-07-20 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Add WebCore/bindings/generic/RuntimeEnabledFeatures.cpp to build files
+ https://bugs.webkit.org/show_bug.cgi?id=42380
+
+ RuntimeEnabledFeatures.cpp and .h were moved from bindings/v8 to
+ bindings/generic a while a go (in r54593), but need to
+ be added to the build in order to be used.
+
+ No new functionality so no new tests.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * websockets/WebSocket.cpp: Remove #if USE(V8), as RuntimeEnabledFeatures.cpp is no longer V8-only.
+ * websockets/WebSocket.h: Ditto.
+
+2010-07-20 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ clean up style in ClipboardWin and PasteboardWin
+ https://bugs.webkit.org/show_bug.cgi?id=42609
+
+ No new tests since this is just a style cleanup.
+
+ * platform/win/ClipboardUtilitiesWin.cpp:
+ (WebCore::createGlobalData):
+ (WebCore::markupToCFHTML):
+ (WebCore::getURL):
+ (WebCore::getPlainText):
+ (WebCore::getTextHTML):
+ (WebCore::fragmentFromFilenames):
+ (WebCore::containsFilenames):
+ (WebCore::fragmentFromCFHTML):
+ (WebCore::fragmentFromHTML):
+ * platform/win/ClipboardUtilitiesWin.h:
+ * platform/win/ClipboardWin.cpp:
+ (WebCore::pathRemoveBadFSCharacters):
+ (WebCore::createGlobalHDropContent):
+ (WebCore::createGlobalUrlFileDescriptor):
+ (WebCore::writeURL):
+ (WebCore::ClipboardWin::clearData):
+ (WebCore::ClipboardWin::clearAllData):
+ (WebCore::ClipboardWin::getData):
+ (WebCore::ClipboardWin::types):
+ (WebCore::ClipboardWin::declareAndWriteDragImage):
+ (WebCore::ClipboardWin::writeRange):
+ * platform/win/ClipboardWin.h:
+ (WebCore::ClipboardWin::create):
+ (WebCore::ClipboardWin::dataObject):
+ * platform/win/PasteboardWin.cpp:
+ (WebCore::PasteboardOwnerWndProc):
+ (WebCore::Pasteboard::writeSelection):
+ (WebCore::Pasteboard::writeURL):
+ (WebCore::Pasteboard::plainText):
+ (WebCore::Pasteboard::documentFragment):
+
+2010-07-20 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: jump to source is broken for call frames logged by console.trace
+ https://bugs.webkit.org/show_bug.cgi?id=42619
+
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleMessage.prototype._populateStackTraceTreeElement):
+ * inspector/front-end/treeoutline.js: allow passing HTML element as a title.
+ (TreeElement.prototype.set title):
+ (TreeElement.prototype.set shouldRefreshChildren):
+ (TreeElement.prototype._setListItemNodeContent):
+ (TreeElement.prototype._attach):
+
+2010-07-20 Tony Chang <tony@chromium.org>
+
+ Reviewed by Dan Bernstein.
+
+ [chromium] crash in Position::getInlineBoxAndOffset
+ https://bugs.webkit.org/show_bug.cgi?id=42202
+
+ Test: editing/selection/firstRect-crash.html
+ Manual test: win/contextmenu-key2.html
+
+ * page/EventHandler.cpp: Code no longer needed
+ * page/Frame.cpp:
+ (WebCore::Frame::firstRectForRange): Normalize Positions to VisiblePositions because
+ Positions may be pointing to nodes that have no renderer. If there's no renderer,
+ getInlineBoxAndOffset will crash.
+
+2010-07-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Foster parenting depends on the current element at insertion time
+ https://bugs.webkit.org/show_bug.cgi?id=42599
+
+ We need to consider the current element at insertion-time when deciding
+ whether to redirect insertion to the foster parent. Previously, we
+ were considering the current element *both* at insertion-time and at
+ the time we created the guard.
+
+ * html/HTMLConstructionSite.h:
+ (WebCore::HTMLConstructionSite::RedirectToFosterParentGuard::RedirectToFosterParentGuard):
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processStartTagForInTable):
+ (WebCore::HTMLTreeBuilder::processEndTagForInTable):
+ (WebCore::HTMLTreeBuilder::defaultForInTableText):
+
+2010-07-20 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Failing 2d.path.stroke.prune.curve philip canvas test
+ https://bugs.webkit.org/show_bug.cgi?id=42190
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::closePath): Added check to make sure there's a non-trivial path to close. Since there is currently no way to check if the current point is the start point, or similarly if there is only 1 point in the current subpath (since these are both sufficient conditions for a trivial subpath), then checking that the bounding rectangle has both zero width and height proves also to be a sufficient condition for a trivial path.
+ (WebCore::CanvasRenderingContext2D::quadraticCurveTo): Added in simple bounds as per the spec.
+ (WebCore::CanvasRenderingContext2D::bezierCurveTo): Added in simple bounds as per the spec.
+ * platform/graphics/cg/PathCG.cpp:
+ (WebCore::Path::closeSubpath): Moved the check for an empty path up on level to make it platform independent and remove redundancy.
+
+2010-07-19 Victoria Kirst <vrk@google.com>
+
+ Reviewed by David Levin.
+
+ Added a simple implementation of VideoLayerChromium. Uses the
+ LayerChromium::updateTextureRect() to send video frames to the
+ GPU.
+ https://bugs.webkit.org/show_bug.cgi?id=42234
+
+ * WebCore.gypi: Added include for VideoLayerChromium.
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::setContentsToMedia): Implemented
+ setContentsToMedia, though it does not seem to trigger a repaint
+ correctly.
+ * platform/graphics/chromium/GraphicsLayerChromium.h:
+ * platform/graphics/chromium/VideoLayerChromium.cpp: Added.
+ (WebCore::VideoLayerChromium::create):
+ (WebCore::VideoLayerChromium::VideoLayerChromium):
+ (WebCore::VideoLayerChromium::updateTextureContents):
+ * platform/graphics/chromium/VideoLayerChromium.h: Added.
+ (WebCore::VideoLayerChromium::drawsContent):
+
+2010-07-19 Dirk Schulze <krit@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ SVG CleanUp of SVGPathData parsing
+ https://bugs.webkit.org/show_bug.cgi?id=41410
+
+ Cleanup the parsing code for SVG Paths. Move classes out of the convoluted SVGParserUtilities.cpp
+ in their own files. Make use of WebCore specific objects in parsing code like FloatPoint, AffineTransform,
+ etc. instead of using home-brewn solutions.
+ The SVGPathParser parses a path data string and delivers the parsed segments and values to the SVGPathConsumer.
+ SVGPathConsumer is the base class for SVGPathBuilder and SVGPathSegListBuilder, that either build the platform
+ Path object or a SVGPathSegList out of the segments.
+ We're now directly parsing floats instead of truncating precision to float afterwards.
+
+ SVG Path with an arc with radius of 0 does not render
+ https://bugs.webkit.org/show_bug.cgi?id=40448
+
+ If one of the radii on the elliptic arc are zero, we should draw a line from the starting point to
+ the end point according to the spec. Fixed this bug with this patch, because an is zero check and
+ an DRT check was neccessary with the current clean-up.
+ Extended svg/dom/path-parser.xhml to check the correct behavior.
+
+ * Android.mk:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/graphics/FloatPoint.h:
+ (WebCore::FloatPoint::move): Follow WebKit style and use multiple lines for the function.
+ (WebCore::FloatPoint::scale): Scale FloatPoint.
+ (WebCore::operator+=):
+ (WebCore::operator+): Add two FloatPoints and give back the sum as FloatPoint.
+ * svg/SVGAllInOne.cpp: Added new created files.
+ * svg/SVGAnimateElement.cpp:
+ (WebCore::SVGAnimateElement::calculateFromAndToValues): Use new PathParser to create a PathSegList.
+ * svg/SVGAnimateMotionElement.cpp:
+ (WebCore::SVGAnimateMotionElement::parseMappedAttribute): Use new PathParser to create a Path.
+ * svg/SVGGlyphElement.cpp:
+ (WebCore::parsePathData): Use new PathParser to create a Path.
+ * svg/SVGParserUtilities.cpp:
+ (WebCore::parseArcFlag): Removed parseArcFlag(double&), we parse in float now.
+ * svg/SVGParserUtilities.h: Removed path parsing code and a lot of unneccessary includes.
+ * svg/SVGPathBuilder.cpp: Added.
+ (WebCore::SVGPathBuilder::SVGPathBuilder):
+ (WebCore::SVGPathBuilder::build): Builds a normalized Path.
+ (WebCore::SVGPathBuilder::moveTo):
+ (WebCore::SVGPathBuilder::lineTo):
+ (WebCore::SVGPathBuilder::curveToCubic):
+ (WebCore::SVGPathBuilder::closePath):
+ * svg/SVGPathBuilder.h: Added. We just create normalized Paths, so this functions should never be reached.
+ (WebCore::SVGPathBuilder::lineToHorizontal):
+ (WebCore::SVGPathBuilder::lineToVertical):
+ (WebCore::SVGPathBuilder::curveToCubicSmooth):
+ (WebCore::SVGPathBuilder::curveToQuadratic):
+ (WebCore::SVGPathBuilder::curveToQuadraticSmooth):
+ (WebCore::SVGPathBuilder::arcTo):
+ * svg/SVGPathConsumer.h: Added. Base class of SVGPathBuilder and SVGPathSegListBuilder.
+ (WebCore::):
+ (WebCore::SVGPathConsumer::SVGPathConsumer):
+ (WebCore::SVGPathConsumer::~SVGPathConsumer):
+ * svg/SVGPathElement.cpp:
+ (WebCore::SVGPathElement::parseMappedAttribute): Use new PathParser to create a PathSegList.
+ * svg/SVGPathParser.cpp: Added.
+ (WebCore::SVGPathParser::SVGPathParser):
+ (WebCore::SVGPathParser::~SVGPathParser):
+ (WebCore::SVGPathParser::parseClosePathSegment):
+ (WebCore::SVGPathParser::parseMoveToSegment):
+ (WebCore::SVGPathParser::parseLineToSegment):
+ (WebCore::SVGPathParser::parseLineToHorizontalSegment):
+ (WebCore::SVGPathParser::parseLineToVerticalSegment):
+ (WebCore::SVGPathParser::parseCurveToCubicSegment):
+ (WebCore::SVGPathParser::parseCurveToCubicSmoothSegment):
+ (WebCore::SVGPathParser::parseCurveToQuadraticSegment):
+ (WebCore::SVGPathParser::parseCurveToQuadraticSmoothSegment):
+ (WebCore::SVGPathParser::parseArcToSegment):
+ (WebCore::SVGPathParser::parsePathDataString):
+ (WebCore::SVGPathParser::decomposeArcToCubic): Normalizes an arc to multiple cubic curves.
+ * svg/SVGPathParser.h: Added.
+ * svg/SVGPathSegListBuilder.cpp: Added.
+ (WebCore::SVGPathSegListBuilder::SVGPathSegListBuilder):
+ (WebCore::SVGPathSegListBuilder::build):
+ (WebCore::SVGPathSegListBuilder::moveTo):
+ (WebCore::SVGPathSegListBuilder::lineTo):
+ (WebCore::SVGPathSegListBuilder::lineToHorizontal):
+ (WebCore::SVGPathSegListBuilder::lineToVertical):
+ (WebCore::SVGPathSegListBuilder::curveToCubic):
+ (WebCore::SVGPathSegListBuilder::curveToCubicSmooth):
+ (WebCore::SVGPathSegListBuilder::curveToQuadratic):
+ (WebCore::SVGPathSegListBuilder::curveToQuadraticSmooth):
+ (WebCore::SVGPathSegListBuilder::arcTo):
+ (WebCore::SVGPathSegListBuilder::closePath):
+ * svg/SVGPathSegListBuilder.h: Added.
+
+2010-07-15 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fix for Bug 42342 - Font download error for an @font-face rule invalidates other @font-face rules for the same font-family
+ https://bugs.webkit.org/show_bug.cgi?id=42342
+
+ Test: fast/css/font-face-download-error.html
+
+ * css/CSSSegmentedFontFace.cpp:
+ (WebCore::CSSSegmentedFontFace::isValid): Valid if at least one font
+ face is valid.
+ (WebCore::CSSSegmentedFontFace::getFontData): Check validity for each
+ font face.
+ * css/CSSSegmentedFontFace.h: Make isValid private.
+
+2010-07-19 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ [Chromium] Fix style errors of RenderThemeChromiumWin.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=42568
+
+ * rendering/RenderThemeChromiumWin.cpp:
+ (WebCore::):
+ (WebCore::getNonClientMetrics):
+ (WebCore::systemFontSize):
+ (WebCore::pointsToPixels):
+ (WebCore::querySystemBlinkInterval):
+ (WebCore::RenderThemeChromiumWin::platformActiveSelectionBackgroundColor):
+ (WebCore::RenderThemeChromiumWin::platformInactiveSelectionBackgroundColor):
+ (WebCore::RenderThemeChromiumWin::platformActiveSelectionForegroundColor):
+ (WebCore::RenderThemeChromiumWin::platformActiveTextSearchHighlightColor):
+ (WebCore::RenderThemeChromiumWin::paintButton):
+ (WebCore::RenderThemeChromiumWin::paintSliderTrack):
+ (WebCore::RenderThemeChromiumWin::paintMenuList):
+ (WebCore::RenderThemeChromiumWin::paintTextFieldInternal):
+ (WebCore::RenderThemeChromiumWin::paintInnerSpinButton):
+
+2010-07-19 Steve Falkenburg <sfalken@apple.com>
+
+ (Hopefully the last) Windows build fix.
+
+ Version of CoreServices.h in WebKit Support Libraries uses
+ pragma once, unlike the version I have locally. Switch based
+ on __COLORSYNCDEPRECATED__ instead.
+
+ * WebCorePrefix.h:
+
+2010-07-19 Steve Falkenburg <sfalken@apple.com>
+
+ Windows build fix.
+
+ * WebCorePrefix.h:
+
+2010-07-19 Steve Falkenburg <sfalken@apple.com>
+
+ Build fix.
+
+ * WebCorePrefix.h:
+
+2010-07-19 Steve Falkenburg <sfalken@apple.com>
+
+ Build fix.
+
+ * WebCorePrefix.h:
+
+2010-07-19 Steve Falkenburg <sfalken@apple.com>
+
+ Windows Build fixes for new ColorSync API.
+ We support both new and old APIs, since the newer headers aren't in the tree yet.
+
+ * WebCorePrefix.h: Removed include of CoreServices.h. Included via ColorSyncPriv.h instead, since header may not be present.
+ * platform/graphics/cg/ColorCG.cpp:
+ (WebCore::createCGColor): Conditionally use new ColorSync API.
+ * platform/graphics/opentype/OpenTypeUtilities.cpp: Define Fixed if CoreServices.h doesn't.
+ * platform/graphics/win/GraphicsLayerCACF.cpp:
+ (WebCore::GraphicsLayerCACF::updateLayerDrawsContent): Use 0 instead of nil, since nil is no longer present via CoreServices.h.
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp: Include AssertMacros.h.
+ * platform/network/cf/ResourceErrorCF.cpp:
+ (WebCore::ResourceError::operator CFErrorRef): Use 0 instead of nil, since nil is no longer present via CoreServices.h.
+
+2010-07-19 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Only set unloadEventEnd when the unload event is actually fired
+ https://bugs.webkit.org/show_bug.cgi?id=42607
+
+ r63689 introduced this ASSERT and it began failing on Qt and Mac debug.
+ For some reason, it did not fail on Windows (which is where I was
+ testing). The ASSERT was disabled in r63699.
+
+ Test: page-cache related layout tests don't crash in debug mode on Mac.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::stopLoading):
+
+2010-07-19 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Don't unnecessarily copy QPainterPath in fillPath() and strokePath()
+ https://bugs.webkit.org/show_bug.cgi?id=42513
+
+ Avoid making unnecessary deep-copies of QPainterPaths that will
+ be discarded after use.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::fillPath):
+ (WebCore::GraphicsContext::strokePath):
+
+2010-07-19 Kenneth Russell <kbr@google.com>
+
+ Reviewed by Nate Chapin.
+
+ WebGL rendering results must be made available to Canvas.toDataURL and 2D drawImage
+ https://bugs.webkit.org/show_bug.cgi?id=34719
+
+ Fixed compiler warning introduced by original patch. No new tests;
+ covered by existing tests.
+
+ * platform/graphics/mac/GraphicsContext3DMac.mm:
+ (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
+
+2010-07-19 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler, Adam Roben, Dan Bernstein and Sam Weinig.
+
+ Handle NP_ASFILE and NP_ASFILEONLY transfer modes
+ https://bugs.webkit.org/show_bug.cgi?id=42587
+
+ * WebCore.exp.in:
+ Export functions from FileSystem.h
+
+ * platform/mac/FileSystemMac.mm:
+ (WebCore::openTemporaryFile):
+ Try to create a temporary file using mkstemp.
+
+2010-07-19 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Implement NPN_PostURLNotify
+ https://bugs.webkit.org/show_bug.cgi?id=42602
+
+ Export symbols needed by WebKit2.
+
+ * WebCore.exp.in:
+
+2010-07-19 Tony Gentilcore <tonyg@chromium.org>
+
+ Unreviewed build fix.
+
+ Remove overzealous ASSERT from r63689
+ https://bugs.webkit.org/show_bug.cgi?id=42606
+
+ No new tests because no new functionality.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::stopLoading):
+
+2010-07-19 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ Web Inspector: Do Not Copy *.re2js Inspector Resources in XCode Build Phase
+ https://bugs.webkit.org/show_bug.cgi?id=42601
+
+ Remove *.re2js files after copying them over in the Build Phase. We do
+ the same to remove the WebKit.qrc file.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2010-07-17 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Web Timing] Move times to DocumentLoader and fix bugs in mark points
+ https://bugs.webkit.org/show_bug.cgi?id=42512
+
+ Test: fast/dom/webtiming-navigate-within-document.html
+
+ * loader/DocumentLoader.h: Move the FrameLoadTimeline (now call DocumentLoadTiming) to the DocumentLoader.
+ (WebCore::DocumentLoader::documentLoadTiming):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::stopLoading): Set unloadEventEnd on the provisional DocumentLoader. Add some ASSERTs to tighten things up.
+ (WebCore::FrameLoader::loadWithDocumentLoader): This was not the right place to set navigationStart. Setting it here caused it to be set before the unload form prompt and caused it to be reset when navigating within the document.
+ (WebCore::FrameLoader::finishedLoading): Set responseEnd on the active DocumentLoader.
+ (WebCore::FrameLoader::continueLoadAfterWillSubmitForm): This is the right place for navigationStart as defined by the spec.
+ * loader/FrameLoader.h: Get rid of FrameLoadTimeline.
+ * loader/FrameLoaderTypes.h: Rename FrameLoadTimeline to DocumentLoadTiming. It is even more apparent this doesn't belong in this file now. I am planning to submit a patch moving it out ASAP, but didn't want to muddy this patch with all those build files.
+ (WebCore::DocumentLoadTiming::DocumentLoadTiming):
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::willSendRequest): Move fetchStart out of this method to load(), and rewrite setting of redirectStart, redirectEnd, and redirectCount to be more readable.
+ (WebCore::MainResourceLoader::load): Set fetchStart slightly earlier here and tighten it up with some ASSERTs.
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::dispatchLoadEvent): Set loadEventStart and loadEventEnd on the DocumentLoader.
+ * page/Navigation.cpp:
+ (WebCore::Navigation::redirectCount): Retrieve redirectCount from the DocumentLoader.
+ * page/Timing.cpp:
+ (WebCore::getPossiblySkewedTimeInKnownRange): The skew problem turned out to be due to the fact that chromium's currentTime() implementation only syncs to the system time every 60 seconds. So absolute times across threads may be skewed slightly. I resolved this temporarily by clipping the time from another thread into a known bound. A better long term solution is probably to add a currentTimeFromSystemTime() method and call that for web timing marks.
+ (WebCore::Timing::navigationStart):
+ (WebCore::Timing::unloadEventEnd):
+ (WebCore::Timing::redirectStart):
+ (WebCore::Timing::redirectEnd):
+ (WebCore::Timing::fetchStart):
+ (WebCore::Timing::domainLookupStart):
+ (WebCore::Timing::domainLookupEnd):
+ (WebCore::Timing::connectStart):
+ (WebCore::Timing::connectEnd):
+ (WebCore::Timing::requestStart):
+ (WebCore::Timing::requestEnd):
+ (WebCore::Timing::responseStart):
+ (WebCore::Timing::responseEnd):
+ (WebCore::Timing::loadEventStart):
+ (WebCore::Timing::loadEventEnd):
+ (WebCore::Timing::documentLoader):
+ (WebCore::Timing::documentLoadTiming):
+ (WebCore::Timing::resourceLoadTiming):
+ (WebCore::Timing::resourceLoadTimeRelativeToAbsolute): Ensure requestTime is in the range of fetchStart to responseEnd.
+ * page/Timing.h:
+
+2010-07-19 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42118
+ Disable WebGL on Leopard for now.
+
+ LayoutTests fail on some graphics hardware on Leopard because one of the features we use,
+ GL_ARB_framebuffer_object, is not universally available in Leopard like it is in
+ SnowLeopard. This will allow LayoutTests to pass on Leopard until we add logic to use a
+ software OpenGL driver on machines without this support.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2010-07-19 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Remove HTML5 media element 'load' event
+ https://bugs.webkit.org/show_bug.cgi?id=30464
+ <rdar://problem/5650561>
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_completelyLoaded.
+ (WebCore::HTMLMediaElement::parseMappedAttribute): Don't deal with 'load' event.
+ (WebCore::HTMLMediaElement::prepareForLoad): Set m_completelyLoaded to false.
+ (WebCore::HTMLMediaElement::setNetworkState): Don't post 'load' event.
+ (WebCore::HTMLMediaElement::progressEventTimerFired): Bail if m_networkState != NETWORK_LOADING.
+ (WebCore::HTMLMediaElement::userCancelledLoad): No more NETWORK_LOADED state.
+ * html/HTMLMediaElement.h:
+ (WebCore::HTMLMediaElement::):
+ * html/HTMLMediaElement.idl: Remove NETWORK_LOADING.
+
+2010-07-19 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40996
+ Progress event should not be fired during synchronous XMLHttpRequest
+
+ https://bugs.webkit.org/show_bug.cgi?id=17502
+ Assertion failure when trying to restart a sync XMLHttpRequest as an async one from onreadystatechange
+
+ Tests: http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events.html
+ http/tests/xmlhttprequest/xmlhttprequest-sync-vs-async-assertion-failure.html
+
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::callReadyStateChangeListener): We now only dispatch readystatechange
+ event for synchronous requests in states UNSENT, OPENED and DONE. I'm not sure what exactly
+ the spec draft says about readystatechange for sync requests, but this seems to be the most
+ logical and backwards compatible behavior.
+ (WebCore::XMLHttpRequest::didReceiveData): Don't dispatch progress events for sync requests.
+ Note that we already don't dispatch upload progress events for those.
+
+2010-07-19 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ <rdar://problem/7232109> Unpainted white area appears at the edge of the page when body has bg color
+ https://bugs.webkit.org/show_bug.cgi?id=34913
+
+ Tests: fast/repaint/view-background-from-body-1.html
+ fast/repaint/view-background-from-body-2.html
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::styleWillChange): If this is the body renderer and its current style is
+ null, repaint the view, similarly to how the view is repainted for any repaint-or-higher
+ style changes.
+ * rendering/RenderObjectChildList.cpp:
+ (WebCore::RenderObjectChildList::removeChildNode): If the removed child is the body renderer,
+ repaint the view, in case the body’s background was propagated to the view.
+
+2010-07-19 Adam Roben <aroben@apple.com>
+
+ Fix an assertion when a plugin returns -1 from NPP_Write
+
+ We were forgetting to call setDefersLoading(false) before destroying
+ the PluginStream. In the process of destroying the stream, someone
+ would call setDefersLoading(true), and we would assert because we were
+ already deferring loads.
+
+ Fixes <http://webkit.org/b/42563> Assertion failure in
+ ResourceHandle::setDefersLoading when running
+ plugins/return-negative-one-from-write.html on Windows
+
+ Reviewed by Anders Carlsson.
+
+ * plugins/PluginStream.cpp:
+ (WebCore::PluginStream::deliverData): Call setDefersLoading(false)
+ before destroying the stream, to match the setDefersLoading(true) call
+ earlier in this function. (We already call setDefersLoading(false) in
+ the non-error case later on.)
+
+2010-07-19 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Fix some EFL theme issues
+ https://bugs.webkit.org/show_bug.cgi?id=42569
+
+ Keep a pointer to theme filename and check for it correctly.
+ Reduce the scope of some variables.
+ Don't test for platformWidget() since we are not using it.
+
+ No new tests, no new functionality.
+
+ * platform/efl/WidgetEfl.cpp:
+ (WebCore::Widget::applyCursor):
+ (WebCore::Widget::setCursor):
+
+2010-07-19 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Add ifdef to compile code just on presence of Ecore_X
+ https://bugs.webkit.org/show_bug.cgi?id=42567
+
+ No new tests since there's no new functionality.
+
+ * platform/efl/WidgetEfl.cpp:
+ (WebCore::Widget::setEvasObject):
+ Add #ifdef HAVE_ECORE_X to it.
+
+2010-07-19 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: add/removeStyleClass shouldn't increase number of spaces between class names.
+ https://bugs.webkit.org/show_bug.cgi?id=42485
+
+ * inspector/front-end/utilities.js:
+ (Element.prototype.removeStyleClass):
+
+2010-07-19 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: show stack trace for uncaught exceptions when Web Inspector is open.
+ https://bugs.webkit.org/show_bug.cgi?id=42560
+
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::setCaptureCallStackForUncaughtExceptions):
+ * bindings/js/ScriptController.h:
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::setCaptureCallStackForUncaughtExceptions):
+ * bindings/v8/ScriptController.h:
+ * bindings/v8/V8ConsoleMessage.cpp:
+ (WebCore::V8ConsoleMessage::dispatchNow):
+ (WebCore::V8ConsoleMessage::handler):
+ * bindings/v8/V8ConsoleMessage.h:
+ * inspector/ConsoleMessage.cpp:
+ (WebCore::ConsoleMessage::ConsoleMessage):
+ * inspector/ConsoleMessage.h:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::addMessageToConsole):
+ (WebCore::InspectorController::startGroup):
+ (WebCore::InspectorController::connectFrontend):
+ (WebCore::InspectorController::disconnectFrontend):
+ * inspector/InspectorController.h:
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleMessage.prototype._formatMessage):
+ (WebInspector.ConsoleMessage.prototype.toMessageElement):
+ (WebInspector.ConsoleMessage.prototype._populateStackTraceTreeElement):
+ (WebInspector.ConsoleMessage.prototype._addMessageHeader):
+ (WebInspector.ConsoleMessage.prototype.toString):
+ * inspector/front-end/inspector.css:
+ (.console-message.repeated-message > ol.stack-trace):
+ (.section .properties ol, .event-properties ol, .stack-trace ol, ol.stack-trace):
+ (ol.stack-trace):
+ (.section .properties ol.expanded, .event-properties ol.expanded, .stack-trace ol, ol.stack-trace):
+ * page/Console.cpp:
+ (WebCore::Console::addMessage):
+ * page/Console.h:
+ (WebCore::):
+
+2010-07-19 Robin Burchell <robin.burchell@collabora.co.uk>
+
+ Reviewed by Antonio Gomes
+
+ [Qt] Use memcpy() instead of qMemCopy()
+ This is supposed to be more efficient, as the compiler is able to
+ optimise more.
+
+ Additionally, qMemCopy() is only strictly supposed to be used in
+ headers (see Qt's src/corelib/qglobal.h for reference)
+ See: https://bugs.webkit.org/show_bug.cgi?id=42392
+
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertQVariantToValue):
+
+2010-07-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Canvas: Rename operator==(CanvasStyle,CanvasStyle) since it isn't a proper equality check
+ https://bugs.webkit.org/show_bug.cgi?id=42284
+
+ New name is isEquivalentColor(CanvasStyle).
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setStrokeStyle):
+ (WebCore::CanvasRenderingContext2D::setFillStyle):
+ * html/canvas/CanvasStyle.cpp:
+ (WebCore::CanvasStyle::isEquivalentColor):
+ * html/canvas/CanvasStyle.h:
+
+2010-07-19 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Canvas: Wrong internal positioning of drawImage() shadows
+ https://bugs.webkit.org/show_bug.cgi?id=42510
+
+ * platform/graphics/qt/ImageQt.cpp:
+ (WebCore::BitmapImage::draw):
+ * platform/graphics/qt/StillImageQt.cpp:
+ (WebCore::StillImage::draw):
+
+2010-07-19 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Render shadow when drawing one canvas onto another
+ https://bugs.webkit.org/show_bug.cgi?id=42508
+
+ * platform/graphics/qt/StillImageQt.cpp:
+ (WebCore::StillImage::draw):
+
+2010-07-19 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Some composition modes fail when color has alpha zero
+ https://bugs.webkit.org/show_bug.cgi?id=36973
+
+ Remove erroneous optimization that ignored painting calls when
+ the stroke/fill color had an alpha value of zero.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::drawLine):
+ (WebCore::GraphicsContext::strokeArc):
+ (WebCore::GraphicsContext::fillPath):
+ (WebCore::GraphicsContext::strokePath):
+ (WebCore::GraphicsContext::fillRect):
+ (WebCore::GraphicsContext::fillRoundedRect):
+
+2010-07-19 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ CSS3 background: Number of layers should be determined by background-image element count
+ https://bugs.webkit.org/show_bug.cgi?id=41201
+
+ Manual test: css3-background-layer-count.html
+
+ Spec link:
+ http://www.w3.org/TR/css3-background/#layering
+
+ * manual-tests/css3-background-layer-count.html: Added.
+ * rendering/style/FillLayer.cpp:
+ (WebCore::FillLayer::fillUnsetProperties): Don't repeat
+ image properties, they determine the total number of layers.
+ (WebCore::FillLayer::cullEmptyLayers): Change culling logic
+ to discard all layers after the first one without an image set.
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::adjustBackgroundLayers): Call
+ fillUnsetProperties() before cullEmptyLayers()
+ (WebCore::InheritedFlags::adjustMaskLayers): Ditto.
+
+2010-07-19 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Avoid QImage::pixel() in getImageData()
+ https://bugs.webkit.org/show_bug.cgi?id=42463
+
+ * platform/graphics/qt/ImageBufferQt.cpp:
+ (WebCore::getImageData): Use QImage::scanLine() instead
+ of fetching data pixel-by-pixel.
+
+2010-07-19 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: hide "toggle debugger" button when debugger is always enabled
+ https://bugs.webkit.org/show_bug.cgi?id=42558
+
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel):
+
+2010-07-19 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Explicitly declare DeviceOrientationEvent destructor and define it in the .cpp file
+ https://bugs.webkit.org/show_bug.cgi?id=42466
+
+ (Original problem at https://bugs.webkit.org/show_bug.cgi?id=42447)
+
+ No new functionality so no new tests.
+
+ * dom/DeviceOrientationEvent.cpp:
+ (WebCore::DeviceOrientationEvent::~DeviceOrientationEvent):
+ Move here to avoid needing to have the full declaration of
+ DeviceOrientation in DeviceOrientationEvent.h.
+ * dom/DeviceOrientationEvent.h:
+
+2010-07-18 Anders Carlsson <andersca@apple.com>
+
+ Fix Build.
+
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration):
+
+2010-07-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Always set the current NSGraphicsContext before calling drawWithFrame
+ https://bugs.webkit.org/show_bug.cgi?id=42542
+
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::paintMeter):
+ (WebCore::RenderThemeMac::paintSearchField):
+ (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
+ (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration):
+ (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
+
+2010-07-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Move PluginWidget to WebKit
+ https://bugs.webkit.org/show_bug.cgi?id=42530
+
+ Rename the PluginWidget class to PluginViewBase and make it an abstract base class.
+
+ This is a stopgap measure until we have a single PluginView class that we can use everywhere.
+
+ * WebCore.exp.in:
+ Remove PluginWidget symbols.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ Update.
+
+ * platform/Widget.h:
+ (WebCore::Widget::isPluginViewBase):
+ Return false.
+
+ * plugins/PluginViewBase.h: Added.
+ (WebCore::PluginViewBase::platformLayer):
+ Always return 0 here now.
+
+ (WebCore::PluginViewBase::isPluginViewBase):
+ Return true.
+
+ * plugins/PluginWidget.h: Removed.
+ * plugins/mac/PluginWidgetMac.mm: Removed.
+ * rendering/RenderEmbeddedObject.cpp:
+ (WebCore::RenderEmbeddedObject::allowsAcceleratedCompositing):
+ Cast to PluginWidgetBase instead.
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
+ Cast to PluginWidgetBase instead.
+
+2010-07-18 Dean Jackson <dino@apple.com>
+
+ Unreviewed.
+
+ Remove the unwanted extra line that Xcode
+ added in my last commit.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2010-07-18 Dean Jackson <dino@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41259
+ Interacting with a <select> element within a transformed and clipped
+ container scrolls the container
+
+ The Node::getRect and ContainerNode::getRect functions were not
+ transform-aware. This fixes both, and has a test to make sure
+ we're not breaking any existing scrollToView code. This means
+ that a <select> popup will appear in the correct place if it
+ is within a transformed and scrolled container.
+
+ Test: fast/transforms/scrollIntoView-transformed.html
+
+ * dom/ContainerNode.cpp:
+ (WebCore::ContainerNode::getUpperLeftCorner):
+ (WebCore::ContainerNode::getLowerRightCorner):
+ - make sure we call localToAbsolute in the right order
+ (after we've done a local move) and pass in the flags to
+ indicate it should look for transforms.
+ * dom/Node.cpp:
+ (WebCore::Node::getRect):
+ - make sure localToAbsolute gets told to look for transforms.
+
+2010-07-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add NPJSObjectMap class
+ https://bugs.webkit.org/show_bug.cgi?id=42524
+
+ Export ScriptController functions.
+
+ * WebCore.exp.in:
+
+2010-07-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Implement some NPRuntime related NPN_ functions
+ https://bugs.webkit.org/show_bug.cgi?id=42518
+
+ * WebCore.exp.in:
+ Export IdentifierRep functions.
+
+2010-07-17 TJ Lee <tjlee0909@gmail.com>
+
+ Reviewed by Timothy Hatcher.
+
+ HTMLLinkElement ignores dnsPrefetchingEnabled setting
+ https://bugs.webkit.org/show_bug.cgi?id=42500
+
+ Changed the HTML Link tag to check that the browser
+ has DNS-prefetching enabled before calling ResourceHandle::prepareForURL.
+
+ There are no test cases for this patch because it was unclear how to test
+ this using a layout test. A possible test case would be to
+ clear the DNS cache on the client's machine before loading a page with
+ <link rel="dns-prefetch" href="SomeSiteThatsNotTheCurrentOne.com"> and
+ then check the number of DNS cache entries.
+
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::process):
+
+2010-07-16 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Asynchronous policy checks make FrameLoader think it is done loading prematurely
+ https://bugs.webkit.org/show_bug.cgi?id=42489
+
+ This caused many (~100) layout tsts to fail under WebKit2.
+
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::loadSubframe): Right after loading a new subframe,
+ if m_complete is true, do not consider it done if it has a provisional loader.
+ This will happen in the case where the policy check is asynchronous.
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::subframeIsLoading): For similar reasons,
+ consider a subframe to be loading if it has a policy decision pending.
+
+2010-07-15 Qi Zhang <qi.2.zhang@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Failure on http://philip.html5.org/tests/canvas/suite/tests/2d.shadow.alpha.5.html
+ https://bugs.webkit.org/show_bug.cgi?id=38400
+
+ FillRect with shadow need take alpha information from fillstyle
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::fillRect):
+
+2010-07-17 Nikita Vasilyev <me@elv1s.ru>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: [REGRESSION] Edit long CSS attributes works incorrect
+ https://bugs.webkit.org/show_bug.cgi?id=42476
+
+ * inspector/front-end/inspector.css:
+ (.editing):
+
+2010-07-16 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Sam Weinig.
+
+ Failing 2d.path.arcTo.ensuresubpath.* philip canvas tests
+ https://bugs.webkit.org/show_bug.cgi?id=42186
+
+ Move code from Qt's Path::addArcTo() up to CanvasRenderingContext2D.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::arcTo): Behave as moveTo(x1,y1)
+ if the current path is empty.
+ * platform/graphics/qt/PathQt.cpp:
+ (WebCore::Path::addArcTo): Remove now-redundant code.
+
+2010-07-16 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Oliver Hunt.
+
+ QtWebkit creates an unnecessary deep copy of images when canvas drawing is done
+ A https://bugs.webkit.org/show_bug.cgi?id=32530
+
+ Solve this by adding ImageBuffer::imageForRendering() which returns an image
+ that can be used for rendering now, but isn't a copy to be kept around.
+
+ * platform/graphics/ImageBuffer.h:
+ (WebCore::ImageBuffer::imageForRendering):
+ * platform/graphics/qt/ImageBufferQt.cpp:
+ (WebCore::ImageBuffer::imageForRendering): Added to provide an image that can
+ be used for rendering now, but may change in the future.
+ * platform/graphics/qt/StillImageQt.cpp:
+ (WebCore::StillImage::StillImage):
+ (WebCore::StillImage::~StillImage):
+ (WebCore::StillImage::size):
+ (WebCore::StillImage::nativeImageForCurrentFrame):
+ (WebCore::StillImage::draw):
+ * platform/graphics/qt/StillImageQt.h:
+ (WebCore::StillImage::createForRendering): Added for use in
+ ImageBuffer::imageForRendering(), provides a thin wrapper around a QPixmap*.
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::paint): Paint with ImageBuffer::imageForRendering()
+
+2010-07-16 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Oliver Hunt.
+
+ [Qt] Remove redundant logic in Path::addArcTo()
+ https://bugs.webkit.org/show_bug.cgi?id=42494
+
+ Bounds checking for arcTo() is now done in cross-platform code
+ thanks to <http://trac.webkit.org/changeset/63599>
+
+ * platform/graphics/qt/PathQt.cpp:
+ (WebCore::Path::addArcTo):
+
+2010-07-16 Zhe Su <suzhe@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION(r61484): Broke focus behaviour on Qt and probably other platforms
+ https://bugs.webkit.org/show_bug.cgi?id=42253
+
+ This patch just reverts the change to WebCore/page/FocusController.cpp
+ made in changeset 61484, and add a new method named
+ willSetInputMethodState in EditorClient interface, which gets called
+ in FocusController just before changing the focused node.
+
+ No new tests, because no new functionality.
+
+ * loader/EmptyClients.h:
+ (WebCore::EmptyEditorClient::willSetInputMethodState):
+ * page/EditorClient.h:
+ * page/FocusController.cpp:
+ (WebCore::FocusController::setFocusedNode):
+
+2010-07-16 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Failing 2d.path.stroke.prune.arc philip canvas test
+ https://bugs.webkit.org/show_bug.cgi?id=42188
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ Note, updated parameter names to match spec.
+ (WebCore::CanvasRenderingContext2D::lineTo): Pulled bound checking code out of lower code to have checks for all platforms.
+ (WebCore::CanvasRenderingContext2D::arcTo): Bound checking per the spec for arcTo parameters. Updated parameter names to match spec.
+ * platform/graphics/Path.h: Added in new method to expose the current position.
+ * platform/graphics/cairo/PathCairo.cpp:
+ (WebCore::Path::currentPoint): Added in likely correct implementation for this call with a FIXME just in case.
+ * platform/graphics/cg/PathCG.cpp:
+ (WebCore::Path::currentPoint): Added in support for this call.
+ * platform/graphics/haiku/PathHaiku.cpp:
+ (WebCore::Path::currentPoint): Added in stub for this call.
+ * platform/graphics/openvg/PathOpenVG.cpp:
+ (WebCore::Path::currentPoint): Added in likely implementation for this call with a FIXME just in case.
+ * platform/graphics/qt/PathQt.cpp:
+ (WebCore::Path::currentPoint): Added in implementation for this call courtesy of Andrea Kling.
+ * platform/graphics/skia/PathSkia.cpp:
+ (WebCore::Path::currentPoint): Added in stub for this call.
+ * platform/graphics/wince/PathWince.cpp:
+ (WebCore::Path::currentPoint): Added in stub for this call.
+ * platform/graphics/wx/PathWx.cpp:
+ (WebCore::Path::currentPoint): Added in stub for this call.
+
+2010-07-16 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r63593.
+ http://trac.webkit.org/changeset/63593
+ https://bugs.webkit.org/show_bug.cgi?id=42487
+
+ Broke a few chromium pixel tests (Requested by tony^work on
+ #webkit).
+
+ * platform/graphics/skia/GraphicsContextSkia.cpp:
+ (WebCore::GraphicsContext::drawConvexPolygon):
+ (WebCore::GraphicsContext::drawEllipse):
+ (WebCore::GraphicsContext::drawLine):
+ (WebCore::GraphicsContext::strokeArc):
+ (WebCore::GraphicsContext::strokePath):
+ (WebCore::GraphicsContext::strokeRect):
+
+2010-07-16 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Part of <rdar://problem/7233974> Deprecate +[WebView _setShouldUseFontSmoothing:]
+ https://bugs.webkit.org/show_bug.cgi?id=29355
+
+ * WebCore.exp.in: Updated.
+ * platform/graphics/Font.cpp:
+ (WebCore::Font::Font): Added a font smoothing mode parameter to the constructor.
+ Set the font smoothing mode in the font description.
+ * platform/graphics/Font.h:
+
+2010-07-16 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Anders Carlsson.
+
+ Add speech attribute to IDL for enabling access from JS.
+ https://bugs.webkit.org/show_bug.cgi?id=42483
+
+ No tests added, this change is a pre-requisite for future layout tests.
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::parseMappedAttribute): Update the renderer when speech attribute changes.
+ * html/HTMLInputElement.idl: Added the speech attribute to IDL.
+
+2010-07-16 Fady Samuel <fsamuel@chromium.org>
+
+ Reviewed by David Levin.
+
+ Avoids adding stroke when stroke-width is zero.
+
+ SVG - stroke-width:0 bug with stroke other than "none"
+ https://bugs.webkit.org/show_bug.cgi?id=42387
+
+ Test: svg/stroke/path-zero-strokewidth-test.svg
+
+ * platform/graphics/skia/GraphicsContextSkia.cpp:
+ (WebCore::GraphicsContext::drawConvexPolygon):
+ (WebCore::GraphicsContext::drawEllipse):
+ (WebCore::GraphicsContext::drawLine):
+ (WebCore::GraphicsContext::strokeArc):
+ (WebCore::GraphicsContext::strokePath):
+ (WebCore::GraphicsContext::strokeRect):
+
+2010-07-16 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, build fix.
+
+ * rendering/RenderThemeChromiumWin.cpp:
+ (WebCore::RenderThemeChromiumWin::getThemeData): Fix a typo.
+
+2010-07-16 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] <input type=number> UI implementation for Windows
+ https://bugs.webkit.org/show_bug.cgi?id=42259
+
+ No additional tests. Existing tests cover this change and we'll
+ update expectations.
+
+ * platform/chromium/ChromiumBridge.h: Add paintSpinButton().
+ * rendering/RenderThemeChromiumWin.cpp:
+ (WebCore::RenderThemeChromiumWin::determineState):
+ Add ControlSubPart parameter and add support for spin buttons.
+ (WebCore::RenderThemeChromiumWin::determineClassicState): ditto.
+ (WebCore::RenderThemeChromiumWin::getThemeData): ditto.
+ (WebCore::RenderThemeChromiumWin::adjustInnerSpinButtonStyle): Added.
+ (WebCore::RenderThemeChromiumWin::paintInnerSpinButton): Added.
+ * rendering/RenderThemeChromiumWin.h:
+ Declare ControlSubpart, and add it to some functions.
+
+2010-07-16 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Use function provided by EFL for system beep
+ https://bugs.webkit.org/show_bug.cgi?id=42481
+
+ EFL port does not support automated tests, yet.
+
+ * platform/efl/SoundEfl.cpp:
+ (WebCore::systemBeep):
+
+2010-07-16 Sarah Strong <sarah.e.strong@gmail.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] Clipboard data is lost on exit
+ https://bugs.webkit.org/show_bug.cgi?id=27411
+
+ No new tests. To manually test the bug fixed by this patch:
+ 1) Open an application that uses a webkit webview on a GNOME-based system
+ 2) Copy some text from that application
+ 3) Optional: paste it to another application. This should work properly with and without this patch.
+ 4) Exit the application completely.
+ 5) Paste:
+ Without this patch, you cannot because your clipboard is empty.
+ With this patch, pasting succeeds.
+ I have not included an automated test because of the difficulty of testing behaviour after application exit.
+
+2010-07-16 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Keyboard operations for <input type=number>
+ https://bugs.webkit.org/show_bug.cgi?id=42076
+
+ - The up arrow key works as stepUp().
+ - The down arrow key works as stepDown().
+ - Reject characters other than + - 0-9 . e E
+
+ Test: fast/forms/input-number-keyoperation.html
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::defaultEventHandler):
+ Add up/down arrow keys support, and call handleBeforeTextInsertedEvent().
+ (WebCore::isNumberCharacter):
+ (WebCore::HTMLInputElement::handleBeforeTextInsertedEvent):
+ For type=number, remove unacceptable characters.
+ * html/HTMLInputElement.h:
+
+2010-07-16 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Improve hover state handling for spin buttons
+ https://bugs.webkit.org/show_bug.cgi?id=42260
+
+ Background:
+ When we move the mouse cursor to a node from the outside of the node,
+ the following steps are executed.
+ 1. setHovered(true) is called.
+ 2. The node is repainted for the hover state.
+ 3. 'mousemove' event is dispatched for the node.
+ For a spin-button, RenderTheme::paint{Inner,Outer}SpinButton() is
+ called before the event handler of the spin-button. So we can't
+ detect which of the up part or the down part is hovered correctly.
+
+ Solution:
+ The hover state of a spin-button is one of three states;
+ Indeterminate, Up, and Down. The state is Indeterminate since
+ setHovered(true) is called and until 'mousemove' event is
+ dispatched.
+
+ No new tests because there are no implementation of spin-buttons
+ with hovered state yet.
+
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::isSpinUpButtonPartPressed):
+ (WebCore::RenderTheme::isHovered):
+ Return false if the node is a spin-button and the state is Indeterminate.
+ (WebCore::RenderTheme::isSpinUpButtonPartHovered):
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::SpinButtonElement::SpinButtonElement):
+ Initialize m_upDownState.
+ (WebCore::SpinButtonElement::defaultEventHandler):
+ (WebCore::SpinButtonElement::setHovered):
+ Set the state to Indeterminate.
+ * rendering/TextControlInnerElements.h:
+ (WebCore::SpinButtonElement::upDownState):
+
+2010-07-16 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ <rdar://problem/7527532> Crash beneath setSelection() during detach()
+ https://bugs.webkit.org/show_bug.cgi?id=42020
+
+ No test because I am unable to reproduce the crash.
+
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::setSelection): In the clearSelection() case, where the repaint mode is
+ RepaintNewMinusOld, avoid making RenderBlockSelectionInfo instances, and thereby avoid calling
+ localToAbsolute() during detach().
+
+2010-07-16 Anders Carlsson <andersca@apple.com>
+
+ Fix release build.
+
+ * storage/Database.cpp:
+ (WebCore::DerefContextTask::performTask):
+
+2010-07-16 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Safari pegs CPU and drops frames on http://neography.com/experiment/circles/solarsystem/ (CSS animations)
+ https://bugs.webkit.org/show_bug.cgi?id=41409
+
+ AnimationController::isAnimatingPropertyOnRenderer() really asked whether an accelerated animation
+ or transition was running. This prevented us from falling into compositing layers for animation
+ on platforms, like Windows, that don't have accelerated animations.
+
+ Fix by making things more explicit: we now have two methods, isRunningAnimationOnRenderer()
+ and isRunningAcceleratedAnimationOnRenderer().
+
+ Changes are more extensive because I flipped the sense of 'm_fallbackAnimating', which is
+ now 'm_isAccelerated', for clarity.
+
+ Test: compositing/animation/animation-compositing.html
+
+ * page/animation/AnimationBase.cpp:
+ (WebCore::AnimationBase::AnimationBase): m_fallbackAnimating -> m_isAccelerated
+ (WebCore::AnimationBase::blendProperties): Ditto.
+ (WebCore::AnimationBase::updateStateMachine): Ditto.
+ * page/animation/AnimationBase.h:
+ (WebCore::AnimationBase::isAnimatingProperty): Takes new acceleratedOnly parameter
+ which causes the method to only return true if the animation is accelerated.
+ (WebCore::AnimationBase::isAccelerated): Changed from isFallbackAnimating.
+
+ * page/animation/AnimationController.cpp:
+ (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer):
+ (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer):
+ (WebCore::AnimationController::isRunningAnimationOnRenderer):
+ (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer):
+
+ * page/animation/CompositeAnimation.h:
+ * page/animation/AnimationController.h: Rename isAnimatingPropertyOnRenderer(), add
+ isRunningAcceleratedAnimationOnRenderer().
+ * page/animation/AnimationControllerPrivate.h: Ditto.
+ * page/animation/CompositeAnimation.cpp:
+ (WebCore::CompositeAnimation::updateTransitions): !isFallbackAnimating() -> isAccelerated().
+ (WebCore::CompositeAnimation::isAnimatingProperty): Pass acceleratedOnly down.
+
+ * page/animation/ImplicitAnimation.cpp:
+ (WebCore::ImplicitAnimation::timeToNextService): !isFallbackAnimating() -> isAccelerated().
+
+ * page/animation/KeyframeAnimation.cpp:
+ (WebCore::KeyframeAnimation::timeToNextService): isFallbackAnimating() -> !isAccelerated().
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Avoid touching the transform or
+ opacity if an accelerated animation is running.
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::requiresCompositingForAnimation): Make compositing layers
+ if an animation of transform or opacity is running.
+
+2010-07-16 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Assertion when turning Accelerated Compositing off on a composited page
+ https://bugs.webkit.org/show_bug.cgi?id=42408
+
+ When accelerated compositing is turned off, check m_hasAcceleratedCompositing
+ before saying that the root layer will be composited. Fixes an assertion.
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+
+2010-07-16 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Fraser.
+
+ Spatial navigation: do not consider outline for focusable element boundaries
+ https://bugs.webkit.org/show_bug.cgi?id=42474
+
+ Test: fast/events/spatial-navigation/snav-zero-margin-content.html
+
+ Currently in WebCore::renderRectRelativeToRootDocument function, we are calling
+ RenderObject::absoluteClippedOverflowRect to obtain the rect boundary of a given
+ renderer/element. This method deals with outline, which is out of elements boundary.
+ It makes spatial navigation to fail on common sites like google.gom: "Web, Images, Map, etc"
+ are inaccessible.
+
+ Patch replaces RenderObject::absoluteClippedOverflowRect by Node::getRect,
+ which returns only the absolute bounding box rect of the Element.
+
+ * page/SpatialNavigation.cpp:
+ (WebCore::renderRectRelativeToRootDocument):
+ (WebCore::checkNegativeCoordsForNode):
+
+2010-07-15 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Gustavo Noronha.
+
+ [Qt] Remove unnecessary WebKit headers inclusion from WebCore files
+ https://bugs.webkit.org/show_bug.cgi?id=42416
+
+ There are some places in WebCore unnecessarily including WebKit headers.
+
+ Cleaning up only, no testing needed.
+
+ * platform/network/qt/ResourceHandleQt.cpp:
+ * platform/qt/RenderThemeQt.cpp:
+ * platform/qt/WidgetQt.cpp:
+
+2010-07-16 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Refinement of r63556: moved the tab width computation back to Font, but added a
+ SimpleFontData parameter.
+
+ * platform/graphics/Font.h:
+ (WebCore::Font::tabWidth):
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::advance):
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+
+2010-07-16 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Fix unit error in calculating timings from ResourceLoadTiming API
+ https://bugs.webkit.org/show_bug.cgi?id=42473
+
+ The start and end offsets are already in milliseconds so they should not be multiplied by 1000.0 like requestTime.
+
+ No new tests because, for a yet unknown reason, the ResourceLoadTiming API is not populated in the chromium test shell like it is in full chromium. This means the test that would have caught this bug (fast/dom/webtiming.html) currently has its expectation set to FAIL.
+
+ * page/Timing.cpp:
+ (WebCore::Timing::domainLookupStart):
+ (WebCore::Timing::domainLookupEnd):
+ (WebCore::Timing::connectStart):
+ (WebCore::Timing::connectEnd):
+ (WebCore::Timing::requestStart):
+ (WebCore::Timing::requestEnd):
+ (WebCore::Timing::responseStart):
+
+2010-07-16 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ clang++ build fixes for JavaScriptCore and WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=42478
+
+ * platform/network/Credential.cpp:
+ (WebCore::Credential::type):
+ * platform/network/Credential.h:
+ Remove const qualifier on Credential::type since it doesn't have an effect on the type.
+
+2010-07-16 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by David Levin.
+
+ Really add WARN_UNUSED_RESULT to leakRef
+ https://bugs.webkit.org/show_bug.cgi?id=42464
+
+ Get rid of a call to releaseRef here by passing the ScriptExecutionContext
+ reference through to the DerefContextTask.
+
+ * storage/Database.cpp:
+ (WebCore::DerefContextTask::create):
+ (WebCore::DerefContextTask::performTask):
+ (WebCore::DerefContextTask::DerefContextTask):
+ (WebCore::Database::~Database):
+
+2010-07-16 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ WebInspector: The current implementation of generator is not ready
+ for generation Backend part of Inspector interface. The full patch
+ with Backend is quite big and I've split it.
+ https://bugs.webkit.org/show_bug.cgi?id=42462
+
+ * inspector/CodeGeneratorInspector.pm:
+ * inspector/Inspector.idl:
+ * inspector/InspectorValues.cpp:
+ (WebCore::InspectorArray::get):
+ * inspector/InspectorValues.h:
+ (WebCore::InspectorArray::length):
+
+2010-07-15 Rob Buis <rwlbuis@gmail.com>
+
+ Reviewed by Darin Adler.
+
+ An empty value for xml:lang isn't considered
+ https://bugs.webkit.org/show_bug.cgi?id=42042
+
+ Allow :lang selector to match empty values for xml:lang and
+ lang attributes.
+
+ Test: fast/css/lang-selector-empty-attribute.xhtml
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
+
+2010-07-16 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Shift-Enter does not do a reverse search. It searches forward.
+ https://bugs.webkit.org/show_bug.cgi?id=42459
+
+ * inspector/front-end/inspector.js:
+ (WebInspector.performSearch):
+
+2010-07-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: do not include SSL time into Waiting time.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42458
+
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype._showPopover):
+
+2010-07-16 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ <rdar://problem/8198266> white-space: pre text containing tabs is not laid out correctly when the font lacks a space glyph
+ https://bugs.webkit.org/show_bug.cgi?id=42437
+
+ No test because none of the fonts available to DumpRenderTree are missing a space glyph.
+
+ Changed the tab width computation to use the width of the space glyph from the font that has
+ a space glyph, which may be a fallback font if the primary font lacks a space glyph.
+
+ * platform/graphics/Font.h: Removed Font::tabWidth().
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::advance):
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+
+2010-07-16 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed. Chromium build fix. Add missing include.
+
+ * inspector/ConsoleMessage.h:
+
+2010-07-16 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Path: Avoid creating a new GraphicsContext in strokeContains() and strokeBoundingRect()
+ https://bugs.webkit.org/show_bug.cgi?id=42456
+
+ * platform/graphics/qt/PathQt.cpp:
+ (WebCore::scratchContext): Added, provides a scratch GraphicsContext.
+ (WebCore::Path::strokeContains): Use the scratch context instead
+ of creating a new GraphicsContext.
+ (WebCore::Path::strokeBoundingRect): Ditto.
+
+2010-07-16 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ [V8] V8Proxy::retrieve may return null if javascript is disabled. Add a check
+ to avoid crashes in inspected page.
+ https://bugs.webkit.org/show_bug.cgi?id=42065
+
+ * bindings/v8/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::addListener):
+
+2010-07-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: add SSL time label into the resources popover.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42458
+
+ * English.lproj/localizedStrings.js:
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::buildObjectForTiming):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype._showPopover):
+
+2010-07-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: disable AppCache in chromium.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41858
+
+ * inspector/front-end/Settings.js:
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel):
+ (WebInspector.StoragePanel.prototype.reset):
+ (WebInspector.StoragePanel.prototype.addApplicationCache):
+
+2010-07-16 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ console.trace should show file and line number for each function in the stack
+ https://bugs.webkit.org/show_bug.cgi?id=21180
+
+ Test: inspector/console-trace.html
+
+ * bindings/js/ScriptCallStack.cpp:
+ (WebCore::ScriptCallStack::initialize):
+ * bindings/v8/ScriptCallFrame.cpp:
+ (WebCore::ScriptCallFrame::ScriptCallFrame):
+ * bindings/v8/ScriptCallFrame.h:
+ * bindings/v8/ScriptCallStack.cpp:
+ (WebCore::getFrameLocation):
+ (WebCore::toScriptCallFrame):
+ (WebCore::ScriptCallStack::create):
+ (WebCore::ScriptCallStack::ScriptCallStack):
+ (WebCore::ScriptCallStack::at):
+ (WebCore::ScriptCallStack::size):
+ * bindings/v8/ScriptCallStack.h:
+ * bindings/v8/custom/V8ConsoleCustom.cpp:
+ (WebCore::V8Console::traceCallback):
+ * inspector/ConsoleMessage.cpp:
+ (WebCore::ConsoleMessage::CallFrame::CallFrame):
+ (WebCore::ConsoleMessage::CallFrame::isEqual):
+ (WebCore::ConsoleMessage::CallFrame::createFrontendObject):
+ (WebCore::ConsoleMessage::ConsoleMessage):
+ (WebCore::ConsoleMessage::addToFrontend):
+ (WebCore::ConsoleMessage::isEqual):
+ * inspector/ConsoleMessage.h:
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleMessage.prototype._formatMessage):
+ (WebInspector.ConsoleMessage.prototype._createStackTraceElement):
+ (WebInspector.ConsoleMessage.prototype._createSourceUrlLink):
+ * inspector/front-end/inspector.css:
+ (.console-message.expandable > .console-message-text::before):
+ (.console-message.expandable.collapsed > .console-message-text::before):
+ (.console-message.expandable.collapsed > ol.stack-trace):
+ (.console-message > ol.stack-trace):
+ (.console-message.repeated-message > ol.stack-trace):
+ (.console-message.repeated-message > ol.stack-trace.trace-message):
+ * page/Console.idl:
+
+2010-07-16 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Build with MathML enabled. Fix build when MathML is enabled and
+ make it the default.
+ https://bugs.webkit.org/show_bug.cgi?id=42453
+
+ EFL port does not support automated tests, yet.
+
+ * CMakeLists.txt: add missing source file and sort.
+
+2010-07-16 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Steve Block.
+
+ DeviceOrientationEvent.h should not forward-declare DeviceOrientation
+ https://bugs.webkit.org/show_bug.cgi?id=42447
+
+ When destructing m_orientation, DeviceOrientation cannot be an incomplete type.
+
+ * dom/DeviceOrientationEvent.h:
+
+2010-07-16 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ gradientTransform + objectBoundingBox is wrong
+ https://bugs.webkit.org/show_bug.cgi?id=42446
+
+ gradientTransform + gradientUnits="objectBoundingBox" is wrong. Reverse multiplication order of both transforms.
+
+ * rendering/RenderSVGResourceGradient.cpp: s/multiply/multLeft/
+
+2010-07-16 Mikhail Naganov <mnaganov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Make JS memory stats available via 'Performance' object (Web Timing).
+ This statistics is populated only if 'WebKitMemoryInfoEnabled'
+ preference is set.
+
+ 'console.memory' is kept until Web Timing object becomes visible by
+ default (currently it is hidden under compile-time flag). These stats
+ are guarded with the same preference.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41617
+
+ * bindings/js/JSConsoleCustom.cpp:
+ * bindings/v8/custom/V8ConsoleCustom.cpp:
+ * page/Console.cpp:
+ (WebCore::Console::disconnectFrame):
+ (WebCore::Console::memory):
+ * page/Console.h:
+ * page/Console.idl:
+ * page/MemoryInfo.cpp:
+ (WebCore::MemoryInfo::MemoryInfo):
+ * page/MemoryInfo.h:
+ (WebCore::MemoryInfo::create):
+ * page/Performance.cpp:
+ (WebCore::Performance::disconnectFrame):
+ (WebCore::Performance::memory):
+ * page/Performance.h:
+ * page/Performance.idl:
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ * page/Settings.h:
+ (WebCore::Settings::setMemoryInfoEnabled):
+ (WebCore::Settings::memoryInfoEnabled):
+
+2010-07-16 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Convolution computation causes bad alpha channel values
+ https://bugs.webkit.org/show_bug.cgi?id=42273
+
+ Unbreak the convolve matrix filter, fixing svg/W3C-SVG-1.1/filters-conv-01-f.svg.
+
+ 1) Fix clamping the rgb values:
+ "image->set(pixel++, clampRGBAValue(totals[0], maxAlpha));" totals[0] -> totals[i].
+
+ 2) Don't apply the divisior divison and bias addition multiple times, accumulated!
+
+ * svg/graphics/filters/SVGFEConvolveMatrix.cpp:
+ (WebCore::setDestinationPixels): Fix two evil bugs, breaking feConvolveMatrix.
+
+2010-07-16 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ relative positioning does not work for radialGradient after window resize
+ https://bugs.webkit.org/show_bug.cgi?id=41249
+
+ Redesign the way resources are invalidated. No longer utilize the DOM tree, specifically SVGStyledElement::svgAttributeChanged(), to invalidate
+ all resources in the ancestor chain (including itself) when any attribute changes. rect.setAttribute("foo", "bar") should never invalidate the
+ resources. Also the old approach didn't work correctly if the root layout changed (eg. window size change) - we failed to invalidate the resources,
+ thus leading to wrong renderings.
+
+ Instead of calling setNeedsLayout(true) from the SVG*Element classes, call RenderSVGResource::markForLayoutAndParentResourceInvalidation(), which
+ does the same thing and invalidates all resources in the ancestor chain (removing the cached results from the HashMaps). This only happens from
+ the various svgAttributeChanged() methods, if we know which attribute changed, and what action has to be taken.
+
+ All SVG renderers now invalidate their own resources on layout() if the layout changed (selfNeedsLayout()=true). The resources will be recreated
+ and cached during the following paint() call.
+
+ Tests: svg/custom/marker-child-changes-css.svg
+ svg/custom/relative-sized-content-with-resources.xhtml
+
+ * rendering/RenderForeignObject.cpp:
+ (WebCore::RenderForeignObject::layout): If our layout changed, invalidate our resources, by calling RenderSVGResource::invalidateAllResourcesOfRenderer().
+ * rendering/RenderPath.cpp:
+ (WebCore::RenderPath::layout): Ditto.
+ * rendering/RenderSVGContainer.cpp:
+ (WebCore::RenderSVGContainer::layout): Ditto.
+ * rendering/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::layout): Ditto.
+ * rendering/RenderSVGModelObject.cpp:
+ (WebCore::RenderSVGModelObject::styleDidChange): Added, to invalidate resources on CSS changes, covered by new svg/custom/marker-child-changes-css.svg test.
+ * rendering/RenderSVGModelObject.h:
+ * rendering/RenderSVGResource.cpp:
+ (WebCore::RenderSVGResource::markForLayoutAndResourceInvalidation): Add new "needsBoundaries" parameter, calling setNeedsBoundaries() on the target render object,
+ simplifying all RenderSVGResource* code.
+ (WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation): New static method used from DOM tree to invalidate all cached resources in the ancestor chain
+ for a render object. Also marks the renderer for layout, if needed.
+ * rendering/RenderSVGResource.h:
+ * rendering/RenderSVGResourceClipper.cpp: Simplify code, remove no longer needed hacks, as invalidation is now carried out by render tree.
+ (WebCore::RenderSVGResourceClipper::RenderSVGResourceClipper): Add m_invalidationBlocked hack, to avoid invalidations, while we're mutating the render styles (which is a hack!).
+ (WebCore::RenderSVGResourceClipper::invalidateClients): Don't do anything if m_invalidationBlocked=true.
+ (WebCore::RenderSVGResourceClipper::invalidateClient): Ditto.
+ (WebCore::RenderSVGResourceClipper::createClipData): Set m_invalidationBlocked before mutating render styles, as they are restored immediately after creating the clip image.
+ (WebCore::RenderSVGResourceClipper::resourceBoundingBox): Remove no longer needed hack to initialize ClipperData earlier than applyResource() would do.
+ * rendering/RenderSVGResourceClipper.h:
+ * rendering/RenderSVGResourceFilter.cpp:
+ (WebCore::RenderSVGResourceFilter::invalidateClients): Simplify code using markForLayoutAndResourceInvalidation.
+ (WebCore::RenderSVGResourceFilter::invalidateClient): Remove wrong assertion.
+ * rendering/RenderSVGResourceGradient.cpp:
+ (WebCore::RenderSVGResourceGradient::invalidateClients): Simplify code using markForLayoutAndResourceInvalidation.
+ (WebCore::RenderSVGResourceGradient::invalidateClient): Remove wrong assertion.
+ * rendering/RenderSVGResourceMarker.cpp:
+ (WebCore::RenderSVGResourceMarker::invalidateClients): Simplify code using markForLayoutAndResourceInvalidation.
+ (WebCore::RenderSVGResourceMarker::invalidateClient): Remove wrong assertion.
+ * rendering/RenderSVGResourceMasker.cpp:
+ (WebCore::RenderSVGResourceMasker::invalidateClients): Simplify code using markForLayoutAndResourceInvalidation.
+ (WebCore::RenderSVGResourceMasker::invalidateClient): Remove wrong assertion.
+ (WebCore::RenderSVGResourceMasker::resourceBoundingBox): Remove no longer needed hack to initializer MaskerData earlier than applyResource() would do.
+ * rendering/RenderSVGResourcePattern.cpp:
+ (WebCore::RenderSVGResourcePattern::invalidateClients): Simplify code using markForLayoutAndResourceInvalidation.
+ (WebCore::RenderSVGResourcePattern::invalidateClient): Remove wrong assertion.
+ * rendering/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::layout): If our layout changed, invalidate our resources, by calling RenderSVGResource::invalidateAllResourcesOfRenderer().
+ * svg/SVGAnimateMotionElement.cpp:
+ (WebCore::SVGAnimateMotionElement::applyResultsToTarget): Call RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer) instead of renderer->setNeedsLayout(true).
+ * svg/SVGAnimateTransformElement.cpp:
+ (WebCore::SVGAnimateTransformElement::applyResultsToTarget): Ditto.
+ * svg/SVGCircleElement.cpp:
+ (WebCore::SVGCircleElement::svgAttributeChanged): Ditto.
+ * svg/SVGEllipseElement.cpp:
+ (WebCore::SVGEllipseElement::svgAttributeChanged): Ditto.
+ * svg/SVGFEImageElement.cpp:
+ (WebCore::SVGFEImageElement::notifyFinished): Ditto.
+ * svg/SVGForeignObjectElement.cpp:
+ (WebCore::SVGForeignObjectElement::svgAttributeChanged): Ditto.
+ * svg/SVGGElement.cpp:
+ (WebCore::SVGGElement::svgAttributeChanged): Ditto.
+ * svg/SVGImageElement.cpp:
+ (WebCore::SVGImageElement::svgAttributeChanged): Ditto.
+ * svg/SVGLineElement.cpp:
+ (WebCore::SVGLineElement::svgAttributeChanged): Ditto.
+ * svg/SVGPathElement.cpp:
+ (WebCore::SVGPathElement::svgAttributeChanged): Ditto.
+ * svg/SVGPolyElement.cpp:
+ (WebCore::SVGPolyElement::svgAttributeChanged): Ditto.
+ * svg/SVGRectElement.cpp:
+ (WebCore::SVGRectElement::svgAttributeChanged): Ditto.
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::setCurrentScale): Ditto.
+ (WebCore::SVGSVGElement::svgAttributeChanged): Ditto.
+ (WebCore::SVGSVGElement::inheritViewAttributes): Ditto.
+ * svg/SVGStopElement.cpp:
+ (WebCore::SVGStopElement::SVGStopElement): Changed m_offset initialization from 0.0f to 0.
+ (WebCore::SVGStopElement::svgAttributeChanged): Add missing implementation, calling RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer) on offsetAttr changes.
+ * svg/SVGStopElement.h:
+ * svg/SVGStyledElement.cpp:
+ (WebCore::SVGStyledElement::svgAttributeChanged): Don't call invalidateResourceInAncestorChain() on every attribute change, do it in all classes inheriting from us,
+ for specific attributes. Also stop calling RenderSVGResource::invalidateAllResourcesOfRenderer(), all handled in the render tree now.
+ (WebCore::SVGStyledElement::invalidateResourceClients): Early exit, if document is still parsing.
+ * svg/SVGStyledElement.h:
+ * svg/SVGTRefElement.cpp:
+ (WebCore::SVGTRefElement::svgAttributeChanged): Call RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer) instead of renderer->setNeedsLayout(true).
+ * svg/SVGTextElement.cpp:
+ (WebCore::SVGTextElement::svgAttributeChanged): Ditto.
+ * svg/SVGTextPathElement.cpp:
+ (WebCore::SVGTextPathElement::svgAttributeChanged): Ditto.
+ * svg/SVGTextPositioningElement.cpp:
+ (WebCore::SVGTextPositioningElement::svgAttributeChanged): Ditto.
+ * svg/SVGUseElement.cpp:
+ (WebCore::SVGUseElement::svgAttributeChanged): Ditto.
+ (WebCore::SVGUseElement::updateContainerSizes): Ditto.
+ (WebCore::SVGUseElement::updateContainerOffsets): Ditto.
+
+2010-07-16 Cosmin Truta <ctruta@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Some SVGs with empty <g> elements crash Chromium on Linux
+ https://bugs.webkit.org/show_bug.cgi?id=41175
+
+ Avoid painting of zero-sized image buffers. Skia can't handle it.
+
+ Test: svg/filters/filter-empty-g.svg
+
+ * WebCore/platform/graphics/skia/ImageBufferSkia.cpp:
+ (ImageBuffer::ImageBuffer):
+
+2010-07-16 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Regression in r63100: Don't clear m_loadType in
+ FrameLoader::handledOnloadEvents, as it is used
+ to make some decisions after the load has actually
+ completed.
+
+ Tickling this bug requires manipulation
+ via the API (layout tests don't appear to traverse
+ the correct codepath), so no layout test.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42298
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::handledOnloadEvents): Don't reset m_loadType.
+ (WebCore::FrameLoader::addExtraFieldsToRequest): Set subresource cache
+ policy in one place and don't depend on m_loadType.
+
+2010-07-15 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Printing test results differ between machines, we should use ImageDiff instead
+ https://bugs.webkit.org/show_bug.cgi?id=20011
+
+ Added spoolAllPagesWithBoundaries into PrintContext.
+
+ Test: printing/setPrinting.html
+
+ * WebCore.base.exp:
+ * page/PrintContext.cpp:
+ (WebCore::PrintContext::spoolAllPagesWithBoundaries):
+ * page/PrintContext.h:
+
+2010-07-15 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, small style fixes.
+
+ * platform/chromium/ThemeChromiumMac.mm:
+ (WebCore::ThemeChromiumMac::inflateControlPaintRect):
+ * platform/mac/ThemeMac.mm:
+ (WebCore::ThemeMac::inflateControlPaintRect):
+
+2010-07-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Update LegacyHTMLTreeBuilder to insert whitespace between </head> and <body>
+ https://bugs.webkit.org/show_bug.cgi?id=42431
+
+ Insert these whitespace text nodes into the HTML element between <head>
+ and <body>, as required by HTML5. Previously, we just dropped them on
+ the floor.
+
+ * html/LegacyHTMLTreeBuilder.cpp:
+ (WebCore::LegacyHTMLTreeBuilder::handleError):
+
+2010-07-15 Victor Wang <victorw@chromium.org>
+
+ Reviewed by David Levin.
+
+ [chromium] update KURLGoogle decodeURLEscapeSequences to
+ use googleurl public api so it does not access functions in
+ url_canon_internal. This is for chromium multi-dll build.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42177
+
+ Test: (unittest) WebKit\chromium\tests\KURLTest.cpp
+
+ * platform/KURLGoogle.cpp:
+ (WebCore::decodeURLEscapeSequences):
+
+2010-07-15 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ [Chromium] Update ThemeChromiumMac.mm for the recent changes of ThemeMac.mm
+ https://bugs.webkit.org/show_bug.cgi?id=41932
+
+ Sync with ThemeMac.mm r61760.
+ This change doesn't contain r54299, r57603, r57734, r57741, and
+ r58533 because they conflict with Chromium change for
+ FlippedView().
+
+ * platform/chromium/ThemeChromiumMac.mm:
+ (WebCore::sizeFromNSControlSize):
+ (WebCore::sizeFromFont):
+ (WebCore::controlSizeFromPixelSize):
+ (WebCore::setControlSize):
+ (WebCore::convertControlStatesToThemeDrawState):
+ (WebCore::stepperSizes):
+ (WebCore::stepperControlSizeForFont):
+ (WebCore::paintStepper):
+ (WebCore::ThemeChromiumMac::controlSize):
+ (WebCore::ThemeChromiumMac::minimumControlSize):
+ (WebCore::ThemeChromiumMac::inflateControlPaintRect):
+ (WebCore::ThemeChromiumMac::paint):
+
+2010-07-15 MORITA Hajime <morrita@google.com>
+
+ Reviewed by David Levin.
+
+ [Chromium][Win] Crashes with <keygen> with huge padding.
+ https://bugs.webkit.org/show_bug.cgi?id=41737
+
+ When we try to draw a large region, TransparencyWin can fail to
+ allocate a temporal buffer for composition. This change adds a
+ fallback path to ThemePainter to handle the buffer allocation
+ failure.
+
+ ThemePainter is no longer a subclass of TransparencyWin. It has
+ a TransparencyWin as a member.
+
+ Test: fast/forms/large-parts.html
+
+ * rendering/RenderThemeChromiumWin.cpp:
+ (WebCore::ThemePainter): Added a fallback path.
+
+2010-07-15 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Darin Adler.
+
+ Fix for Bug 42362 - CSSSegmentedFontFace::isLoaded() const is not used anywhere
+ Remove the method.
+ https://bugs.webkit.org/show_bug.cgi?id=42362
+
+ No new tests because of no behavior changes.
+
+ * css/CSSSegmentedFontFace.cpp:
+ * css/CSSSegmentedFontFace.h:
+
+2010-07-15 Erik Arvidsson <arv@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add directional property enums to the switch in applyProperty
+ https://bugs.webkit.org/show_bug.cgi?id=42438
+
+ Build fix for chromium mac.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+
+2010-07-13 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Nate Chapin.
+
+ bufferData and bufferSubData generate wrong error when null buffer is bound
+ https://bugs.webkit.org/show_bug.cgi?id=42125
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::bufferData): Call validateBufferDataParameters().
+ (WebCore::WebGLRenderingContext::bufferSubData): Ditto.
+ (WebCore::WebGLRenderingContext::validateBufferDataParameters): Parameters validation for buffer{Sub}Data().
+ * html/canvas/WebGLRenderingContext.h: Declare validateBufferDataParameters().
+
+2010-07-15 Jay Civelli <jcivelli@chromium.org>
+
+ Reviewed by David Levin.
+
+ [chromium] Making the popup label color visible when the item is
+ selected.
+ https://bugs.webkit.org/show_bug.cgi?id=42271
+
+ * platform/chromium/PopupMenuChromium.cpp:
+ (WebCore::PopupListBox::paintRow): paint the label text with a
+ different color when it is selected.
+
+2010-07-13 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Nate Chapin.
+
+ WebGL rendering results must be made available to Canvas.toDataURL and 2D drawImage
+ https://bugs.webkit.org/show_bug.cgi?id=34719
+
+ Tests: fast/canvas/webgl/canvas-test.html
+ fast/canvas/webgl/gl-pixelstorei.html
+
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::makeRenderingResultsAvailable): Paint the WebGL rendering results to canvas if it's 3d.
+ (WebCore::HTMLCanvasElement::toDataURL): Paint the WebGL rendering results to canvas if it's 3d.
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::drawImage): Paint the WebGL rendering results to canvas if it's 3d before drawing.
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::markContextChanged): Mark it always for canvas2d.drawImage purpose.
+ (WebCore::WebGLRenderingContext::paintRenderingResultsToCanvas): Paint the WebGL rendering results to canvas if it's dirty.
+ * html/canvas/WebGLRenderingContext.h: Declare paintRenderingResultsToCanvas().
+ * platform/graphics/GraphicsContext3D.h: Declare paintRenderingResultsToCanvas() & paintToCanvas().
+ * platform/graphics/cg/GraphicsContext3DCG.cpp:
+ (WebCore::GraphicsContext3D::paintToCanvas): Paint the rendered image pixels to the canvas.
+ * platform/graphics/mac/GraphicsContext3DMac.mm:
+ (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): Implement paintRenderingResultsToCanvas().
+ * platform/graphics/qt/GraphicsContext3DQt.cpp:
+ (WebCore::GraphicsContext3D::beginPaint): Just call paintRenderingResultsToCanvas().
+ (WebCore::GraphicsContext3D::endPaint):
+ (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): Implement paintRenderingResultsToCanvas().
+
+2010-07-15 Nico Weber <thakis@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ chromium/skia: Fix canvas.toDataURL in the presence of transparency
+ https://bugs.webkit.org/show_bug.cgi?id=42214
+
+ The problem was that SkBitmaps contain premultiplied data, but pnglib
+ doesn't expect premultiplied data. Now, the encoder unpremultiplies
+ data before sending it to pnglib.
+
+ Patch partially by deanm.
+
+ Covered by fast/canvas/toDataURL-alpha.html.
+
+ * platform/image-encoders/skia/PNGImageEncoder.cpp:
+ (WebCore::preMultipliedBGRAtoRGBA):
+ (WebCore::encodeImpl):
+ (WebCore::PNGImageEncoder::encode):
+
+2010-07-15 Alex Nicolaou <anicolao@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Convolution computation causes bad alpha channel values
+ https://bugs.webkit.org/show_bug.cgi?id=42273
+
+ Fixed by clamping colour channel values to the alpha value so that
+ r <= a, g <= a, and b <= a after the convolution is applied. See
+ the bug for why I believe the SVG specification needs to be updated.
+ Test must be drawn to crash. 100x100 green rectangle is used to
+ indicate pass to minimize the chance of regression.
+
+ Test: svg/custom/convolution-crash.svg
+
+ * platform/graphics/skia/SkiaUtils.cpp:
+ (WebCore::SkPMColorToColor):
+ * svg/graphics/filters/SVGFEConvolveMatrix.cpp:
+ (WebCore::clampRGBAValue):
+ (WebCore::setDestinationPixels):
+ (WebCore::FEConvolveMatrix::fastSetInteriorPixels):
+ (WebCore::FEConvolveMatrix::fastSetOuterPixels):
+
+2010-07-15 Dumitru Daniliuc <dumi@chromium.org>
+
+ Unreviewed, Chromium-specific changes that I forgot to make in r63278.
+
+ 1. DatabaseTrackerChromium::getMaxSizeForDatabase() is called on
+ the context thread by sync DBs.
+ 2. Forgot to change V8SQLTransactionSyncCustom to return the
+ result set when executeSql() is called.
+
+ * bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
+ (WebCore::V8SQLTransactionSync::executeSqlCallback):
+ * storage/chromium/DatabaseTrackerChromium.cpp:
+ (WebCore::DatabaseTracker::getMaxSizeForDatabase):
+
+2010-07-15 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Oliver Hunt.
+
+ [GTK] Simplify the distribution step
+ https://bugs.webkit.org/show_bug.cgi?id=42414
+
+ No new tests as this is just a build change.
+
+ * GNUmakefile.am: Modify EXTRA_DIST directly and make sure the list
+ of files is sorted. Also handle distributing the IDL files from the
+ WebCore source tree.
+
+2010-07-15 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ LegacyHTMLTreeBuilder should insert an implicit <colgroup> before inserting <col> to match HTML5
+ https://bugs.webkit.org/show_bug.cgi?id=42346
+
+ This turned out to be an easy fix.
+
+ This is covered by lots of layout tests. I believe
+ all of the changed results to be progressions.
+
+ This change had no measurable effect on the parser benchmark.
+
+ * html/LegacyHTMLTreeBuilder.cpp:
+ (WebCore::LegacyHTMLTreeBuilder::colCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::getNode):
+ * html/LegacyHTMLTreeBuilder.h:
+
+2010-07-15 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=42410
+ Many leaking DatasetDOMStringMaps seen on buildbot
+
+ * dom/NodeRareData.h:
+ (WebCore::NodeRareData::~NodeRareData): Add a virtual destructor so
+ that the ElementRareData's destructor will be called when this is deleted
+ from the Node's destructor.
+
+2010-07-15 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: Crash when table has empty thead tag
+ https://bugs.webkit.org/show_bug.cgi?id=42391
+
+ Test: accessibility/table-with-empty-thead-causes-crash.html
+
+ * accessibility/AccessibilityTableColumn.cpp:
+ (WebCore::AccessibilityTableColumn::headerObjectForSection):
+
+2010-07-15 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Start loading plug-in streams
+ https://bugs.webkit.org/show_bug.cgi?id=42407
+
+ Export some ResourceRequestBase getters.
+
+ * WebCore.exp.in:
+
+2010-07-15 Kenneth Russell <kbr@google.com>
+
+ Reviewed by Nate Chapin.
+
+ Query of NUM_COMPRESSED_TEXTURE_FORMATS must be handled by WebGL
+ https://bugs.webkit.org/show_bug.cgi?id=42401
+
+ No new tests; covered by gl-get-calls.html.
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::getParameter):
+ - Return 0 for getParameter(NUM_COMPRESSED_TEXTURE_FORMATS).
+
+2010-07-07 John Gregg <johnnyg@google.com>
+
+ Reviewed by Jian Li.
+
+ Experimental directory upload feature.
+ https://bugs.webkit.org/show_bug.cgi?id=40872
+
+ This patch adds a new HTML attribute webkitdirectory which applies to
+ <input type="file"> tags and allows the user to specify a folder
+ which is recursively enumerated so that all the files in that folder
+ are added to the file list.
+
+ The files chosen in that way have a .webkitRelativePath attribute which contains
+ the relative path starting from the chosen folder. The relative path is
+ also appended to each item in the FormData when uploaded.
+
+ All the code is behind an ENABLE_DIRECTORY_UPLOAD flag.
+
+ Test: fast/forms/input-file-directory-upload.html
+
+ * html/Blob.cpp:
+ (WebCore::Blob::Blob):
+ * html/Blob.h:
+ * html/File.cpp:
+ (WebCore::File::File):
+ (WebCore::File::Init):
+ (WebCore::File::webkitRelativePath):
+ * html/File.h:
+ (WebCore::File::create):
+ * html/File.idl:
+ * html/HTMLAttributeNames.in: add webkitdirectory attribute
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::setFileListFromRenderer):
+ (WebCore::HTMLInputElement::webkitdirectory):
+ * html/HTMLInputElement.h:
+ * html/HTMLInputElement.idl:
+ * platform/BlobItem.cpp:
+ (WebCore::FileBlobItem::create):
+ (WebCore::FileBlobItem::FileBlobItem):
+ * platform/BlobItem.h:
+ (WebCore::FileBlobItem::relativePath):
+ * platform/FileChooser.h:
+ (WebCore::FileChooser::allowsDirectoryUpload):
+ * platform/network/FormData.cpp:
+ (WebCore::FormData::appendKeyValuePairItems):
+ * rendering/RenderFileUploadControl.cpp:
+ (WebCore::RenderFileUploadControl::allowsMultipleFiles):
+ (WebCore::RenderFileUploadControl::allowsDirectoryUpload):
+ * rendering/RenderFileUploadControl.h:
+
+2010-07-15 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Avoid creating huge compositing layers for elements that project outside the viewport
+ https://bugs.webkit.org/show_bug.cgi?id=42338
+
+ The logic that computed the bounds of compositing layers naively used the
+ union of the bounds of descendant, non-composited RenderLayers, without regard
+ to what is actually visible. This could result in huge layers for page with
+ elements are large negative offsets, or with large negative text-indent (both
+ common).
+
+ For elements without transforms on them or in their ancestor chain, and when
+ no 3d transforms or hardware-accelerated animations are used, can clip compositing
+ layers to the size of the document, or based on CSS overflow and clip.
+
+ Tests: compositing/geometry/limit-layer-bounds-clipping-ancestor.html
+ compositing/geometry/limit-layer-bounds-fixed-positioned.html
+ compositing/geometry/limit-layer-bounds-overflow-repaint.html
+ compositing/geometry/limit-layer-bounds-positioned-transition.html
+ compositing/geometry/limit-layer-bounds-positioned.html
+ compositing/geometry/limit-layer-bounds-transformed-overflow.html
+ compositing/geometry/limit-layer-bounds-transformed.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::enclosingOverflowClipAncestor): Walk up the RenderLayer tree
+ looking for an ancestor that has overflow, or to the root. Along the way, check for
+ transformed elements.
+ (WebCore::RenderLayerBacking::updateCompositedBounds): If we're in "consult
+ overlap" mode, and we don't have transforms, then constrain the bounds
+ of composited layers by the RenderView's layoutOverflowRect(), or by the
+ enclosing layer with overflow.
+ (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): If the offset from the renderer changes,
+ we need to repaint the layer.
+
+2010-07-15 Alex Nicolaou <anicolao@chromium.org>
+
+ Reviewed by Dirk Schulze.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42228
+
+ SVG Masks were in the wrong colour space for non-CG graphics layers,
+ because for those cases ImageBuffer needs to be explicitly told to
+ convert the pixels. This change adds a test that demonstrates the
+ problem and the conversion call to make the mask LinearRGB.
+
+ Test: svg/custom/mask-colorspace.svg
+
+ * rendering/RenderSVGResourceMasker.cpp:
+ (WebCore::RenderSVGResourceMasker::createMaskImage):
+
+2010-07-15 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Darin Adler.
+
+ [Mac] Implement LayoutTestController::markerTextForListItem()
+ https://bugs.webkit.org/show_bug.cgi?id=37929
+
+ Export symbols for WebCore::markerTextForListItem() and WebCore::toElement().
+
+ * WebCore.exp.in:
+
+2010-07-15 Andreas Kling <andreas.kling@nokia.com>
+
+ Rubber-stamped by Kenneth Rohde Christiansen.
+
+ [Qt] Remove an unused variable in BitmapImage::draw()
+
+ * platform/graphics/qt/ImageQt.cpp:
+ (WebCore::BitmapImage::draw): Remove selfSize.
+
+2010-07-15 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: pass all parameters to WebInspector.addConsoleMessage as a single payload object
+ https://bugs.webkit.org/show_bug.cgi?id=42345
+
+ This refactoring is covered by existing console tests.
+
+ * bindings/js/ScriptArray.cpp:
+ (WebCore::ScriptArray::set):
+ * bindings/js/ScriptArray.h:
+ (WebCore::ScriptArray::ScriptArray):
+ (WebCore::ScriptArray::jsArray):
+ * bindings/v8/ScriptArray.cpp:
+ (WebCore::ScriptArray::set):
+ * bindings/v8/ScriptArray.h:
+ (WebCore::ScriptArray::ScriptArray):
+ (WebCore::ScriptArray::~ScriptArray):
+ * inspector/ConsoleMessage.cpp:
+ (WebCore::ConsoleMessage::addToFrontend):
+ * inspector/InspectorFrontend.cpp:
+ (WebCore::InspectorFrontend::addConsoleMessage):
+ * inspector/InspectorFrontend.h:
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.updateMessageRepeatCount):
+ (WebInspector.ConsoleMessage):
+ (WebInspector.ConsoleMessage.createTextMessage):
+ (WebInspector.ConsoleCommandResult):
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype.generateStylesheet):
+ * inspector/front-end/InjectedScriptAccess.js:
+ (InjectedScriptAccess._installHandler.InjectedScriptAccess.prototype.methodName.myCallback):
+ (InjectedScriptAccess._installHandler.InjectedScriptAccess.prototype.methodName):
+ (InjectedScriptAccess._installHandler):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype._checkWarning):
+ * inspector/front-end/inspector.js:
+ (WebInspector.updateConsoleMessageExpiredCount):
+ (WebInspector.addConsoleMessage):
+ (WebInspector.log.logMessage):
+ (WebInspector.log):
+
+2010-07-14 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Backfill DNS and connect times rather than exposing hard zeros
+ https://bugs.webkit.org/show_bug.cgi?id=42303
+
+ There are several cases where domain lookup is not performed and/or a new connection is not established. Previously in these cases, we exposed a "0" to the API. Now, we instead "backfill" with the most recent mark's time.
+
+ Also, previously, I was using the ResourceLoadTiming API incorrectly. Each mark is an integer representing offset in milliseconds from requestTime. So all values need to be added to requestTime.
+
+ No new test because existing test expectations are set to FAIL because disable disabled by default. The expected results of existings tests change as expected when enabled.
+
+ * page/Timing.cpp:
+ (WebCore::toIntegerMilliseconds): Move to file static instead of class static because it might generate more optimal code. Also, instead of converting negative doubles to zero, ASSERT that they are >= 0. This is because we no longer expose hard zeros for DNS and connect, so we want to be sure that the -1s returned by the API are properly handled.
+ (WebCore::Timing::domainLookupStart):
+ (WebCore::Timing::domainLookupEnd):
+ (WebCore::Timing::connectStart):
+ (WebCore::Timing::connectEnd):
+ (WebCore::Timing::requestStart):
+ (WebCore::Timing::requestEnd):
+ (WebCore::Timing::responseStart):
+ * page/Timing.h:
+
+2010-07-15 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: differentiate between blocking and connecting timers.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42372
+
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::InspectorResource):
+ (WebCore::InspectorResource::updateResponse):
+ (WebCore::InspectorResource::updateScriptObject):
+ (WebCore::InspectorResource::buildObjectForTiming):
+ * inspector/InspectorResource.h:
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.get cached):
+ (WebInspector.Resource.prototype.set cached):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype._showPopover):
+ (WebInspector.ResourceGraph):
+ (WebInspector.ResourceGraph.prototype.refresh):
+ (WebInspector.ResourceGraph.prototype._cachedChanged):
+ * inspector/front-end/inspector.js:
+ (WebInspector.updateResource):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::loadedResourceFromMemoryCache):
+ * loader/FrameLoader.h:
+ * platform/network/ResourceResponseBase.cpp:
+ (WebCore::ResourceResponseBase::ResourceResponseBase):
+ (WebCore::ResourceResponseBase::connectionReused):
+ (WebCore::ResourceResponseBase::setConnectionID):
+ * platform/network/ResourceResponseBase.h:
+
+2010-07-15 MORITA Hajime <morrita@google.com>
+
+ Text layout is wrong with a SVG Font that lacks <missing-glyph> element
+ https://bugs.webkit.org/show_bug.cgi?id=42352
+
+ floatWidthOfSubStringUsingSVGFont() calculated a wrong value for a
+ sub-run, and a fallback to system font triggers such a computation.
+ This change made floatWidthOfSubStringUsingSVGFont() to deal with
+ sub-runs.
+
+ Test: svg/custom/svg-fonts-without-missing-glyph.xhtml
+
+ * svg/SVGFont.cpp:
+ (WebCore::floatWidthOfSubStringUsingSVGFont):
+
+2010-07-15 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Cycle detection needs to include shadow tree
+ https://bugs.webkit.org/show_bug.cgi?id=42360
+
+ Search for cycles in shadow tree fragments as well. Extended the svg/custom/recursion-* tests. No more crashes in any of them.
+
+ * rendering/RenderSVGResourceContainer.h:
+ (WebCore::RenderSVGResourceContainer::containsCyclicReference):
+ * rendering/RenderSVGShadowTreeRootContainer.cpp: Implemented here, not inline, so that clients don't need to include SVGShadowTreeElements.h
+ (WebCore::RenderSVGShadowTreeRootContainer::rootElement): Expose helper function, that returns the shadow tree root element as Node*.
+ * rendering/RenderSVGShadowTreeRootContainer.h:
+
+2010-07-15 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ clipPath is missing cycle detection
+ https://bugs.webkit.org/show_bug.cgi?id=42350
+
+ Detect cyclic clipper resources, and ignore them on rendering. Early exit in applyResource just like the pattern/mask resources do.
+
+ * rendering/RenderSVGResourceClipper.cpp:
+ (WebCore::RenderSVGResourceClipper::applyResource):
+ (WebCore::RenderSVGResourceClipper::hitTestClipContent):
+ (WebCore::RenderSVGResourceClipper::childElementReferencesResource):
+ * rendering/RenderSVGResourceClipper.h:
+
+2010-07-15 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Fix a leak of Vector instances seen on the build bot.
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::drawBoxSideFromPath): Don't unnecessarily heap allocate then leak the DashArray.
+
+2010-07-15 Mark Rowe <mrowe@apple.com>
+
+ Update the sorting in the Xcode project files.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2010-07-15 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Eric Seidel.
+
+ SVG patterns and masks should not be able to reference themselves
+ https://bugs.webkit.org/show_bug.cgi?id=32171
+
+ Pattern still had an issue, when using constructs like:
+ <pattern id="pattern1" xlink:href="#pattern2"/>
+ <pattern id="pattern2"><rect fill="url(#pattern1)"/></pattern>
+
+ Extended test svg/custom/recursive-pattern.svg to cover this situation.
+
+ * rendering/RenderSVGResourcePattern.cpp:
+ (WebCore::RenderSVGResourcePattern::applyResource): Don't perform the cycle check against node()...
+ (WebCore::RenderSVGResourcePattern::createTileImage): .. but against the "patternContentElement" which respect the xlink:href chaining.
+
+2010-07-15 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Adam Barth.
+
+ Pixel test failure in moving-shadow-on-path.html and moving-shadow-on-container.html
+ https://bugs.webkit.org/show_bug.cgi?id=42249
+
+ Partly revert <http://trac.webkit.org/changeset/63307>. The RenderSVGRoot change caused a pixel test regression in two fast/repaint tests.
+
+ * rendering/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::layout): Include selfNeedsLayout() check in LayoutStateRepainter argument.
+
+2010-07-14 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r63352.
+ http://trac.webkit.org/changeset/63352
+ https://bugs.webkit.org/show_bug.cgi?id=42341
+
+ Broke plugin-initiate-popup-window.html and plugin-javascript-
+ access.html on snow leopard (Requested by abarth on #webkit).
+
+ * bindings/v8/NPV8Object.cpp:
+ (_NPN_EvaluateHelper):
+
+2010-07-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Make the LegacyHTMLTreeBuilder coalesce text nodes
+ https://bugs.webkit.org/show_bug.cgi?id=42314
+
+ This is slightly tricky as we're side-stepping the old
+ parsers insertion logic in the cases where we know we can
+ safely merge text into an existing text node instead of
+ inserting a new one.
+
+ This affects lots of tests (which will need to change for
+ the HTML5 TreeBuilder anyway) and causes the LegacyHTMLTreeBuilder
+ to now pass a bunch more subtests in html5lib/runner.html.
+
+ The parser benchmark thinks that this is a small speedup.
+ I think I happen to have been lucky enough to get the right
+ cache alignment, and that this is likely a wash.
+
+ * html/LegacyHTMLTreeBuilder.cpp:
+ (WebCore::LegacyHTMLTreeBuilder::parseToken):
+
+2010-07-14 Evan Stade <estade@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] Linux scrollbar steppers are "clickable" even when disabled
+ https://bugs.webkit.org/show_bug.cgi?id=42231
+
+ Not tested by layout tests.
+
+ * platform/chromium/ScrollbarThemeChromiumLinux.cpp:
+ (WebCore::ScrollbarThemeChromiumLinux::paintButton):
+
+2010-07-14 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r63389.
+ http://trac.webkit.org/changeset/63389
+ https://bugs.webkit.org/show_bug.cgi?id=42311
+
+ It broke the Chromium Linux build. (Requested by dave_levin on
+ #webkit).
+
+ * platform/KURLGoogle.cpp:
+ (WebCore::decodeURLEscapeSequences):
+
+2010-07-13 Mirko Damiani <mirko@develer.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] CSS border style not cleared for SVG object
+ https://bugs.webkit.org/show_bug.cgi?id=42150
+
+ For tests and description see:
+ https://bugs.webkit.org/show_bug.cgi?id=25738
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::setLineDash):
+
+2010-07-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ HTMLTreeBuilder shouldn't crash during fast/parser/remove-parser-current-node.html
+ https://bugs.webkit.org/show_bug.cgi?id=42312
+
+ We were crashing because of an ASSERT I added to the attach logic in
+ the HTMLConstructionSite. I knew this ASSERT was wrong when I added
+ it, I just wanted to make sure we had test coverage of those cases.
+ Turns out we do! :)
+
+ * html/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::attach):
+ (WebCore::HTMLConstructionSite::attachAtSite):
+
+2010-07-14 Victor Wang <victorw@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] update KURLGoogle decodeURLEscapeSequences to
+ use googleurl public api so it does not access functions in
+ url_canon_internal. This is for chromium multi-dll build.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42177
+
+ Test: (unittest) WebKit\chromium\tests\KURLTest.cpp
+
+ * platform/KURLGoogle.cpp:
+ (WebCore::decodeURLEscapeSequences):
+
+2010-07-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Avoid extra memcpy of character tokens
+ https://bugs.webkit.org/show_bug.cgi?id=42002
+
+ Eric tells me this patch makes the new tree builder 1% faster than the
+ old tree builder on our parser benchmark.
+
+ * html/HTMLToken.h:
+ (WebCore::AtomicHTMLToken::AtomicHTMLToken):
+ (WebCore::AtomicHTMLToken::characters):
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::ExternalCharacterTokenBuffer):
+ (WebCore::convertToOldStyle):
+ (WebCore::HTMLTreeBuilder::processFakeCharacters):
+
+2010-07-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ HTMLTreeBuilder foster parents when it should not
+ https://bugs.webkit.org/show_bug.cgi?id=42235
+
+ Regarding foster parenting of nodes inside tables:
+ "Process the token using the rules for the "in body" insertion mode,
+ except that if the current node is a table, tbody, tfoot, thead, or
+ tr element, then, whenever a node would be inserted into the current
+ node, it must instead be foster parented."
+
+ We were forgetting the "when the current node is" part of that check
+ and always foster parenting, even if we had just inserted another
+ element (which would have just changed the current node).
+
+ This was covered by multiple tests in html5lib/runner.html
+ but I wrote a reduction (one which I included) as it makes it
+ easier to see what's going on.
+
+ * html/HTMLConstructionSite.cpp:
+ (WebCore::HTMLNames::causesFosterParenting):
+ (WebCore::HTMLConstructionSite::attach):
+ (WebCore::HTMLConstructionSite::insertHTMLHtmlElement):
+ (WebCore::HTMLConstructionSite::insertHTMLHeadElement):
+ (WebCore::HTMLConstructionSite::insertHTMLBodyElement):
+ (WebCore::HTMLConstructionSite::insertTextNode):
+ (WebCore::HTMLConstructionSite::shouldFosterParent):
+ * html/HTMLConstructionSite.h:
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
+
+2010-07-14 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ <rdar://problem/8131355> Apps load stale versions of pages when initial load happens via back/forward navigation.
+
+ No test case is added because DumpRenderTree is not able to test the scenario where the initial load in a WebView
+ occurs via a back/forward navigation.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::navigateToDifferentDocument): When the first load in a page is a back/forward navigation, we
+ shouldn't try to prefer cached data but should do revalidation by default.
+ (WebCore::FrameLoader::addExtraFieldsToRequest): Ditto.
+
+2010-07-14 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Breaks all dependencies on Page from platform/ and cleans up GLES2Context lifetime
+ https://bugs.webkit.org/show_bug.cgi?id=42203
+
+ Rather than constructing a GLES2Context from a Page, pass the LayerRendererChromium
+ a GLES2Context in from the constructor. This way the platform/ directory can remain
+ ignorant of Page and friends. Also adds functions on ChromeClientChromium to request
+ onscreen and offscreen GLES2Contexts for callers in WebCore that need them.
+
+ * page/chromium/ChromeClientChromium.h:
+ * platform/chromium/GLES2Context.h:
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::create):
+ (WebCore::LayerRendererChromium::LayerRendererChromium):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+
+2010-07-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ Add functions to extract individual RGBA32 components
+ https://bugs.webkit.org/show_bug.cgi?id=42305
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::willDraw): Use alphaChannel()
+ * platform/graphics/Color.h:
+ (WebCore::redChannel):
+ (WebCore::greenChannel):
+ (WebCore::blueChannel):
+ (WebCore::alphaChannel):
+ (WebCore::Color::red):
+ (WebCore::Color::green):
+ (WebCore::Color::blue):
+ (WebCore::Color::alpha):
+
+2010-07-14 Alexey Proskuryakov <ap@apple.com>
+
+ Not reviewed.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42201
+ Use ResourceHandle object for synchronous loading
+
+ * platform/network/mac/ResourceHandleMac.mm:
+ (WebCore::ResourceHandle::loadResourceSynchronously): Fix an obvious typo.
+
+2010-07-14 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Brady Eidson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42201
+ Use ResourceHandle object for synchronous loading
+
+ Fix a Tiger test failure.
+
+ Setting NSURLRequest properties has been moved to createNSURLConnection to share code between
+ sync and async cases, but on Tiger, we don't call this function.
+
+ There is more refactoring needed to make this nice, and we need to figure out if some of
+ request-tweaking code in createNSURLConnection needs to run on every redirect, as it happens
+ with CFNetwork version.
+
+ * platform/network/mac/ResourceHandleMac.mm:
+ (WebCore::ResourceHandle::loadResourceSynchronously): Set main document for cookies, which is
+ the only thing we've been missing.
+
+2010-07-14 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Dan Bernstein.
+
+ * WebCore.xcodeproj/project.pbxproj: Silence rsync.
+
+2010-07-14 Darin Adler <darin@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Fix warning seen with newer gcc (on Qt buildbot).
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
+ Add parentheses around && expression.
+
+2010-07-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Avoid extra memcpy of character tokens
+ https://bugs.webkit.org/show_bug.cgi?id=42002
+
+ This patch is just some cleanup to make fixing this bug easier.
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::ExternalCharacterTokenBuffer):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::~ExternalCharacterTokenBuffer):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::isEmpty):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::skipLeadingWhitespace):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeLeadingWhitespace):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemaining):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::giveRemainingTo):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemainingWhitespace):
+ (WebCore::HTMLTreeBuilder::processDoctypeToken):
+ (WebCore::HTMLTreeBuilder::processStartTag):
+ (WebCore::HTMLTreeBuilder::processEndTag):
+ (WebCore::HTMLTreeBuilder::processComment):
+ (WebCore::HTMLTreeBuilder::processCharacter):
+ (WebCore::HTMLTreeBuilder::processCharacterBuffer):
+ (WebCore::HTMLTreeBuilder::processEndOfFile):
+ (WebCore::HTMLTreeBuilder::defaultForInitial):
+ (WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
+ (WebCore::HTMLTreeBuilder::defaultForBeforeHead):
+ (WebCore::HTMLTreeBuilder::defaultForInHead):
+ (WebCore::HTMLTreeBuilder::defaultForInHeadNoscript):
+ (WebCore::HTMLTreeBuilder::defaultForAfterHead):
+ (WebCore::HTMLTreeBuilder::defaultForInTableText):
+ * html/HTMLTreeBuilder.h:
+
+2010-07-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ Canvas: Don't add shadow rect to dirty region when shadow alpha is 0
+ https://bugs.webkit.org/show_bug.cgi?id=42300
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::willDraw):
+
+2010-07-14 Kevin Ollivier <kevino@theolliviers.com>
+
+ [CURL] Build fix after request -> firstRequest rename.
+
+ * platform/network/curl/FormDataStreamCurl.cpp:
+ (WebCore::FormDataStream::read):
+ (WebCore::FormDataStream::hasMoreElements):
+ * platform/network/curl/ResourceHandleManager.cpp:
+ (WebCore::headerCallback):
+ (WebCore::ResourceHandleManager::setupPOST):
+ (WebCore::parseDataUrl):
+ (WebCore::ResourceHandleManager::dispatchSynchronousJob):
+ (WebCore::ResourceHandleManager::startJob):
+ (WebCore::ResourceHandleManager::initializeHandle):
+
+2010-07-14 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by John Sullivan.
+
+ <rdar://problem/8186963> Expose information about compositing layers.
+
+ Expose information about the types of compositing layers via RenderLayerBacking::compositingLayerType().
+
+ * WebCore.exp.in: Export WebCore::SpaceSplitStringData::createVector().
+ * WebCore.xcodeproj/project.pbxproj: Make RenderLayerBacking.h a Private header for use by WebKit.
+ * platform/graphics/GraphicsLayer.h: Add hasContentsLayer() and usingTiledLayer() methods.
+ (WebCore::GraphicsLayer::hasContentsLayer):
+ (WebCore::GraphicsLayer::usingTiledLayer):
+ * platform/graphics/mac/GraphicsLayerCA.h:
+ (WebCore::GraphicsLayerCA::hasContentsLayer): Return true if we have a contents layer.
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::compositingLayerType): Return information about the type of composited layer.
+ * rendering/RenderLayerBacking.h:
+
+2010-07-14 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ TreeWalker::previousSibling calls firstChild instead of lastChild when handling FILTER_SKIP
+ https://bugs.webkit.org/show_bug.cgi?id=42008
+
+ TreeWalker::previousNode does not handle FILTER_REJECT when processing lastChild
+ https://bugs.webkit.org/show_bug.cgi?id=42010
+
+ Tests: fast/dom/TreeWalker/previousNodeLastChildReject.html
+ fast/dom/TreeWalker/previousSiblingLastChildSkip.html
+
+ * dom/TreeWalker.cpp:
+ (WebCore::TreeWalker::previousSibling): Call lastChild instead of firstChild.
+ (WebCore::TreeWalker::previousNode): Fix handling of FILTER_REJECT by exiting
+ the lastChild loop when we encounter it.
+
+2010-07-14 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Brady Eidson.
+
+ Fix crashing layout test on snowleopard.
+
+ * platform/mac/CursorMac.mm:
+ (WebCore::Cursor::ensurePlatformCursor): Make sure to retain the cursor.
+
+2010-07-14 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: aria-checked not recognized on image map radio buttons
+ https://bugs.webkit.org/show_bug.cgi?id=42055
+
+ Moves some code from AccessibilityRenderObject to AccessibilityObject so that
+ elements that do not have render objects, but do have Nodes (like image map links
+ and list box options) can still make use of certain aria attributes.
+
+ Test: platform/mac/accessibility/image-map-link-used-as-radiobutton.html
+
+ * accessibility/AccessibilityImageMapLink.cpp:
+ (WebCore::AccessibilityImageMapLink::roleValue):
+ (WebCore::AccessibilityImageMapLink::accessibilityDescription):
+ (WebCore::AccessibilityImageMapLink::title):
+ Make imageMap use standard AccessibilityObject methods for getAttribute()
+ * accessibility/AccessibilityImageMapLink.h:
+ (WebCore::AccessibilityImageMapLink::node):
+ * accessibility/AccessibilityListBoxOption.cpp:
+ (WebCore::AccessibilityListBoxOption::accessibilityIsIgnored):
+ (WebCore::AccessibilityListBoxOption::stringValue):
+ * accessibility/AccessibilityListBoxOption.h:
+ (WebCore::AccessibilityListBoxOption::node):
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::language):
+ Language method doesn't need a node() anymore, it can use the node from AccessibilityObject.
+ (WebCore::renderListItemContainerForNode):
+ (WebCore::AccessibilityObject::getAttribute):
+ (WebCore::AccessibilityObject::intValue):
+ Move intValue into AccessibilityObject.
+ (WebCore::AccessibilityObject::hasIntValue):
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::isCheckbox):
+ (WebCore::AccessibilityObject::isRadioButton):
+ (WebCore::AccessibilityObject::isCheckboxOrRadio):
+ Consolidate what defines a checkbox and radio button into AccessibilityObject.
+ (WebCore::AccessibilityObject::node):
+ (WebCore::AccessibilityObject::headingLevel):
+ (WebCore::AccessibilityObject::isDetached):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::isPasswordField):
+ (WebCore::AccessibilityRenderObject::headingLevel):
+ (WebCore::AccessibilityRenderObject::selectedTabItem):
+ (WebCore::AccessibilityRenderObject::hierarchicalLevel):
+ (WebCore::AccessibilityRenderObject::node):
+ (WebCore::AccessibilityRenderObject::intValue):
+ * accessibility/AccessibilityRenderObject.h:
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::itemAccessibilityText):
+ Stop using AccessibilityObjects getAttribute (no reason to use it really).
+
+2010-07-14 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ <rdar://problem/7759909> Certain text runs measure 1 pixel wider when measured as a whole than when measured piecewise
+ https://bugs.webkit.org/show_bug.cgi?id=42279
+
+ No test because the issue cannot be reproduced with standard fonts.
+
+ Word- and run-rounding works by advancing ahead to the nearest integral width. As the total
+ width accumulated becomes large, the float type’s low precision results in accumulated rounding
+ error, sometimes crossing an integer. Consequently, word-rounding makes different decisions when
+ measuring a multi-word run than when measuring its words individually. To work around this,
+ word- and run-rounding are applied only to the width accumulated since the last rounding
+ character.
+
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::advance):
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+
+2010-07-14 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Fix enum value names for Navigation.{idl|h}
+ https://bugs.webkit.org/show_bug.cgi?id=42282
+
+ This is necessary after https://bugs.webkit.org/show_bug.cgi?id=42250.
+
+ No new tests because no new functionality.
+
+ * page/Navigation.cpp:
+ (WebCore::Navigation::type):
+ * page/Navigation.h:
+ (WebCore::Navigation::):
+
+2010-07-14 Johnny Ding <jnd@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41292
+ Set right UserGestureIndicator to indicate whether the NPN_Evaluate allows popup window or not.
+
+ Test: plugins/plugin-initiate-popup-window.html
+
+ * bindings/v8/NPV8Object.cpp:
+ (_NPN_EvaluateHelper):
+
+2010-07-14 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Bug 42117 - AX: Data table heuristics: consider assuming data table for 'zebra-striped' rows
+ https://bugs.webkit.org/show_bug.cgi?id=42117
+
+ Test: platform/mac/accessibility/table-with-zebra-rows.html
+
+ * accessibility/AccessibilityTable.cpp:
+ (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
+
+2010-07-14 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: VoiceOver cannot navigate this page because Safari is taking too long
+ https://bugs.webkit.org/show_bug.cgi?id=42219
+
+ No tests. Existing tests cover change.
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::boundingBoxRect):
+
+2010-07-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ Canvas: Fast-path for assigning the same color string as before to fillStyle or strokeStyle
+ https://bugs.webkit.org/show_bug.cgi?id=42272
+
+ Always route assignment of color strings via setFillColor() or setStrokeColor()
+ where we can check it against the previous value and return early if it's the same.
+
+ * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
+ (WebCore::toHTMLCanvasStyle):
+ (WebCore::JSCanvasRenderingContext2D::strokeStyle):
+ (WebCore::JSCanvasRenderingContext2D::setStrokeStyle):
+ (WebCore::JSCanvasRenderingContext2D::setFillStyle):
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setStrokeStyle):
+ (WebCore::CanvasRenderingContext2D::setFillStyle):
+ (WebCore::CanvasRenderingContext2D::setStrokeColor):
+ (WebCore::CanvasRenderingContext2D::setFillColor):
+ * html/canvas/CanvasRenderingContext2D.h:
+
+2010-07-14 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Jian Li.
+
+ Separate line-ending conversion code from BlobItem
+ https://bugs.webkit.org/show_bug.cgi?id=40932
+
+ Add common line-ending normalization code under platform/text.
+ No new tests as it doesn't change any functionality.
+
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/BlobBuilder.cpp:
+ (WebCore::BlobBuilder::appendString):
+ * html/FormDataList.cpp:
+ (WebCore::FormDataList::appendString):
+ * platform/BlobItem.cpp:
+ * platform/BlobItem.h:
+ * platform/text/LineEnding.cpp: Added.
+ * platform/text/LineEnding.h: Added.
+
+2010-07-14 Erik Arvidsson <arv@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Implement border-start and border-end properties
+ https://bugs.webkit.org/show_bug.cgi?id=41782
+
+ Test: fast/css/border-start-end.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::resolveDirectionAwareProperty):
+ * css/CSSPropertyNames.in:
+ * inspector/front-end/SourceCSSTokenizer.js:
+ (WebInspector.SourceCSSTokenizer):
+
+2010-07-14 Alexey Proskuryakov <ap@apple.com>
+
+ Tiger and Gtk build fixes.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42201
+ Use ResourceHandle object for synchronous loading
+
+ * platform/network/mac/ResourceHandleMac.mm:
+ (WebCore::ResourceHandle::createNSURLConnection):
+ (WebCore::ResourceHandle::loadResourceSynchronously):
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ (WebCore::startHttp):
+
+2010-07-14 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=42232
+ Make changing Cursors work in WebKit2.
+
+ - Converted Mac and Windows Cursor implementations to lazily
+ create the platform cursor.
+ - Add HostWindow function to set the cursor and use it from Widget::setCursor.
+ - Rework Windows cursor code to use fewer global variables.
+
+ * WebCore.exp.in: Updated
+ * loader/EmptyClients.h:
+ (WebCore::EmptyChromeClient::setCursor):
+ (WebCore::EmptyChromeClient::setLastSetCursorToCurrentCursor):
+ Added empty implementations.
+
+ * page/Chrome.cpp:
+ (WebCore::Chrome::setCursor):
+ * page/Chrome.h:
+ * page/ChromeClient.h:
+ Change existing setCursor() function to take a Cursor instead of a
+ PlatformCursorHandle. Added setLastSetCursorToCurrentCursor.
+
+ * platform/Cursor.cpp:
+ * platform/Cursor.h:
+ Added Cursor Type and the option of lazily creating the native cursor
+ (used on Mac and Windows for now).
+
+ * platform/HostWindow.h:
+ Add setCursor.
+
+ * platform/mac/CursorMac.mm:
+ (WebCore::createCustomCursor): This no longer needs to call determineHotSpot
+ as that is done when on construction of the cursor now and the hotSpot passed
+ in is correct.
+ (WebCore::Cursor::ensurePlatformCursor):
+ (WebCore::Cursor::Cursor):
+ (WebCore::Cursor::~Cursor):
+ (WebCore::Cursor::operator=):
+ (WebCore::Cursor::platformCursor):
+ Convert to lazily creating the native cursor on the first request and
+ storing the type.
+
+ * platform/mac/WidgetMac.mm:
+ (WebCore::Widget::setCursor):
+ Use HostWindow::setCursor to set the cursor. This in turn will call the
+ ChromeClient.
+
+ * platform/win/CursorWin.cpp:
+ (WebCore::createSharedCursor):
+ (WebCore::loadSharedCursor):
+ (WebCore::loadCursorByName):
+ (WebCore::Cursor::ensurePlatformCursor):
+ (WebCore::SharedCursor::~SharedCursor):
+ (WebCore::Cursor::Cursor):
+ (WebCore::Cursor::~Cursor):
+ (WebCore::Cursor::operator=):
+ (WebCore::Cursor::platformCursor):
+ Convert to lazily creating the native cursor on the first request and
+ storing the type.
+
+ * platform/win/WidgetWin.cpp:
+ (WebCore::Widget::setCursor):
+ Use HostWindow::setCursor to set the cursor. This in turn will call the
+ ChromeClient.
+
+ * plugins/win/PluginViewWin.cpp:
+ (WebCore::PluginView::handleMouseEvent):
+ Use the new setLastSetCursorToCurrentCursor client function to ensure
+ the cursor is properly updated when over a plugin.
+
+ * platform/chromium/CursorChromium.cpp:
+ * platform/efl/CursorEfl.cpp:
+ * platform/gtk/CursorGtk.cpp:
+ * platform/haiku/CursorHaiku.cpp:
+ * platform/wince/CursorWince.cpp:
+ * platform/wx/CursorWx.cpp:
+ * platform/qt/CursorQt.cpp:
+ Change m_impl -> m_platformCursor.
+
+2010-07-13 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ reconstructActiveFormElements should reconstruct attributes as well
+ https://bugs.webkit.org/show_bug.cgi?id=42222
+
+ The case in question is "<p><b foo='bar'></p>text</b>".
+ When the "b" is re-opened to wrap the text it should include
+ any attributes from the original (now closed) tag name.
+
+ There are also similar cases for the Adoption Agency algorithm, but since
+ the html5lib test suite did not cover those (and it wasn't immediately
+ obvious to me how to test those) I've saved fixing that bug for a
+ later patch. For now I've just made the adoption agency use
+ HTMLConstructionSite::createHTMLElementFromElementRecord so the
+ FIXME can be in one place instead of two.
+
+ In order to cleanly support createHTMLElementFromSavedElement
+ I re-factored "attachToCurrent" out from createHTMLElementAndAttachToCurrent
+ and changed all callers to use attachToCurrent(createHTMLElement(token)).
+
+ This is covered by two existing tests in html5lib/runner.html
+ and I wrote two more. One to cover the basic case that we now pass
+ and a second to cover an evil edge case which we do not.
+
+ * html/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::attachToCurrent):
+ (WebCore::HTMLConstructionSite::insertHTMLHtmlElement):
+ (WebCore::HTMLConstructionSite::insertHTMLHeadElement):
+ (WebCore::HTMLConstructionSite::insertHTMLBodyElement):
+ (WebCore::HTMLConstructionSite::insertHTMLElement):
+ (WebCore::HTMLConstructionSite::insertSelfClosingHTMLElement):
+ (WebCore::HTMLConstructionSite::insertScriptElement):
+ (WebCore::HTMLConstructionSite::insertForeignElement):
+ (WebCore::HTMLConstructionSite::createHTMLElementFromElementRecord):
+ (WebCore::HTMLConstructionSite::createHTMLElementFromSavedElement):
+ (WebCore::HTMLConstructionSite::reconstructTheActiveFormattingElements):
+ * html/HTMLConstructionSite.h:
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
+
+2010-07-13 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42201
+ Use ResourceHandle object for synchronous loading
+
+ * platform/network/ResourceHandle.cpp:
+ (WebCore::ResourceHandle::ResourceHandle): Moved common tasks from create() to constructor.
+ (WebCore::ResourceHandle::firstRequest): Renamed from request(). This is not changed with
+ redirect, so the old name was quite confusing.
+
+ * platform/network/ResourceHandle.h: Made createNSURLConnection() a member function, since
+ it now needs access to both ResourceHandle and ResourceHandleInternal. Added createCFURLConnection().
+
+ * platform/network/ResourceHandleInternal.h:
+ (WebCore::ResourceHandleInternal::ResourceHandleInternal): Renamed m_request to m_firstRequest.
+
+ * platform/network/mac/ResourceHandleMac.mm:
+ (WebCoreSynchronousLoaderClient): Replaced an Objective C delegate class with a ResourceHandleClient
+ subclass. This allows for much better code sharing, with common logic is in ResourceHandle.
+ (WebCore::ResourceHandle::createNSURLConnection): Factored out more code that is common
+ between sync and async parts.
+ (WebCore::ResourceHandle::start): Ditto.
+ (WebCore::ResourceHandle::cancel): Updated for firstRequest() renaming.
+ (WebCore::ResourceHandle::loadResourceSynchronously): Use ResourceHandle and ResourceHandleClient,
+ like a good loader.
+ (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Updated for firstRequest() renaming.
+ (WebCore::ResourceHandle::receivedCredential): Ditto.
+ (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]): Ditto.
+ (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Ditto.
+ (-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]): Ditto.
+ (-[WebCoreResourceHandleAsDelegate connection:didFailWithError:]): Ditto.
+
+ * platform/network/cf/ResourceHandleCFNet.cpp:
+ (WebCore::WebCoreSynchronousLoaderClient::create):
+ (WebCore::WebCoreSynchronousLoaderClient::setAllowStoredCredentials):
+ (WebCore::WebCoreSynchronousLoaderClient::isDone):
+ (WebCore::WebCoreSynchronousLoaderClient::data):
+ (WebCore::WebCoreSynchronousLoaderClient::WebCoreSynchronousLoaderClient):
+ (WebCore::willSendRequest):
+ (WebCore::didReceiveResponse):
+ (WebCore::didReceiveData):
+ (WebCore::shouldUseCredentialStorageCallback):
+ (WebCore::didFinishLoading):
+ (WebCore::didFail):
+ (WebCore::didReceiveChallenge):
+ (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
+ (WebCore::ResourceHandle::~ResourceHandle):
+ (WebCore::ResourceHandle::createCFURLConnection):
+ (WebCore::ResourceHandle::start):
+ (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
+ (WebCore::ResourceHandle::receivedCredential):
+ (WebCore::ResourceHandle::loadResourceSynchronously):
+ (WebCore::WebCoreSynchronousLoaderClient::willSendRequest):
+ (WebCore::WebCoreSynchronousLoaderClient::didReceiveResponse):
+ (WebCore::WebCoreSynchronousLoaderClient::didReceiveData):
+ (WebCore::WebCoreSynchronousLoaderClient::didFinishLoading):
+ (WebCore::WebCoreSynchronousLoaderClient::didFail):
+ (WebCore::WebCoreSynchronousLoaderClient::didReceiveAuthenticationChallenge):
+ (WebCore::WebCoreSynchronousLoaderClient::shouldUseCredentialStorage):
+ Same changes for CFNetwork version. Now it's a more direct copy/paste than before, some
+ day we'll share the code.
+
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::continueAfterContentPolicy):
+ * loader/appcache/ApplicationCacheGroup.cpp:
+ (WebCore::ApplicationCacheGroup::createResourceHandle):
+ (WebCore::ApplicationCacheGroup::didReceiveResponse):
+ (WebCore::ApplicationCacheGroup::didFinishLoading):
+ (WebCore::ApplicationCacheGroup::didFail):
+ (WebCore::ApplicationCacheGroup::didReceiveManifestResponse):
+ * loader/icon/IconLoader.cpp:
+ (WebCore::IconLoader::didReceiveResponse):
+ (WebCore::IconLoader::didFail):
+ (WebCore::IconLoader::didFinishLoading):
+ * platform/network/curl/ResourceHandleManager.cpp:
+ (WebCore::headerCallback):
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+ (WebCore::QNetworkReplyHandler::start):
+ * platform/network/qt/ResourceHandleQt.cpp:
+ (WebCore::ResourceHandle::start):
+ (WebCore::ResourceHandle::loadResourceSynchronously):
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ (WebCore::startHttp):
+ Updated for request() -> firstRequest renaming.
+
+2010-07-14 Marcus Bulach <bulach@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Code generator: ensure generated constants match their corresponding enums.
+ https://bugs.webkit.org/show_bug.cgi?id=42250
+
+ Specific interfaces can use DontCheckEnums attribute to avoid generating the compile-time check.
+
+ Tests: updated bindings tests. Generated code should compile.
+
+ * bindings/scripts/CodeGenerator.pm:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/scripts/test/CPP/WebDOMTestObj.h:
+ (WebDOMTestObj::):
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::):
+ (WebCore::JSTestObjPrototype::getOwnPropertySlot):
+ (WebCore::JSTestObjPrototype::getOwnPropertyDescriptor):
+ (WebCore::jsTestObjCONST_VALUE_0):
+ (WebCore::jsTestObjCONST_VALUE_1):
+ (WebCore::jsTestObjCONST_VALUE_2):
+ (WebCore::jsTestObjCONST_VALUE_4):
+ (WebCore::jsTestObjCONST_VALUE_8):
+ * bindings/scripts/test/JS/JSTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ * bindings/scripts/test/TestObj.idl:
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::):
+ (WebCore::ConfigureV8TestObjTemplate):
+ * css/WebKitCSSTransformValue.idl:
+ * dom/DOMCoreException.idl:
+ * dom/EventException.idl:
+ * dom/Node.idl:
+ * dom/OverflowEvent.idl:
+ * dom/RangeException.idl:
+ * html/FileError.idl:
+ * html/FileReader.idl:
+ * html/canvas/Float32Array.idl:
+ * html/canvas/Int16Array.idl:
+ * html/canvas/Int32Array.idl:
+ * html/canvas/Int8Array.idl:
+ * html/canvas/Uint16Array.idl:
+ * html/canvas/Uint32Array.idl:
+ * html/canvas/Uint8Array.idl:
+ * html/canvas/WebGLRenderingContext.idl:
+ * inspector/JavaScriptCallFrame.idl:
+ * loader/appcache/DOMApplicationCache.idl:
+ * storage/SQLException.idl:
+ * svg/SVGComponentTransferFunctionElement.idl:
+ * svg/SVGException.idl:
+ * svg/SVGFEBlendElement.idl:
+ * svg/SVGFEColorMatrixElement.idl:
+ * svg/SVGFECompositeElement.idl:
+ * svg/SVGFEConvolveMatrixElement.idl:
+ * svg/SVGFEDisplacementMapElement.idl:
+ * svg/SVGFEMorphologyElement.idl:
+ * svg/SVGFETurbulenceElement.idl:
+ * svg/SVGGradientElement.idl:
+ * xml/XMLHttpRequestException.idl:
+ * xml/XPathException.idl:
+
+2010-07-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Ojan Vafai.
+
+ Unbreak fast/canvas/gradient-add-second-start-end-stop.html
+
+ Assigning the same CanvasGradient or CanvasPattern to fillStyle
+ or strokeStyle may not be a no-op since the object could have been
+ modified since it was last set.
+
+ Regressed with <http://trac.webkit.org/changeset/63327>
+
+ * html/canvas/CanvasStyle.cpp:
+ (WebCore::operator==):
+
+2010-07-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ Canvas: Make assigning the same fillStyle or strokeStyle a fast no-op
+ https://bugs.webkit.org/show_bug.cgi?id=42267
+
+ Avoid calling into GraphicsContext when setting a style to its current value.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setStrokeStyle): Return early if the
+ new style is the same as the current one.
+ (WebCore::CanvasRenderingContext2D::setFillStyle): Same.
+ * html/canvas/CanvasStyle.cpp:
+ (WebCore::operator==): Added operator==(CanvasStyle, CanvasStyle)
+ * html/canvas/CanvasStyle.h:
+
+2010-07-14 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Implement Web Timing redirectStart, redirectEnd, redirectCount
+ https://bugs.webkit.org/show_bug.cgi?id=42018
+
+ Tests: http/tests/misc/webtiming-one-redirect.php
+ http/tests/misc/webtiming-two-redirects.php
+
+ * loader/FrameLoaderTypes.h:
+ (WebCore::FrameLoadTimeline::FrameLoadTimeline):
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::willSendRequest): This method is called for each request (including server redirects). fetchStart is updated to the current time on each invocation so that it represents fetching of the final document and doesn't include redirect time. For each redirect, redirectCount is incremented and redirectStart to redirectEnd measures the cumulative fetch time for all redirects.
+ * page/Navigation.cpp:
+ (WebCore::Navigation::redirectCount): http://dev.w3.org/2006/webapi/WebTiming/#nt-redirect-count
+ * page/Timing.cpp:
+ (WebCore::Timing::redirectStart): http://dev.w3.org/2006/webapi/WebTiming/#nt-redirect-start
+ (WebCore::Timing::redirectEnd): http://dev.w3.org/2006/webapi/WebTiming/#nt-redirect-end
+ * page/Timing.h:
+ * page/Timing.idl:
+
+2010-07-14 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Antonio Gomes.
+
+ Generate MathML files with CMake even if MathML is disabled. This
+ fixes EFL build after r63274.
+ https://bugs.webkit.org/show_bug.cgi?id=42263
+
+ No new functionality, so no new tests.
+
+ * CMakeLists.txt:
+
+2010-07-14 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Get rid of libWebCoreJS
+ https://bugs.webkit.org/show_bug.cgi?id=42083
+
+ Remove the need to build libWebCoreJS.
+
+ * GNUmakefile.am: List all auto-generated source files for libWebCoreJS
+ instead of relying on make to build libWebCoreJS. This is a more autotools-
+ -friendly approach.
+
+2010-07-14 Eric Carlson <eric.carlson@apple.com>
+
+ One more unreviewed build fix for r63319.
+
+ * html/TimeRanges.cpp:
+ (TimeRanges::nearest):
+
+2010-07-14 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Enable toggling of the "Inspect Element" mode from the browser
+ https://bugs.webkit.org/show_bug.cgi?id=42169
+
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel):
+ (WebInspector.ElementsPanel.prototype.handleShortcut):
+ (WebInspector.ElementsPanel.prototype.toggleSearchingForNode):
+ * inspector/front-end/inspector.js:
+ (WebInspector.toggleSearchingForNode):
+
+2010-07-14 Eric Carlson <eric.carlson@apple.com>
+
+ Unreviewed, build fix for r63319.
+
+ * html/TimeRanges.cpp:
+ (TimeRanges::nearest): Include math.h and use narrowPrecisionToFloat.
+
+2010-07-14 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Update media element's seeking logic
+ https://bugs.webkit.org/show_bug.cgi?id=42178
+ <rdar://problem/8185817>
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::seek): When asked to seek to an unbuffered time, seek to the
+ nearest time instead of generating an exception. Re-order the logic to match spec text.
+
+ * html/TimeRanges.cpp:
+ (TimeRanges::nearest): New, return the value closest to the specified time.
+ * html/TimeRanges.h:
+
+2010-07-14 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Rename DeviceOrientationController::onOrientationChange to didChangeDeviceOrientation
+ https://bugs.webkit.org/show_bug.cgi?id=42257
+
+ According to convention, we should avoid "on" in favor of "did" in function names.
+
+ * dom/DeviceOrientationController.cpp:
+ (WebCore::DeviceOrientationController::didChangeDeviceOrientation):
+ * dom/DeviceOrientationController.h:
+
+2010-07-14 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Kent Tamura.
+
+ Notify browser about popup being deleted. In EFL and BREW ports, the
+ WebCore::Popup object was being deleted leaving the popup in browser
+ alive. Popups can be deleted in two ways: either from browser to webcore or
+ from webcore to browser. The first path was ok. The problem was when the
+ user changed the page with a popup still opened. This would trigger the
+ second path and would cause WebCore::Popup to be deleted without
+ notifying browser.
+ https://bugs.webkit.org/show_bug.cgi?id=41877
+
+ No new functionality so no new tests.
+
+ * platform/brew/PopupMenuBrew.cpp:
+ (WebCore::PopupMenu::~PopupMenu): call hide() when object is
+ destroyed.
+ * platform/efl/PopupMenuEfl.cpp:
+ (WebCore::PopupMenu::~PopupMenu): ditto.
+
+2010-07-14 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Invoke speech recognition when user clicks on the speech button of input elements.
+ http://bugs.webkit.org/show_bug.cgi?id=42047
+
+ No new tests, the relevant LayoutTestController bindings will be added in a subsequent patch.
+
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::InputFieldSpeechButtonElement::InputFieldSpeechButtonElement):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler): Added click handling.
+ (WebCore::InputFieldSpeechButtonElement::speechInput):
+ (WebCore::InputFieldSpeechButtonElement::recordingComplete): Callback to indicate recording progress.
+ (WebCore::InputFieldSpeechButtonElement::setRecognitionResult): Callback to receive recognized text.
+ (WebCore::InputFieldSpeechButtonElement::detach):
+ * rendering/TextControlInnerElements.h:
+
+2010-07-14 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r63305.
+ http://trac.webkit.org/changeset/63305
+ https://bugs.webkit.org/show_bug.cgi?id=42256
+
+ "debugger-breakpoints-not-activated-on-reload.html fails on
+ GTK" (Requested by yurys on #webkit).
+
+ * inspector/front-end/ScriptView.js:
+ (WebInspector.ScriptView.prototype._addBreakpoint):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel):
+ (WebInspector.ScriptsPanel.prototype._resourceLoadingFinished):
+ (WebInspector.ScriptsPanel.prototype._breakpointAdded):
+ (WebInspector.ScriptsPanel.prototype._scriptOrResourceForURLAndLine):
+ (WebInspector.ScriptsPanel.prototype._showScriptOrResource):
+ (WebInspector.ScriptsPanel.prototype._toggleBreakpointsClicked):
+ * inspector/front-end/SourceView.js:
+ (WebInspector.SourceView.prototype._addBreakpoint):
+
+2010-07-14 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Provide implementation of DeviceOrientationController and hook into DOMWindow
+ https://bugs.webkit.org/show_bug.cgi?id=39588
+
+ Added DeviceOrientationController::addListener() and removeListener()
+ to start and stop the client and added calls from DomWindow. Implemented
+ DeviceOrientationController::onDeviceOrientationChange() to fire a
+ DeviceOrientationEvent on the window object.
+
+ No new tests yet, pending LayoutTestController methods for mock DeviceOrientation.
+
+ * dom/DeviceOrientationClient.h:
+ * dom/DeviceOrientationController.cpp:
+ (WebCore::DeviceOrientation::addListener):
+ (WebCore::DeviceOrientation::removeListener):
+ (WebCore::DeviceOrientation::removeAllListeners):
+ (WebCore::DeviceOrientationController::onDeviceOrientationChange):
+ * dom/DeviceOrientationController.h:
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::addEventListener):
+ (WebCore::DOMWindow::removeEventListener):
+ (WebCore::DOMWindow::removeAllEventListeners):
+
+2010-07-14 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: remove v8 debugger code that doesn't use ScriptDebugServer
+ https://bugs.webkit.org/show_bug.cgi?id=42164
+
+ * bindings/v8/ScriptDebugServer.cpp:
+ (WebCore::retrieveFrame):
+ (WebCore::ScriptDebugServer::addListener):
+ (WebCore::ScriptDebugServer::setBreakpoint):
+ (WebCore::ScriptDebugServer::removeBreakpoint):
+ (WebCore::ScriptDebugServer::clearBreakpoints):
+ (WebCore::ScriptDebugServer::setBreakpointsActivated):
+ (WebCore::ScriptDebugServer::pauseOnExceptionsState):
+ (WebCore::ScriptDebugServer::setPauseOnExceptionsState):
+ (WebCore::ScriptDebugServer::continueProgram):
+ (WebCore::ScriptDebugServer::stepIntoStatement):
+ (WebCore::ScriptDebugServer::stepOverStatement):
+ (WebCore::ScriptDebugServer::stepOutOfFunction):
+ (WebCore::ScriptDebugServer::editScriptSource):
+ (WebCore::ScriptDebugServer::handleV8DebugEvent):
+ * bindings/v8/ScriptDebugServer.h:
+
+2010-07-14 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ WebInspector: Clean-up InspectorBackend code. In the next changes
+ InspectorBackend content will be generated by scripts. As far as
+ generator is very simple thing all nontrivial function should be
+ moved to InspectorController and DOMAgent.
+ https://bugs.webkit.org/show_bug.cgi?id=42171
+
+ * bindings/js/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::pause):
+ * bindings/js/ScriptDebugServer.h:
+ (WebCore::ScriptDebugServer::activateBreakpoints):
+ (WebCore::ScriptDebugServer::deactivateBreakpoints):
+ * bindings/v8/ScriptDebugServer.h:
+ (WebCore::ScriptDebugServer::activateBreakpoints):
+ (WebCore::ScriptDebugServer::deactivateBreakpoints):
+ (WebCore::ScriptDebugServer::pause):
+ * inspector/Inspector.idl:
+ * inspector/InspectorBackend.cpp:
+ (WebCore::InspectorBackend::saveApplicationSettings):
+ (WebCore::InspectorBackend::saveSessionSettings):
+ (WebCore::InspectorBackend::enableSearchingForNode):
+ (WebCore::InspectorBackend::disableSearchingForNode):
+ (WebCore::InspectorBackend::enableMonitoringXHR):
+ (WebCore::InspectorBackend::disableMonitoringXHR):
+ (WebCore::InspectorBackend::getResourceContent):
+ (WebCore::InspectorBackend::reloadPage):
+ (WebCore::InspectorBackend::activateBreakpoints):
+ (WebCore::InspectorBackend::deactivateBreakpoints):
+ (WebCore::InspectorBackend::pause):
+ (WebCore::InspectorBackend::resume):
+ (WebCore::InspectorBackend::stepOverStatement):
+ (WebCore::InspectorBackend::stepIntoStatement):
+ (WebCore::InspectorBackend::stepOutOfFunction):
+ (WebCore::InspectorBackend::setPauseOnExceptionsState):
+ (WebCore::InspectorBackend::copyNode):
+ (WebCore::InspectorBackend::pushNodeByPathToFrontend):
+ (WebCore::InspectorBackend::highlightDOMNode):
+ (WebCore::InspectorBackend::hideDOMNodeHighlight):
+ * inspector/InspectorBackend.h:
+ * inspector/InspectorBackend.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::saveApplicationSettings):
+ (WebCore::InspectorController::saveSessionSettings):
+ (WebCore::InspectorController::highlightDOMNode):
+ (WebCore::InspectorController::resume):
+ (WebCore::InspectorController::setPauseOnExceptionsState):
+ (WebCore::InspectorController::getResourceContent):
+ (WebCore::InspectorController::reloadPage):
+ * inspector/InspectorController.h:
+ (WebCore::InspectorController::hideDOMNodeHighlight):
+ (WebCore::InspectorController::startProfiling):
+ (WebCore::InspectorController::stopProfiling):
+ (WebCore::InspectorController::enableSearchingForNode):
+ (WebCore::InspectorController::disableSearchingForNode):
+ (WebCore::InspectorController::enableMonitoringXHR):
+ (WebCore::InspectorController::disableMonitoringXHR):
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::copyNode):
+ (WebCore::InspectorDOMAgent::pushNodeByPathToFrontend):
+ * inspector/InspectorDOMAgent.h:
+ * inspector/front-end/InspectorBackendStub.js:
+ (.WebInspector.InspectorBackendStub.prototype.pause):
+ (.WebInspector.InspectorBackendStub.prototype.resume):
+ (.WebInspector.InspectorBackendStub.prototype.stepIntoStatement):
+ (.WebInspector.InspectorBackendStub.prototype.stepOutOfFunction):
+ (.WebInspector.InspectorBackendStub.prototype.stepOverStatement):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype._togglePause):
+ (WebInspector.ScriptsPanel.prototype._stepOverClicked):
+ (WebInspector.ScriptsPanel.prototype._stepIntoClicked):
+ (WebInspector.ScriptsPanel.prototype._stepOutClicked):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
+
+2010-07-14 Joone Hur <joone@kldp.org>
+
+ Reviewed by Jian Li.
+
+ [GTK] Enabling File Reader/Writer APIs
+ https://bugs.webkit.org/show_bug.cgi?id=40209
+
+ The layout test fast/files will be enabled after eventSender.beginDragWithFiles is implemented for GTK.
+
+ * platform/gtk/FileSystemGtk.cpp:
+ (WebCore::openFile): Added.
+ (WebCore::readFromFile): Added.
+
+2010-07-14 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Inconsistent LayoutRepainter usage in the SVG renderers
+ https://bugs.webkit.org/show_bug.cgi?id=42245
+
+ Unify LayoutRepainter usage in the SVG renders, as RenderBlock does it, always use:
+ LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
+ instead of including selfWillPaint / selfNeedsLayout checks. This improves layout test
+ performance by 8s on my machine with a debug build (from 76.72s -> 68.59s, averaged over 5 runs)
+
+ * rendering/RenderForeignObject.cpp:
+ (WebCore::RenderForeignObject::layout):
+ * rendering/RenderPath.cpp:
+ (WebCore::RenderPath::layout):
+ * rendering/RenderSVGContainer.cpp:
+ (WebCore::RenderSVGContainer::layout):
+ * rendering/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::layout):
+ * rendering/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::layout):
+ * rendering/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::layout):
+
+2010-07-14 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, build fix for r63300.
+
+ * rendering/RenderSVGResourceContainer.h:
+ (WebCore::RenderSVGResourceContainer::containsCyclicReference):
+
+2010-07-14 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: do not activate all breakpoints on page reload
+ https://bugs.webkit.org/show_bug.cgi?id=41461
+
+ Test: inspector/debugger-breakpoints-not-activated-on-reload.html
+
+ * inspector/front-end/ScriptView.js:
+ (WebInspector.ScriptView.prototype._addBreakpoint):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel):
+ (WebInspector.ScriptsPanel.prototype._breakpointAdded):
+ (WebInspector.ScriptsPanel.prototype.toggleBreakpointsClicked):
+ * inspector/front-end/SourceView.js:
+ (WebInspector.SourceView.prototype._addBreakpoint):
+
+2010-07-14 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: use OwnPtr to manage ConsoleMessages in InspectorController
+ https://bugs.webkit.org/show_bug.cgi?id=42243
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::~InspectorController):
+ (WebCore::InspectorController::addConsoleMessage):
+ (WebCore::InspectorController::clearConsoleMessages):
+ * inspector/InspectorController.h:
+ (WebCore::InspectorController::consoleMessages):
+
+2010-07-14 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Eric Seidel.
+
+ SVG patterns and masks should not be able to reference themselves
+ https://bugs.webkit.org/show_bug.cgi?id=32171
+
+ Don't apply pattern/mask resources, if they contain cyclic references. Gradients/Filters are not affected.
+ Clippers are already correcly handling this on their own, as well as markers (all which require subtle quirks, covered by existing tests).
+
+ Tests: svg/custom/recursive-filter.svg
+ svg/custom/recursive-gradient.svg
+ svg/custom/recursive-mask.svg
+ svg/custom/recursive-pattern.svg
+
+ * rendering/RenderSVGResourceContainer.h:
+ (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer): Stop using idForStyleResolution(), but use getIdAttribute(), no functional change though.
+ (WebCore::RenderSVGResourceContainer::idChanged): Ditto.
+ (WebCore::RenderSVGResourceContainer::childElementReferencesResource): To be implemented by classes inheriting from us. Defaults to false.
+ (WebCore::RenderSVGResourceContainer::containsCyclicReference): Check whether this resource contains contains a child which references ourselves.
+ * rendering/RenderSVGResourceMasker.cpp:
+ (WebCore::RenderSVGResourceMasker::childElementReferencesResource): Check whether the masker child specifies mask=".." with the same URI than ourselves.
+ (WebCore::RenderSVGResourceMasker::applyResource): Early exit if we contain a cylic reference.
+ * rendering/RenderSVGResourceMasker.h:
+ * rendering/RenderSVGResourcePattern.cpp:
+ (WebCore::RenderSVGResourcePattern::childElementReferencesResource): Check whether the masker child specifies fill=".." with the same URI than ourselves.
+ (WebCore::RenderSVGResourcePattern::applyResource): Early exit if we contain a cylic reference.
+ * rendering/RenderSVGResourcePattern.h:
+ * svg/SVGPaint.cpp:
+ (WebCore::SVGPaint::matchesTargetURI): Add new helper function comparing a SVGPaint URI with a given reference id.
+ * svg/SVGPaint.h:
+
+2010-07-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Selection dumping code should not dump body's offset in the document
+ https://bugs.webkit.org/show_bug.cgi?id=42238
+
+ This requires updating the results of many layout tests,
+ but has no functional change.
+
+ * rendering/RenderTreeAsText.cpp:
+ (WebCore::nodePosition):
+
+2010-07-14 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ <input type=number> UI: inner spin button layout
+ https://bugs.webkit.org/show_bug.cgi?id=41924
+
+ Add layout/event/style code for the inner spin button, which is
+ going to be used for Windows implementation.
+ No new tests because no ports implement the inner spin button yet.
+
+ * rendering/RenderTextControlSingleLine.cpp:
+ Introduce m_innerSpinButton.
+ (WebCore::RenderTextControlSingleLine::~RenderTextControlSingleLine):
+ Detach m_innerSpinButton.
+ (WebCore::RenderTextControlSingleLine::layout):
+ Set position and size of m_innerSpinButton.
+ (WebCore::RenderTextControlSingleLine::nodeAtPoint):
+ Handle m_innerSpinButton.
+ (WebCore::RenderTextControlSingleLine::forwardEvent):
+ Handle m_innerSpinButton.
+ (WebCore::RenderTextControlSingleLine::textBlockWidth):
+ Shorten the text block width by m_innerSpinButton width.
+ (WebCore::RenderTextControlSingleLine::preferredContentWidth):
+ Add m_innerSpinButton width.
+ (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded):
+ Handle m_innerSpinButton.
+ (WebCore::RenderTextControlSingleLine::createInnerSpinButtonStyle):
+ Make style for m_innerSpinButton with INNER_SPIN_BUTTON pseudo class.
+ * rendering/RenderTextControlSingleLine.h:
+
+2010-07-14 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ <input type=number> UI: Support disabled/readonly states
+ https://bugs.webkit.org/show_bug.cgi?id=38568
+
+ Implement isEnabledFormControl() and isReadOnlyFormControl() of
+ SpinButtonElement. They returns the states of the parent <input> element.
+ The existing isEnabledFormControl() had a bug. It didn't have 'const'
+ modifier.
+
+ Test: fast/forms/input-appearance-spinbutton-disabled-readonly.html
+
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::SpinButtonElement::defaultEventHandler):
+ - If the input element is disabled or read-only, don't process events.
+ - Protect 'input' object from destruction during focus().
+ - Fix a hit-test issue. We don't need to add renderBox()->y() because
+ 'local' is relative to the RenderBox.
+ - Some code cleanup
+ * rendering/TextControlInnerElements.h:
+ (WebCore::SpinButtonElement::isEnabledFormControl):
+ (WebCore::SpinButtonElement::isReadOnlyFormControl):
+
+2010-07-13 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Page flashes to mostly white towards the end of loading
+ https://bugs.webkit.org/show_bug.cgi?id=42230
+
+ We constrain the size of huge composited layers. When doing so, we
+ need to use the constained size to set the position as well
+ as the dimensions, to ensure the layer appears in the correct place.
+
+ Test: compositing/tiling/constrained-layer-size.html
+
+ * platform/graphics/mac/GraphicsLayerCA.mm:
+ (WebCore::GraphicsLayerCA::updateLayerPosition):
+
+2010-07-13 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Linux implementation of <input type=number> UI
+ https://bugs.webkit.org/show_bug.cgi?id=41925
+
+ - Move the code for scrollbar steppers from ScrollbarThemeChromiumLinux
+ to PlatformThemeChromiumGtk.
+ - Move the code for scrollbar colors from RenderThemeChromiumLinux
+ to PlatformThemeChromiumGtk.
+
+ * WebCore.gypi:
+ * platform/chromium/PlatformThemeChromiumGtk.cpp: Added.
+ (WebCore::PlatformThemeChromiumGtk::setScrollbarColors): Moved from RenderThemeChromiumLinux.
+ (WebCore::clamp): Moved from ScrollbarThemeChromiumLinux.
+ (WebCore::PlatformThemeChromiumGtk::saturateAndBrighten): ditto.
+ (WebCore::PlatformThemeChromiumGtk::outlineColor): ditto.
+ (WebCore::PlatformThemeChromiumGtk::paintArrowButton): ditto.
+ * platform/chromium/PlatformThemeChromiumGtk.h: Added.
+ * platform/chromium/ScrollbarThemeChromiumLinux.cpp:
+ (WebCore::ScrollbarThemeChromiumLinux::paintTrackPiece):
+ (WebCore::ScrollbarThemeChromiumLinux::paintButton):
+ Move the main part of the code to PlatformThemeChromiumGtk.
+ (WebCore::ScrollbarThemeChromiumLinux::paintThumb):
+ * rendering/RenderThemeChromiumLinux.cpp:
+ (WebCore::RenderThemeChromiumLinux::adjustInnerSpinButtonStyle): Added.
+ (WebCore::RenderThemeChromiumLinux::paintInnerSpinButton): Added.
+ * rendering/RenderThemeChromiumLinux.h:
+
+2010-07-13 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Darin Fisher
+
+ Implementing DatabaseSync::transaction() and DatabaseSync::changeVersion().
+ https://bugs.webkit.org/show_bug.cgi?id=40607
+
+ Tests: fast/workers/storage/change-version-handle-reuse-sync.html
+ fast/workers/storage/change-version-sync.html
+ fast/workers/storage/empty-statement-sync.html
+ fast/workers/storage/execute-sql-args-sync.html
+ fast/workers/storage/executesql-accepts-only-one-statement-sync.html
+ fast/workers/storage/multiple-transactions-on-different-handles-sync.html
+ fast/workers/storage/open-database-creation-callback-sync.html
+ fast/workers/storage/open-database-empty-version-sync.html
+ fast/workers/storage/open-database-inputs-sync.html
+ fast/workers/storage/open-database-set-empty-version-sync.html
+ fast/workers/storage/open-database-while-transaction-in-progress-sync.html
+ fast/workers/storage/sql-data-types-sync.html
+ fast/workers/storage/sql-exception-codes-sync.html
+ fast/workers/storage/test-authorizer-sync.html
+ fast/workers/storage/transaction-in-transaction-sync.html
+
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * storage/AbstractDatabase.cpp:
+ (WebCore::AbstractDatabase::maximumSize):
+ (WebCore::AbstractDatabase::incrementalVacuumIfNeeded):
+ * storage/AbstractDatabase.h:
+ (WebCore::AbstractDatabase::sqliteDatabase):
+ * storage/ChangeVersionWrapper.cpp:
+ (WebCore::ChangeVersionWrapper::performPreflight):
+ (WebCore::ChangeVersionWrapper::performPostflight):
+ * storage/Database.cpp:
+ (WebCore::Database::performGetTableNames):
+ * storage/Database.h:
+ * storage/DatabaseAuthorizer.cpp:
+ (WebCore::DatabaseAuthorizer::createVTable):
+ (WebCore::DatabaseAuthorizer::dropVTable):
+ * storage/DatabaseCallback.h:
+ * storage/DatabaseSync.cpp:
+ (WebCore::ChangeVersionPreflightStep::create):
+ (WebCore::ChangeVersionPreflightStep::performStep):
+ (WebCore::ChangeVersionPreflightStep::ChangeVersionPreflightStep):
+ (WebCore::ChangeVersionPostflightStep::create):
+ (WebCore::ChangeVersionPostflightStep::performStep):
+ (WebCore::ChangeVersionPostflightStep::ChangeVersionPostflightStep):
+ (WebCore::DatabaseSync::changeVersion):
+ (WebCore::DatabaseSync::transaction):
+ (WebCore::DatabaseSync::runTransaction):
+ * storage/DatabaseSync.h:
+ * storage/DatabaseTracker.cpp:
+ (WebCore::DatabaseTracker::getMaxSizeForDatabase):
+ * storage/SQLError.h:
+ * storage/SQLResultSet.cpp:
+ * storage/SQLResultSet.h:
+ * storage/SQLStatementCallback.h:
+ * storage/SQLStatementErrorCallback.h:
+ * storage/SQLStatementSync.cpp: Copied from WebCore/storage/SQLStatement.cpp.
+ (WebCore::SQLStatementSync::SQLStatementSync):
+ (WebCore::SQLStatementSync::execute):
+ * storage/SQLStatementSync.h: Added.
+ * storage/SQLTransaction.cpp:
+ (WebCore::SQLTransaction::runCurrentStatement):
+ (WebCore::SQLTransaction::deliverQuotaIncreaseCallback):
+ (WebCore::SQLTransaction::postflightAndCommit):
+ * storage/SQLTransaction.h:
+ * storage/SQLTransactionCallback.h:
+ * storage/SQLTransactionClient.cpp:
+ (WebCore::SQLTransactionClient::didCommitWriteTransaction):
+ (WebCore::SQLTransactionClient::didExecuteStatement):
+ (WebCore::SQLTransactionClient::didExceedQuota):
+ * storage/SQLTransactionClient.h:
+ * storage/SQLTransactionErrorCallback.h:
+ * storage/SQLTransactionSync.cpp:
+ (WebCore::transactionClient):
+ (WebCore::SQLTransactionSync::create):
+ (WebCore::SQLTransactionSync::SQLTransactionSync):
+ (WebCore::SQLTransactionSync::~SQLTransactionSync):
+ (WebCore::SQLTransactionSync::executeSQL):
+ (WebCore::SQLTransactionSync::begin):
+ (WebCore::SQLTransactionSync::execute):
+ (WebCore::SQLTransactionSync::commit):
+ (WebCore::SQLTransactionSync::rollback):
+ * storage/SQLTransactionSync.h:
+ (WebCore::SQLTransactionSync::SQLTransactionSyncOptionalStep::~SQLTransactionSyncOptionalStep):
+ * storage/SQLTransactionSyncCallback.h:
+ * storage/chromium/SQLTransactionClientChromium.cpp:
+ (WebCore::SQLTransactionClient::didCommitWriteTransaction):
+ (WebCore::SQLTransactionClient::didExecuteStatement):
+ (WebCore::SQLTransactionClient::didExceedQuota):
+
+2010-07-13 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r63162.
+ http://trac.webkit.org/changeset/63162
+ https://bugs.webkit.org/show_bug.cgi?id=42224
+
+ This is no longer needed (Requested by olliej_ on #webkit).
+
+ * bindings/v8/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+
+2010-07-13 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Fix my misreading of "clear to the last marker" in the HTML5 spec
+ https://bugs.webkit.org/show_bug.cgi?id=42199
+
+ * html/HTMLFormattingElementList.cpp:
+ (WebCore::HTMLFormattingElementList::clearToLastMarker):
+ * html/HTMLFormattingElementList.h:
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processBodyEndTagForInBody):
+ (WebCore::HTMLTreeBuilder::processEndOfFile):
+
+2010-07-13 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ ES5 requires BOMs to be treated as whitespace
+ https://bugs.webkit.org/show_bug.cgi?id=42218
+
+ Remove BOM handling logic from WebCore Script objects.
+
+ * bindings/js/StringSourceProvider.h:
+ (WebCore::StringSourceProvider::StringSourceProvider):
+ * loader/CachedScript.cpp:
+ (WebCore::CachedScript::CachedScript):
+ (WebCore::CachedScript::script):
+ * loader/CachedScript.h:
+
+2010-07-13 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ Canvas: rect(x,y,w,h) should move to (x,y) even if w=0 and h=0
+ https://bugs.webkit.org/show_bug.cgi?id=42211
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::rect):
+
+2010-07-13 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Show IDs and classnames in layer tree dumps
+ https://bugs.webkit.org/show_bug.cgi?id=42213
+
+ When dumping the layer tree via showLayerTree(), include id and class attributes for
+ ease of debugging.
+
+ No tests, since this is debug-only code.
+
+ * rendering/RenderLayer.cpp:
+ (showLayerTree):
+ * rendering/RenderTreeAsText.cpp:
+ (WebCore::RenderTreeAsText::writeRenderObject):
+ * rendering/RenderTreeAsText.h:
+ (WebCore::):
+
+2010-07-13 Simon Fraser <simon.fraser@apple.com>
+
+ Build fix: fix WebCore exports by editing the .in file, rather than the generated file.
+
+ * WebCore.exp.in:
+
+2010-07-13 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42216
+ ResourceRequest::doUpdateResourceRequest() crashes if client denied request
+
+ This is covered by many regression tests with patch for bug 42201 applied (because it makes
+ us also use this code path for sync requests, and those currently have more strict limitations).
+
+ * platform/network/cf/ResourceRequestCFNet.cpp:
+ (WebCore::ResourceRequest::doUpdateResourceRequest): Added a null check.
+
+2010-07-13 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Make our end tag in-foreign-content mode spec bug workarounds more closely match minefield
+ https://bugs.webkit.org/show_bug.cgi?id=42187
+
+ I do not expect these work-arounds to be permanent. Hixie has promised to
+ addresses the feedback to the parser sections of HTML5 soon.
+ I added these hacks to make our hacks more-closely match Minefield's hacks
+ and thus have us "pass" a few more html5lib runner tests.
+
+ We now pass all of the html5lib foreign content tests
+ (thus we'll likely need to write more).
+
+ Tested by html5lib/runner.html
+
+ * html/HTMLElementStack.cpp:
+ (WebCore::HTMLElementStack::contains):
+ * html/HTMLElementStack.h:
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processEndTag):
+
+2010-07-12 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Wire network times from ResourceLoadTiming to performance.timing
+ https://bugs.webkit.org/show_bug.cgi?id=41824
+
+ * page/Timing.cpp:
+ (WebCore::Timing::domainLookupStart): http://dev.w3.org/2006/webapi/WebTiming/#nt-domain-lookupstart
+ (WebCore::Timing::domainLookupEnd): http://dev.w3.org/2006/webapi/WebTiming/#nt-domain-lookupend
+ (WebCore::Timing::connectStart): http://dev.w3.org/2006/webapi/WebTiming/#nt-connect-start
+ (WebCore::Timing::connectEnd): http://dev.w3.org/2006/webapi/WebTiming/#nt-connect-end
+ (WebCore::Timing::requestStart): http://dev.w3.org/2006/webapi/WebTiming/#nt-request-start
+ (WebCore::Timing::requestEnd): http://dev.w3.org/2006/webapi/WebTiming/#nt-request-end
+ (WebCore::Timing::responseStart): http://dev.w3.org/2006/webapi/WebTiming/#nt-response-start
+ (WebCore::Timing::resourceLoadTiming):
+ * page/Timing.h:
+ * page/Timing.idl:
+
+2010-07-13 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add support for loading javascript: URLs
+ https://bugs.webkit.org/show_bug.cgi?id=42221
+
+ * WebCore.exp.in:
+ Export protocolIsJavaScript and ScriptValue::getString.
+
+2010-07-13 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add support for URL frame loading using NPN_GetURLNotify
+ https://bugs.webkit.org/show_bug.cgi?id=42192
+
+ * WebCore.exp.in:
+ Export ResourceRequestBase::setHTTPMethod and ResourceRequestBase::setURL.
+
+2010-07-04 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Darin Fisher.
+
+ Need to track texture completeness
+ https://bugs.webkit.org/show_bug.cgi?id=41381
+
+ Test: fast/canvas/webgl/texture-complete.html
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::WebGLRenderingContext): Init max texture level.
+ (WebCore::WebGLRenderingContext::bindTexture): Pass max texture level to setTarget().
+ (WebCore::WebGLRenderingContext::copyTexImage2D): Cache full texture info rather than partial.
+ (WebCore::WebGLRenderingContext::generateMipmap): Ditto.
+ (WebCore::WebGLRenderingContext::texImage2DBase): Ditto.
+ (WebCore::WebGLRenderingContext::validateTexFuncParameters): Also validate level.
+ * html/canvas/WebGLRenderingContext.h: Add max texture level.
+ * html/canvas/WebGLTexture.cpp: Update the class to fully cache texture information and track NPOT and COMPLETE states.
+ (WebCore::WebGLTexture::WebGLTexture):
+ (WebCore::WebGLTexture::setTarget): Check whether the texture is initialized or has been deleted.
+ (WebCore::WebGLTexture::setParameteri): Ditto.
+ (WebCore::WebGLTexture::setParameterf): Ditto.
+ (WebCore::WebGLTexture::setLevelInfo): Set texture info.
+ (WebCore::WebGLTexture::generateMipmapLevelInfo): Generate texture info for all levels after generateMipmaps() is called.
+ (WebCore::WebGLTexture::getInternalFormat): Return internal format on texture face 0 level 0.
+ (WebCore::WebGLTexture::isNPOT): Check whether the texture is initialized or has been deleted.
+ (WebCore::WebGLTexture::needToUseBlackTexture): Ditto.
+ (WebCore::WebGLTexture::_deleteObject):
+ (WebCore::WebGLTexture::mapTargetToIndex): Map target to index.
+ (WebCore::WebGLTexture::canGenerateMipmaps): Check whether Mipmaps can be generated.
+ (WebCore::WebGLTexture::computeLevelCount): Compute texture level count from width/height.
+ (WebCore::WebGLTexture::update): Update NPOT/COMPLETE states.
+ * html/canvas/WebGLTexture.h: Ditto.
+ (WebCore::WebGLTexture::LevelInfo::LevelInfo): Add data structure to fully cache texture info.
+ (WebCore::WebGLTexture::LevelInfo::setInfo): Set information.
+
+2010-07-13 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ Canvas: drawImage() with wrong 'image' argument type should always throw TypeError
+ https://bugs.webkit.org/show_bug.cgi?id=42160
+
+ Test: canvas/philip/tests/2d.drawImage.wrongtype.html
+
+ * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
+ (WebCore::JSCanvasRenderingContext2D::drawImage): Throw TypeError instead of
+ TYPE_MISMATCH_ERR if 'image' argument is not an image, canvas or video element.
+
+2010-07-13 Aaron Boodman <aa@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Don't reset per-document user style caches when user styles are updated in
+ Chromium.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42003
+
+ * page/PageGroup.cpp:
+ (WebCore::PageGroup::addUserStyleSheetToWorld):
+ (WebCore::PageGroup::removeUserStyleSheetFromWorld):
+ (WebCore::PageGroup::removeUserStyleSheetsFromWorld):
+ (WebCore::PageGroup::removeAllUserContent):
+ (WebCore::PageGroup::resetUserStyleCacheInAllFrames):
+ * page/PageGroup.h:
+
+2010-07-13 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ On Leopard, media element can't handle audio/mp4 MIME type in source tag
+ https://bugs.webkit.org/show_bug.cgi?id=29326
+
+ Test: media/media-can-play-mpeg-audio.html
+
+ * platform/MIMETypeRegistry.cpp:
+ (WebCore::TypeExtensionPair::): Add "audio/mp4", "m4a" to mappings table.
+
+2010-07-13 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Implement performance.timing.fetchStart
+ https://bugs.webkit.org/show_bug.cgi?id=41816
+
+ See: http://dev.w3.org/2006/webapi/WebTiming/#nt-fetch-start
+
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::willSendRequest): Record the fetchStart time for each request for the main resource. This means it is called for each server redirect, overwritting the previous value. In https://bugs.webkit.org/show_bug.cgi?id=42018, this will be modified such that if a previous value exists, it is stored as the redirect time.
+ * loader/FrameLoaderTypes.h:
+ (WebCore::FrameLoadTimeline::FrameLoadTimeline):
+ * page/Timing.cpp:
+ (WebCore::Timing::fetchStart):
+ * page/Timing.h:
+ * page/Timing.idl:
+
+2010-07-13 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Speech input plumbing in webcore
+ https://bugs.webkit.org/show_bug.cgi?id=41518
+
+ Adds the following:
+ - a SpeechInput class to be used by the speech enabled HTML elements
+ - a SpeechInputListener interface to be implemented by the speech enabled HTML elements
+ - a SpeechInputClient interface (defined in WebCore, implemented by WebKit) for WebCore to call into WebKit.
+ This is available as a member of WebCore::Page, set by the platforms which support speech input.
+ - a SpeechInputClientListener interface for WebCore to receive events from WebKit
+
+ No new tests, the relevant LayoutTestController bindings will be added in a subsequent patch.
+
+ * Android.mk:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * page/Page.cpp:
+ (WebCore::Page::Page):
+ * page/Page.h: Added SpeechInputClient member variable and associated methods.
+ (WebCore::Page::setSpeechInputClient):
+ (WebCore::Page::speechInputClient):
+ * page/SpeechInput.cpp: Added new class to provide speech API services to HTML elements.
+ (WebCore::SpeechInput::SpeechInput):
+ (WebCore::SpeechInput::recordingComplete):
+ (WebCore::SpeechInput::setRecognitionResult):
+ (WebCore::SpeechInput::startRecognition):
+ * page/SpeechInput.h: Added.
+ (WebCore::SpeechInput::~SpeechInput):
+ (WebCore::SpeechInput::client):
+ * page/SpeechInputListener.h: Added.
+ (WebCore::SpeechInputListener::~SpeechInputListener):
+ * page/SpeechInputClient.h: Added new interface implemented by WebKit to bubble up speech API requests to the embedder.
+ (WebCore::SpeechInputClient::~SpeechInputClient):
+ * page/SpeechInputClientListener.h: Added.
+ (WebCore::SpeechInputClientListener::~SpeechInputClientListener):
+
+2010-07-13 Richard Moore <rich@kde.org>, Robert Hogan <robert@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] MIME handling in qtwebkit network layer case-sensitivity
+
+ https://bugs.webkit.org/show_bug.cgi?id=28654
+
+ Like other platforms, Qt needs to convert MIME types to lower case
+ so they will be handled by WebCore.
+
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+ (WebCore::QNetworkReplyHandler::sendResponseIfNeeded):
+
+2010-07-13 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ REGRESSION(55056) debug builds ASSERT falsely on pages with animations
+ https://bugs.webkit.org/show_bug.cgi?id=42175
+
+ Revision 55065 added some repaint box precomputation and some debug ASSERT()ions
+ to ensure the precomputed values were valid. However, if animations are enabled and
+ not hardware accelerated, the repaint box dimensions become time-dependent and the
+ ASSERT()s can trigger. This can make it impossible to interactively debug pages
+ like google maps.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37048 is another example of an assertion
+ failing due to time dependent animation values.
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
+
+2010-07-13 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Darin Fisher.
+
+ Implement bufferData and bufferSubData with ArrayBuffer as input
+ https://bugs.webkit.org/show_bug.cgi?id=41884
+
+ Test: fast/canvas/webgl/buffer-data-array-buffer.html
+
+ * html/canvas/WebGLBuffer.cpp: Implement associateBufferData & associateBufferSubData with ArrayBuffer as input.
+ (WebCore::WebGLBuffer::associateBufferData):
+ (WebCore::WebGLBuffer::associateBufferSubData):
+ * html/canvas/WebGLBuffer.h: Ditto.
+ * html/canvas/WebGLRenderingContext.cpp: Implement bufferData and bufferSubData with ArrayBuffer as input.
+ (WebCore::WebGLRenderingContext::bufferData):
+ (WebCore::WebGLRenderingContext::bufferSubData):
+ * html/canvas/WebGLRenderingContext.h: Ditto.
+ * html/canvas/WebGLRenderingContext.idl: Ditto.
+ * platform/graphics/GraphicsContext3D.h: Ditto.
+ * platform/graphics/mac/GraphicsContext3DMac.mm: Ditto.
+ (WebCore::GraphicsContext3D::bufferData):
+ (WebCore::GraphicsContext3D::bufferSubData):
+
+2010-07-13 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Implement performance.timing.responseEnd
+ https://bugs.webkit.org/show_bug.cgi?id=42006
+
+ See: http://dev.w3.org/2006/webapi/WebTiming/#nt-response-end
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::finishedLoading):
+ * loader/FrameLoaderTypes.h:
+ (WebCore::FrameLoadTimeline::FrameLoadTimeline):
+ * page/Timing.cpp:
+ (WebCore::Timing::responseEnd):
+ * page/Timing.h:
+ * page/Timing.idl:
+
+2010-07-13 W. James MacLean <wjmaclean@chromium.org>
+
+ Reviewed by Darin Fisher
+
+ Bug 41962 Limit html canvas element dimensions to 32767 for Skia platform
+ https://bugs.webkit.org/show_bug.cgi?id=41962
+
+ Test: fast/canvas/canvas-skia-excessive-size.html
+
+ * WebCore/html/HTMLCanvasElement.cpp
+ (WebCore::HTMLCanvasElement::convertLogicalToDevice):
+
+2010-07-10 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Darin Fisher.
+
+ Need to emulate MAX_VARYING_VECTORS/MAX_FRAGMENT_UNIFORM_VECTORs/MAX_VERTEX_UNIFORM_VECTORS for glGet
+ https://bugs.webkit.org/show_bug.cgi?id=42032
+
+ * platform/graphics/mac/GraphicsContext3DMac.mm:
+ (WebCore::GraphicsContext3D::getIntegerv): Emulate the enums.
+
+2010-07-13 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] video playback position query flood when mouse over the video element
+ https://bugs.webkit.org/show_bug.cgi?id=35333
+
+ Don't trigger a position query only to know which play/pause
+ button to display. Instead use the media-control button display
+ type to select the image to paint.
+
+ * platform/gtk/RenderThemeGtk.cpp:
+ (WebCore::RenderThemeGtk::paintMediaPlayButton):
+
+2010-07-13 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r63192.
+ http://trac.webkit.org/changeset/63192
+ https://bugs.webkit.org/show_bug.cgi?id=42173
+
+ Broke fast/backgrounds/size/contain-and-cover.html (Requested
+ by kling on #webkit).
+
+ * manual-tests/css3-background-layer-count.html: Removed.
+ * rendering/style/FillLayer.cpp:
+ (WebCore::FillLayer::cullEmptyLayers):
+
+2010-07-13 Marcus Bulach <bulach@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Removes cycles caused by "m_this" members in a few IndexedDB classes.
+ https://bugs.webkit.org/show_bug.cgi?id=42161
+
+ Adds IDBAny::create for the various types.
+ No functionality change, just cleaning up.
+
+ * storage/IDBAny.cpp:
+ (WebCore::createIDBAny):
+ (WebCore::IDBAny::create):
+ * storage/IDBAny.h:
+ * storage/IDBDatabaseRequest.cpp:
+ (WebCore::IDBDatabaseRequest::IDBDatabaseRequest):
+ (WebCore::IDBDatabaseRequest::createObjectStore):
+ (WebCore::IDBDatabaseRequest::removeObjectStore):
+ * storage/IDBDatabaseRequest.h:
+ * storage/IDBKeyRange.cpp:
+ (WebCore::IDBKeyRange::IDBKeyRange):
+ * storage/IDBKeyRange.h:
+ (WebCore::IDBKeyRange::left):
+ (WebCore::IDBKeyRange::right):
+ * storage/IDBObjectStoreRequest.cpp:
+ (WebCore::IDBObjectStoreRequest::IDBObjectStoreRequest):
+ (WebCore::IDBObjectStoreRequest::get):
+ (WebCore::IDBObjectStoreRequest::add):
+ (WebCore::IDBObjectStoreRequest::put):
+ (WebCore::IDBObjectStoreRequest::remove):
+ (WebCore::IDBObjectStoreRequest::createIndex):
+ (WebCore::IDBObjectStoreRequest::removeIndex):
+ * storage/IDBObjectStoreRequest.h:
+ * storage/IndexedDatabaseRequest.cpp:
+ (WebCore::IndexedDatabaseRequest::IndexedDatabaseRequest):
+ (WebCore::IndexedDatabaseRequest::open):
+ * storage/IndexedDatabaseRequest.h:
+
+2010-07-13 Antti Koivisto <koivisto@iki.fi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Land the initial build system for WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=41604
+
+ The build is enabled by passing --qmakearg="CONFIG+=webkit2" to build-webkit
+
+ * WebCore.pri:
+ * WebCore.pro:
+
+2010-07-13 Leon Clarke <leonclarke@google.com>
+
+ Reviewed by Pavel Feldman.
+
+ Don't access objects after deleting them, following
+ the addition of link prefetching. Also remove a forward declaration
+ of the now-nonexistent CachedLinkPrefetch class.
+ https://bugs.webkit.org/show_bug.cgi?id=3652
+
+ No new tests. Correcting aspects of the prefetch change that shouldn't
+ have affected functionality.
+
+ * html/HTMLLinkElement.h:
+ * loader/loader.cpp:
+ (WebCore::Loader::Host::cancelPendingRequests):
+
+2010-07-13 Andras Becsi <abecsi@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix the case of a linker option to lowercase to be able to
+ cross compile QtWebKit for Windows on Linux.
+
+ No new tests needed.
+
+ * WebCore.pro:
+
+2010-07-12 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ WebInspector: Next iteration of Inspector code generator.
+ The InspectorFrontend2 was replaced by slightly modified version of
+ InspectorBackend file (Inspector.idl). At the end all the interface
+ between WebInspector and inspected page will be specified by this file
+ and generated by CodeGeneratorInspector (InspectorFrontend.cpp,
+ InspectorBackend.cpp and InspectorBackend.js).
+ https://bugs.webkit.org/show_bug.cgi?id=42104
+
+ * DerivedSources.make:
+ * GNUmakefile.am:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gyp/scripts/rule_binding.py:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/scripts/IDLParser.pm:
+ * bindings/scripts/IDLStructure.pm:
+ * bindings/scripts/generate-bindings.pl:
+ * inspector/CodeGeneratorInspector.pm:
+ * inspector/Inspector.idl: Added.
+ * inspector/InspectorCSSStore.cpp:
+ (WebCore::InspectorCSSStore::inspectorStyleSheet):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::connectFrontend):
+ (WebCore::InspectorController::startTimelineProfiler):
+ * inspector/InspectorController.h:
+ (WebCore::InspectorController::remoteInspectorFrontend):
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::InspectorDOMAgent):
+ * inspector/InspectorDOMAgent.h:
+ (WebCore::InspectorDOMAgent::create):
+ * inspector/InspectorFrontend2.idl: Removed.
+ * inspector/InspectorTimelineAgent.cpp:
+ (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
+ (WebCore::InspectorTimelineAgent::resetFrontendProxyObject):
+ * inspector/InspectorTimelineAgent.h:
+
+2010-07-12 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ DeviceOrientationEvent should use optional properties
+ https://bugs.webkit.org/show_bug.cgi?id=41607
+
+ This change adds a new DeviceOrientation class which takes care of which of the
+ optional properties are present. DeviceOrientationEvent owns an instance of
+ DeviceOrientation, rather than owning the properties directly.
+ DeviceOrientationEvent now requires custom bindings.
+
+ Test: fast/dom/DeviceOrientation/optional-event-properties.html
+
+ * Android.mk:
+ * Android.jscbindings.mk:
+ * Android.v8bindings.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSBindingsAllInOne.cpp:
+ * bindings/js/JSDeviceOrientationEventCustom.cpp: Added.
+ (WebCore::JSDeviceOrientationEvent::alpha):
+ (WebCore::JSDeviceOrientationEvent::beta):
+ (WebCore::JSDeviceOrientationEvent::gamma):
+ (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
+ * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp: Added.
+ (WebCore::V8DeviceOrientationEvent::alphaAccessorGetter):
+ (WebCore::V8DeviceOrientationEvent::betaAccessorGetter):
+ (WebCore::V8DeviceOrientationEvent::gammaAccessorGetter):
+ (WebCore::V8DeviceOrientationEvent::initDeviceOrientationEventCallback):
+ * dom/DeviceOrientation.cpp: Added.
+ * dom/DeviceOrientation.h: Added.
+ (WebCore::DeviceOrientation::create):
+ (WebCore::DeviceOrientation::canProvideAlpha):
+ (WebCore::DeviceOrientation::alpha):
+ (WebCore::DeviceOrientation::canProvideBeta):
+ (WebCore::DeviceOrientation::beta):
+ (WebCore::DeviceOrientation::canProvideGamma):
+ (WebCore::DeviceOrientation::gamma):
+ (WebCore::DeviceOrientation::DeviceOrientation):
+ * dom/DeviceOrientationEvent.cpp:
+ (WebCore::DeviceOrientationEvent::DeviceOrientationEvent):
+ (WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
+ * dom/DeviceOrientationEvent.h:
+ (WebCore::DeviceOrientationEvent::create):
+ (WebCore::DeviceOrientationEvent::orientation):
+ * dom/DeviceOrientationEvent.idl:
+
+2010-07-13 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Antti Koivisto.
+
+ CSS3 background: Number of layers should be determined by background-image element count
+ https://bugs.webkit.org/show_bug.cgi?id=41201
+
+ Change FillLayer culling logic to discard all layers
+ after the first one without an image set.
+
+ Manual test: css3-background-layer-count.html
+
+ * manual-tests/css3-background-layer-count.html: Added.
+ * rendering/style/FillLayer.cpp:
+ (WebCore::FillLayer::cullEmptyLayers):
+
+2010-07-07 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ Prevent assertion/duplicate loads for non-deferred subtitute-data loads
+
+ https://bugs.webkit.org/show_bug.cgi?id=30879
+
+ MainResourceLoader uses the member m_initialRequest to store requests for future
+ deferred loads. When doing the actual load in handleDataLoadNow(), we therefore
+ have to clear this request so that subsequent entries into the loader will not
+ start yet another load.
+
+ This can happen as a result of a PageGroupLoadDeferrer going out of scope when
+ returning from Chrome::runJavaScriptAlert(), which calls setDeferredLoading(false),
+ but only in the case of using both substitute-data and non-deferred main resource
+ load together. That's why two new DRT functions were added:
+
+ * queueLoadHTMLString()
+ * setDeferMainResourceLoad()
+
+ The change adds DRT hooks for Mac, Win and Qt for these two functions. For Mac
+ and Win the hook uses new SPI in WebDataSource. For Qt a new static member was
+ added to the FrameLoaderClientQt and accessed though DumpRenderTreeSupportQt.
+
+ Test: fast/loader/non-deferred-substitute-load.html
+
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::handleDataLoadNow):
+
+2010-07-13 Yoshiki Hayashi <yhayashi@google.com>
+
+ Reviewed by Kent Tamura.
+
+ Make sure correct Nodes are passed to childrenChanged so that
+ :last-child gets properly applied when fragment is inserted.
+ https://bugs.webkit.org/show_bug.cgi?id=37944
+
+ Test: fast/css/last-child-innerhtml.html
+
+ * dom/ContainerNode.cpp:
+ (WebCore::ContainerNode::replaceChild):
+ (WebCore::ContainerNode::appendChild):
+
+2010-07-13 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Kent Tamura.
+
+ InsertListCommand's modifyRange and doApply should be merged
+ https://bugs.webkit.org/show_bug.cgi?id=41403
+
+ Isolated the code in doApply to insert and remove lists for single paragraph into doApplyForSingleParagraph.
+ Merged the code in modifyRange into doApply and cleaned up.
+
+ No test is added since this is a clean up.
+
+ * editing/InsertListCommand.cpp:
+ (WebCore::InsertListCommand::InsertListCommand): m_forceCreateList is no longer initialized
+ (WebCore::InsertListCommand::doApply): Isolated the code to insert/remove lists in doApplyForSingleParagraph
+ (WebCore::InsertListCommand::doApplyForSingleParagraph): Insert/remove lists for single paragraph
+ * editing/InsertListCommand.h: Added doApplyForSingleParagraph and removed m_forceCreateList
+
+2010-07-12 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Fix typo in "close the cell" which caused assertion
+ https://bugs.webkit.org/show_bug.cgi?id=42138
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::closeTheCell):
+
+2010-07-12 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Fix line number handling in HTMLTreeBuilder to fix a zillion layout tests
+ https://bugs.webkit.org/show_bug.cgi?id=42143
+
+ Covered by a zillion layout tests.
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processEndTag):
+ (WebCore::HTMLTreeBuilder::processScriptStartTag):
+
+2010-07-12 Jay Civelli <jcivelli@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Adding right aligned text called labels to PopupMenus.
+ https://bugs.webkit.org/show_bug.cgi?id=41964
+
+ * platform/PopupMenuClient.h:
+ * platform/chromium/PopupMenuChromium.cpp:
+ (WebCore::PopupListBox::paintRow):
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::itemLabel):
+ * rendering/RenderMenuList.h:
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::itemLabel):
+ * rendering/RenderTextControlSingleLine.h:
+
+2010-07-12 Mihnea Ovidenea <mihnea@adobe.com>
+
+ Reviewed by Dirk Schulze.
+
+ [Cairo] Incorrect Test for Text Fill
+ https://bugs.webkit.org/show_bug.cgi?id=42123
+
+ Correct test used for text shadow. It currently checks for
+ equality with cTextFill. However, this test fails if the
+ text drawing mode is set to 'cTextFill | cTextStroke'. Fix
+ is to modify the test to be like other Cairo uses of the
+ text drawing mode, and check for the cTextFill bit being
+ set, not for equality with the bit.
+
+ * platform/graphics/cairo/FontCairo.cpp:
+ (WebCore::Font::drawGlyphs):
+
2010-07-12 Eric Seidel <eric@webkit.org>
Reviewed by Sam Weinig.
diff --git a/WebCore/Configurations/FeatureDefines.xcconfig b/WebCore/Configurations/FeatureDefines.xcconfig
index 9a3ec0b..4b363aa 100644
--- a/WebCore/Configurations/FeatureDefines.xcconfig
+++ b/WebCore/Configurations/FeatureDefines.xcconfig
@@ -34,7 +34,6 @@
ENABLE_LINK_PREFETCH = ;
ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
-ENABLE_3D_CANVAS_1050 = ENABLE_3D_CANVAS;
ENABLE_3D_CANVAS_1060 = ENABLE_3D_CANVAS;
ENABLE_3D_CANVAS_1070 = ENABLE_3D_CANVAS;
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index 8430024..7c53e86 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -471,11 +471,11 @@ DOM_CLASSES = \
XSLTProcessor \
#
-INSPECTOR_CLASSES = InspectorFrontend2
+INSPECTOR_CLASSES = Inspector
.PHONY : all
-JS_DOM_HEADERS=$(filter-out JSEventListener.h JSEventTarget.h,$(DOM_CLASSES:%=JS%.h) $(INSPECTOR_CLASSES:%=Remote%.h))
+JS_DOM_HEADERS=$(filter-out JSEventListener.h JSEventTarget.h,$(DOM_CLASSES:%=JS%.h) $(INSPECTOR_CLASSES:%=Remote%Frontend.h))
all : \
remove-stray-plugin-and-mime-type-files \
@@ -808,8 +808,8 @@ JS%.h : %.idl $(JS_BINDINGS_SCRIPTS)
INSPECTOR_GENERATOR_SCRIPTS = $(GENERATE_SCRIPTS) inspector/CodeGeneratorInspector.pm
-Remote%.h : %.idl $(INSPECTOR_GENERATOR_SCRIPTS)
- $(call generator_script, $(INSPECTOR_GENERATOR_SCRIPTS)) --outputDir . --defines "LANGUAGE_JAVASCRIPT" --generator Inspector $<
+Remote%Frontend.h : %.idl $(INSPECTOR_GENERATOR_SCRIPTS)
+ $(call generator_script, $(INSPECTOR_GENERATOR_SCRIPTS)) --outputDir . --defines "$(FEATURE_DEFINES) LANGUAGE_JAVASCRIPT" --generator Inspector $<
-include $(JS_DOM_HEADERS:.h=.dep)
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index e624b16..010c28c 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 278aa9b..2aac9a1 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -14,6 +14,7 @@ webcore_cppflags += \
-I$(srcdir)/WebKit/gtk/webkit \
-I$(srcdir)/WebCore \
-I$(srcdir)/WebCore/accessibility \
+ -I$(srcdir)/WebCore/bindings/generic \
-I$(srcdir)/WebCore/bindings/js \
-I$(srcdir)/WebCore/bindings/gobject \
-I$(srcdir)/WebCore/bridge \
@@ -98,248 +99,465 @@ webcore_built_sources += \
DerivedSources/WebCore/HTMLEntityNames.cpp \
DerivedSources/WebCore/HTMLNames.cpp \
DerivedSources/WebCore/HTMLNames.h \
+ DerivedSources/WebCore/JSAbstractWorker.cpp \
+ DerivedSources/WebCore/JSAbstractWorker.h \
+ DerivedSources/WebCore/JSArrayBuffer.cpp \
+ DerivedSources/WebCore/JSArrayBuffer.h \
+ DerivedSources/WebCore/JSArrayBufferView.cpp \
+ DerivedSources/WebCore/JSArrayBufferView.h \
+ DerivedSources/WebCore/JSAttr.cpp \
+ DerivedSources/WebCore/JSAttr.h \
+ DerivedSources/WebCore/JSBarInfo.cpp \
+ DerivedSources/WebCore/JSBarInfo.h \
+ DerivedSources/WebCore/JSBeforeLoadEvent.cpp \
+ DerivedSources/WebCore/JSBeforeLoadEvent.h \
+ DerivedSources/WebCore/JSBeforeProcessEvent.cpp \
+ DerivedSources/WebCore/JSBeforeProcessEvent.h \
+ DerivedSources/WebCore/JSBlobBuilder.cpp \
+ DerivedSources/WebCore/JSBlobBuilder.h \
+ DerivedSources/WebCore/JSBlob.cpp \
+ DerivedSources/WebCore/JSBlob.h \
+ DerivedSources/WebCore/JSCanvasGradient.cpp \
+ DerivedSources/WebCore/JSCanvasGradient.h \
+ DerivedSources/WebCore/JSCanvasPattern.cpp \
+ DerivedSources/WebCore/JSCanvasPattern.h \
+ DerivedSources/WebCore/JSCanvasRenderingContext2D.cpp \
+ DerivedSources/WebCore/JSCanvasRenderingContext2D.h \
+ DerivedSources/WebCore/JSCanvasRenderingContext.cpp \
+ DerivedSources/WebCore/JSCanvasRenderingContext.h \
+ DerivedSources/WebCore/JSCDATASection.cpp \
+ DerivedSources/WebCore/JSCDATASection.h \
+ DerivedSources/WebCore/JSCharacterData.cpp \
+ DerivedSources/WebCore/JSCharacterData.h \
+ DerivedSources/WebCore/JSClientRect.cpp \
+ DerivedSources/WebCore/JSClientRect.h \
+ DerivedSources/WebCore/JSClientRectList.cpp \
+ DerivedSources/WebCore/JSClientRectList.h \
+ DerivedSources/WebCore/JSClipboard.cpp \
+ DerivedSources/WebCore/JSClipboard.h \
+ DerivedSources/WebCore/JSComment.cpp \
+ DerivedSources/WebCore/JSComment.h \
+ DerivedSources/WebCore/JSCompositionEvent.cpp \
+ DerivedSources/WebCore/JSCompositionEvent.h \
+ DerivedSources/WebCore/JSConsole.cpp \
+ DerivedSources/WebCore/JSConsole.h \
+ DerivedSources/WebCore/JSCoordinates.cpp \
+ DerivedSources/WebCore/JSCoordinates.h \
+ DerivedSources/WebCore/JSCounter.cpp \
+ DerivedSources/WebCore/JSCounter.h \
+ DerivedSources/WebCore/JSCSSCharsetRule.cpp \
+ DerivedSources/WebCore/JSCSSCharsetRule.h \
+ DerivedSources/WebCore/JSCSSFontFaceRule.cpp \
+ DerivedSources/WebCore/JSCSSFontFaceRule.h \
+ DerivedSources/WebCore/JSCSSImportRule.cpp \
+ DerivedSources/WebCore/JSCSSImportRule.h \
+ DerivedSources/WebCore/JSCSSMediaRule.cpp \
+ DerivedSources/WebCore/JSCSSMediaRule.h \
+ DerivedSources/WebCore/JSCSSPageRule.cpp \
+ DerivedSources/WebCore/JSCSSPageRule.h \
+ DerivedSources/WebCore/JSCSSPrimitiveValue.cpp \
+ DerivedSources/WebCore/JSCSSPrimitiveValue.h \
+ DerivedSources/WebCore/JSCSSRule.cpp \
+ DerivedSources/WebCore/JSCSSRule.h \
+ DerivedSources/WebCore/JSCSSRuleList.cpp \
+ DerivedSources/WebCore/JSCSSRuleList.h \
+ DerivedSources/WebCore/JSCSSStyleDeclaration.cpp \
+ DerivedSources/WebCore/JSCSSStyleDeclaration.h \
+ DerivedSources/WebCore/JSCSSStyleRule.cpp \
+ DerivedSources/WebCore/JSCSSStyleRule.h \
+ DerivedSources/WebCore/JSCSSStyleSheet.cpp \
+ DerivedSources/WebCore/JSCSSStyleSheet.h \
+ DerivedSources/WebCore/JSCSSValue.cpp \
+ DerivedSources/WebCore/JSCSSValue.h \
+ DerivedSources/WebCore/JSCSSValueList.cpp \
+ DerivedSources/WebCore/JSCSSValueList.h \
+ DerivedSources/WebCore/JSCSSVariablesDeclaration.cpp \
+ DerivedSources/WebCore/JSCSSVariablesDeclaration.h \
+ DerivedSources/WebCore/JSCSSVariablesRule.cpp \
+ DerivedSources/WebCore/JSCSSVariablesRule.h \
+ DerivedSources/WebCore/JSCustomEvent.cpp \
+ DerivedSources/WebCore/JSCustomEvent.h \
+ DerivedSources/WebCore/JSDataGridColumn.cpp \
+ DerivedSources/WebCore/JSDataGridColumn.h \
+ DerivedSources/WebCore/JSDataGridColumnList.cpp \
+ DerivedSources/WebCore/JSDataGridColumnList.h \
+ DerivedSources/WebCore/JSDedicatedWorkerContext.cpp \
+ DerivedSources/WebCore/JSDedicatedWorkerContext.h \
+ DerivedSources/WebCore/JSDeviceOrientationEvent.cpp \
+ DerivedSources/WebCore/JSDeviceOrientationEvent.h \
+ DerivedSources/WebCore/JSDocument.cpp \
+ DerivedSources/WebCore/JSDocumentFragment.cpp \
+ DerivedSources/WebCore/JSDocumentFragment.h \
+ DerivedSources/WebCore/JSDocument.h \
+ DerivedSources/WebCore/JSDocumentType.cpp \
+ DerivedSources/WebCore/JSDocumentType.h \
+ DerivedSources/WebCore/JSDOMCoreException.cpp \
+ DerivedSources/WebCore/JSDOMCoreException.h \
+ DerivedSources/WebCore/JSDOMFormData.cpp \
+ DerivedSources/WebCore/JSDOMFormData.h \
+ DerivedSources/WebCore/JSDOMImplementation.cpp \
+ DerivedSources/WebCore/JSDOMImplementation.h \
+ DerivedSources/WebCore/JSDOMMimeTypeArray.cpp \
+ DerivedSources/WebCore/JSDOMMimeTypeArray.h \
+ DerivedSources/WebCore/JSDOMMimeType.cpp \
+ DerivedSources/WebCore/JSDOMMimeType.h \
+ DerivedSources/WebCore/JSDOMParser.cpp \
+ DerivedSources/WebCore/JSDOMParser.h \
+ DerivedSources/WebCore/JSDOMPluginArray.cpp \
+ DerivedSources/WebCore/JSDOMPluginArray.h \
+ DerivedSources/WebCore/JSDOMPlugin.cpp \
+ DerivedSources/WebCore/JSDOMPlugin.h \
+ DerivedSources/WebCore/JSDOMSelection.cpp \
+ DerivedSources/WebCore/JSDOMSelection.h \
+ DerivedSources/WebCore/JSDOMStringList.cpp \
+ DerivedSources/WebCore/JSDOMStringList.h \
+ DerivedSources/WebCore/JSDOMStringMap.cpp \
+ DerivedSources/WebCore/JSDOMStringMap.h \
+ DerivedSources/WebCore/JSDOMWindow.cpp \
+ DerivedSources/WebCore/JSDOMWindow.h \
+ DerivedSources/WebCore/JSElement.cpp \
+ DerivedSources/WebCore/JSElement.h \
+ DerivedSources/WebCore/JSEntity.cpp \
+ DerivedSources/WebCore/JSEntity.h \
+ DerivedSources/WebCore/JSEntityReference.cpp \
+ DerivedSources/WebCore/JSEntityReference.h \
+ DerivedSources/WebCore/JSErrorEvent.cpp \
+ DerivedSources/WebCore/JSErrorEvent.h \
+ DerivedSources/WebCore/JSEvent.cpp \
+ DerivedSources/WebCore/JSEventException.cpp \
+ DerivedSources/WebCore/JSEventException.h \
+ DerivedSources/WebCore/JSEvent.h \
+ DerivedSources/WebCore/JSEventSource.cpp \
+ DerivedSources/WebCore/JSEventSource.h \
+ DerivedSources/WebCore/JSFile.cpp \
+ DerivedSources/WebCore/JSFileError.cpp \
+ DerivedSources/WebCore/JSFileError.h \
+ DerivedSources/WebCore/JSFile.h \
+ DerivedSources/WebCore/JSFileList.cpp \
+ DerivedSources/WebCore/JSFileList.h \
+ DerivedSources/WebCore/JSFileReader.cpp \
+ DerivedSources/WebCore/JSFileReader.h \
+ DerivedSources/WebCore/JSFloat32Array.cpp \
+ DerivedSources/WebCore/JSFloat32Array.h \
+ DerivedSources/WebCore/JSGeolocation.cpp \
+ DerivedSources/WebCore/JSGeolocation.h \
+ DerivedSources/WebCore/JSGeoposition.cpp \
+ DerivedSources/WebCore/JSGeoposition.h \
+ DerivedSources/WebCore/JSHistory.cpp \
+ DerivedSources/WebCore/JSHistory.h \
+ DerivedSources/WebCore/JSHTMLAllCollection.cpp \
+ DerivedSources/WebCore/JSHTMLAllCollection.h \
+ DerivedSources/WebCore/JSHTMLAnchorElement.cpp \
+ DerivedSources/WebCore/JSHTMLAnchorElement.h \
+ DerivedSources/WebCore/JSHTMLAppletElement.cpp \
+ DerivedSources/WebCore/JSHTMLAppletElement.h \
+ DerivedSources/WebCore/JSHTMLAreaElement.cpp \
+ DerivedSources/WebCore/JSHTMLAreaElement.h \
+ DerivedSources/WebCore/JSHTMLAudioElement.cpp \
+ DerivedSources/WebCore/JSHTMLAudioElement.h \
+ DerivedSources/WebCore/JSHTMLBaseElement.cpp \
+ DerivedSources/WebCore/JSHTMLBaseElement.h \
+ DerivedSources/WebCore/JSHTMLBaseFontElement.cpp \
+ DerivedSources/WebCore/JSHTMLBaseFontElement.h \
+ DerivedSources/WebCore/JSHTMLBlockquoteElement.cpp \
+ DerivedSources/WebCore/JSHTMLBlockquoteElement.h \
+ DerivedSources/WebCore/JSHTMLBodyElement.cpp \
+ DerivedSources/WebCore/JSHTMLBodyElement.h \
+ DerivedSources/WebCore/JSHTMLBRElement.cpp \
+ DerivedSources/WebCore/JSHTMLBRElement.h \
+ DerivedSources/WebCore/JSHTMLButtonElement.cpp \
+ DerivedSources/WebCore/JSHTMLButtonElement.h \
+ DerivedSources/WebCore/JSHTMLCanvasElement.cpp \
+ DerivedSources/WebCore/JSHTMLCanvasElement.h \
+ DerivedSources/WebCore/JSHTMLCollection.cpp \
+ DerivedSources/WebCore/JSHTMLCollection.h \
+ DerivedSources/WebCore/JSHTMLDataGridCellElement.cpp \
+ DerivedSources/WebCore/JSHTMLDataGridCellElement.h \
+ DerivedSources/WebCore/JSHTMLDataGridColElement.cpp \
+ DerivedSources/WebCore/JSHTMLDataGridColElement.h \
+ DerivedSources/WebCore/JSHTMLDataGridElement.cpp \
+ DerivedSources/WebCore/JSHTMLDataGridElement.h \
+ DerivedSources/WebCore/JSHTMLDataGridRowElement.cpp \
+ DerivedSources/WebCore/JSHTMLDataGridRowElement.h \
+ DerivedSources/WebCore/JSHTMLDataListElement.cpp \
+ DerivedSources/WebCore/JSHTMLDataListElement.h \
+ DerivedSources/WebCore/JSHTMLDirectoryElement.cpp \
+ DerivedSources/WebCore/JSHTMLDirectoryElement.h \
+ DerivedSources/WebCore/JSHTMLDivElement.cpp \
+ DerivedSources/WebCore/JSHTMLDivElement.h \
+ DerivedSources/WebCore/JSHTMLDListElement.cpp \
+ DerivedSources/WebCore/JSHTMLDListElement.h \
+ DerivedSources/WebCore/JSHTMLDocument.cpp \
+ DerivedSources/WebCore/JSHTMLDocument.h \
+ DerivedSources/WebCore/JSHTMLElement.cpp \
+ DerivedSources/WebCore/JSHTMLElement.h \
DerivedSources/WebCore/JSHTMLElementWrapperFactory.cpp \
- DerivedSources/WebCore/RemoteInspectorFrontend2.cpp \
- DerivedSources/WebCore/RemoteInspectorFrontend2.h \
- DerivedSources/WebCore/UserAgentStyleSheets.h \
+ DerivedSources/WebCore/JSHTMLEmbedElement.cpp \
+ DerivedSources/WebCore/JSHTMLEmbedElement.h \
+ DerivedSources/WebCore/JSHTMLFieldSetElement.cpp \
+ DerivedSources/WebCore/JSHTMLFieldSetElement.h \
+ DerivedSources/WebCore/JSHTMLFontElement.cpp \
+ DerivedSources/WebCore/JSHTMLFontElement.h \
+ DerivedSources/WebCore/JSHTMLFormElement.cpp \
+ DerivedSources/WebCore/JSHTMLFormElement.h \
+ DerivedSources/WebCore/JSHTMLFrameElement.cpp \
+ DerivedSources/WebCore/JSHTMLFrameElement.h \
+ DerivedSources/WebCore/JSHTMLFrameSetElement.cpp \
+ DerivedSources/WebCore/JSHTMLFrameSetElement.h \
+ DerivedSources/WebCore/JSHTMLHeadElement.cpp \
+ DerivedSources/WebCore/JSHTMLHeadElement.h \
+ DerivedSources/WebCore/JSHTMLHeadingElement.cpp \
+ DerivedSources/WebCore/JSHTMLHeadingElement.h \
+ DerivedSources/WebCore/JSHTMLHRElement.cpp \
+ DerivedSources/WebCore/JSHTMLHRElement.h \
+ DerivedSources/WebCore/JSHTMLHtmlElement.cpp \
+ DerivedSources/WebCore/JSHTMLHtmlElement.h \
+ DerivedSources/WebCore/JSHTMLIFrameElement.cpp \
+ DerivedSources/WebCore/JSHTMLIFrameElement.h \
+ DerivedSources/WebCore/JSHTMLImageElement.cpp \
+ DerivedSources/WebCore/JSHTMLImageElement.h \
+ DerivedSources/WebCore/JSHTMLInputElement.cpp \
+ DerivedSources/WebCore/JSHTMLInputElement.h \
+ DerivedSources/WebCore/JSHTMLIsIndexElement.cpp \
+ DerivedSources/WebCore/JSHTMLIsIndexElement.h \
+ DerivedSources/WebCore/JSHTMLLabelElement.cpp \
+ DerivedSources/WebCore/JSHTMLLabelElement.h \
+ DerivedSources/WebCore/JSHTMLLegendElement.cpp \
+ DerivedSources/WebCore/JSHTMLLegendElement.h \
+ DerivedSources/WebCore/JSHTMLLIElement.cpp \
+ DerivedSources/WebCore/JSHTMLLIElement.h \
+ DerivedSources/WebCore/JSHTMLLinkElement.cpp \
+ DerivedSources/WebCore/JSHTMLLinkElement.h \
+ DerivedSources/WebCore/JSHTMLMapElement.cpp \
+ DerivedSources/WebCore/JSHTMLMapElement.h \
+ DerivedSources/WebCore/JSHTMLMarqueeElement.cpp \
+ DerivedSources/WebCore/JSHTMLMarqueeElement.h \
+ DerivedSources/WebCore/JSHTMLMediaElement.cpp \
+ DerivedSources/WebCore/JSHTMLMediaElement.h \
+ DerivedSources/WebCore/JSHTMLMenuElement.cpp \
+ DerivedSources/WebCore/JSHTMLMenuElement.h \
+ DerivedSources/WebCore/JSHTMLMetaElement.cpp \
+ DerivedSources/WebCore/JSHTMLMetaElement.h \
+ DerivedSources/WebCore/JSHTMLMeterElement.cpp \
+ DerivedSources/WebCore/JSHTMLMeterElement.h \
+ DerivedSources/WebCore/JSHTMLModElement.cpp \
+ DerivedSources/WebCore/JSHTMLModElement.h \
+ DerivedSources/WebCore/JSHTMLObjectElement.cpp \
+ DerivedSources/WebCore/JSHTMLObjectElement.h \
+ DerivedSources/WebCore/JSHTMLOListElement.cpp \
+ DerivedSources/WebCore/JSHTMLOListElement.h \
+ DerivedSources/WebCore/JSHTMLOptGroupElement.cpp \
+ DerivedSources/WebCore/JSHTMLOptGroupElement.h \
+ DerivedSources/WebCore/JSHTMLOptionElement.cpp \
+ DerivedSources/WebCore/JSHTMLOptionElement.h \
+ DerivedSources/WebCore/JSHTMLOptionsCollection.cpp \
+ DerivedSources/WebCore/JSHTMLOptionsCollection.h \
+ DerivedSources/WebCore/JSHTMLParagraphElement.cpp \
+ DerivedSources/WebCore/JSHTMLParagraphElement.h \
+ DerivedSources/WebCore/JSHTMLParamElement.cpp \
+ DerivedSources/WebCore/JSHTMLParamElement.h \
+ DerivedSources/WebCore/JSHTMLPreElement.cpp \
+ DerivedSources/WebCore/JSHTMLPreElement.h \
+ DerivedSources/WebCore/JSHTMLProgressElement.cpp \
+ DerivedSources/WebCore/JSHTMLProgressElement.h \
+ DerivedSources/WebCore/JSHTMLQuoteElement.cpp \
+ DerivedSources/WebCore/JSHTMLQuoteElement.h \
+ DerivedSources/WebCore/JSHTMLScriptElement.cpp \
+ DerivedSources/WebCore/JSHTMLScriptElement.h \
+ DerivedSources/WebCore/JSHTMLSelectElement.cpp \
+ DerivedSources/WebCore/JSHTMLSelectElement.h \
+ DerivedSources/WebCore/JSHTMLSourceElement.cpp \
+ DerivedSources/WebCore/JSHTMLSourceElement.h \
+ DerivedSources/WebCore/JSHTMLStyleElement.cpp \
+ DerivedSources/WebCore/JSHTMLStyleElement.h \
+ DerivedSources/WebCore/JSHTMLTableCaptionElement.cpp \
+ DerivedSources/WebCore/JSHTMLTableCaptionElement.h \
+ DerivedSources/WebCore/JSHTMLTableCellElement.cpp \
+ DerivedSources/WebCore/JSHTMLTableCellElement.h \
+ DerivedSources/WebCore/JSHTMLTableColElement.cpp \
+ DerivedSources/WebCore/JSHTMLTableColElement.h \
+ DerivedSources/WebCore/JSHTMLTableElement.cpp \
+ DerivedSources/WebCore/JSHTMLTableElement.h \
+ DerivedSources/WebCore/JSHTMLTableRowElement.cpp \
+ DerivedSources/WebCore/JSHTMLTableRowElement.h \
+ DerivedSources/WebCore/JSHTMLTableSectionElement.cpp \
+ DerivedSources/WebCore/JSHTMLTableSectionElement.h \
+ DerivedSources/WebCore/JSHTMLTextAreaElement.cpp \
+ DerivedSources/WebCore/JSHTMLTextAreaElement.h \
+ DerivedSources/WebCore/JSHTMLTitleElement.cpp \
+ DerivedSources/WebCore/JSHTMLTitleElement.h \
+ DerivedSources/WebCore/JSHTMLUListElement.cpp \
+ DerivedSources/WebCore/JSHTMLUListElement.h \
+ DerivedSources/WebCore/JSHTMLVideoElement.cpp \
+ DerivedSources/WebCore/JSHTMLVideoElement.h \
+ DerivedSources/WebCore/JSImageData.cpp \
+ DerivedSources/WebCore/JSImageData.h \
+ DerivedSources/WebCore/JSInjectedScriptHost.cpp \
+ DerivedSources/WebCore/JSInjectedScriptHost.h \
+ DerivedSources/WebCore/JSInspectorBackend.cpp \
+ DerivedSources/WebCore/JSInspectorBackend.h \
+ DerivedSources/WebCore/JSInspectorFrontendHost.cpp \
+ DerivedSources/WebCore/JSInspectorFrontendHost.h \
+ DerivedSources/WebCore/JSInt16Array.cpp \
+ DerivedSources/WebCore/JSInt16Array.h \
+ DerivedSources/WebCore/JSInt32Array.cpp \
+ DerivedSources/WebCore/JSInt32Array.h \
+ DerivedSources/WebCore/JSInt8Array.cpp \
+ DerivedSources/WebCore/JSInt8Array.h \
+ DerivedSources/WebCore/JSJavaScriptCallFrame.cpp \
+ DerivedSources/WebCore/JSJavaScriptCallFrame.h \
+ DerivedSources/WebCore/JSKeyboardEvent.cpp \
+ DerivedSources/WebCore/JSKeyboardEvent.h \
+ DerivedSources/WebCore/JSLocation.cpp \
+ DerivedSources/WebCore/JSLocation.h \
+ DerivedSources/WebCore/JSMediaError.cpp \
+ DerivedSources/WebCore/JSMediaError.h \
+ DerivedSources/WebCore/JSMediaList.cpp \
+ DerivedSources/WebCore/JSMediaList.h \
+ DerivedSources/WebCore/JSMemoryInfo.cpp \
+ DerivedSources/WebCore/JSMemoryInfo.h \
+ DerivedSources/WebCore/JSMessageChannel.cpp \
+ DerivedSources/WebCore/JSMessageChannel.h \
+ DerivedSources/WebCore/JSMessageEvent.cpp \
+ DerivedSources/WebCore/JSMessageEvent.h \
+ DerivedSources/WebCore/JSMessagePort.cpp \
+ DerivedSources/WebCore/JSMessagePort.h \
+ DerivedSources/WebCore/JSMouseEvent.cpp \
+ DerivedSources/WebCore/JSMouseEvent.h \
+ DerivedSources/WebCore/JSMutationEvent.cpp \
+ DerivedSources/WebCore/JSMutationEvent.h \
+ DerivedSources/WebCore/JSNamedNodeMap.cpp \
+ DerivedSources/WebCore/JSNamedNodeMap.h \
+ DerivedSources/WebCore/JSNavigation.cpp \
+ DerivedSources/WebCore/JSNavigation.h \
+ DerivedSources/WebCore/JSNavigator.cpp \
+ DerivedSources/WebCore/JSNavigator.h \
+ DerivedSources/WebCore/JSNode.cpp \
+ DerivedSources/WebCore/JSNodeFilter.cpp \
+ DerivedSources/WebCore/JSNodeFilter.h \
+ DerivedSources/WebCore/JSNode.h \
+ DerivedSources/WebCore/JSNodeIterator.cpp \
+ DerivedSources/WebCore/JSNodeIterator.h \
+ DerivedSources/WebCore/JSNodeList.cpp \
+ DerivedSources/WebCore/JSNodeList.h \
+ DerivedSources/WebCore/JSNotation.cpp \
+ DerivedSources/WebCore/JSNotation.h \
+ DerivedSources/WebCore/JSNotificationCenter.cpp \
+ DerivedSources/WebCore/JSNotificationCenter.h \
+ DerivedSources/WebCore/JSNotification.cpp \
+ DerivedSources/WebCore/JSNotification.h \
+ DerivedSources/WebCore/JSOverflowEvent.cpp \
+ DerivedSources/WebCore/JSOverflowEvent.h \
+ DerivedSources/WebCore/JSPageTransitionEvent.cpp \
+ DerivedSources/WebCore/JSPageTransitionEvent.h \
+ DerivedSources/WebCore/JSPerformance.cpp \
+ DerivedSources/WebCore/JSPerformance.h \
+ DerivedSources/WebCore/JSPopStateEvent.cpp \
+ DerivedSources/WebCore/JSPopStateEvent.h \
+ DerivedSources/WebCore/JSPositionError.cpp \
+ DerivedSources/WebCore/JSPositionError.h \
+ DerivedSources/WebCore/JSProcessingInstruction.cpp \
+ DerivedSources/WebCore/JSProcessingInstruction.h \
+ DerivedSources/WebCore/JSProgressEvent.cpp \
+ DerivedSources/WebCore/JSProgressEvent.h \
+ DerivedSources/WebCore/JSRange.cpp \
+ DerivedSources/WebCore/JSRangeException.cpp \
+ DerivedSources/WebCore/JSRangeException.h \
+ DerivedSources/WebCore/JSRange.h \
+ DerivedSources/WebCore/JSRect.cpp \
+ DerivedSources/WebCore/JSRect.h \
+ DerivedSources/WebCore/JSRGBColor.cpp \
+ DerivedSources/WebCore/JSRGBColor.h \
+ DerivedSources/WebCore/JSScreen.cpp \
+ DerivedSources/WebCore/JSScreen.h \
+ DerivedSources/WebCore/JSScriptProfile.cpp \
+ DerivedSources/WebCore/JSScriptProfile.h \
+ DerivedSources/WebCore/JSScriptProfileNode.cpp \
+ DerivedSources/WebCore/JSScriptProfileNode.h \
+ DerivedSources/WebCore/JSSharedWorkerContext.cpp \
+ DerivedSources/WebCore/JSSharedWorkerContext.h \
+ DerivedSources/WebCore/JSSharedWorker.cpp \
+ DerivedSources/WebCore/JSSharedWorker.h \
+ DerivedSources/WebCore/JSStyleMedia.cpp \
+ DerivedSources/WebCore/JSStyleMedia.h \
+ DerivedSources/WebCore/JSStyleSheet.cpp \
+ DerivedSources/WebCore/JSStyleSheet.h \
+ DerivedSources/WebCore/JSStyleSheetList.cpp \
+ DerivedSources/WebCore/JSStyleSheetList.h \
+ DerivedSources/WebCore/JSText.cpp \
+ DerivedSources/WebCore/JSTextEvent.cpp \
+ DerivedSources/WebCore/JSTextEvent.h \
+ DerivedSources/WebCore/JSText.h \
+ DerivedSources/WebCore/JSTextMetrics.cpp \
+ DerivedSources/WebCore/JSTextMetrics.h \
+ DerivedSources/WebCore/JSTiming.cpp \
+ DerivedSources/WebCore/JSTiming.h \
+ DerivedSources/WebCore/JSTouch.cpp \
+ DerivedSources/WebCore/JSTouchEvent.cpp \
+ DerivedSources/WebCore/JSTouchEvent.h \
+ DerivedSources/WebCore/JSTouch.h \
+ DerivedSources/WebCore/JSTouchList.cpp \
+ DerivedSources/WebCore/JSTouchList.h \
+ DerivedSources/WebCore/JSTreeWalker.cpp \
+ DerivedSources/WebCore/JSTreeWalker.h \
+ DerivedSources/WebCore/JSUIEvent.cpp \
+ DerivedSources/WebCore/JSUIEvent.h \
+ DerivedSources/WebCore/JSUint16Array.cpp \
+ DerivedSources/WebCore/JSUint16Array.h \
+ DerivedSources/WebCore/JSUint32Array.cpp \
+ DerivedSources/WebCore/JSUint32Array.h \
+ DerivedSources/WebCore/JSUint8Array.cpp \
+ DerivedSources/WebCore/JSUint8Array.h \
+ DerivedSources/WebCore/JSValidityState.cpp \
+ DerivedSources/WebCore/JSValidityState.h \
+ DerivedSources/WebCore/JSVoidCallback.cpp \
+ DerivedSources/WebCore/JSVoidCallback.h \
+ DerivedSources/WebCore/JSWebGLRenderingContext.cpp \
+ DerivedSources/WebCore/JSWebGLRenderingContext.h \
+ DerivedSources/WebCore/JSWebKitAnimationEvent.cpp \
+ DerivedSources/WebCore/JSWebKitAnimationEvent.h \
+ DerivedSources/WebCore/JSWebKitCSSKeyframeRule.cpp \
+ DerivedSources/WebCore/JSWebKitCSSKeyframeRule.h \
+ DerivedSources/WebCore/JSWebKitCSSKeyframesRule.cpp \
+ DerivedSources/WebCore/JSWebKitCSSKeyframesRule.h \
+ DerivedSources/WebCore/JSWebKitCSSMatrix.cpp \
+ DerivedSources/WebCore/JSWebKitCSSMatrix.h \
+ DerivedSources/WebCore/JSWebKitCSSTransformValue.cpp \
+ DerivedSources/WebCore/JSWebKitCSSTransformValue.h \
+ DerivedSources/WebCore/JSWebKitPoint.cpp \
+ DerivedSources/WebCore/JSWebKitPoint.h \
+ DerivedSources/WebCore/JSWebKitTransitionEvent.cpp \
+ DerivedSources/WebCore/JSWebKitTransitionEvent.h \
+ DerivedSources/WebCore/JSWheelEvent.cpp \
+ DerivedSources/WebCore/JSWheelEvent.h \
+ DerivedSources/WebCore/JSWorkerContext.cpp \
+ DerivedSources/WebCore/JSWorkerContext.h \
+ DerivedSources/WebCore/JSWorker.cpp \
+ DerivedSources/WebCore/JSWorker.h \
+ DerivedSources/WebCore/JSWorkerLocation.cpp \
+ DerivedSources/WebCore/JSWorkerLocation.h \
+ DerivedSources/WebCore/JSWorkerNavigator.cpp \
+ DerivedSources/WebCore/JSWorkerNavigator.h \
+ DerivedSources/WebCore/JSXMLHttpRequest.cpp \
+ DerivedSources/WebCore/JSXMLHttpRequestException.cpp \
+ DerivedSources/WebCore/JSXMLHttpRequestException.h \
+ DerivedSources/WebCore/JSXMLHttpRequest.h \
+ DerivedSources/WebCore/JSXMLHttpRequestProgressEvent.cpp \
+ DerivedSources/WebCore/JSXMLHttpRequestProgressEvent.h \
+ DerivedSources/WebCore/JSXMLHttpRequestUpload.cpp \
+ DerivedSources/WebCore/JSXMLHttpRequestUpload.h \
+ DerivedSources/WebCore/JSXMLSerializer.cpp \
+ DerivedSources/WebCore/JSXMLSerializer.h \
+ DerivedSources/WebCore/JSXSLTProcessor.cpp \
+ DerivedSources/WebCore/JSXSLTProcessor.h \
+ DerivedSources/WebCore/RemoteInspectorFrontend.cpp \
+ DerivedSources/WebCore/RemoteInspectorFrontend.h \
DerivedSources/WebCore/UserAgentStyleSheetsData.cpp \
- DerivedSources/WebCore/XMLNSNames.cpp \
- DerivedSources/WebCore/XMLNSNames.h \
+ DerivedSources/WebCore/UserAgentStyleSheets.h \
DerivedSources/WebCore/XMLNames.cpp \
- DerivedSources/WebCore/XMLNames.h
-
-IDL_BINDINGS += \
- WebCore/css/CSSCharsetRule.idl \
- WebCore/css/CSSFontFaceRule.idl \
- WebCore/css/CSSImportRule.idl \
- WebCore/css/CSSMediaRule.idl \
- WebCore/css/CSSPageRule.idl \
- WebCore/css/CSSPrimitiveValue.idl \
- WebCore/css/CSSRule.idl \
- WebCore/css/CSSRuleList.idl \
- WebCore/css/CSSStyleDeclaration.idl \
- WebCore/css/CSSStyleRule.idl \
- WebCore/css/CSSStyleSheet.idl \
- WebCore/css/CSSValue.idl \
- WebCore/css/CSSValueList.idl \
- WebCore/css/CSSVariablesDeclaration.idl \
- WebCore/css/CSSVariablesRule.idl \
- WebCore/css/Counter.idl \
- WebCore/css/MediaList.idl \
- WebCore/css/Rect.idl \
- WebCore/css/RGBColor.idl \
- WebCore/css/StyleMedia.idl \
- WebCore/css/StyleSheet.idl \
- WebCore/css/StyleSheetList.idl \
- WebCore/css/WebKitCSSKeyframeRule.idl \
- WebCore/css/WebKitCSSKeyframesRule.idl \
- WebCore/css/WebKitCSSMatrix.idl \
- WebCore/css/WebKitCSSTransformValue.idl \
- WebCore/dom/Attr.idl \
- WebCore/dom/BeforeLoadEvent.idl \
- WebCore/dom/BeforeProcessEvent.idl \
- WebCore/dom/CDATASection.idl \
- WebCore/dom/CharacterData.idl \
- WebCore/dom/ClientRect.idl \
- WebCore/dom/ClientRectList.idl \
- WebCore/dom/Clipboard.idl \
- WebCore/dom/Comment.idl \
- WebCore/dom/CompositionEvent.idl \
- WebCore/dom/CustomEvent.idl \
- WebCore/dom/DOMCoreException.idl \
- WebCore/dom/DOMImplementation.idl \
- WebCore/dom/DOMStringList.idl \
- WebCore/dom/DOMStringMap.idl \
- WebCore/dom/DeviceOrientationEvent.idl \
- WebCore/dom/Document.idl \
- WebCore/dom/DocumentFragment.idl \
- WebCore/dom/DocumentType.idl \
- WebCore/dom/Element.idl \
- WebCore/dom/Entity.idl \
- WebCore/dom/EntityReference.idl \
- WebCore/dom/ErrorEvent.idl \
- WebCore/dom/Event.idl \
- WebCore/dom/EventException.idl \
- WebCore/dom/KeyboardEvent.idl \
- WebCore/dom/MessageChannel.idl \
- WebCore/dom/MessageEvent.idl \
- WebCore/dom/MessagePort.idl \
- WebCore/dom/MouseEvent.idl \
- WebCore/dom/MutationEvent.idl \
- WebCore/dom/NamedNodeMap.idl \
- WebCore/dom/Node.idl \
- WebCore/dom/NodeFilter.idl \
- WebCore/dom/NodeIterator.idl \
- WebCore/dom/NodeList.idl \
- WebCore/dom/Notation.idl \
- WebCore/dom/OverflowEvent.idl \
- WebCore/dom/PageTransitionEvent.idl \
- WebCore/dom/PopStateEvent.idl \
- WebCore/dom/ProcessingInstruction.idl \
- WebCore/dom/ProgressEvent.idl \
- WebCore/dom/Range.idl \
- WebCore/dom/RangeException.idl \
- WebCore/dom/Text.idl \
- WebCore/dom/TextEvent.idl \
- WebCore/dom/Touch.idl \
- WebCore/dom/TouchEvent.idl \
- WebCore/dom/TouchList.idl \
- WebCore/dom/TreeWalker.idl \
- WebCore/dom/UIEvent.idl \
- WebCore/dom/WebKitAnimationEvent.idl \
- WebCore/dom/WebKitTransitionEvent.idl \
- WebCore/dom/WheelEvent.idl \
- WebCore/html/Blob.idl \
- WebCore/html/BlobBuilder.idl \
- WebCore/html/canvas/ArrayBufferView.idl \
- WebCore/html/canvas/ArrayBuffer.idl \
- WebCore/html/canvas/Int8Array.idl \
- WebCore/html/canvas/Float32Array.idl \
- WebCore/html/canvas/CanvasGradient.idl \
- WebCore/html/canvas/Int32Array.idl \
- WebCore/html/canvas/CanvasPattern.idl \
- WebCore/html/canvas/CanvasRenderingContext.idl \
- WebCore/html/canvas/CanvasRenderingContext2D.idl \
- WebCore/html/canvas/WebGLRenderingContext.idl \
- WebCore/html/canvas/Int16Array.idl \
- WebCore/html/canvas/Uint8Array.idl \
- WebCore/html/canvas/Uint32Array.idl \
- WebCore/html/canvas/Uint16Array.idl \
- WebCore/html/DataGridColumn.idl \
- WebCore/html/DataGridColumnList.idl \
- WebCore/html/DOMFormData.idl \
- WebCore/html/File.idl \
- WebCore/html/FileError.idl \
- WebCore/html/FileList.idl \
- WebCore/html/FileReader.idl \
- WebCore/html/HTMLAllCollection.idl \
- WebCore/html/HTMLAnchorElement.idl \
- WebCore/html/HTMLAppletElement.idl \
- WebCore/html/HTMLAreaElement.idl \
- WebCore/html/HTMLAudioElement.idl \
- WebCore/html/HTMLBRElement.idl \
- WebCore/html/HTMLBaseElement.idl \
- WebCore/html/HTMLBaseFontElement.idl \
- WebCore/html/HTMLBlockquoteElement.idl \
- WebCore/html/HTMLBodyElement.idl \
- WebCore/html/HTMLButtonElement.idl \
- WebCore/html/HTMLCanvasElement.idl \
- WebCore/html/HTMLCollection.idl \
- WebCore/html/HTMLDataGridElement.idl \
- WebCore/html/HTMLDataGridCellElement.idl \
- WebCore/html/HTMLDataGridColElement.idl \
- WebCore/html/HTMLDataGridRowElement.idl \
- WebCore/html/HTMLDataListElement.idl \
- WebCore/html/HTMLDListElement.idl \
- WebCore/html/HTMLDirectoryElement.idl \
- WebCore/html/HTMLDivElement.idl \
- WebCore/html/HTMLDocument.idl \
- WebCore/html/HTMLElement.idl \
- WebCore/html/HTMLEmbedElement.idl \
- WebCore/html/HTMLFieldSetElement.idl \
- WebCore/html/HTMLFontElement.idl \
- WebCore/html/HTMLFormElement.idl \
- WebCore/html/HTMLFrameElement.idl \
- WebCore/html/HTMLFrameSetElement.idl \
- WebCore/html/HTMLHRElement.idl \
- WebCore/html/HTMLHeadElement.idl \
- WebCore/html/HTMLHeadingElement.idl \
- WebCore/html/HTMLHtmlElement.idl \
- WebCore/html/HTMLIFrameElement.idl \
- WebCore/html/HTMLImageElement.idl \
- WebCore/html/HTMLInputElement.idl \
- WebCore/html/HTMLIsIndexElement.idl \
- WebCore/html/HTMLLIElement.idl \
- WebCore/html/HTMLLabelElement.idl \
- WebCore/html/HTMLLegendElement.idl \
- WebCore/html/HTMLLinkElement.idl \
- WebCore/html/HTMLMapElement.idl \
- WebCore/html/HTMLMarqueeElement.idl \
- WebCore/html/HTMLMediaElement.idl \
- WebCore/html/MediaError.idl \
- WebCore/html/HTMLMenuElement.idl \
- WebCore/html/HTMLMetaElement.idl \
- WebCore/html/HTMLMeterElement.idl \
- WebCore/html/HTMLModElement.idl \
- WebCore/html/HTMLOListElement.idl \
- WebCore/html/HTMLObjectElement.idl \
- WebCore/html/HTMLOptGroupElement.idl \
- WebCore/html/HTMLOptionElement.idl \
- WebCore/html/HTMLOptionsCollection.idl \
- WebCore/html/HTMLParagraphElement.idl \
- WebCore/html/HTMLParamElement.idl \
- WebCore/html/HTMLPreElement.idl \
- WebCore/html/HTMLProgressElement.idl \
- WebCore/html/HTMLQuoteElement.idl \
- WebCore/html/HTMLScriptElement.idl \
- WebCore/html/HTMLSelectElement.idl \
- WebCore/html/HTMLSourceElement.idl \
- WebCore/html/HTMLStyleElement.idl \
- WebCore/html/HTMLTableCaptionElement.idl \
- WebCore/html/HTMLTableCellElement.idl \
- WebCore/html/HTMLTableColElement.idl \
- WebCore/html/HTMLTableElement.idl \
- WebCore/html/HTMLTableRowElement.idl \
- WebCore/html/HTMLTableSectionElement.idl \
- WebCore/html/HTMLTextAreaElement.idl \
- WebCore/html/HTMLTitleElement.idl \
- WebCore/html/HTMLUListElement.idl \
- WebCore/html/HTMLVideoElement.idl \
- WebCore/html/ImageData.idl \
- WebCore/html/TextMetrics.idl \
- WebCore/html/ValidityState.idl \
- WebCore/html/VoidCallback.idl \
- WebCore/inspector/JavaScriptCallFrame.idl \
- WebCore/inspector/InjectedScriptHost.idl \
- WebCore/inspector/InspectorBackend.idl \
- WebCore/inspector/InspectorFrontendHost.idl \
- WebCore/inspector/ScriptProfile.idl \
- WebCore/inspector/ScriptProfileNode.idl \
- WebCore/notifications/Notification.idl \
- WebCore/notifications/NotificationCenter.idl \
- WebCore/page/BarInfo.idl \
- WebCore/page/Console.idl \
- WebCore/page/Coordinates.idl \
- WebCore/page/DOMSelection.idl \
- WebCore/page/DOMWindow.idl \
- WebCore/page/EventSource.idl \
- WebCore/page/Geolocation.idl \
- WebCore/page/Geoposition.idl \
- WebCore/page/History.idl \
- WebCore/page/Location.idl \
- WebCore/page/MemoryInfo.idl \
- WebCore/page/Navigation.idl \
- WebCore/page/Navigator.idl \
- WebCore/page/Performance.idl \
- WebCore/page/PositionError.idl \
- WebCore/page/Screen.idl \
- WebCore/page/Timing.idl \
- WebCore/page/WebKitPoint.idl \
- WebCore/page/WorkerNavigator.idl \
- WebCore/plugins/DOMMimeType.idl \
- WebCore/plugins/DOMMimeTypeArray.idl \
- WebCore/plugins/DOMPlugin.idl \
- WebCore/plugins/DOMPluginArray.idl \
- WebCore/workers/AbstractWorker.idl \
- WebCore/workers/DedicatedWorkerContext.idl \
- WebCore/workers/SharedWorker.idl \
- WebCore/workers/SharedWorkerContext.idl \
- WebCore/workers/Worker.idl \
- WebCore/workers/WorkerContext.idl \
- WebCore/workers/WorkerLocation.idl \
- WebCore/xml/DOMParser.idl \
- WebCore/xml/XMLHttpRequest.idl \
- WebCore/xml/XMLHttpRequestException.idl \
- WebCore/xml/XMLHttpRequestProgressEvent.idl \
- WebCore/xml/XMLHttpRequestUpload.idl \
- WebCore/xml/XMLSerializer.idl \
- WebCore/xml/XSLTProcessor.idl
-
-# This IDL file should not be used when calculating the source list
-# of libWebCoreJS, so we add it directly to the header list here, so
-# that it will be included in the distribution.
-noinst_HEADERS += \
- WebCore/inspector/InspectorFrontend2.idl
+ DerivedSources/WebCore/XMLNames.h \
+ DerivedSources/WebCore/XMLNSNames.cpp \
+ DerivedSources/WebCore/XMLNSNames.h
webcoregtk_dom_sources = \
WebCore/bindings/gobject/ConvertToUTF8String.cpp \
@@ -403,6 +621,8 @@ webcore_sources += \
WebCore/accessibility/AccessibilityTableHeaderContainer.h \
WebCore/accessibility/AccessibilityTableRow.cpp \
WebCore/accessibility/AccessibilityTableRow.h \
+ WebCore/bindings/generic/RuntimeEnabledFeatures.cpp \
+ WebCore/bindings/generic/RuntimeEnabledFeatures.h \
WebCore/bindings/js/CachedScriptSourceProvider.h \
WebCore/bindings/js/DOMObjectHashTableMap.cpp \
WebCore/bindings/js/DOMObjectHashTableMap.h \
@@ -452,6 +672,7 @@ webcore_sources += \
WebCore/bindings/js/JSDOMWindowShell.h \
WebCore/bindings/js/JSDOMWrapper.cpp \
WebCore/bindings/js/JSDOMWrapper.h \
+ WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp \
WebCore/bindings/js/JSDocumentCustom.cpp \
WebCore/bindings/js/JSElementCustom.cpp \
WebCore/bindings/js/JSEventCustom.cpp \
@@ -800,6 +1021,8 @@ webcore_sources += \
WebCore/dom/DatasetDOMStringMap.h \
WebCore/dom/DecodedDataDocumentParser.cpp \
WebCore/dom/DecodedDataDocumentParser.h \
+ WebCore/dom/DeviceOrientation.cpp \
+ WebCore/dom/DeviceOrientation.h \
WebCore/dom/DeviceOrientationClient.h \
WebCore/dom/DeviceOrientationController.cpp \
WebCore/dom/DeviceOrientationController.h \
@@ -1871,6 +2094,8 @@ webcore_sources += \
WebCore/platform/text/CharacterNames.h \
WebCore/platform/text/Hyphenation.cpp \
WebCore/platform/text/Hyphenation.h \
+ WebCore/platform/text/LineEnding.cpp \
+ WebCore/platform/text/LineEnding.h \
WebCore/platform/text/ParserUtilities.h \
WebCore/platform/text/PlatformString.h \
WebCore/platform/text/RegularExpression.cpp \
@@ -2422,12 +2647,13 @@ endif # END ENABLE_JAVASCRIPT_DEBUGGER
if ENABLE_OFFLINE_WEB_APPLICATIONS
FEATURE_DEFINES += ENABLE_OFFLINE_WEB_APPLICATIONS=1
-IDL_BINDINGS += \
- WebCore/loader/appcache/DOMApplicationCache.idl
-
webcore_cppflags += \
-DENABLE_OFFLINE_WEB_APPLICATIONS=1
+webcore_built_sources += \
+ DerivedSources/WebCore/JSDOMApplicationCache.cpp \
+ DerivedSources/WebCore/JSDOMApplicationCache.h
+
webcore_sources += \
WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp \
WebCore/loader/appcache/ApplicationCache.cpp \
@@ -2453,25 +2679,39 @@ endif # END ENABLE_OFFLINE_WEB_APPLICATIONS
if ENABLE_DATABASE
FEATURE_DEFINES += ENABLE_DATABASE=1
-IDL_BINDINGS += \
- WebCore/storage/Database.idl \
- WebCore/storage/DatabaseCallback.idl \
- WebCore/storage/DatabaseSync.idl \
- WebCore/storage/SQLError.idl \
- WebCore/storage/SQLException.idl \
- WebCore/storage/SQLResultSet.idl \
- WebCore/storage/SQLResultSetRowList.idl \
- WebCore/storage/SQLStatementCallback.idl \
- WebCore/storage/SQLStatementErrorCallback.idl \
- WebCore/storage/SQLTransaction.idl \
- WebCore/storage/SQLTransactionCallback.idl \
- WebCore/storage/SQLTransactionErrorCallback.idl \
- WebCore/storage/SQLTransactionSync.idl \
- WebCore/storage/SQLTransactionSyncCallback.idl
-
webcore_cppflags += \
-DENABLE_DATABASE=1
+webcore_built_sources += \
+ DerivedSources/WebCore/JSDatabase.cpp \
+ DerivedSources/WebCore/JSDatabase.h \
+ DerivedSources/WebCore/JSDatabaseCallback.cpp \
+ DerivedSources/WebCore/JSDatabaseCallback.h \
+ DerivedSources/WebCore/JSDatabaseSync.cpp \
+ DerivedSources/WebCore/JSDatabaseSync.h \
+ DerivedSources/WebCore/JSSQLError.cpp \
+ DerivedSources/WebCore/JSSQLError.h \
+ DerivedSources/WebCore/JSSQLException.cpp \
+ DerivedSources/WebCore/JSSQLException.h \
+ DerivedSources/WebCore/JSSQLResultSet.cpp \
+ DerivedSources/WebCore/JSSQLResultSet.h \
+ DerivedSources/WebCore/JSSQLResultSetRowList.cpp \
+ DerivedSources/WebCore/JSSQLResultSetRowList.h \
+ DerivedSources/WebCore/JSSQLStatementCallback.cpp \
+ DerivedSources/WebCore/JSSQLStatementCallback.h \
+ DerivedSources/WebCore/JSSQLStatementErrorCallback.cpp \
+ DerivedSources/WebCore/JSSQLStatementErrorCallback.h \
+ DerivedSources/WebCore/JSSQLTransaction.cpp \
+ DerivedSources/WebCore/JSSQLTransaction.h \
+ DerivedSources/WebCore/JSSQLTransactionCallback.cpp \
+ DerivedSources/WebCore/JSSQLTransactionCallback.h \
+ DerivedSources/WebCore/JSSQLTransactionErrorCallback.cpp \
+ DerivedSources/WebCore/JSSQLTransactionErrorCallback.h \
+ DerivedSources/WebCore/JSSQLTransactionSync.cpp \
+ DerivedSources/WebCore/JSSQLTransactionSync.h \
+ DerivedSources/WebCore/JSSQLTransactionSyncCallback.cpp \
+ DerivedSources/WebCore/JSSQLTransactionSyncCallback.h
+
webcore_sources += \
WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp \
WebCore/bindings/js/JSDatabaseCustom.cpp \
@@ -2524,6 +2764,8 @@ webcore_sources += \
WebCore/storage/SQLStatement.h \
WebCore/storage/SQLStatementCallback.h \
WebCore/storage/SQLStatementErrorCallback.h \
+ WebCore/storage/SQLStatementSync.cpp \
+ WebCore/storage/SQLStatementSync.h \
WebCore/storage/SQLTransaction.cpp \
WebCore/storage/SQLTransaction.h \
WebCore/storage/SQLTransactionCallback.h \
@@ -2572,23 +2814,35 @@ endif # ENABLE_EVENTSOURCE
if ENABLE_INDEXED_DATABASE
FEATURE_DEFINES += ENABLE_INDEXED_DATABASE=1
-IDL_BINDINGS += \
- WebCore/storage/IDBAny.idl \
- WebCore/storage/IDBDatabaseError.idl \
- WebCore/storage/IDBDatabaseException.idl \
- WebCore/storage/IDBDatabaseRequest.idl \
- WebCore/storage/IDBErrorEvent.idl \
- WebCore/storage/IDBEvent.idl \
- WebCore/storage/IDBIndexRequest.idl \
- WebCore/storage/IDBKeyRange.idl \
- WebCore/storage/IDBObjectStoreRequest.idl \
- WebCore/storage/IDBRequest.idl \
- WebCore/storage/IDBSuccessEvent.idl \
- WebCore/storage/IndexedDatabaseRequest.idl
-
webcore_cppflags += \
-DENABLE_INDEXED_DATABASE=1
+webcore_built_sources += \
+ DerivedSources/WebCore/JSIDBAny.cpp \
+ DerivedSources/WebCore/JSIDBAny.h \
+ DerivedSources/WebCore/JSIDBDatabaseError.cpp \
+ DerivedSources/WebCore/JSIDBDatabaseError.h \
+ DerivedSources/WebCore/JSIDBDatabaseException.cpp \
+ DerivedSources/WebCore/JSIDBDatabaseException.h \
+ DerivedSources/WebCore/JSIDBDatabaseRequest.cpp \
+ DerivedSources/WebCore/JSIDBDatabaseRequest.h \
+ DerivedSources/WebCore/JSIDBErrorEvent.cpp \
+ DerivedSources/WebCore/JSIDBErrorEvent.h \
+ DerivedSources/WebCore/JSIDBEvent.cpp \
+ DerivedSources/WebCore/JSIDBEvent.h \
+ DerivedSources/WebCore/JSIDBIndexRequest.cpp \
+ DerivedSources/WebCore/JSIDBIndexRequest.h \
+ DerivedSources/WebCore/JSIDBKeyRange.cpp \
+ DerivedSources/WebCore/JSIDBKeyRange.h \
+ DerivedSources/WebCore/JSIDBObjectStoreRequest.cpp \
+ DerivedSources/WebCore/JSIDBObjectStoreRequest.h \
+ DerivedSources/WebCore/JSIDBRequest.cpp \
+ DerivedSources/WebCore/JSIDBRequest.h \
+ DerivedSources/WebCore/JSIDBSuccessEvent.cpp \
+ DerivedSources/WebCore/JSIDBSuccessEvent.h \
+ DerivedSources/WebCore/JSIndexedDatabaseRequest.cpp \
+ DerivedSources/WebCore/JSIndexedDatabaseRequest.h
+
webcore_sources += \
WebCore/storage/IDBAny.cpp \
WebCore/storage/IDBAny.h \
@@ -2647,13 +2901,15 @@ endif # END ENABLE_DIRECTORY_UPLOAD
if ENABLE_DOM_STORAGE
FEATURE_DEFINES += ENABLE_DOM_STORAGE=1
-IDL_BINDINGS += \
- WebCore/storage/Storage.idl \
- WebCore/storage/StorageEvent.idl
-
webcore_cppflags += \
-DENABLE_DOM_STORAGE=1
+webcore_built_sources += \
+ DerivedSources/WebCore/JSStorage.cpp \
+ DerivedSources/WebCore/JSStorage.h \
+ DerivedSources/WebCore/JSStorageEvent.cpp \
+ DerivedSources/WebCore/JSStorageEvent.h
+
webcore_sources += \
WebCore/bindings/js/JSStorageCustom.cpp \
WebCore/storage/LocalStorageTask.cpp \
@@ -2689,6 +2945,13 @@ if ENABLE_INPUT_SPEECH
FEATURE_DEFINES += ENABLE_INPUT_SPEECH=1
webcore_cppflags += -DENABLE_INPUT_SPEECH=1
+webcore_sources += \
+ WebCore/page/SpeechInput.cpp \
+ WebCore/page/SpeechInput.h \
+ WebCore/page/SpeechInputClient.h \
+ WebCore/page/SpeechInputClientListener.h \
+ WebCore/page/SpeechInputListener.h
+
else
webcore_cppflags += -DENABLE_INPUT_SPEECH=0
@@ -2755,8 +3018,9 @@ if ENABLE_DEBUG
webcore_cppflags += -DGST_DISABLE_DEPRECATED
endif # END ENABLE_DEBUG
-IDL_BINDINGS += \
- WebCore/html/TimeRanges.idl
+webcore_built_sources += \
+ DerivedSources/WebCore/JSTimeRanges.cpp \
+ DerivedSources/WebCore/JSTimeRanges.h
webcore_sources += \
WebCore/bindings/js/JSAudioConstructor.cpp \
@@ -2845,16 +3109,19 @@ FEATURE_DEFINES += ENABLE_XPATH=1
webcore_cppflags += -DENABLE_XPATH=1
webcore_built_sources += \
+ DerivedSources/WebCore/JSXPathEvaluator.cpp \
+ DerivedSources/WebCore/JSXPathEvaluator.h \
+ DerivedSources/WebCore/JSXPathException.cpp \
+ DerivedSources/WebCore/JSXPathException.h \
+ DerivedSources/WebCore/JSXPathExpression.cpp \
+ DerivedSources/WebCore/JSXPathExpression.h \
+ DerivedSources/WebCore/JSXPathNSResolver.cpp \
+ DerivedSources/WebCore/JSXPathNSResolver.h \
+ DerivedSources/WebCore/JSXPathResult.cpp \
+ DerivedSources/WebCore/JSXPathResult.h \
DerivedSources/WebCore/XPathGrammar.cpp \
DerivedSources/WebCore/XPathGrammar.h
-IDL_BINDINGS += \
- WebCore/xml/XPathEvaluator.idl \
- WebCore/xml/XPathException.idl \
- WebCore/xml/XPathExpression.idl \
- WebCore/xml/XPathNSResolver.idl \
- WebCore/xml/XPathResult.idl
-
webcore_sources += \
WebCore/xml/NativeXPathNSResolver.cpp \
WebCore/xml/NativeXPathNSResolver.h \
@@ -3190,160 +3457,295 @@ FEATURE_DEFINES += ENABLE_SVG=1
WEBCORE_CSS_PROPERTY_NAMES += $(WebCore)/css/SVGCSSPropertyNames.in
WEBCORE_CSS_VALUE_KEYWORDS += $(WebCore)/css/SVGCSSValueKeywords.in
-IDL_BINDINGS += \
- WebCore/svg/ElementTimeControl.idl \
- WebCore/svg/SVGAElement.idl \
- WebCore/svg/SVGAltGlyphElement.idl \
- WebCore/svg/SVGAngle.idl \
- WebCore/svg/SVGAnimateColorElement.idl \
- WebCore/svg/SVGAnimateElement.idl \
- WebCore/svg/SVGAnimateTransformElement.idl \
- WebCore/svg/SVGAnimatedAngle.idl \
- WebCore/svg/SVGAnimatedBoolean.idl \
- WebCore/svg/SVGAnimatedEnumeration.idl \
- WebCore/svg/SVGAnimatedInteger.idl \
- WebCore/svg/SVGAnimatedLength.idl \
- WebCore/svg/SVGAnimatedLengthList.idl \
- WebCore/svg/SVGAnimatedNumber.idl \
- WebCore/svg/SVGAnimatedNumberList.idl \
- WebCore/svg/SVGAnimatedPathData.idl \
- WebCore/svg/SVGAnimatedPoints.idl \
- WebCore/svg/SVGAnimatedPreserveAspectRatio.idl \
- WebCore/svg/SVGAnimatedRect.idl \
- WebCore/svg/SVGAnimatedString.idl \
- WebCore/svg/SVGAnimatedTransformList.idl \
- WebCore/svg/SVGAnimationElement.idl \
- WebCore/svg/SVGCircleElement.idl \
- WebCore/svg/SVGClipPathElement.idl \
- WebCore/svg/SVGColor.idl \
- WebCore/svg/SVGComponentTransferFunctionElement.idl \
- WebCore/svg/SVGCursorElement.idl \
- WebCore/svg/SVGDefsElement.idl \
- WebCore/svg/SVGDescElement.idl \
- WebCore/svg/SVGDocument.idl \
- WebCore/svg/SVGElement.idl \
- WebCore/svg/SVGElementInstance.idl \
- WebCore/svg/SVGElementInstanceList.idl \
- WebCore/svg/SVGEllipseElement.idl \
- WebCore/svg/SVGException.idl \
- WebCore/svg/SVGExternalResourcesRequired.idl \
- WebCore/svg/SVGFEBlendElement.idl \
- WebCore/svg/SVGFEColorMatrixElement.idl \
- WebCore/svg/SVGFEComponentTransferElement.idl \
- WebCore/svg/SVGFECompositeElement.idl \
- WebCore/svg/SVGFEConvolveMatrixElement.idl \
- WebCore/svg/SVGFEDiffuseLightingElement.idl \
- WebCore/svg/SVGFEDisplacementMapElement.idl \
- WebCore/svg/SVGFEDistantLightElement.idl \
- WebCore/svg/SVGFEFloodElement.idl \
- WebCore/svg/SVGFEFuncAElement.idl \
- WebCore/svg/SVGFEFuncBElement.idl \
- WebCore/svg/SVGFEFuncGElement.idl \
- WebCore/svg/SVGFEFuncRElement.idl \
- WebCore/svg/SVGFEGaussianBlurElement.idl \
- WebCore/svg/SVGFEImageElement.idl \
- WebCore/svg/SVGFEMergeElement.idl \
- WebCore/svg/SVGFEMergeNodeElement.idl \
- WebCore/svg/SVGFEMorphologyElement.idl \
- WebCore/svg/SVGFEOffsetElement.idl \
- WebCore/svg/SVGFEPointLightElement.idl \
- WebCore/svg/SVGFESpecularLightingElement.idl \
- WebCore/svg/SVGFESpotLightElement.idl \
- WebCore/svg/SVGFETileElement.idl \
- WebCore/svg/SVGFETurbulenceElement.idl \
- WebCore/svg/SVGFilterElement.idl \
- WebCore/svg/SVGFilterPrimitiveStandardAttributes.idl \
- WebCore/svg/SVGFitToViewBox.idl \
- WebCore/svg/SVGFontElement.idl \
- WebCore/svg/SVGFontFaceElement.idl \
- WebCore/svg/SVGFontFaceFormatElement.idl \
- WebCore/svg/SVGFontFaceNameElement.idl \
- WebCore/svg/SVGFontFaceSrcElement.idl \
- WebCore/svg/SVGFontFaceUriElement.idl \
- WebCore/svg/SVGForeignObjectElement.idl \
- WebCore/svg/SVGGElement.idl \
- WebCore/svg/SVGGlyphElement.idl \
- WebCore/svg/SVGGradientElement.idl \
- WebCore/svg/SVGHKernElement.idl \
- WebCore/svg/SVGImageElement.idl \
- WebCore/svg/SVGLangSpace.idl \
- WebCore/svg/SVGLength.idl \
- WebCore/svg/SVGLengthList.idl \
- WebCore/svg/SVGLineElement.idl \
- WebCore/svg/SVGLinearGradientElement.idl \
- WebCore/svg/SVGLocatable.idl \
- WebCore/svg/SVGMarkerElement.idl \
- WebCore/svg/SVGMaskElement.idl \
- WebCore/svg/SVGMatrix.idl \
- WebCore/svg/SVGMetadataElement.idl \
- WebCore/svg/SVGMissingGlyphElement.idl \
- WebCore/svg/SVGNumber.idl \
- WebCore/svg/SVGNumberList.idl \
- WebCore/svg/SVGPaint.idl \
- WebCore/svg/SVGPathElement.idl \
- WebCore/svg/SVGPathSeg.idl \
- WebCore/svg/SVGPathSegArcAbs.idl \
- WebCore/svg/SVGPathSegArcRel.idl \
- WebCore/svg/SVGPathSegClosePath.idl \
- WebCore/svg/SVGPathSegCurvetoCubicAbs.idl \
- WebCore/svg/SVGPathSegCurvetoCubicRel.idl \
- WebCore/svg/SVGPathSegCurvetoCubicSmoothAbs.idl \
- WebCore/svg/SVGPathSegCurvetoCubicSmoothRel.idl \
- WebCore/svg/SVGPathSegCurvetoQuadraticAbs.idl \
- WebCore/svg/SVGPathSegCurvetoQuadraticRel.idl \
- WebCore/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl \
- WebCore/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl \
- WebCore/svg/SVGPathSegLinetoAbs.idl \
- WebCore/svg/SVGPathSegLinetoHorizontalAbs.idl \
- WebCore/svg/SVGPathSegLinetoHorizontalRel.idl \
- WebCore/svg/SVGPathSegLinetoRel.idl \
- WebCore/svg/SVGPathSegLinetoVerticalAbs.idl \
- WebCore/svg/SVGPathSegLinetoVerticalRel.idl \
- WebCore/svg/SVGPathSegList.idl \
- WebCore/svg/SVGPathSegMovetoAbs.idl \
- WebCore/svg/SVGPathSegMovetoRel.idl \
- WebCore/svg/SVGPatternElement.idl \
- WebCore/svg/SVGPoint.idl \
- WebCore/svg/SVGPointList.idl \
- WebCore/svg/SVGPolygonElement.idl \
- WebCore/svg/SVGPolylineElement.idl \
- WebCore/svg/SVGPreserveAspectRatio.idl \
- WebCore/svg/SVGRadialGradientElement.idl \
- WebCore/svg/SVGRect.idl \
- WebCore/svg/SVGRectElement.idl \
- WebCore/svg/SVGRenderingIntent.idl \
- WebCore/svg/SVGSVGElement.idl \
- WebCore/svg/SVGScriptElement.idl \
- WebCore/svg/SVGSetElement.idl \
- WebCore/svg/SVGStopElement.idl \
- WebCore/svg/SVGStringList.idl \
- WebCore/svg/SVGStylable.idl \
- WebCore/svg/SVGStyleElement.idl \
- WebCore/svg/SVGSwitchElement.idl \
- WebCore/svg/SVGSymbolElement.idl \
- WebCore/svg/SVGTRefElement.idl \
- WebCore/svg/SVGTSpanElement.idl \
- WebCore/svg/SVGTests.idl \
- WebCore/svg/SVGTextContentElement.idl \
- WebCore/svg/SVGTextElement.idl \
- WebCore/svg/SVGTextPathElement.idl \
- WebCore/svg/SVGTextPositioningElement.idl \
- WebCore/svg/SVGTitleElement.idl \
- WebCore/svg/SVGTransform.idl \
- WebCore/svg/SVGTransformList.idl \
- WebCore/svg/SVGTransformable.idl \
- WebCore/svg/SVGURIReference.idl \
- WebCore/svg/SVGUnitTypes.idl \
- WebCore/svg/SVGUseElement.idl \
- WebCore/svg/SVGViewElement.idl \
- WebCore/svg/SVGViewSpec.idl \
- WebCore/svg/SVGVKernElement.idl \
- WebCore/svg/SVGZoomAndPan.idl \
- WebCore/svg/SVGZoomEvent.idl
-
webcore_cppflags += \
-DENABLE_SVG=1
+webcore_built_sources += \
+ DerivedSources/WebCore/JSElementTimeControl.h \
+ DerivedSources/WebCore/JSSVGAElement.cpp \
+ DerivedSources/WebCore/JSSVGAElement.h \
+ DerivedSources/WebCore/JSSVGAltGlyphElement.cpp \
+ DerivedSources/WebCore/JSSVGAltGlyphElement.h \
+ DerivedSources/WebCore/JSSVGAngle.cpp \
+ DerivedSources/WebCore/JSSVGAngle.h \
+ DerivedSources/WebCore/JSSVGAnimateColorElement.cpp \
+ DerivedSources/WebCore/JSSVGAnimateColorElement.h \
+ DerivedSources/WebCore/JSSVGAnimatedAngle.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedAngle.h \
+ DerivedSources/WebCore/JSSVGAnimatedBoolean.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedBoolean.h \
+ DerivedSources/WebCore/JSSVGAnimatedEnumeration.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedEnumeration.h \
+ DerivedSources/WebCore/JSSVGAnimatedInteger.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedInteger.h \
+ DerivedSources/WebCore/JSSVGAnimatedLength.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedLength.h \
+ DerivedSources/WebCore/JSSVGAnimatedLengthList.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedLengthList.h \
+ DerivedSources/WebCore/JSSVGAnimatedNumber.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedNumber.h \
+ DerivedSources/WebCore/JSSVGAnimatedNumberList.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedNumberList.h \
+ DerivedSources/WebCore/JSSVGAnimatedPathData.h \
+ DerivedSources/WebCore/JSSVGAnimatedPoints.h \
+ DerivedSources/WebCore/JSSVGAnimatedPreserveAspectRatio.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedPreserveAspectRatio.h \
+ DerivedSources/WebCore/JSSVGAnimatedRect.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedRect.h \
+ DerivedSources/WebCore/JSSVGAnimatedString.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedString.h \
+ DerivedSources/WebCore/JSSVGAnimatedTransformList.cpp \
+ DerivedSources/WebCore/JSSVGAnimatedTransformList.h \
+ DerivedSources/WebCore/JSSVGAnimateElement.cpp \
+ DerivedSources/WebCore/JSSVGAnimateElement.h \
+ DerivedSources/WebCore/JSSVGAnimateTransformElement.cpp \
+ DerivedSources/WebCore/JSSVGAnimateTransformElement.h \
+ DerivedSources/WebCore/JSSVGAnimationElement.cpp \
+ DerivedSources/WebCore/JSSVGAnimationElement.h \
+ DerivedSources/WebCore/JSSVGCircleElement.cpp \
+ DerivedSources/WebCore/JSSVGCircleElement.h \
+ DerivedSources/WebCore/JSSVGClipPathElement.cpp \
+ DerivedSources/WebCore/JSSVGClipPathElement.h \
+ DerivedSources/WebCore/JSSVGColor.cpp \
+ DerivedSources/WebCore/JSSVGColor.h \
+ DerivedSources/WebCore/JSSVGComponentTransferFunctionElement.cpp \
+ DerivedSources/WebCore/JSSVGComponentTransferFunctionElement.h \
+ DerivedSources/WebCore/JSSVGCursorElement.cpp \
+ DerivedSources/WebCore/JSSVGCursorElement.h \
+ DerivedSources/WebCore/JSSVGDefsElement.cpp \
+ DerivedSources/WebCore/JSSVGDefsElement.h \
+ DerivedSources/WebCore/JSSVGDescElement.cpp \
+ DerivedSources/WebCore/JSSVGDescElement.h \
+ DerivedSources/WebCore/JSSVGDocument.cpp \
+ DerivedSources/WebCore/JSSVGDocument.h \
+ DerivedSources/WebCore/JSSVGElement.cpp \
+ DerivedSources/WebCore/JSSVGElement.h \
+ DerivedSources/WebCore/JSSVGElementInstance.cpp \
+ DerivedSources/WebCore/JSSVGElementInstance.h \
+ DerivedSources/WebCore/JSSVGElementInstanceList.cpp \
+ DerivedSources/WebCore/JSSVGElementInstanceList.h \
+ DerivedSources/WebCore/JSSVGEllipseElement.cpp \
+ DerivedSources/WebCore/JSSVGEllipseElement.h \
+ DerivedSources/WebCore/JSSVGException.cpp \
+ DerivedSources/WebCore/JSSVGException.h \
+ DerivedSources/WebCore/JSSVGExternalResourcesRequired.h \
+ DerivedSources/WebCore/JSSVGFEBlendElement.cpp \
+ DerivedSources/WebCore/JSSVGFEBlendElement.h \
+ DerivedSources/WebCore/JSSVGFEColorMatrixElement.cpp \
+ DerivedSources/WebCore/JSSVGFEColorMatrixElement.h \
+ DerivedSources/WebCore/JSSVGFEComponentTransferElement.cpp \
+ DerivedSources/WebCore/JSSVGFEComponentTransferElement.h \
+ DerivedSources/WebCore/JSSVGFECompositeElement.cpp \
+ DerivedSources/WebCore/JSSVGFECompositeElement.h \
+ DerivedSources/WebCore/JSSVGFEConvolveMatrixElement.cpp \
+ DerivedSources/WebCore/JSSVGFEConvolveMatrixElement.h \
+ DerivedSources/WebCore/JSSVGFEDiffuseLightingElement.cpp \
+ DerivedSources/WebCore/JSSVGFEDiffuseLightingElement.h \
+ DerivedSources/WebCore/JSSVGFEDisplacementMapElement.cpp \
+ DerivedSources/WebCore/JSSVGFEDisplacementMapElement.h \
+ DerivedSources/WebCore/JSSVGFEDistantLightElement.cpp \
+ DerivedSources/WebCore/JSSVGFEDistantLightElement.h \
+ DerivedSources/WebCore/JSSVGFEFloodElement.cpp \
+ DerivedSources/WebCore/JSSVGFEFloodElement.h \
+ DerivedSources/WebCore/JSSVGFEFuncAElement.cpp \
+ DerivedSources/WebCore/JSSVGFEFuncAElement.h \
+ DerivedSources/WebCore/JSSVGFEFuncBElement.cpp \
+ DerivedSources/WebCore/JSSVGFEFuncBElement.h \
+ DerivedSources/WebCore/JSSVGFEFuncGElement.cpp \
+ DerivedSources/WebCore/JSSVGFEFuncGElement.h \
+ DerivedSources/WebCore/JSSVGFEFuncRElement.cpp \
+ DerivedSources/WebCore/JSSVGFEFuncRElement.h \
+ DerivedSources/WebCore/JSSVGFEGaussianBlurElement.cpp \
+ DerivedSources/WebCore/JSSVGFEGaussianBlurElement.h \
+ DerivedSources/WebCore/JSSVGFEImageElement.cpp \
+ DerivedSources/WebCore/JSSVGFEImageElement.h \
+ DerivedSources/WebCore/JSSVGFEMergeElement.cpp \
+ DerivedSources/WebCore/JSSVGFEMergeElement.h \
+ DerivedSources/WebCore/JSSVGFEMergeNodeElement.cpp \
+ DerivedSources/WebCore/JSSVGFEMergeNodeElement.h \
+ DerivedSources/WebCore/JSSVGFEMorphologyElement.cpp \
+ DerivedSources/WebCore/JSSVGFEMorphologyElement.h \
+ DerivedSources/WebCore/JSSVGFEOffsetElement.cpp \
+ DerivedSources/WebCore/JSSVGFEOffsetElement.h \
+ DerivedSources/WebCore/JSSVGFEPointLightElement.cpp \
+ DerivedSources/WebCore/JSSVGFEPointLightElement.h \
+ DerivedSources/WebCore/JSSVGFESpecularLightingElement.cpp \
+ DerivedSources/WebCore/JSSVGFESpecularLightingElement.h \
+ DerivedSources/WebCore/JSSVGFESpotLightElement.cpp \
+ DerivedSources/WebCore/JSSVGFESpotLightElement.h \
+ DerivedSources/WebCore/JSSVGFETileElement.cpp \
+ DerivedSources/WebCore/JSSVGFETileElement.h \
+ DerivedSources/WebCore/JSSVGFETurbulenceElement.cpp \
+ DerivedSources/WebCore/JSSVGFETurbulenceElement.h \
+ DerivedSources/WebCore/JSSVGFilterElement.cpp \
+ DerivedSources/WebCore/JSSVGFilterElement.h \
+ DerivedSources/WebCore/JSSVGFilterPrimitiveStandardAttributes.h \
+ DerivedSources/WebCore/JSSVGFitToViewBox.h \
+ DerivedSources/WebCore/JSSVGFontElement.cpp \
+ DerivedSources/WebCore/JSSVGFontElement.h \
+ DerivedSources/WebCore/JSSVGFontFaceElement.cpp \
+ DerivedSources/WebCore/JSSVGFontFaceElement.h \
+ DerivedSources/WebCore/JSSVGFontFaceFormatElement.cpp \
+ DerivedSources/WebCore/JSSVGFontFaceFormatElement.h \
+ DerivedSources/WebCore/JSSVGFontFaceNameElement.cpp \
+ DerivedSources/WebCore/JSSVGFontFaceNameElement.h \
+ DerivedSources/WebCore/JSSVGFontFaceSrcElement.cpp \
+ DerivedSources/WebCore/JSSVGFontFaceSrcElement.h \
+ DerivedSources/WebCore/JSSVGFontFaceUriElement.cpp \
+ DerivedSources/WebCore/JSSVGFontFaceUriElement.h \
+ DerivedSources/WebCore/JSSVGForeignObjectElement.cpp \
+ DerivedSources/WebCore/JSSVGForeignObjectElement.h \
+ DerivedSources/WebCore/JSSVGGElement.cpp \
+ DerivedSources/WebCore/JSSVGGElement.h \
+ DerivedSources/WebCore/JSSVGGlyphElement.cpp \
+ DerivedSources/WebCore/JSSVGGlyphElement.h \
+ DerivedSources/WebCore/JSSVGGradientElement.cpp \
+ DerivedSources/WebCore/JSSVGGradientElement.h \
+ DerivedSources/WebCore/JSSVGHKernElement.cpp \
+ DerivedSources/WebCore/JSSVGHKernElement.h \
+ DerivedSources/WebCore/JSSVGImageElement.cpp \
+ DerivedSources/WebCore/JSSVGImageElement.h \
+ DerivedSources/WebCore/JSSVGLangSpace.h \
+ DerivedSources/WebCore/JSSVGLength.cpp \
+ DerivedSources/WebCore/JSSVGLength.h \
+ DerivedSources/WebCore/JSSVGLengthList.cpp \
+ DerivedSources/WebCore/JSSVGLengthList.h \
+ DerivedSources/WebCore/JSSVGLinearGradientElement.cpp \
+ DerivedSources/WebCore/JSSVGLinearGradientElement.h \
+ DerivedSources/WebCore/JSSVGLineElement.cpp \
+ DerivedSources/WebCore/JSSVGLineElement.h \
+ DerivedSources/WebCore/JSSVGLocatable.h \
+ DerivedSources/WebCore/JSSVGMarkerElement.cpp \
+ DerivedSources/WebCore/JSSVGMarkerElement.h \
+ DerivedSources/WebCore/JSSVGMaskElement.cpp \
+ DerivedSources/WebCore/JSSVGMaskElement.h \
+ DerivedSources/WebCore/JSSVGMatrix.cpp \
+ DerivedSources/WebCore/JSSVGMatrix.h \
+ DerivedSources/WebCore/JSSVGMetadataElement.cpp \
+ DerivedSources/WebCore/JSSVGMetadataElement.h \
+ DerivedSources/WebCore/JSSVGMissingGlyphElement.cpp \
+ DerivedSources/WebCore/JSSVGMissingGlyphElement.h \
+ DerivedSources/WebCore/JSSVGNumber.cpp \
+ DerivedSources/WebCore/JSSVGNumber.h \
+ DerivedSources/WebCore/JSSVGNumberList.cpp \
+ DerivedSources/WebCore/JSSVGNumberList.h \
+ DerivedSources/WebCore/JSSVGPaint.cpp \
+ DerivedSources/WebCore/JSSVGPaint.h \
+ DerivedSources/WebCore/JSSVGPathElement.cpp \
+ DerivedSources/WebCore/JSSVGPathElement.h \
+ DerivedSources/WebCore/JSSVGPathSegArcAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegArcAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegArcRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegArcRel.h \
+ DerivedSources/WebCore/JSSVGPathSegClosePath.cpp \
+ DerivedSources/WebCore/JSSVGPathSegClosePath.h \
+ DerivedSources/WebCore/JSSVGPathSeg.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicRel.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicSmoothAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicSmoothAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicSmoothRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoCubicSmoothRel.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticRel.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticSmoothAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticSmoothAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticSmoothRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegCurvetoQuadraticSmoothRel.h \
+ DerivedSources/WebCore/JSSVGPathSeg.h \
+ DerivedSources/WebCore/JSSVGPathSegLinetoAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegLinetoAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegLinetoHorizontalAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegLinetoHorizontalAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegLinetoHorizontalRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegLinetoHorizontalRel.h \
+ DerivedSources/WebCore/JSSVGPathSegLinetoRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegLinetoRel.h \
+ DerivedSources/WebCore/JSSVGPathSegLinetoVerticalAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegLinetoVerticalAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegLinetoVerticalRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegLinetoVerticalRel.h \
+ DerivedSources/WebCore/JSSVGPathSegList.cpp \
+ DerivedSources/WebCore/JSSVGPathSegList.h \
+ DerivedSources/WebCore/JSSVGPathSegMovetoAbs.cpp \
+ DerivedSources/WebCore/JSSVGPathSegMovetoAbs.h \
+ DerivedSources/WebCore/JSSVGPathSegMovetoRel.cpp \
+ DerivedSources/WebCore/JSSVGPathSegMovetoRel.h \
+ DerivedSources/WebCore/JSSVGPatternElement.cpp \
+ DerivedSources/WebCore/JSSVGPatternElement.h \
+ DerivedSources/WebCore/JSSVGPoint.cpp \
+ DerivedSources/WebCore/JSSVGPoint.h \
+ DerivedSources/WebCore/JSSVGPointList.cpp \
+ DerivedSources/WebCore/JSSVGPointList.h \
+ DerivedSources/WebCore/JSSVGPolygonElement.cpp \
+ DerivedSources/WebCore/JSSVGPolygonElement.h \
+ DerivedSources/WebCore/JSSVGPolylineElement.cpp \
+ DerivedSources/WebCore/JSSVGPolylineElement.h \
+ DerivedSources/WebCore/JSSVGPreserveAspectRatio.cpp \
+ DerivedSources/WebCore/JSSVGPreserveAspectRatio.h \
+ DerivedSources/WebCore/JSSVGRadialGradientElement.cpp \
+ DerivedSources/WebCore/JSSVGRadialGradientElement.h \
+ DerivedSources/WebCore/JSSVGRect.cpp \
+ DerivedSources/WebCore/JSSVGRectElement.cpp \
+ DerivedSources/WebCore/JSSVGRectElement.h \
+ DerivedSources/WebCore/JSSVGRect.h \
+ DerivedSources/WebCore/JSSVGRenderingIntent.cpp \
+ DerivedSources/WebCore/JSSVGRenderingIntent.h \
+ DerivedSources/WebCore/JSSVGScriptElement.cpp \
+ DerivedSources/WebCore/JSSVGScriptElement.h \
+ DerivedSources/WebCore/JSSVGSetElement.cpp \
+ DerivedSources/WebCore/JSSVGSetElement.h \
+ DerivedSources/WebCore/JSSVGStopElement.cpp \
+ DerivedSources/WebCore/JSSVGStopElement.h \
+ DerivedSources/WebCore/JSSVGStringList.cpp \
+ DerivedSources/WebCore/JSSVGStringList.h \
+ DerivedSources/WebCore/JSSVGStylable.h \
+ DerivedSources/WebCore/JSSVGStyleElement.cpp \
+ DerivedSources/WebCore/JSSVGStyleElement.h \
+ DerivedSources/WebCore/JSSVGSVGElement.cpp \
+ DerivedSources/WebCore/JSSVGSVGElement.h \
+ DerivedSources/WebCore/JSSVGSwitchElement.cpp \
+ DerivedSources/WebCore/JSSVGSwitchElement.h \
+ DerivedSources/WebCore/JSSVGSymbolElement.cpp \
+ DerivedSources/WebCore/JSSVGSymbolElement.h \
+ DerivedSources/WebCore/JSSVGTests.h \
+ DerivedSources/WebCore/JSSVGTextContentElement.cpp \
+ DerivedSources/WebCore/JSSVGTextContentElement.h \
+ DerivedSources/WebCore/JSSVGTextElement.cpp \
+ DerivedSources/WebCore/JSSVGTextElement.h \
+ DerivedSources/WebCore/JSSVGTextPathElement.cpp \
+ DerivedSources/WebCore/JSSVGTextPathElement.h \
+ DerivedSources/WebCore/JSSVGTextPositioningElement.cpp \
+ DerivedSources/WebCore/JSSVGTextPositioningElement.h \
+ DerivedSources/WebCore/JSSVGTitleElement.cpp \
+ DerivedSources/WebCore/JSSVGTitleElement.h \
+ DerivedSources/WebCore/JSSVGTransformable.h \
+ DerivedSources/WebCore/JSSVGTransform.cpp \
+ DerivedSources/WebCore/JSSVGTransform.h \
+ DerivedSources/WebCore/JSSVGTransformList.cpp \
+ DerivedSources/WebCore/JSSVGTransformList.h \
+ DerivedSources/WebCore/JSSVGTRefElement.cpp \
+ DerivedSources/WebCore/JSSVGTRefElement.h \
+ DerivedSources/WebCore/JSSVGTSpanElement.cpp \
+ DerivedSources/WebCore/JSSVGTSpanElement.h \
+ DerivedSources/WebCore/JSSVGUnitTypes.cpp \
+ DerivedSources/WebCore/JSSVGUnitTypes.h \
+ DerivedSources/WebCore/JSSVGURIReference.h \
+ DerivedSources/WebCore/JSSVGUseElement.cpp \
+ DerivedSources/WebCore/JSSVGUseElement.h \
+ DerivedSources/WebCore/JSSVGViewElement.cpp \
+ DerivedSources/WebCore/JSSVGViewElement.h \
+ DerivedSources/WebCore/JSSVGViewSpec.h \
+ DerivedSources/WebCore/JSSVGVKernElement.cpp \
+ DerivedSources/WebCore/JSSVGVKernElement.h \
+ DerivedSources/WebCore/JSSVGZoomAndPan.h \
+ DerivedSources/WebCore/JSSVGZoomEvent.cpp \
+ DerivedSources/WebCore/JSSVGZoomEvent.h
+
webcore_sources += \
WebCore/bindings/js/JSSVGContextCache.h \
WebCore/bindings/js/JSSVGElementInstanceCustom.cpp \
@@ -3618,8 +4020,13 @@ webcore_sources += \
WebCore/svg/SVGPaint.h \
WebCore/svg/SVGParserUtilities.cpp \
WebCore/svg/SVGParserUtilities.h \
+ WebCore/svg/SVGPathBuilder.cpp \
+ WebCore/svg/SVGPathBuilder.h \
+ WebCore/svg/SVGPathConsumer.h \
WebCore/svg/SVGPathElement.cpp \
WebCore/svg/SVGPathElement.h \
+ WebCore/svg/SVGPathParser.cpp \
+ WebCore/svg/SVGPathParser.h \
WebCore/svg/SVGPathSeg.h \
WebCore/svg/SVGPathSegArc.cpp \
WebCore/svg/SVGPathSegArc.h \
@@ -3641,6 +4048,8 @@ webcore_sources += \
WebCore/svg/SVGPathSegLinetoVertical.h \
WebCore/svg/SVGPathSegList.cpp \
WebCore/svg/SVGPathSegList.h \
+ WebCore/svg/SVGPathSegListBuilder.cpp \
+ WebCore/svg/SVGPathSegListBuilder.h \
WebCore/svg/SVGPathSegMoveto.cpp \
WebCore/svg/SVGPathSegMoveto.h \
WebCore/svg/SVGPatternElement.cpp \
@@ -3830,12 +4239,13 @@ DerivedSources/WebCore/XLinkNames.cpp : $(WebCore)/dom/make_names.pl $(WebCore)/
if ENABLE_WEB_SOCKETS
FEATURE_DEFINES += ENABLE_WEB_SOCKETS=1
-IDL_BINDINGS += \
- WebCore/websockets/WebSocket.idl
-
webcore_cppflags += \
-DENABLE_WEB_SOCKETS=1
+webcore_built_sources += \
+ DerivedSources/WebCore/JSWebSocket.cpp \
+ DerivedSources/WebCore/JSWebSocket.h
+
webcore_sources += \
WebCore/bindings/js/JSWebSocketCustom.cpp \
WebCore/platform/network/SocketStreamErrorBase.cpp \
@@ -3983,7 +4393,7 @@ DerivedSources/WebCore/XMLNames.cpp DerivedSources/WebCore/XMLNames.h: $(WebCore
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --attrs $(WebCore)/xml/xmlattrs.in --outputDir "$(GENSOURCES_WEBCORE)"
# Remote Inspector frontend
-DerivedSources/WebCore/RemoteInspectorFrontend2.cpp DerivedSources/WebCore/RemoteInspectorFrontend2.h: $(WebCore)/inspector/InspectorFrontend2.idl $(SCRIPTS_BINDINGS) $(WebCore)/inspector/CodeGeneratorInspector.pm
+DerivedSources/WebCore/RemoteInspectorFrontend.cpp DerivedSources/WebCore/RemoteInspectorFrontend.h: $(WebCore)/inspector/Inspector.idl $(SCRIPTS_BINDINGS) $(WebCore)/inspector/CodeGeneratorInspector.pm
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts -I$(WebCore)/inspector $(WebCore)/bindings/scripts/generate-bindings.pl $(IDL_PATH:%=--include "%") --outputDir "$(GENSOURCES_WEBCORE)" --defines "LANGUAGE_JAVASCRIPT=1 $(FEATURE_DEFINES)" --generator Inspector $<
IDL_PATH := \
@@ -4011,51 +4421,6 @@ DerivedSources/WebCore/JS%.h: DerivedSources/WebCore/JS%.cpp;
DerivedSources/WebCore/JS%.cpp: %.idl $(SCRIPTS_BINDINGS) $(WebCore)/bindings/scripts/CodeGeneratorJS.pm
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl $(IDL_PATH:%=--include "%") --outputDir "$(GENSOURCES_WEBCORE)" --defines "LANGUAGE_JAVASCRIPT=1 $(FEATURE_DEFINES)" --generator JS $<
-IDL_BINDINGS_JS_PURE := \
- WebCore/svg/ElementTimeControl.idl \
- WebCore/svg/SVGAnimatedPathData.idl \
- WebCore/svg/SVGAnimatedPoints.idl \
- WebCore/svg/SVGExternalResourcesRequired.idl \
- WebCore/svg/SVGFilterPrimitiveStandardAttributes.idl \
- WebCore/svg/SVGFitToViewBox.idl \
- WebCore/svg/SVGLangSpace.idl \
- WebCore/svg/SVGLocatable.idl \
- WebCore/svg/SVGStylable.idl \
- WebCore/svg/SVGTests.idl \
- WebCore/svg/SVGTransformable.idl \
- WebCore/svg/SVGURIReference.idl \
- WebCore/svg/SVGViewSpec.idl \
- WebCore/svg/SVGZoomAndPan.idl
-
-IDL_BINDINGS_JS := $(filter-out $(IDL_BINDINGS_JS_PURE),$(IDL_BINDINGS))
-
-webcore_built_nosources += $(patsubst %.idl,DerivedSources/WebCore/JS%.h,$(notdir $(IDL_BINDINGS)))
-
-webcore_built_nosources += $(patsubst %.idl,DerivedSources/WebCore/JS%.cpp,$(notdir $(IDL_BINDINGS_JS)))
-
-webcore_built_objects = := $(patsubst %.cpp,%.lo,$(webcore_built_nosources))
-
-$(webcore_built_objects): AM_CPPFLAGS+=$(corekit_cppflags)
-
-$(webcore_built_objects): AM_CXXFLAGS+=$(libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS)
-
-libWebCoreJS_objects := $(patsubst %.idl,DerivedSources/WebCore/JS%.lo,$(notdir $(IDL_BINDINGS_JS)))
-
-libWebCoreJS_depfiles := $(patsubst %.idl,DerivedSources/WebCore/$(DEPDIR)/JS%.Plo,$(notdir $(IDL_BINDINGS_JS)))
-
-# Older automake versions (1.7) place Plo files in a different place:
-libWebCoreJS_depfiles += $(patsubst %.lo,$(DEPDIR)/%.Plo,$(libWebCoreJS_objects))
-
--include $(libWebCoreJS_depfiles)
-
-$(libWebCoreJS_objects): AM_CPPFLAGS+=$(corekit_cppflags)
-
-$(libWebCoreJS_objects): AM_CXXFLAGS+=$(libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS)
-
-libWebCoreJS.la: $(libWebCoreJS_objects)
- $(CXXLINK) $(libWebCoreJS_objects) $(LIBS)
-
-
DerivedSources/webkit/webkitdomdummy.c:
$(AM_V_GEN)mkdir -p DerivedSources/webkit || echo > $@
@@ -4247,59 +4612,70 @@ $(libgdom_objects): AM_CXXFLAGS+=$(libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@W
libgdom.la: $(libgdom_objects)
$(CXXLINK) $(libgdom_objects) $(LIBS)
-noinst_HEADERS += \
- $(IDL_BINDINGS)
-
-webcore_dist += \
- WebCore/ChangeLog \
- WebCore/LICENSE-APPLE \
- WebCore/LICENSE-LGPL-2 \
- WebCore/LICENSE-LGPL-2.1 \
- WebCore/icu/LICENSE \
+EXTRA_DIST += \
+ $(shell ls $(srcdir)/WebCore/css/*.idl) \
+ $(shell ls $(srcdir)/WebCore/dom/*.idl) \
+ $(shell ls $(srcdir)/WebCore/html/canvas/*.idl) \
+ $(shell ls $(srcdir)/WebCore/html/*.idl) \
+ $(shell ls $(srcdir)/WebCore/inspector/*.idl) \
+ $(shell ls $(srcdir)/WebCore/loader/appcache/*.idl) \
+ $(shell ls $(srcdir)/WebCore/notifications/*.idl) \
+ $(shell ls $(srcdir)/WebCore/page/*.idl) \
+ $(shell ls $(srcdir)/WebCore/plugins/*.idl) \
+ $(shell ls $(srcdir)/WebCore/storage/*.idl) \
+ $(shell ls $(srcdir)/WebCore/svg/*.idl) \
+ $(shell ls $(srcdir)/WebCore/websockets/*.idl) \
+ $(shell ls $(srcdir)/WebCore/workers/*.idl) \
+ $(shell ls $(srcdir)/WebCore/xml/*.idl) \
+ WebCore/bindings/scripts/CodeGeneratorGObject.pm \
+ WebCore/bindings/scripts/CodeGeneratorJS.pm \
WebCore/bindings/scripts/CodeGenerator.pm \
+ WebCore/bindings/scripts/generate-bindings.pl \
+ WebCore/bindings/scripts/gobject-generate-headers.pl \
WebCore/bindings/scripts/IDLParser.pm \
WebCore/bindings/scripts/IDLStructure.pm \
WebCore/bindings/scripts/InFilesParser.pm \
- WebCore/bindings/scripts/generate-bindings.pl \
- WebCore/bindings/scripts/CodeGeneratorJS.pm \
- WebCore/bindings/scripts/CodeGeneratorGObject.pm \
- WebCore/bindings/scripts/gobject-generate-headers.pl \
+ WebCore/ChangeLog \
+ WebCore/css/CSSGrammar.y \
+ WebCore/css/CSSPropertyNames.in \
+ WebCore/css/CSSValueKeywords.in \
WebCore/css/html.css \
+ WebCore/css/make-css-file-arrays.pl \
+ WebCore/css/makegrammar.pl \
+ WebCore/css/makeprop.pl \
+ WebCore/css/maketokenizer \
+ WebCore/css/makevalues.pl \
WebCore/css/mathml.css \
- WebCore/css/quirks.css \
- WebCore/css/view-source.css \
- WebCore/css/svg.css \
- WebCore/css/wml.css \
WebCore/css/mediaControls.css \
WebCore/css/mediaControlsGtk.css \
- WebCore/css/CSSGrammar.y \
- WebCore/css/CSSValueKeywords.in \
+ WebCore/css/quirks.css \
+ WebCore/css/svg.css \
WebCore/css/SVGCSSPropertyNames.in \
- WebCore/css/maketokenizer \
- WebCore/css/makeprop.pl \
- WebCore/css/makevalues.pl \
- WebCore/css/tokenizer.flex \
- WebCore/css/CSSPropertyNames.in \
- WebCore/css/make-css-file-arrays.pl \
WebCore/css/SVGCSSValueKeywords.in \
- WebCore/css/makegrammar.pl \
+ WebCore/css/tokenizer.flex \
+ WebCore/css/view-source.css \
+ WebCore/css/wml.css \
WebCore/dom/make_names.pl \
+ WebCore/html/DocTypeStrings.gperf \
+ WebCore/html/HTMLAttributeNames.in \
+ WebCore/html/HTMLEntityNames.gperf \
+ WebCore/html/HTMLTagNames.in \
+ WebCore/icu/LICENSE \
WebCore/inspector/CodeGeneratorInspector.pm \
+ WebCore/LICENSE-APPLE \
+ WebCore/LICENSE-LGPL-2 \
+ WebCore/LICENSE-LGPL-2.1 \
+ WebCore/make-hash-tools.pl \
WebCore/mathml/mathattrs.in \
WebCore/mathml/mathtags.in \
- WebCore/platform/text/mac/make-charset-table.pl \
WebCore/platform/ColorData.gperf \
- WebCore/svg/xlinkattrs.in \
+ WebCore/platform/text/mac/make-charset-table.pl \
WebCore/svg/svgattrs.in \
WebCore/svg/svgtags.in \
- WebCore/html/DocTypeStrings.gperf \
- WebCore/html/HTMLTagNames.in \
- WebCore/html/HTMLEntityNames.gperf \
- WebCore/html/HTMLAttributeNames.in \
+ WebCore/svg/xlinkattrs.in \
WebCore/xml/xmlattrs.in \
WebCore/xml/xmlnsattrs.in \
- WebCore/xml/XPathGrammar.y \
- WebCore/make-hash-tools.pl
+ WebCore/xml/XPathGrammar.y
# Installing web inspector files
webinspectordir = ${datadir}/webkit-@WEBKITGTK_API_VERSION@/webinspector
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 71c632f..cf66285 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -138,6 +138,7 @@ __ZN7WebCore10MouseEventC1ERKNS_12AtomicStringEbbN3WTF10PassRefPtrINS_9DOMWindow
__ZN7WebCore10ScrollView20setCanHaveScrollbarsEb
__ZN7WebCore10StringImpl14createCFStringEv
__ZN7WebCore10StringImplcvP8NSStringEv
+__ZN7WebCore10deleteFileERKNS_6StringE
__ZN7WebCore10handCursorEv
__ZN7WebCore10setCookiesEPNS_8DocumentERKNS_4KURLERKNS_6StringE
__ZN7WebCore11BitmapImageC1EP7CGImagePNS_13ImageObserverE
@@ -203,6 +204,7 @@ __ZN7WebCore11IconFetcher6createEPNS_5FrameEPNS_17IconFetcherClientE
__ZN7WebCore11RenderLayer19scrollRectToVisibleERKNS_7IntRectEbRKNS_15ScrollAlignmentES6_
__ZN7WebCore11globalPointERK8_NSPointP8NSWindow
__ZN7WebCore11toUserSpaceERK7_NSRectP8NSWindow
+__ZN7WebCore11writeToFileEiPKci
__ZN7WebCore12ChromeClient20paintCustomScrollbarEPNS_15GraphicsContextERKNS_9FloatRectENS_20ScrollbarControlSizeEjNS_13ScrollbarPartEbffj
__ZN7WebCore12ChromeClient23paintCustomScrollCornerEPNS_15GraphicsContextERKNS_9FloatRectE
__ZN7WebCore12EventHandler10mouseMovedEP7NSEvent
@@ -214,7 +216,7 @@ __ZN7WebCore12EventHandler14scrollOverflowENS_15ScrollDirectionENS_17ScrollGranu
__ZN7WebCore12EventHandler15sendScrollEventEv
__ZN7WebCore12EventHandler16handleWheelEventERNS_18PlatformWheelEventE
__ZN7WebCore12EventHandler20handleTextInputEventERKNS_6StringEPNS_5EventEbb
-__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsE
+__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsEi
__ZN7WebCore12EventHandler21handleMousePressEventERKNS_18PlatformMouseEventE
__ZN7WebCore12EventHandler23handleMouseReleaseEventERKNS_18PlatformMouseEventE
__ZN7WebCore12EventHandler27capsLockStateMayHaveChangedEv
@@ -247,12 +249,12 @@ __ZN7WebCore12IconDatabase27checkIntegrityBeforeOpeningEv
__ZN7WebCore12IconDatabase4openERKNS_6StringE
__ZN7WebCore12IconDatabase5closeEv
__ZN7WebCore12IconDatabase9setClientEPNS_18IconDatabaseClientE
-__ZN7WebCore12PluginWidget14invalidateRectERKNS_7IntRectE
__ZN7WebCore12PrintContext12pagePropertyEPNS_5FrameEPKci
__ZN7WebCore12PrintContext13numberOfPagesEPNS_5FrameERKNS_9FloatSizeE
__ZN7WebCore12PrintContext16isPageBoxVisibleEPNS_5FrameEi
__ZN7WebCore12PrintContext20pageNumberForElementEPNS_7ElementERKNS_9FloatSizeE
__ZN7WebCore12PrintContext26pageSizeAndMarginsInPixelsEPNS_5FrameEiiiiiii
+__ZN7WebCore12PrintContext27spoolAllPagesWithBoundariesEPNS_5FrameERNS_15GraphicsContextERKNS_9FloatSizeE
__ZN7WebCore12PrintContext28computePageRectsWithPageSizeERKNS_9FloatSizeEb
__ZN7WebCore12PrintContextC1EPNS_5FrameE
__ZN7WebCore12PrintContextD1Ev
@@ -261,6 +263,7 @@ __ZN7WebCore12RenderWidget19showSubstituteImageEN3WTF10PassRefPtrINS_5ImageEEE
__ZN7WebCore12SchedulePairC1EP9NSRunLoopPK10__CFString
__ZN7WebCore12SharedBuffer10wrapNSDataEP6NSData
__ZN7WebCore12SharedBuffer12createNSDataEv
+__ZN7WebCore12SharedBuffer24createWithContentsOfFileERKNS_6StringE
__ZN7WebCore12SharedBufferD1Ev
__ZN7WebCore12TextEncodingC1ERKNS_6StringE
__ZN7WebCore12TextIterator11rangeLengthEPKNS_5RangeEb
@@ -279,6 +282,8 @@ __ZN7WebCore13AXObjectCache21gAccessibilityEnabledE
__ZN7WebCore13AXObjectCache42gAccessibilityEnhancedUserInterfaceEnabledE
__ZN7WebCore13HitTestResultC1ERKS0_
__ZN7WebCore13HitTestResultD1Ev
+__ZN7WebCore13IdentifierRep3getEPKc
+__ZN7WebCore13IdentifierRep3getEi
__ZN7WebCore13KeyboardEventC1ERKNS_12AtomicStringEbbPNS_9DOMWindowERKNS_6StringEjbbbbb
__ZN7WebCore13TypingCommand39insertParagraphSeparatorInQuotedContentEPNS_8DocumentE
__ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
@@ -365,8 +370,10 @@ __ZN7WebCore16LegacyWebArchive6createEPNS_4NodeE
__ZN7WebCore16LegacyWebArchive6createEPNS_5FrameE
__ZN7WebCore16LegacyWebArchive6createEPNS_5RangeE
__ZN7WebCore16LegacyWebArchive6createEv
+__ZN7WebCore16MIMETypeRegistry23getMIMETypeForExtensionERKNS_6StringE
__ZN7WebCore16MIMETypeRegistry24isSupportedImageMIMETypeERKNS_6StringE
__ZN7WebCore16MIMETypeRegistry26getSupportedImageMIMETypesEv
+__ZN7WebCore16MIMETypeRegistry27isSupportedNonImageMIMETypeERKNS_6StringE
__ZN7WebCore16MIMETypeRegistry29getSupportedNonImageMIMETypesEv
__ZN7WebCore16MIMETypeRegistry32isSupportedImageResourceMIMETypeERKNS_6StringE
__ZN7WebCore16NavigationActionC1ERKNS_4KURLENS_13FrameLoadTypeEb
@@ -375,8 +382,10 @@ __ZN7WebCore16NavigationActionC1Ev
__ZN7WebCore16ScriptController10initScriptEPNS_15DOMWrapperWorldE
__ZN7WebCore16ScriptController11createWorldEv
__ZN7WebCore16ScriptController13executeScriptERKNS_6StringEbNS_14ShouldAllowXSSE
+__ZN7WebCore16ScriptController17canExecuteScriptsENS_33ReasonForCallingCanExecuteScriptsE
__ZN7WebCore16ScriptController18windowScriptObjectEv
__ZN7WebCore16ScriptController20executeScriptInWorldEPNS_15DOMWrapperWorldERKNS_6StringEbNS_14ShouldAllowXSSE
+__ZN7WebCore16ScriptController24jsObjectForPluginElementEPNS_17HTMLPlugInElementE
__ZN7WebCore16ThreadGlobalData10staticDataE
__ZN7WebCore16ThreadGlobalDataC1Ev
__ZN7WebCore16ThreadGlobalDataD1Ev
@@ -393,6 +402,8 @@ __ZN7WebCore17DOMImplementation14isTextMIMETypeERKNS_6StringE
__ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
__ZN7WebCore17HTMLPlugInElement11getNPObjectEv
__ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv
+__ZN7WebCore17nameForCursorTypeENS_6Cursor4TypeE
+__ZN7WebCore17openTemporaryFileEPKcRi
__ZN7WebCore18deprecatedParseURLERKNS_6StringE
__ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionE
__ZN7WebCore19AnimationController16resumeAnimationsEPNS_8DocumentE
@@ -402,6 +413,10 @@ __ZN7WebCore19AnimationController21pauseTransitionAtTimeEPNS_12RenderObjectERKNS
__ZN7WebCore19BackForwardListImplC1EPNS_4PageE
__ZN7WebCore19CSSStyleDeclaration11setPropertyERKNS_6StringES3_Ri
__ZN7WebCore19InspectorController34inspectorStartsAttachedSettingNameEv
+__ZN7WebCore19ResourceRequestBase11setHTTPBodyEN3WTF10PassRefPtrINS_8FormDataEEE
+__ZN7WebCore19ResourceRequestBase13setHTTPMethodERKNS_6StringE
+__ZN7WebCore19ResourceRequestBase19addHTTPHeaderFieldsERKNS_13HTTPHeaderMapE
+__ZN7WebCore19ResourceRequestBase6setURLERKNS_4KURLE
__ZN7WebCore19SelectionController10setFocusedEb
__ZN7WebCore19SelectionController12setSelectionERKNS_16VisibleSelectionEbbbNS0_19CursorAlignOnScrollENS_15TextGranularityENS_20DirectionalityPolicyE
__ZN7WebCore19SelectionController16setSelectedRangeEPNS_5RangeENS_9EAffinityEb
@@ -417,6 +432,8 @@ __ZN7WebCore19applicationIsSafariEv
__ZN7WebCore20RenderEmbeddedObject30setShowsCrashedPluginIndicatorEv
__ZN7WebCore20ResourceResponseBase24setExpectedContentLengthEx
__ZN7WebCore20ResourceResponseBaseC2Ev
+__ZN7WebCore20SpaceSplitStringData12createVectorEv
+__ZN7WebCore20protocolIsJavaScriptERKNS_6StringE
__ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS0_4TypeEb
__ZN7WebCore21PlatformKeyboardEventC1EP7NSEvent
__ZN7WebCore21SVGDocumentExtensions21sampleAnimationAtTimeERKNS_6StringEPNS_14SVGSMILElementEd
@@ -428,6 +445,7 @@ __ZN7WebCore21WindowsLatin1EncodingEv
__ZN7WebCore21findEventWithKeyStateEPNS_5EventE
__ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE
__ZN7WebCore21mainThreadNormalWorldEv
+__ZN7WebCore21markerTextForListItemEPNS_7ElementE
__ZN7WebCore21reportThreadViolationEPKcNS_20ThreadViolationRoundE
__ZN7WebCore21setPlatformStrategiesEPNS_18PlatformStrategiesE
__ZN7WebCore22ScriptExecutionContext26canSuspendActiveDOMObjectsEv
@@ -474,7 +492,7 @@ __ZN7WebCore3macERKNS_23AuthenticationChallengeE
__ZN7WebCore4Font11setCodePathENS0_8CodePathE
__ZN7WebCore4Font18shouldUseSmoothingEv
__ZN7WebCore4Font21setShouldUseSmoothingEb
-__ZN7WebCore4FontC1ERKNS_16FontPlatformDataEb
+__ZN7WebCore4FontC1ERKNS_16FontPlatformDataEbNS_17FontSmoothingModeE
__ZN7WebCore4FontC1Ev
__ZN7WebCore4FontaSERKS0_
__ZN7WebCore4Icon18createIconForFilesERKN3WTF6VectorINS_6StringELm0EEE
@@ -537,6 +555,9 @@ __ZN7WebCore5Range6setEndEN3WTF10PassRefPtrINS_4NodeEEEiRi
__ZN7WebCore5Range8setStartEN3WTF10PassRefPtrINS_4NodeEEEiRi
__ZN7WebCore5RangeD1Ev
__ZN7WebCore5cacheEv
+__ZN7WebCore6Cursor8fromTypeENS0_4TypeE
+__ZN7WebCore6CursorD1Ev
+__ZN7WebCore6CursoraSERKS0_
__ZN7WebCore6Editor10applyStyleEPNS_19CSSStyleDeclarationENS_10EditActionE
__ZN7WebCore6Editor10insertTextERKNS_6StringEPNS_5EventE
__ZN7WebCore6Editor13canDHTMLPasteEv
@@ -614,6 +635,7 @@ __ZN7WebCore8Document26pageSizeAndMarginsInPixelsEiRNS_7IntSizeERiS3_S3_S3_
__ZN7WebCore8Document27removeMediaCanStartListenerEPNS_21MediaCanStartListenerE
__ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsEv
__ZN7WebCore8Document4headEv
+__ZN7WebCore8FormData6createEPKvm
__ZN7WebCore8FormDataD1Ev
__ZN7WebCore8IntPointC1ERK8_NSPoint
__ZN7WebCore8PositionC1EN3WTF10PassRefPtrINS_4NodeEEEi
@@ -704,7 +726,7 @@ __ZN7WebCore9FrameView16setPaintBehaviorEj
__ZN7WebCore9FrameView18updateControlTintsEv
__ZN7WebCore9FrameView20enterCompositingModeEv
__ZN7WebCore9FrameView21flushDeferredRepaintsEv
-__ZN7WebCore9FrameView21scrollPositionChangedEv
+__ZN7WebCore9FrameView38scrollPositionChangedViaPlatformWidgetEv
__ZN7WebCore9FrameView22setBaseBackgroundColorENS_5ColorE
__ZN7WebCore9FrameView23layoutIfNeededRecursiveEv
__ZN7WebCore9FrameView23updateCanHaveScrollbarsEv
@@ -767,9 +789,11 @@ __ZN7WebCore9TimerBase4stopEv
__ZN7WebCore9TimerBase5startEdd
__ZN7WebCore9TimerBaseC2Ev
__ZN7WebCore9TimerBaseD2Ev
+__ZN7WebCore9closeFileERi
__ZN7WebCore9fontCacheEv
__ZN7WebCore9makeRangeERKNS_15VisiblePositionES2_
__ZN7WebCore9pageCacheEv
+__ZN7WebCore9toElementEN3JSC7JSValueE
__ZN7WebCoreeqERKNS_19ResourceRequestBaseES2_
__ZNK3JSC8Bindings10RootObject12globalObjectEv
__ZNK7WebCore10FloatPointcv8_NSPointEv
@@ -806,7 +830,9 @@ __ZNK7WebCore11HistoryItem8childrenEv
__ZNK7WebCore11HistoryItem8referrerEv
__ZNK7WebCore11HistoryItem9urlStringEv
__ZNK7WebCore11HistoryItem9viewStateEv
+__ZNK7WebCore11RenderLayer19absoluteBoundingBoxEv
__ZNK7WebCore11RenderStyle21visitedDependentColorEi
+__ZNK7WebCore11ScriptValue9getStringEPN3JSC9ExecStateERNS_6StringE
__ZNK7WebCore12EventHandler20currentKeyboardEventEv
__ZNK7WebCore12IconDatabase12databasePathEv
__ZNK7WebCore12IconDatabase24shouldStopThreadActivityEv
@@ -821,6 +847,7 @@ __ZNK7WebCore12TextIterator4nodeEv
__ZNK7WebCore12TextIterator5rangeEv
__ZNK7WebCore13ContainerNode14childNodeCountEv
__ZNK7WebCore13ContainerNode9childNodeEj
+__ZNK7WebCore13HTTPHeaderMap3getEPKc
__ZNK7WebCore13HitTestResult10isLiveLinkEv
__ZNK7WebCore13HitTestResult10isSelectedEv
__ZNK7WebCore13HitTestResult11targetFrameEv
@@ -879,10 +906,15 @@ __ZNK7WebCore19ResourceRequestBase7isEmptyEv
__ZNK7WebCore19SelectionController17isInPasswordFieldEv
__ZNK7WebCore19SelectionController18isFocusedAndActiveEv
__ZNK7WebCore20ResourceResponseBase14httpStatusCodeEv
+__ZNK7WebCore20ResourceResponseBase14httpStatusTextEv
+__ZNK7WebCore20ResourceResponseBase15httpHeaderFieldEPKc
__ZNK7WebCore20ResourceResponseBase16httpHeaderFieldsEv
+__ZNK7WebCore20ResourceResponseBase16lastModifiedDateEv
__ZNK7WebCore20ResourceResponseBase16textEncodingNameEv
__ZNK7WebCore20ResourceResponseBase17suggestedFilenameEv
+__ZNK7WebCore20ResourceResponseBase21expectedContentLengthEv
__ZNK7WebCore20ResourceResponseBase3urlEv
+__ZNK7WebCore20ResourceResponseBase6isHTTPEv
__ZNK7WebCore20ResourceResponseBase8mimeTypeEv
__ZNK7WebCore21UserContentURLPattern7matchesERKNS_4KURLE
__ZNK7WebCore23FrameLoaderStateMachine15firstLayoutDoneEv
@@ -928,6 +960,7 @@ __ZNK7WebCore5Range19boundaryPointsValidEv
__ZNK7WebCore5Range9endOffsetERi
__ZNK7WebCore5Range9firstNodeEv
__ZNK7WebCore6Chrome12createWindowEPNS_5FrameERKNS_16FrameLoadRequestERKNS_14WindowFeaturesE
+__ZNK7WebCore6Cursor14platformCursorEv
__ZNK7WebCore6Editor13canEditRichlyEv
__ZNK7WebCore6Editor16compositionRangeEv
__ZNK7WebCore6Editor16fontForSelectionERb
@@ -986,7 +1019,6 @@ __ZNK7WebCore9FrameView28isEnclosedInCompositingLayerEv
__ZNK7WebCore9PageCache10frameCountEv
__ZNK7WebCore9PageCache21autoreleasedPageCountEv
__ZTVN7WebCore12ChromeClientE
-__ZTVN7WebCore12PluginWidgetE
__ZTVN7WebCore17FileChooserClientE
__ZTVN7WebCore17FrameLoaderClientE
__ZTVN7WebCore25HistoryPropertyListWriterE
@@ -1061,6 +1093,7 @@ _WebCoreHas3DRendering
#if USE(ACCELERATED_COMPOSITING)
__ZN7WebCore13GraphicsLayer17removeAllChildrenEv
__ZN7WebCore13GraphicsLayer6createEPNS_19GraphicsLayerClientE
+__ZNK7WebCore18RenderLayerBacking20compositingLayerTypeEv
#endif
#if ENABLE(CONTEXT_MENUS)
@@ -1200,12 +1233,8 @@ __ZN3JSC8Bindings13RuntimeObjectD2Ev
__ZN3JSC8Bindings8Instance19createRuntimeObjectEPNS_9ExecStateE
__ZN3JSC8Bindings8InstanceC2EN3WTF10PassRefPtrINS0_10RootObjectEEE
__ZN3JSC8Bindings8InstanceD2Ev
-__ZN7WebCore13IdentifierRep3getEPKc
-__ZN7WebCore13IdentifierRep3getEi
__ZN7WebCore13IdentifierRep7isValidEPS0_
__ZN7WebCore16ScriptController16createRootObjectEPv
-__ZN7WebCore16ScriptController17canExecuteScriptsENS_33ReasonForCallingCanExecuteScriptsE
-__ZN7WebCore16ScriptController24jsObjectForPluginElementEPNS_17HTMLPlugInElementE
__ZNK3JSC8Bindings13RuntimeObject12defaultValueEPNS_9ExecStateENS_22PreferredPrimitiveTypeE
__ZTVN3JSC13RuntimeMethodE
#endif
diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
index 3b94644..6193294 100644
--- a/WebCore/WebCore.gyp/WebCore.gyp
+++ b/WebCore/WebCore.gyp/WebCore.gyp
@@ -475,18 +475,18 @@
],
},
{
- 'action_name': 'InspectorFrontend2',
+ 'action_name': 'RemoteInspectorFrontend',
'inputs': [
'../bindings/scripts/generate-bindings.pl',
'../bindings/scripts/CodeGenerator.pm',
'../bindings/scripts/IDLParser.pm',
'../bindings/scripts/IDLStructure.pm',
'../inspector/CodeGeneratorInspector.pm',
- '../inspector/InspectorFrontend2.idl',
+ '../inspector/Inspector.idl',
],
'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/RemoteInspectorFrontend2.cpp',
- '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/RemoteInspectorFrontend2.h',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/RemoteInspectorFrontend.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/RemoteInspectorFrontend.h',
],
'variables': {
'generator_include_dirs': [
@@ -495,18 +495,17 @@
'action': [
'python',
'scripts/rule_binding.py',
- '../inspector/InspectorFrontend2.idl',
+ '../inspector/Inspector.idl',
'<(SHARED_INTERMEDIATE_DIR)/webcore/bindings',
'<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
'--',
'<@(_inputs)',
'--',
- '--defines', 'LANGUAGE_JAVASCRIPT',
- '--prefix', 'Remote',
+ '--defines', '<(feature_defines) LANGUAGE_JAVASCRIPT',
'--generator', 'Inspector',
'<@(generator_include_dirs)'
],
- 'message': 'Generating InspectorFrontend2 class from InspectorFrontend2.idl',
+ 'message': 'Generating RemoteInspectorFrontend class from Inspector.idl',
},
{
'action_name': 'XMLNames',
@@ -714,7 +713,7 @@
'<(SHARED_INTERMEDIATE_DIR)/webkit/XPathGrammar.cpp',
# Additional .cpp files from the webcore_inspector_sources list.
- '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/RemoteInspectorFrontend2.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/RemoteInspectorFrontend.cpp',
],
'conditions': [
['javascript_engine=="v8"', {
diff --git a/WebCore/WebCore.gyp/scripts/rule_binding.py b/WebCore/WebCore.gyp/scripts/rule_binding.py
index f7f3ed1..5a41808 100644
--- a/WebCore/WebCore.gyp/scripts/rule_binding.py
+++ b/WebCore/WebCore.gyp/scripts/rule_binding.py
@@ -100,6 +100,10 @@ def main(args):
else:
prefixIndex = options.index('--generator')
+ fileName = ''
+ if '--filename' in options:
+ fileName = options[options.index('--filename') + 1]
+
if prefixIndex + 1 < len(options):
prefix = options[prefixIndex + 1]
@@ -117,6 +121,7 @@ def main(args):
command.extend(['-I', includeDir])
command.append(generateBindings)
command.extend(options)
+ command.extend(['--outputHeadersDir', hdir])
command.extend(['--outputDir', cppdir, input])
# Do it. check_call is new in 2.5, so simulate its behavior with call and
@@ -124,18 +129,6 @@ def main(args):
returnCode = subprocess.call(command)
assert returnCode == 0
- # Both the .cpp and .h were generated in cppdir, but if hdir is different,
- # the .h needs to move. Copy it instead of using os.rename for maximum
- # portability in all cases.
- if cppdir != hdir:
- inputBasename = os.path.basename(input)
- (root, ext) = os.path.splitext(inputBasename)
- hname = '%s%s.h' % (prefix, root)
- hsrc = os.path.join(cppdir, hname)
- hdst = os.path.join(hdir, hname)
- shutil.copyfile(hsrc, hdst)
- os.unlink(hsrc)
-
return returnCode
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 1ccbc3f..7aa5d60 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -279,7 +279,7 @@
'xml/XSLTProcessor.idl',
],
'webcore_inspector_idl_files': [
- 'inspector/InspectorFrontend2.idl',
+ 'inspector/Inspector.idl',
],
'webcore_svg_bindings_idl_files': [
'svg/ElementTimeControl.idl',
@@ -542,6 +542,7 @@
'bindings/js/JSDedicatedWorkerContextCustom.cpp',
'bindings/js/JSDebugWrapperSet.cpp',
'bindings/js/JSDebugWrapperSet.h',
+ 'bindings/js/JSDeviceOrientationEventCustom.cpp',
'bindings/js/JSDocumentCustom.cpp',
'bindings/js/JSDOMApplicationCacheCustom.cpp',
'bindings/js/JSDOMBinding.cpp',
@@ -737,6 +738,7 @@
'bindings/v8/custom/V8DatabaseSyncCustom.cpp',
'bindings/v8/custom/V8DataGridColumnListCustom.cpp',
'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
+ 'bindings/v8/custom/V8DeviceOrientationEventCustom.cpp',
'bindings/v8/custom/V8DocumentLocationCustom.cpp',
'bindings/v8/custom/V8DOMFormDataCustom.cpp',
'bindings/v8/custom/V8DOMWindowCustom.cpp',
@@ -1119,6 +1121,8 @@
'dom/DatasetDOMStringMap.h',
'dom/DecodedDataDocumentParser.cpp',
'dom/DecodedDataDocumentParser.h',
+ 'dom/DeviceOrientation.cpp',
+ 'dom/DeviceOrientation.h',
'dom/DeviceOrientationClient.h',
'dom/DeviceOrientationController.cpp',
'dom/DeviceOrientationController.h',
@@ -2033,6 +2037,11 @@
'page/Settings.h',
'page/SpatialNavigation.h',
'page/SpatialNavigation.cpp',
+ 'page/SpeechInput.cpp',
+ 'page/SpeechInput.h',
+ 'page/SpeechInputClient.h',
+ 'page/SpeechInputClientListener.h',
+ 'page/SpeechInputListener.h',
'page/SuspendableTimer.cpp',
'page/SuspendableTimer.h',
'page/Timing.cpp',
@@ -2101,6 +2110,8 @@
'platform/chromium/PlatformCursor.h',
'platform/chromium/PlatformKeyboardEventChromium.cpp',
'platform/chromium/PlatformScreenChromium.cpp',
+ 'platform/chromium/PlatformThemeChromiumGtk.cpp',
+ 'platform/chromium/PlatformThemeChromiumGtk.h',
'platform/chromium/PlatformWidget.h',
'platform/chromium/PopupMenuChromium.cpp',
'platform/chromium/PopupMenuChromium.h',
@@ -2199,6 +2210,8 @@
'platform/graphics/chromium/UniscribeHelper.h',
'platform/graphics/chromium/UniscribeHelperTextRun.cpp',
'platform/graphics/chromium/UniscribeHelperTextRun.h',
+ 'platform/graphics/chromium/VideoLayerChromium.cpp',
+ 'platform/graphics/chromium/VideoLayerChromium.h',
'platform/graphics/chromium/WebGLLayerChromium.cpp',
'platform/graphics/chromium/WebGLLayerChromium.h',
'platform/graphics/filters/FEBlend.cpp',
@@ -2825,6 +2838,8 @@
'platform/text/CharacterNames.h',
'platform/text/Hyphenation.cpp',
'platform/text/Hyphenation.h',
+ 'platform/text/LineEnding.cpp',
+ 'platform/text/LineEnding.h',
'platform/text/ParserUtilities.h',
'platform/text/PlatformString.h',
'platform/text/RegularExpression.cpp',
@@ -3500,6 +3515,8 @@
'storage/SQLStatement.h',
'storage/SQLStatementCallback.h',
'storage/SQLStatementErrorCallback.h',
+ 'storage/SQLStatementSync.cpp',
+ 'storage/SQLStatementSync.h',
'storage/SQLTransaction.cpp',
'storage/SQLTransaction.h',
'storage/SQLTransactionCallback.h',
@@ -3749,8 +3766,13 @@
'svg/SVGPaint.h',
'svg/SVGParserUtilities.cpp',
'svg/SVGParserUtilities.h',
+ 'svg/SVGPathBuilder.cpp',
+ 'svg/SVGPathBuilder.h',
+ 'svg/SVGPathConsumer.h',
'svg/SVGPathElement.cpp',
'svg/SVGPathElement.h',
+ 'svg/SVGPathParser.cpp',
+ 'svg/SVGPathParser.h',
'svg/SVGPathSeg.h',
'svg/SVGPathSegArc.cpp',
'svg/SVGPathSegArc.h',
@@ -3772,6 +3794,8 @@
'svg/SVGPathSegLinetoVertical.h',
'svg/SVGPathSegList.cpp',
'svg/SVGPathSegList.h',
+ 'svg/SVGPathSegListBuilder.cpp',
+ 'svg/SVGPathSegListBuilder.h',
'svg/SVGPathSegMoveto.cpp',
'svg/SVGPathSegMoveto.h',
'svg/SVGPatternElement.cpp',
diff --git a/WebCore/WebCore.order b/WebCore/WebCore.order
index 7f916d2..8fa6586 100644
--- a/WebCore/WebCore.order
+++ b/WebCore/WebCore.order
@@ -2999,7 +2999,7 @@ __ZN7WebCore24StringWrapperCFAllocatorL22deallocateOnMainThreadEPv
__ZNK7WebCore12RenderObject5themeEv
__ZNK7WebCore14RenderThemeMac20supportsControlTintsEv
__ZN7WebCore15GraphicsContext23setUpdatingControlTintsEb
-__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsE
+__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsEi
__ZNK7WebCore13HitTestResult10isSelectedEv
__ZN7WebCore19SelectionController8containsERKNS_8IntPointE
__ZN7WebCore13InlineTextBox11nodeAtPointERKNS_14HitTestRequestERNS_13HitTestResultEiiii
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index 1451984..7205add 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -664,7 +664,87 @@ IDL_BINDINGS += \
xml/XPathEvaluator.idl \
xml/XSLTProcessor.idl
-INSPECTOR_INTERFACES = inspector/InspectorFrontend2.idl
+
+INSPECTOR_INTERFACES = inspector/Inspector.idl
+
+WEBCORE_HEADERS_FOR_WEBKIT2 += \
+ bindings/js/DOMWrapperWorld.h \
+ platform/FileChooser.h \
+ platform/network/qt/ResourceError.h \
+ platform/network/qt/ResourceRequest.h \
+ platform/network/qt/ResourceResponse.h \
+ dom/KeyboardEvent.h \
+ editing/EditCommand.h \
+ history/BackForwardList.h \
+ history/BackForwardControllerClient.h \
+ history/HistoryItem.h \
+ html/HTMLFormElement.h \
+ html/HTMLFrameOwnerElement.h \
+ inspector/InspectorClient.h \
+ loader/DocumentLoader.h \
+ loader/FormState.h \
+ loader/FrameLoader.h \
+ loader/FrameLoaderClient.h \
+ loader/FrameLoaderTypes.h \
+ loader/PolicyChecker.h \
+ loader/ProgressTracker.h \
+ page/animation/AnimationController.h \
+ page/Chrome.h \
+ page/ChromeClient.h \
+ page/ContextMenuClient.h \
+ page/DragClient.h \
+ page/EditorClient.h \
+ page/EventHandler.h \
+ page/FocusController.h \
+ page/Frame.h \
+ page/FrameLoadRequest.h \
+ page/FrameView.h \
+ page/Page.h \
+ page/Settings.h \
+ page/WindowFeatures.h \
+ platform/PlatformKeyboardEvent.h \
+ platform/PlatformMouseEvent.h \
+ platform/PlatformWheelEvent.h \
+ platform/Widget.h \
+ platform/KURL.h \
+ platform/graphics/FloatRect.h \
+ platform/graphics/GraphicsContext.h \
+ platform/graphics/GraphicsLayerClient.h \
+ platform/graphics/IntPoint.h \
+ platform/graphics/IntRect.h \
+ platform/graphics/IntSize.h \
+ platform/graphics/Tile.h \
+ platform/graphics/TiledBackingStore.h \
+ platform/graphics/TiledBackingStoreClient.h \
+ platform/text/PlatformString.h \
+ platform/text/StringImpl.h \
+ platform/MIMETypeRegistry.h \
+ rendering/RenderTreeAsText.h \
+ plugins/PluginData.h \
+
+JSC_HEADERS_FOR_WEBKIT2 += \
+ ../JavaScriptCore/runtime/JSObject.h \
+
+WEBKIT2_API_HEADERS += \
+ ../WebKit2/UIProcess/API/C/WKAPICast.h \
+ ../WebKit2/UIProcess/API/C/WKBase.h \
+ ../WebKit2/UIProcess/API/C/WKContext.h \
+ ../WebKit2/UIProcess/API/C/WKContextPrivate.h \
+ ../WebKit2/UIProcess/API/C/WKFrame.h \
+ ../WebKit2/UIProcess/API/C/WKFramePolicyListener.h \
+ ../WebKit2/UIProcess/API/C/WKNavigationData.h \
+ ../WebKit2/UIProcess/API/C/WKPage.h \
+ ../WebKit2/UIProcess/API/C/WKPageNamespace.h \
+ ../WebKit2/UIProcess/API/C/WKPagePrivate.h \
+ ../WebKit2/UIProcess/API/C/WKPreferences.h \
+ ../WebKit2/UIProcess/API/C/WKString.h \
+ ../WebKit2/UIProcess/API/C/WKURL.h \
+ ../WebKit2/UIProcess/API/C/WebKit2.h \
+ ../WebKit2/UIProcess/API/cpp/WKRetainPtr.h \
+ ../WebKit2/UIProcess/API/qt/qgraphicswkview.h \
+ ../WebKit2/UIProcess/API/qt/qwkpage.h \
+ ../WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBase.h \
+ ../WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h \
mathmlnames.output = $${WC_GENERATED_SOURCES_DIR}/MathMLNames.cpp
mathmlnames.input = MATHML_NAMES
@@ -728,7 +808,7 @@ idl.depends = $$PWD/bindings/scripts/CodeGenerator.pm \
addExtraCompiler(idl)
# GENERATOR 2: inspector idl compiler
-inspectorIDL.output = $${WC_GENERATED_SOURCES_DIR}/Remote${QMAKE_FILE_BASE}.cpp
+inspectorIDL.output = $${WC_GENERATED_SOURCES_DIR}/Remote${QMAKE_FILE_BASE}Frontend.cpp
inspectorIDL.input = INSPECTOR_INTERFACES
inspectorIDL.wkScript = $$PWD/bindings/scripts/generate-bindings.pl
inspectorIDL.commands = perl -I$$PWD/bindings/scripts -I$$PWD/inspector $$inspectorIDL.wkScript --defines \"$${FEATURE_DEFINES_JAVASCRIPT}\" --generator Inspector --outputDir $$WC_GENERATED_SOURCES_DIR --preprocessor \"$${QMAKE_MOC} -E\" ${QMAKE_FILE_NAME}
@@ -830,3 +910,30 @@ webkitversion.clean = ${QMAKE_VAR_WC_GENERATED_SOURCES_DIR}/WebKitVersion.h
webkitversion.wkAddOutputToSources = false
addExtraCompiler(webkitversion)
+webkit2 {
+
+# GENERATOR 12: Copy WebCore headers for WebKit2
+webcoreheaders.output = ../include/WebCore/${QMAKE_FILE_BASE}.h
+webcoreheaders.input = WEBCORE_HEADERS_FOR_WEBKIT2
+webcoreheaders.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
+webcoreheaders.clean = ${QMAKE_FILE_OUT}
+webcoreheaders.wkAddOutputToSources = false
+addExtraCompiler(webcoreheaders)
+
+# GENERATOR 12-B: Copy JavaScriptCore headers for WebKit2
+jscheaders.output = ../include/JavaScriptCore/${QMAKE_FILE_BASE}.h
+jscheaders.input = JSC_HEADERS_FOR_WEBKIT2
+jscheaders.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
+jscheaders.clean = ${QMAKE_FILE_OUT}
+jscheaders.wkAddOutputToSources = false
+addExtraCompiler(jscheaders)
+
+# GENERATOR 13: Copy WebKit2 headers
+webkit2headers.output = ../include/WebKit2/${QMAKE_FILE_BASE}.h
+webkit2headers.input = WEBKIT2_API_HEADERS
+webkit2headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
+webkit2headers.clean = ${QMAKE_FILE_OUT}
+webkit2headers.wkAddOutputToSources = false
+addExtraCompiler(webkit2headers)
+
+}
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 49149dc..8ed7157 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -2,6 +2,10 @@
CONFIG += building-libs
CONFIG += depend_includepath
+meegotouch {
+ DEFINES += WTF_USE_MEEGOTOUCH=1
+}
+
symbian: {
TARGET.EPOCALLOWDLLDATA=1
TARGET.CAPABILITY = All -Tcb
@@ -116,8 +120,16 @@ win32-g++* {
QMAKE_LIBDIR_POST += $$split(TMPPATH,";")
}
-# Assume that symbian OS always comes with sqlite
-symbian:!CONFIG(QTDIR_build): CONFIG += system-sqlite
+symbian {
+ !CONFIG(QTDIR_build) {
+ # Test if symbian OS comes with sqlite
+ exists($${EPOCROOT}epoc32/release/armv5/lib/sqlite3.dso):CONFIG *= system-sqlite
+ } else:!symbian-abld:!symbian-sbsv2 {
+ # When bundled with Qt, all Symbian build systems extract their own sqlite files if
+ # necessary, but on non-mmp based ones we need to specify this ourselves.
+ include($$QT_SOURCE_TREE/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri)
+ }
+}
@@ -168,6 +180,7 @@ INCLUDEPATH = \
$$PWD \
$$PWD/accessibility \
$$PWD/bindings \
+ $$PWD/bindings/generic \
$$PWD/bindings/js \
$$PWD/bridge \
$$PWD/bridge/c \
@@ -263,6 +276,7 @@ SOURCES += \
accessibility/AccessibilityTableHeaderContainer.cpp \
accessibility/AccessibilityTableRow.cpp \
accessibility/AXObjectCache.cpp \
+ bindings/generic/RuntimeEnabledFeatures.cpp \
bindings/js/GCController.cpp \
bindings/js/DOMObjectHashTableMap.cpp \
bindings/js/DOMWrapperWorld.cpp \
@@ -286,6 +300,7 @@ SOURCES += \
bindings/js/JSDataGridDataSource.cpp \
bindings/js/JSDebugWrapperSet.cpp \
bindings/js/JSDesktopNotificationsCustom.cpp \
+ bindings/js/JSDeviceOrientationEventCustom.cpp \
bindings/js/JSDocumentCustom.cpp \
bindings/js/JSDOMFormDataCustom.cpp \
bindings/js/JSDOMGlobalObject.cpp \
@@ -462,6 +477,7 @@ SOURCES += \
dom/CSSMappedAttributeDeclaration.cpp \
dom/CustomEvent.cpp \
dom/DecodedDataDocumentParser.cpp \
+ dom/DeviceOrientation.cpp \
dom/DeviceOrientationController.cpp \
dom/DeviceOrientationEvent.cpp \
dom/Document.cpp \
@@ -891,6 +907,7 @@ SOURCES += \
platform/KillRingNone.cpp \
platform/KURL.cpp \
platform/Length.cpp \
+ platform/text/LineEnding.cpp \
platform/LinkHash.cpp \
platform/Logging.cpp \
platform/MIMETypeRegistry.cpp \
@@ -1219,6 +1236,7 @@ HEADERS += \
dom/CSSMappedAttributeDeclaration.h \
dom/CustomEvent.h \
dom/default/PlatformMessagePortChannel.h \
+ dom/DeviceOrientation.h \
dom/DeviceOrientationClient.h \
dom/DeviceOrientationController.h \
dom/DeviceOrientationEvent.h \
@@ -1590,6 +1608,10 @@ HEADERS += \
page/SecurityOrigin.h \
page/Settings.h \
page/SpatialNavigation.h \
+ page/SpeechInput.h \
+ page/SpeechInputClient.h \
+ page/SpeechInputClientListener.h \
+ page/SpeechInputListener.h \
page/WindowFeatures.h \
page/WorkerNavigator.h \
page/XSSAuditor.h \
@@ -1661,6 +1683,7 @@ HEADERS += \
platform/KillRing.h \
platform/KURL.h \
platform/Length.h \
+ platform/text/LineEnding.h \
platform/LinkHash.h \
platform/Logging.h \
platform/MIMETypeRegistry.h \
@@ -1982,7 +2005,10 @@ HEADERS += \
svg/SVGNumberList.h \
svg/SVGPaint.h \
svg/SVGParserUtilities.h \
+ svg/SVGPathBuilder.h \
+ svg/SVGPathConsumer.h \
svg/SVGPathElement.h \
+ svg/SVGPathParser.h \
svg/SVGPathSegArc.h \
svg/SVGPathSegClosePath.h \
svg/SVGPathSegCurvetoCubic.h \
@@ -1993,6 +2019,7 @@ HEADERS += \
svg/SVGPathSegLinetoHorizontal.h \
svg/SVGPathSegLinetoVertical.h \
svg/SVGPathSegList.h \
+ svg/SVGPathSegListBuilder.h \
svg/SVGPathSegMoveto.h \
svg/SVGPatternElement.h \
svg/SVGPointList.h \
@@ -2243,12 +2270,12 @@ maemo5 {
win32-* {
LIBS += -lgdi32
- LIBS += -lOle32
+ LIBS += -lole32
LIBS += -luser32
}
wince* {
LIBS += -lmmtimer
- LIBS += -lOle32
+ LIBS += -lole32
}
contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
@@ -2368,6 +2395,7 @@ contains(DEFINES, ENABLE_DATABASE=1) {
storage/SQLResultSet.cpp \
storage/SQLResultSetRowList.cpp \
storage/SQLStatement.cpp \
+ storage/SQLStatementSync.cpp \
storage/SQLTransaction.cpp \
storage/SQLTransactionClient.cpp \
storage/SQLTransactionCoordinator.cpp \
@@ -2446,6 +2474,7 @@ contains(DEFINES, ENABLE_DOM_STORAGE=1) {
storage/SQLResultSet.h \
storage/SQLResultSetRowList.h \
storage/SQLStatement.h \
+ storage/SQLStatementSync.h \
storage/SQLTransaction.h \
storage/SQLTransactionClient.h \
storage/SQLTransactionCoordinator.h \
@@ -2519,6 +2548,7 @@ contains(DEFINES, ENABLE_SHARED_WORKERS=1) {
contains(DEFINES, ENABLE_INPUT_SPEECH=1) {
SOURCES += \
+ page/SpeechInput.cpp \
rendering/RenderInputSpeech.cpp
}
@@ -2791,7 +2821,9 @@ contains(DEFINES, ENABLE_SVG=1) {
svg/SVGNumberList.cpp \
svg/SVGPaint.cpp \
svg/SVGParserUtilities.cpp \
+ svg/SVGPathBuilder.cpp \
svg/SVGPathElement.cpp \
+ svg/SVGPathParser.cpp \
svg/SVGPathSegArc.cpp \
svg/SVGPathSegClosePath.cpp \
svg/SVGPathSegCurvetoCubic.cpp \
@@ -2802,6 +2834,7 @@ contains(DEFINES, ENABLE_SVG=1) {
svg/SVGPathSegLinetoHorizontal.cpp \
svg/SVGPathSegLinetoVertical.cpp \
svg/SVGPathSegList.cpp \
+ svg/SVGPathSegListBuilder.cpp \
svg/SVGPathSegMoveto.cpp \
svg/SVGPatternElement.cpp \
svg/SVGPointList.cpp \
@@ -3026,6 +3059,7 @@ contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) {
}
include($$PWD/../WebKit/qt/Api/headers.pri)
+
HEADERS += $$WEBKIT_API_HEADERS
!CONFIG(QTDIR_build) {
@@ -3146,6 +3180,192 @@ SOURCES += \
rendering/RenderLayerCompositor.cpp
}
+webkit2 {
+
+CONFIG += precompile_header
+PRECOMPILED_HEADER = $$PWD/../WebKit2/WebKit2Prefix.h
+
+INCLUDEPATH = \
+ $$PWD/../WebKit2/Platform \
+ $$PWD/../WebKit2/Platform/CoreIPC \
+ $$PWD/../WebKit2/Shared \
+ $$PWD/../WebKit2/Shared/CoreIPCSupport \
+ $$PWD/../WebKit2/Shared/qt \
+ $$PWD/../WebKit2/UIProcess \
+ $$PWD/../WebKit2/UIProcess/API/C \
+ $$PWD/../WebKit2/UIProcess/API/cpp \
+ $$PWD/../WebKit2/UIProcess/API/cpp/qt \
+ $$PWD/../WebKit2/UIProcess/API/qt \
+ $$PWD/../WebKit2/UIProcess/Launcher \
+ $$PWD/../WebKit2/UIProcess/Plugins \
+ $$PWD/../WebKit2/UIProcess/qt \
+ $$PWD/../WebKit2/WebProcess \
+ $$PWD/../WebKit2/WebProcess/InjectedBundle \
+ $$PWD/../WebKit2/WebProcess/InjectedBundle/API/c \
+ $$PWD/../WebKit2/WebProcess/WebCoreSupport \
+ $$PWD/../WebKit2/WebProcess/WebPage \
+ $$INCLUDEPATH \
+ $$OUTPUT_DIR/include \
+
+HEADERS += \
+ ../WebKit2/Platform/CoreIPC/ArgumentDecoder.h \
+ ../WebKit2/Platform/CoreIPC/ArgumentEncoder.h \
+ ../WebKit2/Platform/CoreIPC/Arguments.h \
+ ../WebKit2/Platform/CoreIPC/Attachment.h \
+ ../WebKit2/Platform/CoreIPC/Connection.h \
+ ../WebKit2/Platform/CoreIPC/CoreIPCMessageKinds.h \
+ ../WebKit2/Platform/CoreIPC/MessageID.h \
+ ../WebKit2/Platform/PlatformProcessIdentifier.h \
+ ../WebKit2/Platform/RunLoop.h \
+ ../WebKit2/Platform/WorkItem.h \
+ ../WebKit2/Platform/WorkQueue.h \
+ ../WebKit2/Shared/CoreIPCSupport/DrawingAreaMessageKinds.h \
+ ../WebKit2/Shared/CoreIPCSupport/DrawingAreaProxyMessageKinds.h \
+ ../WebKit2/Shared/CoreIPCSupport/WebPageMessageKinds.h \
+ ../WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h \
+ ../WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h \
+ ../WebKit2/Shared/NotImplemented.h \
+ ../WebKit2/Shared/qt/WebEventFactoryQt.h \
+ ../WebKit2/Shared/WebEventConversion.h \
+ ../WebKit2/Shared/WebEvent.h \
+ ../WebKit2/Shared/WebNavigationDataStore.h \
+ ../WebKit2/Shared/WebPreferencesStore.h \
+ ../WebKit2/UIProcess/API/cpp/WKRetainPtr.h \
+ ../WebKit2/UIProcess/API/cpp/qt/WKStringQt.h \
+ ../WebKit2/UIProcess/API/cpp/qt/WKURLQt.h \
+ ../WebKit2/UIProcess/API/C/WebKit2.h \
+ ../WebKit2/UIProcess/API/C/WKAPICast.h \
+ ../WebKit2/UIProcess/API/C/WKBase.h \
+ ../WebKit2/UIProcess/API/C/WKContext.h \
+ ../WebKit2/UIProcess/API/C/WKContextPrivate.h \
+ ../WebKit2/UIProcess/API/C/WKFrame.h \
+ ../WebKit2/UIProcess/API/C/WKFramePolicyListener.h \
+ ../WebKit2/UIProcess/API/C/WKNavigationData.h \
+ ../WebKit2/UIProcess/API/C/WKPage.h \
+ ../WebKit2/UIProcess/API/C/WKPageNamespace.h \
+ ../WebKit2/UIProcess/API/C/WKPagePrivate.h \
+ ../WebKit2/UIProcess/API/C/WKPreferences.h \
+ ../WebKit2/UIProcess/API/C/WKString.h \
+ ../WebKit2/UIProcess/API/C/WKURL.h \
+ ../WebKit2/UIProcess/API/qt/qgraphicswkview.h \
+ ../WebKit2/UIProcess/API/qt/qwkpage.h \
+ ../WebKit2/UIProcess/API/qt/qwkpage_p.h \
+ ../WebKit2/UIProcess/ChunkedUpdateDrawingAreaProxy.h \
+ ../WebKit2/UIProcess/DrawingAreaProxy.h \
+ ../WebKit2/UIProcess/GenericCallback.h \
+ ../WebKit2/UIProcess/Launcher/ProcessLauncher.h \
+ ../WebKit2/UIProcess/Plugins/PluginInfoStore.h \
+ ../WebKit2/UIProcess/PageClient.h \
+ ../WebKit2/UIProcess/ProcessModel.h \
+ ../WebKit2/UIProcess/API/qt/ClientImpl.h \
+ ../WebKit2/UIProcess/ResponsivenessTimer.h \
+ ../WebKit2/UIProcess/WebContext.h \
+ ../WebKit2/UIProcess/WebContextInjectedBundleClient.h \
+ ../WebKit2/UIProcess/WebFramePolicyListenerProxy.h \
+ ../WebKit2/UIProcess/WebFrameProxy.h \
+ ../WebKit2/UIProcess/WebHistoryClient.h \
+ ../WebKit2/UIProcess/WebLoaderClient.h \
+ ../WebKit2/UIProcess/WebNavigationData.h \
+ ../WebKit2/UIProcess/WebPageNamespace.h \
+ ../WebKit2/UIProcess/WebPageProxy.h \
+ ../WebKit2/UIProcess/WebPolicyClient.h \
+ ../WebKit2/UIProcess/WebPreferences.h \
+ ../WebKit2/UIProcess/WebProcessManager.h \
+ ../WebKit2/UIProcess/WebProcessProxy.h \
+ ../WebKit2/UIProcess/WebUIClient.h \
+ ../WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBase.h \
+ ../WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h \
+ ../WebKit2/WebProcess/InjectedBundle/InjectedBundle.h \
+ ../WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h \
+ ../WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h \
+ ../WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.h \
+ ../WebKit2/WebProcess/WebCoreSupport/WebDragClient.h \
+ ../WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h \
+ ../WebKit2/WebProcess/WebCoreSupport/WebErrors.h \
+ ../WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h \
+ ../WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h \
+ ../WebKit2/WebProcess/WebPage/ChunkedUpdateDrawingArea.h \
+ ../WebKit2/WebProcess/WebPage/DrawingArea.h \
+ ../WebKit2/WebProcess/WebPage/WebFrame.h \
+ ../WebKit2/WebProcess/WebPage/WebPage.h \
+ ../WebKit2/WebProcess/WebProcess.h \
+
+SOURCES += \
+ ../WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp \
+ ../WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp \
+ ../WebKit2/Platform/CoreIPC/Attachment.cpp \
+ ../WebKit2/Platform/CoreIPC/Connection.cpp \
+ ../WebKit2/Platform/CoreIPC/qt/ConnectionQt.cpp \
+ ../WebKit2/Platform/RunLoop.cpp \
+ ../WebKit2/Platform/WorkQueue.cpp \
+ ../WebKit2/Platform/qt/RunLoopQt.cpp \
+ ../WebKit2/Platform/qt/WorkQueueQt.cpp \
+ ../WebKit2/Shared/ImmutableArray.cpp \
+ ../WebKit2/Shared/WebEventConversion.cpp \
+ ../WebKit2/Shared/WebPreferencesStore.cpp \
+ ../WebKit2/Shared/qt/UpdateChunk.cpp \
+ ../WebKit2/Shared/qt/WebEventFactoryQt.cpp \
+ ../WebKit2/UIProcess/API/C/WKContext.cpp \
+ ../WebKit2/UIProcess/API/C/WKFrame.cpp \
+ ../WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp \
+ ../WebKit2/UIProcess/API/C/WKNavigationData.cpp \
+ ../WebKit2/UIProcess/API/C/WKPage.cpp \
+ ../WebKit2/UIProcess/API/C/WKPageNamespace.cpp \
+ ../WebKit2/UIProcess/API/C/WKPreferences.cpp \
+ ../WebKit2/UIProcess/API/C/WKString.cpp \
+ ../WebKit2/UIProcess/API/C/WKURL.cpp \
+ ../WebKit2/UIProcess/API/qt/qgraphicswkview.cpp \
+ ../WebKit2/UIProcess/API/qt/qwkpage.cpp \
+ ../WebKit2/UIProcess/API/cpp/qt/WKStringQt.cpp \
+ ../WebKit2/UIProcess/API/cpp/qt/WKURLQt.cpp \
+ ../WebKit2/UIProcess/ChunkedUpdateDrawingAreaProxy.cpp \
+ ../WebKit2/UIProcess/DrawingAreaProxy.cpp \
+ ../WebKit2/UIProcess/Plugins/PluginInfoStore.cpp \
+ ../WebKit2/UIProcess/Plugins/qt/PluginInfoStoreQt.cpp \
+ ../WebKit2/UIProcess/Launcher/ProcessLauncher.cpp \
+ ../WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp \
+ ../WebKit2/UIProcess/ResponsivenessTimer.cpp \
+ ../WebKit2/UIProcess/WebBackForwardList.cpp \
+ ../WebKit2/UIProcess/WebBackForwardListItem.cpp \
+ ../WebKit2/UIProcess/WebContext.cpp \
+ ../WebKit2/UIProcess/WebContextInjectedBundleClient.cpp \
+ ../WebKit2/UIProcess/WebFramePolicyListenerProxy.cpp \
+ ../WebKit2/UIProcess/WebFrameProxy.cpp \
+ ../WebKit2/UIProcess/WebHistoryClient.cpp \
+ ../WebKit2/UIProcess/WebLoaderClient.cpp \
+ ../WebKit2/UIProcess/WebNavigationData.cpp \
+ ../WebKit2/UIProcess/WebPageNamespace.cpp \
+ ../WebKit2/UIProcess/WebPageProxy.cpp \
+ ../WebKit2/UIProcess/WebPolicyClient.cpp \
+ ../WebKit2/UIProcess/WebPreferences.cpp \
+ ../WebKit2/UIProcess/WebProcessManager.cpp \
+ ../WebKit2/UIProcess/WebProcessProxy.cpp \
+ ../WebKit2/UIProcess/WebUIClient.cpp \
+ ../WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp \
+ ../WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp \
+ ../WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp \
+ ../WebKit2/WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp \
+ ../WebKit2/UIProcess/API/qt/ClientImpl.cpp \
+ ../WebKit2/UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp \
+ ../WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp \
+ ../WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp \
+ ../WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp \
+ ../WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp \
+ ../WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp \
+ ../WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp \
+ ../WebKit2/WebProcess/WebCoreSupport/WebBackForwardControllerClient.cpp \
+ ../WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp \
+ ../WebKit2/WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp \
+ ../WebKit2/WebProcess/WebPage/DrawingArea.cpp \
+ ../WebKit2/WebProcess/WebPage/WebFrame.cpp \
+ ../WebKit2/WebProcess/WebPage/WebPage.cpp \
+ ../WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp \
+ ../WebKit2/WebProcess/WebPage/qt/ChunkedUpdateDrawingAreaQt.cpp \
+ ../WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp \
+ ../WebKit2/WebProcess/WebProcess.cpp \
+
+}
+
symbian {
shared {
contains(CONFIG, def_files) {
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 4e77d82..17a6b7f 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="windows-1251"?>
+<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
@@ -364,7 +364,7 @@
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4065;4273;4565;4701;4702"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -374,7 +374,7 @@
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4065;4273;4565;4701;4702"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -384,7 +384,7 @@
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4065;4273;4565;4701;4702"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -394,7 +394,7 @@
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4065;4273;4565;4701;4702"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -404,7 +404,7 @@
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4065;4273;4565;4701;4702"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -414,7 +414,7 @@
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4065;4273;4565;4701;4702"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
</File>
@@ -3345,6 +3345,118 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMMimeType.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\JSDOMMimeType.h"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMMimeTypeArray.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\JSDOMMimeTypeArray.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMParser.cpp"
>
<FileConfiguration
@@ -3401,6 +3513,118 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMPlugin.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\JSDOMPlugin.h"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMPluginArray.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\JSDOMPluginArray.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMSelection.cpp"
>
<FileConfiguration
@@ -9173,118 +9397,6 @@
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMMimeType.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\JSDOMMimeType.h"
- >
- </File>
- <File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMMimeTypeArray.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\JSDOMMimeTypeArray.h"
- >
- </File>
- <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMouseEvent.cpp"
>
<FileConfiguration
@@ -10125,118 +10237,6 @@
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMPlugin.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\JSDOMPlugin.h"
- >
- </File>
- <File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMPluginArray.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\JSDOMPluginArray.h"
- >
- </File>
- <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSPopStateEvent.cpp"
>
<FileConfiguration
@@ -20741,31 +20741,31 @@
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\SVGElementFactory.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\RemoteInspectorFrontend.cpp"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\SVGElementFactory.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\RemoteInspectorFrontend.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\SVGNames.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\SVGElementFactory.cpp"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\SVGNames.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\SVGElementFactory.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\UserAgentStyleSheets.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\SVGNames.cpp"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\RemoteInspectorFrontend2.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\SVGNames.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\RemoteInspectorFrontend2.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\UserAgentStyleSheets.h"
>
</File>
<File
@@ -20910,7 +20910,7 @@
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4065;4273;4565;4701;4702"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -20920,7 +20920,7 @@
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4065;4273;4565;4701;4702"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -20930,7 +20930,7 @@
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4065;4273;4565;4701;4702"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -20940,7 +20940,7 @@
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4065;4273;4565;4701;4702"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -20950,7 +20950,7 @@
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4065;4273;4565;4701;4702"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -20960,7 +20960,7 @@
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4065;4273;4565;4701;4702"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
</File>
@@ -22417,19 +22417,19 @@
>
</File>
<File
- RelativePath="..\page\Performance.cpp"
+ RelativePath="..\page\PageGroupLoadDeferrer.cpp"
>
</File>
<File
- RelativePath="..\page\Performance.h"
+ RelativePath="..\page\PageGroupLoadDeferrer.h"
>
</File>
<File
- RelativePath="..\page\PageGroupLoadDeferrer.cpp"
+ RelativePath="..\page\Performance.cpp"
>
</File>
<File
- RelativePath="..\page\PageGroupLoadDeferrer.h"
+ RelativePath="..\page\Performance.h"
>
</File>
<File
@@ -22501,6 +22501,26 @@
>
</File>
<File
+ RelativePath="..\page\SpeechInput.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\page\SpeechInput.h"
+ >
+ </File>
+ <File
+ RelativePath="..\page\SpeechInputClient.h"
+ >
+ </File>
+ <File
+ RelativePath="..\page\SpeechInputClientListener.h"
+ >
+ </File>
+ <File
+ RelativePath="..\page\SpeechInputListener.h"
+ >
+ </File>
+ <File
RelativePath="..\page\SuspendableTimer.cpp"
>
</File>
@@ -23824,7 +23844,7 @@
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -23833,7 +23853,7 @@
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -23842,7 +23862,7 @@
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -23851,7 +23871,7 @@
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -23860,7 +23880,7 @@
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -23869,7 +23889,7 @@
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
</File>
@@ -27144,6 +27164,14 @@
>
</File>
<File
+ RelativePath="..\platform\text\LineEnding.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\text\LineEnding.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\text\ParserUtilities.h"
>
</File>
@@ -32059,7 +32087,7 @@
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -32068,7 +32096,7 @@
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -32077,7 +32105,7 @@
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -32086,7 +32114,7 @@
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -32095,7 +32123,7 @@
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
<FileConfiguration
@@ -32104,7 +32132,7 @@
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
- ForcedIncludeFiles="$(NOINHERIT)"
+ ForcedIncludeFiles="$(NOINHERIT);ICUVersion.h"
/>
</FileConfiguration>
</File>
@@ -32393,6 +32421,14 @@
>
</File>
<File
+ RelativePath="..\dom\DatasetDOMStringMap.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\dom\DatasetDOMStringMap.h"
+ >
+ </File>
+ <File
RelativePath="..\dom\DecodedDataDocumentParser.cpp"
>
</File>
@@ -32401,31 +32437,31 @@
>
</File>
<File
- RelativePath="..\dom\DeviceOrientationClient.h"
+ RelativePath="..\dom\DeviceOrientation.cpp"
>
</File>
<File
- RelativePath="..\dom\DeviceOrientationController.cpp"
+ RelativePath="..\dom\DeviceOrientation.h"
>
</File>
<File
- RelativePath="..\dom\DeviceOrientationController.h"
+ RelativePath="..\dom\DeviceOrientationClient.h"
>
</File>
<File
- RelativePath="..\dom\DeviceOrientationEvent.cpp"
+ RelativePath="..\dom\DeviceOrientationController.cpp"
>
</File>
<File
- RelativePath="..\dom\DeviceOrientationEvent.h"
+ RelativePath="..\dom\DeviceOrientationController.h"
>
</File>
<File
- RelativePath="..\dom\DatasetDOMStringMap.cpp"
+ RelativePath="..\dom\DeviceOrientationEvent.cpp"
>
</File>
<File
- RelativePath="..\dom\DatasetDOMStringMap.h"
+ RelativePath="..\dom\DeviceOrientationEvent.h"
>
</File>
<File
@@ -36713,6 +36749,14 @@
>
</File>
<File
+ RelativePath="..\html\HTMLConstructionSite.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\HTMLConstructionSite.h"
+ >
+ </File>
+ <File
RelativePath="..\html\HTMLDataGridCellElement.cpp"
>
<FileConfiguration
@@ -37233,15 +37277,15 @@
>
</File>
<File
- RelativePath="..\html\HTMLElementStack.cpp"
+ RelativePath="..\html\HTMLElementsAllInOne.cpp"
>
</File>
<File
- RelativePath="..\html\HTMLElementStack.h"
+ RelativePath="..\html\HTMLElementStack.cpp"
>
</File>
<File
- RelativePath="..\html\HTMLElementsAllInOne.cpp"
+ RelativePath="..\html\HTMLElementStack.h"
>
</File>
<File
@@ -40385,14 +40429,6 @@
>
</File>
<File
- RelativePath="..\html\HTMLConstructionSite.cpp"
- >
- </File>
- <File
- RelativePath="..\html\HTMLConstructionSite.h"
- >
- </File>
- <File
RelativePath="..\html\HTMLUListElement.cpp"
>
<FileConfiguration
@@ -40605,6 +40641,18 @@
>
</File>
<Filter
+ Name="generic"
+ >
+ <File
+ RelativePath="..\bindings\generic\RuntimeEnabledFeatures.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\generic\RuntimeEnabledFeatures.h"
+ >
+ </File>
+ </Filter>
+ <Filter
Name="js"
>
<File
@@ -40784,6 +40832,62 @@
>
</File>
<File
+ RelativePath="..\bindings\js\IDBBindingUtilities.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\bindings\js\IDBBindingUtilities.h"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\JSAttrCustom.cpp"
>
<FileConfiguration
@@ -42108,6 +42212,58 @@
</FileConfiguration>
</File>
<File
+ RelativePath="..\bindings\js\JSDeviceOrientationEventCustom.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath="..\bindings\js\JSDocumentCustom.cpp"
>
<FileConfiguration
@@ -42376,6 +42532,162 @@
>
</File>
<File
+ RelativePath="..\bindings\js\JSDOMMimeTypeArrayCustom.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSDOMPluginArrayCustom.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSDOMPluginCustom.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath="..\bindings\js\JSDOMStringMapCustom.cpp"
>
<FileConfiguration
@@ -43980,170 +44292,6 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBKey.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\JSIDBKey.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSIDBKeyCustom.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Internal|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_All|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\bindings\js\IDBBindingUtilities.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Internal|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_All|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\bindings\js\IDBBindingUtilities.h"
- >
- </File>
- <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabase.cpp"
>
<FileConfiguration
@@ -44484,7 +44632,7 @@
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBKeyRange.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBKey.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -44536,11 +44684,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBKeyRange.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBKey.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBObjectStoreRequest.cpp"
+ RelativePath="..\bindings\js\JSIDBKeyCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -44592,7 +44740,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBObjectStoreRequest.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBKeyRange.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -44644,11 +44792,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBObjectStoreRequest.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBKeyRange.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBRequest.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBObjectStoreRequest.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -44700,11 +44848,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBRequest.h"
- >
- </File>
- <File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBSuccessEvent.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBObjectStoreRequest.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -44756,11 +44900,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBSuccessEvent.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBObjectStoreRequest.h"
>
</File>
<File
- RelativePath="..\bindings\js\JSImageConstructor.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBRequest.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -44812,11 +44956,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSImageConstructor.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBRequest.h"
>
</File>
<File
- RelativePath="..\bindings\js\JSImageDataCustom.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBSuccessEvent.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -44868,7 +45012,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIndexedDatabaserequest.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBSuccessEvent.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSImageConstructor.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -44920,11 +45068,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIndexedDatabaseRequest.h"
+ RelativePath="..\bindings\js\JSImageConstructor.h"
>
</File>
<File
- RelativePath="..\bindings\js\JSInjectedScriptHostCustom.cpp"
+ RelativePath="..\bindings\js\JSImageDataCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -44976,7 +45124,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSInspectorFrontendHostCustom.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIndexedDatabaserequest.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45028,7 +45176,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSJavaScriptCallFrameCustom.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIndexedDatabaseRequest.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSInjectedScriptHostCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45080,7 +45232,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSLazyEventListener.cpp"
+ RelativePath="..\bindings\js\JSInspectorFrontendHostCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45132,11 +45284,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSLazyEventListener.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSLocationCustom.cpp"
+ RelativePath="..\bindings\js\JSJavaScriptCallFrameCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45188,7 +45336,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSMainThreadExecState.cpp"
+ RelativePath="..\bindings\js\JSLazyEventListener.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45240,11 +45388,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSMainThreadExecState.h"
+ RelativePath="..\bindings\js\JSLazyEventListener.h"
>
</File>
<File
- RelativePath="..\bindings\js\JSMessageChannelCustom.cpp"
+ RelativePath="..\bindings\js\JSLocationCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45296,7 +45444,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSMessageEventCustom.cpp"
+ RelativePath="..\bindings\js\JSMainThreadExecState.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45348,7 +45496,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSMessagePortCustom.cpp"
+ RelativePath="..\bindings\js\JSMainThreadExecState.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSMessageChannelCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45400,11 +45552,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSMessagePortCustom.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSDOMMimeTypeArrayCustom.cpp"
+ RelativePath="..\bindings\js\JSMessageEventCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45456,7 +45604,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNamedNodeMapCustom.cpp"
+ RelativePath="..\bindings\js\JSMessagePortCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45508,7 +45656,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNavigatorCustom.cpp"
+ RelativePath="..\bindings\js\JSMessagePortCustom.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSNamedNodeMapCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45560,7 +45712,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNodeCustom.cpp"
+ RelativePath="..\bindings\js\JSNavigatorCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45612,11 +45764,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNodeCustom.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSNodeFilterCondition.cpp"
+ RelativePath="..\bindings\js\JSNodeCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45668,11 +45816,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNodeFilterCondition.h"
+ RelativePath="..\bindings\js\JSNodeCustom.h"
>
</File>
<File
- RelativePath="..\bindings\js\JSNodeFilterCustom.cpp"
+ RelativePath="..\bindings\js\JSNodeFilterCondition.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45724,59 +45872,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNodeIteratorCustom.cpp"
+ RelativePath="..\bindings\js\JSNodeFilterCondition.h"
>
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Internal|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_All|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNodeListCustom.cpp"
+ RelativePath="..\bindings\js\JSNodeFilterCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45828,7 +45928,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSOptionConstructor.cpp"
+ RelativePath="..\bindings\js\JSNodeIteratorCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45880,11 +45980,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSOptionConstructor.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSDOMPluginArrayCustom.cpp"
+ RelativePath="..\bindings\js\JSNodeListCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45936,7 +46032,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSDOMPluginCustom.cpp"
+ RelativePath="..\bindings\js\JSOptionConstructor.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -45988,6 +46084,10 @@
</FileConfiguration>
</File>
<File
+ RelativePath="..\bindings\js\JSOptionConstructor.h"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\JSPluginElementFunctions.cpp"
>
<FileConfiguration
@@ -48153,27 +48253,27 @@
>
</File>
<File
- RelativePath="..\plugins\npapi.cpp"
+ RelativePath="..\plugins\DOMPlugin.cpp"
>
</File>
<File
- RelativePath="..\plugins\npfunctions.h"
+ RelativePath="..\plugins\DOMPlugin.h"
>
</File>
<File
- RelativePath="..\plugins\DOMPlugin.cpp"
+ RelativePath="..\plugins\DOMPluginArray.cpp"
>
</File>
<File
- RelativePath="..\plugins\DOMPlugin.h"
+ RelativePath="..\plugins\DOMPluginArray.h"
>
</File>
<File
- RelativePath="..\plugins\DOMPluginArray.cpp"
+ RelativePath="..\plugins\npapi.cpp"
>
</File>
<File
- RelativePath="..\plugins\DOMPluginArray.h"
+ RelativePath="..\plugins\npfunctions.h"
>
</File>
<File
@@ -48841,10 +48941,22 @@
>
</File>
<File
+ RelativePath="..\svg\SVGPathBuilder.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\SVGPathConsumer.h"
+ >
+ </File>
+ <File
RelativePath="..\svg\SVGPathElement.h"
>
</File>
<File
+ RelativePath="..\svg\SVGPathParser.h"
+ >
+ </File>
+ <File
RelativePath="..\svg\SVGPathSeg.h"
>
</File>
@@ -48889,6 +49001,10 @@
>
</File>
<File
+ RelativePath="..\svg\SVGPathSegListBuilder.h"
+ >
+ </File>
+ <File
RelativePath="..\svg\SVGPathSegMoveto.h"
>
</File>
@@ -50021,6 +50137,14 @@
>
</File>
<File
+ RelativePath="..\storage\SQLStatementSync.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\SQLStatementSync.h"
+ >
+ </File>
+ <File
RelativePath="..\storage\SQLTransaction.cpp"
>
</File>
diff --git a/WebCore/WebCore.vcproj/WebCoreCommon.vsprops b/WebCore/WebCore.vcproj/WebCoreCommon.vsprops
index 71105bc..537e129 100644
--- a/WebCore/WebCore.vcproj/WebCoreCommon.vsprops
+++ b/WebCore/WebCore.vcproj/WebCoreCommon.vsprops
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioPropertySheet
- ProjectType="Visual C++"
- Version="8.00"
- Name="WebCoreCommon"
- OutputDirectory="$(WebKitOutputDir)\lib"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\accessibility&quot;;&quot;$(ProjectDir)..\accessibility\win&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\bridge\jsc&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\rendering\style&quot;;&quot;$(ProjectDir)..\bindings&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\dom\default&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\html\canvas&quot;;&quot;$(ProjectDir)..\inspector&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\appcache&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\notifications&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\animation&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\animation&quot;;&quot;$(ProjectDir)..\platform\mock&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\graphics\filters&quot;;&quot;$(ProjectDir)..\platform\graphics\opentype&quot;;&quot;$(ProjectDir)..\platform\graphics\transforms&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\text\transcoder&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\svg\animation&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\wml&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(ProjectDir)..\websockets&quot;;&quot;$(ProjectDir)..\workers&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\private&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;;&quot;$(WebKitLibrariesDir)\include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;"
- PreprocessorDefinitions="__WIN32__;DISABLE_3D_RENDERING;WEBCORE_CONTEXT_MENUS"
- UsePrecompiledHeader="2"
- PrecompiledHeaderThrough="WebCorePrefix.h"
- ProgramDataBaseFileName="$(OutDir)\$(TargetName).vc80.pdb"
- ForcedIncludeFiles="WebCorePrefix.h"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine=""
- />
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; /Fo&quot;$(IntDir)\tmp.obj&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 1 (set EnablePREfast=&quot;true&quot;) else (set EnablePREfast=&quot;false&quot;)&#x0D;&#x0A;if ERRORLEVEL 1 (set AnalyzeWithLargeStack=&quot;/analyze:65536&quot;) else (set AnalyzeWithLargeStack=&quot;&quot;)&#x0D;&#x0A;exit /b&#x0D;&#x0A;"
- />
-</VisualStudioPropertySheet>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="WebCoreCommon"
+ OutputDirectory="$(WebKitOutputDir)\lib"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\accessibility&quot;;&quot;$(ProjectDir)..\accessibility\win&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\bridge\jsc&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\rendering\style&quot;;&quot;$(ProjectDir)..\bindings&quot;;&quot;$(ProjectDir)..\bindings\generic&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\dom\default&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\html\canvas&quot;;&quot;$(ProjectDir)..\inspector&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\appcache&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\notifications&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\animation&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\animation&quot;;&quot;$(ProjectDir)..\platform\mock&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\graphics\filters&quot;;&quot;$(ProjectDir)..\platform\graphics\opentype&quot;;&quot;$(ProjectDir)..\platform\graphics\transforms&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\text\transcoder&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\svg\animation&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\wml&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(ProjectDir)..\websockets&quot;;&quot;$(ProjectDir)..\workers&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\private&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;;&quot;$(WebKitLibrariesDir)\include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;"
+ PreprocessorDefinitions="__WIN32__;DISABLE_3D_RENDERING;WEBCORE_CONTEXT_MENUS"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="WebCorePrefix.h"
+ ProgramDataBaseFileName="$(OutDir)\$(TargetName).vc80.pdb"
+ ForcedIncludeFiles="WebCorePrefix.h;ICUVersion.h"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine=""
+ />
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;touch &quot;$(WebKitOutputDir)\tmp.cpp&quot;&#x0D;&#x0A;cl /analyze /nologo /c &quot;$(WebKitOutputDir)\tmp.cpp&quot; /Fo&quot;$(IntDir)\tmp.obj&quot; 2&gt;&amp;1 | findstr D9040&#x0D;&#x0A;if ERRORLEVEL 1 (set EnablePREfast=&quot;true&quot;) else (set EnablePREfast=&quot;false&quot;)&#x0D;&#x0A;if ERRORLEVEL 1 (set AnalyzeWithLargeStack=&quot;/analyze:65536&quot;) else (set AnalyzeWithLargeStack=&quot;&quot;)&#x0D;&#x0A;exit /b&#x0D;&#x0A;"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 1cd25ec..af1949f 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -195,8 +195,7 @@
08E6E0F10EFF42BA00029FBF /* WMLFieldSetElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08E6E0EF0EFF42BA00029FBF /* WMLFieldSetElement.cpp */; };
08E6E0F20EFF42BA00029FBF /* WMLFieldSetElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08E6E0F00EFF42BA00029FBF /* WMLFieldSetElement.h */; };
0A4844990CA44CB200B7BD48 /* SoftLinking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A4844980CA44CB200B7BD48 /* SoftLinking.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 0AFDAC3B10F5448300E1F3D2 /* PluginWidgetMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0AFDAC3A10F5448300E1F3D2 /* PluginWidgetMac.mm */; };
- 0AFDAC3D10F5448C00E1F3D2 /* PluginWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AFDAC3C10F5448C00E1F3D2 /* PluginWidget.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0AFDAC3D10F5448C00E1F3D2 /* PluginViewBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */; };
0B9056190F2578BE0095FF6A /* DocumentThreadableLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */; };
0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */; settings = {ATTRIBUTES = (); }; };
@@ -223,7 +222,7 @@
0F580B0E0F12A2690051D689 /* GraphicsLayerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F580B0B0F12A2690051D689 /* GraphicsLayerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F580CFD0F12DE9B0051D689 /* RenderLayerCompositor.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F580CF90F12DE9B0051D689 /* RenderLayerCompositor.h */; };
0F580CFE0F12DE9B0051D689 /* RenderLayerCompositor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F580CFA0F12DE9B0051D689 /* RenderLayerCompositor.cpp */; };
- 0F580CFF0F12DE9B0051D689 /* RenderLayerBacking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F580CFB0F12DE9B0051D689 /* RenderLayerBacking.h */; };
+ 0F580CFF0F12DE9B0051D689 /* RenderLayerBacking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F580CFB0F12DE9B0051D689 /* RenderLayerBacking.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F580D000F12DE9B0051D689 /* RenderLayerBacking.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F580CFC0F12DE9B0051D689 /* RenderLayerBacking.cpp */; };
0F5B7A5410F65D7A00376302 /* RenderEmbeddedObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5B7A5210F65D7A00376302 /* RenderEmbeddedObject.cpp */; };
0F5B7A5510F65D7A00376302 /* RenderEmbeddedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5B7A5310F65D7A00376302 /* RenderEmbeddedObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1030,7 +1029,7 @@
4F1534E011B533020021FD86 /* EditingBehaviorTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
4F3289B511A42AAB005ABE7E /* InspectorValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F3289B311A42AAB005ABE7E /* InspectorValues.cpp */; };
4F3289B611A42AAB005ABE7E /* InspectorValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F3289B411A42AAB005ABE7E /* InspectorValues.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 4F4F5FFB11CBD2E100A186BF /* RemoteInspectorFrontend2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F4F5FFA11CBD2D200A186BF /* RemoteInspectorFrontend2.cpp */; };
+ 4F4F5FFB11CBD2E100A186BF /* RemoteInspectorFrontend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F4F5FFA11CBD2D200A186BF /* RemoteInspectorFrontend.cpp */; };
4FD8D0F2119C718B002FA825 /* ScriptGCEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */; };
4FD8D0F3119C718B002FA825 /* ScriptGCEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */; };
510184690B08602A004A825F /* CachedPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 510184670B08602A004A825F /* CachedPage.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1071,7 +1070,7 @@
513F14540AB634C400094DDF /* IconLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 513F14520AB634C400094DDF /* IconLoader.h */; };
514185EE0CD65F0400763C99 /* ChangeVersionWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 514185EC0CD65F0400763C99 /* ChangeVersionWrapper.h */; };
514185EF0CD65F0400763C99 /* ChangeVersionWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514185ED0CD65F0400763C99 /* ChangeVersionWrapper.cpp */; };
- 514B3F730C722047000530DF /* FileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 514B3F720C722047000530DF /* FileSystem.h */; };
+ 514B3F730C722047000530DF /* FileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 514B3F720C722047000530DF /* FileSystem.h */; settings = {ATTRIBUTES = (Private, ); }; };
514B3F760C722055000530DF /* FileSystemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 514B3F750C722055000530DF /* FileSystemMac.mm */; };
514C76370CE9225E007EF3CD /* JSSQLError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76350CE9225E007EF3CD /* JSSQLError.cpp */; };
514C76380CE9225E007EF3CD /* JSSQLTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76360CE9225E007EF3CD /* JSSQLTransaction.cpp */; };
@@ -1182,6 +1181,8 @@
54C50F7B0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 54C50F7A0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp */; };
550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* QualifiedName.cpp */; };
550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 590E1B4911E4EF4B0069F784 /* DeviceOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = 590E1B4811E4EF4B0069F784 /* DeviceOrientation.h */; };
+ 590E1B4B11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */; };
5913953B110758450083EC55 /* JNIBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 5913953A110758450083EC55 /* JNIBridge.h */; };
5913953D1107584E0083EC55 /* JNIBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5913953C1107584E0083EC55 /* JNIBridge.cpp */; };
596229781133EFD700DC4CBB /* GeolocationPositionCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 596229771133EFD700DC4CBB /* GeolocationPositionCache.cpp */; };
@@ -1199,6 +1200,7 @@
59B597731108656B007159E8 /* BridgeJSC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59B597721108656B007159E8 /* BridgeJSC.cpp */; };
59B5977511086579007159E8 /* BridgeJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 59B5977411086579007159E8 /* BridgeJSC.h */; settings = {ATTRIBUTES = (Private, ); }; };
59BC393F11054A1300FD85DB /* JavaStringJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 59BC393E11054A1300FD85DB /* JavaStringJSC.h */; };
+ 59D1C10411EB5DCF00B638C8 /* DeviceOrientation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59D1C10311EB5DCF00B638C8 /* DeviceOrientation.cpp */; };
59E560A71105336600AA1258 /* JavaClassJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 59E560A61105336600AA1258 /* JavaClassJSC.h */; };
59E560A91105336F00AA1258 /* JavaClassJSC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59E560A81105336F00AA1258 /* JavaClassJSC.cpp */; };
59E842661109E5A2000305AD /* JNIBridgeJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 59E842651109E5A2000305AD /* JNIBridgeJSC.h */; };
@@ -1342,6 +1344,11 @@
754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */; };
7553CFE8108F473F00EA281E /* TimelineRecordFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */; };
7553CFE9108F473F00EA281E /* TimelineRecordFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */; };
+ 7578F90B11DDF26900D933C5 /* SpeechInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7578F90811DDF26900D933C5 /* SpeechInput.cpp */; };
+ 7578F90C11DDF26900D933C5 /* SpeechInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F90911DDF26900D933C5 /* SpeechInput.h */; };
+ 7578F90D11DDF26900D933C5 /* SpeechInputClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F90A11DDF26900D933C5 /* SpeechInputClient.h */; };
+ 7578F91F11E4E32800D933C5 /* SpeechInputClientListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F91D11E4E32800D933C5 /* SpeechInputClientListener.h */; };
+ 7578F92011E4E32800D933C5 /* SpeechInputListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F91E11E4E32800D933C5 /* SpeechInputListener.h */; };
75793E830D0CE0B3007FC0AC /* MessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */; };
75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793E810D0CE0B3007FC0AC /* MessageEvent.h */; };
75793EC80D0CE72D007FC0AC /* JSMessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75793EC60D0CE72D007FC0AC /* JSMessageEvent.cpp */; };
@@ -1405,6 +1412,13 @@
845E72F80FD261EE00A87D79 /* Filter.h in Headers */ = {isa = PBXBuildFile; fileRef = 845E72F70FD261EE00A87D79 /* Filter.h */; };
845E72FB0FD2623900A87D79 /* SVGFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 845E72F90FD2623900A87D79 /* SVGFilter.cpp */; };
845E72FC0FD2623900A87D79 /* SVGFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 845E72FA0FD2623900A87D79 /* SVGFilter.h */; };
+ 8476C9E511DF6A0B00555B02 /* SVGPathSegListBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8476C9E311DF6A0B00555B02 /* SVGPathSegListBuilder.cpp */; };
+ 8476C9E611DF6A0B00555B02 /* SVGPathSegListBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8476C9E411DF6A0B00555B02 /* SVGPathSegListBuilder.h */; };
+ 8476C9EA11DF6A2900555B02 /* SVGPathBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8476C9E711DF6A2900555B02 /* SVGPathBuilder.cpp */; };
+ 8476C9EB11DF6A2900555B02 /* SVGPathBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8476C9E811DF6A2900555B02 /* SVGPathBuilder.h */; };
+ 8476C9EC11DF6A2900555B02 /* SVGPathConsumer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8476C9E911DF6A2900555B02 /* SVGPathConsumer.h */; };
+ 8476C9EF11DF6A5800555B02 /* SVGPathParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8476C9ED11DF6A5800555B02 /* SVGPathParser.cpp */; };
+ 8476C9F011DF6A5800555B02 /* SVGPathParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 8476C9EE11DF6A5800555B02 /* SVGPathParser.h */; };
84801954108BAFB300CB2B1F /* FEGaussianBlur.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84801952108BAFB300CB2B1F /* FEGaussianBlur.cpp */; };
84801955108BAFB300CB2B1F /* FEGaussianBlur.h in Headers */ = {isa = PBXBuildFile; fileRef = 84801953108BAFB300CB2B1F /* FEGaussianBlur.h */; };
8485227B1190162C006EDC7F /* JSSVGHKernElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 848522771190162C006EDC7F /* JSSVGHKernElement.cpp */; };
@@ -2303,6 +2317,8 @@
895253DF116C4F0600CABF00 /* FileThreadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 895253DE116C4F0600CABF00 /* FileThreadTask.h */; };
8988E10E11A3508B00DB732E /* BlobItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8988E10C11A3508B00DB732E /* BlobItem.cpp */; };
8988E10F11A3508B00DB732E /* BlobItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 8988E10D11A3508B00DB732E /* BlobItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 89B5EAA111E8003D00F2367E /* LineEnding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89B5EA9F11E8003D00F2367E /* LineEnding.cpp */; };
+ 89B5EAA211E8003D00F2367E /* LineEnding.h in Headers */ = {isa = PBXBuildFile; fileRef = 89B5EAA011E8003D00F2367E /* LineEnding.h */; settings = {ATTRIBUTES = (Private, ); }; };
89BED5EB11BE11CE00448492 /* BlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89BED5E911BE11CE00448492 /* BlobBuilder.cpp */; };
89BED5EC11BE11CE00448492 /* BlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 89BED5EA11BE11CE00448492 /* BlobBuilder.h */; };
89CD029311C85B870070B791 /* JSBlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89CD029111C85B870070B791 /* JSBlobBuilder.cpp */; };
@@ -2320,6 +2336,8 @@
8AF4E55611DC5A36000ED3DE /* Navigation.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AF4E55311DC5A36000ED3DE /* Navigation.h */; };
8AF4E55B11DC5A63000ED3DE /* Timing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AF4E55811DC5A63000ED3DE /* Timing.cpp */; };
8AF4E55C11DC5A63000ED3DE /* Timing.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AF4E55911DC5A63000ED3DE /* Timing.h */; };
+ 8C6EA61911EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C6EA61711EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp */; };
+ 8C6EA61A11EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C6EA61811EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h */; };
8FAC774D119872CB0015AE94 /* JSMainThreadExecState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */; };
9302B0BD0D79F82900C7EE83 /* PageGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */; };
9302B0BF0D79F82C00C7EE83 /* PageGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 9302B0BE0D79F82C00C7EE83 /* PageGroup.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2331,7 +2349,7 @@
9307F1130AF2C8BE00DBA31A /* DOMNodeInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85B498FA0ADB340200925CBB /* DOMNodeInternal.h */; };
9307F1D70AF2D59000DBA31A /* HitTestResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9307F1D50AF2D59000DBA31A /* HitTestResult.cpp */; };
9307F1D80AF2D59000DBA31A /* HitTestResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 9307F1D60AF2D59000DBA31A /* HitTestResult.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 930908910AF7EDE40081DF01 /* HitTestRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 930908900AF7EDE40081DF01 /* HitTestRequest.h */; };
+ 930908910AF7EDE40081DF01 /* HitTestRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 930908900AF7EDE40081DF01 /* HitTestRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
930FC68A1072B9280045293E /* TextRenderingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 930FC6891072B9280045293E /* TextRenderingMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
931BCC611124DFCB00BE70DD /* MediaCanStartListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 931BCC601124DFCB00BE70DD /* MediaCanStartListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
9326DC0C09DAD5D600AFC847 /* CharsetData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AC09D14EE6000E61D7 /* CharsetData.cpp */; };
@@ -4291,6 +4309,8 @@
B523CF0B1182675400EBB29C /* DatabaseSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B523CF041182675400EBB29C /* DatabaseSync.h */; };
B525A96511CA2340003A23A8 /* JSSQLException.h in Headers */ = {isa = PBXBuildFile; fileRef = B525A96311CA2340003A23A8 /* JSSQLException.h */; };
B525A96611CA2340003A23A8 /* JSSQLException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B525A96411CA2340003A23A8 /* JSSQLException.cpp */; };
+ B550B52511DC68A800923885 /* SQLStatementSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B550B52111DC68A800923885 /* SQLStatementSync.cpp */; };
+ B550B52611DC68A800923885 /* SQLStatementSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B550B52211DC68A800923885 /* SQLStatementSync.h */; };
B55D5AA4119131FC00BCC315 /* JSSQLTransactionSyncCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B55D5AA2119131FC00BCC315 /* JSSQLTransactionSyncCallback.h */; };
B55D5AA5119131FC00BCC315 /* JSSQLTransactionSyncCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55D5AA3119131FC00BCC315 /* JSSQLTransactionSyncCallback.cpp */; };
B55D5AA81191325000BCC315 /* JSDatabaseSyncCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55D5AA61191325000BCC315 /* JSDatabaseSyncCustom.cpp */; };
@@ -5814,8 +5834,7 @@
08FB84B00ECE373300DC064E /* WMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLElementFactory.cpp; sourceTree = "<group>"; };
08FB84B10ECE373300DC064E /* WMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLElementFactory.h; sourceTree = "<group>"; };
0A4844980CA44CB200B7BD48 /* SoftLinking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoftLinking.h; sourceTree = "<group>"; };
- 0AFDAC3A10F5448300E1F3D2 /* PluginWidgetMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PluginWidgetMac.mm; path = mac/PluginWidgetMac.mm; sourceTree = "<group>"; };
- 0AFDAC3C10F5448C00E1F3D2 /* PluginWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginWidget.h; sourceTree = "<group>"; };
+ 0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginViewBase.h; sourceTree = "<group>"; };
0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderMap.cpp; sourceTree = "<group>"; };
0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentThreadableLoader.cpp; sourceTree = "<group>"; };
0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentThreadableLoader.h; sourceTree = "<group>"; };
@@ -6751,8 +6770,8 @@
4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingBehaviorTypes.h; sourceTree = "<group>"; };
4F3289B311A42AAB005ABE7E /* InspectorValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorValues.cpp; sourceTree = "<group>"; };
4F3289B411A42AAB005ABE7E /* InspectorValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorValues.h; sourceTree = "<group>"; };
- 4F4F5FFA11CBD2D200A186BF /* RemoteInspectorFrontend2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteInspectorFrontend2.cpp; sourceTree = "<group>"; };
- 4F4F5FFC11CBD30100A186BF /* RemoteInspectorFrontend2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteInspectorFrontend2.h; sourceTree = "<group>"; };
+ 4F4F5FFA11CBD2D200A186BF /* RemoteInspectorFrontend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteInspectorFrontend.cpp; sourceTree = "<group>"; };
+ 4F4F5FFC11CBD30100A186BF /* RemoteInspectorFrontend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteInspectorFrontend.h; sourceTree = "<group>"; };
4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptGCEvent.cpp; sourceTree = "<group>"; };
4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptGCEvent.h; sourceTree = "<group>"; };
510184670B08602A004A825F /* CachedPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedPage.h; sourceTree = "<group>"; };
@@ -6920,6 +6939,8 @@
54C50F7A0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLDocumentParserLibxml2.cpp; sourceTree = "<group>"; };
550A0BC7085F6039007353D6 /* QualifiedName.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QualifiedName.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 590E1B4811E4EF4B0069F784 /* DeviceOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceOrientation.h; sourceTree = "<group>"; };
+ 590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDeviceOrientationEventCustom.cpp; sourceTree = "<group>"; };
5913953A110758450083EC55 /* JNIBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JNIBridge.h; sourceTree = "<group>"; };
5913953C1107584E0083EC55 /* JNIBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JNIBridge.cpp; sourceTree = "<group>"; };
596229771133EFD700DC4CBB /* GeolocationPositionCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeolocationPositionCache.cpp; sourceTree = "<group>"; };
@@ -6938,6 +6959,7 @@
59B597721108656B007159E8 /* BridgeJSC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BridgeJSC.cpp; path = bridge/jsc/BridgeJSC.cpp; sourceTree = "<group>"; };
59B5977411086579007159E8 /* BridgeJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BridgeJSC.h; path = bridge/jsc/BridgeJSC.h; sourceTree = "<group>"; };
59BC393E11054A1300FD85DB /* JavaStringJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaStringJSC.h; path = jsc/JavaStringJSC.h; sourceTree = "<group>"; };
+ 59D1C10311EB5DCF00B638C8 /* DeviceOrientation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceOrientation.cpp; sourceTree = "<group>"; };
59E560A61105336600AA1258 /* JavaClassJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaClassJSC.h; path = jsc/JavaClassJSC.h; sourceTree = "<group>"; };
59E560A81105336F00AA1258 /* JavaClassJSC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaClassJSC.cpp; path = jsc/JavaClassJSC.cpp; sourceTree = "<group>"; };
59E842651109E5A2000305AD /* JNIBridgeJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JNIBridgeJSC.h; path = jsc/JNIBridgeJSC.h; sourceTree = "<group>"; };
@@ -7089,6 +7111,11 @@
754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTimelineAgent.cpp; sourceTree = "<group>"; };
7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineRecordFactory.h; sourceTree = "<group>"; };
7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimelineRecordFactory.cpp; sourceTree = "<group>"; };
+ 7578F90811DDF26900D933C5 /* SpeechInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechInput.cpp; sourceTree = "<group>"; };
+ 7578F90911DDF26900D933C5 /* SpeechInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInput.h; sourceTree = "<group>"; };
+ 7578F90A11DDF26900D933C5 /* SpeechInputClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputClient.h; sourceTree = "<group>"; };
+ 7578F91D11E4E32800D933C5 /* SpeechInputClientListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputClientListener.h; sourceTree = "<group>"; };
+ 7578F91E11E4E32800D933C5 /* SpeechInputListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputListener.h; sourceTree = "<group>"; };
75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MessageEvent.cpp; path = dom/MessageEvent.cpp; sourceTree = SOURCE_ROOT; };
75793E810D0CE0B3007FC0AC /* MessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MessageEvent.h; path = dom/MessageEvent.h; sourceTree = SOURCE_ROOT; };
75793E820D0CE0B3007FC0AC /* MessageEvent.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = MessageEvent.idl; path = dom/MessageEvent.idl; sourceTree = SOURCE_ROOT; };
@@ -7158,6 +7185,13 @@
845E72F70FD261EE00A87D79 /* Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Filter.h; path = filters/Filter.h; sourceTree = "<group>"; };
845E72F90FD2623900A87D79 /* SVGFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFilter.cpp; sourceTree = "<group>"; };
845E72FA0FD2623900A87D79 /* SVGFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFilter.h; sourceTree = "<group>"; };
+ 8476C9E311DF6A0B00555B02 /* SVGPathSegListBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegListBuilder.cpp; sourceTree = "<group>"; };
+ 8476C9E411DF6A0B00555B02 /* SVGPathSegListBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegListBuilder.h; sourceTree = "<group>"; };
+ 8476C9E711DF6A2900555B02 /* SVGPathBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathBuilder.cpp; sourceTree = "<group>"; };
+ 8476C9E811DF6A2900555B02 /* SVGPathBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathBuilder.h; sourceTree = "<group>"; };
+ 8476C9E911DF6A2900555B02 /* SVGPathConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathConsumer.h; sourceTree = "<group>"; };
+ 8476C9ED11DF6A5800555B02 /* SVGPathParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathParser.cpp; sourceTree = "<group>"; };
+ 8476C9EE11DF6A5800555B02 /* SVGPathParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathParser.h; sourceTree = "<group>"; };
84801952108BAFB300CB2B1F /* FEGaussianBlur.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEGaussianBlur.cpp; path = filters/FEGaussianBlur.cpp; sourceTree = "<group>"; };
84801953108BAFB300CB2B1F /* FEGaussianBlur.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEGaussianBlur.h; path = filters/FEGaussianBlur.h; sourceTree = "<group>"; };
848522771190162C006EDC7F /* JSSVGHKernElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGHKernElement.cpp; sourceTree = "<group>"; };
@@ -8005,6 +8039,8 @@
895253DE116C4F0600CABF00 /* FileThreadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileThreadTask.h; sourceTree = "<group>"; };
8988E10C11A3508B00DB732E /* BlobItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobItem.cpp; sourceTree = "<group>"; };
8988E10D11A3508B00DB732E /* BlobItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobItem.h; sourceTree = "<group>"; };
+ 89B5EA9F11E8003D00F2367E /* LineEnding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineEnding.cpp; sourceTree = "<group>"; };
+ 89B5EAA011E8003D00F2367E /* LineEnding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineEnding.h; sourceTree = "<group>"; };
89BED5E911BE11CE00448492 /* BlobBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobBuilder.cpp; sourceTree = "<group>"; };
89BED5EA11BE11CE00448492 /* BlobBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobBuilder.h; sourceTree = "<group>"; };
89CD027911C859A80070B791 /* BlobBuilder.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BlobBuilder.idl; sourceTree = "<group>"; };
@@ -8026,6 +8062,8 @@
8AF4E55811DC5A63000ED3DE /* Timing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Timing.cpp; sourceTree = "<group>"; };
8AF4E55911DC5A63000ED3DE /* Timing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timing.h; sourceTree = "<group>"; };
8AF4E55A11DC5A63000ED3DE /* Timing.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Timing.idl; sourceTree = "<group>"; };
+ 8C6EA61711EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RuntimeEnabledFeatures.cpp; path = generic/RuntimeEnabledFeatures.cpp; sourceTree = "<group>"; };
+ 8C6EA61811EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RuntimeEnabledFeatures.h; path = generic/RuntimeEnabledFeatures.h; sourceTree = "<group>"; };
8F934D831189F1EE00508D5D /* JSMainThreadExecState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMainThreadExecState.h; sourceTree = "<group>"; };
8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMainThreadExecState.cpp; sourceTree = "<group>"; };
9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroup.cpp; sourceTree = "<group>"; };
@@ -9875,6 +9913,8 @@
B523CF041182675400EBB29C /* DatabaseSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseSync.h; sourceTree = "<group>"; };
B525A96311CA2340003A23A8 /* JSSQLException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLException.h; sourceTree = "<group>"; };
B525A96411CA2340003A23A8 /* JSSQLException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLException.cpp; sourceTree = "<group>"; };
+ B550B52111DC68A800923885 /* SQLStatementSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLStatementSync.cpp; sourceTree = "<group>"; };
+ B550B52211DC68A800923885 /* SQLStatementSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLStatementSync.h; sourceTree = "<group>"; };
B55D5AA2119131FC00BCC315 /* JSSQLTransactionSyncCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLTransactionSyncCallback.h; sourceTree = "<group>"; };
B55D5AA3119131FC00BCC315 /* JSSQLTransactionSyncCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLTransactionSyncCallback.cpp; sourceTree = "<group>"; };
B55D5AA61191325000BCC315 /* JSDatabaseSyncCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDatabaseSyncCustom.cpp; sourceTree = "<group>"; };
@@ -10945,8 +10985,8 @@
034768DFFF38A50411DB9C8B /* Products */ = {
isa = PBXGroup;
children = (
- 93F19B1A08245E5A001E9ABC /* WebCore.framework */,
5D87BB4F11E3EAEB00702B6F /* WebCoreExportFileGenerator */,
+ 93F19B1A08245E5A001E9ABC /* WebCore.framework */,
);
name = Products;
sourceTree = SOURCE_ROOT;
@@ -11052,14 +11092,6 @@
tabWidth = 4;
usesTabs = 0;
};
- 0AFDAC3610F5447400E1F3D2 /* mac */ = {
- isa = PBXGroup;
- children = (
- 0AFDAC3A10F5448300E1F3D2 /* PluginWidgetMac.mm */,
- );
- name = mac;
- sourceTree = "<group>";
- };
14DFB33F0A7DF7630018F769 /* Derived Sources */ = {
isa = PBXGroup;
children = (
@@ -11335,6 +11367,8 @@
B59DD68E1190298E007E9684 /* SQLStatementCallback.idl */,
1A7CCB160CD9469A00B7B64E /* SQLStatementErrorCallback.h */,
B59DD68F1190298E007E9684 /* SQLStatementErrorCallback.idl */,
+ B550B52111DC68A800923885 /* SQLStatementSync.cpp */,
+ B550B52211DC68A800923885 /* SQLStatementSync.h */,
1ABFE7520CD968D000FE4834 /* SQLTransaction.cpp */,
1A7CCB220CD946FD00B7B64E /* SQLTransaction.h */,
1A7CCB230CD946FD00B7B64E /* SQLTransaction.idl */,
@@ -11394,8 +11428,8 @@
9FA37EF71172FD9300C4CD55 /* JSScriptProfile.h */,
9FA37EF81172FD9300C4CD55 /* JSScriptProfileNode.cpp */,
9FA37EF91172FD9300C4CD55 /* JSScriptProfileNode.h */,
- 4F4F5FFA11CBD2D200A186BF /* RemoteInspectorFrontend2.cpp */,
- 4F4F5FFC11CBD30100A186BF /* RemoteInspectorFrontend2.h */,
+ 4F4F5FFA11CBD2D200A186BF /* RemoteInspectorFrontend.cpp */,
+ 4F4F5FFC11CBD30100A186BF /* RemoteInspectorFrontend.h */,
);
name = Inspector;
sourceTree = "<group>";
@@ -11912,12 +11946,12 @@
children = (
9363B6290F8E8FE000803810 /* cf */,
5160F4920B0AA71500C1D2AF /* mac */,
- 51741D0B0B07259A00ED442C /* BackForwardList.h */,
- BCA8CA5D11E4E6D100812FB7 /* BackForwardListImpl.cpp */,
- BCA8CA5E11E4E6D100812FB7 /* BackForwardListImpl.h */,
BCA8C81D11E3D36900812FB7 /* BackForwardController.cpp */,
BCA8C81C11E3D36900812FB7 /* BackForwardController.h */,
BCA8C83011E3D53200812FB7 /* BackForwardControllerClient.h */,
+ 51741D0B0B07259A00ED442C /* BackForwardList.h */,
+ BCA8CA5D11E4E6D100812FB7 /* BackForwardListImpl.cpp */,
+ BCA8CA5E11E4E6D100812FB7 /* BackForwardListImpl.h */,
51C0AA400F2AA15E001648C2 /* CachedFrame.cpp */,
51C0AA380F2AA10A001648C2 /* CachedFrame.h */,
51CBFC980D10E483002DBF51 /* CachedFramePlatformData.h */,
@@ -12003,7 +12037,6 @@
5DCF83690D59157800953BC6 /* plugins */ = {
isa = PBXGroup;
children = (
- 0AFDAC3610F5447400E1F3D2 /* mac */,
A9C6E4E10D745E05006442E9 /* DOMMimeType.cpp */,
A9C6E4E20D745E05006442E9 /* DOMMimeType.h */,
A9C6E65E0D7466F2006442E9 /* DOMMimeType.idl */,
@@ -12013,17 +12046,17 @@
A9C6E4E90D745E2B006442E9 /* DOMPlugin.cpp */,
A9C6E4EA0D745E2B006442E9 /* DOMPlugin.h */,
A9C6E6600D74670C006442E9 /* DOMPlugin.idl */,
- 1A219B3A0DCA87AB0040E3A0 /* npfunctions.h */,
A9C6E4ED0D745E38006442E9 /* DOMPluginArray.cpp */,
A9C6E4EE0D745E38006442E9 /* DOMPluginArray.h */,
A9C6E6610D74671E006442E9 /* DOMPluginArray.idl */,
+ 1A219B3A0DCA87AB0040E3A0 /* npfunctions.h */,
A9C6E4F10D745E48006442E9 /* PluginData.cpp */,
A9C6E4F20D745E48006442E9 /* PluginData.h */,
1ADA140E0E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp */,
1ADA140F0E1AE5D900023EE5 /* PluginMainThreadScheduler.h */,
1AA8798F11CBE846003C664F /* PluginStrategy.h */,
+ 0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */,
76FF17E211235673001D61B5 /* PluginViewNone.cpp */,
- 0AFDAC3C10F5448C00E1F3D2 /* PluginWidget.h */,
);
path = plugins;
sourceTree = "<group>";
@@ -12331,6 +12364,11 @@
F587863A02DE3A1401EA4122 /* Settings.h */,
626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */,
626CDE0D1140424C001E5A68 /* SpatialNavigation.h */,
+ 7578F90811DDF26900D933C5 /* SpeechInput.cpp */,
+ 7578F90911DDF26900D933C5 /* SpeechInput.h */,
+ 7578F90A11DDF26900D933C5 /* SpeechInputClient.h */,
+ 7578F91D11E4E32800D933C5 /* SpeechInputClientListener.h */,
+ 7578F91E11E4E32800D933C5 /* SpeechInputListener.h */,
62C1217A11AB9E76003C462C /* SuspendableTimer.cpp */,
62C1217B11AB9E77003C462C /* SuspendableTimer.h */,
8AF4E55811DC5A63000ED3DE /* Timing.cpp */,
@@ -13691,6 +13729,8 @@
A8DF3FC9097FA0FB0052981B /* HTMLCollection.cpp */,
A8DF3FC8097FA0FB0052981B /* HTMLCollection.h */,
85DF2F690AA3C74300AD64C5 /* HTMLCollection.idl */,
+ 97EF560E11E40783007E026F /* HTMLConstructionSite.cpp */,
+ 97EF560F11E40783007E026F /* HTMLConstructionSite.h */,
BC77CDB70FEFF1210070887B /* HTMLDataGridCellElement.cpp */,
BC77CDBB0FEFF1420070887B /* HTMLDataGridCellElement.h */,
BC77CDA20FEFEB530070887B /* HTMLDataGridCellElement.idl */,
@@ -13720,8 +13760,6 @@
1A494E290A12354300FDAFC1 /* HTMLDocument.idl */,
A871038811A2947000DBD50E /* HTMLDocumentParser.cpp */,
A871038911A2947000DBD50E /* HTMLDocumentParser.h */,
- 97EF560E11E40783007E026F /* HTMLConstructionSite.cpp */,
- 97EF560F11E40783007E026F /* HTMLConstructionSite.h */,
F523D23E02DE4396018635CA /* HTMLElement.cpp */,
F523D23F02DE4396018635CA /* HTMLElement.h */,
1A494BBB0A122DCD00FDAFC1 /* HTMLElement.idl */,
@@ -15061,9 +15099,14 @@
B22278BF0D00BF200071B782 /* SVGPaint.idl */,
B22278C00D00BF200071B782 /* SVGParserUtilities.cpp */,
B22278C10D00BF200071B782 /* SVGParserUtilities.h */,
+ 8476C9E711DF6A2900555B02 /* SVGPathBuilder.cpp */,
+ 8476C9E811DF6A2900555B02 /* SVGPathBuilder.h */,
+ 8476C9E911DF6A2900555B02 /* SVGPathConsumer.h */,
B22278C20D00BF200071B782 /* SVGPathElement.cpp */,
B22278C30D00BF200071B782 /* SVGPathElement.h */,
B22278C40D00BF200071B782 /* SVGPathElement.idl */,
+ 8476C9ED11DF6A5800555B02 /* SVGPathParser.cpp */,
+ 8476C9EE11DF6A5800555B02 /* SVGPathParser.h */,
B22278C50D00BF200071B782 /* SVGPathSeg.h */,
B22278C60D00BF200071B782 /* SVGPathSeg.idl */,
B22278C70D00BF200071B782 /* SVGPathSegArc.cpp */,
@@ -15104,6 +15147,8 @@
B22278EA0D00BF200071B782 /* SVGPathSegList.cpp */,
B22278EB0D00BF200071B782 /* SVGPathSegList.h */,
B22278EC0D00BF210071B782 /* SVGPathSegList.idl */,
+ 8476C9E311DF6A0B00555B02 /* SVGPathSegListBuilder.cpp */,
+ 8476C9E411DF6A0B00555B02 /* SVGPathSegListBuilder.h */,
B22278ED0D00BF210071B782 /* SVGPathSegMoveto.cpp */,
B22278EE0D00BF210071B782 /* SVGPathSegMoveto.h */,
B22278EF0D00BF210071B782 /* SVGPathSegMovetoAbs.idl */,
@@ -15480,6 +15525,8 @@
B2C3D9F40D006C1D00EF6F26 /* BidiResolver.h */,
B2C3D9F50D006C1D00EF6F26 /* CharacterNames.h */,
375CD231119D43C800A2A859 /* Hyphenation.h */,
+ 89B5EA9F11E8003D00F2367E /* LineEnding.cpp */,
+ 89B5EAA011E8003D00F2367E /* LineEnding.h */,
BC76AC110DD7AD5C00415F34 /* ParserUtilities.h */,
B2C3D9FB0D006C1D00EF6F26 /* PlatformString.h */,
B2C3D9FC0D006C1D00EF6F26 /* RegularExpression.cpp */,
@@ -15565,6 +15612,8 @@
BC1A3790097C6F970019F3D8 /* bindings */ = {
isa = PBXGroup;
children = (
+ 8C6EA61711EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp */,
+ 8C6EA61811EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h */,
BC1A3793097C6FB10019F3D8 /* js */,
BC1A3794097C6FC40019F3D8 /* objc */,
93F8B3050A300FE100F61AB8 /* CodeGenerator.pm */,
@@ -15738,12 +15787,13 @@
BC77D1510FF19C730070887B /* JSDataGridColumnListCustom.cpp */,
4162A453101145E300DFF3ED /* JSDedicatedWorkerContextCustom.cpp */,
33503CBF10179C1A003B47E1 /* JSDesktopNotificationsCustom.cpp */,
+ 590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */,
49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
1AC226160DB69F740089B669 /* JSDOMApplicationCacheCustom.cpp */,
2E0888E5114884E200AF4265 /* JSDOMFormDataCustom.cpp */,
A9C6E6460D7465CA006442E9 /* JSDOMMimeTypeArrayCustom.cpp */,
- A9C6E64B0D7465E7006442E9 /* JSDOMPluginCustom.cpp */,
A9C6E64A0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp */,
+ A9C6E64B0D7465E7006442E9 /* JSDOMPluginCustom.cpp */,
BC64649B11D8238C006455B0 /* JSDOMStringMapCustom.cpp */,
BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */,
652FBBBB0DE27CB60001D386 /* JSDOMWindowCustom.h */,
@@ -16875,9 +16925,11 @@
BC64641A11D7F416006455B0 /* DatasetDOMStringMap.h */,
A8C228A011D5722E00D5A7D3 /* DecodedDataDocumentParser.cpp */,
A8C2289F11D5722E00D5A7D3 /* DecodedDataDocumentParser.h */,
+ 59D1C10311EB5DCF00B638C8 /* DeviceOrientation.cpp */,
+ 590E1B4811E4EF4B0069F784 /* DeviceOrientation.h */,
+ 59A8F1D711A69520001AC34A /* DeviceOrientationClient.h */,
59A8F1D311A69508001AC34A /* DeviceOrientationController.cpp */,
59A8F1D511A69513001AC34A /* DeviceOrientationController.h */,
- 59A8F1D711A69520001AC34A /* DeviceOrientationClient.h */,
59A85EA1119D68D900DEF1EF /* DeviceOrientationEvent.cpp */,
59A85EA3119D68EC00DEF1EF /* DeviceOrientationEvent.h */,
59A85EAA119D7B6E00DEF1EF /* DeviceOrientationEvent.idl */,
@@ -17188,7 +17240,10 @@
51E1ECB30C91C55600DC255B /* AutodrainedPool.h in Headers */,
A8CFF04E0A154F09000A4234 /* AutoTableLayout.h in Headers */,
29A812380FBB9C1D00510293 /* AXObjectCache.h in Headers */,
+ BCA8C81E11E3D36900812FB7 /* BackForwardController.h in Headers */,
+ BCA8C83111E3D53200812FB7 /* BackForwardControllerClient.h in Headers */,
51741D0F0B07259A00ED442C /* BackForwardList.h in Headers */,
+ BCA8CA6011E4E6D100812FB7 /* BackForwardListImpl.h in Headers */,
BC124EE80C2641CD009E2349 /* BarInfo.h in Headers */,
B2C3DA220D006C1D00EF6F26 /* Base64.h in Headers */,
BC9462D8107A7B4C00857193 /* BeforeLoadEvent.h in Headers */,
@@ -17381,8 +17436,9 @@
93309DE1099E64920056E581 /* DeleteSelectionCommand.h in Headers */,
93F1998208245E59001E9ABC /* DeprecatedPtrList.h in Headers */,
93F1996D08245E59001E9ABC /* DeprecatedPtrListImpl.h in Headers */,
- 59A8F1D611A69513001AC34A /* DeviceOrientationController.h in Headers */,
+ 590E1B4911E4EF4B0069F784 /* DeviceOrientation.h in Headers */,
59A8F1D811A69520001AC34A /* DeviceOrientationClient.h in Headers */,
+ 59A8F1D611A69513001AC34A /* DeviceOrientationController.h in Headers */,
59A85EA4119D68EC00DEF1EF /* DeviceOrientationEvent.h in Headers */,
B2F34FE60E82F81400F627CD /* DNS.h in Headers */,
BCB16C2A0979C3BD00467741 /* DocLoader.h in Headers */,
@@ -17613,6 +17669,8 @@
75793ED50D0CE85B007FC0AC /* DOMMessageEventInternal.h in Headers */,
E1ACAF4D0E791AAF0087D12B /* DOMMessagePort.h in Headers */,
E1ADEDD50E76BD60004A1A5E /* DOMMessagePortInternal.h in Headers */,
+ A9C6E4E40D745E05006442E9 /* DOMMimeType.h in Headers */,
+ A9C6E4E80D745E18006442E9 /* DOMMimeTypeArray.h in Headers */,
857E0B250AB043460036E447 /* DOMMouseEvent.h in Headers */,
85989DCD0ACC8BBD00A0BC51 /* DOMMouseEventInternal.h in Headers */,
85C7F5BF0AAFB7CC004014DD /* DOMMutationEvent.h in Headers */,
@@ -17634,6 +17692,8 @@
85989DCF0ACC8BBD00A0BC51 /* DOMOverflowEventInternal.h in Headers */,
E1284BD61044A01E00EAEB52 /* DOMPageTransitionEvent.h in Headers */,
1ACE53E80A8D18E70022947D /* DOMParser.h in Headers */,
+ A9C6E4EC0D745E2B006442E9 /* DOMPlugin.h in Headers */,
+ A9C6E4F00D745E38006442E9 /* DOMPluginArray.h in Headers */,
BC1A37BB097C715F0019F3D8 /* DOMPrivate.h in Headers */,
85F56A7A0A98CE3700ADB60A /* DOMProcessingInstruction.h in Headers */,
85E711D50AC5D5350053270F /* DOMProcessingInstructionInternal.h in Headers */,
@@ -18285,6 +18345,7 @@
A81369D2097374F600D74463 /* HTMLButtonElement.h in Headers */,
93F199E508245E59001E9ABC /* HTMLCanvasElement.h in Headers */,
A8DF3FD0097FA0FC0052981B /* HTMLCollection.h in Headers */,
+ 97EF561111E40783007E026F /* HTMLConstructionSite.h in Headers */,
BC77CDBC0FEFF1420070887B /* HTMLDataGridCellElement.h in Headers */,
BC77CB870FEBF5AF0070887B /* HTMLDataGridColElement.h in Headers */,
BC212A1F0FE8333200EC3708 /* HTMLDataGridElement.h in Headers */,
@@ -18383,6 +18444,27 @@
1A2D753D0DE47FAB00F0A648 /* IconFetcher.h in Headers */,
513F14540AB634C400094DDF /* IconLoader.h in Headers */,
51E1ECC10C91C90400DC255B /* IconRecord.h in Headers */,
+ C585A6CD11D4FB3D004C3E4B /* IDBAny.h in Headers */,
+ C585A66311D4FAC5004C3E4B /* IDBBindingUtilities.h in Headers */,
+ C585A6CF11D4FB3D004C3E4B /* IDBCallbacks.h in Headers */,
+ C585A6D011D4FB3D004C3E4B /* IDBDatabase.h in Headers */,
+ C585A6D111D4FB3D004C3E4B /* IDBDatabaseError.h in Headers */,
+ C585A6D311D4FB3D004C3E4B /* IDBDatabaseException.h in Headers */,
+ C585A6D611D4FB3D004C3E4B /* IDBDatabaseImpl.h in Headers */,
+ C585A6D811D4FB3D004C3E4B /* IDBDatabaseRequest.h in Headers */,
+ C585A6DB11D4FB3D004C3E4B /* IDBErrorEvent.h in Headers */,
+ C585A6DE11D4FB3D004C3E4B /* IDBEvent.h in Headers */,
+ C585A6E011D4FB3D004C3E4B /* IDBIndex.h in Headers */,
+ C585A6E211D4FB3D004C3E4B /* IDBIndexImpl.h in Headers */,
+ C585A6E411D4FB3D004C3E4B /* IDBIndexRequest.h in Headers */,
+ C585A6E711D4FB3D004C3E4B /* IDBKey.h in Headers */,
+ C585A6EA11D4FB3D004C3E4B /* IDBKeyRange.h in Headers */,
+ C585A6EC11D4FB3D004C3E4B /* IDBKeyTree.h in Headers */,
+ C585A6ED11D4FB3D004C3E4B /* IDBObjectStore.h in Headers */,
+ C585A6EF11D4FB3D004C3E4B /* IDBObjectStoreImpl.h in Headers */,
+ C585A6F111D4FB3D004C3E4B /* IDBObjectStoreRequest.h in Headers */,
+ C585A6F411D4FB3D004C3E4B /* IDBRequest.h in Headers */,
+ C585A6F711D4FB3D004C3E4B /* IDBSuccessEvent.h in Headers */,
1A71D57C0F33819000F9CE4E /* IdentifierRep.h in Headers */,
49E911C50EF86D47009D0CAF /* IdentityTransformOperation.h in Headers */,
C0C054CD1118C8E400CE2636 /* IDLParser.pm in Headers */,
@@ -18398,6 +18480,9 @@
4B3480940EEF50D400AC1B41 /* ImageSourceCG.h in Headers */,
316FE1180E6E1DA700BF6088 /* ImplicitAnimation.h in Headers */,
DB23C2CC0A508D29002489EB /* IndentOutdentCommand.h in Headers */,
+ C585A6FA11D4FB3D004C3E4B /* IndexedDatabase.h in Headers */,
+ C585A6FC11D4FB3D004C3E4B /* IndexedDatabaseImpl.h in Headers */,
+ C585A6FE11D4FB3D004C3E4B /* IndexedDatabaseRequest.h in Headers */,
F3644B001119805900E0D537 /* InjectedScript.h in Headers */,
7A0E76FA10BF08ED00A0276E /* InjectedScriptHost.h in Headers */,
A8CFF5E50A155A05000A4234 /* InlineBox.h in Headers */,
@@ -18411,6 +18496,7 @@
93309DEE099E64920056E581 /* InsertNodeBeforeCommand.h in Headers */,
93309DF0099E64920056E581 /* InsertParagraphSeparatorCommand.h in Headers */,
93309DF2099E64920056E581 /* InsertTextCommand.h in Headers */,
+ B885E8D511E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h in Headers */,
7A74ECBB101839A600BF939E /* InspectorBackend.h in Headers */,
1C81B95C0E97330800266E07 /* InspectorClient.h in Headers */,
1C81B95A0E97330800266E07 /* InspectorController.h in Headers */,
@@ -18510,7 +18596,11 @@
2E0888D51148848A00AF4265 /* JSDOMFormData.h in Headers */,
E1C36C030EB076D6007410BC /* JSDOMGlobalObject.h in Headers */,
65DF31F809D1CC60000BE325 /* JSDOMImplementation.h in Headers */,
+ A9D248070D757E7D00FDF959 /* JSDOMMimeType.h in Headers */,
+ A9D248090D757E7D00FDF959 /* JSDOMMimeTypeArray.h in Headers */,
1ACE53E00A8D18810022947D /* JSDOMParser.h in Headers */,
+ A9D247FF0D757E6900FDF959 /* JSDOMPlugin.h in Headers */,
+ A9D248010D757E6900FDF959 /* JSDOMPluginArray.h in Headers */,
BC5A86B60C3367E800EEA649 /* JSDOMSelection.h in Headers */,
C5137CF311A58378004ADB99 /* JSDOMStringList.h in Headers */,
BC64649811D82349006455B0 /* JSDOMStringMap.h in Headers */,
@@ -18610,8 +18700,21 @@
A80E7B0C0A19D606007FB8C5 /* JSHTMLTitleElement.h in Headers */,
1A85B2110A1B258700D8C87C /* JSHTMLUListElement.h in Headers */,
E44614170CD6826900FADA75 /* JSHTMLVideoElement.h in Headers */,
+ C585A67D11D4FB08004C3E4B /* JSIDBAny.h in Headers */,
+ C585A67F11D4FB08004C3E4B /* JSIDBDatabaseError.h in Headers */,
+ C585A68111D4FB08004C3E4B /* JSIDBDatabaseException.h in Headers */,
+ C585A68311D4FB08004C3E4B /* JSIDBDatabaseRequest.h in Headers */,
+ C585A68511D4FB08004C3E4B /* JSIDBErrorEvent.h in Headers */,
+ C585A68711D4FB08004C3E4B /* JSIDBEvent.h in Headers */,
+ C585A68911D4FB08004C3E4B /* JSIDBIndexRequest.h in Headers */,
+ C585A68B11D4FB08004C3E4B /* JSIDBKey.h in Headers */,
+ C585A68D11D4FB08004C3E4B /* JSIDBKeyRange.h in Headers */,
+ C585A68F11D4FB08004C3E4B /* JSIDBObjectStoreRequest.h in Headers */,
+ C585A69111D4FB08004C3E4B /* JSIDBRequest.h in Headers */,
+ C585A69311D4FB08004C3E4B /* JSIDBSuccessEvent.h in Headers */,
BC6C49F40D7DBA0500FFA558 /* JSImageConstructor.h in Headers */,
A77979290D6B9E64003851B9 /* JSImageData.h in Headers */,
+ C585A69711D4FB13004C3E4B /* JSIndexedDatabaseRequest.h in Headers */,
7A0E76DB10BF059800A0276E /* JSInjectedScriptHost.h in Headers */,
41F060CE0F5EEB2B00A07EAC /* JSInspectorBackend.h in Headers */,
7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */,
@@ -18629,11 +18732,10 @@
75793EC90D0CE72D007FC0AC /* JSMessageEvent.h in Headers */,
E1ADEDDA0E76BD93004A1A5E /* JSMessagePort.h in Headers */,
41F584C7104652CB009CAA64 /* JSMessagePortCustom.h in Headers */,
- A9D248070D757E7D00FDF959 /* JSDOMMimeType.h in Headers */,
- A9D248090D757E7D00FDF959 /* JSDOMMimeTypeArray.h in Headers */,
A86629D109DA2B48009633A5 /* JSMouseEvent.h in Headers */,
65DF31FC09D1CC60000BE325 /* JSMutationEvent.h in Headers */,
BCD9C2C10C17B69E005C90A2 /* JSNamedNodeMap.h in Headers */,
+ 8A9A587111E84C36008ACFD1 /* JSNavigation.h in Headers */,
A9D247F80D757E3400FDF959 /* JSNavigator.h in Headers */,
BC9439C3116CF4940048C750 /* JSNodeCustom.h in Headers */,
14115B7309F84CD600CA4FC1 /* JSNodeFilter.h in Headers */,
@@ -18646,8 +18748,7 @@
A826E8AE0A1A8F2300CD1BB6 /* JSOptionConstructor.h in Headers */,
1A0D57410A5C7867007EDD4C /* JSOverflowEvent.h in Headers */,
E1284BB110449FFA00EAEB52 /* JSPageTransitionEvent.h in Headers */,
- A9D247FF0D757E6900FDF959 /* JSDOMPlugin.h in Headers */,
- A9D248010D757E6900FDF959 /* JSDOMPluginArray.h in Headers */,
+ 8A9A587511E84C81008ACFD1 /* JSPerformance.h in Headers */,
93B70D6C09EB0C7C009D8468 /* JSPluginElementFunctions.h in Headers */,
5189F01E10B37BD900F3C739 /* JSPopStateEvent.h in Headers */,
FE80DA720E9C472F000D6F75 /* JSPositionError.h in Headers */,
@@ -18820,6 +18921,7 @@
933A14B90B7D1D5200A53FFD /* JSTextEvent.h in Headers */,
BCEF45F60E687B5C001C1287 /* JSTextMetrics.h in Headers */,
E446141B0CD6826900FADA75 /* JSTimeRanges.h in Headers */,
+ 8A9A588811E84F37008ACFD1 /* JSTiming.h in Headers */,
1A750D5D0A90DEE1000FF215 /* JSTreeWalker.h in Headers */,
A86629CF09DA2B47009633A5 /* JSUIEvent.h in Headers */,
49EECF0D105070C400099FAB /* JSUint16Array.h in Headers */,
@@ -18882,6 +18984,7 @@
BCFF64920EAD15C200C1D6F7 /* LengthSize.h in Headers */,
B22279650D00BF220071B782 /* LinearGradientAttributes.h in Headers */,
AB31C91E10AE1B8E000C7B92 /* LineClampValue.h in Headers */,
+ 89B5EAA211E8003D00F2367E /* LineEnding.h in Headers */,
A7AD2F880EC89D07008AB002 /* LinkHash.h in Headers */,
BCB16C2D0979C3BD00467741 /* loader.h in Headers */,
656D37320ADBA5DE00A4554D /* LoaderNSURLExtras.h in Headers */,
@@ -18919,8 +19022,6 @@
75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */,
E1ADECBF0E76ACF1004A1A5E /* MessagePort.h in Headers */,
41BF700C0FE86F49005E8DEC /* MessagePortChannel.h in Headers */,
- A9C6E4E40D745E05006442E9 /* DOMMimeType.h in Headers */,
- A9C6E4E80D745E18006442E9 /* DOMMimeTypeArray.h in Headers */,
BC772C4F0C4EB3040083285F /* MIMETypeRegistry.h in Headers */,
C6D74AD509AA282E000B0A52 /* ModifySelectionListLevel.h in Headers */,
85031B460A44EFC700F992E0 /* MouseEvent.h in Headers */,
@@ -19004,15 +19105,13 @@
1AD8F81B11CAB9E900E93E54 /* PlatformStrategies.h in Headers */,
B2C3DA2B0D006C1D00EF6F26 /* PlatformString.h in Headers */,
935C476B09AC4D4F00A6AAB4 /* PlatformWheelEvent.h in Headers */,
- A9C6E4EC0D745E2B006442E9 /* DOMPlugin.h in Headers */,
- A9C6E4F00D745E38006442E9 /* DOMPluginArray.h in Headers */,
A9C6E4F40D745E48006442E9 /* PluginData.h in Headers */,
1AC694C80A3B1676003F5049 /* PluginDocument.h in Headers */,
7693BAD4106C2DCA007B0823 /* PluginHalter.h in Headers */,
7693BAD5106C2DCA007B0823 /* PluginHalterClient.h in Headers */,
1ADA14110E1AE5D900023EE5 /* PluginMainThreadScheduler.h in Headers */,
1AA8799011CBE846003C664F /* PluginStrategy.h in Headers */,
- 0AFDAC3D10F5448C00E1F3D2 /* PluginWidget.h in Headers */,
+ 0AFDAC3D10F5448C00E1F3D2 /* PluginViewBase.h in Headers */,
B2B1F7170D00CAA8004AEA64 /* PointerEventsHitRules.h in Headers */,
97059978107D975200A50A7C /* PolicyCallback.h in Headers */,
9705997A107D975200A50A7C /* PolicyChecker.h in Headers */,
@@ -19188,6 +19287,7 @@
416E75CB0EDF90C700360E1D /* ScriptCallFrame.h in Headers */,
416E75BE0EDF8FD700360E1D /* ScriptCallStack.h in Headers */,
93B70D7009EB0C7C009D8468 /* ScriptController.h in Headers */,
+ CE02F0C411E83ADD00C6684A /* ScriptControllerBase.h in Headers */,
7AFD4FF4113277B60035B883 /* ScriptDebugListener.h in Headers */,
9F6FC1971122E82A00E80196 /* ScriptDebugServer.h in Headers */,
08A484780E5272C500C3FE76 /* ScriptElement.h in Headers */,
@@ -19253,6 +19353,10 @@
84A81F420FC7E02700955300 /* SourceGraphic.h in Headers */,
D01A27AE10C9BFD800026A42 /* SpaceSplitString.h in Headers */,
626CDE0F1140424C001E5A68 /* SpatialNavigation.h in Headers */,
+ 7578F90C11DDF26900D933C5 /* SpeechInput.h in Headers */,
+ 7578F90D11DDF26900D933C5 /* SpeechInputClient.h in Headers */,
+ 7578F91F11E4E32800D933C5 /* SpeechInputClientListener.h in Headers */,
+ 7578F92011E4E32800D933C5 /* SpeechInputListener.h in Headers */,
93309E12099E64920056E581 /* SplitElementCommand.h in Headers */,
93309E14099E64920056E581 /* SplitTextNodeCommand.h in Headers */,
93309E16099E64920056E581 /* SplitTextNodeContainingElementCommand.h in Headers */,
@@ -19267,6 +19371,7 @@
515B03990CD1642A00B7EA9C /* SQLStatement.h in Headers */,
1A7CCB190CD9469A00B7B64E /* SQLStatementCallback.h in Headers */,
1A7CCB1A0CD9469A00B7B64E /* SQLStatementErrorCallback.h in Headers */,
+ B550B52611DC68A800923885 /* SQLStatementSync.h in Headers */,
1A7CCB240CD946FD00B7B64E /* SQLTransaction.h in Headers */,
1A7CCB1B0CD9469A00B7B64E /* SQLTransactionCallback.h in Headers */,
B51BF6F1102C9E590002C15A /* SQLTransactionClient.h in Headers */,
@@ -19439,7 +19544,10 @@
B2227A510D00BF220071B782 /* SVGNumberList.h in Headers */,
B2227A540D00BF220071B782 /* SVGPaint.h in Headers */,
B2227A570D00BF220071B782 /* SVGParserUtilities.h in Headers */,
+ 8476C9EB11DF6A2900555B02 /* SVGPathBuilder.h in Headers */,
+ 8476C9EC11DF6A2900555B02 /* SVGPathConsumer.h in Headers */,
B2227A590D00BF220071B782 /* SVGPathElement.h in Headers */,
+ 8476C9F011DF6A5800555B02 /* SVGPathParser.h in Headers */,
B2227A5B0D00BF220071B782 /* SVGPathSeg.h in Headers */,
B2227A5E0D00BF220071B782 /* SVGPathSegArc.h in Headers */,
B2227A620D00BF220071B782 /* SVGPathSegClosePath.h in Headers */,
@@ -19451,6 +19559,7 @@
B2227A780D00BF220071B782 /* SVGPathSegLinetoHorizontal.h in Headers */,
B2227A7D0D00BF220071B782 /* SVGPathSegLinetoVertical.h in Headers */,
B2227A810D00BF220071B782 /* SVGPathSegList.h in Headers */,
+ 8476C9E611DF6A0B00555B02 /* SVGPathSegListBuilder.h in Headers */,
B2227A840D00BF220071B782 /* SVGPathSegMoveto.h in Headers */,
B2227A880D00BF220071B782 /* SVGPatternElement.h in Headers */,
B25599950D00D8BA00BB825C /* SVGPointLightSource.h in Headers */,
@@ -19570,6 +19679,7 @@
E4AFCFA50DAF29A300F5F55C /* UnitBezier.h in Headers */,
D086FE9809D53AAB005BC74D /* UnlinkCommand.h in Headers */,
656581B209D14EE6000E61D7 /* UserAgentStyleSheets.h in Headers */,
+ 003F1FEA11E6AB43008258D9 /* UserContentTypes.h in Headers */,
BCACF3BD1072921A00C0C8A3 /* UserContentURLPattern.h in Headers */,
2542F4DB1166C25A00E89A86 /* UserGestureIndicator.h in Headers */,
BCA2B061105047600043BD1C /* UserScript.h in Headers */,
@@ -19721,53 +19831,7 @@
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
- B885E8D511E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h in Headers */,
- 97EF561111E40783007E026F /* HTMLConstructionSite.h in Headers */,
- BCA8C81E11E3D36900812FB7 /* BackForwardController.h in Headers */,
- BCA8C83111E3D53200812FB7 /* BackForwardControllerClient.h in Headers */,
- BCA8CA6011E4E6D100812FB7 /* BackForwardListImpl.h in Headers */,
- 003F1FEA11E6AB43008258D9 /* UserContentTypes.h in Headers */,
- CE02F0C411E83ADD00C6684A /* ScriptControllerBase.h in Headers */,
- 8A9A587111E84C36008ACFD1 /* JSNavigation.h in Headers */,
- 8A9A587511E84C81008ACFD1 /* JSPerformance.h in Headers */,
- 8A9A588811E84F37008ACFD1 /* JSTiming.h in Headers */,
- C585A66311D4FAC5004C3E4B /* IDBBindingUtilities.h in Headers */,
- C585A67D11D4FB08004C3E4B /* JSIDBAny.h in Headers */,
- C585A67F11D4FB08004C3E4B /* JSIDBDatabaseError.h in Headers */,
- C585A68111D4FB08004C3E4B /* JSIDBDatabaseException.h in Headers */,
- C585A68311D4FB08004C3E4B /* JSIDBDatabaseRequest.h in Headers */,
- C585A68511D4FB08004C3E4B /* JSIDBErrorEvent.h in Headers */,
- C585A68711D4FB08004C3E4B /* JSIDBEvent.h in Headers */,
- C585A68911D4FB08004C3E4B /* JSIDBIndexRequest.h in Headers */,
- C585A68B11D4FB08004C3E4B /* JSIDBKey.h in Headers */,
- C585A68D11D4FB08004C3E4B /* JSIDBKeyRange.h in Headers */,
- C585A68F11D4FB08004C3E4B /* JSIDBObjectStoreRequest.h in Headers */,
- C585A69111D4FB08004C3E4B /* JSIDBRequest.h in Headers */,
- C585A69311D4FB08004C3E4B /* JSIDBSuccessEvent.h in Headers */,
- C585A69711D4FB13004C3E4B /* JSIndexedDatabaseRequest.h in Headers */,
- C585A6CD11D4FB3D004C3E4B /* IDBAny.h in Headers */,
- C585A6CF11D4FB3D004C3E4B /* IDBCallbacks.h in Headers */,
- C585A6D011D4FB3D004C3E4B /* IDBDatabase.h in Headers */,
- C585A6D111D4FB3D004C3E4B /* IDBDatabaseError.h in Headers */,
- C585A6D311D4FB3D004C3E4B /* IDBDatabaseException.h in Headers */,
- C585A6D611D4FB3D004C3E4B /* IDBDatabaseImpl.h in Headers */,
- C585A6D811D4FB3D004C3E4B /* IDBDatabaseRequest.h in Headers */,
- C585A6DB11D4FB3D004C3E4B /* IDBErrorEvent.h in Headers */,
- C585A6DE11D4FB3D004C3E4B /* IDBEvent.h in Headers */,
- C585A6E011D4FB3D004C3E4B /* IDBIndex.h in Headers */,
- C585A6E211D4FB3D004C3E4B /* IDBIndexImpl.h in Headers */,
- C585A6E411D4FB3D004C3E4B /* IDBIndexRequest.h in Headers */,
- C585A6E711D4FB3D004C3E4B /* IDBKey.h in Headers */,
- C585A6EA11D4FB3D004C3E4B /* IDBKeyRange.h in Headers */,
- C585A6EC11D4FB3D004C3E4B /* IDBKeyTree.h in Headers */,
- C585A6ED11D4FB3D004C3E4B /* IDBObjectStore.h in Headers */,
- C585A6EF11D4FB3D004C3E4B /* IDBObjectStoreImpl.h in Headers */,
- C585A6F111D4FB3D004C3E4B /* IDBObjectStoreRequest.h in Headers */,
- C585A6F411D4FB3D004C3E4B /* IDBRequest.h in Headers */,
- C585A6F711D4FB3D004C3E4B /* IDBSuccessEvent.h in Headers */,
- C585A6FA11D4FB3D004C3E4B /* IndexedDatabase.h in Headers */,
- C585A6FC11D4FB3D004C3E4B /* IndexedDatabaseImpl.h in Headers */,
- C585A6FE11D4FB3D004C3E4B /* IndexedDatabaseRequest.h in Headers */,
+ 8C6EA61A11EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -19827,6 +19891,7 @@
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
compatibilityVersion = "Xcode 2.4";
+ developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
@@ -19927,7 +19992,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "# Copy all the Inspector front-end resources.\nditto \"${SRCROOT}/inspector/front-end\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n\n# Remove the WebKit.qrc file since it is not used on the Mac (this file is for Qt)\nrm -f \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/WebKit.qrc\"\n";
+ shellScript = "# Copy all the Inspector front-end resources.\nditto \"${SRCROOT}/inspector/front-end\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n\n# Remove the WebKit.qrc file since it is not used on the Mac (this file is for Qt)\nrm -f \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/WebKit.qrc\"\n\n# Remove *.re2js files, they are only used to generate some .js files.\nrm -f \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/\"*.re2js\n";
};
5D0D540D0E9862F60029E223 /* Check For Weak VTables and Externals */ = {
isa = PBXShellScriptBuildPhase;
@@ -19989,7 +20054,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "rsync -av --exclude \".svn\" --exclude \".DS_Store\" \"$SRCROOT/ForwardingHeaders\" \"$BUILT_PRODUCTS_DIR/$PRIVATE_HEADERS_FOLDER_PATH\"\nrsync -av --exclude \".svn\" --exclude \".DS_Store\" \"$SRCROOT/icu\" \"$BUILT_PRODUCTS_DIR/$PRIVATE_HEADERS_FOLDER_PATH\"\n";
+ shellScript = "rsync -aq --exclude \".svn\" --exclude \".DS_Store\" \"$SRCROOT/ForwardingHeaders\" \"$BUILT_PRODUCTS_DIR/$PRIVATE_HEADERS_FOLDER_PATH\"\nrsync -aq --exclude \".svn\" --exclude \".DS_Store\" \"$SRCROOT/icu\" \"$BUILT_PRODUCTS_DIR/$PRIVATE_HEADERS_FOLDER_PATH\"\n";
};
5DF50887116F3077005202AB /* Check For Inappropriate Files In Framework */ = {
isa = PBXShellScriptBuildPhase;
@@ -20117,6 +20182,8 @@
A8CFF0500A154F09000A4234 /* AutoTableLayout.cpp in Sources */,
29A812370FBB9C1D00510293 /* AXObjectCache.cpp in Sources */,
29A8124B0FBB9CA900510293 /* AXObjectCacheMac.mm in Sources */,
+ BCA8C81F11E3D36900812FB7 /* BackForwardController.cpp in Sources */,
+ BCA8CA5F11E4E6D100812FB7 /* BackForwardListImpl.cpp in Sources */,
BC124EE70C2641CD009E2349 /* BarInfo.cpp in Sources */,
B2C3DA210D006C1D00EF6F26 /* Base64.cpp in Sources */,
5172204B11D2960500638B42 /* BeforeProcessEvent.cpp in Sources */,
@@ -20272,6 +20339,7 @@
93309DDE099E64920056E581 /* DeleteFromTextNodeCommand.cpp in Sources */,
93309DE0099E64920056E581 /* DeleteSelectionCommand.cpp in Sources */,
93F19A3C08245E59001E9ABC /* DeprecatedPtrListImpl.cpp in Sources */,
+ 59D1C10411EB5DCF00B638C8 /* DeviceOrientation.cpp in Sources */,
59A8F1D411A69508001AC34A /* DeviceOrientationController.cpp in Sources */,
59A85EA2119D68D900DEF1EF /* DeviceOrientationEvent.cpp in Sources */,
B2F34FE90E82F82700F627CD /* DNSCFNet.cpp in Sources */,
@@ -20395,6 +20463,8 @@
850656FF0AAB4763002D15C0 /* DOMMediaList.mm in Sources */,
75793ED40D0CE85B007FC0AC /* DOMMessageEvent.mm in Sources */,
E1ACAF4C0E791AAF0087D12B /* DOMMessagePort.mm in Sources */,
+ A9C6E4E30D745E05006442E9 /* DOMMimeType.cpp in Sources */,
+ A9C6E4E70D745E18006442E9 /* DOMMimeTypeArray.cpp in Sources */,
857E0B260AB043460036E447 /* DOMMouseEvent.mm in Sources */,
85C7F5C00AAFB7CD004014DD /* DOMMutationEvent.mm in Sources */,
8518DD790A9CF31B0091B7A6 /* DOMNamedNodeMap.mm in Sources */,
@@ -20407,6 +20477,8 @@
85C7F5D10AAFB8D9004014DD /* DOMOverflowEvent.mm in Sources */,
E1284BD51044A01E00EAEB52 /* DOMPageTransitionEvent.mm in Sources */,
1ACE53E70A8D18E70022947D /* DOMParser.cpp in Sources */,
+ A9C6E4EB0D745E2B006442E9 /* DOMPlugin.cpp in Sources */,
+ A9C6E4EF0D745E38006442E9 /* DOMPluginArray.cpp in Sources */,
85F56A7B0A98CE3700ADB60A /* DOMProcessingInstruction.mm in Sources */,
BCC573360D695BBE006EF517 /* DOMProgressEvent.mm in Sources */,
8538F05C0AD722F1006A81D1 /* DOMRange.mm in Sources */,
@@ -20698,6 +20770,7 @@
A81369D3097374F600D74463 /* HTMLButtonElement.cpp in Sources */,
93F19AFD08245E59001E9ABC /* HTMLCanvasElement.cpp in Sources */,
A8DF3FD1097FA0FC0052981B /* HTMLCollection.cpp in Sources */,
+ 97EF561011E40783007E026F /* HTMLConstructionSite.cpp in Sources */,
BC77CDB80FEFF1210070887B /* HTMLDataGridCellElement.cpp in Sources */,
BC77CBAA0FEBF6C90070887B /* HTMLDataGridColElement.cpp in Sources */,
BCF524600FEBEE5D0095BF26 /* HTMLDataGridElement.cpp in Sources */,
@@ -20794,6 +20867,20 @@
513F14530AB634C400094DDF /* IconLoader.cpp in Sources */,
B275358E0B053A66002CE64F /* IconMac.mm in Sources */,
51E1ECC00C91C90400DC255B /* IconRecord.cpp in Sources */,
+ C585A6CC11D4FB3D004C3E4B /* IDBAny.cpp in Sources */,
+ C585A66211D4FAC5004C3E4B /* IDBBindingUtilities.cpp in Sources */,
+ C585A6D511D4FB3D004C3E4B /* IDBDatabaseImpl.cpp in Sources */,
+ C585A6D711D4FB3D004C3E4B /* IDBDatabaseRequest.cpp in Sources */,
+ C585A6DA11D4FB3D004C3E4B /* IDBErrorEvent.cpp in Sources */,
+ C585A6DD11D4FB3D004C3E4B /* IDBEvent.cpp in Sources */,
+ C585A6E111D4FB3D004C3E4B /* IDBIndexImpl.cpp in Sources */,
+ C585A6E311D4FB3D004C3E4B /* IDBIndexRequest.cpp in Sources */,
+ C585A6E611D4FB3D004C3E4B /* IDBKey.cpp in Sources */,
+ C585A6E911D4FB3D004C3E4B /* IDBKeyRange.cpp in Sources */,
+ C585A6EE11D4FB3D004C3E4B /* IDBObjectStoreImpl.cpp in Sources */,
+ C585A6F011D4FB3D004C3E4B /* IDBObjectStoreRequest.cpp in Sources */,
+ C585A6F311D4FB3D004C3E4B /* IDBRequest.cpp in Sources */,
+ C585A6F611D4FB3D004C3E4B /* IDBSuccessEvent.cpp in Sources */,
1A71D57B0F33819000F9CE4E /* IdentifierRep.cpp in Sources */,
B275356F0B053814002CE64F /* Image.cpp in Sources */,
B2A10B940B3818D700099AA4 /* ImageBufferCG.cpp in Sources */,
@@ -20807,6 +20894,9 @@
4B3480930EEF50D400AC1B41 /* ImageSourceCGMac.mm in Sources */,
316FE1170E6E1DA700BF6088 /* ImplicitAnimation.cpp in Sources */,
DB23C2CB0A508D29002489EB /* IndentOutdentCommand.cpp in Sources */,
+ C585A6F911D4FB3D004C3E4B /* IndexedDatabase.cpp in Sources */,
+ C585A6FB11D4FB3D004C3E4B /* IndexedDatabaseImpl.cpp in Sources */,
+ C585A6FD11D4FB3D004C3E4B /* IndexedDatabaseRequest.cpp in Sources */,
F3644AFF1119805900E0D537 /* InjectedScript.cpp in Sources */,
7A0E76F910BF08ED00A0276E /* InjectedScriptHost.cpp in Sources */,
A8CFF5E60A155A05000A4234 /* InlineBox.cpp in Sources */,
@@ -20819,6 +20909,7 @@
93309DED099E64920056E581 /* InsertNodeBeforeCommand.cpp in Sources */,
93309DEF099E64920056E581 /* InsertParagraphSeparatorCommand.cpp in Sources */,
93309DF1099E64920056E581 /* InsertTextCommand.cpp in Sources */,
+ B885E8D411E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp in Sources */,
7A74ECBA101839A600BF939E /* InspectorBackend.cpp in Sources */,
1C81B95B0E97330800266E07 /* InspectorController.cpp in Sources */,
82B6589A1189E47600E052A1 /* InspectorCSSStore.cpp in Sources */,
@@ -20925,6 +21016,7 @@
4162A454101145E300DFF3ED /* JSDedicatedWorkerContextCustom.cpp in Sources */,
33503CC010179C1A003B47E1 /* JSDesktopNotificationsCustom.cpp in Sources */,
59A86006119DAF7F00DEF1EF /* JSDeviceOrientationEvent.cpp in Sources */,
+ 590E1B4B11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp in Sources */,
659DDC8209E198BA001BF3C6 /* JSDocument.cpp in Sources */,
49C7BA8D1042F5B10009D447 /* JSDocumentCustom.cpp in Sources */,
1A494EDE0A123F4C00FDAFC1 /* JSDocumentFragment.cpp in Sources */,
@@ -20937,7 +21029,14 @@
2E0888E6114884E200AF4265 /* JSDOMFormDataCustom.cpp in Sources */,
E1C36CBD0EB08062007410BC /* JSDOMGlobalObject.cpp in Sources */,
65DF31F709D1CC60000BE325 /* JSDOMImplementation.cpp in Sources */,
+ A9D248060D757E7D00FDF959 /* JSDOMMimeType.cpp in Sources */,
+ A9D248080D757E7D00FDF959 /* JSDOMMimeTypeArray.cpp in Sources */,
+ A9C6E6470D7465CA006442E9 /* JSDOMMimeTypeArrayCustom.cpp in Sources */,
1ACE53DF0A8D18810022947D /* JSDOMParser.cpp in Sources */,
+ A9D247FE0D757E6900FDF959 /* JSDOMPlugin.cpp in Sources */,
+ A9D248000D757E6900FDF959 /* JSDOMPluginArray.cpp in Sources */,
+ A9C6E64C0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp in Sources */,
+ A9C6E64D0D7465E7006442E9 /* JSDOMPluginCustom.cpp in Sources */,
BC5A86B50C3367E800EEA649 /* JSDOMSelection.cpp in Sources */,
C5137CF211A58378004ADB99 /* JSDOMStringList.cpp in Sources */,
BC64649711D82349006455B0 /* JSDOMStringMap.cpp in Sources */,
@@ -21059,9 +21158,24 @@
A80E7B130A19D606007FB8C5 /* JSHTMLTitleElement.cpp in Sources */,
1A85B2100A1B258700D8C87C /* JSHTMLUListElement.cpp in Sources */,
E44614160CD6826900FADA75 /* JSHTMLVideoElement.cpp in Sources */,
+ C585A67C11D4FB08004C3E4B /* JSIDBAny.cpp in Sources */,
+ C585A65E11D4FAB2004C3E4B /* JSIDBAnyCustom.cpp in Sources */,
+ C585A67E11D4FB08004C3E4B /* JSIDBDatabaseError.cpp in Sources */,
+ C585A68011D4FB08004C3E4B /* JSIDBDatabaseException.cpp in Sources */,
+ C585A68211D4FB08004C3E4B /* JSIDBDatabaseRequest.cpp in Sources */,
+ C585A68411D4FB08004C3E4B /* JSIDBErrorEvent.cpp in Sources */,
+ C585A68611D4FB08004C3E4B /* JSIDBEvent.cpp in Sources */,
+ C585A68811D4FB08004C3E4B /* JSIDBIndexRequest.cpp in Sources */,
+ C585A68A11D4FB08004C3E4B /* JSIDBKey.cpp in Sources */,
+ C585A65F11D4FAB2004C3E4B /* JSIDBKeyCustom.cpp in Sources */,
+ C585A68C11D4FB08004C3E4B /* JSIDBKeyRange.cpp in Sources */,
+ C585A68E11D4FB08004C3E4B /* JSIDBObjectStoreRequest.cpp in Sources */,
+ C585A69011D4FB08004C3E4B /* JSIDBRequest.cpp in Sources */,
+ C585A69211D4FB08004C3E4B /* JSIDBSuccessEvent.cpp in Sources */,
BC6C49F30D7DBA0500FFA558 /* JSImageConstructor.cpp in Sources */,
A77979280D6B9E64003851B9 /* JSImageData.cpp in Sources */,
A7D0318E0E93540300E24ACD /* JSImageDataCustom.cpp in Sources */,
+ C585A69611D4FB13004C3E4B /* JSIndexedDatabaseRequest.cpp in Sources */,
7A0E76DA10BF059800A0276E /* JSInjectedScriptHost.cpp in Sources */,
7A0E76D510BF050700A0276E /* JSInjectedScriptHostCustom.cpp in Sources */,
41F060CD0F5EEB2B00A07EAC /* JSInspectorBackend.cpp in Sources */,
@@ -21089,13 +21203,11 @@
410B7E721045FAB000D8224F /* JSMessageEventCustom.cpp in Sources */,
E1ADEDDB0E76BD93004A1A5E /* JSMessagePort.cpp in Sources */,
E1ADED470E76B8DD004A1A5E /* JSMessagePortCustom.cpp in Sources */,
- A9D248060D757E7D00FDF959 /* JSDOMMimeType.cpp in Sources */,
- A9D248080D757E7D00FDF959 /* JSDOMMimeTypeArray.cpp in Sources */,
- A9C6E6470D7465CA006442E9 /* JSDOMMimeTypeArrayCustom.cpp in Sources */,
A86629D209DA2B48009633A5 /* JSMouseEvent.cpp in Sources */,
65DF31FB09D1CC60000BE325 /* JSMutationEvent.cpp in Sources */,
BCD9C2C00C17B69E005C90A2 /* JSNamedNodeMap.cpp in Sources */,
BCD9C2630C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp in Sources */,
+ 8A9A587011E84C36008ACFD1 /* JSNavigation.cpp in Sources */,
A9D247F70D757E3400FDF959 /* JSNavigator.cpp in Sources */,
A9C6E6490D7465D8006442E9 /* JSNavigatorCustom.cpp in Sources */,
14DC0D3709FED073007B0235 /* JSNode.cpp in Sources */,
@@ -21113,10 +21225,7 @@
A826EC480A1B0CBE00CD1BB6 /* JSOptionConstructor.cpp in Sources */,
1A0D57400A5C7867007EDD4C /* JSOverflowEvent.cpp in Sources */,
E1284BB210449FFA00EAEB52 /* JSPageTransitionEvent.cpp in Sources */,
- A9D247FE0D757E6900FDF959 /* JSDOMPlugin.cpp in Sources */,
- A9D248000D757E6900FDF959 /* JSDOMPluginArray.cpp in Sources */,
- A9C6E64C0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp in Sources */,
- A9C6E64D0D7465E7006442E9 /* JSDOMPluginCustom.cpp in Sources */,
+ 8A9A587411E84C81008ACFD1 /* JSPerformance.cpp in Sources */,
93B70D6B09EB0C7C009D8468 /* JSPluginElementFunctions.cpp in Sources */,
5189F01D10B37BD900F3C739 /* JSPopStateEvent.cpp in Sources */,
5189F01810B3781300F3C739 /* JSPopStateEventCustom.cpp in Sources */,
@@ -21302,6 +21411,7 @@
933A14B80B7D1D5200A53FFD /* JSTextEvent.cpp in Sources */,
BCEF45F50E687B5C001C1287 /* JSTextMetrics.cpp in Sources */,
E446141A0CD6826900FADA75 /* JSTimeRanges.cpp in Sources */,
+ 8A9A588711E84F37008ACFD1 /* JSTiming.cpp in Sources */,
1A750D5C0A90DEE1000FF215 /* JSTreeWalker.cpp in Sources */,
516BB7940CE91E6800512F79 /* JSTreeWalkerCustom.cpp in Sources */,
A86629D009DA2B48009633A5 /* JSUIEvent.cpp in Sources */,
@@ -21376,6 +21486,7 @@
512DD8F40D91E6AF000F89EE /* LegacyWebArchive.cpp in Sources */,
51B2417B0D931F3F00E83F5C /* LegacyWebArchiveMac.mm in Sources */,
BCE65BEA0EACDF16007E4533 /* Length.cpp in Sources */,
+ 89B5EAA111E8003D00F2367E /* LineEnding.cpp in Sources */,
A7AD2F870EC89D07008AB002 /* LinkHash.cpp in Sources */,
BCB16C2C0979C3BD00467741 /* loader.cpp in Sources */,
656D37330ADBA5DE00A4554D /* LoaderNSURLExtras.mm in Sources */,
@@ -21412,8 +21523,6 @@
75793E830D0CE0B3007FC0AC /* MessageEvent.cpp in Sources */,
E1ADECC00E76ACF1004A1A5E /* MessagePort.cpp in Sources */,
41BF700B0FE86F49005E8DEC /* MessagePortChannel.cpp in Sources */,
- A9C6E4E30D745E05006442E9 /* DOMMimeType.cpp in Sources */,
- A9C6E4E70D745E18006442E9 /* DOMMimeTypeArray.cpp in Sources */,
BC772C4E0C4EB3040083285F /* MIMETypeRegistry.cpp in Sources */,
BC772C5E0C4EB3440083285F /* MIMETypeRegistryMac.mm in Sources */,
C6D74AE409AA290A000B0A52 /* ModifySelectionListLevel.cpp in Sources */,
@@ -21478,14 +21587,11 @@
935C477109AC4D7300A6AAB4 /* PlatformMouseEventMac.mm in Sources */,
BC94D1080C274F88006BC617 /* PlatformScreenMac.mm in Sources */,
1AD8F81C11CAB9E900E93E54 /* PlatformStrategies.cpp in Sources */,
- A9C6E4EB0D745E2B006442E9 /* DOMPlugin.cpp in Sources */,
- A9C6E4EF0D745E38006442E9 /* DOMPluginArray.cpp in Sources */,
A9C6E4F30D745E48006442E9 /* PluginData.cpp in Sources */,
1AC694C70A3B1676003F5049 /* PluginDocument.cpp in Sources */,
7693BAD3106C2DCA007B0823 /* PluginHalter.cpp in Sources */,
1ADA14100E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp in Sources */,
76FF17E311235673001D61B5 /* PluginViewNone.cpp in Sources */,
- 0AFDAC3B10F5448300E1F3D2 /* PluginWidgetMac.mm in Sources */,
B2B1F7160D00CAA8004AEA64 /* PointerEventsHitRules.cpp in Sources */,
97059977107D975200A50A7C /* PolicyCallback.cpp in Sources */,
97059979107D975200A50A7C /* PolicyChecker.cpp in Sources */,
@@ -21504,6 +21610,7 @@
979F43D31075E44A0000F83B /* RedirectScheduler.cpp in Sources */,
85031B4B0A44EFC700F992E0 /* RegisteredEventListener.cpp in Sources */,
B2C3DA2C0D006C1D00EF6F26 /* RegularExpression.cpp in Sources */,
+ 4F4F5FFB11CBD2E100A186BF /* RemoteInspectorFrontend.cpp in Sources */,
93309E00099E64920056E581 /* RemoveCSSPropertyCommand.cpp in Sources */,
D06C0D900CFD11460065F43F /* RemoveFormatCommand.cpp in Sources */,
93309E04099E64920056E581 /* RemoveNodeCommand.cpp in Sources */,
@@ -21705,6 +21812,7 @@
84A81F410FC7E02700955300 /* SourceGraphic.cpp in Sources */,
D01A27AD10C9BFD800026A42 /* SpaceSplitString.cpp in Sources */,
626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */,
+ 7578F90B11DDF26900D933C5 /* SpeechInput.cpp in Sources */,
93309E11099E64920056E581 /* SplitElementCommand.cpp in Sources */,
93309E13099E64920056E581 /* SplitTextNodeCommand.cpp in Sources */,
93309E15099E64920056E581 /* SplitTextNodeContainingElementCommand.cpp in Sources */,
@@ -21716,6 +21824,7 @@
519611730CAC56570010A80C /* SQLResultSet.cpp in Sources */,
1AFE117D0CBFFB36003017FA /* SQLResultSetRowList.cpp in Sources */,
515B039A0CD1642A00B7EA9C /* SQLStatement.cpp in Sources */,
+ B550B52511DC68A800923885 /* SQLStatementSync.cpp in Sources */,
1ABFE7530CD968D000FE4834 /* SQLTransaction.cpp in Sources */,
B51BF6F0102C9E590002C15A /* SQLTransactionClient.cpp in Sources */,
B5C1123B102B6C4600096578 /* SQLTransactionCoordinator.cpp in Sources */,
@@ -21872,7 +21981,9 @@
B2227A500D00BF220071B782 /* SVGNumberList.cpp in Sources */,
B2227A530D00BF220071B782 /* SVGPaint.cpp in Sources */,
B2227A560D00BF220071B782 /* SVGParserUtilities.cpp in Sources */,
+ 8476C9EA11DF6A2900555B02 /* SVGPathBuilder.cpp in Sources */,
B2227A580D00BF220071B782 /* SVGPathElement.cpp in Sources */,
+ 8476C9EF11DF6A5800555B02 /* SVGPathParser.cpp in Sources */,
B2227A5D0D00BF220071B782 /* SVGPathSegArc.cpp in Sources */,
B2227A610D00BF220071B782 /* SVGPathSegClosePath.cpp in Sources */,
B2227A640D00BF220071B782 /* SVGPathSegCurvetoCubic.cpp in Sources */,
@@ -21883,6 +21994,7 @@
B2227A770D00BF220071B782 /* SVGPathSegLinetoHorizontal.cpp in Sources */,
B2227A7C0D00BF220071B782 /* SVGPathSegLinetoVertical.cpp in Sources */,
B2227A800D00BF220071B782 /* SVGPathSegList.cpp in Sources */,
+ 8476C9E511DF6A0B00555B02 /* SVGPathSegListBuilder.cpp in Sources */,
B2227A830D00BF220071B782 /* SVGPathSegMoveto.cpp in Sources */,
B2227A870D00BF220071B782 /* SVGPatternElement.cpp in Sources */,
B2227A8B0D00BF220071B782 /* SVGPointList.cpp in Sources */,
@@ -22113,46 +22225,7 @@
93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
- B885E8D411E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp in Sources */,
- BCA8C81F11E3D36900812FB7 /* BackForwardController.cpp in Sources */,
- 4F4F5FFB11CBD2E100A186BF /* RemoteInspectorFrontend2.cpp in Sources */,
- 97EF561011E40783007E026F /* HTMLConstructionSite.cpp in Sources */,
- BCA8CA5F11E4E6D100812FB7 /* BackForwardListImpl.cpp in Sources */,
- 8A9A587011E84C36008ACFD1 /* JSNavigation.cpp in Sources */,
- 8A9A587411E84C81008ACFD1 /* JSPerformance.cpp in Sources */,
- 8A9A588711E84F37008ACFD1 /* JSTiming.cpp in Sources */,
- C585A65E11D4FAB2004C3E4B /* JSIDBAnyCustom.cpp in Sources */,
- C585A65F11D4FAB2004C3E4B /* JSIDBKeyCustom.cpp in Sources */,
- C585A66211D4FAC5004C3E4B /* IDBBindingUtilities.cpp in Sources */,
- C585A67C11D4FB08004C3E4B /* JSIDBAny.cpp in Sources */,
- C585A67E11D4FB08004C3E4B /* JSIDBDatabaseError.cpp in Sources */,
- C585A68011D4FB08004C3E4B /* JSIDBDatabaseException.cpp in Sources */,
- C585A68211D4FB08004C3E4B /* JSIDBDatabaseRequest.cpp in Sources */,
- C585A68411D4FB08004C3E4B /* JSIDBErrorEvent.cpp in Sources */,
- C585A68611D4FB08004C3E4B /* JSIDBEvent.cpp in Sources */,
- C585A68811D4FB08004C3E4B /* JSIDBIndexRequest.cpp in Sources */,
- C585A68A11D4FB08004C3E4B /* JSIDBKey.cpp in Sources */,
- C585A68C11D4FB08004C3E4B /* JSIDBKeyRange.cpp in Sources */,
- C585A68E11D4FB08004C3E4B /* JSIDBObjectStoreRequest.cpp in Sources */,
- C585A69011D4FB08004C3E4B /* JSIDBRequest.cpp in Sources */,
- C585A69211D4FB08004C3E4B /* JSIDBSuccessEvent.cpp in Sources */,
- C585A69611D4FB13004C3E4B /* JSIndexedDatabaseRequest.cpp in Sources */,
- C585A6CC11D4FB3D004C3E4B /* IDBAny.cpp in Sources */,
- C585A6D511D4FB3D004C3E4B /* IDBDatabaseImpl.cpp in Sources */,
- C585A6D711D4FB3D004C3E4B /* IDBDatabaseRequest.cpp in Sources */,
- C585A6DA11D4FB3D004C3E4B /* IDBErrorEvent.cpp in Sources */,
- C585A6DD11D4FB3D004C3E4B /* IDBEvent.cpp in Sources */,
- C585A6E111D4FB3D004C3E4B /* IDBIndexImpl.cpp in Sources */,
- C585A6E311D4FB3D004C3E4B /* IDBIndexRequest.cpp in Sources */,
- C585A6E611D4FB3D004C3E4B /* IDBKey.cpp in Sources */,
- C585A6E911D4FB3D004C3E4B /* IDBKeyRange.cpp in Sources */,
- C585A6EE11D4FB3D004C3E4B /* IDBObjectStoreImpl.cpp in Sources */,
- C585A6F011D4FB3D004C3E4B /* IDBObjectStoreRequest.cpp in Sources */,
- C585A6F311D4FB3D004C3E4B /* IDBRequest.cpp in Sources */,
- C585A6F611D4FB3D004C3E4B /* IDBSuccessEvent.cpp in Sources */,
- C585A6F911D4FB3D004C3E4B /* IndexedDatabase.cpp in Sources */,
- C585A6FB11D4FB3D004C3E4B /* IndexedDatabaseImpl.cpp in Sources */,
- C585A6FD11D4FB3D004C3E4B /* IndexedDatabaseRequest.cpp in Sources */,
+ 8C6EA61911EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/WebCorePrefix.h b/WebCore/WebCorePrefix.h
index db79bad..cde5a85 100644
--- a/WebCore/WebCorePrefix.h
+++ b/WebCore/WebCorePrefix.h
@@ -133,12 +133,20 @@
#include <windows.h>
#include <stdio.h>
#else
-#include <CoreServices/CoreServices.h>
#if defined(WIN32) || defined(_WIN32)
-/* Including CoreServices.h on Windows doesn't include CFNetwork.h, so we do
+// FIXME <rdar://problem/8208868> Remove support for obsolete ColorSync API, CoreServices header in CoreGraphics
+// We can remove this once the new ColorSync APIs are available in an internal Safari SDK.
+#include <ColorSync/ColorSync.h>
+#ifdef __COLORSYNCDEPRECATED__
+#define COREGRAPHICS_INCLUDES_CORESERVICES_HEADER
+#define OBSOLETE_COLORSYNC_API
+#endif
+/* Windows doesn't include CFNetwork.h via CoreServices.h, so we do
it explicitly here to make Windows more consistent with Mac. */
#include <CFNetwork/CFNetwork.h>
+#else
+#include <CoreServices/CoreServices.h>
#endif
#endif
diff --git a/WebCore/accessibility/AccessibilityImageMapLink.cpp b/WebCore/accessibility/AccessibilityImageMapLink.cpp
index 2eac8d3..924ba21 100644
--- a/WebCore/accessibility/AccessibilityImageMapLink.cpp
+++ b/WebCore/accessibility/AccessibilityImageMapLink.cpp
@@ -73,7 +73,7 @@ AccessibilityRole AccessibilityImageMapLink::roleValue() const
if (!m_areaElement)
return WebCoreLinkRole;
- const AtomicString& ariaRole = m_areaElement->getAttribute(roleAttr);
+ const AtomicString& ariaRole = getAttribute(roleAttr);
if (!ariaRole.isEmpty())
return AccessibilityObject::ariaRoleToWebCoreRole(ariaRole);
@@ -100,13 +100,10 @@ KURL AccessibilityImageMapLink::url() const
String AccessibilityImageMapLink::accessibilityDescription() const
{
- if (!m_areaElement)
- return String();
-
- const AtomicString& ariaLabel = m_areaElement->getAttribute(aria_labelAttr);
+ const AtomicString& ariaLabel = getAttribute(aria_labelAttr);
if (!ariaLabel.isEmpty())
return ariaLabel;
- const AtomicString& alt = m_areaElement->getAttribute(altAttr);
+ const AtomicString& alt = getAttribute(altAttr);
if (!alt.isEmpty())
return alt;
@@ -115,13 +112,10 @@ String AccessibilityImageMapLink::accessibilityDescription() const
String AccessibilityImageMapLink::title() const
{
- if (!m_areaElement)
- return String();
-
- const AtomicString& title = m_areaElement->getAttribute(titleAttr);
+ const AtomicString& title = getAttribute(titleAttr);
if (!title.isEmpty())
return title;
- const AtomicString& summary = m_areaElement->getAttribute(summaryAttr);
+ const AtomicString& summary = getAttribute(summaryAttr);
if (!summary.isEmpty())
return summary;
diff --git a/WebCore/accessibility/AccessibilityImageMapLink.h b/WebCore/accessibility/AccessibilityImageMapLink.h
index ca4c62c..e2e1544 100644
--- a/WebCore/accessibility/AccessibilityImageMapLink.h
+++ b/WebCore/accessibility/AccessibilityImageMapLink.h
@@ -49,6 +49,7 @@ public:
void setHTMLMapElement(HTMLMapElement* element) { m_mapElement = element; }
HTMLMapElement* mapElement() const { return m_mapElement; }
+ virtual Node* node() const { return m_areaElement; }
void setParent(AccessibilityObject* parent) { m_parent = parent; }
virtual AccessibilityRole roleValue() const;
diff --git a/WebCore/accessibility/AccessibilityListBoxOption.cpp b/WebCore/accessibility/AccessibilityListBoxOption.cpp
index 57519e3..3e4dad9 100644
--- a/WebCore/accessibility/AccessibilityListBoxOption.cpp
+++ b/WebCore/accessibility/AccessibilityListBoxOption.cpp
@@ -110,17 +110,12 @@ bool AccessibilityListBoxOption::accessibilityIsIgnored() const
if (!m_optionElement)
return true;
- if (equalIgnoringCase(getAttribute(m_optionElement, aria_hiddenAttr), "true"))
+ if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "true"))
return true;
return parentObject()->accessibilityIsIgnored();
}
-String AccessibilityListBoxOption::language() const
-{
- return AccessibilityObject::language(m_optionElement);
-}
-
bool AccessibilityListBoxOption::canSetSelectedAttribute() const
{
if (!m_optionElement)
@@ -144,7 +139,7 @@ String AccessibilityListBoxOption::stringValue() const
if (!m_optionElement)
return String();
- const AtomicString& ariaLabel = getAttribute(m_optionElement, aria_labelAttr);
+ const AtomicString& ariaLabel = getAttribute(aria_labelAttr);
if (!ariaLabel.isNull())
return ariaLabel;
diff --git a/WebCore/accessibility/AccessibilityListBoxOption.h b/WebCore/accessibility/AccessibilityListBoxOption.h
index 1da77e7..c4c9315 100644
--- a/WebCore/accessibility/AccessibilityListBoxOption.h
+++ b/WebCore/accessibility/AccessibilityListBoxOption.h
@@ -56,7 +56,7 @@ public:
virtual bool isEnabled() const;
virtual String stringValue() const;
virtual Element* actionElement() const;
-
+ virtual Node* node() const { return m_optionElement; }
virtual void setSelected(bool);
virtual bool canSetSelectedAttribute() const;
@@ -68,7 +68,6 @@ public:
private:
HTMLElement* m_optionElement;
- virtual String language() const;
virtual bool canHaveChildren() const { return false; }
HTMLSelectElement* listBoxOptionParentNode() const;
int listBoxOptionIndex() const;
diff --git a/WebCore/accessibility/AccessibilityObject.cpp b/WebCore/accessibility/AccessibilityObject.cpp
index 555ba6f..bc4e2f5 100644
--- a/WebCore/accessibility/AccessibilityObject.cpp
+++ b/WebCore/accessibility/AccessibilityObject.cpp
@@ -148,17 +148,12 @@ bool AccessibilityObject::press() const
return true;
}
-String AccessibilityObject::language(Node* node) const
-{
- const AtomicString& lang = getAttribute(node, langAttr);
- if (lang.isEmpty())
- return AccessibilityObject::language();
-
- return lang;
-}
-
String AccessibilityObject::language() const
{
+ const AtomicString& lang = getAttribute(langAttr);
+ if (!lang.isEmpty())
+ return lang;
+
AccessibilityObject* parent = parentObject();
// as a last resort, fall back to the content language specified in the meta tag
@@ -166,7 +161,7 @@ String AccessibilityObject::language() const
Document* doc = document();
if (doc)
return doc->contentLanguage();
- return String();
+ return nullAtom;
}
return parent->language();
@@ -403,7 +398,7 @@ static bool replacedNodeNeedsCharacter(Node* replacedNode)
}
// Finds a RenderListItem parent give a node.
-RenderListItem* AccessibilityObject::renderListItemContainerForNode(Node* node) const
+static RenderListItem* renderListItemContainerForNode(Node* node)
{
for (Node* stringNode = node; stringNode; stringNode = stringNode->parent()) {
RenderObject* renderObject = stringNode->renderer();
@@ -844,15 +839,16 @@ const String& AccessibilityObject::actionVerb() const
}
}
-const AtomicString& AccessibilityObject::getAttribute(Node* node, const QualifiedName& attribute)
+const AtomicString& AccessibilityObject::getAttribute(const QualifiedName& attribute) const
{
- if (!node)
+ Node* elementNode = node();
+ if (!elementNode)
return nullAtom;
- if (!node->isElementNode())
+ if (!elementNode->isElementNode())
return nullAtom;
- Element* element = static_cast<Element*>(node);
+ Element* element = static_cast<Element*>(elementNode);
return element->getAttribute(attribute);
}
@@ -980,6 +976,32 @@ bool AccessibilityObject::supportsARIALiveRegion() const
const AtomicString& liveRegion = ariaLiveRegionStatus();
return equalIgnoringCase(liveRegion, "polite") || equalIgnoringCase(liveRegion, "assertive");
}
+
+int AccessibilityObject::intValue() const
+{
+ if (isPasswordField())
+ return 0;
+
+ if (isHeading())
+ return headingLevel();
+
+ // If this is a real checkbox or radio button, AccessibilityRenderObject will handle.
+ // If it's an ARIA checkbox or radio, the aria-checked attribute should be used.
+ if (isCheckboxOrRadio())
+ return equalIgnoringCase(getAttribute(aria_checkedAttr), "true");
+
+ return 0;
+}
+bool AccessibilityObject::hasIntValue() const
+{
+ if (isHeading())
+ return true;
+
+ if (isCheckboxOrRadio())
+ return true;
+
+ return false;
+}
} // namespace WebCore
diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h
index 3c8d392..400a200 100644
--- a/WebCore/accessibility/AccessibilityObject.h
+++ b/WebCore/accessibility/AccessibilityObject.h
@@ -264,7 +264,8 @@ public:
virtual bool isTextControl() const { return false; }
virtual bool isNativeTextControl() const { return false; }
virtual bool isWebArea() const { return false; }
- virtual bool isCheckboxOrRadio() const { return false; }
+ virtual bool isCheckbox() const { return roleValue() == CheckBoxRole; }
+ virtual bool isRadioButton() const { return roleValue() == RadioButtonRole; }
virtual bool isListBox() const { return roleValue() == ListBoxRole; }
virtual bool isMediaTimeline() const { return false; }
virtual bool isMenuRelated() const { return false; }
@@ -298,6 +299,7 @@ public:
bool isScrollbar() const { return roleValue() == ScrollBarRole; }
bool isButton() const { return roleValue() == ButtonRole; }
bool isListItem() const { return roleValue() == ListItemRole; }
+ bool isCheckboxOrRadio() const { return isCheckbox() || isRadioButton(); }
virtual bool isChecked() const { return false; }
virtual bool isEnabled() const { return false; }
@@ -325,16 +327,17 @@ public:
virtual bool canSetSelectedChildrenAttribute() const { return false; }
virtual bool canSetExpandedAttribute() const { return false; }
- virtual bool hasIntValue() const { return false; }
-
+ bool hasIntValue() const;
+ virtual int intValue() const;
+
// A programmatic way to set a name on an AccessibleObject.
virtual void setAccessibleName(String&) { }
+ virtual Node* node() const { return 0; }
bool accessibilityShouldUseUniqueId() const { return true; }
virtual bool accessibilityIsIgnored() const { return true; }
virtual int headingLevel() const { return 0; }
- virtual int intValue() const { return 0; }
virtual String valueDescription() const { return String(); }
virtual float valueForRange() const { return 0.0f; }
virtual float maxValueForRange() const { return 0.0f; }
@@ -419,8 +422,7 @@ public:
virtual Document* document() const { return 0; }
virtual FrameView* topDocumentFrameView() const { return 0; }
virtual FrameView* documentFrameView() const;
- virtual String language() const;
- String language(Node*) const;
+ String language() const;
virtual unsigned hierarchicalLevel() const { return 0; }
virtual void setFocused(bool) { }
@@ -454,7 +456,7 @@ public:
virtual void handleAriaExpandedChanged() { }
static AccessibilityRole ariaRoleToWebCoreRole(const String&);
- static const AtomicString& getAttribute(Node*, const QualifiedName&);
+ const AtomicString& getAttribute(const QualifiedName&) const;
virtual VisiblePositionRange visiblePositionRange() const { return VisiblePositionRange(); }
virtual VisiblePositionRange visiblePositionRangeForLine(unsigned) const { return VisiblePositionRange(); }
@@ -564,7 +566,6 @@ protected:
virtual void clearChildren();
virtual bool isDetached() const { return true; }
- RenderListItem* renderListItemContainerForNode(Node* node) const;
#if PLATFORM(MAC)
RetainPtr<AccessibilityObjectWrapper> m_wrapper;
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 2e53703..1b3c461 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -476,12 +476,6 @@ bool AccessibilityRenderObject::isPasswordField() const
return inputElement->isPasswordField();
}
-
-bool AccessibilityRenderObject::isCheckboxOrRadio() const
-{
- AccessibilityRole role = roleValue();
- return role == RadioButtonRole || role == CheckBoxRole;
-}
bool AccessibilityRenderObject::isFileUploadButton() const
{
@@ -660,36 +654,29 @@ bool AccessibilityRenderObject::isOffScreen() const
int AccessibilityRenderObject::headingLevel() const
{
// headings can be in block flow and non-block flow
- if (!m_renderer)
- return 0;
-
- Node* node = m_renderer->node();
- if (!node)
+ Node* element = node();
+ if (!element)
return 0;
- if (ariaRoleAttribute() == HeadingRole) {
- if (!node->isElementNode())
- return 0;
- Element* element = static_cast<Element*>(node);
- return element->getAttribute(aria_levelAttr).toInt();
- }
+ if (ariaRoleAttribute() == HeadingRole)
+ return getAttribute(aria_levelAttr).toInt();
- if (node->hasTagName(h1Tag))
+ if (element->hasTagName(h1Tag))
return 1;
- if (node->hasTagName(h2Tag))
+ if (element->hasTagName(h2Tag))
return 2;
- if (node->hasTagName(h3Tag))
+ if (element->hasTagName(h3Tag))
return 3;
- if (node->hasTagName(h4Tag))
+ if (element->hasTagName(h4Tag))
return 4;
- if (node->hasTagName(h5Tag))
+ if (element->hasTagName(h5Tag))
return 5;
- if (node->hasTagName(h6Tag))
+ if (element->hasTagName(h6Tag))
return 6;
return 0;
@@ -760,11 +747,6 @@ AccessibilityObject* AccessibilityRenderObject::selectedTabItem()
}
return 0;
}
-
-const AtomicString& AccessibilityRenderObject::getAttribute(const QualifiedName& attribute) const
-{
- return AccessibilityObject::getAttribute(m_renderer->node(), attribute);
-}
Element* AccessibilityRenderObject::anchorElement() const
{
@@ -990,14 +972,6 @@ unsigned AccessibilityRenderObject::hierarchicalLevel() const
return level;
}
-
-String AccessibilityRenderObject::language() const
-{
- if (!m_renderer)
- return String();
-
- return AccessibilityObject::language(m_renderer->node());
-}
String AccessibilityRenderObject::textUnderElement() const
{
@@ -1030,38 +1004,17 @@ String AccessibilityRenderObject::textUnderElement() const
return String();
}
-bool AccessibilityRenderObject::hasIntValue() const
-{
- if (isHeading())
- return true;
-
- if (m_renderer->node() && isCheckboxOrRadio())
- return true;
+Node* AccessibilityRenderObject::node() const
+{
+ return m_renderer ? m_renderer->node() : 0;
+}
- return false;
-}
-
int AccessibilityRenderObject::intValue() const
{
- if (!m_renderer || isPasswordField())
- return 0;
-
- if (isHeading())
- return headingLevel();
-
- Node* node = m_renderer->node();
- if (!node || !isCheckboxOrRadio())
- return 0;
+ if (isCheckboxOrRadio())
+ return isChecked() ? 1 : 0;
- // If this is an ARIA checkbox or radio, check the aria-checked attribute rather than node()->checked()
- AccessibilityRole ariaRole = ariaRoleAttribute();
- if (ariaRole == RadioButtonRole || ariaRole == CheckBoxRole) {
- if (equalIgnoringCase(getAttribute(aria_checkedAttr), "true"))
- return true;
- return false;
- }
-
- return static_cast<HTMLInputElement*>(node)->checked();
+ return AccessibilityObject::intValue();
}
String AccessibilityRenderObject::valueDescription() const
@@ -1122,9 +1075,11 @@ String AccessibilityRenderObject::stringValue() const
Element* selectedOption = 0;
if (selectedIndex >= 0 && selectedIndex < (int)listItems.size())
selectedOption = listItems[selectedIndex];
- String overridenDescription = AccessibilityObject::getAttribute(selectedOption, aria_labelAttr);
- if (!overridenDescription.isNull())
- return overridenDescription;
+ if (selectedOption) {
+ String overridenDescription = selectedOption->getAttribute(aria_labelAttr);
+ if (!overridenDescription.isNull())
+ return overridenDescription;
+ }
return toRenderMenuList(m_renderer)->text();
}
@@ -1364,9 +1319,11 @@ String AccessibilityRenderObject::accessibilityDescription() const
// Check if the HTML element has an aria-label for the webpage.
Element* documentElement = document->documentElement();
- const AtomicString& ariaLabel = AccessibilityObject::getAttribute(documentElement, aria_labelAttr);
- if (!ariaLabel.isEmpty())
- return ariaLabel;
+ if (documentElement) {
+ const AtomicString& ariaLabel = documentElement->getAttribute(aria_labelAttr);
+ if (!ariaLabel.isEmpty())
+ return ariaLabel;
+ }
Node* owner = document->ownerElement();
if (owner) {
@@ -1397,8 +1354,10 @@ IntRect AccessibilityRenderObject::boundingBoxRect() const
if (obj->node()) // If we are a continuation, we want to make sure to use the primary renderer.
obj = obj->node()->renderer();
+ // absoluteFocusRingQuads will query the hierarchy below this element, which for large webpages can be very slow.
+ // For a web area, which will have the most elements of any element, absoluteQuads should be used.
Vector<FloatQuad> quads;
- if (obj->isText())
+ if (obj->isText() || isWebArea())
obj->absoluteQuads(quads);
else
obj->absoluteFocusRingQuads(quads);
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index d4f798a..526324f 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -75,7 +75,6 @@ public:
virtual bool isTextControl() const;
virtual bool isNativeTextControl() const;
virtual bool isWebArea() const;
- virtual bool isCheckboxOrRadio() const;
virtual bool isFileUploadButton() const;
virtual bool isInputImage() const;
virtual bool isProgressIndicator() const;
@@ -106,14 +105,11 @@ public:
virtual bool isExpanded() const;
virtual void setIsExpanded(bool);
- const AtomicString& getAttribute(const QualifiedName&) const;
virtual bool canSetFocusAttribute() const;
virtual bool canSetTextRangeAttributes() const;
virtual bool canSetValueAttribute() const;
virtual bool canSetExpandedAttribute() const;
- virtual bool hasIntValue() const;
-
virtual void setAccessibleName(String&);
// Provides common logic used by all elements when determining isIgnored.
@@ -169,10 +165,7 @@ public:
void setRenderer(RenderObject* renderer) { m_renderer = renderer; }
RenderObject* renderer() const { return m_renderer; }
- Node* node() const
- {
- return m_renderer ? m_renderer->node() : 0;
- };
+ virtual Node* node() const;
RenderView* topRenderer() const;
RenderTextControl* textControl() const;
@@ -283,7 +276,6 @@ private:
bool isAllowedChildOfTree() const;
bool hasTextAlternative() const;
String positionalDescriptionForMSAA() const;
- virtual String language() const;
Element* menuElementForMenuButton() const;
Element* menuItemElementForMenu() const;
diff --git a/WebCore/accessibility/AccessibilityTable.cpp b/WebCore/accessibility/AccessibilityTable.cpp
index 437ac38..a0bb655 100644
--- a/WebCore/accessibility/AccessibilityTable.cpp
+++ b/WebCore/accessibility/AccessibilityTable.cpp
@@ -137,6 +137,9 @@ bool AccessibilityTable::isTableExposableThroughAccessibility()
unsigned borderedCellCount = 0;
unsigned backgroundDifferenceCellCount = 0;
+ Color alternatingRowColors[5];
+ int alternatingRowColorCount = 0;
+
int headersInFirstColumnCount = 0;
for (int row = 0; row < numRows; ++row) {
@@ -189,6 +192,19 @@ bool AccessibilityTable::isTableExposableThroughAccessibility()
// if we've found 10 "good" cells, we don't need to keep searching
if (borderedCellCount >= 10 || backgroundDifferenceCellCount >= 10)
return true;
+
+ // For the first 5 rows, cache the background color so we can check if this table has zebra-striped rows.
+ if (row < 5 && row == alternatingRowColorCount) {
+ RenderObject* renderRow = cell->parent();
+ if (!renderRow || !renderRow->isTableRow())
+ continue;
+ RenderStyle* rowRenderStyle = renderRow->style();
+ if (!rowRenderStyle)
+ continue;
+ Color rowColor = rowRenderStyle->visitedDependentColor(CSSPropertyBackgroundColor);
+ alternatingRowColors[alternatingRowColorCount] = rowColor;
+ alternatingRowColorCount++;
+ }
}
if (!row && headersInFirstRowCount == numCols && numCols > 1)
@@ -211,6 +227,20 @@ bool AccessibilityTable::isTableExposableThroughAccessibility()
if (backgroundDifferenceCellCount >= neededCellCount)
return true;
+ // Check if there is an alternating row background color indicating a zebra striped style pattern.
+ if (alternatingRowColorCount > 2) {
+ Color firstColor = alternatingRowColors[0];
+ for (int k = 1; k < alternatingRowColorCount; k++) {
+ // If an odd row was the same color as the first row, its not alternating.
+ if (k % 2 == 1 && alternatingRowColors[k] == firstColor)
+ return false;
+ // If an even row is not the same as the first row, its not alternating.
+ if (!(k % 2) && alternatingRowColors[k] != firstColor)
+ return false;
+ }
+ return true;
+ }
+
return false;
}
diff --git a/WebCore/accessibility/AccessibilityTableCell.cpp b/WebCore/accessibility/AccessibilityTableCell.cpp
index 7fadb88..28e66ad 100644
--- a/WebCore/accessibility/AccessibilityTableCell.cpp
+++ b/WebCore/accessibility/AccessibilityTableCell.cpp
@@ -73,7 +73,12 @@ AccessibilityObject* AccessibilityTableCell::parentTable() const
if (!m_renderer || !m_renderer->isTableCell())
return 0;
- return axObjectCache()->getOrCreate(toRenderTableCell(m_renderer)->table());
+ // Do not use getOrCreate. parentTable() can be called while the render tree is being modified
+ // by javascript, and creating a table element may try to access the render tree while in a bad state.
+ // By using only get() implies that the AXTable must be created before AXTableCells. This should
+ // always be the case when AT clients access a table.
+ // https://bugs.webkit.org/show_bug.cgi?id=42652
+ return axObjectCache()->get(toRenderTableCell(m_renderer)->table());
}
bool AccessibilityTableCell::isTableCell() const
diff --git a/WebCore/accessibility/AccessibilityTableColumn.cpp b/WebCore/accessibility/AccessibilityTableColumn.cpp
index 5872706..45137ff 100644
--- a/WebCore/accessibility/AccessibilityTableColumn.cpp
+++ b/WebCore/accessibility/AccessibilityTableColumn.cpp
@@ -130,6 +130,9 @@ AccessibilityObject* AccessibilityTableColumn::headerObjectForSection(RenderTabl
if (m_columnIndex >= numCols)
return 0;
+ if (!section->numRows())
+ return 0;
+
RenderTableCell* cell = 0;
// also account for cells that have a span
for (int testCol = m_columnIndex; testCol >= 0; --testCol) {
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
index 7d4e5c1..153f995 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
@@ -47,6 +47,7 @@ bool RuntimeEnabledFeatures::isIndexedDBEnabled = false;
bool RuntimeEnabledFeatures::isWebGLEnabled = false;
bool RuntimeEnabledFeatures::isPushStateEnabled = false;
bool RuntimeEnabledFeatures::isTouchEnabled = true;
+bool RuntimeEnabledFeatures::isDeviceOrientationEnabled = true;
#if ENABLE(VIDEO)
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.h b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
index 73bbf0f..d8eae23 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.h
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
@@ -113,6 +113,11 @@ public:
static bool ontouchcancelEnabled() { return isTouchEnabled; }
#endif
+ static void setDeviceOrientationEnabled(bool isEnabled) { isDeviceOrientationEnabled = isEnabled; }
+ static bool deviceOrientationEnabled() { return isDeviceOrientationEnabled; }
+ static bool deviceOrientationEventEnabled() { return isDeviceOrientationEnabled; }
+ static bool ondeviceorientationEnabled() { return isDeviceOrientationEnabled; }
+
private:
// Never instantiate.
RuntimeEnabledFeatures() { }
@@ -126,6 +131,7 @@ private:
static bool isWebGLEnabled;
static bool isPushStateEnabled;
static bool isTouchEnabled;
+ static bool isDeviceOrientationEnabled;
};
} // namespace WebCore
diff --git a/WebCore/bindings/js/JSBindingsAllInOne.cpp b/WebCore/bindings/js/JSBindingsAllInOne.cpp
index 373c0e0..b517496 100644
--- a/WebCore/bindings/js/JSBindingsAllInOne.cpp
+++ b/WebCore/bindings/js/JSBindingsAllInOne.cpp
@@ -62,6 +62,7 @@
#include "JSDebugWrapperSet.cpp"
#include "JSDedicatedWorkerContextCustom.cpp"
#include "JSDesktopNotificationsCustom.cpp"
+#include "JSDeviceOrientationEventCustom.cpp"
#include "JSDocumentCustom.cpp"
#include "JSElementCustom.cpp"
#include "JSEventCustom.cpp"
diff --git a/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp b/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
index e88afc2..8221fed 100644
--- a/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
+++ b/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
@@ -51,10 +51,8 @@ static JSValue toJS(ExecState* exec, CanvasStyle* style)
return jsString(exec, style->color());
}
-static PassRefPtr<CanvasStyle> toHTMLCanvasStyle(ExecState* exec, JSValue value)
+static PassRefPtr<CanvasStyle> toHTMLCanvasStyle(ExecState*, JSValue value)
{
- if (value.isString())
- return CanvasStyle::create(ustringToString(asString(value)->value(exec)));
if (!value.isObject())
return 0;
JSObject* object = asObject(value);
@@ -74,6 +72,10 @@ JSValue JSCanvasRenderingContext2D::strokeStyle(ExecState* exec) const
void JSCanvasRenderingContext2D::setStrokeStyle(ExecState* exec, JSValue value)
{
CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl());
+ if (value.isString()) {
+ context->setStrokeColor(ustringToString(asString(value)->value(exec)));
+ return;
+ }
context->setStrokeStyle(toHTMLCanvasStyle(exec, value));
}
@@ -86,6 +88,10 @@ JSValue JSCanvasRenderingContext2D::fillStyle(ExecState* exec) const
void JSCanvasRenderingContext2D::setFillStyle(ExecState* exec, JSValue value)
{
CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl());
+ if (value.isString()) {
+ context->setFillColor(ustringToString(asString(value)->value(exec)));
+ return;
+ }
context->setFillStyle(toHTMLCanvasStyle(exec, value));
}
@@ -260,9 +266,8 @@ JSValue JSCanvasRenderingContext2D::drawImage(ExecState* exec)
return throwSyntaxError(exec);
}
#endif
- } else {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- }
+ } else
+ return throwTypeError(exec);
return jsUndefined();
}
diff --git a/WebCore/bindings/js/JSConsoleCustom.cpp b/WebCore/bindings/js/JSConsoleCustom.cpp
index b9b407c..3ad34a3 100644
--- a/WebCore/bindings/js/JSConsoleCustom.cpp
+++ b/WebCore/bindings/js/JSConsoleCustom.cpp
@@ -28,9 +28,7 @@
#include "JSConsole.h"
#include "Console.h"
-#include "JSMemoryInfo.h"
#include "JSScriptProfile.h"
-#include "MemoryInfo.h"
#include "ScriptCallStack.h"
#include "ScriptProfile.h"
#include <runtime/JSArray.h>
@@ -57,9 +55,4 @@ JSValue JSConsole::profiles(ExecState* exec) const
#endif
-JSValue JSConsole::memory(ExecState* exec) const
-{
- return toJS(exec, MemoryInfo::create());
-}
-
} // namespace WebCore
diff --git a/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp b/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
new file mode 100644
index 0000000..05f8755
--- /dev/null
+++ b/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
@@ -0,0 +1,83 @@
+/*
+ * 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 "JSDeviceOrientationEvent.h"
+
+#if ENABLE(DEVICE_ORIENTATION)
+
+#include "DeviceOrientation.h"
+#include "DeviceOrientationEvent.h"
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSDeviceOrientationEvent::alpha(ExecState* exec) const
+{
+ DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
+ if (!imp->orientation()->canProvideAlpha())
+ return jsNull();
+ return jsNumber(exec, imp->orientation()->alpha());
+}
+
+JSValue JSDeviceOrientationEvent::beta(ExecState* exec) const
+{
+ DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
+ if (!imp->orientation()->canProvideBeta())
+ return jsNull();
+ return jsNumber(exec, imp->orientation()->beta());
+}
+
+JSValue JSDeviceOrientationEvent::gamma(ExecState* exec) const
+{
+ DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
+ if (!imp->orientation()->canProvideGamma())
+ return jsNull();
+ return jsNumber(exec, imp->orientation()->gamma());
+}
+
+JSValue JSDeviceOrientationEvent::initDeviceOrientationEvent(ExecState* exec)
+{
+ const String& type = ustringToString(exec->argument(0).toString(exec));
+ bool bubbles = exec->argument(1).toBoolean(exec);
+ bool cancelable = exec->argument(2).toBoolean(exec);
+ // If alpha, beta or gamma are null or undefined, mark them as not provided.
+ // Otherwise, use the standard JavaScript conversion.
+ bool alphaProvided = !exec->argument(3).isUndefinedOrNull();
+ double alpha = exec->argument(3).toNumber(exec);
+ bool betaProvided = !exec->argument(4).isUndefinedOrNull();
+ double beta = exec->argument(4).toNumber(exec);
+ bool gammaProvided = !exec->argument(5).isUndefinedOrNull();
+ double gamma = exec->argument(5).toNumber(exec);
+ RefPtr<DeviceOrientation> orientation = DeviceOrientation::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma);
+ DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
+ imp->initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get());
+ return jsUndefined();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(DEVICE_ORIENTATION)
diff --git a/WebCore/bindings/js/ScriptArray.cpp b/WebCore/bindings/js/ScriptArray.cpp
index caecc40..119d303 100644
--- a/WebCore/bindings/js/ScriptArray.cpp
+++ b/WebCore/bindings/js/ScriptArray.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "ScriptArray.h"
+#include "SerializedScriptValue.h"
+
#include <runtime/JSLock.h>
using namespace JSC;
@@ -62,6 +64,19 @@ bool ScriptArray::set(unsigned index, const ScriptObject& value)
return handleException(m_scriptState);
}
+bool ScriptArray::set(unsigned index, SerializedScriptValue* value)
+{
+ ScriptValue scriptValue = ScriptValue::deserialize(m_scriptState, value);
+ if (scriptValue.hasNoValue()) {
+ ASSERT_NOT_REACHED();
+ return false;
+ }
+
+ JSLock lock(SilenceAssertionsOnly);
+ jsArray()->put(m_scriptState, index, scriptValue.jsValue());
+ return handleException(m_scriptState);
+}
+
bool ScriptArray::set(unsigned index, const String& value)
{
JSLock lock(SilenceAssertionsOnly);
diff --git a/WebCore/bindings/js/ScriptArray.h b/WebCore/bindings/js/ScriptArray.h
index 9240368..2badd09 100644
--- a/WebCore/bindings/js/ScriptArray.h
+++ b/WebCore/bindings/js/ScriptArray.h
@@ -37,23 +37,25 @@
#include <runtime/JSArray.h>
namespace WebCore {
-
- class ScriptArray : public ScriptObject {
- public:
- ScriptArray(ScriptState*, JSC::JSArray*);
- ScriptArray() {}
- JSC::JSArray* jsArray() const { return asArray(jsValue()); }
-
- bool set(unsigned index, const ScriptObject&);
- bool set(unsigned index, const String&);
- bool set(unsigned index, double);
- bool set(unsigned index, long long);
- bool set(unsigned index, int);
- bool set(unsigned index, bool);
- unsigned length();
-
- static ScriptArray createNew(ScriptState*);
- };
+class SerializedScriptValue;
+
+class ScriptArray : public ScriptObject {
+public:
+ ScriptArray(ScriptState*, JSC::JSArray*);
+ ScriptArray() {}
+ JSC::JSArray* jsArray() const { return asArray(jsValue()); }
+
+ bool set(unsigned index, const ScriptObject&);
+ bool set(unsigned index, SerializedScriptValue*);
+ bool set(unsigned index, const String&);
+ bool set(unsigned index, double);
+ bool set(unsigned index, long long);
+ bool set(unsigned index, int);
+ bool set(unsigned index, bool);
+ unsigned length();
+
+ static ScriptArray createNew(ScriptState*);
+};
}
#endif // ScriptArray_h
diff --git a/WebCore/bindings/js/ScriptCallStack.cpp b/WebCore/bindings/js/ScriptCallStack.cpp
index c9bb8b0..de61b07 100644
--- a/WebCore/bindings/js/ScriptCallStack.cpp
+++ b/WebCore/bindings/js/ScriptCallStack.cpp
@@ -91,11 +91,21 @@ void ScriptCallStack::initialize()
if (!m_caller || m_initialized)
return;
- JSValue func = m_exec->interpreter()->retrieveCaller(m_exec, m_caller);
- while (!func.isNull()) {
- JSFunction* jsFunction = asFunction(func);
- m_frames.append(ScriptCallFrame(jsFunction->name(m_exec), UString(), 0, 0, 0));
- func = m_exec->interpreter()->retrieveCaller(m_exec, jsFunction);
+ int signedLineNumber;
+ intptr_t sourceID;
+ UString urlString;
+ JSValue function;
+ // callFrame must exist if m_caller is not null.
+ CallFrame* callFrame = m_exec->callerFrame();
+ while (true) {
+ ASSERT(callFrame);
+ m_exec->interpreter()->retrieveLastCaller(callFrame, signedLineNumber, sourceID, urlString, function);
+ if (!function)
+ break;
+ JSFunction* jsFunction = asFunction(function);
+ unsigned lineNumber = signedLineNumber >= 0 ? signedLineNumber : 0;
+ m_frames.append(ScriptCallFrame(jsFunction->name(m_exec), urlString, lineNumber, m_exec, 0));
+ callFrame = callFrame->callerFrame();
}
m_initialized = true;
}
diff --git a/WebCore/bindings/js/ScriptController.cpp b/WebCore/bindings/js/ScriptController.cpp
index 0aa8f52..98022d9 100644
--- a/WebCore/bindings/js/ScriptController.cpp
+++ b/WebCore/bindings/js/ScriptController.cpp
@@ -379,6 +379,12 @@ PassRefPtr<Bindings::RootObject> ScriptController::createRootObject(void* native
return rootObject.release();
}
+#if ENABLE(INSPECTOR)
+void ScriptController::setCaptureCallStackForUncaughtExceptions(bool)
+{
+}
+#endif
+
#if ENABLE(NETSCAPE_PLUGIN_API)
NPObject* ScriptController::windowScriptNPObject()
diff --git a/WebCore/bindings/js/ScriptController.h b/WebCore/bindings/js/ScriptController.h
index c382a93..80155e4 100644
--- a/WebCore/bindings/js/ScriptController.h
+++ b/WebCore/bindings/js/ScriptController.h
@@ -151,6 +151,10 @@ public:
PassRefPtr<JSC::Bindings::RootObject> createRootObject(void* nativeHandle);
+#if ENABLE(INSPECTOR)
+ static void setCaptureCallStackForUncaughtExceptions(bool);
+#endif
+
#if PLATFORM(MAC)
#if ENABLE(JAVA_BRIDGE)
static void initJavaJSBindings();
diff --git a/WebCore/bindings/js/ScriptDebugServer.cpp b/WebCore/bindings/js/ScriptDebugServer.cpp
index 0a40f13..d71034b 100644
--- a/WebCore/bindings/js/ScriptDebugServer.cpp
+++ b/WebCore/bindings/js/ScriptDebugServer.cpp
@@ -200,7 +200,7 @@ void ScriptDebugServer::setPauseOnExceptionsState(PauseOnExceptionsState pause)
m_pauseOnExceptionsState = pause;
}
-void ScriptDebugServer::pauseProgram()
+void ScriptDebugServer::pause()
{
m_pauseOnNextStatement = true;
}
diff --git a/WebCore/bindings/js/ScriptDebugServer.h b/WebCore/bindings/js/ScriptDebugServer.h
index 6a8209b..fd8976b 100644
--- a/WebCore/bindings/js/ScriptDebugServer.h
+++ b/WebCore/bindings/js/ScriptDebugServer.h
@@ -67,6 +67,8 @@ public:
void removeBreakpoint(const String& sourceID, unsigned lineNumber);
void clearBreakpoints();
void setBreakpointsActivated(bool activated);
+ void activateBreakpoints() { setBreakpointsActivated(true); }
+ void deactivateBreakpoints() { setBreakpointsActivated(false); }
enum PauseOnExceptionsState {
DontPauseOnExceptions,
@@ -76,7 +78,7 @@ public:
PauseOnExceptionsState pauseOnExceptionsState() const { return m_pauseOnExceptionsState; }
void setPauseOnExceptionsState(PauseOnExceptionsState);
- void pauseProgram();
+ void pause();
void continueProgram();
void stepIntoStatement();
void stepOverStatement();
diff --git a/WebCore/bindings/js/StringSourceProvider.h b/WebCore/bindings/js/StringSourceProvider.h
index 2a18006..478c1d1 100644
--- a/WebCore/bindings/js/StringSourceProvider.h
+++ b/WebCore/bindings/js/StringSourceProvider.h
@@ -49,10 +49,6 @@ namespace WebCore {
: ScriptSourceProvider(stringToUString(url))
, m_source(source)
{
- if (m_source.length()) {
- bool scratch = false;
- m_source = String(source.impl()->copyStringWithoutBOMs(false, scratch));
- }
}
String m_source;
diff --git a/WebCore/bindings/objc/WebScriptObject.mm b/WebCore/bindings/objc/WebScriptObject.mm
index 3f224f1..37874ac 100644
--- a/WebCore/bindings/objc/WebScriptObject.mm
+++ b/WebCore/bindings/objc/WebScriptObject.mm
@@ -433,6 +433,27 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
_didExecute(self);
}
+- (BOOL)hasWebScriptKey:(NSString *)key
+{
+ if (![self _isSafeScript])
+ return NO;
+
+ ExecState* exec = [self _rootObject]->globalObject()->globalExec();
+ ASSERT(!exec->hadException());
+
+ JSLock lock(SilenceAssertionsOnly);
+ BOOL result = [self _imp]->hasProperty(exec, Identifier(exec, stringToUString(String(key))));
+
+ if (exec->hadException()) {
+ addExceptionToConsole(exec);
+ exec->clearException();
+ }
+
+ _didExecute(self);
+
+ return result;
+}
+
- (NSString *)stringRepresentation
{
if (![self _isSafeScript]) {
diff --git a/WebCore/bindings/objc/WebScriptObjectPrivate.h b/WebCore/bindings/objc/WebScriptObjectPrivate.h
index 3a424ce..5da1dde 100644
--- a/WebCore/bindings/objc/WebScriptObjectPrivate.h
+++ b/WebCore/bindings/objc/WebScriptObjectPrivate.h
@@ -59,6 +59,16 @@ namespace WebCore {
- (JSC::Bindings::RootObject*)_originRootObject;
@end
+@interface WebScriptObject (StagedForPublic)
+/*!
+ @method hasWebScriptKey:
+ @param name The name of the property to check for.
+ @discussion Checks for the existence of the property on the object in the script environment.
+ @result Returns YES if the property exists, NO otherwise.
+ */
+- (BOOL)hasWebScriptKey:(NSString *)name;
+@end
+
@interface WebScriptObjectPrivate : NSObject
{
@public
diff --git a/WebCore/bindings/scripts/CodeGenerator.pm b/WebCore/bindings/scripts/CodeGenerator.pm
index d106920..363fdc5 100644
--- a/WebCore/bindings/scripts/CodeGenerator.pm
+++ b/WebCore/bindings/scripts/CodeGenerator.pm
@@ -31,6 +31,7 @@ use File::Find;
my $useDocument = "";
my $useGenerator = "";
my $useOutputDir = "";
+my $useOutputHeadersDir = "";
my $useDirectories = "";
my $useLayerOnTop = 0;
my $preprocessor;
@@ -80,6 +81,7 @@ sub new
$useDirectories = shift;
$useGenerator = shift;
$useOutputDir = shift;
+ $useOutputHeadersDir = shift;
$useLayerOnTop = shift;
$preprocessor = shift;
$writeDependencies = shift;
@@ -107,7 +109,7 @@ sub ProcessDocument
require $ifaceName . ".pm";
# Dynamically load external code generation perl module
- $codeGenerator = $ifaceName->new($object, $useOutputDir, $useLayerOnTop, $preprocessor, $writeDependencies, $verbose);
+ $codeGenerator = $ifaceName->new($object, $useOutputDir, $useOutputHeadersDir, $useLayerOnTop, $preprocessor, $writeDependencies, $verbose);
unless (defined($codeGenerator)) {
my $classes = $useDocument->classes;
foreach my $class (@$classes) {
@@ -467,4 +469,28 @@ sub SetterExpressionPrefix
return "$functionName($contentAttributeName, "
}
+sub ShouldCheckEnums
+{
+ my $dataNode = shift;
+ return not $dataNode->extendedAttributes->{"DontCheckEnums"};
+}
+
+sub GenerateCompileTimeCheckForEnumsIfNeeded
+{
+ my ($object, $dataNode) = @_;
+ my $interfaceName = $dataNode->name;
+ my @checks = ();
+ # If necessary, check that all constants are available as enums with the same value.
+ if (ShouldCheckEnums($dataNode) && @{$dataNode->constants}) {
+ push(@checks, "\n");
+ foreach my $constant (@{$dataNode->constants}) {
+ my $name = $constant->name;
+ my $value = $constant->value;
+ push(@checks, "COMPILE_ASSERT($value == ${interfaceName}::$name, ${interfaceName}Enum${name}IsWrongUseDontCheckEnums);\n");
+ }
+ push(@checks, "\n");
+ }
+ return @checks;
+}
+
1;
diff --git a/WebCore/bindings/scripts/CodeGeneratorCPP.pm b/WebCore/bindings/scripts/CodeGeneratorCPP.pm
index 7df91ca..9e254af 100644
--- a/WebCore/bindings/scripts/CodeGeneratorCPP.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorCPP.pm
@@ -98,6 +98,7 @@ sub new
$codeGenerator = shift;
$outputDir = shift;
+ shift; # $outputHeadersDir
shift; # $useLayerOnTop
shift; # $preprocessor
shift; # $writeDependencies
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index a0a2098..d992d89 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -73,6 +73,7 @@ sub new
$codeGenerator = shift;
$outputDir = shift;
+ shift; # $outputHeadersDir
shift; # $useLayerOnTop
shift; # $preprocessor
$writeDependencies = shift;
@@ -1242,6 +1243,8 @@ sub GenerateImplementation
\@hashKeys, \@hashSpecials,
\@hashValue1, \@hashValue2);
+ push(@implContent, $codeGenerator->GenerateCompileTimeCheckForEnumsIfNeeded($dataNode));
+
my $protoClassName = "${className}Prototype";
GenerateConstructorDeclaration(\@implContent, $className, $dataNode) unless $dataNode->extendedAttributes->{"CustomConstructFunction"};
diff --git a/WebCore/bindings/scripts/CodeGeneratorObjC.pm b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
index 7d66979..91cbd0b 100644
--- a/WebCore/bindings/scripts/CodeGeneratorObjC.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
@@ -199,6 +199,7 @@ sub new
$codeGenerator = shift;
$outputDir = shift;
+ shift; # $outputHeadersDir
shift; # $useLayerOnTop
shift; # $preprocessor
$writeDependencies = shift;
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 383bb74..c963e04 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -30,6 +30,7 @@ use Digest::MD5;
my $module = "";
my $outputDir = "";
+my $outputHeadersDir = "";
my @headerContent = ();
my @implContentHeader = ();
@@ -71,6 +72,7 @@ sub new
$codeGenerator = shift;
$outputDir = shift;
+ $outputHeadersDir = shift;
bless($reference, $object);
return $reference;
@@ -110,7 +112,7 @@ sub GenerateInterface
my $name = $dataNode->name;
# Open files for writing
- my $headerFileName = "$outputDir/V8$name.h";
+ my $headerFileName = "$outputHeadersDir/V8$name.h";
my $implFileName = "$outputDir/V8$name.cpp";
open($IMPL, ">$implFileName") || die "Couldn't open file $implFileName";
@@ -273,13 +275,6 @@ END
END
}
- if ($implClassName eq "HTMLDocument") {
- push(@headerContent, <<END);
- static v8::Local<v8::Object> WrapInShadowObject(v8::Local<v8::Object> wrapper, Node* impl);
- static v8::Handle<v8::Value> GetNamedProperty(HTMLDocument* htmlDocument, const AtomicString& key);
-END
- }
-
my @enabledAtRuntime;
foreach my $function (@{$dataNode->functions}) {
my $name = $function->signature->name;
@@ -367,6 +362,9 @@ sub GetInternalFields
if (IsSubType($dataNode, "Document")) {
push(@customInternalFields, "implementationIndex");
+ if ($name eq "HTMLDocument") {
+ push(@customInternalFields, ("markerIndex", "shadowIndex"));
+ }
} elsif ($name eq "DOMWindow") {
push(@customInternalFields, "enteredIsolatedWorldIndex");
}
@@ -403,6 +401,7 @@ END
my %indexerSpecialCases = (
"Storage" => 1,
"HTMLAppletElement" => 1,
+ "HTMLDocument" => 1,
"HTMLEmbedElement" => 1,
"HTMLObjectElement" => 1
);
@@ -429,10 +428,6 @@ sub GenerateHeaderNamedAndIndexedPropertyAccessors
if ($interfaceName eq "HTMLSelectElement" || $interfaceName eq "HTMLAppletElement" || $interfaceName eq "HTMLEmbedElement" || $interfaceName eq "HTMLObjectElement") {
$hasCustomNamedGetter = 1;
}
- if ($interfaceName eq "HTMLDocument") {
- $hasCustomNamedGetter = 0;
- $hasCustomIndexedGetter = 0;
- }
my $isIndexerSpecialCase = exists $indexerSpecialCases{$interfaceName};
if ($hasCustomIndexedGetter || $isIndexerSpecialCase) {
@@ -461,7 +456,7 @@ END
static v8::Handle<v8::Value> namedPropertySetter(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo&);
END
}
- if ($hasCustomDeleters) {
+ if ($hasCustomDeleters || $interfaceName eq "HTMLDocument") {
push(@headerContent, <<END);
static v8::Handle<v8::Boolean> namedPropertyDeleter(v8::Local<v8::String>, const v8::AccessorInfo&);
END
@@ -1478,10 +1473,6 @@ sub GenerateImplementationNamedPropertyGetter
$hasCustomGetter = 1;
}
- if ($interfaceName eq "HTMLDocument") {
- $hasCustomGetter = 0;
- }
-
my $hasGetter = $dataNode->extendedAttributes->{"HasNameGetter"} || $hasCustomGetter || $namedPropertyGetter;
if (!$hasGetter) {
return;
@@ -1497,7 +1488,8 @@ END
}
my $hasSetter = $dataNode->extendedAttributes->{"DelegatingPutFunction"};
- my $hasDeleter = $dataNode->extendedAttributes->{"CustomDeleteProperty"};
+ # FIXME: Try to remove hard-coded HTMLDocument reference by aligning handling of document.all with JSC bindings.
+ my $hasDeleter = $dataNode->extendedAttributes->{"CustomDeleteProperty"} || $interfaceName eq "HTMLDocument";
my $hasEnumerator = $dataNode->extendedAttributes->{"CustomGetPropertyNames"};
my $setOn = "Instance";
@@ -1753,6 +1745,7 @@ END
}
if ($has_constants) {
push(@implContent, "};\n");
+ push(@implContent, $codeGenerator->GenerateCompileTimeCheckForEnumsIfNeeded($dataNode));
}
push(@implContentDecls, "} // namespace ${interfaceName}Internal\n\n");
@@ -1981,11 +1974,6 @@ END
instance->SetAccessCheckCallbacks(V8DOMWindow::namedSecurityCheck, V8DOMWindow::indexedSecurityCheck, v8::External::Wrap(&V8DOMWindow::info), false);
END
}
- if ($interfaceName eq "HTMLDocument") {
- push(@implContent, <<END);
- desc->SetHiddenPrototype(true);
-END
- }
if ($interfaceName eq "Location") {
push(@implContent, <<END);
diff --git a/WebCore/bindings/scripts/IDLParser.pm b/WebCore/bindings/scripts/IDLParser.pm
index e250a4d..927deb9 100644
--- a/WebCore/bindings/scripts/IDLParser.pm
+++ b/WebCore/bindings/scripts/IDLParser.pm
@@ -329,11 +329,13 @@ sub ParseInterface
my $line = $_;
$line =~ /$IDLStructure::interfaceParameterSelector/;
- my $paramExtendedAttributes = (defined($1) ? $1 : " "); chop($paramExtendedAttributes);
- my $paramType = (defined($2) ? $2 : die("Parsing error!\nSource:\n$line\n)"));
- my $paramName = (defined($3) ? $3 : die("Parsing error!\nSource:\n$line\n)"));
+ my $paramDirection = $1;
+ my $paramExtendedAttributes = (defined($2) ? $2 : " "); chop($paramExtendedAttributes);
+ my $paramType = (defined($3) ? $3 : die("Parsing error!\nSource:\n$line\n)"));
+ my $paramName = (defined($4) ? $4 : die("Parsing error!\nSource:\n$line\n)"));
my $paramDataNode = new domSignature();
+ $paramDataNode->direction($paramDirection);
$paramDataNode->name($paramName);
$paramDataNode->type($paramType);
$paramDataNode->extendedAttributes(parseExtendedAttributes($paramExtendedAttributes));
diff --git a/WebCore/bindings/scripts/IDLStructure.pm b/WebCore/bindings/scripts/IDLStructure.pm
index d61fce1..2eda696 100644
--- a/WebCore/bindings/scripts/IDLStructure.pm
+++ b/WebCore/bindings/scripts/IDLStructure.pm
@@ -59,6 +59,7 @@ struct( domAttribute => {
# Used to represent a map of 'variable name' <-> 'variable type'
struct( domSignature => {
+ direction => '$', # Variable direction (in or out)
name => '$', # Variable name
type => '$', # Variable type
extendedAttributes => '$' # Extended attributes
@@ -100,7 +101,7 @@ our $exceptionSubSelector = '{\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s
our $interfaceSelector = 'interface\s*((?:' . $extendedAttributeSyntax . ' )?)(' . $idlIdNs . '*)\s*(?::(\s*[^{]*))?{([a-zA-Z0-9_=\s(),;:\[\]&\|]*)';
our $interfaceMethodSelector = '\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)\s*\(\s*([a-zA-Z0-9:\s,=\[\]]*)';
-our $interfaceParameterSelector = 'in\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)';
+our $interfaceParameterSelector = '(in|out)\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)';
our $interfaceAttributeSelector = '\s*(readonly attribute|attribute)\s*(' . $extendedAttributeSyntax . ' )?' . $supportedTypes . '\s*(' . $idlType . '*)';
diff --git a/WebCore/bindings/scripts/generate-bindings.pl b/WebCore/bindings/scripts/generate-bindings.pl
index b293b3c..57a3928 100755
--- a/WebCore/bindings/scripts/generate-bindings.pl
+++ b/WebCore/bindings/scripts/generate-bindings.pl
@@ -39,8 +39,10 @@ use CodeGenerator;
my @idlDirectories;
my $outputDirectory;
+my $outputHeadersDirectory;
my $generator;
my $defines;
+my $filename;
my $prefix;
my $preprocessor;
my $writeDependencies;
@@ -48,8 +50,10 @@ my $verbose;
GetOptions('include=s@' => \@idlDirectories,
'outputDir=s' => \$outputDirectory,
+ 'outputHeadersDir=s' => \$outputHeadersDirectory,
'generator=s' => \$generator,
'defines=s' => \$defines,
+ 'filename=s' => \$filename,
'prefix=s' => \$prefix,
'preprocessor=s' => \$preprocessor,
'verbose' => \$verbose,
@@ -62,6 +66,9 @@ die('Must specify generator') unless defined($generator);
die('Must specify output directory.') unless defined($outputDirectory);
die('Must specify defines') unless defined($defines);
+if (!$outputHeadersDirectory) {
+ $outputHeadersDirectory = $outputDirectory;
+}
if ($verbose) {
print "$generator: $idlFile\n";
}
@@ -72,5 +79,5 @@ my $parser = IDLParser->new(!$verbose);
my $document = $parser->Parse($idlFile, $defines, $preprocessor);
# Generate desired output for given IDL file.
-my $codeGen = CodeGenerator->new(\@idlDirectories, $generator, $outputDirectory, 0, $preprocessor, $writeDependencies, $verbose);
+my $codeGen = CodeGenerator->new(\@idlDirectories, $generator, $outputDirectory, $outputHeadersDirectory, 0, $preprocessor, $writeDependencies, $verbose);
$codeGen->ProcessDocument($document, $defines);
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
index 1eb5ed3..86c7169 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
@@ -42,6 +42,14 @@ public:
WebDOMTestObj(const WebDOMTestObj&);
~WebDOMTestObj();
+ enum {
+ WEBDOM_CONST_VALUE_0 = 0,
+ WEBDOM_CONST_VALUE_1 = 1,
+ WEBDOM_CONST_VALUE_2 = 2,
+ WEBDOM_CONST_VALUE_4 = 4,
+ WEBDOM_CONST_VALUE_8 = 8
+ };
+
int readOnlyIntAttr() const;
WebDOMString readOnlyStringAttr() const;
WebDOMTestObj readOnlyTestObjAttr() const;
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index 2f561f9..6e667f7 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -100,13 +100,25 @@ static JSC_CONST_HASHTABLE HashTable JSTestObjTable = { 68, 63, JSTestObjTableVa
#define THUNK_GENERATOR(generator)
#endif
-static const HashTableValue JSTestObjConstructorTableValues[1] =
+static const HashTableValue JSTestObjConstructorTableValues[6] =
{
+ { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0 THUNK_GENERATOR(0) },
{ 0, 0, 0, 0 THUNK_GENERATOR(0) }
};
#undef THUNK_GENERATOR
-static JSC_CONST_HASHTABLE HashTable JSTestObjConstructorTable = { 1, 0, JSTestObjConstructorTableValues, 0 };
+static JSC_CONST_HASHTABLE HashTable JSTestObjConstructorTable = { 16, 15, JSTestObjConstructorTableValues, 0 };
+
+COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDontCheckEnums);
+
class JSTestObjConstructor : public DOMConstructorObject {
public:
JSTestObjConstructor(JSC::ExecState*, JSDOMGlobalObject*);
@@ -148,8 +160,13 @@ bool JSTestObjConstructor::getOwnPropertyDescriptor(ExecState* exec, const Ident
#define THUNK_GENERATOR(generator)
#endif
-static const HashTableValue JSTestObjPrototypeTableValues[31] =
+static const HashTableValue JSTestObjPrototypeTableValues[36] =
{
+ { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0 THUNK_GENERATOR(0) },
+ { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0 THUNK_GENERATOR(0) },
{ "voidMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0 THUNK_GENERATOR(0) },
{ "voidMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) },
{ "intMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethod), (intptr_t)0 THUNK_GENERATOR(0) },
@@ -184,7 +201,7 @@ static const HashTableValue JSTestObjPrototypeTableValues[31] =
};
#undef THUNK_GENERATOR
-static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 130, 127, JSTestObjPrototypeTableValues, 0 };
+static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 132, 127, JSTestObjPrototypeTableValues, 0 };
const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", 0, &JSTestObjPrototypeTable, 0 };
JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
@@ -194,12 +211,12 @@ JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject
bool JSTestObjPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
- return getStaticFunctionSlot<JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, slot);
+ return getStaticPropertySlot<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, slot);
}
bool JSTestObjPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
- return getStaticFunctionDescriptor<JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, descriptor);
+ return getStaticPropertyDescriptor<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, descriptor);
}
const ClassInfo JSTestObj::s_info = { "TestObj", 0, &JSTestObjTable, 0 };
@@ -1228,6 +1245,33 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecStat
return throwVMTypeError(exec);
}
+// Constant getters
+
+JSValue jsTestObjCONST_VALUE_0(ExecState* exec, JSValue, const Identifier&)
+{
+ return jsNumber(exec, static_cast<int>(0));
+}
+
+JSValue jsTestObjCONST_VALUE_1(ExecState* exec, JSValue, const Identifier&)
+{
+ return jsNumber(exec, static_cast<int>(1));
+}
+
+JSValue jsTestObjCONST_VALUE_2(ExecState* exec, JSValue, const Identifier&)
+{
+ return jsNumber(exec, static_cast<int>(2));
+}
+
+JSValue jsTestObjCONST_VALUE_4(ExecState* exec, JSValue, const Identifier&)
+{
+ return jsNumber(exec, static_cast<int>(4));
+}
+
+JSValue jsTestObjCONST_VALUE_8(ExecState* exec, JSValue, const Identifier&)
+{
+ return jsNumber(exec, static_cast<int>(8));
+}
+
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* object)
{
return getDOMObjectWrapper<JSTestObj>(exec, globalObject, object);
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.h b/WebCore/bindings/scripts/test/JS/JSTestObj.h
index c83e568..84122b7 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.h
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.h
@@ -173,6 +173,13 @@ JSC::JSValue jsTestObjId(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSTestObjId(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjHash(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsTestObjConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+// Constants
+
+JSC::JSValue jsTestObjCONST_VALUE_0(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjCONST_VALUE_1(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjCONST_VALUE_2(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjCONST_VALUE_4(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjCONST_VALUE_8(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
} // namespace WebCore
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
index 1eac990..33c3a2d 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
@@ -34,6 +34,14 @@
@class NSString;
@protocol DOMEventListener;
+enum {
+ DOM_CONST_VALUE_0 = 0,
+ DOM_CONST_VALUE_1 = 1,
+ DOM_CONST_VALUE_2 = 2,
+ DOM_CONST_VALUE_4 = 4,
+ DOM_CONST_VALUE_8 = 8
+};
+
@interface DOMTestObj : DOMObject
- (int)readOnlyIntAttr;
- (NSString *)readOnlyStringAttr;
diff --git a/WebCore/bindings/scripts/test/TestObj.idl b/WebCore/bindings/scripts/test/TestObj.idl
index 43fc211..f9d41d7 100644
--- a/WebCore/bindings/scripts/test/TestObj.idl
+++ b/WebCore/bindings/scripts/test/TestObj.idl
@@ -129,5 +129,12 @@ module test {
readonly attribute long description;
attribute long id;
readonly attribute DOMString hash;
+
+ // Check constants and enums.
+ const unsigned short CONST_VALUE_0 = 0;
+ const unsigned short CONST_VALUE_1 = 1;
+ const unsigned short CONST_VALUE_2 = 2;
+ const unsigned short CONST_VALUE_4 = 4;
+ const unsigned short CONST_VALUE_8 = 8;
};
}
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index 0b9d034..c348726 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -1015,6 +1015,20 @@ static const BatchedCallback TestObjCallbacks[] = {
{"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjInternal::methodWithNonOptionalArgAndTwoOptionalArgsCallback},
{"overloadedMethod", TestObjInternal::overloadedMethodCallback},
};
+static const BatchedConstant TestObjConsts[] = {
+ {"CONST_VALUE_0", static_cast<signed int>(0)},
+ {"CONST_VALUE_1", static_cast<signed int>(1)},
+ {"CONST_VALUE_2", static_cast<signed int>(2)},
+ {"CONST_VALUE_4", static_cast<signed int>(4)},
+ {"CONST_VALUE_8", static_cast<signed int>(8)},
+};
+
+COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDontCheckEnums);
+COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDontCheckEnums);
+
static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "TestObj", v8::Persistent<v8::FunctionTemplate>(), V8TestObj::internalFieldCount,
@@ -1059,6 +1073,7 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
v8::Handle<v8::FunctionTemplate> customArgsAndExceptionArgv[customArgsAndExceptionArgc] = { V8log::GetRawTemplate() };
v8::Handle<v8::Signature> customArgsAndExceptionSignature = v8::Signature::New(desc, customArgsAndExceptionArgc, customArgsAndExceptionArgv);
proto->Set(v8::String::New("customArgsAndException"), v8::FunctionTemplate::New(TestObjInternal::customArgsAndExceptionCallback, v8::Handle<v8::Value>(), customArgsAndExceptionSignature));
+ batchConfigureConstants(desc, proto, TestObjConsts, sizeof(TestObjConsts) / sizeof(*TestObjConsts));
// Custom toString template
desc->Set(getToStringName(), getToStringTemplate());
diff --git a/WebCore/bindings/v8/DOMData.h b/WebCore/bindings/v8/DOMData.h
index 4d7331b..c8b4a41 100644
--- a/WebCore/bindings/v8/DOMData.h
+++ b/WebCore/bindings/v8/DOMData.h
@@ -79,14 +79,25 @@ namespace WebCore {
template<typename T>
void DOMData::handleWeakObject(DOMDataStore::DOMWrapperMapType mapType, v8::Persistent<v8::Object> v8Object, T* domObject)
{
+ WrapperTypeInfo* type = V8DOMWrapper::domWrapperType(v8Object);
DOMDataList& list = DOMDataStore::allStores();
+ bool found = false;
for (size_t i = 0; i < list.size(); ++i) {
DOMDataStore* store = list[i];
ASSERT(store->domData()->owningThread() == WTF::currentThread());
DOMWrapperMap<T>* domMap = static_cast<DOMWrapperMap<T>*>(store->getDOMWrapperMap(mapType));
- if (domMap->removeIfPresent(domObject, v8Object))
- store->domData()->derefObject(V8DOMWrapper::domWrapperType(v8Object), domObject);
+ if (domMap->removeIfPresent(domObject, v8Object)) {
+ derefObject(type, domObject);
+ found = true;
+ }
+ }
+
+ // If not found, it means map for the wrapper has been already destroyed, just dispose the
+ // handle and deref the object to fight memory leak.
+ if (!found) {
+ v8Object.Dispose();
+ derefObject(type, domObject);
}
}
diff --git a/WebCore/bindings/v8/DOMDataStore.cpp b/WebCore/bindings/v8/DOMDataStore.cpp
index 5d609d8..0b06a69 100644
--- a/WebCore/bindings/v8/DOMDataStore.cpp
+++ b/WebCore/bindings/v8/DOMDataStore.cpp
@@ -163,10 +163,15 @@ void DOMDataStore::weakNodeCallback(v8::Persistent<v8::Value> v8Object, void* do
DOMDataStore* store = list[i];
if (store->domNodeMap().removeIfPresent(node, v8Object)) {
ASSERT(store->domData()->owningThread() == WTF::currentThread());
- node->deref(); // Nobody overrides Node::deref so it's safe
- break; // There might be at most one wrapper for the node in world's maps
+ node->deref(); // Nobody overrides Node::deref so it's safe
+ return; // There might be at most one wrapper for the node in world's maps
}
}
+
+ // If not found, it means map for the wrapper has been already destroyed, just dispose the
+ // handle and deref the object to fight memory leak.
+ v8Object.Dispose();
+ node->deref(); // Nobody overrides Node::deref so it's safe
}
bool DOMDataStore::IntrusiveDOMWrapperMap::removeIfPresent(Node* obj, v8::Persistent<v8::Data> value)
diff --git a/WebCore/bindings/v8/ScriptArray.cpp b/WebCore/bindings/v8/ScriptArray.cpp
index a199a6c..7119b27 100644
--- a/WebCore/bindings/v8/ScriptArray.cpp
+++ b/WebCore/bindings/v8/ScriptArray.cpp
@@ -31,11 +31,11 @@
#include "config.h"
#include "ScriptArray.h"
-#include "ScriptScope.h"
-#include "ScriptState.h"
-
#include "Document.h"
#include "Frame.h"
+#include "ScriptScope.h"
+#include "ScriptState.h"
+#include "SerializedScriptValue.h"
#include "V8Binding.h"
#include "V8Proxy.h"
@@ -57,6 +57,19 @@ bool ScriptArray::set(unsigned index, const ScriptObject& value)
return scope.success();
}
+bool ScriptArray::set(unsigned index, SerializedScriptValue* value)
+{
+ ScriptValue scriptValue = ScriptValue::deserialize(m_scriptState, value);
+ if (scriptValue.hasNoValue()) {
+ ASSERT_NOT_REACHED();
+ return false;
+ }
+
+ ScriptScope scope(m_scriptState);
+ v8Object()->Set(v8::Integer::New(index), scriptValue.v8Value());
+ return scope.success();
+}
+
bool ScriptArray::set(unsigned index, const String& value)
{
ScriptScope scope(m_scriptState);
diff --git a/WebCore/bindings/v8/ScriptArray.h b/WebCore/bindings/v8/ScriptArray.h
index 9f40fbf..9aa8764 100644
--- a/WebCore/bindings/v8/ScriptArray.h
+++ b/WebCore/bindings/v8/ScriptArray.h
@@ -36,24 +36,26 @@
#include <v8.h>
namespace WebCore {
- class ScriptState;
-
- class ScriptArray : public ScriptObject {
- public:
- ScriptArray(ScriptState* scriptState, v8::Handle<v8::Array>);
- ScriptArray() {};
- virtual ~ScriptArray() {}
-
- bool set(unsigned index, const ScriptObject&);
- bool set(unsigned index, const String&);
- bool set(unsigned index, double);
- bool set(unsigned index, long long);
- bool set(unsigned index, int);
- bool set(unsigned index, bool);
- unsigned length();
-
- static ScriptArray createNew(ScriptState*);
- };
+class ScriptState;
+class SerializedScriptValue;
+
+class ScriptArray : public ScriptObject {
+public:
+ ScriptArray(ScriptState* scriptState, v8::Handle<v8::Array>);
+ ScriptArray() {};
+ virtual ~ScriptArray() {}
+
+ bool set(unsigned index, const ScriptObject&);
+ bool set(unsigned index, SerializedScriptValue*);
+ bool set(unsigned index, const String&);
+ bool set(unsigned index, double);
+ bool set(unsigned index, long long);
+ bool set(unsigned index, int);
+ bool set(unsigned index, bool);
+ unsigned length();
+
+ static ScriptArray createNew(ScriptState*);
+};
}
#endif // ScriptArray_h
diff --git a/WebCore/bindings/v8/ScriptCallFrame.cpp b/WebCore/bindings/v8/ScriptCallFrame.cpp
index 4c29814..9554f67 100644
--- a/WebCore/bindings/v8/ScriptCallFrame.cpp
+++ b/WebCore/bindings/v8/ScriptCallFrame.cpp
@@ -45,10 +45,17 @@ ScriptCallFrame::ScriptCallFrame(const String& functionName, const String& urlSt
, m_sourceURL(ParsedURLString, urlString)
, m_lineNumber(lineNumber)
{
- for (int i = 0; i < arguments.Length(); ++i)
+ for (int i = skipArgumentCount; i < arguments.Length(); ++i)
m_arguments.append(ScriptValue(arguments[i]));
}
+ScriptCallFrame::ScriptCallFrame(const String& functionName, const String& urlString, int lineNumber)
+ : m_functionName(functionName)
+ , m_sourceURL(ParsedURLString, urlString)
+ , m_lineNumber(lineNumber)
+{
+}
+
ScriptCallFrame::~ScriptCallFrame()
{
}
diff --git a/WebCore/bindings/v8/ScriptCallFrame.h b/WebCore/bindings/v8/ScriptCallFrame.h
index 50357cf..8d1972f 100644
--- a/WebCore/bindings/v8/ScriptCallFrame.h
+++ b/WebCore/bindings/v8/ScriptCallFrame.h
@@ -50,6 +50,7 @@ namespace WebCore {
class ScriptCallFrame {
public:
ScriptCallFrame(const String& functionName, const String& urlString, int lineNumber, const v8::Arguments&, unsigned skipArgumentCount);
+ ScriptCallFrame(const String& functionName, const String& urlString, int lineNumber);
~ScriptCallFrame();
const ScriptString& functionName() const { return m_functionName; }
diff --git a/WebCore/bindings/v8/ScriptCallStack.cpp b/WebCore/bindings/v8/ScriptCallStack.cpp
index d62175a..98ddb90 100644
--- a/WebCore/bindings/v8/ScriptCallStack.cpp
+++ b/WebCore/bindings/v8/ScriptCallStack.cpp
@@ -32,68 +32,122 @@
#include "ScriptCallStack.h"
#include "InspectorValues.h"
-#include "ScriptScope.h"
#include "ScriptController.h"
#include "ScriptDebugServer.h"
+#include "ScriptScope.h"
#include "V8Binding.h"
#include <v8-debug.h>
namespace WebCore {
-ScriptCallStack* ScriptCallStack::create(const v8::Arguments& arguments, unsigned skipArgumentCount) {
- String sourceName;
- int sourceLineNumber;
- String funcName;
- if (!callLocation(&sourceName, &sourceLineNumber, &funcName))
- return 0;
- return new ScriptCallStack(arguments, skipArgumentCount, sourceName, sourceLineNumber, funcName);
-}
-
-bool ScriptCallStack::callLocation(String* sourceName, int* sourceLineNumber, String* functionName)
+static void getFrameLocation(v8::Handle<v8::StackFrame> frame, String* sourceName, int* sourceLineNumber, String* functionName)
{
- v8::HandleScope scope;
- v8::Context::Scope contextScope(v8::Context::GetCurrent());
- v8::Handle<v8::StackTrace> stackTrace(v8::StackTrace::CurrentStackTrace(1));
- if (stackTrace.IsEmpty())
- return false;
- if (stackTrace->GetFrameCount() <= 0) {
- // Successfully grabbed stack trace, but there are no frames.
- // Fallback to setting lineNumber to 0, and source and function name to "undefined".
- *sourceName = toWebCoreString(v8::Undefined());
- *sourceLineNumber = 0;
- *functionName = toWebCoreString(v8::Undefined());
- return true;
- }
- v8::Handle<v8::StackFrame> frame = stackTrace->GetFrame(0);
- // There must be at least one valid frame.
ASSERT(!frame.IsEmpty());
v8::Local<v8::String> sourceNameValue(frame->GetScriptName());
v8::Local<v8::String> functionNameValue(frame->GetFunctionName());
*sourceName = sourceNameValue.IsEmpty() ? "" : toWebCoreString(sourceNameValue);
*functionName = functionNameValue.IsEmpty() ? "" : toWebCoreString(functionNameValue);
*sourceLineNumber = frame->GetLineNumber();
- return true;
}
-ScriptCallStack::ScriptCallStack(const v8::Arguments& arguments, unsigned skipArgumentCount, String sourceName, int sourceLineNumber, String functionName)
- : m_lastCaller(functionName, sourceName, sourceLineNumber, arguments, skipArgumentCount)
- , m_scriptState(ScriptState::current())
+static void getTopFrameLocation(v8::Handle<v8::StackTrace> stackTrace, String* sourceName, int* sourceLineNumber, String* functionName)
+{
+ if (stackTrace->GetFrameCount() <= 0) {
+ // Successfully grabbed stack trace, but there are no frames. It may happen in case of a syntax error for example.
+ // Fallback to setting lineNumber to 0, and source and function name to "undefined".
+ *sourceName = "undefined";
+ *sourceLineNumber = 0;
+ *functionName = "undefined";
+ } else {
+ v8::Handle<v8::StackFrame> frame = stackTrace->GetFrame(0);
+ getFrameLocation(frame, sourceName, sourceLineNumber, functionName);
+ }
+}
+
+static PassOwnPtr<ScriptCallFrame> toScriptCallFrame(v8::Handle<v8::StackFrame> frame)
+{
+ String sourceName;
+ int sourceLineNumber;
+ String functionName;
+ getFrameLocation(frame, &sourceName, &sourceLineNumber, &functionName);
+ return new ScriptCallFrame(functionName, sourceName, sourceLineNumber);
+}
+
+static void toScriptCallFramesVector(v8::Local<v8::Context> context, v8::Handle<v8::StackTrace> stackTrace, Vector<OwnPtr<ScriptCallFrame> >& scriptCallFrames)
+{
+ v8::Context::Scope contextScope(context);
+ int frameCount = stackTrace->GetFrameCount();
+ for (int i = 0; i < frameCount; i++) {
+ v8::Local<v8::StackFrame> stackFrame = stackTrace->GetFrame(i);
+ scriptCallFrames.append(toScriptCallFrame(stackFrame));
+ }
+}
+
+const int ScriptCallStack::maxCallStackSizeToCapture = 200;
+
+PassOwnPtr<ScriptCallStack> ScriptCallStack::create(const v8::Arguments& arguments, unsigned skipArgumentCount, int framCountLimit)
+{
+ v8::HandleScope scope;
+ v8::Local<v8::Context> context = v8::Context::GetCurrent();
+ v8::Context::Scope contextScope(context);
+ v8::Handle<v8::StackTrace> stackTrace(v8::StackTrace::CurrentStackTrace(framCountLimit));
+
+ if (stackTrace.IsEmpty())
+ return 0;
+
+ String sourceName;
+ int sourceLineNumber;
+ String functionName;
+ getTopFrameLocation(stackTrace, &sourceName, &sourceLineNumber, &functionName);
+
+ Vector<OwnPtr<ScriptCallFrame> > scriptCallFrames;
+ if (framCountLimit > 1)
+ toScriptCallFramesVector(context, stackTrace, scriptCallFrames);
+
+ return new ScriptCallStack(ScriptState::forContext(context), new ScriptCallFrame(functionName, sourceName, sourceLineNumber, arguments, skipArgumentCount), scriptCallFrames);
+}
+
+PassOwnPtr<ScriptCallStack> ScriptCallStack::create(ScriptState* state, v8::Handle<v8::StackTrace> stackTrace)
+{
+ v8::HandleScope scope;
+ Vector<OwnPtr<ScriptCallFrame> > scriptCallFrames;
+ toScriptCallFramesVector(state->context(), stackTrace, scriptCallFrames);
+
+ String sourceName;
+ int sourceLineNumber;
+ String functionName;
+ getTopFrameLocation(stackTrace, &sourceName, &sourceLineNumber, &functionName);
+
+ return new ScriptCallStack(state, new ScriptCallFrame(functionName, sourceName, sourceLineNumber), scriptCallFrames);
+}
+
+ScriptCallStack::ScriptCallStack(ScriptState* scriptState, PassOwnPtr<ScriptCallFrame> topFrame, Vector<OwnPtr<ScriptCallFrame> >& scriptCallFrames)
+ : m_topFrame(topFrame)
+ , m_scriptState(scriptState)
{
+ m_scriptCallFrames.swap(scriptCallFrames);
}
ScriptCallStack::~ScriptCallStack()
{
}
-const ScriptCallFrame& ScriptCallStack::at(unsigned index) const
+const ScriptCallFrame& ScriptCallStack::at(unsigned index)
{
- // Currently, only one ScriptCallFrame is supported. When we can get
- // a full stack trace from V8, we can do this right.
- ASSERT(index == 0);
- return m_lastCaller;
+ if (!index && m_topFrame)
+ return *m_topFrame;
+ return *m_scriptCallFrames.at(index);
}
+unsigned ScriptCallStack::size()
+{
+ if (m_scriptCallFrames.isEmpty())
+ return 1;
+ return m_scriptCallFrames.size();
+}
+
+
bool ScriptCallStack::stackTrace(int frameLimit, const RefPtr<InspectorArray>& stackTrace)
{
#if ENABLE(INSPECTOR)
diff --git a/WebCore/bindings/v8/ScriptCallStack.h b/WebCore/bindings/v8/ScriptCallStack.h
index 80d5f76..b608563 100644
--- a/WebCore/bindings/v8/ScriptCallStack.h
+++ b/WebCore/bindings/v8/ScriptCallStack.h
@@ -48,7 +48,10 @@ class InspectorArray;
class ScriptCallStack : public Noncopyable {
public:
- static ScriptCallStack* create(const v8::Arguments&, unsigned skipArgumentCount = 0);
+ static const int maxCallStackSizeToCapture;
+
+ static PassOwnPtr<ScriptCallStack> create(const v8::Arguments&, unsigned skipArgumentCount = 0, int framCountLimit = 1);
+ static PassOwnPtr<ScriptCallStack> create(ScriptState*, v8::Handle<v8::StackTrace>);
~ScriptCallStack();
// Returns false if there is no running JavaScript or if fetching the stack failed.
@@ -62,20 +65,19 @@ public:
// }
static bool stackTrace(int frameLimit, const RefPtr<InspectorArray>& stackTrace);
- const ScriptCallFrame& at(unsigned) const;
- // FIXME: implement retrieving and storing call stack trace
- unsigned size() const { return 1; }
+ const ScriptCallFrame& at(unsigned);
+ unsigned size();
ScriptState* state() const { return m_scriptState; }
ScriptState* globalState() const { return m_scriptState; }
private:
- ScriptCallStack(const v8::Arguments& arguments, unsigned skipArgumentCount, String sourceName, int sourceLineNumber, String funcName);
-
- static bool callLocation(String* sourceName, int* sourceLineNumber, String* functionName);
+ ScriptCallStack(ScriptState* scriptState, PassOwnPtr<ScriptCallFrame> topFrame, Vector<OwnPtr<ScriptCallFrame> >& scriptCallFrames);
+ ScriptCallStack(ScriptState* scriptState, v8::Handle<v8::StackTrace> stackTrace);
- ScriptCallFrame m_lastCaller;
+ OwnPtr<ScriptCallFrame> m_topFrame;
ScriptState* m_scriptState;
+ Vector<OwnPtr<ScriptCallFrame> > m_scriptCallFrames;
};
} // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index 2396de0..a27c5cf 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -34,6 +34,7 @@
#include "PlatformBridge.h"
#include "Document.h"
+#include "ScriptCallStack.h"
#include "ScriptableDocumentParser.h"
#include "DOMWindow.h"
#include "Event.h"
@@ -464,6 +465,13 @@ void ScriptController::clearWindowShell(bool)
m_proxy->clearForNavigation();
}
+#if ENABLE(INSPECTOR)
+void ScriptController::setCaptureCallStackForUncaughtExceptions(bool)
+{
+ v8::V8::SetCaptureStackTraceForUncaughtExceptions(true, ScriptCallStack::maxCallStackSizeToCapture);
+}
+#endif
+
void ScriptController::attachDebugger(void*)
{
notImplemented();
@@ -476,12 +484,10 @@ void ScriptController::updateDocument()
void ScriptController::namedItemAdded(HTMLDocument* doc, const AtomicString& name)
{
- m_proxy->windowShell()->namedItemAdded(doc, name);
}
void ScriptController::namedItemRemoved(HTMLDocument* doc, const AtomicString& name)
{
- m_proxy->windowShell()->namedItemRemoved(doc, name);
}
} // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index 75ae0bf..04a15f6 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -116,6 +116,10 @@ public:
static bool canAccessFromCurrentOrigin(Frame*);
+#if ENABLE(INSPECTOR)
+ static void setCaptureCallStackForUncaughtExceptions(bool);
+#endif
+
bool canExecuteScripts(ReasonForCallingCanExecuteScripts);
// FIXME: void* is a compile hack.
diff --git a/WebCore/bindings/v8/ScriptDebugServer.cpp b/WebCore/bindings/v8/ScriptDebugServer.cpp
index 138237b..0a432b7 100644
--- a/WebCore/bindings/v8/ScriptDebugServer.cpp
+++ b/WebCore/bindings/v8/ScriptDebugServer.cpp
@@ -44,7 +44,6 @@
namespace WebCore {
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
static Frame* retrieveFrame(v8::Handle<v8::Context> context)
{
if (context.IsEmpty())
@@ -61,7 +60,6 @@ static Frame* retrieveFrame(v8::Handle<v8::Context> context)
return V8Proxy::retrieveFrame(context);
}
-#endif
ScriptDebugServer& ScriptDebugServer::shared()
{
@@ -83,9 +81,13 @@ void ScriptDebugServer::setDebuggerScriptSource(const String& scriptSource)
void ScriptDebugServer::addListener(ScriptDebugListener* listener, Page* page)
{
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
if (!m_enabled)
return;
+
+ V8Proxy* proxy = V8Proxy::retrieve(page->mainFrame());
+ if (!proxy)
+ return;
+
v8::HandleScope scope;
v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
v8::Context::Scope contextScope(debuggerContext);
@@ -96,7 +98,7 @@ void ScriptDebugServer::addListener(ScriptDebugListener* listener, Page* page)
v8::Debug::SetDebugEventListener2(&ScriptDebugServer::v8DebugEventCallback);
}
m_listenersMap.set(page, listener);
- V8Proxy* proxy = V8Proxy::retrieve(page->mainFrame());
+
v8::Local<v8::Context> context = proxy->mainWorldContext();
v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("getScripts")));
@@ -108,7 +110,6 @@ void ScriptDebugServer::addListener(ScriptDebugListener* listener, Page* page)
v8::Handle<v8::Array> scriptsArray = v8::Handle<v8::Array>::Cast(value);
for (unsigned i = 0; i < scriptsArray->Length(); ++i)
dispatchDidParseSource(listener, v8::Handle<v8::Object>::Cast(scriptsArray->Get(v8::Integer::New(i))));
-#endif
}
void ScriptDebugServer::removeListener(ScriptDebugListener* listener, Page* page)
@@ -128,7 +129,6 @@ void ScriptDebugServer::removeListener(ScriptDebugListener* listener, Page* page
bool ScriptDebugServer::setBreakpoint(const String& sourceID, ScriptBreakpoint breakpoint, unsigned lineNumber, unsigned* actualLineNumber)
{
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
v8::HandleScope scope;
v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
v8::Context::Scope contextScope(debuggerContext);
@@ -146,14 +146,10 @@ bool ScriptDebugServer::setBreakpoint(const String& sourceID, ScriptBreakpoint b
ASSERT(result->Int32Value() >= 0);
*actualLineNumber = result->Int32Value();
return true;
-#else
- return false;
-#endif
}
void ScriptDebugServer::removeBreakpoint(const String& sourceID, unsigned lineNumber)
{
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
v8::HandleScope scope;
v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
v8::Context::Scope contextScope(debuggerContext);
@@ -164,12 +160,10 @@ void ScriptDebugServer::removeBreakpoint(const String& sourceID, unsigned lineNu
v8::Handle<v8::Function> removeBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("removeBreakpoint")));
v8::Debug::Call(removeBreakpointFunction, args);
-#endif
}
void ScriptDebugServer::clearBreakpoints()
{
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
ensureDebuggerScriptCompiled();
v8::HandleScope scope;
v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
@@ -177,12 +171,10 @@ void ScriptDebugServer::clearBreakpoints()
v8::Handle<v8::Function> clearBreakpoints = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("clearBreakpoints")));
v8::Debug::Call(clearBreakpoints);
-#endif
}
void ScriptDebugServer::setBreakpointsActivated(bool enabled)
{
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
ensureDebuggerScriptCompiled();
v8::HandleScope scope;
v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
@@ -192,12 +184,10 @@ void ScriptDebugServer::setBreakpointsActivated(bool enabled)
args->Set(v8::String::New("enabled"), v8::Boolean::New(enabled));
v8::Handle<v8::Function> setBreakpointsActivated = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("setBreakpointsActivated")));
v8::Debug::Call(setBreakpointsActivated, args);
-#endif
}
ScriptDebugServer::PauseOnExceptionsState ScriptDebugServer::pauseOnExceptionsState()
{
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
ensureDebuggerScriptCompiled();
v8::HandleScope scope;
v8::Context::Scope contextScope(v8::Debug::GetDebugContext());
@@ -206,14 +196,10 @@ ScriptDebugServer::PauseOnExceptionsState ScriptDebugServer::pauseOnExceptionsSt
v8::Handle<v8::Value> argv[] = { v8::Handle<v8::Value>() };
v8::Handle<v8::Value> result = function->Call(m_debuggerScript.get(), 0, argv);
return static_cast<ScriptDebugServer::PauseOnExceptionsState>(result->Int32Value());
-#else
- return DontPauseOnExceptions;
-#endif
}
void ScriptDebugServer::setPauseOnExceptionsState(PauseOnExceptionsState pauseOnExceptionsState)
{
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
ensureDebuggerScriptCompiled();
v8::HandleScope scope;
v8::Context::Scope contextScope(v8::Debug::GetDebugContext());
@@ -221,54 +207,44 @@ void ScriptDebugServer::setPauseOnExceptionsState(PauseOnExceptionsState pauseOn
v8::Handle<v8::Function> setPauseOnExceptionsFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("setPauseOnExceptionsState")));
v8::Handle<v8::Value> argv[] = { v8::Int32::New(pauseOnExceptionsState) };
setPauseOnExceptionsFunction->Call(m_debuggerScript.get(), 1, argv);
-#endif
}
void ScriptDebugServer::continueProgram()
{
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
if (m_pausedPage)
m_clientMessageLoop->quitNow();
didResume();
-#endif
}
void ScriptDebugServer::stepIntoStatement()
{
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
ASSERT(m_pausedPage);
v8::Handle<v8::Function> function = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("stepIntoStatement")));
v8::Handle<v8::Value> argv[] = { m_executionState.get() };
function->Call(m_debuggerScript.get(), 1, argv);
continueProgram();
-#endif
}
void ScriptDebugServer::stepOverStatement()
{
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
ASSERT(m_pausedPage);
v8::Handle<v8::Function> function = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("stepOverStatement")));
v8::Handle<v8::Value> argv[] = { m_executionState.get() };
function->Call(m_debuggerScript.get(), 1, argv);
continueProgram();
-#endif
}
void ScriptDebugServer::stepOutOfFunction()
{
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
ASSERT(m_pausedPage);
v8::Handle<v8::Function> function = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("stepOutOfFunction")));
v8::Handle<v8::Value> argv[] = { m_executionState.get() };
function->Call(m_debuggerScript.get(), 1, argv);
continueProgram();
-#endif
}
bool ScriptDebugServer::editScriptSource(const String& sourceID, const String& newContent, String& newSourceOrErrorMessage)
{
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
ensureDebuggerScriptCompiled();
v8::HandleScope scope;
@@ -295,9 +271,6 @@ bool ScriptDebugServer::editScriptSource(const String& sourceID, const String& n
if (m_currentCallFrame)
m_currentCallFrame.clear();
return true;
-#else
- return false;
-#endif
}
PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::currentCallFrame()
@@ -321,7 +294,6 @@ bool ScriptDebugServer::isDebuggerAlwaysEnabled()
return m_enabled;
}
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
void ScriptDebugServer::v8DebugEventCallback(const v8::Debug::EventDetails& eventDetails)
{
ScriptDebugServer::shared().handleV8DebugEvent(eventDetails);
@@ -376,7 +348,6 @@ void ScriptDebugServer::handleV8DebugEvent(const v8::Debug::EventDetails& eventD
}
}
}
-#endif
void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8::Handle<v8::Object> object)
{
diff --git a/WebCore/bindings/v8/ScriptDebugServer.h b/WebCore/bindings/v8/ScriptDebugServer.h
index 26ca785..a55388f 100644
--- a/WebCore/bindings/v8/ScriptDebugServer.h
+++ b/WebCore/bindings/v8/ScriptDebugServer.h
@@ -59,6 +59,8 @@ public:
void removeBreakpoint(const String& sourceID, unsigned lineNumber);
void clearBreakpoints();
void setBreakpointsActivated(bool activated);
+ void activateBreakpoints() { setBreakpointsActivated(true); }
+ void deactivateBreakpoints() { setBreakpointsActivated(false); }
enum PauseOnExceptionsState {
DontPauseOnExceptions,
@@ -68,7 +70,7 @@ public:
PauseOnExceptionsState pauseOnExceptionsState();
void setPauseOnExceptionsState(PauseOnExceptionsState pauseOnExceptionsState);
- void pauseProgram() { }
+ void pause() { }
void continueProgram();
void stepIntoStatement();
void stepOverStatement();
@@ -101,10 +103,8 @@ private:
ScriptDebugServer();
~ScriptDebugServer() { }
-#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
static void v8DebugEventCallback(const v8::Debug::EventDetails& eventDetails);
void handleV8DebugEvent(const v8::Debug::EventDetails& eventDetails);
-#endif
void dispatchDidParseSource(ScriptDebugListener* listener, v8::Handle<v8::Object> sourceObject);
diff --git a/WebCore/bindings/v8/ScriptSourceCode.h b/WebCore/bindings/v8/ScriptSourceCode.h
index 485daea..dbc9d5e 100644
--- a/WebCore/bindings/v8/ScriptSourceCode.h
+++ b/WebCore/bindings/v8/ScriptSourceCode.h
@@ -46,14 +46,6 @@ public:
, m_url(url)
, m_startLine(startLine)
{
- // FIXME: Copying the source to strip BOMs isn't strictly necessary
- // because V8 treats BOMs as whitespace. However, it is here because it
- // must be in sync with CachedScript::script() which strips the BOMs. We
- // should investigate the performance implications.
- if (m_source.length()) {
- bool scratch = false;
- m_source = String(source.impl()->copyStringWithoutBOMs(false, scratch));
- }
}
// We lose the encoding information from CachedScript.
diff --git a/WebCore/bindings/v8/V8ConsoleMessage.cpp b/WebCore/bindings/v8/V8ConsoleMessage.cpp
index d9fe069..8b6bb17 100644
--- a/WebCore/bindings/v8/V8ConsoleMessage.cpp
+++ b/WebCore/bindings/v8/V8ConsoleMessage.cpp
@@ -36,6 +36,7 @@
#include "Frame.h"
#include "OwnPtr.h"
#include "Page.h"
+#include "ScriptCallStack.h"
#include "V8Binding.h"
#include "V8Proxy.h"
@@ -52,14 +53,7 @@ V8ConsoleMessage::V8ConsoleMessage(const String& string, const String& sourceID,
void V8ConsoleMessage::dispatchNow(Page* page)
{
- ASSERT(page);
-
- // Process any delayed messages to make sure that messages
- // appear in the right order in the console.
- processDelayed();
-
- Console* console = page->mainFrame()->domWindow()->console();
- console->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, m_string, m_lineNumber, m_sourceID);
+ dispatchNow(page, 0);
}
void V8ConsoleMessage::dispatchLater()
@@ -118,11 +112,33 @@ void V8ConsoleMessage::handler(v8::Handle<v8::Message> message, v8::Handle<v8::V
ASSERT(!errorMessageString.IsEmpty());
String errorMessage = toWebCoreString(errorMessageString);
+ v8::Handle<v8::StackTrace> stackTrace = message->GetStackTrace();
+ OwnPtr<ScriptCallStack> callStack;
+ // Currently stack trace is only collected when inspector is open.
+ if (!stackTrace.IsEmpty() && stackTrace->GetFrameCount() > 0) {
+ v8::Local<v8::Context> context = v8::Context::GetEntered();
+ ScriptState* scriptState = ScriptState::forContext(context);
+ callStack = ScriptCallStack::create(scriptState, stackTrace);
+ }
+
v8::Handle<v8::Value> resourceName = message->GetScriptResourceName();
bool useURL = resourceName.IsEmpty() || !resourceName->IsString();
String resourceNameString = useURL ? frame->document()->url() : toWebCoreString(resourceName);
V8ConsoleMessage consoleMessage(errorMessage, resourceNameString, message->GetLineNumber());
- consoleMessage.dispatchNow(page);
+ consoleMessage.dispatchNow(page, callStack.get());
+}
+
+void V8ConsoleMessage::dispatchNow(Page* page, ScriptCallStack* callStack)
+{
+ ASSERT(page);
+
+ // Process any delayed messages to make sure that messages
+ // appear in the right order in the console.
+ processDelayed();
+
+ Console* console = page->mainFrame()->domWindow()->console();
+ MessageType messageType = callStack ? UncaughtExceptionMessageType : LogMessageType;
+ console->addMessage(JSMessageSource, messageType, ErrorMessageLevel, m_string, m_lineNumber, m_sourceID, callStack);
}
} // namespace WebCore
diff --git a/WebCore/bindings/v8/V8ConsoleMessage.h b/WebCore/bindings/v8/V8ConsoleMessage.h
index a8f75ee..387b5ee 100644
--- a/WebCore/bindings/v8/V8ConsoleMessage.h
+++ b/WebCore/bindings/v8/V8ConsoleMessage.h
@@ -36,8 +36,9 @@
#include <wtf/Vector.h>
namespace WebCore {
-
+
class Page;
+ class ScriptCallStack;
// V8ConsoleMessage encapsulates everything needed to
// log messages originating from JavaScript to the console.
@@ -80,6 +81,8 @@ namespace WebCore {
const String m_sourceID;
const unsigned m_lineNumber;
+ void dispatchNow(Page*, ScriptCallStack*);
+
// All delayed messages are stored in this vector. If the vector
// is 0, there are no delayed messages.
static Vector<V8ConsoleMessage>* m_delayedMessages;
diff --git a/WebCore/bindings/v8/V8DOMMap.h b/WebCore/bindings/v8/V8DOMMap.h
index a7e03a0..d8d5c04 100644
--- a/WebCore/bindings/v8/V8DOMMap.h
+++ b/WebCore/bindings/v8/V8DOMMap.h
@@ -74,13 +74,7 @@ namespace WebCore {
public:
typedef AbstractWeakReferenceMap<KeyType, ValueType> Parent;
WeakReferenceMap(v8::WeakReferenceCallback callback) : Parent(callback) { }
- virtual ~WeakReferenceMap()
- {
- #ifndef NDEBUG
- if (m_map.size() > 0)
- fprintf(stderr, "Leak %d JS wrappers.\n", m_map.size());
- #endif
- }
+ virtual ~WeakReferenceMap() { }
// Get the JS wrapper object of an object.
virtual v8::Persistent<ValueType> get(KeyType* obj)
@@ -135,7 +129,6 @@ namespace WebCore {
protected:
HashMap<KeyType*, ValueType*> m_map;
- v8::WeakReferenceCallback m_weakReferenceCallback;
};
template <class KeyType> class DOMWrapperMap : public WeakReferenceMap<KeyType, v8::Object> {
diff --git a/WebCore/bindings/v8/V8DOMWindowShell.cpp b/WebCore/bindings/v8/V8DOMWindowShell.cpp
index 99fea4c..c7c77d3 100644
--- a/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -50,7 +50,6 @@
#include "V8DOMWindow.h"
#include "V8Document.h"
#include "V8GCForContextDispose.h"
-#include "V8HTMLDocument.h"
#include "V8HiddenPropertyName.h"
#include "V8History.h"
#include "V8Location.h"
@@ -415,12 +414,6 @@ void V8DOMWindowShell::clearDocumentWrapper()
}
}
-static void checkDocumentWrapper(v8::Handle<v8::Object> wrapper, Document* document)
-{
- ASSERT(V8Document::toNative(wrapper) == document);
- ASSERT(!document->isHTMLDocument() || (V8Document::toNative(v8::Handle<v8::Object>::Cast(wrapper->GetPrototype())) == document));
-}
-
void V8DOMWindowShell::updateDocumentWrapperCache()
{
v8::HandleScope handleScope;
@@ -439,10 +432,6 @@ void V8DOMWindowShell::updateDocumentWrapperCache()
}
v8::Handle<v8::Value> documentWrapper = toV8(m_frame->document());
- ASSERT(documentWrapper == m_document || m_document.IsEmpty());
- if (m_document.IsEmpty())
- updateDocumentWrapper(v8::Handle<v8::Object>::Cast(documentWrapper));
- checkDocumentWrapper(m_document, m_frame->document());
// If instantiation of the document wrapper fails, clear the cache
// and let the DOMWindow accessor handle access to the document.
@@ -520,39 +509,6 @@ void V8DOMWindowShell::updateDocument()
updateSecurityOrigin();
}
-v8::Handle<v8::Value> getter(v8::Local<v8::String> property, const v8::AccessorInfo& info)
-{
- // FIXME(antonm): consider passing AtomicStringImpl directly.
- AtomicString name = v8StringToAtomicWebCoreString(property);
- HTMLDocument* htmlDocument = V8HTMLDocument::toNative(info.Holder());
- ASSERT(htmlDocument);
- return V8HTMLDocument::GetNamedProperty(htmlDocument, name);
-}
-
-void V8DOMWindowShell::namedItemAdded(HTMLDocument* doc, const AtomicString& name)
-{
- initContextIfNeeded();
-
- v8::HandleScope handleScope;
- v8::Context::Scope contextScope(m_context);
-
- ASSERT(!m_document.IsEmpty());
- checkDocumentWrapper(m_document, doc);
- m_document->SetAccessor(v8String(name), getter);
-}
-
-void V8DOMWindowShell::namedItemRemoved(HTMLDocument* doc, const AtomicString& name)
-{
- initContextIfNeeded();
-
- v8::HandleScope handleScope;
- v8::Context::Scope contextScope(m_context);
-
- ASSERT(!m_document.IsEmpty());
- checkDocumentWrapper(m_document, doc);
- m_document->Delete(v8String(name));
-}
-
void V8DOMWindowShell::updateSecurityOrigin()
{
v8::HandleScope scope;
diff --git a/WebCore/bindings/v8/V8DOMWindowShell.h b/WebCore/bindings/v8/V8DOMWindowShell.h
index 3cf1b52..f4eaff2 100644
--- a/WebCore/bindings/v8/V8DOMWindowShell.h
+++ b/WebCore/bindings/v8/V8DOMWindowShell.h
@@ -31,7 +31,6 @@
#ifndef V8DOMWindowShell_h
#define V8DOMWindowShell_h
-#include "AtomicString.h"
#include "WrapperTypeInfo.h"
#include <wtf/HashMap.h>
#include <wtf/PassRefPtr.h>
@@ -42,7 +41,6 @@ namespace WebCore {
class DOMWindow;
class Frame;
-class HTMLDocument;
class String;
// V8WindowShell represents all the per-global object state for a Frame that
@@ -56,9 +54,6 @@ public:
// Update document object of the frame.
void updateDocument();
- void namedItemAdded(HTMLDocument*, const AtomicString&);
- void namedItemRemoved(HTMLDocument*, const AtomicString&);
-
// Update the security origin of a document
// (e.g., after setting docoument.domain).
void updateSecurityOrigin();
diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp
index b5703d2..4a09c34 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -284,8 +284,6 @@ v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, WrapperT
if (!instance.IsEmpty()) {
// Avoid setting the DOM wrapper for failed allocations.
setDOMWrapper(instance, type, impl);
- if (type == &V8HTMLDocument::info)
- instance = V8HTMLDocument::WrapInShadowObject(instance, static_cast<Node*>(impl));
}
return instance;
}
diff --git a/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp b/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp
index 62838a0..baffbd4 100644
--- a/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp
@@ -33,10 +33,9 @@
#include "V8Console.h"
#include "Console.h"
-#include "MemoryInfo.h"
+#include "ScriptCallStack.h"
#include "ScriptProfile.h"
#include "V8Binding.h"
-#include "V8MemoryInfo.h"
#include "V8Proxy.h"
#include "V8ScriptProfile.h"
@@ -59,10 +58,26 @@ v8::Handle<v8::Value> V8Console::profilesAccessorGetter(v8::Local<v8::String> na
}
#endif
-v8::Handle<v8::Value> V8Console::memoryAccessorGetter(v8::Local<v8::String>, const v8::AccessorInfo&)
+v8::Handle<v8::Value> V8Console::traceCallback(const v8::Arguments& args)
{
- INC_STATS("DOM.Console.memoryAccessorGetter");
- return toV8(MemoryInfo::create());
+ INC_STATS("DOM.Console.traceCallback");
+ Console* imp = V8Console::toNative(args.Holder());
+ v8::HandleScope handleScope;
+ ScriptState* scriptState = ScriptState::current();
+ v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(ScriptCallStack::maxCallStackSizeToCapture);
+ OwnPtr<ScriptCallStack> callStack(ScriptCallStack::create(scriptState, stackTrace));
+ imp->trace(callStack.get());
+ return v8::Handle<v8::Value>();
+}
+
+v8::Handle<v8::Value> V8Console::assertCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.Console.assertCallback");
+ Console* imp = V8Console::toNative(args.Holder());
+ OwnPtr<ScriptCallStack> callStack(ScriptCallStack::create(args, 1, ScriptCallStack::maxCallStackSizeToCapture));
+ bool condition = args[0]->BooleanValue();
+ imp->assertCondition(condition, callStack.get());
+ return v8::Handle<v8::Value>();
}
} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp b/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp
new file mode 100644
index 0000000..26cc6cc
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 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 "V8DeviceOrientationEvent.h"
+
+#if ENABLE(DEVICE_ORIENTATION)
+
+#include "DeviceOrientation.h"
+#include "V8Binding.h"
+#include "V8Proxy.h"
+
+#include <v8.h>
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8DeviceOrientationEvent::alphaAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.DeviceOrientationEvent.alpha._get");
+ v8::Handle<v8::Object> holder = info.Holder();
+ DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(holder);
+ if (!imp->orientation()->canProvideAlpha())
+ return v8::Null();
+ return v8::Number::New(imp->orientation()->alpha());
+}
+
+v8::Handle<v8::Value> V8DeviceOrientationEvent::betaAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.DeviceOrientationEvent.beta._get");
+ v8::Handle<v8::Object> holder = info.Holder();
+ DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(holder);
+ if (!imp->orientation()->canProvideBeta())
+ return v8::Null();
+ return v8::Number::New(imp->orientation()->beta());
+}
+
+v8::Handle<v8::Value> V8DeviceOrientationEvent::gammaAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.DeviceOrientationEvent.gamma._get");
+ v8::Handle<v8::Object> holder = info.Holder();
+ DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(holder);
+ if (!imp->orientation()->canProvideGamma())
+ return v8::Null();
+ return v8::Number::New(imp->orientation()->gamma());
+}
+
+v8::Handle<v8::Value> V8DeviceOrientationEvent::initDeviceOrientationEventCallback(const v8::Arguments& args)
+{
+ DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(args.Holder());
+ V8Parameter<> type = args[0];
+ bool bubbles = args[1]->BooleanValue();
+ bool cancelable = args[2]->BooleanValue();
+ // If alpha, beta or gamma are null or undefined, mark them as not provided.
+ // Otherwise, use the standard JavaScript conversion.
+ bool alphaProvided = !isUndefinedOrNull(args[3]);
+ double alpha = static_cast<double>(args[3]->NumberValue());
+ bool betaProvided = !isUndefinedOrNull(args[4]);
+ double beta = static_cast<double>(args[4]->NumberValue());
+ bool gammaProvided = !isUndefinedOrNull(args[5]);
+ double gamma = static_cast<double>(args[5]->NumberValue());
+ RefPtr<DeviceOrientation> orientation = DeviceOrientation::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma);
+ imp->initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get());
+ return v8::Handle<v8::Value>();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(DEVICE_ORIENTATION)
diff --git a/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp b/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
index 09f0a6f..86f2eb5 100644
--- a/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
@@ -49,37 +49,48 @@
namespace WebCore {
-v8::Local<v8::Object> V8HTMLDocument::WrapInShadowObject(v8::Local<v8::Object> wrapper, Node* impl)
+v8::Handle<v8::Boolean> V8HTMLDocument::namedPropertyDeleter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- DEFINE_STATIC_LOCAL(v8::Persistent<v8::FunctionTemplate>, shadowTemplate, ());
- if (shadowTemplate.IsEmpty()) {
- shadowTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New());
- if (shadowTemplate.IsEmpty())
- return v8::Local<v8::Object>();
- shadowTemplate->SetClassName(v8::String::New("HTMLDocument"));
- shadowTemplate->Inherit(V8HTMLDocument::GetTemplate());
- shadowTemplate->InstanceTemplate()->SetInternalFieldCount(V8HTMLDocument::internalFieldCount);
- }
-
- v8::Local<v8::Function> shadowConstructor = shadowTemplate->GetFunction();
- if (shadowConstructor.IsEmpty())
- return v8::Local<v8::Object>();
-
- v8::Local<v8::Object> shadow = shadowConstructor->NewInstance();
- if (shadow.IsEmpty())
- return v8::Local<v8::Object>();
- V8DOMWrapper::setDOMWrapper(shadow, &V8HTMLDocument::info, impl);
- shadow->SetPrototype(wrapper);
- return shadow;
+ // Only handle document.all. Insert the marker object into the
+ // shadow internal field to signal that document.all is no longer
+ // shadowed.
+ AtomicString key = v8StringToAtomicWebCoreString(name);
+ DEFINE_STATIC_LOCAL(const AtomicString, all, ("all"));
+ if (key != all)
+ return deletionNotHandledByInterceptor();
+
+ ASSERT(info.Holder()->InternalFieldCount() == V8HTMLDocument::internalFieldCount);
+ v8::Local<v8::Value> marker = info.Holder()->GetInternalField(V8HTMLDocument::markerIndex);
+ info.Holder()->SetInternalField(V8HTMLDocument::shadowIndex, marker);
+ return v8::True();
}
-v8::Handle<v8::Value> V8HTMLDocument::GetNamedProperty(HTMLDocument* htmlDocument, const AtomicString& key)
+v8::Handle<v8::Value> V8HTMLDocument::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- ASSERT(htmlDocument->hasNamedItem(key.impl()) || htmlDocument->hasExtraNamedItem(key.impl()));
+ INC_STATS("DOM.HTMLDocument.NamedPropertyGetter");
+ AtomicString key = v8StringToAtomicWebCoreString(name);
+
+ // Special case for document.all. If the value in the shadow
+ // internal field is not the marker object, then document.all has
+ // been temporarily shadowed and we return the value.
+ DEFINE_STATIC_LOCAL(const AtomicString, all, ("all"));
+ if (key == all) {
+ ASSERT(info.Holder()->InternalFieldCount() == V8HTMLDocument::internalFieldCount);
+ v8::Local<v8::Value> marker = info.Holder()->GetInternalField(V8HTMLDocument::markerIndex);
+ v8::Local<v8::Value> value = info.Holder()->GetInternalField(V8HTMLDocument::shadowIndex);
+ if (marker != value)
+ return value;
+ }
+
+ HTMLDocument* htmlDocument = V8HTMLDocument::toNative(info.Holder());
+
+ // Fast case for named elements that are not there.
+ if (!htmlDocument->hasNamedItem(key.impl()) && !htmlDocument->hasExtraNamedItem(key.impl()))
+ return v8::Handle<v8::Value>();
RefPtr<HTMLCollection> items = htmlDocument->documentNamedItems(key);
if (!items->length())
- return v8::Handle<v8::Value>();
+ return notHandledByInterceptor();
if (items->length() == 1) {
Node* node = items->firstItem();
@@ -93,6 +104,13 @@ v8::Handle<v8::Value> V8HTMLDocument::GetNamedProperty(HTMLDocument* htmlDocumen
return toV8(items.release());
}
+v8::Handle<v8::Value> V8HTMLDocument::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo &info)
+{
+ INC_STATS("DOM.HTMLDocument.IndexedPropertyGetter");
+ v8::Local<v8::Integer> indexV8 = v8::Integer::NewFromUnsigned(index);
+ return namedPropertyGetter(indexV8->ToString(), info);
+}
+
// HTMLDocument ----------------------------------------------------------------
// Concatenates "args" to a string. If args is empty, returns empty string.
@@ -175,8 +193,10 @@ v8::Handle<v8::Value> V8HTMLDocument::allAccessorGetter(v8::Local<v8::String> na
void V8HTMLDocument::allAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
- // Just emulate a normal JS behaviour---install a property on this.
- info.This()->ForceSet(name, value);
+ INC_STATS("DOM.HTMLDocument.all._set");
+ v8::Handle<v8::Object> holder = info.Holder();
+ ASSERT(info.Holder()->InternalFieldCount() == V8HTMLDocument::internalFieldCount);
+ info.Holder()->SetInternalField(V8HTMLDocument::shadowIndex, value);
}
v8::Handle<v8::Value> toV8(HTMLDocument* impl, bool forceNewObject)
@@ -190,6 +210,12 @@ v8::Handle<v8::Value> toV8(HTMLDocument* impl, bool forceNewObject)
if (V8Proxy* proxy = V8Proxy::retrieve(impl->frame()))
proxy->windowShell()->updateDocumentWrapper(wrapper);
}
+ // Create marker object and insert it in two internal fields.
+ // This is used to implement temporary shadowing of document.all.
+ ASSERT(wrapper->InternalFieldCount() == V8HTMLDocument::internalFieldCount);
+ v8::Local<v8::Object> marker = v8::Object::New();
+ wrapper->SetInternalField(V8HTMLDocument::markerIndex, marker);
+ wrapper->SetInternalField(V8HTMLDocument::shadowIndex, marker);
return wrapper;
}
diff --git a/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp b/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
index 8ef11ce..495a8e4 100644
--- a/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
@@ -41,6 +41,7 @@
#include "V8Binding.h"
#include "V8BindingMacros.h"
#include "V8Proxy.h"
+#include "V8SQLResultSet.h"
#include <wtf/Vector.h>
using namespace WTF;
@@ -90,10 +91,10 @@ v8::Handle<v8::Value> V8SQLTransactionSync::executeSqlCallback(const v8::Argumen
SQLTransactionSync* transaction = V8SQLTransactionSync::toNative(args.Holder());
ExceptionCode ec = 0;
- transaction->executeSQL(statement, sqlValues, ec);
+ v8::Handle<v8::Value> result = toV8(transaction->executeSQL(statement, sqlValues, ec));
V8Proxy::setDOMException(ec);
- return v8::Undefined();
+ return result;
}
} // namespace WebCore
diff --git a/WebCore/bridge/qt/qt_runtime.cpp b/WebCore/bridge/qt/qt_runtime.cpp
index 77a6716..cfab3a2 100644
--- a/WebCore/bridge/qt/qt_runtime.cpp
+++ b/WebCore/bridge/qt/qt_runtime.cpp
@@ -869,7 +869,7 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con
if (type == QMetaType::QByteArray) {
QByteArray qtByteArray = variant.value<QByteArray>();
WTF::RefPtr<WTF::ByteArray> wtfByteArray = WTF::ByteArray::create(qtByteArray.length());
- qMemCopy(wtfByteArray->data(), qtByteArray.constData(), qtByteArray.length());
+ memcpy(wtfByteArray->data(), qtByteArray.constData(), qtByteArray.length());
return new (exec) JSC::JSByteArray(exec, JSC::JSByteArray::createStructure(jsNull()), wtfByteArray.get());
}
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp
index 2ebab06..44ff1fc 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -1482,6 +1482,14 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
break;
/* Directional properties are resolved by resolveDirectionAwareProperty() before the switch. */
+ case CSSPropertyWebkitBorderEnd:
+ case CSSPropertyWebkitBorderEndColor:
+ case CSSPropertyWebkitBorderEndStyle:
+ case CSSPropertyWebkitBorderEndWidth:
+ case CSSPropertyWebkitBorderStart:
+ case CSSPropertyWebkitBorderStartColor:
+ case CSSPropertyWebkitBorderStartStyle:
+ case CSSPropertyWebkitBorderStartWidth:
case CSSPropertyWebkitMarginEnd:
case CSSPropertyWebkitMarginStart:
case CSSPropertyWebkitPaddingEnd:
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index be410b4..6bf7751 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -812,6 +812,8 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyBorderRightStyle: // Defined as: none | hidden | dotted | dashed |
case CSSPropertyBorderBottomStyle: // solid | double | groove | ridge | inset | outset
case CSSPropertyBorderLeftStyle:
+ case CSSPropertyWebkitBorderStartStyle:
+ case CSSPropertyWebkitBorderEndStyle:
case CSSPropertyWebkitColumnRuleStyle:
if (id >= CSSValueNone && id <= CSSValueDouble)
validPrimitive = true;
@@ -851,12 +853,14 @@ bool CSSParser::parseValue(int propId, bool important)
break;
}
/* nobreak */
- case CSSPropertyBackgroundColor: // <color> | inherit
- case CSSPropertyBorderTopColor: // <color> | inherit
- case CSSPropertyBorderRightColor: // <color> | inherit
- case CSSPropertyBorderBottomColor: // <color> | inherit
- case CSSPropertyBorderLeftColor: // <color> | inherit
- case CSSPropertyColor: // <color> | inherit
+ case CSSPropertyBackgroundColor: // <color> | inherit
+ case CSSPropertyBorderTopColor: // <color> | inherit
+ case CSSPropertyBorderRightColor:
+ case CSSPropertyBorderBottomColor:
+ case CSSPropertyBorderLeftColor:
+ case CSSPropertyWebkitBorderStartColor:
+ case CSSPropertyWebkitBorderEndColor:
+ case CSSPropertyColor: // <color> | inherit
case CSSPropertyTextLineThroughColor: // CSS3 text decoration colors
case CSSPropertyTextUnderlineColor:
case CSSPropertyTextOverlineColor:
@@ -1005,6 +1009,8 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyBorderRightWidth: // Which is defined as
case CSSPropertyBorderBottomWidth: // thin | medium | thick | <length>
case CSSPropertyBorderLeftWidth:
+ case CSSPropertyWebkitBorderStartWidth:
+ case CSSPropertyWebkitBorderEndWidth:
case CSSPropertyWebkitColumnRuleWidth:
if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick)
validPrimitive = true;
@@ -1698,6 +1704,20 @@ bool CSSParser::parseValue(int propId, bool important)
CSSPropertyBorderLeftColor };
return parseShorthand(propId, properties, 3, important);
}
+ case CSSPropertyWebkitBorderStart:
+ // [ '-webkit-border-start-width' || 'border-style' || <color> ] | inherit
+ {
+ const int properties[3] = { CSSPropertyWebkitBorderStartWidth, CSSPropertyWebkitBorderStartStyle,
+ CSSPropertyWebkitBorderStartColor };
+ return parseShorthand(propId, properties, 3, important);
+ }
+ case CSSPropertyWebkitBorderEnd:
+ // [ '-webkit-border-end-width' || 'border-style' || <color> ] | inherit
+ {
+ const int properties[3] = { CSSPropertyWebkitBorderEndWidth, CSSPropertyWebkitBorderEndStyle,
+ CSSPropertyWebkitBorderEndColor };
+ return parseShorthand(propId, properties, 3, important);
+ }
case CSSPropertyOutline:
// [ 'outline-color' || 'outline-style' || 'outline-width' ] | inherit
{
@@ -5657,31 +5677,27 @@ static int cssPropertyID(const UChar* propertyName, unsigned length)
const char* name = buffer;
if (buffer[0] == '-') {
- // If the prefix is -apple- or -khtml-, change it to -webkit-.
- // This makes the string one character longer.
- if (hasPrefix(buffer, length, "-apple-") || hasPrefix(buffer, length, "-khtml-")) {
+ if (!strcmp(buffer, "-apple-dashboard-region") || !strcmp(buffer, "-apple-line-clamp")) {
+ // Support two Apple-specific CSS properties previously used for
+ // the Dashboard and Safari RSS line clamping.
memmove(buffer + 7, buffer + 6, length + 1 - 6);
memcpy(buffer, "-webkit", 7);
++length;
- }
-
- if (hasPrefix(buffer, length, "-webkit")) {
- if (strcmp(buffer, "-webkit-opacity") == 0) {
- // Honor -webkit-opacity as a synonym for opacity.
- // This was the only syntax that worked in Safari 1.1, and may be in use on some websites and widgets.
- const char* const opacity = "opacity";
- name = opacity;
- length = strlen(opacity);
- } else if (hasPrefix(buffer + 7, length - 7, "-border-")) {
- // -webkit-border-*-*-radius worked in Safari 4 and earlier. -webkit-border-radius syntax
- // differs from border-radius, so it is remains as a distinct property.
- if (!strcmp(buffer + 15, "top-left-radius")
- || !strcmp(buffer + 15, "top-right-radius")
- || !strcmp(buffer + 15, "bottom-right-radius")
- || !strcmp(buffer + 15, "bottom-left-radius")) {
- name = buffer + 8;
- length -= 8;
- }
+ } else if (!strcmp(buffer, "-webkit-opacity")) {
+ // Honor -webkit-opacity as a synonym for opacity. This was the only
+ // syntax that worked in Safari 1.1, and may be in use on some websites and widgets.
+ const char* const opacity = "opacity";
+ name = opacity;
+ length = 7;
+ } else if (hasPrefix(buffer, length, "-webkit-border-")) {
+ // -webkit-border-*-*-radius worked in Safari 4 and earlier. -webkit-border-radius syntax
+ // differs from border-radius, so it remains as a distinct property.
+ if (!strcmp(buffer + 15, "top-left-radius")
+ || !strcmp(buffer + 15, "top-right-radius")
+ || !strcmp(buffer + 15, "bottom-right-radius")
+ || !strcmp(buffer + 15, "bottom-left-radius")) {
+ name = buffer + 8;
+ length -= 8;
}
}
}
diff --git a/WebCore/css/CSSProperty.cpp b/WebCore/css/CSSProperty.cpp
index 777c0c0..453b381 100644
--- a/WebCore/css/CSSProperty.cpp
+++ b/WebCore/css/CSSProperty.cpp
@@ -45,10 +45,30 @@ int CSSProperty::resolveDirectionAwareProperty(int propertyID, TextDirection dir
return direction == LTR ? CSSPropertyMarginRight : CSSPropertyMarginLeft;
case CSSPropertyWebkitMarginStart:
return direction == LTR ? CSSPropertyMarginLeft : CSSPropertyMarginRight;
+
case CSSPropertyWebkitPaddingEnd:
return direction == LTR ? CSSPropertyPaddingRight : CSSPropertyPaddingLeft;
case CSSPropertyWebkitPaddingStart:
return direction == LTR ? CSSPropertyPaddingLeft : CSSPropertyPaddingRight;
+
+ case CSSPropertyWebkitBorderEnd:
+ return direction == LTR ? CSSPropertyBorderRight : CSSPropertyBorderLeft;
+ case CSSPropertyWebkitBorderEndColor:
+ return direction == LTR ? CSSPropertyBorderRightColor : CSSPropertyBorderLeftColor;
+ case CSSPropertyWebkitBorderEndStyle:
+ return direction == LTR ? CSSPropertyBorderRightStyle : CSSPropertyBorderLeftStyle;
+ case CSSPropertyWebkitBorderEndWidth:
+ return direction == LTR ? CSSPropertyBorderRightWidth : CSSPropertyBorderLeftWidth;
+
+ case CSSPropertyWebkitBorderStart:
+ return direction == LTR ? CSSPropertyBorderLeft : CSSPropertyBorderRight;
+ case CSSPropertyWebkitBorderStartColor:
+ return direction == LTR ? CSSPropertyBorderLeftColor : CSSPropertyBorderRightColor;
+ case CSSPropertyWebkitBorderStartStyle:
+ return direction == LTR ? CSSPropertyBorderLeftStyle : CSSPropertyBorderRightStyle;
+ case CSSPropertyWebkitBorderStartWidth:
+ return direction == LTR ? CSSPropertyBorderLeftWidth : CSSPropertyBorderRightWidth;
+
default:
return propertyID;
}
diff --git a/WebCore/css/CSSPropertyNames.in b/WebCore/css/CSSPropertyNames.in
index a330abe..44216e0 100644
--- a/WebCore/css/CSSPropertyNames.in
+++ b/WebCore/css/CSSPropertyNames.in
@@ -173,14 +173,21 @@ z-index
# whereas background-size: l; is equivalent to background-size: l auto;
-webkit-background-size
-webkit-binding
+-webkit-border-end
+-webkit-border-end-color
+-webkit-border-end-style
+-webkit-border-end-width
-webkit-border-fit
-webkit-border-horizontal-spacing
-webkit-border-image
-
# -webkit-border-radius differs from border-radius only in the interpretation of
# a value consisting of two lengths: "-webkit-border-radius: l1 l2;" is equivalent
# to "border-radius: l1 / l2;"
-webkit-border-radius
+-webkit-border-start
+-webkit-border-start-color
+-webkit-border-start-style
+-webkit-border-start-width
-webkit-border-vertical-spacing
-webkit-box-align
-webkit-box-direction
diff --git a/WebCore/css/CSSSegmentedFontFace.cpp b/WebCore/css/CSSSegmentedFontFace.cpp
index b13dd9c..bda29f0 100644
--- a/WebCore/css/CSSSegmentedFontFace.cpp
+++ b/WebCore/css/CSSSegmentedFontFace.cpp
@@ -59,24 +59,15 @@ void CSSSegmentedFontFace::pruneTable()
m_fontDataTable.clear();
}
-bool CSSSegmentedFontFace::isLoaded() const
-{
- unsigned size = m_fontFaces.size();
- for (unsigned i = 0; i < size; i++) {
- if (!m_fontFaces[i]->isLoaded())
- return false;
- }
- return true;
-}
-
bool CSSSegmentedFontFace::isValid() const
{
+ // Valid if at least one font face is valid.
unsigned size = m_fontFaces.size();
for (unsigned i = 0; i < size; i++) {
- if (!m_fontFaces[i]->isValid())
- return false;
+ if (m_fontFaces[i]->isValid())
+ return true;
}
- return true;
+ return false;
}
void CSSSegmentedFontFace::fontLoaded(CSSFontFace*)
@@ -107,6 +98,8 @@ FontData* CSSSegmentedFontFace::getFontData(const FontDescription& fontDescripti
unsigned size = m_fontFaces.size();
for (unsigned i = 0; i < size; i++) {
+ if (!m_fontFaces[i]->isValid())
+ continue;
FontTraitsMask traitsMask = m_fontFaces[i]->traitsMask();
bool syntheticBold = !(traitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask)) && (desiredTraitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask));
bool syntheticItalic = !(traitsMask & FontStyleItalicMask) && (desiredTraitsMask & FontStyleItalicMask);
diff --git a/WebCore/css/CSSSegmentedFontFace.h b/WebCore/css/CSSSegmentedFontFace.h
index 57a3c58..03ebe4a 100644
--- a/WebCore/css/CSSSegmentedFontFace.h
+++ b/WebCore/css/CSSSegmentedFontFace.h
@@ -45,8 +45,6 @@ public:
static PassRefPtr<CSSSegmentedFontFace> create(CSSFontSelector* selector) { return adoptRef(new CSSSegmentedFontFace(selector)); }
~CSSSegmentedFontFace();
- bool isLoaded() const;
- bool isValid() const;
CSSFontSelector* fontSelector() const { return m_fontSelector; }
void fontLoaded(CSSFontFace*);
@@ -59,6 +57,7 @@ private:
CSSSegmentedFontFace(CSSFontSelector*);
void pruneTable();
+ bool isValid() const;
CSSFontSelector* m_fontSelector;
HashMap<unsigned, SegmentedFontData*> m_fontDataTable;
diff --git a/WebCore/css/CSSSelector.cpp b/WebCore/css/CSSSelector.cpp
index 47ead5f..b1de4ec 100644
--- a/WebCore/css/CSSSelector.cpp
+++ b/WebCore/css/CSSSelector.cpp
@@ -31,11 +31,83 @@
#include <wtf/Assertions.h>
#include <wtf/HashMap.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/Vector.h>
namespace WebCore {
using namespace HTMLNames;
+// A helper class to hold CSSSelectors.
+class CSSSelectorBag : public Noncopyable {
+public:
+ ~CSSSelectorBag()
+ {
+ deleteAllValues(m_stack);
+ }
+
+ bool isEmpty() const
+ {
+ return m_stack.isEmpty();
+ }
+
+ void append(PassOwnPtr<CSSSelector> selector)
+ {
+ if (selector)
+ m_stack.append(selector.leakPtr());
+ }
+
+ PassOwnPtr<CSSSelector> takeAny()
+ {
+ ASSERT(!isEmpty());
+ OwnPtr<CSSSelector> selector = adoptPtr(m_stack.last());
+ m_stack.removeLast();
+ return selector.release();
+ }
+
+private:
+ Vector<CSSSelector*, 16> m_stack;
+};
+
+CSSSelector::~CSSSelector()
+{
+ // We should avoid a recursive destructor call, which causes stack overflow
+ // if CSS Selectors are deeply nested.
+
+ // Early exit if we have already processed the children of this selector.
+ if (m_hasRareData) {
+ if (!m_data.m_rareData)
+ return;
+ } else if (!m_data.m_tagHistory)
+ return;
+
+ CSSSelectorBag selectorsToBeDeleted;
+ if (m_hasRareData) {
+ selectorsToBeDeleted.append(m_data.m_rareData->m_tagHistory.release());
+ selectorsToBeDeleted.append(m_data.m_rareData->m_simpleSelector.release());
+ delete m_data.m_rareData;
+ } else
+ selectorsToBeDeleted.append(adoptPtr(m_data.m_tagHistory));
+
+ // Traverse the tree of CSSSelector and delete each CSSSelector iteratively.
+ while (!selectorsToBeDeleted.isEmpty()) {
+ OwnPtr<CSSSelector> selector(selectorsToBeDeleted.takeAny());
+ ASSERT(selector);
+ if (selector->m_hasRareData) {
+ ASSERT(selector->m_data.m_rareData);
+ selectorsToBeDeleted.append(selector->m_data.m_rareData->m_tagHistory.release());
+ selectorsToBeDeleted.append(selector->m_data.m_rareData->m_simpleSelector.release());
+ delete selector->m_data.m_rareData;
+ // Clear the pointer so that a destructor of the selector, which is
+ // about to be called, can know the children are already processed.
+ selector->m_data.m_rareData = 0;
+ } else {
+ selectorsToBeDeleted.append(adoptPtr(selector->m_data.m_tagHistory));
+ // Clear the pointer for the same reason.
+ selector->m_data.m_tagHistory = 0;
+ }
+ }
+}
+
unsigned int CSSSelector::specificity()
{
if (m_isForPage)
@@ -63,6 +135,7 @@ unsigned int CSSSelector::specificity()
break;
}
+ // FIXME: Avoid recursive calls to prevent possible stack overflow.
if (CSSSelector* tagHistory = this->tagHistory())
s += tagHistory->specificity();
@@ -906,5 +979,5 @@ bool CSSSelector::RareData::matchNth(int count)
return (m_b - count) % (-m_a) == 0;
}
}
-
+
} // namespace WebCore
diff --git a/WebCore/css/CSSSelector.h b/WebCore/css/CSSSelector.h
index fc0dd7b..518ff2c 100644
--- a/WebCore/css/CSSSelector.h
+++ b/WebCore/css/CSSSelector.h
@@ -22,8 +22,8 @@
#ifndef CSSSelector_h
#define CSSSelector_h
-#include "RenderStyleConstants.h"
#include "QualifiedName.h"
+#include "RenderStyleConstants.h"
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
@@ -57,13 +57,7 @@ namespace WebCore {
{
}
- ~CSSSelector()
- {
- if (m_hasRareData)
- delete m_data.m_rareData;
- else
- delete m_data.m_tagHistory;
- }
+ ~CSSSelector();
/**
* Re-create selector text from selector's data
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index 44d9e66..516e0e2 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -2600,11 +2600,11 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme
AtomicString value;
// The language property is inherited, so we iterate over the parents
// to find the first language.
- while (n && value.isEmpty()) {
+ while (n && value.isNull()) {
if (n->isElementNode()) {
// Spec: xml:lang takes precedence -- http://www.w3.org/TR/xhtml1/#C_7
value = static_cast<Element*>(n)->fastGetAttribute(XMLNames::langAttr);
- if (value.isEmpty())
+ if (value.isNull())
value = static_cast<Element*>(n)->fastGetAttribute(langAttr);
} else if (n->isDocumentNode())
// checking the MIME content-language
@@ -2613,7 +2613,7 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme
n = n->parent();
}
const AtomicString& argument = sel->argument();
- if (value.isEmpty() || !value.startsWith(argument, false))
+ if (value.isNull() || !value.startsWith(argument, false))
break;
if (value.length() != argument.length() && value[argument.length()] != '-')
break;
@@ -5479,6 +5479,23 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
return;
case CSSPropertyInvalid:
return;
+
+ // Directional properties are resolved by resolveDirectionAwareProperty() before the switch.
+ case CSSPropertyWebkitBorderEnd:
+ case CSSPropertyWebkitBorderEndColor:
+ case CSSPropertyWebkitBorderEndStyle:
+ case CSSPropertyWebkitBorderEndWidth:
+ case CSSPropertyWebkitBorderStart:
+ case CSSPropertyWebkitBorderStartColor:
+ case CSSPropertyWebkitBorderStartStyle:
+ case CSSPropertyWebkitBorderStartWidth:
+ case CSSPropertyWebkitMarginEnd:
+ case CSSPropertyWebkitMarginStart:
+ case CSSPropertyWebkitPaddingEnd:
+ case CSSPropertyWebkitPaddingStart:
+ ASSERT_NOT_REACHED();
+ break;
+
case CSSPropertyFontStretch:
case CSSPropertyPage:
case CSSPropertyQuotes:
@@ -5498,10 +5515,6 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
case CSSPropertyTextUnderlineStyle:
case CSSPropertyTextUnderlineWidth:
case CSSPropertyWebkitFontSizeDelta:
- case CSSPropertyWebkitMarginEnd:
- case CSSPropertyWebkitMarginStart:
- case CSSPropertyWebkitPaddingEnd:
- case CSSPropertyWebkitPaddingStart:
case CSSPropertyWebkitTextDecorationsInEffect:
case CSSPropertyWebkitTextStroke:
case CSSPropertyWebkitVariableDeclarationBlock:
diff --git a/WebCore/css/CSSStyleSelector.h b/WebCore/css/CSSStyleSelector.h
index dca6c1c..6e4a26b 100644
--- a/WebCore/css/CSSStyleSelector.h
+++ b/WebCore/css/CSSStyleSelector.h
@@ -87,7 +87,6 @@ public:
bool strictParsing, bool matchAuthorAndUserStyles);
~CSSStyleSelector();
- void initForStyleResolve(Element*, RenderStyle* parentStyle = 0, PseudoId = NOPSEUDO);
PassRefPtr<RenderStyle> styleForElement(Element* e, RenderStyle* parentStyle = 0, bool allowSharing = true, bool resolveForRootDefault = false, bool matchVisitedPseudoClass = false);
void keyframeStylesForAnimation(Element*, const RenderStyle*, KeyframeList& list);
@@ -105,6 +104,7 @@ public:
#endif
private:
+ void initForStyleResolve(Element*, RenderStyle* parentStyle = 0, PseudoId = NOPSEUDO);
void initElement(Element*);
RenderStyle* locateSharedStyle();
Node* locateCousinList(Element* parent, unsigned depth = 1);
@@ -119,11 +119,11 @@ public:
PassRefPtr<CSSRuleList> styleRulesForElement(Element*, bool authorOnly);
PassRefPtr<CSSRuleList> pseudoStyleRulesForElement(Element*, PseudoId, bool authorOnly);
+ private:
// 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).
static float fontSizeForKeyword(Document*, int keyword, bool monospace);
-
- private:
+
// When the CSS keyword "larger" is used, this function will attempt to match within the keyword
// table, and failing that, will simply multiply by 1.2.
float largerFontSize(float size, bool quirksMode) const;
@@ -133,11 +133,11 @@ public:
public:
void setStyle(PassRefPtr<RenderStyle> s) { m_style = s; } // Used by the document when setting up its root style.
- void setFontSize(FontDescription&, float size);
void applyPropertyToStyle(int id, CSSValue*, RenderStyle*);
private:
+ void setFontSize(FontDescription&, float size);
static float getComputedSizeFromSpecifiedSize(Document*, RenderStyle*, bool isAbsoluteSize, float specifiedSize, bool useSVGZoomRules);
public:
diff --git a/WebCore/css/WebKitCSSTransformValue.idl b/WebCore/css/WebKitCSSTransformValue.idl
index 087aa82..007097e 100644
--- a/WebCore/css/WebKitCSSTransformValue.idl
+++ b/WebCore/css/WebKitCSSTransformValue.idl
@@ -29,7 +29,8 @@
module css {
interface [
- HasIndexGetter
+ HasIndexGetter,
+ DontCheckEnums
] WebKitCSSTransformValue : CSSValueList {
// OperationTypes
diff --git a/WebCore/dom/CharacterData.cpp b/WebCore/dom/CharacterData.cpp
index 5fbb6f2..7accbfb 100644
--- a/WebCore/dom/CharacterData.cpp
+++ b/WebCore/dom/CharacterData.cpp
@@ -59,10 +59,10 @@ String CharacterData::substringData(unsigned offset, unsigned count, ExceptionCo
return m_data->substring(offset, count);
}
-PassRefPtr<StringImpl> CharacterData::parserAppendData(const String& arg)
+PassRefPtr<StringImpl> CharacterData::appendDataCommon(const String& data)
{
String newStr = m_data;
- newStr.append(arg);
+ newStr.append(data);
RefPtr<StringImpl> oldStr = m_data;
m_data = newStr.impl();
@@ -76,20 +76,29 @@ PassRefPtr<StringImpl> CharacterData::parserAppendData(const String& arg)
return oldStr.release();
}
-void CharacterData::appendData(const String& arg, ExceptionCode&)
+void CharacterData::parserAppendData(const String& data)
{
- RefPtr<StringImpl> oldStr = parserAppendData(arg);
+ appendDataCommon(data);
+ // We don't call dispatchModifiedEvent here because we don't want the
+ // parser to dispatch DOM mutation events.
+ if (parentNode())
+ parentNode()->childrenChanged();
+}
+
+void CharacterData::appendData(const String& data, ExceptionCode&)
+{
+ RefPtr<StringImpl> oldStr = appendDataCommon(data);
dispatchModifiedEvent(oldStr.get());
}
-void CharacterData::insertData(unsigned offset, const String& arg, ExceptionCode& ec)
+void CharacterData::insertData(unsigned offset, const String& data, ExceptionCode& ec)
{
checkCharDataOperation(offset, ec);
if (ec)
return;
String newStr = m_data;
- newStr.insert(arg, offset);
+ newStr.insert(data, offset);
RefPtr<StringImpl> oldStr = m_data;
m_data = newStr.impl();
@@ -102,7 +111,7 @@ void CharacterData::insertData(unsigned offset, const String& arg, ExceptionCode
dispatchModifiedEvent(oldStr.get());
- document()->textInserted(this, offset, arg.length());
+ document()->textInserted(this, offset, data.length());
}
void CharacterData::deleteData(unsigned offset, unsigned count, ExceptionCode& ec)
@@ -134,7 +143,7 @@ void CharacterData::deleteData(unsigned offset, unsigned count, ExceptionCode& e
document()->textRemoved(this, offset, realCount);
}
-void CharacterData::replaceData(unsigned offset, unsigned count, const String& arg, ExceptionCode& ec)
+void CharacterData::replaceData(unsigned offset, unsigned count, const String& data, ExceptionCode& ec)
{
checkCharDataOperation(offset, ec);
if (ec)
@@ -148,7 +157,7 @@ void CharacterData::replaceData(unsigned offset, unsigned count, const String& a
String newStr = m_data;
newStr.remove(offset, realCount);
- newStr.insert(arg, offset);
+ newStr.insert(data, offset);
RefPtr<StringImpl> oldStr = m_data;
m_data = newStr.impl();
@@ -163,7 +172,7 @@ void CharacterData::replaceData(unsigned offset, unsigned count, const String& a
// update the markers for spell checking and grammar checking
document()->textRemoved(this, offset, realCount);
- document()->textInserted(this, offset, arg.length());
+ document()->textInserted(this, offset, data.length());
}
String CharacterData::nodeValue() const
diff --git a/WebCore/dom/CharacterData.h b/WebCore/dom/CharacterData.h
index ecc0cf7..94e812b 100644
--- a/WebCore/dom/CharacterData.h
+++ b/WebCore/dom/CharacterData.h
@@ -43,7 +43,7 @@ public:
StringImpl* dataImpl() { return m_data.get(); }
// Like appendData, but optimized for the parser (e.g., no mutation events).
- PassRefPtr<StringImpl> parserAppendData(const String&);
+ void parserAppendData(const String&);
protected:
CharacterData(Document* document, const String& text, ConstructionType type)
@@ -66,6 +66,7 @@ private:
virtual bool offsetInCharacters() const;
void checkCharDataOperation(unsigned offset, ExceptionCode&);
+ PassRefPtr<StringImpl> appendDataCommon(const String&);
RefPtr<StringImpl> m_data;
};
diff --git a/WebCore/dom/ContainerNode.cpp b/WebCore/dom/ContainerNode.cpp
index 80bd035..23b68ba 100644
--- a/WebCore/dom/ContainerNode.cpp
+++ b/WebCore/dom/ContainerNode.cpp
@@ -215,7 +215,6 @@ bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, Exce
bool isFragment = newChild->nodeType() == DOCUMENT_FRAGMENT_NODE;
// Add the new child(ren)
- int childCountDelta = 0;
RefPtr<Node> child = isFragment ? newChild->firstChild() : newChild;
while (child) {
// If the new child is already in the right place, we're done.
@@ -240,8 +239,6 @@ bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, Exce
if (child->parentNode())
break;
- childCountDelta++;
-
ASSERT(!child->nextSibling());
ASSERT(!child->previousSibling());
@@ -269,6 +266,7 @@ bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, Exce
child->setNextSibling(next);
allowEventDispatch();
+ childrenChanged(false, prev.get(), next, 1);
notifyChildInserted(child.get());
// Add child to the rendering tree
@@ -287,8 +285,6 @@ bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, Exce
child = nextChild.release();
}
- if (childCountDelta)
- childrenChanged(false, prev.get(), next.get(), childCountDelta);
dispatchSubtreeModifiedEvent();
return true;
}
@@ -531,6 +527,7 @@ bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bo
// Now that the child is attached to the render tree, dispatch
// the relevant mutation events.
dispatchChildInsertionEvents(child);
+ prev = child;
}
dispatchSubtreeModifiedEvent();
@@ -706,7 +703,6 @@ void ContainerNode::cloneChildNodes(ContainerNode *clone)
document()->frame()->editor()->deleteButtonController()->enable();
}
-// FIXME: This doesn't work correctly with transforms.
bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const
{
if (!renderer())
@@ -716,7 +712,7 @@ bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const
RenderObject *p = o;
if (!o->isInline() || o->isReplaced()) {
- point = o->localToAbsolute();
+ point = o->localToAbsolute(FloatPoint(), false, true);
return true;
}
@@ -741,14 +737,14 @@ bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const
ASSERT(o);
if (!o->isInline() || o->isReplaced()) {
- point = o->localToAbsolute();
+ point = o->localToAbsolute(FloatPoint(), false, true);
return true;
}
if (p->node() && p->node() == this && o->isText() && !o->isBR() && !toRenderText(o)->firstTextBox()) {
// do nothing - skip unrendered whitespace that is a child or next sibling of the anchor
} else if ((o->isText() && !o->isBR()) || o->isReplaced()) {
- point = o->container()->localToAbsolute();
+ point = FloatPoint();
if (o->isText() && toRenderText(o)->firstTextBox()) {
point.move(toRenderText(o)->linesBoundingBox().x(),
toRenderText(o)->firstTextBox()->root()->lineTop());
@@ -756,6 +752,7 @@ bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const
RenderBox* box = toRenderBox(o);
point.move(box->x(), box->y());
}
+ point = o->container()->localToAbsolute(point, false, true);
return true;
}
}
@@ -778,7 +775,7 @@ bool ContainerNode::getLowerRightCorner(FloatPoint& point) const
RenderObject* o = renderer();
if (!o->isInline() || o->isReplaced()) {
RenderBox* box = toRenderBox(o);
- point = o->localToAbsolute();
+ point = o->localToAbsolute(FloatPoint(), false, true);
point.move(box->width(), box->height());
return true;
}
@@ -801,7 +798,7 @@ bool ContainerNode::getLowerRightCorner(FloatPoint& point) const
}
ASSERT(o);
if (o->isText() || o->isReplaced()) {
- point = o->container()->localToAbsolute();
+ point = FloatPoint();
if (o->isText()) {
RenderText* text = toRenderText(o);
IntRect linesBox = text->linesBoundingBox();
@@ -810,6 +807,7 @@ bool ContainerNode::getLowerRightCorner(FloatPoint& point) const
RenderBox* box = toRenderBox(o);
point.move(box->x() + box->width(), box->y() + box->height());
}
+ point = o->container()->localToAbsolute(point, false, true);
return true;
}
}
diff --git a/WebCore/dom/DOMCoreException.idl b/WebCore/dom/DOMCoreException.idl
index 2cbc589..945712d 100644
--- a/WebCore/dom/DOMCoreException.idl
+++ b/WebCore/dom/DOMCoreException.idl
@@ -29,7 +29,8 @@
module core {
interface [
- NoStaticTables
+ NoStaticTables,
+ DontCheckEnums
] DOMCoreException {
readonly attribute unsigned short code;
diff --git a/WebCore/dom/DeviceOrientation.cpp b/WebCore/dom/DeviceOrientation.cpp
new file mode 100644
index 0000000..f1c28b1
--- /dev/null
+++ b/WebCore/dom/DeviceOrientation.cpp
@@ -0,0 +1,89 @@
+/*
+ * 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 "DeviceOrientation.h"
+
+namespace WebCore {
+
+PassRefPtr<DeviceOrientation> DeviceOrientation::create()
+{
+ return adoptRef(new DeviceOrientation);
+}
+
+PassRefPtr<DeviceOrientation> DeviceOrientation::create(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+{
+ return adoptRef(new DeviceOrientation(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma));
+}
+
+
+DeviceOrientation::DeviceOrientation()
+ : m_canProvideAlpha(false)
+ , m_canProvideBeta(false)
+ , m_canProvideGamma(false)
+{
+}
+
+DeviceOrientation::DeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+ : m_canProvideAlpha(canProvideAlpha)
+ , m_canProvideBeta(canProvideBeta)
+ , m_canProvideGamma(canProvideGamma)
+ , m_alpha(alpha)
+ , m_beta(beta)
+ , m_gamma(gamma)
+{
+}
+
+double DeviceOrientation::alpha() const
+{
+ return m_alpha;
+}
+
+double DeviceOrientation::beta() const
+{
+ return m_beta;
+}
+
+double DeviceOrientation::gamma() const
+{
+ return m_gamma;
+}
+
+bool DeviceOrientation::canProvideAlpha() const
+{
+ return m_canProvideAlpha;
+}
+
+bool DeviceOrientation::canProvideBeta() const
+{
+ return m_canProvideBeta;
+}
+
+bool DeviceOrientation::canProvideGamma() const
+{
+ return m_canProvideGamma;
+}
+
+} // namespace WebCore
diff --git a/WebCore/dom/DeviceOrientation.h b/WebCore/dom/DeviceOrientation.h
new file mode 100644
index 0000000..c652736
--- /dev/null
+++ b/WebCore/dom/DeviceOrientation.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 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 DeviceOrientation_h
+#define DeviceOrientation_h
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class DeviceOrientation : public RefCounted<DeviceOrientation> {
+public:
+ static PassRefPtr<DeviceOrientation> create();
+ static PassRefPtr<DeviceOrientation> create(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
+
+ double alpha() const;
+ double beta() const;
+ double gamma() const;
+ bool canProvideAlpha() const;
+ bool canProvideBeta() const;
+ bool canProvideGamma() const;
+
+private:
+ DeviceOrientation();
+ DeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
+
+ bool m_canProvideAlpha;
+ bool m_canProvideBeta;
+ bool m_canProvideGamma;
+ double m_alpha;
+ double m_beta;
+ double m_gamma;
+};
+
+} // namespace WebCore
+
+#endif // DeviceOrientation_h
diff --git a/WebCore/dom/DeviceOrientationClient.h b/WebCore/dom/DeviceOrientationClient.h
index e0f14eb..427412f 100644
--- a/WebCore/dom/DeviceOrientationClient.h
+++ b/WebCore/dom/DeviceOrientationClient.h
@@ -28,10 +28,13 @@
namespace WebCore {
+class DeviceOrientation;
+
class DeviceOrientationClient {
public:
virtual void startUpdating() = 0;
virtual void stopUpdating() = 0;
+ virtual DeviceOrientation* lastOrientation() const = 0;
protected:
virtual ~DeviceOrientationClient() {}
diff --git a/WebCore/dom/DeviceOrientationController.cpp b/WebCore/dom/DeviceOrientationController.cpp
index 97ddcd8..f6867ec 100644
--- a/WebCore/dom/DeviceOrientationController.cpp
+++ b/WebCore/dom/DeviceOrientationController.cpp
@@ -28,9 +28,9 @@
#if ENABLE(DEVICE_ORIENTATION)
+#include "DeviceOrientation.h"
#include "DeviceOrientationClient.h"
#include "DeviceOrientationEvent.h"
-#include <wtf/UnusedParam.h>
namespace WebCore {
@@ -40,13 +40,49 @@ DeviceOrientationController::DeviceOrientationController(Page* page, DeviceOrien
{
}
-void DeviceOrientationController::onDeviceOrientationChange(double alpha, double beta, double gamma)
+void DeviceOrientationController::addListener(DOMWindow* window)
{
- // FIXME: Fire DeviceOrientationEvents on the window object of all frames
- // that are listening to orientation.
- UNUSED_PARAM(alpha);
- UNUSED_PARAM(beta);
- UNUSED_PARAM(gamma);
+ // If no client is present, signal that no orientation data is available.
+ // If the client already has an orientation, call back to this new listener
+ // immediately.
+ if (!m_client) {
+ RefPtr<DeviceOrientation> emptyOrientation = DeviceOrientation::create();
+ window->dispatchEvent(DeviceOrientationEvent::create(eventNames().deviceorientationEvent, emptyOrientation.get()));
+ } else if (m_client && m_client->lastOrientation())
+ window->dispatchEvent(DeviceOrientationEvent::create(eventNames().deviceorientationEvent, m_client->lastOrientation()));
+
+ // The client may call back synchronously.
+ bool wasEmpty = m_listeners.isEmpty();
+ m_listeners.add(window);
+ if (wasEmpty && m_client)
+ m_client->startUpdating();
+}
+
+void DeviceOrientationController::removeListener(DOMWindow* window)
+{
+ m_listeners.remove(window);
+ if (m_listeners.isEmpty() && m_client)
+ m_client->stopUpdating();
+}
+
+void DeviceOrientationController::removeAllListeners(DOMWindow* window)
+{
+ // May be called with a DOMWindow that's not a listener.
+ if (!m_listeners.contains(window))
+ return;
+
+ m_listeners.removeAll(window);
+ if (m_listeners.isEmpty() && m_client)
+ m_client->stopUpdating();
+}
+
+void DeviceOrientationController::didChangeDeviceOrientation(DeviceOrientation* orientation)
+{
+ RefPtr<DeviceOrientationEvent> event = DeviceOrientationEvent::create(eventNames().deviceorientationEvent, orientation);
+ Vector<DOMWindow*> listenersVector;
+ copyToVector(m_listeners, listenersVector);
+ for (size_t i = 0; i < listenersVector.size(); ++i)
+ listenersVector[i]->dispatchEvent(event);
}
} // namespace WebCore
diff --git a/WebCore/dom/DeviceOrientationController.h b/WebCore/dom/DeviceOrientationController.h
index 5f8f49a..376e14c 100644
--- a/WebCore/dom/DeviceOrientationController.h
+++ b/WebCore/dom/DeviceOrientationController.h
@@ -26,8 +26,12 @@
#ifndef DeviceOrientationController_h
#define DeviceOrientationController_h
+#include "DOMWindow.h"
+#include <wtf/HashCountedSet.h>
+
namespace WebCore {
+class DeviceOrientation;
class DeviceOrientationClient;
class Page;
@@ -35,13 +39,17 @@ class DeviceOrientationController {
public:
DeviceOrientationController(Page*, DeviceOrientationClient*);
- // FIXME: Add methods to start and stop the service.
+ void addListener(DOMWindow*);
+ void removeListener(DOMWindow*);
+ void removeAllListeners(DOMWindow*);
- void onDeviceOrientationChange(double alpha, double beta, double gamma);
+ void didChangeDeviceOrientation(DeviceOrientation*);
private:
Page* m_page;
DeviceOrientationClient* m_client;
+ typedef HashCountedSet<DOMWindow*> ListenersSet;
+ ListenersSet m_listeners;
};
} // namespace WebCore
diff --git a/WebCore/dom/DeviceOrientationEvent.cpp b/WebCore/dom/DeviceOrientationEvent.cpp
index b1aae65..992b6ce 100644
--- a/WebCore/dom/DeviceOrientationEvent.cpp
+++ b/WebCore/dom/DeviceOrientationEvent.cpp
@@ -26,35 +26,34 @@
#include "config.h"
#include "DeviceOrientationEvent.h"
+#include "DeviceOrientation.h"
+
#if ENABLE(DEVICE_ORIENTATION)
namespace WebCore {
+DeviceOrientationEvent::~DeviceOrientationEvent()
+{
+}
+
DeviceOrientationEvent::DeviceOrientationEvent()
- : m_alpha(0)
- , m_beta(0)
- , m_gamma(0)
+ : m_orientation(DeviceOrientation::create())
{
}
-DeviceOrientationEvent::DeviceOrientationEvent(const AtomicString& eventType, double alpha, double beta, double gamma)
+DeviceOrientationEvent::DeviceOrientationEvent(const AtomicString& eventType, DeviceOrientation* orientation)
: Event(eventType, false, false) // Can't bubble, not cancelable
- , m_alpha(alpha)
- , m_beta(beta)
- , m_gamma(gamma)
+ , m_orientation(orientation)
{
}
-void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& eventType, bool canBubble, bool cancelable, double alpha, double beta, double gamma)
+void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceOrientation* orientation)
{
if (dispatched())
return;
- initEvent(eventType, canBubble, cancelable);
-
- m_alpha = alpha;
- m_beta = beta;
- m_gamma = gamma;
+ initEvent(type, bubbles, cancelable);
+ m_orientation = orientation;
}
} // namespace WebCore
diff --git a/WebCore/dom/DeviceOrientationEvent.h b/WebCore/dom/DeviceOrientationEvent.h
index 33ff026..bfdf8fb 100644
--- a/WebCore/dom/DeviceOrientationEvent.h
+++ b/WebCore/dom/DeviceOrientationEvent.h
@@ -30,31 +30,31 @@
namespace WebCore {
+class DeviceOrientation;
+
class DeviceOrientationEvent : public Event {
public:
+ ~DeviceOrientationEvent();
static PassRefPtr<DeviceOrientationEvent> create()
{
return adoptRef(new DeviceOrientationEvent);
}
- static PassRefPtr<DeviceOrientationEvent> create(const AtomicString& eventType, double alpha, double beta, double gamma)
+ static PassRefPtr<DeviceOrientationEvent> create(const AtomicString& eventType, DeviceOrientation* orientation)
{
- return adoptRef(new DeviceOrientationEvent(eventType, alpha, beta, gamma));
+ return adoptRef(new DeviceOrientationEvent(eventType, orientation));
}
- void initDeviceOrientationEvent(const AtomicString& eventType, bool canBubble, bool cancelable, double alpha, double beta, double gamma);
- double alpha() const { return m_alpha; }
- double beta() const { return m_beta; }
- double gamma() const { return m_gamma; }
+ void initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceOrientation*);
virtual bool isDeviceOrientationEvent() const { return true; }
+ DeviceOrientation* orientation() const { return m_orientation.get(); }
+
private:
DeviceOrientationEvent();
- DeviceOrientationEvent(const AtomicString& eventType, double alpha, double beta, double gamma);
+ DeviceOrientationEvent(const AtomicString& eventType, DeviceOrientation*);
- double m_alpha;
- double m_beta;
- double m_gamma;
+ RefPtr<DeviceOrientation> m_orientation;
};
} // namespace WebCore
diff --git a/WebCore/dom/DeviceOrientationEvent.idl b/WebCore/dom/DeviceOrientationEvent.idl
index 95d96ec..5582f0d 100644
--- a/WebCore/dom/DeviceOrientationEvent.idl
+++ b/WebCore/dom/DeviceOrientationEvent.idl
@@ -28,10 +28,10 @@ module core {
interface [
Conditional=DEVICE_ORIENTATION
] DeviceOrientationEvent : Event {
- readonly attribute double alpha;
- readonly attribute double beta;
- readonly attribute double gamma;
- void initDeviceOrientationEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in double alpha, in double beta, in double gamma);
+ readonly attribute [Custom] double alpha;
+ readonly attribute [Custom] double beta;
+ readonly attribute [Custom] double gamma;
+ [Custom] void initDeviceOrientationEvent(in DOMString type, in boolean bubbles, in boolean cancelable, in double alpha, in double beta, in double gamma);
};
}
diff --git a/WebCore/dom/EventException.idl b/WebCore/dom/EventException.idl
index 1c8fac6..c8f2bde 100644
--- a/WebCore/dom/EventException.idl
+++ b/WebCore/dom/EventException.idl
@@ -30,7 +30,8 @@ module events {
// Introduced in DOM Level 2:
interface [
- NoStaticTables
+ NoStaticTables,
+ DontCheckEnums
] EventException {
readonly attribute unsigned short code;
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 73eb926..2032612 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -683,9 +683,8 @@ RenderBoxModelObject* Node::renderBoxModelObject() const
IntRect Node::getRect() const
{
- // FIXME: broken with transforms
if (renderer())
- return renderer()->absoluteBoundingBoxRect();
+ return renderer()->absoluteBoundingBoxRect(true);
return IntRect();
}
diff --git a/WebCore/dom/Node.idl b/WebCore/dom/Node.idl
index 07046d1..e15b210 100644
--- a/WebCore/dom/Node.idl
+++ b/WebCore/dom/Node.idl
@@ -28,7 +28,8 @@ module core {
EventTarget,
GenerateNativeConverter,
InlineGetOwnPropertySlot,
- Polymorphic
+ Polymorphic,
+ DontCheckEnums
] Node
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
: Object, EventTarget
diff --git a/WebCore/dom/NodeRareData.h b/WebCore/dom/NodeRareData.h
index 4d80cee..531fc57 100644
--- a/WebCore/dom/NodeRareData.h
+++ b/WebCore/dom/NodeRareData.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2008 David Smith <catfish.man@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -29,8 +29,8 @@
#include "StringHash.h"
#include "TagNodeList.h"
#include <wtf/HashSet.h>
-#include <wtf/PassOwnPtr.h>
#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -77,6 +77,10 @@ public:
{
}
+ virtual ~NodeRareData()
+ {
+ }
+
typedef HashMap<const Node*, NodeRareData*> NodeRareDataMap;
static NodeRareDataMap& rareDataMap()
@@ -123,6 +127,6 @@ private:
bool m_needsFocusAppearanceUpdateSoonAfterAttach : 1;
};
-} //namespace
+} // namespace WebCore
-#endif
+#endif // NodeRareData_h
diff --git a/WebCore/dom/OverflowEvent.idl b/WebCore/dom/OverflowEvent.idl
index 0b4f5c6..74cf56b 100644
--- a/WebCore/dom/OverflowEvent.idl
+++ b/WebCore/dom/OverflowEvent.idl
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module events {
-
- interface OverflowEvent : Event {
+ // FIXME: Converge these consts and OverflowEvent::orientType values and remove DontCheckEnums attribute.
+ interface [DontCheckEnums] OverflowEvent : Event {
const unsigned short HORIZONTAL = 0;
const unsigned short VERTICAL = 1;
const unsigned short BOTH = 2;
diff --git a/WebCore/dom/RangeException.idl b/WebCore/dom/RangeException.idl
index 100912d..c7c8558 100644
--- a/WebCore/dom/RangeException.idl
+++ b/WebCore/dom/RangeException.idl
@@ -19,7 +19,7 @@
module ranges {
- interface RangeException {
+ interface [DontCheckEnums] RangeException {
readonly attribute unsigned short code;
readonly attribute DOMString name;
diff --git a/WebCore/dom/TreeWalker.cpp b/WebCore/dom/TreeWalker.cpp
index de06363..9c46fb3 100644
--- a/WebCore/dom/TreeWalker.cpp
+++ b/WebCore/dom/TreeWalker.cpp
@@ -151,8 +151,8 @@ Node* TreeWalker::previousSibling(ScriptState* state)
m_current = sibling.release();
return m_current.get();
case NodeFilter::FILTER_SKIP:
- if (sibling->firstChild()) {
- sibling = sibling->firstChild();
+ if (sibling->lastChild()) {
+ sibling = sibling->lastChild();
continue;
}
break;
@@ -224,8 +224,8 @@ Node* TreeWalker::previousNode(ScriptState* state)
acceptNodeResult = acceptNode(state, node.get());
if (state && state->hadException())
return 0;
- if (acceptNodeResult == NodeFilter::FILTER_ACCEPT)
- continue;
+ if (acceptNodeResult == NodeFilter::FILTER_REJECT)
+ break;
}
if (acceptNodeResult == NodeFilter::FILTER_ACCEPT) {
m_current = node.release();
diff --git a/WebCore/editing/DeleteSelectionCommand.cpp b/WebCore/editing/DeleteSelectionCommand.cpp
index 623b188..c37b0fc 100644
--- a/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/WebCore/editing/DeleteSelectionCommand.cpp
@@ -537,12 +537,12 @@ void DeleteSelectionCommand::fixupWhitespace()
{
updateLayout();
// FIXME: isRenderedCharacter should be removed, and we should use VisiblePosition::characterAfter and VisiblePosition::characterBefore
- if (m_leadingWhitespace.isNotNull() && !m_leadingWhitespace.isRenderedCharacter()) {
+ if (m_leadingWhitespace.isNotNull() && !m_leadingWhitespace.isRenderedCharacter() && m_leadingWhitespace.node()->isTextNode()) {
Text* textNode = static_cast<Text*>(m_leadingWhitespace.node());
ASSERT(!textNode->renderer() || textNode->renderer()->style()->collapseWhiteSpace());
replaceTextInNode(textNode, m_leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
}
- if (m_trailingWhitespace.isNotNull() && !m_trailingWhitespace.isRenderedCharacter()) {
+ if (m_trailingWhitespace.isNotNull() && !m_trailingWhitespace.isRenderedCharacter() && m_trailingWhitespace.node()->isTextNode()) {
Text* textNode = static_cast<Text*>(m_trailingWhitespace.node());
ASSERT(!textNode->renderer() ||textNode->renderer()->style()->collapseWhiteSpace());
replaceTextInNode(textNode, m_trailingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
diff --git a/WebCore/editing/InsertLineBreakCommand.cpp b/WebCore/editing/InsertLineBreakCommand.cpp
index d805acf..f815d98 100644
--- a/WebCore/editing/InsertLineBreakCommand.cpp
+++ b/WebCore/editing/InsertLineBreakCommand.cpp
@@ -136,11 +136,8 @@ void InsertLineBreakCommand::doApply()
} else if (pos.deprecatedEditingOffset() >= caretMaxOffset(pos.node()) || !pos.node()->isTextNode()) {
insertNodeAt(nodeToInsert.get(), pos);
setEndingSelection(VisibleSelection(positionInParentAfterNode(nodeToInsert.get()), DOWNSTREAM));
- } else {
+ } else if (pos.node()->isTextNode()) {
// Split a text node
- ASSERT(pos.node()->isTextNode());
-
- // Do the split
Text* textNode = static_cast<Text*>(pos.node());
splitTextNode(textNode, pos.deprecatedEditingOffset());
insertNodeBefore(nodeToInsert, textNode);
diff --git a/WebCore/editing/InsertListCommand.cpp b/WebCore/editing/InsertListCommand.cpp
index 0f7dc77..06162c9 100644
--- a/WebCore/editing/InsertListCommand.cpp
+++ b/WebCore/editing/InsertListCommand.cpp
@@ -55,55 +55,10 @@ HTMLElement* InsertListCommand::fixOrphanedListChild(Node* node)
}
InsertListCommand::InsertListCommand(Document* document, Type type)
- : CompositeEditCommand(document), m_type(type), m_forceCreateList(false)
+ : CompositeEditCommand(document), m_type(type)
{
}
-bool InsertListCommand::modifyRange()
-{
- VisibleSelection selection = selectionForParagraphIteration(endingSelection());
- ASSERT(selection.isRange());
- VisiblePosition startOfSelection = selection.visibleStart();
- VisiblePosition endOfSelection = selection.visibleEnd();
- VisiblePosition startOfLastParagraph = startOfParagraph(endOfSelection);
-
- if (startOfParagraph(startOfSelection) == startOfLastParagraph)
- return false;
-
- Node* startList = enclosingList(startOfSelection.deepEquivalent().node());
- Node* endList = enclosingList(endOfSelection.deepEquivalent().node());
- if (!startList || startList != endList)
- m_forceCreateList = true;
-
- setEndingSelection(startOfSelection);
- doApply();
- // Fetch the start of the selection after moving the first paragraph,
- // because moving the paragraph will invalidate the original start.
- // We'll use the new start to restore the original selection after
- // we modified all selected paragraphs.
- startOfSelection = endingSelection().visibleStart();
- VisiblePosition startOfCurrentParagraph = startOfNextParagraph(startOfSelection);
- while (startOfCurrentParagraph != startOfLastParagraph) {
- // doApply() may operate on and remove the last paragraph of the selection from the document
- // if it's in the same list item as startOfCurrentParagraph. Return early to avoid an
- // infinite loop and because there is no more work to be done.
- // FIXME(<rdar://problem/5983974>): The endingSelection() may be incorrect here. Compute
- // the new location of endOfSelection and use it as the end of the new selection.
- if (!startOfLastParagraph.deepEquivalent().node()->inDocument())
- return true;
- setEndingSelection(startOfCurrentParagraph);
- doApply();
- startOfCurrentParagraph = startOfNextParagraph(endingSelection().visibleStart());
- }
- setEndingSelection(endOfSelection);
- doApply();
- // Fetch the end of the selection, for the reason mentioned above.
- endOfSelection = endingSelection().visibleEnd();
- setEndingSelection(VisibleSelection(startOfSelection, endOfSelection));
- m_forceCreateList = false;
- return true;
-}
-
void InsertListCommand::doApply()
{
if (endingSelection().isNone())
@@ -125,9 +80,53 @@ void InsertListCommand::doApply()
if (visibleEnd != visibleStart && isStartOfParagraph(visibleEnd))
setEndingSelection(VisibleSelection(visibleStart, visibleEnd.previous(true)));
- if (endingSelection().isRange() && modifyRange())
- return;
-
+ if (endingSelection().isRange()) {
+ VisibleSelection selection = selectionForParagraphIteration(endingSelection());
+ ASSERT(selection.isRange());
+ VisiblePosition startOfSelection = selection.visibleStart();
+ VisiblePosition endOfSelection = selection.visibleEnd();
+ VisiblePosition startOfLastParagraph = startOfParagraph(endOfSelection);
+
+ if (startOfParagraph(startOfSelection) != startOfLastParagraph) {
+ Node* startList = enclosingList(startOfSelection.deepEquivalent().node());
+ Node* endList = enclosingList(endOfSelection.deepEquivalent().node());
+ bool forceCreateList = !startList || startList != endList;
+
+ VisiblePosition startOfCurrentParagraph = startOfSelection;
+ while (startOfCurrentParagraph != startOfLastParagraph) {
+ // doApply() may operate on and remove the last paragraph of the selection from the document
+ // if it's in the same list item as startOfCurrentParagraph. Return early to avoid an
+ // infinite loop and because there is no more work to be done.
+ // FIXME(<rdar://problem/5983974>): The endingSelection() may be incorrect here. Compute
+ // the new location of endOfSelection and use it as the end of the new selection.
+ if (!startOfLastParagraph.deepEquivalent().node()->inDocument())
+ return;
+ setEndingSelection(startOfCurrentParagraph);
+ doApplyForSingleParagraph(forceCreateList);
+
+ // Fetch the start of the selection after moving the first paragraph,
+ // because moving the paragraph will invalidate the original start.
+ // We'll use the new start to restore the original selection after
+ // we modified all selected paragraphs.
+ if (startOfCurrentParagraph == startOfSelection)
+ startOfSelection = endingSelection().visibleStart();
+
+ startOfCurrentParagraph = startOfNextParagraph(endingSelection().visibleStart());
+ }
+ setEndingSelection(endOfSelection);
+ doApplyForSingleParagraph(forceCreateList);
+ // Fetch the end of the selection, for the reason mentioned above.
+ endOfSelection = endingSelection().visibleEnd();
+ setEndingSelection(VisibleSelection(startOfSelection, endOfSelection));
+ return;
+ }
+ }
+
+ doApplyForSingleParagraph(false);
+}
+
+void InsertListCommand::doApplyForSingleParagraph(bool forceCreateList)
+{
// FIXME: This will produce unexpected results for a selection that starts just before a
// table and ends inside the first cell, selectionForParagraphIteration should probably
// be renamed and deployed inside setEndingSelection().
@@ -147,7 +146,7 @@ void InsertListCommand::doApply()
unlistifyParagraph(endingSelection().visibleStart(), listNode, listChildNode);
}
- if (!listChildNode || switchListType || m_forceCreateList)
+ if (!listChildNode || switchListType || forceCreateList)
m_listElement = listifyParagraph(endingSelection().visibleStart(), listTag);
}
diff --git a/WebCore/editing/InsertListCommand.h b/WebCore/editing/InsertListCommand.h
index 7f3b07d..7fbf936 100644
--- a/WebCore/editing/InsertListCommand.h
+++ b/WebCore/editing/InsertListCommand.h
@@ -53,11 +53,11 @@ private:
HTMLElement* fixOrphanedListChild(Node*);
bool modifyRange();
+ void doApplyForSingleParagraph(bool forceCreateList);
void unlistifyParagraph(const VisiblePosition& originalStart, HTMLElement* listNode, Node* listChildNode);
PassRefPtr<HTMLElement> listifyParagraph(const VisiblePosition& originalStart, const QualifiedName& listTag);
RefPtr<HTMLElement> m_listElement;
Type m_type;
- bool m_forceCreateList;
};
} // namespace WebCore
diff --git a/WebCore/editing/InsertParagraphSeparatorCommand.cpp b/WebCore/editing/InsertParagraphSeparatorCommand.cpp
index d8aa98f..a3dfa83 100644
--- a/WebCore/editing/InsertParagraphSeparatorCommand.cpp
+++ b/WebCore/editing/InsertParagraphSeparatorCommand.cpp
@@ -312,7 +312,7 @@ void InsertParagraphSeparatorCommand::doApply()
Position leadingWhitespace = insertionPosition.leadingWhitespacePosition(VP_DEFAULT_AFFINITY);
// FIXME: leadingWhitespacePosition is returning the position before preserved newlines for positions
// after the preserved newline, causing the newline to be turned into a nbsp.
- if (leadingWhitespace.isNotNull()) {
+ if (leadingWhitespace.isNotNull() && leadingWhitespace.node()->isTextNode()) {
Text* textNode = static_cast<Text*>(leadingWhitespace.node());
ASSERT(!textNode->renderer() || textNode->renderer()->style()->collapseWhiteSpace());
replaceTextInNode(textNode, leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
@@ -385,10 +385,10 @@ void InsertParagraphSeparatorCommand::doApply()
insertionPosition = Position(insertionPosition.node(), 0);
if (!insertionPosition.isRenderedCharacter()) {
// Clear out all whitespace and insert one non-breaking space
- ASSERT(insertionPosition.node()->isTextNode());
ASSERT(!insertionPosition.node()->renderer() || insertionPosition.node()->renderer()->style()->collapseWhiteSpace());
deleteInsignificantTextDownstream(insertionPosition);
- insertTextIntoNode(static_cast<Text*>(insertionPosition.node()), 0, nonBreakingSpaceString());
+ if (insertionPosition.node()->isTextNode())
+ insertTextIntoNode(static_cast<Text*>(insertionPosition.node()), 0, nonBreakingSpaceString());
}
}
diff --git a/WebCore/html/Blob.cpp b/WebCore/html/Blob.cpp
index baf3d49..0680d82 100644
--- a/WebCore/html/Blob.cpp
+++ b/WebCore/html/Blob.cpp
@@ -43,6 +43,11 @@ Blob::Blob(const String& type, const BlobItemList& items)
m_items.append(items[i]);
}
+Blob::Blob(const PassRefPtr<BlobItem>& item)
+{
+ m_items.append(item);
+}
+
Blob::Blob(const String& path)
{
// Note: this doesn't initialize the type unlike File(path).
diff --git a/WebCore/html/Blob.h b/WebCore/html/Blob.h
index ad6c7a6..f5526c7 100644
--- a/WebCore/html/Blob.h
+++ b/WebCore/html/Blob.h
@@ -71,6 +71,7 @@ public:
protected:
Blob(const String& type, const BlobItemList&);
+ Blob(const PassRefPtr<BlobItem>&);
// FIXME: Deprecated constructor. See also the comment for Blob::create(path).
Blob(const String& path);
diff --git a/WebCore/html/BlobBuilder.cpp b/WebCore/html/BlobBuilder.cpp
index cda1568..b2684fc 100644
--- a/WebCore/html/BlobBuilder.cpp
+++ b/WebCore/html/BlobBuilder.cpp
@@ -35,35 +35,34 @@
#include "AtomicString.h"
#include "Blob.h"
#include "ExceptionCode.h"
+#include "LineEnding.h"
#include "TextEncoding.h"
namespace WebCore {
-static bool getLineEndingTypeFromString(const AtomicString& typeString, LineEnding& endingType)
+static CString convertToCString(const String& text, const String& endingType, ExceptionCode& ec)
{
DEFINE_STATIC_LOCAL(AtomicString, transparent, ("transparent"));
DEFINE_STATIC_LOCAL(AtomicString, native, ("native"));
- if (typeString.isEmpty() || typeString == transparent) {
- endingType = EndingTransparent;
- return true;
- }
- if (typeString == native) {
- endingType = EndingNative;
- return true;
- }
- return false;
+ ec = 0;
+
+ if (endingType.isEmpty() || endingType == transparent)
+ return UTF8Encoding().encode(text.characters(), text.length(), EntitiesForUnencodables);
+ if (endingType == native)
+ return normalizeLineEndingsToNative(UTF8Encoding().encode(text.characters(), text.length(), EntitiesForUnencodables));
+
+ ec = SYNTAX_ERR;
+ return CString();
}
-bool BlobBuilder::append(const String& text, const String& type, ExceptionCode& ec)
+bool BlobBuilder::append(const String& text, const String& endingType, ExceptionCode& ec)
{
- ec = 0;
- LineEnding endingType;
- if (!getLineEndingTypeFromString(type, endingType)) {
- ec = SYNTAX_ERR;
+ CString cstr = convertToCString(text, endingType, ec);
+ if (ec)
return false;
- }
- m_items.append(StringBlobItem::create(text, endingType, UTF8Encoding()));
+
+ m_items.append(StringBlobItem::create(cstr));
return true;
}
diff --git a/WebCore/html/File.cpp b/WebCore/html/File.cpp
index 2c9ce53..4000dcb 100644
--- a/WebCore/html/File.cpp
+++ b/WebCore/html/File.cpp
@@ -34,6 +34,19 @@ namespace WebCore {
File::File(const String& path)
: Blob(path)
{
+ Init();
+}
+
+#if ENABLE(DIRECTORY_UPLOAD)
+File::File(const String& relativePath, const String& filePath)
+ : Blob(FileBlobItem::create(filePath, relativePath))
+{
+ Init();
+}
+#endif
+
+void File::Init()
+{
// We don't use MIMETypeRegistry::getMIMETypeForPath() because it returns "application/octet-stream" upon failure.
const String& fileName = name();
int index = fileName.reverseFind('.');
@@ -46,4 +59,11 @@ const String& File::name() const
return items().at(0)->toFileBlobItem()->name();
}
+#if ENABLE(DIRECTORY_UPLOAD)
+const String& File::webkitRelativePath() const
+{
+ return items().at(0)->toFileBlobItem()->relativePath();
+}
+#endif
+
} // namespace WebCore
diff --git a/WebCore/html/File.h b/WebCore/html/File.h
index 582db28..d685472 100644
--- a/WebCore/html/File.h
+++ b/WebCore/html/File.h
@@ -39,9 +39,20 @@ public:
return adoptRef(new File(path));
}
+#if ENABLE(DIRECTORY_UPLOAD)
+ static PassRefPtr<File> create(const String& relativePath, const String& path)
+ {
+ return adoptRef(new File(relativePath, path));
+ }
+#endif
+
virtual bool isFile() const { return true; }
const String& name() const;
+#if ENABLE(DIRECTORY_UPLOAD)
+ // Returns the relative path of this file in the context of a directory selection.
+ const String& webkitRelativePath() const;
+#endif
// FIXME: obsolete attributes. To be removed.
const String& fileName() const { return name(); }
@@ -49,6 +60,11 @@ public:
private:
File(const String& path);
+ void Init();
+
+#if ENABLE(DIRECTORY_UPLOAD)
+ File(const String& relativePath, const String& path);
+#endif
};
} // namespace WebCore
diff --git a/WebCore/html/File.idl b/WebCore/html/File.idl
index 2632a4d..5626c8e 100644
--- a/WebCore/html/File.idl
+++ b/WebCore/html/File.idl
@@ -30,6 +30,9 @@ module html {
GenerateToJS
] File : Blob {
readonly attribute DOMString name;
+#if defined(ENABLE_DIRECTORY_UPLOAD) && ENABLE_DIRECTORY_UPLOAD
+ readonly attribute DOMString webkitRelativePath;
+#endif
// FIXME: obsolete attributes. To be removed.
readonly attribute DOMString fileName;
diff --git a/WebCore/html/FileError.idl b/WebCore/html/FileError.idl
index adc25e8..555d103 100644
--- a/WebCore/html/FileError.idl
+++ b/WebCore/html/FileError.idl
@@ -30,7 +30,8 @@
module html {
interface [
- Conditional=FILE_READER|FILE_WRITER
+ Conditional=FILE_READER|FILE_WRITER,
+ DontCheckEnums
] FileError {
#if !defined(LANGUAGE_OBJECTIVE_C)
const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
diff --git a/WebCore/html/FileReader.idl b/WebCore/html/FileReader.idl
index b933f51..ad0e187 100644
--- a/WebCore/html/FileReader.idl
+++ b/WebCore/html/FileReader.idl
@@ -34,7 +34,8 @@ module html {
CanBeConstructed,
CallWith=ScriptExecutionContext,
EventTarget,
- NoStaticTables
+ NoStaticTables,
+ DontCheckEnums
] FileReader {
// ready states
const unsigned short EMPTY = 0;
diff --git a/WebCore/html/FormDataList.cpp b/WebCore/html/FormDataList.cpp
index 0f62595..94d0031 100644
--- a/WebCore/html/FormDataList.cpp
+++ b/WebCore/html/FormDataList.cpp
@@ -21,6 +21,8 @@
#include "config.h"
#include "FormDataList.h"
+#include "LineEnding.h"
+
namespace WebCore {
FormDataList::FormDataList(const TextEncoding& c)
@@ -30,7 +32,8 @@ FormDataList::FormDataList(const TextEncoding& c)
void FormDataList::appendString(const String& s)
{
- m_items.append(StringBlobItem::create(s, EndingCRLF, m_encoding));
+ CString cstr = m_encoding.encode(s.characters(), s.length(), EntitiesForUnencodables);
+ m_items.append(StringBlobItem::create(normalizeLineEndingsToCRLF(cstr)));
}
void FormDataList::appendString(const CString& s)
diff --git a/WebCore/html/HTMLAttributeNames.in b/WebCore/html/HTMLAttributeNames.in
index 36770e2..b4cdb02 100644
--- a/WebCore/html/HTMLAttributeNames.in
+++ b/WebCore/html/HTMLAttributeNames.in
@@ -281,5 +281,6 @@ version
viewsource
vlink
vspace
+webkitdirectory
width
wrap
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp
index a14cbef..6b5a3a3 100644
--- a/WebCore/html/HTMLCanvasElement.cpp
+++ b/WebCore/html/HTMLCanvasElement.cpp
@@ -66,6 +66,9 @@ static const int DefaultHeight = 150;
// in exchange for a smaller maximum canvas size.
static const float MaxCanvasArea = 32768 * 8192; // Maximum canvas area in CSS pixels
+//In Skia, we will also limit width/height to 32767.
+static const float MaxSkiaDim = 32767.0F; // Maximum width/height in CSS pixels.
+
HTMLCanvasElement::HTMLCanvasElement(const QualifiedName& tagName, Document* document)
: HTMLElement(tagName, document)
, m_observer(0)
@@ -275,7 +278,7 @@ void HTMLCanvasElement::paint(GraphicsContext* context, const IntRect& r)
if (hasCreatedImageBuffer()) {
ImageBuffer* imageBuffer = buffer();
if (imageBuffer) {
- Image* image = imageBuffer->image();
+ Image* image = imageBuffer->imageForRendering();
if (image)
context->drawImage(image, DeviceColorSpace, r);
}
@@ -294,6 +297,16 @@ bool HTMLCanvasElement::is3D() const
}
#endif
+void HTMLCanvasElement::makeRenderingResultsAvailable()
+{
+#if ENABLE(3D_CANVAS)
+ if (is3D()) {
+ WebGLRenderingContext* context3d = reinterpret_cast<WebGLRenderingContext*>(renderingContext());
+ context3d->paintRenderingResultsToCanvas();
+ }
+#endif
+}
+
void HTMLCanvasElement::recalcStyle(StyleChange change)
{
HTMLElement::recalcStyle(change);
@@ -324,6 +337,8 @@ String HTMLCanvasElement::toDataURL(const String& mimeType, const double* qualit
String lowercaseMimeType = mimeType.lower();
+ makeRenderingResultsAvailable();
+
// FIXME: Make isSupportedImageMIMETypeForEncoding threadsafe (to allow this method to be used on a worker thread).
if (mimeType.isNull() || !MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(lowercaseMimeType))
return buffer()->toDataURL("image/png");
@@ -344,6 +359,11 @@ IntSize HTMLCanvasElement::convertLogicalToDevice(const FloatSize& logicalSize)
if (!(wf >= 1 && hf >= 1 && wf * hf <= MaxCanvasArea))
return IntSize();
+#if PLATFORM(SKIA)
+ if (wf > MaxSkiaDim || hf > MaxSkiaDim)
+ return IntSize();
+#endif
+
return IntSize(static_cast<unsigned>(wf), static_cast<unsigned>(hf));
}
diff --git a/WebCore/html/HTMLCanvasElement.h b/WebCore/html/HTMLCanvasElement.h
index d399d5f..ef5d289 100644
--- a/WebCore/html/HTMLCanvasElement.h
+++ b/WebCore/html/HTMLCanvasElement.h
@@ -32,10 +32,6 @@
#include "HTMLElement.h"
#include "IntSize.h"
-#if ENABLE(3D_CANVAS)
-#include "GraphicsContext3D.h"
-#endif
-
namespace WebCore {
class CanvasContextAttributes;
@@ -114,6 +110,7 @@ public:
bool is3D() const;
#endif
+<<<<<<< HEAD:WebCore/html/HTMLCanvasElement.h
#ifdef ANDROID_INSTRUMENT
void* operator new(size_t size) {
return HTMLElement::operator new(size);
@@ -129,6 +126,9 @@ public:
HTMLElement::operator delete[](p, size);
}
#endif
+=======
+ void makeRenderingResultsAvailable();
+>>>>>>> webkit.org at r63859:WebCore/html/HTMLCanvasElement.h
private:
HTMLCanvasElement(const QualifiedName&, Document*);
diff --git a/WebCore/html/HTMLConstructionSite.cpp b/WebCore/html/HTMLConstructionSite.cpp
index 5745625..e9bb762 100644
--- a/WebCore/html/HTMLConstructionSite.cpp
+++ b/WebCore/html/HTMLConstructionSite.cpp
@@ -32,6 +32,8 @@
#include "Element.h"
#include "Frame.h"
#include "HTMLDocument.h"
+#include "HTMLElementFactory.h"
+#include "HTMLFormElement.h"
#include "HTMLHtmlElement.h"
#include "HTMLNames.h"
#include "HTMLScriptElement.h"
@@ -70,6 +72,15 @@ bool hasImpliedEndTag(Element* element)
|| element->hasTagName(rtTag);
}
+bool causesFosterParenting(const QualifiedName& tagName)
+{
+ return tagName == tableTag
+ || tagName == tbodyTag
+ || tagName == tfootTag
+ || tagName == theadTag
+ || tagName == trTag;
+}
+
} // namespace
template<typename ChildType>
@@ -80,7 +91,7 @@ PassRefPtr<ChildType> HTMLConstructionSite::attach(Node* parent, PassRefPtr<Chil
// FIXME: It's confusing that HTMLConstructionSite::attach does the magic
// redirection to the foster parent but HTMLConstructionSite::attachAtSite
// doesn't. It feels like we're missing a concept somehow.
- if (m_redirectAttachToFosterParent) {
+ if (shouldFosterParent()) {
fosterParent(child.get());
ASSERT(child->attached());
return child.release();
@@ -92,9 +103,10 @@ PassRefPtr<ChildType> HTMLConstructionSite::attach(Node* parent, PassRefPtr<Chil
// |parent| to hold a ref at this point. In the common case (at least
// for elements), however, we'll get to use this ref in the stack of
// open elements.
- ASSERT(parent->attached());
- ASSERT(!child->attached());
- child->attach();
+ if (parent->attached()) {
+ ASSERT(!child->attached());
+ child->attach();
+ }
return child.release();
}
@@ -107,8 +119,7 @@ void HTMLConstructionSite::attachAtSite(const AttachmentSite& site, PassRefPtr<N
ExceptionCode ec = 0;
site.parent->insertBefore(child, site.nextChild, ec);
ASSERT(!ec);
- ASSERT(site.parent->attached());
- if (!child->attached())
+ if (site.parent->attached() && !child->attached())
child->attach();
return;
}
@@ -116,14 +127,14 @@ void HTMLConstructionSite::attachAtSite(const AttachmentSite& site, PassRefPtr<N
// It's slightly unfortunate that we need to hold a reference to child
// here to call attach(). We should investigate whether we can rely on
// |site.parent| to hold a ref at this point.
- ASSERT(site.parent->attached());
- if (!child->attached())
+ if (site.parent->attached() && !child->attached())
child->attach();
}
-HTMLConstructionSite::HTMLConstructionSite(Document* document, FragmentScriptingPermission scriptingPermission)
+HTMLConstructionSite::HTMLConstructionSite(Document* document, FragmentScriptingPermission scriptingPermission, bool isParsingFragment)
: m_document(document)
, m_fragmentScriptingPermission(scriptingPermission)
+ , m_isParsingFragment(isParsingFragment)
, m_redirectAttachToFosterParent(false)
{
}
@@ -132,11 +143,23 @@ HTMLConstructionSite::~HTMLConstructionSite()
{
}
+PassRefPtr<HTMLFormElement> HTMLConstructionSite::takeForm()
+{
+ return m_form.release();
+}
+
+void HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded()
+{
+ if (m_document->frame() && !m_isParsingFragment)
+ m_document->frame()->loader()->dispatchDocumentElementAvailable();
+}
+
void HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML(AtomicHTMLToken& token)
{
RefPtr<Element> element = HTMLHtmlElement::create(m_document);
element->setAttributeMap(token.takeAtributes(), m_fragmentScriptingPermission);
m_openElements.pushHTMLHtmlElement(attach(m_document, element.release()));
+ dispatchDocumentElementAvailableIfNeeded();
}
void HTMLConstructionSite::mergeAttributesFromTokenIntoElement(AtomicHTMLToken& token, Element* element)
@@ -193,40 +216,52 @@ void HTMLConstructionSite::insertCommentOnHTMLHtmlElement(AtomicHTMLToken& token
attach(m_openElements.htmlElement(), Comment::create(m_document, token.comment()));
}
-PassRefPtr<Element> HTMLConstructionSite::createHTMLElementAndAttachToCurrent(AtomicHTMLToken& token)
+PassRefPtr<Element> HTMLConstructionSite::attachToCurrent(PassRefPtr<Element> child)
{
- ASSERT(token.type() == HTMLToken::StartTag);
- return attach(currentElement(), createHTMLElement(token));
+ return attach(currentElement(), child);
}
void HTMLConstructionSite::insertHTMLHtmlElement(AtomicHTMLToken& token)
{
- ASSERT(!m_redirectAttachToFosterParent);
- m_openElements.pushHTMLHtmlElement(createHTMLElementAndAttachToCurrent(token));
+ ASSERT(!shouldFosterParent());
+ m_openElements.pushHTMLHtmlElement(attachToCurrent(createHTMLElement(token)));
+ dispatchDocumentElementAvailableIfNeeded();
}
void HTMLConstructionSite::insertHTMLHeadElement(AtomicHTMLToken& token)
{
- ASSERT(!m_redirectAttachToFosterParent);
- m_head = createHTMLElementAndAttachToCurrent(token);
+ ASSERT(!shouldFosterParent());
+ m_head = attachToCurrent(createHTMLElement(token));
m_openElements.pushHTMLHeadElement(m_head);
}
void HTMLConstructionSite::insertHTMLBodyElement(AtomicHTMLToken& token)
{
- ASSERT(!m_redirectAttachToFosterParent);
- m_openElements.pushHTMLBodyElement(createHTMLElementAndAttachToCurrent(token));
+ ASSERT(!shouldFosterParent());
+ m_openElements.pushHTMLBodyElement(attachToCurrent(createHTMLElement(token)));
+}
+
+void HTMLConstructionSite::insertHTMLFormElement(AtomicHTMLToken& token)
+{
+ insertHTMLElement(token);
+ ASSERT(currentElement()->isHTMLElement());
+ ASSERT(currentElement()->hasTagName(formTag));
+ m_form = static_cast<HTMLFormElement*>(currentElement());
}
void HTMLConstructionSite::insertHTMLElement(AtomicHTMLToken& token)
{
- m_openElements.push(createHTMLElementAndAttachToCurrent(token));
+ m_openElements.push(attachToCurrent(createHTMLElement(token)));
}
void HTMLConstructionSite::insertSelfClosingHTMLElement(AtomicHTMLToken& token)
{
ASSERT(token.type() == HTMLToken::StartTag);
- createHTMLElementAndAttachToCurrent(token);
+ RefPtr<Element> element = attachToCurrent(createHTMLElement(token));
+ // Normally HTMLElementStack is responsible for calling finishParsingChildren,
+ // but self-closing elements are never in the element stack so the stack
+ // doesn't get a chance to tell them that we're done parsing their children.
+ element->finishParsingChildren();
// FIXME: Do we want to acknowledge the token's self-closing flag?
// http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#acknowledge-self-closing-flag
}
@@ -244,7 +279,7 @@ void HTMLConstructionSite::insertScriptElement(AtomicHTMLToken& token)
{
RefPtr<HTMLScriptElement> element = HTMLScriptElement::create(scriptTag, m_document, true);
element->setAttributeMap(token.takeAtributes(), m_fragmentScriptingPermission);
- m_openElements.push(attach(currentElement(), element.release()));
+ m_openElements.push(attachToCurrent(element.release()));
}
void HTMLConstructionSite::insertForeignElement(AtomicHTMLToken& token, const AtomicString& namespaceURI)
@@ -252,7 +287,7 @@ void HTMLConstructionSite::insertForeignElement(AtomicHTMLToken& token, const At
ASSERT(token.type() == HTMLToken::StartTag);
notImplemented(); // parseError when xmlns or xmlns:xlink are wrong.
- RefPtr<Element> element = attach(currentElement(), createElement(token, namespaceURI));
+ RefPtr<Element> element = attachToCurrent(createElement(token, namespaceURI));
if (!token.selfClosing())
m_openElements.push(element);
}
@@ -262,7 +297,7 @@ void HTMLConstructionSite::insertTextNode(const String& characters)
AttachmentSite site;
site.parent = currentElement();
site.nextChild = 0;
- if (m_redirectAttachToFosterParent)
+ if (shouldFosterParent())
findFosterSite(site);
Node* previousChild = site.nextChild ? site.nextChild->previousSibling() : site.parent->lastChild();
@@ -287,11 +322,54 @@ PassRefPtr<Element> HTMLConstructionSite::createElement(AtomicHTMLToken& token,
PassRefPtr<Element> HTMLConstructionSite::createHTMLElement(AtomicHTMLToken& token)
{
- RefPtr<Element> element = createElement(token, xhtmlNamespaceURI);
+ QualifiedName tagName(nullAtom, token.name(), xhtmlNamespaceURI);
+ // FIXME: This can't use HTMLConstructionSite::createElement because we
+ // have to pass the current form element. We should rework form association
+ // to occur after construction to allow better code sharing here.
+ RefPtr<Element> element = HTMLElementFactory::createHTMLElement(tagName, m_document, form(), true);
+ element->setAttributeMap(token.takeAtributes(), m_fragmentScriptingPermission);
ASSERT(element->isHTMLElement());
return element.release();
}
+PassRefPtr<Element> HTMLConstructionSite::createHTMLElementFromElementRecord(HTMLElementStack::ElementRecord* record)
+{
+ return createHTMLElementFromSavedElement(record->element());
+}
+
+namespace {
+
+PassRefPtr<NamedNodeMap> cloneAttributes(Element* element)
+{
+ NamedNodeMap* attributes = element->attributes(true);
+ if (!attributes)
+ return 0;
+
+ RefPtr<NamedNodeMap> newAttributes = NamedNodeMap::create();
+ for (size_t i = 0; i < attributes->length(); ++i) {
+ Attribute* attribute = attributes->attributeItem(i);
+ RefPtr<Attribute> clone = Attribute::createMapped(attribute->name(), attribute->value());
+ newAttributes->addAttribute(clone);
+ }
+ return newAttributes.release();
+}
+
+}
+
+PassRefPtr<Element> HTMLConstructionSite::createHTMLElementFromSavedElement(Element* element)
+{
+ // FIXME: This method is wrong. We should be using the original token.
+ // Using an Element* causes us to fail examples like this:
+ // <b id="1"><p><script>document.getElementById("1").id = "2"</script></p>TEXT</b>
+ // When reconstructTheActiveFormattingElements calls this method to open
+ // a second <b> tag to wrap TEXT, it will have id "2", even though the HTML5
+ // spec implies it should be "1". Minefield matches the HTML5 spec here.
+
+ ASSERT(element->isHTMLElement()); // otherwise localName() might be wrong.
+ AtomicHTMLToken fakeToken(HTMLToken::StartTag, element->localName(), cloneAttributes(element));
+ return createHTMLElement(fakeToken);
+}
+
bool HTMLConstructionSite::indexOfFirstUnopenFormattingElement(unsigned& firstUnopenElementIndex) const
{
if (m_activeFormattingElements.isEmpty())
@@ -319,9 +397,8 @@ void HTMLConstructionSite::reconstructTheActiveFormattingElements()
ASSERT(unopenEntryIndex < m_activeFormattingElements.size());
for (; unopenEntryIndex < m_activeFormattingElements.size(); ++unopenEntryIndex) {
HTMLFormattingElementList::Entry& unopenedEntry = m_activeFormattingElements.at(unopenEntryIndex);
- // FIXME: We're supposed to save the original token in the entry.
- AtomicHTMLToken fakeToken(HTMLToken::StartTag, unopenedEntry.element()->localName());
- insertHTMLElement(fakeToken);
+ RefPtr<Element> reconstructed = createHTMLElementFromSavedElement(unopenedEntry.element());
+ m_openElements.push(attachToCurrent(reconstructed.release()));
unopenedEntry.replaceElement(currentElement());
}
}
@@ -357,6 +434,12 @@ void HTMLConstructionSite::findFosterSite(AttachmentSite& site)
site.nextChild = 0;
}
+bool HTMLConstructionSite::shouldFosterParent() const
+{
+ return m_redirectAttachToFosterParent
+ && causesFosterParenting(currentElement()->tagQName());
+}
+
void HTMLConstructionSite::fosterParent(Node* node)
{
AttachmentSite site;
diff --git a/WebCore/html/HTMLConstructionSite.h b/WebCore/html/HTMLConstructionSite.h
index c0af9b3..d9c8ac5 100644
--- a/WebCore/html/HTMLConstructionSite.h
+++ b/WebCore/html/HTMLConstructionSite.h
@@ -42,7 +42,7 @@ class Element;
class HTMLConstructionSite : public Noncopyable {
public:
- HTMLConstructionSite(Document*, FragmentScriptingPermission);
+ HTMLConstructionSite(Document*, FragmentScriptingPermission, bool isParsingFragment);
~HTMLConstructionSite();
void insertDoctype(AtomicHTMLToken&);
@@ -55,6 +55,7 @@ public:
void insertHTMLHtmlElement(AtomicHTMLToken&);
void insertHTMLHeadElement(AtomicHTMLToken&);
void insertHTMLBodyElement(AtomicHTMLToken&);
+ void insertHTMLFormElement(AtomicHTMLToken&);
void insertScriptElement(AtomicHTMLToken&);
void insertTextNode(const String&);
void insertForeignElement(AtomicHTMLToken&, const AtomicString& namespaceURI);
@@ -64,7 +65,9 @@ public:
void insertHTMLBodyStartTagInBody(AtomicHTMLToken&);
PassRefPtr<Element> createHTMLElement(AtomicHTMLToken&);
+ PassRefPtr<Element> createHTMLElementFromElementRecord(HTMLElementStack::ElementRecord*);
+ bool shouldFosterParent() const;
void fosterParent(Node*);
bool indexOfFirstUnopenFormattingElement(unsigned& firstUnopenElementIndex) const;
@@ -81,18 +84,16 @@ public:
Element* head() const { return m_head.get(); }
- Element* form() const { return m_form.get(); }
- PassRefPtr<Element> takeForm() { return m_form.release(); }
-
- void setForm(PassRefPtr<Element> form) { m_form = form; }
+ HTMLFormElement* form() const { return m_form.get(); }
+ PassRefPtr<HTMLFormElement> takeForm();
class RedirectToFosterParentGuard : public Noncopyable {
public:
- RedirectToFosterParentGuard(HTMLConstructionSite& tree, bool shouldRedirect)
+ RedirectToFosterParentGuard(HTMLConstructionSite& tree)
: m_tree(tree)
, m_wasRedirectingBefore(tree.m_redirectAttachToFosterParent)
{
- m_tree.m_redirectAttachToFosterParent = shouldRedirect;
+ m_tree.m_redirectAttachToFosterParent = true;
}
~RedirectToFosterParentGuard()
@@ -113,21 +114,25 @@ private:
template<typename ChildType>
PassRefPtr<ChildType> attach(Node* parent, PassRefPtr<ChildType> child);
+ PassRefPtr<Element> attachToCurrent(PassRefPtr<Element>);
void attachAtSite(const AttachmentSite&, PassRefPtr<Node> child);
void findFosterSite(AttachmentSite&);
+ PassRefPtr<Element> createHTMLElementFromSavedElement(Element*);
PassRefPtr<Element> createElement(AtomicHTMLToken&, const AtomicString& namespaceURI);
- PassRefPtr<Element> createHTMLElementAndAttachToCurrent(AtomicHTMLToken&);
void mergeAttributesFromTokenIntoElement(AtomicHTMLToken&, Element*);
+ void dispatchDocumentElementAvailableIfNeeded();
Document* m_document;
RefPtr<Element> m_head;
- RefPtr<Element> m_form;
+ RefPtr<HTMLFormElement> m_form;
mutable HTMLElementStack m_openElements;
mutable HTMLFormattingElementList m_activeFormattingElements;
+
FragmentScriptingPermission m_fragmentScriptingPermission;
+ bool m_isParsingFragment;
// http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-intable
// In the "in table" insertion mode, we sometimes get into a state where
diff --git a/WebCore/html/HTMLElementStack.cpp b/WebCore/html/HTMLElementStack.cpp
index d1a1752..5c325e5 100644
--- a/WebCore/html/HTMLElementStack.cpp
+++ b/WebCore/html/HTMLElementStack.cpp
@@ -137,6 +137,17 @@ void HTMLElementStack::popHTMLBodyElement()
popCommon();
}
+void HTMLElementStack::popAll()
+{
+ m_htmlElement = 0;
+ m_headElement = 0;
+ m_bodyElement = 0;
+ while (m_top) {
+ top()->finishParsingChildren();
+ m_top = m_top->releaseNext();
+ }
+}
+
void HTMLElementStack::pop()
{
ASSERT(!top()->hasTagName(HTMLNames::headTag));
@@ -325,6 +336,11 @@ bool HTMLElementStack::contains(Element* element) const
return !!find(element);
}
+bool HTMLElementStack::contains(const AtomicString& tagName) const
+{
+ return !!topmost(tagName);
+}
+
template <bool isMarker(Element*)>
bool inScopeCommon(HTMLElementStack::ElementRecord* top, const AtomicString& targetTag)
{
diff --git a/WebCore/html/HTMLElementStack.h b/WebCore/html/HTMLElementStack.h
index 8be4422..830faf0 100644
--- a/WebCore/html/HTMLElementStack.h
+++ b/WebCore/html/HTMLElementStack.h
@@ -92,11 +92,13 @@ public:
void popUntilTableRowScopeMarker(); // "clear the stack back to a table row context" in the spec.
void popHTMLHeadElement();
void popHTMLBodyElement();
+ void popAll();
void remove(Element*);
void removeHTMLHeadElement(Element*);
bool contains(Element*) const;
+ bool contains(const AtomicString& tagName) const;
bool inScope(Element*) const;
bool inScope(const AtomicString& tagName) const;
diff --git a/WebCore/html/HTMLFormElement.cpp b/WebCore/html/HTMLFormElement.cpp
index 2eface2..4d6b603 100644
--- a/WebCore/html/HTMLFormElement.cpp
+++ b/WebCore/html/HTMLFormElement.cpp
@@ -74,6 +74,7 @@ static int64_t generateFormDataIdentifier()
HTMLFormElement::HTMLFormElement(const QualifiedName& tagName, Document* document)
: HTMLElement(tagName, document)
+ , m_submissionTrigger(NotSubmittedByJavaScript)
, m_autocomplete(true)
, m_insubmit(false)
, m_doingsubmit(false)
@@ -370,6 +371,7 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool lockH
}
m_insubmit = true;
+ m_submissionTrigger = formSubmissionTrigger;
HTMLFormControlElement* firstSuccessfulSubmitButton = 0;
bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button?
@@ -559,6 +561,11 @@ String HTMLFormElement::target() const
return getAttribute(targetAttr);
}
+FormSubmissionTrigger HTMLFormElement::submissionTrigger() const
+{
+ return m_submissionTrigger;
+}
+
HTMLFormControlElement* HTMLFormElement::defaultButton() const
{
for (unsigned i = 0; i < m_associatedElements.size(); ++i) {
diff --git a/WebCore/html/HTMLFormElement.h b/WebCore/html/HTMLFormElement.h
index a2a5897..5aa9a5c 100644
--- a/WebCore/html/HTMLFormElement.h
+++ b/WebCore/html/HTMLFormElement.h
@@ -98,6 +98,8 @@ public:
virtual String target() const;
+ FormSubmissionTrigger submissionTrigger() const;
+
HTMLFormControlElement* defaultButton() const;
bool checkValidity();
@@ -153,6 +155,8 @@ private:
Vector<HTMLFormControlElement*> m_associatedElements;
Vector<HTMLImageElement*> m_imageElements;
+ FormSubmissionTrigger m_submissionTrigger;
+
bool m_autocomplete : 1;
bool m_insubmit : 1;
bool m_doingsubmit : 1;
diff --git a/WebCore/html/HTMLFormattingElementList.cpp b/WebCore/html/HTMLFormattingElementList.cpp
index d71cc8c..22bf03e 100644
--- a/WebCore/html/HTMLFormattingElementList.cpp
+++ b/WebCore/html/HTMLFormattingElementList.cpp
@@ -70,36 +70,22 @@ HTMLFormattingElementList::Bookmark HTMLFormattingElementList::bookmarkFor(Eleme
{
size_t index = m_entries.reverseFind(element);
ASSERT(index != notFound);
- Element* elementBefore = (index > 1) ? m_entries[index - 1].element() : 0;
- Element* elementAfter = (index < m_entries.size() - 1) ? m_entries[index + 1].element() : 0;
- return Bookmark(elementBefore, elementAfter);
+ return Bookmark(&at(index));
}
-void HTMLFormattingElementList::insertAt(Element* element, const Bookmark& bookmark)
+void HTMLFormattingElementList::swapTo(Element* oldElement, Element* newElement, const Bookmark& bookmark)
{
- size_t beforeIndex = notFound;
- if (bookmark.elementBefore()) {
- beforeIndex = m_entries.reverseFind(bookmark.elementBefore());
- ASSERT(beforeIndex != notFound);
- }
- size_t afterIndex = notFound;
- if (bookmark.elementAfter()) {
- afterIndex = m_entries.reverseFind(bookmark.elementAfter());
- ASSERT(afterIndex != notFound);
- }
-
- if (!bookmark.elementBefore()) {
- if (bookmark.elementAfter())
- ASSERT(!afterIndex);
- m_entries.prepend(element);
- } else {
- if (bookmark.elementAfter()) {
- // Bookmarks are not general purpose. They're only for the Adoption
- // Agency. Assume the bookmarked element was already removed.
- ASSERT(beforeIndex + 1 == afterIndex);
- }
- m_entries.insert(beforeIndex + 1, element);
+ ASSERT(contains(oldElement));
+ ASSERT(!contains(newElement));
+ if (!bookmark.hasBeenMoved()) {
+ ASSERT(bookmark.mark()->element() == oldElement);
+ bookmark.mark()->replaceElement(newElement);
+ return;
}
+ size_t index = bookmark.mark() - first();
+ ASSERT(index < size());
+ m_entries.insert(index + 1, newElement);
+ remove(oldElement);
}
void HTMLFormattingElementList::append(Element* element)
@@ -121,8 +107,13 @@ void HTMLFormattingElementList::appendMarker()
void HTMLFormattingElementList::clearToLastMarker()
{
- while (m_entries.size() && !m_entries.last().isMarker())
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#clear-the-list-of-active-formatting-elements-up-to-the-last-marker
+ while (m_entries.size()) {
+ bool shouldStop = m_entries.last().isMarker();
m_entries.removeLast();
+ if (shouldStop)
+ break;
+ }
}
#ifndef NDEBUG
diff --git a/WebCore/html/HTMLFormattingElementList.h b/WebCore/html/HTMLFormattingElementList.h
index 6b41da4..135163c 100644
--- a/WebCore/html/HTMLFormattingElementList.h
+++ b/WebCore/html/HTMLFormattingElementList.h
@@ -80,24 +80,24 @@ public:
class Bookmark {
public:
- Bookmark(Element* before, Element* after)
- : m_before(before)
- , m_after(after)
+ Bookmark(Entry* entry)
+ : m_hasBeenMoved(false)
+ , m_mark(entry)
{
}
- void moveToAfter(Element* before)
+ void moveToAfter(Entry* before)
{
- m_before = before;
- m_after = 0;
+ m_hasBeenMoved = true;
+ m_mark = before;
}
- Element* elementBefore() const { return m_before; }
- Element* elementAfter() const { return m_after; }
+ bool hasBeenMoved() const { return m_hasBeenMoved; }
+ Entry* mark() const { return m_mark; }
private:
- Element* m_before;
- Element* m_after;
+ bool m_hasBeenMoved;
+ Entry* m_mark;
};
bool isEmpty() const { return !size(); }
@@ -111,9 +111,10 @@ public:
void remove(Element*);
Bookmark bookmarkFor(Element*);
- void insertAt(Element*, const Bookmark&);
+ void swapTo(Element* oldElement, Element* newElement, const Bookmark&);
void appendMarker();
+ // clearToLastMarker also clears the marker (per the HTML5 spec).
void clearToLastMarker();
const Entry& at(size_t i) const { return m_entries[i]; }
@@ -124,6 +125,8 @@ public:
#endif
private:
+ Entry* first() { return &at(0); }
+
Vector<Entry> m_entries;
};
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 8502814..49b6f01 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -29,6 +29,7 @@
#include "AXObjectCache.h"
#include "Attribute.h"
+#include "BeforeTextInsertedEvent.h"
#include "CSSPropertyNames.h"
#include "ChromeClient.h"
#include "DateComponents.h"
@@ -40,6 +41,7 @@
#include "ExceptionCode.h"
#include "File.h"
#include "FileList.h"
+#include "FileSystem.h"
#include "FocusController.h"
#include "FormDataList.h"
#include "Frame.h"
@@ -108,6 +110,12 @@ static const double weekDefaultStepBase = -259200000.0; // The first day of 1970
static const double msecPerMinute = 60 * 1000;
static const double msecPerSecond = 1000;
+static bool isNumberCharacter(UChar ch)
+{
+ return ch == '+' || ch == '-' || ch == '.' || ch == 'e' || ch == 'E'
+ || ch >= '0' && ch <= '9';
+}
+
HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
: HTMLTextFormControlElement(tagName, document, form)
, m_xPos(0)
@@ -1187,6 +1195,13 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
m_hasNonEmptyList = !attr->isEmpty();
// FIXME: we need to tell this change to a renderer if the attribute affects the appearance.
#endif
+#if ENABLE(INPUT_SPEECH)
+ else if (attr->name() == speechAttr) {
+ if (renderer())
+ renderer()->updateFromElement();
+ setNeedsStyleRecalc();
+ }
+#endif
else
HTMLTextFormControlElement::parseMappedAttribute(attr);
}
@@ -1978,8 +1993,30 @@ void HTMLInputElement::setFileListFromRenderer(const Vector<String>& paths)
{
m_fileList->clear();
int size = paths.size();
+
+#if ENABLE(DIRECTORY_UPLOAD)
+ // If a directory is being selected, the UI allows a directory to be chosen
+ // and the paths provided here share a root directory somewhere up the tree;
+ // we want to store only the relative paths from that point.
+ if (webkitdirectory() && size > 0) {
+ String rootPath = directoryName(paths[0]);
+ // Find the common root path.
+ for (int i = 1; i < size; i++) {
+ while (!paths[i].startsWith(rootPath))
+ rootPath = directoryName(rootPath);
+ }
+ rootPath = directoryName(rootPath);
+ ASSERT(rootPath.length());
+ for (int i = 0; i < size; i++)
+ m_fileList->append(File::create(paths[i].substring(1 + rootPath.length()), paths[i]));
+ } else {
+ for (int i = 0; i < size; i++)
+ m_fileList->append(File::create(paths[i]));
+ }
+#else
for (int i = 0; i < size; i++)
m_fileList->append(File::create(paths[i]));
+#endif
setFormControlValueMatchesRenderer(true);
InputElement::notifyFormStateChanged(this);
@@ -2126,7 +2163,21 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
}
}
- if (isTextField()
+ if (hasSpinButton() && evt->type() == eventNames().keydownEvent && evt->isKeyboardEvent()) {
+ String key = static_cast<KeyboardEvent*>(evt)->keyIdentifier();
+ int step = 0;
+ if (key == "Up")
+ step = 1;
+ else if (key == "Down")
+ step = -1;
+ if (step) {
+ stepUpFromRenderer(step);
+ evt->setDefaultHandled();
+ return;
+ }
+ }
+
+ if (isTextField()
&& evt->type() == eventNames().keydownEvent
&& evt->isKeyboardEvent()
&& focused()
@@ -2382,7 +2433,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
}
if (evt->isBeforeTextInsertedEvent())
- InputElement::handleBeforeTextInsertedEvent(m_data, this, this, evt);
+ handleBeforeTextInsertedEvent(evt);
if (isTextField() && renderer() && (evt->isMouseEvent() || evt->isDragEvent() || evt->isWheelEvent() || evt->type() == eventNames().blurEvent || evt->type() == eventNames().focusEvent))
toRenderTextControlSingleLine(renderer())->forwardEvent(evt);
@@ -2394,6 +2445,33 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
HTMLFormControlElementWithState::defaultEventHandler(evt);
}
+void HTMLInputElement::handleBeforeTextInsertedEvent(Event* event)
+{
+ if (inputType() == NUMBER) {
+ BeforeTextInsertedEvent* textEvent = static_cast<BeforeTextInsertedEvent*>(event);
+ unsigned length = textEvent->text().length();
+ bool hasInvalidChar = false;
+ for (unsigned i = 0; i < length; ++i) {
+ if (!isNumberCharacter(textEvent->text()[i])) {
+ hasInvalidChar = true;
+ break;
+ }
+ }
+ if (hasInvalidChar) {
+ Vector<UChar> stripped;
+ stripped.reserveCapacity(length);
+ for (unsigned i = 0; i < length; ++i) {
+ UChar ch = textEvent->text()[i];
+ if (!isNumberCharacter(ch))
+ continue;
+ stripped.append(ch);
+ }
+ textEvent->setText(String::adopt(stripped));
+ }
+ }
+ InputElement::handleBeforeTextInsertedEvent(m_data, this, this, event);
+}
+
PassRefPtr<HTMLFormElement> HTMLInputElement::createTemporaryFormForIsIndex()
{
RefPtr<HTMLFormElement> form = HTMLFormElement::create(document());
@@ -2460,6 +2538,13 @@ bool HTMLInputElement::multiple() const
return !getAttribute(multipleAttr).isNull();
}
+#if ENABLE(DIRECTORY_UPLOAD)
+bool HTMLInputElement::webkitdirectory() const
+{
+ return !getAttribute(webkitdirectoryAttr).isNull();
+}
+#endif
+
void HTMLInputElement::setSize(unsigned size)
{
setAttribute(sizeAttr, String::number(size));
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index b055e73..3b9ba88 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -180,6 +180,10 @@ public:
bool multiple() const;
+#if ENABLE(DIRECTORY_UPLOAD)
+ bool webkitdirectory() const;
+#endif
+
virtual bool isAutofilled() const { return m_autofilled; }
void setAutofilled(bool value = true);
@@ -299,6 +303,7 @@ private:
void updateCheckedRadioButtons();
+ void handleBeforeTextInsertedEvent(Event*);
PassRefPtr<HTMLFormElement> createTemporaryFormForIsIndex();
// Helper for getAllowedValueStep();
bool getStepParameters(double* defaultStep, double* stepScaleFactor) const;
diff --git a/WebCore/html/HTMLInputElement.idl b/WebCore/html/HTMLInputElement.idl
index b93f05c..c66e775 100644
--- a/WebCore/html/HTMLInputElement.idl
+++ b/WebCore/html/HTMLInputElement.idl
@@ -40,6 +40,9 @@ module html {
attribute long maxLength setter raises(DOMException);
attribute [Reflect] DOMString min;
attribute [Reflect] boolean multiple;
+#if defined(ENABLE_DIRECTORY_UPLOAD) && ENABLE_DIRECTORY_UPLOAD
+ attribute [Reflect] boolean webkitdirectory;
+#endif
attribute [Reflect] DOMString name;
attribute [Reflect] DOMString pattern;
attribute [Reflect] DOMString placeholder;
@@ -95,6 +98,10 @@ module html {
readonly attribute FileList files;
readonly attribute NodeList labels;
+
+#if defined(ENABLE_INPUT_SPEECH) && ENABLE_INPUT_SPEECH
+ attribute [Reflect] boolean speech;
+#endif
};
}
diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp
index eff250a..cce991a 100644
--- a/WebCore/html/HTMLLinkElement.cpp
+++ b/WebCore/html/HTMLLinkElement.cpp
@@ -200,6 +200,7 @@ void HTMLLinkElement::process()
if (m_relAttribute.m_isIcon && m_url.isValid() && !m_url.isEmpty())
document()->setIconURL(m_url.string(), type);
+<<<<<<< HEAD:WebCore/html/HTMLLinkElement.cpp
#ifdef ANDROID_APPLE_TOUCH_ICON
if ((m_relAttribute.m_isTouchIcon || m_relAttribute.m_isPrecomposedTouchIcon) && m_url.isValid()
&& !m_url.isEmpty() && document()->frame())
@@ -209,6 +210,9 @@ void HTMLLinkElement::process()
#endif
if (m_relAttribute.m_isDNSPrefetch && m_url.isValid() && !m_url.isEmpty())
+=======
+ if (m_relAttribute.m_isDNSPrefetch && document()->isDNSPrefetchEnabled() && m_url.isValid() && !m_url.isEmpty())
+>>>>>>> webkit.org at r63859:WebCore/html/HTMLLinkElement.cpp
ResourceHandle::prepareForURL(m_url);
#if ENABLE(LINK_PREFETCH)
diff --git a/WebCore/html/HTMLLinkElement.h b/WebCore/html/HTMLLinkElement.h
index efdfde2..057cccc 100644
--- a/WebCore/html/HTMLLinkElement.h
+++ b/WebCore/html/HTMLLinkElement.h
@@ -31,7 +31,6 @@
namespace WebCore {
class CachedCSSStyleSheet;
-class CachedLinkPrefetch;
class KURL;
class HTMLLinkElement : public HTMLElement, public CachedResourceClient {
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index b83d1cb..bf24cf9 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -130,6 +130,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* doc)
#endif
, m_dispatchingCanPlayEvent(false)
, m_loadInitiatedByUserGesture(false)
+ , m_completelyLoaded(false)
{
document()->registerForDocumentActivationCallbacks(this);
document()->registerForMediaVolumeCallbacks(this);
@@ -177,16 +178,19 @@ void HTMLMediaElement::attributeChanged(Attribute* attr, bool preserveDecls)
if (!getAttribute(srcAttr).isEmpty())
scheduleLoad();
}
-#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
else if (attrName == controlsAttr) {
+#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
if (!isVideo() && attached() && (controls() != (renderer() != 0))) {
detach();
attach();
}
if (renderer())
renderer()->updateFromElement();
- }
+#else
+ if (m_player)
+ m_player->setControls(controls());
#endif
+ }
}
void HTMLMediaElement::parseMappedAttribute(Attribute* attr)
@@ -226,8 +230,6 @@ void HTMLMediaElement::parseMappedAttribute(Attribute* attr)
setAttributeEventListener(eventNames().endedEvent, createAttributeEventListener(this, attr));
else if (attrName == onerrorAttr)
setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, attr));
- else if (attrName == onloadAttr)
- setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attr));
else if (attrName == onloadeddataAttr)
setAttributeEventListener(eventNames().loadeddataEvent, createAttributeEventListener(this, attr));
else if (attrName == onloadedmetadataAttr)
@@ -285,8 +287,14 @@ RenderObject* HTMLMediaElement::createRenderer(RenderArena* arena, RenderStyle*)
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
// Setup the renderer if we already have a proxy widget.
RenderEmbeddedObject* mediaRenderer = new (arena) RenderEmbeddedObject(this);
- if (m_proxyWidget)
+ if (m_proxyWidget) {
mediaRenderer->setWidget(m_proxyWidget);
+
+ Frame* frame = document()->frame();
+ FrameLoader* loader = frame ? frame->loader() : 0;
+ if (loader)
+ loader->showMediaPlayerProxyPlugin(m_proxyWidget.get());
+ }
return mediaRenderer;
#else
return new (arena) RenderMedia(this);
@@ -321,6 +329,14 @@ void HTMLMediaElement::attach()
if (renderer())
renderer()->updateFromElement();
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+ else if (m_proxyWidget) {
+ Frame* frame = document()->frame();
+ FrameLoader* loader = frame ? frame->loader() : 0;
+ if (loader)
+ loader->hideMediaPlayerProxyPlugin(m_proxyWidget.get());
+ }
+#endif
}
void HTMLMediaElement::recalcStyle(StyleChange change)
@@ -482,6 +498,7 @@ void HTMLMediaElement::prepareForLoad()
m_loadTimer.stop();
m_sentStalledEvent = false;
m_haveFiredLoadedData = false;
+ m_completelyLoaded = false;
// 1 - Abort any already-running instance of the resource selection algorithm for this element.
m_currentSourceNode = 0;
@@ -842,25 +859,15 @@ void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
}
if (state == MediaPlayer::Loaded) {
- NetworkState oldState = m_networkState;
-
- m_networkState = NETWORK_LOADED;
- if (oldState < NETWORK_LOADED || oldState == NETWORK_NO_SOURCE) {
+ if (m_networkState != NETWORK_IDLE) {
m_progressEventTimer.stop();
// Schedule one last progress event so we guarantee that at least one is fired
// for files that load very quickly.
scheduleEvent(eventNames().progressEvent);
-
- // Check to see if readyState changes need to be dealt with before sending the
- // 'load' event so we report 'canplaythrough' first. This is necessary because a
- // media engine reports readyState and networkState changes separately
- MediaPlayer::ReadyState currentState = m_player->readyState();
- if (static_cast<ReadyState>(currentState) != m_readyState)
- setReadyState(currentState);
-
- scheduleEvent(eventNames().loadEvent);
}
+ m_networkState = NETWORK_IDLE;
+ m_completelyLoaded = true;
}
}
@@ -973,7 +980,7 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
void HTMLMediaElement::progressEventTimerFired(Timer<HTMLMediaElement>*)
{
ASSERT(m_player);
- if (m_networkState == NETWORK_EMPTY || m_networkState >= NETWORK_LOADED)
+ if (m_networkState != NETWORK_LOADING)
return;
unsigned progress = m_player->bytesLoaded();
@@ -1021,49 +1028,55 @@ bool HTMLMediaElement::supportsSave() const
void HTMLMediaElement::seek(float time, ExceptionCode& ec)
{
- // 4.8.10.10. Seeking
- // 1
+ // 4.8.9.9 Seeking
+
+ // 1 - If the media element's readyState is HAVE_NOTHING, then raise an INVALID_STATE_ERR exception.
if (m_readyState == HAVE_NOTHING || !m_player) {
ec = INVALID_STATE_ERR;
return;
}
- // 2
+ // Get the current time before setting m_seeking, m_lastSeekTime is returned once it is set.
+ float now = currentTime();
+
+ // 3 - Set the seeking IDL attribute to true.
+ // The flag will be cleared when the engine tells is the time has actually changed
+ m_seeking = true;
+
+ // 4 - Queue a task to fire a simple event named timeupdate at the element.
+ scheduleTimeupdateEvent(false);
+
+ // 6 - If the new playback position is later than the end of the media resource, then let it be the end
+ // of the media resource instead.
time = min(time, duration());
- // 3
- time = max(time, 0.0f);
+ // 7 - If the new playback position is less than the earliest possible position, let it be that position instead.
+ float earliestTime = m_player->startTime();
+ time = max(time, earliestTime);
- // 4
+ // 8 - If the (possibly now changed) new playback position is not in one of the ranges given in the
+ // seekable attribute, then let it be the position in one of the ranges given in the seekable attribute
+ // that is the nearest to the new playback position. ... If there are no ranges given in the seekable
+ // attribute then set the seeking IDL attribute to false and abort these steps.
RefPtr<TimeRanges> seekableRanges = seekable();
- if (!seekableRanges->contain(time)) {
- ec = INDEX_SIZE_ERR;
+ if (!seekableRanges->length() || time == now) {
+ m_seeking = false;
return;
}
-
- // avoid generating events when the time won't actually change
- float now = currentTime();
- if (time == now)
- return;
+ time = seekableRanges->nearest(time);
- // 5
if (m_playing) {
if (m_lastSeekTime < now)
addPlayedRange(m_lastSeekTime, now);
}
m_lastSeekTime = time;
+ m_sentEndEvent = false;
- // 6 - set the seeking flag, it will be cleared when the engine tells is the time has actually changed
- m_seeking = true;
-
- // 7
- scheduleTimeupdateEvent(false);
+ // 9 - Set the current playback position to the given new playback position
+ m_player->seek(time);
- // 8 - this is covered, if necessary, when the engine signals a readystate change
+ // 10-15 are handled, if necessary, when the engine signals a readystate change.
- // 10
- m_player->seek(time);
- m_sentEndEvent = false;
}
void HTMLMediaElement::finishSeek()
@@ -1809,7 +1822,7 @@ void HTMLMediaElement::stopPeriodicTimers()
void HTMLMediaElement::userCancelledLoad()
{
- if (m_networkState == NETWORK_EMPTY || m_networkState >= NETWORK_LOADED)
+ if (m_networkState == NETWORK_EMPTY || m_completelyLoaded)
return;
// If the media data fetching process is aborted by the user:
@@ -1992,9 +2005,7 @@ void HTMLMediaElement::createMediaPlayerProxy()
{
ensureMediaPlayer();
- if (!inDocument() && m_proxyWidget)
- return;
- if (inDocument() && !m_needWidgetUpdate)
+ if (m_proxyWidget || (inDocument() && !m_needWidgetUpdate))
return;
Frame* frame = document()->frame();
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index 7d83f94..051629e 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -88,7 +88,7 @@ public:
void setSrc(const String&);
String currentSrc() const;
- enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_LOADED, NETWORK_NO_SOURCE };
+ enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO_SOURCE };
NetworkState networkState() const;
String preload() const;
@@ -366,6 +366,7 @@ private:
bool m_dispatchingCanPlayEvent : 1;
bool m_loadInitiatedByUserGesture : 1;
+ bool m_completelyLoaded : 1;
};
} //namespace
diff --git a/WebCore/html/HTMLMediaElement.idl b/WebCore/html/HTMLMediaElement.idl
index baea577..28a0fbe 100644
--- a/WebCore/html/HTMLMediaElement.idl
+++ b/WebCore/html/HTMLMediaElement.idl
@@ -36,8 +36,7 @@ interface [Conditional=VIDEO] HTMLMediaElement : HTMLElement {
const unsigned short NETWORK_EMPTY = 0;
const unsigned short NETWORK_IDLE = 1;
const unsigned short NETWORK_LOADING = 2;
- const unsigned short NETWORK_LOADED = 3;
- const unsigned short NETWORK_NO_SOURCE = 4;
+ const unsigned short NETWORK_NO_SOURCE = 3;
readonly attribute unsigned short networkState;
attribute DOMString preload;
diff --git a/WebCore/html/HTMLToken.h b/WebCore/html/HTMLToken.h
index c2db87d..d2987f4 100644
--- a/WebCore/html/HTMLToken.h
+++ b/WebCore/html/HTMLToken.h
@@ -339,7 +339,7 @@ public:
m_data = String(token.comment().data(), token.comment().size());
break;
case HTMLToken::Character:
- m_data = String(token.characters().data(), token.characters().size());
+ m_externalCharacters = &token.characters();
break;
}
}
@@ -352,12 +352,6 @@ public:
ASSERT(usesName());
}
- explicit AtomicHTMLToken(const String& characters)
- : m_type(HTMLToken::Character)
- , m_data(characters)
- {
- }
-
HTMLToken::Type type() const { return m_type; }
const AtomicString& name() const
@@ -398,10 +392,10 @@ public:
return m_attributes.release();
}
- const String& characters() const
+ const HTMLToken::DataVector& characters() const
{
ASSERT(m_type == HTMLToken::Character);
- return m_data;
+ return *m_externalCharacters;
}
const String& comment() const
@@ -446,10 +440,19 @@ private:
// "name" for DOCTYPE, StartTag, and EndTag
AtomicString m_name;
- // "characters" for Character
// "data" for Comment
String m_data;
+ // "characters" for Character
+ //
+ // We don't want to copy the the characters out of the HTMLToken, so we
+ // keep a pointer to its buffer instead. This buffer is owned by the
+ // HTMLToken and causes a lifetime dependence between these objects.
+ //
+ // FIXME: Add a mechanism for "internalizing" the characters when the
+ // HTMLToken is destructed.
+ const HTMLToken::DataVector* m_externalCharacters;
+
// For DOCTYPE
OwnPtr<HTMLToken::DoctypeData> m_doctypeData;
diff --git a/WebCore/html/HTMLTreeBuilder.cpp b/WebCore/html/HTMLTreeBuilder.cpp
index 80d4530..93da3f7 100644
--- a/WebCore/html/HTMLTreeBuilder.cpp
+++ b/WebCore/html/HTMLTreeBuilder.cpp
@@ -33,6 +33,7 @@
#include "Frame.h"
#include "HTMLDocument.h"
#include "HTMLElementFactory.h"
+#include "HTMLFormElement.h"
#include "HTMLHtmlElement.h"
#include "HTMLNames.h"
#include "HTMLScriptElement.h"
@@ -65,77 +66,6 @@ inline bool isTreeBuilderWhitepace(UChar cc)
return cc == '\t' || cc == '\x0A' || cc == '\x0C' || cc == '\x0D' || cc == ' ';
}
-class ExternalCharacterTokenBuffer : public Noncopyable {
-public:
- explicit ExternalCharacterTokenBuffer(AtomicHTMLToken& token)
- : m_current(token.characters().characters())
- , m_end(m_current + token.characters().length())
- {
- ASSERT(!isEmpty());
- }
-
- ~ExternalCharacterTokenBuffer()
- {
- ASSERT(isEmpty());
- }
-
- bool isEmpty() const { return m_current == m_end; }
-
- void skipLeadingWhitespace()
- {
- ASSERT(!isEmpty());
- while (isTreeBuilderWhitepace(*m_current)) {
- if (++m_current == m_end)
- return;
- }
- }
-
- String takeLeadingWhitespace()
- {
- ASSERT(!isEmpty());
- const UChar* start = m_current;
- skipLeadingWhitespace();
- if (start == m_current)
- return String();
- return String(start, m_current - start);
- }
-
- String takeRemaining()
- {
- ASSERT(!isEmpty());
- const UChar* start = m_current;
- m_current = m_end;
- return String(start, m_current - start);
- }
-
- void giveRemainingTo(Vector<UChar>& recipient)
- {
- recipient.append(m_current, m_end - m_current);
- m_current = m_end;
- }
-
- String takeRemainingWhitespace()
- {
- ASSERT(!isEmpty());
- Vector<UChar> whitespace;
- do {
- UChar cc = *m_current++;
- if (isTreeBuilderWhitepace(cc))
- whitespace.append(cc);
- } while (m_current < m_end);
- // Returning the null string when there aren't any whitespace
- // characters is slightly cleaner semantically because we don't want
- // to insert a text node (as opposed to inserting an empty text node).
- if (whitespace.isEmpty())
- return String();
- return String::adopt(whitespace);
- }
-
-private:
- const UChar* m_current;
- const UChar* m_end;
-};
-
inline bool hasNonWhitespace(const String& string)
{
const UChar* characters = string.characters();
@@ -285,13 +215,6 @@ bool isNonAnchorFormattingTag(const AtomicString& tagName)
|| isNonAnchorNonNobrFormattingTag(tagName);
}
-bool requiresRedirectToFosterParent(Element* element)
-{
- return element->hasTagName(tableTag)
- || isTableBodyContextTag(element->localName())
- || element->hasTagName(trTag);
-}
-
// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#formatting
bool isFormattingTag(const AtomicString& tagName)
{
@@ -316,10 +239,89 @@ bool isNotFormattingAndNotPhrasing(const Element* element)
} // namespace
+class HTMLTreeBuilder::ExternalCharacterTokenBuffer : public Noncopyable {
+public:
+ explicit ExternalCharacterTokenBuffer(AtomicHTMLToken& token)
+ : m_current(token.characters().data())
+ , m_end(m_current + token.characters().size())
+ {
+ ASSERT(!isEmpty());
+ }
+
+ explicit ExternalCharacterTokenBuffer(const String& string)
+ : m_current(string.characters())
+ , m_end(m_current + string.length())
+ {
+ ASSERT(!isEmpty());
+ }
+
+ ~ExternalCharacterTokenBuffer()
+ {
+ ASSERT(isEmpty());
+ }
+
+ bool isEmpty() const { return m_current == m_end; }
+
+ void skipLeadingWhitespace()
+ {
+ ASSERT(!isEmpty());
+ while (isTreeBuilderWhitepace(*m_current)) {
+ if (++m_current == m_end)
+ return;
+ }
+ }
+
+ String takeLeadingWhitespace()
+ {
+ ASSERT(!isEmpty());
+ const UChar* start = m_current;
+ skipLeadingWhitespace();
+ if (start == m_current)
+ return String();
+ return String(start, m_current - start);
+ }
+
+ String takeRemaining()
+ {
+ ASSERT(!isEmpty());
+ const UChar* start = m_current;
+ m_current = m_end;
+ return String(start, m_current - start);
+ }
+
+ void giveRemainingTo(Vector<UChar>& recipient)
+ {
+ recipient.append(m_current, m_end - m_current);
+ m_current = m_end;
+ }
+
+ String takeRemainingWhitespace()
+ {
+ ASSERT(!isEmpty());
+ Vector<UChar> whitespace;
+ do {
+ UChar cc = *m_current++;
+ if (isTreeBuilderWhitepace(cc))
+ whitespace.append(cc);
+ } while (m_current < m_end);
+ // Returning the null string when there aren't any whitespace
+ // characters is slightly cleaner semantically because we don't want
+ // to insert a text node (as opposed to inserting an empty text node).
+ if (whitespace.isEmpty())
+ return String();
+ return String::adopt(whitespace);
+ }
+
+private:
+ const UChar* m_current;
+ const UChar* m_end;
+};
+
+
HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, HTMLDocument* document, bool reportErrors)
: m_framesetOk(true)
, m_document(document)
- , m_tree(document, FragmentScriptingAllowed)
+ , m_tree(document, FragmentScriptingAllowed, false)
, m_reportErrors(reportErrors)
, m_isPaused(false)
, m_insertionMode(InitialMode)
@@ -339,7 +341,7 @@ HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, HTMLDocument* documen
HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, DocumentFragment* fragment, FragmentScriptingPermission scriptingPermission)
: m_framesetOk(true)
, m_document(fragment->document())
- , m_tree(fragment->document(), scriptingPermission)
+ , m_tree(fragment->document(), scriptingPermission, true)
, m_reportErrors(false) // FIXME: Why not report errors in fragments?
, m_isPaused(false)
, m_insertionMode(InitialMode)
@@ -386,7 +388,7 @@ static void convertToOldStyle(AtomicHTMLToken& token, Token& oldStyleToken)
break;
case HTMLToken::Character:
oldStyleToken.tagName = textAtom;
- oldStyleToken.text = token.characters().impl();
+ oldStyleToken.text = StringImpl::create(token.characters().data(), token.characters().size());
break;
}
}
@@ -542,7 +544,7 @@ void HTMLTreeBuilder::processDoctypeToken(AtomicHTMLToken& token)
return;
}
if (m_insertionMode == InTableTextMode) {
- processDefaultForInTableTextMode(token);
+ defaultForInTableText();
processDoctypeToken(token);
return;
}
@@ -565,8 +567,9 @@ void HTMLTreeBuilder::processFakeEndTag(const QualifiedName& tagName)
void HTMLTreeBuilder::processFakeCharacters(const String& characters)
{
- AtomicHTMLToken fakeToken(characters);
- processCharacter(fakeToken);
+ ASSERT(!characters.isEmpty());
+ ExternalCharacterTokenBuffer buffer(characters);
+ processCharacterBuffer(buffer);
}
void HTMLTreeBuilder::processFakePEndTagIfPInScope()
@@ -843,8 +846,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
return;
}
processFakePEndTagIfPInScope();
- m_tree.insertHTMLElement(token);
- m_tree.setForm(m_tree.currentElement());
+ m_tree.insertHTMLFormElement(token);
return;
}
if (token.name() == liTag) {
@@ -1069,12 +1071,12 @@ bool HTMLTreeBuilder::processColgroupEndTagForInColumnGroup()
void HTMLTreeBuilder::closeTheCell()
{
ASSERT(insertionMode() == InCellMode);
- if (m_tree.openElements()->inScope(tdTag)) {
- ASSERT(!m_tree.openElements()->inScope(thTag));
+ if (m_tree.openElements()->inTableScope(tdTag)) {
+ ASSERT(!m_tree.openElements()->inTableScope(thTag));
processFakeEndTag(tdTag);
return;
}
- ASSERT(m_tree.openElements()->inScope(thTag));
+ ASSERT(m_tree.openElements()->inTableScope(thTag));
processFakeEndTag(thTag);
ASSERT(insertionMode() == InRowMode);
}
@@ -1129,7 +1131,7 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token)
}
if (token.name() == inputTag) {
Attribute* typeAttribute = token.getAttributeItem(typeAttr);
- if (!typeAttribute || equalIgnoringCase(typeAttribute->value(), "hidden")) {
+ if (typeAttribute && equalIgnoringCase(typeAttribute->value(), "hidden")) {
parseError(token);
m_tree.insertSelfClosingHTMLElement(token);
return;
@@ -1140,11 +1142,14 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token)
parseError(token);
if (m_tree.form())
return;
- m_tree.insertSelfClosingHTMLElement(token);
+ // FIXME: This deviates from the spec:
+ // http://www.w3.org/Bugs/Public/show_bug.cgi?id=10216
+ m_tree.insertHTMLFormElement(token);
+ m_tree.openElements()->pop();
return;
}
parseError(token);
- HTMLConstructionSite::RedirectToFosterParentGuard redirecter(m_tree, requiresRedirectToFosterParent(m_tree.currentElement()));
+ HTMLConstructionSite::RedirectToFosterParentGuard redirecter(m_tree);
processStartTagForInBody(token);
}
@@ -1178,7 +1183,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
switch (insertionMode()) {
case InitialMode:
ASSERT(insertionMode() == InitialMode);
- processDefaultForInitialMode(token);
+ defaultForInitial();
// Fall through.
case BeforeHTMLMode:
ASSERT(insertionMode() == BeforeHTMLMode);
@@ -1187,7 +1192,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
setInsertionMode(BeforeHeadMode);
return;
}
- processDefaultForBeforeHTMLMode(token);
+ defaultForBeforeHTML();
// Fall through.
case BeforeHeadMode:
ASSERT(insertionMode() == BeforeHeadMode);
@@ -1200,13 +1205,13 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
setInsertionMode(InHeadMode);
return;
}
- processDefaultForBeforeHeadMode(token);
+ defaultForBeforeHead();
// Fall through.
case InHeadMode:
ASSERT(insertionMode() == InHeadMode);
if (processStartTagForInHead(token))
return;
- processDefaultForInHeadMode(token);
+ defaultForInHead();
// Fall through.
case AfterHeadMode:
ASSERT(insertionMode() == AfterHeadMode);
@@ -1243,7 +1248,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
parseError(token);
return;
}
- processDefaultForAfterHeadMode(token);
+ defaultForAfterHead();
// Fall through
case InBodyMode:
ASSERT(insertionMode() == InBodyMode);
@@ -1383,7 +1388,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
parseError(token);
return;
}
- processDefaultForInHeadNoscriptMode(token);
+ defaultForInHeadNoscript();
processToken(token);
break;
case InFramesetMode:
@@ -1482,7 +1487,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
}
break;
case InTableTextMode:
- processDefaultForInTableTextMode(token);
+ defaultForInTableText();
processStartTag(token);
break;
case InForeignContentMode: {
@@ -1561,7 +1566,7 @@ bool HTMLTreeBuilder::processBodyEndTagForInBody(AtomicHTMLToken& token)
parseError(token);
return false;
}
- notImplemented();
+ notImplemented(); // Emit a more specific parse error based on stack contents.
setInsertionMode(AfterBodyMode);
return true;
}
@@ -1630,7 +1635,7 @@ void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
while (1) {
// 1.
Element* formattingElement = m_tree.activeFormattingElements()->closestElementInScopeWithName(token.name());
- if (!formattingElement || (m_tree.openElements()->contains(formattingElement)) && !m_tree.openElements()->inScope(formattingElement)) {
+ if (!formattingElement || ((m_tree.openElements()->contains(formattingElement)) && !m_tree.openElements()->inScope(formattingElement))) {
parseError(token);
notImplemented(); // Check the stack of open elements for a more specific parse error.
return;
@@ -1675,11 +1680,7 @@ void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
if (node == formattingElementRecord)
break;
// 6.5
- // FIXME: We're supposed to save the original token in the entry.
- AtomicHTMLToken fakeToken(HTMLToken::StartTag, node->element()->localName());
- // Is createHTMLElement correct? (instead of insertHTMLElement)
- // Does this code ever leave newElement unattached?
- RefPtr<Element> newElement = m_tree.createHTMLElement(fakeToken);
+ RefPtr<Element> newElement = m_tree.createHTMLElementFromElementRecord(node);
HTMLFormattingElementList::Entry* nodeEntry = m_tree.activeFormattingElements()->find(node->element());
nodeEntry->replaceElement(newElement.get());
node->replaceElement(newElement.release());
@@ -1687,7 +1688,7 @@ void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
// was replaced in 6.5.
// http://www.w3.org/Bugs/Public/show_bug.cgi?id=10096
if (lastNode == furthestBlock)
- bookmark.moveToAfter(node->element());
+ bookmark.moveToAfter(nodeEntry);
// 6.6
// Use appendChild instead of parserAddChild to handle possible reparenting.
ExceptionCode ec;
@@ -1698,6 +1699,8 @@ void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
}
// 7
const AtomicString& commonAncestorTag = commonAncestor->localName();
+ // FIXME: If this moves to HTMLConstructionSite, this check should use
+ // causesFosterParenting(tagName) instead.
if (commonAncestorTag == tableTag
|| commonAncestorTag == trTag
|| isTableBodyContextTag(commonAncestorTag))
@@ -1708,16 +1711,21 @@ void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
ASSERT(!ec);
}
// 8
- // FIXME: We're supposed to save the original token in the entry.
- AtomicHTMLToken fakeToken(HTMLToken::StartTag, formattingElement->localName());
- RefPtr<Element> newElement = m_tree.createHTMLElement(fakeToken);
+ RefPtr<Element> newElement = m_tree.createHTMLElementFromElementRecord(formattingElementRecord);
// 9
reparentChildren(furthestBlock->element(), newElement.get());
// 10
- furthestBlock->element()->parserAddChild(newElement);
+ Element* furthestBlockElement = furthestBlock->element();
+ // FIXME: All this creation / parserAddChild / attach business should
+ // be in HTMLConstructionSite. My guess is that steps 8--12
+ // should all be in some HTMLConstructionSite function.
+ furthestBlockElement->parserAddChild(newElement);
+ if (furthestBlockElement->attached()) {
+ ASSERT(!newElement->attached());
+ newElement->attach();
+ }
// 11
- m_tree.activeFormattingElements()->remove(formattingElement);
- m_tree.activeFormattingElements()->insertAt(newElement.get(), bookmark);
+ m_tree.activeFormattingElements()->swapTo(formattingElement, newElement.get(), bookmark);
// 12
m_tree.openElements()->remove(formattingElement);
m_tree.openElements()->insertAbove(newElement, furthestBlock);
@@ -2100,7 +2108,7 @@ void HTMLTreeBuilder::processEndTagForInTable(AtomicHTMLToken& token)
return;
}
// Is this redirection necessary here?
- HTMLConstructionSite::RedirectToFosterParentGuard redirecter(m_tree, requiresRedirectToFosterParent(m_tree.currentElement()));
+ HTMLConstructionSite::RedirectToFosterParentGuard redirecter(m_tree);
processEndTagForInBody(token);
}
@@ -2110,7 +2118,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
switch (insertionMode()) {
case InitialMode:
ASSERT(insertionMode() == InitialMode);
- processDefaultForInitialMode(token);
+ defaultForInitial();
// Fall through.
case BeforeHTMLMode:
ASSERT(insertionMode() == BeforeHTMLMode);
@@ -2118,7 +2126,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
parseError(token);
return;
}
- processDefaultForBeforeHTMLMode(token);
+ defaultForBeforeHTML();
// Fall through.
case BeforeHeadMode:
ASSERT(insertionMode() == BeforeHeadMode);
@@ -2126,7 +2134,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
parseError(token);
return;
}
- processDefaultForBeforeHeadMode(token);
+ defaultForBeforeHead();
// Fall through.
case InHeadMode:
ASSERT(insertionMode() == InHeadMode);
@@ -2139,7 +2147,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
parseError(token);
return;
}
- processDefaultForInHeadMode(token);
+ defaultForInHead();
// Fall through.
case AfterHeadMode:
ASSERT(insertionMode() == AfterHeadMode);
@@ -2147,7 +2155,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
parseError(token);
return;
}
- processDefaultForAfterHeadMode(token);
+ defaultForAfterHead();
// Fall through
case InBodyMode:
ASSERT(insertionMode() == InBodyMode);
@@ -2242,7 +2250,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
parseError(token);
return;
}
- processDefaultForInHeadNoscriptMode(token);
+ defaultForInHeadNoscript();
processToken(token);
break;
case TextMode:
@@ -2251,6 +2259,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
m_isPaused = true;
ASSERT(m_tree.currentElement()->hasTagName(scriptTag));
m_scriptToProcess = m_tree.currentElement();
+ m_scriptToProcessStartLine = m_lastScriptElementStartLine + 1;
m_tree.openElements()->pop();
setInsertionMode(m_originalInsertionMode);
return;
@@ -2326,7 +2335,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
}
break;
case InTableTextMode:
- processDefaultForInTableTextMode(token);
+ defaultForInTableText();
processEndTag(token);
break;
case InForeignContentMode:
@@ -2339,9 +2348,11 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
HTMLElementStack::ElementRecord* nodeRecord = m_tree.openElements()->topRecord();
if (!nodeRecord->element()->hasLocalName(token.name())) {
parseError(token);
- // FIXME: This return is not in the spec but appears to be needed.
+ // FIXME: This return is not in the spec but it needed for now
+ // to prevent walking off the bottom of the stack.
// http://www.w3.org/Bugs/Public/show_bug.cgi?id=10118
- return;
+ if (!m_tree.openElements()->contains(token.name()))
+ return;
}
while (1) {
if (nodeRecord->element()->hasLocalName(token.name())) {
@@ -2349,8 +2360,13 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
return;
}
nodeRecord = nodeRecord->next();
- if (nodeRecord->element()->namespaceURI() == xhtmlNamespaceURI)
+ if (nodeRecord->element()->namespaceURI() == xhtmlNamespaceURI) {
processUsingSecondaryInsertionModeAndAdjustInsertionMode(token);
+ // FIXME: This is a hack around a spec bug and is likely wrong.
+ // http://www.w3.org/Bugs/Public/show_bug.cgi?id=9581
+ if (nodeRecord != m_tree.openElements()->topRecord())
+ return;
+ }
}
return;
}
@@ -2408,7 +2424,7 @@ void HTMLTreeBuilder::processComment(AtomicHTMLToken& token)
return;
}
if (m_insertionMode == InTableTextMode) {
- processDefaultForInTableTextMode(token);
+ defaultForInTableText();
processComment(token);
return;
}
@@ -2418,13 +2434,16 @@ void HTMLTreeBuilder::processComment(AtomicHTMLToken& token)
void HTMLTreeBuilder::processCharacter(AtomicHTMLToken& token)
{
ASSERT(token.type() == HTMLToken::Character);
-
// FIXME: Currently this design has an extra memcpy because we copy the
// characters out of the HTMLTokenizer's buffer into the AtomicHTMLToken
// and then into the text node. What we'd really like is to copy directly
// from the HTMLTokenizer's buffer into the text node.
ExternalCharacterTokenBuffer buffer(token);
+ processCharacterBuffer(buffer);
+}
+void HTMLTreeBuilder::processCharacterBuffer(ExternalCharacterTokenBuffer& buffer)
+{
ReprocessBuffer:
switch (insertionMode()) {
case InitialMode: {
@@ -2432,7 +2451,7 @@ ReprocessBuffer:
buffer.skipLeadingWhitespace();
if (buffer.isEmpty())
return;
- processDefaultForInitialMode(token);
+ defaultForInitial();
// Fall through.
}
case BeforeHTMLMode: {
@@ -2440,7 +2459,7 @@ ReprocessBuffer:
buffer.skipLeadingWhitespace();
if (buffer.isEmpty())
return;
- processDefaultForBeforeHTMLMode(token);
+ defaultForBeforeHTML();
// Fall through.
}
case BeforeHeadMode: {
@@ -2448,7 +2467,7 @@ ReprocessBuffer:
buffer.skipLeadingWhitespace();
if (buffer.isEmpty())
return;
- processDefaultForBeforeHeadMode(token);
+ defaultForBeforeHead();
// Fall through.
}
case InHeadMode: {
@@ -2458,7 +2477,7 @@ ReprocessBuffer:
m_tree.insertTextNode(leadingWhitespace);
if (buffer.isEmpty())
return;
- processDefaultForInHeadMode(token);
+ defaultForInHead();
// Fall through.
}
case AfterHeadMode: {
@@ -2468,7 +2487,7 @@ ReprocessBuffer:
m_tree.insertTextNode(leadingWhitespace);
if (buffer.isEmpty())
return;
- processDefaultForAfterHeadMode(token);
+ defaultForAfterHead();
// Fall through.
}
case InBodyMode:
@@ -2511,7 +2530,7 @@ ReprocessBuffer:
case AfterBodyMode:
case AfterAfterBodyMode: {
ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
- parseError(token);
+ // FIXME: parse error
setInsertionMode(InBodyMode);
goto ReprocessBuffer;
break;
@@ -2528,7 +2547,7 @@ ReprocessBuffer:
m_tree.insertTextNode(leadingWhitespace);
if (buffer.isEmpty())
return;
- processDefaultForInHeadNoscriptMode(token);
+ defaultForInHeadNoscript();
goto ReprocessBuffer;
break;
}
@@ -2575,28 +2594,28 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
switch (insertionMode()) {
case InitialMode:
ASSERT(insertionMode() == InitialMode);
- processDefaultForInitialMode(token);
+ defaultForInitial();
// Fall through.
case BeforeHTMLMode:
ASSERT(insertionMode() == BeforeHTMLMode);
- processDefaultForBeforeHTMLMode(token);
+ defaultForBeforeHTML();
// Fall through.
case BeforeHeadMode:
ASSERT(insertionMode() == BeforeHeadMode);
- processDefaultForBeforeHeadMode(token);
+ defaultForBeforeHead();
// Fall through.
case InHeadMode:
ASSERT(insertionMode() == InHeadMode);
- processDefaultForInHeadMode(token);
+ defaultForInHead();
// Fall through.
case AfterHeadMode:
ASSERT(insertionMode() == AfterHeadMode);
- processDefaultForAfterHeadMode(token);
+ defaultForAfterHead();
// Fall through
case InBodyMode:
case InCellMode:
ASSERT(insertionMode() == InBodyMode || insertionMode() == InCellMode);
- notImplemented();
+ notImplemented(); // Emit parse error based on what elemtns are still open.
break;
case AfterBodyMode:
case AfterAfterBodyMode:
@@ -2605,9 +2624,9 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
break;
case InHeadNoscriptMode:
ASSERT(insertionMode() == InHeadNoscriptMode);
- processDefaultForInHeadNoscriptMode(token);
- processToken(token);
- break;
+ defaultForInHeadNoscript();
+ processEndOfFile(token);
+ return;
case AfterFramesetMode:
case AfterAfterFramesetMode:
ASSERT(insertionMode() == AfterFramesetMode || insertionMode() == AfterAfterFramesetMode);
@@ -2631,7 +2650,7 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
return;
}
processEndOfFile(token);
- break;
+ return;
case InForeignContentMode:
parseError(token);
// FIXME: Following the spec would infinitely recurse on <svg><svg>
@@ -2639,64 +2658,66 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
m_tree.openElements()->popUntilElementWithNamespace(xhtmlNamespaceURI);
setInsertionMode(m_secondaryInsertionMode);
processEndOfFile(token);
- break;
+ return;
case InTableTextMode:
- processDefaultForInTableTextMode(token);
+ defaultForInTableText();
processEndOfFile(token);
- break;
+ return;
case TextMode:
case InCaptionMode:
case InRowMode:
notImplemented();
break;
}
+ ASSERT(m_tree.openElements()->top());
+ m_tree.openElements()->popAll();
}
-void HTMLTreeBuilder::processDefaultForInitialMode(AtomicHTMLToken& token)
+void HTMLTreeBuilder::defaultForInitial()
{
notImplemented();
- parseError(token);
+ // FIXME: parse error
setInsertionMode(BeforeHTMLMode);
}
-void HTMLTreeBuilder::processDefaultForBeforeHTMLMode(AtomicHTMLToken&)
+void HTMLTreeBuilder::defaultForBeforeHTML()
{
AtomicHTMLToken startHTML(HTMLToken::StartTag, htmlTag.localName());
m_tree.insertHTMLHtmlStartTagBeforeHTML(startHTML);
setInsertionMode(BeforeHeadMode);
}
-void HTMLTreeBuilder::processDefaultForBeforeHeadMode(AtomicHTMLToken&)
+void HTMLTreeBuilder::defaultForBeforeHead()
{
AtomicHTMLToken startHead(HTMLToken::StartTag, headTag.localName());
processStartTag(startHead);
}
-void HTMLTreeBuilder::processDefaultForInHeadMode(AtomicHTMLToken&)
+void HTMLTreeBuilder::defaultForInHead()
{
AtomicHTMLToken endHead(HTMLToken::EndTag, headTag.localName());
processEndTag(endHead);
}
-void HTMLTreeBuilder::processDefaultForInHeadNoscriptMode(AtomicHTMLToken&)
+void HTMLTreeBuilder::defaultForInHeadNoscript()
{
AtomicHTMLToken endNoscript(HTMLToken::EndTag, noscriptTag.localName());
processEndTag(endNoscript);
}
-void HTMLTreeBuilder::processDefaultForAfterHeadMode(AtomicHTMLToken&)
+void HTMLTreeBuilder::defaultForAfterHead()
{
AtomicHTMLToken startBody(HTMLToken::StartTag, bodyTag.localName());
processStartTag(startBody);
m_framesetOk = true;
}
-void HTMLTreeBuilder::processDefaultForInTableTextMode(AtomicHTMLToken& token)
+void HTMLTreeBuilder::defaultForInTableText()
{
String characters = String::adopt(m_pendingTableCharacters);
if (hasNonWhitespace(characters)) {
- parseError(token);
- HTMLConstructionSite::RedirectToFosterParentGuard redirecter(m_tree, requiresRedirectToFosterParent(m_tree.currentElement()));
+ // FIXME: parse error
+ HTMLConstructionSite::RedirectToFosterParentGuard redirecter(m_tree);
m_tree.reconstructTheActiveFormattingElements();
m_tree.insertTextNode(characters);
m_framesetOk = false;
@@ -2775,6 +2796,7 @@ void HTMLTreeBuilder::processScriptStartTag(AtomicHTMLToken& token)
m_tree.insertScriptElement(token);
m_tokenizer->setState(HTMLTokenizer::ScriptDataState);
m_originalInsertionMode = m_insertionMode;
+ m_lastScriptElementStartLine = m_tokenizer->lineNumber();
setInsertionMode(TextMode);
}
diff --git a/WebCore/html/HTMLTreeBuilder.h b/WebCore/html/HTMLTreeBuilder.h
index 74e3398..0f87cb0 100644
--- a/WebCore/html/HTMLTreeBuilder.h
+++ b/WebCore/html/HTMLTreeBuilder.h
@@ -76,6 +76,7 @@ public:
private:
class FakeInsertionMode;
+ class ExternalCharacterTokenBuffer;
// Represents HTML5 "insertion mode"
// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#insertion-mode
enum InsertionMode {
@@ -134,6 +135,8 @@ private:
// needs to assert which tokens it can be called with.
void processAnyOtherEndTagForInBody(AtomicHTMLToken&);
+ void processCharacterBuffer(ExternalCharacterTokenBuffer&);
+
void processFakeStartTag(const QualifiedName&, PassRefPtr<NamedNodeMap> attributes = 0);
void processFakeEndTag(const QualifiedName&);
void processFakeCharacters(const String&);
@@ -144,14 +147,13 @@ private:
void processScriptStartTag(AtomicHTMLToken&);
// Default processing for the different insertion modes.
- // FIXME: These functions need to be renamed to remove "process" from their names.
- void processDefaultForInitialMode(AtomicHTMLToken&);
- void processDefaultForBeforeHTMLMode(AtomicHTMLToken&);
- void processDefaultForBeforeHeadMode(AtomicHTMLToken&);
- void processDefaultForInHeadMode(AtomicHTMLToken&);
- void processDefaultForInHeadNoscriptMode(AtomicHTMLToken&);
- void processDefaultForAfterHeadMode(AtomicHTMLToken&);
- void processDefaultForInTableTextMode(AtomicHTMLToken&);
+ void defaultForInitial();
+ void defaultForBeforeHTML();
+ void defaultForBeforeHead();
+ void defaultForInHead();
+ void defaultForInHeadNoscript();
+ void defaultForAfterHead();
+ void defaultForInTableText();
void processUsingSecondaryInsertionModeAndAdjustInsertionMode(AtomicHTMLToken&);
diff --git a/WebCore/html/LegacyHTMLTreeBuilder.cpp b/WebCore/html/LegacyHTMLTreeBuilder.cpp
index afd79b6..ee0bcfc 100644
--- a/WebCore/html/LegacyHTMLTreeBuilder.cpp
+++ b/WebCore/html/LegacyHTMLTreeBuilder.cpp
@@ -277,7 +277,30 @@ PassRefPtr<Node> LegacyHTMLTreeBuilder::parseToken(Token* t)
if (m_inBody && !skipMode() && m_current->localName() != styleTag &&
m_current->localName() != titleTag && !t->text->containsOnlyWhitespace())
m_haveContent = true;
-
+
+ // HTML5 requires text node coalescing.
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#insert-a-character
+ Node* previousChild = m_current->lastChild();
+ if (previousChild && previousChild->isTextNode()) {
+ // Only coalesce text nodes if the text node wouldn't be foster parented.
+ if (!m_current->hasTagName(htmlTag)
+ && !m_current->hasTagName(tableTag)
+ && !m_current->hasTagName(trTag)
+ && !m_current->hasTagName(theadTag)
+ && !m_current->hasTagName(tbodyTag)
+ && !m_current->hasTagName(tfootTag)
+ && !m_current->hasTagName(titleTag)) {
+ // Technically we're only supposed to merge into the previous
+ // text node if it was the last node inserted by the parser.
+ // (This was a spec modification made to make it easier for
+ // mozilla to run their parser in a thread.)
+ // In practice it does not seem to matter.
+ CharacterData* textNode = static_cast<CharacterData*>(previousChild);
+ textNode->parserAppendData(t->text);
+ return textNode;
+ }
+ }
+
RefPtr<Node> n;
String text = t->text.get();
unsigned charsLeft = text.length();
@@ -566,8 +589,17 @@ bool LegacyHTMLTreeBuilder::handleError(Node* n, bool flat, const AtomicString&
} else {
if (n->isTextNode()) {
Text* t = static_cast<Text*>(n);
- if (t->containsOnlyWhitespace())
+ if (t->containsOnlyWhitespace()) {
+ if (m_head && !m_inBody) {
+ // We're between </head> and <body>. According to
+ // the HTML5 parsing algorithm, we're supposed to
+ // insert whitespace text nodes into the HTML element.
+ ExceptionCode ec;
+ m_current->appendChild(n, ec);
+ return true;
+ }
return false;
+ }
}
if (!m_haveFrameSet) {
// Ensure that head exists.
@@ -862,6 +894,15 @@ bool LegacyHTMLTreeBuilder::nestedStyleCreateErrorCheck(Token* t, RefPtr<Node>&)
return allowNestedRedundantTag(t->tagName);
}
+bool LegacyHTMLTreeBuilder::colCreateErrorCheck(Token*, RefPtr<Node>&)
+{
+ if (!m_current->hasTagName(tableTag))
+ return true;
+ RefPtr<Element> implicitColgroup = HTMLElementFactory::createHTMLElement(colgroupTag, m_document, 0, true);
+ insertNode(implicitColgroup.get());
+ return true;
+}
+
bool LegacyHTMLTreeBuilder::tableCellCreateErrorCheck(Token*, RefPtr<Node>&)
{
popBlock(tdTag);
@@ -955,6 +996,7 @@ PassRefPtr<Node> LegacyHTMLTreeBuilder::getNode(Token* t)
mapTagsToFunc(gFunctionMap, pCloserCreateErrorTags, &LegacyHTMLTreeBuilder::pCloserCreateErrorCheck);
mapTagToFunc(gFunctionMap, bodyTag, &LegacyHTMLTreeBuilder::bodyCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, colTag, &LegacyHTMLTreeBuilder::colCreateErrorCheck);
mapTagToFunc(gFunctionMap, ddTag, &LegacyHTMLTreeBuilder::ddCreateErrorCheck);
mapTagToFunc(gFunctionMap, dtTag, &LegacyHTMLTreeBuilder::dtCreateErrorCheck);
mapTagToFunc(gFunctionMap, formTag, &LegacyHTMLTreeBuilder::formCreateErrorCheck);
diff --git a/WebCore/html/LegacyHTMLTreeBuilder.h b/WebCore/html/LegacyHTMLTreeBuilder.h
index cfd9519..4ac8413 100644
--- a/WebCore/html/LegacyHTMLTreeBuilder.h
+++ b/WebCore/html/LegacyHTMLTreeBuilder.h
@@ -85,6 +85,7 @@ private:
PassRefPtr<Node> getNode(Token*);
bool bodyCreateErrorCheck(Token*, RefPtr<Node>&);
bool canvasCreateErrorCheck(Token*, RefPtr<Node>&);
+ bool colCreateErrorCheck(Token*, RefPtr<Node>&);
bool commentCreateErrorCheck(Token*, RefPtr<Node>&);
bool ddCreateErrorCheck(Token*, RefPtr<Node>&);
bool dtCreateErrorCheck(Token*, RefPtr<Node>&);
diff --git a/WebCore/html/TimeRanges.cpp b/WebCore/html/TimeRanges.cpp
index e5b070d..1e18306 100644
--- a/WebCore/html/TimeRanges.cpp
+++ b/WebCore/html/TimeRanges.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,6 +27,8 @@
#include "TimeRanges.h"
+#include <math.h>
+
using namespace WebCore;
TimeRanges::TimeRanges(float start, float end)
@@ -115,3 +117,21 @@ bool TimeRanges::contain(float time) const
}
return false;
}
+
+float TimeRanges::nearest(float time) const
+{
+ ExceptionCode unused;
+ float closest = 0;
+ unsigned count = length();
+ for (unsigned ndx = 0; ndx < count; ndx++) {
+ float startTime = start(ndx, unused);
+ float endTime = end(ndx, unused);
+ if (time >= startTime && time <= endTime)
+ return time;
+ if (fabs(startTime - time) < closest)
+ closest = fabsf(startTime - time);
+ else if (fabs(endTime - time) < closest)
+ closest = fabsf(endTime - time);
+ }
+ return closest;
+}
diff --git a/WebCore/html/TimeRanges.h b/WebCore/html/TimeRanges.h
index 6be8c4e..2d7af25 100644
--- a/WebCore/html/TimeRanges.h
+++ b/WebCore/html/TimeRanges.h
@@ -55,6 +55,8 @@ public:
void add(float start, float end);
bool contain(float time) const;
+
+ float nearest(float time) const;
private:
TimeRanges() { }
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index b3d212a..acd15d2 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -172,6 +172,9 @@ void CanvasRenderingContext2D::setStrokeStyle(PassRefPtr<CanvasStyle> style)
if (!style)
return;
+ if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentColor(*style))
+ return;
+
if (canvas()->originClean()) {
if (CanvasPattern* pattern = style->canvasPattern()) {
if (!pattern->originClean())
@@ -184,6 +187,7 @@ void CanvasRenderingContext2D::setStrokeStyle(PassRefPtr<CanvasStyle> style)
if (!c)
return;
state().m_strokeStyle->applyStrokeColor(c);
+ state().m_unparsedStrokeColor = String();
}
CanvasStyle* CanvasRenderingContext2D::fillStyle() const
@@ -195,6 +199,9 @@ void CanvasRenderingContext2D::setFillStyle(PassRefPtr<CanvasStyle> style)
{
if (!style)
return;
+
+ if (state().m_fillStyle && state().m_fillStyle->isEquivalentColor(*style))
+ return;
if (canvas()->originClean()) {
if (CanvasPattern* pattern = style->canvasPattern()) {
@@ -208,6 +215,7 @@ void CanvasRenderingContext2D::setFillStyle(PassRefPtr<CanvasStyle> style)
if (!c)
return;
state().m_fillStyle->applyFillColor(c);
+ state().m_unparsedFillColor = String();
}
float CanvasRenderingContext2D::lineWidth() const
@@ -478,7 +486,10 @@ void CanvasRenderingContext2D::setTransform(float m11, float m12, float m21, flo
void CanvasRenderingContext2D::setStrokeColor(const String& color)
{
+ if (color == state().m_unparsedStrokeColor)
+ return;
setStrokeStyle(CanvasStyle::create(color));
+ state().m_unparsedStrokeColor = color;
}
void CanvasRenderingContext2D::setStrokeColor(float grayLevel)
@@ -508,7 +519,10 @@ void CanvasRenderingContext2D::setStrokeColor(float c, float m, float y, float k
void CanvasRenderingContext2D::setFillColor(const String& color)
{
+ if (color == state().m_unparsedFillColor)
+ return;
setFillStyle(CanvasStyle::create(color));
+ state().m_unparsedFillColor = color;
}
void CanvasRenderingContext2D::setFillColor(float grayLevel)
@@ -543,7 +557,12 @@ void CanvasRenderingContext2D::beginPath()
void CanvasRenderingContext2D::closePath()
{
- m_path.closeSubpath();
+ if (m_path.isEmpty())
+ return;
+
+ FloatRect boundRect = m_path.boundingRect();
+ if (boundRect.width() || boundRect.height())
+ m_path.closeSubpath();
}
void CanvasRenderingContext2D::moveTo(float x, float y)
@@ -561,9 +580,11 @@ void CanvasRenderingContext2D::lineTo(float x, float y)
return;
if (!state().m_invertibleCTM)
return;
+
+ FloatPoint p1 = FloatPoint(x, y);
if (!m_path.hasCurrentPoint())
- m_path.moveTo(FloatPoint(x, y));
- else
+ m_path.moveTo(p1);
+ else if (p1 != m_path.currentPoint())
m_path.addLineTo(FloatPoint(x, y));
}
@@ -575,7 +596,10 @@ void CanvasRenderingContext2D::quadraticCurveTo(float cpx, float cpy, float x, f
return;
if (!m_path.hasCurrentPoint())
m_path.moveTo(FloatPoint(cpx, cpy));
- m_path.addQuadCurveTo(FloatPoint(cpx, cpy), FloatPoint(x, y));
+
+ FloatPoint p1 = FloatPoint(x, y);
+ if (p1 != m_path.currentPoint())
+ m_path.addQuadCurveTo(FloatPoint(cpx, cpy), p1);
}
void CanvasRenderingContext2D::bezierCurveTo(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y)
@@ -586,22 +610,35 @@ void CanvasRenderingContext2D::bezierCurveTo(float cp1x, float cp1y, float cp2x,
return;
if (!m_path.hasCurrentPoint())
m_path.moveTo(FloatPoint(cp1x, cp1y));
- m_path.addBezierCurveTo(FloatPoint(cp1x, cp1y), FloatPoint(cp2x, cp2y), FloatPoint(x, y));
+
+ FloatPoint p1 = FloatPoint(x, y);
+ if (p1 != m_path.currentPoint())
+ m_path.addBezierCurveTo(FloatPoint(cp1x, cp1y), FloatPoint(cp2x, cp2y), p1);
}
-void CanvasRenderingContext2D::arcTo(float x0, float y0, float x1, float y1, float r, ExceptionCode& ec)
+void CanvasRenderingContext2D::arcTo(float x1, float y1, float x2, float y2, float r, ExceptionCode& ec)
{
ec = 0;
- if (!isfinite(x0) | !isfinite(y0) | !isfinite(x1) | !isfinite(y1) | !isfinite(r))
+ if (!isfinite(x1) | !isfinite(y1) | !isfinite(x2) | !isfinite(y2) | !isfinite(r))
return;
if (r < 0) {
ec = INDEX_SIZE_ERR;
return;
}
+
if (!state().m_invertibleCTM)
return;
- m_path.addArcTo(FloatPoint(x0, y0), FloatPoint(x1, y1), r);
+
+ FloatPoint p1 = FloatPoint(x1, y1);
+ FloatPoint p2 = FloatPoint(x2, y2);
+
+ if (!m_path.hasCurrentPoint())
+ m_path.moveTo(p1);
+ else if (p1 == m_path.currentPoint() || p1 == p2 || !r)
+ lineTo(x1, y1);
+ else
+ m_path.addArcTo(p1, p2, r);
}
void CanvasRenderingContext2D::arc(float x, float y, float r, float sa, float ea, bool anticlockwise, ExceptionCode& ec)
@@ -646,10 +683,27 @@ static bool validateRectForCanvas(float& x, float& y, float& width, float& heigh
void CanvasRenderingContext2D::rect(float x, float y, float width, float height)
{
- if (!validateRectForCanvas(x, y, width, height))
- return;
if (!state().m_invertibleCTM)
return;
+
+ if (!isfinite(x) || !isfinite(y) || !isfinite(width) || !isfinite(height))
+ return;
+
+ if (!width && !height) {
+ m_path.moveTo(FloatPoint(x, y));
+ return;
+ }
+
+ if (width < 0) {
+ width = -width;
+ x -= width;
+ }
+
+ if (height < 0) {
+ height = -height;
+ y -= height;
+ }
+
m_path.addRect(FloatRect(x, y, width, height));
}
@@ -1126,6 +1180,8 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const
if (!sourceCanvas->originClean())
canvas()->setOriginTainted();
+ sourceCanvas->makeRenderingResultsAvailable();
+
c->drawImage(buffer->image(), DeviceColorSpace, destRect, sourceRect, state().m_globalComposite);
willDraw(destRect); // This call comes after drawImage, since the buffer we draw into may be our own, and we need to make sure it is dirty.
// FIXME: Arguably willDraw should become didDraw and occur after drawing calls and not before them to avoid problems like this.
@@ -1344,7 +1400,7 @@ void CanvasRenderingContext2D::willDraw(const FloatRect& r, unsigned options)
dirtyRect = ctm.mapRect(r);
}
- if (options & CanvasWillDrawApplyShadow) {
+ if (options & CanvasWillDrawApplyShadow && alphaChannel(state().m_shadowColor)) {
// The shadow gets applied after transformation
FloatRect shadowRect(dirtyRect);
shadowRect.move(state().m_shadowOffset);
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.h b/WebCore/html/canvas/CanvasRenderingContext2D.h
index 43f3b35..2eac88d 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.h
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.h
@@ -214,6 +214,8 @@ namespace WebCore {
struct State {
State();
+ String m_unparsedStrokeColor;
+ String m_unparsedFillColor;
RefPtr<CanvasStyle> m_strokeStyle;
RefPtr<CanvasStyle> m_fillStyle;
float m_lineWidth;
diff --git a/WebCore/html/canvas/CanvasStyle.cpp b/WebCore/html/canvas/CanvasStyle.cpp
index 67e8201..1ae5236 100644
--- a/WebCore/html/canvas/CanvasStyle.cpp
+++ b/WebCore/html/canvas/CanvasStyle.cpp
@@ -33,6 +33,7 @@
#include "CanvasGradient.h"
#include "CanvasPattern.h"
#include "GraphicsContext.h"
+#include <wtf/Assertions.h>
#include <wtf/PassRefPtr.h>
#if PLATFORM(CG)
@@ -120,6 +121,29 @@ PassRefPtr<CanvasStyle> CanvasStyle::create(PassRefPtr<CanvasPattern> pattern)
return adoptRef(new CanvasStyle(pattern));
}
+bool CanvasStyle::isEquivalentColor(const CanvasStyle& other) const
+{
+ if (m_type != other.m_type)
+ return false;
+
+ switch (m_type) {
+ case CanvasStyle::RGBA:
+ return m_rgba == other.m_rgba;
+ case CanvasStyle::CMYKA:
+ return m_cmyka.c == other.m_cmyka.c
+ && m_cmyka.m == other.m_cmyka.m
+ && m_cmyka.y == other.m_cmyka.y
+ && m_cmyka.k == other.m_cmyka.k
+ && m_cmyka.a == other.m_cmyka.a;
+ case CanvasStyle::Gradient:
+ case CanvasStyle::ImagePattern:
+ return false;
+ }
+
+ ASSERT_NOT_REACHED();
+ return false;
+}
+
void CanvasStyle::applyStrokeColor(GraphicsContext* context)
{
if (!context)
diff --git a/WebCore/html/canvas/CanvasStyle.h b/WebCore/html/canvas/CanvasStyle.h
index 18e55cf..76ba6ef 100644
--- a/WebCore/html/canvas/CanvasStyle.h
+++ b/WebCore/html/canvas/CanvasStyle.h
@@ -55,6 +55,8 @@ namespace WebCore {
void applyFillColor(GraphicsContext*);
void applyStrokeColor(GraphicsContext*);
+ bool isEquivalentColor(const CanvasStyle&) const;
+
private:
CanvasStyle(RGBA32 rgba);
CanvasStyle(float grayLevel);
diff --git a/WebCore/html/canvas/Float32Array.idl b/WebCore/html/canvas/Float32Array.idl
index 651e74f..5a939ca 100644
--- a/WebCore/html/canvas/Float32Array.idl
+++ b/WebCore/html/canvas/Float32Array.idl
@@ -33,7 +33,8 @@ module html {
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
- CustomToJS
+ CustomToJS,
+ DontCheckEnums
] Float32Array : ArrayBufferView {
const unsigned int BYTES_PER_ELEMENT = 4;
diff --git a/WebCore/html/canvas/Int16Array.idl b/WebCore/html/canvas/Int16Array.idl
index 095611b..02417f8 100644
--- a/WebCore/html/canvas/Int16Array.idl
+++ b/WebCore/html/canvas/Int16Array.idl
@@ -32,7 +32,8 @@ module html {
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
- CustomToJS
+ CustomToJS,
+ DontCheckEnums
] Int16Array : ArrayBufferView {
const unsigned int BYTES_PER_ELEMENT = 2;
diff --git a/WebCore/html/canvas/Int32Array.idl b/WebCore/html/canvas/Int32Array.idl
index 9d1e8ee..6977d00 100644
--- a/WebCore/html/canvas/Int32Array.idl
+++ b/WebCore/html/canvas/Int32Array.idl
@@ -33,7 +33,8 @@ module html {
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
- CustomToJS
+ CustomToJS,
+ DontCheckEnums
] Int32Array : ArrayBufferView {
const unsigned int BYTES_PER_ELEMENT = 4;
diff --git a/WebCore/html/canvas/Int8Array.idl b/WebCore/html/canvas/Int8Array.idl
index 43c83f5..4dba9e4 100644
--- a/WebCore/html/canvas/Int8Array.idl
+++ b/WebCore/html/canvas/Int8Array.idl
@@ -33,7 +33,8 @@ module html {
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
- CustomToJS
+ CustomToJS,
+ DontCheckEnums
] Int8Array : ArrayBufferView {
const unsigned int BYTES_PER_ELEMENT = 1;
diff --git a/WebCore/html/canvas/Uint16Array.idl b/WebCore/html/canvas/Uint16Array.idl
index 4c369a0..de1e5e0 100644
--- a/WebCore/html/canvas/Uint16Array.idl
+++ b/WebCore/html/canvas/Uint16Array.idl
@@ -33,7 +33,8 @@ module html {
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
- CustomToJS
+ CustomToJS,
+ DontCheckEnums
] Uint16Array : ArrayBufferView {
const unsigned int BYTES_PER_ELEMENT = 2;
diff --git a/WebCore/html/canvas/Uint32Array.idl b/WebCore/html/canvas/Uint32Array.idl
index 25f5b71..ce632dd 100644
--- a/WebCore/html/canvas/Uint32Array.idl
+++ b/WebCore/html/canvas/Uint32Array.idl
@@ -33,7 +33,8 @@ module html {
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
- CustomToJS
+ CustomToJS,
+ DontCheckEnums
] Uint32Array : ArrayBufferView {
const unsigned int BYTES_PER_ELEMENT = 4;
diff --git a/WebCore/html/canvas/Uint8Array.idl b/WebCore/html/canvas/Uint8Array.idl
index 76b8cdd..c520844 100644
--- a/WebCore/html/canvas/Uint8Array.idl
+++ b/WebCore/html/canvas/Uint8Array.idl
@@ -33,7 +33,8 @@ module html {
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
- CustomToJS
+ CustomToJS,
+ DontCheckEnums
] Uint8Array : ArrayBufferView {
const unsigned int BYTES_PER_ELEMENT = 1;
diff --git a/WebCore/html/canvas/WebGLBuffer.cpp b/WebCore/html/canvas/WebGLBuffer.cpp
index e71a12b..e449052 100644
--- a/WebCore/html/canvas/WebGLBuffer.cpp
+++ b/WebCore/html/canvas/WebGLBuffer.cpp
@@ -74,6 +74,35 @@ bool WebGLBuffer::associateBufferData(int size)
return false;
}
+bool WebGLBuffer::associateBufferData(ArrayBuffer* array)
+{
+ if (!m_target)
+ return false;
+ if (!array)
+ return false;
+
+ if (m_target == GraphicsContext3D::ELEMENT_ARRAY_BUFFER) {
+ clearCachedMaxIndices();
+ m_byteLength = array->byteLength();
+ // We must always clone the incoming data because client-side
+ // modifications without calling bufferData or bufferSubData
+ // must never be able to change the validation results.
+ m_elementArrayBuffer = ArrayBuffer::create(array);
+ if (!m_elementArrayBuffer) {
+ m_byteLength = 0;
+ return false;
+ }
+ return true;
+ }
+
+ if (m_target == GraphicsContext3D::ARRAY_BUFFER) {
+ m_byteLength = array->byteLength();
+ return true;
+ }
+
+ return false;
+}
+
bool WebGLBuffer::associateBufferData(ArrayBufferView* array)
{
if (!m_target)
@@ -103,6 +132,39 @@ bool WebGLBuffer::associateBufferData(ArrayBufferView* array)
return false;
}
+bool WebGLBuffer::associateBufferSubData(long offset, ArrayBuffer* array)
+{
+ if (!m_target)
+ return false;
+ if (!array)
+ return false;
+
+ if (m_target == GraphicsContext3D::ELEMENT_ARRAY_BUFFER) {
+ clearCachedMaxIndices();
+
+ // We need to protect against integer overflow with these tests
+ if (offset < 0)
+ return false;
+
+ unsigned long uoffset = static_cast<unsigned long>(offset);
+ if (uoffset > m_byteLength || array->byteLength() > m_byteLength - uoffset)
+ return false;
+
+ if (!m_elementArrayBuffer)
+ return false;
+
+ memcpy(static_cast<unsigned char*>(m_elementArrayBuffer->data()) + offset,
+ static_cast<unsigned char*>(array->data()),
+ array->byteLength());
+ return true;
+ }
+
+ if (m_target == GraphicsContext3D::ARRAY_BUFFER)
+ return array->byteLength() + offset <= m_byteLength;
+
+ return false;
+}
+
bool WebGLBuffer::associateBufferSubData(long offset, ArrayBufferView* array)
{
if (!m_target)
diff --git a/WebCore/html/canvas/WebGLBuffer.h b/WebCore/html/canvas/WebGLBuffer.h
index e1fec47..1280cf9 100644
--- a/WebCore/html/canvas/WebGLBuffer.h
+++ b/WebCore/html/canvas/WebGLBuffer.h
@@ -41,7 +41,9 @@ namespace WebCore {
static PassRefPtr<WebGLBuffer> create(WebGLRenderingContext*);
bool associateBufferData(int size);
+ bool associateBufferData(ArrayBuffer* array);
bool associateBufferData(ArrayBufferView* array);
+ bool associateBufferSubData(long offset, ArrayBuffer* array);
bool associateBufferSubData(long offset, ArrayBufferView* array);
unsigned byteLength() const;
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index a82a4ac4..f567ac8 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -115,12 +115,12 @@ WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement* passedCanvas, Pa
m_context->getIntegerv(GraphicsContext3D::IMPLEMENTATION_COLOR_READ_TYPE, &implementationColorReadType);
m_implementationColorReadType = implementationColorReadType;
- int maxTextureSize = 0;
- m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &maxTextureSize);
- m_maxTextureSize = maxTextureSize;
- int maxCubeMapTextureSize = 0;
- m_context->getIntegerv(GraphicsContext3D::MAX_CUBE_MAP_TEXTURE_SIZE, &maxCubeMapTextureSize);
- m_maxCubeMapTextureSize = maxCubeMapTextureSize;
+ m_maxTextureSize = 0;
+ m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &m_maxTextureSize);
+ m_maxTextureLevel = WebGLTexture::computeLevelCount(m_maxTextureSize, m_maxTextureSize);
+ m_maxCubeMapTextureSize = 0;
+ m_context->getIntegerv(GraphicsContext3D::MAX_CUBE_MAP_TEXTURE_SIZE, &m_maxCubeMapTextureSize);
+ m_maxCubeMapTextureLevel = WebGLTexture::computeLevelCount(m_maxCubeMapTextureSize, m_maxCubeMapTextureSize);
if (!isGLES2Compliant()) {
createFallbackBlackTextures1x1();
@@ -141,17 +141,23 @@ void WebGLRenderingContext::markContextChanged()
RenderBox* renderBox = canvas()->renderBox();
if (renderBox && renderBox->hasLayer() && renderBox->layer()->hasAcceleratedCompositing())
renderBox->layer()->rendererContentChanged();
- else {
#endif
- if (!m_markedCanvasDirty) {
- // Make sure the canvas's image buffer is allocated.
- canvas()->buffer();
- canvas()->willDraw(FloatRect(0, 0, canvas()->width(), canvas()->height()));
- m_markedCanvasDirty = true;
- }
-#if USE(ACCELERATED_COMPOSITING)
+ if (!m_markedCanvasDirty) {
+ // Make sure the canvas's image buffer is allocated.
+ canvas()->buffer();
+ canvas()->willDraw(FloatRect(0, 0, canvas()->width(), canvas()->height()));
+ m_markedCanvasDirty = true;
}
-#endif
+}
+
+bool WebGLRenderingContext::paintRenderingResultsToCanvas()
+{
+ if (m_markedCanvasDirty) {
+ m_markedCanvasDirty = false;
+ m_context->paintRenderingResultsToCanvas(this);
+ return true;
+ }
+ return false;
}
void WebGLRenderingContext::beginPaint()
@@ -293,17 +299,20 @@ void WebGLRenderingContext::bindTexture(unsigned long target, WebGLTexture* text
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
- if (target == GraphicsContext3D::TEXTURE_2D)
+ int maxLevel = 0;
+ if (target == GraphicsContext3D::TEXTURE_2D) {
m_textureUnits[m_activeTextureUnit].m_texture2DBinding = texture;
- else if (target == GraphicsContext3D::TEXTURE_CUBE_MAP)
+ maxLevel = m_maxTextureLevel;
+ } else if (target == GraphicsContext3D::TEXTURE_CUBE_MAP) {
m_textureUnits[m_activeTextureUnit].m_textureCubeMapBinding = texture;
- else {
+ maxLevel = m_maxCubeMapTextureLevel;
+ } else {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
return;
}
m_context->bindTexture(target, texture);
if (!isGLES2Compliant() && texture)
- texture->setTarget(target);
+ texture->setTarget(target, maxLevel);
cleanupAfterGraphicsCall(false);
}
@@ -349,22 +358,11 @@ void WebGLRenderingContext::blendFuncSeparate(unsigned long srcRGB, unsigned lon
void WebGLRenderingContext::bufferData(unsigned long target, int size, unsigned long usage, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
- if (!isGLES2Compliant()) {
- if (!validateBufferDataUsage(usage))
- return;
- }
- if (target == GraphicsContext3D::ELEMENT_ARRAY_BUFFER && m_boundElementArrayBuffer) {
- if (!m_boundElementArrayBuffer->associateBufferData(size)) {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
- return;
- }
- } else if (target == GraphicsContext3D::ARRAY_BUFFER && m_boundArrayBuffer) {
- if (!m_boundArrayBuffer->associateBufferData(size)) {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
- return;
- }
- } else {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+ WebGLBuffer* buffer = validateBufferDataParameters(target, usage);
+ if (!buffer)
+ return;
+ if (!buffer->associateBufferData(size)) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
@@ -372,25 +370,29 @@ void WebGLRenderingContext::bufferData(unsigned long target, int size, unsigned
cleanupAfterGraphicsCall(false);
}
-void WebGLRenderingContext::bufferData(unsigned long target, ArrayBufferView* data, unsigned long usage, ExceptionCode& ec)
+void WebGLRenderingContext::bufferData(unsigned long target, ArrayBuffer* data, unsigned long usage, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
- if (!isGLES2Compliant()) {
- if (!validateBufferDataUsage(usage))
- return;
+ WebGLBuffer* buffer = validateBufferDataParameters(target, usage);
+ if (!buffer)
+ return;
+ if (!buffer->associateBufferData(data)) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+ return;
}
- if (target == GraphicsContext3D::ELEMENT_ARRAY_BUFFER && m_boundElementArrayBuffer) {
- if (!m_boundElementArrayBuffer->associateBufferData(data)) {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
- return;
- }
- } else if (target == GraphicsContext3D::ARRAY_BUFFER && m_boundArrayBuffer) {
- if (!m_boundArrayBuffer->associateBufferData(data)) {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
- return;
- }
- } else {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+
+ m_context->bufferData(target, data, usage);
+ cleanupAfterGraphicsCall(false);
+}
+
+void WebGLRenderingContext::bufferData(unsigned long target, ArrayBufferView* data, unsigned long usage, ExceptionCode& ec)
+{
+ UNUSED_PARAM(ec);
+ WebGLBuffer* buffer = validateBufferDataParameters(target, usage);
+ if (!buffer)
+ return;
+ if (!buffer->associateBufferData(data)) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
@@ -398,21 +400,29 @@ void WebGLRenderingContext::bufferData(unsigned long target, ArrayBufferView* da
cleanupAfterGraphicsCall(false);
}
+void WebGLRenderingContext::bufferSubData(unsigned long target, long offset, ArrayBuffer* data, ExceptionCode& ec)
+{
+ UNUSED_PARAM(ec);
+ WebGLBuffer* buffer = validateBufferDataParameters(target, GraphicsContext3D::STATIC_DRAW);
+ if (!buffer)
+ return;
+ if (!buffer->associateBufferSubData(offset, data)) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+ return;
+ }
+
+ m_context->bufferSubData(target, offset, data);
+ cleanupAfterGraphicsCall(false);
+}
+
void WebGLRenderingContext::bufferSubData(unsigned long target, long offset, ArrayBufferView* data, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
- if (target == GraphicsContext3D::ELEMENT_ARRAY_BUFFER && m_boundElementArrayBuffer) {
- if (!m_boundElementArrayBuffer->associateBufferSubData(offset, data)) {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
- return;
- }
- } else if (target == GraphicsContext3D::ARRAY_BUFFER && m_boundArrayBuffer) {
- if (!m_boundArrayBuffer->associateBufferSubData(offset, data)) {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
- return;
- }
- } else {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+ WebGLBuffer* buffer = validateBufferDataParameters(target, GraphicsContext3D::STATIC_DRAW);
+ if (!buffer)
+ return;
+ if (!buffer->associateBufferSubData(offset, data)) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
@@ -507,10 +517,8 @@ void WebGLRenderingContext::copyTexImage2D(unsigned long target, long level, uns
// FIXME: if the framebuffer is not complete, none of the below should be executed.
WebGLTexture* tex = getTextureBinding(target);
if (!isGLES2Compliant()) {
- if (tex && !level) // only for level 0
- tex->setSize(target, width, height);
if (tex)
- tex->setInternalFormat(internalformat);
+ tex->setLevelInfo(target, level, internalformat, width, height, GraphicsContext3D::UNSIGNED_BYTE);
}
if (m_framebufferBinding && tex)
m_framebufferBinding->onAttachedObjectChange(tex);
@@ -1082,18 +1090,22 @@ void WebGLRenderingContext::frontFace(unsigned long mode)
void WebGLRenderingContext::generateMipmap(unsigned long target)
{
+ RefPtr<WebGLTexture> tex;
if (!isGLES2Compliant()) {
- RefPtr<WebGLTexture> tex = 0;
if (target == GraphicsContext3D::TEXTURE_2D)
tex = m_textureUnits[m_activeTextureUnit].m_texture2DBinding;
else if (target == GraphicsContext3D::TEXTURE_CUBE_MAP)
tex = m_textureUnits[m_activeTextureUnit].m_textureCubeMapBinding;
- if (tex && tex->isNPOT()) {
+ if (tex && !tex->canGenerateMipmaps()) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
}
m_context->generateMipmap(target);
+ if (!isGLES2Compliant()) {
+ if (tex)
+ tex->generateMipmapLevelInfo();
+ }
cleanupAfterGraphicsCall(false);
}
@@ -1337,7 +1349,8 @@ WebGLGetInfo WebGLRenderingContext::getParameter(unsigned long pname, ExceptionC
case GraphicsContext3D::MAX_VIEWPORT_DIMS:
return getWebGLIntArrayParameter(pname);
case GraphicsContext3D::NUM_COMPRESSED_TEXTURE_FORMATS:
- return getLongParameter(pname);
+ // WebGL 1.0 specifies that there are no compressed texture formats.
+ return WebGLGetInfo(static_cast<long>(0));
case GraphicsContext3D::NUM_SHADER_BINARY_FORMATS:
// FIXME: should we always return 0 for this?
return getLongParameter(pname);
@@ -2082,10 +2095,8 @@ void WebGLRenderingContext::texImage2DBase(unsigned target, unsigned level, unsi
border, format, type, pixels);
WebGLTexture* tex = getTextureBinding(target);
if (!isGLES2Compliant()) {
- if (tex && !level) // only for level 0
- tex->setSize(target, width, height);
if (tex)
- tex->setInternalFormat(internalformat);
+ tex->setLevelInfo(target, level, internalformat, width, height, type);
}
if (m_framebufferBinding && tex)
m_framebufferBinding->onAttachedObjectChange(tex);
@@ -3369,9 +3380,6 @@ bool WebGLRenderingContext::validateTexFuncParameters(unsigned long target, long
if (!validateTexFuncFormatAndType(format, type))
return false;
- if (isGLES2Compliant())
- return true;
-
if (width < 0 || height < 0 || level < 0) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return false;
@@ -3379,7 +3387,7 @@ bool WebGLRenderingContext::validateTexFuncParameters(unsigned long target, long
switch (target) {
case GraphicsContext3D::TEXTURE_2D:
- if (width > m_maxTextureSize || height > m_maxTextureSize) {
+ if (width > m_maxTextureSize || height > m_maxTextureSize || level > m_maxTextureLevel) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return false;
}
@@ -3390,7 +3398,7 @@ bool WebGLRenderingContext::validateTexFuncParameters(unsigned long target, long
case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Y:
case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Z:
case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Z:
- if (width != height || width > m_maxCubeMapTextureSize) {
+ if (width != height || width > m_maxCubeMapTextureSize || level > m_maxCubeMapTextureLevel) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return false;
}
@@ -3592,16 +3600,32 @@ bool WebGLRenderingContext::validateUniformMatrixParameters(const WebGLUniformLo
return true;
}
-bool WebGLRenderingContext::validateBufferDataUsage(unsigned long usage)
+WebGLBuffer* WebGLRenderingContext::validateBufferDataParameters(unsigned long target, unsigned long usage)
{
+ WebGLBuffer* buffer = 0;
+ switch (target) {
+ case GraphicsContext3D::ELEMENT_ARRAY_BUFFER:
+ buffer = m_boundElementArrayBuffer.get();
+ break;
+ case GraphicsContext3D::ARRAY_BUFFER:
+ buffer = m_boundArrayBuffer.get();
+ break;
+ default:
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+ return 0;
+ }
+ if (!buffer) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return 0;
+ }
switch (usage) {
case GraphicsContext3D::STREAM_DRAW:
case GraphicsContext3D::STATIC_DRAW:
case GraphicsContext3D::DYNAMIC_DRAW:
- return true;
+ return buffer;
}
m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
- return false;
+ return 0;
}
void WebGLRenderingContext::vertexAttribfImpl(unsigned long index, int expectedSize, float v0, float v1, float v2, float v3)
diff --git a/WebCore/html/canvas/WebGLRenderingContext.h b/WebCore/html/canvas/WebGLRenderingContext.h
index d03d972..fa9ffdb 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/WebCore/html/canvas/WebGLRenderingContext.h
@@ -77,7 +77,9 @@ class WebKitCSSMatrix;
void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha);
void bufferData(unsigned long target, int size, unsigned long usage, ExceptionCode&);
+ void bufferData(unsigned long target, ArrayBuffer* data, unsigned long usage, ExceptionCode&);
void bufferData(unsigned long target, ArrayBufferView* data, unsigned long usage, ExceptionCode&);
+ void bufferSubData(unsigned long target, long offset, ArrayBuffer* data, ExceptionCode&);
void bufferSubData(unsigned long target, long offset, ArrayBufferView* data, ExceptionCode&);
unsigned long checkFramebufferStatus(unsigned long target);
@@ -304,6 +306,10 @@ class WebKitCSSMatrix;
void reshape(int width, int height);
+ // Return value true indicates canvas is updated during the call,
+ // false indicates no updates.
+ bool paintRenderingResultsToCanvas();
+
// Helpers for notification about paint events.
void beginPaint();
void endPaint();
@@ -410,8 +416,10 @@ class WebKitCSSMatrix;
RefPtr<WebGLTexture> m_blackTexture2D;
RefPtr<WebGLTexture> m_blackTextureCubeMap;
- long m_maxTextureSize;
- long m_maxCubeMapTextureSize;
+ int m_maxTextureSize;
+ int m_maxCubeMapTextureSize;
+ int m_maxTextureLevel;
+ int m_maxCubeMapTextureLevel;
int m_packAlignment;
int m_unpackAlignment;
@@ -501,8 +509,9 @@ class WebKitCSSMatrix;
bool validateUniformMatrixParameters(const WebGLUniformLocation* location, bool transpose, Float32Array* v, int mod);
bool validateUniformMatrixParameters(const WebGLUniformLocation* location, bool transpose, void* v, int size, int mod);
- // Helper function to validate usage for bufferData.
- bool validateBufferDataUsage(unsigned long);
+ // Helper function to validate parameters for bufferData.
+ // Return the current bound buffer to target, or 0 if parameters are invalid.
+ WebGLBuffer* validateBufferDataParameters(unsigned long target, unsigned long usage);
// Helper functions for vertexAttribNf{v}.
void vertexAttribfImpl(unsigned long index, int expectedSize, float v0, float v1, float v2, float v3);
diff --git a/WebCore/html/canvas/WebGLRenderingContext.idl b/WebCore/html/canvas/WebGLRenderingContext.idl
index 1ea4c6d..654c7aa 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.idl
+++ b/WebCore/html/canvas/WebGLRenderingContext.idl
@@ -28,7 +28,8 @@ module html {
interface [
Conditional=3D_CANVAS,
InterfaceUUID=98fb48ae-7216-489c-862b-8e1217fc4443,
- ImplementationUUID=ab4f0781-152f-450e-9546-5b3987491a54
+ ImplementationUUID=ab4f0781-152f-450e-9546-5b3987491a54,
+ DontCheckEnums
] WebGLRenderingContext : CanvasRenderingContext {
/* ClearBufferMask */
@@ -477,9 +478,10 @@ module html {
void blendEquationSeparate(in unsigned long modeRGB, in unsigned long modeAlpha);
void blendFunc(in unsigned long sfactor, in unsigned long dfactor);
void blendFuncSeparate(in unsigned long srcRGB, in unsigned long dstRGB, in unsigned long srcAlpha, in unsigned long dstAlpha);
-
+ void bufferData(in unsigned long target, in ArrayBuffer data, in unsigned long usage) raises (DOMException);
void bufferData(in unsigned long target, in ArrayBufferView data, in unsigned long usage) raises (DOMException);
void bufferData(in unsigned long target, in long size, in unsigned long usage) raises (DOMException);
+ void bufferSubData(in unsigned long target, in long offset, in ArrayBuffer data) raises (DOMException);
void bufferSubData(in unsigned long target, in long offset, in ArrayBufferView data) raises (DOMException);
unsigned long checkFramebufferStatus(in unsigned long target);
diff --git a/WebCore/html/canvas/WebGLTexture.cpp b/WebCore/html/canvas/WebGLTexture.cpp
index 1cc7d5d..d832038 100644
--- a/WebCore/html/canvas/WebGLTexture.cpp
+++ b/WebCore/html/canvas/WebGLTexture.cpp
@@ -45,32 +45,39 @@ WebGLTexture::WebGLTexture(WebGLRenderingContext* ctx)
, m_magFilter(GraphicsContext3D::LINEAR)
, m_wrapS(GraphicsContext3D::REPEAT)
, m_wrapT(GraphicsContext3D::REPEAT)
- , m_internalFormat(0)
, m_isNPOT(false)
+ , m_isComplete(false)
, m_needToUseBlackTexture(false)
{
setObject(context()->graphicsContext3D()->createTexture());
- for (int ii = 0; ii < 6; ++ii) {
- m_width[ii] = 0;
- m_height[ii] = 0;
- }
}
-void WebGLTexture::setTarget(unsigned long target)
+void WebGLTexture::setTarget(unsigned long target, int maxLevel)
{
+ if (!object())
+ return;
// Target is finalized the first time bindTexture() is called.
if (m_target)
return;
switch (target) {
case GraphicsContext3D::TEXTURE_2D:
+ m_target = target;
+ m_info.resize(1);
+ m_info[0].resize(maxLevel);
+ break;
case GraphicsContext3D::TEXTURE_CUBE_MAP:
m_target = target;
+ m_info.resize(6);
+ for (int ii = 0; ii < 6; ++ii)
+ m_info[ii].resize(maxLevel);
break;
}
}
void WebGLTexture::setParameteri(unsigned long pname, int param)
{
+ if (!object() || !m_target)
+ return;
switch (pname) {
case GraphicsContext3D::TEXTURE_MIN_FILTER:
switch (param) {
@@ -113,88 +120,195 @@ void WebGLTexture::setParameteri(unsigned long pname, int param)
default:
return;
}
- updateNPOTStates();
+ update();
}
void WebGLTexture::setParameterf(unsigned long pname, float param)
{
+ if (!object() || !m_target)
+ return;
int iparam = static_cast<int>(param);
setParameteri(pname, iparam);
}
-void WebGLTexture::setSize(unsigned long target, unsigned width, unsigned height)
+void WebGLTexture::setLevelInfo(unsigned long target, int level, unsigned long internalFormat, int width, int height, unsigned long type)
{
- if (!width || !height)
+ if (!object() || !m_target)
return;
- int iTarget = -1;
+ // We assume level, internalFormat, width, height, and type have all been
+ // validated already.
+ int index = mapTargetToIndex(target);
+ if (index < 0)
+ return;
+ m_info[index][level].setInfo(internalFormat, width, height, type);
+ update();
+}
+
+void WebGLTexture::generateMipmapLevelInfo()
+{
+ if (!object() || !m_target)
+ return;
+ if (!canGenerateMipmaps())
+ return;
+ if (m_isComplete)
+ return;
+ for (size_t ii = 0; ii < m_info.size(); ++ii) {
+ const LevelInfo& info0 = m_info[ii][0];
+ int width = info0.width;
+ int height = info0.height;
+ int levelCount = computeLevelCount(width, height);
+ for (int level = 1; level < levelCount; ++level) {
+ width = std::max(1, width >> 1);
+ height = std::max(1, height >> 1);
+ LevelInfo& info = m_info[ii][level];
+ info.setInfo(info0.internalFormat, width, height, info0.type);
+ }
+ }
+ m_isComplete = true;
+}
+
+unsigned long WebGLTexture::getInternalFormat() const
+{
+ if (!object() || !m_target)
+ return 0;
+ return m_info[0][0].internalFormat;
+}
+
+bool WebGLTexture::isNPOT(unsigned width, unsigned height)
+{
+ if (!width || !height)
+ return false;
+ if ((width & (width - 1)) || (height & (height - 1)))
+ return true;
+ return false;
+}
+
+bool WebGLTexture::isNPOT() const
+{
+ if (!object())
+ return false;
+ return m_isNPOT;
+}
+
+bool WebGLTexture::needToUseBlackTexture() const
+{
+ if (!object())
+ return false;
+ return m_needToUseBlackTexture;
+}
+
+void WebGLTexture::_deleteObject(Platform3DObject object)
+{
+ context()->graphicsContext3D()->deleteTexture(object);
+}
+
+int WebGLTexture::mapTargetToIndex(unsigned long target)
+{
if (m_target == GraphicsContext3D::TEXTURE_2D) {
if (target == GraphicsContext3D::TEXTURE_2D)
- iTarget = 0;
- } else if (m_target == GraphicsContext3D::TEXTURE_CUBE_MAP && width == height) {
+ return 0;
+ } else if (m_target == GraphicsContext3D::TEXTURE_CUBE_MAP) {
switch (target) {
case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_X:
- iTarget = 0;
- break;
+ return 0;
case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_X:
- iTarget = 1;
- break;
+ return 1;
case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Y:
- iTarget = 2;
- break;
+ return 2;
case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Y:
- iTarget = 3;
- break;
+ return 3;
case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Z:
- iTarget = 4;
- break;
+ return 4;
case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Z:
- iTarget = 5;
- break;
+ return 5;
}
}
- if (iTarget < 0)
- return;
- m_width[iTarget] = width;
- m_height[iTarget] = height;
- updateNPOTStates();
+ return -1;
}
-bool WebGLTexture::isNPOT(unsigned width, unsigned height)
+bool WebGLTexture::canGenerateMipmaps()
{
- if (!width || !height)
+ if (isNPOT())
return false;
- if ((width & (width - 1)) || (height & (height - 1)))
- return true;
- return false;
+ const LevelInfo& first = m_info[0][0];
+ for (size_t ii = 0; ii < m_info.size(); ++ii) {
+ const LevelInfo& info = m_info[ii][0];
+ if (!info.valid
+ || info.width != first.width || info.height != first.height
+ || info.internalFormat != first.internalFormat || info.type != first.type)
+ return false;
+ }
+ return true;
}
-void WebGLTexture::_deleteObject(Platform3DObject object)
+int WebGLTexture::computeLevelCount(int width, int height)
{
- context()->graphicsContext3D()->deleteTexture(object);
+ // return 1 + log2Floor(std::max(width, height));
+ int n = std::max(width, height);
+ if (n <= 0)
+ return 0;
+ int log = 0;
+ int value = n;
+ for (int ii = 4; ii >= 0; --ii) {
+ int shift = (1 << ii);
+ int x = (value >> shift);
+ if (x) {
+ value = x;
+ log += shift;
+ }
+ }
+ ASSERT(value == 1);
+ return log + 1;
}
-void WebGLTexture::updateNPOTStates()
+void WebGLTexture::update()
{
- int numTargets = 0;
- if (m_target == GraphicsContext3D::TEXTURE_2D)
- numTargets = 1;
- else if (m_target == GraphicsContext3D::TEXTURE_CUBE_MAP)
- numTargets = 6;
m_isNPOT = false;
- unsigned w0 = m_width[0], h0 = m_height[0];
- for (int ii = 0; ii < numTargets; ++ii) {
- if (ii && (!m_width[ii] || !m_height[ii] || m_width[ii] != w0 || m_height[ii] != h0)) {
- // We only set NPOT for complete cube map textures.
- m_isNPOT = false;
+ for (size_t ii = 0; ii < m_info.size(); ++ii) {
+ if (isNPOT(m_info[ii][0].width, m_info[ii][0].height)) {
+ m_isNPOT = true;
break;
}
- if (isNPOT(m_width[ii], m_height[ii]))
- m_isNPOT = true;
}
+ m_isComplete = true;
+ const LevelInfo& first = m_info[0][0];
+ int levelCount = computeLevelCount(first.width, first.height);
+ if (levelCount < 1)
+ m_isComplete = false;
+ else {
+ for (size_t ii = 0; ii < m_info.size() && m_isComplete; ++ii) {
+ const LevelInfo& info0 = m_info[ii][0];
+ if (!info0.valid
+ || info0.width != first.width || info0.height != first.height
+ || info0.internalFormat != first.internalFormat || info0.type != first.type) {
+ m_isComplete = false;
+ break;
+ }
+ int width = info0.width;
+ int height = info0.height;
+ for (int level = 1; level < levelCount; ++level) {
+ width = std::max(1, width >> 1);
+ height = std::max(1, height >> 1);
+ const LevelInfo& info = m_info[ii][level];
+ if (!info.valid
+ || info.width != width || info.height != height
+ || info.internalFormat != info0.internalFormat || info.type != info0.type) {
+ m_isComplete = false;
+ break;
+ }
+
+ }
+ }
+ }
+
m_needToUseBlackTexture = false;
+ // NPOT
if (m_isNPOT && ((m_minFilter != GraphicsContext3D::NEAREST && m_minFilter != GraphicsContext3D::LINEAR)
|| m_wrapS != GraphicsContext3D::CLAMP_TO_EDGE || m_wrapT != GraphicsContext3D::CLAMP_TO_EDGE))
m_needToUseBlackTexture = true;
+ // Completeness
+ if (!m_isComplete && m_minFilter != GraphicsContext3D::NEAREST && m_minFilter != GraphicsContext3D::LINEAR)
+ m_needToUseBlackTexture = true;
}
}
diff --git a/WebCore/html/canvas/WebGLTexture.h b/WebCore/html/canvas/WebGLTexture.h
index 4d16b59..d4a32f0 100644
--- a/WebCore/html/canvas/WebGLTexture.h
+++ b/WebCore/html/canvas/WebGLTexture.h
@@ -30,6 +30,7 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
namespace WebCore {
@@ -47,19 +48,26 @@ namespace WebCore {
cubeMapRWrapModeInitialized = initialized;
}
- void setTarget(unsigned long);
+ void setTarget(unsigned long target, int maxLevel);
void setParameteri(unsigned long pname, int param);
void setParameterf(unsigned long pname, float param);
- void setSize(unsigned long target, unsigned width, unsigned height);
- void setInternalFormat(unsigned long internalformat) { m_internalFormat = internalformat; }
- unsigned long getInternalFormat() const { return m_internalFormat; }
+ void setLevelInfo(unsigned long target, int level, unsigned long internalFormat, int width, int height, unsigned long type);
+ bool canGenerateMipmaps();
+ // Generate all level information.
+ void generateMipmapLevelInfo();
+
+ unsigned long getInternalFormat() const;
+
+ // Whether width/height is NotPowerOfTwo.
static bool isNPOT(unsigned, unsigned);
- bool isNPOT() const { return m_isNPOT; }
+ bool isNPOT() const;
// Determine if texture sampling should always return [0, 0, 0, 1] (OpenGL ES 2.0 Sec 3.8.2).
- bool needToUseBlackTexture() const { return m_needToUseBlackTexture; }
+ bool needToUseBlackTexture() const;
+
+ static int computeLevelCount(int width, int height);
protected:
WebGLTexture(WebGLRenderingContext*);
@@ -69,7 +77,9 @@ namespace WebCore {
private:
virtual bool isTexture() const { return true; }
- void updateNPOTStates();
+ void update();
+
+ int mapTargetToIndex(unsigned long);
bool cubeMapRWrapModeInitialized;
@@ -80,12 +90,37 @@ namespace WebCore {
int m_wrapS;
int m_wrapT;
- unsigned long m_internalFormat;
-
- unsigned m_width[6];
- unsigned m_height[6];
+ class LevelInfo {
+ public:
+ LevelInfo()
+ : valid(false)
+ , internalFormat(0)
+ , width(0)
+ , height(0)
+ , type(0)
+ {
+ }
+
+ void setInfo(unsigned long internalFmt, int w, int h, unsigned long tp)
+ {
+ valid = true;
+ internalFormat = internalFmt;
+ width = w;
+ height = h;
+ type = tp;
+ }
+
+ bool valid;
+ unsigned long internalFormat;
+ int width;
+ int height;
+ unsigned long type;
+ };
+
+ Vector<Vector<LevelInfo> > m_info;
bool m_isNPOT;
+ bool m_isComplete;
bool m_needToUseBlackTexture;
};
diff --git a/WebCore/inspector/CodeGeneratorInspector.pm b/WebCore/inspector/CodeGeneratorInspector.pm
index cadfaac..afaddec 100644
--- a/WebCore/inspector/CodeGeneratorInspector.pm
+++ b/WebCore/inspector/CodeGeneratorInspector.pm
@@ -6,6 +6,7 @@ package CodeGeneratorInspector;
use strict;
+use Class::Struct;
use File::stat;
my %typeTransform;
@@ -21,56 +22,56 @@ $typeTransform{"Object"} = {
"retVal" => "PassRefPtr<InspectorObject>",
"forward" => "InspectorObject",
"header" => "InspectorValues.h",
- "push" => "push"
+ "accessorSuffix" => ""
};
$typeTransform{"Array"} = {
"param" => "PassRefPtr<InspectorArray>",
"retVal" => "PassRefPtr<InspectorArray>",
"forward" => "InspectorArray",
"header" => "InspectorValues.h",
- "push" => "push"
+ "accessorSuffix" => ""
};
$typeTransform{"Value"} = {
"param" => "PassRefPtr<InspectorValue>",
"retVal" => "PassRefPtr<InspectorValue>",
"forward" => "InspectorValue",
"header" => "InspectorValues.h",
- "push" => "push"
+ "accessorSuffix" => ""
};
$typeTransform{"String"} = {
"param" => "const String&",
"retVal" => "String",
"forward" => "String",
"header" => "PlatformString.h",
- "push" => "pushString"
+ "accessorSuffix" => "String"
};
$typeTransform{"long"} = {
"param" => "long",
"retVal" => "long",
"forward" => "",
"header" => "",
- "push" => "pushNumber"
+ "accessorSuffix" => "Number"
};
$typeTransform{"int"} = {
"param" => "int",
"retVal" => "int",
"forward" => "",
"header" => "",
- "push" => "pushNumber"
+ "accessorSuffix" => "Number",
};
$typeTransform{"unsigned long"} = {
"param" => "unsigned long",
"retVal" => "unsigned long",
"forward" => "",
"header" => "",
- "push" => "pushNumber"
+ "accessorSuffix" => "Number"
};
$typeTransform{"boolean"} = {
"param" => "bool",
"retVal"=> "bool",
"forward" => "",
"header" => "",
- "push" => "pushBool"
+ "accessorSuffix" => "Bool"
};
$typeTransform{"void"} = {
"retVal" => "void",
@@ -88,26 +89,22 @@ EOF
my $codeGenerator;
my $outputDir;
+my $outputHeadersDir;
my $writeDependencies;
my $verbose;
my $namespace;
-my $fileName;
-my %discoveredTypes;
-my @classDefinition;
-my @functionDefinitions;
+my $frontendClassName;
+my %frontendTypes;
+my %frontendMethods;
+my @frontendMethodsImpl;
+my $frontendConstructor;
+my $frontendFooter;
-sub typeSpec
-{
- my $param = shift;
- my $retValue = shift;
-
- my $type = $typeTransform{$param->type}->{$retValue ? "retVal" : "param"};
- $discoveredTypes{$param->type} = 1;
- $type or die "invalid type specification \"" . $param->type ."\"";
- return $type;
-}
+my $callId = new domSignature(); # it is just structure for describing parameters from IDLStructure.pm.
+$callId->type("long");
+$callId->name("callId");
# Default constructor
sub new
@@ -117,6 +114,7 @@ sub new
$codeGenerator = shift;
$outputDir = shift;
+ $outputHeadersDir = shift;
shift; # $useLayerOnTop
shift; # $preprocessor
$writeDependencies = shift;
@@ -133,6 +131,7 @@ sub GenerateModule
my $dataNode = shift;
$namespace = $dataNode->module;
+ $namespace =~ s/core/WebCore/;
}
# Params: 'idlDocument' struct
@@ -143,103 +142,126 @@ sub GenerateInterface
my $defines = shift;
my $className = $interface->name;
- $fileName = $className;
-
- $discoveredTypes{"String"} = 1;
- $discoveredTypes{"InspectorClient"} = 1;
- $discoveredTypes{"PassRefPtr"} = 1;
-
- push(@classDefinition, "class $className {");
- push(@classDefinition, "public:");
- push(@classDefinition, " $className(InspectorClient* inspectorClient) : m_inspectorClient(inspectorClient) { }");
- push(@classDefinition, "");
- push(@classDefinition, generateFunctionsDeclarations($interface, $className));
- push(@classDefinition, "");
- push(@classDefinition, "private:");
- push(@classDefinition, " void sendSimpleMessageToFrontend(const String&);");
- push(@classDefinition, " InspectorClient* m_inspectorClient;");
- push(@classDefinition, "};");
-
- push(@functionDefinitions, "void ${className}::sendSimpleMessageToFrontend(const String& functionName)");
- push(@functionDefinitions, "{");
- push(@functionDefinitions, " RefPtr<InspectorArray> arguments = InspectorArray::create();");
- push(@functionDefinitions, " arguments->pushString(functionName);");
- push(@functionDefinitions, " m_inspectorClient->sendMessageToFrontend(arguments->toJSONString());");
- push(@functionDefinitions, "}");
+
+ $frontendClassName = "Remote" . $className . "Frontend";
+ $frontendConstructor = " ${frontendClassName}(InspectorClient* inspectorClient) : m_inspectorClient(inspectorClient) { }";
+ $frontendFooter = " InspectorClient* m_inspectorClient;";
+ $frontendTypes{"String"} = 1;
+ $frontendTypes{"InspectorClient"} = 1;
+ $frontendTypes{"PassRefPtr"} = 1;
+
+ generateFunctions($interface);
}
-sub generateFunctionsDeclarations
+sub generateFunctions
{
my $interface = shift;
- my $className = shift;
- my @functionDeclarations;
foreach my $function (@{$interface->functions}) {
- my $functionName = $function->signature->name;
- my $abstract = $function->signature->extendedAttributes->{"abstract"};
- my $arguments = "";
- foreach my $parameter (@{$function->parameters}) {
- $parameter->name or die "empty argument name specified for function ${className}::$functionName and argument type " . $parameter->type;
- $arguments = $arguments . ", " if ($arguments);
- $arguments = $arguments . typeSpec($parameter) . " " . $parameter->name;
- }
- my $signature = " " . typeSpec($function->signature, 1) . " $functionName($arguments)";
- push(@functionDeclarations, $abstract ? "$signature = 0;" : "$signature;");
- push(@functionDefinitions, generateFunctionsImpl($className, $function, $arguments)) if !$abstract;
+ generateFrontendFunction($function);
}
- return @functionDeclarations;
}
-sub generateHeader
+sub generateFrontendFunction
{
- my @headerContent = split("\r", $licenseTemplate);
- push(@headerContent, "#ifndef ${fileName}_h");
- push(@headerContent, "#define ${fileName}_h");
- push(@headerContent, "");
-
- my @forwardHeaders;
- foreach my $type (keys %discoveredTypes) {
- push(@forwardHeaders, "#include <" . $typeTransform{$type}->{"forwardHeader"} . ">") if !$typeTransform{$type}->{"forwardHeader"} eq "";
+ my $function = shift;
+
+ my $functionName;
+ my $notify = $function->signature->extendedAttributes->{"notify"};
+ if ($notify) {
+ $functionName = $function->signature->name;
+ } else {
+ my $customResponse = $function->signature->extendedAttributes->{"customResponse"};
+ $functionName = $customResponse ? $customResponse : "did" . ucfirst($function->signature->name);
}
- push(@headerContent, sort @forwardHeaders);
- push(@headerContent, "");
- push(@headerContent, "namespace $namespace {");
- push(@headerContent, "");
-
- my @forwardDeclarations;
- foreach my $type (keys %discoveredTypes) {
- push(@forwardDeclarations, "class " . $typeTransform{$type}->{"forward"} . ";") if !$typeTransform{$type}->{"forward"} eq "";
+
+ my @argsFiltered = grep($_->direction eq "out", @{$function->parameters}); # just keep only out parameters for frontend interface.
+ unshift(@argsFiltered, $callId) if !$notify; # Add callId as the first argument for all frontend did* methods.
+ map($frontendTypes{$_->type} = 1, @argsFiltered); # register required types.
+ my $arguments = join(", ", map($typeTransform{$_->type}->{"param"} . " " . $_->name, @argsFiltered)); # prepare arguments for function signature.
+ my @pushArguments = map(" arguments->push" . $typeTransform{$_->type}->{"accessorSuffix"} . "(" . $_->name . ");", @argsFiltered);
+
+ my $signature = " void ${functionName}(${arguments});";
+ if (!$frontendMethods{${signature}}) {
+ $frontendMethods{${signature}} = 1;
+
+ my @function;
+ push(@function, "void ${frontendClassName}::${functionName}(${arguments})");
+ push(@function, "{");
+ push(@function, " RefPtr<InspectorArray> arguments = InspectorArray::create();");
+ push(@function, " arguments->pushString(\"$functionName\");");
+ push(@function, @pushArguments);
+ push(@function, " m_inspectorClient->sendMessageToFrontend(arguments->toJSONString());");
+ push(@function, "}");
+ push(@function, "");
+ push(@frontendMethodsImpl, @function);
}
- push(@headerContent, sort @forwardDeclarations);
-
- push(@headerContent, "");
- push(@headerContent, @classDefinition);
- push(@headerContent, "");
- push(@headerContent, "} // namespace $namespace");
- push(@headerContent, "");
- push(@headerContent, "#endif // !defined(${fileName}_h)");
- push(@headerContent, "");
- return @headerContent;
+}
+
+sub generateHeader
+{
+ my $className = shift;
+ my $types = shift;
+ my $constructor = shift;
+ my $methods = shift;
+ my $footer = shift;
+
+ my $forwardHeaders = join("\n", sort(map("#include <" . $typeTransform{$_}->{"forwardHeader"} . ">", grep($typeTransform{$_}->{"forwardHeader"}, keys %{$types}))));
+ my $forwardDeclarations = join("\n", sort(map("class " . $typeTransform{$_}->{"forward"} . ";", grep($typeTransform{$_}->{"forward"}, keys %{$types}))));
+ my $methodsDeclarations = join("\n", keys %{$methods});
+
+ my $headerBody = << "EOF";
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#ifndef ${className}_h
+#define ${className}_h
+
+${forwardHeaders}
+
+namespace $namespace {
+
+$forwardDeclarations
+
+class $className {
+public:
+$constructor
+
+$methodsDeclarations
+
+private:
+$footer
+};
+
+} // namespace $namespace
+#endif // !defined(${className}_h)
+
+EOF
+ return $headerBody;
}
sub generateSource
{
+ my $className = shift;
+ my $types = shift;
+ my $methods = shift;
+
my @sourceContent = split("\r", $licenseTemplate);
push(@sourceContent, "\n#include \"config.h\"");
- push(@sourceContent, "#include \"Remote$fileName.h\"");
+ push(@sourceContent, "#include \"$className.h\"");
push(@sourceContent, "");
push(@sourceContent, "#if ENABLE(INSPECTOR)");
push(@sourceContent, "");
my %headers;
- foreach my $type (keys %discoveredTypes) {
+ foreach my $type (keys %{$types}) {
$headers{"#include \"" . $typeTransform{$type}->{"header"} . "\""} = 1 if !$typeTransform{$type}->{"header"} eq "";
}
push(@sourceContent, sort keys %headers);
push(@sourceContent, "");
push(@sourceContent, "namespace $namespace {");
push(@sourceContent, "");
- push(@sourceContent, @functionDefinitions);
+ push(@sourceContent, @{$methods});
push(@sourceContent, "");
push(@sourceContent, "} // namespace $namespace");
push(@sourceContent, "");
@@ -248,51 +270,20 @@ sub generateSource
return @sourceContent;
}
-sub generateFunctionsImpl
-{
- my $className = shift;
- my $function = shift;
- my $arguments = shift;
-
- my @func;
-
- my $functionName = $function->signature->name;
-
- push(@func, typeSpec($function->signature, 1) . " " . $className . "::" . $functionName . "(" . $arguments . ")");
- push(@func, "{");
-
- my $numParameters = @{$function->parameters};
- if ($numParameters > 0) {
- push(@func, " RefPtr<InspectorArray> arguments = InspectorArray::create();");
- push(@func, " arguments->pushString(\"$functionName\");");
- foreach my $parameter (@{$function->parameters}) {
- my $pushCall = $typeTransform{$parameter->type}->{"push"};
- push(@func, " arguments->$pushCall(" . $parameter->name . ");");
- }
- push(@func, " m_inspectorClient->sendMessageToFrontend(arguments->toJSONString());");
- } else {
- push(@func, " sendSimpleMessageToFrontend(\"$functionName\");");
- }
-
- push(@func, "}");
- push(@func, "");
- return @func;
-}
-
sub finish
{
my $object = shift;
- open(my $SOURCE, ">$outputDir/Remote$fileName.cpp") || die "Couldn't open file $outputDir/Remote$fileName.cpp";
- open(my $HEADER, ">$outputDir/Remote$fileName.h") || die "Couldn't open file $outputDir/Remote$fileName.h";
-
- print $SOURCE join("\n", generateSource());
+ open(my $SOURCE, ">$outputDir/$frontendClassName.cpp") || die "Couldn't open file $outputDir/$frontendClassName.cpp";
+ print $SOURCE join("\n", generateSource($frontendClassName, \%frontendTypes, \@frontendMethodsImpl));
close($SOURCE);
undef($SOURCE);
- print $HEADER join("\n", generateHeader());
+ open(my $HEADER, ">$outputHeadersDir/$frontendClassName.h") || die "Couldn't open file $outputHeadersDir/$frontendClassName.h";
+ print $HEADER generateHeader($frontendClassName, \%frontendTypes, $frontendConstructor, \%frontendMethods, $frontendFooter);
close($HEADER);
undef($HEADER);
+
}
1;
diff --git a/WebCore/inspector/ConsoleMessage.cpp b/WebCore/inspector/ConsoleMessage.cpp
index 934e2e9..79b5115 100644
--- a/WebCore/inspector/ConsoleMessage.cpp
+++ b/WebCore/inspector/ConsoleMessage.cpp
@@ -40,6 +40,34 @@
namespace WebCore {
+ConsoleMessage::CallFrame::CallFrame(const ScriptCallFrame& frame)
+ : m_functionName(frame.functionName())
+ , m_sourceURL(frame.sourceURL())
+ , m_lineNumber(frame.lineNumber())
+{
+}
+
+ConsoleMessage::CallFrame::CallFrame()
+ : m_lineNumber(0)
+{
+}
+
+bool ConsoleMessage::CallFrame::isEqual(const ConsoleMessage::CallFrame& o) const
+{
+ return m_functionName == o.m_functionName
+ && m_sourceURL == o.m_sourceURL
+ && m_lineNumber == o.m_lineNumber;
+}
+
+ScriptObject ConsoleMessage::CallFrame::buildObject(InspectorFrontend* frontend) const
+{
+ ScriptObject frame = frontend->newScriptObject();
+ frame.set("functionName", m_functionName);
+ frame.set("sourceURL", m_sourceURL.string());
+ frame.set("lineNumber", m_lineNumber);
+ return frame;
+}
+
ConsoleMessage::ConsoleMessage(MessageSource s, MessageType t, MessageLevel l, const String& m, unsigned li, const String& u, unsigned g)
: m_source(s)
, m_type(t)
@@ -52,10 +80,11 @@ ConsoleMessage::ConsoleMessage(MessageSource s, MessageType t, MessageLevel l, c
{
}
-ConsoleMessage::ConsoleMessage(MessageSource s, MessageType t, MessageLevel l, ScriptCallStack* callStack, unsigned g, bool storeTrace)
+ConsoleMessage::ConsoleMessage(MessageSource s, MessageType t, MessageLevel l, const String& m, ScriptCallStack* callStack, unsigned g, bool storeTrace)
: m_source(s)
, m_type(t)
, m_level(l)
+ , m_message(m)
#if ENABLE(INSPECTOR)
, m_arguments(callStack->at(0).argumentCount())
, m_scriptState(callStack->globalState())
@@ -68,12 +97,9 @@ ConsoleMessage::ConsoleMessage(MessageSource s, MessageType t, MessageLevel l, S
m_line = lastCaller.lineNumber();
m_url = lastCaller.sourceURL().string();
- // FIXME: For now, just store function names as strings.
- // As ScriptCallStack start storing line number and source URL for all
- // frames, refactor to use that, as well.
if (storeTrace) {
for (unsigned i = 0; i < callStack->size(); ++i)
- m_frames[i] = callStack->at(i).functionName();
+ m_frames[i] = ConsoleMessage::CallFrame(callStack->at(i));
}
#if ENABLE(INSPECTOR)
@@ -93,15 +119,26 @@ void ConsoleMessage::addToFrontend(InspectorFrontend* frontend, InjectedScriptHo
jsonObj.set("url", m_url);
jsonObj.set("groupLevel", static_cast<int>(m_groupLevel));
jsonObj.set("repeatCount", static_cast<int>(m_repeatCount));
- Vector<RefPtr<SerializedScriptValue> > arguments;
+ jsonObj.set("message", m_message);
if (!m_arguments.isEmpty()) {
+ ScriptArray jsonArgs = frontend->newScriptArray();
InjectedScript injectedScript = injectedScriptHost->injectedScriptFor(m_scriptState.get());
for (unsigned i = 0; i < m_arguments.size(); ++i) {
RefPtr<SerializedScriptValue> serializedValue = injectedScript.wrapForConsole(m_arguments[i]);
- arguments.append(serializedValue);
+ if (!jsonArgs.set(i, serializedValue.get())) {
+ ASSERT_NOT_REACHED();
+ return;
+ }
}
- }
- frontend->addConsoleMessage(jsonObj, m_frames, arguments, m_message);
+ jsonObj.set("parameters", jsonArgs);
+ }
+ if (!m_frames.isEmpty()) {
+ ScriptArray frames = frontend->newScriptArray();
+ for (unsigned i = 0; i < m_frames.size(); i++)
+ frames.set(i, m_frames.at(i).buildObject(frontend));
+ jsonObj.set("stackTrace", frames);
+ }
+ frontend->addConsoleMessage(jsonObj);
}
void ConsoleMessage::updateRepeatCountInConsole(InspectorFrontend* frontend)
@@ -133,7 +170,7 @@ bool ConsoleMessage::isEqual(ScriptState* state, ConsoleMessage* msg) const
return false;
for (size_t i = 0; i < frameCount; ++i) {
- if (m_frames[i] != msg->m_frames[i])
+ if (!m_frames[i].isEqual(msg->m_frames[i]))
return false;
}
diff --git a/WebCore/inspector/ConsoleMessage.h b/WebCore/inspector/ConsoleMessage.h
index 77a010c..3848dbf 100644
--- a/WebCore/inspector/ConsoleMessage.h
+++ b/WebCore/inspector/ConsoleMessage.h
@@ -32,6 +32,7 @@
#define ConsoleMessage_h
#include "Console.h"
+#include "KURL.h"
#include "ScriptObject.h"
#include "ScriptState.h"
@@ -40,13 +41,14 @@
namespace WebCore {
class InjectedScriptHost;
class InspectorFrontend;
+class ScriptCallFrame;
class ScriptCallStack;
class ScriptString;
class ConsoleMessage : public Noncopyable {
public:
- ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& m, unsigned li, const String& u, unsigned g);
- ConsoleMessage(MessageSource, MessageType, MessageLevel, ScriptCallStack*, unsigned g, bool storeTrace = false);
+ ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& m, unsigned li, const String& u, unsigned g);
+ ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& m, ScriptCallStack*, unsigned g, bool storeTrace = false);
#if ENABLE(INSPECTOR)
void addToFrontend(InspectorFrontend*, InjectedScriptHost*);
@@ -59,6 +61,19 @@ public:
const String& message() const { return m_message; }
private:
+ class CallFrame {
+ public:
+ explicit CallFrame(const ScriptCallFrame& frame);
+ CallFrame();
+ bool isEqual(const CallFrame& o) const;
+ ScriptObject buildObject(InspectorFrontend* frontend) const;
+
+ private:
+ String m_functionName;
+ KURL m_sourceURL;
+ unsigned m_lineNumber;
+ };
+
MessageSource m_source;
MessageType m_type;
MessageLevel m_level;
@@ -67,7 +82,7 @@ private:
Vector<ScriptValue> m_arguments;
ScriptStateProtectedPtr m_scriptState;
#endif
- Vector<ScriptString> m_frames;
+ Vector<CallFrame> m_frames;
unsigned m_line;
String m_url;
unsigned m_groupLevel;
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
new file mode 100644
index 0000000..3c96db1
--- /dev/null
+++ b/WebCore/inspector/Inspector.idl
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
+ * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module core {
+ interface [Conditional=INSPECTOR] Inspector {
+ [notify] void addRecordToTimeline(out Object record);
+ [notify] void addNodesToSearchResult(out Array nodeIds);
+ [notify] void attributesUpdated(out long id, out Array attributes);
+ [notify] void childNodeCountUpdated(out long id, out int newValue);
+ [notify] void childNodeInserted(out long parentId, out long prevId, out Object node);
+ [notify] void childNodeRemoved(out long parentId, out long id);
+ [notify] void setChildNodes(out long parentId, out Array nodes);
+ [notify] void setDetachedRoot(out Object root);
+ [notify] void setDocument(out Value root);
+
+ void storeLastActivePanel(in String panelName);
+
+ void saveApplicationSettings(in String settings);
+ void saveSessionSettings(in String settings);
+
+ void enableSearchingForNode();
+ void disableSearchingForNode();
+
+ void enableMonitoringXHR();
+ void disableMonitoringXHR();
+
+ void enableResourceTracking(in boolean always);
+ void disableResourceTracking(in boolean always);
+ void getResourceContent(in long callId, in unsigned long identifier);
+ void reloadPage();
+
+ void startTimelineProfiler();
+ void stopTimelineProfiler();
+
+#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
+ void enableDebugger(in boolean always);
+ void disableDebugger(in boolean always);
+
+ void setBreakpoint(in long callId, in String sourceID, in unsigned long lineNumber, in boolean enabled, in String condition);
+ void removeBreakpoint(in String sourceID, in unsigned long lineNumber);
+ void activateBreakpoints();
+ void deactivateBreakpoints();
+
+ void pause();
+ void resume();
+
+ void stepOverStatement();
+ void stepIntoStatement();
+ void stepOutOfFunction();
+
+ void setPauseOnExceptionsState(in long pauseOnExceptionsState);
+
+ void editScriptSource(in long callId, in String sourceID, in String newContent);
+ void getScriptSource(in long callId, in String sourceID);
+
+ void enableProfiler(in boolean always);
+ void disableProfiler(in boolean always);
+
+ void startProfiling();
+ void stopProfiling();
+
+ void getProfileHeaders(in long callId);
+ void getProfile(in long callId, in unsigned long uid);
+
+ void removeProfile(in unsigned long uid);
+ void clearProfiles();
+
+ void takeHeapSnapshot();
+#endif
+ void setInjectedScriptSource(in String scriptSource);
+ void dispatchOnInjectedScript(in long callId, in long injectedScriptId, in String methodName, in String arguments, in boolean async);
+
+ void addScriptToEvaluateOnLoad(in String scriptSource);
+ void removeAllScriptsToEvaluateOnLoad();
+
+ void getChildNodes(in long callId, in long nodeId);
+ [customResponse=didApplyDomChange] void setAttribute(in long callId, in long elementId, in String name, in String value, out boolean success);
+ [customResponse=didApplyDomChange] void removeAttribute(in long callId, in long elementId, in String name, out boolean success);
+ void setTextNodeValue(in long callId, in long nodeId, in String value);
+ void getEventListenersForNode(in long callId, in long nodeId, out long nodeId, out Array listenersArray);
+ void copyNode(in long nodeId);
+ void removeNode(in long callId, in long nodeId, out long nodeId);
+ void changeTagName(in long callId, in long nodeId, in String newTagName, out long nodeId);
+ void getOuterHTML(in long callId, in long nodeId, out String outerHTML);
+ void setOuterHTML(in long callId, in long nodeId, in String outerHTML, out long nodeId);
+ void addInspectedNode(in long nodeId);
+ void performSearch(in String query, in boolean runSynchronously);
+ void searchCanceled();
+ void pushNodeByPathToFrontend(in long callId, in String path, out long nodeId);
+
+ void clearConsoleMessages();
+
+ void highlightDOMNode(in long nodeId);
+ void hideDOMNodeHighlight();
+
+ void getStyles(in long callId, in long nodeId, in boolean authOnly, out Value styles);
+ void getAllStyles(in long callId, out Array styles);
+ void getInlineStyle(in long callId, in long nodeId, out Value style);
+ void getComputedStyle(in long callId, in long nodeId, out Value style);
+ void getStyleSheet(in long callId, in long styleSheetId, out Value styleSheet);
+ void getRuleRangesForStyleSheetId(in long callId, in long styleSheetId);
+ void applyStyleText(in long callId, in long styleId, in String styleText, in String propertyName, out boolean success, out Value style, out Array changedProperties);
+ void setStyleText(in long callId, in long styleId, in String styleText, out boolean success);
+ void setStyleProperty(in long callId, in long styleId, in String name, in String value, out boolean success);
+ void toggleStyleEnabled(in long callId, in long styleId, in String propertyName, in boolean disabled, out Value style);
+ void setRuleSelector(in long callId, in long ruleId, in String selector, in long selectedNodeId, out Value rule, out boolean selectorAffectsNode);
+ void addRule(in long callId, in String selector, in long selectedNodeId, out Value rule, out boolean selectorAffectsNode);
+
+ void getCookies(in long callId);
+ void deleteCookie(in String cookieName, in String domain);
+
+#if defined(ENABLE_OFFLINE_WEB_APPLICATIONS) && ENABLE_OFFLINE_WEB_APPLICATIONS
+ void getApplicationCaches(in long callId);
+#endif
+
+ void releaseWrapperObjectGroup(in long injectedScriptId, in String objectGroup);
+ void didEvaluateForTestInFrontend(in long callId, in String jsonResult);
+
+#if defined(ENABLE_DATABASE) && ENABLE_DATABASE
+ void getDatabaseTableNames(in long callId, in long databaseId);
+#endif
+
+#if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE
+ void getDOMStorageEntries(in long callId, in long storageId);
+ void setDOMStorageItem(in long callId, in long storageId, in String key, in String value);
+ void removeDOMStorageItem(in long callId, in long storageId, in String key);
+#endif
+ };
+}
diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp
index 57ee19f..9f71307 100644
--- a/WebCore/inspector/InspectorBackend.cpp
+++ b/WebCore/inspector/InspectorBackend.cpp
@@ -86,13 +86,13 @@ InspectorBackend::~InspectorBackend()
void InspectorBackend::saveApplicationSettings(const String& settings)
{
if (m_inspectorController)
- m_inspectorController->setSetting(InspectorController::frontendSettingsSettingName(), settings);
+ m_inspectorController->saveApplicationSettings(settings);
}
void InspectorBackend::saveSessionSettings(const String& settings)
{
if (m_inspectorController)
- m_inspectorController->setSessionSettings(settings);
+ m_inspectorController->saveSessionSettings(settings);
}
void InspectorBackend::storeLastActivePanel(const String& panelName)
@@ -104,25 +104,25 @@ void InspectorBackend::storeLastActivePanel(const String& panelName)
void InspectorBackend::enableSearchingForNode()
{
if (m_inspectorController)
- m_inspectorController->setSearchingForNode(true);
+ m_inspectorController->enableSearchingForNode();
}
void InspectorBackend::disableSearchingForNode()
{
if (m_inspectorController)
- m_inspectorController->setSearchingForNode(false);
+ m_inspectorController->disableSearchingForNode();
}
void InspectorBackend::enableMonitoringXHR()
{
if (m_inspectorController)
- m_inspectorController->setMonitoringXHR(true);
+ m_inspectorController->enableMonitoringXHR();
}
void InspectorBackend::disableMonitoringXHR()
{
if (m_inspectorController)
- m_inspectorController->setMonitoringXHR(false);
+ m_inspectorController->disableMonitoringXHR();
}
void InspectorBackend::enableResourceTracking(bool always)
@@ -139,21 +139,14 @@ void InspectorBackend::disableResourceTracking(bool always)
void InspectorBackend::getResourceContent(long callId, unsigned long identifier)
{
- InspectorFrontend* frontend = inspectorFrontend();
- if (!frontend)
- return;
-
- RefPtr<InspectorResource> resource = m_inspectorController->resources().get(identifier);
- if (resource)
- frontend->didGetResourceContent(callId, resource->sourceString());
- else
- frontend->didGetResourceContent(callId, "");
+ if (m_inspectorController)
+ m_inspectorController->getResourceContent(callId, identifier);
}
void InspectorBackend::reloadPage()
{
if (m_inspectorController)
- m_inspectorController->m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true);
+ m_inspectorController->reloadPage();
}
void InspectorBackend::startTimelineProfiler()
@@ -196,45 +189,44 @@ void InspectorBackend::removeBreakpoint(const String& sourceID, unsigned lineNum
void InspectorBackend::activateBreakpoints()
{
- ScriptDebugServer::shared().setBreakpointsActivated(true);
+ ScriptDebugServer::shared().activateBreakpoints();
}
void InspectorBackend::deactivateBreakpoints()
{
- ScriptDebugServer::shared().setBreakpointsActivated(false);
+ ScriptDebugServer::shared().deactivateBreakpoints();
}
-void InspectorBackend::pauseInDebugger()
+void InspectorBackend::pause()
{
- ScriptDebugServer::shared().pauseProgram();
+ ScriptDebugServer::shared().pause();
}
-void InspectorBackend::resumeDebugger()
+void InspectorBackend::resume()
{
if (m_inspectorController)
- m_inspectorController->resumeDebugger();
+ m_inspectorController->resume();
}
-void InspectorBackend::stepOverStatementInDebugger()
+void InspectorBackend::stepOverStatement()
{
ScriptDebugServer::shared().stepOverStatement();
}
-void InspectorBackend::stepIntoStatementInDebugger()
+void InspectorBackend::stepIntoStatement()
{
ScriptDebugServer::shared().stepIntoStatement();
}
-void InspectorBackend::stepOutOfFunctionInDebugger()
+void InspectorBackend::stepOutOfFunction()
{
ScriptDebugServer::shared().stepOutOfFunction();
}
void InspectorBackend::setPauseOnExceptionsState(long pauseState)
{
- ScriptDebugServer::shared().setPauseOnExceptionsState(static_cast<ScriptDebugServer::PauseOnExceptionsState>(pauseState));
- if (InspectorFrontend* frontend = inspectorFrontend())
- frontend->updatePauseOnExceptionsState(ScriptDebugServer::shared().pauseOnExceptionsState());
+ if (m_inspectorController)
+ m_inspectorController->setPauseOnExceptionsState(pauseState);
}
void InspectorBackend::editScriptSource(long callId, const String& sourceID, const String& newContent)
@@ -368,11 +360,8 @@ void InspectorBackend::getEventListenersForNode(long callId, long nodeId)
void InspectorBackend::copyNode(long nodeId)
{
- Node* node = nodeForId(nodeId);
- if (!node)
- return;
- String markup = createMarkup(node);
- Pasteboard::generalPasteboard()->writePlainText(markup);
+ if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+ domAgent->copyNode(nodeId);
}
void InspectorBackend::removeNode(long callId, long nodeId)
@@ -419,13 +408,8 @@ void InspectorBackend::searchCanceled()
void InspectorBackend::pushNodeByPathToFrontend(long callId, const String& path)
{
- InspectorDOMAgent* domAgent = inspectorDOMAgent();
- InspectorFrontend* frontend = inspectorFrontend();
- if (!domAgent || !frontend)
- return;
-
- long id = domAgent->pushNodeByPathToFrontend(path);
- frontend->didPushNodeByPathToFrontend(callId, id);
+ if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+ domAgent->pushNodeByPathToFrontend(callId, path);
}
void InspectorBackend::clearConsoleMessages()
@@ -508,14 +492,14 @@ void InspectorBackend::addRule(long callId, const String& selector, long selecte
void InspectorBackend::highlightDOMNode(long nodeId)
{
- if (Node* node = nodeForId(nodeId))
- m_inspectorController->highlight(node);
+ if (m_inspectorController)
+ m_inspectorController->highlightDOMNode(nodeId);
}
void InspectorBackend::hideDOMNodeHighlight()
{
if (m_inspectorController)
- m_inspectorController->hideHighlight();
+ m_inspectorController->hideDOMNodeHighlight();
}
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
@@ -613,13 +597,6 @@ InspectorFrontend* InspectorBackend::inspectorFrontend()
return m_inspectorController->m_frontend.get();
}
-Node* InspectorBackend::nodeForId(long nodeId)
-{
- if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
- return domAgent->nodeForId(nodeId);
- return 0;
-}
-
void InspectorBackend::addScriptToEvaluateOnLoad(const String& source)
{
if (m_inspectorController)
diff --git a/WebCore/inspector/InspectorBackend.h b/WebCore/inspector/InspectorBackend.h
index 47cfdc7..78d34b6 100644
--- a/WebCore/inspector/InspectorBackend.h
+++ b/WebCore/inspector/InspectorBackend.h
@@ -86,12 +86,12 @@ public:
void activateBreakpoints();
void deactivateBreakpoints();
- void pauseInDebugger();
- void resumeDebugger();
+ void pause();
+ void resume();
- void stepOverStatementInDebugger();
- void stepIntoStatementInDebugger();
- void stepOutOfFunctionInDebugger();
+ void stepOverStatement();
+ void stepIntoStatement();
+ void stepOutOfFunction();
void setPauseOnExceptionsState(long pauseState);
diff --git a/WebCore/inspector/InspectorBackend.idl b/WebCore/inspector/InspectorBackend.idl
index 1fc8a16..3c460a1 100644
--- a/WebCore/inspector/InspectorBackend.idl
+++ b/WebCore/inspector/InspectorBackend.idl
@@ -60,12 +60,12 @@ module core {
void activateBreakpoints();
void deactivateBreakpoints();
- void pauseInDebugger();
- void resumeDebugger();
+ void pause();
+ void resume();
- void stepOverStatementInDebugger();
- void stepIntoStatementInDebugger();
- void stepOutOfFunctionInDebugger();
+ void stepOverStatement();
+ void stepIntoStatement();
+ void stepOutOfFunction();
void setPauseOnExceptionsState(in long pauseOnExceptionsState);
diff --git a/WebCore/inspector/InspectorCSSStore.cpp b/WebCore/inspector/InspectorCSSStore.cpp
index 413fb8b..9dffef9 100644
--- a/WebCore/inspector/InspectorCSSStore.cpp
+++ b/WebCore/inspector/InspectorCSSStore.cpp
@@ -41,7 +41,7 @@
#include "InspectorController.h"
#include "InspectorResource.h"
#include "PlatformString.h"
-#include "RemoteInspectorFrontend2.h"
+#include "RemoteInspectorFrontend.h"
#include "StyleSheetList.h"
namespace WebCore {
@@ -95,13 +95,13 @@ CSSStyleSheet* InspectorCSSStore::inspectorStyleSheet(Document* ownerDocument, b
if (!ec)
ownerDocument->head()->appendChild(styleElement, ec);
if (ec) {
- m_inspectorController->inspectorFrontend2()->didAddRule(callId, InspectorValue::null(), false);
+ m_inspectorController->remoteInspectorFrontend()->didAddRule(callId, InspectorValue::null(), false);
return 0;
}
StyleSheetList* styleSheets = ownerDocument->styleSheets();
StyleSheet* styleSheet = styleSheets->item(styleSheets->length() - 1);
if (!styleSheet->isCSSStyleSheet()) {
- m_inspectorController->inspectorFrontend2()->didAddRule(callId, InspectorValue::null(), false);
+ m_inspectorController->remoteInspectorFrontend()->didAddRule(callId, InspectorValue::null(), false);
return 0;
}
CSSStyleSheet* inspectorStyleSheet = static_cast<CSSStyleSheet*>(styleSheet);
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index ed25696..8879b8e 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -68,7 +68,7 @@
#include "Page.h"
#include "ProgressTracker.h"
#include "Range.h"
-#include "RemoteInspectorFrontend2.h"
+#include "RemoteInspectorFrontend.h"
#include "RenderInline.h"
#include "ResourceRequest.h"
#include "ResourceResponse.h"
@@ -129,6 +129,8 @@ static const char* const inspectorAttachedHeightName = "inspectorAttachedHeight"
static const char* const lastActivePanelSettingName = "lastActivePanel";
static const char* const monitoringXHRSettingName = "xhrMonitor";
+int connectedFrontendCount = 0;
+
const String& InspectorController::frontendSettingsSettingName()
{
DEFINE_STATIC_LOCAL(String, settingName, ("frontendSettings"));
@@ -216,7 +218,6 @@ InspectorController::~InspectorController()
ASSERT(!m_highlightedNode);
deleteAllValues(m_frameResources);
- deleteAllValues(m_consoleMessages);
ASSERT(s_inspectorControllerCount);
--s_inspectorControllerCount;
@@ -266,7 +267,12 @@ void InspectorController::setSetting(const String& key, const String& value)
m_client->storeSetting(key, value);
}
-void InspectorController::setSessionSettings(const String& settingsJSON)
+void InspectorController::saveApplicationSettings(const String& settings)
+{
+ setSetting(InspectorController::frontendSettingsSettingName(), settings);
+}
+
+void InspectorController::saveSessionSettings(const String& settingsJSON)
{
m_sessionSettings = InspectorValue::parseJSON(settingsJSON);
}
@@ -312,6 +318,13 @@ void InspectorController::highlight(Node* node)
m_client->highlight(node);
}
+void InspectorController::highlightDOMNode(long nodeId)
+{
+ Node* node = 0;
+ if (m_domAgent && (node = m_domAgent->nodeForId(nodeId)))
+ highlight(node);
+}
+
void InspectorController::hideHighlight()
{
if (!enabled())
@@ -325,12 +338,13 @@ bool InspectorController::windowVisible()
return m_frontend;
}
-void InspectorController::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, ScriptCallStack* callStack)
+void InspectorController::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, ScriptCallStack* callStack, const String& message)
{
if (!enabled())
return;
- addConsoleMessage(callStack->state(), new ConsoleMessage(source, type, level, callStack, m_groupLevel, type == TraceMessageType));
+ bool storeStackTrace = type == TraceMessageType || type == UncaughtExceptionMessageType || type == AssertMessageType;
+ addConsoleMessage(callStack->state(), new ConsoleMessage(source, type, level, message, callStack, m_groupLevel, storeStackTrace));
}
void InspectorController::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID)
@@ -341,18 +355,17 @@ void InspectorController::addMessageToConsole(MessageSource source, MessageType
addConsoleMessage(0, new ConsoleMessage(source, type, level, message, lineNumber, sourceID, m_groupLevel));
}
-void InspectorController::addConsoleMessage(ScriptState* scriptState, ConsoleMessage* consoleMessage)
+void InspectorController::addConsoleMessage(ScriptState* scriptState, PassOwnPtr<ConsoleMessage> consoleMessage)
{
ASSERT(enabled());
ASSERT_ARG(consoleMessage, consoleMessage);
- if (m_previousMessage && m_previousMessage->isEqual(scriptState, consoleMessage)) {
+ if (m_previousMessage && m_previousMessage->isEqual(scriptState, consoleMessage.get())) {
m_previousMessage->incrementCount();
- delete consoleMessage;
if (m_frontend)
m_previousMessage->updateRepeatCountInConsole(m_frontend.get());
} else {
- m_previousMessage = consoleMessage;
+ m_previousMessage = consoleMessage.get();
m_consoleMessages.append(consoleMessage);
if (m_frontend)
m_previousMessage->addToFrontend(m_frontend.get(), m_injectedScriptHost.get());
@@ -360,15 +373,12 @@ void InspectorController::addConsoleMessage(ScriptState* scriptState, ConsoleMes
if (!m_frontend && m_consoleMessages.size() >= maximumConsoleMessages) {
m_expiredConsoleMessageCount += expireConsoleMessagesStep;
- for (size_t i = 0; i < expireConsoleMessagesStep; ++i)
- delete m_consoleMessages[i];
m_consoleMessages.remove(0, expireConsoleMessagesStep);
}
}
void InspectorController::clearConsoleMessages()
{
- deleteAllValues(m_consoleMessages);
m_consoleMessages.clear();
m_expiredConsoleMessageCount = 0;
m_previousMessage = 0;
@@ -384,7 +394,7 @@ void InspectorController::startGroup(MessageSource source, ScriptCallStack* call
{
++m_groupLevel;
- addConsoleMessage(callStack->state(), new ConsoleMessage(source, collapsed ? StartGroupCollapsedMessageType : StartGroupMessageType, LogMessageLevel, callStack, m_groupLevel));
+ addConsoleMessage(callStack->state(), new ConsoleMessage(source, collapsed ? StartGroupCollapsedMessageType : StartGroupMessageType, LogMessageLevel, String(), callStack, m_groupLevel));
}
void InspectorController::endGroup(MessageSource source, unsigned lineNumber, const String& sourceURL)
@@ -486,10 +496,10 @@ void InspectorController::connectFrontend(const ScriptObject& webInspector)
m_openingFrontend = false;
releaseFrontendLifetimeAgents();
m_frontend = new InspectorFrontend(webInspector, m_client);
- m_frontend2 = new InspectorFrontend2(m_client);
- m_domAgent = InspectorDOMAgent::create(m_cssStore.get(), m_frontend2.get());
+ m_remoteFrontend = new RemoteInspectorFrontend(m_client);
+ m_domAgent = InspectorDOMAgent::create(m_cssStore.get(), m_remoteFrontend.get());
if (m_timelineAgent)
- m_timelineAgent->resetFrontendProxyObject(m_frontend2.get());
+ m_timelineAgent->resetFrontendProxyObject(m_remoteFrontend.get());
// Initialize Web Inspector title.
m_frontend->inspectedURLChanged(m_inspectedPage->mainFrame()->loader()->url().string());
@@ -523,6 +533,10 @@ void InspectorController::connectFrontend(const ScriptObject& webInspector)
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
m_applicationCacheAgent = new InspectorApplicationCacheAgent(this, m_frontend.get());
#endif
+
+ if (!connectedFrontendCount)
+ ScriptController::setCaptureCallStackForUncaughtExceptions(true);
+ connectedFrontendCount++;
}
void InspectorController::show()
@@ -572,6 +586,10 @@ void InspectorController::disconnectFrontend()
return;
m_frontend.clear();
+ connectedFrontendCount--;
+ if (!connectedFrontendCount)
+ ScriptController::setCaptureCallStackForUncaughtExceptions(false);
+
#if ENABLE(JAVASCRIPT_DEBUGGER)
// If the window is being closed with the debugger enabled,
// remember this state to re-enable debugger on the next window
@@ -1163,7 +1181,7 @@ void InspectorController::startTimelineProfiler()
if (m_timelineAgent)
return;
- m_timelineAgent = new InspectorTimelineAgent(m_frontend2.get());
+ m_timelineAgent = new InspectorTimelineAgent(m_remoteFrontend.get());
if (m_frontend)
m_frontend->timelineProfilerWasStarted();
m_client->timelineProfilerWasStarted();
@@ -1746,13 +1764,20 @@ void InspectorController::getScriptSource(long callId, const String& sourceID)
m_frontend->didGetScriptSource(callId, scriptSource);
}
-void InspectorController::resumeDebugger()
+void InspectorController::resume()
{
if (!m_debuggerEnabled)
return;
ScriptDebugServer::shared().continueProgram();
}
+void InspectorController::setPauseOnExceptionsState(long pauseState)
+{
+ ScriptDebugServer::shared().setPauseOnExceptionsState(static_cast<ScriptDebugServer::PauseOnExceptionsState>(pauseState));
+ if (m_frontend)
+ m_frontend->updatePauseOnExceptionsState(ScriptDebugServer::shared().pauseOnExceptionsState());
+}
+
PassRefPtr<SerializedScriptValue> InspectorController::currentCallFrames()
{
if (!m_pausedScriptState)
@@ -2159,6 +2184,23 @@ void InspectorController::removeAllScriptsToEvaluateOnLoad()
m_scriptsToEvaluateOnLoad.clear();
}
+void InspectorController::getResourceContent(long callId, unsigned long identifier)
+{
+ if (!m_frontend)
+ return;
+
+ RefPtr<InspectorResource> resource = m_resources.get(identifier);
+ if (resource)
+ m_frontend->didGetResourceContent(callId, resource->sourceString());
+ else
+ m_frontend->didGetResourceContent(callId, "");
+}
+
+void InspectorController::reloadPage()
+{
+ m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true);
+}
+
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 9bb6c7d..76b88f1 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -69,7 +69,6 @@ class InspectorCSSStore;
class InspectorDOMStorageResource;
class InspectorDatabaseResource;
class InspectorFrontend;
-class InspectorFrontend2;
class InspectorFrontendClient;
class InspectorResource;
class InspectorTimelineAgent;
@@ -78,6 +77,7 @@ class InspectorWorkerResource;
class KURL;
class Node;
class Page;
+class RemoteInspectorFrontend;
class ResourceRequest;
class ResourceResponse;
class ResourceError;
@@ -127,14 +127,19 @@ public:
bool enabled() const;
Page* inspectedPage() const { return m_inspectedPage; }
+ void reloadPage();
String setting(const String& key) const;
void setSetting(const String& key, const String& value);
- void setSessionSettings(const String&);
+ void saveApplicationSettings(const String& settings);
+ void saveSessionSettings(const String&);
+
void inspect(Node*);
void highlight(Node*);
void hideHighlight();
+ void highlightDOMNode(long nodeId);
+ void hideDOMNodeHighlight() { hideHighlight(); }
void show();
void showPanel(SpecialPanels);
@@ -146,10 +151,10 @@ public:
void connectFrontend(const ScriptObject& webInspector);
void disconnectFrontend();
- void addMessageToConsole(MessageSource, MessageType, MessageLevel, ScriptCallStack*);
+ void addMessageToConsole(MessageSource, MessageType, MessageLevel, ScriptCallStack*, const String& message = String());
void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceID);
void clearConsoleMessages();
- const Vector<ConsoleMessage*>& consoleMessages() const { return m_consoleMessages; }
+ const Vector<OwnPtr<ConsoleMessage> >& consoleMessages() const { return m_consoleMessages; }
bool searchingForNodeInPage() const { return m_searchingForNode; }
void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
@@ -220,7 +225,7 @@ public:
const ResourcesMap& resources() const { return m_resources; }
InspectorResource* resourceForURL(const String& url);
InspectorFrontend* inspectorFrontend() { return m_frontend.get(); }
- InspectorFrontend2* inspectorFrontend2() { return m_frontend2.get(); }
+ RemoteInspectorFrontend* remoteInspectorFrontend() { return m_remoteFrontend.get(); }
void drawNodeHighlight(GraphicsContext&) const;
@@ -246,6 +251,8 @@ public:
String getCurrentUserInitiatedProfileName(bool incrementProfileNumber);
void startUserInitiatedProfiling(Timer<InspectorController>* = 0);
void stopUserInitiatedProfiling();
+ void startProfiling() { startUserInitiatedProfiling(); }
+ void stopProfiling() { stopUserInitiatedProfiling(); }
void enableProfiler(bool always = false, bool skipRecompile = false);
void disableProfiler(bool always = false);
@@ -260,7 +267,8 @@ public:
void editScriptSource(long callId, const String& sourceID, const String& newContent);
void getScriptSource(long callId, const String& sourceID);
- void resumeDebugger();
+ void resume();
+ void setPauseOnExceptionsState(long pauseState);
PassRefPtr<SerializedScriptValue> currentCallFrames();
virtual void didParseSource(const String& sourceID, const String& url, const String& data, int firstLine, ScriptWorldType);
@@ -288,7 +296,12 @@ private:
// Following are used from InspectorBackend and internally.
void setSearchingForNode(bool enabled);
+ void enableSearchingForNode() { setSearchingForNode(true); }
+ void disableSearchingForNode() { setSearchingForNode(false); }
+
void setMonitoringXHR(bool enabled);
+ void enableMonitoringXHR() { setMonitoringXHR(true); }
+ void disableMonitoringXHR() { setMonitoringXHR(false); }
void storeLastActivePanel(const String& panelName);
InspectorDOMAgent* domAgent() { return m_domAgent.get(); }
void releaseFrontendLifetimeAgents();
@@ -319,11 +332,12 @@ private:
void focusNode();
- void addConsoleMessage(ScriptState*, ConsoleMessage*);
+ void addConsoleMessage(ScriptState*, PassOwnPtr<ConsoleMessage>);
void addResource(InspectorResource*);
void removeResource(InspectorResource*);
InspectorResource* getTrackedResource(unsigned long identifier);
+ void getResourceContent(long callId, unsigned long identifier);
void pruneResources(ResourcesMap*, DocumentLoader* loaderToKeep = 0);
void removeAllResources(ResourcesMap* map) { pruneResources(map); }
@@ -345,7 +359,7 @@ private:
OwnPtr<InspectorFrontendClient> m_inspectorFrontendClient;
bool m_openingFrontend;
OwnPtr<InspectorFrontend> m_frontend;
- OwnPtr<InspectorFrontend2> m_frontend2;
+ OwnPtr<RemoteInspectorFrontend> m_remoteFrontend;
RefPtr<InspectorDOMAgent> m_domAgent;
OwnPtr<InspectorCSSStore> m_cssStore;
OwnPtr<InspectorTimelineAgent> m_timelineAgent;
@@ -359,7 +373,7 @@ private:
ResourcesMap m_resources;
HashSet<String> m_knownResources;
FrameResourcesMap m_frameResources;
- Vector<ConsoleMessage*> m_consoleMessages;
+ Vector<OwnPtr<ConsoleMessage> > m_consoleMessages;
unsigned m_expiredConsoleMessageCount;
HashMap<String, double> m_times;
HashMap<String, unsigned> m_counts;
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index 46bc938..e3d1bf5 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -58,8 +58,9 @@
#include "MutationEvent.h"
#include "Node.h"
#include "NodeList.h"
+#include "Pasteboard.h"
#include "PlatformString.h"
-#include "RemoteInspectorFrontend2.h"
+#include "RemoteInspectorFrontend.h"
#include "RenderStyle.h"
#include "RenderStyleConstants.h"
#include "ScriptEventListener.h"
@@ -70,6 +71,8 @@
#include "XPathResult.h"
#endif
+#include "markup.h"
+
#include <wtf/text/CString.h>
#include <wtf/HashSet.h>
#include <wtf/ListHashSet.h>
@@ -195,7 +198,7 @@ public:
}
-InspectorDOMAgent::InspectorDOMAgent(InspectorCSSStore* cssStore, InspectorFrontend2* frontend)
+InspectorDOMAgent::InspectorDOMAgent(InspectorCSSStore* cssStore, RemoteInspectorFrontend* frontend)
: EventListener(InspectorDOMAgentType)
, m_cssStore(cssStore)
, m_frontend(frontend)
@@ -354,14 +357,6 @@ void InspectorDOMAgent::pushChildNodesToFrontend(long nodeId)
m_frontend->setChildNodes(nodeId, children.release());
}
-long InspectorDOMAgent::pushNodeByPathToFrontend(const String& path)
-{
- Node* node = nodeForPath(path);
- if (!node)
- return 0;
- return pushNodePathToFrontend(node);
-}
-
long InspectorDOMAgent::inspectedNode(unsigned long num)
{
if (num < m_inspectedNodes.size())
@@ -1635,6 +1630,28 @@ void InspectorDOMAgent::reportNodesAsSearchResults(ListHashSet<Node*>& resultCol
m_frontend->addNodesToSearchResult(nodeIds.release());
}
+void InspectorDOMAgent::copyNode(long nodeId)
+{
+ Node* node = nodeForId(nodeId);
+ if (!node)
+ return;
+ String markup = createMarkup(node);
+ Pasteboard::generalPasteboard()->writePlainText(markup);
+}
+
+void InspectorDOMAgent::pushNodeByPathToFrontend(long callId, const String& path)
+{
+ if (!m_frontend)
+ return;
+
+ long id = 0;
+ Node* node = nodeForPath(path);
+ if (node)
+ id = pushNodePathToFrontend(node);
+
+ m_frontend->didPushNodeByPathToFrontend(callId, id);
+}
+
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index 33c5f64..efa27e0 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -57,7 +57,11 @@ namespace WebCore {
class Element;
class Event;
class InspectorDOMAgent;
+<<<<<<< HEAD:WebCore/inspector/InspectorDOMAgent.h
class InspectorFrontend2;
+=======
+ class RemoteInspectorFrontend;
+>>>>>>> webkit.org at r63859:WebCore/inspector/InspectorDOMAgent.h
class MatchJob;
class NameNodeMap;
class Node;
@@ -80,7 +84,7 @@ namespace WebCore {
class InspectorDOMAgent : public EventListener {
public:
- static PassRefPtr<InspectorDOMAgent> create(InspectorCSSStore* cssStore, InspectorFrontend2* frontend)
+ static PassRefPtr<InspectorDOMAgent> create(InspectorCSSStore* cssStore, RemoteInspectorFrontend* frontend)
{
return adoptRef(new InspectorDOMAgent(cssStore, frontend));
}
@@ -92,7 +96,7 @@ namespace WebCore {
: 0;
}
- InspectorDOMAgent(InspectorCSSStore* cssStore, InspectorFrontend2* frontend);
+ InspectorDOMAgent(InspectorCSSStore* cssStore, RemoteInspectorFrontend* frontend);
~InspectorDOMAgent();
void reset();
@@ -138,8 +142,9 @@ namespace WebCore {
Node* nodeForId(long nodeId);
long pushNodePathToFrontend(Node* node);
void pushChildNodesToFrontend(long nodeId);
- long pushNodeByPathToFrontend(const String& path);
+ void pushNodeByPathToFrontend(long callId, const String& path);
long inspectedNode(unsigned long num);
+ void copyNode(long nodeId);
private:
static CSSStyleSheet* getParentStyleSheet(CSSStyleDeclaration*);
@@ -195,7 +200,7 @@ namespace WebCore {
void discardBindings();
InspectorCSSStore* m_cssStore;
- InspectorFrontend2* m_frontend;
+ RemoteInspectorFrontend* m_frontend;
NodeToIdMap m_documentNodeToIdMap;
// Owns node mappings for dangling nodes.
Vector<NodeToIdMap*> m_danglingNodeToIdMaps;
diff --git a/WebCore/inspector/InspectorFrontend.cpp b/WebCore/inspector/InspectorFrontend.cpp
index f9a29b6..5925741 100644
--- a/WebCore/inspector/InspectorFrontend.cpp
+++ b/WebCore/inspector/InspectorFrontend.cpp
@@ -32,7 +32,6 @@
#if ENABLE(INSPECTOR)
-#include "ConsoleMessage.h"
#include "Frame.h"
#include "InjectedScript.h"
#include "InjectedScriptHost.h"
@@ -112,26 +111,11 @@ void InspectorFrontend::updateConsoleMessageExpiredCount(unsigned count)
function.call();
}
-void InspectorFrontend::addConsoleMessage(const ScriptObject& messageObj, const Vector<ScriptString>& frames, const Vector<RefPtr<SerializedScriptValue> >& arguments, const String& message)
+void InspectorFrontend::addConsoleMessage(const ScriptObject& messageObj)
{
ScriptFunctionCall function(m_webInspector, "dispatch");
function.appendArgument("addConsoleMessage");
function.appendArgument(messageObj);
- if (!frames.isEmpty()) {
- for (unsigned i = 0; i < frames.size(); ++i)
- function.appendArgument(frames[i]);
- } else if (!arguments.isEmpty()) {
- for (unsigned i = 0; i < arguments.size(); ++i) {
- ScriptValue scriptValue = ScriptValue::deserialize(scriptState(), arguments[i].get());
- if (scriptValue.hasNoValue()) {
- ASSERT_NOT_REACHED();
- return;
- }
- function.appendArgument(scriptValue);
- }
- } else {
- function.appendArgument(message);
- }
function.call();
}
diff --git a/WebCore/inspector/InspectorFrontend.h b/WebCore/inspector/InspectorFrontend.h
index e32f40c..e6567be 100644
--- a/WebCore/inspector/InspectorFrontend.h
+++ b/WebCore/inspector/InspectorFrontend.h
@@ -68,7 +68,7 @@ namespace WebCore {
void populateSessionSettings(const String& settings);
void updateConsoleMessageExpiredCount(unsigned count);
- void addConsoleMessage(const ScriptObject& messageObj, const Vector<ScriptString>& frames, const Vector<RefPtr<SerializedScriptValue> >& arguments, const String& message);
+ void addConsoleMessage(const ScriptObject& messageObj);
void updateConsoleMessageRepeatCount(unsigned count);
void clearConsoleMessages();
diff --git a/WebCore/inspector/InspectorFrontend2.idl b/WebCore/inspector/InspectorFrontend2.idl
deleted file mode 100644
index b96d715..0000000
--- a/WebCore/inspector/InspectorFrontend2.idl
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-module WebCore {
-
- interface [Conditional=INSPECTOR, JS] InspectorFrontend2 {
- // TimelineAgent
- void addRecordToTimeline(in Object record);
-
- // DOMAgent
- void addNodesToSearchResult(in Array nodeIds);
- void attributesUpdated(in long id, in Array attributes);
- void childNodeCountUpdated(in long id, in int newValue);
- void childNodeInserted(in long parentId, in long prevId, in Object node);
- void childNodeRemoved(in long parentId, in long id);
- void didAddRule(in long callId, in Value rule, in boolean selectorAffectsNode);
- void didApplyDomChange(in long callId, in boolean success);
- void didApplyStyleText(in long callId, in boolean success, in Value style, in Array changedProperties);
- void didChangeTagName(in long callId, in long nodeId);
- void didGetAllStyles(in long callId, in Array styles);
- void didGetChildNodes(in long callId);
- void didGetComputedStyle(in long callId, in Value style);
- void didGetEventListenersForNode(in long callId, in long nodeId, in Array listenersArray);
- void didGetInlineStyle(in long callId, in Value style);
- void didGetOuterHTML(in long callId, in String outerHTML);
- void didGetStyleSheet(in long callId, in Value styleSheet);
- void didGetStyles(in long callId, in Value styles);
- void didRemoveNode(in long callId, in long nodeId);
- void didSetOuterHTML(in long callId, in long nodeId);
- void didSetRuleSelector(in long callId, in Value rule, in boolean selectorAffectsNode);
- void didSetStyleProperty(in long callId, in boolean success);
- void didSetStyleText(in long callId, in boolean success);
- void didToggleStyleEnabled(in long callId, in Value style);
- void setChildNodes(in long parentId, in Array nodes);
- void setDetachedRoot(in Object root);
- void setDocument(in Value root);
- };
-}
diff --git a/WebCore/inspector/InspectorResource.cpp b/WebCore/inspector/InspectorResource.cpp
index 91a57e0..6a5919c 100644
--- a/WebCore/inspector/InspectorResource.cpp
+++ b/WebCore/inspector/InspectorResource.cpp
@@ -64,6 +64,7 @@ InspectorResource::InspectorResource(unsigned long identifier, DocumentLoader* l
, m_loadEventTime(-1.0)
, m_domContentEventTime(-1.0)
, m_connectionID(0)
+ , m_connectionReused(false)
, m_isMainResource(false)
{
}
@@ -131,6 +132,7 @@ void InspectorResource::updateResponse(const ResourceResponse& response)
m_suggestedFilename = response.suggestedFilename();
m_connectionID = response.connectionID();
+ m_connectionReused = response.connectionReused();
m_loadTiming = response.resourceLoadTiming();
m_cached = response.wasCached();
@@ -183,6 +185,7 @@ void InspectorResource::updateScriptObject(InspectorFrontend* frontend)
populateHeadersObject(&responseHeaders, m_responseHeaderFields);
jsonObject.set("responseHeaders", responseHeaders);
jsonObject.set("connectionID", m_connectionID);
+ jsonObject.set("connectionReused", m_connectionReused);
jsonObject.set("cached", m_cached);
if (m_loadTiming && !m_cached)
jsonObject.set("timing", buildObjectForTiming(frontend, m_loadTiming.get()));
@@ -394,9 +397,9 @@ ScriptObject InspectorResource::buildObjectForTiming(InspectorFrontend* frontend
jsonObject.set("proxyDuration", timing->proxyStart == -1 ? -1 : (timing->proxyEnd - timing->proxyStart) / 1000.0);
jsonObject.set("dnsDuration", timing->dnsStart == -1 ? -1 : (timing->dnsEnd - timing->dnsStart) / 1000.0);
jsonObject.set("connectDuration", timing->connectStart == -1 ? -1 : (timing->connectEnd - timing->connectStart) / 1000.0);
+ jsonObject.set("sslDuration", timing->sslStart == -1 ? -1 : (timing->sslEnd - timing->sslStart) / 1000.0);
jsonObject.set("sendDuration", (timing->sendEnd - timing->sendStart) / 1000.0);
jsonObject.set("waitDuration", (timing->receiveHeadersEnd - timing->sendEnd) / 1000.0);
- jsonObject.set("sslDuration", (timing->sslEnd - timing->sslStart) / 1000.0);
return jsonObject;
}
diff --git a/WebCore/inspector/InspectorResource.h b/WebCore/inspector/InspectorResource.h
index ed9ec37..48e1a20 100644
--- a/WebCore/inspector/InspectorResource.h
+++ b/WebCore/inspector/InspectorResource.h
@@ -174,6 +174,7 @@ namespace WebCore {
double m_loadEventTime;
double m_domContentEventTime;
unsigned m_connectionID;
+ bool m_connectionReused;
RefPtr<ResourceLoadTiming> m_loadTiming;
ScriptString m_overrideContent;
Type m_overrideContentType;
diff --git a/WebCore/inspector/InspectorTimelineAgent.cpp b/WebCore/inspector/InspectorTimelineAgent.cpp
index 31513d1..b5cff68 100644
--- a/WebCore/inspector/InspectorTimelineAgent.cpp
+++ b/WebCore/inspector/InspectorTimelineAgent.cpp
@@ -35,7 +35,7 @@
#include "Event.h"
#include "IntRect.h"
-#include "RemoteInspectorFrontend2.h"
+#include "RemoteInspectorFrontend.h"
#include "ResourceRequest.h"
#include "ResourceResponse.h"
#include "TimelineRecordFactory.h"
@@ -46,7 +46,7 @@ namespace WebCore {
int InspectorTimelineAgent::s_instanceCount = 0;
-InspectorTimelineAgent::InspectorTimelineAgent(InspectorFrontend2* frontend)
+InspectorTimelineAgent::InspectorTimelineAgent(RemoteInspectorFrontend* frontend)
: m_frontend(frontend)
{
++s_instanceCount;
@@ -279,7 +279,7 @@ void InspectorTimelineAgent::reset()
m_recordStack.clear();
}
-void InspectorTimelineAgent::resetFrontendProxyObject(InspectorFrontend2* frontend)
+void InspectorTimelineAgent::resetFrontendProxyObject(RemoteInspectorFrontend* frontend)
{
ASSERT(frontend);
reset();
diff --git a/WebCore/inspector/InspectorTimelineAgent.h b/WebCore/inspector/InspectorTimelineAgent.h
index 9a5cb98..16d7b83 100644
--- a/WebCore/inspector/InspectorTimelineAgent.h
+++ b/WebCore/inspector/InspectorTimelineAgent.h
@@ -42,7 +42,7 @@
namespace WebCore {
class Event;
-class InspectorFrontend2;
+class RemoteInspectorFrontend;
class IntRect;
class ResourceRequest;
class ResourceResponse;
@@ -74,11 +74,11 @@ enum TimelineRecordType {
class InspectorTimelineAgent : ScriptGCEventListener, public Noncopyable {
public:
- InspectorTimelineAgent(InspectorFrontend2* frontend);
+ InspectorTimelineAgent(RemoteInspectorFrontend* frontend);
~InspectorTimelineAgent();
void reset();
- void resetFrontendProxyObject(InspectorFrontend2*);
+ void resetFrontendProxyObject(RemoteInspectorFrontend*);
// Methods called from WebCore.
void willCallFunction(const String& scriptName, int scriptLine);
@@ -152,7 +152,7 @@ private:
void pushGCEventRecords();
- InspectorFrontend2* m_frontend;
+ RemoteInspectorFrontend* m_frontend;
Vector<TimelineRecordEntry> m_recordStack;
static int s_instanceCount;
diff --git a/WebCore/inspector/InspectorValues.cpp b/WebCore/inspector/InspectorValues.cpp
index f95116c..90a40f9 100644
--- a/WebCore/inspector/InspectorValues.cpp
+++ b/WebCore/inspector/InspectorValues.cpp
@@ -550,6 +550,7 @@ void InspectorBasicValue::writeJSON(Vector<UChar>* output) const
output->append(falseString, 5);
} else if (type() == TypeDouble) {
String value = String::format("%f", m_doubleValue);
+ value.replace(',', '.');
output->append(value.characters(), value.length());
}
}
@@ -650,6 +651,12 @@ void InspectorArray::writeJSON(Vector<UChar>* output) const
output->append(']');
}
+PassRefPtr<InspectorValue> InspectorArray::get(size_t index)
+{
+ ASSERT(index < m_data.size());
+ return m_data[index];
+}
+
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorValues.h b/WebCore/inspector/InspectorValues.h
index 30ba95a..a0c0c2d 100644
--- a/WebCore/inspector/InspectorValues.h
+++ b/WebCore/inspector/InspectorValues.h
@@ -198,7 +198,9 @@ public:
void pushNumber(double);
void pushString(const String&);
void push(PassRefPtr<InspectorValue>);
- unsigned length() { return m_data.size(); }
+ unsigned length() const { return m_data.size(); }
+
+ PassRefPtr<InspectorValue> get(size_t index);
virtual void writeJSON(Vector<UChar>* output) const;
diff --git a/WebCore/inspector/JavaScriptCallFrame.idl b/WebCore/inspector/JavaScriptCallFrame.idl
index 28f4f34..225059d 100644
--- a/WebCore/inspector/JavaScriptCallFrame.idl
+++ b/WebCore/inspector/JavaScriptCallFrame.idl
@@ -25,7 +25,11 @@
module inspector {
- interface [Conditional=JAVASCRIPT_DEBUGGER, OmitConstructor] JavaScriptCallFrame {
+ interface [
+ Conditional=JAVASCRIPT_DEBUGGER,
+ OmitConstructor,
+ DontCheckEnums
+ ] JavaScriptCallFrame {
// Scope type
const unsigned short GLOBAL_SCOPE = 0;
diff --git a/WebCore/inspector/front-end/AbstractTimelinePanel.js b/WebCore/inspector/front-end/AbstractTimelinePanel.js
index 1b5f6ce..187ef86 100644
--- a/WebCore/inspector/front-end/AbstractTimelinePanel.js
+++ b/WebCore/inspector/front-end/AbstractTimelinePanel.js
@@ -202,6 +202,9 @@ WebInspector.AbstractTimelinePanel.prototype = {
// When we are updating our filtering, scroll to the top so we don't end up
// in blank graph under all the resources.
this.containerElement.scrollTop = 0;
+
+ var searchField = document.getElementById("search");
+ WebInspector.doPerformSearch(searchField.value, WebInspector.shortSearchWasForcedByKeyEvent, false, true);
},
updateGraphDividersIfNeeded: function(force)
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index 8bb71e6..d4119a1 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -275,9 +275,9 @@ WebInspector.ConsoleView.prototype = {
msg._updateRepeatCount();
this._incrementErrorWarningCount(msg);
} else {
- msgCopy = new WebInspector.ConsoleMessage(msg.source, msg.type, msg.level, msg.line, msg.url, msg.groupLevel, count - prevRepeatCount);
+ var msgCopy = new WebInspector.ConsoleMessage(msg.source, msg.type, msg.level, msg.line, msg.url, msg.groupLevel, count - prevRepeatCount, msg._messageText, msg._parameters, msg._stackTrace);
msgCopy.totalRepeatCount = count;
- msgCopy.setMessageBody(msg.args);
+ msgCopy._formatMessage();
this.addMessage(msgCopy);
}
},
@@ -645,7 +645,7 @@ WebInspector.ConsoleView.prototype = {
WebInspector.ConsoleView.prototype.__proto__ = WebInspector.View.prototype;
-WebInspector.ConsoleMessage = function(source, type, level, line, url, groupLevel, repeatCount)
+WebInspector.ConsoleMessage = function(source, type, level, line, url, groupLevel, repeatCount, message, parameters, stackTrace)
{
this.source = source;
this.type = type;
@@ -656,29 +656,56 @@ WebInspector.ConsoleMessage = function(source, type, level, line, url, groupLeve
this.repeatCount = repeatCount;
this.repeatDelta = repeatCount;
this.totalRepeatCount = repeatCount;
- if (arguments.length > 7)
- this.setMessageBody(Array.prototype.slice.call(arguments, 7));
+ this._messageText = message;
+ this._parameters = parameters;
+ this._stackTrace = stackTrace;
+ this._formatMessage();
+}
+
+WebInspector.ConsoleMessage.createTextMessage = function(text, level)
+{
+ level = level || WebInspector.ConsoleMessage.MessageLevel.Log;
+ return new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Log, level, 0, null, null, 1, null, [text], null);
}
WebInspector.ConsoleMessage.prototype = {
- setMessageBody: function(args)
+ _formatMessage: function()
{
- this.args = args;
switch (this.type) {
+ case WebInspector.ConsoleMessage.MessageType.Assert:
case WebInspector.ConsoleMessage.MessageType.Trace:
- var span = document.createElement("span");
- span.className = "console-formatted-trace source-code";
- var stack = Array.prototype.slice.call(args);
- var funcNames = stack.map(function(f) {
- return f || WebInspector.UIString("(anonymous function)");
- });
- span.appendChild(document.createTextNode(funcNames.join("\n")));
- this.formattedMessage = span;
+ case WebInspector.ConsoleMessage.MessageType.UncaughtException:
+ var ol = document.createElement("ol");
+ ol.addStyleClass("stack-trace");
+ if (this.type === WebInspector.ConsoleMessage.MessageType.Trace)
+ ol.addStyleClass("trace-message");
+ var treeOutline = new TreeOutline(ol);
+
+ var root = treeOutline;
+ if (this.type === WebInspector.ConsoleMessage.MessageType.UncaughtException ||
+ this.type === WebInspector.ConsoleMessage.MessageType.Assert) {
+ var messageText;
+ if (this.type === WebInspector.ConsoleMessage.MessageType.Assert)
+ messageText = this._format(this._parameters);
+ else
+ messageText = document.createTextNode(this._messageText);
+
+ var content = document.createElement("div");
+ this._addMessageHeader(content, messageText);
+ root = new TreeElement(content, null, true);
+ content.treeElementForTest = root;
+ treeOutline.appendChild(root);
+ }
+
+ this._populateStackTraceTreeElement(root);
+ this.formattedMessage = ol;
break;
case WebInspector.ConsoleMessage.MessageType.Object:
- this.formattedMessage = this._format(["%O", args[0]]);
+ var obj = this._parameters ? this._parameters[0] : undefined;
+ this.formattedMessage = this._format(["%O", obj]);
break;
default:
+ var args = this._parameters || [this._messageText];
this.formattedMessage = this._format(args);
break;
}
@@ -822,34 +849,52 @@ WebInspector.ConsoleMessage.prototype = {
return element;
}
- if (this.url && this.url !== "undefined") {
- var urlElement = document.createElement("a");
- urlElement.className = "console-message-url webkit-html-resource-link";
- urlElement.href = this.url;
- urlElement.lineNumber = this.line;
+ if (this.type === WebInspector.ConsoleMessage.MessageType.Trace ||
+ this.type === WebInspector.ConsoleMessage.MessageType.Assert ||
+ this.type === WebInspector.ConsoleMessage.MessageType.UncaughtException)
+ element.appendChild(this.formattedMessage);
+ else
+ this._addMessageHeader(element, this.formattedMessage);
+
+ if (this.repeatCount > 1)
+ this._updateRepeatCount();
+
+ return element;
+ },
+
+ _populateStackTraceTreeElement: function(parentTreeElement)
+ {
+ for (var i = 0; i < this._stackTrace.length; i++) {
+ var frame = this._stackTrace[i];
- if (this.source === WebInspector.ConsoleMessage.MessageSource.JS)
- urlElement.preferredPanel = "scripts";
+ var content = document.createElement("div");
+ var messageTextElement = document.createElement("span");
+ messageTextElement.className = "console-message-text source-code";
+ var functionName = frame.functionName || WebInspector.UIString("(anonymous function)");
+ messageTextElement.appendChild(document.createTextNode(functionName));
+ content.appendChild(messageTextElement);
- if (this.line > 0)
- urlElement.textContent = WebInspector.displayNameForURL(this.url) + ":" + this.line;
- else
- urlElement.textContent = WebInspector.displayNameForURL(this.url);
+ var urlElement = WebInspector.linkifyResourceAsNode(frame.sourceURL, "scripts", frame.lineNumber, "console-message-url");
+ content.appendChild(urlElement);
- element.appendChild(urlElement);
+ var treeElement = new TreeElement(content);
+ parentTreeElement.appendChild(treeElement);
+ }
+ },
+
+ _addMessageHeader: function(parentElement, formattedMessage)
+ {
+ if (this.url && this.url !== "undefined") {
+ var urlElement = WebInspector.linkifyResourceAsNode(this.url, "scripts", this.line, "console-message-url");
+ parentElement.appendChild(urlElement);
}
var messageTextElement = document.createElement("span");
messageTextElement.className = "console-message-text source-code";
if (this.type === WebInspector.ConsoleMessage.MessageType.Assert)
messageTextElement.appendChild(document.createTextNode(WebInspector.UIString("Assertion failed: ")));
- messageTextElement.appendChild(this.formattedMessage);
- element.appendChild(messageTextElement);
-
- if (this.repeatCount > 1)
- this._updateRepeatCount();
-
- return element;
+ messageTextElement.appendChild(formattedMessage);
+ parentElement.appendChild(messageTextElement);
},
_updateRepeatCount: function() {
@@ -890,6 +935,7 @@ WebInspector.ConsoleMessage.prototype = {
var typeString;
switch (this.type) {
case WebInspector.ConsoleMessage.MessageType.Log:
+ case WebInspector.ConsoleMessage.MessageType.UncaughtException:
typeString = "Log";
break;
case WebInspector.ConsoleMessage.MessageType.Object:
@@ -969,7 +1015,8 @@ WebInspector.ConsoleMessage.MessageType = {
StartGroupCollapsed: 4,
EndGroup: 5,
Assert: 6,
- Result: 7
+ UncaughtException: 7,
+ Result: 8
}
WebInspector.ConsoleMessage.MessageLevel = {
@@ -1001,14 +1048,6 @@ WebInspector.ConsoleCommand.prototype = {
}
}
-WebInspector.ConsoleTextMessage = function(text, level)
-{
- level = level || WebInspector.ConsoleMessage.MessageLevel.Log;
- WebInspector.ConsoleMessage.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Log, level, 0, null, null, 1, text);
-}
-
-WebInspector.ConsoleTextMessage.prototype.__proto__ = WebInspector.ConsoleMessage.prototype;
-
WebInspector.ConsoleCommandResult = function(result, exception, originatingCommand)
{
var level = (exception ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
@@ -1023,7 +1062,7 @@ WebInspector.ConsoleCommandResult = function(result, exception, originatingComma
this.originatingCommand = originatingCommand;
- WebInspector.ConsoleMessage.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, line, url, null, 1, message);
+ WebInspector.ConsoleMessage.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, line, url, null, 1, null, [message]);
}
WebInspector.ConsoleCommandResult.prototype = {
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index cd7cbd2..48eb4c0 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -99,7 +99,7 @@ WebInspector.ElementsPanel = function()
this.sidebarResizeElement.addEventListener("mousedown", this.rightSidebarResizerDragStart.bind(this), false);
this._nodeSearchButton = new WebInspector.StatusBarButton(WebInspector.UIString("Select an element in the page to inspect it."), "node-search-status-bar-item");
- this._nodeSearchButton.addEventListener("click", this._nodeSearchButtonClicked.bind(this), false);
+ this._nodeSearchButton.addEventListener("click", this.toggleSearchingForNode.bind(this), false);
this.element.appendChild(this.contentElement);
this.element.appendChild(this.sidebarElement);
@@ -453,7 +453,7 @@ WebInspector.ElementsPanel.prototype = {
}
WebInspector.showConsole();
- WebInspector.console.addMessage(new WebInspector.ConsoleTextMessage(builder.join("\n")));
+ WebInspector.console.addMessage(WebInspector.ConsoleMessage.createTextMessage(builder.join("\n")));
},
get rootDOMNode()
@@ -1092,7 +1092,7 @@ WebInspector.ElementsPanel.prototype = {
var isNodeSearchKey = event.ctrlKey && !event.metaKey && !event.altKey && event.shiftKey;
if (isNodeSearchKey) {
- this._nodeSearchButtonClicked(event);
+ this.toggleSearchingForNode();
event.handled = true;
return;
}
@@ -1136,7 +1136,7 @@ WebInspector.ElementsPanel.prototype = {
this.treeOutline.updateSelection();
},
- _nodeSearchButtonClicked: function(event)
+ toggleSearchingForNode: function()
{
if (!this._nodeSearchButton.toggled)
InspectorBackend.enableSearchingForNode();
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index 1b84b83..7247ba0 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -1205,8 +1205,9 @@ WebInspector.ElementsTreeElement.prototype = {
html += "=&#8203;\"";
if (linkify && (name === "src" || name === "href")) {
+ var rewrittenHref = this._rewriteAttrHref(node, value);
value = value.replace(/([\/;:\)\]\}])/g, "$1\u200B");
- html += linkify(this._rewriteAttrHref(node, value), value, "webkit-html-attribute-value", node.nodeName.toLowerCase() === "a");
+ html += linkify(rewrittenHref, value, "webkit-html-attribute-value", node.nodeName.toLowerCase() === "a");
} else {
value = value.escapeHTML().replace(/([\/;:\)\]\}])/g, "$1&#8203;");
html += "<span class=\"webkit-html-attribute-value\">" + value + "</span>";
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index 5d9d065..9e16dad 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -544,6 +544,8 @@ InjectedScript._type = function(obj)
return "array";
if (obj instanceof inspectedWindow.HTMLCollection)
return "array";
+ if (inspectedWindow.jQuery && obj instanceof inspectedWindow.jQuery)
+ return "array";
if (obj instanceof inspectedWindow.Error)
return "error";
return type;
diff --git a/WebCore/inspector/front-end/InjectedScriptAccess.js b/WebCore/inspector/front-end/InjectedScriptAccess.js
index 90daab7..0e4cc2e 100644
--- a/WebCore/inspector/front-end/InjectedScriptAccess.js
+++ b/WebCore/inspector/front-end/InjectedScriptAccess.js
@@ -58,7 +58,7 @@ InjectedScriptAccess._installHandler = function(methodName, async)
if (!isException)
callback(result);
else
- WebInspector.console.addMessage(new WebInspector.ConsoleTextMessage("Error dispatching: " + methodName));
+ WebInspector.console.addMessage(WebInspector.ConsoleMessage.createTextMessage("Error dispatching: " + methodName));
}
var callId = WebInspector.Callback.wrap(myCallback);
diff --git a/WebCore/inspector/front-end/InspectorBackendStub.js b/WebCore/inspector/front-end/InspectorBackendStub.js
index 761e876..857e026 100644
--- a/WebCore/inspector/front-end/InspectorBackendStub.js
+++ b/WebCore/inspector/front-end/InspectorBackendStub.js
@@ -184,7 +184,7 @@ WebInspector.InspectorBackendStub.prototype = {
this._breakpointsActivated = false;
},
- pauseInDebugger: function()
+ pause: function()
{
},
@@ -203,7 +203,7 @@ WebInspector.InspectorBackendStub.prototype = {
WebInspector.didGetScriptSource(callId, null);
},
- resumeDebugger: function()
+ resume: function()
{
},
@@ -243,15 +243,15 @@ WebInspector.InspectorBackendStub.prototype = {
return [];
},
- stepIntoStatementInDebugger: function()
+ stepIntoStatement: function()
{
},
- stepOutOfFunctionInDebugger: function()
+ stepOutOfFunction: function()
{
},
- stepOverStatementInDebugger: function()
+ stepOverStatement: function()
{
},
diff --git a/WebCore/inspector/front-end/Resource.js b/WebCore/inspector/front-end/Resource.js
index 2ae23a0..06a610d 100644
--- a/WebCore/inspector/front-end/Resource.js
+++ b/WebCore/inspector/front-end/Resource.js
@@ -308,6 +308,17 @@ WebInspector.Resource.prototype = {
}
},
+ get cached()
+ {
+ return this._cached;
+ },
+
+ set cached(x)
+ {
+ this._cached = x;
+ this.dispatchEventToListeners("cached changed");
+ },
+
get mimeType()
{
return this._mimeType;
@@ -587,9 +598,14 @@ WebInspector.Resource.prototype = {
if (!this._mimeTypeIsConsistentWithType())
msg = new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.MessageSource.Other,
WebInspector.ConsoleMessage.MessageType.Log,
- WebInspector.ConsoleMessage.MessageLevel.Warning, -1, this.url, null, 1,
- String.sprintf(WebInspector.Warnings.IncorrectMIMEType.message,
- WebInspector.Resource.Type.toString(this.type), this.mimeType));
+ WebInspector.ConsoleMessage.MessageLevel.Warning,
+ -1,
+ this.url,
+ null,
+ 1,
+ String.sprintf(WebInspector.Warnings.IncorrectMIMEType.message, WebInspector.Resource.Type.toString(this.type), this.mimeType),
+ null,
+ null);
break;
}
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index 8af1505..b02a277 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -228,7 +228,7 @@ WebInspector.ResourcesPanel.prototype = {
var resourcesLength = this._resources.length;
for (var i = 0; i < resourcesLength; ++i) {
var resource = this._resources[i];
- if (!resource._itemsTreeElement)
+ if (!resource._itemsTreeElement || !resource._itemsTreeElement.selectable)
continue;
var resourceView = this.resourceViewForResource(resource);
if (!resourceView.performSearch || resourceView === visibleView)
@@ -751,13 +751,49 @@ WebInspector.ResourcesPanel.prototype = {
{
var tableElement = document.createElement("table");
var resource = anchor.parentElement.resource;
- var data = [WebInspector.UIString("Blocking"), resource.timing.requestTime === 0 ? "?" : Number.secondsToString(Math.max(resource.timing.requestTime - resource.startTime, 0)),
- WebInspector.UIString("Proxy"), resource.timing.proxyDuration == -1 ? WebInspector.UIString("(none)") : Number.secondsToString(resource.timing.proxyDuration),
- WebInspector.UIString("DNS Lookup"), resource.timing.dnsDuration == -1 ? WebInspector.UIString("(reused)") : Number.secondsToString(resource.timing.dnsDuration),
- WebInspector.UIString("Connecting"), resource.timing.connectDuration == -1 ? WebInspector.UIString("(reused)") : Number.secondsToString(resource.timing.connectDuration),
- WebInspector.UIString("Sending"), Number.secondsToString(resource.timing.sendDuration),
- WebInspector.UIString("Waiting"), Number.secondsToString(resource.timing.waitDuration),
- WebInspector.UIString("Receiving"), Number.secondsToString(resource.endTime - resource.responseReceivedTime)];
+ var data = [];
+
+ if (resource.timing.proxyDuration !== -1) {
+ data.push(WebInspector.UIString("Proxy"));
+ data.push(Number.secondsToString(resource.timing.proxyDuration));
+ }
+
+ if (resource.timing.dnsDuration !== -1) {
+ data.push(WebInspector.UIString("DNS Lookup"));
+ data.push(Number.secondsToString(resource.timing.dnsDuration));
+ }
+
+ if (resource.timing.connectDuration !== -1) {
+ if (resource.connectionReused) {
+ data.push(WebInspector.UIString("Blocking"));
+ data.push(Number.secondsToString(resource.timing.connectDuration));
+ } else {
+ data.push(WebInspector.UIString("Connecting"));
+ // Connection includes DNS, subtract it here.
+ var connectDuration = resource.timing.connectDuration;
+ if (resource.timing.dnsDuration !== -1)
+ connectDuration -= resource.timing.dnsDuration;
+ data.push(Number.secondsToString(connectDuration));
+ }
+ }
+
+ if (resource.timing.sslDuration !== -1) {
+ data.push(WebInspector.UIString("SSL"));
+ data.push(Number.secondsToString(resource.timing.sslDuration));
+ }
+
+ data.push(WebInspector.UIString("Sending"));
+ data.push(Number.secondsToString(resource.timing.sendDuration));
+
+ data.push(WebInspector.UIString("Waiting"));
+ // Waiting includes SSL, subtract it here.
+ var waitDuration = resource.timing.waitDuration;
+ if (resource.timing.sslDuration !== -1)
+ waitDuration -= resource.timing.sslDuration;
+ data.push(Number.secondsToString(waitDuration));
+
+ data.push(WebInspector.UIString("Receiving"));
+ data.push(Number.secondsToString(resource.endTime - resource.responseReceivedTime));
for (var i = 0; i < data.length; i += 2) {
var tr = document.createElement("tr");
@@ -1252,8 +1288,7 @@ WebInspector.ResourceGraph = function(resource)
this._graphElement.className = "resources-graph-side";
this._graphElement.addEventListener("mouseover", this.refreshLabelPositions.bind(this), false);
- if (resource.cached)
- this._graphElement.addStyleClass("resource-cached");
+ this._cachedChanged();
this._barAreaElement = document.createElement("div");
this._barAreaElement.className = "resources-graph-bar-area hidden";
@@ -1277,6 +1312,8 @@ WebInspector.ResourceGraph = function(resource)
this._barAreaElement.appendChild(this._labelRightElement);
this._graphElement.addStyleClass("resources-category-" + resource.category.name);
+
+ resource.addEventListener("cached changed", this._cachedChanged, this);
}
WebInspector.ResourceGraph.prototype = {
@@ -1400,5 +1437,11 @@ WebInspector.ResourceGraph.prototype = {
this._labelLeftElement.title = tooltip;
this._labelRightElement.title = tooltip;
this._barRightElement.title = tooltip;
+ },
+
+ _cachedChanged: function()
+ {
+ if (this.resource.cached)
+ this._graphElement.addStyleClass("resource-cached");
}
}
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 3c4a0be..7a1a4d5 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -158,6 +158,8 @@ WebInspector.ScriptsPanel = function()
this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
this.enableToggleButton.addEventListener("click", this._toggleDebugging.bind(this), false);
+ if (Preferences.debuggerAlwaysEnabled)
+ this.enableToggleButton.element.addStyleClass("hidden");
this._pauseOnExceptionButton = new WebInspector.StatusBarButton("", "scripts-pause-on-exceptions-status-bar-item", 3);
this._pauseOnExceptionButton.addEventListener("click", this._togglePauseOnExceptions.bind(this), false);
@@ -931,11 +933,11 @@ WebInspector.ScriptsPanel.prototype = {
if (this._paused) {
this._paused = false;
this._waitingToPause = false;
- InspectorBackend.resumeDebugger();
+ InspectorBackend.resume();
} else {
this._stepping = false;
this._waitingToPause = true;
- InspectorBackend.pauseInDebugger();
+ InspectorBackend.pause();
}
this._clearInterface();
@@ -948,7 +950,7 @@ WebInspector.ScriptsPanel.prototype = {
this._clearInterface();
- InspectorBackend.stepOverStatementInDebugger();
+ InspectorBackend.stepOverStatement();
},
_stepIntoClicked: function()
@@ -958,7 +960,7 @@ WebInspector.ScriptsPanel.prototype = {
this._clearInterface();
- InspectorBackend.stepIntoStatementInDebugger();
+ InspectorBackend.stepIntoStatement();
},
_stepOutClicked: function()
@@ -968,7 +970,7 @@ WebInspector.ScriptsPanel.prototype = {
this._clearInterface();
- InspectorBackend.stepOutOfFunctionInDebugger();
+ InspectorBackend.stepOutOfFunction();
},
_toggleBreakpointsClicked: function()
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js
index 11f456c..39c1e1e 100644
--- a/WebCore/inspector/front-end/Settings.js
+++ b/WebCore/inspector/front-end/Settings.js
@@ -42,7 +42,8 @@ var Preferences = {
showColorNicknames: true,
debuggerAlwaysEnabled: false,
profilerAlwaysEnabled: false,
- auditsPanelEnabled: true
+ auditsPanelEnabled: true,
+ appCacheEnabled: true
}
WebInspector.populateApplicationSettings = function(settingsString)
diff --git a/WebCore/inspector/front-end/SourceCSSTokenizer.js b/WebCore/inspector/front-end/SourceCSSTokenizer.js
index 1d8a784..2179982 100644
--- a/WebCore/inspector/front-end/SourceCSSTokenizer.js
+++ b/WebCore/inspector/front-end/SourceCSSTokenizer.js
@@ -73,8 +73,10 @@ WebInspector.SourceCSSTokenizer = function()
"-webkit-animation-iteration-count", "-webkit-animation-name", "-webkit-animation-play-state",
"-webkit-animation-timing-function", "-webkit-appearance", "-webkit-backface-visibility",
"-webkit-background-clip", "-webkit-background-composite", "-webkit-background-origin", "-webkit-background-size",
- "-webkit-binding", "-webkit-border-fit", "-webkit-border-horizontal-spacing", "-webkit-border-image",
- "-webkit-border-radius", "-webkit-border-vertical-spacing", "-webkit-box-align", "-webkit-box-direction",
+ "-webkit-binding", "-webkit-border-end", "-webkit-border-end-color", "-webkit-border-end-style", "-webkit-border-end-width",
+ "-webkit-border-fit", "-webkit-border-horizontal-spacing", "-webkit-border-image",
+ "-webkit-border-radius", "-webkit-border-start", "-webkit-border-start-color", "-webkit-border-start-style",
+ "-webkit-border-start-width","-webkit-border-vertical-spacing", "-webkit-box-align", "-webkit-box-direction",
"-webkit-box-flex", "-webkit-box-flex-group", "-webkit-box-lines", "-webkit-box-ordinal-group",
"-webkit-box-orient", "-webkit-box-pack", "-webkit-box-reflect", "-webkit-box-shadow", "-webkit-box-sizing",
"-webkit-column-break-after", "-webkit-column-break-before", "-webkit-column-break-inside", "-webkit-column-count",
diff --git a/WebCore/inspector/front-end/StoragePanel.js b/WebCore/inspector/front-end/StoragePanel.js
index 2733907..03a099f 100644
--- a/WebCore/inspector/front-end/StoragePanel.js
+++ b/WebCore/inspector/front-end/StoragePanel.js
@@ -49,9 +49,11 @@ WebInspector.StoragePanel = function(database)
this.sidebarTree.appendChild(this.cookieListTreeElement);
this.cookieListTreeElement.expand();
- this.applicationCacheListTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("APPLICATION CACHE"), {}, true);
- this.sidebarTree.appendChild(this.applicationCacheListTreeElement);
- this.applicationCacheListTreeElement.expand();
+ if (Preferences.appCacheEnabled) {
+ this.applicationCacheListTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("APPLICATION CACHE"), {}, true);
+ this.sidebarTree.appendChild(this.applicationCacheListTreeElement);
+ this.applicationCacheListTreeElement.expand();
+ }
this.storageViews = document.createElement("div");
this.storageViews.id = "storage-views";
@@ -108,7 +110,9 @@ WebInspector.StoragePanel.prototype = {
this.localStorageListTreeElement.removeChildren();
this.sessionStorageListTreeElement.removeChildren();
this.cookieListTreeElement.removeChildren();
- this.applicationCacheListTreeElement.removeChildren();
+
+ if (Preferences.appCacheEnabled)
+ this.applicationCacheListTreeElement.removeChildren();
this.storageViews.removeChildren();
@@ -146,6 +150,8 @@ WebInspector.StoragePanel.prototype = {
addApplicationCache: function(domain)
{
+ if (!Preferences.appCacheEnabled)
+ return;
var applicationCacheTreeElement = new WebInspector.ApplicationCacheSidebarTreeElement(domain);
this.applicationCacheListTreeElement.appendChild(applicationCacheTreeElement);
},
diff --git a/WebCore/inspector/front-end/TimelinePanel.js b/WebCore/inspector/front-end/TimelinePanel.js
index 1f12625..8900d8d 100644
--- a/WebCore/inspector/front-end/TimelinePanel.js
+++ b/WebCore/inspector/front-end/TimelinePanel.js
@@ -841,10 +841,8 @@ WebInspector.TimelinePanel.FormattedRecord = function(record, parentRecord, pane
this._selfTime = this.endTime - this.startTime;
this._lastChildEndTime = this.endTime;
this.originalRecordForTests = record;
- if (record.stackTrace && record.stackTrace.length) {
- this.callerScriptName = record.stackTrace[0].scriptName;
- this.callerScriptLine = record.stackTrace[0].lineNumber;
- }
+ if (record.stackTrace && record.stackTrace.length)
+ this.stackTrace = record.stackTrace;
this.totalHeapSize = record.totalHeapSize;
this.usedHeapSize = record.usedHeapSize;
@@ -877,8 +875,7 @@ WebInspector.TimelinePanel.FormattedRecord = function(record, parentRecord, pane
} else if (record.type === recordTypes.TimerFire) {
var timerInstalledRecord = panel._timerRecords[record.data.timerId];
if (timerInstalledRecord) {
- this.callSiteScriptName = timerInstalledRecord.callerScriptName;
- this.callSiteScriptLine = timerInstalledRecord.callerScriptLine;
+ this.callSiteStackTrace = timerInstalledRecord.stackTrace;
this.timeout = timerInstalledRecord.timeout;
this.singleShot = timerInstalledRecord.singleShot;
}
@@ -940,8 +937,6 @@ WebInspector.TimelinePanel.FormattedRecord.prototype = {
contentHelper._appendTextRow(WebInspector.UIString("Timeout"), Number.secondsToString(this.timeout / 1000, WebInspector.UIString));
contentHelper._appendTextRow(WebInspector.UIString("Repeats"), !this.singleShot);
}
- if (typeof this.callSiteScriptLine === "number")
- contentHelper._appendLinkRow(WebInspector.UIString("Call Site"), this.callSiteScriptName, this.callSiteScriptLine);
break;
case recordTypes.FunctionCall:
contentHelper._appendLinkRow(WebInspector.UIString("Location"), this.data.scriptName, this.data.scriptLine);
@@ -979,12 +974,15 @@ WebInspector.TimelinePanel.FormattedRecord.prototype = {
if (this.data.scriptName && this.type !== recordTypes.FunctionCall)
contentHelper._appendLinkRow(WebInspector.UIString("Function Call"), this.data.scriptName, this.data.scriptLine);
- if (this.callerScriptName && this.type !== recordTypes.GCEvent)
- contentHelper._appendLinkRow(WebInspector.UIString("Caller"), this.callerScriptName, this.callerScriptLine);
-
if (this.usedHeapSize)
contentHelper._appendTextRow(WebInspector.UIString("Used Heap Size"), WebInspector.UIString("%s of %s", Number.bytesToString(this.usedHeapSize, WebInspector.UIString), Number.bytesToString(this.totalHeapSize, WebInspector.UIString)));
+ if (this.callSiteStackTrace && this.callSiteStackTrace.length)
+ contentHelper._appendStackTrace(WebInspector.UIString("Call Site stack"), this.callSiteStackTrace);
+
+ if (this.stackTrace)
+ contentHelper._appendStackTrace(WebInspector.UIString("Call Stack"), this.stackTrace);
+
return contentHelper._contentTable;
},
@@ -1003,10 +1001,10 @@ WebInspector.TimelinePanel.FormattedRecord.prototype = {
return record.data.width + "\u2009\u00d7\u2009" + record.data.height;
case WebInspector.TimelineAgent.RecordType.TimerInstall:
case WebInspector.TimelineAgent.RecordType.TimerRemove:
- return this.callerScriptName ? WebInspector.linkifyResourceAsNode(this.callerScriptName, "scripts", this.callerScriptLine, "", "") : record.data.timerId;
+ return this.stackTrace ? WebInspector.linkifyResourceAsNode(this.stackTrace[0].scriptName, "scripts", this.stackTrace[0].lineNumber, "", "") : record.data.timerId;
case WebInspector.TimelineAgent.RecordType.ParseHTML:
case WebInspector.TimelineAgent.RecordType.RecalculateStyles:
- return this.callerScriptName ? WebInspector.linkifyResourceAsNode(this.callerScriptName, "scripts", this.callerScriptLine, "", "") : null;
+ return this.stackTrace ? WebInspector.linkifyResourceAsNode(this.stackTrace[0].scriptName, "scripts", this.stackTrace[0].lineNumber, "", "") : null;
case WebInspector.TimelineAgent.RecordType.EvaluateScript:
return record.data.url ? WebInspector.linkifyResourceAsNode(record.data.url, "scripts", record.data.lineNumber, "", "") : null;
case WebInspector.TimelineAgent.RecordType.XHRReadyStateChange:
@@ -1075,11 +1073,15 @@ WebInspector.TimelinePanel.PopupContentHelper.prototype = {
this._contentTable.appendChild(row);
},
- _appendElementRow: function(title, content)
+ _appendElementRow: function(title, content, titleStyle)
{
var row = document.createElement("tr");
- row.appendChild(this._createCell(title, "timeline-details-row-title"));
+ var titleCell = this._createCell(title, "timeline-details-row-title");
+ if (titleStyle)
+ titleCell.addStyleClass(titleStyle);
+ row.appendChild(titleCell);
var cell = document.createElement("td");
+ cell.className = "timeline-details";
cell.appendChild(content);
row.appendChild(cell);
this._contentTable.appendChild(row);
@@ -1089,6 +1091,24 @@ WebInspector.TimelinePanel.PopupContentHelper.prototype = {
{
var link = WebInspector.linkifyResourceAsNode(scriptName, "scripts", scriptLine, "timeline-details");
this._appendElementRow(title, link);
+ },
+
+ _appendStackTrace: function(title, stackTrace)
+ {
+ this._appendTextRow("", "");
+ var framesTable = document.createElement("table");
+ for (var i = 0; i < stackTrace.length; ++i) {
+ var stackFrame = stackTrace[i];
+ var row = document.createElement("tr");
+ row.className = "timeline-details";
+ row.appendChild(this._createCell(stackFrame.functionName ? stackFrame.functionName : WebInspector.UIString("(anonymous function)"), "timeline-function-name"));
+ row.appendChild(this._createCell(" @ "));
+ var linkCell = document.createElement("td");
+ linkCell.appendChild(WebInspector.linkifyResourceAsNode(stackFrame.scriptName, "scripts", stackFrame.lineNumber, "timeline-details"));
+ row.appendChild(linkCell);
+ framesTable.appendChild(row);
+ }
+ this._appendElementRow(title, framesTable, "timeline-stacktrace-title");
}
}
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index d8e29e8..f1ee49f 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -711,6 +711,11 @@ 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;
@@ -1164,6 +1169,7 @@ 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;
@@ -1173,26 +1179,32 @@ 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;
}
@@ -1372,14 +1384,18 @@ body.inactive .placard.selected {
margin-left: 1px;
}
-.section .properties ol, .event-properties ol {
+.section .properties ol, .event-properties ol, .stack-trace ol, ol.stack-trace {
display: none;
margin: 0;
-webkit-padding-start: 12px;
list-style: none;
}
-.section .properties ol.expanded, .event-properties ol.expanded {
+ol.stack-trace {
+ -webkit-padding-start: 0px;
+}
+
+.section .properties ol.expanded, .event-properties ol.expanded, .stack-trace ol, ol.stack-trace {
display: block;
}
@@ -1474,7 +1490,7 @@ body.inactive .placard.selected {
outline: 1px solid rgb(66%, 66%, 66%) !important;
background-color: white;
-webkit-user-modify: read-write-plaintext-only;
- text-overflow: clip;
+ text-overflow: clip !important;
padding-left: 2px;
margin-left: -2px;
padding-right: 2px;
@@ -3677,6 +3693,15 @@ body.inactive .sidebar-tree-item.selected .bubble.search-matches {
.timeline-details {
-webkit-user-select: text;
+ vertical-align: top;
+}
+
+.timeline-function-name {
+ text-align: right;
+}
+
+.timeline-stacktrace-title {
+ padding-top: 4px;
}
.timeline-details-row-title {
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 89d1ae0..5ec7081 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -1071,6 +1071,14 @@ WebInspector.elementDragEnd = function(event)
event.preventDefault();
}
+WebInspector.toggleSearchingForNode = function()
+{
+ if (this.panels.elements) {
+ this.showElementsPanel();
+ this.panels.elements.toggleSearchingForNode();
+ }
+}
+
WebInspector.showConsole = function()
{
this.drawer.showView(this.console);
@@ -1159,7 +1167,6 @@ WebInspector.updateResource = function(identifier, payload)
resource.mainResource = payload.mainResource;
resource.requestMethod = payload.requestMethod;
resource.requestFormData = payload.requestFormData;
- resource.cached = payload.cached;
resource.documentURL = payload.documentURL;
if (resource.mainResource)
@@ -1182,7 +1189,9 @@ WebInspector.updateResource = function(identifier, payload)
resource.suggestedFilename = payload.suggestedFilename;
resource.responseHeaders = payload.responseHeaders;
resource.connectionID = payload.connectionID;
+ resource.connectionReused = payload.connectionReused;
resource.timing = payload.timing;
+ resource.cached = payload.cached;
}
if (payload.didTypeChange) {
@@ -1455,10 +1464,10 @@ WebInspector.didCommitLoad = function()
WebInspector.updateConsoleMessageExpiredCount = function(count)
{
var message = String.sprintf(WebInspector.UIString("%d console messages are not shown."), count);
- WebInspector.console.addMessage(new WebInspector.ConsoleTextMessage(message, WebInspector.ConsoleMessage.MessageLevel.Warning));
+ WebInspector.console.addMessage(WebInspector.ConsoleMessage.createTextMessage(message, WebInspector.ConsoleMessage.MessageLevel.Warning));
}
-WebInspector.addConsoleMessage = function(payload, opt_args)
+WebInspector.addConsoleMessage = function(payload)
{
var consoleMessage = new WebInspector.ConsoleMessage(
payload.source,
@@ -1467,8 +1476,10 @@ WebInspector.addConsoleMessage = function(payload, opt_args)
payload.line,
payload.url,
payload.groupLevel,
- payload.repeatCount);
- consoleMessage.setMessageBody(Array.prototype.slice.call(arguments, 1));
+ payload.repeatCount,
+ payload.message,
+ payload.parameters,
+ payload.stackTrace);
this.console.addMessage(consoleMessage);
}
@@ -1536,7 +1547,9 @@ WebInspector.log = function(message, messageLevel)
null,
null,
repeatCount,
- message);
+ null,
+ [message],
+ null);
self.console.addMessage(msg);
}
@@ -1830,8 +1843,12 @@ WebInspector._searchKeyDown = function(event)
WebInspector.performSearch = function(event)
{
- var query = event.target.value;
var forceSearch = event.keyIdentifier === "Enter";
+ this.doPerformSearch(event.target.value, forceSearch, event.shiftKey, false);
+}
+
+WebInspector.doPerformSearch = function(query, forceSearch, isBackwardSearch, repeatSearch)
+{
var isShortSearch = (query.length < 3);
// Clear a leftover short search flag due to a non-conflicting forced search.
@@ -1863,11 +1880,15 @@ WebInspector.performSearch = function(event)
return;
}
- if (query === this.currentPanel.currentQuery && this.currentPanel.currentQuery === this.currentQuery) {
+ if (!repeatSearch && query === this.currentPanel.currentQuery && this.currentPanel.currentQuery === this.currentQuery) {
// When this is the same query and a forced search, jump to the next
// search result for a good user experience.
- if (forceSearch && this.currentPanel.jumpToNextSearchResult)
- this.currentPanel.jumpToNextSearchResult();
+ if (forceSearch) {
+ if (!isBackwardSearch && this.currentPanel.jumpToNextSearchResult)
+ this.currentPanel.jumpToNextSearchResult();
+ else if (isBackwardSearch && this.currentPanel.jumpToPreviousSearchResult)
+ this.currentPanel.jumpToPreviousSearchResult();
+ }
return;
}
diff --git a/WebCore/inspector/front-end/treeoutline.js b/WebCore/inspector/front-end/treeoutline.js
index 297bbab..5891401 100644
--- a/WebCore/inspector/front-end/treeoutline.js
+++ b/WebCore/inspector/front-end/treeoutline.js
@@ -482,8 +482,7 @@ TreeElement.prototype = {
set title(x) {
this._title = x;
- if (this._listItemNode)
- this._listItemNode.innerHTML = x;
+ this._setListItemNodeContent();
},
get tooltip() {
@@ -548,6 +547,20 @@ TreeElement.prototype = {
this._shouldRefreshChildren = x;
if (x && this.expanded)
this.expand();
+ },
+
+ _setListItemNodeContent: function()
+ {
+ if (!this._listItemNode)
+ return;
+ if (!this._title || typeof this._title === "string")
+ this._listItemNode.innerHTML = this._title;
+ else {
+ this._listItemNode.removeChildren();
+ if (this._title.parentNode)
+ this._title.parentNode.removeChild(this._title);
+ this._listItemNode.appendChild(this._title);
+ }
}
}
@@ -566,7 +579,7 @@ TreeElement.prototype._attach = function()
this._listItemNode = this.treeOutline._childrenListNode.ownerDocument.createElement("li");
this._listItemNode.treeElement = this;
- this._listItemNode.innerHTML = this._title;
+ this._setListItemNodeContent();
this._listItemNode.title = this._tooltip ? this._tooltip : "";
if (this.hidden)
diff --git a/WebCore/inspector/front-end/utilities.js b/WebCore/inspector/front-end/utilities.js
index 1312e5b..6e7c725 100644
--- a/WebCore/inspector/front-end/utilities.js
+++ b/WebCore/inspector/front-end/utilities.js
@@ -188,8 +188,9 @@ Element.prototype.removeStyleClass = function(className)
if (index === -1)
return;
- var newClassName = " " + this.className + " ";
- this.className = newClassName.replace(" " + className + " ", " ");
+ this.className = this.className.split(" ").filter(function(s) {
+ return s && s !== className;
+ }).join(" ");
}
Element.prototype.removeMatchingStyleClasses = function(classNameRegex)
diff --git a/WebCore/loader/CachedScript.cpp b/WebCore/loader/CachedScript.cpp
index e3d618a..58895d6 100644
--- a/WebCore/loader/CachedScript.cpp
+++ b/WebCore/loader/CachedScript.cpp
@@ -37,7 +37,6 @@ namespace WebCore {
CachedScript::CachedScript(const String& url, const String& charset)
: CachedResource(url, Script)
- , m_scriptHasBOMs(SourceCouldHaveBOMs)
, m_decoder(TextResourceDecoder::create("application/javascript", charset))
, m_decodedDataDeletionTimer(this, &CachedScript::decodedDataDeletionTimerFired)
{
@@ -73,14 +72,8 @@ const String& CachedScript::script()
if (!m_script && m_data) {
m_script = m_decoder->decode(m_data->data(), encodedSize());
m_script += m_decoder->flush();
- if (m_scriptHasBOMs != SourceHasNoBOMs && m_script.length()) {
- bool hasBOMs = false;
- m_script = String(m_script.impl()->copyStringWithoutBOMs(m_scriptHasBOMs == SourceHasBOMs, hasBOMs));
- m_scriptHasBOMs = hasBOMs ? SourceHasBOMs : SourceHasNoBOMs;
- }
setDecodedSize(m_script.length() * sizeof(UChar));
}
-
m_decodedDataDeletionTimer.startOneShot(0);
return m_script;
}
diff --git a/WebCore/loader/CachedScript.h b/WebCore/loader/CachedScript.h
index a36d735..beab508 100644
--- a/WebCore/loader/CachedScript.h
+++ b/WebCore/loader/CachedScript.h
@@ -56,7 +56,6 @@ namespace WebCore {
void decodedDataDeletionTimerFired(Timer<CachedScript>*);
String m_script;
- enum { SourceHasNoBOMs, SourceCouldHaveBOMs, SourceHasBOMs } m_scriptHasBOMs;
RefPtr<TextResourceDecoder> m_decoder;
Timer<CachedScript> m_decodedDataDeletionTimer;
};
diff --git a/WebCore/loader/DocumentLoader.h b/WebCore/loader/DocumentLoader.h
index ea6f58b..f5935c9 100644
--- a/WebCore/loader/DocumentLoader.h
+++ b/WebCore/loader/DocumentLoader.h
@@ -209,6 +209,8 @@ namespace WebCore {
void recordMemoryCacheLoadForFutureClientNotification(const String& url);
void takeMemoryCacheLoadsForClientNotification(Vector<String>& loads);
+ DocumentLoadTiming* timing() { return &m_documentLoadTiming; }
+
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
ApplicationCacheHost* applicationCacheHost() const { return m_applicationCacheHost.get(); }
#endif
@@ -300,6 +302,8 @@ namespace WebCore {
String m_clientRedirectSourceForHistory;
bool m_didCreateGlobalHistoryEntry;
+ DocumentLoadTiming m_documentLoadTiming;
+
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
friend class ApplicationCacheHost; // for substitute resource delivery
OwnPtr<ApplicationCacheHost> m_applicationCacheHost;
diff --git a/WebCore/loader/DocumentThreadableLoader.cpp b/WebCore/loader/DocumentThreadableLoader.cpp
index 4a7a88b..16f114d 100644
--- a/WebCore/loader/DocumentThreadableLoader.cpp
+++ b/WebCore/loader/DocumentThreadableLoader.cpp
@@ -37,10 +37,12 @@
#include "Document.h"
#include "Frame.h"
#include "FrameLoader.h"
+#include "ResourceHandle.h"
#include "ResourceRequest.h"
#include "SecurityOrigin.h"
#include "SubresourceLoader.h"
#include "ThreadableLoaderClient.h"
+#include <wtf/UnusedParam.h>
namespace WebCore {
@@ -264,14 +266,20 @@ bool DocumentThreadableLoader::getShouldUseCredentialStorage(SubresourceLoader*
return false; // Only FrameLoaderClient can ultimately permit credential use.
}
-void DocumentThreadableLoader::didReceiveAuthenticationChallenge(SubresourceLoader* loader, const AuthenticationChallenge&)
+void DocumentThreadableLoader::didReceiveAuthenticationChallenge(SubresourceLoader* loader, const AuthenticationChallenge& challenge)
{
ASSERT(loader == m_loader);
// Users are not prompted for credentials for cross-origin requests.
if (!m_sameOriginRequest) {
+#if PLATFORM(MAC) || USE(CFNETWORK) || USE(CURL)
+ loader->handle()->receivedRequestToContinueWithoutCredential(challenge);
+#else
+ // These platforms don't provide a way to continue without credentials, cancel the load altogether.
+ UNUSED_PARAM(challenge);
RefPtr<DocumentThreadableLoader> protect(this);
m_client->didFail(loader->blockedError());
cancel();
+#endif
}
}
diff --git a/WebCore/loader/EmptyClients.h b/WebCore/loader/EmptyClients.h
index 869de22..aab30fc 100644
--- a/WebCore/loader/EmptyClients.h
+++ b/WebCore/loader/EmptyClients.h
@@ -157,7 +157,7 @@ public:
virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
- virtual bool setCursor(PlatformCursorHandle) { return false; }
+ virtual void setCursor(const Cursor&) { }
virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const {}
@@ -170,6 +170,9 @@ public:
virtual void scheduleCompositingLayerSync() {};
#endif
+#if PLATFORM(WIN)
+ virtual void setLastSetCursorToCurrentCursor() { }
+#endif
#if ENABLE(TOUCH_EVENTS)
virtual void needTouchEvents(bool) { }
#endif
@@ -309,6 +312,8 @@ public:
virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, const Vector<String>&, const Vector<String>&) { return 0; }
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
virtual PassRefPtr<Widget> createMediaPlayerProxyPlugin(const IntSize&, HTMLMediaElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&) { return 0; }
+ virtual void hideMediaPlayerProxyPlugin(Widget*) { }
+ virtual void showMediaPlayerProxyPlugin(Widget*) { }
#endif
virtual ObjectContentType objectContentType(const KURL&, const String&) { return ObjectContentType(); }
@@ -439,6 +444,7 @@ public:
virtual void showSpellingUI(bool) { }
virtual bool spellingUIIsShowing() { return false; }
virtual void getGuessesForWord(const String&, Vector<String>&) { }
+ virtual void willSetInputMethodState() { }
virtual void setInputMethodState(bool) { }
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 7b7487f..0ec4c98 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -66,6 +66,9 @@
#endif // PLATFORM(ANDROID)
#include "HTMLAnchorElement.h"
#include "HTMLFormElement.h"
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+#include "HTMLMediaElement.h"
+#endif
#include "HTMLNames.h"
#include "HTMLObjectElement.h"
#include "HTTPParsers.h"
@@ -104,11 +107,6 @@
#include <wtf/StdLibExtras.h>
#include <wtf/text/CString.h>
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-#include "HTMLMediaElement.h"
-#include "RenderVideo.h"
-#endif
-
#if ENABLE(SHARED_WORKERS)
#include "SharedWorkerRepository.h"
#endif
@@ -460,9 +458,18 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolic
if (m_frame->domWindow()) {
if (unloadEventPolicy == UnloadEventPolicyUnloadAndPageHide)
m_frame->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, m_frame->document()->inPageCache()), m_frame->document());
- if (!m_frame->document()->inPageCache())
+ if (!m_frame->document()->inPageCache()) {
m_frame->domWindow()->dispatchEvent(Event::create(eventNames().unloadEvent, false, false), m_frame->domWindow()->document());
- m_frameLoadTimeline.unloadEventEnd = currentTime();
+
+ if (m_provisionalDocumentLoader) {
+ DocumentLoadTiming* timing = m_provisionalDocumentLoader->timing();
+ ASSERT(timing->navigationStart);
+ // FIXME: This fails in Safari (https://bugs.webkit.org/show_bug.cgi?id=42772). Understand why.
+ // ASSERT(!timing->unloadEventEnd);
+ timing->unloadEventEnd = currentTime();
+ ASSERT(timing->unloadEventEnd >= timing->navigationStart);
+ }
+ }
}
m_pageDismissalEventBeingDispatched = false;
if (m_frame->document())
@@ -1531,9 +1538,6 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t
if (m_pageDismissalEventBeingDispatched)
return;
- m_frameLoadTimeline = FrameLoadTimeline();
- m_frameLoadTimeline.navigationStart = currentTime();
-
policyChecker()->setLoadType(type);
RefPtr<FormState> formState = prpFormState;
bool isFormSubmission = formState;
@@ -2249,6 +2253,8 @@ void FrameLoader::finishedLoading()
RefPtr<Frame> protect(m_frame);
RefPtr<DocumentLoader> dl = activeDocumentLoader();
+ ASSERT(!dl->timing()->responseEnd);
+ dl->timing()->responseEnd = currentTime();
dl->finishedLoading();
if (!dl->mainDocumentError().isNull() || !dl->frameLoader())
return;
@@ -2367,6 +2373,9 @@ bool FrameLoader::subframeIsLoading() const
documentLoader = childLoader->provisionalDocumentLoader();
if (documentLoader && documentLoader->isLoadingInAPISense())
return true;
+ documentLoader = childLoader->policyDocumentLoader();
+ if (documentLoader)
+ return true;
}
return false;
}
@@ -2546,6 +2555,9 @@ void FrameLoader::continueLoadAfterWillSubmitForm()
notifier()->assignIdentifierToInitialRequest(identifier, m_provisionalDocumentLoader.get(), m_provisionalDocumentLoader->originalRequest());
}
+ ASSERT(!m_provisionalDocumentLoader->timing()->navigationStart);
+ m_provisionalDocumentLoader->timing()->navigationStart = currentTime();
+
if (!m_provisionalDocumentLoader->startLoadingMainResource(identifier))
m_provisionalDocumentLoader->updateLoading();
}
@@ -2649,8 +2661,6 @@ void FrameLoader::handledOnloadEvents()
{
m_client->dispatchDidHandleOnloadEvents();
- m_loadType = FrameLoadTypeStandard;
-
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
if (documentLoader())
documentLoader()->applicationCacheHost()->stopDeferringEvents();
@@ -2730,7 +2740,14 @@ void FrameLoader::addExtraFieldsToRequest(ResourceRequest& request, FrameLoadTyp
// 2. Delegates that modify the cache policy using willSendRequest: should
// not affect any other resources. Such changes need to be done
// per request.
- if (loadType == FrameLoadTypeReload) {
+ if (!mainResource) {
+ if (request.isConditional())
+ request.setCachePolicy(ReloadIgnoringCacheData);
+ else if (documentLoader()->isLoadingInAPISense())
+ request.setCachePolicy(documentLoader()->originalRequest().cachePolicy());
+ else
+ request.setCachePolicy(UseProtocolCachePolicy);
+ } else if (loadType == FrameLoadTypeReload) {
request.setCachePolicy(ReloadIgnoringCacheData);
request.setHTTPHeaderField("Cache-Control", "max-age=0");
} else if (loadType == FrameLoadTypeReloadFromOrigin) {
@@ -2739,10 +2756,8 @@ void FrameLoader::addExtraFieldsToRequest(ResourceRequest& request, FrameLoadTyp
request.setHTTPHeaderField("Pragma", "no-cache");
} else if (request.isConditional())
request.setCachePolicy(ReloadIgnoringCacheData);
- else if (isBackForwardLoadType(loadType) && !request.url().protocolIs("https"))
+ else if (isBackForwardLoadType(loadType) && m_stateMachine.committedFirstRealDocumentLoad() && !request.url().protocolIs("https"))
request.setCachePolicy(ReturnCacheDataElseLoad);
- else if (!mainResource && documentLoader()->isLoadingInAPISense())
- request.setCachePolicy(documentLoader()->originalRequest().cachePolicy());
if (mainResource)
request.setHTTPAccept(defaultAcceptHeader);
@@ -3038,7 +3053,7 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest&, Pass
#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR) && USE(JSC)
if (Page* page = m_frame->page()) {
if (page->mainFrame() == m_frame)
- page->inspectorController()->resumeDebugger();
+ page->inspectorController()->resume();
}
#endif
@@ -3114,14 +3129,13 @@ void FrameLoader::loadedResourceFromMemoryCache(const CachedResource* resource)
if (!page)
return;
-#if ENABLE(INSPECTOR)
- page->inspectorController()->didLoadResourceFromMemoryCache(m_documentLoader.get(), resource);
-#endif
-
if (!resource->sendResourceLoadCallbacks() || m_documentLoader->haveToldClientAboutLoad(resource->url()))
return;
if (!page->areMemoryCacheClientCallsEnabled()) {
+#if ENABLE(INSPECTOR)
+ page->inspectorController()->didLoadResourceFromMemoryCache(m_documentLoader.get(), resource);
+#endif
m_documentLoader->recordMemoryCacheLoadForFutureClientNotification(resource->url());
m_documentLoader->didTellClientAboutLoad(resource->url());
return;
@@ -3129,6 +3143,9 @@ void FrameLoader::loadedResourceFromMemoryCache(const CachedResource* resource)
ResourceRequest request(resource->url());
if (m_client->dispatchDidLoadResourceFromMemoryCache(m_documentLoader.get(), request, resource->response(), resource->encodedSize())) {
+#if ENABLE(INSPECTOR)
+ page->inspectorController()->didLoadResourceFromMemoryCache(m_documentLoader.get(), resource);
+#endif
m_documentLoader->didTellClientAboutLoad(resource->url());
return;
}
@@ -3289,7 +3306,9 @@ void FrameLoader::navigateToDifferentDocument(HistoryItem* item, FrameLoadType l
case FrameLoadTypeBackWMLDeckNotAccessible:
case FrameLoadTypeForward:
case FrameLoadTypeIndexedBackForward:
- if (!itemURL.protocolIs("https"))
+ // If the first load within a frame is a navigation within a back/forward list that was attached
+ // without any of the items being loaded then we should use the default caching policy (<rdar://problem/8131355>).
+ if (m_stateMachine.committedFirstRealDocumentLoad() && !itemURL.protocolIs("https"))
request.setCachePolicy(ReturnCacheDataElseLoad);
break;
case FrameLoadTypeStandard:
diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h
index 491e6ef..de043d2 100644
--- a/WebCore/loader/FrameLoader.h
+++ b/WebCore/loader/FrameLoader.h
@@ -197,7 +197,6 @@ public:
void didChangeIcons(DocumentLoader*);
FrameLoadType loadType() const;
- FrameLoadTimeline* frameLoadTimeline() { return &m_frameLoadTimeline; }
CachePolicy subresourceCachePolicy() const;
@@ -450,7 +449,6 @@ private:
FrameState m_state;
FrameLoadType m_loadType;
- FrameLoadTimeline m_frameLoadTimeline;
// Document loaders for the three phases of frame loading. Note that while
// a new request is being loaded, the old document loader may still be referenced.
diff --git a/WebCore/loader/FrameLoaderClient.h b/WebCore/loader/FrameLoaderClient.h
index c74933b..c7bd456 100644
--- a/WebCore/loader/FrameLoaderClient.h
+++ b/WebCore/loader/FrameLoaderClient.h
@@ -237,6 +237,8 @@ namespace WebCore {
virtual void dispatchDidFailToStartPlugin(const PluginView*) const { }
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
virtual PassRefPtr<Widget> createMediaPlayerProxyPlugin(const IntSize&, HTMLMediaElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&) = 0;
+ virtual void hideMediaPlayerProxyPlugin(Widget*) = 0;
+ virtual void showMediaPlayerProxyPlugin(Widget*) = 0;
#endif
virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType) = 0;
diff --git a/WebCore/loader/FrameLoaderTypes.h b/WebCore/loader/FrameLoaderTypes.h
index b1388a5..387b067 100644
--- a/WebCore/loader/FrameLoaderTypes.h
+++ b/WebCore/loader/FrameLoaderTypes.h
@@ -60,17 +60,28 @@ namespace WebCore {
FrameLoadTypeBackWMLDeckNotAccessible
};
- struct FrameLoadTimeline {
- FrameLoadTimeline()
- : navigationStart(0)
- , unloadEventEnd(0)
- , loadEventStart(0)
- , loadEventEnd(0)
+ // FIXME: Move to DocumentLoadTiming.h.
+ struct DocumentLoadTiming {
+ DocumentLoadTiming()
+ : navigationStart(0.0)
+ , unloadEventEnd(0.0)
+ , redirectStart(0.0)
+ , redirectEnd(0.0)
+ , redirectCount(0)
+ , fetchStart(0.0)
+ , responseEnd(0.0)
+ , loadEventStart(0.0)
+ , loadEventEnd(0.0)
{
}
double navigationStart;
double unloadEventEnd;
+ double redirectStart;
+ double redirectEnd;
+ short redirectCount;
+ double fetchStart;
+ double responseEnd;
double loadEventStart;
double loadEventEnd;
};
diff --git a/WebCore/loader/MainResourceLoader.cpp b/WebCore/loader/MainResourceLoader.cpp
index 0a5bf40..504a5ea 100644
--- a/WebCore/loader/MainResourceLoader.cpp
+++ b/WebCore/loader/MainResourceLoader.cpp
@@ -44,6 +44,7 @@
#include "ResourceError.h"
#include "ResourceHandle.h"
#include "Settings.h"
+#include <wtf/CurrentTime.h>
// FIXME: More that is in common with SubresourceLoader should move up into ResourceLoader.
@@ -157,7 +158,17 @@ void MainResourceLoader::willSendRequest(ResourceRequest& newRequest, const Reso
// The additional processing can do anything including possibly removing the last
// reference to this object; one example of this is 3266216.
RefPtr<MainResourceLoader> protect(this);
-
+
+ ASSERT(documentLoader()->timing()->fetchStart);
+ if (!redirectResponse.isNull()) {
+ DocumentLoadTiming* documentLoadTiming = documentLoader()->timing();
+ documentLoadTiming->redirectCount++;
+ if (!documentLoadTiming->redirectStart)
+ documentLoadTiming->redirectStart = documentLoadTiming->fetchStart;
+ documentLoadTiming->redirectEnd = currentTime();
+ documentLoadTiming->fetchStart = documentLoadTiming->redirectEnd;
+ }
+
// Update cookie policy base URL as URL changes, except for subframes, which use the
// URL of the main frame which doesn't change when we redirect.
if (frameLoader()->isLoadingMainFrame())
@@ -223,7 +234,7 @@ void MainResourceLoader::continueAfterContentPolicy(PolicyAction contentPolicy,
receivedError(cannotShowURLError());
return;
}
- frameLoader()->client()->download(m_handle.get(), request(), m_handle.get()->request(), r);
+ frameLoader()->client()->download(m_handle.get(), request(), m_handle.get()->firstRequest(), r);
// It might have gone missing
if (frameLoader())
receivedError(interruptionForPolicyChangeError());
@@ -464,6 +475,10 @@ void MainResourceLoader::handleDataLoadNow(MainResourceLoaderTimer*)
KURL url = m_substituteData.responseURL();
if (url.isEmpty())
url = m_initialRequest.url();
+
+ // Clear the initial request here so that subsequent entries into the
+ // loader will not think there's still a deferred load left to do.
+ m_initialRequest = ResourceRequest();
ResourceResponse response(url, m_substituteData.mimeType(), m_substituteData.content()->size(), m_substituteData.textEncoding(), "");
didReceiveResponse(response);
@@ -528,6 +543,9 @@ bool MainResourceLoader::load(const ResourceRequest& r, const SubstituteData& su
m_substituteData = substituteData;
+ ASSERT(documentLoader()->timing()->navigationStart);
+ ASSERT(!documentLoader()->timing()->fetchStart);
+ documentLoader()->timing()->fetchStart = currentTime();
ResourceRequest request(r);
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
diff --git a/WebCore/loader/SubframeLoader.cpp b/WebCore/loader/SubframeLoader.cpp
index f5a4c18..2206b4e 100644
--- a/WebCore/loader/SubframeLoader.cpp
+++ b/WebCore/loader/SubframeLoader.cpp
@@ -179,12 +179,23 @@ PassRefPtr<Widget> FrameLoader::loadMediaPlayerProxyPlugin(Node* node, const KUR
if (widget && renderer) {
renderer->setWidget(widget);
- m_containsPlugIns = true;
renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange);
}
+ m_containsPlugIns = true;
return widget ? widget.release() : 0;
}
+
+void FrameLoader::hideMediaPlayerProxyPlugin(Widget* widget)
+{
+ m_client->hideMediaPlayerProxyPlugin(widget);
+}
+
+void FrameLoader::showMediaPlayerProxyPlugin(Widget* widget)
+{
+ m_client->showMediaPlayerProxyPlugin(widget);
+}
+
#endif // ENABLE(PLUGIN_PROXY_FOR_VIDEO)
PassRefPtr<Widget> SubframeLoader::createJavaAppletWidget(const IntSize& size, HTMLAppletElement* element, const HashMap<String, String>& args)
@@ -272,7 +283,7 @@ Frame* SubframeLoader::loadSubframe(HTMLFrameOwnerElement* ownerElement, const K
// FIXME: In this case the Frame will have finished loading before
// it's being added to the child list. It would be a good idea to
// create the child first, then invoke the loader separately.
- if (frame->loader()->state() == FrameStateComplete)
+ if (frame->loader()->state() == FrameStateComplete && !frame->loader()->policyDocumentLoader())
frame->loader()->checkCompleted();
return frame.get();
diff --git a/WebCore/loader/SubresourceLoader.cpp b/WebCore/loader/SubresourceLoader.cpp
index 7aef353..1e22fb1 100644
--- a/WebCore/loader/SubresourceLoader.cpp
+++ b/WebCore/loader/SubresourceLoader.cpp
@@ -248,14 +248,20 @@ void SubresourceLoader::didReceiveAuthenticationChallenge(const AuthenticationCh
{
RefPtr<SubresourceLoader> protect(this);
+ ASSERT(handle()->hasAuthenticationChallenge());
+
if (m_client)
m_client->didReceiveAuthenticationChallenge(this, challenge);
// The SubResourceLoaderClient may have cancelled this ResourceLoader in response to the challenge.
- // If that's the case, don't call didReceiveAuthenticationChallenge
+ // If that's the case, don't call didReceiveAuthenticationChallenge.
if (reachedTerminalState())
return;
-
+
+ // It may have also handled authentication on its own.
+ if (!handle()->hasAuthenticationChallenge())
+ return;
+
ResourceLoader::didReceiveAuthenticationChallenge(challenge);
}
diff --git a/WebCore/loader/appcache/ApplicationCacheGroup.cpp b/WebCore/loader/appcache/ApplicationCacheGroup.cpp
index 2effba7..9b05e0d 100644
--- a/WebCore/loader/appcache/ApplicationCacheGroup.cpp
+++ b/WebCore/loader/appcache/ApplicationCacheGroup.cpp
@@ -481,7 +481,7 @@ PassRefPtr<ResourceHandle> ApplicationCacheGroup::createResourceHandle(const KUR
m_currentResourceIdentifier = m_frame->page()->progress()->createUniqueIdentifier();
if (Page* page = m_frame->page()) {
InspectorController* inspectorController = page->inspectorController();
- inspectorController->identifierForInitialRequest(m_currentResourceIdentifier, m_frame->loader()->documentLoader(), handle->request());
+ inspectorController->identifierForInitialRequest(m_currentResourceIdentifier, m_frame->loader()->documentLoader(), handle->firstRequest());
ResourceResponse redirectResponse = ResourceResponse();
inspectorController->willSendRequest(m_currentResourceIdentifier, request, redirectResponse);
}
@@ -517,7 +517,7 @@ void ApplicationCacheGroup::didReceiveResponse(ResourceHandle* handle, const Res
ASSERT(handle == m_currentHandle);
- KURL url(handle->request().url());
+ KURL url(handle->firstRequest().url());
if (url.hasFragmentIdentifier())
url.removeFragmentIdentifier();
@@ -534,7 +534,7 @@ void ApplicationCacheGroup::didReceiveResponse(ResourceHandle* handle, const Res
ApplicationCacheResource* newestCachedResource = m_newestCache->resourceForURL(url);
if (newestCachedResource) {
m_cacheBeingUpdated->addResource(ApplicationCacheResource::create(url, newestCachedResource->response(), type, newestCachedResource->data()));
- m_pendingEntries.remove(m_currentHandle->request().url());
+ m_pendingEntries.remove(m_currentHandle->firstRequest().url());
m_currentHandle->cancel();
m_currentHandle = 0;
// Load the next resource, if any.
@@ -544,7 +544,7 @@ void ApplicationCacheGroup::didReceiveResponse(ResourceHandle* handle, const Res
// The server could return 304 for an unconditional request - in this case, we handle the response as a normal error.
}
- if (response.httpStatusCode() / 100 != 2 || response.url() != m_currentHandle->request().url()) {
+ if (response.httpStatusCode() / 100 != 2 || response.url() != m_currentHandle->firstRequest().url()) {
if ((type & ApplicationCacheResource::Explicit) || (type & ApplicationCacheResource::Fallback)) {
// Note that cacheUpdateFailed() can cause the cache group to be deleted.
cacheUpdateFailed();
@@ -559,10 +559,10 @@ void ApplicationCacheGroup::didReceiveResponse(ResourceHandle* handle, const Res
// Copy the resource and its metadata from the newest application cache in cache group whose completeness flag is complete, and act
// as if that was the fetched resource, ignoring the resource obtained from the network.
ASSERT(m_newestCache);
- ApplicationCacheResource* newestCachedResource = m_newestCache->resourceForURL(handle->request().url());
+ ApplicationCacheResource* newestCachedResource = m_newestCache->resourceForURL(handle->firstRequest().url());
ASSERT(newestCachedResource);
m_cacheBeingUpdated->addResource(ApplicationCacheResource::create(url, newestCachedResource->response(), type, newestCachedResource->data()));
- m_pendingEntries.remove(m_currentHandle->request().url());
+ m_pendingEntries.remove(m_currentHandle->firstRequest().url());
m_currentHandle->cancel();
m_currentHandle = 0;
// Load the next resource, if any.
@@ -607,9 +607,9 @@ void ApplicationCacheGroup::didFinishLoading(ResourceHandle* handle)
}
ASSERT(m_currentHandle == handle);
- ASSERT(m_pendingEntries.contains(handle->request().url()));
+ ASSERT(m_pendingEntries.contains(handle->firstRequest().url()));
- m_pendingEntries.remove(handle->request().url());
+ m_pendingEntries.remove(handle->firstRequest().url());
ASSERT(m_cacheBeingUpdated);
@@ -634,8 +634,8 @@ void ApplicationCacheGroup::didFail(ResourceHandle* handle, const ResourceError&
return;
}
- unsigned type = m_currentResource ? m_currentResource->type() : m_pendingEntries.get(handle->request().url());
- KURL url(handle->request().url());
+ unsigned type = m_currentResource ? m_currentResource->type() : m_pendingEntries.get(handle->firstRequest().url());
+ KURL url(handle->firstRequest().url());
if (url.hasFragmentIdentifier())
url.removeFragmentIdentifier();
@@ -671,13 +671,12 @@ void ApplicationCacheGroup::didReceiveManifestResponse(const ResourceResponse& r
if (response.httpStatusCode() == 304)
return;
- if (response.httpStatusCode() / 100 != 2 || response.url() != m_manifestHandle->request().url() || !equalIgnoringCase(response.mimeType(), "text/cache-manifest")) {
+ if (response.httpStatusCode() / 100 != 2 || response.url() != m_manifestHandle->firstRequest().url() || !equalIgnoringCase(response.mimeType(), "text/cache-manifest")) {
cacheUpdateFailed();
return;
}
- m_manifestResource = ApplicationCacheResource::create(m_manifestHandle->request().url(), response,
- ApplicationCacheResource::Manifest);
+ m_manifestResource = ApplicationCacheResource::create(m_manifestHandle->firstRequest().url(), response, ApplicationCacheResource::Manifest);
}
void ApplicationCacheGroup::didReceiveManifestData(const char* data, int length)
diff --git a/WebCore/loader/appcache/DOMApplicationCache.idl b/WebCore/loader/appcache/DOMApplicationCache.idl
index 8525fe6..9113ffa 100644
--- a/WebCore/loader/appcache/DOMApplicationCache.idl
+++ b/WebCore/loader/appcache/DOMApplicationCache.idl
@@ -28,7 +28,8 @@ module offline {
interface [
Conditional=OFFLINE_WEB_APPLICATIONS,
EventTarget,
- OmitConstructor
+ OmitConstructor,
+ DontCheckEnums
] DOMApplicationCache {
// update status
const unsigned short UNCACHED = 0;
diff --git a/WebCore/loader/icon/IconLoader.cpp b/WebCore/loader/icon/IconLoader.cpp
index eb49087..6e2762f 100644
--- a/WebCore/loader/icon/IconLoader.cpp
+++ b/WebCore/loader/icon/IconLoader.cpp
@@ -91,7 +91,7 @@ void IconLoader::didReceiveResponse(SubresourceLoader* resourceLoader, const Res
if (status && (status < 200 || status > 299)) {
ResourceHandle* handle = resourceLoader->handle();
- finishLoading(handle ? handle->request().url() : KURL(), 0);
+ finishLoading(handle ? handle->firstRequest().url() : KURL(), 0);
}
}
@@ -115,7 +115,7 @@ void IconLoader::didFail(SubresourceLoader* resourceLoader, const ResourceError&
if (m_loadIsInProgress) {
ASSERT(resourceLoader == m_resourceLoader);
ResourceHandle* handle = resourceLoader->handle();
- finishLoading(handle ? handle->request().url() : KURL(), 0);
+ finishLoading(handle ? handle->firstRequest().url() : KURL(), 0);
}
}
@@ -137,7 +137,7 @@ void IconLoader::didFinishLoading(SubresourceLoader* resourceLoader)
if (m_loadIsInProgress) {
ASSERT(resourceLoader == m_resourceLoader);
ResourceHandle* handle = resourceLoader->handle();
- finishLoading(handle ? handle->request().url() : KURL(), m_resourceLoader->resourceData());
+ finishLoading(handle ? handle->firstRequest().url() : KURL(), m_resourceLoader->resourceData());
}
}
diff --git a/WebCore/loader/loader.cpp b/WebCore/loader/loader.cpp
index e137a5f..230d6ea 100644
--- a/WebCore/loader/loader.cpp
+++ b/WebCore/loader/loader.cpp
@@ -590,8 +590,8 @@ void Loader::Host::cancelPendingRequests(RequestQueue& requestsPending, DocLoade
Request* request = *it;
if (request->docLoader() == docLoader) {
cache()->remove(request->cachedResource());
- delete request;
docLoader->decrementRequestCount(request->cachedResource());
+ delete request;
} else
remaining.append(request);
}
diff --git a/WebCore/manual-tests/css3-background-layer-count.html b/WebCore/manual-tests/css3-background-layer-count.html
new file mode 100644
index 0000000..fc21fd7
--- /dev/null
+++ b/WebCore/manual-tests/css3-background-layer-count.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS Test: Number of background properties greater than number of background images</title>
+ <style type="text/css">
+ div
+ {
+ margin: 10px;
+ width: 250px;
+ height: 250px;
+ border: thick solid black;
+ }
+ #test
+ {
+ background-image: url("resources/non-animated.gif"), url("resources/non-animated.gif"), url("resources/non-animated.gif");
+ background-position: right bottom, right top, left bottom, left center, right center;
+ background-repeat: no-repeat, no-repeat, repeat-x, repeat, repeat-y;
+ }
+ #reference
+ {
+ background-image: url("resources/non-animated.gif"), url("resources/non-animated.gif"), url("resources/non-animated.gif");
+ background-position: right bottom, right top, left bottom;
+ background-repeat: no-repeat, no-repeat, repeat-x;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if the contents of the black boxes look exactly the same.</p>
+ <table>
+ <td>
+ <div id="test"></div>
+ </td>
+ <td>
+ <div id="reference"></div>
+ </td>
+ </table>
+ </body>
+</html>
diff --git a/WebCore/manual-tests/win/contextmenu-key2.html b/WebCore/manual-tests/win/contextmenu-key2.html
new file mode 100644
index 0000000..2833e58
--- /dev/null
+++ b/WebCore/manual-tests/win/contextmenu-key2.html
@@ -0,0 +1,13 @@
+<div oncontextmenu="contextmenu(event)">
+Select some text in the contenteditable below and press the context menu key
+(or shift+F10). The browser should not crash.
+<div contenteditable id="a">
+<p>|content editable|</p>
+</div>
+After content editable.
+</div>
+<script>
+function contextmenu(event) {
+ document.getElementById("a").style.visibility = "hidden";
+}
+</script>
diff --git a/WebCore/notifications/NotificationCenter.cpp b/WebCore/notifications/NotificationCenter.cpp
index f9672ad..ec70f0a 100644
--- a/WebCore/notifications/NotificationCenter.cpp
+++ b/WebCore/notifications/NotificationCenter.cpp
@@ -61,6 +61,11 @@ void NotificationCenter::requestPermission(PassRefPtr<VoidCallback> callback)
void NotificationCenter::disconnectFrame()
{
+ // m_notificationPresenter should never be 0. But just to be safe, we check it here.
+ // Due to the mysterious bug http://code.google.com/p/chromium/issues/detail?id=49323.
+ ASSERT(m_notificationPresenter);
+ if (!m_notificationPresenter)
+ return;
m_notificationPresenter->cancelRequestsForPermission(m_scriptExecutionContext);
m_notificationPresenter = 0;
}
diff --git a/WebCore/page/Chrome.cpp b/WebCore/page/Chrome.cpp
index f2e1d9d..0c66925 100644
--- a/WebCore/page/Chrome.cpp
+++ b/WebCore/page/Chrome.cpp
@@ -426,9 +426,9 @@ void Chrome::chooseIconForFiles(const Vector<String>& filenames, FileChooser* fi
m_client->chooseIconForFiles(filenames, fileChooser);
}
-bool Chrome::setCursor(PlatformCursorHandle cursor)
+void Chrome::setCursor(const Cursor& cursor)
{
- return m_client->setCursor(cursor);
+ m_client->setCursor(cursor);
}
#if ENABLE(NOTIFICATIONS)
diff --git a/WebCore/page/Chrome.h b/WebCore/page/Chrome.h
index 27bde83..537468a 100644
--- a/WebCore/page/Chrome.h
+++ b/WebCore/page/Chrome.h
@@ -69,6 +69,7 @@ namespace WebCore {
virtual IntRect windowToScreen(const IntRect&) const;
virtual PlatformPageClient platformPageClient() const;
virtual void scrollbarsModeDidChange() const;
+ virtual void setCursor(const Cursor&);
void scrollRectIntoView(const IntRect&) const;
@@ -135,8 +136,6 @@ namespace WebCore {
void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
void chooseIconForFiles(const Vector<String>&, FileChooser*);
- bool setCursor(PlatformCursorHandle);
-
#if PLATFORM(MAC)
void focusNSView(NSView*);
#endif
diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.h
index 8101c52..1b2d1cc 100644
--- a/WebCore/page/ChromeClient.h
+++ b/WebCore/page/ChromeClient.h
@@ -135,11 +135,13 @@ namespace WebCore {
virtual IntPoint screenToWindow(const IntPoint&) const = 0;
virtual IntRect windowToScreen(const IntRect&) const = 0;
virtual PlatformPageClient platformPageClient() const = 0;
- virtual void contentsSizeChanged(Frame*, const IntSize&) const = 0;
- virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const = 0; // Currently only Mac has a non empty implementation.
+ virtual void scrollbarsModeDidChange() const = 0;
+ virtual void setCursor(const Cursor&) = 0;
// End methods used by HostWindow.
- virtual void scrollbarsModeDidChange() const = 0;
+ virtual void contentsSizeChanged(Frame*, const IntSize&) const = 0;
+ virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const = 0; // Currently only Mac has a non empty implementation.
+
virtual bool shouldMissingPluginMessageBeButton() const { return false; }
virtual void missingPluginButtonClicked(Element*) const { }
virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags) = 0;
@@ -194,8 +196,6 @@ namespace WebCore {
// Asynchronous request to load an icon for specified filenames.
virtual void chooseIconForFiles(const Vector<String>&, FileChooser*) = 0;
- virtual bool setCursor(PlatformCursorHandle) = 0;
-
// Notification that the given form element has changed. This function
// will be called frequently, so handling should be very fast.
virtual void formStateDidChange(const Node*) = 0;
@@ -236,6 +236,10 @@ namespace WebCore {
virtual void willPopUpMenu(NSMenu *) { }
#endif
+#if PLATFORM(WIN)
+ virtual void setLastSetCursorToCurrentCursor() = 0;
+#endif
+
#if ENABLE(TOUCH_EVENTS)
virtual void needTouchEvents(bool) = 0;
#endif
diff --git a/WebCore/page/Console.cpp b/WebCore/page/Console.cpp
index 1d6c095..3d8a7de 100644
--- a/WebCore/page/Console.cpp
+++ b/WebCore/page/Console.cpp
@@ -36,6 +36,7 @@
#include "FrameLoader.h"
#include "FrameTree.h"
#include "InspectorController.h"
+#include "MemoryInfo.h"
#include "Page.h"
#include "PageGroup.h"
#include "PlatformString.h"
@@ -61,6 +62,8 @@ Frame* Console::frame() const
void Console::disconnectFrame()
{
+ if (m_memory)
+ m_memory = 0;
m_frame = 0;
}
@@ -141,7 +144,7 @@ static void printMessageSourceAndLevelPrefix(MessageSource source, MessageLevel
printf("%s %s:", sourceString, levelString);
}
-void Console::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
+void Console::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL, ScriptCallStack* callStack)
{
Page* page = this->page();
if (!page)
@@ -151,7 +154,10 @@ void Console::addMessage(MessageSource source, MessageType type, MessageLevel le
page->chrome()->client()->addMessageToConsole(source, type, level, message, lineNumber, sourceURL);
#if ENABLE(INSPECTOR)
- page->inspectorController()->addMessageToConsole(source, type, level, message, lineNumber, sourceURL);
+ if (callStack)
+ page->inspectorController()->addMessageToConsole(source, type, level, callStack, message);
+ else
+ page->inspectorController()->addMessageToConsole(source, type, level, message, lineNumber, sourceURL);
#endif
if (!Console::shouldPrintExceptions())
@@ -294,15 +300,15 @@ String Console::lastWMLErrorMessage() const
if (!page)
return String();
- const Vector<ConsoleMessage*>& consoleMessages = page->inspectorController()->consoleMessages();
+ const Vector<OwnPtr<ConsoleMessage> >& consoleMessages = page->inspectorController()->consoleMessages();
if (consoleMessages.isEmpty())
return String();
- Vector<ConsoleMessage*>::const_iterator it = consoleMessages.begin();
- const Vector<ConsoleMessage*>::const_iterator end = consoleMessages.end();
+ Vector<OwnPtr<ConsoleMessage> >::const_iterator it = consoleMessages.begin();
+ const Vector<OwnPtr<ConsoleMessage> >::const_iterator end = consoleMessages.end();
for (; it != end; ++it) {
- ConsoleMessage* message = *it;
+ ConsoleMessage* message = it->get();
if (message->source() != WMLMessageSource)
continue;
@@ -456,6 +462,12 @@ void Console::warn(ScriptCallStack* callStack)
addMessage(LogMessageType, WarningMessageLevel, callStack);
}
+MemoryInfo* Console::memory() const
+{
+ m_memory = MemoryInfo::create(m_frame);
+ return m_memory.get();
+}
+
static bool printExceptions = false;
bool Console::shouldPrintExceptions()
diff --git a/WebCore/page/Console.h b/WebCore/page/Console.h
index 04e743e..d057ff9 100644
--- a/WebCore/page/Console.h
+++ b/WebCore/page/Console.h
@@ -29,8 +29,8 @@
#ifndef Console_h
#define Console_h
+#include "MemoryInfo.h"
#include "PlatformString.h"
-
#include "ScriptProfile.h"
#include <wtf/PassRefPtr.h>
@@ -43,7 +43,6 @@ typedef Vector<RefPtr<ScriptProfile> > ProfilesArray;
#endif
class Frame;
-class MemoryInfo;
class Page;
class String;
class ScriptCallStack;
@@ -65,7 +64,8 @@ enum MessageType {
StartGroupMessageType,
StartGroupCollapsedMessageType,
EndGroupMessageType,
- AssertMessageType
+ AssertMessageType,
+ UncaughtExceptionMessageType
};
enum MessageLevel {
@@ -83,7 +83,7 @@ public:
Frame* frame() const;
void disconnectFrame();
- void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
+ void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL, ScriptCallStack* callStack = 0);
void debug(ScriptCallStack*);
void error(ScriptCallStack*);
@@ -116,6 +116,8 @@ public:
const ProfilesArray& profiles() const { return m_profiles; }
#endif
+ MemoryInfo* memory() const;
+
private:
inline Page* page() const;
void addMessage(MessageType, MessageLevel, ScriptCallStack*, bool acceptNoArguments = false);
@@ -126,6 +128,7 @@ private:
#if ENABLE(JAVASCRIPT_DEBUGGER)
ProfilesArray m_profiles;
#endif
+ mutable RefPtr<MemoryInfo> m_memory;
};
} // namespace WebCore
diff --git a/WebCore/page/Console.idl b/WebCore/page/Console.idl
index 1506210..52528f1 100644
--- a/WebCore/page/Console.idl
+++ b/WebCore/page/Console.idl
@@ -41,8 +41,8 @@ module window {
[CustomArgumentHandling] void warn();
[CustomArgumentHandling] void dir();
[CustomArgumentHandling] void dirxml();
- [CustomArgumentHandling] void trace();
- [CustomArgumentHandling, ImplementationFunction=assertCondition] void assert(in boolean condition);
+ [V8Custom, CustomArgumentHandling] void trace();
+ [V8Custom, CustomArgumentHandling, ImplementationFunction=assertCondition] void assert(in boolean condition);
[CustomArgumentHandling] void count();
[CustomArgumentHandling] void markTimeline();
@@ -61,7 +61,7 @@ module window {
[CustomArgumentHandling] void groupCollapsed();
void groupEnd();
- readonly attribute [CustomGetter] MemoryInfo memory;
+ readonly attribute MemoryInfo memory;
};
}
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 18eef41..6498042 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -35,11 +35,13 @@
#include "CSSStyleSelector.h"
#include "Chrome.h"
#include "Console.h"
-#include "Database.h"
-#include "DatabaseCallback.h"
+#include "DocumentLoader.h"
#include "DOMApplicationCache.h"
#include "DOMSelection.h"
#include "DOMTimer.h"
+#include "Database.h"
+#include "DatabaseCallback.h"
+#include "DeviceOrientationController.h"
#include "PageTransitionEvent.h"
#include "Document.h"
#include "Element.h"
@@ -671,6 +673,17 @@ NotificationCenter* DOMWindow::webkitNotifications() const
}
#endif
+void DOMWindow::pageDestroyed()
+{
+#if ENABLE(NOTIFICATIONS)
+ // Clearing Notifications requests involves accessing the client so it must be done
+ // before the frame is detached.
+ if (m_notifications)
+ m_notifications->disconnectFrame();
+ m_notifications = 0;
+#endif
+}
+
#if ENABLE(INDEXED_DATABASE)
IndexedDatabaseRequest* DOMWindow::indexedDB() const
{
@@ -1426,6 +1439,10 @@ bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<Event
addUnloadEventListener(this);
else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
addBeforeUnloadEventListener(this);
+#if ENABLE(DEVICE_ORIENTATION)
+ else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() && frame()->page()->deviceOrientationController())
+ frame()->page()->deviceOrientationController()->addListener(this);
+#endif
return true;
}
@@ -1439,17 +1456,21 @@ bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener
removeUnloadEventListener(this);
else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
removeBeforeUnloadEventListener(this);
+#if ENABLE(DEVICE_ORIENTATION)
+ else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() && frame()->page()->deviceOrientationController())
+ frame()->page()->deviceOrientationController()->removeListener(this);
+#endif
return true;
}
void DOMWindow::dispatchLoadEvent()
{
- if (m_frame)
- m_frame->loader()->frameLoadTimeline()->loadEventStart = currentTime();
+ if (DocumentLoader* documentLoader = m_frame ? m_frame->loader()->documentLoader() : 0)
+ documentLoader->timing()->loadEventStart = currentTime();
dispatchEvent(Event::create(eventNames().loadEvent, false, false), document());
- if (m_frame)
- m_frame->loader()->frameLoadTimeline()->loadEventEnd = currentTime();
+ if (DocumentLoader* documentLoader = m_frame ? m_frame->loader()->documentLoader() : 0)
+ documentLoader->timing()->loadEventEnd = currentTime();
// For load events, send a separate load event to the enclosing frame only.
// This is a DOM extension and is independent of bubbling/capturing rules of
@@ -1513,6 +1534,11 @@ void DOMWindow::removeAllEventListeners()
{
EventTarget::removeAllEventListeners();
+#if ENABLE(DEVICE_ORIENTATION)
+ if (frame() && frame()->page() && frame()->page()->deviceOrientationController())
+ frame()->page()->deviceOrientationController()->removeAllListeners(this);
+#endif
+
removeAllUnloadEventListeners(this);
removeAllBeforeUnloadEventListeners(this);
}
diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h
index beb2f7d..69d7428 100644
--- a/WebCore/page/DOMWindow.h
+++ b/WebCore/page/DOMWindow.h
@@ -228,6 +228,8 @@ namespace WebCore {
NotificationCenter* webkitNotifications() const;
#endif
+ void pageDestroyed();
+
#if ENABLE(INDEXED_DATABASE)
IndexedDatabaseRequest* indexedDB() const;
#endif
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index f3cf9fe..f6b9feb 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -305,8 +305,8 @@ module window {
attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchend;
attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel;
- attribute [Conditional=DEVICE_ORIENTATION] DeviceOrientationEventConstructor DeviceOrientationEvent;
- attribute [Conditional=DEVICE_ORIENTATION] EventListener ondeviceorientation;
+ attribute [Conditional=DEVICE_ORIENTATION, EnabledAtRuntime] DeviceOrientationEventConstructor DeviceOrientationEvent;
+ attribute [Conditional=DEVICE_ORIENTATION, EnabledAtRuntime] EventListener ondeviceorientation;
// EventTarget interface
[Custom] void addEventListener(in DOMString type,
diff --git a/WebCore/page/EditorClient.h b/WebCore/page/EditorClient.h
index 69f48e7..ff5bf94 100644
--- a/WebCore/page/EditorClient.h
+++ b/WebCore/page/EditorClient.h
@@ -183,10 +183,10 @@ public:
virtual void showSpellingUI(bool show) = 0;
virtual bool spellingUIIsShowing() = 0;
virtual void getGuessesForWord(const String&, Vector<String>& guesses) = 0;
+ virtual void willSetInputMethodState() = 0;
virtual void setInputMethodState(bool enabled) = 0;
};
}
#endif // EditorClient_h
-
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index 08b8257..4d7771d 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -197,6 +197,9 @@ EventHandler::EventHandler(Frame* frame)
, m_sendingEventToSubview(false)
, m_activationEventNumber(0)
#endif
+#if ENABLE(TOUCH_EVENTS)
+ , m_touchPressed(false)
+#endif
{
}
@@ -866,11 +869,15 @@ void EventHandler::allowDHTMLDrag(bool& flagDHTML, bool& flagUA) const
}
#endif // ENABLE(DRAG_SUPPORT)
+<<<<<<< HEAD:WebCore/page/EventHandler.cpp
#ifdef ANDROID_HITTEST_WITHSIZE
HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, const IntSize& pointPadding)
#else
HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars)
#endif
+=======
+HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, int hitType)
+>>>>>>> webkit.org at r63859:WebCore/page/EventHandler.cpp
{
#ifdef ANDROID_HITTEST_WITHSIZE
HitTestResult result(point, pointPadding);
@@ -879,7 +886,6 @@ HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool all
#endif
if (!m_frame->contentRenderer())
return result;
- int hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
if (ignoreClipping)
hitType |= HitTestRequest::IgnoreClipping;
m_frame->contentRenderer()->layer()->hitTest(HitTestRequest(hitType), result);
@@ -1460,6 +1466,12 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
hitType |= HitTestRequest::ReadOnly;
if (m_mousePressed)
hitType |= HitTestRequest::Active;
+
+#if ENABLE(TOUCH_EVENTS)
+ // Treat any mouse move events as readonly if the user is currently touching the screen.
+ if (m_touchPressed)
+ hitType |= HitTestRequest::Active | HitTestRequest::ReadOnly;
+#endif
HitTestRequest request(hitType);
MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseEvent);
if (hoveredNode)
@@ -2064,10 +2076,6 @@ bool EventHandler::sendContextMenuEventForKey()
Position start = selectionController->selection().start();
if (start.node() && (selectionController->rootEditableElement() || selectionController->isRange())) {
- RenderObject* renderer = start.node()->renderer();
- if (!renderer)
- return false;
-
RefPtr<Range> selection = selectionController->toNormalizedRange();
IntRect firstRect = m_frame->firstRectForRange(selection.get());
@@ -2867,7 +2875,29 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
for (unsigned i = 0; i < points.size(); ++i) {
const PlatformTouchPoint& point = points[i];
IntPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos());
- HitTestResult result = hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false);
+
+ int hitType = HitTestRequest::Active | HitTestRequest::ReadOnly;
+ // The HitTestRequest types used for mouse events map quite adequately
+ // to touch events. Note that in addition to meaning that the hit test
+ // should affect the active state of the current node if necessary,
+ // HitTestRequest::Active signifies that the hit test is taking place
+ // with the mouse (or finger in this case) being pressed.
+ switch (point.state()) {
+ case PlatformTouchPoint::TouchPressed:
+ hitType = HitTestRequest::Active;
+ break;
+ case PlatformTouchPoint::TouchMoved:
+ hitType = HitTestRequest::Active | HitTestRequest::MouseMove | HitTestRequest::ReadOnly;
+ break;
+ case PlatformTouchPoint::TouchReleased:
+ case PlatformTouchPoint::TouchCancelled:
+ hitType = HitTestRequest::MouseUp;
+ break;
+ default:
+ break;
+ }
+
+ HitTestResult result = hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false, false, DontHitTestScrollbars, hitType);
Node* target = result.innerNode();
// Touch events should not go to text nodes
@@ -2930,6 +2960,8 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
movedTouches->append(touch);
}
+ m_touchPressed = touches->length() > 0;
+
bool defaultPrevented = false;
Touch* changedTouch = 0;
EventTarget* touchEventTarget = 0;
diff --git a/WebCore/page/EventHandler.h b/WebCore/page/EventHandler.h
index d24d803..55c6b20 100644
--- a/WebCore/page/EventHandler.h
+++ b/WebCore/page/EventHandler.h
@@ -28,6 +28,7 @@
#include "DragActions.h"
#include "FocusDirection.h"
+#include "HitTestRequest.h"
#include "PlatformMouseEvent.h"
#include "ScrollTypes.h"
#include "Timer.h"
@@ -105,11 +106,15 @@ public:
void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&);
+<<<<<<< HEAD:WebCore/page/EventHandler.h
#ifdef ANDROID_HITTEST_WITHSIZE
HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false, HitTestScrollbars scrollbars = DontHitTestScrollbars, const IntSize& pointPadding = IntSize());
#else
HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false, HitTestScrollbars scrollbars = DontHitTestScrollbars);
#endif
+=======
+ HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false, HitTestScrollbars scrollbars = DontHitTestScrollbars, int hitType = HitTestRequest::ReadOnly | HitTestRequest::Active);
+>>>>>>> webkit.org at r63859:WebCore/page/EventHandler.h
bool mousePressed() const { return m_mousePressed; }
void setMousePressed(bool pressed) { m_mousePressed = pressed; }
@@ -435,6 +440,7 @@ private:
#if ENABLE(TOUCH_EVENTS)
typedef HashMap<int, RefPtr<EventTarget> > TouchTargetMap;
TouchTargetMap m_originatingTouchPointTargets;
+ bool m_touchPressed;
#endif
};
diff --git a/WebCore/page/FocusController.cpp b/WebCore/page/FocusController.cpp
index 6ecdffd..53a4fa8 100644
--- a/WebCore/page/FocusController.cpp
+++ b/WebCore/page/FocusController.cpp
@@ -595,22 +595,21 @@ bool FocusController::setFocusedNode(Node* node, PassRefPtr<Frame> newFocusedFra
if (oldFocusedNode && oldFocusedNode->rootEditableElement() == oldFocusedNode && !relinquishesEditingFocus(oldFocusedNode))
return false;
- // Set input method state before changing the focused node, so that the
- // input method can still have a chance to finish the ongoing composition
- // session.
- m_page->editorClient()->setInputMethodState(node ? node->shouldUseInputMethod() : false);
+ m_page->editorClient()->willSetInputMethodState();
clearSelectionIfNeeded(oldFocusedFrame.get(), newFocusedFrame.get(), node);
if (!node) {
if (oldDocument)
oldDocument->setFocusedNode(0);
+ m_page->editorClient()->setInputMethodState(false);
return true;
}
RefPtr<Document> newDocument = node->document();
if (newDocument && newDocument->focusedNode() == node) {
+ m_page->editorClient()->setInputMethodState(node->shouldUseInputMethod());
return true;
}
@@ -622,6 +621,8 @@ bool FocusController::setFocusedNode(Node* node, PassRefPtr<Frame> newFocusedFra
if (newDocument)
newDocument->setFocusedNode(node);
+ m_page->editorClient()->setInputMethodState(node->shouldUseInputMethod());
+
return true;
}
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index 46917fd..a8d0f15 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -298,24 +298,31 @@ String Frame::selectedText() const
IntRect Frame::firstRectForRange(Range* range) const
{
int extraWidthToEndOfLine = 0;
- ExceptionCode ec = 0;
- ASSERT(range->startContainer(ec));
- ASSERT(range->endContainer(ec));
+ ASSERT(range->startContainer());
+ ASSERT(range->endContainer());
InlineBox* startInlineBox;
int startCaretOffset;
- range->startPosition().getInlineBoxAndOffset(DOWNSTREAM, startInlineBox, startCaretOffset);
+ Position startPosition = VisiblePosition(range->startPosition()).deepEquivalent();
+ if (startPosition.isNull())
+ return IntRect();
+ startPosition.getInlineBoxAndOffset(DOWNSTREAM, startInlineBox, startCaretOffset);
- RenderObject* startRenderer = range->startContainer(ec)->renderer();
+ RenderObject* startRenderer = startPosition.node()->renderer();
+ ASSERT(startRenderer);
IntRect startCaretRect = startRenderer->localCaretRect(startInlineBox, startCaretOffset, &extraWidthToEndOfLine);
if (startCaretRect != IntRect())
startCaretRect = startRenderer->localToAbsoluteQuad(FloatRect(startCaretRect)).enclosingBoundingBox();
InlineBox* endInlineBox;
int endCaretOffset;
- range->endPosition().getInlineBoxAndOffset(UPSTREAM, endInlineBox, endCaretOffset);
+ Position endPosition = VisiblePosition(range->endPosition()).deepEquivalent();
+ if (endPosition.isNull())
+ return IntRect();
+ endPosition.getInlineBoxAndOffset(UPSTREAM, endInlineBox, endCaretOffset);
- RenderObject* endRenderer = range->endContainer(ec)->renderer();
+ RenderObject* endRenderer = endPosition.node()->renderer();
+ ASSERT(endRenderer);
IntRect endCaretRect = endRenderer->localCaretRect(endInlineBox, endCaretOffset);
if (endCaretRect != IntRect())
endCaretRect = endRenderer->localToAbsoluteQuad(FloatRect(endCaretRect)).enclosingBoundingBox();
@@ -1344,6 +1351,9 @@ void Frame::pageDestroyed()
if (Frame* parent = tree()->parent())
parent->loader()->checkLoadComplete();
+ if (m_domWindow)
+ m_domWindow->pageDestroyed();
+
// FIXME: It's unclear as to why this is called more than once, but it is,
// so page() could be NULL.
if (page() && page()->focusController()->focusedFrame() == this)
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index defb34a..31f9910 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -1129,7 +1129,7 @@ void FrameView::setScrollPosition(const IntPoint& scrollPoint)
m_inProgrammaticScroll = wasInProgrammaticScroll;
}
-void FrameView::scrollPositionChanged()
+void FrameView::scrollPositionChangedViaPlatformWidget()
{
frame()->eventHandler()->sendScrollEvent();
repaintFixedElementsAfterScrolling();
diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h
index b047db0..868a15f 100644
--- a/WebCore/page/FrameView.h
+++ b/WebCore/page/FrameView.h
@@ -143,7 +143,7 @@ public:
virtual IntRect windowResizerRect() const;
void setScrollPosition(const IntPoint&);
- void scrollPositionChanged();
+ void scrollPositionChangedViaPlatformWidget();
virtual void repaintFixedElementsAfterScrolling();
String mediaType() const;
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index 13bc02a..abdb8bf 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -295,7 +295,7 @@ PassRefPtr<Geolocation::GeoNotifier> Geolocation::startRequest(PassRefPtr<Positi
else if (haveSuitableCachedPosition(notifier->m_options.get()))
notifier->setUseCachedPosition();
else if (notifier->hasZeroTimeout() || startUpdating(notifier.get())) {
-#if ENABLE(CLIENT_BASED_GEOLOCATION)
+#if USE(PREEMPT_GEOLOCATION_PERMISSION)
// Only start timer if we're not waiting for user permission.
if (!m_startRequestPermissionNotifier)
#endif
@@ -416,18 +416,22 @@ void Geolocation::setIsAllowed(bool allowed)
// position.
m_allowGeolocation = allowed ? Yes : No;
-#if ENABLE(CLIENT_BASED_GEOLOCATION)
+#if USE(PREEMPT_GEOLOCATION_PERMISSION)
if (m_startRequestPermissionNotifier) {
if (isAllowed()) {
// Permission request was made during the startUpdating process
m_startRequestPermissionNotifier->startTimerIfNeeded();
m_startRequestPermissionNotifier = 0;
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
if (!m_frame)
return;
Page* page = m_frame->page();
if (!page)
return;
page->geolocationController()->addObserver(this);
+#else
+ // TODO: Handle startUpdate() for non-client based implementations using pre-emptive policy
+#endif
} else {
m_startRequestPermissionNotifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
m_oneShots.add(m_startRequestPermissionNotifier);
@@ -628,15 +632,15 @@ void Geolocation::geolocationServiceErrorOccurred(GeolocationService* service)
bool Geolocation::startUpdating(GeoNotifier* notifier)
{
-#if ENABLE(CLIENT_BASED_GEOLOCATION)
- // FIXME: Pass options to client.
-
+#if USE(PREEMPT_GEOLOCATION_PERMISSION)
if (!isAllowed()) {
m_startRequestPermissionNotifier = notifier;
requestPermission();
return true;
}
-
+#endif
+
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
if (!m_frame)
return false;
@@ -644,6 +648,7 @@ bool Geolocation::startUpdating(GeoNotifier* notifier)
if (!page)
return false;
+ // FIXME: Pass options to client.
page->geolocationController()->addObserver(this);
return true;
#else
diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h
index f831b87..af10632 100644
--- a/WebCore/page/Geolocation.h
+++ b/WebCore/page/Geolocation.h
@@ -169,7 +169,8 @@ private:
Frame* m_frame;
#if !ENABLE(CLIENT_BASED_GEOLOCATION)
OwnPtr<GeolocationService> m_service;
-#else
+#endif
+#if USE(PREEMPT_GEOLOCATION_PERMISSION)
RefPtr<GeoNotifier> m_startRequestPermissionNotifier;
#endif
RefPtr<Geoposition> m_lastPosition;
diff --git a/WebCore/page/MemoryInfo.cpp b/WebCore/page/MemoryInfo.cpp
index 010a19c..c2247b9 100644
--- a/WebCore/page/MemoryInfo.cpp
+++ b/WebCore/page/MemoryInfo.cpp
@@ -31,17 +31,21 @@
#include "config.h"
#include "MemoryInfo.h"
+#include "Frame.h"
#include "ScriptGCEvent.h"
+#include "Settings.h"
namespace WebCore {
-MemoryInfo::MemoryInfo()
+MemoryInfo::MemoryInfo(Frame* frame)
: m_totalJSHeapSize(0),
m_usedJSHeapSize(0)
{
+ if (frame && frame->settings() && frame->settings()->memoryInfoEnabled()) {
#if ENABLE(INSPECTOR)
- ScriptGCEvent::getHeapSize(m_usedJSHeapSize, m_totalJSHeapSize);
+ ScriptGCEvent::getHeapSize(m_usedJSHeapSize, m_totalJSHeapSize);
#endif
+ }
}
} // namespace WebCore
diff --git a/WebCore/page/MemoryInfo.h b/WebCore/page/MemoryInfo.h
index e9e0fa5..615e952 100644
--- a/WebCore/page/MemoryInfo.h
+++ b/WebCore/page/MemoryInfo.h
@@ -36,15 +36,17 @@
namespace WebCore {
+class Frame;
+
class MemoryInfo : public RefCounted<MemoryInfo> {
public:
- static PassRefPtr<MemoryInfo> create() { return adoptRef(new MemoryInfo()); }
+ static PassRefPtr<MemoryInfo> create(Frame* frame) { return adoptRef(new MemoryInfo(frame)); }
size_t totalJSHeapSize() const { return m_totalJSHeapSize; }
size_t usedJSHeapSize() const { return m_usedJSHeapSize; }
private:
- MemoryInfo();
+ MemoryInfo(Frame*);
size_t m_totalJSHeapSize;
size_t m_usedJSHeapSize;
diff --git a/WebCore/page/Navigation.cpp b/WebCore/page/Navigation.cpp
index efda924..ad93b47 100644
--- a/WebCore/page/Navigation.cpp
+++ b/WebCore/page/Navigation.cpp
@@ -57,20 +57,20 @@ void Navigation::disconnectFrame()
unsigned short Navigation::type() const
{
if (!m_frame)
- return Navigate;
+ return NAVIGATE;
DocumentLoader* documentLoader = m_frame->loader()->documentLoader();
if (!documentLoader)
- return Navigate;
+ return NAVIGATE;
WebCore::NavigationType navigationType = documentLoader->triggeringAction().type();
switch (navigationType) {
case NavigationTypeReload:
- return Reload;
+ return RELOAD;
case NavigationTypeBackForward:
- return BackForward;
+ return BACK_FORWARD;
default:
- return Navigate;
+ return NAVIGATE;
}
}
@@ -79,7 +79,11 @@ unsigned short Navigation::redirectCount() const
if (!m_frame)
return 0;
- return 0; // FIXME
+ DocumentLoader* loader = m_frame->loader()->documentLoader();
+ if (!loader)
+ return 0;
+
+ return loader->timing()->redirectCount;
}
} // namespace WebCore
diff --git a/WebCore/page/Navigation.h b/WebCore/page/Navigation.h
index 85c7b55..ba68ff3 100644
--- a/WebCore/page/Navigation.h
+++ b/WebCore/page/Navigation.h
@@ -47,17 +47,16 @@ public:
Frame* frame() const;
void disconnectFrame();
+ enum NavigationType {
+ NAVIGATE,
+ RELOAD,
+ BACK_FORWARD
+ };
+
unsigned short type() const;
unsigned short redirectCount() const;
private:
- // Keep in sync with what's in the .idl file.
- enum NavigationType {
- Navigate = 0,
- Reload = 1,
- BackForward = 2,
- };
-
Navigation(Frame*);
Frame* m_frame;
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index ee99c43..8e471fc 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -57,10 +57,12 @@
#include "ProgressTracker.h"
#include "RenderTheme.h"
#include "RenderWidget.h"
+#include "RuntimeEnabledFeatures.h"
#include "ScriptController.h"
#include "SelectionController.h"
#include "Settings.h"
#include "SharedBuffer.h"
+#include "SpeechInputClient.h"
#include "StringHash.h"
#include "TextResourceDecoder.h"
#include "Widget.h"
@@ -153,7 +155,10 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi
, m_geolocationController(new GeolocationController(this, geolocationControllerClient))
#endif
#if ENABLE(DEVICE_ORIENTATION)
- , m_deviceOrientationController(new DeviceOrientationController(this, deviceOrientationClient))
+ , m_deviceOrientationController(RuntimeEnabledFeatures::deviceOrientationEnabled() ? new DeviceOrientationController(this, deviceOrientationClient) : 0)
+#endif
+#if ENABLE(INPUT_SPEECH)
+ , m_speechInputClient(0)
#endif
, m_settings(new Settings(this))
, m_progress(new ProgressTracker)
diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h
index 56a25eb..8599a83 100644
--- a/WebCore/page/Page.h
+++ b/WebCore/page/Page.h
@@ -70,6 +70,7 @@ namespace WebCore {
class VisibleSelection;
class SelectionController;
class Settings;
+ class SpeechInputClient;
#if ENABLE(DOM_STORAGE)
class StorageNamespace;
@@ -152,6 +153,10 @@ namespace WebCore {
#if ENABLE(DEVICE_ORIENTATION)
DeviceOrientationController* deviceOrientationController() const { return m_deviceOrientationController.get(); }
#endif
+#if ENABLE(INPUT_SPEECH)
+ void setSpeechInputClient(SpeechInputClient* client) { m_speechInputClient = client; }
+ SpeechInputClient* speechInputClient() const { return m_speechInputClient; }
+#endif
Settings* settings() const { return m_settings.get(); }
ProgressTracker* progress() const { return m_progress.get(); }
@@ -269,6 +274,9 @@ namespace WebCore {
#if ENABLE(DEVICE_ORIENTATION)
OwnPtr<DeviceOrientationController> m_deviceOrientationController;
#endif
+#if ENABLE(INPUT_SPEECH)
+ SpeechInputClient* m_speechInputClient;
+#endif
OwnPtr<Settings> m_settings;
OwnPtr<ProgressTracker> m_progress;
diff --git a/WebCore/page/PageGroup.cpp b/WebCore/page/PageGroup.cpp
index b45b9ea..e0502c5 100644
--- a/WebCore/page/PageGroup.cpp
+++ b/WebCore/page/PageGroup.cpp
@@ -242,12 +242,7 @@ void PageGroup::addUserStyleSheetToWorld(DOMWrapperWorld* world, const String& s
styleSheetsInWorld = new UserStyleSheetVector;
styleSheetsInWorld->append(userStyleSheet.release());
- // Clear our cached sheets and have them just reparse.
- HashSet<Page*>::const_iterator end = m_pages.end();
- for (HashSet<Page*>::const_iterator it = m_pages.begin(); it != end; ++it) {
- for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext())
- frame->document()->clearPageGroupUserSheets();
- }
+ resetUserStyleCacheInAllFrames();
}
void PageGroup::removeUserScriptFromWorld(DOMWrapperWorld* world, const KURL& url)
@@ -301,13 +296,8 @@ void PageGroup::removeUserStyleSheetFromWorld(DOMWrapperWorld* world, const KURL
delete it->second;
m_userStyleSheets->remove(it);
}
-
- // Clear our cached sheets and have them just reparse.
- HashSet<Page*>::const_iterator end = m_pages.end();
- for (HashSet<Page*>::const_iterator it = m_pages.begin(); it != end; ++it) {
- for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext())
- frame->document()->clearPageGroupUserSheets();
- }
+
+ resetUserStyleCacheInAllFrames();
}
void PageGroup::removeUserScriptsFromWorld(DOMWrapperWorld* world)
@@ -339,12 +329,7 @@ void PageGroup::removeUserStyleSheetsFromWorld(DOMWrapperWorld* world)
delete it->second;
m_userStyleSheets->remove(it);
- // Clear our cached sheets and have them just reparse.
- HashSet<Page*>::const_iterator end = m_pages.end();
- for (HashSet<Page*>::const_iterator it = m_pages.begin(); it != end; ++it) {
- for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext())
- frame->document()->clearPageGroupUserSheets();
- }
+ resetUserStyleCacheInAllFrames();
}
void PageGroup::removeAllUserContent()
@@ -353,12 +338,24 @@ void PageGroup::removeAllUserContent()
deleteAllValues(*m_userScripts);
m_userScripts.clear();
}
-
-
+
if (m_userStyleSheets) {
deleteAllValues(*m_userStyleSheets);
m_userStyleSheets.clear();
+ resetUserStyleCacheInAllFrames();
}
}
+void PageGroup::resetUserStyleCacheInAllFrames()
+{
+#if !PLATFORM(CHROMIUM)
+ // Clear our cached sheets and have them just reparse.
+ HashSet<Page*>::const_iterator end = m_pages.end();
+ for (HashSet<Page*>::const_iterator it = m_pages.begin(); it != end; ++it) {
+ for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext())
+ frame->document()->clearPageGroupUserSheets();
+ }
+#endif
+}
+
} // namespace WebCore
diff --git a/WebCore/page/PageGroup.h b/WebCore/page/PageGroup.h
index 545df78..77aa281 100644
--- a/WebCore/page/PageGroup.h
+++ b/WebCore/page/PageGroup.h
@@ -94,7 +94,8 @@ namespace WebCore {
private:
void addVisitedLink(LinkHash stringHash);
-
+ void resetUserStyleCacheInAllFrames();
+
String m_name;
HashSet<Page*> m_pages;
diff --git a/WebCore/page/Performance.cpp b/WebCore/page/Performance.cpp
index c19ce8f..c4234a7 100644
--- a/WebCore/page/Performance.cpp
+++ b/WebCore/page/Performance.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "Performance.h"
+#include "MemoryInfo.h"
#include "Navigation.h"
#include "Timing.h"
@@ -52,6 +53,8 @@ Frame* Performance::frame() const
void Performance::disconnectFrame()
{
+ if (m_memory)
+ m_memory = 0;
if (m_navigation) {
m_navigation->disconnectFrame();
m_navigation = 0;
@@ -63,6 +66,12 @@ void Performance::disconnectFrame()
m_frame = 0;
}
+MemoryInfo* Performance::memory() const
+{
+ m_memory = MemoryInfo::create(m_frame);
+ return m_memory.get();
+}
+
Navigation* Performance::navigation() const
{
if (!m_navigation)
diff --git a/WebCore/page/Performance.h b/WebCore/page/Performance.h
index f317076..9736fe7 100644
--- a/WebCore/page/Performance.h
+++ b/WebCore/page/Performance.h
@@ -33,6 +33,7 @@
#if ENABLE(WEB_TIMING)
+#include "MemoryInfo.h"
#include "Navigation.h"
#include "Timing.h"
#include <wtf/PassRefPtr.h>
@@ -48,12 +49,14 @@ public:
Frame* frame() const;
void disconnectFrame();
+ MemoryInfo* memory() const;
Navigation* navigation() const;
Timing* timing() const;
private:
Performance(Frame*);
+ mutable RefPtr<MemoryInfo> m_memory;
mutable RefPtr<Navigation> m_navigation;
mutable RefPtr<Timing> m_timing;
Frame* m_frame;
diff --git a/WebCore/page/Performance.idl b/WebCore/page/Performance.idl
index 3885e2c..ffe8b6f 100644
--- a/WebCore/page/Performance.idl
+++ b/WebCore/page/Performance.idl
@@ -34,6 +34,7 @@ module window {
interface [Conditional=WEB_TIMING, OmitConstructor] Performance {
readonly attribute Navigation navigation;
readonly attribute Timing timing;
+ readonly attribute MemoryInfo memory;
};
}
diff --git a/WebCore/page/PrintContext.cpp b/WebCore/page/PrintContext.cpp
index cc3707e..2bbc63a 100644
--- a/WebCore/page/PrintContext.cpp
+++ b/WebCore/page/PrintContext.cpp
@@ -245,4 +245,52 @@ int PrintContext::numberOfPages(Frame* frame, const FloatSize& pageSizeInPixels)
return printContext.pageCount();
}
+void PrintContext::spoolAllPagesWithBoundaries(Frame* frame, GraphicsContext& graphicsContext, const FloatSize& pageSizeInPixels)
+{
+ if (!frame->document() || !frame->view() || !frame->document()->renderer())
+ return;
+
+ frame->document()->updateLayout();
+
+ PrintContext printContext(frame);
+ printContext.begin(pageSizeInPixels.width());
+
+ float pageHeight;
+ printContext.computePageRects(FloatRect(FloatPoint(0, 0), pageSizeInPixels), 0, 0, 1, pageHeight);
+
+ const float pageWidth = pageSizeInPixels.width();
+ const Vector<IntRect>& pageRects = printContext.pageRects();
+ int totalHeight = pageRects.size() * (pageSizeInPixels.height() + 1) - 1;
+
+ // Fill the whole background by white.
+ graphicsContext.setFillColor(Color(255, 255, 255), DeviceColorSpace);
+ graphicsContext.fillRect(FloatRect(0, 0, pageWidth, totalHeight));
+
+ graphicsContext.save();
+ graphicsContext.translate(0, totalHeight);
+ graphicsContext.scale(FloatSize(1, -1));
+
+ int currentHeight = 0;
+ for (size_t pageIndex = 0; pageIndex < pageRects.size(); pageIndex++) {
+ // Draw a line for a page boundary if this isn't the first page.
+ if (pageIndex > 0) {
+ graphicsContext.save();
+ graphicsContext.setStrokeColor(Color(0, 0, 255), DeviceColorSpace);
+ graphicsContext.setFillColor(Color(0, 0, 255), DeviceColorSpace);
+ graphicsContext.drawLine(IntPoint(0, currentHeight),
+ IntPoint(pageWidth, currentHeight));
+ graphicsContext.restore();
+ }
+
+ graphicsContext.save();
+ graphicsContext.translate(0, currentHeight);
+ printContext.spoolPage(graphicsContext, pageIndex, pageWidth);
+ graphicsContext.restore();
+
+ currentHeight += pageSizeInPixels.height() + 1;
+ }
+
+ graphicsContext.restore();
+}
+
}
diff --git a/WebCore/page/PrintContext.h b/WebCore/page/PrintContext.h
index 1080c29..8492718 100644
--- a/WebCore/page/PrintContext.h
+++ b/WebCore/page/PrintContext.h
@@ -59,6 +59,10 @@ public:
static bool isPageBoxVisible(Frame* frame, int pageNumber);
static String pageSizeAndMarginsInPixels(Frame* frame, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);
static int numberOfPages(Frame*, const FloatSize& pageSizeInPixels);
+ // Draw all pages into a graphics context with lines which mean page boundaries.
+ // The height of the graphics context should be
+ // (pageSizeInPixels.height() + 1) * number-of-pages - 1
+ static void spoolAllPagesWithBoundaries(Frame*, GraphicsContext&, const FloatSize& pageSizeInPixels);
protected:
Frame* m_frame;
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index 51d387a..bca2c7b 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -148,9 +148,13 @@ Settings::Settings(Page* page)
, m_html5TreeBuilderEnabled(false) // Will be deleted soon, do not use.
, m_paginateDuringLayoutEnabled(false)
, m_dnsPrefetchingEnabled(true)
+<<<<<<< HEAD:WebCore/page/Settings.cpp
#ifdef ANDROID_PLUGINS
, m_pluginsOnDemand(false)
#endif
+=======
+ , m_memoryInfoEnabled(false)
+>>>>>>> webkit.org at r63859:WebCore/page/Settings.cpp
{
// A Frame may not have been created yet, so we initialize the AtomicString
// hash before trying to use it.
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index abf0699..d1ffdbe 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -376,6 +376,9 @@ namespace WebCore {
void setPaginateDuringLayoutEnabled(bool flag) { m_paginateDuringLayoutEnabled = flag; }
bool paginateDuringLayoutEnabled() const { return m_paginateDuringLayoutEnabled; }
+ void setMemoryInfoEnabled(bool flag) { m_memoryInfoEnabled = flag; }
+ bool memoryInfoEnabled() const { return m_memoryInfoEnabled; }
+
private:
Page* m_page;
@@ -496,9 +499,13 @@ namespace WebCore {
bool m_html5TreeBuilderEnabled: 1; // Will be deleted soon, do not use.
bool m_paginateDuringLayoutEnabled : 1;
bool m_dnsPrefetchingEnabled : 1;
+<<<<<<< HEAD:WebCore/page/Settings.h
#ifdef ANDROID_PLUGINS
bool m_pluginsOnDemand : 1;
#endif
+=======
+ bool m_memoryInfoEnabled: 1;
+>>>>>>> webkit.org at r63859:WebCore/page/Settings.h
#if USE(SAFARI_THEME)
static bool gShouldPaintNativeControls;
diff --git a/WebCore/page/SpatialNavigation.cpp b/WebCore/page/SpatialNavigation.cpp
index e748d12..40aa52b 100644
--- a/WebCore/page/SpatialNavigation.cpp
+++ b/WebCore/page/SpatialNavigation.cpp
@@ -103,14 +103,9 @@ void distanceDataForNode(FocusDirection direction, Node* start, FocusCandidate&
// FIXME: This function does not behave correctly with transformed frames.
static IntRect renderRectRelativeToRootDocument(RenderObject* render)
{
- ASSERT(render);
+ ASSERT(render && render->node());
- IntRect rect(render->absoluteClippedOverflowRect());
-
- if (rect.isEmpty()) {
- Element* e = static_cast<Element*>(render->node());
- rect = e->getRect();
- }
+ IntRect rect = render->node()->getRect();
// In cases when the |render|'s associated node is in a scrollable inner
// document, we only consider its scrollOffset if it is not offscreen.
@@ -517,7 +512,7 @@ static bool checkNegativeCoordsForNode(Node* node, const IntRect& curRect)
{
ASSERT(node || node->renderer());
- if (curRect.x() > 0 && curRect.y() > 0)
+ if (curRect.x() >= 0 && curRect.y() >= 0)
return true;
bool canBeScrolled = false;
diff --git a/WebCore/page/SpeechInput.cpp b/WebCore/page/SpeechInput.cpp
new file mode 100644
index 0000000..92df70e
--- /dev/null
+++ b/WebCore/page/SpeechInput.cpp
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SpeechInput.h"
+
+#if ENABLE(INPUT_SPEECH)
+
+#include "Frame.h"
+#include "SpeechInputClient.h"
+#include "SpeechInputListener.h"
+
+namespace WebCore {
+
+SpeechInput::SpeechInput(SpeechInputClient* client, SpeechInputListener* listener)
+ : m_client(client)
+ , m_listener(listener)
+{
+}
+
+void SpeechInput::recordingComplete()
+{
+ m_listener->recordingComplete();
+}
+
+void SpeechInput::setRecognitionResult(const String& result)
+{
+ m_listener->setRecognitionResult(result);
+}
+
+bool SpeechInput::startRecognition()
+{
+ if (m_client)
+ return m_client->startRecognition(this);
+ return false;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
diff --git a/WebCore/page/SpeechInput.h b/WebCore/page/SpeechInput.h
new file mode 100644
index 0000000..201be99
--- /dev/null
+++ b/WebCore/page/SpeechInput.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SpeechInput_h
+#define SpeechInput_h
+
+#if ENABLE(INPUT_SPEECH)
+
+#include "SpeechInputClientListener.h"
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class SpeechInputClient;
+class SpeechInputListener;
+class String;
+
+// This class connects the input elements requiring speech input with the platform specific
+// speech recognition engine. It provides methods for the input elements to activate speech
+// recognition and methods for the speech recognition engine to return back the results.
+class SpeechInput : public Noncopyable, public SpeechInputClientListener {
+public:
+ SpeechInput(SpeechInputClient*, SpeechInputListener*);
+ virtual ~SpeechInput() { }
+
+ // Methods invoked by the input elements.
+ virtual bool startRecognition();
+
+ // SpeechInputClient::Listener methods.
+ virtual void recordingComplete();
+ virtual void setRecognitionResult(const String&);
+
+protected:
+ SpeechInputClient* client() const { return m_client; }
+
+private:
+ SpeechInputClient* m_client;
+ SpeechInputListener* m_listener;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
+
+#endif // SpeechInput_h
diff --git a/WebCore/page/SpeechInputClient.h b/WebCore/page/SpeechInputClient.h
new file mode 100644
index 0000000..be68f46
--- /dev/null
+++ b/WebCore/page/SpeechInputClient.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SpeechInputClient_h
+#define SpeechInputClient_h
+
+#if ENABLE(INPUT_SPEECH)
+
+namespace WebCore {
+
+class SpeechInputClientListener;
+
+// Provides an interface for SpeechInput to call into the embedder.
+class SpeechInputClient {
+public:
+ virtual bool startRecognition(SpeechInputClientListener* listener) = 0;
+
+protected:
+ virtual ~SpeechInputClient() { }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
+
+#endif // SpeechInputClient_h
diff --git a/WebCore/page/SpeechInputClientListener.h b/WebCore/page/SpeechInputClientListener.h
new file mode 100644
index 0000000..a9a897e
--- /dev/null
+++ b/WebCore/page/SpeechInputClientListener.h
@@ -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:
+ *
+ * * 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 SpeechInputClientListener_h
+#define SpeechInputClientListener_h
+
+#if ENABLE(INPUT_SPEECH)
+
+namespace WebCore {
+
+class String;
+
+// Provides an interface for the embedder to call into WebCore.
+class SpeechInputClientListener {
+public:
+ virtual void recordingComplete() = 0;
+ virtual void setRecognitionResult(const String& result) = 0;
+
+protected:
+ virtual ~SpeechInputClientListener() { }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
+
+#endif // SpeechInputClientListener_h
diff --git a/WebCore/page/SpeechInputListener.h b/WebCore/page/SpeechInputListener.h
new file mode 100644
index 0000000..d087d36
--- /dev/null
+++ b/WebCore/page/SpeechInputListener.h
@@ -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:
+ *
+ * * 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 SpeechInputListener_h
+#define SpeechInputListener_h
+
+#if ENABLE(INPUT_SPEECH)
+
+namespace WebCore {
+
+class String;
+
+// Interface to be implemented by the element which invokes SpeechInput.
+class SpeechInputListener {
+public:
+ virtual void recordingComplete() = 0;
+ virtual void setRecognitionResult(const String& result) = 0;
+
+protected:
+ virtual ~SpeechInputListener() { }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
+
+#endif // SpeechInputListener_h
diff --git a/WebCore/page/Timing.cpp b/WebCore/page/Timing.cpp
index af00441..527390a 100644
--- a/WebCore/page/Timing.cpp
+++ b/WebCore/page/Timing.cpp
@@ -33,10 +33,40 @@
#if ENABLE(WEB_TIMING)
+#include "DocumentLoader.h"
#include "Frame.h"
+#include "ResourceLoadTiming.h"
+#include "ResourceResponse.h"
namespace WebCore {
+static unsigned long long toIntegerMilliseconds(double seconds)
+{
+ ASSERT(seconds >= 0);
+ return static_cast<unsigned long long>(seconds * 1000.0);
+}
+
+static double getPossiblySkewedTimeInKnownRange(double skewedTime, double lowerBound, double upperBound)
+{
+#if PLATFORM(CHROMIUM)
+ // The chromium port's currentTime() implementation only syncs with the
+ // system clock every 60 seconds. So it is possible for timing marks
+ // collected in different threads or processes to have a small skew.
+ // FIXME: It may be possible to add a currentTimeFromSystemTime() method
+ // that eliminates the skew.
+ if (skewedTime <= lowerBound)
+ return lowerBound;
+
+ if (skewedTime >= upperBound)
+ return upperBound;
+#else
+ ASSERT_UNUSED(lowerBound, skewedTime >= lowerBound);
+ ASSERT_UNUSED(upperBound, skewedTime <= upperBound);
+#endif
+
+ return skewedTime;
+}
+
Timing::Timing(Frame* frame)
: m_frame(frame)
{
@@ -54,34 +84,214 @@ void Timing::disconnectFrame()
unsigned long long Timing::navigationStart() const
{
- if (!m_frame)
+ DocumentLoadTiming* timing = documentLoadTiming();
+ if (!timing)
return 0;
- return static_cast<unsigned long long>(m_frame->loader()->frameLoadTimeline()->navigationStart * 1000);
+ return toIntegerMilliseconds(timing->navigationStart);
}
unsigned long long Timing::unloadEventEnd() const
{
- if (!m_frame)
+ DocumentLoadTiming* timing = documentLoadTiming();
+ if (!timing)
+ return 0;
+
+ return toIntegerMilliseconds(timing->unloadEventEnd);
+}
+
+unsigned long long Timing::redirectStart() const
+{
+ DocumentLoadTiming* timing = documentLoadTiming();
+ if (!timing)
+ return 0;
+
+ return toIntegerMilliseconds(timing->redirectStart);
+}
+
+unsigned long long Timing::redirectEnd() const
+{
+ DocumentLoadTiming* timing = documentLoadTiming();
+ if (!timing)
+ return 0;
+
+ return toIntegerMilliseconds(timing->redirectEnd);
+}
+
+unsigned long long Timing::fetchStart() const
+{
+ DocumentLoadTiming* timing = documentLoadTiming();
+ if (!timing)
+ return 0;
+
+ return toIntegerMilliseconds(timing->fetchStart);
+}
+
+unsigned long long Timing::domainLookupStart() const
+{
+ ResourceLoadTiming* timing = resourceLoadTiming();
+ if (!timing)
+ return 0;
+
+ // This will be -1 when a DNS request is not performed.
+ // Rather than exposing a special value that indicates no DNS, we "backfill" with fetchStart.
+ int dnsStart = timing->dnsStart;
+ if (dnsStart < 0)
+ return fetchStart();
+
+ return resourceLoadTimeRelativeToAbsolute(dnsStart);
+}
+
+unsigned long long Timing::domainLookupEnd() const
+{
+ ResourceLoadTiming* timing = resourceLoadTiming();
+ if (!timing)
return 0;
- return static_cast<unsigned long long>(m_frame->loader()->frameLoadTimeline()->unloadEventEnd * 1000);
+ // This will be -1 when a DNS request is not performed.
+ // Rather than exposing a special value that indicates no DNS, we "backfill" with domainLookupStart.
+ int dnsEnd = timing->dnsEnd;
+ if (dnsEnd < 0)
+ return domainLookupStart();
+
+ return resourceLoadTimeRelativeToAbsolute(dnsEnd);
+}
+
+unsigned long long Timing::connectStart() const
+{
+ ResourceLoadTiming* timing = resourceLoadTiming();
+ if (!timing)
+ return 0;
+
+ // This will be -1 when a new connection is not established.
+ // Rather than exposing a special value that indicates no new connection, we "backfill" with domainLookupEnd.
+ int connectStart = timing->connectStart;
+ if (connectStart < 0)
+ return domainLookupEnd();
+
+ return resourceLoadTimeRelativeToAbsolute(connectStart);
+}
+
+unsigned long long Timing::connectEnd() const
+{
+ ResourceLoadTiming* timing = resourceLoadTiming();
+ if (!timing)
+ return 0;
+
+ // This will be -1 when a new connection is not established.
+ // Rather than exposing a special value that indicates no new connection, we "backfill" with connectStart.
+ int connectEnd = timing->connectEnd;
+ if (connectEnd < 0)
+ return connectStart();
+
+ return resourceLoadTimeRelativeToAbsolute(connectEnd);
+}
+
+unsigned long long Timing::requestStart() const
+{
+ ResourceLoadTiming* timing = resourceLoadTiming();
+ if (!timing)
+ return 0;
+
+ ASSERT(timing->sendStart >= 0);
+ return resourceLoadTimeRelativeToAbsolute(timing->sendStart);
+}
+
+unsigned long long Timing::requestEnd() const
+{
+ ResourceLoadTiming* timing = resourceLoadTiming();
+ if (!timing)
+ return 0;
+
+ ASSERT(timing->sendEnd >= 0);
+ return resourceLoadTimeRelativeToAbsolute(timing->sendEnd);
+}
+
+unsigned long long Timing::responseStart() const
+{
+ ResourceLoadTiming* timing = resourceLoadTiming();
+ if (!timing)
+ return 0;
+
+ // FIXME: Response start needs to be the time of the first received byte.
+ // However, the ResourceLoadTiming API currently only supports the time
+ // the last header byte was received. For many responses with reasonable
+ // sized cookies, the HTTP headers fit into a single packet so this time
+ // is basically equivalent. But for some responses, particularly those with
+ // headers larger than a single packet, this time will be too late.
+ ASSERT(timing->receiveHeadersEnd >= 0);
+ return resourceLoadTimeRelativeToAbsolute(timing->receiveHeadersEnd);
+}
+
+unsigned long long Timing::responseEnd() const
+{
+ DocumentLoadTiming* timing = documentLoadTiming();
+ if (!timing)
+ return 0;
+
+ return toIntegerMilliseconds(timing->responseEnd);
}
unsigned long long Timing::loadEventStart() const
{
- if (!m_frame)
+ DocumentLoadTiming* timing = documentLoadTiming();
+ if (!timing)
return 0;
- return static_cast<unsigned long long>(m_frame->loader()->frameLoadTimeline()->loadEventStart * 1000);
+ return toIntegerMilliseconds(timing->loadEventStart);
}
unsigned long long Timing::loadEventEnd() const
{
+ DocumentLoadTiming* timing = documentLoadTiming();
+ if (!timing)
+ return 0;
+
+ return toIntegerMilliseconds(timing->loadEventEnd);
+}
+
+DocumentLoader* Timing::documentLoader() const
+{
if (!m_frame)
return 0;
- return static_cast<unsigned long long>(m_frame->loader()->frameLoadTimeline()->loadEventEnd * 1000);
+ return m_frame->loader()->documentLoader();
+}
+
+DocumentLoadTiming* Timing::documentLoadTiming() const
+{
+ DocumentLoader* loader = documentLoader();
+ if (!loader)
+ return 0;
+
+ return loader->timing();
+}
+
+ResourceLoadTiming* Timing::resourceLoadTiming() const
+{
+ DocumentLoader* loader = documentLoader();
+ if (!loader)
+ return 0;
+
+ return loader->response().resourceLoadTiming();
+}
+
+unsigned long long Timing::resourceLoadTimeRelativeToAbsolute(int relativeSeconds) const
+{
+ ASSERT(relativeSeconds >= 0);
+ ResourceLoadTiming* resourceTiming = resourceLoadTiming();
+ ASSERT(resourceTiming);
+ DocumentLoadTiming* documentTiming = documentLoadTiming();
+ ASSERT(documentTiming);
+
+ // The ResourceLoadTiming API's requestTime is the base time to which all
+ // other marks are relative. So to get an absolute time, we must add it to
+ // the relative marks.
+ //
+ // Since ResourceLoadTimings came from the network platform layer, we must
+ // check them for skew because they may be from another thread/process.
+ double baseTime = getPossiblySkewedTimeInKnownRange(resourceTiming->requestTime, documentTiming->fetchStart, documentTiming->responseEnd);
+ return toIntegerMilliseconds(baseTime) + relativeSeconds;
}
} // namespace WebCore
diff --git a/WebCore/page/Timing.h b/WebCore/page/Timing.h
index 47ce478..f48f525 100644
--- a/WebCore/page/Timing.h
+++ b/WebCore/page/Timing.h
@@ -38,7 +38,10 @@
namespace WebCore {
+struct DocumentLoadTiming;
+class DocumentLoader;
class Frame;
+class ResourceLoadTiming;
class Timing : public RefCounted<Timing> {
public:
@@ -49,12 +52,28 @@ public:
unsigned long long navigationStart() const;
unsigned long long unloadEventEnd() const;
+ unsigned long long redirectStart() const;
+ unsigned long long redirectEnd() const;
+ unsigned long long fetchStart() const;
+ unsigned long long domainLookupStart() const;
+ unsigned long long domainLookupEnd() const;
+ unsigned long long connectStart() const;
+ unsigned long long connectEnd() const;
+ unsigned long long requestStart() const;
+ unsigned long long requestEnd() const;
+ unsigned long long responseStart() const;
+ unsigned long long responseEnd() const;
unsigned long long loadEventStart() const;
unsigned long long loadEventEnd() const;
private:
Timing(Frame*);
+ DocumentLoader* documentLoader() const;
+ DocumentLoadTiming* documentLoadTiming() const;
+ ResourceLoadTiming* resourceLoadTiming() const;
+ unsigned long long resourceLoadTimeRelativeToAbsolute(int) const;
+
Frame* m_frame;
};
diff --git a/WebCore/page/Timing.idl b/WebCore/page/Timing.idl
index dbe996e..e7e46cc 100644
--- a/WebCore/page/Timing.idl
+++ b/WebCore/page/Timing.idl
@@ -32,20 +32,19 @@ module window {
// See: http://dev.w3.org/2006/webapi/WebTiming/
interface [Conditional=WEB_TIMING, OmitConstructor] Timing {
- // FIXME: Implement remainder of interface.
readonly attribute unsigned long long navigationStart;
- // readonly attribute unsigned long long fetchStart;
readonly attribute unsigned long long unloadEventEnd;
- // readonly attribute unsigned long long redirectStart;
- // readonly attribute unsigned long long redirectEnd;
- // readonly attribute unsigned long long domainLookupStart;
- // readonly attribute unsigned long long domainLookupEnd;
- // readonly attribute unsigned long long connectStart;
- // readonly attribute unsigned long long connectEnd;
- // readonly attribute unsigned long long requestStart;
- // readonly attribute unsigned long long requestEnd;
- // readonly attribute unsigned long long responseStart;
- // readonly attribute unsigned long long responseEnd;
+ readonly attribute unsigned long long redirectStart;
+ readonly attribute unsigned long long redirectEnd;
+ readonly attribute unsigned long long fetchStart;
+ readonly attribute unsigned long long domainLookupStart;
+ readonly attribute unsigned long long domainLookupEnd;
+ readonly attribute unsigned long long connectStart;
+ readonly attribute unsigned long long connectEnd;
+ readonly attribute unsigned long long requestStart;
+ readonly attribute unsigned long long requestEnd;
+ readonly attribute unsigned long long responseStart;
+ readonly attribute unsigned long long responseEnd;
readonly attribute unsigned long long loadEventStart;
readonly attribute unsigned long long loadEventEnd;
};
diff --git a/WebCore/page/animation/AnimationBase.cpp b/WebCore/page/animation/AnimationBase.cpp
index 7195d1f..83fd039 100644
--- a/WebCore/page/animation/AnimationBase.cpp
+++ b/WebCore/page/animation/AnimationBase.cpp
@@ -774,7 +774,7 @@ AnimationBase::AnimationBase(const Animation* transition, RenderObject* renderer
, m_object(renderer)
, m_animation(const_cast<Animation*>(transition))
, m_compAnim(compAnim)
- , m_fallbackAnimating(false)
+ , m_isAccelerated(false)
, m_transformFunctionListValid(false)
, m_nextIterationDuration(-1)
, m_next(0)
@@ -837,7 +837,7 @@ bool AnimationBase::blendProperties(const AnimationBase* anim, int prop, RenderS
if (wrapper) {
wrapper->blend(anim, dst, a, b, progress);
#if USE(ACCELERATED_COMPOSITING)
- return !wrapper->animationIsAccelerated() || anim->isFallbackAnimating();
+ return !wrapper->animationIsAccelerated() || !anim->isAccelerated();
#else
return true;
#endif
@@ -974,7 +974,7 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param)
// We won't try to start accelerated animations if we are overridden and
// just move on to the next state.
m_animState = AnimationStateStartWaitResponse;
- m_fallbackAnimating = true;
+ m_isAccelerated = false;
updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime());
}
else {
@@ -985,7 +985,7 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param)
bool started = startAnimation(timeOffset);
m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started);
- m_fallbackAnimating = !started;
+ m_isAccelerated = started;
}
break;
case AnimationStateStartWaitResponse:
@@ -1108,11 +1108,11 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param)
// We won't try to start accelerated animations if we are overridden and
// just move on to the next state.
updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime());
- m_fallbackAnimating = true;
+ m_isAccelerated = false;
} else {
bool started = startAnimation(beginAnimationUpdateTime() - m_startTime);
m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started);
- m_fallbackAnimating = !started;
+ m_isAccelerated = started;
}
break;
case AnimationStateFillingForwards:
diff --git a/WebCore/page/animation/AnimationBase.h b/WebCore/page/animation/AnimationBase.h
index 91ef8cf..9bdca3a 100644
--- a/WebCore/page/animation/AnimationBase.h
+++ b/WebCore/page/animation/AnimationBase.h
@@ -144,9 +144,10 @@ public:
// Does this animation/transition involve the given property?
virtual bool affectsProperty(int /*property*/) const { return false; }
- bool isAnimatingProperty(int property, bool isRunningNow) const
+
+ bool isAnimatingProperty(int property, bool acceleratedOnly, bool isRunningNow) const
{
- if (m_fallbackAnimating)
+ if (acceleratedOnly && !m_isAccelerated)
return false;
if (isRunningNow)
@@ -197,7 +198,7 @@ protected:
void goIntoEndingOrLoopingState();
- bool isFallbackAnimating() const { return m_fallbackAnimating; }
+ bool isAccelerated() const { return m_isAccelerated; }
static bool propertiesEqual(int prop, const RenderStyle* a, const RenderStyle* b);
static int getPropertyAtIndex(int, bool& isShorthand);
@@ -220,7 +221,7 @@ protected:
RefPtr<Animation> m_animation;
CompositeAnimation* m_compAnim;
- bool m_fallbackAnimating; // true when animating an accelerated property but have to fall back to software
+ bool m_isAccelerated;
bool m_transformFunctionListValid;
double m_totalDuration, m_nextIterationDuration;
diff --git a/WebCore/page/animation/AnimationController.cpp b/WebCore/page/animation/AnimationController.cpp
index 3761c5a..b5d87e6 100644
--- a/WebCore/page/animation/AnimationController.cpp
+++ b/WebCore/page/animation/AnimationController.cpp
@@ -209,13 +209,22 @@ void AnimationControllerPrivate::animationTimerFired(Timer<AnimationControllerPr
fireEventsAndUpdateStyle();
}
-bool AnimationControllerPrivate::isAnimatingPropertyOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const
+bool AnimationControllerPrivate::isRunningAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const
{
RefPtr<CompositeAnimation> animation = m_compositeAnimations.get(renderer);
if (!animation)
return false;
- return animation->isAnimatingProperty(property, isRunningNow);
+ return animation->isAnimatingProperty(property, false, isRunningNow);
+}
+
+bool AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const
+{
+ RefPtr<CompositeAnimation> animation = m_compositeAnimations.get(renderer);
+ if (!animation)
+ return false;
+
+ return animation->isAnimatingProperty(property, true, isRunningNow);
}
void AnimationControllerPrivate::suspendAnimations(Document* document)
@@ -532,9 +541,14 @@ bool AnimationController::pauseTransitionAtTime(RenderObject* renderer, const St
return m_data->pauseTransitionAtTime(renderer, property, t);
}
-bool AnimationController::isAnimatingPropertyOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const
+bool AnimationController::isRunningAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const
+{
+ return m_data->isRunningAnimationOnRenderer(renderer, property, isRunningNow);
+}
+
+bool AnimationController::isRunningAcceleratedAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const
{
- return m_data->isAnimatingPropertyOnRenderer(renderer, property, isRunningNow);
+ return m_data->isRunningAcceleratedAnimationOnRenderer(renderer, property, isRunningNow);
}
void AnimationController::suspendAnimations(Document* document)
diff --git a/WebCore/page/animation/AnimationController.h b/WebCore/page/animation/AnimationController.h
index db82618..d184b45 100644
--- a/WebCore/page/animation/AnimationController.h
+++ b/WebCore/page/animation/AnimationController.h
@@ -61,7 +61,8 @@ public:
bool pauseTransitionAtTime(RenderObject*, const String& property, double t); // To be used only for testing
unsigned numberOfActiveAnimations() const; // To be used only for testing
- bool isAnimatingPropertyOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow = true) const;
+ bool isRunningAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow = true) const;
+ bool isRunningAcceleratedAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow = true) const;
void suspendAnimations(Document*);
void resumeAnimations(Document*);
diff --git a/WebCore/page/animation/AnimationControllerPrivate.h b/WebCore/page/animation/AnimationControllerPrivate.h
index 5ef9098..3ae15a5 100644
--- a/WebCore/page/animation/AnimationControllerPrivate.h
+++ b/WebCore/page/animation/AnimationControllerPrivate.h
@@ -70,7 +70,8 @@ public:
void suspendAnimations(Document*);
void resumeAnimations(Document*);
- bool isAnimatingPropertyOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow) const;
+ bool isRunningAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow) const;
+ bool isRunningAcceleratedAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow) const;
bool pauseAnimationAtTime(RenderObject*, const String& name, double t);
bool pauseTransitionAtTime(RenderObject*, const String& property, double t);
diff --git a/WebCore/page/animation/CompositeAnimation.cpp b/WebCore/page/animation/CompositeAnimation.cpp
index 7619b1f..57c2aa4 100644
--- a/WebCore/page/animation/CompositeAnimation.cpp
+++ b/WebCore/page/animation/CompositeAnimation.cpp
@@ -136,7 +136,7 @@ void CompositeAnimation::updateTransitions(RenderObject* renderer, RenderStyle*
#if USE(ACCELERATED_COMPOSITING)
// For accelerated animations we need to return a new RenderStyle with the _current_ value
// of the property, so that restarted transitions use the correct starting point.
- if (AnimationBase::animationOfPropertyIsAccelerated(prop) && !implAnim->isFallbackAnimating()) {
+ if (AnimationBase::animationOfPropertyIsAccelerated(prop) && implAnim->isAccelerated()) {
if (!modifiedCurrentStyle)
modifiedCurrentStyle = RenderStyle::clone(currentStyle);
@@ -460,14 +460,14 @@ void CompositeAnimation::resumeOverriddenImplicitAnimations(int property)
}
}
-bool CompositeAnimation::isAnimatingProperty(int property, bool isRunningNow) const
+bool CompositeAnimation::isAnimatingProperty(int property, bool acceleratedOnly, bool isRunningNow) const
{
if (!m_keyframeAnimations.isEmpty()) {
m_keyframeAnimations.checkConsistency();
AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
KeyframeAnimation* anim = it->second.get();
- if (anim && anim->isAnimatingProperty(property, isRunningNow))
+ if (anim && anim->isAnimatingProperty(property, acceleratedOnly, isRunningNow))
return true;
}
}
@@ -476,7 +476,7 @@ bool CompositeAnimation::isAnimatingProperty(int property, bool isRunningNow) co
CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
ImplicitAnimation* anim = it->second.get();
- if (anim && anim->isAnimatingProperty(property, isRunningNow))
+ if (anim && anim->isAnimatingProperty(property, acceleratedOnly, isRunningNow))
return true;
}
}
diff --git a/WebCore/page/animation/CompositeAnimation.h b/WebCore/page/animation/CompositeAnimation.h
index b7db442..51ba565 100644
--- a/WebCore/page/animation/CompositeAnimation.h
+++ b/WebCore/page/animation/CompositeAnimation.h
@@ -70,8 +70,8 @@ public:
bool hasAnimations() const { return !m_transitions.isEmpty() || !m_keyframeAnimations.isEmpty(); }
void setAnimating(bool);
- bool isAnimatingProperty(int property, bool isRunningNow) const;
-
+ bool isAnimatingProperty(int property, bool acceleratedOnly, bool isRunningNow) const;
+
PassRefPtr<KeyframeAnimation> getAnimationForProperty(int property) const;
void overrideImplicitAnimations(int property);
diff --git a/WebCore/page/animation/ImplicitAnimation.cpp b/WebCore/page/animation/ImplicitAnimation.cpp
index 328fe0e..da0a810 100644
--- a/WebCore/page/animation/ImplicitAnimation.cpp
+++ b/WebCore/page/animation/ImplicitAnimation.cpp
@@ -273,7 +273,7 @@ double ImplicitAnimation::timeToNextService()
// A return value of 0 means we need service. But if this is an accelerated animation we
// only need service at the end of the transition.
- if (animationOfPropertyIsAccelerated(m_animatingProperty) && !isFallbackAnimating()) {
+ if (animationOfPropertyIsAccelerated(m_animatingProperty) && isAccelerated()) {
bool isLooping;
getTimeToNextEvent(t, isLooping);
}
diff --git a/WebCore/page/animation/KeyframeAnimation.cpp b/WebCore/page/animation/KeyframeAnimation.cpp
index 4c2cbc8..2f2cfc0 100644
--- a/WebCore/page/animation/KeyframeAnimation.cpp
+++ b/WebCore/page/animation/KeyframeAnimation.cpp
@@ -400,7 +400,7 @@ double KeyframeAnimation::timeToNextService()
bool acceleratedPropertiesOnly = true;
for (HashSet<int>::const_iterator it = m_keyframes.beginProperties(); it != endProperties; ++it) {
- if (!animationOfPropertyIsAccelerated(*it) || isFallbackAnimating()) {
+ if (!animationOfPropertyIsAccelerated(*it) || !isAccelerated()) {
acceleratedPropertiesOnly = false;
break;
}
diff --git a/WebCore/page/chromium/ChromeClientChromium.h b/WebCore/page/chromium/ChromeClientChromium.h
index e897c15..46985b1 100644
--- a/WebCore/page/chromium/ChromeClientChromium.h
+++ b/WebCore/page/chromium/ChromeClientChromium.h
@@ -39,6 +39,10 @@ class AccessibilityObject;
class IntRect;
class PopupContainer;
+#if USE(ACCELERATED_COMPOSITING)
+class GLES2Context;
+#endif
+
// Contains Chromium-specific extensions to the ChromeClient. Only put
// things here that don't make sense for other ports.
class ChromeClientChromium : public ChromeClient {
@@ -55,6 +59,12 @@ public:
// Notifies embedder that the state of an accessibility object has changed.
virtual void didChangeAccessibilityObjectState(AccessibilityObject*) = 0;
+
+#if USE(ACCELERATED_COMPOSITING)
+ // Request a GL ES 2 context to use for compositing this page's content.
+ virtual PassOwnPtr<GLES2Context> getOnscreenGLES2Context() = 0;
+ virtual PassOwnPtr<GLES2Context> getOffscreenGLES2Context() = 0;
+#endif
};
} // namespace WebCore
diff --git a/WebCore/page/mac/EventHandlerMac.mm b/WebCore/page/mac/EventHandlerMac.mm
index 8842e31..bb466db 100644
--- a/WebCore/page/mac/EventHandlerMac.mm
+++ b/WebCore/page/mac/EventHandlerMac.mm
@@ -215,10 +215,14 @@ bool EventHandler::passMouseDownEventToWidget(Widget* pWidget)
return true;
}
+ // In WebKit2 we will never have an NSView. Just return early and let the regular event handler machinery take care of
+ // dispatching the event.
+ if (!widget->platformWidget())
+ return false;
+
BEGIN_BLOCK_OBJC_EXCEPTIONS;
NSView *nodeView = widget->platformWidget();
- ASSERT(nodeView);
ASSERT([nodeView superview]);
NSView *view = [nodeView hitTest:[[nodeView superview] convertPoint:[currentNSEvent() locationInWindow] fromView:nil]];
if (!view) {
diff --git a/WebCore/platform/BlobItem.cpp b/WebCore/platform/BlobItem.cpp
index a12dd08..cc5e6c7 100644
--- a/WebCore/platform/BlobItem.cpp
+++ b/WebCore/platform/BlobItem.cpp
@@ -78,6 +78,20 @@ FileBlobItem::FileBlobItem(const String& path)
{
}
+#if ENABLE(DIRECTORY_UPLOAD)
+PassRefPtr<BlobItem> FileBlobItem::create(const String& path, const String& relativePath)
+{
+ return adoptRef(static_cast<BlobItem*>(new FileBlobItem(path, relativePath)));
+}
+
+FileBlobItem::FileBlobItem(const String& path, const String& relativePath)
+ : m_path(path)
+ , m_fileName(pathGetFileName(m_path))
+ , m_relativePath(relativePath)
+{
+}
+#endif
+
unsigned long long FileBlobItem::size() const
{
// FIXME: synchronized file call
@@ -105,144 +119,16 @@ PassRefPtr<BlobItem> FileBlobItem::slice(long long start, long long length)
// StringBlobItem --------------------------------------------------------------
-PassRefPtr<BlobItem> StringBlobItem::create(const String& text, LineEnding ending, TextEncoding encoding)
-{
- return adoptRef(static_cast<BlobItem*>(new StringBlobItem(text, ending, encoding)));
-}
-
PassRefPtr<BlobItem> StringBlobItem::create(const CString& text)
{
return adoptRef(static_cast<BlobItem*>(new StringBlobItem(text)));
}
-StringBlobItem::StringBlobItem(const String& text, LineEnding ending, TextEncoding encoding)
- : m_data(StringBlobItem::convertToCString(text, ending, encoding))
-{
-}
-
StringBlobItem::StringBlobItem(const CString& text)
: m_data(text)
{
}
-// Normalize all line-endings to CRLF.
-static CString convertToCRLF(const CString& from)
-{
- unsigned newLen = 0;
- const char* p = from.data();
- while (char c = *p++) {
- if (c == '\r') {
- // Safe to look ahead because of trailing '\0'.
- if (*p != '\n') {
- // Turn CR into CRLF.
- newLen += 2;
- }
- } else if (c == '\n') {
- // Turn LF into CRLF.
- newLen += 2;
- } else {
- // Leave other characters alone.
- newLen += 1;
- }
- }
- if (newLen == from.length())
- return from;
-
- // Make a copy of the string.
- p = from.data();
- char* q;
- CString result = CString::newUninitialized(newLen, q);
- while (char c = *p++) {
- if (c == '\r') {
- // Safe to look ahead because of trailing '\0'.
- if (*p != '\n') {
- // Turn CR into CRLF.
- *q++ = '\r';
- *q++ = '\n';
- }
- } else if (c == '\n') {
- // Turn LF into CRLF.
- *q++ = '\r';
- *q++ = '\n';
- } else {
- // Leave other characters alone.
- *q++ = c;
- }
- }
- return result;
-}
-
-// Normalize all line-endings to CR or LF.
-static CString convertToCROrLF(const CString& from, bool toCR)
-{
- unsigned newLen = 0;
- bool needFix = false;
- const char* p = from.data();
- char fromEndingChar = toCR ? '\n' : '\r';
- char toEndingChar = toCR ? '\r' : '\n';
- while (char c = *p++) {
- if (c == '\r' && *p == '\n') {
- // Turn CRLF into CR or LF.
- p++;
- needFix = true;
- } else if (c == fromEndingChar) {
- // Turn CR/LF into LF/CR.
- needFix = true;
- }
- newLen += 1;
- }
- if (!needFix)
- return from;
-
- // Make a copy of the string.
- p = from.data();
- char* q;
- CString result = CString::newUninitialized(newLen, q);
- while (char c = *p++) {
- if (c == '\r' && *p == '\n') {
- // Turn CRLF or CR into CR or LF.
- p++;
- *q++ = toEndingChar;
- } else if (c == fromEndingChar) {
- // Turn CR/LF into LF/CR.
- *q++ = toEndingChar;
- } else {
- // Leave other characters alone.
- *q++ = c;
- }
- }
- return result;
-}
-
-CString StringBlobItem::convertToCString(const String& text, LineEnding ending, TextEncoding encoding)
-{
- CString from = encoding.encode(text.characters(), text.length(), EntitiesForUnencodables);
-
- if (ending == EndingNative) {
-#if OS(WINDOWS)
- ending = EndingCRLF;
-#else
- ending = EndingLF;
-#endif
- }
-
- switch (ending) {
- case EndingTransparent:
- return from;
- case EndingCRLF:
- return convertToCRLF(from);
- case EndingCR:
- return convertToCROrLF(from, true);
- case EndingLF:
- return convertToCROrLF(from, false);
- default:
- ASSERT_NOT_REACHED();
- }
-
- ASSERT_NOT_REACHED();
- return from;
-}
-
// ByteArrayBlobItem ----------------------------------------------------------
PassRefPtr<BlobItem> ByteArrayBlobItem::create(const char* data, size_t size)
diff --git a/WebCore/platform/BlobItem.h b/WebCore/platform/BlobItem.h
index 1d34c59..3741f3f 100644
--- a/WebCore/platform/BlobItem.h
+++ b/WebCore/platform/BlobItem.h
@@ -32,7 +32,6 @@
#define BlobItem_h
#include "PlatformString.h"
-#include "TextEncoding.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -41,15 +40,6 @@
namespace WebCore {
-// String ending types.
-enum LineEnding {
- EndingTransparent = 0,
- EndingNative,
- EndingLF,
- EndingCR,
- EndingCRLF,
-};
-
class ByteArrayBlobItem;
class DataBlobItem;
class DataRangeBlobItem;
@@ -108,8 +98,14 @@ public:
class FileBlobItem : public BlobItem {
public:
static PassRefPtr<BlobItem> create(const String& path);
+#if ENABLE(DIRECTORY_UPLOAD)
+ static PassRefPtr<BlobItem> create(const String& path, const String& relativePath);
+#endif
virtual const String& name() const { return m_fileName; }
virtual const String& path() const { return m_path; }
+#if ENABLE(DIRECTORY_UPLOAD)
+ const String& relativePath() const { return m_relativePath; }
+#endif
// BlobItem methods.
virtual unsigned long long size() const;
@@ -120,13 +116,18 @@ public:
protected:
FileBlobItem(const String& path);
+#if ENABLE(DIRECTORY_UPLOAD)
+ FileBlobItem(const String& path, const String& relativePath);
+#endif
String m_path;
String m_fileName;
+#if ENABLE(DIRECTORY_UPLOAD)
+ String m_relativePath;
+#endif
};
class StringBlobItem : public DataBlobItem {
public:
- static PassRefPtr<BlobItem> create(const String&, LineEnding, TextEncoding);
static PassRefPtr<BlobItem> create(const CString&);
const CString& cstr() const { return m_data; }
@@ -138,9 +139,7 @@ public:
virtual const char* data() const { return m_data.data(); }
private:
- StringBlobItem(const String&, LineEnding, TextEncoding);
StringBlobItem(const CString&);
- static CString convertToCString(const String&, LineEnding, TextEncoding);
CString m_data;
};
diff --git a/WebCore/platform/Cursor.cpp b/WebCore/platform/Cursor.cpp
index 794a9dc..3f17ad9 100644
--- a/WebCore/platform/Cursor.cpp
+++ b/WebCore/platform/Cursor.cpp
@@ -46,4 +46,477 @@ IntPoint determineHotSpot(Image* image, const IntPoint& specifiedHotSpot)
return IntPoint();
}
+const Cursor& Cursor::fromType(Cursor::Type type)
+{
+ switch (type) {
+ case Cursor::Pointer:
+ return pointerCursor();
+ case Cursor::Cross:
+ return crossCursor();
+ case Cursor::Hand:
+ return handCursor();
+ case Cursor::IBeam:
+ return iBeamCursor();
+ case Cursor::Wait:
+ return waitCursor();
+ case Cursor::Help:
+ return helpCursor();
+ case Cursor::EastResize:
+ return eastResizeCursor();
+ case Cursor::NorthResize:
+ return northResizeCursor();
+ case Cursor::NorthEastResize:
+ return northEastResizeCursor();
+ case Cursor::NorthWestResize:
+ return northWestResizeCursor();
+ case Cursor::SouthResize:
+ return southResizeCursor();
+ case Cursor::SouthEastResize:
+ return southEastResizeCursor();
+ case Cursor::SouthWestResize:
+ return southWestResizeCursor();
+ case Cursor::WestResize:
+ return westResizeCursor();
+ case Cursor::NorthSouthResize:
+ return northSouthResizeCursor();
+ case Cursor::EastWestResize:
+ return eastWestResizeCursor();
+ case Cursor::NorthEastSouthWestResize:
+ return northEastSouthWestResizeCursor();
+ case Cursor::NorthWestSouthEastResize:
+ return northWestSouthEastResizeCursor();
+ case Cursor::ColumnResize:
+ return columnResizeCursor();
+ case Cursor::RowResize:
+ return rowResizeCursor();
+ case Cursor::MiddlePanning:
+ return middlePanningCursor();
+ case Cursor::EastPanning:
+ return eastPanningCursor();
+ case Cursor::NorthPanning:
+ return northPanningCursor();
+ case Cursor::NorthEastPanning:
+ return northEastPanningCursor();
+ case Cursor::NorthWestPanning:
+ return northWestPanningCursor();
+ case Cursor::SouthPanning:
+ return southPanningCursor();
+ case Cursor::SouthEastPanning:
+ return southEastPanningCursor();
+ case Cursor::SouthWestPanning:
+ return southWestPanningCursor();
+ case Cursor::WestPanning:
+ return westPanningCursor();
+ case Cursor::Move:
+ return moveCursor();
+ case Cursor::VerticalText:
+ return verticalTextCursor();
+ case Cursor::Cell:
+ return cellCursor();
+ case Cursor::ContextMenu:
+ return contextMenuCursor();
+ case Cursor::Alias:
+ return aliasCursor();
+ case Cursor::Progress:
+ return progressCursor();
+ case Cursor::NoDrop:
+ return noDropCursor();
+ case Cursor::Copy:
+ return copyCursor();
+ case Cursor::None:
+ return noneCursor();
+ case Cursor::NotAllowed:
+ return notAllowedCursor();
+ case Cursor::ZoomIn:
+ return zoomInCursor();
+ case Cursor::ZoomOut:
+ return zoomOutCursor();
+ case Cursor::Grab:
+ return grabCursor();
+ case Cursor::Grabbing:
+ return grabbingCursor();
+ case Cursor::Custom:
+ ASSERT_NOT_REACHED();
+ }
+ return pointerCursor();
+}
+
+const char* nameForCursorType(Cursor::Type type)
+{
+ switch (type) {
+ case Cursor::Pointer:
+ return "Pointer";
+ case Cursor::Cross:
+ return "Cross";
+ case Cursor::Hand:
+ return "Hand";
+ case Cursor::IBeam:
+ return "IBeam";
+ case Cursor::Wait:
+ return "Wait";
+ case Cursor::Help:
+ return "Help";
+ case Cursor::EastResize:
+ return "EastResize";
+ case Cursor::NorthResize:
+ return "NorthResize";
+ case Cursor::NorthEastResize:
+ return "NorthEastResize";
+ case Cursor::NorthWestResize:
+ return "NorthWestResize";
+ case Cursor::SouthResize:
+ return "SouthResize";
+ case Cursor::SouthEastResize:
+ return "SouthEastResize";
+ case Cursor::SouthWestResize:
+ return "SouthWestResize";
+ case Cursor::WestResize:
+ return "WestResize";
+ case Cursor::NorthSouthResize:
+ return "NorthSouthResize";
+ case Cursor::EastWestResize:
+ return "EastWestResize";
+ case Cursor::NorthEastSouthWestResize:
+ return "NorthEastSouthWestResize";
+ case Cursor::NorthWestSouthEastResize:
+ return "NorthWestSouthEastResize";
+ case Cursor::ColumnResize:
+ return "ColumnResize";
+ case Cursor::RowResize:
+ return "RowResize";
+ case Cursor::MiddlePanning:
+ return "MiddlePanning";
+ case Cursor::EastPanning:
+ return "EastPanning";
+ case Cursor::NorthPanning:
+ return "NorthPanning";
+ case Cursor::NorthEastPanning:
+ return "NorthEastPanning";
+ case Cursor::NorthWestPanning:
+ return "NorthWestPanning";
+ case Cursor::SouthPanning:
+ return "SouthPanning";
+ case Cursor::SouthEastPanning:
+ return "SouthEastPanning";
+ case Cursor::SouthWestPanning:
+ return "SouthWestPanning";
+ case Cursor::WestPanning:
+ return "WestPanning";
+ case Cursor::Move:
+ return "Move";
+ case Cursor::VerticalText:
+ return "VerticalText";
+ case Cursor::Cell:
+ return "Cell";
+ case Cursor::ContextMenu:
+ return "ContextMenu";
+ case Cursor::Alias:
+ return "Alias";
+ case Cursor::Progress:
+ return "Progress";
+ case Cursor::NoDrop:
+ return "NoDrop";
+ case Cursor::Copy:
+ return "Copy";
+ case Cursor::None:
+ return "None";
+ case Cursor::NotAllowed:
+ return "NotAllowed";
+ case Cursor::ZoomIn:
+ return "ZoomIn";
+ case Cursor::ZoomOut:
+ return "ZoomOut";
+ case Cursor::Grab:
+ return "Grab";
+ case Cursor::Grabbing:
+ return "Grabbing";
+ case Cursor::Custom:
+ return "Custom";
+ }
+
+ return "ERROR";
+}
+
+#if USE(LAZY_NATIVE_CURSOR)
+
+Cursor::Cursor(Image* image, const IntPoint& hotSpot)
+ : m_type(Custom)
+ , m_image(image)
+ , m_hotSpot(determineHotSpot(image, hotSpot))
+ , m_platformCursor(0)
+{
+}
+
+Cursor::Cursor(Type type)
+ : m_type(type)
+ , m_platformCursor(0)
+{
+}
+
+PlatformCursor Cursor::platformCursor() const
+{
+ ensurePlatformCursor();
+ return m_platformCursor;
+}
+
+const Cursor& pointerCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Pointer));
+ return c;
+}
+
+const Cursor& crossCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Cross));
+ return c;
+}
+
+const Cursor& handCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Hand));
+ return c;
+}
+
+const Cursor& moveCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Move));
+ return c;
+}
+
+const Cursor& verticalTextCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::VerticalText));
+ return c;
+}
+
+const Cursor& cellCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Cell));
+ return c;
+}
+
+const Cursor& contextMenuCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::ContextMenu));
+ return c;
+}
+
+const Cursor& aliasCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Alias));
+ return c;
+}
+
+const Cursor& zoomInCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::ZoomIn));
+ return c;
+}
+
+const Cursor& zoomOutCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::ZoomOut));
+ return c;
+}
+
+const Cursor& copyCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Copy));
+ return c;
+}
+
+const Cursor& noneCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::None));
+ return c;
+}
+
+const Cursor& progressCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Progress));
+ return c;
+}
+
+const Cursor& noDropCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NoDrop));
+ return c;
+}
+
+const Cursor& notAllowedCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NotAllowed));
+ return c;
+}
+
+const Cursor& iBeamCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::IBeam));
+ return c;
+}
+
+const Cursor& waitCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Wait));
+ return c;
+}
+
+const Cursor& helpCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Help));
+ return c;
}
+
+const Cursor& eastResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::EastResize));
+ return c;
+}
+
+const Cursor& northResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthResize));
+ return c;
+}
+
+const Cursor& northEastResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthEastResize));
+ return c;
+}
+
+const Cursor& northWestResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthWestResize));
+ return c;
+}
+
+const Cursor& southResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthResize));
+ return c;
+}
+
+const Cursor& southEastResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthEastResize));
+ return c;
+}
+
+const Cursor& southWestResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthWestResize));
+ return c;
+}
+
+const Cursor& westResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::WestResize));
+ return c;
+}
+
+const Cursor& northSouthResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthSouthResize));
+ return c;
+}
+
+const Cursor& eastWestResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::EastWestResize));
+ return c;
+}
+
+const Cursor& northEastSouthWestResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthEastSouthWestResize));
+ return c;
+}
+
+const Cursor& northWestSouthEastResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthWestSouthEastResize));
+ return c;
+}
+
+const Cursor& columnResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::ColumnResize));
+ return c;
+}
+
+const Cursor& rowResizeCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::RowResize));
+ return c;
+}
+
+const Cursor& middlePanningCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::MiddlePanning));
+ return c;
+}
+
+const Cursor& eastPanningCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::EastPanning));
+ return c;
+}
+
+const Cursor& northPanningCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthPanning));
+ return c;
+}
+
+const Cursor& northEastPanningCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthEastPanning));
+ return c;
+}
+
+const Cursor& northWestPanningCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthWestPanning));
+ return c;
+}
+
+const Cursor& southPanningCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthPanning));
+ return c;
+}
+
+const Cursor& southEastPanningCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthEastPanning));
+ return c;
+}
+
+const Cursor& southWestPanningCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthWestPanning));
+ return c;
+}
+
+const Cursor& westPanningCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::WestPanning));
+ return c;
+}
+
+const Cursor& grabCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Grab));
+ return c;
+}
+
+const Cursor& grabbingCursor()
+{
+ DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Grabbing));
+ return c;
+}
+
+#endif
+
+} // namespace WebCore
diff --git a/WebCore/platform/Cursor.h b/WebCore/platform/Cursor.h
index 12b1614..98d69b9 100644
--- a/WebCore/platform/Cursor.h
+++ b/WebCore/platform/Cursor.h
@@ -26,12 +26,15 @@
#ifndef Cursor_h
#define Cursor_h
+#include "Image.h"
+#include "IntPoint.h"
+#include <wtf/RefPtr.h>
+
#if PLATFORM(WIN)
typedef struct HICON__* HICON;
typedef HICON HCURSOR;
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
#elif PLATFORM(GTK)
typedef struct _GdkCursor GdkCursor;
#elif PLATFORM(QT)
@@ -59,10 +62,13 @@ typedef struct HICON__ *HICON;
typedef HICON HCURSOR;
#endif
+#if PLATFORM(WIN) || PLATFORM(MAC)
+#define WTF_USE_LAZY_NATIVE_CURSOR 1
+#endif
+
namespace WebCore {
class Image;
- class IntPoint;
#if PLATFORM(WIN)
class SharedCursor : public RefCounted<SharedCursor> {
@@ -75,55 +81,113 @@ namespace WebCore {
HCURSOR m_nativeCursor;
};
typedef RefPtr<SharedCursor> PlatformCursor;
- typedef HCURSOR PlatformCursorHandle;
#elif PLATFORM(MAC)
typedef NSCursor* PlatformCursor;
- typedef NSCursor* PlatformCursorHandle;
#elif PLATFORM(GTK)
typedef GdkCursor* PlatformCursor;
- typedef GdkCursor* PlatformCursorHandle;
#elif PLATFORM(EFL)
typedef const char* PlatformCursor;
- typedef const char* PlatformCursorHandle;
#elif PLATFORM(QT) && !defined(QT_NO_CURSOR)
typedef QCursor PlatformCursor;
- typedef QCursor* PlatformCursorHandle;
#elif PLATFORM(WX)
typedef wxCursor* PlatformCursor;
- typedef wxCursor* PlatformCursorHandle;
#elif PLATFORM(CHROMIUM)
// See PlatformCursor.h
- typedef void* PlatformCursorHandle;
#elif PLATFORM(HAIKU)
typedef BCursor* PlatformCursor;
- typedef BCursor* PlatformCursorHandle;
#else
typedef void* PlatformCursor;
- typedef void* PlatformCursorHandle;
#endif
class Cursor {
public:
+ enum Type {
+ Pointer,
+ Cross,
+ Hand,
+ IBeam,
+ Wait,
+ Help,
+ EastResize,
+ NorthResize,
+ NorthEastResize,
+ NorthWestResize,
+ SouthResize,
+ SouthEastResize,
+ SouthWestResize,
+ WestResize,
+ NorthSouthResize,
+ EastWestResize,
+ NorthEastSouthWestResize,
+ NorthWestSouthEastResize,
+ ColumnResize,
+ RowResize,
+ MiddlePanning,
+ EastPanning,
+ NorthPanning,
+ NorthEastPanning,
+ NorthWestPanning,
+ SouthPanning,
+ SouthEastPanning,
+ SouthWestPanning,
+ WestPanning,
+ Move,
+ VerticalText,
+ Cell,
+ ContextMenu,
+ Alias,
+ Progress,
+ NoDrop,
+ Copy,
+ None,
+ NotAllowed,
+ ZoomIn,
+ ZoomOut,
+ Grab,
+ Grabbing,
+ Custom
+ };
+
+ static const Cursor& fromType(Cursor::Type);
+
Cursor()
#if !PLATFORM(QT) && !PLATFORM(EFL)
- : m_impl(0)
+ : m_platformCursor(0)
#endif
- { }
+ {
+ }
Cursor(Image*, const IntPoint& hotSpot);
Cursor(const Cursor&);
~Cursor();
Cursor& operator=(const Cursor&);
+#if USE(LAZY_NATIVE_CURSOR)
+ Cursor(Type);
+ Type type() const { return m_type; }
+ Image* image() const { return m_image.get(); }
+ const IntPoint& hotSpot() const { return m_hotSpot; }
+ PlatformCursor platformCursor() const;
+#else
Cursor(PlatformCursor);
- PlatformCursor impl() const { return m_impl; }
+ PlatformCursor impl() const { return m_platformCursor; }
+#endif
private:
- PlatformCursor m_impl;
+#if USE(LAZY_NATIVE_CURSOR)
+ void ensurePlatformCursor() const;
+
+ Type m_type;
+ RefPtr<Image> m_image;
+ IntPoint m_hotSpot;
+#endif
+
+ mutable PlatformCursor m_platformCursor;
};
IntPoint determineHotSpot(Image*, const IntPoint& specifiedHotSpot);
-
+ const char* nameForCursorType(Cursor::Type);
+
const Cursor& pointerCursor();
const Cursor& crossCursor();
const Cursor& handCursor();
diff --git a/WebCore/platform/FileChooser.h b/WebCore/platform/FileChooser.h
index e93b9ac..fa25406 100644
--- a/WebCore/platform/FileChooser.h
+++ b/WebCore/platform/FileChooser.h
@@ -44,6 +44,9 @@ public:
virtual void valueChanged() = 0;
virtual void repaint() = 0;
virtual bool allowsMultipleFiles() = 0;
+#if ENABLE(DIRECTORY_UPLOAD)
+ virtual bool allowsDirectoryUpload() = 0;
+#endif
virtual String acceptTypes() = 0;
virtual void chooseIconForFiles(FileChooser*, const Vector<String>&) = 0;
virtual ~FileChooserClient();
@@ -70,6 +73,9 @@ public:
void iconLoaded(PassRefPtr<Icon>);
bool allowsMultipleFiles() const { return m_client ? m_client->allowsMultipleFiles() : false; }
+#if ENABLE(DIRECTORY_UPLOAD)
+ bool allowsDirectoryUpload() const { return m_client ? m_client->allowsDirectoryUpload() : false; }
+#endif
// Acceptable MIME types. It's an 'accept' attribute value of the corresponding INPUT element.
String acceptTypes() const { return m_client ? m_client->acceptTypes() : String(); }
diff --git a/WebCore/platform/HostWindow.h b/WebCore/platform/HostWindow.h
index e7316a7..b0ee653 100644
--- a/WebCore/platform/HostWindow.h
+++ b/WebCore/platform/HostWindow.h
@@ -31,6 +31,8 @@
namespace WebCore {
+class Cursor;
+
class HostWindow : public Noncopyable {
public:
virtual ~HostWindow() { }
@@ -56,6 +58,9 @@ public:
// To notify WebKit of scrollbar mode changes.
virtual void scrollbarsModeDidChange() const = 0;
+
+ // Request that the cursor change.
+ virtual void setCursor(const Cursor&) = 0;
};
} // namespace WebCore
diff --git a/WebCore/platform/KURLGoogle.cpp b/WebCore/platform/KURLGoogle.cpp
index b4c84a6..ac02630 100644
--- a/WebCore/platform/KURLGoogle.cpp
+++ b/WebCore/platform/KURLGoogle.cpp
@@ -48,7 +48,6 @@
#include <wtf/StdLibExtras.h>
#include <wtf/text/CString.h>
-#include <googleurl/src/url_canon_internal.h>
#include <googleurl/src/url_util.h>
using WTF::isASCIILower;
@@ -943,55 +942,13 @@ String decodeURLEscapeSequences(const String& str, const TextEncoding& encoding)
const char* input = cstr.data();
int inputLength = cstr.length();
- url_canon::RawCanonOutputT<char> unescaped;
- for (int i = 0; i < inputLength; i++) {
- if (input[i] == '%') {
- unsigned char ch;
- if (url_canon::DecodeEscaped(input, &i, inputLength, &ch))
- unescaped.push_back(ch);
- else {
- // Invalid escape sequence, copy the percent literal.
- unescaped.push_back('%');
- }
- } else {
- // Regular non-escaped 8-bit character.
- unescaped.push_back(input[i]);
- }
- }
- // Convert that 8-bit to UTF-16. It's not clear IE does this at all to
- // JavaScript URLs, but Firefox and Safari do.
- url_canon::RawCanonOutputT<url_parse::UTF16Char> utf16;
- for (int i = 0; i < unescaped.length(); i++) {
- unsigned char uch = static_cast<unsigned char>(unescaped.at(i));
- if (uch < 0x80) {
- // Non-UTF-8, just append directly
- utf16.push_back(uch);
- } else {
- // next_ch will point to the last character of the decoded
- // character.
- int nextCharacter = i;
- unsigned codePoint;
- if (url_canon::ReadUTFChar(unescaped.data(), &nextCharacter,
- unescaped.length(), &codePoint)) {
- // Valid UTF-8 character, convert to UTF-16.
- url_canon::AppendUTF16Value(codePoint, &utf16);
- i = nextCharacter;
- } else {
- // KURL.cpp strips any sequences that are not valid UTF-8. This
- // sounds scary. Instead, we just keep those invalid code
- // points and promote to UTF-16. We copy all characters from
- // the current position to the end of the identified sqeuqnce.
- while (i < nextCharacter) {
- utf16.push_back(static_cast<unsigned char>(unescaped.at(i)));
- i++;
- }
- utf16.push_back(static_cast<unsigned char>(unescaped.at(i)));
- }
- }
- }
+ url_canon::RawCanonOutputT<url_parse::UTF16Char> unescaped;
+
+ url_util::DecodeURLEscapeSequences(input, inputLength, &unescaped);
- return String(reinterpret_cast<UChar*>(utf16.data()), utf16.length());
+ return String(reinterpret_cast<UChar*>(unescaped.data()),
+ unescaped.length());
}
bool KURL::protocolIs(const char* protocol) const
diff --git a/WebCore/platform/MIMETypeRegistry.cpp b/WebCore/platform/MIMETypeRegistry.cpp
index d6ff588..e6eb209 100644
--- a/WebCore/platform/MIMETypeRegistry.cpp
+++ b/WebCore/platform/MIMETypeRegistry.cpp
@@ -302,6 +302,7 @@ static MediaMIMETypeMap& mediaMIMETypeMap()
{ "audio/x-m4a", "m4a" },
{ "audio/x-m4b", "m4b" },
{ "audio/x-m4p", "m4p" },
+ { "audio/mp4", "m4a" },
// MP3
{ "audio/mp3", "mp3" },
diff --git a/WebCore/platform/PopupMenuClient.h b/WebCore/platform/PopupMenuClient.h
index bffde92..a1396e8 100644
--- a/WebCore/platform/PopupMenuClient.h
+++ b/WebCore/platform/PopupMenuClient.h
@@ -42,6 +42,7 @@ public:
virtual void selectionCleared() = 0;
virtual String itemText(unsigned listIndex) const = 0;
+ virtual String itemLabel(unsigned listIndex) const = 0;
virtual String itemToolTip(unsigned listIndex) const = 0;
virtual String itemAccessibilityText(unsigned listIndex) const = 0;
virtual bool itemIsEnabled(unsigned listIndex) const = 0;
diff --git a/WebCore/platform/Widget.h b/WebCore/platform/Widget.h
index 45da67a..6303c6a 100644
--- a/WebCore/platform/Widget.h
+++ b/WebCore/platform/Widget.h
@@ -187,8 +187,8 @@ public:
virtual bool isFrameView() const { return false; }
virtual bool isPluginView() const { return false; }
- // FIXME: The Mac plug-in code should inherit from PluginView. When this happens PluginWidget and PluginView can become one class.
- virtual bool isPluginWidget() const { return false; }
+ // FIXME: The Mac plug-in code should inherit from PluginView. When this happens PluginViewBase and PluginView can become one class.
+ virtual bool isPluginViewBase() const { return false; }
virtual bool isScrollbar() const { return false; }
void removeFromParent();
diff --git a/WebCore/platform/brew/PopupMenuBrew.cpp b/WebCore/platform/brew/PopupMenuBrew.cpp
index 89f3fa1..eb03c66 100644
--- a/WebCore/platform/brew/PopupMenuBrew.cpp
+++ b/WebCore/platform/brew/PopupMenuBrew.cpp
@@ -40,6 +40,9 @@ PopupMenu::PopupMenu(PopupMenuClient* menuList)
PopupMenu::~PopupMenu()
{
+ // Tell client to destroy data related to this popup since this object is
+ // going away.
+ hide();
}
void PopupMenu::show(const IntRect& rect, FrameView* view, int index)
diff --git a/WebCore/platform/chromium/ChromiumBridge.h b/WebCore/platform/chromium/ChromiumBridge.h
index 3284aae..2d9695e 100644
--- a/WebCore/platform/chromium/ChromiumBridge.h
+++ b/WebCore/platform/chromium/ChromiumBridge.h
@@ -241,6 +241,8 @@ namespace WebCore {
GraphicsContext*, int part, int state, int classicState, const IntRect&);
static void paintScrollbarTrack(
GraphicsContext*, int part, int state, int classicState, const IntRect&, const IntRect& alignRect);
+ static void paintSpinButton(
+ GraphicsContext*, int part, int state, int classicState, const IntRect&);
static void paintTextField(
GraphicsContext*, int part, int state, int classicState, const IntRect&, const Color&, bool fillContentArea, bool drawEdges);
static void paintTrackbar(
diff --git a/WebCore/platform/chromium/CursorChromium.cpp b/WebCore/platform/chromium/CursorChromium.cpp
index 16fa634..0119f07 100644
--- a/WebCore/platform/chromium/CursorChromium.cpp
+++ b/WebCore/platform/chromium/CursorChromium.cpp
@@ -34,12 +34,12 @@
namespace WebCore {
Cursor::Cursor(const Cursor& other)
- : m_impl(other.m_impl)
+ : m_platformCursor(other.m_platformCursor)
{
}
Cursor::Cursor(Image* image, const IntPoint& hotSpot)
- : m_impl(image, hotSpot)
+ : m_platformCursor(image, hotSpot)
{
}
@@ -49,12 +49,12 @@ Cursor::~Cursor()
Cursor& Cursor::operator=(const Cursor& other)
{
- m_impl = other.m_impl;
+ m_platformCursor = other.m_platformCursor;
return *this;
}
Cursor::Cursor(PlatformCursor c)
- : m_impl(c)
+ : m_platformCursor(c)
{
}
diff --git a/WebCore/platform/chromium/GLES2Context.h b/WebCore/platform/chromium/GLES2Context.h
index b72329a..d37885a 100644
--- a/WebCore/platform/chromium/GLES2Context.h
+++ b/WebCore/platform/chromium/GLES2Context.h
@@ -43,14 +43,8 @@ class Page;
class GLES2Context : public Noncopyable {
public:
- // Creates a GL ES context that draws directly to the window associated with
- // the Page.
- static PassOwnPtr<GLES2Context> createOnscreen(Page*);
-
- // Creates a GL ES context that renders offscreen, optionally as a child
- // of the given parent if specified.
- static PassOwnPtr<GLES2Context> createOffscreen(GLES2Context* parent);
-
+ // Used by the implementation only
+ static PassOwnPtr<GLES2Context> create(PassOwnPtr<GLES2ContextInternal>);
~GLES2Context();
bool makeCurrent();
@@ -65,6 +59,8 @@ public:
unsigned getOffscreenContentParentTextureId();
private:
+ GLES2Context();
+
friend class GLES2ContextInternal;
OwnPtr<GLES2ContextInternal> m_internal;
};
diff --git a/WebCore/platform/chromium/PlatformThemeChromiumGtk.cpp b/WebCore/platform/chromium/PlatformThemeChromiumGtk.cpp
new file mode 100644
index 0000000..1f74840
--- /dev/null
+++ b/WebCore/platform/chromium/PlatformThemeChromiumGtk.cpp
@@ -0,0 +1,221 @@
+/*
+ * 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 "PlatformThemeChromiumGtk.h"
+
+namespace WebCore {
+
+unsigned PlatformThemeChromiumGtk::s_thumbInactiveColor = 0xeaeaea;
+unsigned PlatformThemeChromiumGtk::s_thumbActiveColor = 0xf4f4f4;
+unsigned PlatformThemeChromiumGtk::s_trackColor = 0xd3d3d3;
+
+void PlatformThemeChromiumGtk::setScrollbarColors(
+ SkColor inactiveColor, SkColor activeColor, SkColor trackColor)
+{
+ s_thumbInactiveColor = inactiveColor;
+ s_thumbActiveColor = activeColor;
+ s_trackColor = trackColor;
+}
+
+static SkScalar clamp(SkScalar value, SkScalar min, SkScalar max)
+{
+ return std::min(std::max(value, min), max);
+}
+
+SkColor PlatformThemeChromiumGtk::saturateAndBrighten(const SkScalar hsv[3], SkScalar saturateAmount, SkScalar brightenAmount)
+{
+ SkScalar color[3];
+ color[0] = hsv[0];
+ color[1] = clamp(hsv[1] + saturateAmount, 0.0, 1.0);
+ color[2] = clamp(hsv[2] + brightenAmount, 0.0, 1.0);
+ return SkHSVToColor(color);
+}
+
+SkColor PlatformThemeChromiumGtk::outlineColor(const SkScalar hsv1[3], const SkScalar hsv2[3])
+{
+ // GTK Theme engines have way too much control over the layout of
+ // the scrollbar. We might be able to more closely approximate its
+ // look-and-feel, if we sent whole images instead of just colors
+ // from the browser to the renderer. But even then, some themes
+ // would just break.
+ //
+ // So, instead, we don't even try to 100% replicate the look of
+ // the native scrollbar. We render our own version, but we make
+ // sure to pick colors that blend in nicely with the system GTK
+ // theme. In most cases, we can just sample a couple of pixels
+ // from the system scrollbar and use those colors to draw our
+ // scrollbar.
+ //
+ // This works fine for the track color and the overall thumb
+ // color. But it fails spectacularly for the outline color used
+ // around the thumb piece. Not all themes have a clearly defined
+ // outline. For some of them it is partially transparent, and for
+ // others the thickness is very unpredictable.
+ //
+ // So, instead of trying to approximate the system theme, we
+ // instead try to compute a reasonable looking choice based on the
+ // known color of the track and the thumb piece. This is difficult
+ // when trying to deal both with high- and low-contrast themes,
+ // and both with positive and inverted themes.
+ //
+ // The following code has been tested to look OK with all of the
+ // default GTK themes.
+ SkScalar minDiff = clamp((hsv1[1] + hsv2[1]) * 1.2, 0.28, 0.5);
+ SkScalar diff = clamp(fabs(hsv1[2] - hsv2[2]) / 2, minDiff, 0.5);
+
+ if (hsv1[2] + hsv2[2] > 1.0)
+ diff = -diff;
+
+ return saturateAndBrighten(hsv2, -0.2, diff);
+}
+
+void PlatformThemeChromiumGtk::paintArrowButton(GraphicsContext* gc, const IntRect& rect, ArrowDirection direction, ControlStates states)
+{
+ SkCanvas* const canvas = gc->platformContext()->canvas();
+ int widthMiddle, lengthMiddle;
+ SkPaint paint;
+ if (direction == North || direction == South) {
+ widthMiddle = rect.width() / 2 + 1;
+ lengthMiddle = rect.height() / 2 + 1;
+ } else {
+ lengthMiddle = rect.width() / 2 + 1;
+ widthMiddle = rect.height() / 2 + 1;
+ }
+
+ // Calculate button color.
+ SkScalar trackHSV[3];
+ SkColorToHSV(trackColor(), trackHSV);
+ SkColor buttonColor = saturateAndBrighten(trackHSV, 0, 0.2);
+ SkColor backgroundColor = buttonColor;
+ if (states & PressedState) {
+ SkScalar buttonHSV[3];
+ SkColorToHSV(buttonColor, buttonHSV);
+ buttonColor = saturateAndBrighten(buttonHSV, 0, -0.1);
+ } else if (states & HoverState) {
+ SkScalar buttonHSV[3];
+ SkColorToHSV(buttonColor, buttonHSV);
+ buttonColor = saturateAndBrighten(buttonHSV, 0, 0.05);
+ }
+
+ SkIRect skrect;
+ skrect.set(rect.x(), rect.y(), rect.x() + rect.width(), rect.y() + rect.height());
+ // Paint the background (the area visible behind the rounded corners).
+ paint.setColor(backgroundColor);
+ canvas->drawIRect(skrect, paint);
+
+ // Paint the button's outline and fill the middle
+ SkPath outline;
+ switch (direction) {
+ case North:
+ outline.moveTo(rect.x() + 0.5, rect.y() + rect.height() + 0.5);
+ outline.rLineTo(0, -(rect.height() - 2));
+ outline.rLineTo(2, -2);
+ outline.rLineTo(rect.width() - 5, 0);
+ outline.rLineTo(2, 2);
+ outline.rLineTo(0, rect.height() - 2);
+ break;
+ case South:
+ outline.moveTo(rect.x() + 0.5, rect.y() - 0.5);
+ outline.rLineTo(0, rect.height() - 2);
+ outline.rLineTo(2, 2);
+ outline.rLineTo(rect.width() - 5, 0);
+ outline.rLineTo(2, -2);
+ outline.rLineTo(0, -(rect.height() - 2));
+ break;
+ case East:
+ outline.moveTo(rect.x() - 0.5, rect.y() + 0.5);
+ outline.rLineTo(rect.width() - 2, 0);
+ outline.rLineTo(2, 2);
+ outline.rLineTo(0, rect.height() - 5);
+ outline.rLineTo(-2, 2);
+ outline.rLineTo(-(rect.width() - 2), 0);
+ break;
+ case West:
+ outline.moveTo(rect.x() + rect.width() + 0.5, rect.y() + 0.5);
+ outline.rLineTo(-(rect.width() - 2), 0);
+ outline.rLineTo(-2, 2);
+ outline.rLineTo(0, rect.height() - 5);
+ outline.rLineTo(2, 2);
+ outline.rLineTo(rect.width() - 2, 0);
+ break;
+ }
+ outline.close();
+
+ paint.setStyle(SkPaint::kFill_Style);
+ paint.setColor(buttonColor);
+ canvas->drawPath(outline, paint);
+
+ paint.setAntiAlias(true);
+ paint.setStyle(SkPaint::kStroke_Style);
+ SkScalar thumbHSV[3];
+ SkColorToHSV(thumbInactiveColor(), thumbHSV);
+ paint.setColor(outlineColor(trackHSV, thumbHSV));
+ canvas->drawPath(outline, paint);
+
+ // If the button is disabled, the arrow is drawn with the outline color.
+ if (states & EnabledState)
+ paint.setColor(SK_ColorBLACK);
+
+ paint.setAntiAlias(false);
+ paint.setStyle(SkPaint::kFill_Style);
+
+ SkPath path;
+ // The constants in this block of code are hand-tailored to produce good
+ // looking arrows without anti-aliasing.
+ switch (direction) {
+ case North:
+ path.moveTo(rect.x() + widthMiddle - 4, rect.y() + lengthMiddle + 2);
+ path.rLineTo(7, 0);
+ path.rLineTo(-4, -4);
+ break;
+ case South:
+ path.moveTo(rect.x() + widthMiddle - 4, rect.y() + lengthMiddle - 3);
+ path.rLineTo(7, 0);
+ path.rLineTo(-4, 4);
+ break;
+ case East:
+ path.moveTo(rect.x() + lengthMiddle - 3, rect.y() + widthMiddle - 4);
+ path.rLineTo(0, 7);
+ path.rLineTo(4, -4);
+ break;
+ case West:
+ path.moveTo(rect.x() + lengthMiddle + 1, rect.y() + widthMiddle - 5);
+ path.rLineTo(0, 9);
+ path.rLineTo(-4, -4);
+ break;
+ }
+ path.close();
+
+ canvas->drawPath(path, paint);
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/chromium/PlatformThemeChromiumGtk.h b/WebCore/platform/chromium/PlatformThemeChromiumGtk.h
new file mode 100644
index 0000000..bdc2683
--- /dev/null
+++ b/WebCore/platform/chromium/PlatformThemeChromiumGtk.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:
+ *
+ * * 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 PlatformThemeChromiumGtk_h
+#define PlatformThemeChromiumGtk_h
+
+#include "PlatformContextSkia.h"
+#include "SkColor.h"
+#include "SkScalar.h"
+#include "ThemeTypes.h"
+
+namespace WebCore {
+
+class PlatformThemeChromiumGtk {
+public:
+ enum ArrowDirection {
+ North,
+ East,
+ South,
+ West,
+ };
+
+ static void setScrollbarColors(unsigned inactiveColor,
+ unsigned activeColor,
+ unsigned trackColor);
+ static unsigned thumbInactiveColor() { return s_thumbInactiveColor; }
+ static unsigned thumbActiveColor() { return s_thumbActiveColor; }
+ static unsigned trackColor() { return s_trackColor; }
+
+ static SkColor saturateAndBrighten(const SkScalar hsv[3], SkScalar saturateAmount, SkScalar brightenAmount);
+ static SkColor outlineColor(const SkScalar hsv1[3], const SkScalar hsv2[3]);
+ static void paintArrowButton(GraphicsContext*, const IntRect&, ArrowDirection, ControlStates);
+
+private:
+ PlatformThemeChromiumGtk() {}
+
+ static unsigned s_thumbInactiveColor;
+ static unsigned s_thumbActiveColor;
+ static unsigned s_trackColor;
+};
+
+} // namespace WebCore
+
+#endif // PlatformThemeChromiumGtk_h
diff --git a/WebCore/platform/chromium/PopupMenuChromium.cpp b/WebCore/platform/chromium/PopupMenuChromium.cpp
index 7e3a2a0..4701a75 100644
--- a/WebCore/platform/chromium/PopupMenuChromium.cpp
+++ b/WebCore/platform/chromium/PopupMenuChromium.cpp
@@ -70,6 +70,7 @@ typedef unsigned long long TimeStamp;
static const int kMaxVisibleRows = 20;
static const int kMaxHeight = 500;
static const int kBorderSize = 1;
+static const int kTextToLabelPadding = 10;
static const TimeStamp kTypeAheadTimeoutMs = 1000;
// The settings used for the drop down menu.
@@ -751,8 +752,11 @@ bool PopupListBox::handleKeyEvent(const PlatformKeyboardEvent& event)
if (event.windowsVirtualKeyCode() == VKEY_TAB) {
// TAB is a special case as it should select the current item if any and
// advance focus.
- if (m_selectedIndex >= 0)
- m_popupClient->setTextFromItem(m_selectedIndex);
+ if (m_selectedIndex >= 0) {
+ acceptIndex(m_selectedIndex); // May delete us.
+ // Return false so the TAB key event is propagated to the page.
+ return false;
+ }
// Call abandon() so we honor m_acceptedIndexOnAbandon if set.
abandon();
// Return false so the TAB key event is propagated to the page.
@@ -873,13 +877,17 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd
PopupMenuStyle style = m_popupClient->itemStyle(rowIndex);
// Paint background
- Color backColor, textColor;
+ Color backColor, textColor, labelColor;
if (rowIndex == m_selectedIndex) {
backColor = RenderTheme::defaultTheme()->activeListBoxSelectionBackgroundColor();
textColor = RenderTheme::defaultTheme()->activeListBoxSelectionForegroundColor();
+ labelColor = textColor;
} else {
backColor = style.backgroundColor();
textColor = style.foregroundColor();
+ // FIXME: for now the label color is hard-coded. It should be added to
+ // the PopupMenuStyle.
+ labelColor = Color(115, 115, 115);
}
// If we have a transparent background, make sure it has a color to blend
@@ -917,10 +925,23 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd
}
// Prepare text to be drawn.
String itemText = m_popupClient->itemText(rowIndex);
- if (m_settings.restrictWidthOfListBox) // truncate string to fit in.
- itemText = StringTruncator::rightTruncate(itemText, maxWidth, itemFont);
- unsigned length = itemText.length();
- const UChar* str = itemText.characters();
+ String itemLabel = m_popupClient->itemLabel(rowIndex);
+ if (m_settings.restrictWidthOfListBox) { // Truncate strings to fit in.
+ // FIXME: We should leftTruncate for the rtl case.
+ // StringTruncator::leftTruncate would have to be implemented.
+ String str = StringTruncator::rightTruncate(itemText, maxWidth, itemFont);
+ if (str != itemText) {
+ itemText = str;
+ // Don't display the label, we already don't have enough room for the
+ // item text.
+ itemLabel = "";
+ } else if (!itemLabel.isEmpty()) {
+ int availableWidth = maxWidth - kTextToLabelPadding -
+ StringTruncator::width(itemText, itemFont);
+ itemLabel = StringTruncator::rightTruncate(itemLabel, availableWidth, itemFont);
+ }
+ }
+
// Prepare the directionality to draw text.
bool rtl = false;
if (m_settings.itemTextDirectionalityHint == PopupContainerSettings::DOMElementDirection)
@@ -928,14 +949,31 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd
else if (m_settings.itemTextDirectionalityHint ==
PopupContainerSettings::FirstStrongDirectionalCharacterDirection)
rtl = itemText.defaultWritingDirection() == WTF::Unicode::RightToLeft;
- TextRun textRun(str, length, false, 0, 0, rtl);
+ TextRun textRun(itemText.characters(), itemText.length(), false, 0, 0, rtl);
// If the text is right-to-left, make it right-aligned by adjusting its
// beginning position.
if (rightAligned)
textX += maxWidth - itemFont.width(textRun);
+
// Draw the item text.
int textY = rowRect.y() + itemFont.ascent() + (rowRect.height() - itemFont.height()) / 2;
gc->drawBidiText(itemFont, textRun, IntPoint(textX, textY));
+
+ // Draw the the label if applicable.
+ if (itemLabel.isEmpty())
+ return;
+ TextRun labelTextRun(itemLabel.characters(), itemLabel.length(), false, 0, 0, rtl);
+ if (rightAligned)
+ textX = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
+ else {
+ // We are using the left padding as the right padding includes room for the scroll-bar which
+ // does not show in this case.
+ int rightPadding = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
+ textX = rowRect.width() - rightPadding - itemFont.width(labelTextRun);
+ }
+
+ gc->setFillColor(labelColor, DeviceColorSpace);
+ gc->drawBidiText(itemFont, labelTextRun, IntPoint(textX, textY));
}
Font PopupListBox::getRowFont(int rowIndex)
diff --git a/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp b/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp
index a9cff9f..19b4a54 100644
--- a/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp
+++ b/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp
@@ -33,8 +33,7 @@
#include "PlatformContextSkia.h"
#include "PlatformMouseEvent.h"
-#include "RenderTheme.h"
-#include "RenderThemeChromiumLinux.h"
+#include "PlatformThemeChromiumGtk.h"
#include "Scrollbar.h"
#include "TransformationMatrix.h"
@@ -78,60 +77,6 @@ static void drawBox(SkCanvas* canvas, const IntRect& rect, const SkPaint& paint)
drawVertLine(canvas, rect.x(), rect.y(), bottom, paint);
}
-static SkScalar clamp(SkScalar value, SkScalar min, SkScalar max)
-{
- return std::min(std::max(value, min), max);
-}
-
-static SkColor saturateAndBrighten(SkScalar* hsv,
- SkScalar saturateAmount,
- SkScalar brightenAmount)
-{
- SkScalar color[3];
- color[0] = hsv[0];
- color[1] = clamp(hsv[1] + saturateAmount, 0.0, 1.0);
- color[2] = clamp(hsv[2] + brightenAmount, 0.0, 1.0);
- return SkHSVToColor(color);
-}
-
-static SkColor outlineColor(SkScalar* hsv1, SkScalar* hsv2)
-{
- // GTK Theme engines have way too much control over the layout of
- // the scrollbar. We might be able to more closely approximate its
- // look-and-feel, if we sent whole images instead of just colors
- // from the browser to the renderer. But even then, some themes
- // would just break.
- //
- // So, instead, we don't even try to 100% replicate the look of
- // the native scrollbar. We render our own version, but we make
- // sure to pick colors that blend in nicely with the system GTK
- // theme. In most cases, we can just sample a couple of pixels
- // from the system scrollbar and use those colors to draw our
- // scrollbar.
- //
- // This works fine for the track color and the overall thumb
- // color. But it fails spectacularly for the outline color used
- // around the thumb piece. Not all themes have a clearly defined
- // outline. For some of them it is partially transparent, and for
- // others the thickness is very unpredictable.
- //
- // So, instead of trying to approximate the system theme, we
- // instead try to compute a reasonable looking choice based on the
- // known color of the track and the thumb piece. This is difficult
- // when trying to deal both with high- and low-contrast themes,
- // and both with positive and inverted themes.
- //
- // The following code has been tested to look OK with all of the
- // default GTK themes.
- SkScalar minDiff = clamp((hsv1[1] + hsv2[1]) * 1.2, 0.28, 0.5);
- SkScalar diff = clamp(fabs(hsv1[2] - hsv2[2]) / 2, minDiff, 0.5);
-
- if (hsv1[2] + hsv2[2] > 1.0)
- diff = -diff;
-
- return saturateAndBrighten(hsv2, -0.2, diff);
-}
-
void ScrollbarThemeChromiumLinux::paintTrackPiece(GraphicsContext* gc, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart partType)
{
SkCanvas* const canvas = gc->platformContext()->canvas();
@@ -140,154 +85,47 @@ void ScrollbarThemeChromiumLinux::paintTrackPiece(GraphicsContext* gc, Scrollbar
skrect.set(rect.x(), rect.y(), rect.x() + rect.width(), rect.y() + rect.height());
SkScalar trackHSV[3];
- SkColorToHSV(RenderThemeChromiumLinux::trackColor(), trackHSV);
- paint.setColor(saturateAndBrighten(trackHSV, 0, 0));
+ SkColorToHSV(PlatformThemeChromiumGtk::trackColor(), trackHSV);
+ paint.setColor(PlatformThemeChromiumGtk::saturateAndBrighten(trackHSV, 0, 0));
canvas->drawIRect(skrect, paint);
SkScalar thumbHSV[3];
- SkColorToHSV(RenderThemeChromiumLinux::thumbInactiveColor(),
+ SkColorToHSV(PlatformThemeChromiumGtk::thumbInactiveColor(),
thumbHSV);
- paint.setColor(outlineColor(trackHSV, thumbHSV));
+ paint.setColor(PlatformThemeChromiumGtk::outlineColor(trackHSV, thumbHSV));
drawBox(canvas, rect, paint);
}
void ScrollbarThemeChromiumLinux::paintButton(GraphicsContext* gc, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart part)
{
- SkCanvas* const canvas = gc->platformContext()->canvas();
- static const int widthMiddle = scrollbarThicknessValue / 2 + 1;
- static const int lengthMiddle = buttonLength / 2 + 1;
- SkPaint paint;
- enum {
- North,
- East,
- South,
- West,
- } direction;
-
+ PlatformThemeChromiumGtk::ArrowDirection direction;
if (scrollbar->orientation() == HorizontalScrollbar) {
if (part == BackButtonStartPart)
- direction = West;
+ direction = PlatformThemeChromiumGtk::West;
else
- direction = East;
+ direction = PlatformThemeChromiumGtk::East;
} else {
if (part == BackButtonStartPart)
- direction = North;
+ direction = PlatformThemeChromiumGtk::North;
else
- direction = South;
+ direction = PlatformThemeChromiumGtk::South;
}
+ ControlStates states = 0;
// Determine if the button can be pressed.
- bool enabled = false;
- if (((direction == West || direction == North) && scrollbar->currentPos())
- || (direction == East || direction == South) && scrollbar->currentPos() != scrollbar->maximum())
- enabled = true;
-
- // Calculate button color.
- SkScalar trackHSV[3];
- SkColorToHSV(RenderThemeChromiumLinux::trackColor(), trackHSV);
- SkColor buttonColor = saturateAndBrighten(trackHSV, 0, 0.2);
- SkColor backgroundColor = buttonColor;
- if (part == scrollbar->pressedPart()) {
- SkScalar buttonHSV[3];
- SkColorToHSV(buttonColor, buttonHSV);
- buttonColor = saturateAndBrighten(buttonHSV, 0, -0.1);
- } else if (part == scrollbar->hoveredPart() && enabled) {
- SkScalar buttonHSV[3];
- SkColorToHSV(buttonColor, buttonHSV);
- buttonColor = saturateAndBrighten(buttonHSV, 0, 0.05);
- }
-
- SkIRect skrect;
- skrect.set(rect.x(), rect.y(), rect.x() + rect.width(), rect.y() + rect.height());
- // Paint the background (the area visible behind the rounded corners).
- paint.setColor(backgroundColor);
- canvas->drawIRect(skrect, paint);
-
- // Paint the button's outline and fill the middle
- SkPath outline;
- switch (direction) {
- case North:
- outline.moveTo(rect.x() + 0.5, rect.y() + rect.height() + 0.5);
- outline.rLineTo(0, -(rect.height() - 2));
- outline.rLineTo(2, -2);
- outline.rLineTo(rect.width() - 5, 0);
- outline.rLineTo(2, 2);
- outline.rLineTo(0, rect.height() - 2);
- break;
- case South:
- outline.moveTo(rect.x() + 0.5, rect.y() - 0.5);
- outline.rLineTo(0, rect.height() - 2);
- outline.rLineTo(2, 2);
- outline.rLineTo(rect.width() - 5, 0);
- outline.rLineTo(2, -2);
- outline.rLineTo(0, -(rect.height() - 2));
- break;
- case East:
- outline.moveTo(rect.x() - 0.5, rect.y() + 0.5);
- outline.rLineTo(rect.width() - 2, 0);
- outline.rLineTo(2, 2);
- outline.rLineTo(0, rect.height() - 5);
- outline.rLineTo(-2, 2);
- outline.rLineTo(-(rect.width() - 2), 0);
- break;
- case West:
- outline.moveTo(rect.x() + rect.width() + 0.5, rect.y() + 0.5);
- outline.rLineTo(-(rect.width() - 2), 0);
- outline.rLineTo(-2, 2);
- outline.rLineTo(0, rect.height() - 5);
- outline.rLineTo(2, 2);
- outline.rLineTo(rect.width() - 2, 0);
- break;
- }
- outline.close();
-
- paint.setStyle(SkPaint::kFill_Style);
- paint.setColor(buttonColor);
- canvas->drawPath(outline, paint);
-
- paint.setAntiAlias(true);
- paint.setStyle(SkPaint::kStroke_Style);
- SkScalar thumbHSV[3];
- SkColorToHSV(RenderThemeChromiumLinux::thumbInactiveColor(), thumbHSV);
- paint.setColor(outlineColor(trackHSV, thumbHSV));
- canvas->drawPath(outline, paint);
-
- // If the button is disabled, the arrow is drawn with the outline color.
- if (enabled)
- paint.setColor(SK_ColorBLACK);
-
- paint.setAntiAlias(false);
- paint.setStyle(SkPaint::kFill_Style);
-
- SkPath path;
- // The constants in this block of code are hand-tailored to produce good
- // looking arrows without anti-aliasing.
- switch (direction) {
- case North:
- path.moveTo(rect.x() + widthMiddle - 4, rect.y() + lengthMiddle + 2);
- path.rLineTo(7, 0);
- path.rLineTo(-4, -4);
- break;
- case South:
- path.moveTo(rect.x() + widthMiddle - 4, rect.y() + lengthMiddle - 3);
- path.rLineTo(7, 0);
- path.rLineTo(-4, 4);
- break;
- case East:
- path.moveTo(rect.x() + lengthMiddle - 3, rect.y() + widthMiddle - 4);
- path.rLineTo(0, 7);
- path.rLineTo(4, -4);
- break;
- case West:
- path.moveTo(rect.x() + lengthMiddle + 1, rect.y() + widthMiddle - 5);
- path.rLineTo(0, 9);
- path.rLineTo(-4, -4);
- break;
+ if (((direction == PlatformThemeChromiumGtk::West || direction == PlatformThemeChromiumGtk::North) && scrollbar->currentPos())
+ || (direction == PlatformThemeChromiumGtk::East || direction == PlatformThemeChromiumGtk::South) && scrollbar->currentPos() != scrollbar->maximum())
+ states |= EnabledState;
+
+ if (states & EnabledState) {
+ if (part == scrollbar->pressedPart())
+ states |= PressedState;
+ else if (part == scrollbar->hoveredPart())
+ states |= HoverState;
}
- path.close();
- canvas->drawPath(path, paint);
+ PlatformThemeChromiumGtk::paintArrowButton(gc, rect, direction, states);
}
void ScrollbarThemeChromiumLinux::paintThumb(GraphicsContext* gc, Scrollbar* scrollbar, const IntRect& rect)
@@ -300,12 +138,12 @@ void ScrollbarThemeChromiumLinux::paintThumb(GraphicsContext* gc, Scrollbar* scr
SkScalar thumb[3];
SkColorToHSV(hovered
- ? RenderThemeChromiumLinux::thumbActiveColor()
- : RenderThemeChromiumLinux::thumbInactiveColor(),
+ ? PlatformThemeChromiumGtk::thumbActiveColor()
+ : PlatformThemeChromiumGtk::thumbInactiveColor(),
thumb);
SkPaint paint;
- paint.setColor(saturateAndBrighten(thumb, 0, 0.02));
+ paint.setColor(PlatformThemeChromiumGtk::saturateAndBrighten(thumb, 0, 0.02));
SkIRect skrect;
if (vertical)
@@ -315,7 +153,7 @@ void ScrollbarThemeChromiumLinux::paintThumb(GraphicsContext* gc, Scrollbar* scr
canvas->drawIRect(skrect, paint);
- paint.setColor(saturateAndBrighten(thumb, 0, -0.02));
+ paint.setColor(PlatformThemeChromiumGtk::saturateAndBrighten(thumb, 0, -0.02));
if (vertical)
skrect.set(midx + 1, rect.y(), rect.x() + rect.width(), rect.y() + rect.height());
@@ -325,8 +163,8 @@ void ScrollbarThemeChromiumLinux::paintThumb(GraphicsContext* gc, Scrollbar* scr
canvas->drawIRect(skrect, paint);
SkScalar track[3];
- SkColorToHSV(RenderThemeChromiumLinux::trackColor(), track);
- paint.setColor(outlineColor(track, thumb));
+ SkColorToHSV(PlatformThemeChromiumGtk::trackColor(), track);
+ paint.setColor(PlatformThemeChromiumGtk::outlineColor(track, thumb));
drawBox(canvas, rect, paint);
if (rect.height() > 10 && rect.width() > 10) {
diff --git a/WebCore/platform/chromium/ThemeChromiumMac.mm b/WebCore/platform/chromium/ThemeChromiumMac.mm
index 5769e38..68fd7b7 100644
--- a/WebCore/platform/chromium/ThemeChromiumMac.mm
+++ b/WebCore/platform/chromium/ThemeChromiumMac.mm
@@ -32,6 +32,7 @@
#import "LocalCurrentGraphicsContext.h"
#import "ScrollView.h"
#import "WebCoreSystemInterface.h"
+#import <Carbon/Carbon.h>
#include <wtf/StdLibExtras.h>
#import <objc/runtime.h>
@@ -210,9 +211,9 @@ static NSControlSize controlSizeForFont(const Font& font)
return NSMiniControlSize;
}
-static LengthSize sizeFromFont(const Font& font, const LengthSize& zoomedSize, float zoomFactor, const IntSize* sizes)
+static LengthSize sizeFromNSControlSize(NSControlSize nsControlSize, const LengthSize& zoomedSize, float zoomFactor, const IntSize* sizes)
{
- IntSize controlSize = sizes[controlSizeForFont(font)];
+ IntSize controlSize = sizes[nsControlSize];
if (zoomFactor != 1.0f)
controlSize = IntSize(controlSize.width() * zoomFactor, controlSize.height() * zoomFactor);
LengthSize result = zoomedSize;
@@ -223,19 +224,27 @@ static LengthSize sizeFromFont(const Font& font, const LengthSize& zoomedSize, f
return result;
}
-static void setControlSize(NSCell* cell, const IntSize* sizes, const IntSize& minZoomedSize, float zoomFactor)
+static LengthSize sizeFromFont(const Font& font, const LengthSize& zoomedSize, float zoomFactor, const IntSize* sizes)
+{
+ return sizeFromNSControlSize(controlSizeForFont(font), zoomedSize, zoomFactor, sizes);
+}
+
+static ControlSize controlSizeFromPixelSize(const IntSize* sizes, const IntSize& minZoomedSize, float zoomFactor)
{
- NSControlSize size;
if (minZoomedSize.width() >= static_cast<int>(sizes[NSRegularControlSize].width() * zoomFactor) &&
minZoomedSize.height() >= static_cast<int>(sizes[NSRegularControlSize].height() * zoomFactor))
- size = NSRegularControlSize;
- else if (minZoomedSize.width() >= static_cast<int>(sizes[NSSmallControlSize].width() * zoomFactor) &&
- minZoomedSize.height() >= static_cast<int>(sizes[NSSmallControlSize].height() * zoomFactor))
- size = NSSmallControlSize;
- else
- size = NSMiniControlSize;
+ return NSRegularControlSize;
+ if (minZoomedSize.width() >= static_cast<int>(sizes[NSSmallControlSize].width() * zoomFactor) &&
+ minZoomedSize.height() >= static_cast<int>(sizes[NSSmallControlSize].height() * zoomFactor))
+ return NSSmallControlSize;
+ return NSMiniControlSize;
+}
+
+static void setControlSize(NSCell* cell, const IntSize* sizes, const IntSize& minZoomedSize, float zoomFactor)
+{
+ ControlSize size = controlSizeFromPixelSize(sizes, minZoomedSize, zoomFactor);
if (size != [cell controlSize]) // Only update if we have to, since AppKit does work even if the size is the same.
- [cell setControlSize:size];
+ [cell setControlSize:(NSControlSize)size];
}
static void updateStates(NSCell* cell, ControlStates states)
@@ -277,6 +286,22 @@ static void updateStates(NSCell* cell, ControlStates states)
[cell setControlTint:tint];
}
+static ThemeDrawState convertControlStatesToThemeDrawState(ThemeButtonKind kind, ControlStates states)
+{
+ if (states & ReadOnlyState)
+ return kThemeStateUnavailableInactive;
+ if (!(states & EnabledState))
+ return kThemeStateUnavailableInactive;
+
+ // Do not process PressedState if !EnabledState or ReadOnlyState.
+ if (states & PressedState) {
+ if (kind == kThemeIncDecButton || kind == kThemeIncDecButtonSmall || kind == kThemeIncDecButtonMini)
+ return states & SpinUpState ? kThemeStatePressedUp : kThemeStatePressedDown;
+ return kThemeStatePressed;
+ }
+ return kThemeStateActive;
+}
+
static IntRect inflateRect(const IntRect& zoomedRect, const IntSize& zoomedSize, const int* margins, float zoomFactor)
{
// Only do the inflation if the available width/height are too small. Otherwise try to
@@ -571,6 +596,64 @@ static void paintButton(ControlPart part, ControlStates states, GraphicsContext*
END_BLOCK_OBJC_EXCEPTIONS
}
+// Stepper
+
+static const IntSize* stepperSizes()
+{
+ static const IntSize sizes[3] = { IntSize(19, 27), IntSize(15, 22), IntSize(13, 15) };
+ return sizes;
+}
+
+// We don't use controlSizeForFont() for steppers because the stepper height
+// should be equal to or less than the corresponding text field height,
+static NSControlSize stepperControlSizeForFont(const Font& font)
+{
+ int fontSize = font.pixelSize();
+ if (fontSize >= 18)
+ return NSRegularControlSize;
+ if (fontSize >= 13)
+ return NSSmallControlSize;
+ return NSMiniControlSize;
+}
+
+static void paintStepper(ControlStates states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView*)
+{
+ // We don't use NSStepperCell because there are no ways to draw an
+ // NSStepperCell with the up button highlighted.
+
+ HIThemeButtonDrawInfo drawInfo;
+ drawInfo.version = 0;
+ drawInfo.state = convertControlStatesToThemeDrawState(kThemeIncDecButton, states);
+ drawInfo.adornment = kThemeAdornmentDefault;
+ ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);
+ if (controlSize == NSSmallControlSize)
+ drawInfo.kind = kThemeIncDecButtonSmall;
+ else if (controlSize == NSMiniControlSize)
+ drawInfo.kind = kThemeIncDecButtonMini;
+ else
+ drawInfo.kind = kThemeIncDecButton;
+
+ IntRect rect(zoomedRect);
+ context->save();
+ if (zoomFactor != 1.0f) {
+ rect.setWidth(rect.width() / zoomFactor);
+ rect.setHeight(rect.height() / zoomFactor);
+ context->translate(rect.x(), rect.y());
+ context->scale(FloatSize(zoomFactor, zoomFactor));
+ context->translate(-rect.x(), -rect.y());
+ }
+ CGRect bounds(rect);
+ // Adjust 'bounds' so that HIThemeDrawButton(bounds,...) draws exactly on 'rect'.
+ CGRect backgroundBounds;
+ HIThemeGetButtonBackgroundBounds(&bounds, &drawInfo, &backgroundBounds);
+ if (bounds.origin.x != backgroundBounds.origin.x)
+ bounds.origin.x += bounds.origin.x - backgroundBounds.origin.x;
+ if (bounds.origin.y != backgroundBounds.origin.y)
+ bounds.origin.y += bounds.origin.y - backgroundBounds.origin.y;
+ HIThemeDrawButton(&bounds, &drawInfo, context->platformContext(), kHIThemeOrientationNormal, 0);
+ context->restore();
+}
+
// Theme overrides
int ThemeChromiumMac::baselinePositionAdjustment(ControlPart part) const
@@ -613,6 +696,13 @@ LengthSize ThemeChromiumMac::controlSize(ControlPart part, const Font& font, con
case ListButtonPart:
return sizeFromFont(font, LengthSize(zoomedSize.width(), Length()), zoomFactor, listButtonSizes());
#endif
+ case InnerSpinButtonPart:
+ // We don't use inner spin buttons on Mac.
+ return LengthSize(Length(Fixed), Length(Fixed));
+ case OuterSpinButtonPart:
+ if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
+ return zoomedSize;
+ return sizeFromNSControlSize(stepperControlSizeForFont(font), zoomedSize, zoomFactor, stepperSizes());
default:
return zoomedSize;
}
@@ -626,6 +716,14 @@ LengthSize ThemeChromiumMac::minimumControlSize(ControlPart part, const Font& fo
case ButtonPart:
case ListButtonPart:
return LengthSize(Length(0, Fixed), Length(static_cast<int>(15 * zoomFactor), Fixed));
+ case InnerSpinButtonPart:
+ // We don't use inner spin buttons on Mac.
+ return LengthSize(Length(Fixed), Length(Fixed));
+ case OuterSpinButtonPart: {
+ IntSize base = stepperSizes()[NSMiniControlSize];
+ return LengthSize(Length(static_cast<int>(base.width() * zoomFactor), Fixed),
+ Length(static_cast<int>(base.height() * zoomFactor), Fixed));
+ }
default:
return Theme::minimumControlSize(part, font, zoomFactor);
}
@@ -702,6 +800,15 @@ void ThemeChromiumMac::inflateControlPaintRect(ControlPart part, ControlStates s
}
break;
}
+ case OuterSpinButtonPart: {
+ static const int stepperMargin[4] = { 0, 0, 0, 0 };
+ ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);
+ IntSize zoomedSize = stepperSizes()[controlSize];
+ zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
+ zoomedSize.setWidth(zoomedSize.width() * zoomFactor);
+ zoomedRect = inflateRect(zoomedRect, zoomedSize, stepperMargin, zoomFactor);
+ break;
+ }
default:
break;
}
@@ -724,6 +831,9 @@ void ThemeChromiumMac::paint(ControlPart part, ControlStates states, GraphicsCon
case ListButtonPart:
paintButton(part, states, context, zoomedRect, zoomFactor, scrollView);
break;
+ case OuterSpinButtonPart:
+ paintStepper(states, context, zoomedRect, zoomFactor, scrollView);
+ break;
default:
break;
}
diff --git a/WebCore/platform/efl/CursorEfl.cpp b/WebCore/platform/efl/CursorEfl.cpp
index c88830e..47141f9 100644
--- a/WebCore/platform/efl/CursorEfl.cpp
+++ b/WebCore/platform/efl/CursorEfl.cpp
@@ -45,33 +45,33 @@ namespace WebCore {
Cursor::Cursor(PlatformCursor p)
{
- m_impl = eina_stringshare_add(p);
+ m_platformCursor = eina_stringshare_add(p);
}
Cursor::Cursor(const Cursor& other)
{
- m_impl = eina_stringshare_ref(other.m_impl);
+ m_platformCursor = eina_stringshare_ref(other.m_platformCursor);
}
Cursor::~Cursor()
{
- if (m_impl) {
- eina_stringshare_del(m_impl);
- m_impl = 0;
+ if (m_platformCursor) {
+ eina_stringshare_del(m_platformCursor);
+ m_platformCursor = 0;
}
}
Cursor::Cursor(Image* image, const IntPoint& hotspot)
- : m_impl(0)
+ : m_platformCursor(0)
{
notImplemented();
}
Cursor& Cursor::operator=(const Cursor& other)
{
- eina_stringshare_ref(other.m_impl);
- eina_stringshare_del(m_impl);
- m_impl = other.m_impl;
+ eina_stringshare_ref(other.m_platformCursor);
+ eina_stringshare_del(m_platformCursor);
+ m_platformCursor = other.m_platformCursor;
return *this;
}
diff --git a/WebCore/platform/efl/PopupMenuEfl.cpp b/WebCore/platform/efl/PopupMenuEfl.cpp
index 4d9677b..9dc6986 100644
--- a/WebCore/platform/efl/PopupMenuEfl.cpp
+++ b/WebCore/platform/efl/PopupMenuEfl.cpp
@@ -39,6 +39,9 @@ PopupMenu::PopupMenu(PopupMenuClient* client)
PopupMenu::~PopupMenu()
{
+ // Tell client to destroy data related to this popup since this object is
+ // going away.
+ hide();
}
void PopupMenu::show(const IntRect& rect, FrameView* view, int index)
diff --git a/WebCore/platform/efl/SoundEfl.cpp b/WebCore/platform/efl/SoundEfl.cpp
index c3b1eb3..091de7a 100644
--- a/WebCore/platform/efl/SoundEfl.cpp
+++ b/WebCore/platform/efl/SoundEfl.cpp
@@ -32,7 +32,6 @@
#ifdef HAVE_ECORE_X
#include <Ecore_X.h>
-#include <X11/Xlib.h>
#endif
namespace WebCore {
@@ -40,8 +39,7 @@ namespace WebCore {
void systemBeep()
{
#ifdef HAVE_ECORE_X
- Display* display = (Display*) ecore_x_display_get();
- XBell(display, 0);
+ ecore_x_bell(0);
#endif
}
diff --git a/WebCore/platform/efl/WidgetEfl.cpp b/WebCore/platform/efl/WidgetEfl.cpp
index 725e56f..6dbf2c2 100644
--- a/WebCore/platform/efl/WidgetEfl.cpp
+++ b/WebCore/platform/efl/WidgetEfl.cpp
@@ -211,8 +211,8 @@ void Widget::applyFallbackCursor()
int shape = cursorStringMap.cursor(m_data->m_cursorGroup.utf8().data());
if (shape < ECORE_X_CURSOR_X || shape > ECORE_X_CURSOR_XTERM) {
- fprintf(stderr, "ERROR: cannot map an equivalent X cursor for"
- " cursor group %s", m_data->m_cursorGroup.utf8().data());
+ LOG_ERROR("cannot map an equivalent X cursor for"
+ " c ursor group %s", m_data->m_cursorGroup.utf8().data());
shape = ECORE_X_CURSOR_LEFT_PTR;
}
@@ -221,29 +221,23 @@ void Widget::applyFallbackCursor()
ecore_x_window_cursor_set(win, cur);
return;
}
-#else
- fprintf(stderr, "ERROR: Ooops, no fallback to set cursor %s!\n",
- m_data->m_cursorGroup.utf8().data());
#endif
+ LOG("Ooops, no fallback to set cursor %s!\n",
+ m_data->m_cursorGroup.utf8().data());
}
void Widget::applyCursor()
{
- const char *file = 0;
- Evas_Coord x, y;
-
- String theme = edjeThemeRecursive();
- if (!theme.isNull())
- file = edjeThemeRecursive().utf8().data();
+ CString file = edjeThemeRecursive().utf8();
m_data->m_cursorObject = edje_object_add(evas());
- if (file && !edje_object_file_set(m_data->m_cursorObject, file, m_data->m_cursorGroup.utf8().data())) {
+ if (!file.isNull() && !edje_object_file_set(m_data->m_cursorObject, file.data(), m_data->m_cursorGroup.utf8().data())) {
evas_object_del(m_data->m_cursorObject);
m_data->m_cursorObject = 0;
ecore_evas_object_cursor_set(ecoreEvas(), 0, 0, 0, 0);
applyFallbackCursor();
} else {
- Evas_Coord w, h;
+ Evas_Coord x, y, w, h;
const char *d;
edje_object_size_min_get(m_data->m_cursorObject, &w, &h);
@@ -266,7 +260,7 @@ void Widget::applyCursor()
void Widget::setCursor(const Cursor& cursor)
{
- if (!platformWidget() || !evas())
+ if (!evas())
return;
const char *group = cursor.impl();
@@ -347,7 +341,9 @@ void Widget::setEvasObject(Evas_Object *o)
m_data->m_evasObject = o;
if (!o) {
m_data->m_evas = 0;
+#ifdef HAVE_ECORE_X
m_data->m_isUsingEcoreX = false;
+#endif
return;
}
diff --git a/WebCore/platform/graphics/Color.h b/WebCore/platform/graphics/Color.h
index 089d061..9335bc4 100644
--- a/WebCore/platform/graphics/Color.h
+++ b/WebCore/platform/graphics/Color.h
@@ -69,6 +69,11 @@ RGBA32 makeRGBAFromCMYKA(float c, float m, float y, float k, float a);
int differenceSquared(const Color&, const Color&);
+inline int redChannel(RGBA32 color) { return (color >> 16) & 0xFF; }
+inline int greenChannel(RGBA32 color) { return (color >> 8) & 0xFF; }
+inline int blueChannel(RGBA32 color) { return color & 0xFF; }
+inline int alphaChannel(RGBA32 color) { return (color >> 24) & 0xFF; }
+
class Color : public FastAllocBase {
public:
Color() : m_color(0), m_valid(false) { }
@@ -93,10 +98,10 @@ public:
bool hasAlpha() const { return alpha() < 255; }
- int red() const { return (m_color >> 16) & 0xFF; }
- int green() const { return (m_color >> 8) & 0xFF; }
- int blue() const { return m_color & 0xFF; }
- int alpha() const { return (m_color >> 24) & 0xFF; }
+ int red() const { return redChannel(m_color); }
+ int green() const { return greenChannel(m_color); }
+ int blue() const { return blueChannel(m_color); }
+ int alpha() const { return alphaChannel(m_color); }
RGBA32 rgb() const { return m_color; } // Preserve the alpha.
void setRGB(int r, int g, int b) { m_color = makeRGB(r, g, b); m_valid = true; }
diff --git a/WebCore/platform/graphics/FloatPoint.h b/WebCore/platform/graphics/FloatPoint.h
index 7443e97..5018f1d 100644
--- a/WebCore/platform/graphics/FloatPoint.h
+++ b/WebCore/platform/graphics/FloatPoint.h
@@ -80,7 +80,16 @@ public:
void setX(float x) { m_x = x; }
void setY(float y) { m_y = y; }
- void move(float dx, float dy) { m_x += dx; m_y += dy; }
+ void move(float dx, float dy)
+ {
+ m_x += dx;
+ m_y += dy;
+ }
+ void scale(float sx, float sy)
+ {
+ m_x *= sx;
+ m_y *= sy;
+ }
#if PLATFORM(CG)
FloatPoint(const CGPoint&);
@@ -122,6 +131,12 @@ inline FloatPoint& operator+=(FloatPoint& a, const FloatSize& b)
return a;
}
+inline FloatPoint& operator+=(FloatPoint& a, const FloatPoint& b)
+{
+ a.move(b.x(), b.y());
+ return a;
+}
+
inline FloatPoint& operator-=(FloatPoint& a, const FloatSize& b)
{
a.move(-b.width(), -b.height());
@@ -133,6 +148,11 @@ inline FloatPoint operator+(const FloatPoint& a, const FloatSize& b)
return FloatPoint(a.x() + b.width(), a.y() + b.height());
}
+inline FloatPoint operator+(const FloatPoint& a, const FloatPoint& b)
+{
+ return FloatPoint(a.x() + b.x(), a.y() + b.y());
+}
+
inline FloatSize operator-(const FloatPoint& a, const FloatPoint& b)
{
return FloatSize(a.x() - b.x(), a.y() - b.y());
diff --git a/WebCore/platform/graphics/Font.cpp b/WebCore/platform/graphics/Font.cpp
index 0351f7b..61f5707 100644
--- a/WebCore/platform/graphics/Font.cpp
+++ b/WebCore/platform/graphics/Font.cpp
@@ -72,7 +72,7 @@ Font::Font(const FontDescription& fd, short letterSpacing, short wordSpacing)
{
}
-Font::Font(const FontPlatformData& fontData, bool isPrinterFont)
+Font::Font(const FontPlatformData& fontData, bool isPrinterFont, FontSmoothingMode fontSmoothingMode)
: m_fontList(FontFallbackList::create())
, m_letterSpacing(0)
, m_wordSpacing(0)
@@ -80,6 +80,7 @@ Font::Font(const FontPlatformData& fontData, bool isPrinterFont)
, m_needsTranscoding(fontTranscoder().needsTranscoding(family().family().string()))
{
m_fontDescription.setUsePrinterFont(isPrinterFont);
+ m_fontDescription.setFontSmoothing(fontSmoothingMode);
m_fontList->setPlatformFont(fontData);
}
diff --git a/WebCore/platform/graphics/Font.h b/WebCore/platform/graphics/Font.h
index ecfde98..d6cf140 100644
--- a/WebCore/platform/graphics/Font.h
+++ b/WebCore/platform/graphics/Font.h
@@ -76,7 +76,7 @@ public:
Font();
Font(const FontDescription&, short letterSpacing, short wordSpacing);
// This constructor is only used if the platform wants to start with a native font.
- Font(const FontPlatformData&, bool isPrinting);
+ Font(const FontPlatformData&, bool isPrinting, FontSmoothingMode = AutoSmoothing);
~Font();
Font(const Font&);
@@ -135,7 +135,7 @@ public:
float xHeight() const { return primaryFont()->xHeight(); }
unsigned unitsPerEm() const { return primaryFont()->unitsPerEm(); }
int spaceWidth() const { return (int)ceilf(primaryFont()->adjustedSpaceWidth() + m_letterSpacing); }
- int tabWidth() const { return 8 * spaceWidth(); }
+ float tabWidth(const SimpleFontData& fontData) const { return 8 * ceilf(fontData.adjustedSpaceWidth() + letterSpacing()); }
const SimpleFontData* primaryFont() const;
const FontData* fontDataAt(unsigned) const;
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index 882362f..28388f4 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -68,8 +68,13 @@ typedef int Platform3DObject;
const Platform3DObject NullPlatform3DObject = 0;
#endif
+#if PLATFORM(CG)
+#include <CoreGraphics/CGContext.h>
+#endif
+
namespace WebCore {
class WebGLActiveInfo;
+ class ArrayBuffer;
class ArrayBufferView;
class WebGLBuffer;
class Uint8Array;
@@ -551,7 +556,9 @@ namespace WebCore {
void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha);
void bufferData(unsigned long target, int size, unsigned long usage);
+ void bufferData(unsigned long target, ArrayBuffer* data, unsigned long usage);
void bufferData(unsigned long target, ArrayBufferView* data, unsigned long usage);
+ void bufferSubData(unsigned long target, long offset, ArrayBuffer* data);
void bufferSubData(unsigned long target, long offset, ArrayBufferView* data);
unsigned long checkFramebufferStatus(unsigned long target);
@@ -707,7 +714,14 @@ namespace WebCore {
void viewport(long x, long y, unsigned long width, unsigned long height);
void reshape(int width, int height);
-
+
+#if PLATFORM(CG)
+ void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight,
+ int canvasWidth, int canvasHeight, CGContextRef context);
+#endif
+
+ void paintRenderingResultsToCanvas(WebGLRenderingContext* context);
+
// Helpers for notification about paint events
void beginPaint(WebGLRenderingContext* context);
void endPaint();
diff --git a/WebCore/platform/graphics/GraphicsLayer.h b/WebCore/platform/graphics/GraphicsLayer.h
index 8fcebce..a5819f4 100644
--- a/WebCore/platform/graphics/GraphicsLayer.h
+++ b/WebCore/platform/graphics/GraphicsLayer.h
@@ -298,10 +298,11 @@ public:
virtual void setContentsToImage(Image*) { }
virtual void setContentsToMedia(PlatformLayer*) { } // video or plug-in
virtual void setContentsBackgroundColor(const Color&) { }
-
#if ENABLE(3D_CANVAS)
virtual void setContentsToWebGL(PlatformLayer*) { }
#endif
+ virtual bool hasContentsLayer() const { return false; }
+
// Callback from the underlying graphics system to draw layer contents.
void paintGraphicsLayerContents(GraphicsContext&, const IntRect& clip);
// Callback from the underlying graphics system when the layer has been displayed
@@ -351,6 +352,8 @@ public:
// pointers for the layers and timing data will be included in the returned string.
String layerTreeAsText(LayerTreeAsTextBehavior = LayerTreeAsTextBehaviorNormal) const;
+ bool usingTiledLayer() const { return m_usingTiledLayer; }
+
protected:
typedef Vector<TransformOperation::OperationType> TransformOperationList;
diff --git a/WebCore/platform/graphics/ImageBuffer.h b/WebCore/platform/graphics/ImageBuffer.h
index 9f9ba7e..cb5d63f 100644
--- a/WebCore/platform/graphics/ImageBuffer.h
+++ b/WebCore/platform/graphics/ImageBuffer.h
@@ -74,6 +74,11 @@ namespace WebCore {
GraphicsContext* context() const;
Image* image() const;
+#if PLATFORM(QT)
+ Image* imageForRendering() const;
+#else
+ Image* imageForRendering() const { return image(); }
+#endif
void clearImage() { m_image.clear(); }
diff --git a/WebCore/platform/graphics/MediaPlayer.cpp b/WebCore/platform/graphics/MediaPlayer.cpp
index 3915713..9290dfe 100644
--- a/WebCore/platform/graphics/MediaPlayer.cpp
+++ b/WebCore/platform/graphics/MediaPlayer.cpp
@@ -130,6 +130,7 @@ public:
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
virtual void deliverNotification(MediaPlayerProxyNotificationType) { }
virtual void setMediaPlayerProxy(WebMediaPlayerProxy*) { }
+ virtual void setControls(bool) { }
#endif
virtual bool hasSingleSecurityOrigin() const { return true; }
@@ -563,6 +564,21 @@ void MediaPlayer::setMediaPlayerProxy(WebMediaPlayerProxy* proxy)
m_playerProxy = proxy;
m_private->setMediaPlayerProxy(proxy);
}
+
+void MediaPlayer::setControls(bool controls)
+{
+ m_private->setControls(controls);
+}
+
+void MediaPlayer::enterFullscreen()
+{
+ m_private->enterFullscreen();
+}
+
+void MediaPlayer::exitFullscreen()
+{
+ m_private->exitFullscreen();
+}
#endif
#if USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/MediaPlayer.h b/WebCore/platform/graphics/MediaPlayer.h
index 87f8fb4..dea5100 100644
--- a/WebCore/platform/graphics/MediaPlayer.h
+++ b/WebCore/platform/graphics/MediaPlayer.h
@@ -55,6 +55,7 @@ class QTMovieVisualContext;
namespace WebCore {
class GStreamerGWorld;
+class MediaPlayerPrivateInterface;
// Structure that will hold every native
// types supported by the current media player.
@@ -67,6 +68,7 @@ struct PlatformMedia {
QTMovieGWorldType,
QTMovieVisualContextType,
GStreamerGWorldType,
+ ChromiumMediaPlayerType,
} type;
union {
@@ -74,6 +76,7 @@ struct PlatformMedia {
QTMovieGWorld* qtMovieGWorld;
QTMovieVisualContext* qtMovieVisualContext;
GStreamerGWorld* gstreamerGWorld;
+ MediaPlayerPrivateInterface* chromiumMediaPlayer;
} media;
};
@@ -85,7 +88,6 @@ class GraphicsContext;
class IntRect;
class IntSize;
class MediaPlayer;
-class MediaPlayerPrivateInterface;
class String;
class TimeRanges;
@@ -256,6 +258,9 @@ public:
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
void deliverNotification(MediaPlayerProxyNotificationType notification);
void setMediaPlayerProxy(WebMediaPlayerProxy* proxy);
+ void setControls(bool);
+ void enterFullscreen();
+ void exitFullscreen();
#endif
#if USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/MediaPlayerPrivate.h b/WebCore/platform/graphics/MediaPlayerPrivate.h
index 16ff543..40aeacb 100644
--- a/WebCore/platform/graphics/MediaPlayerPrivate.h
+++ b/WebCore/platform/graphics/MediaPlayerPrivate.h
@@ -107,6 +107,9 @@ public:
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
virtual void deliverNotification(MediaPlayerProxyNotificationType) = 0;
virtual void setMediaPlayerProxy(WebMediaPlayerProxy*) = 0;
+ virtual void setControls(bool) { }
+ virtual void enterFullscreen() { }
+ virtual void exitFullscreen() { }
#endif
#if USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/Path.h b/WebCore/platform/graphics/Path.h
index b69670f..f2ae2df 100644
--- a/WebCore/platform/graphics/Path.h
+++ b/WebCore/platform/graphics/Path.h
@@ -124,6 +124,7 @@ namespace WebCore {
// Gets the current point of the current path, which is conceptually the final point reached by the path so far.
// Note the Path can be empty (isEmpty() == true) and still have a current point.
bool hasCurrentPoint() const;
+ FloatPoint currentPoint() const;
void moveTo(const FloatPoint&);
void addLineTo(const FloatPoint&);
diff --git a/WebCore/platform/graphics/WidthIterator.cpp b/WebCore/platform/graphics/WidthIterator.cpp
index 827cd10..ef047e8 100644
--- a/WebCore/platform/graphics/WidthIterator.cpp
+++ b/WebCore/platform/graphics/WidthIterator.cpp
@@ -84,7 +84,10 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
bool rtl = m_run.rtl();
bool hasExtraSpacing = (m_font->letterSpacing() || m_font->wordSpacing() || m_padding) && !m_run.spacingDisabled();
- float runWidthSoFar = m_runWidthSoFar;
+ float widthSinceLastRounding = m_runWidthSoFar;
+ m_runWidthSoFar = floorf(m_runWidthSoFar);
+ widthSinceLastRounding -= m_runWidthSoFar;
+
float lastRoundingWidth = m_finalRoundingWidth;
FloatRect bounds;
@@ -130,8 +133,8 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
// Now that we have a glyph and font data, get its width.
float width;
if (c == '\t' && m_run.allowTabs()) {
- float tabWidth = m_font->tabWidth();
- width = tabWidth - fmodf(m_run.xPos() + runWidthSoFar, tabWidth);
+ float tabWidth = m_font->tabWidth(*fontData);
+ width = tabWidth - fmodf(m_run.xPos() + m_runWidthSoFar + widthSinceLastRounding, tabWidth);
} else {
width = fontData->widthForGlyph(glyph);
@@ -216,11 +219,13 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
// width so that the total run width will be on an integer boundary.
if ((m_run.applyWordRounding() && currentCharacter < m_run.length() && Font::isRoundingHackCharacter(*cp))
|| (m_run.applyRunRounding() && currentCharacter >= m_end)) {
- float totalWidth = runWidthSoFar + width;
- width += ceilf(totalWidth) - totalWidth;
- }
-
- runWidthSoFar += width;
+ float totalWidth = widthSinceLastRounding + width;
+ widthSinceLastRounding = ceilf(totalWidth);
+ width += widthSinceLastRounding - totalWidth;
+ m_runWidthSoFar += widthSinceLastRounding;
+ widthSinceLastRounding = 0;
+ } else
+ widthSinceLastRounding += width;
if (glyphBuffer)
glyphBuffer->add(glyph, fontData, (rtl ? oldWidth + lastRoundingWidth : width));
@@ -235,7 +240,7 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
}
m_currentCharacter = currentCharacter;
- m_runWidthSoFar = runWidthSoFar;
+ m_runWidthSoFar += widthSinceLastRounding;
m_finalRoundingWidth = lastRoundingWidth;
}
diff --git a/WebCore/platform/graphics/cairo/FontCairo.cpp b/WebCore/platform/graphics/cairo/FontCairo.cpp
index 93051cb..9217a81 100644
--- a/WebCore/platform/graphics/cairo/FontCairo.cpp
+++ b/WebCore/platform/graphics/cairo/FontCairo.cpp
@@ -73,8 +73,8 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
FloatSize shadowSize;
float shadowBlur = 0;
Color shadowColor;
- bool hasShadow = context->textDrawingMode() == cTextFill &&
- context->getShadow(shadowSize, shadowBlur, shadowColor);
+ bool hasShadow = context->textDrawingMode() & cTextFill
+ && context->getShadow(shadowSize, shadowBlur, shadowColor);
// TODO: Blur support
if (hasShadow) {
diff --git a/WebCore/platform/graphics/cairo/PathCairo.cpp b/WebCore/platform/graphics/cairo/PathCairo.cpp
index 91cecd3..d880626 100644
--- a/WebCore/platform/graphics/cairo/PathCairo.cpp
+++ b/WebCore/platform/graphics/cairo/PathCairo.cpp
@@ -86,6 +86,15 @@ bool Path::hasCurrentPoint() const
return !isEmpty();
}
+FloatPoint Path::currentPoint() const
+{
+ // FIXME: Is this the correct way?
+ double x;
+ double y;
+ cairo_get_current_point(platformPath()->m_cr, &x, &y);
+ return FloatPoint(x, y);
+}
+
void Path::translate(const FloatSize& p)
{
cairo_t* cr = platformPath()->m_cr;
diff --git a/WebCore/platform/graphics/cg/ColorCG.cpp b/WebCore/platform/graphics/cg/ColorCG.cpp
index e514fa3..9257642 100644
--- a/WebCore/platform/graphics/cg/ColorCG.cpp
+++ b/WebCore/platform/graphics/cg/ColorCG.cpp
@@ -73,10 +73,14 @@ Color::Color(CGColorRef color)
CGColorRef createCGColor(const Color& c)
{
CGColorRef color = NULL;
+#ifdef OBSOLETE_COLORSYNC_API
CMProfileRef prof = NULL;
CMGetSystemProfile(&prof);
-
RetainPtr<CGColorSpaceRef> rgbSpace(AdoptCF, CGColorSpaceCreateWithPlatformColorSpace(prof));
+#else
+ ColorSyncProfileRef prof = ColorSyncProfileCreateWithDisplayID(0);
+ RetainPtr<CGColorSpaceRef> rgbSpace(AdoptCF, CGColorSpaceCreateWithPlatformColorSpace(const_cast<void*>(reinterpret_cast<const void*>(prof))));
+#endif
if (rgbSpace) {
CGFloat components[4] = { static_cast<CGFloat>(c.red()) / 255, static_cast<CGFloat>(c.green()) / 255,
@@ -84,7 +88,12 @@ CGColorRef createCGColor(const Color& c)
color = CGColorCreate(rgbSpace.get(), components);
}
+#ifdef OBSOLETE_COLORSYNC_API
CMCloseProfile(prof);
+#else
+ if (prof)
+ CFRelease(prof);
+#endif
return color;
}
diff --git a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
index 9f0f353..8af3d0e 100644
--- a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
@@ -36,6 +36,8 @@
#include <CoreGraphics/CGContext.h>
#include <CoreGraphics/CGImage.h>
+#include <wtf/RetainPtr.h>
+
namespace WebCore {
bool GraphicsContext3D::getImageData(Image* image,
@@ -104,6 +106,41 @@ bool GraphicsContext3D::getImageData(Image* image,
format, type, neededAlphaOp, outputVector.data());
}
+void GraphicsContext3D::paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, int canvasWidth, int canvasHeight, CGContextRef context)
+{
+ if (!imagePixels || imageWidth <= 0 || imageHeight <= 0 || canvasWidth <= 0 || canvasHeight <= 0 || !context)
+ return;
+ int rowBytes = imageWidth * 4;
+ RetainPtr<CGDataProviderRef> dataProvider = CGDataProviderCreateWithData(0, imagePixels, rowBytes * imageHeight, 0);
+ RetainPtr<CGColorSpaceRef> colorSpace = CGColorSpaceCreateDeviceRGB();
+ RetainPtr<CGImageRef> cgImage = CGImageCreate(imageWidth,
+ imageHeight,
+ 8,
+ 32,
+ rowBytes,
+ colorSpace.get(),
+ kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host,
+ dataProvider.get(),
+ 0,
+ false,
+ kCGRenderingIntentDefault);
+ // CSS styling may cause the canvas's content to be resized on
+ // the page. Go back to the Canvas to figure out the correct
+ // width and height to draw.
+ CGRect rect = CGRectMake(0, 0,
+ canvasWidth,
+ canvasHeight);
+ // We want to completely overwrite the previous frame's
+ // rendering results.
+ CGContextSaveGState(context);
+ CGContextSetBlendMode(context,
+ kCGBlendModeCopy);
+ CGContextSetInterpolationQuality(context,
+ kCGInterpolationNone);
+ CGContextDrawImage(context,
+ rect, cgImage.get());
+ CGContextRestoreGState(context);
+}
} // namespace WebCore
diff --git a/WebCore/platform/graphics/cg/PathCG.cpp b/WebCore/platform/graphics/cg/PathCG.cpp
index eb196d9..90d4b8a 100644
--- a/WebCore/platform/graphics/cg/PathCG.cpp
+++ b/WebCore/platform/graphics/cg/PathCG.cpp
@@ -213,8 +213,7 @@ void Path::addArcTo(const FloatPoint& p1, const FloatPoint& p2, float radius)
void Path::closeSubpath()
{
- if (!CGPathIsEmpty(m_path)) // to silence a warning when trying to close an empty path
- CGPathCloseSubpath(m_path);
+ CGPathCloseSubpath(m_path);
}
void Path::addArc(const FloatPoint& p, float r, float sa, float ea, bool clockwise)
@@ -249,6 +248,11 @@ bool Path::hasCurrentPoint() const
{
return !isEmpty();
}
+
+FloatPoint Path::currentPoint() const
+{
+ return CGPathGetCurrentPoint(m_path);
+}
static void CGPathToCFStringApplierFunction(void* info, const CGPathElement *element)
{
diff --git a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
index dda10b7..9b54732 100644
--- a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
@@ -43,7 +43,8 @@
namespace WebCore {
static SkPaint::Hinting skiaHinting = SkPaint::kNormal_Hinting;
-static bool isSkiaAntiAlias = true, isSkiaSubpixelGlyphs;
+static bool isSkiaAntiAlias = true;
+static bool isSkiaSubpixelGlyphs = false;
void FontPlatformData::setHinting(SkPaint::Hinting hinting)
{
diff --git a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
index 9b65346..a01a17f 100644
--- a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
@@ -363,9 +363,30 @@ void GraphicsLayerChromium::setContentsToWebGL(PlatformLayer* platformLayer)
}
#endif
-void GraphicsLayerChromium::setContentsToVideo(PlatformLayer* videoLayer)
+void GraphicsLayerChromium::setContentsToMedia(PlatformLayer* layer)
{
- // FIXME: Implement
+ bool childrenChanged = false;
+ if (layer) {
+ if (!m_contentsLayer.get() || m_contentsLayerPurpose != ContentsLayerForVideo) {
+ setupContentsLayer(layer);
+ m_contentsLayer = layer;
+ m_contentsLayerPurpose = ContentsLayerForVideo;
+ childrenChanged = true;
+ }
+ layer->setOwner(this);
+ layer->setNeedsDisplay();
+ updateContentsRect();
+ } else {
+ if (m_contentsLayer) {
+ childrenChanged = true;
+
+ // The old contents layer will be removed via updateSublayerList.
+ m_contentsLayer = 0;
+ }
+ }
+
+ if (childrenChanged)
+ updateSublayerList();
}
void GraphicsLayerChromium::setGeometryOrientation(CompositingCoordinatesOrientation orientation)
diff --git a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
index ccd02eb..cd5e479 100644
--- a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
+++ b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
@@ -85,7 +85,7 @@ public:
virtual void setContentsRect(const IntRect&);
virtual void setContentsToImage(Image*);
- virtual void setContentsToVideo(PlatformLayer*);
+ virtual void setContentsToMedia(PlatformLayer*);
virtual void setContentsToWebGL(PlatformLayer*);
virtual PlatformLayer* platformLayer() const;
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
index 9ac506c..b071385 100644
--- a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -37,7 +37,6 @@
#include "GLES2Context.h"
#include "LayerChromium.h"
#include "NotImplemented.h"
-#include "Page.h"
#include "TransformLayerChromium.h"
#include "WebGLLayerChromium.h"
#if PLATFORM(SKIA)
@@ -190,24 +189,24 @@ ShaderProgram::ShaderProgram()
{
}
-PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(Page* page)
+PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(PassOwnPtr<GLES2Context> gles2Context)
{
- return new LayerRendererChromium(page);
+ return new LayerRendererChromium(gles2Context);
}
-LayerRendererChromium::LayerRendererChromium(Page* page)
+LayerRendererChromium::LayerRendererChromium(PassOwnPtr<GLES2Context> gles2Context)
: m_rootLayer(0)
, m_needsDisplay(false)
, m_positionLocation(0)
, m_texCoordLocation(1)
- , m_page(page)
, m_rootLayerTextureWidth(0)
, m_rootLayerTextureHeight(0)
, m_scrollPosition(IntPoint(-1, -1))
, m_currentShaderProgramType(NumShaderProgramTypes)
+ , m_gles2Context(gles2Context)
{
m_quadVboIds[Vertices] = m_quadVboIds[LayerElements] = 0;
- m_hardwareCompositing = (initGL() && initializeSharedGLObjects());
+ m_hardwareCompositing = (m_gles2Context && initializeSharedGLObjects());
}
LayerRendererChromium::~LayerRendererChromium()
@@ -645,16 +644,6 @@ bool LayerRendererChromium::makeContextCurrent()
return m_gles2Context->makeCurrent();
}
-bool LayerRendererChromium::initGL()
-{
- m_gles2Context = GLES2Context::createOnscreen(m_page);
-
- if (!m_gles2Context)
- return false;
-
- return true;
-}
-
void LayerRendererChromium::bindCommonAttribLocations(ShaderProgramType program)
{
unsigned programId = m_shaderPrograms[program].m_shaderProgramId;
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
index dc7ea70..3b89dc6 100644
--- a/WebCore/platform/graphics/chromium/LayerRendererChromium.h
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
@@ -45,7 +45,6 @@
namespace WebCore {
class GLES2Context;
-class Page;
class ShaderProgram {
public:
@@ -60,9 +59,9 @@ public:
// Class that handles drawing of composited render layers using GL.
class LayerRendererChromium : public Noncopyable {
public:
- static PassOwnPtr<LayerRendererChromium> create(Page* page);
+ static PassOwnPtr<LayerRendererChromium> create(PassOwnPtr<GLES2Context> gles2Context);
- LayerRendererChromium(Page* page);
+ LayerRendererChromium(PassOwnPtr<GLES2Context> gles2Context);
~LayerRendererChromium();
// Updates the contents of the root layer that fall inside the updateRect and recomposites
@@ -105,7 +104,6 @@ private:
enum VboIds { Vertices, LayerElements };
// These are here only temporarily and should be removed once we switch over to GGL
- bool initGL();
bool makeContextCurrent();
bool initializeSharedGLObjects();
@@ -151,9 +149,6 @@ private:
IntSize m_rootLayerCanvasSize;
OwnPtr<GLES2Context> m_gles2Context;
-
- // The WebCore Page that the compositor renders into.
- Page* m_page;
};
}
diff --git a/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp b/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
new file mode 100644
index 0000000..5ac0e57
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "VideoLayerChromium.h"
+
+namespace WebCore {
+
+PassRefPtr<VideoLayerChromium> VideoLayerChromium::create(GraphicsLayerChromium* owner)
+{
+ return adoptRef(new VideoLayerChromium(owner));
+}
+
+VideoLayerChromium::VideoLayerChromium(GraphicsLayerChromium* owner)
+ : LayerChromium(owner)
+{
+}
+
+}
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/chromium/VideoLayerChromium.h b/WebCore/platform/graphics/chromium/VideoLayerChromium.h
new file mode 100644
index 0000000..1fa8009
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/VideoLayerChromium.h
@@ -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:
+ *
+ * * 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 VideoLayerChromium_h
+#define VideoLayerChromium_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "LayerChromium.h"
+
+namespace WebCore {
+
+// A Layer that contains a Video element.
+class VideoLayerChromium : public LayerChromium {
+public:
+ static PassRefPtr<VideoLayerChromium> create(GraphicsLayerChromium* owner = 0);
+ virtual bool drawsContent() { return true; }
+
+private:
+ VideoLayerChromium(GraphicsLayerChromium* owner);
+};
+
+}
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif
diff --git a/WebCore/platform/graphics/haiku/PathHaiku.cpp b/WebCore/platform/graphics/haiku/PathHaiku.cpp
index d8b6932..c5b8c98 100644
--- a/WebCore/platform/graphics/haiku/PathHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/PathHaiku.cpp
@@ -65,6 +65,14 @@ bool Path::hasCurrentPoint() const
return !isEmpty();
}
+FloatPoint Path::currentPoint() const
+{
+ // FIXME: implement safe way to return current point of subpath.
+ notImplemented();
+ float quietNaN = std::numeric_limits<float>::quiet_NaN();
+ return FloatPoint(quietNaN, quietNaN);
+}
+
bool Path::contains(const FloatPoint& point, WindRule rule) const
{
return m_path->Contains(point);
diff --git a/WebCore/platform/graphics/mac/ComplexTextController.cpp b/WebCore/platform/graphics/mac/ComplexTextController.cpp
index 61c9a59..da381f2 100644
--- a/WebCore/platform/graphics/mac/ComplexTextController.cpp
+++ b/WebCore/platform/graphics/mac/ComplexTextController.cpp
@@ -431,6 +431,7 @@ void ComplexTextController::advance(unsigned offset, GlyphBuffer* glyphBuffer)
void ComplexTextController::adjustGlyphsAndAdvances()
{
+ CGFloat widthSinceLastRounding = 0;
size_t runCount = m_complexTextRuns.size();
for (size_t r = 0; r < runCount; ++r) {
ComplexTextRun& complexTextRun = *m_complexTextRuns[r];
@@ -473,8 +474,8 @@ void ComplexTextController::adjustGlyphsAndAdvances()
CGSize advance = treatAsSpace ? CGSizeMake(fontData->spaceWidth(), advances[i].height) : advances[i];
if (ch == '\t' && m_run.allowTabs()) {
- float tabWidth = m_font.tabWidth();
- advance.width = tabWidth - fmodf(m_run.xPos() + m_totalWidth, tabWidth);
+ float tabWidth = m_font.tabWidth(*fontData);
+ advance.width = tabWidth - fmodf(m_run.xPos() + m_totalWidth + widthSinceLastRounding, tabWidth);
} else if (ch == zeroWidthSpace || Font::treatAsZeroWidthSpace(ch) && !treatAsSpace) {
advance.width = 0;
glyph = fontData->spaceGlyph();
@@ -532,21 +533,23 @@ void ComplexTextController::adjustGlyphsAndAdvances()
// Check to see if the next character is a "rounding hack character", if so, adjust the
// width so that the total run width will be on an integer boundary.
if (m_run.applyWordRounding() && !lastGlyph && Font::isRoundingHackCharacter(nextCh) || m_run.applyRunRounding() && lastGlyph) {
- CGFloat totalWidth = m_totalWidth + advance.width;
- CGFloat extraWidth = ceilCGFloat(totalWidth) - totalWidth;
+ CGFloat totalWidth = widthSinceLastRounding + advance.width;
+ widthSinceLastRounding = ceilCGFloat(totalWidth);
+ CGFloat extraWidth = widthSinceLastRounding - totalWidth;
if (m_run.ltr())
advance.width += extraWidth;
else {
- m_totalWidth += extraWidth;
if (m_lastRoundingGlyph)
m_adjustedAdvances[m_lastRoundingGlyph - 1].width += extraWidth;
else
m_finalRoundingWidth = extraWidth;
m_lastRoundingGlyph = m_adjustedAdvances.size() + 1;
}
- }
+ m_totalWidth += widthSinceLastRounding;
+ widthSinceLastRounding = 0;
+ } else
+ widthSinceLastRounding += advance.width;
- m_totalWidth += advance.width;
advance.height *= -1;
m_adjustedAdvances.append(advance);
m_adjustedGlyphs.append(glyph);
@@ -565,6 +568,7 @@ void ComplexTextController::adjustGlyphsAndAdvances()
if (!isMonotonic)
complexTextRun.setIsNonMonotonic();
}
+ m_totalWidth += widthSinceLastRounding;
}
} // namespace WebCore
diff --git a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
index 961ec45..30c3b8e 100644
--- a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
+++ b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
@@ -34,14 +34,18 @@
#include "ImageBuffer.h"
#include "NotImplemented.h"
#include "WebGLActiveInfo.h"
+#include "ArrayBuffer.h"
#include "ArrayBufferView.h"
#include "WebGLBuffer.h"
#include "Float32Array.h"
#include "WebGLFramebuffer.h"
+#include "GraphicsContext.h"
+#include "HTMLCanvasElement.h"
#include "Int32Array.h"
#include "WebGLLayer.h"
#include "WebGLProgram.h"
#include "WebGLRenderbuffer.h"
+#include "WebGLRenderingContext.h"
#include "WebGLShader.h"
#include "WebGLTexture.h"
#include "Uint8Array.h"
@@ -236,6 +240,54 @@ void GraphicsContext3D::makeContextCurrent()
CGLSetCurrentContext(m_contextObj);
}
+void GraphicsContext3D::paintRenderingResultsToCanvas(WebGLRenderingContext* context)
+{
+ HTMLCanvasElement* canvas = context->canvas();
+ ImageBuffer* imageBuffer = canvas->buffer();
+
+ int rowBytes = m_currentWidth * 4;
+ int totalBytes = rowBytes * m_currentHeight;
+
+ OwnArrayPtr<unsigned char> pixels(new unsigned char[totalBytes]);
+ if (!pixels)
+ return;
+
+ CGLSetCurrentContext(m_contextObj);
+
+ bool mustRestoreFBO = false;
+ if (m_attrs.antialias) {
+ ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
+ ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
+ ::glBlitFramebufferEXT(0, 0, m_currentWidth, m_currentHeight, 0, 0, m_currentWidth, m_currentHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR);
+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+ mustRestoreFBO = true;
+ } else {
+ if (m_boundFBO != m_fbo) {
+ mustRestoreFBO = true;
+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+ }
+ }
+
+ GLint packAlignment = 4;
+ bool mustRestorePackAlignment = false;
+ ::glGetIntegerv(GL_PACK_ALIGNMENT, &packAlignment);
+ if (packAlignment > 4) {
+ ::glPixelStorei(GL_PACK_ALIGNMENT, 4);
+ mustRestorePackAlignment = true;
+ }
+
+ ::glReadPixels(0, 0, m_currentWidth, m_currentHeight, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, pixels.get());
+
+ if (mustRestorePackAlignment)
+ ::glPixelStorei(GL_PACK_ALIGNMENT, packAlignment);
+
+ if (mustRestoreFBO)
+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
+
+ paintToCanvas(pixels.get(), m_currentWidth, m_currentHeight,
+ canvas->width(), canvas->height(), imageBuffer->context()->platformContext());
+}
+
void GraphicsContext3D::beginPaint(WebGLRenderingContext* context)
{
UNUSED_PARAM(context);
@@ -494,6 +546,16 @@ void GraphicsContext3D::bufferData(unsigned long target, int size, unsigned long
ensureContext(m_contextObj);
::glBufferData(target, size, 0, usage);
}
+
+void GraphicsContext3D::bufferData(unsigned long target, ArrayBuffer* array, unsigned long usage)
+{
+ if (!array || !array->byteLength())
+ return;
+
+ ensureContext(m_contextObj);
+ ::glBufferData(target, array->byteLength(), array->data(), usage);
+}
+
void GraphicsContext3D::bufferData(unsigned long target, ArrayBufferView* array, unsigned long usage)
{
if (!array || !array->length())
@@ -503,6 +565,15 @@ void GraphicsContext3D::bufferData(unsigned long target, ArrayBufferView* array,
::glBufferData(target, array->byteLength(), array->baseAddress(), usage);
}
+void GraphicsContext3D::bufferSubData(unsigned long target, long offset, ArrayBuffer* array)
+{
+ if (!array || !array->byteLength())
+ return;
+
+ ensureContext(m_contextObj);
+ ::glBufferSubData(target, offset, array->byteLength(), array->data());
+}
+
void GraphicsContext3D::bufferSubData(unsigned long target, long offset, ArrayBufferView* array)
{
if (!array || !array->length())
@@ -1216,6 +1287,10 @@ void GraphicsContext3D::getIntegerv(unsigned long pname, int* value)
// Need to emulate IMPLEMENTATION_COLOR_READ_FORMAT/TYPE for GL. Any valid
// combination should work, but GL_RGB/GL_UNSIGNED_BYTE might be the most
// useful for desktop WebGL users.
+ // Need to emulate MAX_FRAGMENT/VERTEX_UNIFORM_VECTORS and MAX_VARYING_VECTORS
+ // because desktop GL's corresponding queries return the number of components
+ // whereas GLES2 return the number of vectors (each vector has 4 components).
+ // Therefore, the value returned by desktop GL needs to be divided by 4.
ensureContext(m_contextObj);
switch (pname) {
case IMPLEMENTATION_COLOR_READ_FORMAT:
@@ -1224,6 +1299,18 @@ void GraphicsContext3D::getIntegerv(unsigned long pname, int* value)
case IMPLEMENTATION_COLOR_READ_TYPE:
*value = GL_UNSIGNED_BYTE;
break;
+ case MAX_FRAGMENT_UNIFORM_VECTORS:
+ ::glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, value);
+ *value /= 4;
+ break;
+ case MAX_VERTEX_UNIFORM_VECTORS:
+ ::glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS, value);
+ *value /= 4;
+ break;
+ case MAX_VARYING_VECTORS:
+ ::glGetIntegerv(GL_MAX_VARYING_FLOATS, value);
+ *value /= 4;
+ break;
default:
::glGetIntegerv(pname, value);
}
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.h b/WebCore/platform/graphics/mac/GraphicsLayerCA.h
index 7d78dee..80c822c 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.h
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.h
@@ -106,6 +106,7 @@ public:
#if ENABLE(3D_CANVAS)
virtual void setContentsToWebGL(PlatformLayer*);
#endif
+ virtual bool hasContentsLayer() const { return m_contentsLayer; }
virtual PlatformLayer* platformLayer() const;
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
index 43b3f3e..9f1ac83 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
@@ -1057,11 +1057,11 @@ void GraphicsLayerCA::updateSublayerList()
void GraphicsLayerCA::updateLayerPosition()
{
- // FIXME: if constrained the size, the position will be wrong. Fixing this is not trivial.
+ FloatSize usedSize = m_usingTiledLayer ? constrainedSize() : m_size;
// Position is offset on the layer by the layer anchor point.
- CGPoint posPoint = CGPointMake(m_position.x() + m_anchorPoint.x() * m_size.width(),
- m_position.y() + m_anchorPoint.y() * m_size.height());
+ CGPoint posPoint = CGPointMake(m_position.x() + m_anchorPoint.x() * usedSize.width(),
+ m_position.y() + m_anchorPoint.y() * usedSize.height());
[primaryLayer() setPosition:posPoint];
@@ -2271,8 +2271,6 @@ void GraphicsLayerCA::updateContentsTransform()
contentsTransform = CGAffineTransformTranslate(contentsTransform, 0, -[m_layer.get() bounds].size.height);
[m_layer.get() setContentsTransform:contentsTransform];
}
-#else
- ASSERT(contentsOrientation() == CompositingCoordinatesTopDown);
#endif
}
diff --git a/WebCore/platform/graphics/mac/WebLayer.h b/WebCore/platform/graphics/mac/WebLayer.h
index af53ae6..3a91f04 100644
--- a/WebCore/platform/graphics/mac/WebLayer.h
+++ b/WebCore/platform/graphics/mac/WebLayer.h
@@ -53,12 +53,12 @@ namespace WebCore {
{
WebCore::GraphicsLayer* m_layerOwner;
}
-
-// Class method allows us to share implementation across TiledLayerMac and WebLayer
-+ (void)drawContents:(WebCore::GraphicsLayer*)layerContents ofLayer:(CALayer*)layer intoContext:(CGContextRef)context;
-
@end
+// Functions allows us to share implementation across WebTiledLayer and WebLayer
+void drawLayerContents(CGContextRef, CALayer *, WebCore::GraphicsLayer*);
+void setLayerNeedsDisplayInRect(CALayer *, WebCore::GraphicsLayer*, CGRect);
+
#endif // USE(ACCELERATED_COMPOSITING)
#endif // WebLayer_h
diff --git a/WebCore/platform/graphics/mac/WebLayer.mm b/WebCore/platform/graphics/mac/WebLayer.mm
index 0c9925e..9bb8212 100644
--- a/WebCore/platform/graphics/mac/WebLayer.mm
+++ b/WebCore/platform/graphics/mac/WebLayer.mm
@@ -31,6 +31,7 @@
#import "GraphicsContext.h"
#import "GraphicsLayer.h"
+#import <objc/objc-runtime.h>
#import <QuartzCore/QuartzCore.h>
#import <wtf/UnusedParam.h>
@@ -38,7 +39,7 @@ using namespace WebCore;
@implementation WebLayer
-+ (void)drawContents:(WebCore::GraphicsLayer*)layerContents ofLayer:(CALayer*)layer intoContext:(CGContextRef)context
+void drawLayerContents(CGContextRef context, CALayer *layer, WebCore::GraphicsLayer* layerContents)
{
if (!layerContents)
return;
@@ -110,6 +111,34 @@ using namespace WebCore;
CGContextRestoreGState(context);
}
+void setLayerNeedsDisplayInRect(CALayer *layer, WebCore::GraphicsLayer* layerContents, CGRect rect)
+{
+ if (layerContents && layerContents->client() && layerContents->drawsContent()) {
+ struct objc_super layerSuper = { layer, class_getSuperclass(object_getClass(layer)) };
+#if defined(BUILDING_ON_LEOPARD)
+ rect = CGRectApplyAffineTransform(rect, [layer contentsTransform]);
+#else
+ if (layerContents->contentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesBottomUp)
+ rect.origin.y = [layer bounds].size.height - rect.origin.y - rect.size.height;
+#endif
+ objc_msgSendSuper(&layerSuper, @selector(setNeedsDisplayInRect:), rect);
+
+#ifndef NDEBUG
+ if (layerContents->showRepaintCounter()) {
+ CGRect bounds = [layer bounds];
+ CGRect indicatorRect = CGRectMake(bounds.origin.x, bounds.origin.y, 46, 25);
+#if defined(BUILDING_ON_LEOPARD)
+ indicatorRect = CGRectApplyAffineTransform(indicatorRect, [layer contentsTransform]);
+#else
+ if (layerContents->contentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesBottomUp)
+ indicatorRect.origin.y = [layer bounds].size.height - indicatorRect.origin.y - indicatorRect.size.height;
+#endif
+ objc_msgSendSuper(&layerSuper, @selector(setNeedsDisplayInRect:), indicatorRect);
+ }
+#endif
+ }
+}
+
// Disable default animations
- (id<CAAction>)actionForKey:(NSString *)key
{
@@ -134,23 +163,7 @@ using namespace WebCore;
- (void)setNeedsDisplayInRect:(CGRect)dirtyRect
{
- if (m_layerOwner && m_layerOwner->client() && m_layerOwner->drawsContent()) {
-#if defined(BUILDING_ON_LEOPARD)
- dirtyRect = CGRectApplyAffineTransform(dirtyRect, [self contentsTransform]);
-#endif
- [super setNeedsDisplayInRect:dirtyRect];
-
-#ifndef NDEBUG
- if (m_layerOwner->showRepaintCounter()) {
- CGRect bounds = [self bounds];
- CGRect indicatorRect = CGRectMake(bounds.origin.x, bounds.origin.y, 46, 25);
-#if defined(BUILDING_ON_LEOPARD)
- indicatorRect = CGRectApplyAffineTransform(indicatorRect, [self contentsTransform]);
-#endif
- [super setNeedsDisplayInRect:indicatorRect];
- }
-#endif
- }
+ setLayerNeedsDisplayInRect(self, m_layerOwner, dirtyRect);
}
- (void)display
@@ -162,7 +175,7 @@ using namespace WebCore;
- (void)drawInContext:(CGContextRef)context
{
- [WebLayer drawContents:m_layerOwner ofLayer:self intoContext:context];
+ drawLayerContents(context, self, m_layerOwner);
}
@end // implementation WebLayer
diff --git a/WebCore/platform/graphics/mac/WebTiledLayer.mm b/WebCore/platform/graphics/mac/WebTiledLayer.mm
index 97ba233..72128ad 100644
--- a/WebCore/platform/graphics/mac/WebTiledLayer.mm
+++ b/WebCore/platform/graphics/mac/WebTiledLayer.mm
@@ -73,23 +73,7 @@ using namespace WebCore;
- (void)setNeedsDisplayInRect:(CGRect)dirtyRect
{
- if (m_layerOwner && m_layerOwner->client() && m_layerOwner->drawsContent()) {
-#if defined(BUILDING_ON_LEOPARD)
- dirtyRect = CGRectApplyAffineTransform(dirtyRect, [self contentsTransform]);
-#endif
- [super setNeedsDisplayInRect:dirtyRect];
-
-#ifndef NDEBUG
- if (m_layerOwner->showRepaintCounter()) {
- CGRect bounds = [self bounds];
- CGRect indicatorRect = CGRectMake(bounds.origin.x, bounds.origin.y, 46, 25);
-#if defined(BUILDING_ON_LEOPARD)
- indicatorRect = CGRectApplyAffineTransform(indicatorRect, [self contentsTransform]);
-#endif
- [super setNeedsDisplayInRect:indicatorRect];
- }
-#endif
- }
+ setLayerNeedsDisplayInRect(self, m_layerOwner, dirtyRect);
}
- (void)display
@@ -99,9 +83,9 @@ using namespace WebCore;
m_layerOwner->didDisplay(self);
}
-- (void)drawInContext:(CGContextRef)ctx
+- (void)drawInContext:(CGContextRef)context
{
- [WebLayer drawContents:m_layerOwner ofLayer:self intoContext:ctx];
+ drawLayerContents(context, self, m_layerOwner);
}
@end // implementation WebTiledLayer
diff --git a/WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp b/WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp
index 12ae09d..7f4547d 100644
--- a/WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp
+++ b/WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp
@@ -70,8 +70,8 @@ struct TableDirectoryEntry {
BigEndianULong length;
};
-#if !PLATFORM(CG)
-// Fixed type is not defined on non-CG platforms. |version| in sfntHeader
+#if !PLATFORM(CG) || !defined(COREGRAPHICS_INCLUDES_CORESERVICES_HEADER)
+// Fixed type is not defined on non-CG and Windows platforms. |version| in sfntHeader
// and headTable and |fontRevision| in headTable are of Fixed, but they're
// not actually refered to anywhere. Therefore, we just have to match
// the size (4 bytes). For the definition of Fixed type, see
diff --git a/WebCore/platform/graphics/openvg/PathOpenVG.cpp b/WebCore/platform/graphics/openvg/PathOpenVG.cpp
index 7e67036..e74ea57 100644
--- a/WebCore/platform/graphics/openvg/PathOpenVG.cpp
+++ b/WebCore/platform/graphics/openvg/PathOpenVG.cpp
@@ -123,6 +123,13 @@ Path& Path::operator=(const Path& other)
return *this;
}
+FloatPoint Path::currentPoint() const
+{
+ // FIXME: is this the way to return the current point of the subpath?
+ return m_currentPoint;
+}
+
+
bool Path::contains(const FloatPoint& point, WindRule rule) const
{
notImplemented();
diff --git a/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
index 002765f..311d3a3 100644
--- a/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
@@ -521,6 +521,15 @@ void GraphicsContext3D::makeContextCurrent()
void GraphicsContext3D::beginPaint(WebGLRenderingContext* context)
{
+ paintRenderingResultsToCanvas();
+}
+
+void GraphicsContext3D::endPaint()
+{
+}
+
+void GraphicsContext3D::paintRenderingResultsToCanvas(WebGLRenderingContext* context)
+{
m_internal->m_glWidget->makeCurrent();
HTMLCanvasElement* canvas = context->canvas();
ImageBuffer* imageBuffer = canvas->buffer();
@@ -528,10 +537,6 @@ void GraphicsContext3D::beginPaint(WebGLRenderingContext* context)
paint(painter, QRect(QPoint(0, 0), QSize(m_currentWidth, m_currentHeight)));
}
-void GraphicsContext3D::endPaint()
-{
-}
-
void GraphicsContext3D::paint(QPainter* painter, const QRect& rect) const
{
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 913a764..a828070 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -358,7 +358,7 @@ void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
StrokeStyle style = strokeStyle();
Color color = strokeColor();
- if (style == NoStroke || !color.alpha())
+ if (style == NoStroke)
return;
float width = strokeThickness();
@@ -467,7 +467,7 @@ void GraphicsContext::drawEllipse(const IntRect& rect)
void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSpan)
{
- if (paintingDisabled() || strokeStyle() == NoStroke || strokeThickness() <= 0.0f || !strokeColor().alpha())
+ if (paintingDisabled() || strokeStyle() == NoStroke || strokeThickness() <= 0.0f)
return;
QPainter* p = m_data->p();
@@ -567,23 +567,20 @@ void GraphicsContext::fillPath()
return;
QPainter* p = m_data->p();
- QPainterPath path = m_data->currentPath;
+ QPainterPath& path = m_data->currentPath; // Avoid detaching the QPainterPath
path.setFillRule(toQtFillRule(fillRule()));
- if (m_common->state.fillPattern || m_common->state.fillGradient || fillColor().alpha()) {
- drawFilledShadowPath(this, p, path);
- if (m_common->state.fillPattern) {
- AffineTransform affine;
- p->fillPath(path, QBrush(m_common->state.fillPattern->createPlatformPattern(affine)));
- } else if (m_common->state.fillGradient) {
- QBrush brush(*m_common->state.fillGradient->platformGradient());
- brush.setTransform(m_common->state.fillGradient->gradientSpaceTransform());
- p->fillPath(path, brush);
- } else {
- if (fillColor().alpha())
- p->fillPath(path, p->brush());
- }
- }
+ drawFilledShadowPath(this, p, path);
+ if (m_common->state.fillPattern) {
+ AffineTransform affine;
+ p->fillPath(path, QBrush(m_common->state.fillPattern->createPlatformPattern(affine)));
+ } else if (m_common->state.fillGradient) {
+ QBrush brush(*m_common->state.fillGradient->platformGradient());
+ brush.setTransform(m_common->state.fillGradient->gradientSpaceTransform());
+ p->fillPath(path, brush);
+ } else
+ p->fillPath(path, p->brush());
+
m_data->currentPath = QPainterPath();
}
@@ -594,37 +591,33 @@ void GraphicsContext::strokePath()
QPainter* p = m_data->p();
QPen pen(p->pen());
- QPainterPath path = m_data->currentPath;
+ QPainterPath& path = m_data->currentPath; // Avoid detaching the QPainterPath
path.setFillRule(toQtFillRule(fillRule()));
- if (m_common->state.strokePattern || m_common->state.strokeGradient || strokeColor().alpha()) {
- FloatSize shadowSize;
- float shadowBlur;
- Color shadowColor;
- if (getShadow(shadowSize, shadowBlur, shadowColor)) {
- QTransform t(p->worldTransform());
- p->translate(shadowSize.width(), shadowSize.height());
- QPen shadowPen(pen);
- shadowPen.setColor(shadowColor);
- p->strokePath(path, shadowPen);
- p->setWorldTransform(t);
- }
- if (m_common->state.strokePattern) {
- AffineTransform affine;
- pen.setBrush(QBrush(m_common->state.strokePattern->createPlatformPattern(affine)));
- p->setPen(pen);
- p->strokePath(path, pen);
- } else if (m_common->state.strokeGradient) {
- QBrush brush(*m_common->state.strokeGradient->platformGradient());
- brush.setTransform(m_common->state.strokeGradient->gradientSpaceTransform());
- pen.setBrush(brush);
- p->setPen(pen);
- p->strokePath(path, pen);
- } else {
- if (strokeColor().alpha())
- p->strokePath(path, pen);
- }
+ FloatSize shadowSize;
+ float shadowBlur;
+ Color shadowColor;
+ if (getShadow(shadowSize, shadowBlur, shadowColor)) {
+ QTransform t(p->worldTransform());
+ p->translate(shadowSize.width(), shadowSize.height());
+ QPen shadowPen(pen);
+ shadowPen.setColor(shadowColor);
+ p->strokePath(path, shadowPen);
+ p->setWorldTransform(t);
}
+ if (m_common->state.strokePattern) {
+ AffineTransform affine;
+ pen.setBrush(QBrush(m_common->state.strokePattern->createPlatformPattern(affine)));
+ p->setPen(pen);
+ p->strokePath(path, pen);
+ } else if (m_common->state.strokeGradient) {
+ QBrush brush(*m_common->state.strokeGradient->platformGradient());
+ brush.setTransform(m_common->state.strokeGradient->gradientSpaceTransform());
+ pen.setBrush(brush);
+ p->setPen(pen);
+ p->strokePath(path, pen);
+ } else
+ p->strokePath(path, pen);
m_data->currentPath = QPainterPath();
}
@@ -713,28 +706,63 @@ void GraphicsContext::fillRect(const FloatRect& rect)
return;
QPainter* p = m_data->p();
+ FloatRect normalizedRect = rect.normalized();
- if (m_common->state.fillPattern || m_common->state.fillGradient || fillColor().alpha()) {
- if (m_common->state.shadowColor.isValid())
- drawBorderlessRectShadow(this, p, rect);
- if (m_common->state.fillPattern) {
- AffineTransform affine;
- FloatRect rectM(rect);
- QBrush brush(m_common->state.fillPattern->createPlatformPattern(affine));
- QPixmap* image = m_common->state.fillPattern->tileImage()->nativeImageForCurrentFrame();
-
- drawRepeatPattern(p, image, rect, m_common->state.fillPattern->repeatX(), m_common->state.fillPattern->repeatY());
- } else if (m_common->state.fillGradient) {
- QBrush brush(*m_common->state.fillGradient->platformGradient());
- brush.setTransform(m_common->state.fillGradient->gradientSpaceTransform());
- p->fillRect(rect, brush);
- } else {
- if (fillColor().alpha())
- p->fillRect(rect, p->brush());
+ FloatSize shadowSize;
+ float shadowBlur;
+ Color shadowColor;
+ bool hasShadow = getShadow(shadowSize, shadowBlur, shadowColor);
+ FloatRect shadowDestRect;
+ QImage* shadowImage = 0;
+ QPainter* pShadow = 0;
+
+ if (hasShadow) {
+ shadowImage = new QImage(roundedIntSize(normalizedRect.size()), QImage::Format_ARGB32_Premultiplied);
+ pShadow = new QPainter(shadowImage);
+ shadowDestRect = normalizedRect;
+ shadowDestRect.move(shadowSize.width(), shadowSize.height());
+
+ pShadow->setCompositionMode(QPainter::CompositionMode_Source);
+ pShadow->fillRect(shadowImage->rect(), shadowColor);
+ pShadow->setCompositionMode(QPainter::CompositionMode_DestinationIn);
+ }
+
+ if (m_common->state.fillPattern) {
+ AffineTransform affine;
+ FloatRect rectM(rect);
+ QBrush brush(m_common->state.fillPattern->createPlatformPattern(affine));
+ QPixmap* image = m_common->state.fillPattern->tileImage()->nativeImageForCurrentFrame();
+
+ if (hasShadow) {
+ drawRepeatPattern(pShadow, image, FloatRect(static_cast<QRectF>(shadowImage->rect())), m_common->state.fillPattern->repeatX(), m_common->state.fillPattern->repeatY());
+ pShadow->end();
+ p->drawImage(shadowDestRect, *shadowImage, shadowImage->rect());
+ }
+ drawRepeatPattern(p, image, normalizedRect, m_common->state.fillPattern->repeatX(), m_common->state.fillPattern->repeatY());
+ } else if (m_common->state.fillGradient) {
+ QBrush brush(*m_common->state.fillGradient->platformGradient());
+ brush.setTransform(m_common->state.fillGradient->gradientSpaceTransform());
+
+ if (hasShadow) {
+ pShadow->fillRect(shadowImage->rect(), brush);
+ pShadow->end();
+ p->drawImage(shadowDestRect, *shadowImage, shadowImage->rect());
}
+ p->fillRect(normalizedRect, brush);
+ } else {
+ if (hasShadow) {
+ pShadow->fillRect(shadowImage->rect(), p->brush());
+ pShadow->end();
+ p->drawImage(shadowDestRect, *shadowImage, shadowImage->rect());
+ }
+ p->fillRect(normalizedRect, p->brush());
}
+
+ delete shadowImage;
+ delete pShadow;
}
+
void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace colorSpace)
{
if (paintingDisabled() || !color.isValid())
@@ -749,7 +777,7 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorS
void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color& color, ColorSpace colorSpace)
{
- if (paintingDisabled() || !color.isValid() || !color.alpha())
+ if (paintingDisabled() || !color.isValid())
return;
Path path = Path::createRoundedRectangle(rect, topLeft, topRight, bottomLeft, bottomRight);
@@ -1015,7 +1043,8 @@ void GraphicsContext::setLineDash(const DashArray& dashes, float dashOffset)
pen.setDashPattern(pattern);
pen.setDashOffset(dashOffset);
- }
+ } else
+ pen.setStyle(Qt::SolidLine);
p->setPen(pen);
}
diff --git a/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index a546def..b4ca617 100644
--- a/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -98,6 +98,14 @@ GraphicsContext* ImageBuffer::context() const
return m_context.get();
}
+Image* ImageBuffer::imageForRendering() const
+{
+ if (!m_image)
+ m_image = StillImage::createForRendering(&m_data.m_pixmap);
+
+ return m_image.get();
+}
+
Image* ImageBuffer::image() const
{
if (!m_image) {
@@ -178,8 +186,13 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const ImageBufferData& i
unsigned destBytesPerRow = 4 * rect.width();
unsigned char* destRows = data + desty * destBytesPerRow + destx * 4;
for (int y = 0; y < numRows; ++y) {
+#if QT_VERSION >= 0x040700
+ const quint32* scanLine = reinterpret_cast<const quint32*>(image.constScanLine(y + originy));
+#else
+ quint32* scanLine = reinterpret_cast<quint32*>(image.scanLine(y + originy));
+#endif
for (int x = 0; x < numColumns; x++) {
- QRgb value = image.pixel(x + originx, y + originy);
+ QRgb value = scanLine[x + originx];
int basex = x * 4;
destRows[basex] = qRed(value);
diff --git a/WebCore/platform/graphics/qt/ImageQt.cpp b/WebCore/platform/graphics/qt/ImageQt.cpp
index dd97873..e0ac574 100644
--- a/WebCore/platform/graphics/qt/ImageQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageQt.cpp
@@ -180,8 +180,6 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst,
return;
}
- IntSize selfSize = size();
-
QPainter* painter(ctxt->platformContext());
QPainter::CompositionMode compositionMode = GraphicsContext::toQtCompositionMode(op);
@@ -204,7 +202,7 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst,
p.setCompositionMode(QPainter::CompositionMode_Source);
p.fillRect(shadowImage.rect(), shadowColor);
p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
- p.drawPixmap(normalizedDst, *image, normalizedSrc);
+ p.drawPixmap(QRect(0, 0, normalizedDst.width(), normalizedDst.height()), *image, normalizedSrc);
p.end();
painter->drawImage(shadowImageRect, shadowImage, normalizedSrc);
}
diff --git a/WebCore/platform/graphics/qt/PathQt.cpp b/WebCore/platform/graphics/qt/PathQt.cpp
index a367212..a8adb31 100644
--- a/WebCore/platform/graphics/qt/PathQt.cpp
+++ b/WebCore/platform/graphics/qt/PathQt.cpp
@@ -121,15 +121,18 @@ bool Path::contains(const FloatPoint& point, WindRule rule) const
return contains;
}
+static GraphicsContext* scratchContext()
+{
+ static ImageBuffer* scratch = ImageBuffer::create(IntSize(1, 1)).leakPtr();
+ return scratch->context();
+}
+
bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point) const
{
ASSERT(applier);
- // FIXME: We should try to use a 'shared Context' instead of creating a new ImageBuffer
- // on each call.
- OwnPtr<ImageBuffer> scratchImage = ImageBuffer::create(IntSize(1, 1));
- GraphicsContext* gc = scratchImage->context();
QPainterPathStroker stroke;
+ GraphicsContext* gc = scratchContext();
applier->strokeStyle(gc);
QPen pen = gc->pen();
@@ -157,10 +160,7 @@ FloatRect Path::boundingRect() const
FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
{
- // FIXME: We should try to use a 'shared Context' instead of creating a new ImageBuffer
- // on each call.
- OwnPtr<ImageBuffer> scratchImage = ImageBuffer::create(IntSize(1, 1));
- GraphicsContext* gc = scratchImage->context();
+ GraphicsContext* gc = scratchContext();
QPainterPathStroker stroke;
if (applier) {
applier->strokeStyle(gc);
@@ -198,22 +198,8 @@ void Path::addBezierCurveTo(const FloatPoint& cp1, const FloatPoint& cp2, const
void Path::addArcTo(const FloatPoint& p1, const FloatPoint& p2, float radius)
{
- // Make sure there is a subpath for p1, the behavior depend on the last element of the subpath.
- // When the user agent is to ensure there is a subpath for a coordinate (x, y), the user agent must
- // check to see if the context has any subpaths, and if it does not, then the user agent must create
- // a new subpath with the point (x, y) as its first (and only) point, as if the moveTo() method had been called.
- if (!m_path.elementCount()) {
- m_path.moveTo(p1);
- return;
- }
-
FloatPoint p0(m_path.currentPosition());
- if ((p1.x() == p0.x() && p1.y() == p0.y()) || (p1.x() == p2.x() && p1.y() == p2.y()) || radius == 0.f) {
- m_path.lineTo(p1);
- return;
- }
-
FloatPoint p1p0((p0.x() - p1.x()), (p0.y() - p1.y()));
FloatPoint p1p2((p2.x() - p1.x()), (p2.y() - p1.y()));
float p1p0_length = sqrtf(p1p0.x() * p1p0.x() + p1p0.y() * p1p0.y());
@@ -362,6 +348,11 @@ bool Path::hasCurrentPoint() const
return !isEmpty();
}
+FloatPoint Path::currentPoint() const
+{
+ return m_path.currentPosition();
+}
+
String Path::debugString() const
{
QString ret;
diff --git a/WebCore/platform/graphics/qt/StillImageQt.cpp b/WebCore/platform/graphics/qt/StillImageQt.cpp
index 4653c58..9c6acab 100644
--- a/WebCore/platform/graphics/qt/StillImageQt.cpp
+++ b/WebCore/platform/graphics/qt/StillImageQt.cpp
@@ -36,65 +36,65 @@
namespace WebCore {
StillImage::StillImage(const QPixmap& pixmap)
+ : m_pixmap(new QPixmap(pixmap))
+ , m_ownsPixmap(true)
+{}
+
+StillImage::StillImage(const QPixmap* pixmap)
: m_pixmap(pixmap)
+ , m_ownsPixmap(false)
{}
+StillImage::~StillImage()
+{
+ if (m_ownsPixmap)
+ delete m_pixmap;
+}
+
IntSize StillImage::size() const
{
- return IntSize(m_pixmap.width(), m_pixmap.height());
+ return IntSize(m_pixmap->width(), m_pixmap->height());
}
NativeImagePtr StillImage::nativeImageForCurrentFrame()
{
- return const_cast<NativeImagePtr>(&m_pixmap);
+ return const_cast<NativeImagePtr>(m_pixmap);
}
void StillImage::draw(GraphicsContext* ctxt, const FloatRect& dst,
const FloatRect& src, ColorSpace, CompositeOperator op)
{
- if (m_pixmap.isNull())
+ if (m_pixmap->isNull())
return;
- ctxt->save();
- ctxt->setCompositeOperation(op);
- // To support width or height is negative
- float sx = src.x();
- float sy = src.y();
- float sw = src.width();
- float sh = src.height();
+ FloatRect normalizedSrc = src.normalized();
+ FloatRect normalizedDst = dst.normalized();
- if (sw < 0) {
- sx = sx + sw;
- sw = -sw;
- }
+ QPainter* painter = ctxt->platformContext();
+ QPainter::CompositionMode oldCompositionMode = painter->compositionMode();
- if (sh < 0) {
- sy = sy + sh;
- sh = -sh;
- }
-
- float dx = dst.x();
- float dy = dst.y();
- float dw = dst.width();
- float dh = dst.height();
-
- if (dw < 0) {
- dx = dx + dw;
- dw = -dw;
- }
+ ctxt->setCompositeOperation(op);
- if (dh < 0) {
- dy = dy + dh;
- dh = -dh;
+ FloatSize shadowSize;
+ float shadowBlur;
+ Color shadowColor;
+ if (ctxt->getShadow(shadowSize, shadowBlur, shadowColor)) {
+ FloatRect shadowImageRect(normalizedDst);
+ shadowImageRect.move(shadowSize.width(), shadowSize.height());
+
+ QImage shadowImage(QSize(static_cast<int>(normalizedSrc.width()), static_cast<int>(normalizedSrc.height())), QImage::Format_ARGB32_Premultiplied);
+ QPainter p(&shadowImage);
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ p.fillRect(shadowImage.rect(), shadowColor);
+ p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
+ p.drawPixmap(QRect(0, 0, normalizedDst.width(), normalizedDst.height()), *m_pixmap, normalizedSrc);
+ p.end();
+ painter->drawImage(shadowImageRect, shadowImage, normalizedSrc);
}
- FloatRect srcM(sx, sy, sw, sh);
- FloatRect dstM(dx, dy, dw, dh);
- QPainter* painter(ctxt->platformContext());
-
- painter->drawPixmap(dstM, m_pixmap, srcM);
- ctxt->restore();
+ painter->drawPixmap(normalizedDst, *m_pixmap, normalizedSrc);
+ painter->setCompositionMode(oldCompositionMode);
}
}
diff --git a/WebCore/platform/graphics/qt/StillImageQt.h b/WebCore/platform/graphics/qt/StillImageQt.h
index 7be9136..58071d9 100644
--- a/WebCore/platform/graphics/qt/StillImageQt.h
+++ b/WebCore/platform/graphics/qt/StillImageQt.h
@@ -39,6 +39,11 @@ namespace WebCore {
return adoptRef(new StillImage(pixmap));
}
+ static PassRefPtr<StillImage> createForRendering(const QPixmap* pixmap)
+ {
+ return adoptRef(new StillImage(pixmap));
+ }
+
// FIXME: StillImages are underreporting decoded sizes and will be unable
// to prune because these functions are not implemented yet.
virtual void destroyDecodedData(bool destroyAll = true) { Q_UNUSED(destroyAll); }
@@ -50,8 +55,11 @@ namespace WebCore {
private:
StillImage(const QPixmap& pixmap);
+ StillImage(const QPixmap* pixmap);
+ ~StillImage();
- QPixmap m_pixmap;
+ const QPixmap* m_pixmap;
+ bool m_ownsPixmap;
};
}
diff --git a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index 912fd12..f8192fe 100644
--- a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -74,7 +74,10 @@ ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, b
// Make the background transparent. It would be nice if this wasn't
// required, but the canvas is currently filled with the magic transparency
// color. Can we have another way to manage this?
- m_data.m_canvas.drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode);
+ //
+ // Avoid drawing on a zero-sized canvas. Skia can't handle it.
+ if (!size.isZero())
+ m_data.m_canvas.drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode);
success = true;
}
diff --git a/WebCore/platform/graphics/skia/PathSkia.cpp b/WebCore/platform/graphics/skia/PathSkia.cpp
index a0d4c79..12241f8 100644
--- a/WebCore/platform/graphics/skia/PathSkia.cpp
+++ b/WebCore/platform/graphics/skia/PathSkia.cpp
@@ -74,6 +74,13 @@ bool Path::hasCurrentPoint() const
return m_path->getPoints(NULL, 0) != 0;
}
+FloatPoint Path::currentPoint() const
+{
+ // FIXME: return current point of subpath.
+ float quietNaN = std::numeric_limits<float>::quiet_NaN();
+ return FloatPoint(quietNaN, quietNaN);
+}
+
bool Path::contains(const FloatPoint& point, WindRule rule) const
{
return SkPathContainsPoint(m_path, point,
diff --git a/WebCore/platform/graphics/skia/SkiaUtils.cpp b/WebCore/platform/graphics/skia/SkiaUtils.cpp
index 0c6b2d6..b16a344 100644
--- a/WebCore/platform/graphics/skia/SkiaUtils.cpp
+++ b/WebCore/platform/graphics/skia/SkiaUtils.cpp
@@ -129,10 +129,18 @@ static U8CPU InvScaleByte(U8CPU component, uint32_t scale)
SkColor SkPMColorToColor(SkPMColor pm)
{
- if (0 == pm)
+ if (!pm)
return 0;
-
unsigned a = SkGetPackedA32(pm);
+ if (!a) {
+ // A zero alpha value when there are non-zero R, G, or B channels is an
+ // invalid premultiplied color (since all channels should have been
+ // multiplied by 0 if a=0).
+ SkASSERT(false);
+ // In production, return 0 to protect against division by zero.
+ return 0;
+ }
+
uint32_t scale = (255 << 16) / a;
return SkColorSetARGB(a,
diff --git a/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp b/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
index 20d76ef..96ac0c1 100644
--- a/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
+++ b/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
@@ -669,7 +669,7 @@ void GraphicsLayerCACF::updateLayerDrawsContent()
if (m_drawsContent)
m_layer->setNeedsDisplay();
else
- m_layer->setContents(nil);
+ m_layer->setContents(0);
updateDebugIndicators();
}
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
index aa7bdd4..e0ecf78 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
@@ -46,6 +46,7 @@
#include "StringHash.h"
#include "TimeRanges.h"
#include "Timer.h"
+#include <AssertMacros.h>
#include <CoreGraphics/CGContext.h>
#include <Wininet.h>
#include <wtf/CurrentTime.h>
diff --git a/WebCore/platform/graphics/wince/PathWince.cpp b/WebCore/platform/graphics/wince/PathWince.cpp
index 00d03b1..747e650 100644
--- a/WebCore/platform/graphics/wince/PathWince.cpp
+++ b/WebCore/platform/graphics/wince/PathWince.cpp
@@ -160,4 +160,11 @@ bool Path::hasCurrentPoint() const
return !isEmpty();
}
+FloatPoint Path::currentPoint() const
+{
+ // FIXME: return current point of subpath.
+ float quietNaN = std::numeric_limits<float>::quiet_NaN();
+ return FloatPoint(quietNaN, quietNaN);
+}
+
}
diff --git a/WebCore/platform/graphics/wx/PathWx.cpp b/WebCore/platform/graphics/wx/PathWx.cpp
index 2305be0..3006e27 100644
--- a/WebCore/platform/graphics/wx/PathWx.cpp
+++ b/WebCore/platform/graphics/wx/PathWx.cpp
@@ -245,4 +245,11 @@ bool Path::hasCurrentPoint() const
return !isEmpty();
}
+FloatPoint Path::currentPoint() const
+{
+ // FIXME: return current point of subpath.
+ float quietNaN = std::numeric_limits<float>::quiet_NaN();
+ return FloatPoint(quietNaN, quietNaN);
+}
+
}
diff --git a/WebCore/platform/gtk/CursorGtk.cpp b/WebCore/platform/gtk/CursorGtk.cpp
index 017e486..a535f0c 100644
--- a/WebCore/platform/gtk/CursorGtk.cpp
+++ b/WebCore/platform/gtk/CursorGtk.cpp
@@ -57,38 +57,38 @@ static GdkCursor* customCursorNew(CustomCursorType cursorType)
Cursor::Cursor(const Cursor& other)
- : m_impl(other.m_impl)
+ : m_platformCursor(other.m_platformCursor)
{
- if (m_impl)
- gdk_cursor_ref(m_impl);
+ if (m_platformCursor)
+ gdk_cursor_ref(m_platformCursor);
}
Cursor::Cursor(Image* image, const IntPoint& hotSpot)
{
IntPoint effectiveHotSpot = determineHotSpot(image, hotSpot);
GdkPixbuf* pixbuf = image->getGdkPixbuf();
- m_impl = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf, effectiveHotSpot.x(), effectiveHotSpot.y());
+ m_platformCursor = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf, effectiveHotSpot.x(), effectiveHotSpot.y());
g_object_unref(pixbuf);
}
Cursor::~Cursor()
{
- if (m_impl)
- gdk_cursor_unref(m_impl);
+ if (m_platformCursor)
+ gdk_cursor_unref(m_platformCursor);
}
Cursor& Cursor::operator=(const Cursor& other)
{
- gdk_cursor_ref(other.m_impl);
- gdk_cursor_unref(m_impl);
- m_impl = other.m_impl;
+ gdk_cursor_ref(other.m_platformCursor);
+ gdk_cursor_unref(m_platformCursor);
+ m_platformCursor = other.m_platformCursor;
return *this;
}
Cursor::Cursor(GdkCursor* c)
- : m_impl(c)
+ : m_platformCursor(c)
{
- m_impl = c;
+ m_platformCursor = c;
// The GdkCursor may be NULL - the default cursor for the window.
if (c)
diff --git a/WebCore/platform/gtk/FileSystemGtk.cpp b/WebCore/platform/gtk/FileSystemGtk.cpp
index 401bd4a..7ad2a39 100644
--- a/WebCore/platform/gtk/FileSystemGtk.cpp
+++ b/WebCore/platform/gtk/FileSystemGtk.cpp
@@ -24,12 +24,13 @@
#include "GOwnPtr.h"
#include "PlatformString.h"
-#include <wtf/text/CString.h>
+#include <errno.h>
+#include <fcntl.h>
#include <glib.h>
#include <glib/gstdio.h>
-
#include <unistd.h>
+#include <wtf/text/CString.h>
namespace WebCore {
@@ -233,6 +234,22 @@ CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
return tempFilePath;
}
+PlatformFileHandle openFile(const String& path, FileOpenMode mode)
+{
+ CString fsRep = fileSystemRepresentation(path);
+
+ if (fsRep.isNull())
+ return invalidPlatformFileHandle;
+
+ int platformFlag = 0;
+ if (mode == OpenForRead)
+ platformFlag |= O_RDONLY;
+ else if (mode == OpenForWrite)
+ platformFlag |= (O_WRONLY | O_CREAT | O_TRUNC);
+
+ return g_open(fsRep.data(), platformFlag, 0666);
+}
+
void closeFile(PlatformFileHandle& handle)
{
if (isHandleValid(handle)) {
@@ -255,6 +272,17 @@ int writeToFile(PlatformFileHandle handle, const char* data, int length)
return totalBytesWritten;
}
+int readFromFile(PlatformFileHandle handle, char* data, int length)
+{
+ do {
+ int bytesRead = read(handle, data, static_cast<size_t>(length));
+ if (bytesRead >= 0)
+ return bytesRead;
+ } while (errno == EINTR);
+
+ return -1;
+}
+
bool unloadModule(PlatformModule module)
{
return g_module_close(module);
diff --git a/WebCore/platform/gtk/PasteboardHelper.cpp b/WebCore/platform/gtk/PasteboardHelper.cpp
index 111fb4e..2babe91 100644
--- a/WebCore/platform/gtk/PasteboardHelper.cpp
+++ b/WebCore/platform/gtk/PasteboardHelper.cpp
@@ -296,6 +296,7 @@ void PasteboardHelper::writeClipboardContents(GtkClipboard* clipboard, GClosure*
gtk_clipboard_set_with_data(clipboard, table, numberOfTargets,
getClipboardContentsCallback, clearClipboardContentsCallback, callback);
+ gtk_clipboard_set_can_store(clipboard, 0, 0);
settingClipboardDataObject = 0;
diff --git a/WebCore/platform/gtk/RenderThemeGtk.cpp b/WebCore/platform/gtk/RenderThemeGtk.cpp
index b70773e..bc0d147 100644
--- a/WebCore/platform/gtk/RenderThemeGtk.cpp
+++ b/WebCore/platform/gtk/RenderThemeGtk.cpp
@@ -762,11 +762,12 @@ bool RenderThemeGtk::paintMediaMuteButton(RenderObject* o, const PaintInfo& pain
bool RenderThemeGtk::paintMediaPlayButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
- HTMLMediaElement* mediaElement = getMediaElementFromRenderObject(o);
- if (!mediaElement)
+ Node* node = o->node();
+ if (!node)
return false;
- return paintMediaButton(paintInfo.context, r, mediaElement->canPlay() ? m_playButton.get() : m_pauseButton.get(), m_panelColor, m_mediaIconSize);
+ MediaControlPlayButtonElement* button = static_cast<MediaControlPlayButtonElement*>(node);
+ return paintMediaButton(paintInfo.context, r, button->displayType() == MediaPlayButton ? m_playButton.get() : m_pauseButton.get(), m_panelColor, m_mediaIconSize);
}
bool RenderThemeGtk::paintMediaSeekBackButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
diff --git a/WebCore/platform/haiku/CursorHaiku.cpp b/WebCore/platform/haiku/CursorHaiku.cpp
index 21d678a..58833bc 100644
--- a/WebCore/platform/haiku/CursorHaiku.cpp
+++ b/WebCore/platform/haiku/CursorHaiku.cpp
@@ -34,31 +34,31 @@
namespace WebCore {
Cursor::Cursor(PlatformCursor cursor)
- : m_impl(cursor)
+ : m_platformCursor(cursor)
{
}
Cursor::Cursor(const Cursor& other)
- : m_impl(0)
+ : m_platformCursor(0)
{
*this = other;
}
Cursor::~Cursor()
{
- delete m_impl;
+ delete m_platformCursor;
}
Cursor::Cursor(Image*, const IntPoint&)
- : m_impl(0)
+ : m_platformCursor(0)
{
notImplemented();
}
Cursor& Cursor::operator=(const Cursor& other)
{
- delete m_impl;
- m_impl = other.m_impl ? new BCursor(*other.m_impl) : 0;
+ delete m_platformCursor;
+ m_platformCursor = other.m_platformCursor ? new BCursor(*other.m_platformCursor) : 0;
return *this;
}
diff --git a/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp b/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp
index 19363c8..a2e8760 100644
--- a/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp
+++ b/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp
@@ -36,6 +36,7 @@
#include "Vector.h"
#include "SkBitmap.h"
+#include "SkUnPreMultiply.h"
extern "C" {
#include "png.h"
@@ -57,6 +58,25 @@ static void convertBetweenBGRAandRGBA(const unsigned char* input, int numberOfPi
}
}
+// Converts BGRA->RGBA and RGBA->BGRA and undoes alpha premultiplication.
+static void preMultipliedBGRAtoRGBA(const unsigned char* input, int numberOfPixels,
+ unsigned char* output)
+{
+ SkBitmap inputBitmap;
+ inputBitmap.setConfig(SkBitmap::kARGB_8888_Config, numberOfPixels, 1);
+ inputBitmap.setPixels(const_cast<unsigned char*>(input));
+ for (int x = 0; x < numberOfPixels; x++) {
+ uint32_t srcPixel = *inputBitmap.getAddr32(x, 0);
+ SkColor unmultiplied = SkUnPreMultiply::PMColorToColor(srcPixel);
+ unsigned char* pixelOut = &output[x * 4];
+ pixelOut[0] = SkColorGetR(unmultiplied);
+ pixelOut[1] = SkColorGetG(unmultiplied);
+ pixelOut[2] = SkColorGetB(unmultiplied);
+ pixelOut[3] = SkColorGetA(unmultiplied);
+ }
+}
+
+
// Encoder --------------------------------------------------------------------
//
// This section of the code is based on nsPNGEncoder.cpp in Mozilla
@@ -98,24 +118,12 @@ private:
png_info** m_pngInfo;
};
-// static
-bool PNGImageEncoder::encode(const SkBitmap& image, Vector<unsigned char>* output)
-{
- if (image.config() != SkBitmap::kARGB_8888_Config)
- return false; // Only support ARGB at 8 bpp now.
-
- image.lockPixels();
- bool result = PNGImageEncoder::encode(static_cast<unsigned char*>(
- image.getPixels()), IntSize(image.width(), image.height()),
- image.rowBytes(), output);
- image.unlockPixels();
- return result;
-}
-
-// static
-bool PNGImageEncoder::encode(const unsigned char* input, const IntSize& size,
- int bytesPerRow,
- Vector<unsigned char>* output)
+static bool encodeImpl(const unsigned char* input,
+ const IntSize& size,
+ int bytesPerRow,
+ Vector<unsigned char>* output,
+ void (*conversionFunc)(const unsigned char*, int, unsigned char*)
+ )
{
int inputColorComponents = 4;
int outputColorComponents = 4;
@@ -158,7 +166,7 @@ bool PNGImageEncoder::encode(const unsigned char* input, const IntSize& size,
OwnArrayPtr<unsigned char> rowPixels(new unsigned char[imageSize.width() * outputColorComponents]);
for (int y = 0; y < imageSize.height(); y ++) {
- convertBetweenBGRAandRGBA(&input[y * bytesPerRow], imageSize.width(), rowPixels.get());
+ conversionFunc(&input[y * bytesPerRow], imageSize.width(), rowPixels.get());
png_write_row(pngPtr, rowPixels.get());
}
@@ -166,4 +174,27 @@ bool PNGImageEncoder::encode(const unsigned char* input, const IntSize& size,
return true;
}
+
+// static
+bool PNGImageEncoder::encode(const SkBitmap& image, Vector<unsigned char>* output)
+{
+ if (image.config() != SkBitmap::kARGB_8888_Config)
+ return false; // Only support ARGB at 8 bpp now.
+
+ image.lockPixels();
+ bool result = encodeImpl(static_cast<unsigned char*>(
+ image.getPixels()), IntSize(image.width(), image.height()),
+ image.rowBytes(), output, preMultipliedBGRAtoRGBA);
+ image.unlockPixels();
+ return result;
+}
+
+// static
+bool PNGImageEncoder::encode(const unsigned char* input, const IntSize& size,
+ int bytesPerRow,
+ Vector<unsigned char>* output)
+{
+ return encodeImpl(input, size, bytesPerRow, output, convertBetweenBGRAandRGBA);
+}
+
} // namespace WebCore
diff --git a/WebCore/platform/mac/CursorMac.mm b/WebCore/platform/mac/CursorMac.mm
index 8cd54a1..1b4c1b1 100644
--- a/WebCore/platform/mac/CursorMac.mm
+++ b/WebCore/platform/mac/CursorMac.mm
@@ -28,8 +28,6 @@
#import "BlockExceptions.h"
#import "FoundationExtras.h"
-#import "Image.h"
-#import "IntPoint.h"
#import <wtf/StdLibExtras.h>
@interface WebCoreCursorBundle : NSObject { }
@@ -50,7 +48,7 @@ static NSCursor* createCustomCursor(Image* image, const IntPoint& hotSpot)
if (!img)
return 0;
BEGIN_BLOCK_OBJC_EXCEPTIONS;
- return [[NSCursor alloc] initWithImage:img hotSpot:determineHotSpot(image, hotSpot)];
+ return [[NSCursor alloc] initWithImage:img hotSpot:hotSpot];
END_BLOCK_OBJC_EXCEPTIONS;
return 0;
}
@@ -76,281 +74,152 @@ static NSCursor* leakNamedCursor(const char* name, int x, int y)
return nil;
}
-Cursor::Cursor(Image* image, const IntPoint& hotSpot)
- : m_impl(HardRetainWithNSRelease(createCustomCursor(image, hotSpot)))
-{
+void Cursor::ensurePlatformCursor() const
+{
+ if (m_platformCursor)
+ return;
+
+ switch (m_type) {
+ case Cursor::Pointer:
+ m_platformCursor = HardRetain([NSCursor arrowCursor]);
+ break;
+ case Cursor::Cross:
+ m_platformCursor = HardRetain(leakNamedCursor("crossHairCursor", 11, 11));
+ break;
+ case Cursor::Hand:
+ m_platformCursor = HardRetain(leakNamedCursor("linkCursor", 6, 1));
+ break;
+ case Cursor::IBeam:
+ m_platformCursor = HardRetain([NSCursor IBeamCursor]);
+ break;
+ case Cursor::Wait:
+ m_platformCursor = HardRetain(leakNamedCursor("waitCursor", 7, 7));
+ break;
+ case Cursor::Help:
+ m_platformCursor = HardRetain(leakNamedCursor("helpCursor", 8, 8));
+ break;
+ case Cursor::Move:
+ case Cursor::MiddlePanning:
+ m_platformCursor = HardRetain(leakNamedCursor("moveCursor", 7, 7));
+ break;
+ case Cursor::EastResize:
+ case Cursor::EastPanning:
+ m_platformCursor = HardRetain(leakNamedCursor("eastResizeCursor", 14, 7));
+ break;
+ case Cursor::NorthResize:
+ case Cursor::NorthPanning:
+ m_platformCursor = HardRetain(leakNamedCursor("northResizeCursor", 7, 1));
+ break;
+ case Cursor::NorthEastResize:
+ case Cursor::NorthEastPanning:
+ m_platformCursor = HardRetain(leakNamedCursor("northEastResizeCursor", 14, 1));
+ break;
+ case Cursor::NorthWestResize:
+ case Cursor::NorthWestPanning:
+ m_platformCursor = HardRetain(leakNamedCursor("northWestResizeCursor", 0, 0));
+ break;
+ case Cursor::SouthResize:
+ case Cursor::SouthPanning:
+ m_platformCursor = HardRetain(leakNamedCursor("southResizeCursor", 7, 14));
+ break;
+ case Cursor::SouthEastResize:
+ case Cursor::SouthEastPanning:
+ m_platformCursor = HardRetain(leakNamedCursor("southEastResizeCursor", 14, 14));
+ break;
+ case Cursor::SouthWestResize:
+ case Cursor::SouthWestPanning:
+ m_platformCursor = HardRetain(leakNamedCursor("southWestResizeCursor", 1, 14));
+ break;
+ case Cursor::WestResize:
+ m_platformCursor = HardRetain(leakNamedCursor("westResizeCursor", 1, 7));
+ break;
+ case Cursor::NorthSouthResize:
+ m_platformCursor = HardRetain(leakNamedCursor("northSouthResizeCursor", 7, 7));
+ break;
+ case Cursor::EastWestResize:
+ case Cursor::WestPanning:
+ m_platformCursor = HardRetain(leakNamedCursor("eastWestResizeCursor", 7, 7));
+ break;
+ case Cursor::NorthEastSouthWestResize:
+ m_platformCursor = HardRetain(leakNamedCursor("northEastSouthWestResizeCursor", 7, 7));
+ break;
+ case Cursor::NorthWestSouthEastResize:
+ m_platformCursor = HardRetain(leakNamedCursor("northWestSouthEastResizeCursor", 7, 7));
+ break;
+ case Cursor::ColumnResize:
+ m_platformCursor = HardRetain([NSCursor resizeLeftRightCursor]);
+ break;
+ case Cursor::RowResize:
+ m_platformCursor = HardRetain([NSCursor resizeUpDownCursor]);
+ break;
+ case Cursor::VerticalText:
+ m_platformCursor = HardRetain(leakNamedCursor("verticalTextCursor", 7, 7));
+ break;
+ case Cursor::Cell:
+ m_platformCursor = HardRetain(leakNamedCursor("cellCursor", 7, 7));
+ break;
+ case Cursor::ContextMenu:
+ m_platformCursor = HardRetain(leakNamedCursor("contextMenuCursor", 3, 2));
+ break;
+ case Cursor::Alias:
+ m_platformCursor = HardRetain(leakNamedCursor("aliasCursor", 11, 3));
+ break;
+ case Cursor::Progress:
+ m_platformCursor = HardRetain(leakNamedCursor("progressCursor", 3, 2));
+ break;
+ case Cursor::NoDrop:
+ m_platformCursor = HardRetain(leakNamedCursor("noDropCursor", 3, 1));
+ break;
+ case Cursor::Copy:
+ m_platformCursor = HardRetain(leakNamedCursor("copyCursor", 3, 2));
+ break;
+ case Cursor::None:
+ m_platformCursor = HardRetain(leakNamedCursor("noneCursor", 7, 7));
+ break;
+ case Cursor::NotAllowed:
+ m_platformCursor = HardRetain(leakNamedCursor("notAllowedCursor", 11, 11));
+ break;
+ case Cursor::ZoomIn:
+ m_platformCursor = HardRetain(leakNamedCursor("zoomInCursor", 7, 7));
+ break;
+ case Cursor::ZoomOut:
+ m_platformCursor = HardRetain(leakNamedCursor("zoomOutCursor", 7, 7));
+ break;
+ case Cursor::Grab:
+ m_platformCursor = HardRetain([NSCursor openHandCursor]);
+ break;
+ case Cursor::Grabbing:
+ m_platformCursor = HardRetain([NSCursor closedHandCursor]);
+ break;
+ case Cursor::Custom:
+ m_platformCursor = HardRetainWithNSRelease(createCustomCursor(m_image.get(), m_hotSpot));
+ break;
+ }
}
Cursor::Cursor(const Cursor& other)
- : m_impl(HardRetain(other.m_impl))
+ : m_type(other.m_type)
+ , m_image(other.m_image)
+ , m_hotSpot(other.m_hotSpot)
+ , m_platformCursor(HardRetain(other.m_platformCursor))
{
}
-Cursor::~Cursor()
-{
- HardRelease(m_impl);
-}
-
Cursor& Cursor::operator=(const Cursor& other)
{
- HardRetain(other.m_impl);
- HardRelease(m_impl);
- m_impl = other.m_impl;
- return *this;
-}
-
-Cursor::Cursor(NSCursor* c)
- : m_impl(HardRetain(c))
-{
-}
-
-const Cursor& pointerCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, ([NSCursor arrowCursor]));
- return c;
-}
-
-const Cursor& crossCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("crossHairCursor", 11, 11)));
- return c;
-}
-
-const Cursor& handCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("linkCursor", 6, 1)));
- return c;
-}
-
-const Cursor& moveCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("moveCursor", 7, 7)));
- return c;
-}
-
-const Cursor& verticalTextCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("verticalTextCursor", 7, 7)));
- return c;
-}
-
-const Cursor& cellCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("cellCursor", 7, 7)));
- return c;
-}
-
-const Cursor& contextMenuCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("contextMenuCursor", 3, 2)));
- return c;
-}
-
-const Cursor& aliasCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("aliasCursor", 11, 3)));
- return c;
-}
-
-const Cursor& zoomInCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("zoomInCursor", 7, 7)));
- return c;
-}
-
-const Cursor& zoomOutCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("zoomOutCursor", 7, 7)));
- return c;
-}
-
-const Cursor& copyCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("copyCursor", 3, 2)));
- return c;
-}
-
-const Cursor& noneCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("noneCursor", 7, 7)));
- return c;
-}
-
-const Cursor& progressCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("progressCursor", 3, 2)));
- return c;
-}
-
-const Cursor& noDropCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("noDropCursor", 3, 1)));
- return c;
-}
-
-const Cursor& notAllowedCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("notAllowedCursor", 11, 11)));
- return c;
-}
-
-const Cursor& iBeamCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, ([NSCursor IBeamCursor]));
- return c;
-}
-
-const Cursor& waitCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("waitCursor", 7, 7)));
- return c;
-}
-
-const Cursor& helpCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("helpCursor", 8, 8)));
- return c;
-}
-
-const Cursor& eastResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("eastResizeCursor", 14, 7)));
- return c;
-}
-
-const Cursor& northResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("northResizeCursor", 7, 1)));
- return c;
-}
-
-const Cursor& northEastResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("northEastResizeCursor", 14, 1)));
- return c;
-}
-
-const Cursor& northWestResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("northWestResizeCursor", 0, 0)));
- return c;
-}
-
-const Cursor& southResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("southResizeCursor", 7, 14)));
- return c;
-}
-
-const Cursor& southEastResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("southEastResizeCursor", 14, 14)));
- return c;
-}
-
-const Cursor& southWestResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("southWestResizeCursor", 1, 14)));
- return c;
-}
-
-const Cursor& westResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("westResizeCursor", 1, 7)));
- return c;
-}
-
-const Cursor& northSouthResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("northSouthResizeCursor", 7, 7)));
- return c;
-}
-
-const Cursor& eastWestResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("eastWestResizeCursor", 7, 7)));
- return c;
-}
-
-const Cursor& northEastSouthWestResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("northEastSouthWestResizeCursor", 7, 7)));
- return c;
-}
+ m_type = other.m_type;
+ m_image = other.m_image;
+ m_hotSpot = other.m_hotSpot;
-const Cursor& northWestSouthEastResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, (leakNamedCursor("northWestSouthEastResizeCursor", 7, 7)));
- return c;
-}
-
-const Cursor& columnResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, ([NSCursor resizeLeftRightCursor]));
- return c;
-}
-
-const Cursor& rowResizeCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, ([NSCursor resizeUpDownCursor]));
- return c;
-}
-
-const Cursor& middlePanningCursor()
-{
- return moveCursor();
-}
-
-const Cursor& eastPanningCursor()
-{
- return eastResizeCursor();
-}
-
-const Cursor& northPanningCursor()
-{
- return northResizeCursor();
-}
-
-const Cursor& northEastPanningCursor()
-{
- return northEastResizeCursor();
-}
-
-const Cursor& northWestPanningCursor()
-{
- return northWestResizeCursor();
-}
-
-const Cursor& southPanningCursor()
-{
- return southResizeCursor();
-}
-
-const Cursor& southEastPanningCursor()
-{
- return southEastResizeCursor();
-}
-
-const Cursor& southWestPanningCursor()
-{
- return southWestResizeCursor();
-}
-
-const Cursor& westPanningCursor()
-{
- return westResizeCursor();
-}
-
-const Cursor& grabCursor()
-{
- DEFINE_STATIC_LOCAL(Cursor, c, ([NSCursor openHandCursor]));
- return c;
+ HardRetain(other.m_platformCursor);
+ HardRelease(m_platformCursor);
+ m_platformCursor = other.m_platformCursor;
+ return *this;
}
-const Cursor& grabbingCursor()
+Cursor::~Cursor()
{
- DEFINE_STATIC_LOCAL(Cursor, c, ([NSCursor closedHandCursor]));
- return c;
+ HardRelease(m_platformCursor);
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/mac/FileSystemMac.mm b/WebCore/platform/mac/FileSystemMac.mm
index 98f85bb..0df3c89 100644
--- a/WebCore/platform/mac/FileSystemMac.mm
+++ b/WebCore/platform/mac/FileSystemMac.mm
@@ -29,6 +29,7 @@
#import "FileSystem.h"
#import "PlatformString.h"
+#import <wtf/text/CString.h>
namespace WebCore {
@@ -37,4 +38,28 @@ String homeDirectoryPath()
return NSHomeDirectory();
}
+CString openTemporaryFile(const char* prefix, PlatformFileHandle& platformFileHandle)
+{
+ platformFileHandle = invalidPlatformFileHandle;
+
+ Vector<char> temporaryFilePath(PATH_MAX);
+ if (!confstr(_CS_DARWIN_USER_TEMP_DIR, temporaryFilePath.data(), temporaryFilePath.size()))
+ return CString();
+
+ // Shrink the vector.
+ temporaryFilePath.shrink(strlen(temporaryFilePath.data()));
+ ASSERT(temporaryFilePath.last() == '/');
+
+ // Append the file name.
+ temporaryFilePath.append(prefix, strlen(prefix));
+ temporaryFilePath.append("XXXXXX", 6);
+ temporaryFilePath.append('\0');
+
+ platformFileHandle = mkstemp(temporaryFilePath.data());
+ if (platformFileHandle == invalidPlatformFileHandle)
+ return CString();
+
+ return CString(temporaryFilePath.data());
+}
+
} // namespace WebCore
diff --git a/WebCore/platform/mac/ThemeMac.mm b/WebCore/platform/mac/ThemeMac.mm
index 20b662f..c57e8df 100644
--- a/WebCore/platform/mac/ThemeMac.mm
+++ b/WebCore/platform/mac/ThemeMac.mm
@@ -687,7 +687,7 @@ void ThemeMac::inflateControlPaintRect(ControlPart part, ControlStates states, I
break;
}
case OuterSpinButtonPart: {
- static const int stepperMargin[4] = { 0, 0, 0, 0};
+ static const int stepperMargin[4] = { 0, 0, 0, 0 };
ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);
IntSize zoomedSize = stepperSizes()[controlSize];
zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
diff --git a/WebCore/platform/mac/WidgetMac.mm b/WebCore/platform/mac/WidgetMac.mm
index 37c9e9f..2598591 100644
--- a/WebCore/platform/mac/WidgetMac.mm
+++ b/WebCore/platform/mac/WidgetMac.mm
@@ -123,11 +123,12 @@ void Widget::setFocus(bool focused)
END_BLOCK_OBJC_EXCEPTIONS;
}
- void Widget::setCursor(const Cursor& cursor)
- {
- if ([NSCursor currentCursor] == cursor.impl())
+void Widget::setCursor(const Cursor& cursor)
+{
+ ScrollView* view = root();
+ if (!view)
return;
- [cursor.impl() set];
+ view->hostWindow()->setCursor(cursor);
}
void Widget::show()
diff --git a/WebCore/platform/network/Credential.cpp b/WebCore/platform/network/Credential.cpp
index 87cd7ff..4b24403 100644
--- a/WebCore/platform/network/Credential.cpp
+++ b/WebCore/platform/network/Credential.cpp
@@ -114,7 +114,7 @@ CFArrayRef Credential::certificates() const
return m_certificates.get();
}
-const CredentialType Credential::type() const
+CredentialType Credential::type() const
{
return m_type;
}
diff --git a/WebCore/platform/network/Credential.h b/WebCore/platform/network/Credential.h
index 199817c..4fb8bfd 100644
--- a/WebCore/platform/network/Credential.h
+++ b/WebCore/platform/network/Credential.h
@@ -69,7 +69,7 @@ public:
#if CERTIFICATE_CREDENTIALS_SUPPORTED
SecIdentityRef identity() const;
CFArrayRef certificates() const;
- const CredentialType type() const;
+ CredentialType type() const;
#endif
private:
diff --git a/WebCore/platform/network/CredentialStorage.cpp b/WebCore/platform/network/CredentialStorage.cpp
index a48af77..14f4086 100644
--- a/WebCore/platform/network/CredentialStorage.cpp
+++ b/WebCore/platform/network/CredentialStorage.cpp
@@ -106,6 +106,11 @@ Credential CredentialStorage::get(const ProtectionSpace& protectionSpace)
return protectionSpaceToCredentialMap().get(protectionSpace);
}
+void CredentialStorage::remove(const ProtectionSpace& protectionSpace)
+{
+ protectionSpaceToCredentialMap().remove(protectionSpace);
+}
+
static PathToDefaultProtectionSpaceMap::iterator findDefaultProtectionSpaceForURL(const KURL& url)
{
ASSERT(url.protocolInHTTPFamily());
diff --git a/WebCore/platform/network/CredentialStorage.h b/WebCore/platform/network/CredentialStorage.h
index ff7b5ee..d11384d 100644
--- a/WebCore/platform/network/CredentialStorage.h
+++ b/WebCore/platform/network/CredentialStorage.h
@@ -37,6 +37,7 @@ public:
// WebCore session credential storage.
static void set(const Credential&, const ProtectionSpace&, const KURL&);
static Credential get(const ProtectionSpace&);
+ static void remove(const ProtectionSpace&);
// OS persistent storage.
static Credential getFromPersistentStorage(const ProtectionSpace&);
diff --git a/WebCore/platform/network/FormData.cpp b/WebCore/platform/network/FormData.cpp
index 9e4a227..80f17da 100644
--- a/WebCore/platform/network/FormData.cpp
+++ b/WebCore/platform/network/FormData.cpp
@@ -224,7 +224,12 @@ void FormData::appendKeyValuePairItems(const BlobItemList& items, const TextEnco
const FileBlobItem* fileItem = value->toFileBlobItem();
if (fileItem) {
const String& path = fileItem->path();
+
+#if ENABLE(DIRECTORY_UPLOAD)
+ String fileName = !fileItem->relativePath().isEmpty() ? fileItem->relativePath() : fileItem->name();
+#else
String fileName = fileItem->name();
+#endif
// Let the application specify a filename if it's going to generate a replacement file for the upload.
if (!path.isEmpty()) {
diff --git a/WebCore/platform/network/ResourceHandle.cpp b/WebCore/platform/network/ResourceHandle.cpp
index d3ee3f2..0575523 100644
--- a/WebCore/platform/network/ResourceHandle.cpp
+++ b/WebCore/platform/network/ResourceHandle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -37,30 +37,28 @@ namespace WebCore {
static bool shouldForceContentSniffing;
-ResourceHandle::ResourceHandle(const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading,
- bool shouldContentSniff)
- : d(new ResourceHandleInternal(this, request, client, defersLoading, shouldContentSniff))
+ResourceHandle::ResourceHandle(const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff)
+ : d(new ResourceHandleInternal(this, request, client, defersLoading, shouldContentSniff && shouldContentSniffURL(request.url())))
{
+ if (!request.url().isValid()) {
+ scheduleFailure(InvalidURLFailure);
+ return;
+ }
+
+ if (!portAllowed(request.url())) {
+ scheduleFailure(BlockedFailure);
+ return;
+ }
}
PassRefPtr<ResourceHandle> ResourceHandle::create(const ResourceRequest& request, ResourceHandleClient* client,
Frame* frame, bool defersLoading, bool shouldContentSniff)
{
- if (shouldContentSniff)
- shouldContentSniff = shouldContentSniffURL(request.url());
-
RefPtr<ResourceHandle> newHandle(adoptRef(new ResourceHandle(request, client, defersLoading, shouldContentSniff)));
- if (!request.url().isValid()) {
- newHandle->scheduleFailure(InvalidURLFailure);
+ if (newHandle->d->m_scheduledFailureType != NoFailure)
return newHandle.release();
- }
- if (!portAllowed(request.url())) {
- newHandle->scheduleFailure(BlockedFailure);
- return newHandle.release();
- }
-
if (newHandle->start(frame))
return newHandle.release();
@@ -105,9 +103,9 @@ void ResourceHandle::setClient(ResourceHandleClient* client)
d->m_client = client;
}
-const ResourceRequest& ResourceHandle::request() const
+ResourceRequest& ResourceHandle::firstRequest()
{
- return d->m_request;
+ return d->m_firstRequest;
}
const String& ResourceHandle::lastHTTPMethod() const
@@ -115,6 +113,11 @@ const String& ResourceHandle::lastHTTPMethod() const
return d->m_lastHTTPMethod;
}
+bool ResourceHandle::hasAuthenticationChallenge() const
+{
+ return !d->m_currentWebChallenge.isNull();
+}
+
void ResourceHandle::clearAuthentication()
{
#if PLATFORM(MAC)
diff --git a/WebCore/platform/network/ResourceHandle.h b/WebCore/platform/network/ResourceHandle.h
index e1c889a..867e974 100644
--- a/WebCore/platform/network/ResourceHandle.h
+++ b/WebCore/platform/network/ResourceHandle.h
@@ -110,8 +110,8 @@ private:
public:
// FIXME: should not need the Frame
static PassRefPtr<ResourceHandle> create(const ResourceRequest&, ResourceHandleClient*, Frame*, bool defersLoading, bool shouldContentSniff);
-
static void loadResourceSynchronously(const ResourceRequest&, StoredCredentials, ResourceError&, ResourceResponse&, Vector<char>& data, Frame* frame);
+
static void prepareForURL(const KURL&);
static bool willLoadFromCache(ResourceRequest&, Frame*);
static void cacheMetadata(const ResourceResponse&, const Vector<char>&);
@@ -187,7 +187,8 @@ public:
// Used to work around the fact that you don't get any more NSURLConnection callbacks until you return from the one you're in.
static bool loadsBlocked();
-
+
+ bool hasAuthenticationChallenge() const;
void clearAuthentication();
void cancel();
@@ -196,12 +197,17 @@ public:
void setClient(ResourceHandleClient*);
void setDefersLoading(bool);
+<<<<<<< HEAD:WebCore/platform/network/ResourceHandle.h
#if PLATFORM(ANDROID)
// TODO: this needs upstreaming.
void pauseLoad(bool);
#endif
const ResourceRequest& request() const;
+=======
+
+ ResourceRequest& firstRequest();
+>>>>>>> webkit.org at r63859:WebCore/platform/network/ResourceHandle.h
const String& lastHTTPMethod() const;
void fireFailure(Timer<ResourceHandle>*);
@@ -219,6 +225,12 @@ private:
virtual void refAuthenticationClient() { ref(); }
virtual void derefAuthenticationClient() { deref(); }
+#if PLATFORM(MAC)
+ void createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff);
+#elif PLATFORM(CF)
+ void createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff);
+#endif
+
friend class ResourceHandleInternal;
OwnPtr<ResourceHandleInternal> d;
};
diff --git a/WebCore/platform/network/ResourceHandleInternal.h b/WebCore/platform/network/ResourceHandleInternal.h
index 92b24cb..7b6e960 100644
--- a/WebCore/platform/network/ResourceHandleInternal.h
+++ b/WebCore/platform/network/ResourceHandleInternal.h
@@ -83,7 +83,7 @@ namespace WebCore {
public:
ResourceHandleInternal(ResourceHandle* loader, const ResourceRequest& request, ResourceHandleClient* c, bool defersLoading, bool shouldContentSniff)
: m_client(c)
- , m_request(request)
+ , m_firstRequest(request)
, m_lastHTTPMethod(request.httpMethod())
, status(0)
, m_defersLoading(defersLoading)
@@ -136,10 +136,10 @@ namespace WebCore {
, m_scheduledFailureType(ResourceHandle::NoFailure)
, m_failureTimer(loader, &ResourceHandle::fireFailure)
{
- const KURL& url = m_request.url();
+ const KURL& url = m_firstRequest.url();
m_user = url.user();
m_pass = url.pass();
- m_request.removeCredentials();
+ m_firstRequest.removeCredentials();
}
~ResourceHandleInternal();
@@ -147,7 +147,7 @@ namespace WebCore {
ResourceHandleClient* client() { return m_client; }
ResourceHandleClient* m_client;
- ResourceRequest m_request;
+ ResourceRequest m_firstRequest;
String m_lastHTTPMethod;
// Suggested credentials for the current redirection step.
diff --git a/WebCore/platform/network/ResourceResponseBase.cpp b/WebCore/platform/network/ResourceResponseBase.cpp
index 89d31d7..f30344e 100644
--- a/WebCore/platform/network/ResourceResponseBase.cpp
+++ b/WebCore/platform/network/ResourceResponseBase.cpp
@@ -45,6 +45,7 @@ ResourceResponseBase::ResourceResponseBase()
, m_lastModifiedDate(0)
, m_wasCached(false)
, m_connectionID(0)
+ , m_connectionReused(false)
, m_isNull(true)
, m_haveParsedCacheControlHeader(false)
, m_haveParsedAgeHeader(false)
@@ -72,6 +73,7 @@ ResourceResponseBase::ResourceResponseBase(const KURL& url, const String& mimeTy
, m_lastModifiedDate(0)
, m_wasCached(false)
, m_connectionID(0)
+ , m_connectionReused(false)
, m_isNull(false)
, m_haveParsedCacheControlHeader(false)
, m_haveParsedAgeHeader(false)
@@ -471,6 +473,20 @@ void ResourceResponseBase::setWasCached(bool value)
m_wasCached = value;
}
+bool ResourceResponseBase::connectionReused() const
+{
+ lazyInit();
+
+ return m_connectionReused;
+}
+
+void ResourceResponseBase::setConnectionReused(bool connectionReused)
+{
+ lazyInit();
+
+ m_connectionReused = connectionReused;
+}
+
unsigned ResourceResponseBase::connectionID() const
{
lazyInit();
diff --git a/WebCore/platform/network/ResourceResponseBase.h b/WebCore/platform/network/ResourceResponseBase.h
index 858a612..65e24ad 100644
--- a/WebCore/platform/network/ResourceResponseBase.h
+++ b/WebCore/platform/network/ResourceResponseBase.h
@@ -100,6 +100,9 @@ public:
unsigned connectionID() const;
void setConnectionID(unsigned);
+ bool connectionReused() const;
+ void setConnectionReused(bool);
+
bool wasCached() const;
void setWasCached(bool);
@@ -136,8 +139,9 @@ protected:
String m_httpStatusText;
HTTPHeaderMap m_httpHeaderFields;
time_t m_lastModifiedDate;
- bool m_wasCached;
+ bool m_wasCached : 1;
unsigned m_connectionID;
+ bool m_connectionReused : 1;
RefPtr<ResourceLoadTiming> m_resourceLoadTiming;
bool m_isNull : 1;
diff --git a/WebCore/platform/network/cf/ResourceErrorCF.cpp b/WebCore/platform/network/cf/ResourceErrorCF.cpp
index dacc68b..1eba97e 100644
--- a/WebCore/platform/network/cf/ResourceErrorCF.cpp
+++ b/WebCore/platform/network/cf/ResourceErrorCF.cpp
@@ -115,7 +115,7 @@ ResourceError::operator CFErrorRef() const
{
if (m_isNull) {
ASSERT(!m_platformError);
- return nil;
+ return 0;
}
if (!m_platformError) {
diff --git a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
index 1139126..419e397 100644
--- a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
+++ b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
@@ -66,36 +66,40 @@ namespace WebCore {
static CFStringRef WebCoreSynchronousLoaderRunLoopMode = CFSTR("WebCoreSynchronousLoaderRunLoopMode");
-class WebCoreSynchronousLoader {
+class WebCoreSynchronousLoaderClient : public ResourceHandleClient {
public:
- static RetainPtr<CFDataRef> load(const ResourceRequest&, StoredCredentials, ResourceResponse&, ResourceError&);
+ static PassOwnPtr<WebCoreSynchronousLoaderClient> create(ResourceResponse& response, ResourceError& error)
+ {
+ return adoptPtr(new WebCoreSynchronousLoaderClient(response, error));
+ }
+
+ void setAllowStoredCredentials(bool allow) { m_allowStoredCredentials = allow; }
+ bool isDone() { return m_isDone; }
+
+ CFMutableDataRef data() { return m_data.get(); }
private:
- WebCoreSynchronousLoader(ResourceResponse& response, ResourceError& error)
- : m_isDone(false)
+ WebCoreSynchronousLoaderClient(ResourceResponse& response, ResourceError& error)
+ : m_allowStoredCredentials(false)
, m_response(response)
, m_error(error)
+ , m_isDone(false)
{
}
- static CFURLRequestRef willSendRequest(CFURLConnectionRef, CFURLRequestRef, CFURLResponseRef, const void* clientInfo);
- static void didReceiveResponse(CFURLConnectionRef, CFURLResponseRef, const void* clientInfo);
- static void didReceiveData(CFURLConnectionRef, CFDataRef, CFIndex, const void* clientInfo);
- static void didFinishLoading(CFURLConnectionRef, const void* clientInfo);
- static void didFail(CFURLConnectionRef, CFErrorRef, const void* clientInfo);
- static void didReceiveChallenge(CFURLConnectionRef, CFURLAuthChallengeRef, const void* clientInfo);
- static Boolean shouldUseCredentialStorage(CFURLConnectionRef, const void* clientInfo);
+ virtual void willSendRequest(ResourceHandle*, ResourceRequest&, const ResourceResponse& /*redirectResponse*/);
+ virtual bool shouldUseCredentialStorage(ResourceHandle*);
+ virtual void didReceiveAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge&);
+ virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
+ virtual void didReceiveData(ResourceHandle*, const char*, int, int /*lengthReceived*/);
+ virtual void didFinishLoading(ResourceHandle*);
+ virtual void didFail(ResourceHandle*, const ResourceError&);
- bool m_isDone;
- RetainPtr<CFURLRef> m_url;
- RetainPtr<CFStringRef> m_user;
- RetainPtr<CFStringRef> m_pass;
- // Store the preemptively used initial credential so that if we get an authentication challenge, we won't use the same one again.
- Credential m_initialCredential;
bool m_allowStoredCredentials;
ResourceResponse& m_response;
RetainPtr<CFMutableDataRef> m_data;
ResourceError& m_error;
+ bool m_isDone;
};
static HashSet<String>& allowsAnyHTTPSCertificateHosts()
@@ -137,7 +141,7 @@ CFURLRequestRef willSendRequest(CFURLConnectionRef conn, CFURLRequestRef cfReque
return cfRequest;
}
- LOG(Network, "CFNet - willSendRequest(conn=%p, handle=%p) (%s)", conn, handle, handle->request().url().string().utf8().data());
+ LOG(Network, "CFNet - willSendRequest(conn=%p, handle=%p) (%s)", conn, handle, handle->firstRequest().url().string().utf8().data());
ResourceRequest request;
if (cfRedirectResponse) {
@@ -149,11 +153,11 @@ CFURLRequestRef willSendRequest(CFURLConnectionRef conn, CFURLRequestRef cfReque
RetainPtr<CFMutableURLRequestRef> mutableRequest(AdoptCF, CFURLRequestCreateMutableCopy(0, cfRequest));
CFURLRequestSetHTTPRequestMethod(mutableRequest.get(), lastHTTPMethod.get());
- FormData* body = handle->request().httpBody();
- if (!equalIgnoringCase(handle->request().httpMethod(), "GET") && body && !body->isEmpty())
+ FormData* body = handle->firstRequest().httpBody();
+ if (!equalIgnoringCase(handle->firstRequest().httpMethod(), "GET") && body && !body->isEmpty())
WebCore::setHTTPBody(mutableRequest.get(), body);
- String originalContentType = handle->request().httpContentType();
+ String originalContentType = handle->firstRequest().httpContentType();
RetainPtr<CFStringRef> originalContentTypeCF(AdoptCF, originalContentType.createCFString());
if (!originalContentType.isEmpty())
CFURLRequestSetHTTPHeaderFieldValue(mutableRequest.get(), CFSTR("Content-Type"), originalContentTypeCF.get());
@@ -184,7 +188,7 @@ void didReceiveResponse(CFURLConnectionRef conn, CFURLResponseRef cfResponse, co
{
ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
- LOG(Network, "CFNet - didReceiveResponse(conn=%p, handle=%p) (%s)", conn, handle, handle->request().url().string().utf8().data());
+ LOG(Network, "CFNet - didReceiveResponse(conn=%p, handle=%p) (%s)", conn, handle, handle->firstRequest().url().string().utf8().data());
if (!handle->client())
return;
@@ -204,7 +208,7 @@ void didReceiveData(CFURLConnectionRef conn, CFDataRef data, CFIndex originalLen
const UInt8* bytes = CFDataGetBytePtr(data);
CFIndex length = CFDataGetLength(data);
- LOG(Network, "CFNet - didReceiveData(conn=%p, handle=%p, bytes=%d) (%s)", conn, handle, length, handle->request().url().string().utf8().data());
+ LOG(Network, "CFNet - didReceiveData(conn=%p, handle=%p, bytes=%d) (%s)", conn, handle, length, handle->firstRequest().url().string().utf8().data());
if (handle->client())
handle->client()->didReceiveData(handle, (const char*)bytes, length, originalLength);
@@ -222,7 +226,7 @@ static Boolean shouldUseCredentialStorageCallback(CFURLConnectionRef conn, const
{
ResourceHandle* handle = const_cast<ResourceHandle*>(static_cast<const ResourceHandle*>(clientInfo));
- LOG(Network, "CFNet - shouldUseCredentialStorage(conn=%p, handle=%p) (%s)", conn, handle, handle->request().url().string().utf8().data());
+ LOG(Network, "CFNet - shouldUseCredentialStorage(conn=%p, handle=%p) (%s)", conn, handle, handle->firstRequest().url().string().utf8().data());
if (!handle)
return false;
@@ -234,7 +238,7 @@ void didFinishLoading(CFURLConnectionRef conn, const void* clientInfo)
{
ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
- LOG(Network, "CFNet - didFinishLoading(conn=%p, handle=%p) (%s)", conn, handle, handle->request().url().string().utf8().data());
+ LOG(Network, "CFNet - didFinishLoading(conn=%p, handle=%p) (%s)", conn, handle, handle->firstRequest().url().string().utf8().data());
if (handle->client())
handle->client()->didFinishLoading(handle);
@@ -244,7 +248,7 @@ void didFail(CFURLConnectionRef conn, CFErrorRef error, const void* clientInfo)
{
ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
- LOG(Network, "CFNet - didFail(conn=%p, handle=%p, error = %p) (%s)", conn, handle, error, handle->request().url().string().utf8().data());
+ LOG(Network, "CFNet - didFail(conn=%p, handle=%p, error = %p) (%s)", conn, handle, error, handle->firstRequest().url().string().utf8().data());
if (handle->client())
handle->client()->didFail(handle, ResourceError(error));
@@ -277,7 +281,7 @@ void didReceiveChallenge(CFURLConnectionRef conn, CFURLAuthChallengeRef challeng
{
ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
ASSERT(handle);
- LOG(Network, "CFNet - didReceiveChallenge(conn=%p, handle=%p (%s)", conn, handle, handle->request().url().string().utf8().data());
+ LOG(Network, "CFNet - didReceiveChallenge(conn=%p, handle=%p (%s)", conn, handle, handle->firstRequest().url().string().utf8().data());
handle->didReceiveAuthenticationChallenge(AuthenticationChallenge(challenge, handle));
}
@@ -300,14 +304,14 @@ void addHeadersFromHashMap(CFMutableURLRequestRef request, const HTTPHeaderMap&
ResourceHandleInternal::~ResourceHandleInternal()
{
if (m_connection) {
- LOG(Network, "CFNet - Cancelling connection %p (%s)", m_connection, m_request.url().string().utf8().data());
+ LOG(Network, "CFNet - Cancelling connection %p (%s)", m_connection, m_firstRequest.url().string().utf8().data());
CFURLConnectionCancel(m_connection.get());
}
}
ResourceHandle::~ResourceHandle()
{
- LOG(Network, "CFNet - Destroying job %p (%s)", this, d->m_request.url().string().utf8().data());
+ LOG(Network, "CFNet - Destroying job %p (%s)", this, d->m_firstRequest.url().string().utf8().data());
}
CFArrayRef arrayFromFormData(const FormData& d)
@@ -390,56 +394,60 @@ static CFDictionaryRef createConnectionProperties(bool shouldUseCredentialStorag
return propertiesDictionary;
}
-bool ResourceHandle::start(Frame* frame)
+void ResourceHandle::createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff)
{
- // If we are no longer attached to a Page, this must be an attempted load from an
- // onUnload handler, so let's just block it.
- if (!frame->page())
- return false;
-
- if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty()) && !d->m_request.url().protocolInHTTPFamily()) {
+ if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty()) && !firstRequest().url().protocolInHTTPFamily()) {
// Credentials for ftp can only be passed in URL, the didReceiveAuthenticationChallenge delegate call won't be made.
- KURL urlWithCredentials(d->m_request.url());
+ KURL urlWithCredentials(firstRequest().url());
urlWithCredentials.setUser(d->m_user);
urlWithCredentials.setPass(d->m_pass);
- d->m_request.setURL(urlWithCredentials);
+ firstRequest().setURL(urlWithCredentials);
}
- bool shouldUseCredentialStorage = !client() || client()->shouldUseCredentialStorage(this);
-
// <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
// try and reuse the credential preemptively, as allowed by RFC 2617.
- if (shouldUseCredentialStorage && d->m_request.url().protocolInHTTPFamily()) {
+ if (shouldUseCredentialStorage && firstRequest().url().protocolInHTTPFamily()) {
if (d->m_user.isEmpty() && d->m_pass.isEmpty()) {
// <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
// try and reuse the credential preemptively, as allowed by RFC 2617.
- d->m_initialCredential = CredentialStorage::get(d->m_request.url());
+ d->m_initialCredential = CredentialStorage::get(firstRequest().url());
} else {
// If there is already a protection space known for the URL, update stored credentials before sending a request.
// This makes it possible to implement logout by sending an XMLHttpRequest with known incorrect credentials, and aborting it immediately
// (so that an authentication dialog doesn't pop up).
- CredentialStorage::set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), d->m_request.url());
+ CredentialStorage::set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), firstRequest().url());
}
}
if (!d->m_initialCredential.isEmpty()) {
String authHeader = "Basic " + encodeBasicAuthorization(d->m_initialCredential.user(), d->m_initialCredential.password());
- d->m_request.addHTTPHeaderField("Authorization", authHeader);
+ firstRequest().addHTTPHeaderField("Authorization", authHeader);
}
- RetainPtr<CFURLRequestRef> request(AdoptCF, makeFinalRequest(d->m_request, d->m_shouldContentSniff));
-
- CFURLConnectionClient_V3 client = { 3, this, 0, 0, 0, WebCore::willSendRequest, didReceiveResponse, didReceiveData, NULL, didFinishLoading, didFail, willCacheResponse, didReceiveChallenge, didSendBodyData, shouldUseCredentialStorageCallback, 0};
+ RetainPtr<CFURLRequestRef> request(AdoptCF, makeFinalRequest(firstRequest(), shouldContentSniff));
+ CFURLConnectionClient_V3 client = { 3, this, 0, 0, 0, WebCore::willSendRequest, didReceiveResponse, didReceiveData, 0, didFinishLoading, didFail, willCacheResponse, didReceiveChallenge, didSendBodyData, shouldUseCredentialStorageCallback, 0};
RetainPtr<CFDictionaryRef> connectionProperties(AdoptCF, createConnectionProperties(shouldUseCredentialStorage));
d->m_connection.adoptCF(CFURLConnectionCreateWithProperties(0, request.get(), reinterpret_cast<CFURLConnectionClient*>(&client), connectionProperties.get()));
+}
+
+bool ResourceHandle::start(Frame* frame)
+{
+ // If we are no longer attached to a Page, this must be an attempted load from an
+ // onUnload handler, so let's just block it.
+ if (!frame->page())
+ return false;
+
+ bool shouldUseCredentialStorage = !client() || client()->shouldUseCredentialStorage(this);
+
+ createCFURLConnection(shouldUseCredentialStorage, d->m_shouldContentSniff);
CFURLConnectionScheduleWithCurrentMessageQueue(d->m_connection.get());
CFURLConnectionScheduleDownloadWithRunLoop(d->m_connection.get(), loaderRunLoop(), kCFRunLoopDefaultMode);
CFURLConnectionStart(d->m_connection.get());
- LOG(Network, "CFNet - Starting URL %s (handle=%p, conn=%p)", d->m_request.url().string().utf8().data(), this, d->m_connection);
+ LOG(Network, "CFNet - Starting URL %s (handle=%p, conn=%p)", firstRequest().url().string().utf8().data(), this, d->m_connection);
return true;
}
@@ -500,7 +508,7 @@ void ResourceHandle::didReceiveAuthenticationChallenge(const AuthenticationChall
KURL urlToStore;
if (challenge.failureResponse().httpStatusCode() == 401)
- urlToStore = d->m_request.url();
+ urlToStore = firstRequest().url();
CredentialStorage::set(core(credential.get()), challenge.protectionSpace(), urlToStore);
CFURLConnectionUseCredential(d->m_connection.get(), credential.get(), challenge.cfURLAuthChallengeRef());
@@ -510,17 +518,26 @@ void ResourceHandle::didReceiveAuthenticationChallenge(const AuthenticationChall
return;
}
- if (!challenge.previousFailureCount() && (!client() || client()->shouldUseCredentialStorage(this))) {
- Credential credential = CredentialStorage::get(challenge.protectionSpace());
- if (!credential.isEmpty() && credential != d->m_initialCredential) {
- ASSERT(credential.persistence() == CredentialPersistenceNone);
- if (challenge.failureResponse().httpStatusCode() == 401) {
- // Store the credential back, possibly adding it as a default for this directory.
- CredentialStorage::set(credential, challenge.protectionSpace(), d->m_request.url());
+ if (!client() || client()->shouldUseCredentialStorage(this)) {
+ if (!d->m_initialCredential.isEmpty() || challenge.previousFailureCount()) {
+ // The stored credential wasn't accepted, stop using it.
+ // There is a race condition here, since a different credential might have already been stored by another ResourceHandle,
+ // but the observable effect should be very minor, if any.
+ CredentialStorage::remove(challenge.protectionSpace());
+ }
+
+ if (!challenge.previousFailureCount()) {
+ Credential credential = CredentialStorage::get(challenge.protectionSpace());
+ if (!credential.isEmpty() && credential != d->m_initialCredential) {
+ ASSERT(credential.persistence() == CredentialPersistenceNone);
+ if (challenge.failureResponse().httpStatusCode() == 401) {
+ // Store the credential back, possibly adding it as a default for this directory.
+ CredentialStorage::set(credential, challenge.protectionSpace(), firstRequest().url());
+ }
+ RetainPtr<CFURLCredentialRef> cfCredential(AdoptCF, createCF(credential));
+ CFURLConnectionUseCredential(d->m_connection.get(), cfCredential.get(), challenge.cfURLAuthChallengeRef());
+ return;
}
- RetainPtr<CFURLCredentialRef> cfCredential(AdoptCF, createCF(credential));
- CFURLConnectionUseCredential(d->m_connection.get(), cfCredential.get(), challenge.cfURLAuthChallengeRef());
- return;
}
}
@@ -552,7 +569,7 @@ void ResourceHandle::receivedCredential(const AuthenticationChallenge& challenge
KURL urlToStore;
if (challenge.failureResponse().httpStatusCode() == 401)
- urlToStore = d->m_request.url();
+ urlToStore = firstRequest().url();
CredentialStorage::set(webCredential, challenge.protectionSpace(), urlToStore);
CFURLConnectionUseCredential(d->m_connection.get(), cfCredential.get(), challenge.cfURLAuthChallengeRef());
@@ -598,12 +615,43 @@ CFURLConnectionRef ResourceHandle::releaseConnectionForDownload()
return d->m_connection.releaseRef();
}
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& vector, Frame*)
+void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& vector, Frame* frame)
{
+ LOG(Network, "ResourceHandle::loadResourceSynchronously:%s allowStoredCredentials:%u", request.url().string().utf8().data(), storedCredentials);
+
ASSERT(!request.isEmpty());
- RetainPtr<CFDataRef> data = WebCoreSynchronousLoader::load(request, storedCredentials, response, error);
+ ASSERT(response.isNull());
+ ASSERT(error.isNull());
+
+ OwnPtr<WebCoreSynchronousLoaderClient> client = WebCoreSynchronousLoaderClient::create(response, error);
+ client->setAllowStoredCredentials(storedCredentials == AllowStoredCredentials);
+
+ RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, client.get(), false /*defersLoading*/, true /*shouldContentSniff*/));
+
+ if (handle->d->m_scheduledFailureType != NoFailure) {
+ error = frame->loader()->blockedError(request);
+ return;
+ }
+
+ RetainPtr<CFDictionaryRef> connectionProperties(AdoptCF, createConnectionProperties(storedCredentials == AllowStoredCredentials));
+ handle->createCFURLConnection(storedCredentials == AllowStoredCredentials, ResourceHandle::shouldContentSniffURL(request.url()));
+
+ CFURLConnectionScheduleWithRunLoop(handle->connection(), CFRunLoopGetCurrent(), WebCoreSynchronousLoaderRunLoopMode);
+ CFURLConnectionScheduleDownloadWithRunLoop(handle->connection(), CFRunLoopGetCurrent(), WebCoreSynchronousLoaderRunLoopMode);
+ CFURLConnectionStart(handle->connection());
+
+ while (!client->isDone())
+ CFRunLoopRunInMode(WebCoreSynchronousLoaderRunLoopMode, UINT_MAX, true);
+
+ CFURLConnectionCancel(handle->connection());
+
+ if (error.isNull() && response.mimeType().isNull())
+ setDefaultMIMEType(response.cfURLResponse());
+
+ RetainPtr<CFDataRef> data = client->data();
+
if (!error.isNull()) {
response = ResourceResponse(request.url(), String(), 0, String(), String());
@@ -666,173 +714,51 @@ bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame* frame)
return cached;
}
-CFURLRequestRef WebCoreSynchronousLoader::willSendRequest(CFURLConnectionRef, CFURLRequestRef cfRequest, CFURLResponseRef cfRedirectResponse, const void* clientInfo)
+void WebCoreSynchronousLoaderClient::willSendRequest(ResourceHandle* handle, ResourceRequest& request, const ResourceResponse& /*redirectResponse*/)
{
- WebCoreSynchronousLoader* loader = static_cast<WebCoreSynchronousLoader*>(const_cast<void*>(clientInfo));
-
// FIXME: This needs to be fixed to follow the redirect correctly even for cross-domain requests.
- if (loader->m_url && !protocolHostAndPortAreEqual(loader->m_url.get(), CFURLRequestGetURL(cfRequest))) {
+ if (!protocolHostAndPortAreEqual(handle->firstRequest().url(), request.url())) {
+ ASSERT(!m_error);
RetainPtr<CFErrorRef> cfError(AdoptCF, CFErrorCreate(kCFAllocatorDefault, kCFErrorDomainCFNetwork, kCFURLErrorBadServerResponse, 0));
- loader->m_error = cfError.get();
- loader->m_isDone = true;
- return 0;
- }
-
- loader->m_url = CFURLRequestGetURL(cfRequest);
-
- if (cfRedirectResponse) {
- // Take user/pass out of the URL.
- loader->m_user.adoptCF(CFURLCopyUserName(loader->m_url.get()));
- loader->m_pass.adoptCF(CFURLCopyPassword(loader->m_url.get()));
- if (loader->m_user || loader->m_pass) {
- ResourceRequest requestWithoutCredentials = cfRequest;
- requestWithoutCredentials.removeCredentials();
- cfRequest = requestWithoutCredentials.cfURLRequest();
- }
+ m_error = cfError.get();
+ m_isDone = true;
+ request = 0;
+ return;
}
-
- CFRetain(cfRequest);
- return cfRequest;
}
-
-void WebCoreSynchronousLoader::didReceiveResponse(CFURLConnectionRef, CFURLResponseRef cfResponse, const void* clientInfo)
+void WebCoreSynchronousLoaderClient::didReceiveResponse(ResourceHandle*, const ResourceResponse& response)
{
- WebCoreSynchronousLoader* loader = static_cast<WebCoreSynchronousLoader*>(const_cast<void*>(clientInfo));
-
- loader->m_response = cfResponse;
+ m_response = response;
}
-void WebCoreSynchronousLoader::didReceiveData(CFURLConnectionRef, CFDataRef data, CFIndex originalLength, const void* clientInfo)
+void WebCoreSynchronousLoaderClient::didReceiveData(ResourceHandle*, const char* data, int length, int /*lengthReceived*/)
{
- WebCoreSynchronousLoader* loader = static_cast<WebCoreSynchronousLoader*>(const_cast<void*>(clientInfo));
-
- if (!loader->m_data)
- loader->m_data.adoptCF(CFDataCreateMutable(kCFAllocatorDefault, 0));
-
- const UInt8* bytes = CFDataGetBytePtr(data);
- CFIndex length = CFDataGetLength(data);
-
- CFDataAppendBytes(loader->m_data.get(), bytes, length);
+ if (!m_data)
+ m_data.adoptCF(CFDataCreateMutable(kCFAllocatorDefault, 0));
+ CFDataAppendBytes(m_data.get(), reinterpret_cast<const UInt8*>(data), length);
}
-void WebCoreSynchronousLoader::didFinishLoading(CFURLConnectionRef, const void* clientInfo)
+void WebCoreSynchronousLoaderClient::didFinishLoading(ResourceHandle*)
{
- WebCoreSynchronousLoader* loader = static_cast<WebCoreSynchronousLoader*>(const_cast<void*>(clientInfo));
-
- loader->m_isDone = true;
+ m_isDone = true;
}
-void WebCoreSynchronousLoader::didFail(CFURLConnectionRef, CFErrorRef error, const void* clientInfo)
+void WebCoreSynchronousLoaderClient::didFail(ResourceHandle*, const ResourceError& error)
{
- WebCoreSynchronousLoader* loader = static_cast<WebCoreSynchronousLoader*>(const_cast<void*>(clientInfo));
-
- loader->m_error = error;
- loader->m_isDone = true;
+ m_error = error;
+ m_isDone = true;
}
-void WebCoreSynchronousLoader::didReceiveChallenge(CFURLConnectionRef conn, CFURLAuthChallengeRef challenge, const void* clientInfo)
+void WebCoreSynchronousLoaderClient::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge& challenge)
{
- WebCoreSynchronousLoader* loader = static_cast<WebCoreSynchronousLoader*>(const_cast<void*>(clientInfo));
-
- CFURLResponseRef urlResponse = (CFURLResponseRef)CFURLAuthChallengeGetFailureResponse(challenge);
- CFHTTPMessageRef httpResponse = urlResponse ? CFURLResponseGetHTTPResponse(urlResponse) : 0;
-
- if (loader->m_user && loader->m_pass) {
- Credential credential(loader->m_user.get(), loader->m_pass.get(), CredentialPersistenceNone);
- RetainPtr<CFURLCredentialRef> cfCredential(AdoptCF, createCF(credential));
-
- KURL urlToStore;
- if (httpResponse && CFHTTPMessageGetResponseStatusCode(httpResponse) == 401)
- urlToStore = loader->m_url.get();
-
- CredentialStorage::set(credential, core(CFURLAuthChallengeGetProtectionSpace(challenge)), urlToStore);
-
- CFURLConnectionUseCredential(conn, cfCredential.get(), challenge);
- loader->m_user = 0;
- loader->m_pass = 0;
- return;
- }
- if (!CFURLAuthChallengeGetPreviousFailureCount(challenge) && loader->m_allowStoredCredentials) {
- Credential credential = CredentialStorage::get(core(CFURLAuthChallengeGetProtectionSpace(challenge)));
- if (!credential.isEmpty() && credential != loader->m_initialCredential) {
- ASSERT(credential.persistence() == CredentialPersistenceNone);
- if (httpResponse && CFHTTPMessageGetResponseStatusCode(httpResponse) == 401) {
- // Store the credential back, possibly adding it as a default for this directory.
- CredentialStorage::set(credential, core(CFURLAuthChallengeGetProtectionSpace(challenge)), loader->m_url.get());
- }
- RetainPtr<CFURLCredentialRef> cfCredential(AdoptCF, createCF(credential));
- CFURLConnectionUseCredential(conn, cfCredential.get(), challenge);
- return;
- }
- }
// FIXME: The user should be asked for credentials, as in async case.
- CFURLConnectionUseCredential(conn, 0, challenge);
+ CFURLConnectionUseCredential(handle->connection(), 0, challenge.cfURLAuthChallengeRef());
}
-Boolean WebCoreSynchronousLoader::shouldUseCredentialStorage(CFURLConnectionRef, const void* clientInfo)
+bool WebCoreSynchronousLoaderClient::shouldUseCredentialStorage(ResourceHandle*)
{
- WebCoreSynchronousLoader* loader = static_cast<WebCoreSynchronousLoader*>(const_cast<void*>(clientInfo));
-
// FIXME: We should ask FrameLoaderClient whether using credential storage is globally forbidden.
- return loader->m_allowStoredCredentials;
-}
-
-RetainPtr<CFDataRef> WebCoreSynchronousLoader::load(const ResourceRequest& request, StoredCredentials storedCredentials, ResourceResponse& response, ResourceError& error)
-{
- ASSERT(response.isNull());
- ASSERT(error.isNull());
-
- WebCoreSynchronousLoader loader(response, error);
-
- KURL url = request.url();
-
- if (url.user().length())
- loader.m_user.adoptCF(url.user().createCFString());
- if (url.pass().length())
- loader.m_pass.adoptCF(url.pass().createCFString());
- loader.m_allowStoredCredentials = (storedCredentials == AllowStoredCredentials);
-
- // Take user/pass out of the URL.
- // Credentials for ftp can only be passed in URL, the didReceiveAuthenticationChallenge delegate call won't be made.
- RetainPtr<CFURLRequestRef> cfRequest;
- if ((loader.m_user || loader.m_pass) && url.protocolInHTTPFamily()) {
- ResourceRequest requestWithoutCredentials(request);
- requestWithoutCredentials.removeCredentials();
- cfRequest.adoptCF(makeFinalRequest(requestWithoutCredentials, ResourceHandle::shouldContentSniffURL(requestWithoutCredentials.url())));
- } else {
- // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
- // try and reuse the credential preemptively, as allowed by RFC 2617.
- ResourceRequest requestWithInitialCredential(request);
- if (loader.m_allowStoredCredentials && url.protocolInHTTPFamily())
- loader.m_initialCredential = CredentialStorage::get(url);
-
- if (!loader.m_initialCredential.isEmpty()) {
- String authHeader = "Basic " + encodeBasicAuthorization(loader.m_initialCredential.user(), loader.m_initialCredential.password());
- requestWithInitialCredential.addHTTPHeaderField("Authorization", authHeader);
- }
-
- cfRequest.adoptCF(makeFinalRequest(requestWithInitialCredential, ResourceHandle::shouldContentSniffURL(requestWithInitialCredential.url())));
- }
-
- CFURLConnectionClient_V3 client = { 3, &loader, 0, 0, 0, willSendRequest, didReceiveResponse, didReceiveData, 0, didFinishLoading, didFail, 0, didReceiveChallenge, 0, shouldUseCredentialStorage, 0 };
-
- RetainPtr<CFDictionaryRef> connectionProperties(AdoptCF, createConnectionProperties(loader.m_allowStoredCredentials));
-
- RetainPtr<CFURLConnectionRef> connection(AdoptCF, CFURLConnectionCreateWithProperties(kCFAllocatorDefault, cfRequest.get(), reinterpret_cast<CFURLConnectionClient*>(&client), connectionProperties.get()));
-
- CFURLConnectionScheduleWithRunLoop(connection.get(), CFRunLoopGetCurrent(), WebCoreSynchronousLoaderRunLoopMode);
- CFURLConnectionScheduleDownloadWithRunLoop(connection.get(), CFRunLoopGetCurrent(), WebCoreSynchronousLoaderRunLoopMode);
- CFURLConnectionStart(connection.get());
-
- while (!loader.m_isDone)
- CFRunLoopRunInMode(WebCoreSynchronousLoaderRunLoopMode, UINT_MAX, true);
-
- CFURLConnectionCancel(connection.get());
-
- if (error.isNull() && loader.m_response.mimeType().isNull())
- setDefaultMIMEType(loader.m_response.cfURLResponse());
-
- return loader.m_data;
+ return m_allowStoredCredentials;
}
} // namespace WebCore
diff --git a/WebCore/platform/network/cf/ResourceRequestCFNet.cpp b/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
index cc0220e..8e15040 100644
--- a/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
+++ b/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
@@ -146,6 +146,11 @@ void ResourceRequest::doUpdatePlatformRequest()
void ResourceRequest::doUpdateResourceRequest()
{
+ if (!m_cfRequest) {
+ *this = ResourceRequest();
+ return;
+ }
+
m_url = CFURLRequestGetURL(m_cfRequest.get());
m_cachePolicy = (ResourceRequestCachePolicy)CFURLRequestGetCachePolicy(m_cfRequest.get());
diff --git a/WebCore/platform/network/curl/FormDataStreamCurl.cpp b/WebCore/platform/network/curl/FormDataStreamCurl.cpp
index 0f94d63..e47eb07 100644
--- a/WebCore/platform/network/curl/FormDataStreamCurl.cpp
+++ b/WebCore/platform/network/curl/FormDataStreamCurl.cpp
@@ -50,8 +50,8 @@ size_t FormDataStream::read(void* ptr, size_t blockSize, size_t numberOfBlocks)
return 0;
Vector<FormDataElement> elements;
- if (m_resourceHandle->request().httpBody())
- elements = m_resourceHandle->request().httpBody()->elements();
+ if (m_resourceHandle->firstRequest().httpBody())
+ elements = m_resourceHandle->firstRequest().httpBody()->elements();
if (m_formDataElementIndex >= elements.size())
return 0;
@@ -104,8 +104,8 @@ size_t FormDataStream::read(void* ptr, size_t blockSize, size_t numberOfBlocks)
bool FormDataStream::hasMoreElements() const
{
Vector<FormDataElement> elements;
- if (m_resourceHandle->request().httpBody())
- elements = m_resourceHandle->request().httpBody()->elements();
+ if (m_resourceHandle->firstRequest().httpBody())
+ elements = m_resourceHandle->firstRequest().httpBody()->elements();
return m_formDataElementIndex < elements.size();
}
diff --git a/WebCore/platform/network/curl/ResourceHandleManager.cpp b/WebCore/platform/network/curl/ResourceHandleManager.cpp
index c621d5c..ba68351 100644
--- a/WebCore/platform/network/curl/ResourceHandleManager.cpp
+++ b/WebCore/platform/network/curl/ResourceHandleManager.cpp
@@ -264,14 +264,14 @@ static size_t headerCallback(char* ptr, size_t size, size_t nmemb, void* data)
if (httpCode >= 300 && httpCode < 400) {
String location = d->m_response.httpHeaderField("location");
if (!location.isEmpty()) {
- KURL newURL = KURL(job->request().url(), location);
+ KURL newURL = KURL(job->firstRequest().url(), location);
- ResourceRequest redirectedRequest = job->request();
+ ResourceRequest redirectedRequest = job->firstRequest();
redirectedRequest.setURL(newURL);
if (client)
client->willSendRequest(job, redirectedRequest, d->m_response);
- d->m_request.setURL(newURL);
+ d->m_firstRequest.setURL(newURL);
return totalSize;
}
@@ -463,17 +463,17 @@ void ResourceHandleManager::setupPOST(ResourceHandle* job, struct curl_slist** h
curl_easy_setopt(d->m_handle, CURLOPT_POST, TRUE);
curl_easy_setopt(d->m_handle, CURLOPT_POSTFIELDSIZE, 0);
- if (!job->request().httpBody())
+ if (!job->firstRequest().httpBody())
return;
- Vector<FormDataElement> elements = job->request().httpBody()->elements();
+ Vector<FormDataElement> elements = job->firstRequest().httpBody()->elements();
size_t numElements = elements.size();
if (!numElements)
return;
// Do not stream for simple POST data
if (numElements == 1) {
- job->request().httpBody()->flatten(d->m_postBytes);
+ job->firstRequest().httpBody()->flatten(d->m_postBytes);
if (d->m_postBytes.size() != 0) {
curl_easy_setopt(d->m_handle, CURLOPT_POSTFIELDSIZE, d->m_postBytes.size());
curl_easy_setopt(d->m_handle, CURLOPT_POSTFIELDS, d->m_postBytes.data());
@@ -580,7 +580,7 @@ static void parseDataUrl(ResourceHandle* handle)
if (!client)
return;
- String url = handle->request().url().string();
+ String url = handle->firstRequest().url().string();
ASSERT(url.startsWith("data:", false));
int index = url.find(',');
@@ -628,7 +628,7 @@ static void parseDataUrl(ResourceHandle* handle)
void ResourceHandleManager::dispatchSynchronousJob(ResourceHandle* job)
{
- KURL kurl = job->request().url();
+ KURL kurl = job->firstRequest().url();
if (kurl.protocolIs("data")) {
parseDataUrl(job);
@@ -659,7 +659,7 @@ void ResourceHandleManager::dispatchSynchronousJob(ResourceHandle* job)
void ResourceHandleManager::startJob(ResourceHandle* job)
{
- KURL kurl = job->request().url();
+ KURL kurl = job->firstRequest().url();
if (kurl.protocolIs("data")) {
parseDataUrl(job);
@@ -674,7 +674,7 @@ void ResourceHandleManager::startJob(ResourceHandle* job)
// timeout will occur and do curl_multi_perform
if (ret && ret != CURLM_CALL_MULTI_PERFORM) {
#ifndef NDEBUG
- fprintf(stderr, "Error %d starting job %s\n", ret, encodeWithURLEscapeSequences(job->request().url().string()).latin1().data());
+ fprintf(stderr, "Error %d starting job %s\n", ret, encodeWithURLEscapeSequences(job->firstRequest().url().string()).latin1().data());
#endif
job->cancel();
return;
@@ -683,7 +683,7 @@ void ResourceHandleManager::startJob(ResourceHandle* job)
void ResourceHandleManager::initializeHandle(ResourceHandle* job)
{
- KURL kurl = job->request().url();
+ KURL kurl = job->firstRequest().url();
// Remove any fragment part, otherwise curl will send it as part of the request.
kurl.removeFragmentIdentifier();
@@ -753,8 +753,8 @@ void ResourceHandleManager::initializeHandle(ResourceHandle* job)
}
struct curl_slist* headers = 0;
- if (job->request().httpHeaderFields().size() > 0) {
- HTTPHeaderMap customHeaders = job->request().httpHeaderFields();
+ if (job->firstRequest().httpHeaderFields().size() > 0) {
+ HTTPHeaderMap customHeaders = job->firstRequest().httpHeaderFields();
HTTPHeaderMap::const_iterator end = customHeaders.end();
for (HTTPHeaderMap::const_iterator it = customHeaders.begin(); it != end; ++it) {
String key = it->first;
@@ -767,13 +767,13 @@ void ResourceHandleManager::initializeHandle(ResourceHandle* job)
}
}
- if ("GET" == job->request().httpMethod())
+ if ("GET" == job->firstRequest().httpMethod())
curl_easy_setopt(d->m_handle, CURLOPT_HTTPGET, TRUE);
- else if ("POST" == job->request().httpMethod())
+ else if ("POST" == job->firstRequest().httpMethod())
setupPOST(job, &headers);
- else if ("PUT" == job->request().httpMethod())
+ else if ("PUT" == job->firstRequest().httpMethod())
setupPUT(job, &headers);
- else if ("HEAD" == job->request().httpMethod())
+ else if ("HEAD" == job->firstRequest().httpMethod())
curl_easy_setopt(d->m_handle, CURLOPT_NOBODY, TRUE);
if (headers) {
diff --git a/WebCore/platform/network/mac/ResourceHandleMac.mm b/WebCore/platform/network/mac/ResourceHandleMac.mm
index 9f64d4e..f7161ec 100644
--- a/WebCore/platform/network/mac/ResourceHandleMac.mm
+++ b/WebCore/platform/network/mac/ResourceHandleMac.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2006-2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -56,8 +56,7 @@ typedef int NSInteger;
using namespace WebCore;
-@interface WebCoreResourceHandleAsDelegate : NSObject <NSURLConnectionDelegate>
-{
+@interface WebCoreResourceHandleAsDelegate : NSObject <NSURLConnectionDelegate> {
ResourceHandle* m_handle;
}
- (id)initWithHandle:(ResourceHandle*)handle;
@@ -85,20 +84,48 @@ using namespace WebCore;
#ifndef BUILDING_ON_TIGER
-@interface WebCoreSynchronousLoader : NSObject <NSURLConnectionDelegate> {
- NSURL *m_url;
- NSString *m_user;
- NSString *m_pass;
- // Store the preemptively used initial credential so that if we get an authentication challenge, we won't use the same one again.
- Credential m_initialCredential;
- BOOL m_allowStoredCredentials;
+class WebCoreSynchronousLoaderClient : public ResourceHandleClient {
+public:
+ static PassOwnPtr<WebCoreSynchronousLoaderClient> create()
+ {
+ return adoptPtr(new WebCoreSynchronousLoaderClient);
+ }
+
+ virtual ~WebCoreSynchronousLoaderClient();
+
+ void setAllowStoredCredentials(bool allow) { m_allowStoredCredentials = allow; }
+ NSURLResponse *response() { return m_response; }
+ NSMutableData *data() { return m_data; }
+ NSError *error() { return m_error; }
+ bool isDone() { return m_isDone; }
+
+private:
+ WebCoreSynchronousLoaderClient()
+ : m_allowStoredCredentials(false)
+ , m_response(0)
+ , m_data(0)
+ , m_error(0)
+ , m_isDone(false)
+ {
+ }
+
+ virtual void willSendRequest(ResourceHandle*, ResourceRequest&, const ResourceResponse& /*redirectResponse*/);
+ virtual bool shouldUseCredentialStorage(ResourceHandle*);
+ virtual void didReceiveAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge&);
+ virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
+ virtual void didReceiveData(ResourceHandle*, const char*, int, int /*lengthReceived*/);
+ virtual void didFinishLoading(ResourceHandle*);
+ virtual void didFail(ResourceHandle*, const ResourceError&);
+#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
+ virtual bool canAuthenticateAgainstProtectionSpace(ResourceHandle*, const ProtectionSpace&);
+#endif
+
+ bool m_allowStoredCredentials;
NSURLResponse *m_response;
NSMutableData *m_data;
NSError *m_error;
- BOOL m_isDone;
-}
-+ (NSData *)loadRequest:(NSURLRequest *)request allowStoredCredentials:(BOOL)allowStoredCredentials returningResponse:(NSURLResponse **)response error:(NSError **)error;
-@end
+ bool m_isDone;
+};
static NSString *WebCoreSynchronousLoaderRunLoopMode = @"WebCoreSynchronousLoaderRunLoopMode";
@@ -161,12 +188,51 @@ bool ResourceHandle::didSendBodyDataDelegateExists()
return NSFoundationVersionNumber > MaxFoundationVersionWithoutdidSendBodyDataDelegate;
}
-static NSURLConnection *createNSURLConnection(NSURLRequest *request, id delegate, bool shouldUseCredentialStorage)
+void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff)
{
-#if defined(BUILDING_ON_TIGER)
- UNUSED_PARAM(shouldUseCredentialStorage);
- return [[NSURLConnection alloc] initWithRequest:request delegate:delegate];
-#else
+ // Credentials for ftp can only be passed in URL, the connection:didReceiveAuthenticationChallenge: delegate call won't be made.
+ if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty())
+#ifndef BUILDING_ON_TIGER
+ && !firstRequest().url().protocolInHTTPFamily() // On Tiger, always pass credentials in URL, so that they get stored even if the request gets cancelled right away.
+#endif
+ ) {
+ KURL urlWithCredentials(firstRequest().url());
+ urlWithCredentials.setUser(d->m_user);
+ urlWithCredentials.setPass(d->m_pass);
+ firstRequest().setURL(urlWithCredentials);
+ }
+
+ // If a URL already has cookies, then we'll relax the 3rd party cookie policy and accept new cookies.
+ NSHTTPCookieStorage *sharedStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
+ if ([sharedStorage cookieAcceptPolicy] == NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain && [[sharedStorage cookiesForURL:firstRequest().url()] count])
+ firstRequest().setFirstPartyForCookies(firstRequest().url());
+
+#if !defined(BUILDING_ON_TIGER)
+ if (shouldUseCredentialStorage && firstRequest().url().protocolInHTTPFamily()) {
+ if (d->m_user.isEmpty() && d->m_pass.isEmpty()) {
+ // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
+ // try and reuse the credential preemptively, as allowed by RFC 2617.
+ d->m_initialCredential = CredentialStorage::get(firstRequest().url());
+ } else {
+ // If there is already a protection space known for the URL, update stored credentials before sending a request.
+ // This makes it possible to implement logout by sending an XMLHttpRequest with known incorrect credentials, and aborting it immediately
+ // (so that an authentication dialog doesn't pop up).
+ CredentialStorage::set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), firstRequest().url());
+ }
+ }
+
+ if (!d->m_initialCredential.isEmpty()) {
+ // FIXME: Support Digest authentication, and Proxy-Authorization.
+ String authHeader = "Basic " + encodeBasicAuthorization(d->m_initialCredential.user(), d->m_initialCredential.password());
+ firstRequest().addHTTPHeaderField("Authorization", authHeader);
+ }
+
+ NSURLRequest *nsRequest = firstRequest().nsURLRequest();
+ if (!shouldContentSniff) {
+ NSMutableURLRequest *mutableRequest = [[nsRequest copy] autorelease];
+ wkSetNSURLRequestShouldContentSniff(mutableRequest, NO);
+ nsRequest = mutableRequest;
+ }
#if !defined(BUILDING_ON_LEOPARD)
ASSERT([NSURLConnection instancesRespondToSelector:@selector(_initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:)]);
@@ -178,10 +244,18 @@ static NSURLConnection *createNSURLConnection(NSURLRequest *request, id delegate
if (supportsSettingConnectionProperties) {
NSDictionary *sessionID = shouldUseCredentialStorage ? [NSDictionary dictionary] : [NSDictionary dictionaryWithObject:@"WebKitPrivateSession" forKey:@"_kCFURLConnectionSessionID"];
NSDictionary *propertyDictionary = [NSDictionary dictionaryWithObject:sessionID forKey:@"kCFURLConnectionSocketStreamProperties"];
- return [[NSURLConnection alloc] _initWithRequest:request delegate:delegate usesCache:YES maxContentLength:0 startImmediately:NO connectionProperties:propertyDictionary];
+ d->m_connection.adoptNS([[NSURLConnection alloc] _initWithRequest:nsRequest delegate:delegate usesCache:YES maxContentLength:0 startImmediately:NO connectionProperties:propertyDictionary]);
+ return;
}
- return [[NSURLConnection alloc] initWithRequest:request delegate:delegate startImmediately:NO];
+ d->m_connection.adoptNS([[NSURLConnection alloc] initWithRequest:nsRequest delegate:delegate startImmediately:NO]);
+ return;
+
+#else
+ // Building on Tiger. Don't use WebCore credential storage, don't try to disable content sniffing.
+ UNUSED_PARAM(shouldUseCredentialStorage);
+ UNUSED_PARAM(shouldContentSniff);
+ d->m_connection.adoptNS([[NSURLConnection alloc] initWithRequest:firstRequest().nsURLRequest() delegate:delegate]);
#endif
}
@@ -206,69 +280,24 @@ bool ResourceHandle::start(Frame* frame)
d->m_proxy.adoptNS(wkCreateNSURLConnectionDelegateProxy());
[static_cast<WebCoreNSURLConnectionDelegateProxy*>(d->m_proxy.get()) setDelegate:ResourceHandle::delegate()];
- if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty())
-#ifndef BUILDING_ON_TIGER
- && !d->m_request.url().protocolInHTTPFamily() // On Tiger, always pass credentials in URL, so that they get stored even if the request gets cancelled right away.
-#endif
- ) {
- // Credentials for ftp can only be passed in URL, the connection:didReceiveAuthenticationChallenge: delegate call won't be made.
- KURL urlWithCredentials(d->m_request.url());
- urlWithCredentials.setUser(d->m_user);
- urlWithCredentials.setPass(d->m_pass);
- d->m_request.setURL(urlWithCredentials);
- }
-
bool shouldUseCredentialStorage = !client() || client()->shouldUseCredentialStorage(this);
-#ifndef BUILDING_ON_TIGER
- if (shouldUseCredentialStorage && d->m_request.url().protocolInHTTPFamily()) {
- if (d->m_user.isEmpty() && d->m_pass.isEmpty()) {
- // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
- // try and reuse the credential preemptively, as allowed by RFC 2617.
- d->m_initialCredential = CredentialStorage::get(d->m_request.url());
- } else {
- // If there is already a protection space known for the URL, update stored credentials before sending a request.
- // This makes it possible to implement logout by sending an XMLHttpRequest with known incorrect credentials, and aborting it immediately
- // (so that an authentication dialog doesn't pop up).
- CredentialStorage::set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), d->m_request.url());
- }
- }
-
- if (!d->m_initialCredential.isEmpty()) {
- // FIXME: Support Digest authentication, and Proxy-Authorization.
- String authHeader = "Basic " + encodeBasicAuthorization(d->m_initialCredential.user(), d->m_initialCredential.password());
- d->m_request.addHTTPHeaderField("Authorization", authHeader);
- }
-#endif
-
if (!ResourceHandle::didSendBodyDataDelegateExists())
- associateStreamWithResourceHandle([d->m_request.nsURLRequest() HTTPBodyStream], this);
+ associateStreamWithResourceHandle([firstRequest().nsURLRequest() HTTPBodyStream], this);
#ifdef BUILDING_ON_TIGER
// A conditional request sent by WebCore (e.g. to update appcache) can be for a resource that is not cacheable by NSURLConnection,
// which can get confused and fail to load it in this case.
- if (d->m_request.isConditional())
- d->m_request.setCachePolicy(ReloadIgnoringCacheData);
+ if (firstRequest().isConditional())
+ firstRequest().setCachePolicy(ReloadIgnoringCacheData);
#endif
d->m_needsSiteSpecificQuirks = frame->settings() && frame->settings()->needsSiteSpecificQuirks();
- // If a URL already has cookies, then we'll relax the 3rd party cookie policy and accept new cookies.
- NSHTTPCookieStorage *sharedStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
- if ([sharedStorage cookieAcceptPolicy] == NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain
- && [[sharedStorage cookiesForURL:d->m_request.url()] count])
- d->m_request.setFirstPartyForCookies(d->m_request.url());
-
- NSURLConnection *connection;
-
- if (d->m_shouldContentSniff || frame->settings()->localFileContentSniffingEnabled())
- connection = createNSURLConnection(d->m_request.nsURLRequest(), d->m_proxy.get(), shouldUseCredentialStorage);
- else {
- NSMutableURLRequest *request = [d->m_request.nsURLRequest() mutableCopy];
- wkSetNSURLRequestShouldContentSniff(request, NO);
- connection = createNSURLConnection(request, d->m_proxy.get(), shouldUseCredentialStorage);
- [request release];
- }
+ createNSURLConnection(
+ d->m_proxy.get(),
+ shouldUseCredentialStorage,
+ d->m_shouldContentSniff || frame->settings()->localFileContentSniffingEnabled());
#ifndef BUILDING_ON_TIGER
bool scheduled = false;
@@ -276,7 +305,7 @@ bool ResourceHandle::start(Frame* frame)
SchedulePairHashSet::iterator end = scheduledPairs->end();
for (SchedulePairHashSet::iterator it = scheduledPairs->begin(); it != end; ++it) {
if (NSRunLoop *runLoop = (*it)->nsRunLoop()) {
- [connection scheduleInRunLoop:runLoop forMode:(NSString *)(*it)->mode()];
+ [connection() scheduleInRunLoop:runLoop forMode:(NSString *)(*it)->mode()];
scheduled = true;
}
}
@@ -285,7 +314,7 @@ bool ResourceHandle::start(Frame* frame)
// Start the connection if we did schedule with at least one runloop.
// We can't start the connection until we have one runloop scheduled.
if (scheduled)
- [connection start];
+ [connection() start];
else
d->m_startWhenScheduled = true;
#endif
@@ -294,15 +323,11 @@ bool ResourceHandle::start(Frame* frame)
isInitializingConnection = NO;
#endif
- LOG(Network, "Handle %p starting connection %p for %@", this, connection, d->m_request.nsURLRequest());
+ LOG(Network, "Handle %p starting connection %p for %@", this, connection(), firstRequest().nsURLRequest());
- d->m_connection = connection;
-
if (d->m_connection) {
- [connection release];
-
if (d->m_defersLoading)
- wkSetNSURLConnectionDefersCallbacks(d->m_connection.get(), YES);
+ wkSetNSURLConnectionDefersCallbacks(connection(), YES);
return true;
}
@@ -321,7 +346,7 @@ void ResourceHandle::cancel()
[[d->m_currentMacChallenge sender] cancelAuthenticationChallenge:d->m_currentMacChallenge];
if (!ResourceHandle::didSendBodyDataDelegateExists())
- disassociateStreamWithResourceHandle([d->m_request.nsURLRequest() HTTPBodyStream]);
+ disassociateStreamWithResourceHandle([firstRequest().nsURLRequest() HTTPBodyStream]);
[d->m_connection.get() cancel];
}
@@ -435,43 +460,63 @@ bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame*)
#endif
}
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame*)
+void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame)
{
+ LOG(Network, "ResourceHandle::loadResourceSynchronously:%@ allowStoredCredentials:%u", request.nsURLRequest(), storedCredentials);
+
NSError *nsError = nil;
-
NSURLResponse *nsURLResponse = nil;
NSData *result = nil;
ASSERT(!request.isEmpty());
- NSMutableURLRequest *mutableRequest = nil;
- if (!shouldContentSniffURL(request.url())) {
- mutableRequest = [[request.nsURLRequest() mutableCopy] autorelease];
- wkSetNSURLRequestShouldContentSniff(mutableRequest, NO);
- }
+#ifndef BUILDING_ON_TIGER
+ OwnPtr<WebCoreSynchronousLoaderClient> client = WebCoreSynchronousLoaderClient::create();
+ client->setAllowStoredCredentials(storedCredentials == AllowStoredCredentials);
- // If a URL already has cookies, then we'll ignore the 3rd party cookie policy and accept new cookies.
- NSHTTPCookieStorage *sharedStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
- if ([sharedStorage cookieAcceptPolicy] == NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain
- && [[sharedStorage cookiesForURL:request.url()] count]) {
- if (!mutableRequest)
- mutableRequest = [[request.nsURLRequest() mutableCopy] autorelease];
- [mutableRequest setMainDocumentURL:[mutableRequest URL]];
+ RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, client.get(), false /*defersLoading*/, true /*shouldContentSniff*/));
+
+ if (handle->d->m_scheduledFailureType != NoFailure) {
+ error = frame->loader()->blockedError(request);
+ return;
}
+
+ handle->createNSURLConnection(
+ handle->delegate(), // A synchronous request cannot turn into a download, so there is no need to proxy the delegate.
+ storedCredentials == AllowStoredCredentials,
+ handle->shouldContentSniff() || frame->settings()->localFileContentSniffingEnabled());
+
+ [handle->connection() scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:WebCoreSynchronousLoaderRunLoopMode];
+ [handle->connection() start];
- NSURLRequest *nsRequest = mutableRequest ? mutableRequest : request.nsURLRequest();
-
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ while (!client->isDone())
+ [[NSRunLoop currentRunLoop] runMode:WebCoreSynchronousLoaderRunLoopMode beforeDate:[NSDate distantFuture]];
+
+ result = client->data();
+ nsURLResponse = client->response();
+ nsError = client->error();
-#ifndef BUILDING_ON_TIGER
- result = [WebCoreSynchronousLoader loadRequest:nsRequest allowStoredCredentials:(storedCredentials == AllowStoredCredentials) returningResponse:&nsURLResponse error:&nsError];
+ [handle->connection() cancel];
+
#else
UNUSED_PARAM(storedCredentials);
- result = [NSURLConnection sendSynchronousRequest:nsRequest returningResponse:&nsURLResponse error:&nsError];
-#endif
+ UNUSED_PARAM(frame);
+ NSURLRequest *firstRequest = request.nsURLRequest();
+
+ // If a URL already has cookies, then we'll relax the 3rd party cookie policy and accept new cookies.
+ NSHTTPCookieStorage *sharedStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
+ if ([sharedStorage cookieAcceptPolicy] == NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain && [[sharedStorage cookiesForURL:[firstRequest URL]] count]) {
+ NSMutableURLRequest *mutableRequest = [[firstRequest mutableCopy] autorelease];
+ [mutableRequest setMainDocumentURL:[mutableRequest URL]];
+ firstRequest = mutableRequest;
+ }
+
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ result = [NSURLConnection sendSynchronousRequest:firstRequest returningResponse:&nsURLResponse error:&nsError];
END_BLOCK_OBJC_EXCEPTIONS;
+#endif
- if (nsError == nil)
+ if (!nsError)
response = nsURLResponse;
else {
response = ResourceResponse(request.url(), String(), 0, String(), String());
@@ -536,16 +581,25 @@ void ResourceHandle::didReceiveAuthenticationChallenge(const AuthenticationChall
}
#ifndef BUILDING_ON_TIGER
- if (!challenge.previousFailureCount() && (!client() || client()->shouldUseCredentialStorage(this))) {
- Credential credential = CredentialStorage::get(challenge.protectionSpace());
- if (!credential.isEmpty() && credential != d->m_initialCredential) {
- ASSERT(credential.persistence() == CredentialPersistenceNone);
- if (challenge.failureResponse().httpStatusCode() == 401) {
- // Store the credential back, possibly adding it as a default for this directory.
- CredentialStorage::set(credential, challenge.protectionSpace(), d->m_request.url());
+ if (!client() || client()->shouldUseCredentialStorage(this)) {
+ if (!d->m_initialCredential.isEmpty() || challenge.previousFailureCount()) {
+ // The stored credential wasn't accepted, stop using it.
+ // There is a race condition here, since a different credential might have already been stored by another ResourceHandle,
+ // but the observable effect should be very minor, if any.
+ CredentialStorage::remove(challenge.protectionSpace());
+ }
+
+ if (!challenge.previousFailureCount()) {
+ Credential credential = CredentialStorage::get(challenge.protectionSpace());
+ if (!credential.isEmpty() && credential != d->m_initialCredential) {
+ ASSERT(credential.persistence() == CredentialPersistenceNone);
+ if (challenge.failureResponse().httpStatusCode() == 401) {
+ // Store the credential back, possibly adding it as a default for this directory.
+ CredentialStorage::set(credential, challenge.protectionSpace(), firstRequest().url());
+ }
+ [challenge.sender() useCredential:mac(credential) forAuthenticationChallenge:mac(challenge)];
+ return;
}
- [challenge.sender() useCredential:mac(credential) forAuthenticationChallenge:mac(challenge)];
- return;
}
}
#endif
@@ -604,7 +658,7 @@ void ResourceHandle::receivedCredential(const AuthenticationChallenge& challenge
Credential webCredential(credential, CredentialPersistenceNone);
KURL urlToStore;
if (challenge.failureResponse().httpStatusCode() == 401)
- urlToStore = d->m_request.url();
+ urlToStore = firstRequest().url();
CredentialStorage::set(webCredential, core([d->m_currentMacChallenge protectionSpace]), urlToStore);
[[d->m_currentMacChallenge sender] useCredential:mac(webCredential) forAuthenticationChallenge:d->m_currentMacChallenge];
} else
@@ -679,11 +733,11 @@ void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challen
NSMutableURLRequest *mutableRequest = [newRequest mutableCopy];
[mutableRequest setHTTPMethod:lastHTTPMethod];
- FormData* body = m_handle->request().httpBody();
+ FormData* body = m_handle->firstRequest().httpBody();
if (!equalIgnoringCase(lastHTTPMethod, "GET") && body && !body->isEmpty())
WebCore::setHTTPBody(mutableRequest, body);
- String originalContentType = m_handle->request().httpContentType();
+ String originalContentType = m_handle->firstRequest().httpContentType();
if (!originalContentType.isEmpty())
[mutableRequest setValue:originalContentType forHTTPHeaderField:@"Content-Type"];
@@ -779,7 +833,7 @@ void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challen
if (statusCode != 304)
[r adjustMIMETypeIfNecessary];
- if ([m_handle->request().nsURLRequest() _propertyForKey:@"ForceHTMLMIMEType"])
+ if ([m_handle->firstRequest().nsURLRequest() _propertyForKey:@"ForceHTMLMIMEType"])
[r _setMIMEType:@"text/html"];
#if ENABLE(WML)
@@ -855,7 +909,7 @@ void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challen
CallbackGuard guard;
if (!ResourceHandle::didSendBodyDataDelegateExists())
- disassociateStreamWithResourceHandle([m_handle->request().nsURLRequest() HTTPBodyStream]);
+ disassociateStreamWithResourceHandle([m_handle->firstRequest().nsURLRequest() HTTPBodyStream]);
m_handle->client()->didFinishLoading(m_handle);
}
@@ -871,7 +925,7 @@ void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challen
CallbackGuard guard;
if (!ResourceHandle::didSendBodyDataDelegateExists())
- disassociateStreamWithResourceHandle([m_handle->request().nsURLRequest() HTTPBodyStream]);
+ disassociateStreamWithResourceHandle([m_handle->firstRequest().nsURLRequest() HTTPBodyStream]);
m_handle->client()->didFail(m_handle, error);
}
@@ -947,220 +1001,69 @@ void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challen
#ifndef BUILDING_ON_TIGER
-@implementation WebCoreSynchronousLoader
-
-- (BOOL)_isDone
-{
- return m_isDone;
-}
-
-- (void)dealloc
+WebCoreSynchronousLoaderClient::~WebCoreSynchronousLoaderClient()
{
- [m_url release];
- [m_user release];
- [m_pass release];
[m_response release];
[m_data release];
[m_error release];
-
- [super dealloc];
}
-- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
+void WebCoreSynchronousLoaderClient::willSendRequest(ResourceHandle* handle, ResourceRequest& request, const ResourceResponse& /*redirectResponse*/)
{
- UNUSED_PARAM(connection);
-
- LOG(Network, "WebCoreSynchronousLoader delegate connection:%p willSendRequest:%@ redirectResponse:%p", connection, [newRequest description], redirectResponse);
-
// FIXME: This needs to be fixed to follow the redirect correctly even for cross-domain requests.
- if (m_url && !protocolHostAndPortAreEqual(m_url, [newRequest URL])) {
+ if (!protocolHostAndPortAreEqual(handle->firstRequest().url(), request.url())) {
+ ASSERT(!m_error);
m_error = [[NSError alloc] initWithDomain:NSURLErrorDomain code:NSURLErrorBadServerResponse userInfo:nil];
- m_isDone = YES;
- return nil;
- }
-
- NSURL *copy = [[newRequest URL] copy];
- [m_url release];
- m_url = copy;
-
- if (redirectResponse) {
- // Take user/pass out of the URL.
- [m_user release];
- [m_pass release];
- m_user = [[m_url user] copy];
- m_pass = [[m_url password] copy];
- if (m_user || m_pass) {
- ResourceRequest requestWithoutCredentials = newRequest;
- requestWithoutCredentials.removeCredentials();
- return requestWithoutCredentials.nsURLRequest();
- }
+ m_isDone = true;
+ request = 0;
+ return;
}
-
- return newRequest;
}
-- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection *)connection
+bool WebCoreSynchronousLoaderClient::shouldUseCredentialStorage(ResourceHandle*)
{
- UNUSED_PARAM(connection);
-
- LOG(Network, "WebCoreSynchronousLoader delegate connectionShouldUseCredentialStorage:%p", connection);
-
// FIXME: We should ask FrameLoaderClient whether using credential storage is globally forbidden.
return m_allowStoredCredentials;
}
-- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
+bool WebCoreSynchronousLoaderClient::canAuthenticateAgainstProtectionSpace(ResourceHandle*, const ProtectionSpace&)
{
- UNUSED_PARAM(connection);
-
- LOG(Network, "WebCoreSynchronousLoader delegate connection:%p didReceiveAuthenticationChallenge:%p", connection, challenge);
+ // FIXME: We should ask FrameLoaderClient.
+ return true;
+}
+#endif
- if (m_user && m_pass) {
- NSURLCredential *credential = [[NSURLCredential alloc] initWithUser:m_user
- password:m_pass
- persistence:NSURLCredentialPersistenceNone];
- KURL urlToStore;
- if ([[challenge failureResponse] isKindOfClass:[NSHTTPURLResponse class]] && [(NSHTTPURLResponse*)[challenge failureResponse] statusCode] == 401)
- urlToStore = m_url;
- CredentialStorage::set(core(credential), core([challenge protectionSpace]), urlToStore);
-
- [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
- [credential release];
- [m_user release];
- [m_pass release];
- m_user = 0;
- m_pass = 0;
- return;
- }
- if ([challenge previousFailureCount] == 0 && m_allowStoredCredentials) {
- Credential credential = CredentialStorage::get(core([challenge protectionSpace]));
- if (!credential.isEmpty() && credential != m_initialCredential) {
- ASSERT(credential.persistence() == CredentialPersistenceNone);
- if ([[challenge failureResponse] isKindOfClass:[NSHTTPURLResponse class]] && [(NSHTTPURLResponse *)[challenge failureResponse] statusCode] == 401) {
- // Store the credential back, possibly adding it as a default for this directory.
- CredentialStorage::set(credential, core([challenge protectionSpace]), m_url);
- }
- [[challenge sender] useCredential:mac(credential) forAuthenticationChallenge:challenge];
- return;
- }
- }
+void WebCoreSynchronousLoaderClient::didReceiveAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge& challenge)
+{
// FIXME: The user should be asked for credentials, as in async case.
- [[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge];
+ [challenge.sender() continueWithoutCredentialForAuthenticationChallenge:challenge.nsURLAuthenticationChallenge()];
}
-- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
+void WebCoreSynchronousLoaderClient::didReceiveResponse(ResourceHandle*, const ResourceResponse& response)
{
- UNUSED_PARAM(connection);
-
- LOG(Network, "WebCoreSynchronousLoader delegate connection:%p didReceiveResponse:%p (HTTP status %d, reported MIMEType '%s')", connection, response, [response respondsToSelector:@selector(statusCode)] ? [(id)response statusCode] : 0, [[response MIMEType] UTF8String]);
-
- NSURLResponse *r = [response copy];
-
[m_response release];
- m_response = r;
+ m_response = [response.nsURLResponse() copy];
}
-- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
+void WebCoreSynchronousLoaderClient::didReceiveData(ResourceHandle*, const char* data, int length, int /*lengthReceived*/)
{
- UNUSED_PARAM(connection);
-
- LOG(Network, "WebCoreSynchronousLoader delegate connection:%p didReceiveData:%p", connection, data);
-
if (!m_data)
m_data = [[NSMutableData alloc] init];
-
- [m_data appendData:data];
+ [m_data appendBytes:data length:length];
}
-- (void)connectionDidFinishLoading:(NSURLConnection *)connection
+void WebCoreSynchronousLoaderClient::didFinishLoading(ResourceHandle*)
{
- UNUSED_PARAM(connection);
-
- LOG(Network, "WebCoreSynchronousLoader delegate connectionDidFinishLoading:%p", connection);
-
- m_isDone = YES;
+ m_isDone = true;
}
-- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
+void WebCoreSynchronousLoaderClient::didFail(ResourceHandle*, const ResourceError& error)
{
- UNUSED_PARAM(connection);
-
- LOG(Network, "WebCoreSynchronousLoader delegate connection:%p didFailWithError:%@", connection, error);
-
ASSERT(!m_error);
-
- m_error = [error retain];
- m_isDone = YES;
-}
-
-- (NSData *)_data
-{
- return [[m_data retain] autorelease];
-}
-
-- (NSURLResponse *)_response
-{
- return [[m_response retain] autorelease];
-}
-- (NSError *)_error
-{
- return [[m_error retain] autorelease];
+ m_error = [error copy];
+ m_isDone = true;
}
-+ (NSData *)loadRequest:(NSURLRequest *)request allowStoredCredentials:(BOOL)allowStoredCredentials returningResponse:(NSURLResponse **)response error:(NSError **)error
-{
- LOG(Network, "WebCoreSynchronousLoader loadRequest:%@ allowStoredCredentials:%u", request, allowStoredCredentials);
-
- WebCoreSynchronousLoader *delegate = [[WebCoreSynchronousLoader alloc] init];
-
- KURL url([request URL]);
- delegate->m_user = [nsStringNilIfEmpty(url.user()) retain];
- delegate->m_pass = [nsStringNilIfEmpty(url.pass()) retain];
- delegate->m_allowStoredCredentials = allowStoredCredentials;
-
- NSURLConnection *connection;
-
- // Take user/pass out of the URL.
- // Credentials for ftp can only be passed in URL, the connection:didReceiveAuthenticationChallenge: delegate call won't be made.
- if ((delegate->m_user || delegate->m_pass) && url.protocolInHTTPFamily()) {
- ResourceRequest requestWithoutCredentials = request;
- requestWithoutCredentials.removeCredentials();
- connection = createNSURLConnection(requestWithoutCredentials.nsURLRequest(), delegate, allowStoredCredentials);
- } else {
- // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
- // try and reuse the credential preemptively, as allowed by RFC 2617.
- ResourceRequest requestWithInitialCredentials = request;
- if (allowStoredCredentials && url.protocolInHTTPFamily())
- delegate->m_initialCredential = CredentialStorage::get(url);
-
- if (!delegate->m_initialCredential.isEmpty()) {
- String authHeader = "Basic " + encodeBasicAuthorization(delegate->m_initialCredential.user(), delegate->m_initialCredential.password());
- requestWithInitialCredentials.addHTTPHeaderField("Authorization", authHeader);
- }
- connection = createNSURLConnection(requestWithInitialCredentials.nsURLRequest(), delegate, allowStoredCredentials);
- }
-
- [connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:WebCoreSynchronousLoaderRunLoopMode];
- [connection start];
-
- while (![delegate _isDone])
- [[NSRunLoop currentRunLoop] runMode:WebCoreSynchronousLoaderRunLoopMode beforeDate:[NSDate distantFuture]];
-
- NSData *data = [delegate _data];
- *response = [delegate _response];
- *error = [delegate _error];
-
- [connection cancel];
-
- [connection release];
- [delegate release];
-
- LOG(Network, "WebCoreSynchronousLoader done");
-
- return data;
-}
-
-@end
-
#endif
diff --git a/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index 1ae24ff..131f924 100644
--- a/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -150,7 +150,7 @@ QNetworkReplyHandler::QNetworkReplyHandler(ResourceHandle* handle, LoadMode load
, m_shouldForwardData(false)
, m_redirectionTries(gMaxRecursionLimit)
{
- const ResourceRequest &r = m_resourceHandle->request();
+ const ResourceRequest &r = m_resourceHandle->firstRequest();
if (r.httpMethod() == "GET")
m_method = QNetworkAccessManager::GetOperation;
@@ -309,7 +309,7 @@ void QNetworkReplyHandler::sendResponseIfNeeded()
}
KURL url(m_reply->url());
- ResourceResponse response(url, mimeType,
+ ResourceResponse response(url, mimeType.lower(),
m_reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(),
encoding, String());
@@ -358,7 +358,7 @@ void QNetworkReplyHandler::sendResponseIfNeeded()
}
m_redirected = true;
- ResourceRequest newRequest = m_resourceHandle->request();
+ ResourceRequest newRequest = m_resourceHandle->firstRequest();
newRequest.setURL(newUrl);
if (((statusCode >= 301 && statusCode <= 303) || statusCode == 307) && newRequest.httpMethod() == "POST") {
@@ -442,7 +442,7 @@ void QNetworkReplyHandler::start()
m_reply = manager->get(m_request);
break;
case QNetworkAccessManager::PostOperation: {
- FormDataIODevice* postDevice = new FormDataIODevice(d->m_request.httpBody());
+ FormDataIODevice* postDevice = new FormDataIODevice(d->m_firstRequest.httpBody());
m_reply = manager->post(m_request, postDevice);
postDevice->setParent(m_reply);
break;
@@ -451,7 +451,7 @@ void QNetworkReplyHandler::start()
m_reply = manager->head(m_request);
break;
case QNetworkAccessManager::PutOperation: {
- FormDataIODevice* putDevice = new FormDataIODevice(d->m_request.httpBody());
+ FormDataIODevice* putDevice = new FormDataIODevice(d->m_firstRequest.httpBody());
m_reply = manager->put(m_request, putDevice);
putDevice->setParent(m_reply);
break;
@@ -464,7 +464,7 @@ void QNetworkReplyHandler::start()
#endif
#if QT_VERSION >= 0x040700
case QNetworkAccessManager::CustomOperation:
- m_reply = manager->sendCustomRequest(m_request, m_resourceHandle->request().httpMethod().latin1().data());
+ m_reply = manager->sendCustomRequest(m_request, m_resourceHandle->firstRequest().httpMethod().latin1().data());
break;
#endif
case QNetworkAccessManager::UnknownOperation: {
@@ -494,7 +494,7 @@ void QNetworkReplyHandler::start()
connect(m_reply, SIGNAL(readyRead()),
this, SLOT(forwardData()), SIGNAL_CONN);
- if (m_resourceHandle->request().reportUploadProgress()) {
+ if (m_resourceHandle->firstRequest().reportUploadProgress()) {
connect(m_reply, SIGNAL(uploadProgress(qint64, qint64)),
this, SLOT(uploadProgress(qint64, qint64)), SIGNAL_CONN);
}
diff --git a/WebCore/platform/network/qt/ResourceHandleQt.cpp b/WebCore/platform/network/qt/ResourceHandleQt.cpp
index ff75a94..f91eecb 100644
--- a/WebCore/platform/network/qt/ResourceHandleQt.cpp
+++ b/WebCore/platform/network/qt/ResourceHandleQt.cpp
@@ -43,7 +43,6 @@
// FIXME: WebCore including these headers from WebKit is a massive layering violation.
#include "qwebframe_p.h"
-#include "qwebpage_p.h"
#include <QAbstractNetworkCache>
#include <QCoreApplication>
@@ -130,10 +129,10 @@ bool ResourceHandle::start(Frame* frame)
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 QNetworkRequest.
- KURL urlWithCredentials(d->m_request.url());
+ KURL urlWithCredentials(firstRequest().url());
urlWithCredentials.setUser(d->m_user);
urlWithCredentials.setPass(d->m_pass);
- d->m_request.setURL(urlWithCredentials);
+ d->m_firstRequest.setURL(urlWithCredentials);
}
getInternal()->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();
@@ -195,10 +194,10 @@ void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, S
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 QNetworkRequest.
- KURL urlWithCredentials(d->m_request.url());
+ KURL urlWithCredentials(d->m_firstRequest.url());
urlWithCredentials.setUser(d->m_user);
urlWithCredentials.setPass(d->m_pass);
- d->m_request.setURL(urlWithCredentials);
+ d->m_firstRequest.setURL(urlWithCredentials);
}
d->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();
d->m_job = new QNetworkReplyHandler(handle.get(), QNetworkReplyHandler::LoadNormal);
diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index e4f2a4b..96a2f25 100644
--- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -188,9 +188,9 @@ static void restartedCallback(SoupMessage* msg, gpointer data)
char* uri = soup_uri_to_string(soup_message_get_uri(msg), false);
String location = String(uri);
g_free(uri);
- KURL newURL = KURL(handle->request().url(), location);
+ KURL newURL = KURL(handle->firstRequest().url(), location);
- ResourceRequest request = handle->request();
+ ResourceRequest request = handle->firstRequest();
ResourceResponse response;
request.setURL(newURL);
request.setHTTPMethod(msg->method);
@@ -354,7 +354,7 @@ static gboolean parseDataUrl(gpointer callbackData)
if (!client)
return false;
- String url = handle->request().url().string();
+ String url = handle->firstRequest().url().string();
ASSERT(url.startsWith("data:", false));
int index = url.find(',');
@@ -377,7 +377,7 @@ static gboolean parseDataUrl(gpointer callbackData)
String charset = extractCharsetFromMediaType(mediaType);
ResourceResponse response;
- response.setURL(handle->request().url());
+ response.setURL(handle->firstRequest().url());
response.setMimeType(mimeType);
if (isBase64) {
@@ -478,7 +478,7 @@ static bool startHttp(ResourceHandle* handle)
ResourceHandleInternal* d = handle->getInternal();
- ResourceRequest request(handle->request());
+ ResourceRequest request(handle->firstRequest());
KURL url(request.url());
url.removeFragmentIdentifier();
request.setURL(url);
@@ -504,7 +504,7 @@ static bool startHttp(ResourceHandle* handle)
#endif
g_object_set_data(G_OBJECT(d->m_msg), "resourceHandle", reinterpret_cast<void*>(handle));
- FormData* httpBody = d->m_request.httpBody();
+ FormData* httpBody = d->m_firstRequest.httpBody();
if (httpBody && !httpBody->isEmpty()) {
size_t numElements = httpBody->elements().size();
@@ -512,7 +512,7 @@ static bool startHttp(ResourceHandle* handle)
if (numElements < 2) {
Vector<char> body;
httpBody->flatten(body);
- soup_message_set_request(d->m_msg, d->m_request.httpContentType().utf8().data(),
+ soup_message_set_request(d->m_msg, d->m_firstRequest.httpContentType().utf8().data(),
SOUP_MEMORY_COPY, body.data(), body.size());
} else {
/*
@@ -590,7 +590,7 @@ bool ResourceHandle::start(Frame* frame)
if (frame && !frame->page())
return false;
- KURL url = request().url();
+ KURL url = firstRequest().url();
String urlString = url.string();
String protocol = url.protocol();
@@ -889,7 +889,7 @@ static bool startGio(ResourceHandle* handle, KURL url)
ResourceHandleInternal* d = handle->getInternal();
- if (handle->request().httpMethod() != "GET" && handle->request().httpMethod() != "POST")
+ if (handle->firstRequest().httpMethod() != "GET" && handle->firstRequest().httpMethod() != "POST")
return false;
// GIO doesn't know how to handle refs and queries, so remove them
diff --git a/WebCore/platform/qt/CursorQt.cpp b/WebCore/platform/qt/CursorQt.cpp
index 2e495e7..6017daa 100644
--- a/WebCore/platform/qt/CursorQt.cpp
+++ b/WebCore/platform/qt/CursorQt.cpp
@@ -44,12 +44,12 @@
namespace WebCore {
Cursor::Cursor(PlatformCursor p)
- : m_impl(p)
+ : m_platformCursor(p)
{
}
Cursor::Cursor(const Cursor& other)
- : m_impl(other.m_impl)
+ : m_platformCursor(other.m_platformCursor)
{
}
@@ -61,13 +61,13 @@ Cursor::Cursor(Image* image, const IntPoint& hotSpot)
{
#ifndef QT_NO_CURSOR
IntPoint effectiveHotSpot = determineHotSpot(image, hotSpot);
- m_impl = QCursor(*(image->nativeImageForCurrentFrame()), effectiveHotSpot.x(), effectiveHotSpot.y());
+ m_platformCursor = QCursor(*(image->nativeImageForCurrentFrame()), effectiveHotSpot.x(), effectiveHotSpot.y());
#endif
}
Cursor& Cursor::operator=(const Cursor& other)
{
- m_impl = other.m_impl;
+ m_platformCursor = other.m_platformCursor;
return *this;
}
diff --git a/WebCore/platform/qt/GeolocationServiceQt.cpp b/WebCore/platform/qt/GeolocationServiceQt.cpp
index e24d497..3562eb9 100644
--- a/WebCore/platform/qt/GeolocationServiceQt.cpp
+++ b/WebCore/platform/qt/GeolocationServiceQt.cpp
@@ -55,6 +55,7 @@ GeolocationServiceQt::GeolocationServiceQt(GeolocationServiceClient* client)
GeolocationServiceQt::~GeolocationServiceQt()
{
+ delete m_location;
}
void GeolocationServiceQt::positionUpdated(const QGeoPositionInfo &geoPosition)
@@ -65,20 +66,19 @@ void GeolocationServiceQt::positionUpdated(const QGeoPositionInfo &geoPosition)
QGeoCoordinate coord = geoPosition.coordinate();
double latitude = coord.latitude();
double longitude = coord.longitude();
- bool providesAltitude = true;
+ bool providesAltitude = (geoPosition.coordinate().type() == QGeoCoordinate::Coordinate3D);
double altitude = coord.altitude();
- double accuracy = geoPosition.hasAttribute(QGeoPositionInfo::HorizontalAccuracy) ?
- geoPosition.attribute(QGeoPositionInfo::HorizontalAccuracy) : 0.0;
+ double accuracy = geoPosition.attribute(QGeoPositionInfo::HorizontalAccuracy);
bool providesAltitudeAccuracy = geoPosition.hasAttribute(QGeoPositionInfo::VerticalAccuracy);
- double altitudeAccuracy = providesAltitudeAccuracy ? geoPosition.attribute(QGeoPositionInfo::VerticalAccuracy) : 0.0;
+ double altitudeAccuracy = geoPosition.attribute(QGeoPositionInfo::VerticalAccuracy);
bool providesHeading = geoPosition.hasAttribute(QGeoPositionInfo::Direction);
- double heading = providesHeading ? geoPosition.attribute(QGeoPositionInfo::Direction) : 0.0;
+ double heading = geoPosition.attribute(QGeoPositionInfo::Direction);
bool providesSpeed = geoPosition.hasAttribute(QGeoPositionInfo::GroundSpeed);
- double speed = providesSpeed ? geoPosition.attribute(QGeoPositionInfo::GroundSpeed) : 0.0;
+ double speed = geoPosition.attribute(QGeoPositionInfo::GroundSpeed);
RefPtr<Coordinates> coordinates = Coordinates::create(latitude, longitude, providesAltitude, altitude,
accuracy, providesAltitudeAccuracy, altitudeAccuracy,
diff --git a/WebCore/platform/qt/RenderThemeQt.cpp b/WebCore/platform/qt/RenderThemeQt.cpp
index deb9037..22d99a1 100644
--- a/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/WebCore/platform/qt/RenderThemeQt.cpp
@@ -58,8 +58,6 @@
#include "ScrollbarThemeQt.h"
#include "TimeRanges.h"
#include "UserAgentStyleSheets.h"
-#include "qwebpage.h"
-
#include <QApplication>
#include <QColor>
diff --git a/WebCore/platform/qt/WidgetQt.cpp b/WebCore/platform/qt/WidgetQt.cpp
index 00a58a4..0903b6e 100644
--- a/WebCore/platform/qt/WidgetQt.cpp
+++ b/WebCore/platform/qt/WidgetQt.cpp
@@ -41,14 +41,11 @@
#include "QWebPageClient.h"
#include "ScrollView.h"
-#include "qwebframe.h"
-#include "qwebframe_p.h"
-#include "qwebpage.h"
-
#include <QCoreApplication>
#include <QDebug>
#include <QPaintEngine>
#include <QPainter>
+#include <QWidget>
namespace WebCore {
diff --git a/WebCore/platform/text/LineEnding.cpp b/WebCore/platform/text/LineEnding.cpp
new file mode 100644
index 0000000..545f22b
--- /dev/null
+++ b/WebCore/platform/text/LineEnding.cpp
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 "LineEnding.h"
+
+#include "PlatformString.h"
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+// Normalize all line-endings to CRLF.
+CString normalizeLineEndingsToCRLF(const CString& from)
+{
+ unsigned newLen = 0;
+ const char* p = from.data();
+ while (char c = *p++) {
+ if (c == '\r') {
+ // Safe to look ahead because of trailing '\0'.
+ if (*p != '\n') {
+ // Turn CR into CRLF.
+ newLen += 2;
+ }
+ } else if (c == '\n') {
+ // Turn LF into CRLF.
+ newLen += 2;
+ } else {
+ // Leave other characters alone.
+ newLen += 1;
+ }
+ }
+ if (newLen == from.length())
+ return from;
+
+ // Make a copy of the string.
+ p = from.data();
+ char* q;
+ CString result = CString::newUninitialized(newLen, q);
+ while (char c = *p++) {
+ if (c == '\r') {
+ // Safe to look ahead because of trailing '\0'.
+ if (*p != '\n') {
+ // Turn CR into CRLF.
+ *q++ = '\r';
+ *q++ = '\n';
+ }
+ } else if (c == '\n') {
+ // Turn LF into CRLF.
+ *q++ = '\r';
+ *q++ = '\n';
+ } else {
+ // Leave other characters alone.
+ *q++ = c;
+ }
+ }
+ return result;
+}
+
+// Normalize all line-endings to CR or LF.
+static CString normalizeToCROrLF(const CString& from, bool toCR)
+{
+ unsigned newLen = 0;
+ bool needFix = false;
+ const char* p = from.data();
+ char fromEndingChar = toCR ? '\n' : '\r';
+ char toEndingChar = toCR ? '\r' : '\n';
+ while (char c = *p++) {
+ if (c == '\r' && *p == '\n') {
+ // Turn CRLF into CR or LF.
+ p++;
+ needFix = true;
+ } else if (c == fromEndingChar) {
+ // Turn CR/LF into LF/CR.
+ needFix = true;
+ }
+ newLen += 1;
+ }
+ if (!needFix)
+ return from;
+
+ // Make a copy of the string.
+ p = from.data();
+ char* q;
+ CString result = CString::newUninitialized(newLen, q);
+ while (char c = *p++) {
+ if (c == '\r' && *p == '\n') {
+ // Turn CRLF or CR into CR or LF.
+ p++;
+ *q++ = toEndingChar;
+ } else if (c == fromEndingChar) {
+ // Turn CR/LF into LF/CR.
+ *q++ = toEndingChar;
+ } else {
+ // Leave other characters alone.
+ *q++ = c;
+ }
+ }
+ return result;
+}
+
+// Normalize all line-endings to CR.
+CString normalizeLineEndingsToCR(const CString& from)
+{
+ return normalizeToCROrLF(from, true);
+}
+
+// Normalize all line-endings to LF.
+CString normalizeLineEndingsToLF(const CString& from)
+{
+ return normalizeToCROrLF(from, false);
+}
+
+CString normalizeLineEndingsToNative(const CString& from)
+{
+#if OS(WINDOWS)
+ return normalizeLineEndingsToCRLF(from);
+#else
+ return normalizeLineEndingsToLF(from);
+#endif
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/text/LineEnding.h b/WebCore/platform/text/LineEnding.h
new file mode 100644
index 0000000..9c3e2aa
--- /dev/null
+++ b/WebCore/platform/text/LineEnding.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 LineEnding_h
+#define LineEnding_h
+
+namespace WTF {
+class CString;
+}
+
+namespace WebCore {
+
+// Normalize all line-endings in the given string to CRLF.
+WTF::CString normalizeLineEndingsToCRLF(const WTF::CString&);
+
+// Normalize all line-endings in the given string to CR.
+WTF::CString normalizeLineEndingsToCR(const WTF::CString&);
+
+// Normalize all line-endings in the given string to LF.
+WTF::CString normalizeLineEndingsToLF(const WTF::CString&);
+
+// Normalize all line-endings in the given string to the native line-endings.
+// (Normalize to CRLF on Windows and normalize to LF on all other platforms.)
+WTF::CString normalizeLineEndingsToNative(const WTF::CString&);
+
+} // namespace WebCore
+
+#endif // LineEnding_h
diff --git a/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
index fbd0011..e6af7ef 100644
--- a/WebCore/platform/win/ClipboardUtilitiesWin.cpp
+++ b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
@@ -32,10 +32,10 @@
#include "TextEncoding.h"
#include "markup.h"
#include <CoreFoundation/CoreFoundation.h>
+#include <shlwapi.h>
+#include <wininet.h> // for INTERNET_MAX_URL_LENGTH
#include <wtf/RetainPtr.h>
#include <wtf/text/CString.h>
-#include <shlwapi.h>
-#include <wininet.h> // for INTERNET_MAX_URL_LENGTH
namespace WebCore {
@@ -97,7 +97,7 @@ static String extractURL(const String &inURL, String* title)
return url;
}
-//Firefox text/html
+// Firefox text/html
static FORMATETC* texthtmlFormat()
{
static UINT cf = RegisterClipboardFormat(L"text/html");
@@ -109,7 +109,7 @@ HGLOBAL createGlobalData(const KURL& url, const String& title)
{
String mutableURL(url.string());
String mutableTitle(title);
- SIZE_T size = mutableURL.length() + mutableTitle.length() + 2; // +1 for "\n" and +1 for null terminator
+ SIZE_T size = mutableURL.length() + mutableTitle.length() + 2; // +1 for "\n" and +1 for null terminator
HGLOBAL cbData = ::GlobalAlloc(GPTR, size * sizeof(UChar));
if (cbData) {
@@ -155,7 +155,7 @@ static void append(Vector<char>& vector, const CString& string)
}
// Documentation for the CF_HTML format is available at http://msdn.microsoft.com/workshop/networking/clipboard/htmlclipboard.asp
-void markupToCF_HTML(const String& markup, const String& srcURL, Vector<char>& result)
+void markupToCFHTML(const String& markup, const String& srcURL, Vector<char>& result)
{
if (markup.isEmpty())
return;
@@ -256,7 +256,7 @@ FORMATETC* filenameFormat()
return &urlFormat;
}
-//MSIE HTML Format
+// MSIE HTML Format
FORMATETC* htmlFormat()
{
static UINT cf = RegisterClipboardFormat(L"HTML Format");
@@ -294,18 +294,17 @@ String getURL(IDataObject* dataObject, DragData::FilenameConversionPolicy filena
STGMEDIUM store;
String url;
success = false;
- if (getWebLocData(dataObject, url, title)) {
+ if (getWebLocData(dataObject, url, title))
success = true;
- return url;
- } else if (SUCCEEDED(dataObject->GetData(urlWFormat(), &store))) {
- //URL using unicode
+ else if (SUCCEEDED(dataObject->GetData(urlWFormat(), &store))) {
+ // URL using Unicode
UChar* data = (UChar*)GlobalLock(store.hGlobal);
url = extractURL(String(data), title);
GlobalUnlock(store.hGlobal);
ReleaseStgMedium(&store);
success = true;
} else if (SUCCEEDED(dataObject->GetData(urlFormat(), &store))) {
- //URL using ascii
+ // URL using ASCII
char* data = (char*)GlobalLock(store.hGlobal);
url = extractURL(String(data), title);
GlobalUnlock(store.hGlobal);
@@ -349,14 +348,14 @@ String getPlainText(IDataObject* dataObject, bool& success)
String text;
success = false;
if (SUCCEEDED(dataObject->GetData(plainTextWFormat(), &store))) {
- //unicode text
+ // Unicode text
UChar* data = (UChar*)GlobalLock(store.hGlobal);
text = String(data);
GlobalUnlock(store.hGlobal);
ReleaseStgMedium(&store);
success = true;
} else if (SUCCEEDED(dataObject->GetData(plainTextFormat(), &store))) {
- //ascii text
+ // ASCII text
char* data = (char*)GlobalLock(store.hGlobal);
text = String(data);
GlobalUnlock(store.hGlobal);
@@ -372,40 +371,55 @@ String getPlainText(IDataObject* dataObject, bool& success)
return text;
}
+String getTextHTML(IDataObject* data, bool& success)
+{
+ STGMEDIUM store;
+ String html;
+ success = false;
+ if (SUCCEEDED(data->GetData(texthtmlFormat(), &store))) {
+ UChar* data = static_cast<UChar*>(GlobalLock(store.hGlobal));
+ html = String(data);
+ GlobalUnlock(store.hGlobal);
+ ReleaseStgMedium(&store);
+ success = true;
+ }
+ return html;
+}
+
PassRefPtr<DocumentFragment> fragmentFromFilenames(Document*, const IDataObject*)
{
- //FIXME: We should be able to create fragments from files
+ // FIXME: We should be able to create fragments from files
return 0;
}
bool containsFilenames(const IDataObject*)
{
- //FIXME: We'll want to update this once we can produce fragments from files
+ // FIXME: We'll want to update this once we can produce fragments from files
return false;
}
-//Convert a String containing CF_HTML formatted text to a DocumentFragment
-PassRefPtr<DocumentFragment> fragmentFromCF_HTML(Document* doc, const String& cf_html)
+// Convert a String containing CF_HTML formatted text to a DocumentFragment
+PassRefPtr<DocumentFragment> fragmentFromCFHTML(Document* doc, const String& cfhtml)
{
// obtain baseURL if present
String srcURLStr("sourceURL:");
String srcURL;
- unsigned lineStart = cf_html.find(srcURLStr, 0, false);
+ unsigned lineStart = cfhtml.find(srcURLStr, 0, false);
if (lineStart != -1) {
- unsigned srcEnd = cf_html.find("\n", lineStart, false);
+ unsigned srcEnd = cfhtml.find("\n", lineStart, false);
unsigned srcStart = lineStart+srcURLStr.length();
- String rawSrcURL = cf_html.substring(srcStart, srcEnd-srcStart);
+ String rawSrcURL = cfhtml.substring(srcStart, srcEnd-srcStart);
replaceNBSPWithSpace(rawSrcURL);
srcURL = rawSrcURL.stripWhiteSpace();
}
// find the markup between "<!--StartFragment -->" and "<!--EndFragment -->", accounting for browser quirks
- unsigned markupStart = cf_html.find("<html", 0, false);
- unsigned tagStart = cf_html.find("startfragment", markupStart, false);
- unsigned fragmentStart = cf_html.find('>', tagStart) + 1;
- unsigned tagEnd = cf_html.find("endfragment", fragmentStart, false);
- unsigned fragmentEnd = cf_html.reverseFind('<', tagEnd);
- String markup = cf_html.substring(fragmentStart, fragmentEnd - fragmentStart).stripWhiteSpace();
+ unsigned markupStart = cfhtml.find("<html", 0, false);
+ unsigned tagStart = cfhtml.find("startfragment", markupStart, false);
+ unsigned fragmentStart = cfhtml.find('>', tagStart) + 1;
+ unsigned tagEnd = cfhtml.find("endfragment", fragmentStart, false);
+ unsigned fragmentEnd = cfhtml.reverseFind('<', tagEnd);
+ String markup = cfhtml.substring(fragmentStart, fragmentEnd - fragmentStart).stripWhiteSpace();
return createFragmentFromMarkup(doc, markup, srcURL, FragmentScriptingNotAllowed);
}
@@ -420,23 +434,19 @@ PassRefPtr<DocumentFragment> fragmentFromHTML(Document* doc, IDataObject* data)
String html;
String srcURL;
if (SUCCEEDED(data->GetData(htmlFormat(), &store))) {
- //MS HTML Format parsing
+ // MS HTML Format parsing
char* data = (char*)GlobalLock(store.hGlobal);
SIZE_T dataSize = ::GlobalSize(store.hGlobal);
- String cf_html(UTF8Encoding().decode(data, dataSize));
+ String cfhtml(UTF8Encoding().decode(data, dataSize));
GlobalUnlock(store.hGlobal);
ReleaseStgMedium(&store);
- if (PassRefPtr<DocumentFragment> fragment = fragmentFromCF_HTML(doc, cf_html))
+ if (PassRefPtr<DocumentFragment> fragment = fragmentFromCFHTML(doc, cfhtml))
return fragment;
}
- if (SUCCEEDED(data->GetData(texthtmlFormat(), &store))) {
- //raw html
- UChar* data = (UChar*)GlobalLock(store.hGlobal);
- html = String(data);
- GlobalUnlock(store.hGlobal);
- ReleaseStgMedium(&store);
+ bool success = false;
+ html = getTextHTML(data, success);
+ if (success)
return createFragmentFromMarkup(doc, html, srcURL, FragmentScriptingNotAllowed);
- }
return 0;
}
diff --git a/WebCore/platform/win/ClipboardUtilitiesWin.h b/WebCore/platform/win/ClipboardUtilitiesWin.h
index ac5efd8..4ca46f9 100644
--- a/WebCore/platform/win/ClipboardUtilitiesWin.h
+++ b/WebCore/platform/win/ClipboardUtilitiesWin.h
@@ -49,7 +49,7 @@ FORMATETC* htmlFormat();
FORMATETC* cfHDropFormat();
FORMATETC* smartPasteFormat();
-void markupToCF_HTML(const String& markup, const String& srcURL, Vector<char>& result);
+void markupToCFHTML(const String& markup, const String& srcURL, Vector<char>& result);
void replaceNewlinesWithWindowsStyleNewlines(String&);
void replaceNBSPWithSpace(String&);
@@ -59,12 +59,12 @@ bool containsHTML(IDataObject*);
PassRefPtr<DocumentFragment> fragmentFromFilenames(Document*, const IDataObject*);
PassRefPtr<DocumentFragment> fragmentFromHTML(Document*, IDataObject*);
-PassRefPtr<DocumentFragment> fragmentFromCF_HTML(Document*, const String& cf_html);
+PassRefPtr<DocumentFragment> fragmentFromCFHTML(Document*, const String& cfhtml);
String getURL(IDataObject*, DragData::FilenameConversionPolicy, bool& success, String* title = 0);
String getPlainText(IDataObject*, bool& success);
+String getTextHTML(IDataObject*, bool& success);
} // namespace WebCore
#endif // ClipboardUtilitiesWin_h
-
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp
index 3c3a205..2cd6feb 100644
--- a/WebCore/platform/win/ClipboardWin.cpp
+++ b/WebCore/platform/win/ClipboardWin.cpp
@@ -105,9 +105,8 @@ static inline void pathRemoveBadFSCharacters(PWSTR psz, size_t length)
size_t readFrom = 0;
while (readFrom < length) {
UINT type = PathGetCharType(psz[readFrom]);
- if (psz[readFrom] == 0 || type & (GCT_LFNCHAR | GCT_SHORTCHAR)) {
+ if (!psz[readFrom] || type & (GCT_LFNCHAR | GCT_SHORTCHAR))
psz[writeTo++] = psz[readFrom];
- }
readFrom++;
}
@@ -215,7 +214,7 @@ static HGLOBAL createGlobalImageFileContent(SharedBuffer* data)
static HGLOBAL createGlobalHDropContent(const KURL& url, String& fileName, SharedBuffer* data)
{
- if (fileName.isEmpty() || !data )
+ if (fileName.isEmpty() || !data)
return 0;
WCHAR filePath[MAX_PATH];
@@ -290,7 +289,7 @@ static HGLOBAL createGlobalUrlFileDescriptor(const String& url, const String& ti
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
+ fileSize += strlen(szShellDotUrlTemplate) - 2; // -2 is for getting rid of %s in the template string
fgd->fgd[0].nFileSizeLow = fileSize;
estimatedSize = fileSize;
fsPath = filesystemPathFromUrlOrTitle(url, title, L".URL", true);
@@ -437,7 +436,7 @@ static bool writeURL(WCDataObject *data, const KURL& url, String title, bool wit
if (withHTML) {
Vector<char> cfhtmlData;
- markupToCF_HTML(urlToMarkup(url, title), "", cfhtmlData);
+ markupToCFHTML(urlToMarkup(url, title), "", cfhtmlData);
medium.hGlobal = createGlobalData(cfhtmlData);
if (medium.hGlobal && FAILED(data->SetData(htmlFormat(), &medium, TRUE)))
::GlobalFree(medium.hGlobal);
@@ -458,7 +457,7 @@ static bool writeURL(WCDataObject *data, const KURL& url, String title, bool wit
void ClipboardWin::clearData(const String& type)
{
- //FIXME: Need to be able to write to the system clipboard <rdar://problem/5015941>
+ // FIXME: Need to be able to write to the system clipboard <rdar://problem/5015941>
ASSERT(isForDragging());
if (policy() != ClipboardWritable || !m_writableDataObject)
return;
@@ -478,7 +477,7 @@ void ClipboardWin::clearData(const String& type)
void ClipboardWin::clearAllData()
{
- //FIXME: Need to be able to write to the system clipboard <rdar://problem/5015941>
+ // FIXME: Need to be able to write to the system clipboard <rdar://problem/5015941>
ASSERT(isForDragging());
if (policy() != ClipboardWritable)
return;
@@ -491,14 +490,13 @@ void ClipboardWin::clearAllData()
String ClipboardWin::getData(const String& type, bool& success) const
{
success = false;
- if (policy() != ClipboardReadable || !m_dataObject) {
+ if (policy() != ClipboardReadable || !m_dataObject)
return "";
- }
ClipboardDataType dataType = clipboardTypeFromMIMEType(type);
if (dataType == ClipboardDataTypeText)
return getPlainText(m_dataObject.get(), success);
- else if (dataType == ClipboardDataTypeURL)
+ if (dataType == ClipboardDataTypeURL)
return getURL(m_dataObject.get(), DragData::DoNotConvertFilenames, success);
return "";
@@ -568,9 +566,8 @@ HashSet<String> ClipboardWin::types() const
FORMATETC data;
// IEnumFORMATETC::Next returns S_FALSE if there are no more items.
- while (itr->Next(1, &data, 0) == S_OK) {
+ while (itr->Next(1, &data, 0) == S_OK)
addMimeTypesForFormat(results, data);
- }
return results;
}
@@ -720,7 +717,7 @@ void ClipboardWin::declareAndWriteDragImage(Element* element, const KURL& url, c
// Put img tag on the clipboard referencing the image
Vector<char> data;
- markupToCF_HTML(imageToMarkup(fullURL), "", data);
+ markupToCFHTML(imageToMarkup(fullURL), "", data);
medium.hGlobal = createGlobalData(data);
if (medium.hGlobal && FAILED(m_writableDataObject->SetData(htmlFormat(), &medium, TRUE)))
::GlobalFree(medium.hGlobal);
@@ -757,7 +754,7 @@ void ClipboardWin::writeRange(Range* selectedRange, Frame* frame)
ExceptionCode ec = 0;
Vector<char> data;
- markupToCF_HTML(createMarkup(selectedRange, 0, AnnotateForInterchange),
+ markupToCFHTML(createMarkup(selectedRange, 0, AnnotateForInterchange),
selectedRange->startContainer(ec)->document()->url().string(), data);
medium.hGlobal = createGlobalData(data);
if (medium.hGlobal && FAILED(m_writableDataObject->SetData(htmlFormat(), &medium, TRUE)))
diff --git a/WebCore/platform/win/ClipboardWin.h b/WebCore/platform/win/ClipboardWin.h
index 49fdcfe..1b139ed 100644
--- a/WebCore/platform/win/ClipboardWin.h
+++ b/WebCore/platform/win/ClipboardWin.h
@@ -26,66 +26,66 @@
#ifndef ClipboardWin_h
#define ClipboardWin_h
+#include "COMPtr.h"
#include "CachedResourceClient.h"
#include "Clipboard.h"
-#include "COMPtr.h"
struct IDataObject;
namespace WebCore {
- class CachedImage;
- class IntPoint;
- class WCDataObject;
-
- // State available during IE's events for drag and drop and copy/paste
- class ClipboardWin : public Clipboard, public CachedResourceClient {
- public:
- static PassRefPtr<ClipboardWin> create(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy)
- {
- return adoptRef(new ClipboardWin(isForDragging, dataObject, policy));
- }
- static PassRefPtr<ClipboardWin> create(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy)
- {
- return adoptRef(new ClipboardWin(isForDragging, dataObject, policy));
- }
- ~ClipboardWin();
-
- void clearData(const String& type);
- void clearAllData();
- String getData(const String& type, bool& success) const;
- bool setData(const String& type, const String& data);
-
- // extensions beyond IE's API
- virtual HashSet<String> types() const;
- virtual PassRefPtr<FileList> files() const;
-
- void setDragImage(CachedImage*, const IntPoint&);
- void setDragImageElement(Node*, const IntPoint&);
-
- virtual DragImageRef createDragImage(IntPoint& dragLoc) const;
- virtual void declareAndWriteDragImage(Element*, const KURL&, const String& title, Frame*);
- virtual void writeURL(const KURL&, const String&, Frame*);
- virtual void writeRange(Range*, Frame*);
- virtual void writePlainText(const String&);
-
- virtual bool hasData();
-
- COMPtr<IDataObject> dataObject() { return m_dataObject; }
-
- void setExternalDataObject(IDataObject *dataObject);
-
- private:
- ClipboardWin(bool isForDragging, IDataObject*, ClipboardAccessPolicy);
- ClipboardWin(bool isForDragging, WCDataObject*, ClipboardAccessPolicy);
-
- void resetFromClipboard();
- void setDragImage(CachedImage*, Node*, const IntPoint&);
-
- COMPtr<IDataObject> m_dataObject;
- COMPtr<WCDataObject> m_writableDataObject;
- Frame* m_frame;
- };
+class CachedImage;
+class IntPoint;
+class WCDataObject;
+
+// State available during IE's events for drag and drop and copy/paste
+class ClipboardWin : public Clipboard, public CachedResourceClient {
+public:
+ static PassRefPtr<ClipboardWin> create(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy)
+ {
+ return adoptRef(new ClipboardWin(isForDragging, dataObject, policy));
+ }
+ static PassRefPtr<ClipboardWin> create(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy)
+ {
+ return adoptRef(new ClipboardWin(isForDragging, dataObject, policy));
+ }
+ ~ClipboardWin();
+
+ void clearData(const String& type);
+ void clearAllData();
+ String getData(const String& type, bool& success) const;
+ bool setData(const String& type, const String& data);
+
+ // extensions beyond IE's API
+ virtual HashSet<String> types() const;
+ virtual PassRefPtr<FileList> files() const;
+
+ void setDragImage(CachedImage*, const IntPoint&);
+ void setDragImageElement(Node*, const IntPoint&);
+
+ virtual DragImageRef createDragImage(IntPoint& dragLoc) const;
+ virtual void declareAndWriteDragImage(Element*, const KURL&, const String& title, Frame*);
+ virtual void writeURL(const KURL&, const String&, Frame*);
+ virtual void writeRange(Range*, Frame*);
+ virtual void writePlainText(const String&);
+
+ virtual bool hasData();
+
+ COMPtr<IDataObject> dataObject() { return m_dataObject; }
+
+ void setExternalDataObject(IDataObject *dataObject);
+
+private:
+ ClipboardWin(bool isForDragging, IDataObject*, ClipboardAccessPolicy);
+ ClipboardWin(bool isForDragging, WCDataObject*, ClipboardAccessPolicy);
+
+ void resetFromClipboard();
+ void setDragImage(CachedImage*, Node*, const IntPoint&);
+
+ COMPtr<IDataObject> m_dataObject;
+ COMPtr<WCDataObject> m_writableDataObject;
+ Frame* m_frame;
+};
} // namespace WebCore
diff --git a/WebCore/platform/win/CursorWin.cpp b/WebCore/platform/win/CursorWin.cpp
index 22a535d..2dd1452 100644
--- a/WebCore/platform/win/CursorWin.cpp
+++ b/WebCore/platform/win/CursorWin.cpp
@@ -39,11 +39,6 @@
namespace WebCore {
-Cursor::Cursor(const Cursor& other)
- : m_impl(other.m_impl)
-{
-}
-
static inline bool supportsAlphaCursors()
{
OSVERSIONINFO osinfo = {0};
@@ -52,8 +47,10 @@ static inline bool supportsAlphaCursors()
return osinfo.dwMajorVersion > 5 || (osinfo.dwMajorVersion == 5 && osinfo.dwMinorVersion > 0);
}
-Cursor::Cursor(Image* img, const IntPoint& hotSpot)
+static PassRefPtr<SharedCursor> createSharedCursor(Image* img, const IntPoint& hotSpot)
{
+ RefPtr<SharedCursor> impl;
+
IntPoint effectiveHotSpot = determineHotSpot(img, hotSpot);
static bool doAlpha = supportsAlphaCursors();
BitmapInfo cursorImage = BitmapInfo::create(IntSize(img->width(), img->height()));
@@ -80,7 +77,7 @@ Cursor::Cursor(Image* img, const IntPoint& hotSpot)
ii.hbmMask = hMask.get();
ii.hbmColor = hCursor.get();
- m_impl = SharedCursor::create(CreateIconIndirect(&ii));
+ impl = SharedCursor::create(CreateIconIndirect(&ii));
} else {
// Platform doesn't support alpha blended cursors, so we need
// to create the mask manually
@@ -115,303 +112,183 @@ Cursor::Cursor(Image* img, const IntPoint& hotSpot)
icon.yHotspot = effectiveHotSpot.y();
icon.hbmMask = andMask.get();
icon.hbmColor = xorMask.get();
- m_impl = SharedCursor::create(CreateIconIndirect(&icon));
+ impl = SharedCursor::create(CreateIconIndirect(&icon));
DeleteDC(xorMaskDC);
DeleteDC(andMaskDC);
}
DeleteDC(workingDC);
ReleaseDC(0, dc);
-}
-Cursor::~Cursor()
-{
+ return impl.release();
}
-Cursor& Cursor::operator=(const Cursor& other)
-{
- m_impl = other.m_impl;
- return *this;
-}
-
-Cursor::Cursor(PlatformCursor c)
- : m_impl(c)
+static PassRefPtr<SharedCursor> loadSharedCursor(HINSTANCE hInstance, LPCTSTR lpCursorName)
{
+ return SharedCursor::create(::LoadCursor(hInstance, lpCursorName));
}
-static Cursor loadCursorByName(char* name, int x, int y)
+static PassRefPtr<SharedCursor> loadCursorByName(char* name, int x, int y)
{
IntPoint hotSpot(x, y);
- Cursor c;
RefPtr<Image> cursorImage(Image::loadPlatformResource(name));
- if (cursorImage && !cursorImage->isNull())
- c = Cursor(cursorImage.get(), hotSpot);
- else
- c = pointerCursor();
- return c;
-}
-
-static PassRefPtr<SharedCursor> loadSharedCursor(HINSTANCE hInstance, LPCTSTR lpCursorName)
-{
- return SharedCursor::create(LoadCursor(hInstance, lpCursorName));
-}
-
-const Cursor& pointerCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_ARROW);
- return c;
-}
-
-const Cursor& crossCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_CROSS);
- return c;
-}
-
-const Cursor& handCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_HAND);
- return c;
-}
-
-const Cursor& iBeamCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_IBEAM);
- return c;
-}
-
-const Cursor& waitCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_WAIT);
- return c;
-}
-
-const Cursor& helpCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_HELP);
- return c;
-}
-
-const Cursor& eastResizeCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_SIZEWE);
- return c;
-}
-
-const Cursor& northResizeCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_SIZENS);
- return c;
-}
-
-const Cursor& northEastResizeCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_SIZENESW);
- return c;
-}
-
-const Cursor& northWestResizeCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_SIZENWSE);
- return c;
-}
-
-const Cursor& southResizeCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_SIZENS);
- return c;
-}
-
-const Cursor& southEastResizeCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_SIZENWSE);
- return c;
-}
-
-const Cursor& southWestResizeCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_SIZENESW);
- return c;
-}
-
-const Cursor& westResizeCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_SIZEWE);
- return c;
-}
-
-const Cursor& northSouthResizeCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_SIZENS);
- return c;
-}
-
-const Cursor& eastWestResizeCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_SIZEWE);
- return c;
-}
-
-const Cursor& northEastSouthWestResizeCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_SIZENESW);
- return c;
-}
-
-const Cursor& northWestSouthEastResizeCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_SIZENWSE);
- return c;
-}
-
-const Cursor& columnResizeCursor()
-{
- // FIXME: Windows does not have a standard column resize cursor <rdar://problem/5018591>
- static Cursor c = loadSharedCursor(0, IDC_SIZEWE);
- return c;
-}
-
-const Cursor& rowResizeCursor()
-{
- // FIXME: Windows does not have a standard row resize cursor <rdar://problem/5018591>
- static Cursor c = loadSharedCursor(0, IDC_SIZENS);
- return c;
-}
-
-const Cursor& middlePanningCursor()
-{
- static const Cursor c = loadCursorByName("panIcon", 8, 8);
- return c;
-}
-
-const Cursor& eastPanningCursor()
-{
- static const Cursor c = loadCursorByName("panEastCursor", 7, 7);
- return c;
-}
-
-const Cursor& northPanningCursor()
-{
- static const Cursor c = loadCursorByName("panNorthCursor", 7, 7);
- return c;
-}
-
-const Cursor& northEastPanningCursor()
-{
- static const Cursor c = loadCursorByName("panNorthEastCursor", 7, 7);
- return c;
-}
-
-const Cursor& northWestPanningCursor()
-{
- static const Cursor c = loadCursorByName("panNorthWestCursor", 7, 7);
- return c;
-}
-
-const Cursor& southPanningCursor()
-{
- static const Cursor c = loadCursorByName("panSouthCursor", 7, 7);
- return c;
-}
-
-const Cursor& southEastPanningCursor()
-{
- static const Cursor c = loadCursorByName("panSouthEastCursor", 7, 7);
- return c;
-}
-
-const Cursor& southWestPanningCursor()
-{
- static const Cursor c = loadCursorByName("panSouthWestCursor", 7, 7);
- return c;
-}
-
-const Cursor& westPanningCursor()
-{
- static const Cursor c = loadCursorByName("panWestCursor", 7, 7);
- return c;
-}
-
-const Cursor& moveCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_SIZEALL);
- return c;
-}
-
-const Cursor& verticalTextCursor()
-{
- static const Cursor c = loadCursorByName("verticalTextCursor", 7, 7);
- return c;
-}
-
-const Cursor& cellCursor()
-{
- return pointerCursor();
-}
-
-const Cursor& contextMenuCursor()
-{
- return pointerCursor();
-}
-
-const Cursor& aliasCursor()
-{
- return pointerCursor();
-}
-
-const Cursor& progressCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_APPSTARTING);
- return c;
-}
-
-const Cursor& noDropCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_NO);
- return c;
-}
-
-const Cursor& copyCursor()
-{
- return pointerCursor();
-}
-
-const Cursor& noneCursor()
-{
- return pointerCursor();
-}
-
-const Cursor& notAllowedCursor()
-{
- static Cursor c = loadSharedCursor(0, IDC_NO);
- return c;
-}
-
-const Cursor& zoomInCursor()
-{
- static const Cursor c = loadCursorByName("zoomInCursor", 7, 7);
- return c;
+ if (cursorImage && !cursorImage->isNull())
+ return createSharedCursor(cursorImage.get(), hotSpot);
+ return loadSharedCursor(0, IDC_ARROW);
+}
+
+void Cursor::ensurePlatformCursor() const
+{
+ if (m_platformCursor)
+ return;
+
+ switch (m_type) {
+ case Cursor::Pointer:
+ case Cursor::Cell:
+ case Cursor::ContextMenu:
+ case Cursor::Alias:
+ case Cursor::Copy:
+ case Cursor::None:
+ case Cursor::Grab:
+ case Cursor::Grabbing:
+ m_platformCursor = loadSharedCursor(0, IDC_ARROW);
+ break;
+ case Cursor::Cross:
+ m_platformCursor = loadSharedCursor(0, IDC_CROSS);
+ break;
+ case Cursor::Hand:
+ m_platformCursor = loadSharedCursor(0, IDC_HAND);
+ break;
+ case Cursor::IBeam:
+ m_platformCursor = loadSharedCursor(0, IDC_IBEAM);
+ break;
+ case Cursor::Wait:
+ m_platformCursor = loadSharedCursor(0, IDC_WAIT);
+ break;
+ case Cursor::Help:
+ m_platformCursor = loadSharedCursor(0, IDC_HELP);
+ break;
+ case Cursor::Move:
+ m_platformCursor = loadSharedCursor(0, IDC_SIZEALL);
+ break;
+ case Cursor::MiddlePanning:
+ m_platformCursor = loadCursorByName("panIcon", 8, 8);
+ break;
+ case Cursor::EastResize:
+ m_platformCursor = loadSharedCursor(0, IDC_SIZEWE);
+ break;
+ case Cursor::EastPanning:
+ m_platformCursor = loadCursorByName("panEastCursor", 7, 7);
+ break;
+ case Cursor::NorthResize:
+ m_platformCursor = loadSharedCursor(0, IDC_SIZENS);
+ break;
+ case Cursor::NorthPanning:
+ m_platformCursor = loadCursorByName("panNorthCursor", 7, 7);
+ break;
+ case Cursor::NorthEastResize:
+ m_platformCursor = loadSharedCursor(0, IDC_SIZENESW);
+ break;
+ case Cursor::NorthEastPanning:
+ m_platformCursor = loadCursorByName("panNorthEastCursor", 7, 7);
+ break;
+ case Cursor::NorthWestResize:
+ m_platformCursor = loadSharedCursor(0, IDC_SIZENWSE);
+ break;
+ case Cursor::NorthWestPanning:
+ m_platformCursor = loadCursorByName("panNorthWestCursor", 7, 7);
+ break;
+ case Cursor::SouthResize:
+ m_platformCursor = loadSharedCursor(0, IDC_SIZENS);
+ break;
+ case Cursor::SouthPanning:
+ m_platformCursor = loadCursorByName("panSouthCursor", 7, 7);
+ break;
+ case Cursor::SouthEastResize:
+ m_platformCursor = loadSharedCursor(0, IDC_SIZENWSE);
+ break;
+ case Cursor::SouthEastPanning:
+ m_platformCursor = loadCursorByName("panSouthEastCursor", 7, 7);
+ break;
+ case Cursor::SouthWestResize:
+ m_platformCursor = loadSharedCursor(0, IDC_SIZENESW);
+ break;
+ case Cursor::SouthWestPanning:
+ m_platformCursor = loadCursorByName("panSouthWestCursor", 7, 7);
+ break;
+ case Cursor::WestResize:
+ m_platformCursor = loadSharedCursor(0, IDC_SIZEWE);
+ break;
+ case Cursor::NorthSouthResize:
+ m_platformCursor = loadSharedCursor(0, IDC_SIZENS);
+ break;
+ case Cursor::EastWestResize:
+ m_platformCursor = loadSharedCursor(0, IDC_SIZEWE);
+ break;
+ case Cursor::WestPanning:
+ m_platformCursor = loadCursorByName("panWestCursor", 7, 7);
+ break;
+ case Cursor::NorthEastSouthWestResize:
+ m_platformCursor = loadSharedCursor(0, IDC_SIZENESW);
+ break;
+ case Cursor::NorthWestSouthEastResize:
+ m_platformCursor = loadSharedCursor(0, IDC_SIZENWSE);
+ break;
+ case Cursor::ColumnResize:
+ // FIXME: Windows does not have a standard column resize cursor <rdar://problem/5018591>
+ m_platformCursor = loadSharedCursor(0, IDC_SIZEWE);
+ break;
+ case Cursor::RowResize:
+ // FIXME: Windows does not have a standard row resize cursor <rdar://problem/5018591>
+ m_platformCursor = loadSharedCursor(0, IDC_SIZENS);
+ break;
+ case Cursor::VerticalText:
+ m_platformCursor = loadCursorByName("verticalTextCursor", 7, 7);
+ break;
+ case Cursor::Progress:
+ m_platformCursor = loadSharedCursor(0, IDC_APPSTARTING);
+ break;
+ case Cursor::NoDrop:
+ break;
+ case Cursor::NotAllowed:
+ m_platformCursor = loadSharedCursor(0, IDC_NO);
+ break;
+ case Cursor::ZoomIn:
+ m_platformCursor = loadCursorByName("zoomInCursor", 7, 7);
+ break;
+ case Cursor::ZoomOut:
+ m_platformCursor = loadCursorByName("zoomOutCursor", 7, 7);
+ break;
+ case Cursor::Custom:
+ m_platformCursor = createSharedCursor(m_image.get(), m_hotSpot);
+ break;
+ }
}
-const Cursor& zoomOutCursor()
+SharedCursor::~SharedCursor()
{
- static const Cursor c = loadCursorByName("zoomOutCursor", 7, 7);
- return c;
+ DestroyIcon(m_nativeCursor);
}
-const Cursor& grabCursor()
+Cursor::Cursor(const Cursor& other)
+ : m_type(other.m_type)
+ , m_image(other.m_image)
+ , m_hotSpot(other.m_hotSpot)
+ , m_platformCursor(other.m_platformCursor)
{
- return pointerCursor();
}
-const Cursor& grabbingCursor()
+Cursor& Cursor::operator=(const Cursor& other)
{
- return pointerCursor();
+ m_type = other.m_type;
+ m_image = other.m_image;
+ m_hotSpot = other.m_hotSpot;
+ m_platformCursor = other.m_platformCursor;
+ return *this;
}
-SharedCursor::~SharedCursor()
+Cursor::~Cursor()
{
- DestroyIcon(m_nativeCursor);
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/win/PasteboardWin.cpp b/WebCore/platform/win/PasteboardWin.cpp
index 512f6cf..808c863 100644
--- a/WebCore/platform/win/PasteboardWin.cpp
+++ b/WebCore/platform/win/PasteboardWin.cpp
@@ -54,7 +54,7 @@ static LRESULT CALLBACK PasteboardOwnerWndProc(HWND hWnd, UINT message, WPARAM w
LRESULT lresult = 0;
LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0);
- switch(message) {
+ switch (message) {
case WM_RENDERFORMAT:
// This message comes when SetClipboardData was sent a null data handle
// and now it's come time to put the data on the clipboard.
@@ -117,7 +117,7 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
if (::OpenClipboard(m_owner)) {
ExceptionCode ec = 0;
Vector<char> data;
- markupToCF_HTML(createMarkup(selectedRange, 0, AnnotateForInterchange),
+ markupToCFHTML(createMarkup(selectedRange, 0, AnnotateForInterchange),
selectedRange->startContainer(ec)->document()->url().string(), data);
HGLOBAL cbData = createGlobalData(data);
if (!::SetClipboardData(HTMLClipboardFormat, cbData))
@@ -139,7 +139,7 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
// enable smart-replacing later on by putting dummy data on the pasteboard
if (canSmartCopyOrDelete) {
if (::OpenClipboard(m_owner)) {
- ::SetClipboardData(WebSmartPasteFormat, NULL);
+ ::SetClipboardData(WebSmartPasteFormat, 0);
::CloseClipboard();
}
@@ -185,7 +185,7 @@ void Pasteboard::writeURL(const KURL& url, const String& titleStr, Frame* frame)
// write to clipboard in format CF_HTML to be able to paste into contenteditable areas as a link
if (::OpenClipboard(m_owner)) {
Vector<char> data;
- markupToCF_HTML(urlToMarkup(url, title), "", data);
+ markupToCFHTML(urlToMarkup(url, title), "", data);
HGLOBAL cbData = createGlobalData(data);
if (!::SetClipboardData(HTMLClipboardFormat, cbData))
::GlobalFree(cbData);
@@ -260,8 +260,8 @@ String Pasteboard::plainText(Frame* frame)
::GlobalUnlock(cbData);
::CloseClipboard();
return fromClipboard;
- } else
- ::CloseClipboard();
+ }
+ ::CloseClipboard();
}
if (::IsClipboardFormatAvailable(CF_TEXT) && ::OpenClipboard(m_owner)) {
@@ -272,8 +272,8 @@ String Pasteboard::plainText(Frame* frame)
::GlobalUnlock(cbData);
::CloseClipboard();
return fromClipboard;
- } else
- ::CloseClipboard();
+ }
+ ::CloseClipboard();
}
return String();
@@ -288,11 +288,11 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
HANDLE cbData = ::GetClipboardData(HTMLClipboardFormat);
if (cbData) {
SIZE_T dataSize = ::GlobalSize(cbData);
- String cf_html(UTF8Encoding().decode((char*)::GlobalLock(cbData), dataSize));
+ String cfhtml(UTF8Encoding().decode((char*)::GlobalLock(cbData), dataSize));
::GlobalUnlock(cbData);
::CloseClipboard();
- PassRefPtr<DocumentFragment> fragment = fragmentFromCF_HTML(frame->document(), cf_html);
+ PassRefPtr<DocumentFragment> fragment = fragmentFromCFHTML(frame->document(), cfhtml);
if (fragment)
return fragment;
} else
@@ -306,7 +306,7 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
if (cbData) {
UChar* buffer = (UChar*)GlobalLock(cbData);
String str(buffer);
- ::GlobalUnlock( cbData );
+ ::GlobalUnlock(cbData);
::CloseClipboard();
RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str);
if (fragment)
@@ -323,7 +323,7 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
if (cbData) {
char* buffer = (char*)GlobalLock(cbData);
String str(buffer);
- ::GlobalUnlock( cbData );
+ ::GlobalUnlock(cbData);
::CloseClipboard();
RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str);
if (fragment)
diff --git a/WebCore/platform/win/WidgetWin.cpp b/WebCore/platform/win/WidgetWin.cpp
index 607c0d8..416260b 100644
--- a/WebCore/platform/win/WidgetWin.cpp
+++ b/WebCore/platform/win/WidgetWin.cpp
@@ -59,7 +59,6 @@ void Widget::hide()
{
}
-HCURSOR lastSetCursor = 0;
bool ignoreNextSetCursor = false;
void Widget::setCursor(const Cursor& cursor)
@@ -71,30 +70,10 @@ void Widget::setCursor(const Cursor& cursor)
return;
}
- if (!cursor.impl()->nativeCursor())
- return;
-
- lastSetCursor = cursor.impl()->nativeCursor();
-
ScrollView* view = root();
- if (!view || !view->isFrameView()) {
- SetCursor(lastSetCursor);
- return;
- }
-
- Frame* frame = static_cast<FrameView*>(view)->frame();
- if (!frame) {
- SetCursor(lastSetCursor);
+ if (!view)
return;
- }
-
- Page* page = frame->page();
- if (!page) {
- SetCursor(lastSetCursor);
- return;
- }
-
- page->chrome()->setCursor(lastSetCursor);
+ view->hostWindow()->setCursor(cursor);
}
void Widget::paint(GraphicsContext*, const IntRect&)
diff --git a/WebCore/platform/wince/CursorWince.cpp b/WebCore/platform/wince/CursorWince.cpp
index e35f1f9..d7dcfb4 100644
--- a/WebCore/platform/wince/CursorWince.cpp
+++ b/WebCore/platform/wince/CursorWince.cpp
@@ -38,12 +38,12 @@ static const Cursor& getCursor(CursorType type)
}
Cursor::Cursor(const Cursor& other)
-: m_impl(other.m_impl)
+: m_platformCursor(other.m_platformCursor)
{
}
Cursor::Cursor(Image* img, const IntPoint& hotspot)
-: m_impl(CursorNone)
+: m_platformCursor(CursorNone)
{
}
@@ -53,12 +53,12 @@ Cursor::~Cursor()
Cursor& Cursor::operator=(const Cursor& other)
{
- m_impl = other.m_impl;
+ m_platformCursor = other.m_platformCursor;
return *this;
}
Cursor::Cursor(PlatformCursor c)
-: m_impl(c)
+: m_platformCursor(c)
{
}
diff --git a/WebCore/platform/wx/CursorWx.cpp b/WebCore/platform/wx/CursorWx.cpp
index ed7f86b..dd61f1e 100644
--- a/WebCore/platform/wx/CursorWx.cpp
+++ b/WebCore/platform/wx/CursorWx.cpp
@@ -34,15 +34,15 @@
namespace WebCore {
Cursor::Cursor(const Cursor& other)
- : m_impl(other.m_impl)
+ : m_platformCursor(other.m_platformCursor)
{
}
Cursor::Cursor(Image* image, const IntPoint&)
{
- m_impl = 0;
+ m_platformCursor = 0;
// FIXME: figure out why the below code causes a crash
- //m_impl = new wxCursor( image->getWxBitmap()->ConvertToImage() );
+ //m_platformCursor = new wxCursor( image->getWxBitmap()->ConvertToImage() );
}
Cursor::~Cursor()
@@ -51,12 +51,12 @@ Cursor::~Cursor()
Cursor& Cursor::operator=(const Cursor& other)
{
- m_impl = other.m_impl;
+ m_platformCursor = other.m_platformCursor;
return *this;
}
Cursor::Cursor(wxCursor* c)
- : m_impl(c)
+ : m_platformCursor(c)
{
}
diff --git a/WebCore/plugins/PluginStream.cpp b/WebCore/plugins/PluginStream.cpp
index bdf7a40..8d7a561 100644
--- a/WebCore/plugins/PluginStream.cpp
+++ b/WebCore/plugins/PluginStream.cpp
@@ -366,6 +366,8 @@ void PluginStream::deliverData()
deliveryBytes = m_pluginFuncs->write(m_instance, &m_stream, m_offset, dataLength, (void*)data);
if (deliveryBytes < 0) {
LOG_PLUGIN_NET_ERROR();
+ if (m_loader)
+ m_loader->setDefersLoading(false);
cancelAndDestroyStream(NPRES_NETWORK_ERR);
return;
}
diff --git a/WebCore/plugins/PluginWidget.h b/WebCore/plugins/PluginViewBase.h
index 7a76fc1..9d3f463 100644
--- a/WebCore/plugins/PluginWidget.h
+++ b/WebCore/plugins/PluginViewBase.h
@@ -30,26 +30,21 @@
namespace WebCore {
-class PluginWidget : public Widget {
-
+// PluginViewBase is a widget that all plug-in views inherit from, both in Webkit and WebKit2.
+// It's intended as a stopgap measure until we can merge all plug-in views into a single plug-in view.
+class PluginViewBase : public Widget {
public:
- PluginWidget(PlatformWidget widget = 0) : Widget(widget) { }
#if USE(ACCELERATED_COMPOSITING)
- PlatformLayer* platformLayer() const;
+ virtual PlatformLayer* platformLayer() const { return 0; }
#endif
+
+protected:
+ PluginViewBase(PlatformWidget widget) : Widget(widget) { }
private:
- virtual void invalidateRect(const IntRect&);
- virtual bool isPluginWidget() const { return true; }
+ virtual bool isPluginViewBase() const { return true; }
};
-#if USE(ACCELERATED_COMPOSITING) && !PLATFORM(MAC)
-inline PlatformLayer* PluginWidget::platformLayer() const
-{
- return 0;
-}
-#endif
-
} // namespace WebCore
#endif // PluginWidget_h
diff --git a/WebCore/plugins/mac/PluginWidgetMac.mm b/WebCore/plugins/mac/PluginWidgetMac.mm
deleted file mode 100644
index f407928..0000000
--- a/WebCore/plugins/mac/PluginWidgetMac.mm
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "PluginWidget.h"
-
-#if USE(ACCELERATED_COMPOSITING)
-@interface NSView (WebKitSecretsWebCoreKnowsAbout)
-- (CALayer *)pluginLayer;
-@end
-#endif
-namespace WebCore {
-
-void PluginWidget::invalidateRect(const IntRect& rect)
-{
- [platformWidget() setNeedsDisplayInRect:rect];
-}
-
-#if USE(ACCELERATED_COMPOSITING)
-PlatformLayer* PluginWidget::platformLayer() const
-{
- if (![platformWidget() respondsToSelector:@selector(pluginLayer)])
- return 0;
-
- return [platformWidget() pluginLayer];
-}
-#endif
-} // namespace WebCore
diff --git a/WebCore/plugins/win/PluginViewWin.cpp b/WebCore/plugins/win/PluginViewWin.cpp
index 1765939..8dbb04b 100644
--- a/WebCore/plugins/win/PluginViewWin.cpp
+++ b/WebCore/plugins/win/PluginViewWin.cpp
@@ -30,6 +30,8 @@
#include "BitmapImage.h"
#include "Bridge.h"
+#include "Chrome.h"
+#include "ChromeClient.h"
#include "Document.h"
#include "DocumentLoader.h"
#include "Element.h"
@@ -656,7 +658,6 @@ void PluginView::handleKeyboardEvent(KeyboardEvent* event)
}
#if !OS(WINCE)
-extern HCURSOR lastSetCursor;
extern bool ignoreNextSetCursor;
#endif
@@ -727,7 +728,8 @@ void PluginView::handleMouseEvent(MouseEvent* event)
// Currently, Widget::setCursor is always called after this function in EventHandler.cpp
// and since we don't want that we set ignoreNextSetCursor to true here to prevent that.
ignoreNextSetCursor = true;
- lastSetCursor = ::GetCursor();
+ if (Page* page = m_parentFrame->page())
+ page->chrome()->client()->setLastSetCursorToCurrentCursor();
#endif
}
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index c97d965..1b855d4 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -3,6 +3,7 @@
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2007 David Smith (catfish.man@gmail.com)
* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * 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
@@ -940,6 +941,10 @@ static bool canMergeContiguousAnonymousBlocks(RenderObject* oldChild, RenderObje
|| (next && (!next->isAnonymousBlock() || toRenderBlock(next)->continuation())))
return false;
+ // FIXME: This check isn't required when inline run-ins can't be split into continuations.
+ if (prev && prev->firstChild() && prev->firstChild()->isInline() && prev->firstChild()->isRunIn())
+ return false;
+
#if ENABLE(RUBY)
if ((prev && (prev->isRubyRun() || prev->isRubyBase()))
|| (next && (next->isRubyRun() || next->isRubyBase())))
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index d4c691f..8d18440 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -3,7 +3,7 @@
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
* (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
- * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -155,7 +155,9 @@ void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyl
if (isFloating() && !isPositioned() && (newStyle->position() == AbsolutePosition || newStyle->position() == FixedPosition))
removeFloatingOrPositionedChildFromBlockLists();
}
- }
+ } else if (newStyle && isBody())
+ view()->repaint();
+
if (FrameView *frameView = view()->frameView()) {
bool newStyleIsFixed = newStyle && newStyle->position() == FixedPosition;
bool oldStyleIsFixed = style() && style()->position() == FixedPosition;
diff --git a/WebCore/rendering/RenderEmbeddedObject.cpp b/WebCore/rendering/RenderEmbeddedObject.cpp
index de9ca17..e72825e 100644
--- a/WebCore/rendering/RenderEmbeddedObject.cpp
+++ b/WebCore/rendering/RenderEmbeddedObject.cpp
@@ -42,7 +42,7 @@
#include "MouseEvent.h"
#include "Page.h"
#include "Path.h"
-#include "PluginWidget.h"
+#include "PluginViewBase.h"
#include "RenderTheme.h"
#include "RenderView.h"
#include "RenderWidgetProtector.h"
@@ -53,10 +53,6 @@
#include "HTMLVideoElement.h"
#endif
-#if USE(ACCELERATED_COMPOSITING)
-#include "PluginWidget.h"
-#endif
-
namespace WebCore {
using namespace HTMLNames;
@@ -102,7 +98,7 @@ bool RenderEmbeddedObject::requiresLayer() const
bool RenderEmbeddedObject::allowsAcceleratedCompositing() const
{
- return widget() && widget()->isPluginWidget() && static_cast<PluginWidget*>(widget())->platformLayer();
+ return widget() && widget()->isPluginViewBase() && static_cast<PluginViewBase*>(widget())->platformLayer();
}
#endif
diff --git a/WebCore/rendering/RenderFileUploadControl.cpp b/WebCore/rendering/RenderFileUploadControl.cpp
index c652276..f31ca20 100644
--- a/WebCore/rendering/RenderFileUploadControl.cpp
+++ b/WebCore/rendering/RenderFileUploadControl.cpp
@@ -94,10 +94,23 @@ void RenderFileUploadControl::valueChanged()
bool RenderFileUploadControl::allowsMultipleFiles()
{
+#if ENABLE(DIRECTORY_UPLOAD)
+ if (allowsDirectoryUpload())
+ return true;
+#endif
+
HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
return !input->getAttribute(multipleAttr).isNull();
}
+#if ENABLE(DIRECTORY_UPLOAD)
+bool RenderFileUploadControl::allowsDirectoryUpload()
+{
+ HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
+ return !input->getAttribute(webkitdirectoryAttr).isNull();
+}
+#endif
+
String RenderFileUploadControl::acceptTypes()
{
return static_cast<HTMLInputElement*>(node())->accept();
diff --git a/WebCore/rendering/RenderFileUploadControl.h b/WebCore/rendering/RenderFileUploadControl.h
index 25d2639..205ba47 100644
--- a/WebCore/rendering/RenderFileUploadControl.h
+++ b/WebCore/rendering/RenderFileUploadControl.h
@@ -62,6 +62,9 @@ private:
void valueChanged();
void repaint() { RenderBlock::repaint(); }
bool allowsMultipleFiles();
+#if ENABLE(DIRECTORY_UPLOAD)
+ bool allowsDirectoryUpload();
+#endif
String acceptTypes();
void chooseIconForFiles(FileChooser*, const Vector<String>&);
diff --git a/WebCore/rendering/RenderForeignObject.cpp b/WebCore/rendering/RenderForeignObject.cpp
index 4b94bab..8b84f97 100644
--- a/WebCore/rendering/RenderForeignObject.cpp
+++ b/WebCore/rendering/RenderForeignObject.cpp
@@ -26,6 +26,7 @@
#include "RenderForeignObject.h"
#include "GraphicsContext.h"
+#include "RenderSVGResource.h"
#include "RenderView.h"
#include "SVGForeignObjectElement.h"
#include "SVGRenderSupport.h"
@@ -98,7 +99,7 @@ void RenderForeignObject::layout()
ASSERT(needsLayout());
ASSERT(!view()->layoutStateEnabled()); // RenderSVGRoot disables layoutState for the SVG rendering tree.
- LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
+ LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
SVGForeignObjectElement* foreign = static_cast<SVGForeignObjectElement*>(node());
if (m_needsTransformUpdate) {
@@ -118,6 +119,10 @@ void RenderForeignObject::layout()
setLocation(roundedIntPoint(viewportLocation));
RenderBlock::layout();
+ // Invalidate all resources of this client, if we changed something.
+ if (m_everHadLayout && selfNeedsLayout())
+ RenderSVGResource::invalidateAllResourcesOfRenderer(this);
+
repainter.repaintAfterLayout();
setNeedsLayout(false);
}
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index 756073e..f0c6333 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -3933,7 +3933,7 @@ void showLayerTree(const WebCore::RenderLayer* layer)
return;
if (WebCore::Frame* frame = layer->renderer()->frame()) {
- WebCore::String output = externalRepresentation(frame, WebCore::RenderAsTextShowAllLayers | WebCore::RenderAsTextShowLayerNesting | WebCore::RenderAsTextShowCompositedLayers | WebCore::RenderAsTextShowAddresses);
+ WebCore::String output = externalRepresentation(frame, WebCore::RenderAsTextShowAllLayers | WebCore::RenderAsTextShowLayerNesting | WebCore::RenderAsTextShowCompositedLayers | WebCore::RenderAsTextShowAddresses | WebCore::RenderAsTextShowIDAndClass);
fprintf(stderr, "%s\n", output.utf8().data());
}
}
diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
index 1153727..2bc6a88 100644
--- a/WebCore/rendering/RenderLayerBacking.cpp
+++ b/WebCore/rendering/RenderLayerBacking.cpp
@@ -43,7 +43,7 @@
#include "HTMLNames.h"
#include "InspectorTimelineAgent.h"
#include "KeyframeList.h"
-#include "PluginWidget.h"
+#include "PluginViewBase.h"
#include "RenderBox.h"
#include "RenderIFrame.h"
#include "RenderImage.h"
@@ -68,6 +68,7 @@ using namespace HTMLNames;
static bool hasBorderOutlineOrShadow(const RenderStyle*);
static bool hasBoxDecorationsOrBackground(const RenderObject*);
static bool hasBoxDecorationsOrBackgroundImage(const RenderStyle*);
+static IntRect clipBox(RenderBox* renderer);
static inline bool is3DCanvas(RenderObject* renderer)
{
@@ -143,10 +144,60 @@ static bool hasNonZeroTransformOrigin(const RenderObject* renderer)
|| (style->transformOriginY().type() == Fixed && style->transformOriginY().value());
}
+static RenderLayer* enclosingOverflowClipAncestor(RenderLayer* layer, bool& crossesTransform)
+{
+ crossesTransform = false;
+
+ for (RenderLayer* curr = layer->parent(); curr; curr = curr->parent()) {
+ if (curr->renderer()->hasOverflowClip())
+ return curr;
+
+ if (curr->hasTransform())
+ crossesTransform = true;
+ }
+
+ return 0;
+}
+
void RenderLayerBacking::updateCompositedBounds()
{
IntRect layerBounds = compositor()->calculateCompositedBounds(m_owningLayer, m_owningLayer);
+ // Clip to the size of the document or enclosing overflow-scroll layer.
+ if (compositor()->compositingConsultsOverlap() && !m_owningLayer->hasTransform()) {
+ bool crossesTransform;
+ RenderLayer* overflowAncestor = enclosingOverflowClipAncestor(m_owningLayer, crossesTransform);
+ // If an ancestor is transformed, we can't currently compute the correct rect to intersect with.
+ // We'd need RenderObject::convertContainerToLocalQuad(), which doesn't yet exist.
+ if (!crossesTransform) {
+ IntRect clippingBounds;
+ RenderLayer* boundsRelativeLayer;
+
+ if (overflowAncestor) {
+ RenderBox* overflowBox = toRenderBox(overflowAncestor->renderer());
+ // If scrollbars are visible, then constrain the layer to the scrollable area, so we can avoid redraws
+ // on scrolling. Otherwise just clip to the visible area (it can still be scrolled via JS, but we'll come
+ // back through this code when the scroll offset changes).
+ if (overflowBox->scrollsOverflow())
+ clippingBounds = IntRect(-overflowAncestor->scrollXOffset(), -overflowAncestor->scrollYOffset(), overflowBox->scrollWidth(), overflowBox->scrollHeight());
+ else
+ clippingBounds = clipBox(overflowBox);
+
+ boundsRelativeLayer = overflowAncestor;
+ } else {
+ RenderView* view = m_owningLayer->renderer()->view();
+ clippingBounds = view->layoutOverflowRect();
+ boundsRelativeLayer = view->layer();
+ }
+
+ int deltaX = 0;
+ int deltaY = 0;
+ m_owningLayer->convertToLayerCoords(boundsRelativeLayer, deltaX, deltaY);
+ clippingBounds.move(-deltaX, -deltaY);
+ layerBounds.intersect(clippingBounds);
+ }
+ }
+
// If the element has a transform-origin that has fixed lengths, and the renderer has zero size,
// then we need to ensure that the compositing layer has non-zero size so that we can apply
// the transform-origin via the GraphicsLayer anchorPoint (which is expressed as a fractional value).
@@ -215,8 +266,8 @@ bool RenderLayerBacking::updateGraphicsLayerConfiguration()
updateImageContents();
if (renderer()->isEmbeddedObject() && toRenderEmbeddedObject(renderer())->allowsAcceleratedCompositing()) {
- PluginWidget* pluginWidget = static_cast<PluginWidget*>(toRenderEmbeddedObject(renderer())->widget());
- m_graphicsLayer->setContentsToMedia(pluginWidget->platformLayer());
+ PluginViewBase* pluginViewBase = static_cast<PluginViewBase*>(toRenderEmbeddedObject(renderer())->widget());
+ m_graphicsLayer->setContentsToMedia(pluginViewBase->platformLayer());
}
#if ENABLE(VIDEO)
else if (renderer()->isVideo()) {
@@ -259,11 +310,11 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
// Set transform property, if it is not animating. We have to do this here because the transform
// is affected by the layer dimensions.
- if (!renderer()->animation()->isAnimatingPropertyOnRenderer(renderer(), CSSPropertyWebkitTransform))
+ if (!renderer()->animation()->isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyWebkitTransform))
updateLayerTransform(renderer()->style());
// Set opacity, if it is not animating.
- if (!renderer()->animation()->isAnimatingPropertyOnRenderer(renderer(), CSSPropertyOpacity))
+ if (!renderer()->animation()->isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyOpacity))
updateLayerOpacity(renderer()->style());
RenderStyle* style = renderer()->style();
@@ -312,7 +363,12 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
}
m_graphicsLayer->setPosition(FloatPoint() + (relativeCompositingBounds.location() - graphicsLayerParentLocation));
+
+ IntSize oldOffsetFromRenderer = m_graphicsLayer->offsetFromRenderer();
m_graphicsLayer->setOffsetFromRenderer(localCompositingBounds.location() - IntPoint());
+ // If the compositing layer offset changes, we need to repaint.
+ if (oldOffsetFromRenderer != m_graphicsLayer->offsetFromRenderer())
+ m_graphicsLayer->setNeedsDisplay();
FloatSize oldSize = m_graphicsLayer->size();
FloatSize newSize = relativeCompositingBounds.size();
@@ -961,38 +1017,11 @@ void RenderLayerBacking::paintIntoLayer(RenderLayer* rootLayer, GraphicsContext*
bool shouldPaint = (m_owningLayer->hasVisibleContent() || m_owningLayer->hasVisibleDescendant()) && m_owningLayer->isSelfPaintingLayer();
if (shouldPaint && (paintingPhase & GraphicsLayerPaintBackground)) {
- // If this is the root then we need to send in a bigger bounding box
- // because we'll be painting the background as well (see RenderBox::paintRootBoxDecorations()).
- IntRect paintBox = clipRectToApply;
-
- // FIXME: do we need this code?
- if (renderer()->node() && renderer()->node()->isDocumentNode() && renderer()->document()->isHTMLDocument()) {
- RenderBox* box = toRenderBox(renderer());
- int w = box->width();
- int h = box->height();
-
- int rw;
- int rh;
- if (FrameView* frameView = box->view()->frameView()) {
- rw = frameView->contentsWidth();
- rh = frameView->contentsHeight();
- } else {
- rw = box->view()->width();
- rh = box->view()->height();
- }
-
- int bx = tx - box->marginLeft();
- int by = ty - box->marginTop();
- int bw = max(w + box->marginLeft() + box->marginRight() + box->borderLeft() + box->borderRight(), rw);
- int bh = max(h + box->marginTop() + box->marginBottom() + box->borderTop() + box->borderBottom(), rh);
- paintBox = IntRect(bx, by, bw, bh);
- }
-
// Paint our background first, before painting any child layers.
// Establish the clip used to paint our background.
setClip(context, paintDirtyRect, damageRect);
- PaintInfo info(context, paintBox, PaintPhaseBlockBackground, false, paintingRootForRenderer, 0);
+ PaintInfo info(context, damageRect, PaintPhaseBlockBackground, false, paintingRootForRenderer, 0);
renderer()->paint(info, tx, ty);
// Our scrollbar widgets paint exactly when we tell them to, so that they work properly with
@@ -1307,6 +1336,17 @@ String RenderLayerBacking::nameForLayer() const
}
#endif
+CompositingLayerType RenderLayerBacking::compositingLayerType() const
+{
+ if (m_graphicsLayer->hasContentsLayer())
+ return MediaCompositingLayer;
+
+ if (m_graphicsLayer->drawsContent())
+ return m_graphicsLayer->usingTiledLayer() ? TiledCompositingLayer : NormalCompositingLayer;
+
+ return ContainerCompositingLayer;
+}
+
} // namespace WebCore
#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/rendering/RenderLayerBacking.h b/WebCore/rendering/RenderLayerBacking.h
index 16c39da..852fc04 100644
--- a/WebCore/rendering/RenderLayerBacking.h
+++ b/WebCore/rendering/RenderLayerBacking.h
@@ -40,6 +40,13 @@ namespace WebCore {
class KeyframeList;
class RenderLayerCompositor;
+enum CompositingLayerType {
+ NormalCompositingLayer, // non-tiled layer with backing store
+ TiledCompositingLayer, // tiled layer (always has backing store)
+ MediaCompositingLayer, // layer that contains an image, video, webGL or plugin
+ ContainerCompositingLayer // layer with no backing store
+};
+
// RenderLayerBacking controls the compositing behavior for a single RenderLayer.
// It holds the various GraphicsLayers, and makes decisions about intra-layer rendering
// optimizations.
@@ -127,6 +134,9 @@ public:
IntRect contentsBox() const;
+ // For informative purposes only.
+ CompositingLayerType compositingLayerType() const;
+
private:
void createGraphicsLayer();
void destroyGraphicsLayer();
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp
index fe0d4e8..46278a2 100644
--- a/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/WebCore/rendering/RenderLayerCompositor.cpp
@@ -643,9 +643,11 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* layer, O
}
}
- // If we just entered compositing mode, the root will have become composited.
- if (layer->isRootLayer() && inCompositingMode())
- willBeComposited = true;
+ // If we just entered compositing mode, the root will have become composited (as long as accelerated compositing is enabled).
+ if (layer->isRootLayer()) {
+ if (inCompositingMode() && m_hasAcceleratedCompositing)
+ willBeComposited = true;
+ }
ASSERT(willBeComposited == needsToBeComposited(layer));
@@ -1337,8 +1339,8 @@ bool RenderLayerCompositor::requiresCompositingForIFrame(RenderObject* renderer)
bool RenderLayerCompositor::requiresCompositingForAnimation(RenderObject* renderer) const
{
if (AnimationController* animController = renderer->animation()) {
- return (animController->isAnimatingPropertyOnRenderer(renderer, CSSPropertyOpacity) && inCompositingMode())
- || animController->isAnimatingPropertyOnRenderer(renderer, CSSPropertyWebkitTransform);
+ return (animController->isRunningAnimationOnRenderer(renderer, CSSPropertyOpacity) && inCompositingMode())
+ || animController->isRunningAnimationOnRenderer(renderer, CSSPropertyWebkitTransform);
}
return false;
}
diff --git a/WebCore/rendering/RenderMenuList.cpp b/WebCore/rendering/RenderMenuList.cpp
index 77fe3c2..177921c 100644
--- a/WebCore/rendering/RenderMenuList.cpp
+++ b/WebCore/rendering/RenderMenuList.cpp
@@ -26,7 +26,6 @@
#include "RenderMenuList.h"
#include "AXObjectCache.h"
-#include "AccessibilityObject.h"
#include "CSSStyleSelector.h"
#include "Frame.h"
#include "FrameView.h"
@@ -350,6 +349,11 @@ String RenderMenuList::itemText(unsigned listIndex) const
return String();
}
+String RenderMenuList::itemLabel(unsigned) const
+{
+ return String();
+}
+
String RenderMenuList::itemAccessibilityText(unsigned listIndex) const
{
// Allow the accessible name be changed if necessary.
@@ -358,7 +362,7 @@ String RenderMenuList::itemAccessibilityText(unsigned listIndex) const
if (listIndex >= listItems.size())
return String();
- return AccessibilityObject::getAttribute(listItems[listIndex], aria_labelAttr);
+ return listItems[listIndex]->getAttribute(aria_labelAttr);
}
String RenderMenuList::itemToolTip(unsigned listIndex) const
diff --git a/WebCore/rendering/RenderMenuList.h b/WebCore/rendering/RenderMenuList.h
index 9e51996..d72e1a9 100644
--- a/WebCore/rendering/RenderMenuList.h
+++ b/WebCore/rendering/RenderMenuList.h
@@ -82,6 +82,7 @@ private:
// PopupMenuClient methods
virtual String itemText(unsigned listIndex) const;
+ virtual String itemLabel(unsigned listIndex) const;
virtual String itemToolTip(unsigned listIndex) const;
virtual String itemAccessibilityText(unsigned listIndex) const;
virtual bool itemIsEnabled(unsigned listIndex) const;
diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp
index 4ff35eb..783ed63 100644
--- a/WebCore/rendering/RenderObject.cpp
+++ b/WebCore/rendering/RenderObject.cpp
@@ -944,10 +944,10 @@ void RenderObject::drawBoxSideFromPath(GraphicsContext* graphicsContext, IntRect
whiteSpaceWidth += (patWidth / numberOfWhitespaceDashes);
}
- DashArray* lineDash = new DashArray();
- lineDash->append(patWidth);
- lineDash->append(whiteSpaceWidth);
- graphicsContext->setLineDash(*lineDash, patWidth);
+ DashArray lineDash;
+ lineDash.append(patWidth);
+ lineDash.append(whiteSpaceWidth);
+ graphicsContext->setLineDash(lineDash, patWidth);
graphicsContext->addPath(borderPath);
graphicsContext->strokePath();
return;
@@ -1357,7 +1357,8 @@ bool RenderObject::repaintAfterLayoutIfNeeded(RenderBoxModelObject* repaintConta
if (v->printing())
return false; // Don't repaint if we're printing.
- ASSERT(!newBoundsPtr || *newBoundsPtr == clippedOverflowRectForRepaint(repaintContainer));
+ // This ASSERT fails due to animations. See https://bugs.webkit.org/show_bug.cgi?id=37048
+ // ASSERT(!newBoundsPtr || *newBoundsPtr == clippedOverflowRectForRepaint(repaintContainer));
IntRect newBounds = newBoundsPtr ? *newBoundsPtr : clippedOverflowRectForRepaint(repaintContainer);
IntRect newOutlineBox;
@@ -1366,7 +1367,8 @@ bool RenderObject::repaintAfterLayoutIfNeeded(RenderBoxModelObject* repaintConta
if (!fullRepaint && style()->borderFit() == BorderFitLines)
fullRepaint = true;
if (!fullRepaint) {
- ASSERT(!newOutlineBoxRectPtr || *newOutlineBoxRectPtr == outlineBoundsForRepaint(repaintContainer));
+ // This ASSERT fails due to animations. See https://bugs.webkit.org/show_bug.cgi?id=37048
+ // ASSERT(!newOutlineBoxRectPtr || *newOutlineBoxRectPtr == outlineBoundsForRepaint(repaintContainer));
newOutlineBox = newOutlineBoxRectPtr ? *newOutlineBoxRectPtr : outlineBoundsForRepaint(repaintContainer);
if (newOutlineBox.location() != oldOutlineBox.location() || (mustRepaintBackgroundOrBorder() && (newBounds != oldBounds || newOutlineBox != oldOutlineBox)))
fullRepaint = true;
diff --git a/WebCore/rendering/RenderObjectChildList.cpp b/WebCore/rendering/RenderObjectChildList.cpp
index 6775537..68e392c 100644
--- a/WebCore/rendering/RenderObjectChildList.cpp
+++ b/WebCore/rendering/RenderObjectChildList.cpp
@@ -1,5 +1,6 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -44,7 +45,11 @@ void RenderObjectChildList::destroyLeftoverChildren()
while (firstChild()) {
if (firstChild()->isListMarker() || (firstChild()->style()->styleType() == FIRST_LETTER && !firstChild()->isText()))
firstChild()->remove(); // List markers are owned by their enclosing list and so don't get destroyed by this container. Similarly, first letters are destroyed by their remaining text fragment.
- else {
+ else if (firstChild()->isRunIn() && firstChild()->node()) {
+ firstChild()->node()->setRenderer(0);
+ firstChild()->node()->setNeedsStyleRecalc();
+ firstChild()->destroy();
+ } else {
// Destroy any anonymous children remaining in the render tree, as well as implicit (shadow) DOM elements like those used in the engine-based text fields.
if (firstChild()->node())
firstChild()->node()->setRenderer(0);
@@ -62,9 +67,12 @@ RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, Render
// disappears gets repainted properly.
if (!owner->documentBeingDestroyed() && fullRemove && oldChild->m_everHadLayout) {
oldChild->setNeedsLayoutAndPrefWidthsRecalc();
- oldChild->repaint();
+ if (oldChild->isBody())
+ owner->view()->repaint();
+ else
+ oldChild->repaint();
}
-
+
// If we have a line box wrapper, delete it.
if (oldChild->isBox())
toRenderBox(oldChild)->deleteLineBoxWrapper();
diff --git a/WebCore/rendering/RenderPath.cpp b/WebCore/rendering/RenderPath.cpp
index 27d480d..dd79397 100644
--- a/WebCore/rendering/RenderPath.cpp
+++ b/WebCore/rendering/RenderPath.cpp
@@ -97,7 +97,7 @@ bool RenderPath::strokeContains(const FloatPoint& point, bool requiresStroke) co
void RenderPath::layout()
{
- LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout());
+ LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
bool needsPathUpdate = m_needsPathUpdate;
@@ -111,6 +111,10 @@ void RenderPath::layout()
m_needsTransformUpdate = false;
}
+ // Invalidate all resources of this client, if we changed something.
+ if (m_everHadLayout && selfNeedsLayout())
+ RenderSVGResource::invalidateAllResourcesOfRenderer(this);
+
// At this point LayoutRepainter already grabbed the old bounds,
// recalculate them now so repaintAfterLayout() uses the new bounds
if (needsPathUpdate || m_needsBoundariesUpdate) {
diff --git a/WebCore/rendering/RenderSVGContainer.cpp b/WebCore/rendering/RenderSVGContainer.cpp
index d4ca69f..f82ec95 100644
--- a/WebCore/rendering/RenderSVGContainer.cpp
+++ b/WebCore/rendering/RenderSVGContainer.cpp
@@ -50,13 +50,17 @@ void RenderSVGContainer::layout()
// Allow RenderSVGViewportContainer to update its viewport.
calcViewport();
- LayoutRepainter repainter(*this, checkForRepaintDuringLayout() || selfWillPaint());
+ LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
// Allow RenderSVGTransformableContainer to update its transform.
calculateLocalTransform();
SVGRenderSupport::layoutChildren(this, selfNeedsLayout());
+ // Invalidate all resources of this client, if we changed something.
+ if (m_everHadLayout && selfNeedsLayout())
+ RenderSVGResource::invalidateAllResourcesOfRenderer(this);
+
repainter.repaintAfterLayout();
setNeedsLayout(false);
}
diff --git a/WebCore/rendering/RenderSVGImage.cpp b/WebCore/rendering/RenderSVGImage.cpp
index a4572e6..44b68b1 100644
--- a/WebCore/rendering/RenderSVGImage.cpp
+++ b/WebCore/rendering/RenderSVGImage.cpp
@@ -52,7 +52,7 @@ void RenderSVGImage::layout()
{
ASSERT(needsLayout());
- LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
+ LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
SVGImageElement* image = static_cast<SVGImageElement*>(node());
if (m_needsTransformUpdate) {
@@ -66,11 +66,15 @@ void RenderSVGImage::layout()
calcWidth();
calcHeight();
+ // FIXME: Optimize caching the repaint rects.
m_localBounds = FloatRect(image->x().value(image), image->y().value(image), image->width().value(image), image->height().value(image));
m_cachedLocalRepaintRect = FloatRect();
+ // Invalidate all resources of this client, if we changed something.
+ if (m_everHadLayout && selfNeedsLayout())
+ RenderSVGResource::invalidateAllResourcesOfRenderer(this);
+
repainter.repaintAfterLayout();
-
setNeedsLayout(false);
}
diff --git a/WebCore/rendering/RenderSVGModelObject.cpp b/WebCore/rendering/RenderSVGModelObject.cpp
index 3d22e7a..49404cb 100644
--- a/WebCore/rendering/RenderSVGModelObject.cpp
+++ b/WebCore/rendering/RenderSVGModelObject.cpp
@@ -87,6 +87,14 @@ void RenderSVGModelObject::destroy()
RenderObject::destroy();
}
+void RenderSVGModelObject::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
+{
+ RenderObject::styleDidChange(diff, oldStyle);
+
+ if (style() && (diff == StyleDifferenceLayout || diff == StyleDifferenceRepaint))
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(this, false);
+}
+
bool RenderSVGModelObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int, HitTestAction)
{
ASSERT_NOT_REACHED();
diff --git a/WebCore/rendering/RenderSVGModelObject.h b/WebCore/rendering/RenderSVGModelObject.h
index 82c08c0..741cd61 100644
--- a/WebCore/rendering/RenderSVGModelObject.h
+++ b/WebCore/rendering/RenderSVGModelObject.h
@@ -61,6 +61,7 @@ public:
virtual void destroy();
virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const;
+ virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
private:
// This method should never be called, SVG uses a different nodeAtPoint method
diff --git a/WebCore/rendering/RenderSVGResource.cpp b/WebCore/rendering/RenderSVGResource.cpp
index 0aa7182..b4f499e 100644
--- a/WebCore/rendering/RenderSVGResource.cpp
+++ b/WebCore/rendering/RenderSVGResource.cpp
@@ -184,21 +184,17 @@ RenderSVGResourceSolidColor* RenderSVGResource::sharedSolidPaintingResource()
return s_sharedSolidPaintingResource;
}
-void RenderSVGResource::markForLayoutAndResourceInvalidation(RenderObject* object)
+void RenderSVGResource::markForLayoutAndResourceInvalidation(RenderObject* object, bool needsBoundariesUpdate)
{
ASSERT(object);
ASSERT(object->node());
ASSERT(object->node()->isSVGElement());
- // Mark the renderer for layout
- object->setNeedsLayout(true);
+ // Eventually mark the renderer needing a boundaries update
+ if (needsBoundariesUpdate)
+ object->setNeedsBoundariesUpdate();
- // Notify any resources in the ancestor chain, that we've been invalidated
- SVGElement* element = static_cast<SVGElement*>(object->node());
- if (!element->isStyled())
- return;
-
- static_cast<SVGStyledElement*>(element)->invalidateResourcesInAncestorChain();
+ markForLayoutAndParentResourceInvalidation(object);
}
static inline void invalidatePaintingResource(SVGPaint* paint, RenderObject* object)
@@ -254,6 +250,22 @@ void RenderSVGResource::invalidateAllResourcesOfRenderer(RenderObject* object)
invalidatePaintingResource(svgStyle->strokePaint(), object);
}
+void RenderSVGResource::markForLayoutAndParentResourceInvalidation(RenderObject* object, bool needsLayout)
+{
+ ASSERT(object);
+ if (needsLayout)
+ object->setNeedsLayout(true);
+
+ // Invalidate resources in ancestor chain, if needed.
+ RenderObject* current = object->parent();
+ while (current) {
+ if (current->isSVGResourceContainer())
+ current->toRenderSVGResourceContainer()->invalidateClients();
+
+ current = current->parent();
+ }
+}
+
}
#endif
diff --git a/WebCore/rendering/RenderSVGResource.h b/WebCore/rendering/RenderSVGResource.h
index 34ff14e..b3ea6fb 100644
--- a/WebCore/rendering/RenderSVGResource.h
+++ b/WebCore/rendering/RenderSVGResource.h
@@ -80,12 +80,13 @@ public:
static RenderSVGResourceSolidColor* sharedSolidPaintingResource();
static void invalidateAllResourcesOfRenderer(RenderObject*);
+ static void markForLayoutAndParentResourceInvalidation(RenderObject*, bool needsLayout = true);
private:
static void adjustColorForPseudoRules(const RenderStyle*, bool useFillPaint, Color&);
protected:
- void markForLayoutAndResourceInvalidation(RenderObject*);
+ void markForLayoutAndResourceInvalidation(RenderObject*, bool needsBoundariesUpdate = true);
};
}
diff --git a/WebCore/rendering/RenderSVGResourceClipper.cpp b/WebCore/rendering/RenderSVGResourceClipper.cpp
index cc499bf..e923f7e 100644
--- a/WebCore/rendering/RenderSVGResourceClipper.cpp
+++ b/WebCore/rendering/RenderSVGResourceClipper.cpp
@@ -49,6 +49,7 @@ RenderSVGResourceType RenderSVGResourceClipper::s_resourceType = ClipperResource
RenderSVGResourceClipper::RenderSVGResourceClipper(SVGClipPathElement* node)
: RenderSVGResourceContainer(node)
+ , m_invalidationBlocked(false)
{
}
@@ -60,12 +61,13 @@ RenderSVGResourceClipper::~RenderSVGResourceClipper()
void RenderSVGResourceClipper::invalidateClients()
{
+ if (m_invalidationBlocked)
+ return;
+
HashMap<RenderObject*, ClipperData*>::const_iterator end = m_clipper.end();
- for (HashMap<RenderObject*, ClipperData*>::const_iterator it = m_clipper.begin(); it != end; ++it) {
- RenderObject* renderer = it->first;
- renderer->setNeedsBoundariesUpdate();
- renderer->setNeedsLayout(true);
- }
+ for (HashMap<RenderObject*, ClipperData*>::const_iterator it = m_clipper.begin(); it != end; ++it)
+ markForLayoutAndResourceInvalidation(it->first);
+
deleteAllValues(m_clipper);
m_clipper.clear();
m_clipBoundaries = FloatRect();
@@ -73,12 +75,10 @@ void RenderSVGResourceClipper::invalidateClients()
void RenderSVGResourceClipper::invalidateClient(RenderObject* object)
{
- ASSERT(object);
+ if (m_invalidationBlocked)
+ return;
- // FIXME: The HashSet should always contain the object on calling invalidateClient. A race condition
- // during the parsing can causes a call of invalidateClient right before the call of applyResource.
- // We return earlier for the moment. This bug should be fixed in:
- // https://bugs.webkit.org/show_bug.cgi?id=35181
+ ASSERT(object);
if (!m_clipper.contains(object))
return;
@@ -95,6 +95,11 @@ bool RenderSVGResourceClipper::applyResource(RenderObject* object, RenderStyle*,
#else
UNUSED_PARAM(resourceMode);
#endif
+
+ // Early exit, if this resource contains a child which references ourselves.
+ if (containsCyclicReference(node()))
+ return false;
+
applyClippingToContext(object, object->objectBoundingBox(), object->repaintRectInLocalCoordinates(), context);
return true;
}
@@ -237,6 +242,10 @@ bool RenderSVGResourceClipper::createClipData(ClipperData* clipperData, const Fl
svgStyle->setStrokeOpacity(1.0f);
svgStyle->setFilterResource(String());
svgStyle->setMaskerResource(String());
+
+ // The setStyle() call results in a styleDidChange() call, which in turn invalidations the resources.
+ // As we're mutating the resource on purpose, block updates until we've resetted the style again.
+ m_invalidationBlocked = true;
renderer->setStyle(newRenderStyle.release());
// In the case of a <use> element, we obtained its renderere above, to retrieve its clipRule.
@@ -245,6 +254,7 @@ bool RenderSVGResourceClipper::createClipData(ClipperData* clipperData, const Fl
SVGRenderSupport::renderSubtreeToImage(clipperData->clipMaskImage.get(), isUseElement ? childNode->renderer() : renderer);
renderer->setStyle(oldRenderStyle.release());
+ m_invalidationBlocked = false;
}
maskContext->restore();
@@ -270,6 +280,12 @@ void RenderSVGResourceClipper::calculateClipContentRepaintRect()
bool RenderSVGResourceClipper::hitTestClipContent(const FloatRect& objectBoundingBox, const FloatPoint& nodeAtPoint)
{
+ // FIXME: We should be able to check whether m_clipper.contains(object) - this doesn't work at the moment
+ // as resourceBoundingBox() has already created ClipperData, even if applyResource() returned false.
+ // Early exit, if this resource contains a child which references ourselves.
+ if (containsCyclicReference(node()))
+ return false;
+
FloatPoint point = nodeAtPoint;
if (!SVGRenderSupport::pointInClippingArea(this, point))
return false;
@@ -296,12 +312,16 @@ bool RenderSVGResourceClipper::hitTestClipContent(const FloatRect& objectBoundin
return false;
}
-FloatRect RenderSVGResourceClipper::resourceBoundingBox(RenderObject* object)
+bool RenderSVGResourceClipper::childElementReferencesResource(const SVGRenderStyle* style, const String& referenceId) const
{
- // Save the reference to the calling object for relayouting it on changing resource properties.
- if (!m_clipper.contains(object))
- m_clipper.set(object, new ClipperData);
+ if (!style->hasClipper())
+ return false;
+
+ return style->clipperResource() == referenceId;
+}
+FloatRect RenderSVGResourceClipper::resourceBoundingBox(RenderObject* object)
+{
// Resource was not layouted yet. Give back the boundingBox of the object.
if (selfNeedsLayout())
return object->objectBoundingBox();
diff --git a/WebCore/rendering/RenderSVGResourceClipper.h b/WebCore/rendering/RenderSVGResourceClipper.h
index 78ec75b..7128aa1 100644
--- a/WebCore/rendering/RenderSVGResourceClipper.h
+++ b/WebCore/rendering/RenderSVGResourceClipper.h
@@ -68,6 +68,9 @@ private:
bool createClipData(ClipperData*, const FloatRect&, const FloatRect&);
void calculateClipContentRepaintRect();
+ virtual bool childElementReferencesResource(const SVGRenderStyle*, const String&) const;
+
+ bool m_invalidationBlocked;
FloatRect m_clipBoundaries;
HashMap<RenderObject*, ClipperData*> m_clipper;
};
diff --git a/WebCore/rendering/RenderSVGResourceContainer.h b/WebCore/rendering/RenderSVGResourceContainer.h
index 54617bb..5f1c828 100644
--- a/WebCore/rendering/RenderSVGResourceContainer.h
+++ b/WebCore/rendering/RenderSVGResourceContainer.h
@@ -26,6 +26,7 @@
#include "SVGStyledTransformableElement.h"
#include "RenderSVGResource.h"
+#include "RenderSVGShadowTreeRootContainer.h"
namespace WebCore {
@@ -35,8 +36,7 @@ public:
RenderSVGResourceContainer(SVGStyledElement* node)
: RenderSVGHiddenContainer(node)
, RenderSVGResource()
- // FIXME: Should probably be using getIdAttribute rather than idForStyleResolution.
- , m_id(node->hasID() ? node->idForStyleResolution() : nullAtom)
+ , m_id(node->hasID() ? node->getIdAttribute() : nullAtom)
{
ASSERT(node->document());
node->document()->accessSVGExtensions()->addResource(m_id, this);
@@ -57,9 +57,7 @@ public:
// Remove old id, that is guaranteed to be present in cache
extensions->removeResource(m_id);
-
- // FIXME: Should probably be using getIdAttribute rather than idForStyleResolution.
- m_id = node()->hasID() ? static_cast<Element*>(node())->idForStyleResolution() : nullAtom;
+ m_id = static_cast<Element*>(node())->getIdAttribute();
// It's possible that an element is referencing us with the new id, and has to be notified that we're existing now
if (extensions->isPendingResource(m_id)) {
@@ -84,7 +82,8 @@ public:
virtual bool drawsContents() { return false; }
virtual RenderSVGResourceContainer* toRenderSVGResourceContainer() { return this; }
-
+ virtual bool childElementReferencesResource(const SVGRenderStyle*, const String&) const { return false; }
+
static AffineTransform transformOnNonScalingStroke(RenderObject* object, const AffineTransform resourceTransform)
{
if (!object->isRenderPath())
@@ -96,6 +95,48 @@ public:
return transform;
}
+ bool containsCyclicReference(const Node* startNode) const
+ {
+ ASSERT(startNode->document());
+
+ for (Node* node = startNode->firstChild(); node; node = node->nextSibling()) {
+ if (!node->isSVGElement())
+ continue;
+
+ RenderObject* renderer = node->renderer();
+ if (!renderer)
+ continue;
+
+ RenderStyle* style = renderer->style();
+ if (!style)
+ continue;
+
+ const SVGRenderStyle* svgStyle = style->svgStyle();
+ ASSERT(svgStyle);
+
+ // Let the class inheriting from us decide whether the child element references ourselves.
+ if (childElementReferencesResource(svgStyle, m_id))
+ return true;
+
+ // Dive into shadow tree to check for cycles there.
+ if (node->hasTagName(SVGNames::useTag)) {
+ ASSERT(renderer->isSVGShadowTreeRootContainer());
+ if (Node* shadowRoot = static_cast<RenderSVGShadowTreeRootContainer*>(renderer)->rootElement()) {
+ if (containsCyclicReference(shadowRoot))
+ return true;
+ }
+
+ }
+
+ if (node->hasChildNodes()) {
+ if (containsCyclicReference(node))
+ return true;
+ }
+ }
+
+ return false;
+ }
+
private:
AtomicString m_id;
};
diff --git a/WebCore/rendering/RenderSVGResourceFilter.cpp b/WebCore/rendering/RenderSVGResourceFilter.cpp
index 19a6ccb..a6358f0 100644
--- a/WebCore/rendering/RenderSVGResourceFilter.cpp
+++ b/WebCore/rendering/RenderSVGResourceFilter.cpp
@@ -67,11 +67,9 @@ RenderSVGResourceFilter::~RenderSVGResourceFilter()
void RenderSVGResourceFilter::invalidateClients()
{
HashMap<RenderObject*, FilterData*>::const_iterator end = m_filter.end();
- for (HashMap<RenderObject*, FilterData*>::const_iterator it = m_filter.begin(); it != end; ++it) {
- RenderObject* renderer = it->first;
- renderer->setNeedsBoundariesUpdate();
- renderer->setNeedsLayout(true);
- }
+ for (HashMap<RenderObject*, FilterData*>::const_iterator it = m_filter.begin(); it != end; ++it)
+ markForLayoutAndResourceInvalidation(it->first);
+
deleteAllValues(m_filter);
m_filter.clear();
}
@@ -79,11 +77,6 @@ void RenderSVGResourceFilter::invalidateClients()
void RenderSVGResourceFilter::invalidateClient(RenderObject* object)
{
ASSERT(object);
-
- // FIXME: The HashMap should always contain the object on calling invalidateClient. A race condition
- // during the parsing can causes a call of invalidateClient right before the call of applyResource.
- // We return earlier for the moment. This bug should be fixed in:
- // https://bugs.webkit.org/show_bug.cgi?id=35181
if (!m_filter.contains(object))
return;
diff --git a/WebCore/rendering/RenderSVGResourceGradient.cpp b/WebCore/rendering/RenderSVGResourceGradient.cpp
index 74f5b13..ce51369 100644
--- a/WebCore/rendering/RenderSVGResourceGradient.cpp
+++ b/WebCore/rendering/RenderSVGResourceGradient.cpp
@@ -51,7 +51,7 @@ void RenderSVGResourceGradient::invalidateClients()
{
const HashMap<RenderObject*, GradientData*>::const_iterator end = m_gradient.end();
for (HashMap<RenderObject*, GradientData*>::const_iterator it = m_gradient.begin(); it != end; ++it)
- markForLayoutAndResourceInvalidation(it->first);
+ markForLayoutAndResourceInvalidation(it->first, false);
deleteAllValues(m_gradient);
m_gradient.clear();
@@ -60,16 +60,11 @@ void RenderSVGResourceGradient::invalidateClients()
void RenderSVGResourceGradient::invalidateClient(RenderObject* object)
{
ASSERT(object);
-
- // FIXME: The HashMap should always contain the object on calling invalidateClient. A race condition
- // during the parsing can causes a call of invalidateClient right before the call of applyResource.
- // We return earlier for the moment. This bug should be fixed in:
- // https://bugs.webkit.org/show_bug.cgi?id=35181
if (!m_gradient.contains(object))
return;
delete m_gradient.take(object);
- markForLayoutAndResourceInvalidation(object);
+ markForLayoutAndResourceInvalidation(object, false);
}
#if PLATFORM(CG)
@@ -133,7 +128,7 @@ static inline AffineTransform clipToTextMask(GraphicsContext* context,
matrix.translate(maskBoundingBox.x(), maskBoundingBox.y());
matrix.scaleNonUniform(maskBoundingBox.width(), maskBoundingBox.height());
}
- matrix.multiply(gradientData->transform);
+ matrix.multLeft(gradientData->transform);
return matrix;
}
#endif
@@ -179,7 +174,7 @@ bool RenderSVGResourceGradient::applyResource(RenderObject* object, RenderStyle*
gradientData->userspaceTransform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
}
- gradientData->userspaceTransform.multiply(gradientData->transform);
+ gradientData->userspaceTransform.multLeft(gradientData->transform);
gradientData->gradient->setGradientSpaceTransform(gradientData->userspaceTransform);
}
diff --git a/WebCore/rendering/RenderSVGResourceMarker.cpp b/WebCore/rendering/RenderSVGResourceMarker.cpp
index ce331a7..4f0cace 100644
--- a/WebCore/rendering/RenderSVGResourceMarker.cpp
+++ b/WebCore/rendering/RenderSVGResourceMarker.cpp
@@ -62,11 +62,8 @@ void RenderSVGResourceMarker::addClient(const RenderObject* object)
void RenderSVGResourceMarker::invalidateClients()
{
const HashSet<const RenderObject*>::const_iterator end = m_marker.end();
- for (HashSet<const RenderObject*>::const_iterator it = m_marker.begin(); it != end; ++it) {
- RenderObject* renderer = const_cast<RenderObject*>(*it);
- renderer->setNeedsBoundariesUpdate();
- renderer->setNeedsLayout(true);
- }
+ for (HashSet<const RenderObject*>::const_iterator it = m_marker.begin(); it != end; ++it)
+ markForLayoutAndResourceInvalidation(const_cast<RenderObject*>(*it));
m_marker.clear();
}
@@ -74,11 +71,6 @@ void RenderSVGResourceMarker::invalidateClients()
void RenderSVGResourceMarker::invalidateClient(RenderObject* object)
{
ASSERT(object);
-
- // FIXME: The HashSet should always contain the object on calling invalidateClient. A race condition
- // during the parsing can causes a call of invalidateClient right before the call of applyResource.
- // We return earlier for the moment. This bug should be fixed in:
- // https://bugs.webkit.org/show_bug.cgi?id=35181
if (!m_marker.contains(object))
return;
diff --git a/WebCore/rendering/RenderSVGResourceMasker.cpp b/WebCore/rendering/RenderSVGResourceMasker.cpp
index 74d3fe6..83a64b5 100644
--- a/WebCore/rendering/RenderSVGResourceMasker.cpp
+++ b/WebCore/rendering/RenderSVGResourceMasker.cpp
@@ -58,11 +58,8 @@ RenderSVGResourceMasker::~RenderSVGResourceMasker()
void RenderSVGResourceMasker::invalidateClients()
{
HashMap<RenderObject*, MaskerData*>::const_iterator end = m_masker.end();
- for (HashMap<RenderObject*, MaskerData*>::const_iterator it = m_masker.begin(); it != end; ++it) {
- RenderObject* renderer = it->first;
- renderer->setNeedsBoundariesUpdate();
- renderer->setNeedsLayout(true);
- }
+ for (HashMap<RenderObject*, MaskerData*>::const_iterator it = m_masker.begin(); it != end; ++it)
+ markForLayoutAndResourceInvalidation(it->first);
deleteAllValues(m_masker);
m_masker.clear();
@@ -72,11 +69,6 @@ void RenderSVGResourceMasker::invalidateClients()
void RenderSVGResourceMasker::invalidateClient(RenderObject* object)
{
ASSERT(object);
-
- // FIXME: The HashMap should always contain the object on calling invalidateClient. A race condition
- // during the parsing can causes a call of invalidateClient right before the call of applyResource.
- // We return earlier for the moment. This bug should be fixed in:
- // https://bugs.webkit.org/show_bug.cgi?id=35181
if (!m_masker.contains(object))
return;
@@ -84,6 +76,14 @@ void RenderSVGResourceMasker::invalidateClient(RenderObject* object)
markForLayoutAndResourceInvalidation(object);
}
+bool RenderSVGResourceMasker::childElementReferencesResource(const SVGRenderStyle* style, const String& referenceId) const
+{
+ if (!style->hasMasker())
+ return false;
+
+ return style->maskerResource() == referenceId;
+}
+
bool RenderSVGResourceMasker::applyResource(RenderObject* object, RenderStyle*, GraphicsContext*& context, unsigned short resourceMode)
{
ASSERT(object);
@@ -103,6 +103,10 @@ bool RenderSVGResourceMasker::applyResource(RenderObject* object, RenderStyle*,
if (!maskElement)
return false;
+ // Early exit, if this resource contains a child which references ourselves.
+ if (containsCyclicReference(node()))
+ return false;
+
createMaskImage(maskerData, maskElement, object);
}
@@ -178,6 +182,10 @@ void RenderSVGResourceMasker::createMaskImage(MaskerData* maskerData, const SVGM
maskImageContext->restore();
+#if !PLATFORM(CG)
+ maskerData->maskImage->transformColorSpace(DeviceRGB, LinearRGB);
+#endif
+
// create the luminance mask
RefPtr<ImageData> imageData(maskerData->maskImage->getUnmultipliedImageData(maskImageRect));
CanvasPixelArray* srcPixelArray(imageData->data());
@@ -212,10 +220,6 @@ void RenderSVGResourceMasker::calculateMaskContentRepaintRect()
FloatRect RenderSVGResourceMasker::resourceBoundingBox(RenderObject* object)
{
- // Save the reference to the calling object for relayouting it on changing resource properties.
- if (!m_masker.contains(object))
- m_masker.set(object, new MaskerData);
-
// Resource was not layouted yet. Give back clipping rect of the mask.
SVGMaskElement* maskElement = static_cast<SVGMaskElement*>(node());
FloatRect objectBoundingBox = object->objectBoundingBox();
diff --git a/WebCore/rendering/RenderSVGResourceMasker.h b/WebCore/rendering/RenderSVGResourceMasker.h
index f6301cb..56f657b 100644
--- a/WebCore/rendering/RenderSVGResourceMasker.h
+++ b/WebCore/rendering/RenderSVGResourceMasker.h
@@ -69,6 +69,8 @@ private:
void createMaskImage(MaskerData*, const SVGMaskElement*, RenderObject*);
void calculateMaskContentRepaintRect();
+ virtual bool childElementReferencesResource(const SVGRenderStyle*, const String&) const;
+
FloatRect m_maskBoundaries;
HashMap<RenderObject*, MaskerData*> m_masker;
};
diff --git a/WebCore/rendering/RenderSVGResourcePattern.cpp b/WebCore/rendering/RenderSVGResourcePattern.cpp
index ba24fcf..a2234c8 100644
--- a/WebCore/rendering/RenderSVGResourcePattern.cpp
+++ b/WebCore/rendering/RenderSVGResourcePattern.cpp
@@ -48,7 +48,7 @@ void RenderSVGResourcePattern::invalidateClients()
{
const HashMap<RenderObject*, PatternData*>::const_iterator end = m_pattern.end();
for (HashMap<RenderObject*, PatternData*>::const_iterator it = m_pattern.begin(); it != end; ++it)
- markForLayoutAndResourceInvalidation(it->first);
+ markForLayoutAndResourceInvalidation(it->first, false);
deleteAllValues(m_pattern);
m_pattern.clear();
@@ -57,16 +57,26 @@ void RenderSVGResourcePattern::invalidateClients()
void RenderSVGResourcePattern::invalidateClient(RenderObject* object)
{
ASSERT(object);
-
- // FIXME: The HashMap should always contain the object on calling invalidateClient. A race condition
- // during the parsing can causes a call of invalidateClient right before the call of applyResource.
- // We return earlier for the moment. This bug should be fixed in:
- // https://bugs.webkit.org/show_bug.cgi?id=35181
if (!m_pattern.contains(object))
return;
delete m_pattern.take(object);
- markForLayoutAndResourceInvalidation(object);
+ markForLayoutAndResourceInvalidation(object, false);
+}
+
+bool RenderSVGResourcePattern::childElementReferencesResource(const SVGRenderStyle* style, const String& referenceId) const
+{
+ if (style->hasFill()) {
+ if (style->fillPaint()->matchesTargetURI(referenceId))
+ return true;
+ }
+
+ if (style->hasStroke()) {
+ if (style->strokePaint()->matchesTargetURI(referenceId))
+ return true;
+ }
+
+ return false;
}
bool RenderSVGResourcePattern::applyResource(RenderObject* object, RenderStyle* style, GraphicsContext*& context, unsigned short resourceMode)
@@ -91,7 +101,6 @@ bool RenderSVGResourcePattern::applyResource(RenderObject* object, RenderStyle*
PatternData* patternData = m_pattern.get(object);
if (!patternData->pattern) {
-
// Create tile image
OwnPtr<ImageBuffer> tileImage = createTileImage(patternData, patternElement, object);
if (!tileImage)
@@ -235,6 +244,10 @@ PassOwnPtr<ImageBuffer> RenderSVGResourcePattern::createTileImage(PatternData* p
if (!attributes.patternContentElement())
return 0;
+ // Early exit, if this resource contains a child which references ourselves.
+ if (containsCyclicReference(attributes.patternContentElement()))
+ return 0;
+
FloatRect objectBoundingBox = object->objectBoundingBox();
FloatRect patternBoundaries = calculatePatternBoundaries(attributes, objectBoundingBox, patternElement);
AffineTransform patternTransform = attributes.patternTransform();
diff --git a/WebCore/rendering/RenderSVGResourcePattern.h b/WebCore/rendering/RenderSVGResourcePattern.h
index 690b0de..ec89777 100644
--- a/WebCore/rendering/RenderSVGResourcePattern.h
+++ b/WebCore/rendering/RenderSVGResourcePattern.h
@@ -67,6 +67,8 @@ private:
FloatRect calculatePatternBoundariesIncludingOverflow(PatternAttributes&, const FloatRect& objectBoundingBox,
const AffineTransform& viewBoxCTM, const FloatRect& patternBoundaries) const;
+ virtual bool childElementReferencesResource(const SVGRenderStyle*, const String&) const;
+
HashMap<RenderObject*, PatternData*> m_pattern;
};
diff --git a/WebCore/rendering/RenderSVGRoot.cpp b/WebCore/rendering/RenderSVGRoot.cpp
index 396df19..1659e40 100644
--- a/WebCore/rendering/RenderSVGRoot.cpp
+++ b/WebCore/rendering/RenderSVGRoot.cpp
@@ -112,7 +112,7 @@ void RenderSVGRoot::layout()
view()->disableLayoutState();
bool needsLayout = selfNeedsLayout();
- LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && needsLayout);
+ LayoutRepainter repainter(*this, needsLayout && m_everHadLayout && checkForRepaintDuringLayout());
IntSize oldSize(width(), height());
calcWidth();
diff --git a/WebCore/rendering/RenderSVGShadowTreeRootContainer.cpp b/WebCore/rendering/RenderSVGShadowTreeRootContainer.cpp
index 9d3d26f..888dd57 100644
--- a/WebCore/rendering/RenderSVGShadowTreeRootContainer.cpp
+++ b/WebCore/rendering/RenderSVGShadowTreeRootContainer.cpp
@@ -96,6 +96,11 @@ void RenderSVGShadowTreeRootContainer::styleDidChange(StyleDifference diff, cons
shadowRootRenderer->setStyle(style());
}
+Node* RenderSVGShadowTreeRootContainer::rootElement() const
+{
+ return m_shadowRoot.get();
+}
+
}
#endif
diff --git a/WebCore/rendering/RenderSVGShadowTreeRootContainer.h b/WebCore/rendering/RenderSVGShadowTreeRootContainer.h
index 81ae44b..bff2a87 100644
--- a/WebCore/rendering/RenderSVGShadowTreeRootContainer.h
+++ b/WebCore/rendering/RenderSVGShadowTreeRootContainer.h
@@ -39,6 +39,8 @@ public:
void updateStyle(Node::StyleChange);
virtual void updateFromElement();
+ Node* rootElement() const;
+
private:
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
diff --git a/WebCore/rendering/RenderSVGText.cpp b/WebCore/rendering/RenderSVGText.cpp
index 12f3cb5..58348db 100644
--- a/WebCore/rendering/RenderSVGText.cpp
+++ b/WebCore/rendering/RenderSVGText.cpp
@@ -73,7 +73,7 @@ void RenderSVGText::mapLocalToContainer(RenderBoxModelObject* repaintContainer,
void RenderSVGText::layout()
{
ASSERT(needsLayout());
- LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
+ LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
if (m_needsTransformUpdate) {
SVGTextElement* text = static_cast<SVGTextElement*>(node());
@@ -98,6 +98,10 @@ void RenderSVGText::layout()
ASSERT(childrenInline());
forceLayoutInlineChildren();
+ // Invalidate all resources of this client, if we changed something.
+ if (m_everHadLayout && selfNeedsLayout())
+ RenderSVGResource::invalidateAllResourcesOfRenderer(this);
+
repainter.repaintAfterLayout();
setNeedsLayout(false);
}
diff --git a/WebCore/rendering/RenderTextControlSingleLine.cpp b/WebCore/rendering/RenderTextControlSingleLine.cpp
index b6c2916..71d5a86 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -69,6 +69,8 @@ RenderTextControlSingleLine::~RenderTextControlSingleLine()
if (m_innerBlock)
m_innerBlock->detach();
+ if (m_innerSpinButton)
+ m_innerSpinButton->detach();
if (m_outerSpinButton)
m_outerSpinButton->detach();
}
@@ -261,6 +263,12 @@ void RenderTextControlSingleLine::layout()
if (currentHeight < height())
childBlock->setY((height() - currentHeight) / 2);
+ // Ignores the paddings for the inner spin button.
+ if (RenderBox* spinBox = m_innerSpinButton ? m_innerSpinButton->renderBox() : 0) {
+ spinBox->setLocation(spinBox->x() + paddingRight(), borderTop());
+ spinBox->setHeight(height() - borderTop() - borderBottom());
+ }
+
// Center the spin button vertically, and move it to the right by
// padding + border of the text fields.
if (RenderBox* spinBox = m_outerSpinButton ? m_outerSpinButton->renderBox() : 0) {
@@ -292,6 +300,8 @@ bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, Hit
hitInnerTextElement(result, xPos, yPos, tx, ty);
// If we found a spin button, we're done.
+ if (m_innerSpinButton && result.innerNode() == m_innerSpinButton)
+ return true;
if (m_outerSpinButton && result.innerNode() == m_outerSpinButton)
return true;
// If we're not a search field, or we already found the speech, results or cancel buttons, we're done.
@@ -376,6 +386,8 @@ void RenderTextControlSingleLine::forwardEvent(Event* event)
m_resultsButton->defaultEventHandler(event);
else if (m_cancelButton && localPoint.x() > textRight)
m_cancelButton->defaultEventHandler(event);
+ else if (m_innerSpinButton && localPoint.x() > textRight && localPoint.x() < textRight + m_innerSpinButton->renderBox()->width())
+ m_innerSpinButton->defaultEventHandler(event);
else if (m_outerSpinButton && localPoint.x() > textRight)
m_outerSpinButton->defaultEventHandler(event);
else
@@ -469,6 +481,11 @@ int RenderTextControlSingleLine::textBlockWidth() const
width -= cancelRenderer->width() + cancelRenderer->marginLeft() + cancelRenderer->marginRight();
}
+ if (RenderBox* spinRenderer = m_innerSpinButton ? m_innerSpinButton->renderBox() : 0) {
+ spinRenderer->calcWidth();
+ width -= spinRenderer->width() + spinRenderer->marginLeft() + spinRenderer->marginRight();
+ }
+
#if ENABLE(INPUT_SPEECH)
if (RenderBox* speechRenderer = m_speechButton ? m_speechButton->renderBox() : 0) {
speechRenderer->calcWidth();
@@ -534,6 +551,9 @@ int RenderTextControlSingleLine::preferredContentWidth(float charWidth) const
result += cancelRenderer->borderLeft() + cancelRenderer->borderRight() +
cancelRenderer->paddingLeft() + cancelRenderer->paddingRight();
+ if (RenderBox* spinRenderer = m_innerSpinButton ? m_innerSpinButton->renderBox() : 0)
+ result += spinRenderer->minPrefWidth();
+
#if ENABLE(INPUT_SPEECH)
if (RenderBox* speechRenderer = m_speechButton ? m_speechButton->renderBox() : 0) {
result += speechRenderer->borderLeft() + speechRenderer->borderRight() +
@@ -598,7 +618,12 @@ void RenderTextControlSingleLine::createSubtreeIfNeeded()
#endif
if (!createSubtree) {
RenderTextControl::createSubtreeIfNeeded(m_innerBlock.get());
- if (inputElement()->hasSpinButton() && !m_outerSpinButton) {
+ bool hasSpinButton = inputElement()->hasSpinButton();
+ if (hasSpinButton && !m_innerSpinButton) {
+ m_innerSpinButton = SpinButtonElement::create(node());
+ m_innerSpinButton->attachInnerElement(node(), createInnerSpinButtonStyle(), renderArena());
+ }
+ if (hasSpinButton && !m_outerSpinButton) {
m_outerSpinButton = SpinButtonElement::create(node());
m_outerSpinButton->attachInnerElement(node(), createOuterSpinButtonStyle(), renderArena());
}
@@ -767,6 +792,16 @@ PassRefPtr<RenderStyle> RenderTextControlSingleLine::createCancelButtonStyle(con
return cancelBlockStyle.release();
}
+PassRefPtr<RenderStyle> RenderTextControlSingleLine::createInnerSpinButtonStyle() const
+{
+ ASSERT(node()->isHTMLElement());
+ RefPtr<RenderStyle> buttonStyle = getCachedPseudoStyle(INNER_SPIN_BUTTON);
+ if (!buttonStyle)
+ buttonStyle = RenderStyle::create();
+ buttonStyle->inheritFrom(style());
+ return buttonStyle.release();
+}
+
PassRefPtr<RenderStyle> RenderTextControlSingleLine::createOuterSpinButtonStyle() const
{
ASSERT(node()->isHTMLElement());
@@ -880,6 +915,11 @@ String RenderTextControlSingleLine::itemText(unsigned listIndex) const
return m_recentSearches[listIndex - 1];
}
+String RenderTextControlSingleLine::itemLabel(unsigned) const
+{
+ return String();
+}
+
bool RenderTextControlSingleLine::itemIsEnabled(unsigned listIndex) const
{
if (!listIndex || itemIsSeparator(listIndex))
diff --git a/WebCore/rendering/RenderTextControlSingleLine.h b/WebCore/rendering/RenderTextControlSingleLine.h
index ab9f711..92ecadd 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.h
+++ b/WebCore/rendering/RenderTextControlSingleLine.h
@@ -98,6 +98,7 @@ private:
PassRefPtr<RenderStyle> createInnerBlockStyle(const RenderStyle* startStyle) const;
PassRefPtr<RenderStyle> createResultsButtonStyle(const RenderStyle* startStyle) const;
PassRefPtr<RenderStyle> createCancelButtonStyle(const RenderStyle* startStyle) const;
+ PassRefPtr<RenderStyle> createInnerSpinButtonStyle() const;
PassRefPtr<RenderStyle> createOuterSpinButtonStyle() const;
#if ENABLE(INPUT_SPEECH)
PassRefPtr<RenderStyle> createSpeechButtonStyle(const RenderStyle* startStyle) const;
@@ -115,6 +116,7 @@ private:
virtual void selectionChanged(unsigned, bool) {}
virtual void selectionCleared() {}
virtual String itemText(unsigned listIndex) const;
+ virtual String itemLabel(unsigned listIndex) const;
virtual String itemToolTip(unsigned) const { return String(); }
virtual String itemAccessibilityText(unsigned) const { return String(); }
virtual bool itemIsEnabled(unsigned listIndex) const;
@@ -145,6 +147,7 @@ private:
RefPtr<TextControlInnerElement> m_innerBlock;
RefPtr<SearchFieldResultsButtonElement> m_resultsButton;
RefPtr<SearchFieldCancelButtonElement> m_cancelButton;
+ RefPtr<TextControlInnerElement> m_innerSpinButton;
RefPtr<TextControlInnerElement> m_outerSpinButton;
#if ENABLE(INPUT_SPEECH)
RefPtr<InputFieldSpeechButtonElement> m_speechButton;
diff --git a/WebCore/rendering/RenderTheme.cpp b/WebCore/rendering/RenderTheme.cpp
index 2147b36..3fcb2c9 100644
--- a/WebCore/rendering/RenderTheme.cpp
+++ b/WebCore/rendering/RenderTheme.cpp
@@ -832,7 +832,7 @@ bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject* o) const
|| !static_cast<Element*>(node)->isSpinButtonElement())
return false;
SpinButtonElement* element = static_cast<SpinButtonElement*>(node);
- return element->onUpButton();
+ return element->upDownState() == SpinButtonElement::Up;
}
bool RenderTheme::isReadOnlyControl(const RenderObject* o) const
@@ -845,19 +845,22 @@ bool RenderTheme::isReadOnlyControl(const RenderObject* o) const
bool RenderTheme::isHovered(const RenderObject* o) const
{
- if (!o->node())
+ Node* node = o->node();
+ if (!node)
return false;
- return o->node()->hovered();
+ if (!node->isElementNode() || !static_cast<Element*>(node)->isSpinButtonElement())
+ return node->hovered();
+ SpinButtonElement* element = static_cast<SpinButtonElement*>(node);
+ return element->hovered() && element->upDownState() != SpinButtonElement::Indeterminate;
}
bool RenderTheme::isSpinUpButtonPartHovered(const RenderObject* o) const
{
Node* node = o->node();
- if (!node || !node->active() || !node->isElementNode()
- || !static_cast<Element*>(node)->isSpinButtonElement())
+ if (!node || !node->isElementNode() || !static_cast<Element*>(node)->isSpinButtonElement())
return false;
SpinButtonElement* element = static_cast<SpinButtonElement*>(node);
- return element->onUpButton();
+ return element->upDownState() == SpinButtonElement::Up;
}
bool RenderTheme::isDefault(const RenderObject* o) const
diff --git a/WebCore/rendering/RenderThemeChromiumLinux.cpp b/WebCore/rendering/RenderThemeChromiumLinux.cpp
index c29353d..de83ae9 100644
--- a/WebCore/rendering/RenderThemeChromiumLinux.cpp
+++ b/WebCore/rendering/RenderThemeChromiumLinux.cpp
@@ -27,14 +27,13 @@
#include "CSSValueKeywords.h"
#include "Color.h"
+#include "PlatformThemeChromiumGtk.h"
#include "RenderObject.h"
+#include "ScrollbarTheme.h"
#include "UserAgentStyleSheets.h"
namespace WebCore {
-unsigned RenderThemeChromiumLinux::m_thumbInactiveColor = 0xeaeaea;
-unsigned RenderThemeChromiumLinux::m_thumbActiveColor = 0xf4f4f4;
-unsigned RenderThemeChromiumLinux::m_trackColor = 0xd3d3d3;
unsigned RenderThemeChromiumLinux::m_activeSelectionBackgroundColor =
0xff1e90ff;
unsigned RenderThemeChromiumLinux::m_activeSelectionForegroundColor =
@@ -168,12 +167,29 @@ void RenderThemeChromiumLinux::setSelectionColors(
m_inactiveSelectionForegroundColor = inactiveForegroundColor;
}
-void RenderThemeChromiumLinux::setScrollbarColors(
- SkColor inactiveColor, SkColor activeColor, SkColor trackColor)
+void RenderThemeChromiumLinux::adjustInnerSpinButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
{
- m_thumbInactiveColor = inactiveColor;
- m_thumbActiveColor = activeColor;
- m_trackColor = trackColor;
+ int width = ScrollbarTheme::nativeTheme()->scrollbarThickness();
+ style->setWidth(Length(width, Fixed));
+ style->setMinWidth(Length(width, Fixed));
+}
+
+bool RenderThemeChromiumLinux::paintInnerSpinButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+{
+ ControlStates northStates = controlStatesForRenderer(object);
+ ControlStates southStates = northStates;
+ if (northStates & SpinUpState)
+ southStates &= ~(HoverState | PressedState);
+ else
+ northStates &= ~(HoverState | PressedState);
+
+ IntRect half = rect;
+ half.setHeight(rect.height() / 2);
+ PlatformThemeChromiumGtk::paintArrowButton(info.context, half, PlatformThemeChromiumGtk::North, northStates);
+
+ half.setY(rect.y() + rect.height() / 2);
+ PlatformThemeChromiumGtk::paintArrowButton(info.context, half, PlatformThemeChromiumGtk::South, southStates);
+ return false;
}
} // namespace WebCore
diff --git a/WebCore/rendering/RenderThemeChromiumLinux.h b/WebCore/rendering/RenderThemeChromiumLinux.h
index c60dec3..9eeca97 100644
--- a/WebCore/rendering/RenderThemeChromiumLinux.h
+++ b/WebCore/rendering/RenderThemeChromiumLinux.h
@@ -59,18 +59,14 @@ namespace WebCore {
static void setCaretBlinkInterval(double interval);
virtual double caretBlinkIntervalInternal() const;
+ virtual void adjustInnerSpinButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+ virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&);
+
static void setSelectionColors(unsigned activeBackgroundColor,
unsigned activeForegroundColor,
unsigned inactiveBackgroundColor,
unsigned inactiveForegroundColor);
- static void setScrollbarColors(unsigned inactive_color,
- unsigned active_color,
- unsigned track_color);
- static unsigned thumbInactiveColor() { return m_thumbInactiveColor; }
- static unsigned thumbActiveColor() { return m_thumbActiveColor; }
- static unsigned trackColor() { return m_trackColor; }
-
private:
RenderThemeChromiumLinux();
virtual ~RenderThemeChromiumLinux();
@@ -84,10 +80,6 @@ namespace WebCore {
static unsigned m_activeSelectionForegroundColor;
static unsigned m_inactiveSelectionBackgroundColor;
static unsigned m_inactiveSelectionForegroundColor;
-
- static unsigned m_thumbInactiveColor;
- static unsigned m_thumbActiveColor;
- static unsigned m_trackColor;
};
} // namespace WebCore
diff --git a/WebCore/rendering/RenderThemeChromiumWin.cpp b/WebCore/rendering/RenderThemeChromiumWin.cpp
index 1172f96..3023798 100644
--- a/WebCore/rendering/RenderThemeChromiumWin.cpp
+++ b/WebCore/rendering/RenderThemeChromiumWin.cpp
@@ -29,8 +29,8 @@
#include <uxtheme.h>
#include <vssym32.h>
-#include "ChromiumBridge.h"
#include "CSSValueKeywords.h"
+#include "ChromiumBridge.h"
#include "CurrentTime.h"
#include "FontSelector.h"
#include "FontUtilsChromiumWin.h"
@@ -57,53 +57,71 @@
namespace WebCore {
namespace {
-class ThemePainter : public TransparencyWin {
+class ThemePainter {
public:
ThemePainter(GraphicsContext* context, const IntRect& r)
{
- TransformMode transformMode = getTransformMode(context->getCTM());
- init(context, getLayerMode(context, transformMode), transformMode, r);
+ TransparencyWin::TransformMode transformMode = getTransformMode(context->getCTM());
+ m_helper.init(context, getLayerMode(context, transformMode), transformMode, r);
+
+ if (!m_helper.context()) {
+ // TransparencyWin doesn't have well-defined copy-ctor nor op=()
+ // so we re-initialize it instead of assigning a fresh istance.
+ // On the reinitialization, we fallback to use NoLayer mode.
+ // Note that the original initialization failure can be caused by
+ // a failure of an internal buffer allocation and NoLayer mode
+ // does not have such buffer allocations.
+ m_helper.~TransparencyWin();
+ new (&m_helper) TransparencyWin();
+ m_helper.init(context, TransparencyWin::NoLayer, transformMode, r);
+ }
}
~ThemePainter()
{
- composite();
+ m_helper.composite();
}
+ GraphicsContext* context() { return m_helper.context(); }
+ const IntRect& drawRect() { return m_helper.drawRect(); }
+
private:
+
static bool canvasHasMultipleLayers(const SkCanvas* canvas)
{
SkCanvas::LayerIter iter(const_cast<SkCanvas*>(canvas), false);
- iter.next(); // There is always at least one layer.
- return !iter.done(); // There is > 1 layer if the the iterator can stil advance.
+ iter.next(); // There is always at least one layer.
+ return !iter.done(); // There is > 1 layer if the the iterator can stil advance.
}
- static LayerMode getLayerMode(GraphicsContext* context, TransformMode transformMode)
+ static TransparencyWin::LayerMode getLayerMode(GraphicsContext* context, TransparencyWin::TransformMode transformMode)
{
- if (context->platformContext()->isDrawingToImageBuffer()) // Might have transparent background.
- return WhiteLayer;
- else if (canvasHasMultipleLayers(context->platformContext()->canvas())) // Needs antialiasing help.
- return OpaqueCompositeLayer;
- else // Nothing interesting.
- return transformMode == KeepTransform ? NoLayer : OpaqueCompositeLayer;
+ if (context->platformContext()->isDrawingToImageBuffer()) // Might have transparent background.
+ return TransparencyWin::WhiteLayer;
+ if (canvasHasMultipleLayers(context->platformContext()->canvas())) // Needs antialiasing help.
+ return TransparencyWin::OpaqueCompositeLayer;
+ // Nothing interesting.
+ return transformMode == TransparencyWin::KeepTransform ? TransparencyWin::NoLayer : TransparencyWin::OpaqueCompositeLayer;
}
- static TransformMode getTransformMode(const AffineTransform& matrix)
+ static TransparencyWin::TransformMode getTransformMode(const AffineTransform& matrix)
{
- if (matrix.b() != 0 || matrix.c() != 0) // Skew.
- return Untransform;
- else if (matrix.a() != 1.0 || matrix.d() != 1.0) // Scale.
- return ScaleTransform;
- else // Nothing interesting.
- return KeepTransform;
+ if (matrix.b() || matrix.c()) // Skew.
+ return TransparencyWin::Untransform;
+ if (matrix.a() != 1.0 || matrix.d() != 1.0) // Scale.
+ return TransparencyWin::ScaleTransform;
+ // Nothing interesting.
+ return TransparencyWin::KeepTransform;
}
+
+ TransparencyWin m_helper;
};
-} // namespace
+} // namespace
static void getNonClientMetrics(NONCLIENTMETRICS* metrics)
{
- static UINT size = WebCore::isVistaOrNewer() ?
+ static UINT size = isVistaOrNewer() ?
sizeof(NONCLIENTMETRICS) : NONCLIENTMETRICS_SIZE_PRE_VISTA;
metrics->cbSize = size;
bool success = !!SystemParametersInfo(SPI_GETNONCLIENTMETRICS, size, metrics, 0);
@@ -139,7 +157,7 @@ static float systemFontSize(const LOGFONT& font)
if (size < 0) {
HFONT hFont = CreateFontIndirect(&font);
if (hFont) {
- HDC hdc = GetDC(0); // What about printing? Is this the right DC?
+ HDC hdc = GetDC(0); // What about printing? Is this the right DC?
if (hdc) {
HGDIOBJ hObject = SelectObject(hdc, hFont);
TEXTMETRIC tm;
@@ -170,8 +188,8 @@ static float pointsToPixels(float points)
{
static float pixelsPerInch = 0.0f;
if (!pixelsPerInch) {
- HDC hdc = GetDC(0); // What about printing? Is this the right DC?
- if (hdc) { // Can this ever actually be NULL?
+ HDC hdc = GetDC(0); // What about printing? Is this the right DC?
+ if (hdc) { // Can this ever actually be NULL?
pixelsPerInch = GetDeviceCaps(hdc, LOGPIXELSY);
ReleaseDC(0, hdc);
} else {
@@ -186,7 +204,7 @@ static float pointsToPixels(float points)
static double querySystemBlinkInterval(double defaultInterval)
{
UINT blinkTime = GetCaretBlinkTime();
- if (blinkTime == 0)
+ if (!blinkTime)
return defaultInterval;
if (blinkTime == INFINITE)
return 0;
@@ -216,7 +234,7 @@ bool RenderThemeChromiumWin::supportsFocusRing(const RenderStyle* style) const
Color RenderThemeChromiumWin::platformActiveSelectionBackgroundColor() const
{
if (ChromiumBridge::layoutTestMode())
- return Color(0x00, 0x00, 0xff); // Royal blue.
+ return Color(0x00, 0x00, 0xff); // Royal blue.
COLORREF color = GetSysColor(COLOR_HIGHLIGHT);
return Color(GetRValue(color), GetGValue(color), GetBValue(color), 0xff);
}
@@ -224,7 +242,7 @@ Color RenderThemeChromiumWin::platformActiveSelectionBackgroundColor() const
Color RenderThemeChromiumWin::platformInactiveSelectionBackgroundColor() const
{
if (ChromiumBridge::layoutTestMode())
- return Color(0x99, 0x99, 0x99); // Medium gray.
+ return Color(0x99, 0x99, 0x99); // Medium gray.
COLORREF color = GetSysColor(COLOR_GRAYTEXT);
return Color(GetRValue(color), GetGValue(color), GetBValue(color), 0xff);
}
@@ -232,7 +250,7 @@ Color RenderThemeChromiumWin::platformInactiveSelectionBackgroundColor() const
Color RenderThemeChromiumWin::platformActiveSelectionForegroundColor() const
{
if (ChromiumBridge::layoutTestMode())
- return Color(0xff, 0xff, 0xcc); // Pale yellow.
+ return Color(0xff, 0xff, 0xcc); // Pale yellow.
COLORREF color = GetSysColor(COLOR_HIGHLIGHTTEXT);
return Color(GetRValue(color), GetGValue(color), GetBValue(color), 0xff);
}
@@ -244,7 +262,7 @@ Color RenderThemeChromiumWin::platformInactiveSelectionForegroundColor() const
Color RenderThemeChromiumWin::platformActiveTextSearchHighlightColor() const
{
- return Color(0xff, 0x96, 0x32); // Orange.
+ return Color(0xff, 0x96, 0x32); // Orange.
}
Color RenderThemeChromiumWin::platformInactiveTextSearchHighlightColor() const
@@ -387,7 +405,7 @@ bool RenderThemeChromiumWin::paintButton(RenderObject* o, const PaintInfo& i, co
{
const ThemeData& themeData = getThemeData(o);
- WebCore::ThemePainter painter(i.context, r);
+ ThemePainter painter(i.context, r);
ChromiumBridge::paintButton(painter.context(),
themeData.m_part,
themeData.m_state,
@@ -405,7 +423,7 @@ bool RenderThemeChromiumWin::paintSliderTrack(RenderObject* o, const PaintInfo&
{
const ThemeData& themeData = getThemeData(o);
- WebCore::ThemePainter painter(i.context, r);
+ ThemePainter painter(i.context, r);
ChromiumBridge::paintTrackbar(painter.context(),
themeData.m_part,
themeData.m_state,
@@ -436,7 +454,7 @@ bool RenderThemeChromiumWin::paintMenuList(RenderObject* o, const PaintInfo& i,
// draw individual borders and then pass that to skia so we can avoid
// drawing any borders that are set to 0. For non-zero borders, we draw the
// border, but webkit just draws over it.
- bool drawEdges = !(borderRight == 0 && borderLeft == 0 && borderTop == 0 && borderBottom == 0);
+ bool drawEdges = !(!borderRight && !borderLeft && !borderTop && !borderBottom);
paintTextFieldInternal(o, i, r, drawEdges);
@@ -462,7 +480,7 @@ bool RenderThemeChromiumWin::paintMenuList(RenderObject* o, const PaintInfo& i,
r.height() - (spacingTop + spacingBottom));
// Get the correct theme data for a textfield and paint the menu.
- WebCore::ThemePainter painter(i.context, rect);
+ ThemePainter painter(i.context, rect);
ChromiumBridge::paintMenuList(painter.context(),
CP_DROPDOWNBUTTON,
determineState(o),
@@ -487,19 +505,20 @@ double RenderThemeChromiumWin::caretBlinkIntervalInternal() const
return blinkInterval;
}
-unsigned RenderThemeChromiumWin::determineState(RenderObject* o)
+unsigned RenderThemeChromiumWin::determineState(RenderObject* o, ControlSubPart subPart)
{
unsigned result = TS_NORMAL;
ControlPart appearance = o->style()->appearance();
if (!isEnabled(o))
result = TS_DISABLED;
- else if (isReadOnlyControl(o) && (TextFieldPart == appearance || TextAreaPart == appearance || SearchFieldPart == appearance))
- result = ETS_READONLY; // Readonly is supported on textfields.
- else if (isPressed(o)) // Active overrides hover and focused.
+ else if (isReadOnlyControl(o))
+ result = (appearance == TextFieldPart || appearance == TextAreaPart || appearance == SearchFieldPart) ? ETS_READONLY : TS_DISABLED;
+ // Active overrides hover and focused.
+ else if (isPressed(o) && (subPart == SpinButtonUp) == isSpinUpButtonPartPressed(o))
result = TS_PRESSED;
else if (supportsFocus(appearance) && isFocused(o))
result = ETS_FOCUSED;
- else if (isHovered(o))
+ else if (isHovered(o) && (subPart == SpinButtonUp) == isSpinUpButtonPartHovered(o))
result = TS_HOT;
// CBS_UNCHECKED*: 1-4
@@ -526,7 +545,7 @@ unsigned RenderThemeChromiumWin::determineSliderThumbState(RenderObject* o)
return result;
}
-unsigned RenderThemeChromiumWin::determineClassicState(RenderObject* o)
+unsigned RenderThemeChromiumWin::determineClassicState(RenderObject* o, ControlSubPart subPart)
{
unsigned result = 0;
@@ -548,13 +567,14 @@ unsigned RenderThemeChromiumWin::determineClassicState(RenderObject* o)
else if (isHovered(o))
result = DFCS_HOT;
} else {
- if (!isEnabled(o))
+ if (!isEnabled(o) || isReadOnlyControl(o))
result = DFCS_INACTIVE;
- else if (isPressed(o)) // Active supersedes hover
+ // Active supersedes hover
+ else if (isPressed(o) && (subPart == SpinButtonUp) == isSpinUpButtonPartPressed(o))
result = DFCS_PUSHED;
else if (supportsFocus(part) && isFocused(o)) // So does focused
result = 0;
- else if (isHovered(o))
+ else if (isHovered(o) && (subPart == SpinButtonUp) == isSpinUpButtonPartHovered(o))
result = DFCS_HOT;
// Classic theme can't represent indeterminate states. Use unchecked appearance.
if (isChecked(o) && !isIndeterminate(o))
@@ -563,7 +583,7 @@ unsigned RenderThemeChromiumWin::determineClassicState(RenderObject* o)
return result;
}
-ThemeData RenderThemeChromiumWin::getThemeData(RenderObject* o)
+ThemeData RenderThemeChromiumWin::getThemeData(RenderObject* o, ControlSubPart subPart)
{
ThemeData result;
switch (o->style()->appearance()) {
@@ -608,9 +628,14 @@ ThemeData RenderThemeChromiumWin::getThemeData(RenderObject* o)
result.m_part = EP_EDITTEXT;
result.m_state = determineState(o);
break;
+ case InnerSpinButtonPart:
+ result.m_part = subPart == SpinButtonUp ? SPNP_UP : SPNP_DOWN;
+ result.m_state = determineState(o, subPart);
+ result.m_classicState = subPart == SpinButtonUp ? DFCS_SCROLLUP : DFCS_SCROLLDOWN;
+ break;
}
- result.m_classicState |= determineClassicState(o);
+ result.m_classicState |= determineClassicState(o, subPart);
return result;
}
@@ -646,7 +671,7 @@ bool RenderThemeChromiumWin::paintTextFieldInternal(RenderObject* o,
}
{
const ThemeData& themeData = getThemeData(o);
- WebCore::ThemePainter painter(i.context, r);
+ ThemePainter painter(i.context, r);
ChromiumBridge::paintTextField(painter.context(),
themeData.m_part,
themeData.m_state,
@@ -662,6 +687,37 @@ bool RenderThemeChromiumWin::paintTextFieldInternal(RenderObject* o,
return false;
}
+void RenderThemeChromiumWin::adjustInnerSpinButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
+{
+ int width = ScrollbarTheme::nativeTheme()->scrollbarThickness();
+ style->setWidth(Length(width, Fixed));
+ style->setMinWidth(Length(width, Fixed));
+}
+
+bool RenderThemeChromiumWin::paintInnerSpinButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+{
+ IntRect half = rect;
+
+ half.setHeight(rect.height() / 2);
+ const ThemeData& upThemeData = getThemeData(object, SpinButtonUp);
+ ThemePainter upPainter(info.context, half);
+ ChromiumBridge::paintSpinButton(upPainter.context(),
+ upThemeData.m_part,
+ upThemeData.m_state,
+ upThemeData.m_classicState,
+ upPainter.drawRect());
+
+ half.setY(rect.y() + rect.height() / 2);
+ const ThemeData& downThemeData = getThemeData(object, SpinButtonDown);
+ ThemePainter downPainter(info.context, half);
+ ChromiumBridge::paintSpinButton(downPainter.context(),
+ downThemeData.m_part,
+ downThemeData.m_state,
+ downThemeData.m_classicState,
+ downPainter.drawRect());
+ return false;
+}
+
#if ENABLE(PROGRESS_TAG)
// MSDN says that update intervals for the bar is 30ms.
diff --git a/WebCore/rendering/RenderThemeChromiumWin.h b/WebCore/rendering/RenderThemeChromiumWin.h
index c6c95e6..661b623 100644
--- a/WebCore/rendering/RenderThemeChromiumWin.h
+++ b/WebCore/rendering/RenderThemeChromiumWin.h
@@ -86,6 +86,8 @@ namespace WebCore {
// See comment in RenderThemeChromiumSkia::setDefaultFontSize() regarding ugliness of this hack.
static void setDefaultFontSize(int);
+ virtual void adjustInnerSpinButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+ virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&);
#if ENABLE(PROGRESS_TAG)
virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
@@ -98,14 +100,20 @@ namespace WebCore {
virtual double caretBlinkIntervalInternal() const;
private:
+ enum ControlSubPart {
+ None,
+ SpinButtonDown,
+ SpinButtonUp,
+ };
+
RenderThemeChromiumWin() { }
virtual ~RenderThemeChromiumWin() { }
- unsigned determineState(RenderObject*);
+ unsigned determineState(RenderObject*, ControlSubPart = None);
unsigned determineSliderThumbState(RenderObject*);
- unsigned determineClassicState(RenderObject*);
+ unsigned determineClassicState(RenderObject*, ControlSubPart = None);
- ThemeData getThemeData(RenderObject*);
+ ThemeData getThemeData(RenderObject*, ControlSubPart = None);
bool paintTextFieldInternal(RenderObject*, const PaintInfo&, const IntRect&, bool);
};
diff --git a/WebCore/rendering/RenderThemeMac.mm b/WebCore/rendering/RenderThemeMac.mm
index bbf6906..cc2ff1f 100644
--- a/WebCore/rendering/RenderThemeMac.mm
+++ b/WebCore/rendering/RenderThemeMac.mm
@@ -826,6 +826,8 @@ bool RenderThemeMac::paintMeter(RenderObject* renderObject, const PaintInfo& pai
if (!renderObject->isMeter())
return true;
+ LocalCurrentGraphicsContext localContext(paintInfo.context);
+
// Becaue NSLevelIndicatorCell doesn't support vertical gauge, we use a portable version
if (rect.width() < rect.height())
return RenderTheme::paintMeter(renderObject, paintInfo, rect);
@@ -1379,8 +1381,8 @@ bool RenderThemeMac::paintSliderThumb(RenderObject* o, const PaintInfo& paintInf
bool RenderThemeMac::paintSearchField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
- NSSearchFieldCell* search = this->search();
LocalCurrentGraphicsContext localContext(paintInfo.context);
+ NSSearchFieldCell* search = this->search();
setSearchCellState(o, r);
@@ -1480,6 +1482,7 @@ bool RenderThemeMac::paintSearchFieldCancelButton(RenderObject* o, const PaintIn
if (!input->renderer()->isBox())
return false;
+ LocalCurrentGraphicsContext localContext(paintInfo.context);
setSearchCellState(input->renderer(), r);
NSSearchFieldCell* search = this->search();
@@ -1562,12 +1565,13 @@ void RenderThemeMac::adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*,
style->setBoxShadow(0);
}
-bool RenderThemeMac::paintSearchFieldResultsDecoration(RenderObject* o, const PaintInfo&, const IntRect& r)
+bool RenderThemeMac::paintSearchFieldResultsDecoration(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
Node* input = o->node()->shadowAncestorNode();
if (!input->renderer()->isBox())
return false;
+ LocalCurrentGraphicsContext localContext(paintInfo.context);
setSearchCellState(input->renderer(), r);
NSSearchFieldCell* search = this->search();
@@ -1600,6 +1604,7 @@ bool RenderThemeMac::paintSearchFieldResultsButton(RenderObject* o, const PaintI
if (!input->renderer()->isBox())
return false;
+ LocalCurrentGraphicsContext localContext(paintInfo.context);
setSearchCellState(input->renderer(), r);
NSSearchFieldCell* search = this->search();
diff --git a/WebCore/rendering/RenderTreeAsText.cpp b/WebCore/rendering/RenderTreeAsText.cpp
index 26f40ab..408015c 100644
--- a/WebCore/rendering/RenderTreeAsText.cpp
+++ b/WebCore/rendering/RenderTreeAsText.cpp
@@ -234,9 +234,9 @@ void RenderTreeAsText::writeRenderObject(TextStream& ts, const RenderObject& o,
ts << " " << r;
if (!(o.isText() && !o.isBR())) {
- if (o.isFileUploadControl()) {
+ if (o.isFileUploadControl())
ts << " " << quoteAndEscapeNonPrintables(toRenderFileUploadControl(&o)->fileTextValue());
- }
+
if (o.parent() && (o.parent()->style()->color() != o.style()->color()))
ts << " [color=" << o.style()->color().name() << "]";
@@ -355,6 +355,24 @@ void RenderTreeAsText::writeRenderObject(TextStream& ts, const RenderObject& o,
ts << ": " << text;
}
}
+
+ if (behavior & RenderAsTextShowIDAndClass) {
+ if (Node* node = o.node()) {
+ if (node->hasID())
+ ts << " id=\"" + static_cast<Element*>(node)->getIdAttribute() + "\"";
+
+ if (node->hasClass()) {
+ StyledElement* styledElement = static_cast<StyledElement*>(node);
+ String classes;
+ for (size_t i = 0; i < styledElement->classNames().size(); ++i) {
+ if (i > 0)
+ classes += " ";
+ classes += styledElement->classNames()[i];
+ }
+ ts << " class=\"" + classes + "\"";
+ }
+ }
+ }
#if PLATFORM(QT)
// Print attributes of embedded QWidgets. E.g. when the WebCore::Widget
@@ -580,6 +598,7 @@ static String nodePosition(Node* node)
{
String result;
+ Element* body = node->document()->body();
Node* parent;
for (Node* n = node; n; n = parent) {
parent = n->parentNode();
@@ -587,9 +606,14 @@ static String nodePosition(Node* node)
parent = n->shadowParentNode();
if (n != node)
result += " of ";
- if (parent)
+ if (parent) {
+ if (body && n == body) {
+ // We don't care what offset body may be in the document.
+ result += "body";
+ break;
+ }
result += "child " + String::number(n->nodeIndex()) + " {" + getTagName(n) + "}";
- else
+ } else
result += "document";
}
diff --git a/WebCore/rendering/RenderTreeAsText.h b/WebCore/rendering/RenderTreeAsText.h
index 1635e79..645ccc0 100644
--- a/WebCore/rendering/RenderTreeAsText.h
+++ b/WebCore/rendering/RenderTreeAsText.h
@@ -40,7 +40,8 @@ enum RenderAsTextBehaviorFlags {
RenderAsTextShowLayerNesting = 1 << 1, // Annotate the layer lists.
RenderAsTextShowCompositedLayers = 1 << 2, // Show which layers are composited.
RenderAsTextShowAddresses = 1 << 3, // Show layer and renderer addresses.
- RenderAsTextPrintingMode = 1 << 4 // Dump the tree in printing mode.
+ RenderAsTextShowIDAndClass = 1 << 4, // Show id and class attributes
+ RenderAsTextPrintingMode = 1 << 5 // Dump the tree in printing mode.
};
typedef unsigned RenderAsTextBehavior;
diff --git a/WebCore/rendering/RenderView.cpp b/WebCore/rendering/RenderView.cpp
index 232dd5d..449c15c 100644
--- a/WebCore/rendering/RenderView.cpp
+++ b/WebCore/rendering/RenderView.cpp
@@ -456,13 +456,15 @@ void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* e
if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
// Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
oldSelectedObjects.set(os, new RenderSelectionInfo(os, true));
- RenderBlock* cb = os->containingBlock();
- while (cb && !cb->isRenderView()) {
- RenderBlockSelectionInfo* blockInfo = oldSelectedBlocks.get(cb);
- if (blockInfo)
- break;
- oldSelectedBlocks.set(cb, new RenderBlockSelectionInfo(cb));
- cb = cb->containingBlock();
+ if (blockRepaintMode == RepaintNewXOROld) {
+ RenderBlock* cb = os->containingBlock();
+ while (cb && !cb->isRenderView()) {
+ RenderBlockSelectionInfo* blockInfo = oldSelectedBlocks.get(cb);
+ if (blockInfo)
+ break;
+ oldSelectedBlocks.set(cb, new RenderBlockSelectionInfo(cb));
+ cb = cb->containingBlock();
+ }
}
}
@@ -565,8 +567,7 @@ void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* e
RenderBlockSelectionInfo* newInfo = newSelectedBlocks.get(block);
RenderBlockSelectionInfo* oldInfo = i->second;
if (!newInfo || oldInfo->rects() != newInfo->rects() || oldInfo->state() != newInfo->state()) {
- if (blockRepaintMode == RepaintNewXOROld)
- oldInfo->repaint();
+ oldInfo->repaint();
if (newInfo) {
newInfo->repaint();
newSelectedBlocks.remove(block);
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index 36e30af..24e1d74 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -36,8 +36,10 @@
#include "HTMLNames.h"
#include "HTMLTextAreaElement.h"
#include "MouseEvent.h"
+#include "Page.h"
#include "RenderLayer.h"
#include "RenderTextControlSingleLine.h"
+#include "SpeechInput.h"
namespace WebCore {
@@ -246,7 +248,7 @@ void SearchFieldCancelButtonElement::defaultEventHandler(Event* event)
inline SpinButtonElement::SpinButtonElement(Node* shadowParent)
: TextControlInnerElement(shadowParent->document(), shadowParent)
, m_capturing(false)
- , m_onUpButton(false)
+ , m_upDownState(Indeterminate)
{
}
@@ -278,12 +280,19 @@ void SpinButtonElement::defaultEventHandler(Event* event)
}
HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
+ if (input->disabled() || input->isReadOnlyFormControl()) {
+ if (!event->defaultHandled())
+ HTMLDivElement::defaultEventHandler(event);
+ return;
+ }
+
IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
if (event->type() == eventNames().clickEvent) {
if (box->borderBoxRect().contains(local)) {
+ RefPtr<Node> protector(input);
input->focus();
input->select();
- if (local.y() < box->y() + box->height() / 2)
+ if (local.y() < box->height() / 2)
input->stepUpFromRenderer(1);
else
input->stepUpFromRenderer(-1);
@@ -297,9 +306,9 @@ void SpinButtonElement::defaultEventHandler(Event* event)
m_capturing = true;
}
}
- bool oldOnUpButton = m_onUpButton;
- m_onUpButton = local.y() < box->y() + box->height() / 2;
- if (m_onUpButton != oldOnUpButton)
+ UpDownState oldUpDownState = m_upDownState;
+ m_upDownState = local.y() < box->height() / 2 ? Up : Down;
+ if (m_upDownState != oldUpDownState)
renderer()->repaint();
} else {
if (m_capturing) {
@@ -315,12 +324,21 @@ void SpinButtonElement::defaultEventHandler(Event* event)
HTMLDivElement::defaultEventHandler(event);
}
+void SpinButtonElement::setHovered(bool flag)
+{
+ if (!hovered() && flag)
+ m_upDownState = Indeterminate;
+ TextControlInnerElement::setHovered(flag);
+}
+
+
// ----------------------------
#if ENABLE(INPUT_SPEECH)
inline InputFieldSpeechButtonElement::InputFieldSpeechButtonElement(Document* document)
: TextControlInnerElement(document)
+ , m_capturing(false)
{
}
@@ -331,8 +349,73 @@ PassRefPtr<InputFieldSpeechButtonElement> InputFieldSpeechButtonElement::create(
void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
{
- // FIXME: Start speech recognition here.
- HTMLDivElement::defaultEventHandler(event);
+ // On mouse down, select the text and set focus.
+ HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
+ if (event->type() == eventNames().mousedownEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() == LeftButton) {
+ if (renderer() && renderer()->visibleToHitTesting()) {
+ if (Frame* frame = document()->frame()) {
+ frame->eventHandler()->setCapturingMouseEventsNode(this);
+ m_capturing = true;
+ }
+ }
+ // The call to focus() below dispatches a focus 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->focus();
+ input->select();
+ event->setDefaultHandled();
+ }
+ // On mouse up, start speech recognition.
+ if (event->type() == eventNames().mouseupEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() == LeftButton) {
+ if (m_capturing && renderer() && renderer()->visibleToHitTesting()) {
+ if (Frame* frame = document()->frame()) {
+ frame->eventHandler()->setCapturingMouseEventsNode(0);
+ m_capturing = false;
+ }
+ if (hovered()) {
+ speechInput()->startRecognition();
+ event->setDefaultHandled();
+ }
+ }
+ }
+
+ if (!event->defaultHandled())
+ HTMLDivElement::defaultEventHandler(event);
+}
+
+SpeechInput* InputFieldSpeechButtonElement::speechInput()
+{
+ if (!m_speechInput)
+ m_speechInput.set(new SpeechInput(document()->page()->speechInputClient(), this));
+ return m_speechInput.get();
+}
+
+void InputFieldSpeechButtonElement::recordingComplete()
+{
+ // FIXME: Add UI feedback here to indicate that audio recording stopped and recognition is
+ // in progress.
+}
+
+void InputFieldSpeechButtonElement::setRecognitionResult(const String& result)
+{
+ HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
+ // The call to setValue() below dispatches an event, and an event handler in the page might
+ // 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->dispatchFormControlChangeEvent();
+ renderer()->repaint();
+}
+
+void InputFieldSpeechButtonElement::detach()
+{
+ if (m_capturing) {
+ if (Frame* frame = document()->frame())
+ frame->eventHandler()->setCapturingMouseEventsNode(0);
+ }
+ TextControlInnerElement::detach();
}
#endif // ENABLE(INPUT_SPEECH)
diff --git a/WebCore/rendering/TextControlInnerElements.h b/WebCore/rendering/TextControlInnerElements.h
index 1884a34..68d6ff4 100644
--- a/WebCore/rendering/TextControlInnerElements.h
+++ b/WebCore/rendering/TextControlInnerElements.h
@@ -28,9 +28,11 @@
#define TextControlInnerElements_h
#include "HTMLDivElement.h"
+#include "SpeechInputListener.h"
namespace WebCore {
+class SpeechInput;
class String;
class TextControlInnerElement : public HTMLDivElement {
@@ -88,33 +90,50 @@ private:
class SpinButtonElement : public TextControlInnerElement {
public:
- static PassRefPtr<SpinButtonElement> create(Node*);
+ enum UpDownState {
+ Indeterminate, // Hovered, but the event is not handled.
+ Down,
+ Up,
+ };
- // FIXME: "Spin button on up button" is not a phrase with a single clear meaning.
- // Need a name for this that makes it clearer.
- bool onUpButton() const { return m_onUpButton; }
+ static PassRefPtr<SpinButtonElement> create(Node*);
+ UpDownState upDownState() const { return m_upDownState; }
private:
SpinButtonElement(Node*);
virtual bool isSpinButtonElement() const { return true; }
- virtual bool isEnabledFormControl() { return static_cast<Element*>(shadowAncestorNode())->isEnabledFormControl(); }
+ // FIXME: shadowAncestorNode() should be const.
+ virtual bool isEnabledFormControl() const { return static_cast<Element*>(const_cast<SpinButtonElement*>(this)->shadowAncestorNode())->isEnabledFormControl(); }
+ virtual bool isReadOnlyFormControl() const { return static_cast<Element*>(const_cast<SpinButtonElement*>(this)->shadowAncestorNode())->isReadOnlyFormControl(); }
virtual void defaultEventHandler(Event*);
+ virtual void setHovered(bool = true);
bool m_capturing;
- bool m_onUpButton;
+ UpDownState m_upDownState;
};
#if ENABLE(INPUT_SPEECH)
-class InputFieldSpeechButtonElement : public TextControlInnerElement {
+class InputFieldSpeechButtonElement
+ : public TextControlInnerElement,
+ public SpeechInputListener {
public:
static PassRefPtr<InputFieldSpeechButtonElement> create(Document*);
virtual void defaultEventHandler(Event*);
+ // SpeechInputListener methods.
+ void recordingComplete();
+ void setRecognitionResult(const String& result);
+
private:
InputFieldSpeechButtonElement(Document*);
+ virtual void detach();
+ SpeechInput* speechInput();
+
+ bool m_capturing;
+ OwnPtr<SpeechInput> m_speechInput;
};
#endif // ENABLE(INPUT_SPEECH)
diff --git a/WebCore/rendering/style/FillLayer.cpp b/WebCore/rendering/style/FillLayer.cpp
index 59f3bb2..3469e97 100644
--- a/WebCore/rendering/style/FillLayer.cpp
+++ b/WebCore/rendering/style/FillLayer.cpp
@@ -129,17 +129,6 @@ bool FillLayer::operator==(const FillLayer& o) const
void FillLayer::fillUnsetProperties()
{
FillLayer* curr;
- for (curr = this; curr && curr->isImageSet(); curr = curr->next()) { }
- if (curr && curr != this) {
- // We need to fill in the remaining values with the pattern specified.
- for (FillLayer* pattern = this; curr; curr = curr->next()) {
- curr->m_image = pattern->m_image;
- pattern = pattern->next();
- if (pattern == curr || !pattern)
- pattern = this;
- }
- }
-
for (curr = this; curr && curr->isXPositionSet(); curr = curr->next()) { }
if (curr && curr != this) {
// We need to fill in the remaining values with the pattern specified.
@@ -243,15 +232,27 @@ void FillLayer::fillUnsetProperties()
void FillLayer::cullEmptyLayers()
{
+ // CSS3 background layering: the number of background layers is determined
+ // by the number of values in the 'background-image' property.
+ // http://www.w3.org/TR/css3-background/#layering
+
FillLayer* next;
for (FillLayer* p = this; p; p = next) {
next = p->m_next;
- if (next && !next->isImageSet() &&
- !next->isXPositionSet() && !next->isYPositionSet() &&
- !next->isAttachmentSet() && !next->isClipSet() &&
- !next->isCompositeSet() && !next->isOriginSet() &&
- !next->isRepeatXSet() && !next->isRepeatYSet()
- && !next->isSizeSet()) {
+ if (!next)
+ break;
+
+ bool anyAttributeSet = next->isXPositionSet()
+ || next->isYPositionSet()
+ || next->isAttachmentSet()
+ || next->isClipSet()
+ || next->isCompositeSet()
+ || next->isOriginSet()
+ || next->isRepeatXSet()
+ || next->isRepeatYSet()
+ || next->isSizeSet();
+
+ if (!next->isImageSet() || !anyAttributeSet) {
delete next;
p->m_next = 0;
break;
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index 782508e..58af7cf 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -876,8 +876,8 @@ public:
void adjustBackgroundLayers()
{
if (backgroundLayers()->next()) {
- accessBackgroundLayers()->cullEmptyLayers();
accessBackgroundLayers()->fillUnsetProperties();
+ accessBackgroundLayers()->cullEmptyLayers();
}
}
@@ -887,8 +887,8 @@ public:
void adjustMaskLayers()
{
if (maskLayers()->next()) {
- accessMaskLayers()->cullEmptyLayers();
accessMaskLayers()->fillUnsetProperties();
+ accessMaskLayers()->cullEmptyLayers();
}
}
diff --git a/WebCore/storage/AbstractDatabase.cpp b/WebCore/storage/AbstractDatabase.cpp
index ca9a1b5..bcc5d06 100644
--- a/WebCore/storage/AbstractDatabase.cpp
+++ b/WebCore/storage/AbstractDatabase.cpp
@@ -32,7 +32,6 @@
#if ENABLE(DATABASE)
#include "DatabaseAuthorizer.h"
#include "DatabaseTracker.h"
-#include "ExceptionCode.h"
#include "Logging.h"
#include "SQLiteStatement.h"
#include "ScriptExecutionContext.h"
@@ -462,6 +461,19 @@ void AbstractDatabase::resetAuthorizer()
m_databaseAuthorizer->reset();
}
+unsigned long long AbstractDatabase::maximumSize() const
+{
+ return DatabaseTracker::tracker().getMaxSizeForDatabase(this);
+}
+
+void AbstractDatabase::incrementalVacuumIfNeeded()
+{
+ int64_t freeSpaceSize = m_sqliteDatabase.freeSpaceSize();
+ int64_t totalSize = m_sqliteDatabase.totalSize();
+ if (totalSize <= 10 * freeSpaceSize)
+ m_sqliteDatabase.runIncrementalVacuumCommand();
+}
+
} // namespace WebCore
#endif // ENABLE(DATABASE)
diff --git a/WebCore/storage/AbstractDatabase.h b/WebCore/storage/AbstractDatabase.h
index d38a819..e302909 100644
--- a/WebCore/storage/AbstractDatabase.h
+++ b/WebCore/storage/AbstractDatabase.h
@@ -31,6 +31,7 @@
#if ENABLE(DATABASE)
+#include "ExceptionCode.h"
#include "PlatformString.h"
#include "SQLiteDatabase.h"
#include <wtf/Forward.h>
@@ -45,8 +46,6 @@ class DatabaseAuthorizer;
class ScriptExecutionContext;
class SecurityOrigin;
-typedef int ExceptionCode;
-
class AbstractDatabase : public ThreadSafeShared<AbstractDatabase> {
public:
static bool isAvailable();
@@ -65,6 +64,10 @@ public:
virtual String displayName() const;
virtual unsigned long estimatedSize() const;
virtual String fileName() const;
+ SQLiteDatabase& sqliteDatabase() { return m_sqliteDatabase; }
+
+ unsigned long long maximumSize() const;
+ void incrementalVacuumIfNeeded();
// FIXME: move all version-related methods to a DatabaseVersionTracker class
bool versionMatchesExpected() const;
@@ -103,8 +106,6 @@ protected:
unsigned long m_estimatedSize;
String m_filename;
- SQLiteDatabase m_sqliteDatabase;
-
#ifndef NDEBUG
String databaseDebugName() const { return m_contextThreadSecurityOrigin->toString() + "::" + m_name; }
#endif
@@ -116,6 +117,8 @@ private:
bool m_opened;
bool m_new;
+ SQLiteDatabase m_sqliteDatabase;
+
RefPtr<DatabaseAuthorizer> m_databaseAuthorizer;
};
diff --git a/WebCore/storage/ChangeVersionWrapper.cpp b/WebCore/storage/ChangeVersionWrapper.cpp
index 66ca63f..17be716 100644
--- a/WebCore/storage/ChangeVersionWrapper.cpp
+++ b/WebCore/storage/ChangeVersionWrapper.cpp
@@ -50,13 +50,13 @@ bool ChangeVersionWrapper::performPreflight(SQLTransaction* transaction)
if (!transaction->database()->getVersionFromDatabase(actualVersion)) {
LOG_ERROR("Unable to retrieve actual current version from database");
- m_sqlError = SQLError::create(0, "unable to verify current version of database");
+ m_sqlError = SQLError::create(SQLError::UNKNOWN_ERR, "unable to verify current version of database");
return false;
}
if (actualVersion != m_oldVersion) {
LOG_ERROR("Old version doesn't match actual version");
- m_sqlError = SQLError::create(2, "current version of the database and `oldVersion` argument do not match");
+ m_sqlError = SQLError::create(SQLError::VERSION_ERR, "current version of the database and `oldVersion` argument do not match");
return false;
}
@@ -69,7 +69,7 @@ bool ChangeVersionWrapper::performPostflight(SQLTransaction* transaction)
if (!transaction->database()->setVersionInDatabase(m_newVersion)) {
LOG_ERROR("Unable to set new version in database");
- m_sqlError = SQLError::create(0, "unable to set new version in database");
+ m_sqlError = SQLError::create(SQLError::UNKNOWN_ERR, "unable to set new version in database");
return false;
}
diff --git a/WebCore/storage/Database.cpp b/WebCore/storage/Database.cpp
index 30087ee..69f5036 100644
--- a/WebCore/storage/Database.cpp
+++ b/WebCore/storage/Database.cpp
@@ -36,7 +36,6 @@
#include "DatabaseThread.h"
#include "DatabaseTracker.h"
#include "Document.h"
-#include "ExceptionCode.h"
#include "InspectorController.h"
#include "Logging.h"
#include "NotImplemented.h"
@@ -141,25 +140,37 @@ Database::Database(ScriptExecutionContext* context, const String& name, const St
class DerefContextTask : public ScriptExecutionContext::Task {
public:
- static PassOwnPtr<DerefContextTask> create()
+ static PassOwnPtr<DerefContextTask> create(PassRefPtr<ScriptExecutionContext> context)
{
- return new DerefContextTask();
+ return new DerefContextTask(context);
}
virtual void performTask(ScriptExecutionContext* context)
{
- context->deref();
+ ASSERT_UNUSED(context, context == m_context);
+ m_context.clear();
}
virtual bool isCleanupTask() const { return true; }
+
+private:
+ DerefContextTask(PassRefPtr<ScriptExecutionContext> context)
+ : m_context(context)
+ {
+ }
+
+ RefPtr<ScriptExecutionContext> m_context;
};
Database::~Database()
{
// The reference to the ScriptExecutionContext needs to be cleared on the JavaScript thread. If we're on that thread already, we can just let the RefPtr's destruction do the dereffing.
if (!m_scriptExecutionContext->isContextThread()) {
- m_scriptExecutionContext->postTask(DerefContextTask::create());
- m_scriptExecutionContext.release().releaseRef();
+ // Grab a pointer to the script execution here because we're releasing it when we pass it to
+ // DerefContextTask::create.
+ ScriptExecutionContext* scriptExecutionContext = m_scriptExecutionContext.get();
+
+ scriptExecutionContext->postTask(DerefContextTask::create(m_scriptExecutionContext.release()));
}
}
@@ -336,7 +347,7 @@ Vector<String> Database::performGetTableNames()
{
disableAuthorizer();
- SQLiteStatement statement(m_sqliteDatabase, "SELECT name FROM sqlite_master WHERE type='table';");
+ SQLiteStatement statement(sqliteDatabase(), "SELECT name FROM sqlite_master WHERE type='table';");
if (statement.prepare() != SQLResultOk) {
LOG_ERROR("Unable to retrieve list of tables for database %s", databaseDebugName().ascii().data());
enableAuthorizer();
@@ -397,14 +408,6 @@ SecurityOrigin* Database::securityOrigin() const
return 0;
}
-void Database::incrementalVacuumIfNeeded()
-{
- int64_t freeSpaceSize = m_sqliteDatabase.freeSpaceSize();
- int64_t totalSize = m_sqliteDatabase.totalSize();
- if (totalSize <= 10 * freeSpaceSize)
- m_sqliteDatabase.runIncrementalVacuumCommand();
-}
-
} // namespace WebCore
#endif // ENABLE(DATABASE)
diff --git a/WebCore/storage/Database.h b/WebCore/storage/Database.h
index 22ef55e..e8482a7 100644
--- a/WebCore/storage/Database.h
+++ b/WebCore/storage/Database.h
@@ -31,8 +31,8 @@
#if ENABLE(DATABASE)
#include "AbstractDatabase.h"
+#include "ExceptionCode.h"
#include "PlatformString.h"
-#include "SQLiteDatabase.h"
#include <wtf/Deque.h>
#include <wtf/Forward.h>
@@ -66,7 +66,6 @@ public:
Vector<String> tableNames();
virtual SecurityOrigin* securityOrigin() const;
- SQLiteDatabase& sqliteDatabase() { return m_sqliteDatabase; }
virtual void markAsDeletedAndClose();
bool deleted() const { return m_deleted; }
@@ -83,8 +82,6 @@ public:
SQLTransactionClient* transactionClient() const;
SQLTransactionCoordinator* transactionCoordinator() const;
- void incrementalVacuumIfNeeded();
-
private:
class DatabaseOpenTask;
class DatabaseCloseTask;
diff --git a/WebCore/storage/DatabaseAuthorizer.cpp b/WebCore/storage/DatabaseAuthorizer.cpp
index d155d6c..17abebd 100644
--- a/WebCore/storage/DatabaseAuthorizer.cpp
+++ b/WebCore/storage/DatabaseAuthorizer.cpp
@@ -290,7 +290,7 @@ int DatabaseAuthorizer::createVTable(const String& tableName, const String& modu
return SQLAuthDeny;
// Allow only the FTS3 extension
- if (moduleName != "fts3")
+ if (!equalIgnoringCase(moduleName, "fts3"))
return SQLAuthDeny;
m_lastActionChangedDatabase = true;
@@ -303,7 +303,7 @@ int DatabaseAuthorizer::dropVTable(const String& tableName, const String& module
return SQLAuthDeny;
// Allow only the FTS3 extension
- if (moduleName != "fts3")
+ if (!equalIgnoringCase(moduleName, "fts3"))
return SQLAuthDeny;
return updateDeletesBasedOnTableName(tableName);
diff --git a/WebCore/storage/DatabaseCallback.h b/WebCore/storage/DatabaseCallback.h
index dfdc038..9ece2a3 100644
--- a/WebCore/storage/DatabaseCallback.h
+++ b/WebCore/storage/DatabaseCallback.h
@@ -33,7 +33,7 @@
#if ENABLE(DATABASE)
-#include <wtf/Threading.h>
+#include <wtf/ThreadSafeShared.h>
namespace WebCore {
diff --git a/WebCore/storage/DatabaseSync.cpp b/WebCore/storage/DatabaseSync.cpp
index 8de9680..f64c27f 100644
--- a/WebCore/storage/DatabaseSync.cpp
+++ b/WebCore/storage/DatabaseSync.cpp
@@ -2,28 +2,30 @@
* 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:
+ * modification, are permitted provided that 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.
+ * * 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 APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY 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"
@@ -32,8 +34,9 @@
#if ENABLE(DATABASE)
#include "DatabaseCallback.h"
#include "DatabaseTracker.h"
-#include "ExceptionCode.h"
#include "Logging.h"
+#include "SQLException.h"
+#include "SQLTransactionSync.h"
#include "SQLTransactionSyncCallback.h"
#include "ScriptExecutionContext.h"
#include "SecurityOrigin.h"
@@ -87,14 +90,56 @@ DatabaseSync::~DatabaseSync()
}
}
-void DatabaseSync::changeVersion(const String&, const String&, PassRefPtr<SQLTransactionSyncCallback>, ExceptionCode&)
+void DatabaseSync::changeVersion(const String& oldVersion, const String& newVersion, PassRefPtr<SQLTransactionSyncCallback> changeVersionCallback, ExceptionCode& ec)
{
ASSERT(m_scriptExecutionContext->isContextThread());
+
+ if (sqliteDatabase().transactionInProgress()) {
+ ec = SQLException::DATABASE_ERR;
+ return;
+ }
+
+ RefPtr<SQLTransactionSync> transaction = SQLTransactionSync::create(this, changeVersionCallback, false);
+ if ((ec = transaction->begin()))
+ return;
+
+ String actualVersion;
+ if (!getVersionFromDatabase(actualVersion)) {
+ ec = SQLException::UNKNOWN_ERR;
+ return;
+ }
+
+ if (actualVersion != oldVersion) {
+ ec = SQLException::VERSION_ERR;
+ return;
+ }
+
+ if ((ec = transaction->execute()))
+ return;
+
+ if (!setVersionInDatabase(newVersion)) {
+ ec = SQLException::UNKNOWN_ERR;
+ return;
+ }
+
+ if ((ec = transaction->commit()))
+ return;
+
+ setExpectedVersion(newVersion);
}
-void DatabaseSync::transaction(PassRefPtr<SQLTransactionSyncCallback>, bool, ExceptionCode&)
+void DatabaseSync::transaction(PassRefPtr<SQLTransactionSyncCallback> callback, bool readOnly, ExceptionCode& ec)
{
ASSERT(m_scriptExecutionContext->isContextThread());
+
+ if (sqliteDatabase().transactionInProgress()) {
+ ec = SQLException::DATABASE_ERR;
+ return;
+ }
+
+ RefPtr<SQLTransactionSync> transaction = SQLTransactionSync::create(this, callback, readOnly);
+ if ((ec = transaction->begin()) || (ec = transaction->execute()) || (ec = transaction->commit()))
+ transaction->rollback();
}
void DatabaseSync::markAsDeletedAndClose()
diff --git a/WebCore/storage/DatabaseSync.h b/WebCore/storage/DatabaseSync.h
index 96b4f7d..2019f85 100644
--- a/WebCore/storage/DatabaseSync.h
+++ b/WebCore/storage/DatabaseSync.h
@@ -2,28 +2,30 @@
* 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:
+ * modification, are permitted provided that 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.
+ * * 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 APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY 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 DatabaseSync_h
@@ -31,6 +33,7 @@
#if ENABLE(DATABASE)
#include "AbstractDatabase.h"
+#include "ExceptionCode.h"
#include "PlatformString.h"
#include <wtf/Forward.h>
#ifndef NDEBUG
@@ -40,6 +43,7 @@
namespace WebCore {
class DatabaseCallback;
+class SQLTransactionSync;
class SQLTransactionSyncCallback;
class ScriptExecutionContext;
class SecurityOrigin;
diff --git a/WebCore/storage/DatabaseSync.idl b/WebCore/storage/DatabaseSync.idl
index 29b87a7..30adf38 100644
--- a/WebCore/storage/DatabaseSync.idl
+++ b/WebCore/storage/DatabaseSync.idl
@@ -2,28 +2,30 @@
* 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:
+ * modification, are permitted provided that 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.
+ * * 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 APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module storage {
diff --git a/WebCore/storage/DatabaseTracker.cpp b/WebCore/storage/DatabaseTracker.cpp
index 8d23a4f..de38ec3 100644
--- a/WebCore/storage/DatabaseTracker.cpp
+++ b/WebCore/storage/DatabaseTracker.cpp
@@ -221,7 +221,6 @@ bool DatabaseTracker::hasEntryForDatabase(SecurityOrigin* origin, const String&
unsigned long long DatabaseTracker::getMaxSizeForDatabase(const AbstractDatabase* database)
{
- ASSERT(currentThread() == database->scriptExecutionContext()->databaseThread()->getThreadID());
// The maximum size for a database is the full quota for its origin, minus the current usage within the origin,
// plus the current usage of the given database
MutexLocker lockDatabase(m_databaseGuard);
diff --git a/WebCore/storage/IDBAny.h b/WebCore/storage/IDBAny.h
index ff2d6b9..77bba7c 100644
--- a/WebCore/storage/IDBAny.h
+++ b/WebCore/storage/IDBAny.h
@@ -44,6 +44,13 @@ class SerializedScriptValue;
class IDBAny : public RefCounted<IDBAny> {
public:
static PassRefPtr<IDBAny> create();
+ template<typename T>
+ static PassRefPtr<IDBAny> create(T* idbObject)
+ {
+ RefPtr<IDBAny> any = IDBAny::create();
+ any->set(idbObject);
+ return any.release();
+ }
~IDBAny();
enum Type {
diff --git a/WebCore/storage/IDBDatabaseRequest.cpp b/WebCore/storage/IDBDatabaseRequest.cpp
index 3168d06..fce2671 100644
--- a/WebCore/storage/IDBDatabaseRequest.cpp
+++ b/WebCore/storage/IDBDatabaseRequest.cpp
@@ -39,10 +39,8 @@ namespace WebCore {
IDBDatabaseRequest::IDBDatabaseRequest(PassRefPtr<IDBDatabase> database)
: m_database(database)
{
- m_this = IDBAny::create();
// We pass a reference to this object before it can be adopted.
relaxAdoptionRequirement();
- m_this->set(this);
}
IDBDatabaseRequest::~IDBDatabaseRequest()
@@ -51,7 +49,7 @@ IDBDatabaseRequest::~IDBDatabaseRequest()
PassRefPtr<IDBRequest> IDBDatabaseRequest::createObjectStore(ScriptExecutionContext* context, const String& name, const String& keyPath, bool autoIncrement)
{
- RefPtr<IDBRequest> request = IDBRequest::create(context, m_this);
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
m_database->createObjectStore(name, keyPath, autoIncrement, request);
return request;
}
@@ -65,7 +63,7 @@ PassRefPtr<IDBObjectStoreRequest> IDBDatabaseRequest::objectStore(const String&
PassRefPtr<IDBRequest> IDBDatabaseRequest::removeObjectStore(ScriptExecutionContext* context, const String& name)
{
- RefPtr<IDBRequest> request = IDBRequest::create(context, m_this);
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
m_database->removeObjectStore(name, request);
return request;
}
diff --git a/WebCore/storage/IDBDatabaseRequest.h b/WebCore/storage/IDBDatabaseRequest.h
index 23b1ecc..fd19882 100644
--- a/WebCore/storage/IDBDatabaseRequest.h
+++ b/WebCore/storage/IDBDatabaseRequest.h
@@ -63,7 +63,6 @@ private:
IDBDatabaseRequest(PassRefPtr<IDBDatabase>);
RefPtr<IDBDatabase> m_database;
- RefPtr<IDBAny> m_this;
};
} // namespace WebCore
diff --git a/WebCore/storage/IDBKeyRange.cpp b/WebCore/storage/IDBKeyRange.cpp
index 34c11fe..9f22fc8 100644
--- a/WebCore/storage/IDBKeyRange.cpp
+++ b/WebCore/storage/IDBKeyRange.cpp
@@ -34,12 +34,10 @@
namespace WebCore {
IDBKeyRange::IDBKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags)
- : m_left(IDBAny::create())
- , m_right(IDBAny::create())
+ : m_left(left)
+ , m_right(right)
, m_flags(flags)
{
- m_left->set(left);
- m_right->set(right);
}
} // namespace WebCore
diff --git a/WebCore/storage/IDBKeyRange.h b/WebCore/storage/IDBKeyRange.h
index 4c5efe2..52239e4 100644
--- a/WebCore/storage/IDBKeyRange.h
+++ b/WebCore/storage/IDBKeyRange.h
@@ -53,15 +53,15 @@ public:
~IDBKeyRange() { }
- PassRefPtr<IDBAny> left() const { return m_left; }
- PassRefPtr<IDBAny> right() const { return m_right; }
+ PassRefPtr<IDBAny> left() const { return IDBAny::create(m_left.get()); }
+ PassRefPtr<IDBAny> right() const { return IDBAny::create(m_right.get()); }
unsigned short flags() const { return m_flags; }
private:
IDBKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags);
- RefPtr<IDBAny> m_left;
- RefPtr<IDBAny> m_right;
+ RefPtr<SerializedScriptValue> m_left;
+ RefPtr<SerializedScriptValue> m_right;
unsigned short m_flags;
};
diff --git a/WebCore/storage/IDBObjectStoreRequest.cpp b/WebCore/storage/IDBObjectStoreRequest.cpp
index fdd498b..3e095c1 100644
--- a/WebCore/storage/IDBObjectStoreRequest.cpp
+++ b/WebCore/storage/IDBObjectStoreRequest.cpp
@@ -40,10 +40,8 @@ namespace WebCore {
IDBObjectStoreRequest::IDBObjectStoreRequest(PassRefPtr<IDBObjectStore> idbObjectStore)
: m_objectStore(idbObjectStore)
{
- m_this = IDBAny::create();
// We pass a reference to this object before it can be adopted.
relaxAdoptionRequirement();
- m_this->set(this);
}
String IDBObjectStoreRequest::name() const
@@ -63,35 +61,35 @@ PassRefPtr<DOMStringList> IDBObjectStoreRequest::indexNames() const
PassRefPtr<IDBRequest> IDBObjectStoreRequest::get(ScriptExecutionContext* context, PassRefPtr<IDBKey> key)
{
- RefPtr<IDBRequest> request = IDBRequest::create(context, m_this);
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
m_objectStore->get(key, request);
return request;
}
PassRefPtr<IDBRequest> IDBObjectStoreRequest::add(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key)
{
- RefPtr<IDBRequest> request = IDBRequest::create(context, m_this);
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
m_objectStore->put(value, key, true, request);
return request;
}
PassRefPtr<IDBRequest> IDBObjectStoreRequest::put(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key)
{
- RefPtr<IDBRequest> request = IDBRequest::create(context, m_this);
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
m_objectStore->put(value, key, false, request);
return request;
}
PassRefPtr<IDBRequest> IDBObjectStoreRequest::remove(ScriptExecutionContext* context, PassRefPtr<IDBKey> key)
{
- RefPtr<IDBRequest> request = IDBRequest::create(context, m_this);
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
m_objectStore->remove(key, request);
return request;
}
PassRefPtr<IDBRequest> IDBObjectStoreRequest::createIndex(ScriptExecutionContext* context, const String& name, const String& keyPath, bool unique)
{
- RefPtr<IDBRequest> request = IDBRequest::create(context, m_this);
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
m_objectStore->createIndex(name, keyPath, unique, request);
return request;
}
@@ -105,7 +103,7 @@ PassRefPtr<IDBIndexRequest> IDBObjectStoreRequest::index(const String& name)
PassRefPtr<IDBRequest> IDBObjectStoreRequest::removeIndex(ScriptExecutionContext* context, const String& name)
{
- RefPtr<IDBRequest> request = IDBRequest::create(context, m_this);
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
m_objectStore->removeIndex(name, request);
return request;
}
diff --git a/WebCore/storage/IDBObjectStoreRequest.h b/WebCore/storage/IDBObjectStoreRequest.h
index af752f5..86f64d6 100644
--- a/WebCore/storage/IDBObjectStoreRequest.h
+++ b/WebCore/storage/IDBObjectStoreRequest.h
@@ -68,7 +68,6 @@ private:
IDBObjectStoreRequest(PassRefPtr<IDBObjectStore>);
RefPtr<IDBObjectStore> m_objectStore;
- RefPtr<IDBAny> m_this;
};
} // namespace WebCore
diff --git a/WebCore/storage/IndexedDatabaseRequest.cpp b/WebCore/storage/IndexedDatabaseRequest.cpp
index a25fb2b..45ae1bd 100644
--- a/WebCore/storage/IndexedDatabaseRequest.cpp
+++ b/WebCore/storage/IndexedDatabaseRequest.cpp
@@ -44,10 +44,8 @@ namespace WebCore {
IndexedDatabaseRequest::IndexedDatabaseRequest(IndexedDatabase* indexedDatabase)
: m_indexedDatabase(indexedDatabase)
{
- m_this = IDBAny::create();
// We pass a reference to this object before it can be adopted.
relaxAdoptionRequirement();
- m_this->set(this);
}
IndexedDatabaseRequest::~IndexedDatabaseRequest()
@@ -65,7 +63,7 @@ PassRefPtr<IDBRequest> IndexedDatabaseRequest::open(ScriptExecutionContext* cont
if (!document->frame())
return 0;
- RefPtr<IDBRequest> request = IDBRequest::create(document, m_this);
+ RefPtr<IDBRequest> request = IDBRequest::create(document, IDBAny::create(this));
m_indexedDatabase->open(name, description, request, document->securityOrigin(), document->frame());
return request;
}
diff --git a/WebCore/storage/IndexedDatabaseRequest.h b/WebCore/storage/IndexedDatabaseRequest.h
index 9802380..f505d9d 100644
--- a/WebCore/storage/IndexedDatabaseRequest.h
+++ b/WebCore/storage/IndexedDatabaseRequest.h
@@ -64,7 +64,6 @@ private:
IndexedDatabaseRequest(IndexedDatabase*);
RefPtr<IndexedDatabase> m_indexedDatabase;
- RefPtr<IDBAny> m_this;
};
} // namespace WebCore
diff --git a/WebCore/storage/SQLError.h b/WebCore/storage/SQLError.h
index efbe4ec..496145a 100644
--- a/WebCore/storage/SQLError.h
+++ b/WebCore/storage/SQLError.h
@@ -32,7 +32,7 @@
#if ENABLE(DATABASE)
#include "PlatformString.h"
-#include <wtf/Threading.h>
+#include <wtf/ThreadSafeShared.h>
namespace WebCore {
diff --git a/WebCore/storage/SQLException.idl b/WebCore/storage/SQLException.idl
index 9830142..cbbc311 100644
--- a/WebCore/storage/SQLException.idl
+++ b/WebCore/storage/SQLException.idl
@@ -32,7 +32,8 @@ module storage {
interface [
Conditional=DATABASE,
- NoStaticTables
+ NoStaticTables,
+ DontCheckEnums
] SQLException {
readonly attribute unsigned long code;
readonly attribute DOMString message;
diff --git a/WebCore/storage/SQLResultSet.cpp b/WebCore/storage/SQLResultSet.cpp
index 19c66c7..7482628 100644
--- a/WebCore/storage/SQLResultSet.cpp
+++ b/WebCore/storage/SQLResultSet.cpp
@@ -31,9 +31,6 @@
#if ENABLE(DATABASE)
-#include "ExceptionCode.h"
-#include "SQLValue.h"
-
namespace WebCore {
static unsigned const MaxErrorCode = 2;
diff --git a/WebCore/storage/SQLResultSet.h b/WebCore/storage/SQLResultSet.h
index 5a0ff78..268472f 100644
--- a/WebCore/storage/SQLResultSet.h
+++ b/WebCore/storage/SQLResultSet.h
@@ -31,13 +31,12 @@
#if ENABLE(DATABASE)
+#include "ExceptionCode.h"
#include "SQLResultSetRowList.h"
-#include <wtf/Threading.h>
+#include <wtf/ThreadSafeShared.h>
namespace WebCore {
-typedef int ExceptionCode;
-
class SQLResultSet : public ThreadSafeShared<SQLResultSet> {
public:
static PassRefPtr<SQLResultSet> create() { return adoptRef(new SQLResultSet); }
diff --git a/WebCore/storage/SQLStatementCallback.h b/WebCore/storage/SQLStatementCallback.h
index 68e7cb8..4bb2e06 100644
--- a/WebCore/storage/SQLStatementCallback.h
+++ b/WebCore/storage/SQLStatementCallback.h
@@ -30,7 +30,7 @@
#if ENABLE(DATABASE)
-#include <wtf/Threading.h>
+#include <wtf/ThreadSafeShared.h>
namespace WebCore {
diff --git a/WebCore/storage/SQLStatementErrorCallback.h b/WebCore/storage/SQLStatementErrorCallback.h
index 8db98be..7c45afd 100644
--- a/WebCore/storage/SQLStatementErrorCallback.h
+++ b/WebCore/storage/SQLStatementErrorCallback.h
@@ -31,7 +31,7 @@
#if ENABLE(DATABASE)
-#include <wtf/Threading.h>
+#include <wtf/ThreadSafeShared.h>
namespace WebCore {
diff --git a/WebCore/storage/SQLStatementSync.cpp b/WebCore/storage/SQLStatementSync.cpp
new file mode 100644
index 0000000..7be3f50
--- /dev/null
+++ b/WebCore/storage/SQLStatementSync.cpp
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SQLStatementSync.h"
+
+#if ENABLE(DATABASE)
+
+#include "DatabaseSync.h"
+#include "SQLException.h"
+#include "SQLResultSet.h"
+#include "SQLValue.h"
+#include "SQLiteDatabase.h"
+#include "SQLiteStatement.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+SQLStatementSync::SQLStatementSync(const String& statement, const Vector<SQLValue>& arguments, bool readOnly)
+ : m_statement(statement)
+ , m_arguments(arguments)
+ , m_readOnly(readOnly)
+{
+ ASSERT(!m_statement.isEmpty());
+}
+
+PassRefPtr<SQLResultSet> SQLStatementSync::execute(DatabaseSync* db, ExceptionCode& ec)
+{
+ if (m_readOnly)
+ db->setAuthorizerReadOnly();
+
+ SQLiteDatabase* database = &db->sqliteDatabase();
+
+ SQLiteStatement statement(*database, m_statement);
+ int result = statement.prepare();
+ if (result != SQLResultOk) {
+ ec = SQLException::SYNTAX_ERR;
+ return 0;
+ }
+
+ if (statement.bindParameterCount() != m_arguments.size()) {
+ ec = SQLException::SYNTAX_ERR;
+ return 0;
+ }
+
+ for (unsigned i = 0; i < m_arguments.size(); ++i) {
+ result = statement.bindValue(i + 1, m_arguments[i]);
+ if (result == SQLResultFull) {
+ ec = SQLException::QUOTA_ERR;
+ return 0;
+ }
+
+ if (result != SQLResultOk) {
+ ec = SQLException::DATABASE_ERR;
+ return 0;
+ }
+ }
+
+ RefPtr<SQLResultSet> resultSet = SQLResultSet::create();
+
+ // Step so we can fetch the column names.
+ result = statement.step();
+ if (result == SQLResultRow) {
+ int columnCount = statement.columnCount();
+ SQLResultSetRowList* rows = resultSet->rows();
+
+ for (int i = 0; i < columnCount; i++)
+ rows->addColumn(statement.getColumnName(i));
+
+ do {
+ for (int i = 0; i < columnCount; i++)
+ rows->addResult(statement.getColumnValue(i));
+
+ result = statement.step();
+ } while (result == SQLResultRow);
+
+ if (result != SQLResultDone) {
+ ec = SQLException::DATABASE_ERR;
+ return 0;
+ }
+ } else if (result == SQLResultDone) {
+ // Didn't find anything, or was an insert.
+ if (db->lastActionWasInsert())
+ resultSet->setInsertId(database->lastInsertRowID());
+ } else if (result == SQLResultFull) {
+ // Quota error, the delegate will be asked for more space and this statement might be re-run.
+ ec = SQLException::QUOTA_ERR;
+ return 0;
+ } else {
+ ec = SQLException::DATABASE_ERR;
+ return 0;
+ }
+
+ resultSet->setRowsAffected(database->lastChanges());
+ return resultSet.release();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(DATABASE)
diff --git a/WebCore/storage/SQLStatementSync.h b/WebCore/storage/SQLStatementSync.h
new file mode 100644
index 0000000..dc0394c
--- /dev/null
+++ b/WebCore/storage/SQLStatementSync.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SQLStatementSync_h
+#define SQLStatementSync_h
+
+#if ENABLE(DATABASE)
+
+#include "ExceptionCode.h"
+#include "PlatformString.h"
+#include "SQLValue.h"
+#include <wtf/Forward.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class DatabaseSync;
+class SQLResultSet;
+
+class SQLStatementSync {
+public:
+ SQLStatementSync(const String& statement, const Vector<SQLValue>& arguments, bool readOnly);
+
+ PassRefPtr<SQLResultSet> execute(DatabaseSync*, ExceptionCode&);
+
+private:
+ String m_statement;
+ Vector<SQLValue> m_arguments;
+ bool m_readOnly;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(DATABASE)
+
+#endif // SQLStatementSync_h
diff --git a/WebCore/storage/SQLTransaction.cpp b/WebCore/storage/SQLTransaction.cpp
index 960427b..decdf24 100644
--- a/WebCore/storage/SQLTransaction.cpp
+++ b/WebCore/storage/SQLTransaction.cpp
@@ -33,7 +33,6 @@
#include "Database.h"
#include "DatabaseThread.h"
-#include "ExceptionCode.h"
#include "Logging.h"
#include "PlatformString.h"
#include "ScriptExecutionContext.h"
@@ -370,7 +369,7 @@ bool SQLTransaction::runCurrentStatement()
// Flag this transaction as having changed the database for later delegate notification
m_modifiedDatabase = true;
// Also dirty the size of this database file for calculating quota usage
- m_database->transactionClient()->didExecuteStatement(this);
+ m_database->transactionClient()->didExecuteStatement(database());
}
if (m_currentStatement->hasStatementCallback()) {
@@ -432,7 +431,7 @@ void SQLTransaction::deliverQuotaIncreaseCallback()
ASSERT(m_currentStatement);
ASSERT(!m_shouldRetryCurrentStatement);
- m_shouldRetryCurrentStatement = m_database->transactionClient()->didExceedQuota(this);
+ m_shouldRetryCurrentStatement = m_database->transactionClient()->didExceedQuota(database());
m_nextStep = &SQLTransaction::runStatements;
LOG(StorageAPI, "Scheduling runStatements for transaction %p\n", this);
@@ -472,7 +471,7 @@ void SQLTransaction::postflightAndCommit()
// The commit was successful. If the transaction modified this database, notify the delegates.
if (m_modifiedDatabase)
- m_database->transactionClient()->didCommitTransaction(this);
+ m_database->transactionClient()->didCommitWriteTransaction(database());
// Now release our unneeded callbacks, to break reference cycles.
m_callback = 0;
diff --git a/WebCore/storage/SQLTransaction.h b/WebCore/storage/SQLTransaction.h
index 3cef036..5c62ca2 100644
--- a/WebCore/storage/SQLTransaction.h
+++ b/WebCore/storage/SQLTransaction.h
@@ -30,17 +30,15 @@
#if ENABLE(DATABASE)
-#include <wtf/Threading.h>
-
+#include "ExceptionCode.h"
#include "SQLStatement.h"
#include <wtf/Deque.h>
#include <wtf/Forward.h>
+#include <wtf/ThreadSafeShared.h>
#include <wtf/Vector.h>
namespace WebCore {
-typedef int ExceptionCode;
-
class Database;
class SQLError;
class SQLiteTransaction;
diff --git a/WebCore/storage/SQLTransactionCallback.h b/WebCore/storage/SQLTransactionCallback.h
index 048410f..73123ee 100644
--- a/WebCore/storage/SQLTransactionCallback.h
+++ b/WebCore/storage/SQLTransactionCallback.h
@@ -31,7 +31,7 @@
#if ENABLE(DATABASE)
-#include <wtf/Threading.h>
+#include <wtf/ThreadSafeShared.h>
namespace WebCore {
diff --git a/WebCore/storage/SQLTransactionClient.cpp b/WebCore/storage/SQLTransactionClient.cpp
index 32c8e07..6b95606 100644
--- a/WebCore/storage/SQLTransactionClient.cpp
+++ b/WebCore/storage/SQLTransactionClient.cpp
@@ -33,36 +33,27 @@
#if ENABLE(DATABASE)
-#include "Chrome.h"
-#include "ChromeClient.h"
-#include "Database.h"
-#include "DatabaseThread.h"
+#include "AbstractDatabase.h"
#include "DatabaseTracker.h"
-#include "Document.h"
-#include "Page.h"
-#include "SQLTransaction.h"
+#include "ScriptExecutionContext.h"
+#include "SecurityOrigin.h"
namespace WebCore {
-void SQLTransactionClient::didCommitTransaction(SQLTransaction* transaction)
+void SQLTransactionClient::didCommitWriteTransaction(AbstractDatabase* database)
{
- ASSERT(currentThread() == transaction->database()->scriptExecutionContext()->databaseThread()->getThreadID());
- Database* database = transaction->database();
DatabaseTracker::tracker().scheduleNotifyDatabaseChanged(
database->securityOrigin(), database->stringIdentifier());
}
-void SQLTransactionClient::didExecuteStatement(SQLTransaction* transaction)
+void SQLTransactionClient::didExecuteStatement(AbstractDatabase* database)
{
- ASSERT(currentThread() == transaction->database()->scriptExecutionContext()->databaseThread()->getThreadID());
- DatabaseTracker::tracker().databaseChanged(transaction->database());
+ DatabaseTracker::tracker().databaseChanged(database);
}
-bool SQLTransactionClient::didExceedQuota(SQLTransaction* transaction)
+bool SQLTransactionClient::didExceedQuota(AbstractDatabase* database)
{
- ASSERT(transaction->database()->scriptExecutionContext()->isContextThread());
- Database* database = transaction->database();
-
+ ASSERT(database->scriptExecutionContext()->isContextThread());
unsigned long long currentQuota = DatabaseTracker::tracker().quotaForOrigin(database->securityOrigin());
database->scriptExecutionContext()->databaseExceededQuota(database->stringIdentifier());
unsigned long long newQuota = DatabaseTracker::tracker().quotaForOrigin(database->securityOrigin());
diff --git a/WebCore/storage/SQLTransactionClient.h b/WebCore/storage/SQLTransactionClient.h
index 801647b..fed0657 100644
--- a/WebCore/storage/SQLTransactionClient.h
+++ b/WebCore/storage/SQLTransactionClient.h
@@ -37,16 +37,17 @@
namespace WebCore {
- class SQLTransaction;
-
- // A client to the SQLTransaction class. Allows SQLTransaction to notify interested
- // parties that certain things have happened in a transaction.
- class SQLTransactionClient : public Noncopyable {
- public:
- void didCommitTransaction(SQLTransaction*);
- void didExecuteStatement(SQLTransaction*);
- bool didExceedQuota(SQLTransaction*);
- };
+class AbstractDatabase;
+
+// A client to the SQLTransaction class. Allows SQLTransaction to notify interested
+// parties that certain things have happened in a transaction.
+class SQLTransactionClient : public Noncopyable {
+public:
+ void didCommitWriteTransaction(AbstractDatabase*);
+ void didExecuteStatement(AbstractDatabase*);
+ bool didExceedQuota(AbstractDatabase*);
+};
+
}
#endif // ENABLE(DATABASE)
diff --git a/WebCore/storage/SQLTransactionErrorCallback.h b/WebCore/storage/SQLTransactionErrorCallback.h
index 2fe2cb3..71580eb 100644
--- a/WebCore/storage/SQLTransactionErrorCallback.h
+++ b/WebCore/storage/SQLTransactionErrorCallback.h
@@ -31,7 +31,7 @@
#if ENABLE(DATABASE)
-#include <wtf/Threading.h>
+#include <wtf/ThreadSafeShared.h>
namespace WebCore {
diff --git a/WebCore/storage/SQLTransactionSync.cpp b/WebCore/storage/SQLTransactionSync.cpp
index 5e7c879..af98f8f 100644
--- a/WebCore/storage/SQLTransactionSync.cpp
+++ b/WebCore/storage/SQLTransactionSync.cpp
@@ -2,28 +2,30 @@
* 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:
+ * modification, are permitted provided that 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.
+ * * 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 APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY 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"
@@ -32,11 +34,14 @@
#if ENABLE(DATABASE)
#include "DatabaseSync.h"
-#include "ExceptionCode.h"
#include "PlatformString.h"
+#include "SQLException.h"
#include "SQLResultSet.h"
+#include "SQLStatementSync.h"
+#include "SQLTransactionClient.h"
#include "SQLTransactionSyncCallback.h"
#include "SQLValue.h"
+#include "SQLiteTransaction.h"
#include "ScriptExecutionContext.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
@@ -52,22 +57,150 @@ SQLTransactionSync::SQLTransactionSync(DatabaseSync* db, PassRefPtr<SQLTransacti
: m_database(db)
, m_callback(callback)
, m_readOnly(readOnly)
+ , m_modifiedDatabase(false)
+ , m_transactionClient(new SQLTransactionClient())
{
ASSERT(m_database->scriptExecutionContext()->isContextThread());
- ASSERT(callback);
}
SQLTransactionSync::~SQLTransactionSync()
{
ASSERT(m_database->scriptExecutionContext()->isContextThread());
+ if (m_sqliteTransaction && m_sqliteTransaction->inProgress())
+ rollback();
}
-PassRefPtr<SQLResultSet> SQLTransactionSync::executeSQL(const String&, const Vector<SQLValue>&, ExceptionCode&)
+PassRefPtr<SQLResultSet> SQLTransactionSync::executeSQL(const String& sqlStatement, const Vector<SQLValue>& arguments, ExceptionCode& ec)
{
ASSERT(m_database->scriptExecutionContext()->isContextThread());
+ if (!m_database->opened()) {
+ ec = SQLException::UNKNOWN_ERR;
+ return 0;
+ }
+
+ if (!m_database->versionMatchesExpected()) {
+ ec = SQLException::VERSION_ERR;
+ return 0;
+ }
+
+ if (sqlStatement.isEmpty())
+ return 0;
+
+ bool readOnlyMode = m_readOnly || m_database->scriptExecutionContext()->isDatabaseReadOnly();
+ SQLStatementSync statement(sqlStatement, arguments, readOnlyMode);
+
+ m_database->resetAuthorizer();
+ bool retryStatement = true;
+ RefPtr<SQLResultSet> resultSet;
+ while (retryStatement) {
+ retryStatement = false;
+ resultSet = statement.execute(m_database.get(), ec);
+ if (!resultSet) {
+ if (m_sqliteTransaction->wasRolledBackBySqlite())
+ return 0;
+
+ if (ec == SQLException::QUOTA_ERR) {
+ if (m_transactionClient->didExceedQuota(database())) {
+ ec = 0;
+ retryStatement = true;
+ } else
+ return 0;
+ }
+ }
+ }
+
+ if (m_database->lastActionChangedDatabase()) {
+ m_modifiedDatabase = true;
+ m_transactionClient->didExecuteStatement(database());
+ }
+
+ return resultSet.release();
+}
+
+ExceptionCode SQLTransactionSync::begin()
+{
+ ASSERT(m_database->scriptExecutionContext()->isContextThread());
+ if (!m_database->opened())
+ return SQLException::UNKNOWN_ERR;
+
+ ASSERT(!m_database->sqliteDatabase().transactionInProgress());
+
+ // Set the maximum usage for this transaction if this transactions is not read-only.
+ if (!m_readOnly)
+ m_database->sqliteDatabase().setMaximumSize(m_database->maximumSize());
+
+ ASSERT(!m_sqliteTransaction);
+ m_sqliteTransaction.set(new SQLiteTransaction(m_database->sqliteDatabase(), m_readOnly));
+
+ m_database->resetDeletes();
+ m_database->disableAuthorizer();
+ m_sqliteTransaction->begin();
+ m_database->enableAuthorizer();
+
+ // Check if begin() succeeded.
+ if (!m_sqliteTransaction->inProgress()) {
+ ASSERT(!m_database->sqliteDatabase().transactionInProgress());
+ m_sqliteTransaction.clear();
+ return SQLException::DATABASE_ERR;
+ }
+
+ return 0;
+}
+
+ExceptionCode SQLTransactionSync::execute()
+{
+ ASSERT(m_database->scriptExecutionContext()->isContextThread());
+ if (!m_database->opened() || !m_callback || !m_callback->handleEvent(m_database->scriptExecutionContext(), this)) {
+ m_callback = 0;
+ return SQLException::UNKNOWN_ERR;
+ }
+
+ m_callback = 0;
+ return 0;
+}
+
+ExceptionCode SQLTransactionSync::commit()
+{
+ ASSERT(m_database->scriptExecutionContext()->isContextThread());
+ if (!m_database->opened())
+ return SQLException::UNKNOWN_ERR;
+
+ ASSERT(m_sqliteTransaction);
+
+ m_database->disableAuthorizer();
+ m_sqliteTransaction->commit();
+ m_database->enableAuthorizer();
+
+ // If the commit failed, the transaction will still be marked as "in progress"
+ if (m_sqliteTransaction->inProgress())
+ return SQLException::DATABASE_ERR;
+
+ m_sqliteTransaction.clear();
+
+ // Vacuum the database if anything was deleted.
+ if (m_database->hadDeletes())
+ m_database->incrementalVacuumIfNeeded();
+
+ // The commit was successful. If the transaction modified this database, notify the delegates.
+ if (m_modifiedDatabase)
+ m_transactionClient->didCommitWriteTransaction(database());
+
return 0;
}
+void SQLTransactionSync::rollback()
+{
+ ASSERT(m_database->scriptExecutionContext()->isContextThread());
+ m_database->disableAuthorizer();
+ if (m_sqliteTransaction) {
+ m_sqliteTransaction->rollback();
+ m_sqliteTransaction.clear();
+ }
+ m_database->enableAuthorizer();
+
+ ASSERT(!m_database->sqliteDatabase().transactionInProgress());
+}
+
} // namespace WebCore
#endif // ENABLE(DATABASE)
diff --git a/WebCore/storage/SQLTransactionSync.h b/WebCore/storage/SQLTransactionSync.h
index 7c03927..025215b 100644
--- a/WebCore/storage/SQLTransactionSync.h
+++ b/WebCore/storage/SQLTransactionSync.h
@@ -2,46 +2,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:
+ * modification, are permitted provided that 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.
+ * * 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 APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY 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 SQLTransactionSync_h
#define SQLTransactionSync_h
#if ENABLE(DATABASE)
+#include "ExceptionCode.h"
#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
namespace WebCore {
-typedef int ExceptionCode;
-
class DatabaseSync;
class SQLResultSet;
+class SQLTransactionClient;
class SQLTransactionSyncCallback;
class SQLValue;
+class SQLiteTransaction;
class String;
// Instances of this class should be created and used only on the worker's context thread.
@@ -56,12 +60,21 @@ public:
DatabaseSync* database() { return m_database.get(); }
bool isReadOnly() const { return m_readOnly; }
+ ExceptionCode begin();
+ ExceptionCode execute();
+ ExceptionCode commit();
+ void rollback();
+
private:
SQLTransactionSync(DatabaseSync*, PassRefPtr<SQLTransactionSyncCallback>, bool readOnly);
RefPtr<DatabaseSync> m_database;
RefPtr<SQLTransactionSyncCallback> m_callback;
bool m_readOnly;
+
+ bool m_modifiedDatabase;
+ OwnPtr<SQLTransactionClient> m_transactionClient;
+ OwnPtr<SQLiteTransaction> m_sqliteTransaction;
};
} // namespace WebCore
diff --git a/WebCore/storage/SQLTransactionSync.idl b/WebCore/storage/SQLTransactionSync.idl
index a4002b1..003a21d 100644
--- a/WebCore/storage/SQLTransactionSync.idl
+++ b/WebCore/storage/SQLTransactionSync.idl
@@ -2,28 +2,30 @@
* 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:
+ * modification, are permitted provided that 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.
+ * * 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 APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module storage {
diff --git a/WebCore/storage/SQLTransactionSyncCallback.h b/WebCore/storage/SQLTransactionSyncCallback.h
index eba82b0..557db86 100644
--- a/WebCore/storage/SQLTransactionSyncCallback.h
+++ b/WebCore/storage/SQLTransactionSyncCallback.h
@@ -2,28 +2,30 @@
* 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:
- *Transaction
- * 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.
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * 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.
+ * * 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 SQLTransactionSyncCallback_h
@@ -32,7 +34,6 @@
#if ENABLE(DATABASE)
#include <wtf/RefCounted.h>
-#include <wtf/Threading.h>
namespace WebCore {
diff --git a/WebCore/storage/SQLTransactionSyncCallback.idl b/WebCore/storage/SQLTransactionSyncCallback.idl
index 1bff22b..b0fffca 100644
--- a/WebCore/storage/SQLTransactionSyncCallback.idl
+++ b/WebCore/storage/SQLTransactionSyncCallback.idl
@@ -2,28 +2,30 @@
* 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:
+ * modification, are permitted provided that 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.
+ * * 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 APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module storage {
diff --git a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
index 13c65cc..7d9c4de 100644
--- a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
+++ b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
@@ -33,16 +33,13 @@
#include "AbstractDatabase.h"
#include "DatabaseObserver.h"
-#include "DatabaseThread.h"
#include "QuotaTracker.h"
+#include "PlatformString.h"
#include "ScriptExecutionContext.h"
#include "SecurityOrigin.h"
#include "SecurityOriginHash.h"
#include "SQLiteFileSystem.h"
-#include <wtf/HashSet.h>
-#include <wtf/MainThread.h>
#include <wtf/StdLibExtras.h>
-#include <wtf/text/CString.h>
namespace WebCore {
@@ -167,7 +164,6 @@ void DatabaseTracker::getOpenDatabases(SecurityOrigin* origin, const String& nam
unsigned long long DatabaseTracker::getMaxSizeForDatabase(const AbstractDatabase* database)
{
- ASSERT(currentThread() == database->scriptExecutionContext()->databaseThread()->getThreadID());
unsigned long long spaceAvailable = 0;
unsigned long long databaseSize = 0;
QuotaTracker::instance().getDatabaseSizeAndSpaceAvailableToOrigin(
diff --git a/WebCore/storage/chromium/SQLTransactionClientChromium.cpp b/WebCore/storage/chromium/SQLTransactionClientChromium.cpp
index a10ca3e..22d95e6 100644
--- a/WebCore/storage/chromium/SQLTransactionClientChromium.cpp
+++ b/WebCore/storage/chromium/SQLTransactionClientChromium.cpp
@@ -31,18 +31,15 @@
#include "config.h"
#include "SQLTransactionClient.h"
-#include "Database.h"
+#include "AbstractDatabase.h"
#include "DatabaseObserver.h"
-#include "DatabaseThread.h"
-#include "Document.h"
-#include "SQLTransaction.h"
-#include <wtf/MainThread.h>
+#include "ScriptExecutionContext.h"
namespace WebCore {
class NotifyDatabaseChangedTask : public ScriptExecutionContext::Task {
public:
- static PassOwnPtr<NotifyDatabaseChangedTask> create(Database *database)
+ static PassOwnPtr<NotifyDatabaseChangedTask> create(AbstractDatabase *database)
{
return new NotifyDatabaseChangedTask(database);
}
@@ -53,34 +50,35 @@ public:
}
private:
- NotifyDatabaseChangedTask(PassRefPtr<Database> database)
+ NotifyDatabaseChangedTask(PassRefPtr<AbstractDatabase> database)
: m_database(database)
{
}
- RefPtr<Database> m_database;
+ RefPtr<AbstractDatabase> m_database;
};
-void SQLTransactionClient::didCommitTransaction(SQLTransaction* transaction)
+void SQLTransactionClient::didCommitWriteTransaction(AbstractDatabase* database)
{
- ASSERT(currentThread() == transaction->database()->scriptExecutionContext()->databaseThread()->getThreadID());
- if (!transaction->isReadOnly()) {
- transaction->database()->scriptExecutionContext()->postTask(NotifyDatabaseChangedTask::create(transaction->database()));
+ if (!database->scriptExecutionContext()->isContextThread()) {
+ database->scriptExecutionContext()->postTask(NotifyDatabaseChangedTask::create(database));
+ return;
}
+
+ WebCore::DatabaseObserver::databaseModified(database);
}
-void SQLTransactionClient::didExecuteStatement(SQLTransaction* transaction)
+void SQLTransactionClient::didExecuteStatement(AbstractDatabase* database)
{
// This method is called after executing every statement that changes the DB.
// Chromium doesn't need to do anything at that point.
- ASSERT(currentThread() == transaction->database()->scriptExecutionContext()->databaseThread()->getThreadID());
}
-bool SQLTransactionClient::didExceedQuota(SQLTransaction* transaction)
+bool SQLTransactionClient::didExceedQuota(AbstractDatabase* database)
{
// Chromium does not allow users to manually change the quota for an origin (for now, at least).
// Don't do anything.
- ASSERT(transaction->database()->scriptExecutionContext()->isContextThread());
+ ASSERT(database->scriptExecutionContext()->isContextThread());
return false;
}
diff --git a/WebCore/svg/SVGAllInOne.cpp b/WebCore/svg/SVGAllInOne.cpp
index c1bf281..0ad4932 100644
--- a/WebCore/svg/SVGAllInOne.cpp
+++ b/WebCore/svg/SVGAllInOne.cpp
@@ -107,7 +107,9 @@
#include "SVGNumberList.cpp"
#include "SVGPaint.cpp"
#include "SVGParserUtilities.cpp"
+#include "SVGPathBuilder.cpp"
#include "SVGPathElement.cpp"
+#include "SVGPathParser.cpp"
#include "SVGPathSegArc.cpp"
#include "SVGPathSegClosePath.cpp"
#include "SVGPathSegCurvetoCubic.cpp"
@@ -118,6 +120,7 @@
#include "SVGPathSegLinetoHorizontal.cpp"
#include "SVGPathSegLinetoVertical.cpp"
#include "SVGPathSegList.cpp"
+#include "SVGPathSegListBuilder.cpp"
#include "SVGPathSegMoveto.cpp"
#include "SVGPatternElement.cpp"
#include "SVGPointList.cpp"
diff --git a/WebCore/svg/SVGAnimateElement.cpp b/WebCore/svg/SVGAnimateElement.cpp
index ff3317b..fa4a4cf 100644
--- a/WebCore/svg/SVGAnimateElement.cpp
+++ b/WebCore/svg/SVGAnimateElement.cpp
@@ -28,6 +28,7 @@
#include "SVGColor.h"
#include "SVGParserUtilities.h"
#include "SVGPathSegList.h"
+#include "SVGPathSegListBuilder.h"
#include "SVGPointList.h"
#include <math.h>
@@ -189,9 +190,11 @@ bool SVGAnimateElement::calculateFromAndToValues(const String& fromString, const
}
} else if (m_propertyType == PathProperty) {
m_fromPath = SVGPathSegList::create(SVGNames::dAttr);
- if (pathSegListFromSVGData(m_fromPath.get(), fromString)) {
+ SVGPathSegListBuilder fromParser(m_fromPath.get());
+ if (fromParser.build(fromString, UnalteredParsing)) {
m_toPath = SVGPathSegList::create(SVGNames::dAttr);
- if (pathSegListFromSVGData(m_toPath.get(), toString))
+ SVGPathSegListBuilder toParser(m_toPath.get());
+ if (toParser.build(toString, UnalteredParsing))
return true;
}
m_fromPath.clear();
diff --git a/WebCore/svg/SVGAnimateMotionElement.cpp b/WebCore/svg/SVGAnimateMotionElement.cpp
index 9a0da7f..a3f4ef9 100644
--- a/WebCore/svg/SVGAnimateMotionElement.cpp
+++ b/WebCore/svg/SVGAnimateMotionElement.cpp
@@ -28,9 +28,11 @@
#include "Attribute.h"
#include "RenderObject.h"
+#include "RenderSVGResource.h"
#include "SVGElementInstance.h"
#include "SVGMPathElement.h"
#include "SVGParserUtilities.h"
+#include "SVGPathBuilder.h"
#include "SVGPathElement.h"
#include "SVGTransformList.h"
#include <math.h>
@@ -87,7 +89,9 @@ void SVGAnimateMotionElement::parseMappedAttribute(Attribute* attr)
{
if (attr->name() == SVGNames::pathAttr) {
m_path = Path();
- pathFromSVGData(m_path, attr->value());
+ SVGPathBuilder builder(m_path);
+ // FIXME: We should analyse the returned value.
+ builder.build(attr->value());
} else
SVGAnimationElement::parseMappedAttribute(attr);
}
@@ -214,9 +218,12 @@ void SVGAnimateMotionElement::applyResultsToTarget()
{
// We accumulate to the target element transform list so there is not much to do here.
SVGElement* targetElement = this->targetElement();
- if (targetElement && targetElement->renderer())
- targetElement->renderer()->setNeedsLayout(true);
-
+ if (!targetElement)
+ return;
+
+ if (RenderObject* renderer = targetElement->renderer())
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+
// ...except in case where we have additional instances in <use> trees.
const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
@@ -228,7 +235,7 @@ void SVGAnimateMotionElement::applyResultsToTarget()
transform->setMatrix(t->a(), t->b(), t->c(), t->d(), t->e(), t->f());
if (RenderObject* renderer = shadowTreeElement->renderer()) {
renderer->setNeedsTransformUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
}
}
@@ -248,5 +255,3 @@ float SVGAnimateMotionElement::calculateDistance(const String& fromString, const
}
#endif // ENABLE(SVG)
-
-// vim:ts=4:noet
diff --git a/WebCore/svg/SVGAnimateTransformElement.cpp b/WebCore/svg/SVGAnimateTransformElement.cpp
index 1a305bb..6ca9447 100644
--- a/WebCore/svg/SVGAnimateTransformElement.cpp
+++ b/WebCore/svg/SVGAnimateTransformElement.cpp
@@ -30,6 +30,7 @@
#include "AffineTransform.h"
#include "Attribute.h"
#include "RenderObject.h"
+#include "RenderSVGResource.h"
#include "SVGAngle.h"
#include "SVGElementInstance.h"
#include "SVGGradientElement.h"
@@ -172,9 +173,12 @@ void SVGAnimateTransformElement::applyResultsToTarget()
return;
// We accumulate to the target element transform list so there is not much to do here.
SVGElement* targetElement = this->targetElement();
+ if (!targetElement)
+ return;
+
if (RenderObject* renderer = targetElement->renderer()) {
renderer->setNeedsTransformUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
// ...except in case where we have additional instances in <use> trees.
@@ -192,7 +196,7 @@ void SVGAnimateTransformElement::applyResultsToTarget()
static_cast<SVGGradientElement*>(shadowTreeElement)->setGradientTransformBaseValue(transformList.get());
if (RenderObject* renderer = shadowTreeElement->renderer()) {
renderer->setNeedsTransformUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
}
}
diff --git a/WebCore/svg/SVGCircleElement.cpp b/WebCore/svg/SVGCircleElement.cpp
index c90b8e3..f8c9ccd 100644
--- a/WebCore/svg/SVGCircleElement.cpp
+++ b/WebCore/svg/SVGCircleElement.cpp
@@ -26,6 +26,7 @@
#include "Attribute.h"
#include "FloatPoint.h"
#include "RenderPath.h"
+#include "RenderSVGResource.h"
#include "SVGLength.h"
#include "SVGNames.h"
@@ -84,20 +85,20 @@ void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName)
if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
renderer->setNeedsTransformUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
if (isLengthAttribute) {
renderer->setNeedsPathUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
if (SVGTests::isKnownAttribute(attrName)
|| SVGLangSpace::isKnownAttribute(attrName)
|| SVGExternalResourcesRequired::isKnownAttribute(attrName))
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
void SVGCircleElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGComponentTransferFunctionElement.idl b/WebCore/svg/SVGComponentTransferFunctionElement.idl
index 950f77d..0a9e05d 100644
--- a/WebCore/svg/SVGComponentTransferFunctionElement.idl
+++ b/WebCore/svg/SVGComponentTransferFunctionElement.idl
@@ -25,7 +25,10 @@
module svg {
- interface [Conditional=SVG&FILTERS] SVGComponentTransferFunctionElement : SVGElement {
+ interface [
+ Conditional=SVG&FILTERS,
+ DontCheckEnums
+ ] SVGComponentTransferFunctionElement : SVGElement {
// Component Transfer Types
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1;
diff --git a/WebCore/svg/SVGEllipseElement.cpp b/WebCore/svg/SVGEllipseElement.cpp
index 5509c2d..963b4b0 100644
--- a/WebCore/svg/SVGEllipseElement.cpp
+++ b/WebCore/svg/SVGEllipseElement.cpp
@@ -26,6 +26,7 @@
#include "Attribute.h"
#include "FloatPoint.h"
#include "RenderPath.h"
+#include "RenderSVGResource.h"
#include "SVGLength.h"
#include "SVGNames.h"
@@ -90,20 +91,20 @@ void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName)
if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
renderer->setNeedsTransformUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
if (isLengthAttribute) {
renderer->setNeedsPathUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
if (SVGTests::isKnownAttribute(attrName)
|| SVGLangSpace::isKnownAttribute(attrName)
|| SVGExternalResourcesRequired::isKnownAttribute(attrName))
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
void SVGEllipseElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGException.idl b/WebCore/svg/SVGException.idl
index db565ff..3f1f8ec 100644
--- a/WebCore/svg/SVGException.idl
+++ b/WebCore/svg/SVGException.idl
@@ -21,7 +21,8 @@
module svg {
interface [
- Conditional=SVG
+ Conditional=SVG,
+ DontCheckEnums
] SVGException {
readonly attribute unsigned short code;
diff --git a/WebCore/svg/SVGFEBlendElement.idl b/WebCore/svg/SVGFEBlendElement.idl
index bb6d86d..0c08603 100644
--- a/WebCore/svg/SVGFEBlendElement.idl
+++ b/WebCore/svg/SVGFEBlendElement.idl
@@ -25,8 +25,11 @@
module svg {
- interface [Conditional=SVG&FILTERS] SVGFEBlendElement : SVGElement,
- SVGFilterPrimitiveStandardAttributes {
+ interface [
+ Conditional=SVG&FILTERS,
+ DontCheckEnums
+ ] SVGFEBlendElement : SVGElement,
+ SVGFilterPrimitiveStandardAttributes {
// Blend Mode Types
const unsigned short SVG_FEBLEND_MODE_UNKNOWN = 0;
const unsigned short SVG_FEBLEND_MODE_NORMAL = 1;
diff --git a/WebCore/svg/SVGFEColorMatrixElement.idl b/WebCore/svg/SVGFEColorMatrixElement.idl
index d704906..61c5b4a 100644
--- a/WebCore/svg/SVGFEColorMatrixElement.idl
+++ b/WebCore/svg/SVGFEColorMatrixElement.idl
@@ -25,8 +25,11 @@
module svg {
- interface [Conditional=SVG&FILTERS] SVGFEColorMatrixElement : SVGElement,
- SVGFilterPrimitiveStandardAttributes {
+ interface [
+ Conditional=SVG&FILTERS,
+ DontCheckEnums
+ ] SVGFEColorMatrixElement : SVGElement,
+ SVGFilterPrimitiveStandardAttributes {
// Color Matrix Types
const unsigned short SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0;
const unsigned short SVG_FECOLORMATRIX_TYPE_MATRIX = 1;
diff --git a/WebCore/svg/SVGFECompositeElement.idl b/WebCore/svg/SVGFECompositeElement.idl
index d3adb25..af1d5cf 100644
--- a/WebCore/svg/SVGFECompositeElement.idl
+++ b/WebCore/svg/SVGFECompositeElement.idl
@@ -25,8 +25,11 @@
module svg {
- interface [Conditional=SVG&FILTERS] SVGFECompositeElement : SVGElement,
- SVGFilterPrimitiveStandardAttributes {
+ interface [
+ Conditional=SVG&FILTERS,
+ DontCheckEnums
+ ] SVGFECompositeElement : SVGElement,
+ SVGFilterPrimitiveStandardAttributes {
// Composite Operators
const unsigned short SVG_FECOMPOSITE_OPERATOR_UNKNOWN = 0;
const unsigned short SVG_FECOMPOSITE_OPERATOR_OVER = 1;
diff --git a/WebCore/svg/SVGFEConvolveMatrixElement.idl b/WebCore/svg/SVGFEConvolveMatrixElement.idl
index 5be4c33..afe859d 100644
--- a/WebCore/svg/SVGFEConvolveMatrixElement.idl
+++ b/WebCore/svg/SVGFEConvolveMatrixElement.idl
@@ -25,8 +25,12 @@
module svg {
- interface [Conditional=SVG&FILTERS, GenerateConstructor] SVGFEConvolveMatrixElement : SVGElement,
- SVGFilterPrimitiveStandardAttributes {
+ interface [
+ Conditional=SVG&FILTERS,
+ GenerateConstructor,
+ DontCheckEnums
+ ] SVGFEConvolveMatrixElement : SVGElement,
+ SVGFilterPrimitiveStandardAttributes {
// Edge Mode Values
const unsigned short SVG_EDGEMODE_UNKNOWN = 0;
const unsigned short SVG_EDGEMODE_DUPLICATE = 1;
diff --git a/WebCore/svg/SVGFEDisplacementMapElement.idl b/WebCore/svg/SVGFEDisplacementMapElement.idl
index b003e8f..1eb9440 100644
--- a/WebCore/svg/SVGFEDisplacementMapElement.idl
+++ b/WebCore/svg/SVGFEDisplacementMapElement.idl
@@ -25,8 +25,11 @@
module svg {
- interface [Conditional=SVG&FILTERS] SVGFEDisplacementMapElement : SVGElement,
- SVGFilterPrimitiveStandardAttributes {
+ interface [
+ Conditional=SVG&FILTERS,
+ DontCheckEnums
+ ] SVGFEDisplacementMapElement : SVGElement,
+ SVGFilterPrimitiveStandardAttributes {
// Channel Selectors
const unsigned short SVG_CHANNEL_UNKNOWN = 0;
const unsigned short SVG_CHANNEL_R = 1;
diff --git a/WebCore/svg/SVGFEImageElement.cpp b/WebCore/svg/SVGFEImageElement.cpp
index 84f8734..1f7164f 100644
--- a/WebCore/svg/SVGFEImageElement.cpp
+++ b/WebCore/svg/SVGFEImageElement.cpp
@@ -29,6 +29,7 @@
#include "DocLoader.h"
#include "Document.h"
#include "RenderObject.h"
+#include "RenderSVGResource.h"
#include "SVGLength.h"
#include "SVGNames.h"
#include "SVGPreserveAspectRatio.h"
@@ -107,7 +108,16 @@ void SVGFEImageElement::synchronizeProperty(const QualifiedName& attrName)
void SVGFEImageElement::notifyFinished(CachedResource*)
{
- SVGStyledElement::invalidateResourcesInAncestorChain();
+ if (!inDocument())
+ return;
+
+ Element* parent = parentElement();
+ ASSERT(parent);
+
+ if (!parent->hasTagName(SVGNames::filterTag) || !parent->renderer())
+ return;
+
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(parent->renderer());
}
PassRefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*)
diff --git a/WebCore/svg/SVGFEMorphologyElement.idl b/WebCore/svg/SVGFEMorphologyElement.idl
index ffd2289..64023e8 100644
--- a/WebCore/svg/SVGFEMorphologyElement.idl
+++ b/WebCore/svg/SVGFEMorphologyElement.idl
@@ -25,8 +25,11 @@
module svg {
- interface [Conditional=SVG&FILTERS] SVGFEMorphologyElement : SVGElement,
- SVGFilterPrimitiveStandardAttributes {
+ interface [
+ Conditional=SVG&FILTERS,
+ DontCheckEnums
+ ] SVGFEMorphologyElement : SVGElement,
+ SVGFilterPrimitiveStandardAttributes {
// Morphology Operators
const unsigned short SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0;
const unsigned short SVG_MORPHOLOGY_OPERATOR_ERODE = 1;
diff --git a/WebCore/svg/SVGFETurbulenceElement.idl b/WebCore/svg/SVGFETurbulenceElement.idl
index 934eddf..f011d99 100644
--- a/WebCore/svg/SVGFETurbulenceElement.idl
+++ b/WebCore/svg/SVGFETurbulenceElement.idl
@@ -25,8 +25,11 @@
module svg {
- interface [Conditional=SVG&FILTERS] SVGFETurbulenceElement : SVGElement,
- SVGFilterPrimitiveStandardAttributes {
+ interface [
+ Conditional=SVG&FILTERS,
+ DontCheckEnums
+ ] SVGFETurbulenceElement : SVGElement,
+ SVGFilterPrimitiveStandardAttributes {
// Turbulence Types
const unsigned short SVG_TURBULENCE_TYPE_UNKNOWN = 0;
const unsigned short SVG_TURBULENCE_TYPE_FRACTALNOISE = 1;
diff --git a/WebCore/svg/SVGFilterElement.cpp b/WebCore/svg/SVGFilterElement.cpp
index b86b8c4..4387e71 100644
--- a/WebCore/svg/SVGFilterElement.cpp
+++ b/WebCore/svg/SVGFilterElement.cpp
@@ -62,8 +62,11 @@ SVGFilterElement::~SVGFilterElement()
{
}
-void SVGFilterElement::setFilterRes(unsigned long, unsigned long) const
+void SVGFilterElement::setFilterRes(unsigned long filterResX, unsigned long filterResY)
{
+ setFilterResXBaseValue(filterResX);
+ setFilterResYBaseValue(filterResY);
+ invalidateResourceClients();
}
void SVGFilterElement::parseMappedAttribute(Attribute* attr)
@@ -122,10 +125,10 @@ void SVGFilterElement::svgAttributeChanged(const QualifiedName& attrName)
|| attrName == SVGNames::filterUnitsAttr
|| attrName == SVGNames::primitiveUnitsAttr
|| attrName == SVGNames::filterResAttr
+ || SVGStyledElement::isKnownAttribute(attrName)
|| SVGURIReference::isKnownAttribute(attrName)
|| SVGLangSpace::isKnownAttribute(attrName)
- || SVGExternalResourcesRequired::isKnownAttribute(attrName)
- || SVGStyledElement::isKnownAttribute(attrName))
+ || SVGExternalResourcesRequired::isKnownAttribute(attrName))
invalidateResourceClients();
}
@@ -168,6 +171,14 @@ void SVGFilterElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeHref();
}
+void SVGFilterElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
+{
+ SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
+
+ if (!changedByParser)
+ invalidateResourceClients();
+}
+
FloatRect SVGFilterElement::filterBoundingBox(const FloatRect& objectBoundingBox) const
{
FloatRect filterBBox;
diff --git a/WebCore/svg/SVGFilterElement.h b/WebCore/svg/SVGFilterElement.h
index 85679c7..7b0192c 100644
--- a/WebCore/svg/SVGFilterElement.h
+++ b/WebCore/svg/SVGFilterElement.h
@@ -43,12 +43,13 @@ public:
SVGFilterElement(const QualifiedName&, Document*);
virtual ~SVGFilterElement();
- void setFilterRes(unsigned long filterResX, unsigned long filterResY) const;
+ void setFilterRes(unsigned long filterResX, unsigned long filterResY);
FloatRect filterBoundingBox(const FloatRect&) const;
virtual void parseMappedAttribute(Attribute*);
virtual void svgAttributeChanged(const QualifiedName&);
virtual void synchronizeProperty(const QualifiedName&);
+ virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
diff --git a/WebCore/svg/SVGFont.cpp b/WebCore/svg/SVGFont.cpp
index 5436688..6abea60 100644
--- a/WebCore/svg/SVGFont.cpp
+++ b/WebCore/svg/SVGFont.cpp
@@ -413,7 +413,7 @@ static float floatWidthOfSubStringUsingSVGFont(const Font* font, const TextRun&
}
SVGTextRunWalker<SVGTextRunWalkerMeasuredLengthData> runWalker(fontData, fontElement, data, floatWidthUsingSVGFontCallback, floatWidthMissingGlyphCallback);
- runWalker.walk(run, isVerticalText, language, 0, run.length());
+ runWalker.walk(run, isVerticalText, language, from, to);
charsConsumed = data.charsConsumed;
glyphName = data.glyphName;
return data.length;
diff --git a/WebCore/svg/SVGForeignObjectElement.cpp b/WebCore/svg/SVGForeignObjectElement.cpp
index d6bf1cf..7ffe1c6 100644
--- a/WebCore/svg/SVGForeignObjectElement.cpp
+++ b/WebCore/svg/SVGForeignObjectElement.cpp
@@ -28,6 +28,7 @@
#include "Attribute.h"
#include "CSSPropertyNames.h"
#include "RenderForeignObject.h"
+#include "RenderSVGResource.h"
#include "SVGLength.h"
#include "SVGNames.h"
#include <wtf/Assertions.h>
@@ -90,7 +91,7 @@ void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName)
if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
renderer->setNeedsTransformUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
@@ -98,7 +99,7 @@ void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName)
|| SVGTests::isKnownAttribute(attrName)
|| SVGLangSpace::isKnownAttribute(attrName)
|| SVGExternalResourcesRequired::isKnownAttribute(attrName))
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
void SVGForeignObjectElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGGElement.cpp b/WebCore/svg/SVGGElement.cpp
index eceac41..a830096 100644
--- a/WebCore/svg/SVGGElement.cpp
+++ b/WebCore/svg/SVGGElement.cpp
@@ -24,6 +24,7 @@
#include "SVGGElement.h"
#include "RenderSVGHiddenContainer.h"
+#include "RenderSVGResource.h"
#include "RenderSVGTransformableContainer.h"
namespace WebCore {
@@ -62,14 +63,14 @@ void SVGGElement::svgAttributeChanged(const QualifiedName& attrName)
if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
renderer->setNeedsTransformUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
if (SVGTests::isKnownAttribute(attrName)
|| SVGLangSpace::isKnownAttribute(attrName)
|| SVGExternalResourcesRequired::isKnownAttribute(attrName))
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
void SVGGElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGGlyphElement.cpp b/WebCore/svg/SVGGlyphElement.cpp
index d5b7531..054db11 100644
--- a/WebCore/svg/SVGGlyphElement.cpp
+++ b/WebCore/svg/SVGGlyphElement.cpp
@@ -29,7 +29,7 @@
#include "SVGFontElement.h"
#include "SVGFontFaceElement.h"
#include "SVGNames.h"
-#include "SVGParserUtilities.h"
+#include "SVGPathBuilder.h"
#include "SimpleFontData.h"
#include "XMLNames.h"
@@ -102,7 +102,9 @@ static inline SVGGlyphIdentifier::Orientation parseOrientation(const AtomicStrin
static inline Path parsePathData(const AtomicString& value)
{
Path result;
- pathFromSVGData(result, value);
+ SVGPathBuilder builder(result);
+ // FIXME: We should analyse the returned value.
+ builder.build(value);
return result;
}
diff --git a/WebCore/svg/SVGGradientElement.idl b/WebCore/svg/SVGGradientElement.idl
index 7485780..16ac636 100644
--- a/WebCore/svg/SVGGradientElement.idl
+++ b/WebCore/svg/SVGGradientElement.idl
@@ -25,11 +25,14 @@
module svg {
- interface [Conditional=SVG] SVGGradientElement : SVGElement,
- SVGURIReference,
- SVGExternalResourcesRequired,
- SVGStylable
- /* SVGUnitTypes */ {
+ interface [
+ Conditional=SVG,
+ DontCheckEnums
+ ] SVGGradientElement : SVGElement,
+ SVGURIReference,
+ SVGExternalResourcesRequired,
+ SVGStylable
+ /* SVGUnitTypes */ {
// Spread Method Types
const unsigned short SVG_SPREADMETHOD_UNKNOWN = 0;
const unsigned short SVG_SPREADMETHOD_PAD = 1;
diff --git a/WebCore/svg/SVGImageElement.cpp b/WebCore/svg/SVGImageElement.cpp
index 711e9f3..75f05cf 100644
--- a/WebCore/svg/SVGImageElement.cpp
+++ b/WebCore/svg/SVGImageElement.cpp
@@ -27,6 +27,7 @@
#include "Attribute.h"
#include "CSSPropertyNames.h"
#include "RenderSVGImage.h"
+#include "RenderSVGResource.h"
#include "SVGDocument.h"
#include "SVGLength.h"
#include "SVGPreserveAspectRatio.h"
@@ -105,7 +106,7 @@ void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName)
if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
renderer->setNeedsTransformUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
@@ -114,7 +115,7 @@ void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName)
|| SVGTests::isKnownAttribute(attrName)
|| SVGLangSpace::isKnownAttribute(attrName)
|| SVGExternalResourcesRequired::isKnownAttribute(attrName))
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
void SVGImageElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGLineElement.cpp b/WebCore/svg/SVGLineElement.cpp
index c6e5e04..0898319 100644
--- a/WebCore/svg/SVGLineElement.cpp
+++ b/WebCore/svg/SVGLineElement.cpp
@@ -26,6 +26,7 @@
#include "Attribute.h"
#include "FloatPoint.h"
#include "RenderPath.h"
+#include "RenderSVGResource.h"
#include "SVGLength.h"
#include "SVGNames.h"
@@ -86,20 +87,20 @@ void SVGLineElement::svgAttributeChanged(const QualifiedName& attrName)
if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
renderer->setNeedsTransformUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
if (isLengthAttribute) {
renderer->setNeedsPathUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
if (SVGTests::isKnownAttribute(attrName)
|| SVGLangSpace::isKnownAttribute(attrName)
|| SVGExternalResourcesRequired::isKnownAttribute(attrName))
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
void SVGLineElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGPaint.cpp b/WebCore/svg/SVGPaint.cpp
index 82a5fe4..6d60979 100644
--- a/WebCore/svg/SVGPaint.cpp
+++ b/WebCore/svg/SVGPaint.cpp
@@ -1,6 +1,7 @@
/*
- Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
+ Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
2004, 2005, 2006, 2007 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,8 +20,10 @@
*/
#include "config.h"
+
#if ENABLE(SVG)
#include "SVGPaint.h"
+#include "SVGURIReference.h"
namespace WebCore {
@@ -108,8 +111,14 @@ String SVGPaint::cssText() const
return SVGColor::cssText();
}
+bool SVGPaint::matchesTargetURI(const String& referenceId)
+{
+ if (m_paintType != SVG_PAINTTYPE_URI && m_paintType != SVG_PAINTTYPE_URI_RGBCOLOR)
+ return false;
+
+ return referenceId == SVGURIReference::getTarget(m_uri);
+}
+
}
-// vim:ts=4:noet
#endif // ENABLE(SVG)
-
diff --git a/WebCore/svg/SVGPaint.h b/WebCore/svg/SVGPaint.h
index 032f715..aa696d1 100644
--- a/WebCore/svg/SVGPaint.h
+++ b/WebCore/svg/SVGPaint.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
+ Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
Copyright (C) 2006 Samuel Weinig (sam.weinig@gmial.com)
@@ -78,6 +78,8 @@ namespace WebCore {
static SVGPaint* defaultFill();
static SVGPaint* defaultStroke();
+ bool matchesTargetURI(const String& referenceId);
+
private:
SVGPaint();
SVGPaint(const String& uri);
@@ -96,5 +98,3 @@ namespace WebCore {
#endif // ENABLE(SVG)
#endif // SVGPaint_h
-
-// vim:ts=4:noet
diff --git a/WebCore/svg/SVGParserUtilities.cpp b/WebCore/svg/SVGParserUtilities.cpp
index c722232..14e3d58 100644
--- a/WebCore/svg/SVGParserUtilities.cpp
+++ b/WebCore/svg/SVGParserUtilities.cpp
@@ -21,31 +21,16 @@
*/
#include "config.h"
+
#if ENABLE(SVG)
#include "SVGParserUtilities.h"
+#include "Document.h"
#include "ExceptionCode.h"
-#include "FloatConversion.h"
#include "FloatPoint.h"
-#include "Path.h"
#include "PlatformString.h"
-#include "SVGPathSegList.h"
-#include "SVGPathSegArc.h"
-#include "SVGPathSegClosePath.h"
-#include "SVGPathSegCurvetoCubic.h"
-#include "SVGPathSegCurvetoCubicSmooth.h"
-#include "SVGPathSegCurvetoQuadratic.h"
-#include "SVGPathSegCurvetoQuadraticSmooth.h"
-#include "SVGPathSegLineto.h"
-#include "SVGPathSegLinetoHorizontal.h"
-#include "SVGPathSegLinetoVertical.h"
-#include "SVGPathSegList.h"
-#include "SVGPathSegMoveto.h"
#include "SVGPointList.h"
-#include "SVGPathElement.h"
-#include <math.h>
#include <wtf/ASCIICType.h>
-#include <wtf/MathExtras.h>
namespace WebCore {
@@ -135,15 +120,9 @@ bool parseNumber(const UChar*& ptr, const UChar* end, float& number, bool skip)
return _parseNumber(ptr, end, number, skip);
}
-// Only used for parsing Paths
-static bool parseNumber(const UChar*& ptr, const UChar* end, double& number, bool skip = true)
-{
- return _parseNumber(ptr, end, number, skip);
-}
-
// only used to parse largeArcFlag and sweepFlag which must be a "0" or "1"
// and might not have any whitespace/comma after it
-static bool parseArcFlag(const UChar*& ptr, const UChar* end, bool& flag)
+bool parseArcFlag(const UChar*& ptr, const UChar* end, bool& flag)
{
const UChar flagChar = *ptr++;
if (flagChar == '0')
@@ -210,637 +189,6 @@ bool pointsListFromSVGData(SVGPointList* pointsList, const String& points)
return cur == end && !delimParsed;
}
- /**
- * Parser for svg path data, contained in the d attribute.
- *
- * The parser delivers encountered commands and parameters by calling
- * methods that correspond to those commands. Clients have to derive
- * from this class and implement the abstract command methods.
- *
- * There are two operating modes. By default the parser just delivers unaltered
- * svg path data commands and parameters. In the second mode, it will convert all
- * relative coordinates to absolute ones, and convert all curves to cubic beziers.
- */
- class SVGPathParser {
- public:
- virtual ~SVGPathParser() { }
- bool parseSVG(const String& d, bool process = false);
-
- protected:
- virtual void svgMoveTo(double x1, double y1, bool closed, bool abs = true) = 0;
- virtual void svgLineTo(double x1, double y1, bool abs = true) = 0;
- virtual void svgLineToHorizontal(double, bool /*abs*/ = true) { }
- virtual void svgLineToVertical(double /*y*/, bool /*abs*/ = true) { }
- virtual void svgCurveToCubic(double x1, double y1, double x2, double y2, double x, double y, bool abs = true) = 0;
- virtual void svgCurveToCubicSmooth(double /*x*/, double /*y*/, double /*x2*/, double /*y2*/, bool /*abs*/ = true) { }
- virtual void svgCurveToQuadratic(double /*x*/, double /*y*/, double /*x1*/, double /*y1*/, bool /*abs*/ = true) { }
- virtual void svgCurveToQuadraticSmooth(double /*x*/, double /*y*/, bool /*abs*/ = true) { }
- virtual void svgArcTo(double /*x*/, double /*y*/, double /*r1*/, double /*r2*/, double /*angle*/, bool /*largeArcFlag*/, bool /*sweepFlag*/, bool /*abs*/ = true) { }
- virtual void svgClosePath() = 0;
-
- private:
- void calculateArc(bool relative, double& curx, double& cury, double angle, double x, double y, double r1, double r2, bool largeArcFlag, bool sweepFlag);
- };
-
-bool SVGPathParser::parseSVG(const String& s, bool process)
-{
- const UChar* ptr = s.characters();
- const UChar* end = ptr + s.length();
-
- double contrlx, contrly, curx, cury, subpathx, subpathy, tox, toy, x1, y1, x2, y2, xc, yc;
- double px1, py1, px2, py2, px3, py3;
- bool closed = true;
-
- if (!skipOptionalSpaces(ptr, end)) // skip any leading spaces
- return false;
-
- char command = *(ptr++), lastCommand = ' ';
- if (command != 'm' && command != 'M') // path must start with moveto
- return false;
-
- subpathx = subpathy = curx = cury = contrlx = contrly = 0.0;
- while (1) {
- skipOptionalSpaces(ptr, end); // skip spaces between command and first coord
-
- bool relative = false;
-
- switch (command)
- {
- case 'm':
- relative = true;
- case 'M':
- {
- if (!parseNumber(ptr, end, tox) || !parseNumber(ptr, end, toy))
- return false;
-
- if (process) {
- subpathx = curx = relative ? curx + tox : tox;
- subpathy = cury = relative ? cury + toy : toy;
-
- svgMoveTo(narrowPrecisionToFloat(curx), narrowPrecisionToFloat(cury), closed);
- } else
- svgMoveTo(narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), closed, !relative);
- closed = false;
- break;
- }
- case 'l':
- relative = true;
- case 'L':
- {
- if (!parseNumber(ptr, end, tox) || !parseNumber(ptr, end, toy))
- return false;
-
- if (process) {
- curx = relative ? curx + tox : tox;
- cury = relative ? cury + toy : toy;
-
- svgLineTo(narrowPrecisionToFloat(curx), narrowPrecisionToFloat(cury));
- }
- else
- svgLineTo(narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), !relative);
- break;
- }
- case 'h':
- {
- if (!parseNumber(ptr, end, tox))
- return false;
- if (process) {
- curx = curx + tox;
- svgLineTo(narrowPrecisionToFloat(curx), narrowPrecisionToFloat(cury));
- }
- else
- svgLineToHorizontal(narrowPrecisionToFloat(tox), false);
- break;
- }
- case 'H':
- {
- if (!parseNumber(ptr, end, tox))
- return false;
- if (process) {
- curx = tox;
- svgLineTo(narrowPrecisionToFloat(curx), narrowPrecisionToFloat(cury));
- }
- else
- svgLineToHorizontal(narrowPrecisionToFloat(tox));
- break;
- }
- case 'v':
- {
- if (!parseNumber(ptr, end, toy))
- return false;
- if (process) {
- cury = cury + toy;
- svgLineTo(narrowPrecisionToFloat(curx), narrowPrecisionToFloat(cury));
- }
- else
- svgLineToVertical(narrowPrecisionToFloat(toy), false);
- break;
- }
- case 'V':
- {
- if (!parseNumber(ptr, end, toy))
- return false;
- if (process) {
- cury = toy;
- svgLineTo(narrowPrecisionToFloat(curx), narrowPrecisionToFloat(cury));
- }
- else
- svgLineToVertical(narrowPrecisionToFloat(toy));
- break;
- }
- case 'z':
- case 'Z':
- {
- // reset curx, cury for next path
- if (process) {
- curx = subpathx;
- cury = subpathy;
- }
- closed = true;
- svgClosePath();
- break;
- }
- case 'c':
- relative = true;
- case 'C':
- {
- if (!parseNumber(ptr, end, x1) || !parseNumber(ptr, end, y1) ||
- !parseNumber(ptr, end, x2) || !parseNumber(ptr, end, y2) ||
- !parseNumber(ptr, end, tox) || !parseNumber(ptr, end, toy))
- return false;
-
- if (process) {
- px1 = relative ? curx + x1 : x1;
- py1 = relative ? cury + y1 : y1;
- px2 = relative ? curx + x2 : x2;
- py2 = relative ? cury + y2 : y2;
- px3 = relative ? curx + tox : tox;
- py3 = relative ? cury + toy : toy;
-
- svgCurveToCubic(narrowPrecisionToFloat(px1), narrowPrecisionToFloat(py1), narrowPrecisionToFloat(px2),
- narrowPrecisionToFloat(py2), narrowPrecisionToFloat(px3), narrowPrecisionToFloat(py3));
-
- contrlx = relative ? curx + x2 : x2;
- contrly = relative ? cury + y2 : y2;
- curx = relative ? curx + tox : tox;
- cury = relative ? cury + toy : toy;
- }
- else
- svgCurveToCubic(narrowPrecisionToFloat(x1), narrowPrecisionToFloat(y1), narrowPrecisionToFloat(x2),
- narrowPrecisionToFloat(y2), narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), !relative);
-
- break;
- }
- case 's':
- relative = true;
- case 'S':
- {
- if (!parseNumber(ptr, end, x2) || !parseNumber(ptr, end, y2) ||
- !parseNumber(ptr, end, tox) || !parseNumber(ptr, end, toy))
- return false;
-
- if (!(lastCommand == 'c' || lastCommand == 'C' ||
- lastCommand == 's' || lastCommand == 'S')) {
- contrlx = curx;
- contrly = cury;
- }
-
- if (process) {
- px1 = 2 * curx - contrlx;
- py1 = 2 * cury - contrly;
- px2 = relative ? curx + x2 : x2;
- py2 = relative ? cury + y2 : y2;
- px3 = relative ? curx + tox : tox;
- py3 = relative ? cury + toy : toy;
-
- svgCurveToCubic(narrowPrecisionToFloat(px1), narrowPrecisionToFloat(py1), narrowPrecisionToFloat(px2),
- narrowPrecisionToFloat(py2), narrowPrecisionToFloat(px3), narrowPrecisionToFloat(py3));
-
- contrlx = relative ? curx + x2 : x2;
- contrly = relative ? cury + y2 : y2;
- curx = relative ? curx + tox : tox;
- cury = relative ? cury + toy : toy;
- }
- else
- svgCurveToCubicSmooth(narrowPrecisionToFloat(x2), narrowPrecisionToFloat(y2),
- narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), !relative);
- break;
- }
- case 'q':
- relative = true;
- case 'Q':
- {
- if (!parseNumber(ptr, end, x1) || !parseNumber(ptr, end, y1) ||
- !parseNumber(ptr, end, tox) || !parseNumber(ptr, end, toy))
- return false;
-
- if (process) {
- px1 = relative ? (curx + 2 * (x1 + curx)) * (1.0 / 3.0) : (curx + 2 * x1) * (1.0 / 3.0);
- py1 = relative ? (cury + 2 * (y1 + cury)) * (1.0 / 3.0) : (cury + 2 * y1) * (1.0 / 3.0);
- px2 = relative ? ((curx + tox) + 2 * (x1 + curx)) * (1.0 / 3.0) : (tox + 2 * x1) * (1.0 / 3.0);
- py2 = relative ? ((cury + toy) + 2 * (y1 + cury)) * (1.0 / 3.0) : (toy + 2 * y1) * (1.0 / 3.0);
- px3 = relative ? curx + tox : tox;
- py3 = relative ? cury + toy : toy;
-
- svgCurveToCubic(narrowPrecisionToFloat(px1), narrowPrecisionToFloat(py1), narrowPrecisionToFloat(px2),
- narrowPrecisionToFloat(py2), narrowPrecisionToFloat(px3), narrowPrecisionToFloat(py3));
-
- contrlx = relative ? curx + x1 : x1;
- contrly = relative ? cury + y1 : y1;
- curx = relative ? curx + tox : tox;
- cury = relative ? cury + toy : toy;
- }
- else
- svgCurveToQuadratic(narrowPrecisionToFloat(x1), narrowPrecisionToFloat(y1),
- narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), !relative);
- break;
- }
- case 't':
- relative = true;
- case 'T':
- {
- if (!parseNumber(ptr, end, tox) || !parseNumber(ptr, end, toy))
- return false;
- if (!(lastCommand == 'q' || lastCommand == 'Q' ||
- lastCommand == 't' || lastCommand == 'T')) {
- contrlx = curx;
- contrly = cury;
- }
-
- if (process) {
- xc = 2 * curx - contrlx;
- yc = 2 * cury - contrly;
-
- px1 = relative ? (curx + 2 * xc) * (1.0 / 3.0) : (curx + 2 * xc) * (1.0 / 3.0);
- py1 = relative ? (cury + 2 * yc) * (1.0 / 3.0) : (cury + 2 * yc) * (1.0 / 3.0);
- px2 = relative ? ((curx + tox) + 2 * xc) * (1.0 / 3.0) : (tox + 2 * xc) * (1.0 / 3.0);
- py2 = relative ? ((cury + toy) + 2 * yc) * (1.0 / 3.0) : (toy + 2 * yc) * (1.0 / 3.0);
- px3 = relative ? curx + tox : tox;
- py3 = relative ? cury + toy : toy;
-
- svgCurveToCubic(narrowPrecisionToFloat(px1), narrowPrecisionToFloat(py1), narrowPrecisionToFloat(px2),
- narrowPrecisionToFloat(py2), narrowPrecisionToFloat(px3), narrowPrecisionToFloat(py3));
-
- contrlx = xc;
- contrly = yc;
- curx = relative ? curx + tox : tox;
- cury = relative ? cury + toy : toy;
- }
- else
- svgCurveToQuadraticSmooth(narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), !relative);
- break;
- }
- case 'a':
- relative = true;
- case 'A':
- {
- bool largeArc, sweep;
- double angle, rx, ry;
- if (!parseNumber(ptr, end, rx) || !parseNumber(ptr, end, ry)
- || !parseNumber(ptr, end, angle)
- || !parseArcFlag(ptr, end, largeArc) || !parseArcFlag(ptr, end, sweep)
- || !parseNumber(ptr, end, tox) || !parseNumber(ptr, end, toy))
- return false;
-
- // Spec: radii are nonnegative numbers
- rx = fabs(rx);
- ry = fabs(ry);
-
- if (process)
- calculateArc(relative, curx, cury, angle, tox, toy, rx, ry, largeArc, sweep);
- else
- svgArcTo(narrowPrecisionToFloat(tox), narrowPrecisionToFloat(toy), narrowPrecisionToFloat(rx), narrowPrecisionToFloat(ry),
- narrowPrecisionToFloat(angle), largeArc, sweep, !relative);
- break;
- }
- default:
- // FIXME: An error should go to the JavaScript console, or the like.
- return false;
- }
- lastCommand = command;
-
- if (ptr >= end)
- return true;
-
- // Check for remaining coordinates in the current command.
- if ((*ptr == '+' || *ptr == '-' || *ptr == '.' || (*ptr >= '0' && *ptr <= '9'))
- && (command != 'z' && command != 'Z')) {
- if (command == 'M')
- command = 'L';
- else if (command == 'm')
- command = 'l';
- } else
- command = *(ptr++);
-
- if (lastCommand != 'C' && lastCommand != 'c' &&
- lastCommand != 'S' && lastCommand != 's' &&
- lastCommand != 'Q' && lastCommand != 'q' &&
- lastCommand != 'T' && lastCommand != 't') {
- contrlx = curx;
- contrly = cury;
- }
- }
-
- return false;
-}
-
-// This works by converting the SVG arc to "simple" beziers.
-// For each bezier found a svgToCurve call is done.
-// Adapted from Niko's code in kdelibs/kdecore/svgicons.
-// Maybe this can serve in some shared lib? (Rob)
-void SVGPathParser::calculateArc(bool relative, double& curx, double& cury, double angle, double x, double y, double r1, double r2, bool largeArcFlag, bool sweepFlag)
-{
- double sin_th, cos_th;
- double a00, a01, a10, a11;
- double x0, y0, x1, y1, xc, yc;
- double d, sfactor, sfactor_sq;
- double th0, th1, th_arc;
- int i, n_segs;
-
- sin_th = sin(angle * (piDouble / 180.0));
- cos_th = cos(angle * (piDouble / 180.0));
-
- double dx;
-
- if (!relative)
- dx = (curx - x) / 2.0;
- else
- dx = -x / 2.0;
-
- double dy;
-
- if (!relative)
- dy = (cury - y) / 2.0;
- else
- dy = -y / 2.0;
-
- double _x1 = cos_th * dx + sin_th * dy;
- double _y1 = -sin_th * dx + cos_th * dy;
- double Pr1 = r1 * r1;
- double Pr2 = r2 * r2;
- double Px = _x1 * _x1;
- double Py = _y1 * _y1;
-
- // Spec : check if radii are large enough
- double check = Px / Pr1 + Py / Pr2;
- if (check > 1) {
- r1 = r1 * sqrt(check);
- r2 = r2 * sqrt(check);
- }
-
- a00 = cos_th / r1;
- a01 = sin_th / r1;
- a10 = -sin_th / r2;
- a11 = cos_th / r2;
-
- x0 = a00 * curx + a01 * cury;
- y0 = a10 * curx + a11 * cury;
-
- if (!relative)
- x1 = a00 * x + a01 * y;
- else
- x1 = a00 * (curx + x) + a01 * (cury + y);
-
- if (!relative)
- y1 = a10 * x + a11 * y;
- else
- y1 = a10 * (curx + x) + a11 * (cury + y);
-
- /* (x0, y0) is current point in transformed coordinate space.
- (x1, y1) is new point in transformed coordinate space.
-
- The arc fits a unit-radius circle in this space.
- */
-
- d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);
-
- sfactor_sq = 1.0 / d - 0.25;
-
- if (sfactor_sq < 0)
- sfactor_sq = 0;
-
- sfactor = sqrt(sfactor_sq);
-
- if (sweepFlag == largeArcFlag)
- sfactor = -sfactor;
-
- xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);
- yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);
-
- /* (xc, yc) is center of the circle. */
- th0 = atan2(y0 - yc, x0 - xc);
- th1 = atan2(y1 - yc, x1 - xc);
-
- th_arc = th1 - th0;
- if (th_arc < 0 && sweepFlag)
- th_arc += 2 * piDouble;
- else if (th_arc > 0 && !sweepFlag)
- th_arc -= 2 * piDouble;
-
- n_segs = (int) (int) ceil(fabs(th_arc / (piDouble * 0.5 + 0.001)));
-
- for (i = 0; i < n_segs; i++) {
- double sin_th, cos_th;
- double a00, a01, a10, a11;
- double x1, y1, x2, y2, x3, y3;
- double t;
- double th_half;
-
- double _th0 = th0 + i * th_arc / n_segs;
- double _th1 = th0 + (i + 1) * th_arc / n_segs;
-
- sin_th = sin(angle * (piDouble / 180.0));
- cos_th = cos(angle * (piDouble / 180.0));
-
- /* inverse transform compared with rsvg_path_arc */
- a00 = cos_th * r1;
- a01 = -sin_th * r2;
- a10 = sin_th * r1;
- a11 = cos_th * r2;
-
- th_half = 0.5 * (_th1 - _th0);
- t = (8.0 / 3.0) * sin(th_half * 0.5) * sin(th_half * 0.5) / sin(th_half);
- x1 = xc + cos(_th0) - t * sin(_th0);
- y1 = yc + sin(_th0) + t * cos(_th0);
- x3 = xc + cos(_th1);
- y3 = yc + sin(_th1);
- x2 = x3 + t * sin(_th1);
- y2 = y3 - t * cos(_th1);
-
- svgCurveToCubic(narrowPrecisionToFloat(a00 * x1 + a01 * y1), narrowPrecisionToFloat(a10 * x1 + a11 * y1),
- narrowPrecisionToFloat(a00 * x2 + a01 * y2), narrowPrecisionToFloat(a10 * x2 + a11 * y2),
- narrowPrecisionToFloat(a00 * x3 + a01 * y3), narrowPrecisionToFloat(a10 * x3 + a11 * y3));
- }
-
- if (!relative)
- curx = x;
- else
- curx += x;
-
- if (!relative)
- cury = y;
- else
- cury += y;
-}
-
-class PathBuilder : private SVGPathParser {
-public:
- bool build(Path* path, const String& d)
- {
- Path temporaryPath;
- m_path = &temporaryPath;
- if (!parseSVG(d, true))
- return false;
- temporaryPath.swap(*path);
- return true;
- }
-
-private:
- virtual void svgMoveTo(double x1, double y1, bool closed, bool abs = true)
- {
- current.setX(narrowPrecisionToFloat(abs ? x1 : current.x() + x1));
- current.setY(narrowPrecisionToFloat(abs ? y1 : current.y() + y1));
- if (closed)
- m_path->closeSubpath();
- m_path->moveTo(current);
- }
- virtual void svgLineTo(double x1, double y1, bool abs = true)
- {
- current.setX(narrowPrecisionToFloat(abs ? x1 : current.x() + x1));
- current.setY(narrowPrecisionToFloat(abs ? y1 : current.y() + y1));
- m_path->addLineTo(current);
- }
- virtual void svgCurveToCubic(double x1, double y1, double x2, double y2, double x, double y, bool abs = true)
- {
- if (!abs) {
- x1 += current.x();
- y1 += current.y();
- x2 += current.x();
- y2 += current.y();
- }
- current.setX(narrowPrecisionToFloat(abs ? x : current.x() + x));
- current.setY(narrowPrecisionToFloat(abs ? y : current.y() + y));
- m_path->addBezierCurveTo(FloatPoint::narrowPrecision(x1, y1), FloatPoint::narrowPrecision(x2, y2), current);
- }
- virtual void svgClosePath()
- {
- m_path->closeSubpath();
- }
-
- Path* m_path;
- FloatPoint current;
-};
-
-bool pathFromSVGData(Path& path, const String& d)
-{
- PathBuilder builder;
- return builder.build(&path, d);
-}
-
-class SVGPathSegListBuilder : private SVGPathParser {
-public:
- bool build(SVGPathSegList* segList, const String& d, bool process)
- {
- bool result = parseSVG(d, process);
- size_t size = m_vector.size();
- for (size_t i = 0; i < size; ++i) {
- ExceptionCode ec;
- segList->appendItem(m_vector[i].release(), ec);
- }
- m_vector.clear();
- return result;
- }
-
-private:
- virtual void svgMoveTo(double x1, double y1, bool, bool abs = true)
- {
- if (abs)
- m_vector.append(SVGPathElement::createSVGPathSegMovetoAbs(narrowPrecisionToFloat(x1), narrowPrecisionToFloat(y1)));
- else
- m_vector.append(SVGPathElement::createSVGPathSegMovetoRel(narrowPrecisionToFloat(x1), narrowPrecisionToFloat(y1)));
- }
- virtual void svgLineTo(double x1, double y1, bool abs = true)
- {
- if (abs)
- m_vector.append(SVGPathElement::createSVGPathSegLinetoAbs(narrowPrecisionToFloat(x1), narrowPrecisionToFloat(y1)));
- else
- m_vector.append(SVGPathElement::createSVGPathSegLinetoRel(narrowPrecisionToFloat(x1), narrowPrecisionToFloat(y1)));
- }
- virtual void svgLineToHorizontal(double x, bool abs)
- {
- if (abs)
- m_vector.append(SVGPathElement::createSVGPathSegLinetoHorizontalAbs(narrowPrecisionToFloat(x)));
- else
- m_vector.append(SVGPathElement::createSVGPathSegLinetoHorizontalRel(narrowPrecisionToFloat(x)));
- }
- virtual void svgLineToVertical(double y, bool abs)
- {
- if (abs)
- m_vector.append(SVGPathElement::createSVGPathSegLinetoVerticalAbs(narrowPrecisionToFloat(y)));
- else
- m_vector.append(SVGPathElement::createSVGPathSegLinetoVerticalRel(narrowPrecisionToFloat(y)));
- }
- virtual void svgCurveToCubic(double x1, double y1, double x2, double y2, double x, double y, bool abs = true)
- {
- if (abs)
- m_vector.append(SVGPathElement::createSVGPathSegCurvetoCubicAbs(narrowPrecisionToFloat(x), narrowPrecisionToFloat(y),
- narrowPrecisionToFloat(x1), narrowPrecisionToFloat(y1),
- narrowPrecisionToFloat(x2), narrowPrecisionToFloat(y2)));
- else
- m_vector.append(SVGPathElement::createSVGPathSegCurvetoCubicRel(narrowPrecisionToFloat(x), narrowPrecisionToFloat(y),
- narrowPrecisionToFloat(x1), narrowPrecisionToFloat(y1),
- narrowPrecisionToFloat(x2), narrowPrecisionToFloat(y2)));
- }
- virtual void svgCurveToCubicSmooth(double x, double y, double x2, double y2, bool abs)
- {
- if (abs)
- m_vector.append(SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs(narrowPrecisionToFloat(x2), narrowPrecisionToFloat(y2),
- narrowPrecisionToFloat(x), narrowPrecisionToFloat(y)));
- else
- m_vector.append(SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel(narrowPrecisionToFloat(x2), narrowPrecisionToFloat(y2),
- narrowPrecisionToFloat(x), narrowPrecisionToFloat(y)));
- }
- virtual void svgCurveToQuadratic(double x, double y, double x1, double y1, bool abs)
- {
- if (abs)
- m_vector.append(SVGPathElement::createSVGPathSegCurvetoQuadraticAbs(narrowPrecisionToFloat(x1), narrowPrecisionToFloat(y1),
- narrowPrecisionToFloat(x), narrowPrecisionToFloat(y)));
- else
- m_vector.append(SVGPathElement::createSVGPathSegCurvetoQuadraticRel(narrowPrecisionToFloat(x1), narrowPrecisionToFloat(y1),
- narrowPrecisionToFloat(x), narrowPrecisionToFloat(y)));
- }
- virtual void svgCurveToQuadraticSmooth(double x, double y, bool abs)
- {
- if (abs)
- m_vector.append(SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs(narrowPrecisionToFloat(x), narrowPrecisionToFloat(y)));
- else
- m_vector.append(SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel(narrowPrecisionToFloat(x), narrowPrecisionToFloat(y)));
- }
- virtual void svgArcTo(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag, bool abs)
- {
- if (abs)
- m_vector.append(SVGPathElement::createSVGPathSegArcAbs(narrowPrecisionToFloat(x), narrowPrecisionToFloat(y),
- narrowPrecisionToFloat(r1), narrowPrecisionToFloat(r2),
- narrowPrecisionToFloat(angle), largeArcFlag, sweepFlag));
- else
- m_vector.append(SVGPathElement::createSVGPathSegArcRel(narrowPrecisionToFloat(x), narrowPrecisionToFloat(y),
- narrowPrecisionToFloat(r1), narrowPrecisionToFloat(r2),
- narrowPrecisionToFloat(angle), largeArcFlag, sweepFlag));
- }
- virtual void svgClosePath()
- {
- m_vector.append(SVGPathElement::createSVGPathSegClosePath());
- }
-
- Vector<RefPtr<SVGPathSeg> > m_vector;
-};
-
-bool pathSegListFromSVGData(SVGPathSegList* path, const String& d, bool process)
-{
- SVGPathSegListBuilder builder;
- return builder.build(path, d, process);
-}
-
bool parseGlyphName(const String& input, HashSet<String>& values)
{
// FIXME: Parsing error detection is missing.
diff --git a/WebCore/svg/SVGParserUtilities.h b/WebCore/svg/SVGParserUtilities.h
index cd6cbbe..69d6b12 100644
--- a/WebCore/svg/SVGParserUtilities.h
+++ b/WebCore/svg/SVGParserUtilities.h
@@ -30,12 +30,11 @@ typedef Vector<UnicodeRange> UnicodeRanges;
namespace WebCore {
- class Path;
class SVGPointList;
- class SVGPathSegList;
bool parseNumber(const UChar*& ptr, const UChar* end, float& number, bool skip = true);
bool parseNumberOptionalNumber(const String& s, float& h, float& v);
+ bool parseArcFlag(const UChar*& ptr, const UChar* end, bool& flag);
// SVG allows several different whitespace characters:
// http://www.w3.org/TR/SVG/paths.html#PathDataBNF
@@ -65,8 +64,6 @@ namespace WebCore {
}
bool pointsListFromSVGData(SVGPointList* pointsList, const String& points);
- bool pathFromSVGData(Path& path, const String& d);
- bool pathSegListFromSVGData(SVGPathSegList* pathSegList, const String& d, bool process = false);
Vector<String> parseDelimitedString(const String& input, const char seperator);
bool parseKerningUnicodeString(const String& input, UnicodeRanges&, HashSet<String>& stringList);
bool parseGlyphName(const String& input, HashSet<String>& values);
diff --git a/WebCore/svg/SVGPathBuilder.cpp b/WebCore/svg/SVGPathBuilder.cpp
new file mode 100644
index 0000000..916c7d0
--- /dev/null
+++ b/WebCore/svg/SVGPathBuilder.cpp
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2002, 2003 The Karbon Developers
+ * 2006 Alexander Kellett <lypanov@kde.org>
+ * 2006, 2007 Rob Buis <buis@kde.org>
+ * Copyrigth (C) 2007, 2009 Apple, Inc. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+
+#if ENABLE(SVG)
+#include "SVGPathBuilder.h"
+
+#include "SVGPathParser.h"
+
+namespace WebCore {
+
+SVGPathBuilder::SVGPathBuilder(Path& path)
+ : m_path(path)
+{
+}
+
+bool SVGPathBuilder::build(const String& d)
+{
+ SVGPathParser parser(this);
+ return parser.parsePathDataString(d, true);
+}
+
+void SVGPathBuilder::moveTo(const FloatPoint& point, bool closed, PathCoordinateMode mode)
+{
+ m_current = mode == AbsoluteCoordinates ? point : m_current + point;
+ if (closed)
+ m_path.closeSubpath();
+ m_path.moveTo(m_current);
+}
+
+void SVGPathBuilder::lineTo(const FloatPoint& point, PathCoordinateMode mode)
+{
+ m_current = mode == AbsoluteCoordinates ? point : m_current + point;
+ m_path.addLineTo(m_current);
+}
+
+void SVGPathBuilder::curveToCubic(const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& point, PathCoordinateMode mode)
+{
+ if (mode == RelativeCoordinates) {
+ m_path.addBezierCurveTo(m_current + point1, m_current + point2, m_current + point);
+ m_current += point;
+ } else {
+ m_current = point;
+ m_path.addBezierCurveTo(point1, point2, m_current);
+ }
+}
+
+void SVGPathBuilder::closePath()
+{
+ m_path.closeSubpath();
+}
+
+}
+
+#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGPathBuilder.h b/WebCore/svg/SVGPathBuilder.h
new file mode 100644
index 0000000..c47e69d
--- /dev/null
+++ b/WebCore/svg/SVGPathBuilder.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2002, 2003 The Karbon Developers
+ * 2006 Alexander Kellett <lypanov@kde.org>
+ * 2006, 2007 Rob Buis <buis@kde.org>
+ * Copyrigth (C) 2007, 2009 Apple, Inc. All rights reserved.
+ * 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 SVGPathBuilder_h
+#define SVGPathBuilder_h
+
+#if ENABLE(SVG)
+#include "FloatPoint.h"
+#include "Path.h"
+#include "SVGPathConsumer.h"
+
+namespace WebCore {
+
+class SVGPathBuilder : private SVGPathConsumer {
+public:
+ SVGPathBuilder(Path&);
+ bool build(const String&);
+
+private:
+ // Used in UnalteredParisng/NormalizedParsing modes.
+ virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode);
+ virtual void lineTo(const FloatPoint&, PathCoordinateMode);
+ virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode);
+ virtual void closePath();
+
+private:
+ // Only used in UnalteredParsing mode.
+ virtual void lineToHorizontal(float, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
+ virtual void lineToVertical(float, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
+ virtual void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
+ virtual void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
+ virtual void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
+ virtual void arcTo(const FloatPoint&, float, float, float, bool, bool, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
+
+ Path& m_path;
+ FloatPoint m_current;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif // SVGPathBuilder_h
diff --git a/WebCore/svg/SVGPathConsumer.h b/WebCore/svg/SVGPathConsumer.h
new file mode 100644
index 0000000..7f2fb39
--- /dev/null
+++ b/WebCore/svg/SVGPathConsumer.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2002, 2003 The Karbon Developers
+ * 2006 Alexander Kellett <lypanov@kde.org>
+ * 2006, 2007 Rob Buis <buis@kde.org>
+ * Copyrigth (C) 2007, 2009 Apple, Inc. All rights reserved.
+ * 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 SVGPathConsumer_h
+#define SVGPathConsumer_h
+
+#if ENABLE(SVG)
+#include "FloatPoint.h"
+
+namespace WebCore {
+
+enum PathCoordinateMode {
+ AbsoluteCoordinates,
+ RelativeCoordinates
+};
+
+enum PathParsingMode {
+ NormalizedParsing,
+ UnalteredParsing
+};
+
+class SVGPathConsumer {
+public:
+ // Used in UnalteredParisng/NormalizedParsing modes.
+ virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode) = 0;
+ virtual void lineTo(const FloatPoint&, PathCoordinateMode) = 0;
+ virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode) = 0;
+ virtual void closePath() = 0;
+
+public:
+ // Only used in UnalteredParsing mode.
+ virtual void lineToHorizontal(float, PathCoordinateMode) = 0;
+ virtual void lineToVertical(float, PathCoordinateMode) = 0;
+ virtual void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCoordinateMode) = 0;
+ virtual void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoordinateMode) = 0;
+ virtual void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) = 0;
+ virtual void arcTo(const FloatPoint&, float, float, float, bool largeArcFlag, bool sweepFlag, PathCoordinateMode) = 0;
+
+protected:
+ SVGPathConsumer() { }
+ virtual ~SVGPathConsumer() { }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif // SVGPathConsumer_h
diff --git a/WebCore/svg/SVGPathElement.cpp b/WebCore/svg/SVGPathElement.cpp
index 40996d1..803ce14 100644
--- a/WebCore/svg/SVGPathElement.cpp
+++ b/WebCore/svg/SVGPathElement.cpp
@@ -25,8 +25,8 @@
#include "Attribute.h"
#include "RenderPath.h"
+#include "RenderSVGResource.h"
#include "SVGNames.h"
-#include "SVGParserUtilities.h"
#include "SVGPathSegArc.h"
#include "SVGPathSegClosePath.h"
#include "SVGPathSegCurvetoCubic.h"
@@ -37,6 +37,7 @@
#include "SVGPathSegLinetoHorizontal.h"
#include "SVGPathSegLinetoVertical.h"
#include "SVGPathSegList.h"
+#include "SVGPathSegListBuilder.h"
#include "SVGPathSegMoveto.h"
#include "SVGSVGElement.h"
@@ -172,7 +173,8 @@ void SVGPathElement::parseMappedAttribute(Attribute* attr)
if (attr->name() == SVGNames::dAttr) {
ExceptionCode ec;
pathSegList()->clear(ec);
- if (!pathSegListFromSVGData(pathSegList(), attr->value(), true))
+ SVGPathSegListBuilder parser(pathSegList());
+ if (!parser.build(attr->value(), NormalizedParsing))
document()->accessSVGExtensions()->reportError("Problem parsing d=\"" + attr->value() + "\"");
} else if (attr->name() == SVGNames::pathLengthAttr) {
setPathLengthBaseValue(attr->value().toFloat());
@@ -199,13 +201,13 @@ void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName)
if (attrName == SVGNames::dAttr) {
renderer->setNeedsPathUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
renderer->setNeedsTransformUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
@@ -213,7 +215,7 @@ void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName)
|| SVGTests::isKnownAttribute(attrName)
|| SVGLangSpace::isKnownAttribute(attrName)
|| SVGExternalResourcesRequired::isKnownAttribute(attrName))
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
void SVGPathElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGPathParser.cpp b/WebCore/svg/SVGPathParser.cpp
new file mode 100644
index 0000000..3d937c0
--- /dev/null
+++ b/WebCore/svg/SVGPathParser.cpp
@@ -0,0 +1,509 @@
+/*
+ * Copyright (C) 2002, 2003 The Karbon Developers
+ * 2006 Alexander Kellett <lypanov@kde.org>
+ * 2006, 2007 Rob Buis <buis@kde.org>
+ * Copyrigth (C) 2007, 2009 Apple, Inc. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+
+#if ENABLE(SVG)
+#include "SVGPathParser.h"
+
+#include "AffineTransform.h"
+#include "SVGParserUtilities.h"
+#include <wtf/MathExtras.h>
+
+static const float gOneOverThree = 1 / 3.f;
+
+namespace WebCore {
+
+SVGPathParser::SVGPathParser(SVGPathConsumer* consumer)
+ : m_consumer(consumer)
+{
+}
+
+SVGPathParser::~SVGPathParser()
+{
+}
+
+void SVGPathParser::parseClosePathSegment()
+{
+ // Reset m_currentPoint for the next path.
+ if (m_normalized)
+ m_currentPoint = m_subPathPoint;
+ m_pathClosed = true;
+ m_consumer->closePath();
+}
+
+bool SVGPathParser::parseMoveToSegment()
+{
+ float toX;
+ float toY;
+ if (!parseNumber(m_ptr, m_end, toX) || !parseNumber(m_ptr, m_end, toY))
+ return false;
+
+ FloatPoint toPoint(toX, toY);
+ if (m_normalized) {
+ if (m_mode == RelativeCoordinates)
+ m_currentPoint += toPoint;
+ else
+ m_currentPoint = toPoint;
+ m_subPathPoint = m_currentPoint;
+ m_consumer->moveTo(m_currentPoint, m_pathClosed, AbsoluteCoordinates);
+ } else
+ m_consumer->moveTo(toPoint, m_pathClosed, m_mode);
+ m_pathClosed = false;
+ return true;
+}
+
+bool SVGPathParser::parseLineToSegment()
+{
+ float toX;
+ float toY;
+ if (!parseNumber(m_ptr, m_end, toX) || !parseNumber(m_ptr, m_end, toY))
+ return false;
+
+ FloatPoint toPoint(toX, toY);
+ if (m_normalized) {
+ if (m_mode == RelativeCoordinates)
+ m_currentPoint += toPoint;
+ else
+ m_currentPoint = toPoint;
+ m_consumer->lineTo(m_currentPoint, AbsoluteCoordinates);
+ } else
+ m_consumer->lineTo(toPoint, m_mode);
+ return true;
+}
+
+bool SVGPathParser::parseLineToHorizontalSegment()
+{
+ float toX;
+ if (!parseNumber(m_ptr, m_end, toX))
+ return false;
+
+ if (m_normalized) {
+ if (m_mode == RelativeCoordinates)
+ m_currentPoint.move(toX, 0);
+ else
+ m_currentPoint.setX(toX);
+ m_consumer->lineTo(m_currentPoint, AbsoluteCoordinates);
+ } else
+ m_consumer->lineToHorizontal(toX, m_mode);
+ return true;
+}
+
+bool SVGPathParser::parseLineToVerticalSegment()
+{
+ float toY;
+ if (!parseNumber(m_ptr, m_end, toY))
+ return false;
+
+ if (m_normalized) {
+ if (m_mode == RelativeCoordinates)
+ m_currentPoint.move(0, toY);
+ else
+ m_currentPoint.setY(toY);
+ m_consumer->lineTo(m_currentPoint, AbsoluteCoordinates);
+ } else
+ m_consumer->lineToVertical(toY, m_mode);
+ return true;
+}
+
+bool SVGPathParser::parseCurveToCubicSegment()
+{
+ float x1;
+ float y1;
+ float x2;
+ float y2;
+ float toX;
+ float toY;
+ if (!parseNumber(m_ptr, m_end, x1)
+ || !parseNumber(m_ptr, m_end, y1)
+ || !parseNumber(m_ptr, m_end, x2)
+ || !parseNumber(m_ptr, m_end, y2)
+ || !parseNumber(m_ptr, m_end, toX)
+ || !parseNumber(m_ptr, m_end, toY))
+ return false;
+
+ FloatPoint point1(x1, y1);
+ FloatPoint point2(x2, y2);
+ FloatPoint point3(toX, toY);
+ if (m_normalized) {
+ if (m_mode == RelativeCoordinates) {
+ point1 += m_currentPoint;
+ point2 += m_currentPoint;
+ point3 += m_currentPoint;
+ }
+ m_consumer->curveToCubic(point1, point2, point3, AbsoluteCoordinates);
+
+ m_controlPoint = point2;
+ m_currentPoint = point3;
+ } else
+ m_consumer->curveToCubic(point1, point2, point3, m_mode);
+ return true;
+}
+
+bool SVGPathParser::parseCurveToCubicSmoothSegment()
+{
+ float x2;
+ float y2;
+ float toX;
+ float toY;
+ if (!parseNumber(m_ptr, m_end, x2)
+ || !parseNumber(m_ptr, m_end, y2)
+ || !parseNumber(m_ptr, m_end, toX)
+ || !parseNumber(m_ptr, m_end, toY))
+ return false;
+
+ if (m_lastCommand != 'c'
+ && m_lastCommand != 'C'
+ && m_lastCommand != 's'
+ && m_lastCommand != 'S')
+ m_controlPoint = m_currentPoint;
+
+ FloatPoint point2(x2, y2);
+ FloatPoint point3(toX, toY);
+ if (m_normalized) {
+ FloatPoint point1 = m_currentPoint;
+ point1.scale(2, 2);
+ point1.move(-m_controlPoint.x(), -m_controlPoint.y());
+ if (m_mode == RelativeCoordinates) {
+ point2 += m_currentPoint;
+ point3 += m_currentPoint;
+ }
+
+ m_consumer->curveToCubic(point1, point2, point3, AbsoluteCoordinates);
+
+ m_controlPoint = point2;
+ m_currentPoint = point3;
+ } else
+ m_consumer->curveToCubicSmooth(point2, point3, m_mode);
+ return true;
+}
+
+bool SVGPathParser::parseCurveToQuadraticSegment()
+{
+ float x1;
+ float y1;
+ float toX;
+ float toY;
+ if (!parseNumber(m_ptr, m_end, x1)
+ || !parseNumber(m_ptr, m_end, y1)
+ || !parseNumber(m_ptr, m_end, toX)
+ || !parseNumber(m_ptr, m_end, toY))
+ return false;
+
+ FloatPoint point3(toX, toY);
+ if (m_normalized) {
+ FloatPoint point1 = m_currentPoint;
+ point1.move(2 * x1, 2 * y1);
+ FloatPoint point2(toX + 2 * x1, toY + 2 * y1);
+ if (m_mode == RelativeCoordinates) {
+ point1.move(2 * m_currentPoint.x(), 2 * m_currentPoint.y());
+ point2.move(3 * m_currentPoint.x(), 3 * m_currentPoint.y());
+ point3 += m_currentPoint;
+ }
+ point1.scale(gOneOverThree, gOneOverThree);
+ point2.scale(gOneOverThree, gOneOverThree);
+
+ m_consumer->curveToCubic(point1, point2, point3, AbsoluteCoordinates);
+
+ m_controlPoint = FloatPoint(x1, y1);
+ if (m_mode == RelativeCoordinates)
+ m_controlPoint += m_currentPoint;
+ m_currentPoint = point3;
+ } else
+ m_consumer->curveToQuadratic(FloatPoint(x1, y1), point3, m_mode);
+ return true;
+}
+
+bool SVGPathParser::parseCurveToQuadraticSmoothSegment()
+{
+ float toX;
+ float toY;
+ if (!parseNumber(m_ptr, m_end, toX) || !parseNumber(m_ptr, m_end, toY))
+ return false;
+ if (m_lastCommand != 'q'
+ && m_lastCommand != 'Q'
+ && m_lastCommand != 't'
+ && m_lastCommand != 'T')
+ m_controlPoint = m_currentPoint;
+
+ if (m_normalized) {
+ FloatPoint cubicPoint = m_currentPoint;
+ cubicPoint.scale(2, 2);
+ cubicPoint.move(-m_controlPoint.x(), -m_controlPoint.y());
+ FloatPoint point1(m_currentPoint.x() + 2 * cubicPoint.x(), m_currentPoint.y() + 2 * cubicPoint.y());
+ FloatPoint point2(toX + 2 * cubicPoint.x(), toY + 2 * cubicPoint.y());
+ FloatPoint point3(toX, toY);
+ if (m_mode == RelativeCoordinates) {
+ point2 += m_currentPoint;
+ point3 += m_currentPoint;
+ }
+ point1.scale(gOneOverThree, gOneOverThree);
+ point2.scale(gOneOverThree, gOneOverThree);
+
+ m_consumer->curveToCubic(point1, point2, point3, AbsoluteCoordinates);
+
+ m_controlPoint = cubicPoint;
+ m_currentPoint = point3;
+ } else
+ m_consumer->curveToQuadraticSmooth(FloatPoint(toX, toY), m_mode);
+ return true;
+}
+
+bool SVGPathParser::parseArcToSegment()
+{
+ bool largeArc;
+ bool sweep;
+ float angle;
+ float rx;
+ float ry;
+ float toX;
+ float toY;
+ if (!parseNumber(m_ptr, m_end, rx)
+ || !parseNumber(m_ptr, m_end, ry)
+ || !parseNumber(m_ptr, m_end, angle)
+ || !parseArcFlag(m_ptr, m_end, largeArc)
+ || !parseArcFlag(m_ptr, m_end, sweep)
+ || !parseNumber(m_ptr, m_end, toX)
+ || !parseNumber(m_ptr, m_end, toY))
+ return false;
+
+ FloatPoint point2 = FloatPoint(toX, toY);
+ // If rx = 0 or ry = 0 then this arc is treated as a straight line segment (a "lineto") joining the endpoints.
+ // http://www.w3.org/TR/SVG/implnote.html#ArcOutOfRangeParameters
+ rx = fabsf(rx);
+ ry = fabsf(ry);
+ if (!rx || !ry) {
+ if (m_normalized) {
+ if (m_mode == RelativeCoordinates)
+ m_currentPoint += point2;
+ else
+ m_currentPoint = point2;
+ m_consumer->lineTo(m_currentPoint, AbsoluteCoordinates);
+ } else
+ m_consumer->lineTo(point2, m_mode);
+ return true;
+ }
+
+ if (m_normalized) {
+ FloatPoint point1 = m_currentPoint;
+ if (m_mode == RelativeCoordinates)
+ point2 += m_currentPoint;
+ m_currentPoint = point2;
+ return decomposeArcToCubic(angle, rx, ry, point1, point2, largeArc, sweep);
+ }
+ m_consumer->arcTo(point2, rx, ry, angle, largeArc, sweep, m_mode);
+ return true;
+}
+
+bool SVGPathParser::parsePathDataString(const String& s, bool normalized)
+{
+ m_ptr = s.characters();
+ m_end = m_ptr + s.length();
+ m_normalized = normalized;
+
+ m_controlPoint = FloatPoint();
+ m_currentPoint = FloatPoint();
+ m_subPathPoint = FloatPoint();
+ m_pathClosed = true;
+
+ // Skip any leading spaces.
+ if (!skipOptionalSpaces(m_ptr, m_end))
+ return false;
+
+ char command = *(m_ptr++);
+ m_lastCommand = ' ';
+ // Path must start with moveto.
+ if (command != 'm' && command != 'M')
+ return false;
+
+ while (true) {
+ // Skip spaces between command and first coordinate.
+ skipOptionalSpaces(m_ptr, m_end);
+ m_mode = command >= 'a' && command <= 'z' ? RelativeCoordinates : AbsoluteCoordinates;
+ switch (command) {
+ case 'm':
+ case 'M':
+ if (!parseMoveToSegment())
+ return false;
+ break;
+ case 'l':
+ case 'L':
+ if (!parseLineToSegment())
+ return false;
+ break;
+ case 'h':
+ case 'H':
+ if (!parseLineToHorizontalSegment())
+ return false;
+ break;
+ case 'v':
+ case 'V':
+ if (!parseLineToVerticalSegment())
+ return false;
+ break;
+ case 'z':
+ case 'Z':
+ parseClosePathSegment();
+ break;
+ case 'c':
+ case 'C':
+ if (!parseCurveToCubicSegment())
+ return false;
+ break;
+ case 's':
+ case 'S':
+ if (!parseCurveToCubicSmoothSegment())
+ return false;
+ break;
+ case 'q':
+ case 'Q':
+ if (!parseCurveToQuadraticSegment())
+ return false;
+ break;
+ case 't':
+ case 'T':
+ if (!parseCurveToQuadraticSmoothSegment())
+ return false;
+ break;
+ case 'a':
+ case 'A':
+ if (!parseArcToSegment())
+ return false;
+ break;
+ default:
+ return false;
+ }
+ m_lastCommand = command;
+
+ if (m_ptr >= m_end)
+ return true;
+
+ // Check for remaining coordinates in the current command.
+ if ((*m_ptr == '+' || *m_ptr == '-' || *m_ptr == '.' || (*m_ptr >= '0' && *m_ptr <= '9'))
+ && command != 'z' && command != 'Z') {
+ if (command == 'M')
+ command = 'L';
+ else if (command == 'm')
+ command = 'l';
+ } else
+ command = *(m_ptr++);
+
+ if (m_lastCommand != 'C' && m_lastCommand != 'c'
+ && m_lastCommand != 'S' && m_lastCommand != 's'
+ && m_lastCommand != 'Q' && m_lastCommand != 'q'
+ && m_lastCommand != 'T' && m_lastCommand != 't')
+ m_controlPoint = m_currentPoint;
+ }
+
+ return false;
+}
+
+// This works by converting the SVG arc to "simple" beziers.
+// Partly adapted from Niko's code in kdelibs/kdecore/svgicons.
+// See also SVG implementation notes: http://www.w3.org/TR/SVG/implnote.html#ArcConversionEndpointToCenter
+bool SVGPathParser::decomposeArcToCubic(float angle, float rx, float ry, FloatPoint& point1, FloatPoint& point2, bool largeArcFlag, bool sweepFlag)
+{
+ FloatSize midPointDistance = point1 - point2;
+ midPointDistance.scale(0.5f);
+
+ AffineTransform pointTransform;
+ pointTransform.rotate(-angle);
+
+ FloatPoint transformedMidPoint = pointTransform.mapPoint(FloatPoint(midPointDistance.width(), midPointDistance.height()));
+ float squareRx = rx * rx;
+ float squareRy = ry * ry;
+ float squareX = transformedMidPoint.x() * transformedMidPoint.x();
+ float squareY = transformedMidPoint.y() * transformedMidPoint.y();
+
+ // Check if the radii are big enough to draw the arc, scale radii if not.
+ // http://www.w3.org/TR/SVG/implnote.html#ArcCorrectionOutOfRangeRadii
+ float radiiScale = squareX / squareRx + squareY / squareRy;
+ if (radiiScale > 1) {
+ rx *= sqrtf(radiiScale);
+ ry *= sqrtf(radiiScale);
+ }
+
+ pointTransform.makeIdentity();
+ pointTransform.scale(1 / rx, 1 / ry);
+ pointTransform.rotate(-angle);
+
+ point1 = pointTransform.mapPoint(point1);
+ point2 = pointTransform.mapPoint(point2);
+ FloatSize delta = point2 - point1;
+
+ float d = delta.width() * delta.width() + delta.height() * delta.height();
+ float scaleFactorSquared = std::max(1 / d - 0.25f, 0.f);
+
+ float scaleFactor = sqrtf(scaleFactorSquared);
+ if (sweepFlag == largeArcFlag)
+ scaleFactor = -scaleFactor;
+
+ delta.scale(scaleFactor);
+ FloatPoint centerPoint = FloatPoint(0.5f * (point1.x() + point2.x()) - delta.height(),
+ 0.5f * (point1.y() + point2.y()) + delta.width());
+
+ float theta1 = atan2f(point1.y() - centerPoint.y(), point1.x() - centerPoint.x());
+ float theta2 = atan2f(point2.y() - centerPoint.y(), point2.x() - centerPoint.x());
+
+ float thetaArc = theta2 - theta1;
+ if (thetaArc < 0 && sweepFlag)
+ thetaArc += 2 * piFloat;
+ else if (thetaArc > 0 && !sweepFlag)
+ thetaArc -= 2 * piFloat;
+
+ pointTransform.makeIdentity();
+ pointTransform.rotate(angle);
+ pointTransform.scale(rx, ry);
+
+ // Some results of atan2 on some platform implementations are not exact enough. So that we get more
+ // cubic curves than expected here. Adding 0.001f reduces the count of sgements to the correct count.
+ int segments = ceilf(fabsf(thetaArc / (piOverTwoFloat + 0.001f)));
+ for (int i = 0; i < segments; ++i) {
+ float startTheta = theta1 + i * thetaArc / segments;
+ float endTheta = theta1 + (i + 1) * thetaArc / segments;
+
+ float t = (8 / 6.f) * tanf(0.25f * (endTheta - startTheta));
+ if (!isfinite(t))
+ return false;
+ float sinStartTheta = sinf(startTheta);
+ float cosStartTheta = cosf(startTheta);
+ float sinEndTheta = sinf(endTheta);
+ float cosEndTheta = cosf(endTheta);
+
+ point1 = FloatPoint(cosStartTheta - t * sinStartTheta, sinStartTheta + t * cosStartTheta);
+ point1.move(centerPoint.x(), centerPoint.y());
+ FloatPoint point3 = FloatPoint(cosEndTheta, sinEndTheta);
+ point3.move(centerPoint.x(), centerPoint.y());
+ point2 = point3;
+ point2.move(t * sinEndTheta, -t * cosEndTheta);
+
+ m_consumer->curveToCubic(pointTransform.mapPoint(point1), pointTransform.mapPoint(point2),
+ pointTransform.mapPoint(point3), AbsoluteCoordinates);
+ }
+ return true;
+}
+
+}
+
+#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGPathParser.h b/WebCore/svg/SVGPathParser.h
new file mode 100644
index 0000000..f39094b
--- /dev/null
+++ b/WebCore/svg/SVGPathParser.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2002, 2003 The Karbon Developers
+ * 2006 Alexander Kellett <lypanov@kde.org>
+ * 2006, 2007 Rob Buis <buis@kde.org>
+ * Copyrigth (C) 2007, 2009 Apple, Inc. All rights reserved.
+ * 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 SVGPathParser_h
+#define SVGPathParser_h
+
+#if ENABLE(SVG)
+#include "PlatformString.h"
+#include "SVGPathConsumer.h"
+
+namespace WebCore {
+
+class SVGPathParser {
+public:
+ SVGPathParser(SVGPathConsumer*);
+ ~SVGPathParser();
+
+ bool parsePathDataString(const String&, bool normalized = false);
+
+private:
+ bool decomposeArcToCubic(float, float, float, FloatPoint&, FloatPoint&, bool largeArcFlag, bool sweepFlag);
+ void parseClosePathSegment();
+ bool parseMoveToSegment();
+ bool parseLineToSegment();
+ bool parseLineToHorizontalSegment();
+ bool parseLineToVerticalSegment();
+ bool parseCurveToCubicSegment();
+ bool parseCurveToCubicSmoothSegment();
+ bool parseCurveToQuadraticSegment();
+ bool parseCurveToQuadraticSmoothSegment();
+ bool parseArcToSegment();
+
+ SVGPathConsumer* m_consumer;
+ PathCoordinateMode m_mode;
+ const UChar* m_ptr;
+ const UChar* m_end;
+ char m_lastCommand;
+ bool m_normalized;
+ bool m_pathClosed;
+ FloatPoint m_controlPoint;
+ FloatPoint m_currentPoint;
+ FloatPoint m_subPathPoint;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif // SVGPathParser_h
diff --git a/WebCore/svg/SVGPathSegListBuilder.cpp b/WebCore/svg/SVGPathSegListBuilder.cpp
new file mode 100644
index 0000000..4434c2e
--- /dev/null
+++ b/WebCore/svg/SVGPathSegListBuilder.cpp
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2002, 2003 The Karbon Developers
+ * 2006 Alexander Kellett <lypanov@kde.org>
+ * 2006, 2007 Rob Buis <buis@kde.org>
+ * Copyrigth (C) 2007, 2009 Apple, Inc. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+
+#if ENABLE(SVG)
+#include "SVGPathSegListBuilder.h"
+
+#include "ExceptionCode.h"
+#include "SVGPathElement.h"
+#include "SVGPathParser.h"
+#include "SVGPathSegArc.h"
+#include "SVGPathSegClosePath.h"
+#include "SVGPathSegCurvetoCubic.h"
+#include "SVGPathSegCurvetoCubicSmooth.h"
+#include "SVGPathSegCurvetoQuadratic.h"
+#include "SVGPathSegCurvetoQuadraticSmooth.h"
+#include "SVGPathSegLineto.h"
+#include "SVGPathSegLinetoHorizontal.h"
+#include "SVGPathSegLinetoVertical.h"
+#include "SVGPathSegList.h"
+#include "SVGPathSegMoveto.h"
+
+namespace WebCore {
+
+SVGPathSegListBuilder::SVGPathSegListBuilder(SVGPathSegList* segList)
+ : m_pathSegList(segList)
+{
+}
+
+bool SVGPathSegListBuilder::build(const String& d, PathParsingMode parsingMode)
+{
+ if (!m_pathSegList)
+ return false;
+
+ SVGPathParser parser(this);
+ return parser.parsePathDataString(d, parsingMode == NormalizedParsing);
+}
+
+void SVGPathSegListBuilder::moveTo(const FloatPoint& point, bool, PathCoordinateMode mode)
+{
+ ExceptionCode ec = 0;
+ if (mode == AbsoluteCoordinates)
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegMovetoAbs(point.x(), point.y()), ec);
+ else
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegMovetoRel(point.x(), point.y()), ec);
+ ASSERT(!ec);
+}
+
+void SVGPathSegListBuilder::lineTo(const FloatPoint& point, PathCoordinateMode mode)
+{
+ ExceptionCode ec = 0;
+ if (mode == AbsoluteCoordinates)
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegLinetoAbs(point.x(), point.y()), ec);
+ else
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegLinetoRel(point.x(), point.y()), ec);
+ ASSERT(!ec);
+}
+
+void SVGPathSegListBuilder::lineToHorizontal(float x, PathCoordinateMode mode)
+{
+ ExceptionCode ec = 0;
+ if (mode == AbsoluteCoordinates)
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegLinetoHorizontalAbs(x), ec);
+ else
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegLinetoHorizontalRel(x), ec);
+ ASSERT(!ec);
+}
+
+void SVGPathSegListBuilder::lineToVertical(float y, PathCoordinateMode mode)
+{
+ ExceptionCode ec = 0;
+ if (mode == AbsoluteCoordinates)
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegLinetoVerticalAbs(y), ec);
+ else
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegLinetoVerticalRel(y), ec);
+ ASSERT(!ec);
+}
+
+void SVGPathSegListBuilder::curveToCubic(const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& point, PathCoordinateMode mode)
+{
+ ExceptionCode ec = 0;
+ if (mode == AbsoluteCoordinates)
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegCurvetoCubicAbs(point.x(), point.y(), point1.x(), point1.y(), point2.x(), point2.y()), ec);
+ else
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegCurvetoCubicRel(point.x(), point.y(), point1.x(), point1.y(), point2.x(), point2.y()), ec);
+ ASSERT(!ec);
+}
+
+void SVGPathSegListBuilder::curveToCubicSmooth(const FloatPoint& point, const FloatPoint& point2, PathCoordinateMode mode)
+{
+ ExceptionCode ec = 0;
+ if (mode == AbsoluteCoordinates)
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs(point2.x(), point2.y(), point.x(), point.y()), ec);
+ else
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel(point2.x(), point2.y(), point.x(), point.y()), ec);
+ ASSERT(!ec);
+}
+
+void SVGPathSegListBuilder::curveToQuadratic(const FloatPoint& point, const FloatPoint& point1, PathCoordinateMode mode)
+{
+ ExceptionCode ec = 0;
+ if (mode == AbsoluteCoordinates)
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegCurvetoQuadraticAbs(point1.x(), point1.y(), point.x(), point.y()), ec);
+ else
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegCurvetoQuadraticRel(point1.x(), point1.y(), point.x(), point.y()), ec);
+ ASSERT(!ec);
+}
+
+void SVGPathSegListBuilder::curveToQuadraticSmooth(const FloatPoint& point, PathCoordinateMode mode)
+{
+ ExceptionCode ec = 0;
+ if (mode == AbsoluteCoordinates)
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs(point.x(), point.y()), ec);
+ else
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel(point.x(), point.y()), ec);
+ ASSERT(!ec);
+}
+
+void SVGPathSegListBuilder::arcTo(const FloatPoint& point, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, PathCoordinateMode mode)
+{
+ ExceptionCode ec = 0;
+ if (mode == AbsoluteCoordinates)
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegArcAbs(point.x(), point.y(), r1, r2, angle, largeArcFlag, sweepFlag), ec);
+ else
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegArcRel(point.x(), point.y(), r1, r2, angle, largeArcFlag, sweepFlag), ec);
+ ASSERT(!ec);
+}
+
+void SVGPathSegListBuilder::closePath()
+{
+ ExceptionCode ec = 0;
+ m_pathSegList->appendItem(SVGPathElement::createSVGPathSegClosePath(), ec);
+ ASSERT(!ec);
+}
+
+}
+
+#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGPathSegListBuilder.h b/WebCore/svg/SVGPathSegListBuilder.h
new file mode 100644
index 0000000..71d0dde
--- /dev/null
+++ b/WebCore/svg/SVGPathSegListBuilder.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2002, 2003 The Karbon Developers
+ * 2006 Alexander Kellett <lypanov@kde.org>
+ * 2006, 2007 Rob Buis <buis@kde.org>
+ * Copyrigth (C) 2007, 2009 Apple, Inc. All rights reserved.
+ * 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 SVGPathSegListBuilder_h
+#define SVGPathSegListBuilder_h
+
+#if ENABLE(SVG)
+#include "FloatPoint.h"
+#include "SVGPathConsumer.h"
+#include "SVGPathSegList.h"
+
+namespace WebCore {
+
+class SVGPathSegListBuilder : private SVGPathConsumer {
+public:
+ SVGPathSegListBuilder(SVGPathSegList*);
+ bool build(const String&, PathParsingMode);
+
+private:
+ // Used in UnalteredParisng/NormalizedParsing modes.
+ virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode);
+ virtual void lineTo(const FloatPoint&, PathCoordinateMode);
+ virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode);
+ virtual void closePath();
+
+private:
+ // Only used in UnalteredParsing mode.
+ virtual void lineToHorizontal(float, PathCoordinateMode);
+ virtual void lineToVertical(float, PathCoordinateMode);
+ virtual void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCoordinateMode);
+ virtual void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoordinateMode);
+ virtual void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode);
+ virtual void arcTo(const FloatPoint&, float, float, float, bool largeArcFlag, bool sweepFlag, PathCoordinateMode);
+
+ SVGPathSegList* m_pathSegList;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif // SVGPathSegListBuilder_h
diff --git a/WebCore/svg/SVGPolyElement.cpp b/WebCore/svg/SVGPolyElement.cpp
index 6f88b22..2996dd7 100644
--- a/WebCore/svg/SVGPolyElement.cpp
+++ b/WebCore/svg/SVGPolyElement.cpp
@@ -27,6 +27,7 @@
#include "Document.h"
#include "FloatPoint.h"
#include "RenderPath.h"
+#include "RenderSVGResource.h"
#include "SVGNames.h"
#include "SVGParserUtilities.h"
#include "SVGPointList.h"
@@ -94,20 +95,20 @@ void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName)
if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
renderer->setNeedsTransformUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
if (attrName == SVGNames::pointsAttr) {
renderer->setNeedsPathUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
if (SVGTests::isKnownAttribute(attrName)
|| SVGLangSpace::isKnownAttribute(attrName)
|| SVGExternalResourcesRequired::isKnownAttribute(attrName))
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
void SVGPolyElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGRectElement.cpp b/WebCore/svg/SVGRectElement.cpp
index 3e559ed..a848246 100644
--- a/WebCore/svg/SVGRectElement.cpp
+++ b/WebCore/svg/SVGRectElement.cpp
@@ -25,6 +25,7 @@
#include "Attribute.h"
#include "RenderPath.h"
+#include "RenderSVGResource.h"
#include "SVGLength.h"
#include "SVGNames.h"
@@ -101,20 +102,20 @@ void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName)
if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
renderer->setNeedsTransformUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
if (isLengthAttribute) {
renderer->setNeedsPathUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
return;
}
if (SVGTests::isKnownAttribute(attrName)
|| SVGLangSpace::isKnownAttribute(attrName)
|| SVGExternalResourcesRequired::isKnownAttribute(attrName))
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
void SVGRectElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index 6d88c37..c513b98 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -35,6 +35,7 @@
#include "FloatRect.h"
#include "FrameView.h"
#include "HTMLNames.h"
+#include "RenderSVGResource.h"
#include "RenderSVGRoot.h"
#include "RenderSVGViewportContainer.h"
#include "SMILTimeContainer.h"
@@ -204,8 +205,8 @@ void SVGSVGElement::setCurrentScale(float scale)
}
m_scale = scale;
- if (renderer())
- renderer()->setNeedsLayout(true);
+ if (RenderObject* object = renderer())
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(object);
}
FloatPoint SVGSVGElement::currentTranslate() const
@@ -320,7 +321,7 @@ void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName)
|| SVGExternalResourcesRequired::isKnownAttribute(attrName)
|| SVGZoomAndPan::isKnownAttribute(attrName)
|| SVGStyledLocatableElement::isKnownAttribute(attrName))
- renderer()->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer());
}
void SVGSVGElement::synchronizeProperty(const QualifiedName& attrName)
@@ -579,7 +580,9 @@ void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement)
if (viewElement->hasAttribute(SVGNames::zoomAndPanAttr))
currentView()->setZoomAndPan(viewElement->zoomAndPan());
- renderer()->setNeedsLayout(true);
+
+ if (RenderObject* object = renderer())
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(object);
}
void SVGSVGElement::documentWillBecomeInactive()
diff --git a/WebCore/svg/SVGStopElement.cpp b/WebCore/svg/SVGStopElement.cpp
index 672b082..36d4338 100644
--- a/WebCore/svg/SVGStopElement.cpp
+++ b/WebCore/svg/SVGStopElement.cpp
@@ -26,6 +26,7 @@
#include "Attribute.h"
#include "Document.h"
#include "RenderSVGGradientStop.h"
+#include "RenderSVGResource.h"
#include "SVGGradientElement.h"
#include "SVGNames.h"
@@ -33,7 +34,7 @@ namespace WebCore {
SVGStopElement::SVGStopElement(const QualifiedName& tagName, Document* doc)
: SVGStyledElement(tagName, doc)
- , m_offset(0.0f)
+ , m_offset(0)
{
}
@@ -53,6 +54,17 @@ void SVGStopElement::parseMappedAttribute(Attribute* attr)
SVGStyledElement::parseMappedAttribute(attr);
}
+void SVGStopElement::svgAttributeChanged(const QualifiedName& attrName)
+{
+ SVGStyledElement::svgAttributeChanged(attrName);
+
+ if (!renderer())
+ return;
+
+ if (attrName == SVGNames::offsetAttr)
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer());
+}
+
void SVGStopElement::synchronizeProperty(const QualifiedName& attrName)
{
SVGStyledElement::synchronizeProperty(attrName);
diff --git a/WebCore/svg/SVGStopElement.h b/WebCore/svg/SVGStopElement.h
index db5eff0..96c3294 100644
--- a/WebCore/svg/SVGStopElement.h
+++ b/WebCore/svg/SVGStopElement.h
@@ -33,6 +33,7 @@ namespace WebCore {
virtual ~SVGStopElement();
virtual void parseMappedAttribute(Attribute*);
+ virtual void svgAttributeChanged(const QualifiedName&);
virtual void synchronizeProperty(const QualifiedName&);
Color stopColorIncludingOpacity() const;
diff --git a/WebCore/svg/SVGStyledElement.cpp b/WebCore/svg/SVGStyledElement.cpp
index 6b55683..6c2993c 100644
--- a/WebCore/svg/SVGStyledElement.cpp
+++ b/WebCore/svg/SVGStyledElement.cpp
@@ -246,14 +246,6 @@ void SVGStyledElement::svgAttributeChanged(const QualifiedName& attrName)
object->toRenderSVGResourceContainer()->idChanged();
}
- if (!document()->parsing() && object) {
- // If we're the child of a resource element, tell the resource (and eventually its resources) that we've changed.
- invalidateResourcesInAncestorChain();
-
- // If we're referencing resources, tell them we've changed.
- RenderSVGResource::invalidateAllResourcesOfRenderer(object);
- }
-
// Invalidate all SVGElementInstances associated with us
SVGElementInstance::invalidateAllInstancesOfElement(this);
}
@@ -266,27 +258,11 @@ void SVGStyledElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeClassName();
}
-void SVGStyledElement::invalidateResourcesInAncestorChain() const
-{
- Node* node = parentNode();
- while (node) {
- if (!node->isSVGElement())
- break;
-
- SVGElement* element = static_cast<SVGElement*>(node);
- if (SVGStyledElement* styledElement = static_cast<SVGStyledElement*>(element->isStyled() ? element : 0)) {
- styledElement->invalidateResourceClients();
-
- // If we found the first resource in the ancestor chain, immediately stop.
- break;
- }
-
- node = node->parentNode();
- }
-}
-
void SVGStyledElement::invalidateResourceClients()
{
+ if (document()->parsing())
+ return;
+
RenderObject* object = renderer();
if (!object)
return;
diff --git a/WebCore/svg/SVGStyledElement.h b/WebCore/svg/SVGStyledElement.h
index dcfc96a..4982908 100644
--- a/WebCore/svg/SVGStyledElement.h
+++ b/WebCore/svg/SVGStyledElement.h
@@ -65,7 +65,6 @@ namespace WebCore {
PassRefPtr<RenderStyle> resolveStyle(RenderStyle* parentStyle);
void invalidateResourceClients();
- void invalidateResourcesInAncestorChain() const;
bool instanceUpdatesBlocked() const;
void setInstanceUpdatesBlocked(bool);
diff --git a/WebCore/svg/SVGTRefElement.cpp b/WebCore/svg/SVGTRefElement.cpp
index 4faa633..4c593ca 100644
--- a/WebCore/svg/SVGTRefElement.cpp
+++ b/WebCore/svg/SVGTRefElement.cpp
@@ -24,6 +24,7 @@
#include "SVGTRefElement.h"
#include "RenderSVGInline.h"
+#include "RenderSVGResource.h"
#include "SVGDocument.h"
#include "SVGNames.h"
#include "Text.h"
@@ -69,7 +70,7 @@ void SVGTRefElement::svgAttributeChanged(const QualifiedName& attrName)
return;
if (SVGURIReference::isKnownAttribute(attrName))
- renderer()->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer());
}
void SVGTRefElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGTextElement.cpp b/WebCore/svg/SVGTextElement.cpp
index 0aba04b..7269adf 100644
--- a/WebCore/svg/SVGTextElement.cpp
+++ b/WebCore/svg/SVGTextElement.cpp
@@ -26,6 +26,7 @@
#include "AffineTransform.h"
#include "Attribute.h"
#include "FloatRect.h"
+#include "RenderSVGResource.h"
#include "RenderSVGText.h"
#include "SVGLengthList.h"
#include "SVGRenderStyle.h"
@@ -120,7 +121,7 @@ void SVGTextElement::svgAttributeChanged(const QualifiedName& attrName)
if (SVGTransformable::isKnownAttribute(attrName)) {
renderer->setNeedsTransformUpdate();
- renderer->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
}
diff --git a/WebCore/svg/SVGTextPathElement.cpp b/WebCore/svg/SVGTextPathElement.cpp
index 288edfd..732185d 100644
--- a/WebCore/svg/SVGTextPathElement.cpp
+++ b/WebCore/svg/SVGTextPathElement.cpp
@@ -25,6 +25,7 @@
#include "AffineTransform.h"
#include "Attribute.h"
#include "FloatRect.h"
+#include "RenderSVGResource.h"
#include "RenderSVGTextPath.h"
#include "SVGLengthList.h"
#include "SVGPathElement.h"
@@ -82,7 +83,7 @@ void SVGTextPathElement::svgAttributeChanged(const QualifiedName& attrName)
if (attrName == SVGNames::startOffsetAttr
|| SVGTextContentElement::isKnownAttribute(attrName)
|| SVGURIReference::isKnownAttribute(attrName))
- renderer()->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer());
}
void SVGTextPathElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGTextPositioningElement.cpp b/WebCore/svg/SVGTextPositioningElement.cpp
index ef47322..19f1fbc 100644
--- a/WebCore/svg/SVGTextPositioningElement.cpp
+++ b/WebCore/svg/SVGTextPositioningElement.cpp
@@ -25,6 +25,7 @@
#include "Attribute.h"
#include "RenderObject.h"
+#include "RenderSVGResource.h"
#include "SVGLengthList.h"
#include "SVGNames.h"
#include "SVGNumberList.h"
@@ -75,7 +76,7 @@ void SVGTextPositioningElement::svgAttributeChanged(const QualifiedName& attrNam
return;
if (isKnownAttribute(attrName))
- renderer()->setNeedsLayout(true);
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer());
}
void SVGTextPositioningElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGUseElement.cpp b/WebCore/svg/SVGUseElement.cpp
index 5ca560a..e42a794 100644
--- a/WebCore/svg/SVGUseElement.cpp
+++ b/WebCore/svg/SVGUseElement.cpp
@@ -32,6 +32,7 @@
#include "HTMLNames.h"
#include "NodeRenderStyle.h"
#include "RegisteredEventListener.h"
+#include "RenderSVGResource.h"
#include "RenderSVGShadowTreeRootContainer.h"
#include "SVGElementInstance.h"
#include "SVGElementInstanceList.h"
@@ -142,7 +143,8 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
if (isXYAttribute || isWidthHeightAttribute)
updateRelativeLengthsInformation();
- if (!renderer())
+ RenderObject* object = renderer();
+ if (!object)
return;
if (SVGURIReference::isKnownAttribute(attrName)) {
@@ -173,8 +175,8 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
}
if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
- renderer()->setNeedsTransformUpdate();
- renderer()->setNeedsLayout(true);
+ object->setNeedsTransformUpdate();
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(object);
return;
}
@@ -256,8 +258,8 @@ void SVGUseElement::updateContainerSizes()
// Update whole subtree, scanning for shadow container elements, that correspond to <svg>/<symbol> tags
updateContainerSize(this, m_targetElementInstance.get());
- if (renderer())
- renderer()->setNeedsLayout(true);
+ if (RenderObject* object = renderer())
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(object);
}
static void updateContainerOffset(SVGElementInstance* targetInstance)
@@ -308,8 +310,8 @@ void SVGUseElement::updateContainerOffsets()
// Update whole subtree, scanning for shadow container elements, marking a cloned use subtree
updateContainerOffset(m_targetElementInstance.get());
- if (renderer())
- renderer()->setNeedsLayout(true);
+ if (RenderObject* object = renderer())
+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(object);
}
void SVGUseElement::recalcStyle(StyleChange change)
diff --git a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp b/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp
index 39b3e57..ddd4928 100644
--- a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp
@@ -194,13 +194,27 @@ void FEConvolveMatrix::setPreserveAlpha(bool preserveAlpha)
and would make it really hard to understand.
*/
-static ALWAYS_INLINE unsigned char clampRGBAValue(float rgba)
+static ALWAYS_INLINE unsigned char clampRGBAValue(float channel, unsigned char max = 255)
{
- if (rgba <= 0)
+ if (channel <= 0)
return 0;
- if (rgba >= 255)
- return 255;
- return rgba;
+ if (channel >= max)
+ return max;
+ return channel;
+}
+
+template<bool preserveAlphaValues>
+ALWAYS_INLINE void setDestinationPixels(CanvasPixelArray* image, int& pixel, float* totals, float divisor, float bias, CanvasPixelArray* src)
+{
+ unsigned char maxAlpha = preserveAlphaValues ? 255 : clampRGBAValue(totals[3] / divisor + bias);
+ for (int i = 0; i < 3; ++i)
+ image->set(pixel++, clampRGBAValue(totals[i] / divisor + bias, maxAlpha));
+
+ if (preserveAlphaValues) {
+ image->set(pixel, src->get(pixel));
+ ++pixel;
+ } else
+ image->set(pixel++, maxAlpha);
}
// Only for region C
@@ -244,15 +258,7 @@ ALWAYS_INLINE void FEConvolveMatrix::fastSetInteriorPixels(PaintingData& paintin
}
}
- paintingData.dstPixelArray->set(pixel++, clampRGBAValue(totals[0] / m_divisor + paintingData.bias));
- paintingData.dstPixelArray->set(pixel++, clampRGBAValue(totals[1] / m_divisor + paintingData.bias));
- paintingData.dstPixelArray->set(pixel++, clampRGBAValue(totals[2] / m_divisor + paintingData.bias));
- if (!preserveAlphaValues)
- paintingData.dstPixelArray->set(pixel++, clampRGBAValue(totals[3] / m_divisor + paintingData.bias));
- else {
- paintingData.dstPixelArray->set(pixel, paintingData.srcPixelArray->get(pixel));
- ++pixel;
- }
+ setDestinationPixels<preserveAlphaValues>(paintingData.dstPixelArray, pixel, totals, m_divisor, paintingData.bias, paintingData.srcPixelArray);
startKernelPixel += 4;
}
pixel += xIncrease;
@@ -337,15 +343,7 @@ void FEConvolveMatrix::fastSetOuterPixels(PaintingData& paintingData, int x1, in
}
}
- paintingData.dstPixelArray->set(pixel++, clampRGBAValue(totals[0] / m_divisor + paintingData.bias));
- paintingData.dstPixelArray->set(pixel++, clampRGBAValue(totals[1] / m_divisor + paintingData.bias));
- paintingData.dstPixelArray->set(pixel++, clampRGBAValue(totals[2] / m_divisor + paintingData.bias));
- if (!preserveAlphaValues)
- paintingData.dstPixelArray->set(pixel++, clampRGBAValue(totals[3] / m_divisor + paintingData.bias));
- else {
- paintingData.dstPixelArray->set(pixel, paintingData.srcPixelArray->get(pixel));
- ++pixel;
- }
+ setDestinationPixels<preserveAlphaValues>(paintingData.dstPixelArray, pixel, totals, m_divisor, paintingData.bias, paintingData.srcPixelArray);
++startKernelPixelX;
}
pixel += xIncrease;
diff --git a/WebCore/websockets/WebSocket.cpp b/WebCore/websockets/WebSocket.cpp
index 91761fb..38629d7 100644
--- a/WebCore/websockets/WebSocket.cpp
+++ b/WebCore/websockets/WebSocket.cpp
@@ -78,8 +78,6 @@ static String encodeProtocolString(const String& protocol)
return builder.toString();
}
-#if USE(V8)
-
static bool webSocketsAvailable = false;
void WebSocket::setIsAvailable(bool available)
@@ -92,8 +90,6 @@ bool WebSocket::isAvailable()
return webSocketsAvailable;
}
-#endif
-
WebSocket::WebSocket(ScriptExecutionContext* context)
: ActiveDOMObject(context, this)
, m_state(CONNECTING)
diff --git a/WebCore/websockets/WebSocket.h b/WebCore/websockets/WebSocket.h
index b2102d1..2c95ff9 100644
--- a/WebCore/websockets/WebSocket.h
+++ b/WebCore/websockets/WebSocket.h
@@ -50,10 +50,8 @@ namespace WebCore {
class WebSocket : public RefCounted<WebSocket>, public EventTarget, public ActiveDOMObject, public WebSocketChannelClient {
public:
-#if USE(V8)
static void setIsAvailable(bool);
static bool isAvailable();
-#endif
static PassRefPtr<WebSocket> create(ScriptExecutionContext* context) { return adoptRef(new WebSocket(context)); }
virtual ~WebSocket();
diff --git a/WebCore/xml/XMLHttpRequest.cpp b/WebCore/xml/XMLHttpRequest.cpp
index 8762bb5..3e76407 100644
--- a/WebCore/xml/XMLHttpRequest.cpp
+++ b/WebCore/xml/XMLHttpRequest.cpp
@@ -283,7 +283,8 @@ void XMLHttpRequest::callReadyStateChangeListener()
timelineAgent->willChangeXHRReadyState(m_url.string(), m_state);
#endif
- m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent), m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent);
+ if (m_async || (m_state <= OPENED || m_state == DONE))
+ m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent), m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent);
#if ENABLE(INSPECTOR)
if (callTimelineAgentOnReadyStateChange && (timelineAgent = InspectorTimelineAgent::retrieve(scriptExecutionContext())))
@@ -978,8 +979,10 @@ void XMLHttpRequest::didReceiveData(const char* data, int len)
long long expectedLength = m_response.expectedContentLength();
m_receivedLength += len;
- bool lengthComputable = expectedLength && m_receivedLength <= expectedLength;
- m_progressEventThrottle.dispatchProgressEvent(lengthComputable, static_cast<unsigned>(m_receivedLength), static_cast<unsigned>(expectedLength));
+ if (m_async) {
+ bool lengthComputable = expectedLength && m_receivedLength <= expectedLength;
+ m_progressEventThrottle.dispatchProgressEvent(lengthComputable, static_cast<unsigned>(m_receivedLength), static_cast<unsigned>(expectedLength));
+ }
if (m_state != LOADING)
changeState(LOADING);
diff --git a/WebCore/xml/XMLHttpRequestException.idl b/WebCore/xml/XMLHttpRequestException.idl
index 7121468..ffea732 100644
--- a/WebCore/xml/XMLHttpRequestException.idl
+++ b/WebCore/xml/XMLHttpRequestException.idl
@@ -29,7 +29,8 @@
module xml {
interface [
- NoStaticTables
+ NoStaticTables,
+ DontCheckEnums
] XMLHttpRequestException {
readonly attribute unsigned short code;
diff --git a/WebCore/xml/XPathException.idl b/WebCore/xml/XPathException.idl
index d5a9af6..b57df57 100644
--- a/WebCore/xml/XPathException.idl
+++ b/WebCore/xml/XPathException.idl
@@ -29,7 +29,8 @@
module xpath {
interface [
- Conditional=XPATH
+ Conditional=XPATH,
+ DontCheckEnums
] XPathException {
readonly attribute unsigned short code;