summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--JavaScriptCore/ChangeLog480
-rw-r--r--JavaScriptCore/Configurations/FeatureDefines.xcconfig3
-rw-r--r--JavaScriptCore/Configurations/Version.xcconfig2
-rw-r--r--JavaScriptCore/JavaScriptCore.exp8
-rw-r--r--JavaScriptCore/JavaScriptCore.pro32
-rw-r--r--JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.make2
-rw-r--r--JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def4
-rw-r--r--JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make1
-rw-r--r--JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj8
-rw-r--r--JavaScriptCore/parser/ASTBuilder.h1
-rw-r--r--JavaScriptCore/parser/JSParser.cpp134
-rw-r--r--JavaScriptCore/parser/JSParser.h3
-rw-r--r--JavaScriptCore/parser/Nodes.cpp31
-rw-r--r--JavaScriptCore/parser/Nodes.h22
-rw-r--r--JavaScriptCore/parser/Parser.cpp7
-rw-r--r--JavaScriptCore/parser/Parser.h25
-rw-r--r--JavaScriptCore/parser/SyntaxChecker.h1
-rw-r--r--JavaScriptCore/runtime/Collector.cpp4
-rw-r--r--JavaScriptCore/runtime/DatePrototype.cpp43
-rw-r--r--JavaScriptCore/runtime/Executable.cpp24
-rw-r--r--JavaScriptCore/runtime/Executable.h6
-rw-r--r--JavaScriptCore/runtime/GCActivityCallbackCF.cpp6
-rw-r--r--JavaScriptCore/runtime/JSArray.cpp9
-rw-r--r--JavaScriptCore/runtime/JSValue.cpp63
-rw-r--r--JavaScriptCore/runtime/JSValue.h88
-rw-r--r--JavaScriptCore/runtime/MemoryStatistics.cpp55
-rw-r--r--JavaScriptCore/runtime/MemoryStatistics.h46
-rw-r--r--JavaScriptCore/runtime/RegExpObject.h2
-rw-r--r--JavaScriptCore/wtf/FastMalloc.cpp3
-rw-r--r--JavaScriptCore/wtf/OwnPtrCommon.h4
-rw-r--r--JavaScriptCore/wtf/Platform.h6
-rw-r--r--JavaScriptCore/wtf/PlatformRefPtr.h5
-rw-r--r--JavaScriptCore/wtf/TypeTraits.cpp5
-rw-r--r--JavaScriptCore/wtf/TypeTraits.h12
-rw-r--r--JavaScriptCore/wtf/WTFThreadData.h9
-rw-r--r--JavaScriptCore/wtf/brew/OwnPtrBrew.cpp14
-rw-r--r--JavaScriptCore/wtf/gobject/GTypedefs.h2
-rw-r--r--JavaScriptCore/wtf/text/StringImpl.cpp6
-rw-r--r--JavaScriptCore/wtf/text/WTFString.h41
-rw-r--r--JavaScriptCore/wtf/unicode/Unicode.h2
-rw-r--r--JavaScriptCore/wtf/unicode/UnicodeMacrosFromICU.h (renamed from JavaScriptCore/wtf/unicode/glib/UnicodeMacrosFromICU.h)1
-rw-r--r--JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h45
-rw-r--r--JavaScriptCore/wtf/unicode/wince/UnicodeWinCE.cpp (renamed from JavaScriptCore/wtf/unicode/wince/UnicodeWince.cpp)2
-rw-r--r--JavaScriptCore/wtf/unicode/wince/UnicodeWinCE.h (renamed from JavaScriptCore/wtf/unicode/wince/UnicodeWince.h)51
-rw-r--r--JavaScriptCore/wtf/wince/FastMallocWinCE.h (renamed from JavaScriptCore/wtf/wince/FastMallocWince.h)7
-rw-r--r--JavaScriptCore/wtf/wtf.pri35
-rw-r--r--JavaScriptCore/yarr/RegexCompiler.cpp95
-rw-r--r--JavaScriptCore/yarr/RegexJIT.cpp182
-rw-r--r--JavaScriptCore/yarr/RegexPattern.h31
-rw-r--r--JavaScriptGlue/Configurations/Version.xcconfig2
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js8
-rw-r--r--LayoutTests/fast/dom/HTMLFontElement/script-tests/size-attribute.js37
-rw-r--r--LayoutTests/fast/dom/HTMLFontElement/size-attribute-expected.txt32
-rw-r--r--LayoutTests/fast/dom/beforeload/remove-frame-in-beforeload-listener.html4
-rw-r--r--LayoutTests/http/tests/resources/last-modified.php7
-rw-r--r--LayoutTests/storage/indexeddb/index-basics-expected.txt331
-rw-r--r--LayoutTests/storage/indexeddb/index-basics.html217
-rw-r--r--LayoutTests/storage/indexeddb/index-cursor-expected.txt2111
-rw-r--r--LayoutTests/storage/indexeddb/index-cursor.html238
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-basics-expected.txt23
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-basics.html15
-rw-r--r--SunSpider/ChangeLog16
-rw-r--r--SunSpider/resources/sunspider-standalone-driver.js7
-rwxr-xr-xSunSpider/sunspider7
-rw-r--r--WebCore/Android.mk5
-rw-r--r--WebCore/CMakeLists.txt25
-rw-r--r--WebCore/CMakeListsEfl.txt6
-rw-r--r--WebCore/ChangeLog6971
-rw-r--r--WebCore/Configurations/FeatureDefines.xcconfig3
-rw-r--r--WebCore/Configurations/Version.xcconfig2
-rw-r--r--WebCore/DerivedSources.cpp1
-rw-r--r--WebCore/DerivedSources.make5
-rw-r--r--WebCore/English.lproj/localizedStrings.jsbin45952 -> 47620 bytes
-rw-r--r--WebCore/GNUmakefile.am2796
-rw-r--r--WebCore/WebCore.exp.in35
-rw-r--r--WebCore/WebCore.gyp/WebCore.gyp338
-rw-r--r--WebCore/WebCore.gypi21
-rw-r--r--WebCore/WebCore.pri56
-rw-r--r--WebCore/WebCore.pro949
-rw-r--r--WebCore/WebCore.vcproj/QTMovieWin.vcproj16
-rw-r--r--WebCore/WebCore.vcproj/WebCore.vcproj260
-rw-r--r--WebCore/WebCore.vcproj/WebCoreCommon.vsprops2
-rwxr-xr-xWebCore/WebCore.vcproj/copyForwardingHeaders.cmd1
-rw-r--r--WebCore/WebCore.xcodeproj/project.pbxproj468
-rw-r--r--[-rwxr-xr-x]WebCore/accessibility/AccessibilityAllInOne.cpp0
-rw-r--r--WebCore/accessibility/AccessibilityObject.cpp17
-rw-r--r--WebCore/accessibility/AccessibilityObject.h2
-rw-r--r--WebCore/accessibility/AccessibilityRenderObject.cpp33
-rw-r--r--WebCore/accessibility/AccessibilityTableRow.cpp3
-rw-r--r--WebCore/accessibility/chromium/AXObjectCacheChromium.cpp50
-rw-r--r--WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp25
-rw-r--r--WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp141
-rw-r--r--WebCore/accessibility/mac/AccessibilityObjectWrapper.mm9
-rw-r--r--WebCore/bindings/generic/ActiveDOMCallback.cpp2
-rw-r--r--WebCore/bindings/js/JSDOMBinding.h7
-rw-r--r--WebCore/bindings/js/JSDirectoryEntryCustom.cpp141
-rw-r--r--WebCore/bindings/js/JSEntryCustom.cpp61
-rw-r--r--WebCore/bindings/js/JSEventCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSSVGPODListCustom.h8
-rw-r--r--WebCore/bindings/js/JSSVGPathSegListCustom.cpp8
-rw-r--r--WebCore/bindings/js/ScriptDebugServer.cpp2
-rw-r--r--WebCore/bindings/js/SerializedScriptValue.cpp75
-rw-r--r--WebCore/bindings/scripts/CodeGenerator.pm9
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorV8.pm18
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp6
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h4
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestObj.cpp2
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestObj.h4
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm6
-rw-r--r--WebCore/bindings/scripts/test/TestObj.idl10
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestInterface.cpp22
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestInterface.h31
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestObj.cpp101
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestObj.h31
-rw-r--r--WebCore/bindings/v8/DebuggerScript.js (renamed from WebKit/chromium/src/js/DebuggerScript.js)45
-rw-r--r--WebCore/bindings/v8/NPV8Object.cpp2
-rw-r--r--WebCore/bindings/v8/ScriptCachedFrameData.h2
-rw-r--r--WebCore/bindings/v8/ScriptController.cpp4
-rw-r--r--WebCore/bindings/v8/ScriptController.h14
-rw-r--r--WebCore/bindings/v8/ScriptControllerQt.cpp49
-rw-r--r--[-rwxr-xr-x]WebCore/bindings/v8/ScriptValue.cpp0
-rw-r--r--WebCore/bindings/v8/SerializedScriptValue.cpp6
-rw-r--r--WebCore/bindings/v8/V8Binding.cpp2
-rw-r--r--WebCore/bindings/v8/V8Helpers.h2
-rw-r--r--WebCore/bindings/v8/V8NPObject.h2
-rw-r--r--WebCore/bindings/v8/V8NPUtils.h2
-rw-r--r--WebCore/bindings/v8/V8Proxy.cpp1
-rw-r--r--WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp13
-rw-r--r--WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp15
-rw-r--r--WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp139
-rw-r--r--WebCore/bindings/v8/custom/V8EntryCustom.cpp61
-rw-r--r--WebCore/bindings/v8/custom/V8EventCustom.cpp3
-rw-r--r--WebCore/bindings/v8/npruntime_internal.h12
-rw-r--r--WebCore/bridge/npruntime_internal.h2
-rw-r--r--WebCore/config.h9
-rw-r--r--WebCore/css/CSSComputedStyleDeclaration.cpp176
-rw-r--r--WebCore/css/CSSComputedStyleDeclaration.h2
-rw-r--r--WebCore/css/CSSGrammar.y33
-rw-r--r--WebCore/css/CSSHelper.h17
-rw-r--r--WebCore/css/CSSMutableStyleDeclaration.h2
-rw-r--r--WebCore/css/CSSParser.cpp129
-rw-r--r--WebCore/css/CSSParser.h15
-rw-r--r--WebCore/css/CSSPrimitiveValueMappings.h55
-rw-r--r--WebCore/css/CSSProperty.cpp264
-rw-r--r--WebCore/css/CSSProperty.h3
-rw-r--r--WebCore/css/CSSPropertyNames.in20
-rw-r--r--WebCore/css/CSSPropertySourceData.cpp135
-rw-r--r--WebCore/css/CSSPropertySourceData.h90
-rw-r--r--WebCore/css/CSSStyleSelector.cpp139
-rw-r--r--WebCore/css/CSSStyleSelector.h8
-rw-r--r--WebCore/css/CSSValueKeywords.in14
-rw-r--r--WebCore/css/SVGCSSComputedStyleDeclaration.cpp2
-rw-r--r--WebCore/css/SVGCSSParser.cpp2
-rw-r--r--WebCore/css/SVGCSSValueKeywords.in9
-rw-r--r--WebCore/css/mediaControlsQuickTime.css2
-rw-r--r--WebCore/dom/ActiveDOMObject.cpp2
-rw-r--r--WebCore/dom/ActiveDOMObject.h7
-rw-r--r--WebCore/dom/AsyncScriptRunner.cpp2
-rw-r--r--WebCore/dom/ContainerNode.cpp15
-rw-r--r--WebCore/dom/DOMStringMap.h3
-rw-r--r--WebCore/dom/DatasetDOMStringMap.h2
-rw-r--r--WebCore/dom/Document.cpp112
-rw-r--r--WebCore/dom/Document.h4
-rw-r--r--WebCore/dom/Document.idl2
-rw-r--r--WebCore/dom/Element.cpp29
-rw-r--r--WebCore/dom/Event.cpp5
-rw-r--r--WebCore/dom/Event.h1
-rw-r--r--WebCore/dom/EventTarget.cpp2
-rw-r--r--WebCore/dom/EventTarget.h2
-rw-r--r--WebCore/dom/ExceptionCode.h2
-rw-r--r--WebCore/dom/HashChangeEvent.h65
-rw-r--r--WebCore/dom/HashChangeEvent.idl (renamed from WebCore/page/ZoomMode.h)25
-rw-r--r--WebCore/dom/InputElement.cpp2
-rw-r--r--WebCore/dom/MouseRelatedEvent.cpp9
-rw-r--r--WebCore/dom/Node.cpp58
-rw-r--r--WebCore/dom/Node.h10
-rw-r--r--WebCore/dom/Range.cpp17
-rw-r--r--WebCore/dom/Range.h2
-rw-r--r--WebCore/dom/ScriptElement.cpp24
-rw-r--r--WebCore/dom/ScriptExecutionContext.cpp33
-rw-r--r--WebCore/dom/ScriptExecutionContext.h13
-rw-r--r--WebCore/dom/Touch.cpp8
-rw-r--r--WebCore/dom/ViewportArguments.cpp318
-rw-r--r--WebCore/dom/ViewportArguments.h41
-rw-r--r--WebCore/dom/XMLDocumentParser.h4
-rw-r--r--WebCore/dom/XMLDocumentParserLibxml2.cpp45
-rw-r--r--WebCore/editing/ApplyStyleCommand.cpp70
-rw-r--r--WebCore/editing/ApplyStyleCommand.h7
-rw-r--r--WebCore/editing/DeleteButton.cpp12
-rw-r--r--WebCore/editing/DeleteSelectionCommand.cpp2
-rw-r--r--WebCore/editing/Editor.cpp113
-rw-r--r--WebCore/editing/Editor.h3
-rw-r--r--WebCore/editing/EditorCommand.cpp11
-rw-r--r--WebCore/editing/InsertLineBreakCommand.cpp2
-rw-r--r--WebCore/editing/InsertTextCommand.cpp2
-rw-r--r--WebCore/editing/RemoveFormatCommand.cpp2
-rw-r--r--WebCore/editing/ReplaceSelectionCommand.cpp4
-rw-r--r--WebCore/editing/SelectionController.cpp240
-rw-r--r--WebCore/editing/SelectionController.h40
-rw-r--r--WebCore/editing/TextIterator.cpp26
-rw-r--r--WebCore/editing/TextIterator.h23
-rw-r--r--WebCore/editing/TypingCommand.cpp6
-rw-r--r--WebCore/editing/mac/EditorMac.mm43
-rw-r--r--WebCore/editing/markup.cpp491
-rw-r--r--WebCore/features.pri1
-rw-r--r--WebCore/fileapi/AsyncFileWriter.h4
-rw-r--r--WebCore/fileapi/Blob.cpp44
-rw-r--r--WebCore/fileapi/Blob.h28
-rw-r--r--WebCore/fileapi/Blob.idl2
-rw-r--r--WebCore/fileapi/BlobBuilder.cpp4
-rw-r--r--WebCore/fileapi/BlobBuilder.h3
-rw-r--r--WebCore/fileapi/BlobBuilder.idl2
-rw-r--r--WebCore/fileapi/BlobURL.cpp35
-rw-r--r--WebCore/fileapi/BlobURL.h22
-rw-r--r--WebCore/fileapi/DOMFilePath.cpp2
-rw-r--r--WebCore/fileapi/DirectoryEntry.h4
-rw-r--r--WebCore/fileapi/DirectoryEntry.idl4
-rw-r--r--WebCore/fileapi/Entry.cpp6
-rw-r--r--WebCore/fileapi/Entry.idl7
-rw-r--r--WebCore/fileapi/File.cpp13
-rw-r--r--WebCore/fileapi/File.h19
-rw-r--r--WebCore/fileapi/FileEntry.cpp14
-rw-r--r--WebCore/fileapi/FileEntry.h6
-rw-r--r--WebCore/fileapi/FileEntry.idl2
-rw-r--r--WebCore/fileapi/FileError.h4
-rw-r--r--WebCore/fileapi/FileError.idl2
-rw-r--r--WebCore/fileapi/FileException.h4
-rw-r--r--WebCore/fileapi/FileException.idl2
-rw-r--r--WebCore/fileapi/FileReader.cpp22
-rw-r--r--WebCore/fileapi/FileReader.h3
-rw-r--r--WebCore/fileapi/FileReaderSync.cpp10
-rw-r--r--WebCore/fileapi/FileStreamProxy.cpp4
-rw-r--r--WebCore/fileapi/FileStreamProxy.h4
-rw-r--r--WebCore/fileapi/FileSystemCallbacks.cpp12
-rw-r--r--WebCore/fileapi/FileThread.cpp4
-rw-r--r--WebCore/fileapi/FileThread.h4
-rw-r--r--WebCore/fileapi/FileWriter.cpp4
-rw-r--r--WebCore/fileapi/FileWriter.h6
-rw-r--r--WebCore/fileapi/FileWriter.idl2
-rw-r--r--WebCore/fileapi/FileWriterCallback.h4
-rw-r--r--WebCore/fileapi/FileWriterCallback.idl2
-rw-r--r--WebCore/fileapi/FileWriterClient.h4
-rw-r--r--WebCore/fileapi/Flags.idl7
-rw-r--r--WebCore/fileapi/ThreadableBlobRegistry.cpp15
-rw-r--r--WebCore/fileapi/ThreadableBlobRegistry.h7
-rw-r--r--WebCore/history/CachedFrame.cpp2
-rw-r--r--WebCore/history/PageCache.cpp1
-rw-r--r--WebCore/html/HTMLAnchorElement.cpp229
-rw-r--r--WebCore/html/HTMLAnchorElement.h17
-rw-r--r--WebCore/html/HTMLBodyElement.cpp50
-rw-r--r--WebCore/html/HTMLCanvasElement.cpp2
-rw-r--r--WebCore/html/HTMLDocument.cpp9
-rw-r--r--WebCore/html/HTMLDocument.h7
-rw-r--r--WebCore/html/HTMLElement.cpp32
-rw-r--r--WebCore/html/HTMLFontElement.cpp159
-rw-r--r--WebCore/html/HTMLFormElement.cpp34
-rw-r--r--WebCore/html/HTMLFormElement.h12
-rw-r--r--WebCore/html/HTMLFrameElementBase.cpp53
-rw-r--r--WebCore/html/HTMLFrameElementBase.h22
-rw-r--r--WebCore/html/HTMLFrameOwnerElement.cpp5
-rw-r--r--WebCore/html/HTMLInputElement.cpp222
-rw-r--r--WebCore/html/HTMLInputElement.h61
-rw-r--r--WebCore/html/HTMLMarqueeElement.cpp2
-rw-r--r--WebCore/html/HTMLMarqueeElement.h2
-rw-r--r--WebCore/html/HTMLMediaElement.cpp43
-rw-r--r--WebCore/html/HTMLMediaElement.h2
-rw-r--r--WebCore/html/HTMLMeterElement.cpp2
-rw-r--r--WebCore/html/HTMLObjectElement.cpp22
-rw-r--r--WebCore/html/HTMLPlugInImageElement.h1
-rw-r--r--WebCore/html/HTMLProgressElement.cpp2
-rw-r--r--WebCore/html/HTMLTextAreaElement.cpp2
-rw-r--r--WebCore/html/ImageDocument.cpp12
-rw-r--r--WebCore/html/StepRange.cpp4
-rw-r--r--[-rwxr-xr-x]WebCore/html/canvas/CanvasRenderingContext2D.cpp2
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.cpp14
-rw-r--r--WebCore/html/parser/HTMLConstructionSite.cpp20
-rw-r--r--WebCore/html/parser/HTMLDocumentParser.cpp29
-rw-r--r--WebCore/html/parser/HTMLDocumentParser.h4
-rw-r--r--WebCore/html/parser/HTMLElementStack.cpp27
-rw-r--r--WebCore/html/parser/HTMLElementStack.h2
-rw-r--r--WebCore/html/parser/HTMLParserIdioms.cpp144
-rw-r--r--WebCore/html/parser/HTMLParserIdioms.h66
-rw-r--r--WebCore/html/parser/HTMLPreloadScanner.cpp12
-rw-r--r--WebCore/html/parser/HTMLScriptRunner.cpp37
-rw-r--r--WebCore/html/parser/HTMLScriptRunner.h2
-rw-r--r--WebCore/html/parser/HTMLTokenizer.cpp64
-rw-r--r--WebCore/html/parser/HTMLTokenizer.h36
-rw-r--r--WebCore/html/parser/HTMLTreeBuilder.cpp187
-rw-r--r--WebCore/html/parser/HTMLTreeBuilder.h15
-rw-r--r--WebCore/html/parser/HTMLViewSourceParser.cpp12
-rw-r--r--WebCore/html/parser/NestingLevelIncrementer.h50
-rw-r--r--WebCore/inspector/CodeGeneratorInspector.pm1
-rw-r--r--WebCore/inspector/Inspector.idl13
-rw-r--r--WebCore/inspector/InspectorCSSStore.cpp168
-rw-r--r--WebCore/inspector/InspectorCSSStore.h27
-rw-r--r--WebCore/inspector/InspectorClient.h5
-rw-r--r--WebCore/inspector/InspectorController.cpp369
-rw-r--r--WebCore/inspector/InspectorController.h34
-rw-r--r--WebCore/inspector/InspectorDOMAgent.cpp166
-rw-r--r--WebCore/inspector/InspectorDOMAgent.h5
-rw-r--r--WebCore/inspector/InspectorDebuggerAgent.cpp3
-rw-r--r--WebCore/inspector/InspectorProfilerAgent.cpp1
-rw-r--r--WebCore/inspector/InspectorResource.cpp109
-rw-r--r--WebCore/inspector/InspectorResource.h40
-rw-r--r--[-rwxr-xr-x]WebCore/inspector/front-end/AuditFormatters.js10
-rw-r--r--WebCore/inspector/front-end/BreakpointsSidebarPane.js11
-rw-r--r--WebCore/inspector/front-end/CallStackSidebarPane.js34
-rw-r--r--WebCore/inspector/front-end/ConsoleView.js15
-rw-r--r--WebCore/inspector/front-end/ElementsPanel.js39
-rw-r--r--WebCore/inspector/front-end/ElementsTreeOutline.js63
-rw-r--r--WebCore/inspector/front-end/HAREntry.js97
-rw-r--r--WebCore/inspector/front-end/InjectedScript.js4
-rw-r--r--WebCore/inspector/front-end/ProfileDataGridTree.js15
-rw-r--r--WebCore/inspector/front-end/Resource.js11
-rw-r--r--WebCore/inspector/front-end/ResourceView.js21
-rw-r--r--WebCore/inspector/front-end/ResourcesPanel.js45
-rw-r--r--WebCore/inspector/front-end/ScriptsPanel.js9
-rw-r--r--WebCore/inspector/front-end/Settings.js3
-rw-r--r--WebCore/inspector/front-end/StylesSidebarPane.js12
-rw-r--r--WebCore/inspector/front-end/WebKit.qrc1
-rw-r--r--WebCore/inspector/front-end/inspector.css17
-rw-r--r--WebCore/inspector/front-end/inspector.js155
-rw-r--r--WebCore/inspector/front-end/treeoutline.js1
-rw-r--r--WebCore/inspector/front-end/utilities.js9
-rw-r--r--WebCore/loader/Cache.cpp13
-rw-r--r--WebCore/loader/DocumentLoader.cpp27
-rw-r--r--WebCore/loader/DocumentLoader.h4
-rw-r--r--WebCore/loader/EmptyClients.h4
-rw-r--r--WebCore/loader/FrameLoader.cpp54
-rw-r--r--WebCore/loader/FrameLoader.h6
-rw-r--r--WebCore/loader/FrameLoaderClient.h1
-rw-r--r--WebCore/loader/MainResourceLoader.cpp12
-rw-r--r--WebCore/loader/MainResourceLoader.h2
-rw-r--r--WebCore/loader/NetscapePlugInStreamLoader.cpp4
-rw-r--r--WebCore/loader/NetscapePlugInStreamLoader.h2
-rw-r--r--WebCore/loader/PingLoader.cpp4
-rw-r--r--WebCore/loader/PingLoader.h2
-rw-r--r--WebCore/loader/RedirectScheduler.cpp32
-rw-r--r--WebCore/loader/ResourceLoadNotifier.cpp10
-rw-r--r--WebCore/loader/ResourceLoadNotifier.h4
-rw-r--r--WebCore/loader/ResourceLoader.cpp16
-rw-r--r--WebCore/loader/ResourceLoader.h6
-rw-r--r--WebCore/loader/SubframeLoader.cpp17
-rw-r--r--WebCore/loader/SubframeLoader.h2
-rw-r--r--WebCore/loader/SubresourceLoader.cpp10
-rw-r--r--WebCore/loader/SubresourceLoader.h2
-rw-r--r--WebCore/loader/appcache/ApplicationCacheGroup.cpp7
-rw-r--r--WebCore/loader/appcache/ApplicationCacheGroup.h2
-rw-r--r--WebCore/loader/icon/IconDatabase.cpp1
-rw-r--r--WebCore/loader/icon/IconFetcher.cpp5
-rw-r--r--WebCore/loader/icon/IconFetcher.h6
-rw-r--r--WebCore/loader/icon/IconLoader.cpp1
-rw-r--r--WebCore/loader/icon/wince/IconDatabaseWinCE.cpp (renamed from WebCore/loader/icon/wince/IconDatabaseWince.cpp)0
-rw-r--r--WebCore/manual-tests/qt/numpad-enter-key.html22
-rw-r--r--WebCore/manual-tests/selection-drag-crash.html14
-rw-r--r--[-rwxr-xr-x]WebCore/manual-tests/spatial-navigation/links.html0
-rw-r--r--[-rwxr-xr-x]WebCore/manual-tests/spatial-navigation/spatial-navigation-test-cases.html0
-rw-r--r--WebCore/page/Chrome.cpp4
-rw-r--r--WebCore/page/ContextMenuController.cpp2
-rw-r--r--WebCore/page/DOMTimer.cpp3
-rw-r--r--WebCore/page/DOMTimer.h2
-rw-r--r--WebCore/page/DOMWindow.cpp20
-rw-r--r--WebCore/page/DOMWindow.idl7
-rw-r--r--WebCore/page/DragController.cpp20
-rw-r--r--WebCore/page/EditorClient.h9
-rw-r--r--WebCore/page/EventHandler.cpp69
-rw-r--r--WebCore/page/FocusController.cpp2
-rwxr-xr-x[-rw-r--r--]WebCore/page/Frame.cpp324
-rw-r--r--WebCore/page/Frame.h174
-rw-r--r--WebCore/page/FrameView.cpp111
-rw-r--r--WebCore/page/FrameView.h31
-rw-r--r--WebCore/page/PageGroupLoadDeferrer.cpp4
-rw-r--r--WebCore/page/PrintContext.cpp28
-rw-r--r--WebCore/page/SecurityOrigin.cpp45
-rw-r--r--WebCore/page/SecurityOrigin.h8
-rw-r--r--WebCore/page/Settings.cpp22
-rw-r--r--WebCore/page/Settings.h14
-rw-r--r--WebCore/page/SuspendableTimer.cpp2
-rw-r--r--WebCore/page/SuspendableTimer.h2
-rw-r--r--WebCore/page/animation/AnimationBase.cpp4
-rw-r--r--WebCore/page/animation/AnimationBase.h2
-rw-r--r--WebCore/page/chromium/ChromeClientChromium.h4
-rw-r--r--WebCore/page/chromium/EventHandlerChromium.cpp2
-rw-r--r--WebCore/page/chromium/FrameChromium.cpp6
-rw-r--r--WebCore/page/gtk/DragControllerGtk.cpp3
-rw-r--r--WebCore/page/mac/EventHandlerMac.mm53
-rw-r--r--WebCore/page/mac/FrameMac.mm83
-rw-r--r--WebCore/page/win/FrameCGWin.cpp2
-rw-r--r--WebCore/page/wince/FrameWinCE.cpp (renamed from WebCore/page/wince/FrameWince.cpp)12
-rw-r--r--WebCore/platform/AsyncFileStream.h4
-rw-r--r--WebCore/platform/DragImage.cpp2
-rw-r--r--WebCore/platform/DragImage.h4
-rw-r--r--WebCore/platform/FileStream.cpp4
-rw-r--r--WebCore/platform/FileStream.h4
-rw-r--r--WebCore/platform/FileStreamClient.h4
-rw-r--r--WebCore/platform/LinkHash.cpp118
-rw-r--r--WebCore/platform/MIMETypeRegistry.cpp14
-rw-r--r--WebCore/platform/Pasteboard.h3
-rw-r--r--WebCore/platform/ScrollAnimator.cpp2
-rw-r--r--WebCore/platform/ScrollAnimatorWin.cpp9
-rw-r--r--WebCore/platform/ScrollAnimatorWin.h5
-rw-r--r--WebCore/platform/ScrollView.cpp11
-rw-r--r--WebCore/platform/ScrollView.h1
-rw-r--r--WebCore/platform/animation/Animation.h4
-rw-r--r--WebCore/platform/audio/AudioFileReader.h54
-rw-r--r--WebCore/platform/audio/mac/AudioFileReaderMac.cpp257
-rw-r--r--WebCore/platform/audio/mac/AudioFileReaderMac.h71
-rw-r--r--WebCore/platform/brew/PlatformKeyboardEventBrew.cpp4
-rw-r--r--WebCore/platform/brew/PlatformMouseEventBrew.cpp13
-rw-r--r--WebCore/platform/brew/SSLKeyGeneratorBrew.cpp4
-rw-r--r--WebCore/platform/brew/SharedBufferBrew.cpp1
-rw-r--r--WebCore/platform/chromium/ClipboardChromium.cpp3
-rw-r--r--WebCore/platform/chromium/GeolocationServiceChromium.cpp4
-rw-r--r--WebCore/platform/chromium/GeolocationServiceChromium.h1
-rw-r--r--WebCore/platform/graphics/Gradient.cpp11
-rw-r--r--WebCore/platform/graphics/Gradient.h4
-rw-r--r--WebCore/platform/graphics/GraphicsContext3D.cpp34
-rw-r--r--WebCore/platform/graphics/GraphicsContext3D.h28
-rw-r--r--WebCore/platform/graphics/GraphicsLayer.cpp86
-rw-r--r--WebCore/platform/graphics/GraphicsLayer.h10
-rw-r--r--WebCore/platform/graphics/MediaPlayer.cpp2
-rw-r--r--WebCore/platform/graphics/Path.h9
-rw-r--r--WebCore/platform/graphics/cairo/FontCacheFreeType.cpp (renamed from WebCore/platform/graphics/cairo/FontCacheCairo.cpp)13
-rw-r--r--WebCore/platform/graphics/cairo/FontPlatformData.h164
-rw-r--r--WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp (renamed from WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp)82
-rw-r--r--WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h98
-rw-r--r--WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp4
-rw-r--r--WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp48
-rw-r--r--WebCore/platform/graphics/cairo/OwnPtrCairo.cpp14
-rw-r--r--WebCore/platform/graphics/cairo/OwnPtrCairo.h6
-rw-r--r--WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp33
-rw-r--r--WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h13
-rw-r--r--WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp16
-rw-r--r--WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp32
-rw-r--r--WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp27
-rw-r--r--WebCore/platform/graphics/chromium/CanvasLayerChromium.h3
-rw-r--r--WebCore/platform/graphics/chromium/ContentLayerChromium.cpp57
-rw-r--r--WebCore/platform/graphics/chromium/ContentLayerChromium.h5
-rw-r--r--WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp10
-rw-r--r--WebCore/platform/graphics/chromium/FontCacheLinux.cpp1
-rw-r--r--WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp32
-rw-r--r--WebCore/platform/graphics/chromium/GraphicsLayerChromium.h3
-rw-r--r--WebCore/platform/graphics/chromium/ImageChromium.cpp (renamed from WebKit/chromium/src/js/DevToolsHostStub.js)27
-rw-r--r--WebCore/platform/graphics/chromium/ImageLayerChromium.cpp21
-rw-r--r--WebCore/platform/graphics/chromium/ImageLayerChromium.h11
-rw-r--r--WebCore/platform/graphics/chromium/LayerChromium.cpp162
-rw-r--r--WebCore/platform/graphics/chromium/LayerChromium.h13
-rw-r--r--WebCore/platform/graphics/chromium/LayerRendererChromium.cpp289
-rw-r--r--WebCore/platform/graphics/chromium/LayerRendererChromium.h38
-rw-r--r--WebCore/platform/graphics/chromium/VideoLayerChromium.cpp18
-rw-r--r--WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp12
-rw-r--r--WebCore/platform/graphics/filters/FEBlend.cpp38
-rw-r--r--WebCore/platform/graphics/filters/FEBlend.h10
-rw-r--r--WebCore/platform/graphics/filters/FEColorMatrix.cpp16
-rw-r--r--WebCore/platform/graphics/filters/FEColorMatrix.h6
-rw-r--r--WebCore/platform/graphics/filters/FEComponentTransfer.cpp18
-rw-r--r--WebCore/platform/graphics/filters/FEComponentTransfer.h8
-rw-r--r--WebCore/platform/graphics/filters/FEComposite.cpp50
-rw-r--r--WebCore/platform/graphics/filters/FEComposite.h9
-rw-r--r--WebCore/platform/graphics/filters/FEGaussianBlur.cpp20
-rw-r--r--WebCore/platform/graphics/filters/FEGaussianBlur.h6
-rw-r--r--WebCore/platform/graphics/filters/Filter.h2
-rw-r--r--WebCore/platform/graphics/filters/FilterEffect.cpp90
-rw-r--r--WebCore/platform/graphics/filters/FilterEffect.h158
-rw-r--r--WebCore/platform/graphics/filters/SourceAlpha.cpp6
-rw-r--r--WebCore/platform/graphics/filters/SourceAlpha.h5
-rw-r--r--WebCore/platform/graphics/filters/SourceGraphic.cpp6
-rw-r--r--WebCore/platform/graphics/filters/SourceGraphic.h7
-rw-r--r--WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp40
-rw-r--r--WebCore/platform/graphics/gpu/SharedGraphicsContext3D.h17
-rw-r--r--WebCore/platform/graphics/gpu/SolidFillShader.cpp2
-rw-r--r--WebCore/platform/graphics/gpu/TexShader.cpp2
-rw-r--r--WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp4
-rw-r--r--WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp5
-rw-r--r--WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp12
-rw-r--r--WebCore/platform/graphics/gtk/FontCachePango.cpp65
-rw-r--r--WebCore/platform/graphics/gtk/FontGtk.cpp2
-rw-r--r--WebCore/platform/graphics/gtk/FontPlatformDataPango.h102
-rw-r--r--WebCore/platform/graphics/mac/GraphicsContext3DMac.mm1429
-rw-r--r--WebCore/platform/graphics/mac/GraphicsLayerCA.h10
-rw-r--r--WebCore/platform/graphics/mac/GraphicsLayerCA.mm62
-rw-r--r--WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp1454
-rw-r--r--WebCore/platform/graphics/qt/ContextShadow.cpp188
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp9
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContextQt.cpp14
-rw-r--r--WebCore/platform/graphics/qt/GraphicsLayerQt.cpp48
-rw-r--r--WebCore/platform/graphics/qt/GraphicsLayerQt.h1
-rw-r--r--WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp3
-rw-r--r--WebCore/platform/graphics/qt/PathQt.cpp28
-rw-r--r--WebCore/platform/graphics/qt/TransparencyLayer.h3
-rw-r--r--WebCore/platform/graphics/skia/ImageSkia.cpp6
-rw-r--r--WebCore/platform/graphics/skia/NativeImageSkia.cpp7
-rw-r--r--WebCore/platform/graphics/skia/NativeImageSkia.h1
-rw-r--r--[-rwxr-xr-x]WebCore/platform/graphics/skia/PlatformContextSkia.cpp0
-rw-r--r--WebCore/platform/graphics/win/FontPlatformDataCairoWin.h108
-rw-r--r--WebCore/platform/graphics/win/GraphicsLayerCACF.cpp36
-rw-r--r--WebCore/platform/graphics/win/GraphicsLayerCACF.h3
-rw-r--r--[-rwxr-xr-x]WebCore/platform/graphics/win/LocalWindowsContext.h0
-rwxr-xr-x[-rw-r--r--]WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp2
-rw-r--r--WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp134
-rw-r--r--WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h12
-rw-r--r--WebCore/platform/graphics/win/QTMovie.cpp60
-rw-r--r--WebCore/platform/graphics/win/QTMovie.h14
-rw-r--r--WebCore/platform/graphics/win/QTTrack.cpp119
-rw-r--r--WebCore/platform/graphics/win/QTTrack.h66
-rw-r--r--WebCore/platform/graphics/win/WKCACFLayer.cpp6
-rwxr-xr-x[-rw-r--r--]WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp48
-rwxr-xr-x[-rw-r--r--]WebCore/platform/graphics/win/WKCACFLayerRenderer.h6
-rw-r--r--[-rwxr-xr-x]WebCore/platform/graphics/win/WebLayer.cpp0
-rw-r--r--[-rwxr-xr-x]WebCore/platform/graphics/win/WebTiledLayer.cpp0
-rw-r--r--WebCore/platform/graphics/wince/ColorWinCE.cpp (renamed from WebCore/platform/graphics/wince/ColorWince.cpp)0
-rw-r--r--WebCore/platform/graphics/wince/FontCacheWinCE.cpp (renamed from WebCore/platform/graphics/wince/FontCacheWince.cpp)3
-rw-r--r--WebCore/platform/graphics/wince/FontWinCE.cpp (renamed from WebCore/platform/graphics/wince/FontWince.cpp)2
-rw-r--r--WebCore/platform/graphics/wince/GlyphPageTreeNodeWinCE.cpp (renamed from WebCore/platform/graphics/wince/GlyphPageTreeNodeWince.cpp)3
-rw-r--r--WebCore/platform/graphics/wince/GradientWinCE.cpp (renamed from WebCore/platform/graphics/wince/GradientWince.cpp)4
-rw-r--r--WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp (renamed from WebCore/platform/graphics/wince/GraphicsContextWince.cpp)2
-rw-r--r--WebCore/platform/graphics/wince/ImageBufferWinCE.cpp (renamed from WebCore/platform/graphics/wince/ImageBufferWince.cpp)28
-rw-r--r--WebCore/platform/graphics/wince/ImageWinCE.cpp199
-rw-r--r--WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h (renamed from WebCore/platform/graphics/wince/MediaPlayerPrivateWince.h)8
-rw-r--r--WebCore/platform/graphics/wince/PathWinCE.cpp (renamed from WebCore/platform/graphics/wince/PathWince.cpp)2
-rw-r--r--WebCore/platform/graphics/wince/PlatformPathWinCE.cpp (renamed from WebCore/platform/graphics/wince/PlatformPathWince.cpp)6
-rw-r--r--WebCore/platform/graphics/wince/PlatformPathWinCE.h (renamed from WebCore/platform/graphics/wince/PlatformPathWince.h)6
-rw-r--r--WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp (renamed from WebCore/platform/graphics/wince/SimpleFontDataWince.cpp)2
-rw-r--r--WebCore/platform/graphics/wince/WinCEGraphicsExtras.h (renamed from WebCore/platform/graphics/wince/WinceGraphicsExtras.h)6
-rw-r--r--WebCore/platform/gtk/ClipboardGtk.cpp3
-rw-r--r--WebCore/platform/gtk/DragImageGtk.cpp47
-rw-r--r--WebCore/platform/gtk/GtkVersioning.h9
-rw-r--r--WebCore/platform/gtk/KeyEventGtk.cpp1
-rw-r--r--WebCore/platform/gtk/PopupMenuGtk.cpp9
-rw-r--r--WebCore/platform/gtk/gtk2drawing.c23
-rw-r--r--WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp4
-rw-r--r--WebCore/platform/image-encoders/JPEGImageEncoder.cpp135
-rw-r--r--WebCore/platform/image-encoders/JPEGImageEncoder.h33
-rw-r--r--WebCore/platform/image-encoders/PNGImageEncoder.cpp126
-rw-r--r--WebCore/platform/image-encoders/PNGImageEncoder.h33
-rw-r--r--WebCore/platform/mac/ClipboardMac.mm5
-rw-r--r--WebCore/platform/mac/PasteboardMac.mm189
-rw-r--r--WebCore/platform/network/BlobResourceHandle.cpp6
-rw-r--r--WebCore/platform/network/NetworkingContext.h1
-rw-r--r--WebCore/platform/network/ResourceHandle.cpp5
-rw-r--r--WebCore/platform/network/ResourceHandle.h8
-rw-r--r--WebCore/platform/network/ResourceHandleClient.h3
-rw-r--r--WebCore/platform/network/ResourceHandleInternal.h7
-rw-r--r--WebCore/platform/network/cf/ResourceHandleCFNet.cpp23
-rw-r--r--WebCore/platform/network/curl/ResourceHandleCurl.cpp13
-rw-r--r--WebCore/platform/network/curl/ResourceHandleManager.cpp4
-rw-r--r--WebCore/platform/network/mac/ResourceHandleMac.mm33
-rw-r--r--WebCore/platform/network/qt/QNetworkReplyHandler.cpp29
-rw-r--r--WebCore/platform/network/qt/ResourceHandleQt.cpp32
-rw-r--r--WebCore/platform/network/soup/ResourceHandleSoup.cpp26
-rw-r--r--WebCore/platform/network/win/ResourceHandleWin.cpp17
-rw-r--r--WebCore/platform/qt/CookieJarQt.cpp5
-rw-r--r--WebCore/platform/qt/Language.cpp41
-rw-r--r--WebCore/platform/qt/MIMETypeRegistryQt.cpp2
-rw-r--r--WebCore/platform/qt/PlatformBridge.h98
-rw-r--r--WebCore/platform/qt/PlatformBridgeQt.cpp (renamed from WebCore/platform/text/brew/TextBreakIteratorInternalICUBrew.cpp)38
-rw-r--r--WebCore/platform/qt/PlatformKeyboardEventQt.cpp12
-rw-r--r--WebCore/platform/qt/RenderThemeQt.cpp2
-rw-r--r--WebCore/platform/text/wince/TextBoundariesWinCE.cpp (renamed from WebCore/platform/text/wince/TextBoundariesWince.cpp)3
-rw-r--r--WebCore/platform/text/wince/TextBreakIteratorWinCE.cpp (renamed from WebCore/platform/text/wince/TextBreakIteratorWince.cpp)0
-rw-r--r--WebCore/platform/text/wince/TextCodecWinCE.cpp33
-rw-r--r--WebCore/platform/text/wince/TextCodecWinCE.h6
-rw-r--r--WebCore/platform/win/ClipboardWin.cpp3
-rw-r--r--WebCore/platform/wince/CursorWinCE.cpp (renamed from WebCore/platform/wince/CursorWince.cpp)2
-rw-r--r--WebCore/platform/wince/DragDataWinCE.cpp (renamed from WebCore/platform/wince/DragDataWince.cpp)3
-rw-r--r--WebCore/platform/wince/DragImageWinCE.cpp (renamed from WebCore/platform/wince/DragImageWince.cpp)2
-rw-r--r--WebCore/platform/wince/EditorWinCE.cpp (renamed from WebCore/platform/wince/EditorWince.cpp)4
-rw-r--r--WebCore/platform/wince/FileChooserWinCE.cpp (renamed from WebCore/platform/wince/FileChooserWince.cpp)2
-rw-r--r--WebCore/platform/wince/FileSystemWinCE.cpp (renamed from WebCore/platform/wince/FileSystemWince.cpp)2
-rw-r--r--WebCore/platform/wince/KURLWinCE.cpp (renamed from WebCore/platform/wince/KURLWince.cpp)2
-rw-r--r--WebCore/platform/wince/KeygenWinCE.cpp (renamed from WebCore/platform/wince/KeygenWince.cpp)0
-rw-r--r--WebCore/platform/wince/MIMETypeRegistryWinCE.cpp (renamed from WebCore/platform/wince/MIMETypeRegistryWince.cpp)2
-rw-r--r--WebCore/platform/wince/PasteboardWinCE.cpp (renamed from WebCore/platform/wince/PasteboardWince.cpp)0
-rw-r--r--WebCore/platform/wince/SearchPopupMenuWinCE.cpp (renamed from WebCore/platform/wince/SearchPopupMenuWince.cpp)2
-rw-r--r--WebCore/platform/wince/SharedTimerWinCE.cpp (renamed from WebCore/platform/wince/SharedTimerWince.cpp)2
-rw-r--r--WebCore/platform/wx/PasteboardWx.cpp2
-rw-r--r--WebCore/plugins/PluginDatabase.cpp1
-rw-r--r--WebCore/plugins/PluginView.cpp34
-rw-r--r--WebCore/plugins/PluginView.h3
-rw-r--r--WebCore/plugins/gtk/PluginViewGtk.cpp4
-rw-r--r--WebCore/plugins/qt/PluginContainerQt.cpp2
-rw-r--r--WebCore/plugins/qt/PluginDataQt.cpp98
-rw-r--r--WebCore/plugins/qt/PluginViewQt.cpp12
-rw-r--r--WebCore/plugins/win/PluginViewWin.cpp4
-rw-r--r--WebCore/rendering/ColumnInfo.h54
-rw-r--r--WebCore/rendering/LayoutState.cpp75
-rw-r--r--WebCore/rendering/LayoutState.h25
-rw-r--r--WebCore/rendering/MediaControlElements.cpp2
-rw-r--r--WebCore/rendering/RenderBlock.cpp891
-rw-r--r--WebCore/rendering/RenderBlock.h152
-rw-r--r--WebCore/rendering/RenderBlockLineLayout.cpp127
-rw-r--r--WebCore/rendering/RenderBox.cpp30
-rw-r--r--WebCore/rendering/RenderBox.h8
-rw-r--r--WebCore/rendering/RenderBoxModelObject.cpp44
-rw-r--r--WebCore/rendering/RenderBoxModelObject.h4
-rw-r--r--WebCore/rendering/RenderEmbeddedObject.cpp6
-rw-r--r--WebCore/rendering/RenderFileUploadControl.cpp4
-rw-r--r--WebCore/rendering/RenderFlexibleBox.cpp234
-rw-r--r--WebCore/rendering/RenderFlexibleBox.h7
-rw-r--r--WebCore/rendering/RenderImage.cpp27
-rw-r--r--WebCore/rendering/RenderImage.h4
-rw-r--r--WebCore/rendering/RenderInline.cpp4
-rw-r--r--WebCore/rendering/RenderLayer.cpp12
-rw-r--r--WebCore/rendering/RenderLayerBacking.cpp12
-rwxr-xr-x[-rw-r--r--]WebCore/rendering/RenderLayerCompositor.cpp30
-rwxr-xr-x[-rw-r--r--]WebCore/rendering/RenderLayerCompositor.h2
-rw-r--r--WebCore/rendering/RenderLineBoxList.cpp6
-rw-r--r--WebCore/rendering/RenderMediaControls.cpp125
-rw-r--r--WebCore/rendering/RenderMediaControls.h1
-rw-r--r--WebCore/rendering/RenderObject.h10
-rw-r--r--WebCore/rendering/RenderReplaced.cpp72
-rw-r--r--WebCore/rendering/RenderReplaced.h9
-rw-r--r--WebCore/rendering/RenderSVGInline.h1
-rw-r--r--WebCore/rendering/RenderSVGInlineText.cpp41
-rw-r--r--WebCore/rendering/RenderSVGInlineText.h10
-rw-r--r--WebCore/rendering/RenderSVGResourceFilter.cpp15
-rw-r--r--WebCore/rendering/RenderSVGText.cpp4
-rw-r--r--WebCore/rendering/RenderSlider.cpp2
-rw-r--r--WebCore/rendering/RenderTable.cpp8
-rw-r--r--WebCore/rendering/RenderTableCell.cpp109
-rw-r--r--WebCore/rendering/RenderTableRow.cpp5
-rw-r--r--WebCore/rendering/RenderTableSection.cpp36
-rw-r--r--WebCore/rendering/RenderText.cpp58
-rw-r--r--WebCore/rendering/RenderText.h5
-rw-r--r--WebCore/rendering/RenderTextFragment.h15
-rw-r--r--WebCore/rendering/RenderThemeWin.cpp43
-rw-r--r--WebCore/rendering/RenderThemeWin.h9
-rw-r--r--WebCore/rendering/RenderThemeWinCE.cpp (renamed from WebCore/rendering/RenderThemeWince.cpp)98
-rw-r--r--WebCore/rendering/RenderThemeWinCE.h (renamed from WebCore/rendering/RenderThemeWince.h)12
-rw-r--r--WebCore/rendering/RenderVideo.cpp46
-rw-r--r--WebCore/rendering/RenderVideo.h3
-rw-r--r--WebCore/rendering/RenderView.cpp71
-rw-r--r--WebCore/rendering/RenderView.h127
-rw-r--r--WebCore/rendering/RootInlineBox.h6
-rw-r--r--WebCore/rendering/style/RenderStyle.cpp184
-rw-r--r--WebCore/rendering/style/RenderStyle.h48
-rw-r--r--WebCore/rendering/style/RenderStyleConstants.h5
-rw-r--r--WebCore/rendering/svg/SVGTextLayoutAttributes.cpp100
-rw-r--r--WebCore/rendering/svg/SVGTextLayoutAttributes.h89
-rw-r--r--WebCore/rendering/svg/SVGTextLayoutBuilder.cpp304
-rw-r--r--WebCore/rendering/svg/SVGTextLayoutBuilder.h67
-rw-r--r--WebCore/storage/AbstractDatabase.cpp1
-rw-r--r--WebCore/storage/Database.cpp1
-rw-r--r--WebCore/storage/DatabaseSync.cpp1
-rw-r--r--WebCore/storage/DatabaseTracker.cpp1
-rw-r--r--WebCore/storage/IDBAny.cpp2
-rw-r--r--WebCore/storage/IDBCursor.cpp2
-rw-r--r--WebCore/storage/IDBCursorBackendImpl.cpp60
-rw-r--r--WebCore/storage/IDBCursorBackendImpl.h19
-rw-r--r--WebCore/storage/IDBCursorBackendInterface.h2
-rw-r--r--WebCore/storage/IDBFactory.cpp11
-rw-r--r--WebCore/storage/IDBFactoryBackendImpl.cpp34
-rw-r--r--WebCore/storage/IDBFactoryBackendImpl.h2
-rw-r--r--WebCore/storage/IDBFactoryBackendInterface.h2
-rw-r--r--WebCore/storage/IDBIndex.cpp34
-rw-r--r--WebCore/storage/IDBIndex.h7
-rw-r--r--WebCore/storage/IDBIndex.idl12
-rw-r--r--WebCore/storage/IDBIndexBackendImpl.cpp98
-rw-r--r--WebCore/storage/IDBIndexBackendImpl.h8
-rw-r--r--WebCore/storage/IDBIndexBackendInterface.h10
-rw-r--r--WebCore/storage/IDBKey.cpp58
-rw-r--r--WebCore/storage/IDBKey.h6
-rw-r--r--WebCore/storage/IDBKeyRange.cpp30
-rw-r--r--WebCore/storage/IDBKeyRange.h3
-rw-r--r--[-rwxr-xr-x]WebCore/storage/IDBObjectStoreBackendImpl.cpp56
-rw-r--r--WebCore/storage/IDBRequest.cpp11
-rw-r--r--[-rwxr-xr-x]WebCore/storage/IDBTransactionBackendImpl.cpp0
-rw-r--r--[-rwxr-xr-x]WebCore/storage/IDBTransactionBackendImpl.h0
-rw-r--r--WebCore/storage/wince/DatabaseThreadWinCE.cpp (renamed from WebCore/storage/wince/DatabaseThreadWince.cpp)0
-rw-r--r--WebCore/storage/wince/DatabaseThreadWinCE.h (renamed from WebCore/storage/wince/DatabaseThreadWince.h)6
-rw-r--r--WebCore/storage/wince/LocalStorageThreadWinCE.cpp (renamed from WebCore/storage/wince/LocalStorageThreadWince.cpp)2
-rw-r--r--WebCore/storage/wince/LocalStorageThreadWinCE.h (renamed from WebCore/storage/wince/LocalStorageThreadWince.h)6
-rw-r--r--WebCore/svg/SVGAElement.cpp69
-rw-r--r--WebCore/svg/SVGFEBlendElement.cpp7
-rw-r--r--WebCore/svg/SVGFEColorMatrixElement.cpp4
-rw-r--r--WebCore/svg/SVGFEComponentTransferElement.cpp4
-rw-r--r--WebCore/svg/SVGFECompositeElement.cpp11
-rw-r--r--WebCore/svg/SVGFEConvolveMatrixElement.cpp10
-rw-r--r--WebCore/svg/SVGFEDiffuseLightingElement.cpp6
-rw-r--r--WebCore/svg/SVGFEDisplacementMapElement.cpp12
-rw-r--r--WebCore/svg/SVGFEGaussianBlurElement.cpp4
-rw-r--r--WebCore/svg/SVGFEMergeElement.cpp5
-rw-r--r--WebCore/svg/SVGFEMorphologyElement.cpp4
-rw-r--r--WebCore/svg/SVGFEOffsetElement.cpp4
-rw-r--r--WebCore/svg/SVGFESpecularLightingElement.cpp8
-rw-r--r--WebCore/svg/SVGFETileElement.cpp4
-rw-r--r--WebCore/svg/SVGFETurbulenceElement.cpp14
-rw-r--r--WebCore/svg/SVGFETurbulenceElement.h1
-rw-r--r--WebCore/svg/SVGGElement.cpp5
-rw-r--r--WebCore/svg/SVGGElement.h2
-rw-r--r--WebCore/svg/SVGImageLoader.cpp2
-rw-r--r--WebCore/svg/SVGSVGElement.cpp8
-rw-r--r--WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp20
-rw-r--r--WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h6
-rw-r--r--WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp10
-rw-r--r--WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h4
-rw-r--r--WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp31
-rw-r--r--WebCore/svg/graphics/filters/SVGFEDisplacementMap.h9
-rw-r--r--WebCore/svg/graphics/filters/SVGFEFlood.cpp2
-rw-r--r--WebCore/svg/graphics/filters/SVGFEImage.cpp2
-rw-r--r--WebCore/svg/graphics/filters/SVGFELighting.cpp12
-rw-r--r--WebCore/svg/graphics/filters/SVGFELighting.h5
-rw-r--r--WebCore/svg/graphics/filters/SVGFEMerge.cpp57
-rw-r--r--WebCore/svg/graphics/filters/SVGFEMerge.h10
-rw-r--r--WebCore/svg/graphics/filters/SVGFEMorphology.cpp24
-rw-r--r--WebCore/svg/graphics/filters/SVGFEMorphology.h6
-rw-r--r--WebCore/svg/graphics/filters/SVGFEOffset.cpp26
-rw-r--r--WebCore/svg/graphics/filters/SVGFEOffset.h6
-rw-r--r--WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp10
-rw-r--r--WebCore/svg/graphics/filters/SVGFESpecularLighting.h5
-rw-r--r--WebCore/svg/graphics/filters/SVGFETile.cpp35
-rw-r--r--WebCore/svg/graphics/filters/SVGFETile.h9
-rw-r--r--WebCore/svg/graphics/filters/SVGFilter.cpp40
-rw-r--r--WebCore/svg/graphics/filters/SVGFilter.h9
-rw-r--r--WebCore/websockets/WebSocket.cpp2
-rw-r--r--WebCore/websockets/WebSocket.h2
-rw-r--r--WebCore/websockets/WebSocketChannel.cpp43
-rw-r--r--WebCore/websockets/WebSocketChannel.h8
-rw-r--r--WebCore/wml/WMLAElement.cpp35
-rw-r--r--WebCore/wml/WMLElement.cpp10
-rw-r--r--WebCore/wml/WMLImageLoader.cpp4
-rw-r--r--WebCore/wml/WMLInputElement.cpp2
-rw-r--r--WebCore/xml/XMLHttpRequest.cpp2
-rw-r--r--WebCore/xml/XMLHttpRequest.h2
-rw-r--r--WebKit/ChangeLog33
-rw-r--r--WebKit/WebKit.xcodeproj/project.pbxproj26
-rw-r--r--WebKit/chromium/ChangeLog969
-rw-r--r--WebKit/chromium/DEPS2
-rw-r--r--WebKit/chromium/WebKit.grd2
-rw-r--r--WebKit/chromium/WebKit.gyp10
-rw-r--r--WebKit/chromium/WebKit.gypi1
-rw-r--r--WebKit/chromium/public/WebAccessibilityNotification.h57
-rw-r--r--WebKit/chromium/public/WebAccessibilityObject.h1
-rw-r--r--WebKit/chromium/public/WebDOMEvent.h2
-rw-r--r--WebKit/chromium/public/WebDataSource.h4
-rw-r--r--WebKit/chromium/public/WebDeviceOrientationClientMock.h3
-rw-r--r--WebKit/chromium/public/WebFileSystem.h6
-rw-r--r--WebKit/chromium/public/WebFileWriter.h57
-rw-r--r--WebKit/chromium/public/WebFileWriterClient.h57
-rw-r--r--WebKit/chromium/public/WebFrame.h3
-rw-r--r--WebKit/chromium/public/WebGeolocationService.h7
-rw-r--r--WebKit/chromium/public/WebGeolocationServiceBridge.h6
-rw-r--r--WebKit/chromium/public/WebGeolocationServiceMock.h3
-rw-r--r--WebKit/chromium/public/WebGraphicsContext3D.h17
-rw-r--r--WebKit/chromium/public/WebHTTPBody.h4
-rw-r--r--WebKit/chromium/public/WebIDBCursor.h31
-rwxr-xr-xWebKit/chromium/public/WebIDBFactory.h10
-rw-r--r--WebKit/chromium/public/WebIDBIndex.h14
-rw-r--r--WebKit/chromium/public/WebIDBKey.h2
-rw-r--r--WebKit/chromium/public/WebInputElement.h8
-rw-r--r--WebKit/chromium/public/WebKit.h5
-rw-r--r--WebKit/chromium/public/WebURLLoaderClient.h5
-rw-r--r--WebKit/chromium/public/WebView.h13
-rw-r--r--WebKit/chromium/public/WebViewClient.h4
-rw-r--r--WebKit/chromium/public/WebWidget.h27
-rw-r--r--WebKit/chromium/public/WebWidgetClient.h3
-rw-r--r--WebKit/chromium/src/AsyncFileWriterChromium.cpp92
-rw-r--r--WebKit/chromium/src/AsyncFileWriterChromium.h74
-rw-r--r--WebKit/chromium/src/ChromeClientImpl.cpp85
-rw-r--r--WebKit/chromium/src/ChromeClientImpl.h1
-rw-r--r--WebKit/chromium/src/DOMUtilitiesPrivate.cpp2
-rw-r--r--WebKit/chromium/src/FrameLoaderClientImpl.cpp17
-rw-r--r--WebKit/chromium/src/FrameLoaderClientImpl.h1
-rw-r--r--WebKit/chromium/src/GraphicsContext3D.cpp287
-rw-r--r--WebKit/chromium/src/GraphicsContext3DInternal.h301
-rw-r--r--WebKit/chromium/src/IDBCursorBackendProxy.cpp14
-rw-r--r--WebKit/chromium/src/IDBCursorBackendProxy.h2
-rwxr-xr-xWebKit/chromium/src/IDBFactoryBackendProxy.cpp4
-rwxr-xr-xWebKit/chromium/src/IDBFactoryBackendProxy.h2
-rw-r--r--WebKit/chromium/src/IDBIndexBackendProxy.cpp34
-rw-r--r--WebKit/chromium/src/IDBIndexBackendProxy.h6
-rw-r--r--WebKit/chromium/src/InspectorClientImpl.cpp22
-rw-r--r--WebKit/chromium/src/InspectorClientImpl.h5
-rw-r--r--WebKit/chromium/src/ResourceHandle.cpp20
-rw-r--r--WebKit/chromium/src/WebAccessibilityCacheImpl.cpp3
-rw-r--r--WebKit/chromium/src/WebAccessibilityObject.cpp9
-rw-r--r--WebKit/chromium/src/WebDataSourceImpl.cpp8
-rw-r--r--WebKit/chromium/src/WebDataSourceImpl.h1
-rw-r--r--WebKit/chromium/src/WebDevToolsAgentImpl.cpp61
-rw-r--r--WebKit/chromium/src/WebDevToolsAgentImpl.h6
-rw-r--r--WebKit/chromium/src/WebDeviceOrientationClientMock.cpp5
-rw-r--r--WebKit/chromium/src/WebFormElement.cpp2
-rw-r--r--WebKit/chromium/src/WebFrameImpl.cpp28
-rw-r--r--WebKit/chromium/src/WebFrameImpl.h2
-rw-r--r--WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp86
-rw-r--r--WebKit/chromium/src/WebGeolocationServiceMock.cpp70
-rw-r--r--WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp48
-rw-r--r--WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h9
-rw-r--r--WebKit/chromium/src/WebHTTPBody.cpp14
-rw-r--r--WebKit/chromium/src/WebIDBCursorImpl.cpp14
-rw-r--r--WebKit/chromium/src/WebIDBCursorImpl.h2
-rwxr-xr-xWebKit/chromium/src/WebIDBFactoryImpl.cpp4
-rwxr-xr-xWebKit/chromium/src/WebIDBFactoryImpl.h2
-rw-r--r--WebKit/chromium/src/WebIDBIndexImpl.cpp30
-rw-r--r--WebKit/chromium/src/WebIDBIndexImpl.h6
-rw-r--r--WebKit/chromium/src/WebInputElement.cpp22
-rw-r--r--WebKit/chromium/src/WebKit.cpp5
-rw-r--r--WebKit/chromium/src/WebPasswordFormUtils.cpp8
-rw-r--r--WebKit/chromium/src/WebPopupMenuImpl.cpp10
-rw-r--r--WebKit/chromium/src/WebPopupMenuImpl.h2
-rw-r--r--WebKit/chromium/src/WebSearchableFormData.cpp23
-rw-r--r--WebKit/chromium/src/WebViewImpl.cpp361
-rw-r--r--WebKit/chromium/src/WebViewImpl.h44
-rw-r--r--WebKit/chromium/src/js/DevTools.js4
-rw-r--r--WebKit/chromium/src/js/Tests.js224
-rw-r--r--WebKit/chromium/tests/PopupMenuTest.cpp2
-rw-r--r--WebKit/efl/CMakeListsEfl.txt2
-rw-r--r--WebKit/efl/ChangeLog137
-rw-r--r--WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp63
-rw-r--r--WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h2
-rw-r--r--WebKit/efl/ewk/ewk_frame.cpp39
-rw-r--r--WebKit/efl/ewk/ewk_view.cpp43
-rw-r--r--WebKit/efl/ewk/ewk_view.h3
-rw-r--r--WebKit/gtk/ChangeLog381
-rw-r--r--WebKit/gtk/JSCore.gir.in12
-rw-r--r--WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp2
-rw-r--r--WebKit/gtk/WebCoreSupport/DragClientGtk.cpp48
-rw-r--r--WebKit/gtk/WebCoreSupport/DragClientGtk.h7
-rw-r--r--WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp71
-rw-r--r--WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp142
-rw-r--r--WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h1
-rw-r--r--WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp1
-rw-r--r--WebKit/gtk/tests/testatk.c146
-rw-r--r--WebKit/gtk/webkit/webkitdownload.cpp7
-rw-r--r--WebKit/gtk/webkit/webkitprivate.cpp10
-rw-r--r--WebKit/gtk/webkit/webkitprivate.h44
-rw-r--r--WebKit/gtk/webkit/webkitwebsettings.cpp56
-rw-r--r--WebKit/gtk/webkit/webkitwebview.cpp357
-rw-r--r--WebKit/haiku/ChangeLog42
-rw-r--r--WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp13
-rw-r--r--WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h1
-rw-r--r--WebKit/mac/ChangeLog441
-rw-r--r--WebKit/mac/Configurations/FeatureDefines.xcconfig3
-rw-r--r--WebKit/mac/Configurations/Version.xcconfig2
-rw-r--r--WebKit/mac/DOM/WebDOMOperations.mm4
-rw-r--r--WebKit/mac/MigrateHeaders.make1
-rw-r--r--WebKit/mac/Misc/WebCoreStatistics.mm20
-rw-r--r--WebKit/mac/Misc/WebKitVersionChecks.h7
-rw-r--r--WebKit/mac/Misc/WebKitVersionChecks.m16
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm2
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginStream.mm2
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginView.mm2
-rw-r--r--WebKit/mac/Plugins/WebPluginContainerCheck.mm2
-rw-r--r--WebKit/mac/WebCoreSupport/WebChromeClient.mm20
-rw-r--r--WebKit/mac/WebCoreSupport/WebEditorClient.h7
-rw-r--r--WebKit/mac/WebCoreSupport/WebEditorClient.mm67
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h1
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm5
-rw-r--r--WebKit/mac/WebView/WebDashboardRegion.h (renamed from WebCore/page/mac/WebDashboardRegion.h)0
-rw-r--r--WebKit/mac/WebView/WebDashboardRegion.mm (renamed from WebCore/page/mac/WebDashboardRegion.m)17
-rw-r--r--WebKit/mac/WebView/WebFrame.mm69
-rw-r--r--WebKit/mac/WebView/WebFrameInternal.h2
-rw-r--r--WebKit/mac/WebView/WebHTMLRepresentation.mm65
-rw-r--r--WebKit/mac/WebView/WebHTMLView.mm116
-rw-r--r--WebKit/mac/WebView/WebPreferenceKeysPrivate.h2
-rw-r--r--WebKit/mac/WebView/WebPreferences.mm32
-rw-r--r--WebKit/mac/WebView/WebPreferencesPrivate.h8
-rw-r--r--WebKit/mac/WebView/WebView.mm79
-rw-r--r--WebKit/mac/WebView/WebViewData.h1
-rw-r--r--WebKit/mac/WebView/WebViewData.mm1
-rw-r--r--WebKit/qt/Api/DerivedSources.pro2
-rw-r--r--WebKit/qt/Api/qwebelement.cpp47
-rw-r--r--WebKit/qt/Api/qwebelement.h18
-rw-r--r--WebKit/qt/Api/qwebframe.cpp78
-rw-r--r--WebKit/qt/Api/qwebframe_p.h6
-rw-r--r--WebKit/qt/Api/qwebkitplatformplugin.h5
-rw-r--r--WebKit/qt/Api/qwebpage.cpp98
-rw-r--r--WebKit/qt/Api/qwebpage.h22
-rw-r--r--WebKit/qt/Api/qwebpage_p.h6
-rw-r--r--WebKit/qt/Api/qwebscriptworld.cpp2
-rw-r--r--WebKit/qt/Api/qwebsettings.cpp4
-rw-r--r--WebKit/qt/ChangeLog554
-rw-r--r--WebKit/qt/WebCoreSupport/ChromeClientQt.cpp45
-rw-r--r--WebKit/qt/WebCoreSupport/ChromeClientQt.h3
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp78
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h5
-rw-r--r--WebKit/qt/WebCoreSupport/EditorClientQt.cpp2
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp159
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h24
-rw-r--r--WebKit/qt/WebCoreSupport/InspectorClientQt.cpp22
-rw-r--r--WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp51
-rw-r--r--WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h4
-rw-r--r--WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp1
-rw-r--r--WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp (renamed from WebCore/platform/qt/Localizations.cpp)343
-rw-r--r--WebKit/qt/WebCoreSupport/WebPlatformStrategies.h141
-rw-r--r--WebKit/qt/declarative/qdeclarativewebview.cpp101
-rw-r--r--WebKit/qt/docs/qtwebkit.qdoc2
-rw-r--r--WebKit/qt/examples/platformplugin/WebNotificationPresenter.cpp6
-rw-r--r--WebKit/qt/examples/platformplugin/WebNotificationPresenter.h2
-rw-r--r--WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h5
-rw-r--r--WebKit/qt/qt_webkit_version.pri2
-rw-r--r--WebKit/qt/symbian/eabi/QtWebKitu.def6
-rw-r--r--WebKit/qt/tests/qwebpage/tst_qwebpage.cpp48
-rw-r--r--WebKit/win/ChangeLog182
-rw-r--r--WebKit/win/FullscreenVideoController.cpp3
-rwxr-xr-xWebKit/win/Interfaces/IWebFramePrivate.idl2
-rw-r--r--[-rwxr-xr-x]WebKit/win/Interfaces/JavaScriptCoreAPITypes.idl0
-rw-r--r--WebKit/win/Interfaces/WebKit.idl1
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp21
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameLoaderClient.h1
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp5
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h2
-rw-r--r--WebKit/win/WebFrame.cpp40
-rw-r--r--WebKit/win/WebFrame.h3
-rwxr-xr-x[-rw-r--r--]WebKit/win/WebView.cpp67
-rwxr-xr-x[-rw-r--r--]WebKit/win/WebView.h6
-rw-r--r--WebKit/wince/ChangeLog35
-rw-r--r--WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp627
-rw-r--r--WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h196
-rw-r--r--WebKit/wince/WebCoreSupport/FrameNetworkingContextWinCE.cpp57
-rw-r--r--WebKit/wince/WebCoreSupport/FrameNetworkingContextWinCE.h51
-rw-r--r--WebKit/wx/ChangeLog71
-rw-r--r--WebKit/wx/WebFrame.cpp8
-rw-r--r--WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp22
-rw-r--r--WebKit/wx/WebKitSupport/FrameLoaderClientWx.h3
-rw-r--r--WebKit/wx/WebKitSupport/FrameNetworkingContextWx.h51
-rw-r--r--WebKitLibraries/ChangeLog41
-rw-r--r--WebKitLibraries/WebKitSystemInterface.h6
-rw-r--r--WebKitLibraries/libWebKitSystemInterfaceLeopard.abin1637800 -> 1621064 bytes
-rw-r--r--WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.abin1347660 -> 1352508 bytes
-rw-r--r--WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h43
-rw-r--r--WebKitLibraries/win/lib/WebKitSystemInterface.libbin178620 -> 1223940 bytes
-rw-r--r--WebKitLibraries/win/lib/WebKitSystemInterface_debug.libbin85296 -> 458358 bytes
-rw-r--r--WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops7
-rw-r--r--WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops7
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json2
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg5
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/default.css524
-rwxr-xr-x[-rw-r--r--]WebKitTools/BuildSlaveSupport/build.webkit.org-config/templates/root.html (renamed from WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/index.html)0
-rw-r--r--WebKitTools/ChangeLog1370
-rw-r--r--WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp24
-rw-r--r--WebKitTools/DumpRenderTree/AccessibilityUIElement.h2
-rw-r--r--WebKitTools/DumpRenderTree/DumpRenderTree.gypi2
-rw-r--r--WebKitTools/DumpRenderTree/chromium/EventSender.cpp34
-rw-r--r--WebKitTools/DumpRenderTree/chromium/ImageDiff.cpp13
-rw-r--r--WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp336
-rw-r--r--WebKitTools/DumpRenderTree/chromium/LayoutTestController.h27
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShell.cpp111
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShell.h9
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TextInputController.cpp30
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TextInputController.h1
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp161
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebPreferences.h84
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp89
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebViewHost.h3
-rw-r--r--WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp6
-rw-r--r--WebKitTools/DumpRenderTree/gtk/EventSender.cpp59
-rw-r--r--WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm19
-rw-r--r--WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm1
-rw-r--r--WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp14
-rw-r--r--WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp25
-rw-r--r--WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h4
-rw-r--r--WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp6
-rwxr-xr-xWebKitTools/EWSTools/start-commit-queue.sh37
-rw-r--r--WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops2
-rw-r--r--WebKitTools/MiniBrowser/mac/AppDelegate.m3
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserWindowController.h12
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserWindowController.m141
-rw-r--r--WebKitTools/MiniBrowser/mac/MainMenu.xib1705
-rw-r--r--WebKitTools/MiniBrowser/qt/BrowserView.cpp3
-rw-r--r--WebKitTools/MiniBrowser/win/BrowserView.cpp23
-rw-r--r--WebKitTools/QtTestBrowser/launcherwindow.cpp14
-rw-r--r--WebKitTools/QtTestBrowser/launcherwindow.h6
-rw-r--r--WebKitTools/QtTestBrowser/mainwindow.cpp33
-rw-r--r--WebKitTools/QtTestBrowser/mainwindow.h9
-rw-r--r--WebKitTools/QtTestBrowser/webview.cpp26
-rw-r--r--WebKitTools/QtTestBrowser/webview.h33
-rw-r--r--WebKitTools/QueueStatusServer/app.yaml4
-rw-r--r--WebKitTools/QueueStatusServer/handlers/nextpatch.py61
-rw-r--r--WebKitTools/QueueStatusServer/handlers/queuestatus.py17
-rw-r--r--WebKitTools/QueueStatusServer/index.yaml5
-rw-r--r--WebKitTools/QueueStatusServer/main.py2
-rw-r--r--WebKitTools/QueueStatusServer/model/activeworkitems.py58
-rw-r--r--WebKitTools/QueueStatusServer/stylesheets/dashboard.css35
-rw-r--r--WebKitTools/QueueStatusServer/templates/dashboard.html6
-rw-r--r--WebKitTools/QueueStatusServer/templates/includes/singlequeuestatus.html5
-rw-r--r--WebKitTools/QueueStatusServer/templates/queuestatus.html37
-rwxr-xr-xWebKitTools/Scripts/build-webkit15
-rwxr-xr-xWebKitTools/Scripts/update-webgl-conformance-tests36
-rwxr-xr-xWebKitTools/Scripts/update-webkit-chromium5
-rw-r--r--WebKitTools/Scripts/webkitdirs.pm1
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl89
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/committers.py5
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/bugzilla.py30
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/statusserver.py5
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py61
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py19
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py71
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/base.py19
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py33
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py42
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py8
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/test.py11
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py26
-rwxr-xr-xWebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py22
-rwxr-xr-xWebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests.py160
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests_unittest.py102
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/cpp.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py5
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py12
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py42
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/download.py13
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py5
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queues.py105
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py100
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py16
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/mocktool.py23
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/applypatch.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/options.py1
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp32
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp215
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h47
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp24
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h13
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm59
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp61
-rw-r--r--WebKitTools/WebKitTestRunner/TestController.cpp9
-rw-r--r--WebKitTools/WebKitTestRunner/TestController.h2
-rw-r--r--WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj4
-rw-r--r--WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj22
-rw-r--r--WebKitTools/wx/build/settings.py5
1025 files changed, 40856 insertions, 14213 deletions
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 85860d8..045347a 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,483 @@
+2010-09-20 Michael Saboff <msaboff@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Fixed detection of alternative smaller than the first alternative
+ to only check looping alternatives.
+ https://bugs.webkit.org/show_bug.cgi?id=46049
+
+ * yarr/RegexJIT.cpp:
+ (JSC::Yarr::RegexGenerator::generateDisjunction):
+
+2010-09-20 Peter Varga <pvarga@inf.u-szeged.hu>
+
+ Reviewed by Geoffrey Garen.
+
+ REGRESSION(67790): jsc tests are failed with YARR interpreter
+ https://bugs.webkit.org/show_bug.cgi?id=46083
+
+ Fix the initializing of the lastSubpatternId member of
+ parentheses.
+
+ * yarr/RegexCompiler.cpp:
+ (JSC::Yarr::RegexPatternConstructor::atomParenthesesEnd):
+
+2010-09-20 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 46077 - ASSERT failure in YARR JIT
+
+ We will currently attempt to loop if there are multiple alternatives, they are all
+ BOL predicated, and the last alternative is longer then the first - however if all
+ alternatives are BOL predicated the head of loop label will not have been set, and
+ we'll try to link a jump to an undefined label. Stop doing so.
+
+ * yarr/RegexJIT.cpp:
+ (JSC::Yarr::RegexGenerator::generateDisjunction):
+
+2010-09-20 Adam Roben <aroben@apple.com>
+
+ Export RegExpObject::info from JavaScriptCore
+
+ This allows obj->inherits(&RegExpObject::info) to work correctly from
+ outside JavaScriptCore.dll on Windows.
+
+ Fixes <http://webkit.org/b/46098>
+ fast/loader/stateobjects/pushstate-object-types.html fails on Windows
+
+ Reviewed by John Sullivan.
+
+ * runtime/RegExpObject.h: Added JS_EXPORTDATA to the info member, as
+ we already have for some other classes whose info members have to be
+ used from outside the DLL.
+
+2010-09-19 Gavin Barraclough <barraclough@apple.com>
+
+ Windows build fix pt 2.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-09-19 Gavin Barraclough <barraclough@apple.com>
+
+ Windows build fix pt 1.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-09-19 Gavin Barraclough <barraclough@apple.com>
+
+ Build fix - implicit double-to-int conversion invalid on 32-bit.
+
+ * runtime/DatePrototype.cpp:
+ (JSC::fillStructuresUsingDateArgs):
+ (JSC::dateProtoFuncSetYear):
+
+2010-09-19 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 46065 - Unify implementation of ToInt32 and ToUInt32, don't use fmod.
+
+ These methods implement the same conversion (see discussion in the notes
+ of sections of 9.5 and 9.6 of the spec), only differing in how the result
+ is interpretted.
+
+ Date prototype is incorrectly using toInt32, and this is causing us to
+ provide an output value indicating whether the input to ToInt32 was finite
+ (the corresponding methods on Date are actually spec'ed to use ToInteger,
+ not ToInt32). This patch partially fixes this in order to remove this
+ bogus output value, hoewever more work will be require to bring Date
+ fully up to spec compliance (the constructor is still performing ToInt32
+ conversions).
+
+ * JavaScriptCore.exp:
+ * runtime/DatePrototype.cpp:
+ (JSC::fillStructuresUsingTimeArgs):
+ (JSC::fillStructuresUsingDateArgs):
+ (JSC::dateProtoFuncSetYear):
+ * runtime/JSValue.cpp:
+ (JSC::toInt32):
+ * runtime/JSValue.h:
+ (JSC::toUInt32):
+ (JSC::JSValue::toInt32):
+ (JSC::JSValue::toUInt32):
+
+2010-09-18 Darin Adler <darin@apple.com>
+
+ First step in fixing Windows build.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+ Removed incorrect symbol. The build will probably still fail,
+ but the failure will tell us what symbol to add.
+
+2010-09-18 Michael Saboff <msaboff@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Added code to unroll regular expressions containing ^.
+ Alternatives that begin with ^ are tagged during parsing
+ and rolled up in containing sub expression structs.
+ After parsing, a regular expression flagged as containing
+ a ^ (a.k.a. BOL) is processed further in optimizeBOL().
+ A copy of the disjunction is made excluding alternatives that
+ are rooted with BOL. The original alternatives are flagged
+ to only be executed once. The copy of the other alternatives are
+ added to the original expression.
+ In the case that all original alternatives are flagged, there
+ won't be any looping alternatives.
+ The JIT generator will emit code accordingly, executing the
+ original alternatives once and then looping over the
+ alternatives that aren't anchored with a BOL (if any).
+ https://bugs.webkit.org/show_bug.cgi?id=45787
+
+ * yarr/RegexCompiler.cpp:
+ (JSC::Yarr::RegexPatternConstructor::assertionBOL):
+ (JSC::Yarr::RegexPatternConstructor::atomParenthesesEnd):
+ (JSC::Yarr::RegexPatternConstructor::copyDisjunction):
+ (JSC::Yarr::RegexPatternConstructor::copyTerm):
+ (JSC::Yarr::RegexPatternConstructor::optimizeBOL):
+ (JSC::Yarr::compileRegex):
+ * yarr/RegexJIT.cpp:
+ (JSC::Yarr::RegexGenerator::generateDisjunction):
+ * yarr/RegexPattern.h:
+ (JSC::Yarr::PatternAlternative::PatternAlternative):
+ (JSC::Yarr::PatternAlternative::setOnceThrough):
+ (JSC::Yarr::PatternAlternative::onceThrough):
+ (JSC::Yarr::PatternDisjunction::PatternDisjunction):
+ (JSC::Yarr::RegexPattern::RegexPattern):
+ (JSC::Yarr::RegexPattern::reset):
+
+2010-09-18 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Darin Adler.
+
+ Rename Wince files to WinCE
+ https://bugs.webkit.org/show_bug.cgi?id=37287
+
+ * wtf/unicode/Unicode.h:
+ * wtf/unicode/wince/UnicodeWinCE.cpp: Copied from JavaScriptCore/wtf/unicode/wince/UnicodeWince.cpp.
+ * wtf/unicode/wince/UnicodeWinCE.h: Copied from JavaScriptCore/wtf/unicode/wince/UnicodeWince.h.
+ * wtf/unicode/wince/UnicodeWince.cpp: Removed.
+ * wtf/unicode/wince/UnicodeWince.h: Removed.
+ * wtf/wince/FastMallocWinCE.h: Copied from JavaScriptCore/wtf/wince/FastMallocWince.h.
+ * wtf/wince/FastMallocWince.h: Removed.
+
+2010-09-18 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Enable Platform Strategies on Qt
+
+ [Qt] Turn on PLATFORM_STRATEGIES
+ https://bugs.webkit.org/show_bug.cgi?id=45831
+
+ * wtf/Platform.h: Enable Platform Strategies when building QtWebkit
+
+2010-09-17 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Imprecise tracking of variable capture leads to overly pessimistic creation of activations
+ https://bugs.webkit.org/show_bug.cgi?id=46020
+
+ The old logic for track free and captured variables would cause us
+ to decide we needed an activation in every function along the scope
+ chain between a variable capture and its declaration. We now track
+ captured variables precisely which requires a bit of additional work
+
+ The most substantial change is that the parsing routine needs to
+ be passed the list of function parameters when reparsing a function
+ as when reparsing we don't parse the function declaration itself only
+ its body.
+
+ * JavaScriptCore.exp:
+ * parser/JSParser.cpp:
+ (JSC::JSParser::Scope::Scope):
+ (JSC::JSParser::Scope::needsFullActivation):
+ We need to distinguish between use of a feature that requires
+ an activation and eval so we now get this additional flag.
+ (JSC::JSParser::Scope::collectFreeVariables):
+ (JSC::JSParser::Scope::getCapturedVariables):
+ We can't simply return the list of "capturedVariables" now as
+ is insufficiently precise, so we compute them instead.
+ (JSC::JSParser::popScope):
+ (JSC::jsParse):
+ (JSC::JSParser::JSParser):
+ (JSC::JSParser::parseProgram):
+ (JSC::JSParser::parseWithStatement):
+ (JSC::JSParser::parseTryStatement):
+ (JSC::JSParser::parseFunctionInfo):
+ (JSC::JSParser::parseFunctionDeclaration):
+ (JSC::JSParser::parseProperty):
+ (JSC::JSParser::parseMemberExpression):
+ * parser/JSParser.h:
+ * parser/Parser.cpp:
+ (JSC::Parser::parse):
+ * parser/Parser.h:
+ (JSC::Parser::parse):
+ * runtime/Executable.cpp:
+ (JSC::EvalExecutable::compileInternal):
+ (JSC::ProgramExecutable::checkSyntax):
+ (JSC::ProgramExecutable::compileInternal):
+ (JSC::FunctionExecutable::compileForCallInternal):
+ (JSC::FunctionExecutable::compileForConstructInternal):
+ (JSC::FunctionExecutable::reparseExceptionInfo):
+ (JSC::EvalExecutable::reparseExceptionInfo):
+ (JSC::FunctionExecutable::fromGlobalCode):
+ Pass function parameters (if available) to the parser.
+
+2010-09-17 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add IsFloatingPoint and IsArithmetic type traits
+ https://bugs.webkit.org/show_bug.cgi?id=46018
+
+ * wtf/TypeTraits.h:
+ * wtf/TypeTraits.cpp:
+
+2010-09-17 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Oliver Hunt.
+
+ [GTK] FontPlatformDataFreeType should use smart pointers to hold its members
+ https://bugs.webkit.org/show_bug.cgi?id=45917
+
+ Added support to PlatformRefPtr for handling HashTableDeletedValue.
+
+ * wtf/PlatformRefPtr.h:
+ (WTF::PlatformRefPtr::PlatformRefPtr): Added a constructor that takes HashTableDeletedValue.
+ (WTF::PlatformRefPtr::isHashTableDeletedValue): Added.
+
+2010-09-16 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Crash due to timer triggered GC on one heap while another heap is active
+ https://bugs.webkit.org/show_bug.cgi?id=45932
+ <rdar://problem/8318446>
+
+ The GC timer may trigger for one heap while another heap is active. This
+ is safe, but requires us to ensure that we have temporarily associated the
+ thread's identifierTable with the heap we're collecting on. Otherwise we
+ may end up with the identifier tables in an inconsistent state leading to
+ an eventual crash.
+
+ * runtime/Collector.cpp:
+ (JSC::Heap::allocate):
+ (JSC::Heap::reset):
+ (JSC::Heap::collectAllGarbage):
+ Add assertions to ensure we have the correct identifierTable active
+ while collecting.
+ * runtime/GCActivityCallbackCF.cpp:
+ (JSC::DefaultGCActivityCallbackPlatformData::trigger):
+ Temporarily make the expected IdentifierTable active
+ * wtf/WTFThreadData.h:
+ (JSC::IdentifierTable::remove):
+ Make it possible to see when IdentifierTable::remove has succeeded
+ * wtf/text/StringImpl.cpp:
+ (WTF::StringImpl::~StringImpl):
+ CRASH if an StringImpl is an Identifier but isn't present in the
+ active IdentifierTable. If we get to this state something has
+ gone wrong and we should just crash immediately.
+
+2010-09-16 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Implement dissolveDragImageToFraction
+ https://bugs.webkit.org/show_bug.cgi?id=45826
+
+ * wtf/gobject/GTypedefs.h: Added forward declarations for GtkWindow and GdkEventExpose.
+
+2010-09-16 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by Jian Li.
+
+ Unify FILE_SYSTEM and FILE_WRITER enables under the name FILE_SYSTEM.
+ https://bugs.webkit.org/show_bug.cgi?id=45798
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2010-09-15 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Use free variable analysis to improve activation performance
+ https://bugs.webkit.org/show_bug.cgi?id=45837
+
+ Adds free and captured variable tracking to the JS parser. This
+ allows us to avoid construction of an activation object in some
+ cases. Future patches will make more use of this information to
+ improve those cases where activations are still needed.
+
+ * parser/ASTBuilder.h:
+ * parser/JSParser.cpp:
+ (JSC::JSParser::Scope::Scope):
+ (JSC::JSParser::Scope::declareVariable):
+ (JSC::JSParser::Scope::useVariable):
+ (JSC::JSParser::Scope::collectFreeVariables):
+ (JSC::JSParser::Scope::capturedVariables):
+ (JSC::JSParser::ScopeRef::ScopeRef):
+ (JSC::JSParser::ScopeRef::operator->):
+ (JSC::JSParser::ScopeRef::index):
+ (JSC::JSParser::currentScope):
+ (JSC::JSParser::pushScope):
+ (JSC::JSParser::popScope):
+ (JSC::JSParser::parseProgram):
+ (JSC::JSParser::parseVarDeclarationList):
+ (JSC::JSParser::parseConstDeclarationList):
+ (JSC::JSParser::parseTryStatement):
+ (JSC::JSParser::parseFormalParameters):
+ (JSC::JSParser::parseFunctionInfo):
+ (JSC::JSParser::parseFunctionDeclaration):
+ (JSC::JSParser::parsePrimaryExpression):
+ * parser/Nodes.cpp:
+ (JSC::ScopeNodeData::ScopeNodeData):
+ (JSC::ScopeNode::ScopeNode):
+ (JSC::ProgramNode::ProgramNode):
+ (JSC::ProgramNode::create):
+ (JSC::EvalNode::EvalNode):
+ (JSC::EvalNode::create):
+ (JSC::FunctionBodyNode::FunctionBodyNode):
+ (JSC::FunctionBodyNode::create):
+ * parser/Nodes.h:
+ (JSC::ScopeNode::needsActivation):
+ (JSC::ScopeNode::hasCapturedVariables):
+ * parser/Parser.cpp:
+ (JSC::Parser::didFinishParsing):
+ * parser/Parser.h:
+ (JSC::Parser::parse):
+ * parser/SyntaxChecker.h:
+ * runtime/Executable.cpp:
+ (JSC::EvalExecutable::compileInternal):
+ (JSC::ProgramExecutable::compileInternal):
+ (JSC::FunctionExecutable::compileForCallInternal):
+ (JSC::FunctionExecutable::compileForConstructInternal):
+ * runtime/Executable.h:
+ (JSC::ScriptExecutable::needsActivation):
+ (JSC::ScriptExecutable::recordParse):
+
+2010-09-14 Hyung Song <beergun@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Add IMemGroup and IMemSpace to OwnPtr type.
+ https://bugs.webkit.org/show_bug.cgi?id=44764
+
+ * wtf/OwnPtrCommon.h:
+ * wtf/brew/OwnPtrBrew.cpp:
+ (WTF::deleteOwnedPtr):
+
+2010-09-14 Darin Adler <darin@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Sort with non-numeric custom sort function fails on array with length but no values
+ https://bugs.webkit.org/show_bug.cgi?id=45781
+
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::sort): Replaced early exit for an array of length zero to instead
+ exit for any array without values, even if it has a non-0 length.
+
+2010-09-14 Steve Falkenburg <sfalken@apple.com>
+
+ Windows production build fix.
+ Roll out r65143.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
+
+2010-09-14 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Darin Adler.
+
+ Share UnicodeMacrosFromICU.h
+ https://bugs.webkit.org/show_bug.cgi?id=45710
+
+ glib, qt4 and wince use the same macros from ICU.
+ Remove the code duplication and use the same header file.
+
+ * wtf/unicode/UnicodeMacrosFromICU.h: Copied from JavaScriptCore/wtf/unicode/glib/UnicodeMacrosFromICU.h.
+ * wtf/unicode/glib/UnicodeMacrosFromICU.h: Removed.
+ * wtf/unicode/qt4/UnicodeQt4.h:
+ * wtf/unicode/wince/UnicodeWince.h:
+
+2010-09-13 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Preparation for eliminating deprecatedParseURL
+ https://bugs.webkit.org/show_bug.cgi?id=45695
+
+ * wtf/text/WTFString.h: Added isAllSpecialCharacters, moved here from
+ the HTML tree builder.
+
+2010-09-13 Darin Fisher <darin@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add option to conditionally compile smooth scrolling support.
+ https://bugs.webkit.org/show_bug.cgi?id=45689
+
+ ENABLE(SMOOTH_SCROLLING) is disabled by default for all platforms.
+
+ * wtf/Platform.h:
+
+2010-09-13 Adam Roben <aroben@apple.com>
+
+ Copy JavaScriptCore's generated sources to the right directory
+
+ * JavaScriptCore.vcproj/JavaScriptCore.make: Fixed typo.
+
+2010-09-13 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Don't call _msize
+ https://bugs.webkit.org/show_bug.cgi?id=45556
+
+ Because Brew MP uses its own memory allocator, it is not correct to use
+ _msize in fastMallocSize. Add !PLATFORM(BREWMP) guard.
+
+ * wtf/FastMalloc.cpp:
+ (WTF::fastMallocSize):
+
+2010-09-11 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] V8 port: webcore project files changes
+ https://bugs.webkit.org/show_bug.cgi?id=45141
+
+ * JavaScriptCore.pro: Moved wtf specific files to wtf.pri,
+ so that they can also be used from WebCore.pro for v8 builds.
+ * wtf/wtf.pri: Added.
+
+2010-09-10 Fridrich Strba <fridrich.strba@bluewin.ch>
+
+ Reviewed by Andreas Kling.
+
+ Add a define missing when building with glib unicode backend
+ https://bugs.webkit.org/show_bug.cgi?id=45544
+
+ * wtf/unicode/glib/UnicodeMacrosFromICU.h:
+
+2010-09-10 Stephanie Lewis <slewis@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Refactor JavaScriptCore memory statistics so that WebKit doesn't need to know
+ about the JIT and other implementation details of JavaScriptCore. Necessary
+ to fix PPC build.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45528
+
+ * JavaScriptCore.exp:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * runtime/MemoryStatistics.cpp: Added.
+ (JSC::memoryStatistics):
+ * runtime/MemoryStatistics.h: Added.
+
2010-09-09 Michael Saboff <msaboff@apple.com>
Reviewed by Gavin Barraclough.
diff --git a/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/JavaScriptCore/Configurations/FeatureDefines.xcconfig
index f2b4c09..2ed3a8e 100644
--- a/JavaScriptCore/Configurations/FeatureDefines.xcconfig
+++ b/JavaScriptCore/Configurations/FeatureDefines.xcconfig
@@ -69,7 +69,6 @@ ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
ENABLE_FILTERS = $(ENABLE_FILTERS_$(REAL_PLATFORM_NAME));
ENABLE_FILTERS_macosx = ENABLE_FILTERS;
-ENABLE_FILE_WRITER = ;
ENABLE_FILE_SYSTEM = ;
ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
@@ -120,4 +119,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_WRITER) $(ENABLE_FILE_SYSTEM) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/JavaScriptCore/Configurations/Version.xcconfig b/JavaScriptCore/Configurations/Version.xcconfig
index 673e234..e82e464 100644
--- a/JavaScriptCore/Configurations/Version.xcconfig
+++ b/JavaScriptCore/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 8;
+MINOR_VERSION = 9;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/JavaScriptCore/JavaScriptCore.exp b/JavaScriptCore/JavaScriptCore.exp
index ee0bfb7..13b9676 100644
--- a/JavaScriptCore/JavaScriptCore.exp
+++ b/JavaScriptCore/JavaScriptCore.exp
@@ -132,7 +132,6 @@ __ZN3JSC12JSGlobalData14sharedInstanceEv
__ZN3JSC12JSGlobalData15dumpRegExpTraceEv
__ZN3JSC12JSGlobalData6createENS_15ThreadStackTypeE
__ZN3JSC12JSGlobalDataD1Ev
-__ZN3JSC12RegisterFile18committedByteCountEv
__ZN3JSC12SamplingTool5setupEv
__ZN3JSC12SmallStrings17createEmptyStringEPNS_12JSGlobalDataE
__ZN3JSC12SmallStrings27createSingleCharacterStringEPNS_12JSGlobalDataEh
@@ -151,6 +150,7 @@ __ZN3JSC13SamplingFlags4stopEv
__ZN3JSC13SamplingFlags5startEv
__ZN3JSC13SamplingFlags7s_flagsE
__ZN3JSC13StatementNode6setLocEii
+__ZN3JSC14heapStatisticsEPNS_12JSGlobalDataE
__ZN3JSC14JSGlobalObject10globalExecEv
__ZN3JSC14JSGlobalObject12defineGetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj
__ZN3JSC14JSGlobalObject12defineSetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj
@@ -168,7 +168,6 @@ __ZN3JSC14TimeoutChecker5resetEv
__ZN3JSC14throwTypeErrorEPNS_9ExecStateE
__ZN3JSC15JSWrapperObject12markChildrenERNS_9MarkStackE
__ZN3JSC15createTypeErrorEPNS_9ExecStateERKNS_7UStringE
-__ZN3JSC15toInt32SlowCaseEdRb
__ZN3JSC16InternalFunction4infoE
__ZN3JSC16InternalFunction4nameEPNS_9ExecStateE
__ZN3JSC16InternalFunctionC2EPNS_12JSGlobalDataEPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEERKNS_10IdentifierE
@@ -178,7 +177,6 @@ __ZN3JSC16JSVariableObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNam
__ZN3JSC16WeakGCHandlePool4freeEPNS_12WeakGCHandleE
__ZN3JSC16createRangeErrorEPNS_9ExecStateERKNS_7UStringE
__ZN3JSC16throwSyntaxErrorEPNS_9ExecStateE
-__ZN3JSC16toUInt32SlowCaseEdRb
__ZN3JSC17BytecodeGenerator21setDumpsGeneratedCodeEb
__ZN3JSC17PropertyNameArray3addEPN3WTF10StringImplE
__ZN3JSC17constructFunctionEPNS_9ExecStateERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi
@@ -193,10 +191,10 @@ __ZN3JSC18PropertyDescriptor17defaultAttributesE
__ZN3JSC18PropertyDescriptor21setAccessorDescriptorENS_7JSValueES1_j
__ZN3JSC18PropertyDescriptor9setGetterENS_7JSValueE
__ZN3JSC18PropertyDescriptor9setSetterENS_7JSValueE
-__ZN3JSC19ExecutableAllocator18committedByteCountEv
__ZN3JSC19initializeThreadingEv
__ZN3JSC20MarkedArgumentBuffer10slowAppendENS_7JSValueE
__ZN3JSC20createReferenceErrorEPNS_9ExecStateERKNS_7UStringE
+__ZN3JSC22globalMemoryStatisticsEv
__ZN3JSC23AbstractSamplingCounter4dumpEv
__ZN3JSC23objectProtoFuncToStringEPNS_9ExecStateE
__ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectERKNS_10IdentifierERNS_12PropertySlotE
@@ -241,7 +239,6 @@ __ZN3JSC6JSLock4lockENS_14JSLockBehaviorE
__ZN3JSC6JSLock6unlockENS_14JSLockBehaviorE
__ZN3JSC6JSLock9lockCountEv
__ZN3JSC6JSLockC1EPNS_9ExecStateE
-__ZN3JSC6Parser5parseEPNS_12JSGlobalDataEPiPNS_7UStringE
__ZN3JSC7JSArray12markChildrenERNS_9MarkStackE
__ZN3JSC7JSArray15setSubclassDataEPv
__ZN3JSC7JSArray18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
@@ -264,6 +261,7 @@ __ZN3JSC7UStringC1EPKc
__ZN3JSC7UStringC1EPKcj
__ZN3JSC7UStringC1EPKt
__ZN3JSC7UStringC1EPKtj
+__ZN3JSC7toInt32Ed
__ZN3JSC8Debugger23recompileAllJSFunctionsEPNS_12JSGlobalDataE
__ZN3JSC8Debugger6attachEPNS_14JSGlobalObjectE
__ZN3JSC8Debugger6detachEPNS_14JSGlobalObjectE
diff --git a/JavaScriptCore/JavaScriptCore.pro b/JavaScriptCore/JavaScriptCore.pro
index 7f6b27d..f463f41 100644
--- a/JavaScriptCore/JavaScriptCore.pro
+++ b/JavaScriptCore/JavaScriptCore.pro
@@ -66,6 +66,7 @@ wince* {
}
include(pcre/pcre.pri)
+include(wtf/wtf.pri)
SOURCES += \
API/JSBase.cpp \
@@ -203,42 +204,11 @@ SOURCES += \
runtime/Structure.cpp \
runtime/TimeoutChecker.cpp \
runtime/UString.cpp \
- wtf/Assertions.cpp \
- wtf/ByteArray.cpp \
- wtf/CurrentTime.cpp \
- wtf/DateMath.cpp \
- wtf/dtoa.cpp \
- wtf/FastMalloc.cpp \
- wtf/HashTable.cpp \
- wtf/MD5.cpp \
- wtf/MainThread.cpp \
- wtf/qt/MainThreadQt.cpp \
- wtf/qt/StringQt.cpp \
- wtf/qt/ThreadingQt.cpp \
- wtf/PageAllocation.cpp \
- wtf/RandomNumber.cpp \
- wtf/RefCountedLeakCounter.cpp \
- wtf/ThreadingNone.cpp \
- wtf/Threading.cpp \
- wtf/TypeTraits.cpp \
- wtf/WTFThreadData.cpp \
- wtf/text/AtomicString.cpp \
- wtf/text/CString.cpp \
- wtf/text/StringImpl.cpp \
- wtf/text/StringStatics.cpp \
- wtf/text/WTFString.cpp \
- wtf/unicode/CollatorDefault.cpp \
- wtf/unicode/icu/CollatorICU.cpp \
- wtf/unicode/UTF8.cpp \
yarr/RegexCompiler.cpp \
yarr/RegexInterpreter.cpp \
yarr/RegexJIT.cpp
# Generated files, simply list them for JavaScriptCore
-!contains(DEFINES, USE_SYSTEM_MALLOC) {
- SOURCES += wtf/TCSystemAlloc.cpp
-}
-
# Disable C++0x mode in JSC for those who enabled it in their Qt's mkspec
*-g++*:QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.make b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.make
index 4c47ac6..4f049c9 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.make
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.make
@@ -32,4 +32,4 @@ install:
xcopy "$(OBJROOT)\lib\*" "$(DSTROOT)\AppleInternal\lib\" /e/v/i/h/y
xcopy "$(OBJROOT)\bin\JavaScriptCore.resources\*" "$(DSTROOT)\AppleInternal\bin\JavaScriptCore.resources" /e/v/i/h/y
-mkdir "$(DSTROOT)\AppleInternal\Sources\JavaScriptCore"
- xcopy "$(OBJROOT)\obj\JavaScriptCore\DerivedSources\*" "$(DSTROOT)\AppleInternal\Sources\WebCore" /e/v/i/h/y
+ xcopy "$(OBJROOT)\obj\JavaScriptCore\DerivedSources\*" "$(DSTROOT)\AppleInternal\Sources\JavaScriptCore" /e/v/i/h/y
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
index 7226326..ba564f0 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
@@ -232,7 +232,6 @@ EXPORTS
?nonInlineNaN@JSC@@YANXZ
?objectCount@Heap@JSC@@QBEIXZ
?objectProtoFuncToString@JSC@@YI_JPAVExecState@1@@Z
- ?parse@Parser@JSC@@AAEXPAVJSGlobalData@2@PAHPAVUString@2@@Z
?parseDateFromNullTerminatedCharacters@WTF@@YANPBD@Z
?pool@WeakGCHandle@JSC@@QAEPAVWeakGCHandlePool@2@XZ
?profiler@Profiler@JSC@@SAPAV12@XZ
@@ -305,7 +304,7 @@ EXPORTS
?toBoolean@JSCell@JSC@@UBE_NPAVExecState@2@@Z
?toBoolean@JSObject@JSC@@UBE_NPAVExecState@2@@Z
?toBoolean@JSString@JSC@@EBE_NPAVExecState@2@@Z
- ?toInt32SlowCase@JSC@@YAHNAA_N@Z
+ ?toInt32@JSC@@YAHN@Z
?toInteger@JSValue@JSC@@QBENPAVExecState@2@@Z
?toNumber@JSCell@JSC@@UBENPAVExecState@2@@Z
?toNumber@JSObject@JSC@@UBENPAVExecState@2@@Z
@@ -324,7 +323,6 @@ EXPORTS
?toThisObject@JSString@JSC@@EBEPAVJSObject@2@PAVExecState@2@@Z
?toThisObjectSlowCase@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z
?toUInt32@Identifier@JSC@@SAIABVUString@2@AA_N@Z
- ?toUInt32SlowCase@JSC@@YAINAA_N@Z
?tryFastCalloc@WTF@@YA?AUTryMallocReturnValue@1@II@Z
?tryFastMalloc@WTF@@YA?AUTryMallocReturnValue@1@I@Z
?tryLock@Mutex@WTF@@QAE_NXZ
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make
index a9493a3..098ff08 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make
@@ -1,5 +1,4 @@
all:
- -if not exist "$(WEBKITLIBRARIESDIR)\tools\vsprops\.svn" del /s/q "$(WEBKITLIBRARIESDIR)\tools\vsprops\"
-xcopy /y/d/e/i "..\..\..\WebKitLibraries\win\tools" "$(WEBKITLIBRARIESDIR)\tools"
touch "$(WEBKITOUTPUTDIR)\buildfailed"
bash build-generated-files.sh "$(WEBKITOUTPUTDIR)" "$(WEBKITLIBRARIESDIR)"
diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index bee44b6..675d26d 100644
--- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -258,6 +258,8 @@
86EAC49B0F93E8D1008EC948 /* RegexParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EAC4930F93E8D1008EC948 /* RegexParser.h */; };
86EAC49C0F93E8D1008EC948 /* RegexPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EAC4940F93E8D1008EC948 /* RegexPattern.h */; };
86F38859121130CA007A7CE3 /* AtomicStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F38858121130CA007A7CE3 /* AtomicStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 90213E3D123A40C200D422F3 /* MemoryStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90213E3B123A40C200D422F3 /* MemoryStatistics.cpp */; };
+ 90213E3E123A40C200D422F3 /* MemoryStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 90213E3C123A40C200D422F3 /* MemoryStatistics.h */; settings = {ATTRIBUTES = (Private, ); }; };
905B02AE0E28640F006DF882 /* RefCountedLeakCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 905B02AD0E28640F006DF882 /* RefCountedLeakCounter.cpp */; };
90D3469C0E285280009492EE /* RefCountedLeakCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 90D3469B0E285280009492EE /* RefCountedLeakCounter.h */; settings = {ATTRIBUTES = (Private, ); }; };
93052C340FB792190048FDC3 /* ParserArena.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93052C320FB792190048FDC3 /* ParserArena.cpp */; };
@@ -859,6 +861,8 @@
86EAC4930F93E8D1008EC948 /* RegexParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegexParser.h; path = yarr/RegexParser.h; sourceTree = "<group>"; };
86EAC4940F93E8D1008EC948 /* RegexPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegexPattern.h; path = yarr/RegexPattern.h; sourceTree = "<group>"; };
86F38858121130CA007A7CE3 /* AtomicStringHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomicStringHash.h; path = text/AtomicStringHash.h; sourceTree = "<group>"; };
+ 90213E3B123A40C200D422F3 /* MemoryStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryStatistics.cpp; sourceTree = "<group>"; };
+ 90213E3C123A40C200D422F3 /* MemoryStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryStatistics.h; sourceTree = "<group>"; };
905B02AD0E28640F006DF882 /* RefCountedLeakCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RefCountedLeakCounter.cpp; sourceTree = "<group>"; };
90D3469B0E285280009492EE /* RefCountedLeakCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefCountedLeakCounter.h; sourceTree = "<group>"; };
9303F567099118FA00AD71B8 /* OwnPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnPtr.h; sourceTree = "<group>"; };
@@ -1735,6 +1739,8 @@
A7C530E3102A3813005BC741 /* MarkStackPosix.cpp */,
F692A86A0255597D01FF60F7 /* MathObject.cpp */,
F692A86B0255597D01FF60F7 /* MathObject.h */,
+ 90213E3B123A40C200D422F3 /* MemoryStatistics.cpp */,
+ 90213E3C123A40C200D422F3 /* MemoryStatistics.h */,
BC02E9080E1839DB000F9297 /* NativeErrorConstructor.cpp */,
BC02E9090E1839DB000F9297 /* NativeErrorConstructor.h */,
BC02E90A0E1839DB000F9297 /* NativeErrorPrototype.cpp */,
@@ -2307,6 +2313,7 @@
9714AF4F122F289A0092D9F5 /* URLSegments.h in Headers */,
9714AF5F122F32070092D9F5 /* ParsedURL.h in Headers */,
9714AF60122F32070092D9F5 /* URLString.h in Headers */,
+ 90213E3E123A40C200D422F3 /* MemoryStatistics.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2760,6 +2767,7 @@
A74DE1D0120B875600D40D5B /* ARMv7Assembler.cpp in Sources */,
9714AF46122F28850092D9F5 /* URLSegments.cpp in Sources */,
9714AF5E122F32070092D9F5 /* ParsedURL.cpp in Sources */,
+ 90213E3D123A40C200D422F3 /* MemoryStatistics.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/JavaScriptCore/parser/ASTBuilder.h b/JavaScriptCore/parser/ASTBuilder.h
index dbf3c07..40023f8 100644
--- a/JavaScriptCore/parser/ASTBuilder.h
+++ b/JavaScriptCore/parser/ASTBuilder.h
@@ -100,6 +100,7 @@ public:
typedef std::pair<ExpressionNode*, BinaryOpInfo> BinaryOperand;
static const bool CreatesAST = true;
+ static const bool NeedsFreeVariableInfo = true;
ExpressionNode* makeBinaryNode(int token, std::pair<ExpressionNode*, BinaryOpInfo>, std::pair<ExpressionNode*, BinaryOpInfo>);
ExpressionNode* makeFunctionCallNode(ExpressionNode* func, ArgumentsNode* args, int start, int divot, int end);
diff --git a/JavaScriptCore/parser/JSParser.cpp b/JavaScriptCore/parser/JSParser.cpp
index 820811e..540dc3b 100644
--- a/JavaScriptCore/parser/JSParser.cpp
+++ b/JavaScriptCore/parser/JSParser.cpp
@@ -67,7 +67,7 @@ static const ptrdiff_t kMaxParserStackUsage = 128 * sizeof(void*) * 1024;
class JSParser {
public:
- JSParser(Lexer*, JSGlobalData*, SourceProvider*);
+ JSParser(Lexer*, JSGlobalData*, FunctionParameters*, SourceProvider*);
bool parseProgram();
private:
struct AllowInOverride {
@@ -161,7 +161,7 @@ private:
template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseVarDeclarationList(TreeBuilder&, int& declarations, const Identifier*& lastIdent, TreeExpression& lastInitializer, int& identStart, int& initStart, int& initEnd);
template <class TreeBuilder> ALWAYS_INLINE TreeConstDeclList parseConstDeclarationList(TreeBuilder& context);
enum FunctionRequirements { FunctionNoRequirements, FunctionNeedsName };
- template <FunctionRequirements, class TreeBuilder> bool parseFunctionInfo(TreeBuilder&, const Identifier*&, TreeFormalParameterList&, TreeFunctionBody&, int& openBrace, int& closeBrace, int& bodyStartLine);
+ template <FunctionRequirements, bool nameIsInContainingScope, class TreeBuilder> bool parseFunctionInfo(TreeBuilder&, const Identifier*&, TreeFormalParameterList&, TreeFunctionBody&, int& openBrace, int& closeBrace, int& bodyStartLine);
ALWAYS_INLINE int isBinaryOperator(JSTokenType token);
bool allowAutomaticSemicolon();
@@ -199,15 +199,105 @@ private:
int m_assignmentCount;
int m_nonLHSCount;
bool m_syntaxAlreadyValidated;
+
+ struct Scope {
+ Scope()
+ : m_usesEval(false)
+ , m_needsFullActivation(false)
+ {
+ }
+
+ void declareVariable(const Identifier* ident)
+ {
+ m_declaredVariables.add(ident->ustring().impl());
+ }
+
+ void useVariable(const Identifier* ident, bool isEval)
+ {
+ m_usesEval |= isEval;
+ m_usedVariables.add(ident->ustring().impl());
+ }
+
+ void needsFullActivation() { m_needsFullActivation = true; }
+
+ void collectFreeVariables(Scope* nestedScope, bool shouldTrackClosedVariables)
+ {
+ if (nestedScope->m_usesEval)
+ m_usesEval = true;
+ IdentifierSet::iterator end = nestedScope->m_usedVariables.end();
+ for (IdentifierSet::iterator ptr = nestedScope->m_usedVariables.begin(); ptr != end; ++ptr) {
+ if (nestedScope->m_declaredVariables.contains(*ptr))
+ continue;
+ m_usedVariables.add(*ptr);
+ if (shouldTrackClosedVariables)
+ m_closedVariables.add(*ptr);
+ }
+ }
+
+ void getCapturedVariables(IdentifierSet& capturedVariables)
+ {
+ if (m_needsFullActivation || m_usesEval) {
+ capturedVariables.swap(m_declaredVariables);
+ return;
+ }
+ for (IdentifierSet::iterator ptr = m_closedVariables.begin(); ptr != m_closedVariables.end(); ++ptr) {
+ if (!m_declaredVariables.contains(*ptr))
+ continue;
+ capturedVariables.add(*ptr);
+ }
+ }
+ private:
+ bool m_usesEval;
+ bool m_needsFullActivation;
+ IdentifierSet m_declaredVariables;
+ IdentifierSet m_usedVariables;
+ IdentifierSet m_closedVariables;
+ };
+
+ typedef Vector<Scope, 10> ScopeStack;
+
+ struct ScopeRef {
+ ScopeRef(ScopeStack* scopeStack, unsigned index)
+ : m_scopeStack(scopeStack)
+ , m_index(index)
+ {
+ }
+ Scope* operator->() { return &m_scopeStack->at(m_index); }
+ unsigned index() const { return m_index; }
+ private:
+ ScopeStack* m_scopeStack;
+ unsigned m_index;
+ };
+
+ ScopeRef currentScope()
+ {
+ return ScopeRef(&m_scopeStack, m_scopeStack.size() - 1);
+ }
+
+ ScopeRef pushScope()
+ {
+ m_scopeStack.append(Scope());
+ return currentScope();
+ }
+
+ void popScope(ScopeRef scope, bool shouldTrackClosedVariables)
+ {
+ ASSERT_UNUSED(scope, scope.index() == m_scopeStack.size() - 1);
+ ASSERT(m_scopeStack.size() > 1);
+ m_scopeStack[m_scopeStack.size() - 2].collectFreeVariables(&m_scopeStack.last(), shouldTrackClosedVariables);
+ m_scopeStack.removeLast();
+ }
+
+ ScopeStack m_scopeStack;
};
-int jsParse(JSGlobalData* globalData, const SourceCode* source)
+int jsParse(JSGlobalData* globalData, FunctionParameters* parameters, const SourceCode* source)
{
- JSParser parser(globalData->lexer, globalData, source->provider());
+ JSParser parser(globalData->lexer, globalData, parameters, source->provider());
return parser.parseProgram();
}
-JSParser::JSParser(Lexer* lexer, JSGlobalData* globalData, SourceProvider* provider)
+JSParser::JSParser(Lexer* lexer, JSGlobalData* globalData, FunctionParameters* parameters, SourceProvider* provider)
: m_lexer(lexer)
, m_endAddress(0)
, m_error(false)
@@ -223,16 +313,24 @@ JSParser::JSParser(Lexer* lexer, JSGlobalData* globalData, SourceProvider* provi
m_endAddress = wtfThreadData().approximatedStackStart() - kMaxParserStackUsage;
next();
m_lexer->setLastLineNumber(tokenLine());
+ ScopeRef scope = pushScope();
+ if (parameters) {
+ for (unsigned i = 0; i < parameters->size(); i++)
+ scope->declareVariable(&parameters->at(i));
+ }
}
bool JSParser::parseProgram()
{
ASTBuilder context(m_globalData, m_lexer);
+ ScopeRef scope = currentScope();
SourceElements* sourceElements = parseSourceElements<ASTBuilder>(context);
if (!sourceElements || !consume(EOFTOK))
return true;
+ IdentifierSet capturedVariables;
+ scope->getCapturedVariables(capturedVariables);
m_globalData->parser->didFinishParsing(sourceElements, context.varDeclarations(), context.funcDeclarations(), context.features(),
- m_lastLine, context.numConstants());
+ m_lastLine, context.numConstants(), capturedVariables);
return false;
}
@@ -327,6 +425,7 @@ template <class TreeBuilder> TreeExpression JSParser::parseVarDeclarationList(Tr
lastIdent = name;
next();
bool hasInitializer = match(EQUAL);
+ currentScope()->declareVariable(name);
context.addVar(name, (hasInitializer || (!m_allowsIn && match(INTOKEN))) ? DeclarationStacks::HasInitializer : 0);
if (hasInitializer) {
int varDivot = tokenStart() + 1;
@@ -358,6 +457,7 @@ template <class TreeBuilder> TreeConstDeclList JSParser::parseConstDeclarationLi
const Identifier* name = m_token.m_data.ident;
next();
bool hasInitializer = match(EQUAL);
+ currentScope()->declareVariable(name);
context.addVar(name, DeclarationStacks::IsConstant | (hasInitializer ? DeclarationStacks::HasInitializer : 0));
TreeExpression initializer = 0;
if (hasInitializer) {
@@ -552,6 +652,7 @@ template <class TreeBuilder> TreeStatement JSParser::parseThrowStatement(TreeBui
template <class TreeBuilder> TreeStatement JSParser::parseWithStatement(TreeBuilder& context)
{
ASSERT(match(WITH));
+ currentScope()->needsFullActivation();
int startLine = tokenLine();
next();
consumeOrFail(OPENPAREN);
@@ -650,17 +751,21 @@ template <class TreeBuilder> TreeStatement JSParser::parseTryStatement(TreeBuild
int lastLine = m_lastLine;
if (match(CATCH)) {
+ currentScope()->needsFullActivation();
next();
consumeOrFail(OPENPAREN);
matchOrFail(IDENT);
ident = m_token.m_data.ident;
next();
+ ScopeRef catchScope = pushScope();
+ catchScope->declareVariable(ident);
consumeOrFail(CLOSEPAREN);
matchOrFail(OPENBRACE);
int initialEvalCount = context.evalCount();
catchBlock = parseBlockStatement(context);
failIfFalse(catchBlock);
catchHasEval = initialEvalCount != context.evalCount();
+ popScope(catchScope, TreeBuilder::NeedsFreeVariableInfo);
}
if (match(FINALLY)) {
@@ -757,6 +862,7 @@ template <class TreeBuilder> TreeFormalParameterList JSParser::parseFormalParame
{
matchOrFail(IDENT);
usesArguments = m_globalData->propertyNames->arguments == *m_token.m_data.ident;
+ currentScope()->declareVariable(m_token.m_data.ident);
TreeFormalParameterList list = context.createFormalParameterList(*m_token.m_data.ident);
TreeFormalParameterList tail = list;
next();
@@ -764,6 +870,7 @@ template <class TreeBuilder> TreeFormalParameterList JSParser::parseFormalParame
next();
matchOrFail(IDENT);
const Identifier* ident = m_token.m_data.ident;
+ currentScope()->declareVariable(ident);
next();
usesArguments = usesArguments || m_globalData->propertyNames->arguments == *ident;
tail = context.createFormalParameterList(tail, *ident);
@@ -780,11 +887,14 @@ template <class TreeBuilder> TreeFunctionBody JSParser::parseFunctionBody(TreeBu
return context.createFunctionBody();
}
-template <JSParser::FunctionRequirements requirements, class TreeBuilder> bool JSParser::parseFunctionInfo(TreeBuilder& context, const Identifier*& name, TreeFormalParameterList& parameters, TreeFunctionBody& body, int& openBracePos, int& closeBracePos, int& bodyStartLine)
+template <JSParser::FunctionRequirements requirements, bool nameIsInContainingScope, class TreeBuilder> bool JSParser::parseFunctionInfo(TreeBuilder& context, const Identifier*& name, TreeFormalParameterList& parameters, TreeFunctionBody& body, int& openBracePos, int& closeBracePos, int& bodyStartLine)
{
+ ScopeRef functionScope = pushScope();
if (match(IDENT)) {
name = m_token.m_data.ident;
next();
+ if (!nameIsInContainingScope)
+ functionScope->declareVariable(name);
} else if (requirements == FunctionNeedsName)
return false;
consumeOrFail(OPENPAREN);
@@ -804,7 +914,7 @@ template <JSParser::FunctionRequirements requirements, class TreeBuilder> bool J
failIfFalse(body);
if (usesArguments)
context.setUsesArguments(body);
-
+ popScope(functionScope, TreeBuilder::NeedsFreeVariableInfo);
matchOrFail(CLOSEBRACE);
closeBracePos = m_token.m_data.intValue;
next();
@@ -821,8 +931,9 @@ template <class TreeBuilder> TreeStatement JSParser::parseFunctionDeclaration(Tr
int openBracePos = 0;
int closeBracePos = 0;
int bodyStartLine = 0;
- failIfFalse(parseFunctionInfo<FunctionNeedsName>(context, name, parameters, body, openBracePos, closeBracePos, bodyStartLine));
+ failIfFalse((parseFunctionInfo<FunctionNeedsName, true>(context, name, parameters, body, openBracePos, closeBracePos, bodyStartLine)));
failIfFalse(name);
+ currentScope()->declareVariable(name);
return context.createFuncDeclStatement(name, body, parameters, openBracePos, closeBracePos, bodyStartLine, m_lastLine);
}
@@ -1113,7 +1224,7 @@ template <bool complete, class TreeBuilder> TreeProperty JSParser::parseProperty
type = PropertyNode::Setter;
else
fail();
- failIfFalse(parseFunctionInfo<FunctionNeedsName>(context, accessorName, parameters, body, openBracePos, closeBracePos, bodyStartLine));
+ failIfFalse((parseFunctionInfo<FunctionNeedsName, false>(context, accessorName, parameters, body, openBracePos, closeBracePos, bodyStartLine)));
return context.template createGetterOrSetterProperty<complete>(type, accessorName, parameters, body, openBracePos, closeBracePos, bodyStartLine, m_lastLine);
}
case NUMBER: {
@@ -1281,6 +1392,7 @@ template <class TreeBuilder> TreeExpression JSParser::parsePrimaryExpression(Tre
int start = tokenStart();
const Identifier* ident = m_token.m_data.ident;
next();
+ currentScope()->useVariable(ident, m_globalData->propertyNames->eval == *ident);
return context.createResolve(ident, start);
}
case STRING: {
@@ -1364,7 +1476,7 @@ template <class TreeBuilder> TreeExpression JSParser::parseMemberExpression(Tree
int closeBracePos = 0;
int bodyStartLine = 0;
next();
- failIfFalse(parseFunctionInfo<FunctionNoRequirements>(context, name, parameters, body, openBracePos, closeBracePos, bodyStartLine));
+ failIfFalse((parseFunctionInfo<FunctionNoRequirements, false>(context, name, parameters, body, openBracePos, closeBracePos, bodyStartLine)));
base = context.createFunctionExpr(name, body, parameters, openBracePos, closeBracePos, bodyStartLine, m_lastLine);
} else
base = parsePrimaryExpression(context);
diff --git a/JavaScriptCore/parser/JSParser.h b/JavaScriptCore/parser/JSParser.h
index b5a21d9..ab18fab 100644
--- a/JavaScriptCore/parser/JSParser.h
+++ b/JavaScriptCore/parser/JSParser.h
@@ -28,6 +28,7 @@
namespace JSC {
+class FunctionParameters;
class Identifier;
class JSGlobalData;
class SourceCode;
@@ -154,6 +155,6 @@ struct JSToken {
JSTokenInfo m_info;
};
-int jsParse(JSGlobalData*, const SourceCode*);
+int jsParse(JSGlobalData*, FunctionParameters*, const SourceCode*);
}
#endif // JSParser_h
diff --git a/JavaScriptCore/parser/Nodes.cpp b/JavaScriptCore/parser/Nodes.cpp
index c41d735..534e28a 100644
--- a/JavaScriptCore/parser/Nodes.cpp
+++ b/JavaScriptCore/parser/Nodes.cpp
@@ -75,7 +75,7 @@ StatementNode* SourceElements::singleStatement() const
// -----------------------------ScopeNodeData ---------------------------
-ScopeNodeData::ScopeNodeData(ParserArena& arena, SourceElements* statements, VarStack* varStack, FunctionStack* funcStack, int numConstants)
+ScopeNodeData::ScopeNodeData(ParserArena& arena, SourceElements* statements, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, int numConstants)
: m_numConstants(numConstants)
, m_statements(statements)
{
@@ -84,6 +84,7 @@ ScopeNodeData::ScopeNodeData(ParserArena& arena, SourceElements* statements, Var
m_varStack.swap(*varStack);
if (funcStack)
m_functionStack.swap(*funcStack);
+ m_capturedVariables.swap(capturedVariables);
}
// ------------------------------ ScopeNode -----------------------------
@@ -95,10 +96,10 @@ ScopeNode::ScopeNode(JSGlobalData* globalData)
{
}
-ScopeNode::ScopeNode(JSGlobalData* globalData, const SourceCode& source, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, CodeFeatures features, int numConstants)
+ScopeNode::ScopeNode(JSGlobalData* globalData, const SourceCode& source, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, CodeFeatures features, int numConstants)
: StatementNode(globalData)
, ParserArenaRefCounted(globalData)
- , m_data(adoptPtr(new ScopeNodeData(globalData->parser->arena(), children, varStack, funcStack, numConstants)))
+ , m_data(adoptPtr(new ScopeNodeData(globalData->parser->arena(), children, varStack, funcStack, capturedVariables, numConstants)))
, m_features(features)
, m_source(source)
{
@@ -111,14 +112,14 @@ StatementNode* ScopeNode::singleStatement() const
// ------------------------------ ProgramNode -----------------------------
-inline ProgramNode::ProgramNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& source, CodeFeatures features, int numConstants)
- : ScopeNode(globalData, source, children, varStack, funcStack, features, numConstants)
+inline ProgramNode::ProgramNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants)
+ : ScopeNode(globalData, source, children, varStack, funcStack, capturedVariables, features, numConstants)
{
}
-PassRefPtr<ProgramNode> ProgramNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& source, CodeFeatures features, int numConstants)
+PassRefPtr<ProgramNode> ProgramNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants)
{
- RefPtr<ProgramNode> node = new ProgramNode(globalData, children, varStack, funcStack, source, features, numConstants);
+ RefPtr<ProgramNode> node = new ProgramNode(globalData, children, varStack, funcStack, capturedVariables, source, features, numConstants);
ASSERT(node->data()->m_arena.last() == node);
node->data()->m_arena.removeLast();
@@ -129,14 +130,14 @@ PassRefPtr<ProgramNode> ProgramNode::create(JSGlobalData* globalData, SourceElem
// ------------------------------ EvalNode -----------------------------
-inline EvalNode::EvalNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& source, CodeFeatures features, int numConstants)
- : ScopeNode(globalData, source, children, varStack, funcStack, features, numConstants)
+inline EvalNode::EvalNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants)
+ : ScopeNode(globalData, source, children, varStack, funcStack, capturedVariables, features, numConstants)
{
}
-PassRefPtr<EvalNode> EvalNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& source, CodeFeatures features, int numConstants)
+PassRefPtr<EvalNode> EvalNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants)
{
- RefPtr<EvalNode> node = new EvalNode(globalData, children, varStack, funcStack, source, features, numConstants);
+ RefPtr<EvalNode> node = new EvalNode(globalData, children, varStack, funcStack, capturedVariables, source, features, numConstants);
ASSERT(node->data()->m_arena.last() == node);
node->data()->m_arena.removeLast();
@@ -158,8 +159,8 @@ inline FunctionBodyNode::FunctionBodyNode(JSGlobalData* globalData)
{
}
-inline FunctionBodyNode::FunctionBodyNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& sourceCode, CodeFeatures features, int numConstants)
- : ScopeNode(globalData, sourceCode, children, varStack, funcStack, features, numConstants)
+inline FunctionBodyNode::FunctionBodyNode(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& sourceCode, CodeFeatures features, int numConstants)
+ : ScopeNode(globalData, sourceCode, children, varStack, funcStack, capturedVariables, features, numConstants)
{
}
@@ -181,9 +182,9 @@ FunctionBodyNode* FunctionBodyNode::create(JSGlobalData* globalData)
return new FunctionBodyNode(globalData);
}
-PassRefPtr<FunctionBodyNode> FunctionBodyNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, const SourceCode& sourceCode, CodeFeatures features, int numConstants)
+PassRefPtr<FunctionBodyNode> FunctionBodyNode::create(JSGlobalData* globalData, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& sourceCode, CodeFeatures features, int numConstants)
{
- RefPtr<FunctionBodyNode> node = new FunctionBodyNode(globalData, children, varStack, funcStack, sourceCode, features, numConstants);
+ RefPtr<FunctionBodyNode> node = new FunctionBodyNode(globalData, children, varStack, funcStack, capturedVariables, sourceCode, features, numConstants);
ASSERT(node->data()->m_arena.last() == node);
node->data()->m_arena.removeLast();
diff --git a/JavaScriptCore/parser/Nodes.h b/JavaScriptCore/parser/Nodes.h
index d25079b..2d8448c 100644
--- a/JavaScriptCore/parser/Nodes.h
+++ b/JavaScriptCore/parser/Nodes.h
@@ -81,6 +81,8 @@ namespace JSC {
OpLogicalOr
};
+ typedef HashSet<RefPtr<StringImpl>, IdentifierRepHash> IdentifierSet;
+
namespace DeclarationStacks {
enum VarAttrs { IsConstant = 1, HasInitializer = 2 };
typedef Vector<std::pair<const Identifier*, unsigned> > VarStack;
@@ -1376,13 +1378,14 @@ namespace JSC {
typedef DeclarationStacks::VarStack VarStack;
typedef DeclarationStacks::FunctionStack FunctionStack;
- ScopeNodeData(ParserArena&, SourceElements*, VarStack*, FunctionStack*, int numConstants);
+ ScopeNodeData(ParserArena&, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, int numConstants);
ParserArena m_arena;
VarStack m_varStack;
FunctionStack m_functionStack;
int m_numConstants;
SourceElements* m_statements;
+ IdentifierSet m_capturedVariables;
};
class ScopeNode : public StatementNode, public ParserArenaRefCounted {
@@ -1391,7 +1394,7 @@ namespace JSC {
typedef DeclarationStacks::FunctionStack FunctionStack;
ScopeNode(JSGlobalData*);
- ScopeNode(JSGlobalData*, const SourceCode&, SourceElements*, VarStack*, FunctionStack*, CodeFeatures, int numConstants);
+ ScopeNode(JSGlobalData*, const SourceCode&, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, CodeFeatures, int numConstants);
using ParserArenaRefCounted::operator new;
@@ -1409,7 +1412,8 @@ namespace JSC {
bool usesArguments() const { return m_features & ArgumentsFeature; }
void setUsesArguments() { m_features |= ArgumentsFeature; }
bool usesThis() const { return m_features & ThisFeature; }
- bool needsActivation() const { return m_features & (EvalFeature | ClosureFeature | WithFeature | CatchFeature); }
+ bool needsActivation() const { ASSERT(m_data); return (hasCapturedVariables()) || (m_features & (EvalFeature | WithFeature | CatchFeature)); }
+ bool hasCapturedVariables() const { return !!m_data->m_capturedVariables.size(); }
VarStack& varStack() { ASSERT(m_data); return m_data->m_varStack; }
FunctionStack& functionStack() { ASSERT(m_data); return m_data->m_functionStack; }
@@ -1437,24 +1441,24 @@ namespace JSC {
class ProgramNode : public ScopeNode {
public:
- static PassRefPtr<ProgramNode> create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants);
+ static PassRefPtr<ProgramNode> create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);
static const bool scopeIsFunction = false;
private:
- ProgramNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants);
+ ProgramNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);
virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
};
class EvalNode : public ScopeNode {
public:
- static PassRefPtr<EvalNode> create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants);
+ static PassRefPtr<EvalNode> create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);
static const bool scopeIsFunction = false;
private:
- EvalNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants);
+ EvalNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);
virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
};
@@ -1470,7 +1474,7 @@ namespace JSC {
class FunctionBodyNode : public ScopeNode {
public:
static FunctionBodyNode* create(JSGlobalData*);
- static PassRefPtr<FunctionBodyNode> create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants);
+ static PassRefPtr<FunctionBodyNode> create(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);
FunctionParameters* parameters() const { return m_parameters.get(); }
size_t parameterCount() const { return m_parameters->size(); }
@@ -1486,7 +1490,7 @@ namespace JSC {
private:
FunctionBodyNode(JSGlobalData*);
- FunctionBodyNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants);
+ FunctionBodyNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);
Identifier m_ident;
RefPtr<FunctionParameters> m_parameters;
diff --git a/JavaScriptCore/parser/Parser.cpp b/JavaScriptCore/parser/Parser.cpp
index 39ff597..bd77742 100644
--- a/JavaScriptCore/parser/Parser.cpp
+++ b/JavaScriptCore/parser/Parser.cpp
@@ -39,7 +39,7 @@ extern int jscyyparse(void*);
namespace JSC {
-void Parser::parse(JSGlobalData* globalData, int* errLine, UString* errMsg)
+void Parser::parse(JSGlobalData* globalData, FunctionParameters* parameters, int* errLine, UString* errMsg)
{
#ifdef ANDROID_INSTRUMENT
android::TimeCounter::start(android::TimeCounter::JavaScriptParseTimeCounter);
@@ -60,7 +60,7 @@ void Parser::parse(JSGlobalData* globalData, int* errLine, UString* errMsg)
Lexer& lexer = *globalData->lexer;
lexer.setCode(*m_source, m_arena);
- int parseError = jsParse(globalData, m_source);
+ int parseError = jsParse(globalData, parameters, m_source);
int lineNumber = lexer.lineNumber();
bool lexError = lexer.sawError();
lexer.clear();
@@ -76,11 +76,12 @@ void Parser::parse(JSGlobalData* globalData, int* errLine, UString* errMsg)
}
void Parser::didFinishParsing(SourceElements* sourceElements, ParserArenaData<DeclarationStacks::VarStack>* varStack,
- ParserArenaData<DeclarationStacks::FunctionStack>* funcStack, CodeFeatures features, int lastLine, int numConstants)
+ ParserArenaData<DeclarationStacks::FunctionStack>* funcStack, CodeFeatures features, int lastLine, int numConstants, IdentifierSet& capturedVars)
{
m_sourceElements = sourceElements;
m_varDeclarations = varStack;
m_funcDeclarations = funcStack;
+ m_capturedVariables.swap(capturedVars);
m_features = features;
m_lastLine = lastLine;
m_numConstants = numConstants;
diff --git a/JavaScriptCore/parser/Parser.h b/JavaScriptCore/parser/Parser.h
index c167980..9134de1 100644
--- a/JavaScriptCore/parser/Parser.h
+++ b/JavaScriptCore/parser/Parser.h
@@ -48,15 +48,16 @@ namespace JSC {
class Parser : public Noncopyable {
public:
template <class ParsedNode>
- PassRefPtr<ParsedNode> parse(JSGlobalData* globalData, JSGlobalObject* lexicalGlobalObject, Debugger*, ExecState*, const SourceCode& source, JSObject** exception);
+ PassRefPtr<ParsedNode> parse(JSGlobalData* globalData, JSGlobalObject* lexicalGlobalObject, Debugger*, ExecState*, const SourceCode& source, FunctionParameters*, JSObject** exception);
void didFinishParsing(SourceElements*, ParserArenaData<DeclarationStacks::VarStack>*,
- ParserArenaData<DeclarationStacks::FunctionStack>*, CodeFeatures features, int lastLine, int numConstants);
+ ParserArenaData<DeclarationStacks::FunctionStack>*, CodeFeatures features,
+ int lastLine, int numConstants, IdentifierSet&);
ParserArena& arena() { return m_arena; }
private:
- void parse(JSGlobalData*, int* errLine, UString* errMsg);
+ void parse(JSGlobalData*, FunctionParameters*, int* errLine, UString* errMsg);
// Used to determine type of error to report.
bool isFunctionBodyNode(ScopeNode*) { return false; }
@@ -67,13 +68,14 @@ namespace JSC {
SourceElements* m_sourceElements;
ParserArenaData<DeclarationStacks::VarStack>* m_varDeclarations;
ParserArenaData<DeclarationStacks::FunctionStack>* m_funcDeclarations;
+ IdentifierSet m_capturedVariables;
CodeFeatures m_features;
int m_lastLine;
int m_numConstants;
};
template <class ParsedNode>
- PassRefPtr<ParsedNode> Parser::parse(JSGlobalData* globalData, JSGlobalObject* lexicalGlobalObject, Debugger* debugger, ExecState* debuggerExecState, const SourceCode& source, JSObject** exception)
+ PassRefPtr<ParsedNode> Parser::parse(JSGlobalData* globalData, JSGlobalObject* lexicalGlobalObject, Debugger* debugger, ExecState* debuggerExecState, const SourceCode& source, FunctionParameters* parameters, JSObject** exception)
{
ASSERT(exception && !*exception);
int errLine;
@@ -82,17 +84,18 @@ namespace JSC {
m_source = &source;
if (ParsedNode::scopeIsFunction)
globalData->lexer->setIsReparsing();
- parse(globalData, &errLine, &errMsg);
+ parse(globalData, parameters, &errLine, &errMsg);
RefPtr<ParsedNode> result;
if (m_sourceElements) {
result = ParsedNode::create(globalData,
- m_sourceElements,
- m_varDeclarations ? &m_varDeclarations->data : 0,
- m_funcDeclarations ? &m_funcDeclarations->data : 0,
- source,
- m_features,
- m_numConstants);
+ m_sourceElements,
+ m_varDeclarations ? &m_varDeclarations->data : 0,
+ m_funcDeclarations ? &m_funcDeclarations->data : 0,
+ m_capturedVariables,
+ source,
+ m_features,
+ m_numConstants);
result->setLoc(m_source->firstLine(), m_lastLine);
} else if (lexicalGlobalObject) {
// We can never see a syntax error when reparsing a function, since we should have
diff --git a/JavaScriptCore/parser/SyntaxChecker.h b/JavaScriptCore/parser/SyntaxChecker.h
index e05facd..ce3ab61 100644
--- a/JavaScriptCore/parser/SyntaxChecker.h
+++ b/JavaScriptCore/parser/SyntaxChecker.h
@@ -70,6 +70,7 @@ public:
typedef int BinaryOperand;
static const bool CreatesAST = false;
+ static const bool NeedsFreeVariableInfo = false;
int createSourceElements() { return 1; }
int makeFunctionCallNode(int, int, int, int, int) { return 1; }
diff --git a/JavaScriptCore/runtime/Collector.cpp b/JavaScriptCore/runtime/Collector.cpp
index 4a81913..93b91bb 100644
--- a/JavaScriptCore/runtime/Collector.cpp
+++ b/JavaScriptCore/runtime/Collector.cpp
@@ -43,6 +43,7 @@
#include <stdlib.h>
#include <wtf/FastMalloc.h>
#include <wtf/HashCountedSet.h>
+#include <wtf/WTFThreadData.h>
#include <wtf/UnusedParam.h>
#include <wtf/VMTags.h>
@@ -298,6 +299,7 @@ void Heap::recordExtraCost(size_t cost)
void* Heap::allocate(size_t s)
{
+ ASSERT(globalData()->identifierTable == wtfThreadData().currentIdentifierTable());
typedef HeapConstants::Block Block;
typedef HeapConstants::Cell Cell;
@@ -1189,6 +1191,7 @@ bool Heap::isBusy()
void Heap::reset()
{
+ ASSERT(globalData()->identifierTable == wtfThreadData().currentIdentifierTable());
JAVASCRIPTCORE_GC_BEGIN();
markRoots();
@@ -1211,6 +1214,7 @@ void Heap::reset()
void Heap::collectAllGarbage()
{
+ ASSERT(globalData()->identifierTable == wtfThreadData().currentIdentifierTable());
JAVASCRIPTCORE_GC_BEGIN();
// If the last iteration through the heap deallocated blocks, we need
diff --git a/JavaScriptCore/runtime/DatePrototype.cpp b/JavaScriptCore/runtime/DatePrototype.cpp
index 249f427..4983f29 100644
--- a/JavaScriptCore/runtime/DatePrototype.cpp
+++ b/JavaScriptCore/runtime/DatePrototype.cpp
@@ -301,19 +301,25 @@ static bool fillStructuresUsingTimeArgs(ExecState* exec, int maxArgs, double* ms
// hours
if (maxArgs >= 4 && idx < numArgs) {
t->hour = 0;
- milliseconds += exec->argument(idx++).toInt32(exec, ok) * msPerHour;
+ double hours = exec->argument(idx++).toIntegerPreserveNaN(exec);
+ ok = isfinite(hours);
+ milliseconds += hours * msPerHour;
}
// minutes
if (maxArgs >= 3 && idx < numArgs && ok) {
t->minute = 0;
- milliseconds += exec->argument(idx++).toInt32(exec, ok) * msPerMinute;
+ double minutes = exec->argument(idx++).toIntegerPreserveNaN(exec);
+ ok = isfinite(minutes);
+ milliseconds += minutes * msPerMinute;
}
// seconds
if (maxArgs >= 2 && idx < numArgs && ok) {
t->second = 0;
- milliseconds += exec->argument(idx++).toInt32(exec, ok) * msPerSecond;
+ double seconds = exec->argument(idx++).toIntegerPreserveNaN(exec);
+ ok = isfinite(seconds);
+ milliseconds += seconds * msPerSecond;
}
if (!ok)
@@ -321,7 +327,7 @@ static bool fillStructuresUsingTimeArgs(ExecState* exec, int maxArgs, double* ms
// milliseconds
if (idx < numArgs) {
- double millis = exec->argument(idx).toNumber(exec);
+ double millis = exec->argument(idx).toIntegerPreserveNaN(exec);
ok = isfinite(millis);
milliseconds += millis;
} else
@@ -346,17 +352,23 @@ static bool fillStructuresUsingDateArgs(ExecState *exec, int maxArgs, double *ms
numArgs = maxArgs;
// years
- if (maxArgs >= 3 && idx < numArgs)
- t->year = exec->argument(idx++).toInt32(exec, ok) - 1900;
-
+ if (maxArgs >= 3 && idx < numArgs) {
+ double years = exec->argument(idx++).toIntegerPreserveNaN(exec);
+ ok = isfinite(years);
+ t->year = toInt32(years - 1900);
+ }
// months
- if (maxArgs >= 2 && idx < numArgs && ok)
- t->month = exec->argument(idx++).toInt32(exec, ok);
-
+ if (maxArgs >= 2 && idx < numArgs && ok) {
+ double months = exec->argument(idx++).toIntegerPreserveNaN(exec);
+ ok = isfinite(months);
+ t->month = toInt32(months);
+ }
// days
- if (idx < numArgs && ok) {
+ if (idx < numArgs && ok) {
+ double days = exec->argument(idx++).toIntegerPreserveNaN(exec);
+ ok = isfinite(days);
t->monthDay = 0;
- *ms += exec->argument(idx).toInt32(exec, ok) * msPerDay;
+ *ms += days * msPerDay;
}
return ok;
@@ -1026,15 +1038,14 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncSetYear(ExecState* exec)
gregorianDateTime.copyFrom(*other);
}
- bool ok = true;
- int32_t year = exec->argument(0).toInt32(exec, ok);
- if (!ok) {
+ double year = exec->argument(0).toIntegerPreserveNaN(exec);
+ if (!isfinite(year)) {
JSValue result = jsNaN(exec);
thisDateObj->setInternalValue(result);
return JSValue::encode(result);
}
- gregorianDateTime.year = (year > 99 || year < 0) ? year - 1900 : year;
+ gregorianDateTime.year = toInt32((year > 99 || year < 0) ? year - 1900 : year);
JSValue result = jsNumber(exec, gregorianDateTimeToMS(exec, gregorianDateTime, ms, false));
thisDateObj->setInternalValue(result);
return JSValue::encode(result);
diff --git a/JavaScriptCore/runtime/Executable.cpp b/JavaScriptCore/runtime/Executable.cpp
index 41b5f1f..e14955c 100644
--- a/JavaScriptCore/runtime/Executable.cpp
+++ b/JavaScriptCore/runtime/Executable.cpp
@@ -96,12 +96,12 @@ JSObject* EvalExecutable::compileInternal(ExecState* exec, ScopeChainNode* scope
JSObject* exception = 0;
JSGlobalData* globalData = &exec->globalData();
JSGlobalObject* lexicalGlobalObject = exec->lexicalGlobalObject();
- RefPtr<EvalNode> evalNode = globalData->parser->parse<EvalNode>(globalData, lexicalGlobalObject, lexicalGlobalObject->debugger(), exec, m_source, &exception);
+ RefPtr<EvalNode> evalNode = globalData->parser->parse<EvalNode>(globalData, lexicalGlobalObject, lexicalGlobalObject->debugger(), exec, m_source, 0, &exception);
if (!evalNode) {
ASSERT(exception);
return exception;
}
- recordParse(evalNode->features(), evalNode->lineNo(), evalNode->lastLine());
+ recordParse(evalNode->features(), evalNode->hasCapturedVariables(), evalNode->lineNo(), evalNode->lastLine());
ScopeChain scopeChain(scopeChainNode);
JSGlobalObject* globalObject = scopeChain.globalObject();
@@ -131,7 +131,7 @@ JSObject* ProgramExecutable::checkSyntax(ExecState* exec)
JSObject* exception = 0;
JSGlobalData* globalData = &exec->globalData();
JSGlobalObject* lexicalGlobalObject = exec->lexicalGlobalObject();
- RefPtr<ProgramNode> programNode = globalData->parser->parse<ProgramNode>(globalData, lexicalGlobalObject, lexicalGlobalObject->debugger(), exec, m_source, &exception);
+ RefPtr<ProgramNode> programNode = globalData->parser->parse<ProgramNode>(globalData, lexicalGlobalObject, lexicalGlobalObject->debugger(), exec, m_source, 0, &exception);
if (programNode)
return 0;
ASSERT(exception);
@@ -145,12 +145,12 @@ JSObject* ProgramExecutable::compileInternal(ExecState* exec, ScopeChainNode* sc
JSObject* exception = 0;
JSGlobalData* globalData = &exec->globalData();
JSGlobalObject* lexicalGlobalObject = exec->lexicalGlobalObject();
- RefPtr<ProgramNode> programNode = globalData->parser->parse<ProgramNode>(globalData, lexicalGlobalObject, lexicalGlobalObject->debugger(), exec, m_source, &exception);
+ RefPtr<ProgramNode> programNode = globalData->parser->parse<ProgramNode>(globalData, lexicalGlobalObject, lexicalGlobalObject->debugger(), exec, m_source, 0, &exception);
if (!programNode) {
ASSERT(exception);
return exception;
}
- recordParse(programNode->features(), programNode->lineNo(), programNode->lastLine());
+ recordParse(programNode->features(), programNode->hasCapturedVariables(), programNode->lineNo(), programNode->lastLine());
ScopeChain scopeChain(scopeChainNode);
JSGlobalObject* globalObject = scopeChain.globalObject();
@@ -178,7 +178,7 @@ JSObject* FunctionExecutable::compileForCallInternal(ExecState* exec, ScopeChain
{
JSObject* exception = 0;
JSGlobalData* globalData = scopeChainNode->globalData;
- RefPtr<FunctionBodyNode> body = globalData->parser->parse<FunctionBodyNode>(globalData, exec->lexicalGlobalObject(), 0, 0, m_source, &exception);
+ RefPtr<FunctionBodyNode> body = globalData->parser->parse<FunctionBodyNode>(globalData, exec->lexicalGlobalObject(), 0, 0, m_source, m_parameters.get(), &exception);
if (!body) {
ASSERT(exception);
return exception;
@@ -186,7 +186,7 @@ JSObject* FunctionExecutable::compileForCallInternal(ExecState* exec, ScopeChain
if (m_forceUsesArguments)
body->setUsesArguments();
body->finishParsing(m_parameters, m_name);
- recordParse(body->features(), body->lineNo(), body->lastLine());
+ recordParse(body->features(), body->hasCapturedVariables(), body->lineNo(), body->lastLine());
ScopeChain scopeChain(scopeChainNode);
JSGlobalObject* globalObject = scopeChain.globalObject();
@@ -219,7 +219,7 @@ JSObject* FunctionExecutable::compileForConstructInternal(ExecState* exec, Scope
{
JSObject* exception = 0;
JSGlobalData* globalData = scopeChainNode->globalData;
- RefPtr<FunctionBodyNode> body = globalData->parser->parse<FunctionBodyNode>(globalData, exec->lexicalGlobalObject(), 0, 0, m_source, &exception);
+ RefPtr<FunctionBodyNode> body = globalData->parser->parse<FunctionBodyNode>(globalData, exec->lexicalGlobalObject(), 0, 0, m_source, m_parameters.get(), &exception);
if (!body) {
ASSERT(exception);
return exception;
@@ -227,7 +227,7 @@ JSObject* FunctionExecutable::compileForConstructInternal(ExecState* exec, Scope
if (m_forceUsesArguments)
body->setUsesArguments();
body->finishParsing(m_parameters, m_name);
- recordParse(body->features(), body->lineNo(), body->lastLine());
+ recordParse(body->features(), body->hasCapturedVariables(), body->lineNo(), body->lastLine());
ScopeChain scopeChain(scopeChainNode);
JSGlobalObject* globalObject = scopeChain.globalObject();
@@ -267,7 +267,7 @@ void FunctionExecutable::markAggregate(MarkStack& markStack)
PassOwnPtr<ExceptionInfo> FunctionExecutable::reparseExceptionInfo(JSGlobalData* globalData, ScopeChainNode* scopeChainNode, CodeBlock* codeBlock)
{
JSObject* exception = 0;
- RefPtr<FunctionBodyNode> newFunctionBody = globalData->parser->parse<FunctionBodyNode>(globalData, 0, 0, 0, m_source, &exception);
+ RefPtr<FunctionBodyNode> newFunctionBody = globalData->parser->parse<FunctionBodyNode>(globalData, 0, 0, 0, m_source, m_parameters.get(), &exception);
if (!newFunctionBody)
return PassOwnPtr<ExceptionInfo>();
if (m_forceUsesArguments)
@@ -301,7 +301,7 @@ PassOwnPtr<ExceptionInfo> FunctionExecutable::reparseExceptionInfo(JSGlobalData*
PassOwnPtr<ExceptionInfo> EvalExecutable::reparseExceptionInfo(JSGlobalData* globalData, ScopeChainNode* scopeChainNode, CodeBlock* codeBlock)
{
JSObject* exception = 0;
- RefPtr<EvalNode> newEvalBody = globalData->parser->parse<EvalNode>(globalData, 0, 0, 0, m_source, &exception);
+ RefPtr<EvalNode> newEvalBody = globalData->parser->parse<EvalNode>(globalData, 0, 0, 0, m_source, 0, &exception);
if (!newEvalBody)
return PassOwnPtr<ExceptionInfo>();
@@ -341,7 +341,7 @@ void FunctionExecutable::recompile(ExecState*)
PassRefPtr<FunctionExecutable> FunctionExecutable::fromGlobalCode(const Identifier& functionName, ExecState* exec, Debugger* debugger, const SourceCode& source, JSObject** exception)
{
JSGlobalObject* lexicalGlobalObject = exec->lexicalGlobalObject();
- RefPtr<ProgramNode> program = exec->globalData().parser->parse<ProgramNode>(&exec->globalData(), lexicalGlobalObject, debugger, exec, source, exception);
+ RefPtr<ProgramNode> program = exec->globalData().parser->parse<ProgramNode>(&exec->globalData(), lexicalGlobalObject, debugger, exec, source, 0, exception);
if (!program) {
ASSERT(*exception);
return 0;
diff --git a/JavaScriptCore/runtime/Executable.h b/JavaScriptCore/runtime/Executable.h
index 10dfb34..c168ac8 100644
--- a/JavaScriptCore/runtime/Executable.h
+++ b/JavaScriptCore/runtime/Executable.h
@@ -172,20 +172,22 @@ namespace JSC {
bool usesEval() const { return m_features & EvalFeature; }
bool usesArguments() const { return m_features & ArgumentsFeature; }
- bool needsActivation() const { return m_features & (EvalFeature | ClosureFeature | WithFeature | CatchFeature); }
+ bool needsActivation() const { return m_hasCapturedVariables || m_features & (EvalFeature | WithFeature | CatchFeature); }
virtual PassOwnPtr<ExceptionInfo> reparseExceptionInfo(JSGlobalData*, ScopeChainNode*, CodeBlock*) = 0;
protected:
- void recordParse(CodeFeatures features, int firstLine, int lastLine)
+ void recordParse(CodeFeatures features, bool hasCapturedVariables, int firstLine, int lastLine)
{
m_features = features;
+ m_hasCapturedVariables = hasCapturedVariables;
m_firstLine = firstLine;
m_lastLine = lastLine;
}
SourceCode m_source;
CodeFeatures m_features;
+ bool m_hasCapturedVariables;
int m_firstLine;
int m_lastLine;
};
diff --git a/JavaScriptCore/runtime/GCActivityCallbackCF.cpp b/JavaScriptCore/runtime/GCActivityCallbackCF.cpp
index 06d4210..45329ca 100644
--- a/JavaScriptCore/runtime/GCActivityCallbackCF.cpp
+++ b/JavaScriptCore/runtime/GCActivityCallbackCF.cpp
@@ -29,9 +29,12 @@
#include "config.h"
#include "GCActivityCallback.h"
+#include "APIShims.h"
#include "Collector.h"
+#include "JSGlobalData.h"
#include "JSLock.h"
#include <wtf/RetainPtr.h>
+#include <wtf/WTFThreadData.h>
#include <CoreFoundation/CoreFoundation.h>
#if !PLATFORM(CF)
@@ -52,8 +55,7 @@ const CFTimeInterval decade = 60 * 60 * 24 * 365 * 10;
void DefaultGCActivityCallbackPlatformData::trigger(CFRunLoopTimerRef, void *info)
{
Heap* heap = static_cast<Heap*>(info);
- JSLock lock(heap->globalData());
-
+ APIEntryShim shim(heap->globalData());
heap->collectAllGarbage();
}
diff --git a/JavaScriptCore/runtime/JSArray.cpp b/JavaScriptCore/runtime/JSArray.cpp
index 55aa327..340cb75 100644
--- a/JavaScriptCore/runtime/JSArray.cpp
+++ b/JavaScriptCore/runtime/JSArray.cpp
@@ -1060,10 +1060,11 @@ void JSArray::sort(ExecState* exec, JSValue compareFunction, CallType callType,
if (storage->m_length > static_cast<unsigned>(std::numeric_limits<int>::max()))
return;
- if (!storage->m_length)
- return;
-
unsigned usedVectorLength = min(storage->m_length, m_vectorLength);
+ unsigned nodeCount = usedVectorLength + (storage->m_sparseValueMap ? storage->m_sparseValueMap->size() : 0);
+
+ if (!nodeCount)
+ return;
AVLTree<AVLTreeAbstractorForArrayCompare, 44> tree; // Depth 44 is enough for 2^31 items
tree.abstractor().m_exec = exec;
@@ -1071,7 +1072,7 @@ void JSArray::sort(ExecState* exec, JSValue compareFunction, CallType callType,
tree.abstractor().m_compareCallType = callType;
tree.abstractor().m_compareCallData = &callData;
tree.abstractor().m_globalThisValue = exec->globalThisValue();
- tree.abstractor().m_nodes.resize(usedVectorLength + (storage->m_sparseValueMap ? storage->m_sparseValueMap->size() : 0));
+ tree.abstractor().m_nodes.grow(nodeCount);
if (callType == CallTypeJS)
tree.abstractor().m_cachedCall = adoptPtr(new CachedCall(exec, asFunction(compareFunction), 2, exec->exceptionSlot()));
diff --git a/JavaScriptCore/runtime/JSValue.cpp b/JavaScriptCore/runtime/JSValue.cpp
index 6db6954..2a23a79 100644
--- a/JavaScriptCore/runtime/JSValue.cpp
+++ b/JavaScriptCore/runtime/JSValue.cpp
@@ -135,36 +135,49 @@ char* JSValue::description()
}
#endif
-int32_t toInt32SlowCase(double d, bool& ok)
+// This in the ToInt32 operation is defined in section 9.5 of the ECMA-262 spec.
+// Note that this operation is identical to ToUInt32 other than to interpretation
+// of the resulting bit-pattern (as such this metod is also called to implement
+// ToUInt32).
+//
+// The operation can be descibed as round towards zero, then select the 32 least
+// bits of the resulting value in 2s-complement representation.
+int32_t toInt32(double number)
{
- if (isnan(d) || isinf(d)) {
- ok = false;
+ int64_t bits = WTF::bitwise_cast<int64_t>(number);
+ int32_t exp = (static_cast<int32_t>(bits >> 52) & 0x7ff) - 0x3ff;
+
+ // If exponent < 0 there will be no bits to the left of the decimal point
+ // after rounding; if the exponent is > 83 then no bits of precision can be
+ // left in the low 32-bit range of the result (IEEE-754 doubles have 52 bits
+ // of fractional precision).
+ // Note this case handles 0, -0, and all infinte, NaN, & denormal value.
+ if (exp < 0 || exp > 83)
return 0;
- }
-
- ok = true;
-
- double d32 = fmod(trunc(d), D32);
- if (d32 >= D32 / 2)
- d32 -= D32;
- else if (d32 < -D32 / 2)
- d32 += D32;
- return static_cast<int32_t>(d32);
-}
-uint32_t toUInt32SlowCase(double d, bool& ok)
-{
- if (isnan(d) || isinf(d)) {
- ok = false;
- return 0;
+ // Select the appropriate 32-bits from the floating point mantissa. If the
+ // exponent is 52 then the bits we need to select are already aligned to the
+ // lowest bits of the 64-bit integer representation of tghe number, no need
+ // to shift. If the exponent is greater than 52 we need to shift the value
+ // left by (exp - 52), if the value is less than 52 we need to shift right
+ // accordingly.
+ int32_t result = (exp > 52)
+ ? static_cast<int32_t>(bits << (exp - 52))
+ : static_cast<int32_t>(bits >> (52 - exp));
+
+ // IEEE-754 double precision values are stored omitting an implicit 1 before
+ // the decimal point; we need to reinsert this now. We may also the shifted
+ // invalid bits into the result that are not a part of the mantissa (the sign
+ // and exponent bits from the floatingpoint representation); mask these out.
+ if (exp < 32) {
+ int32_t missingOne = 1 << exp;
+ result &= missingOne - 1;
+ result += missingOne;
}
- ok = true;
-
- double d32 = fmod(trunc(d), D32);
- if (d32 < 0)
- d32 += D32;
- return static_cast<uint32_t>(d32);
+ // If the input value was negative (we could test either 'number' or 'bits',
+ // but testing 'bits' is likely faster) invert the result appropriately.
+ return bits < 0 ? -result : result;
}
NEVER_INLINE double nonInlineNaN()
diff --git a/JavaScriptCore/runtime/JSValue.h b/JavaScriptCore/runtime/JSValue.h
index 4a6744d..b5834c1 100644
--- a/JavaScriptCore/runtime/JSValue.h
+++ b/JavaScriptCore/runtime/JSValue.h
@@ -56,8 +56,17 @@ namespace JSC {
#endif
double nonInlineNaN();
- int32_t toInt32SlowCase(double, bool& ok);
- uint32_t toUInt32SlowCase(double, bool& ok);
+
+ // This implements ToInt32, defined in ECMA-262 9.5.
+ int32_t toInt32(double);
+
+ // This implements ToUInt32, defined in ECMA-262 9.6.
+ inline uint32_t toUInt32(double number)
+ {
+ // As commented in the spec, the operation of ToInt32 and ToUint32 only differ
+ // in how the result is interpreted; see NOTEs in sections 9.5 and 9.6.
+ return toInt32(number);
+ }
class JSValue {
friend class JSImmediate;
@@ -163,9 +172,7 @@ namespace JSC {
double toInteger(ExecState*) const;
double toIntegerPreserveNaN(ExecState*) const;
int32_t toInt32(ExecState*) const;
- int32_t toInt32(ExecState*, bool& ok) const;
uint32_t toUInt32(ExecState*) const;
- uint32_t toUInt32(ExecState*, bool& ok) const;
#if ENABLE(JSC_ZOMBIES)
bool isZombie() const;
@@ -367,24 +374,6 @@ namespace JSC {
inline bool operator!=(const JSValue a, const JSCell* b) { return a != JSValue(b); }
inline bool operator!=(const JSCell* a, const JSValue b) { return JSValue(a) != b; }
- inline int32_t toInt32(double val)
- {
- if (!(val >= -2147483648.0 && val < 2147483648.0)) {
- bool ignored;
- return toInt32SlowCase(val, ignored);
- }
- return static_cast<int32_t>(val);
- }
-
- inline uint32_t toUInt32(double val)
- {
- if (!(val >= 0.0 && val < 4294967296.0)) {
- bool ignored;
- return toUInt32SlowCase(val, ignored);
- }
- return static_cast<uint32_t>(val);
- }
-
// FIXME: We should deprecate this and just use JSValue::asCell() instead.
JSCell* asCell(JSValue);
@@ -397,62 +386,13 @@ namespace JSC {
{
if (isInt32())
return asInt32();
-
- double val = toNumber(exec);
-
- if (val >= -2147483648.0 && val < 2147483648.0)
- return static_cast<int32_t>(val);
-
- bool ignored;
- return toInt32SlowCase(val, ignored);
+ return JSC::toInt32(toNumber(exec));
}
inline uint32_t JSValue::toUInt32(ExecState* exec) const
{
- if (isUInt32())
- return asUInt32();
-
- double val = toNumber(exec);
-
- if (val >= 0.0 && val < 4294967296.0)
- return static_cast<uint32_t>(val);
-
- bool ignored;
- return toUInt32SlowCase(val, ignored);
- }
-
- inline int32_t JSValue::toInt32(ExecState* exec, bool& ok) const
- {
- if (isInt32()) {
- ok = true;
- return asInt32();
- }
-
- double val = toNumber(exec);
-
- if (val >= -2147483648.0 && val < 2147483648.0) {
- ok = true;
- return static_cast<int32_t>(val);
- }
-
- return toInt32SlowCase(val, ok);
- }
-
- inline uint32_t JSValue::toUInt32(ExecState* exec, bool& ok) const
- {
- if (isUInt32()) {
- ok = true;
- return asInt32();
- }
-
- double val = toNumber(exec);
-
- if (val >= 0.0 && val < 4294967296.0) {
- ok = true;
- return static_cast<uint32_t>(val);
- }
-
- return toUInt32SlowCase(val, ok);
+ // See comment on JSC::toUInt32, above.
+ return toInt32(exec);
}
#if USE(JSVALUE32_64)
diff --git a/JavaScriptCore/runtime/MemoryStatistics.cpp b/JavaScriptCore/runtime/MemoryStatistics.cpp
new file mode 100644
index 0000000..7fafa9c
--- /dev/null
+++ b/JavaScriptCore/runtime/MemoryStatistics.cpp
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "MemoryStatistics.h"
+
+#include "ExecutableAllocator.h"
+#include "JSGlobalData.h"
+#include "RegisterFile.h"
+
+namespace JSC {
+
+Heap::Statistics heapStatistics(JSGlobalData* commonGlobalData)
+{
+ return commonGlobalData->heap.statistics();
+}
+
+GlobalMemoryStatistics globalMemoryStatistics()
+{
+ GlobalMemoryStatistics stats;
+
+ stats.stackBytes = RegisterFile::committedByteCount();
+#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
+ stats.JITBytes = ExecutableAllocator::committedByteCount();
+#else
+ stats.JITBytes = 0;
+#endif
+ return stats;
+}
+
+}
+
+
diff --git a/JavaScriptCore/runtime/MemoryStatistics.h b/JavaScriptCore/runtime/MemoryStatistics.h
new file mode 100644
index 0000000..1b92eb9
--- /dev/null
+++ b/JavaScriptCore/runtime/MemoryStatistics.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MemoryStatistics_h
+#define MemoryStatistics_h
+
+#include "Collector.h"
+
+class JSGlobalData;
+
+namespace JSC {
+
+struct GlobalMemoryStatistics {
+ size_t stackBytes;
+ size_t JITBytes;
+};
+
+Heap::Statistics heapStatistics(JSGlobalData* commonGlobalData);
+GlobalMemoryStatistics globalMemoryStatistics();
+
+}
+
+#endif // MemoryStatistics_h
+
diff --git a/JavaScriptCore/runtime/RegExpObject.h b/JavaScriptCore/runtime/RegExpObject.h
index f997374..19de929 100644
--- a/JavaScriptCore/runtime/RegExpObject.h
+++ b/JavaScriptCore/runtime/RegExpObject.h
@@ -45,7 +45,7 @@ namespace JSC {
virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual const ClassInfo* classInfo() const { return &info; }
- static const ClassInfo info;
+ static JS_EXPORTDATA const ClassInfo info;
static PassRefPtr<Structure> createStructure(JSValue prototype)
{
diff --git a/JavaScriptCore/wtf/FastMalloc.cpp b/JavaScriptCore/wtf/FastMalloc.cpp
index 0f240ff..1e537b9 100644
--- a/JavaScriptCore/wtf/FastMalloc.cpp
+++ b/JavaScriptCore/wtf/FastMalloc.cpp
@@ -384,7 +384,8 @@ size_t fastMallocSize(const void* p)
{
#if OS(DARWIN)
return malloc_size(p);
-#elif COMPILER(MSVC)
+#elif COMPILER(MSVC) && !PLATFORM(BREWMP)
+ // Brew MP uses its own memory allocator, so _msize does not work on the Brew MP simulator.
return _msize(const_cast<void*>(p));
#else
return 1;
diff --git a/JavaScriptCore/wtf/OwnPtrCommon.h b/JavaScriptCore/wtf/OwnPtrCommon.h
index 37c135d..19256ea 100644
--- a/JavaScriptCore/wtf/OwnPtrCommon.h
+++ b/JavaScriptCore/wtf/OwnPtrCommon.h
@@ -46,6 +46,8 @@ typedef struct _IFileMgr IFileMgr;
typedef struct _IFile IFile;
typedef struct IBitmap IBitmap;
typedef struct ISSL ISSL;
+typedef struct IMemGroup IMemGroup;
+typedef struct IMemSpace IMemSpace;
#endif
namespace WTF {
@@ -73,6 +75,8 @@ namespace WTF {
void deleteOwnedPtr(IBitmap*);
void deleteOwnedPtr(ISSL*);
void deleteOwnedPtr(ISocket*);
+ void deleteOwnedPtr(IMemGroup*);
+ void deleteOwnedPtr(IMemSpace*);
#endif
} // namespace WTF
diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h
index e77fe98..30bc795 100644
--- a/JavaScriptCore/wtf/Platform.h
+++ b/JavaScriptCore/wtf/Platform.h
@@ -1057,6 +1057,10 @@
#define ENABLE_PAN_SCROLLING 1
#endif
+#if !defined(ENABLE_SMOOTH_SCROLLING)
+#define ENABLE_SMOOTH_SCROLLING 0
+#endif
+
/* Use the QXmlStreamReader implementation for XMLDocumentParser */
/* Use the QXmlQuery implementation for XSLTProcessor */
#if PLATFORM(QT)
@@ -1123,7 +1127,7 @@
#define ENABLE_JSC_ZOMBIES 0
/* FIXME: Eventually we should enable this for all platforms and get rid of the define. */
-#if PLATFORM(MAC) || PLATFORM(WIN)
+#if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT)
#define WTF_USE_PLATFORM_STRATEGIES 1
#endif
diff --git a/JavaScriptCore/wtf/PlatformRefPtr.h b/JavaScriptCore/wtf/PlatformRefPtr.h
index 2d05ac9..8ac16cb 100644
--- a/JavaScriptCore/wtf/PlatformRefPtr.h
+++ b/JavaScriptCore/wtf/PlatformRefPtr.h
@@ -24,6 +24,7 @@
#define PlatformRefPtr_h
#include "AlwaysInline.h"
+#include "RefPtr.h"
#include <algorithm>
namespace WTF {
@@ -73,6 +74,10 @@ public:
derefPlatformPtr(ptr);
}
+ // Hash table deleted values, which are only constructed and never copied or destroyed.
+ PlatformRefPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { }
+ bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); }
+
T* get() const { return m_ptr; }
T& operator*() const { return *m_ptr; }
ALWAYS_INLINE T* operator->() const { return m_ptr; }
diff --git a/JavaScriptCore/wtf/TypeTraits.cpp b/JavaScriptCore/wtf/TypeTraits.cpp
index 9e51ad0..a55019b 100644
--- a/JavaScriptCore/wtf/TypeTraits.cpp
+++ b/JavaScriptCore/wtf/TypeTraits.cpp
@@ -47,6 +47,11 @@ COMPILE_ASSERT(!IsInteger<volatile char*>::value, WTF_IsInteger_volatile_char_po
COMPILE_ASSERT(!IsInteger<double>::value, WTF_IsInteger_double_false);
COMPILE_ASSERT(!IsInteger<float>::value, WTF_IsInteger_float_false);
+COMPILE_ASSERT(IsFloatingPoint<float>::value, WTF_IsFloatingPoint_float_true);
+COMPILE_ASSERT(IsFloatingPoint<double>::value, WTF_IsFloatingPoint_double_true);
+COMPILE_ASSERT(IsFloatingPoint<long double>::value, WTF_IsFloatingPoint_long_double_true);
+COMPILE_ASSERT(!IsFloatingPoint<int>::value, WTF_IsFloatingPoint_int_false);
+
COMPILE_ASSERT(IsPod<bool>::value, WTF_IsPod_bool_true);
COMPILE_ASSERT(IsPod<char>::value, WTF_IsPod_char_true);
COMPILE_ASSERT(IsPod<signed char>::value, WTF_IsPod_signed_char_true);
diff --git a/JavaScriptCore/wtf/TypeTraits.h b/JavaScriptCore/wtf/TypeTraits.h
index 62dbc49..cf9b4af 100644
--- a/JavaScriptCore/wtf/TypeTraits.h
+++ b/JavaScriptCore/wtf/TypeTraits.h
@@ -62,12 +62,16 @@ namespace WTF {
template<> struct IsInteger<wchar_t> { static const bool value = true; };
#endif
+ template<typename T> struct IsFloatingPoint { static const bool value = false; };
+ template<> struct IsFloatingPoint<float> { static const bool value = true; };
+ template<> struct IsFloatingPoint<double> { static const bool value = true; };
+ template<> struct IsFloatingPoint<long double> { static const bool value = true; };
+
+ template<typename T> struct IsArithmetic { static const bool value = IsInteger<T>::value || IsFloatingPoint<T>::value; };
+
// IsPod is misnamed as it doesn't cover all plain old data (pod) types.
// Specifically, it doesn't allow for enums or for structs.
- template <typename T> struct IsPod { static const bool value = IsInteger<T>::value; };
- template <> struct IsPod<float> { static const bool value = true; };
- template <> struct IsPod<double> { static const bool value = true; };
- template <> struct IsPod<long double> { static const bool value = true; };
+ template <typename T> struct IsPod { static const bool value = IsArithmetic<T>::value; };
template <typename P> struct IsPod<P*> { static const bool value = true; };
template<typename T> class IsConvertibleToInteger {
diff --git a/JavaScriptCore/wtf/WTFThreadData.h b/JavaScriptCore/wtf/WTFThreadData.h
index 20ffaca..7f91e1a 100644
--- a/JavaScriptCore/wtf/WTFThreadData.h
+++ b/JavaScriptCore/wtf/WTFThreadData.h
@@ -59,7 +59,14 @@ public:
template<typename U, typename V>
std::pair<HashSet<StringImpl*>::iterator, bool> add(U value);
- void remove(StringImpl* r) { m_table.remove(r); }
+ bool remove(StringImpl* r)
+ {
+ HashSet<StringImpl*>::iterator iter = m_table.find(r);
+ if (iter == m_table.end())
+ return false;
+ m_table.remove(iter);
+ return true;
+ }
LiteralIdentifierTable& literalTable() { return m_literalTable; }
diff --git a/JavaScriptCore/wtf/brew/OwnPtrBrew.cpp b/JavaScriptCore/wtf/brew/OwnPtrBrew.cpp
index 28046bd..ce10fc3 100644
--- a/JavaScriptCore/wtf/brew/OwnPtrBrew.cpp
+++ b/JavaScriptCore/wtf/brew/OwnPtrBrew.cpp
@@ -28,6 +28,8 @@
#include <AEEBitmap.h>
#include <AEEFile.h>
+#include <AEEIMemGroup.h>
+#include <AEEIMemSpace.h>
#include <AEENet.h>
#include <AEESSL.h>
#include <AEEStdLib.h>
@@ -58,6 +60,18 @@ void deleteOwnedPtr(ISSL* ptr)
ISSL_Release(ptr);
}
+void deleteOwnedPtr(IMemGroup* ptr)
+{
+ if (ptr)
+ IMemGroup_Release(ptr);
+}
+
+void deleteOwnedPtr(IMemSpace* ptr)
+{
+ if (ptr)
+ IMemSpace_Release(ptr);
+}
+
void deleteOwnedPtr(ISocket* ptr)
{
if (ptr)
diff --git a/JavaScriptCore/wtf/gobject/GTypedefs.h b/JavaScriptCore/wtf/gobject/GTypedefs.h
index e79ba33..b1600c2 100644
--- a/JavaScriptCore/wtf/gobject/GTypedefs.h
+++ b/JavaScriptCore/wtf/gobject/GTypedefs.h
@@ -45,6 +45,7 @@ typedef struct _GdkCursor GdkCursor;
typedef struct _GdkDragContext GdkDragContext;
typedef struct _GdkDrawable GdkDrawable;
typedef struct _GdkEventConfigure GdkEventConfigure;
+typedef struct _GdkEventExpose GdkEventExpose;
typedef struct _GdkPixbuf GdkPixbuf;
typedef struct _GError GError;
typedef struct _GFile GFile;
@@ -79,6 +80,7 @@ typedef struct _GtkStyle GtkStyle;
typedef struct _GtkTargetList GtkTargetList;
typedef struct _GtkThemeParts GtkThemeParts;
typedef struct _GtkWidget GtkWidget;
+typedef struct _GtkWindow GtkWindow;
#ifdef GTK_API_VERSION_2
typedef struct _GdkRectangle GdkRectangle;
diff --git a/JavaScriptCore/wtf/text/StringImpl.cpp b/JavaScriptCore/wtf/text/StringImpl.cpp
index a667525..7822c00 100644
--- a/JavaScriptCore/wtf/text/StringImpl.cpp
+++ b/JavaScriptCore/wtf/text/StringImpl.cpp
@@ -48,8 +48,10 @@ StringImpl::~StringImpl()
if (isAtomic())
AtomicString::remove(this);
#if USE(JSC)
- if (isIdentifier())
- wtfThreadData().currentIdentifierTable()->remove(this);
+ if (isIdentifier()) {
+ if (!wtfThreadData().currentIdentifierTable()->remove(this))
+ CRASH();
+ }
#endif
BufferOwnership ownership = bufferOwnership();
diff --git a/JavaScriptCore/wtf/text/WTFString.h b/JavaScriptCore/wtf/text/WTFString.h
index fafef12..8a4a6c7 100644
--- a/JavaScriptCore/wtf/text/WTFString.h
+++ b/JavaScriptCore/wtf/text/WTFString.h
@@ -53,6 +53,7 @@ class BString;
namespace WTF {
class CString;
+struct StringHash;
// Declarations of string operations
@@ -72,6 +73,8 @@ intptr_t charactersToIntPtr(const UChar*, size_t, bool* ok = 0); // ignores trai
double charactersToDouble(const UChar*, size_t, bool* ok = 0);
float charactersToFloat(const UChar*, size_t, bool* ok = 0);
+template<bool isSpecialCharacter(UChar)> bool isAllSpecialCharacters(const UChar*, size_t);
+
class String {
public:
// Construct a null string, distinguishable from an empty string.
@@ -220,6 +223,7 @@ public:
String simplifyWhiteSpace() const;
String removeCharacters(CharacterMatchFunctionPtr) const;
+ template<bool isSpecialCharacter(UChar)> bool isAllSpecialCharacters() const;
// Return the string with case folded for case insensitive comparison.
String foldCase() const;
@@ -423,7 +427,19 @@ inline void appendNumber(Vector<UChar>& vector, unsigned char number)
}
}
-struct StringHash;
+template<bool isSpecialCharacter(UChar)> inline bool isAllSpecialCharacters(const UChar* characters, size_t length)
+{
+ for (size_t i = 0; i < length; ++i) {
+ if (!isSpecialCharacter(characters[i]))
+ return false;
+ }
+ return true;
+}
+
+template<bool isSpecialCharacter(UChar)> inline bool String::isAllSpecialCharacters() const
+{
+ return WTF::isAllSpecialCharacters<isSpecialCharacter>(characters(), length());
+}
// StringHash is the default hash for String
template<typename T> struct DefaultHash;
@@ -440,17 +456,26 @@ template <> struct VectorTraits<String> : SimpleClassVectorTraits
using WTF::CString;
using WTF::String;
-
-using WTF::isSpaceOrNewline;
-using WTF::find;
-using WTF::reverseFind;
using WTF::append;
using WTF::appendNumber;
-using WTF::equal;
-using WTF::equalIgnoringCase;
using WTF::charactersAreAllASCII;
+using WTF::charactersToIntStrict;
+using WTF::charactersToUIntStrict;
+using WTF::charactersToInt64Strict;
+using WTF::charactersToUInt64Strict;
+using WTF::charactersToIntPtrStrict;
using WTF::charactersToInt;
-using WTF::charactersToFloat;
+using WTF::charactersToUInt;
+using WTF::charactersToInt64;
+using WTF::charactersToUInt64;
+using WTF::charactersToIntPtr;
using WTF::charactersToDouble;
+using WTF::charactersToFloat;
+using WTF::equal;
+using WTF::equalIgnoringCase;
+using WTF::find;
+using WTF::isAllSpecialCharacters;
+using WTF::isSpaceOrNewline;
+using WTF::reverseFind;
#endif
diff --git a/JavaScriptCore/wtf/unicode/Unicode.h b/JavaScriptCore/wtf/unicode/Unicode.h
index d59439d..c755c6c 100644
--- a/JavaScriptCore/wtf/unicode/Unicode.h
+++ b/JavaScriptCore/wtf/unicode/Unicode.h
@@ -32,7 +32,7 @@
#elif USE(GLIB_UNICODE)
#include <wtf/unicode/glib/UnicodeGLib.h>
#elif USE(WINCE_UNICODE)
-#include <wtf/unicode/wince/UnicodeWince.h>
+#include <wtf/unicode/wince/UnicodeWinCE.h>
#else
#error "Unknown Unicode implementation"
#endif
diff --git a/JavaScriptCore/wtf/unicode/glib/UnicodeMacrosFromICU.h b/JavaScriptCore/wtf/unicode/UnicodeMacrosFromICU.h
index 1963576..f865ef1 100644
--- a/JavaScriptCore/wtf/unicode/glib/UnicodeMacrosFromICU.h
+++ b/JavaScriptCore/wtf/unicode/UnicodeMacrosFromICU.h
@@ -36,6 +36,7 @@
#define U16_LEAD(supplementary) (UChar)(((supplementary)>>10)+0xd7c0)
#define U16_TRAIL(supplementary) (UChar)(((supplementary)&0x3ff)|0xdc00)
+#define U16_LENGTH(c) ((uint32_t)(c) <= 0xffff ? 1 : 2)
#define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800)
#define U16_IS_SINGLE(c) !U_IS_SURROGATE(c)
diff --git a/JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h b/JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h
index badab66..c9e2e1c 100644
--- a/JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h
+++ b/JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h
@@ -23,6 +23,8 @@
#ifndef WTF_UNICODE_QT4_H
#define WTF_UNICODE_QT4_H
+#include "UnicodeMacrosFromICU.h"
+
#include <QChar>
#include <QString>
@@ -63,49 +65,6 @@ typedef uint16_t UChar;
#endif
typedef uint32_t UChar32;
-// some defines from ICU
-// FIXME: This should use UnicodeMacrosFromICU.h instead!
-
-#define U_IS_BMP(c) ((UChar32)(c)<=0xffff)
-#define U16_IS_LEAD(c) (((c)&0xfffffc00)==0xd800)
-#define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00)
-#define U16_SURROGATE_OFFSET ((0xd800<<10UL)+0xdc00-0x10000)
-#define U16_GET_SUPPLEMENTARY(lead, trail) \
- (((UChar32)(lead)<<10UL)+(UChar32)(trail)-U16_SURROGATE_OFFSET)
-
-#define U16_LEAD(supplementary) (UChar)(((supplementary)>>10)+0xd7c0)
-#define U16_TRAIL(supplementary) (UChar)(((supplementary)&0x3ff)|0xdc00)
-#define U16_LENGTH(c) ((uint32_t)(c) <= 0xffff ? 1 : 2)
-
-#define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800)
-#define U16_IS_SINGLE(c) !U_IS_SURROGATE(c)
-#define U16_IS_SURROGATE(c) U_IS_SURROGATE(c)
-#define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
-
-#define U16_NEXT(s, i, length, c) { \
- (c)=(s)[(i)++]; \
- if(U16_IS_LEAD(c)) { \
- uint16_t __c2; \
- if((i)<(length) && U16_IS_TRAIL(__c2=(s)[(i)])) { \
- ++(i); \
- (c)=U16_GET_SUPPLEMENTARY((c), __c2); \
- } \
- } \
-}
-
-#define U16_PREV(s, start, i, c) { \
- (c)=(s)[--(i)]; \
- if(U16_IS_TRAIL(c)) { \
- uint16_t __c2; \
- if((i)>(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \
- --(i); \
- (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \
- } \
- } \
-}
-
-#define U_MASK(x) ((uint32_t)1<<(x))
-
namespace WTF {
namespace Unicode {
diff --git a/JavaScriptCore/wtf/unicode/wince/UnicodeWince.cpp b/JavaScriptCore/wtf/unicode/wince/UnicodeWinCE.cpp
index 42f0ff8..b52b05c 100644
--- a/JavaScriptCore/wtf/unicode/wince/UnicodeWince.cpp
+++ b/JavaScriptCore/wtf/unicode/wince/UnicodeWinCE.cpp
@@ -20,7 +20,7 @@
*/
#include "config.h"
-#include "UnicodeWince.h"
+#include "UnicodeWinCE.h"
#include <wchar.h>
diff --git a/JavaScriptCore/wtf/unicode/wince/UnicodeWince.h b/JavaScriptCore/wtf/unicode/wince/UnicodeWinCE.h
index 3866568..8cc9580 100644
--- a/JavaScriptCore/wtf/unicode/wince/UnicodeWince.h
+++ b/JavaScriptCore/wtf/unicode/wince/UnicodeWinCE.h
@@ -21,55 +21,15 @@
*
*/
-#ifndef UNICODE_WINCE_H
-#define UNICODE_WINCE_H
+#ifndef WTF_UnicodeWinCE_h
+#define WTF_UnicodeWinCE_h
+
+#include "UnicodeMacrosFromICU.h"
#include "ce_unicode.h"
#define TO_MASK(x) (1 << (x))
-// some defines from ICU needed one or two places
-// FIXME: This should use UnicodeMacrosFromICU.h instead!
-
-#define U_IS_BMP(c) ((UChar32)(c)<=0xffff)
-#define U16_IS_LEAD(c) (((c) & 0xfffffc00) == 0xd800)
-#define U16_IS_TRAIL(c) (((c) & 0xfffffc00) == 0xdc00)
-#define U16_SURROGATE_OFFSET ((0xd800 << 10UL) + 0xdc00 - 0x10000)
-#define U16_GET_SUPPLEMENTARY(lead, trail) \
- (((UChar32)(lead) << 10UL) + (UChar32)(trail) - U16_SURROGATE_OFFSET)
-
-#define U16_LEAD(supplementary) (UChar)(((supplementary) >> 10) + 0xd7c0)
-#define U16_TRAIL(supplementary) (UChar)(((supplementary) & 0x3ff) | 0xdc00)
-#define U16_LENGTH(c) ((uint32_t)(c) <= 0xffff ? 1 : 2)
-
-#define U_IS_SURROGATE(c) (((c) & 0xfffff800) == 0xd800)
-#define U16_IS_SURROGATE(c) U_IS_SURROGATE(c)
-#define U16_IS_SURROGATE_LEAD(c) (((c) & 0x400) == 0)
-
-#define U16_NEXT(s, i, length, c) { \
- (c)=(s)[(i)++]; \
- if (U16_IS_LEAD(c)) { \
- uint16_t __c2; \
- if ((i) < (length) && U16_IS_TRAIL(__c2 = (s)[(i)])) { \
- ++(i); \
- (c) = U16_GET_SUPPLEMENTARY((c), __c2); \
- } \
- } \
-}
-
-#define U16_PREV(s, start, i, c) { \
- (c)=(s)[--(i)]; \
- if (U16_IS_TRAIL(c)) { \
- uint16_t __c2; \
- if ((i) > (start) && U16_IS_LEAD(__c2 = (s)[(i) - 1])) { \
- --(i); \
- (c) = U16_GET_SUPPLEMENTARY(__c2, (c)); \
- } \
- } \
-}
-
-#define U16_IS_SINGLE(c) !U_IS_SURROGATE(c)
-
namespace WTF {
namespace Unicode {
@@ -216,5 +176,4 @@ namespace WTF {
} // namespace WTF
-#endif
-// vim: ts=2 sw=2 et
+#endif // WTF_UnicodeWinCE_h
diff --git a/JavaScriptCore/wtf/wince/FastMallocWince.h b/JavaScriptCore/wtf/wince/FastMallocWinCE.h
index 37174f0..d91a5f2 100644
--- a/JavaScriptCore/wtf/wince/FastMallocWince.h
+++ b/JavaScriptCore/wtf/wince/FastMallocWinCE.h
@@ -19,8 +19,8 @@
*
*/
-#ifndef FastMallocWince_h
-#define FastMallocWince_h
+#ifndef WTF_FastMallocWinCE_h
+#define WTF_FastMallocWinCE_h
#include <new.h>
@@ -172,5 +172,4 @@ namespace WTF {
#endif
-#endif // FastMallocWince_h
-
+#endif // WTF_FastMallocWinCE_h
diff --git a/JavaScriptCore/wtf/wtf.pri b/JavaScriptCore/wtf/wtf.pri
new file mode 100644
index 0000000..84ac20e
--- /dev/null
+++ b/JavaScriptCore/wtf/wtf.pri
@@ -0,0 +1,35 @@
+# wtf - qmake build info
+
+SOURCES += \
+ wtf/Assertions.cpp \
+ wtf/ByteArray.cpp \
+ wtf/CurrentTime.cpp \
+ wtf/DateMath.cpp \
+ wtf/dtoa.cpp \
+ wtf/FastMalloc.cpp \
+ wtf/HashTable.cpp \
+ wtf/MD5.cpp \
+ wtf/MainThread.cpp \
+ wtf/qt/MainThreadQt.cpp \
+ wtf/qt/StringQt.cpp \
+ wtf/qt/ThreadingQt.cpp \
+ wtf/PageAllocation.cpp \
+ wtf/RandomNumber.cpp \
+ wtf/RefCountedLeakCounter.cpp \
+ wtf/ThreadingNone.cpp \
+ wtf/Threading.cpp \
+ wtf/TypeTraits.cpp \
+ wtf/WTFThreadData.cpp \
+ wtf/text/AtomicString.cpp \
+ wtf/text/CString.cpp \
+ wtf/text/StringImpl.cpp \
+ wtf/text/StringStatics.cpp \
+ wtf/text/WTFString.cpp \
+ wtf/unicode/CollatorDefault.cpp \
+ wtf/unicode/icu/CollatorICU.cpp \
+ wtf/unicode/UTF8.cpp
+
+!contains(DEFINES, USE_SYSTEM_MALLOC) {
+ SOURCES += wtf/TCSystemAlloc.cpp
+}
+
diff --git a/JavaScriptCore/yarr/RegexCompiler.cpp b/JavaScriptCore/yarr/RegexCompiler.cpp
index fa87186..9f9e028 100644
--- a/JavaScriptCore/yarr/RegexCompiler.cpp
+++ b/JavaScriptCore/yarr/RegexCompiler.cpp
@@ -240,6 +240,7 @@ public:
RegexPatternConstructor(RegexPattern& pattern)
: m_pattern(pattern)
, m_characterClassConstructor(pattern.m_ignoreCase)
+ , m_invertParentheticalAssertion(false)
{
}
@@ -255,6 +256,11 @@ public:
void assertionBOL()
{
+ if (!m_alternative->m_terms.size() & !m_invertParentheticalAssertion) {
+ m_alternative->m_startsWithBOL = true;
+ m_alternative->m_containsBOL = true;
+ m_pattern.m_containsBOL = true;
+ }
m_alternative->m_terms.append(PatternTerm::BOL());
}
void assertionEOL()
@@ -358,15 +364,36 @@ public:
m_pattern.m_disjunctions.append(parenthesesDisjunction);
m_alternative->m_terms.append(PatternTerm(PatternTerm::TypeParentheticalAssertion, m_pattern.m_numSubpatterns + 1, parenthesesDisjunction, invert));
m_alternative = parenthesesDisjunction->addNewAlternative();
+ m_invertParentheticalAssertion = invert;
}
void atomParenthesesEnd()
{
ASSERT(m_alternative->m_parent);
ASSERT(m_alternative->m_parent->m_parent);
+
+ PatternDisjunction* parenthesisDisjunction = m_alternative->m_parent;
m_alternative = m_alternative->m_parent->m_parent;
+
+ PatternTerm& lastTerm = m_alternative->lastTerm();
+
+ unsigned numParenAlternatives = parenthesisDisjunction->m_alternatives.size();
+ unsigned numBOLAnchoredAlts = 0;
+ // Bubble up BOL flags
+ for (unsigned i = 0; i < numParenAlternatives; i++) {
+ if (parenthesisDisjunction->m_alternatives[i]->m_startsWithBOL)
+ numBOLAnchoredAlts++;
+ }
+
+ if (numBOLAnchoredAlts) {
+ m_alternative->m_containsBOL = true;
+ // If all the alternatives in parens start with BOL, then so does this one
+ if (numBOLAnchoredAlts == numParenAlternatives)
+ m_alternative->m_startsWithBOL = true;
+ }
- m_alternative->lastTerm().parentheses.lastSubpatternId = m_pattern.m_numSubpatterns;
+ lastTerm.parentheses.lastSubpatternId = m_pattern.m_numSubpatterns;
+ m_invertParentheticalAssertion = false;
}
void atomBackReference(unsigned subpatternId)
@@ -397,32 +424,39 @@ public:
m_alternative->m_terms.append(PatternTerm(subpatternId));
}
- PatternDisjunction* copyDisjunction(PatternDisjunction* disjunction)
+ // deep copy the argument disjunction. If filterStartsWithBOL is true,
+ // skip alternatives with m_startsWithBOL set true.
+ PatternDisjunction* copyDisjunction(PatternDisjunction* disjunction, bool filterStartsWithBOL = false)
{
- PatternDisjunction* newDisjunction = new PatternDisjunction();
-
- newDisjunction->m_parent = disjunction->m_parent;
+ PatternDisjunction* newDisjunction = 0;
for (unsigned alt = 0; alt < disjunction->m_alternatives.size(); ++alt) {
PatternAlternative* alternative = disjunction->m_alternatives[alt];
- PatternAlternative* newAlternative = newDisjunction->addNewAlternative();
- for (unsigned i = 0; i < alternative->m_terms.size(); ++i)
- newAlternative->m_terms.append(copyTerm(alternative->m_terms[i]));
+ if (!filterStartsWithBOL || !alternative->m_startsWithBOL) {
+ if (!newDisjunction) {
+ newDisjunction = new PatternDisjunction();
+ newDisjunction->m_parent = disjunction->m_parent;
+ }
+ PatternAlternative* newAlternative = newDisjunction->addNewAlternative();
+ for (unsigned i = 0; i < alternative->m_terms.size(); ++i)
+ newAlternative->m_terms.append(copyTerm(alternative->m_terms[i], filterStartsWithBOL));
+ }
}
-
- m_pattern.m_disjunctions.append(newDisjunction);
+
+ if (newDisjunction)
+ m_pattern.m_disjunctions.append(newDisjunction);
return newDisjunction;
}
-
- PatternTerm copyTerm(PatternTerm& term)
+
+ PatternTerm copyTerm(PatternTerm& term, bool filterStartsWithBOL = false)
{
if ((term.type != PatternTerm::TypeParenthesesSubpattern) && (term.type != PatternTerm::TypeParentheticalAssertion))
return PatternTerm(term);
-
+
PatternTerm termCopy = term;
- termCopy.parentheses.disjunction = copyDisjunction(termCopy.parentheses.disjunction);
+ termCopy.parentheses.disjunction = copyDisjunction(termCopy.parentheses.disjunction, filterStartsWithBOL);
return termCopy;
}
-
+
void quantifyAtom(unsigned min, unsigned max, bool greedy)
{
ASSERT(min <= max);
@@ -589,11 +623,40 @@ public:
setupDisjunctionOffsets(m_pattern.m_body, 0, 0);
}
+ void optimizeBOL()
+ {
+ // Look for expressions containing beginning of line (^) anchoring and unroll them.
+ // e.g. /^a|^b|c/ becomes /^a|^b|c/ which is executed once followed by /c/ which loops
+ // This code relies on the parsing code tagging alternatives with m_containsBOL and
+ // m_startsWithBOL and rolling those up to containing alternatives.
+ // At this point, this is only valid for non-multiline expressions.
+ PatternDisjunction* disjunction = m_pattern.m_body;
+
+ if (!m_pattern.m_containsBOL || m_pattern.m_multiline)
+ return;
+
+ PatternDisjunction* loopDisjunction = copyDisjunction(disjunction, true);
+
+ // Set alternatives in disjunction to "onceThrough"
+ for (unsigned alt = 0; alt < disjunction->m_alternatives.size(); ++alt)
+ disjunction->m_alternatives[alt]->setOnceThrough();
+
+ if (loopDisjunction) {
+ // Move alternatives from loopDisjunction to disjunction
+ for (unsigned alt = 0; alt < loopDisjunction->m_alternatives.size(); ++alt)
+ disjunction->m_alternatives.append(loopDisjunction->m_alternatives[alt]);
+
+ loopDisjunction->m_alternatives.clear();
+ }
+ }
+
+
private:
RegexPattern& m_pattern;
PatternAlternative* m_alternative;
CharacterClassConstructor m_characterClassConstructor;
bool m_invertCharacterClass;
+ bool m_invertParentheticalAssertion;
};
@@ -621,6 +684,8 @@ const char* compileRegex(const UString& patternString, RegexPattern& pattern)
ASSERT(numSubpatterns == pattern.m_numSubpatterns);
}
+ constructor.optimizeBOL();
+
constructor.setupOffsets();
return 0;
diff --git a/JavaScriptCore/yarr/RegexJIT.cpp b/JavaScriptCore/yarr/RegexJIT.cpp
index 7818b52..8740130 100644
--- a/JavaScriptCore/yarr/RegexJIT.cpp
+++ b/JavaScriptCore/yarr/RegexJIT.cpp
@@ -1207,21 +1207,26 @@ class RegexGenerator : private MacroAssembler {
TermGenerationState state(disjunction, 0);
state.resetAlternative();
- // Plant a check to see if there is sufficient input available to run the first alternative.
- // Jumping back to the label 'firstAlternative' will get to this check, jumping to
- // 'firstAlternativeInputChecked' will jump directly to matching the alternative having
- // skipped this check.
-
- Label firstAlternative(this);
-
// check availability for the next alternative
int countCheckedForCurrentAlternative = 0;
int countToCheckForFirstAlternative = 0;
bool hasShorterAlternatives = false;
+ bool setRepeatAlternativeLabels = false;
JumpList notEnoughInputForPreviousAlternative;
+ Label firstAlternative;
+ Label firstAlternativeInputChecked;
+ // The label 'firstAlternative' is used to plant a check to see if there is
+ // sufficient input available to run the first repeating alternative.
+ // The label 'firstAlternativeInputChecked' will jump directly to matching
+ // the first repeating alternative having skipped this check.
+
if (state.alternativeValid()) {
PatternAlternative* alternative = state.alternative();
+ if (!alternative->onceThrough()) {
+ firstAlternative = Label(this);
+ setRepeatAlternativeLabels = true;
+ }
countToCheckForFirstAlternative = alternative->m_minimumSize;
state.checkedTotal += countToCheckForFirstAlternative;
if (countToCheckForFirstAlternative)
@@ -1229,15 +1234,17 @@ class RegexGenerator : private MacroAssembler {
countCheckedForCurrentAlternative = countToCheckForFirstAlternative;
}
- Label firstAlternativeInputChecked(this);
+ if (setRepeatAlternativeLabels)
+ firstAlternativeInputChecked = Label(this);
while (state.alternativeValid()) {
- // Track whether any alternatives are shorter than the first one.
- hasShorterAlternatives = hasShorterAlternatives || (countCheckedForCurrentAlternative < countToCheckForFirstAlternative);
-
PatternAlternative* alternative = state.alternative();
optimizeAlternative(alternative);
+ // Track whether any alternatives are shorter than the first one.
+ if (!alternative->onceThrough())
+ hasShorterAlternatives = hasShorterAlternatives || (countCheckedForCurrentAlternative < countToCheckForFirstAlternative);
+
for (state.resetTerm(); state.termValid(); state.nextTerm())
generateTerm(state);
@@ -1264,6 +1271,17 @@ class RegexGenerator : private MacroAssembler {
// if there are any more alternatives, plant the check for input before looping.
if (state.alternativeValid()) {
PatternAlternative* nextAlternative = state.alternative();
+ bool setAlternativeLoopLabel = false;
+ if (!setRepeatAlternativeLabels && !nextAlternative->onceThrough()) {
+ // We have handled non-repeating alternatives, jump to next iteration
+ // and loop over repeating alternatives.
+ state.jumpToBacktrack(jump(), this);
+
+ firstAlternative = Label(this);
+ setRepeatAlternativeLabels = true;
+ setAlternativeLoopLabel = true;
+ }
+
int countToCheckForNextAlternative = nextAlternative->m_minimumSize;
if (countCheckedForCurrentAlternative > countToCheckForNextAlternative) { // CASE 1: current alternative was longer than the next one.
@@ -1302,6 +1320,12 @@ class RegexGenerator : private MacroAssembler {
state.linkAlternativeBacktracks(this);
}
+ if (setAlternativeLoopLabel) {
+ firstAlternativeInputChecked = Label(this);
+ countToCheckForFirstAlternative = countToCheckForNextAlternative;
+ setAlternativeLoopLabel = true;
+ }
+
state.checkedTotal -= countCheckedForCurrentAlternative;
countCheckedForCurrentAlternative = countToCheckForNextAlternative;
state.checkedTotal += countCheckedForCurrentAlternative;
@@ -1312,75 +1336,83 @@ class RegexGenerator : private MacroAssembler {
state.checkedTotal -= countCheckedForCurrentAlternative;
- // How much more input need there be to be able to retry from the first alternative?
- // examples:
- // /yarr_jit/ or /wrec|pcre/
- // In these examples we need check for one more input before looping.
- // /yarr_jit|pcre/
- // In this case we need check for 5 more input to loop (+4 to allow for the first alterative
- // being four longer than the last alternative checked, and another +1 to effectively move
- // the start position along by one).
- // /yarr|rules/ or /wrec|notsomuch/
- // In these examples, provided that there was sufficient input to have just been matching for
- // the second alternative we can loop without checking for available input (since the second
- // alternative is longer than the first). In the latter example we need to decrement index
- // (by 4) so the start position is only progressed by 1 from the last iteration.
- int incrementForNextIter = (countToCheckForFirstAlternative - countCheckedForCurrentAlternative) + 1;
-
- // First, deal with the cases where there was sufficient input to try the last alternative.
- if (incrementForNextIter > 0) // We need to check for more input anyway, fall through to the checking below.
- state.linkAlternativeBacktracks(this);
- else if (m_pattern.m_body->m_hasFixedSize && !incrementForNextIter) // No need to update anything, link these backtracks straight to the to pof the loop!
- state.linkAlternativeBacktracksTo(firstAlternativeInputChecked, this);
- else { // no need to check the input, but we do have some bookkeeping to do first.
+ if (!setRepeatAlternativeLabels) {
+ // If there are no alternatives that need repeating (all are marked 'onceThrough') then just link
+ // the match failures to this point, and fall through to the return below.
state.linkAlternativeBacktracks(this);
+ notEnoughInputForPreviousAlternative.link(this);
+ } else {
+ // How much more input need there be to be able to retry from the first alternative?
+ // examples:
+ // /yarr_jit/ or /wrec|pcre/
+ // In these examples we need check for one more input before looping.
+ // /yarr_jit|pcre/
+ // In this case we need check for 5 more input to loop (+4 to allow for the first alterative
+ // being four longer than the last alternative checked, and another +1 to effectively move
+ // the start position along by one).
+ // /yarr|rules/ or /wrec|notsomuch/
+ // In these examples, provided that there was sufficient input to have just been matching for
+ // the second alternative we can loop without checking for available input (since the second
+ // alternative is longer than the first). In the latter example we need to decrement index
+ // (by 4) so the start position is only progressed by 1 from the last iteration.
+ int incrementForNextIter = (countToCheckForFirstAlternative - countCheckedForCurrentAlternative) + 1;
+
+ // First, deal with the cases where there was sufficient input to try the last alternative.
+ if (incrementForNextIter > 0) // We need to check for more input anyway, fall through to the checking below.
+ state.linkAlternativeBacktracks(this);
+ else if (m_pattern.m_body->m_hasFixedSize && !incrementForNextIter) // No need to update anything, link these backtracks straight to the to pof the loop!
+ state.linkAlternativeBacktracksTo(firstAlternativeInputChecked, this);
+ else { // no need to check the input, but we do have some bookkeeping to do first.
+ state.linkAlternativeBacktracks(this);
- // Where necessary update our preserved start position.
- if (!m_pattern.m_body->m_hasFixedSize) {
- move(index, regT0);
- sub32(Imm32(countCheckedForCurrentAlternative - 1), regT0);
- store32(regT0, Address(output));
- }
+ // Where necessary update our preserved start position.
+ if (!m_pattern.m_body->m_hasFixedSize) {
+ move(index, regT0);
+ sub32(Imm32(countCheckedForCurrentAlternative - 1), regT0);
+ store32(regT0, Address(output));
+ }
- // Update index if necessary, and loop (without checking).
- if (incrementForNextIter)
- add32(Imm32(incrementForNextIter), index);
- jump().linkTo(firstAlternativeInputChecked, this);
- }
+ // Update index if necessary, and loop (without checking).
+ if (incrementForNextIter)
+ add32(Imm32(incrementForNextIter), index);
+ jump().linkTo(firstAlternativeInputChecked, this);
+ }
- notEnoughInputForPreviousAlternative.link(this);
- // Update our idea of the start position, if we're tracking this.
- if (!m_pattern.m_body->m_hasFixedSize) {
- if (countCheckedForCurrentAlternative - 1) {
- move(index, regT0);
- sub32(Imm32(countCheckedForCurrentAlternative - 1), regT0);
- store32(regT0, Address(output));
- } else
- store32(index, Address(output));
+ notEnoughInputForPreviousAlternative.link(this);
+ // Update our idea of the start position, if we're tracking this.
+ if (!m_pattern.m_body->m_hasFixedSize) {
+ if (countCheckedForCurrentAlternative - 1) {
+ move(index, regT0);
+ sub32(Imm32(countCheckedForCurrentAlternative - 1), regT0);
+ store32(regT0, Address(output));
+ } else
+ store32(index, Address(output));
+ }
+
+ // Check if there is sufficent input to run the first alternative again.
+ jumpIfAvailableInput(incrementForNextIter).linkTo(firstAlternativeInputChecked, this);
+ // No - insufficent input to run the first alteranative, are there any other alternatives we
+ // might need to check? If so, the last check will have left the index incremented by
+ // (countToCheckForFirstAlternative + 1), so we need test whether countToCheckForFirstAlternative
+ // LESS input is available, to have the effect of just progressing the start position by 1
+ // from the last iteration. If this check passes we can just jump up to the check associated
+ // with the first alternative in the loop. This is a bit sad, since we'll end up trying the
+ // first alternative again, and this check will fail (otherwise the check planted just above
+ // here would have passed). This is a bit sad, however it saves trying to do something more
+ // complex here in compilation, and in the common case we should end up coallescing the checks.
+ //
+ // FIXME: a nice improvement here may be to stop trying to match sooner, based on the least
+ // of the minimum-alternative-lengths. E.g. if I have two alternatives of length 200 and 150,
+ // and a string of length 100, we'll end up looping index from 0 to 100, checking whether there
+ // is sufficient input to run either alternative (constantly failing). If there had been only
+ // one alternative, or if the shorter alternative had come first, we would have terminated
+ // immediately. :-/
+ if (hasShorterAlternatives)
+ jumpIfAvailableInput(-countToCheckForFirstAlternative).linkTo(firstAlternative, this);
+ // index will now be a bit garbled (depending on whether 'hasShorterAlternatives' is true,
+ // it has either been incremented by 1 or by (countToCheckForFirstAlternative + 1) ...
+ // but since we're about to return a failure this doesn't really matter!)
}
- // Check if there is sufficent input to run the first alternative again.
- jumpIfAvailableInput(incrementForNextIter).linkTo(firstAlternativeInputChecked, this);
- // No - insufficent input to run the first alteranative, are there any other alternatives we
- // might need to check? If so, the last check will have left the index incremented by
- // (countToCheckForFirstAlternative + 1), so we need test whether countToCheckForFirstAlternative
- // LESS input is available, to have the effect of just progressing the start position by 1
- // from the last iteration. If this check passes we can just jump up to the check associated
- // with the first alternative in the loop. This is a bit sad, since we'll end up trying the
- // first alternative again, and this check will fail (otherwise the check planted just above
- // here would have passed). This is a bit sad, however it saves trying to do something more
- // complex here in compilation, and in the common case we should end up coallescing the checks.
- //
- // FIXME: a nice improvement here may be to stop trying to match sooner, based on the least
- // of the minimum-alternative-lengths. E.g. if I have two alternatives of length 200 and 150,
- // and a string of length 100, we'll end up looping index from 0 to 100, checking whether there
- // is sufficient input to run either alternative (constantly failing). If there had been only
- // one alternative, or if the shorter alternative had come first, we would have terminated
- // immediately. :-/
- if (hasShorterAlternatives)
- jumpIfAvailableInput(-countToCheckForFirstAlternative).linkTo(firstAlternative, this);
- // index will now be a bit garbled (depending on whether 'hasShorterAlternatives' is true,
- // it has either been incremented by 1 or by (countToCheckForFirstAlternative + 1) ...
- // but since we're about to return a failure this doesn't really matter!)
if (m_pattern.m_body->m_callFrameSize)
addPtr(Imm32(m_pattern.m_body->m_callFrameSize * sizeof(void*)), stackPointerRegister);
diff --git a/JavaScriptCore/yarr/RegexPattern.h b/JavaScriptCore/yarr/RegexPattern.h
index 61d6ad6..eecbd43 100644
--- a/JavaScriptCore/yarr/RegexPattern.h
+++ b/JavaScriptCore/yarr/RegexPattern.h
@@ -207,6 +207,10 @@ struct PatternTerm {
struct PatternAlternative : FastAllocBase {
PatternAlternative(PatternDisjunction* disjunction)
: m_parent(disjunction)
+ , m_onceThrough(false)
+ , m_hasFixedSize(false)
+ , m_startsWithBOL(false)
+ , m_containsBOL(false)
{
}
@@ -221,16 +225,30 @@ struct PatternAlternative : FastAllocBase {
ASSERT(m_terms.size());
m_terms.shrink(m_terms.size() - 1);
}
+
+ void setOnceThrough()
+ {
+ m_onceThrough = true;
+ }
+
+ bool onceThrough()
+ {
+ return m_onceThrough;
+ }
Vector<PatternTerm> m_terms;
PatternDisjunction* m_parent;
unsigned m_minimumSize;
- bool m_hasFixedSize;
+ bool m_onceThrough : 1;
+ bool m_hasFixedSize : 1;
+ bool m_startsWithBOL : 1;
+ bool m_containsBOL : 1;
};
struct PatternDisjunction : FastAllocBase {
PatternDisjunction(PatternAlternative* parent = 0)
: m_parent(parent)
+ , m_hasFixedSize(false)
{
}
@@ -269,9 +287,10 @@ struct RegexPattern {
RegexPattern(bool ignoreCase, bool multiline)
: m_ignoreCase(ignoreCase)
, m_multiline(multiline)
+ , m_containsBackreferences(false)
+ , m_containsBOL(false)
, m_numSubpatterns(0)
, m_maxBackReference(0)
- , m_containsBackreferences(false)
, newlineCached(0)
, digitsCached(0)
, spacesCached(0)
@@ -294,6 +313,7 @@ struct RegexPattern {
m_maxBackReference = 0;
m_containsBackreferences = false;
+ m_containsBOL = false;
newlineCached = 0;
digitsCached = 0;
@@ -357,11 +377,12 @@ struct RegexPattern {
return nonwordcharCached;
}
- bool m_ignoreCase;
- bool m_multiline;
+ bool m_ignoreCase : 1;
+ bool m_multiline : 1;
+ bool m_containsBackreferences : 1;
+ bool m_containsBOL : 1;
unsigned m_numSubpatterns;
unsigned m_maxBackReference;
- bool m_containsBackreferences;
PatternDisjunction* m_body;
Vector<PatternDisjunction*, 4> m_disjunctions;
Vector<CharacterClass*> m_userCharacterClasses;
diff --git a/JavaScriptGlue/Configurations/Version.xcconfig b/JavaScriptGlue/Configurations/Version.xcconfig
index 673e234..e82e464 100644
--- a/JavaScriptGlue/Configurations/Version.xcconfig
+++ b/JavaScriptGlue/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 8;
+MINOR_VERSION = 9;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js b/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js
index 6176da0..0f9cb58 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js
@@ -6,9 +6,11 @@ if (window.layoutTestController) {
} else
debug('This test can not be run without the LayoutTestController');
-navigator.geolocation.watchPosition(function() {});
-navigator.geolocation.clearWatch(0);
-location = "data:text/html,TEST COMPLETE<script>layoutTestController.notifyDone();</script>";
+document.body.onload = function() {
+ navigator.geolocation.watchPosition(function() {});
+ navigator.geolocation.clearWatch(0);
+ location = "data:text/html,TEST COMPLETE<script>if(window.layoutTestController) layoutTestController.notifyDone();</script>";
+}
window.jsTestIsAsync = true;
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/HTMLFontElement/script-tests/size-attribute.js b/LayoutTests/fast/dom/HTMLFontElement/script-tests/size-attribute.js
index 3e090b1..2e32331 100644
--- a/LayoutTests/fast/dom/HTMLFontElement/script-tests/size-attribute.js
+++ b/LayoutTests/fast/dom/HTMLFontElement/script-tests/size-attribute.js
@@ -24,7 +24,7 @@ shouldBe('fontSizeAttributeEffect("5")', '"24px"');
shouldBe('fontSizeAttributeEffect("6")', '"32px"');
shouldBe('fontSizeAttributeEffect("7")', '"48px"');
-shouldBe('fontSizeAttributeEffect("0")', '"16px"'); // Gecko and WebKit do not agree on this result. Which matches IE?
+shouldBe('fontSizeAttributeEffect("0")', '"10px"');
shouldBe('fontSizeAttributeEffect("-1")', '"13px"');
shouldBe('fontSizeAttributeEffect("-2")', '"10px"');
@@ -37,6 +37,41 @@ shouldBe('fontSizeAttributeEffect("-8")', '"10px"');
shouldBe('fontSizeAttributeEffect("-9")', '"10px"');
shouldBe('fontSizeAttributeEffect("-10")', '"10px"');
+shouldBe('fontSizeAttributeEffect("x6")', 'null');
+shouldBe('fontSizeAttributeEffect(" 6")', '"32px"');
+shouldBe('fontSizeAttributeEffect("\\t6")', '"32px"');
+shouldBe('fontSizeAttributeEffect("\\r6")', '"32px"');
+shouldBe('fontSizeAttributeEffect("\\n6")', '"32px"');
+shouldBe('fontSizeAttributeEffect("\\u20086")', 'null');
+
+shouldBe('fontSizeAttributeEffect("x-6")', 'null');
+shouldBe('fontSizeAttributeEffect(" -6")', '"10px"');
+shouldBe('fontSizeAttributeEffect("\\t-6")', '"10px"');
+shouldBe('fontSizeAttributeEffect("\\r-6")', '"10px"');
+shouldBe('fontSizeAttributeEffect("\\n-6")', '"10px"');
+shouldBe('fontSizeAttributeEffect("\\u2008-6")', 'null');
+
+shouldBe('fontSizeAttributeEffect("x+6")', 'null');
+shouldBe('fontSizeAttributeEffect(" +6")', '"48px"');
+shouldBe('fontSizeAttributeEffect("\\t+6")', '"48px"');
+shouldBe('fontSizeAttributeEffect("\\r+6")', '"48px"');
+shouldBe('fontSizeAttributeEffect("\\n+6")', '"48px"');
+shouldBe('fontSizeAttributeEffect("\\u2008+6")', 'null');
+
+shouldBe('fontSizeAttributeEffect("x+x6")', 'null');
+shouldBe('fontSizeAttributeEffect(" + 6")', 'null');
+shouldBe('fontSizeAttributeEffect("\\t+\\t6")', 'null');
+shouldBe('fontSizeAttributeEffect("\\r+\\r6")', 'null');
+shouldBe('fontSizeAttributeEffect("\\n+\\n6")', 'null');
+shouldBe('fontSizeAttributeEffect("\\u2008+\\u20086")', 'null');
+
+shouldBe('fontSizeAttributeEffect("x-x6")', 'null');
+shouldBe('fontSizeAttributeEffect(" - 6")', 'null');
+shouldBe('fontSizeAttributeEffect("\\t-\\t6")', 'null');
+shouldBe('fontSizeAttributeEffect("\\r-\\r6")', 'null');
+shouldBe('fontSizeAttributeEffect("\\n-\\n6")', 'null');
+shouldBe('fontSizeAttributeEffect("\\u2008-\\u20086")', 'null');
+
shouldBe('fontSizeAttributeEffect("8")', '"48px"');
shouldBe('fontSizeAttributeEffect("9")', '"48px"');
shouldBe('fontSizeAttributeEffect("10")', '"48px"');
diff --git a/LayoutTests/fast/dom/HTMLFontElement/size-attribute-expected.txt b/LayoutTests/fast/dom/HTMLFontElement/size-attribute-expected.txt
index 28d44af..53d19e4 100644
--- a/LayoutTests/fast/dom/HTMLFontElement/size-attribute-expected.txt
+++ b/LayoutTests/fast/dom/HTMLFontElement/size-attribute-expected.txt
@@ -11,7 +11,7 @@ PASS fontSizeAttributeEffect("4") is "18px"
PASS fontSizeAttributeEffect("5") is "24px"
PASS fontSizeAttributeEffect("6") is "32px"
PASS fontSizeAttributeEffect("7") is "48px"
-PASS fontSizeAttributeEffect("0") is "16px"
+PASS fontSizeAttributeEffect("0") is "10px"
PASS fontSizeAttributeEffect("-1") is "13px"
PASS fontSizeAttributeEffect("-2") is "10px"
PASS fontSizeAttributeEffect("-3") is "10px"
@@ -22,6 +22,36 @@ PASS fontSizeAttributeEffect("-7") is "10px"
PASS fontSizeAttributeEffect("-8") is "10px"
PASS fontSizeAttributeEffect("-9") is "10px"
PASS fontSizeAttributeEffect("-10") is "10px"
+PASS fontSizeAttributeEffect("x6") is null
+PASS fontSizeAttributeEffect(" 6") is "32px"
+PASS fontSizeAttributeEffect("\t6") is "32px"
+PASS fontSizeAttributeEffect("\r6") is "32px"
+PASS fontSizeAttributeEffect("\n6") is "32px"
+PASS fontSizeAttributeEffect("\u20086") is null
+PASS fontSizeAttributeEffect("x-6") is null
+PASS fontSizeAttributeEffect(" -6") is "10px"
+PASS fontSizeAttributeEffect("\t-6") is "10px"
+PASS fontSizeAttributeEffect("\r-6") is "10px"
+PASS fontSizeAttributeEffect("\n-6") is "10px"
+PASS fontSizeAttributeEffect("\u2008-6") is null
+PASS fontSizeAttributeEffect("x+6") is null
+PASS fontSizeAttributeEffect(" +6") is "48px"
+PASS fontSizeAttributeEffect("\t+6") is "48px"
+PASS fontSizeAttributeEffect("\r+6") is "48px"
+PASS fontSizeAttributeEffect("\n+6") is "48px"
+PASS fontSizeAttributeEffect("\u2008+6") is null
+PASS fontSizeAttributeEffect("x+x6") is null
+PASS fontSizeAttributeEffect(" + 6") is null
+PASS fontSizeAttributeEffect("\t+\t6") is null
+PASS fontSizeAttributeEffect("\r+\r6") is null
+PASS fontSizeAttributeEffect("\n+\n6") is null
+PASS fontSizeAttributeEffect("\u2008+\u20086") is null
+PASS fontSizeAttributeEffect("x-x6") is null
+PASS fontSizeAttributeEffect(" - 6") is null
+PASS fontSizeAttributeEffect("\t-\t6") is null
+PASS fontSizeAttributeEffect("\r-\r6") is null
+PASS fontSizeAttributeEffect("\n-\n6") is null
+PASS fontSizeAttributeEffect("\u2008-\u20086") is null
PASS fontSizeAttributeEffect("8") is "48px"
PASS fontSizeAttributeEffect("9") is "48px"
PASS fontSizeAttributeEffect("10") is "48px"
diff --git a/LayoutTests/fast/dom/beforeload/remove-frame-in-beforeload-listener.html b/LayoutTests/fast/dom/beforeload/remove-frame-in-beforeload-listener.html
index fe45195..8d0f514 100644
--- a/LayoutTests/fast/dom/beforeload/remove-frame-in-beforeload-listener.html
+++ b/LayoutTests/fast/dom/beforeload/remove-frame-in-beforeload-listener.html
@@ -8,6 +8,10 @@
document.addEventListener("beforeload", function(event) {
if (event.target && event.target.parentElement)
event.target.parentElement.removeChild(event.target);
+ // Note, we intentionally do not cancel the load here,
+ // WebCore should automatically cancel it.
+ // Otherwise DRT will print:
+ // Blocked access to external URL http://webkit.org/
}, true);
</script>
</head>
diff --git a/LayoutTests/http/tests/resources/last-modified.php b/LayoutTests/http/tests/resources/last-modified.php
new file mode 100644
index 0000000..55c5222
--- /dev/null
+++ b/LayoutTests/http/tests/resources/last-modified.php
@@ -0,0 +1,7 @@
+<?php
+ $date = $_GET['date'];
+ header("Last-Modified: $date");
+?>
+<script>
+document.write(document.lastModified);
+</script>
diff --git a/LayoutTests/storage/indexeddb/index-basics-expected.txt b/LayoutTests/storage/indexeddb/index-basics-expected.txt
new file mode 100644
index 0000000..a99bc86
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/index-basics-expected.txt
@@ -0,0 +1,331 @@
+Test the basics of IndexedDB's IDBIndex.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB.open('name', 'description')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.createObjectStore('storeName', null)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+store = event.result
+event.result.createIndex('indexName', 'x')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is false
+indexObject = event.result
+PASS 'name' in indexObject is true
+PASS indexObject.name is "indexName"
+PASS 'storeName' in indexObject is true
+PASS indexObject.storeName is "storeName"
+PASS 'keyPath' in indexObject is true
+PASS indexObject.keyPath is "x"
+PASS 'unique' in indexObject is true
+PASS indexObject.unique is false
+PASS 'openObjectCursor' in indexObject is true
+PASS 'openCursor' in indexObject is true
+PASS 'getObject' in indexObject is true
+PASS 'get' in indexObject is true
+event.source.add({x: 'value', y: 'zzz'}, 'key')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+event.source.add({x: 'value2', y: 'zzz2'}, 'key2')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+indexObject.get('value')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result is "key"
+indexObject.getObject('value')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result.x is "value"
+PASS event.result.y is "zzz"
+indexObject.get('does not exist')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is IDBDatabaseException.NOT_FOUND_ERR
+indexObject.getObject('does not exist')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is IDBDatabaseException.NOT_FOUND_ERR
+indexObject.openCursor()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is false
+PASS event.result.key is "value"
+PASS event.result.value is "key"
+event.result.continue()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is false
+PASS event.result.key is "value2"
+PASS event.result.value is "key2"
+event.result.continue()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is true
+indexObject.openObjectCursor()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is false
+PASS event.result.key is "value"
+PASS event.result.value.x is "value"
+PASS event.result.value.y is "zzz"
+event.result.continue()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is false
+PASS event.result.key is "value2"
+PASS event.result.value.x is "value2"
+PASS event.result.value.y is "zzz2"
+event.result.continue()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/index-basics.html b/LayoutTests/storage/indexeddb/index-basics.html
new file mode 100644
index 0000000..c23f141
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/index-basics.html
@@ -0,0 +1,217 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test the basics of IndexedDB's IDBIndex.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ result = evalAndLog("indexedDB.open('name', 'description')");
+ verifyResult(result);
+ result.onsuccess = createObjectStore;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function createObjectStore()
+{
+ verifySuccessEvent(event);
+ db = evalAndLog("db = event.result");
+
+ deleteAllObjectStores(db);
+
+ result = evalAndLog("db.createObjectStore('storeName', null)");
+ verifyResult(result);
+ result.onsuccess = createIndex;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function createIndex()
+{
+ verifySuccessEvent(event);
+ window.store = evalAndLog("store = event.result");
+
+ result = evalAndLog("event.result.createIndex('indexName', 'x')");
+ verifyResult(result);
+ result.onsuccess = addData;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function addData()
+{
+ verifySuccessEvent(event);
+ shouldBeFalse("event.result === null");
+ window.indexObject = evalAndLog("indexObject = event.result");
+ shouldBeTrue("'name' in indexObject");
+ shouldBeEqualToString("indexObject.name", "indexName");
+ shouldBeTrue("'storeName' in indexObject");
+ shouldBeEqualToString("indexObject.storeName", "storeName");
+ shouldBeTrue("'keyPath' in indexObject");
+ shouldBeEqualToString("indexObject.keyPath", "x");
+ shouldBeTrue("'unique' in indexObject");
+ shouldBeFalse("indexObject.unique");
+ shouldBeTrue("'openObjectCursor' in indexObject");
+ shouldBeTrue("'openCursor' in indexObject");
+ shouldBeTrue("'getObject' in indexObject");
+ shouldBeTrue("'get' in indexObject");
+
+ result = evalAndLog("event.source.add({x: 'value', y: 'zzz'}, 'key')");
+ verifyResult(result);
+ result.onsuccess = addMore;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function addMore()
+{
+ verifySuccessEvent(event);
+
+ result = evalAndLog("event.source.add({x: 'value2', y: 'zzz2'}, 'key2')");
+ verifyResult(result);
+ result.onsuccess = getData;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function getData()
+{
+ verifySuccessEvent(event);
+
+ result = evalAndLog("indexObject.get('value')");
+ verifyResult(result);
+ result.onsuccess = getObjectData;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function getObjectData()
+{
+ verifySuccessEvent(event);
+ shouldBeEqualToString("event.result", "key");
+
+ result = evalAndLog("indexObject.getObject('value')");
+ verifyResult(result);
+ result.onsuccess = getDataFail;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function getDataFail()
+{
+ verifySuccessEvent(event);
+ shouldBeEqualToString("event.result.x", "value");
+ shouldBeEqualToString("event.result.y", "zzz");
+
+ result = evalAndLog("indexObject.get('does not exist')");
+ verifyResult(result);
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = getObjectDataFail;
+}
+
+function getObjectDataFail()
+{
+ verifyErrorEvent(event);
+ shouldBe("event.code", "IDBDatabaseException.NOT_FOUND_ERR");
+
+ result = evalAndLog("indexObject.getObject('does not exist')");
+ verifyResult(result);
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = openCursor;
+}
+
+function openCursor()
+{
+ verifyErrorEvent(event);
+ shouldBe("event.code", "IDBDatabaseException.NOT_FOUND_ERR");
+
+ window.result = evalAndLog("indexObject.openCursor()");
+ verifyResult(result);
+ result.onsuccess = cursor1Continue;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function cursor1Continue()
+{
+ verifySuccessEvent(event);
+ shouldBeFalse("event.result === null");
+ shouldBeEqualToString("event.result.key", "value");
+ shouldBeEqualToString("event.result.value", "key");
+
+ // We re-use the last result object.
+ evalAndLog("event.result.continue()");
+ verifyResult(window.result);
+ window.result.onsuccess = cursor1Continue2;
+}
+
+function cursor1Continue2()
+{
+ verifySuccessEvent(event);
+ shouldBeFalse("event.result === null");
+ shouldBeEqualToString("event.result.key", "value2");
+ shouldBeEqualToString("event.result.value", "key2");
+
+ // We re-use the last result object.
+ evalAndLog("event.result.continue()");
+ verifyResult(window.result);
+ window.result.onsuccess = openObjectCursor;
+}
+
+function openObjectCursor()
+{
+ verifySuccessEvent(event);
+ shouldBeTrue("event.result === null");
+
+ window.result = evalAndLog("indexObject.openObjectCursor()");
+ verifyResult(result);
+ result.onsuccess = cursor2Continue;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function cursor2Continue()
+{
+ verifySuccessEvent(event);
+ shouldBeFalse("event.result === null");
+ shouldBeEqualToString("event.result.key", "value");
+ shouldBeEqualToString("event.result.value.x", "value");
+ shouldBeEqualToString("event.result.value.y", "zzz");
+
+ // We re-use the last result object.
+ evalAndLog("event.result.continue()");
+ verifyResult(window.result);
+ window.result.onsuccess = cursor2Continue2;
+}
+
+function cursor2Continue2()
+{
+ verifySuccessEvent(event);
+ shouldBeFalse("event.result === null");
+ shouldBeEqualToString("event.result.key", "value2");
+ shouldBeEqualToString("event.result.value.x", "value2");
+ shouldBeEqualToString("event.result.value.y", "zzz2");
+
+ // We re-use the last result object.
+ evalAndLog("event.result.continue()");
+ verifyResult(window.result);
+ window.result.onsuccess = last;
+}
+
+function last()
+{
+ verifySuccessEvent(event);
+ shouldBeTrue("event.result === null");
+
+ done();
+}
+
+test();
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/index-cursor-expected.txt b/LayoutTests/storage/indexeddb/index-cursor-expected.txt
new file mode 100644
index 0000000..1442ad4
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/index-cursor-expected.txt
@@ -0,0 +1,2111 @@
+Test IndexedDB's IDBIndex.openCursor + the cursor it produces in depth.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB.open('someDB', 'some description')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.createObjectStore('someObjectStore')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+objectStore = event.result
+objectStore.createIndex('someIndex', 'x')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+indexObject = event.result
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Scheduling tests...
+Running tests...
+
+Next test: lower open bound is 0; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 0; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: upper open bound is 0; sorted ascending.
+PASS event.result is null
+
+Next test: upper bound is 0; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result is null
+
+Next test: lower open bound is 0; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower bound is 0; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: upper open bound is 0; sorted descending.
+PASS event.result is null
+
+Next test: upper bound is 0; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower open bound is 0; upper open bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 0; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 0; upper open bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 0; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 0; upper open bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower open bound is 0; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower bound is 0; upper open bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower bound is 0; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower open bound is 0; upper open bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 0; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 0; upper open bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 0; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 0; upper open bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower open bound is 0; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower bound is 0; upper open bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower bound is 0; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower open bound is 1; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 1; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: upper open bound is 1; sorted ascending.
+PASS event.result is null
+
+Next test: upper bound is 1; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result is null
+
+Next test: lower open bound is 1; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower bound is 1; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: upper open bound is 1; sorted descending.
+PASS event.result is null
+
+Next test: upper bound is 1; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower open bound is 1; upper open bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 1; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 1; upper open bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 1; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 1; upper open bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower open bound is 1; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower bound is 1; upper open bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower bound is 1; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower open bound is 1; upper open bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 1; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 1; upper open bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 1; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 1; upper open bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower open bound is 1; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower bound is 1; upper open bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower bound is 1; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower open bound is 2; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 2; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: upper open bound is 2; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result is null
+
+Next test: upper bound is 2; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result is null
+
+Next test: lower open bound is 2; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower bound is 2; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: upper open bound is 2; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: upper bound is 2; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower open bound is 2; upper open bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 2; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 2; upper open bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 2; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 2; upper open bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower open bound is 2; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower bound is 2; upper open bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower bound is 2; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower open bound is 2; upper open bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 2; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 2; upper open bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 2; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 2; upper open bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower open bound is 2; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower bound is 2; upper open bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower bound is 2; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower open bound is 3; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 3; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: upper open bound is 3; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result is null
+
+Next test: upper bound is 3; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result is null
+
+Next test: lower open bound is 3; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower bound is 3; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: upper open bound is 3; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: upper bound is 3; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower open bound is 3; upper open bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 3; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 3; upper open bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 3; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 3; upper open bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower open bound is 3; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower bound is 3; upper open bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower bound is 3; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower open bound is 3; upper open bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 3; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 3; upper open bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 3; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 3; upper open bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower open bound is 3; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower bound is 3; upper open bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower bound is 3; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result is null
+
+Next test: lower open bound is 4; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 4; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: upper open bound is 4; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result is null
+
+Next test: upper bound is 4; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower open bound is 4; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 4; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: upper open bound is 4; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: upper bound is 4; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower open bound is 4; upper open bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 4; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 4; upper open bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 4; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 4; upper open bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 4; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 4; upper open bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower bound is 4; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower open bound is 4; upper open bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 4; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 4; upper open bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 4; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 4; upper open bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 4; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 4; upper open bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower bound is 4; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: lower open bound is 5; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 5; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: upper open bound is 5; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result is null
+
+Next test: upper bound is 5; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 5; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result is null
+
+Next test: lower bound is 5; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: upper open bound is 5; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: upper bound is 5; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower open bound is 5; upper open bound is 6; sorted ascending.
+PASS event.result is null
+
+Next test: lower open bound is 5; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 5; upper open bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 5; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 5; upper open bound is 6; sorted descending.
+PASS event.result is null
+
+Next test: lower open bound is 5; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result is null
+
+Next test: lower bound is 5; upper open bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 5; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 5; upper open bound is 7; sorted ascending.
+PASS event.result is null
+
+Next test: lower open bound is 5; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower bound is 5; upper open bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 5; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 5; upper open bound is 7; sorted descending.
+PASS event.result is null
+
+Next test: lower open bound is 5; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result is null
+
+Next test: lower bound is 5; upper open bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower bound is 5; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: lower open bound is 6; sorted ascending.
+PASS event.result is null
+
+Next test: lower bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: upper open bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 6; sorted descending.
+PASS event.result is null
+
+Next test: lower bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result is null
+
+Next test: upper open bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower open bound is 6; upper open bound is 6; sorted ascending.
+PASS event.result is null
+
+Next test: lower open bound is 6; upper bound is 6; sorted ascending.
+PASS event.result is null
+
+Next test: lower bound is 6; upper open bound is 6; sorted ascending.
+PASS event.result is null
+
+Next test: lower bound is 6; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 6; upper open bound is 6; sorted descending.
+PASS event.result is null
+
+Next test: lower open bound is 6; upper bound is 6; sorted descending.
+PASS event.result is null
+
+Next test: lower bound is 6; upper open bound is 6; sorted descending.
+PASS event.result is null
+
+Next test: lower bound is 6; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result is null
+
+Next test: lower open bound is 6; upper open bound is 7; sorted ascending.
+PASS event.result is null
+
+Next test: lower open bound is 6; upper bound is 7; sorted ascending.
+PASS event.result is null
+
+Next test: lower bound is 6; upper open bound is 7; sorted ascending.
+PASS event.result is null
+
+Next test: lower bound is 6; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 6; upper open bound is 7; sorted descending.
+PASS event.result is null
+
+Next test: lower open bound is 6; upper bound is 7; sorted descending.
+PASS event.result is null
+
+Next test: lower bound is 6; upper open bound is 7; sorted descending.
+PASS event.result is null
+
+Next test: lower bound is 6; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result is null
+
+Next test: lower open bound is 7; sorted ascending.
+PASS event.result is null
+
+Next test: lower bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: upper open bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result is null
+
+Next test: upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 7; sorted descending.
+PASS event.result is null
+
+Next test: lower bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result is null
+
+Next test: upper open bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
+
+Next test: lower open bound is 7; upper open bound is 6; sorted ascending.
+PASS event.result is null
+
+Next test: lower open bound is 7; upper bound is 6; sorted ascending.
+PASS event.result is null
+
+Next test: lower bound is 7; upper open bound is 6; sorted ascending.
+PASS event.result is null
+
+Next test: lower bound is 7; upper bound is 6; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 7; upper open bound is 6; sorted descending.
+PASS event.result is null
+
+Next test: lower open bound is 7; upper bound is 6; sorted descending.
+PASS event.result is null
+
+Next test: lower bound is 7; upper open bound is 6; sorted descending.
+PASS event.result is null
+
+Next test: lower bound is 7; upper bound is 6; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result is null
+
+Next test: lower open bound is 7; upper open bound is 7; sorted ascending.
+PASS event.result is null
+
+Next test: lower open bound is 7; upper bound is 7; sorted ascending.
+PASS event.result is null
+
+Next test: lower bound is 7; upper open bound is 7; sorted ascending.
+PASS event.result is null
+
+Next test: lower bound is 7; upper bound is 7; sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: lower open bound is 7; upper open bound is 7; sorted descending.
+PASS event.result is null
+
+Next test: lower open bound is 7; upper bound is 7; sorted descending.
+PASS event.result is null
+
+Next test: lower bound is 7; upper open bound is 7; sorted descending.
+PASS event.result is null
+
+Next test: lower bound is 7; upper bound is 7; sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/index-cursor.html b/LayoutTests/storage/indexeddb/index-cursor.html
new file mode 100644
index 0000000..9541d60
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/index-cursor.html
@@ -0,0 +1,238 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test IndexedDB's IDBIndex.openCursor + the cursor it produces in depth.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+// In order of how it should be sorted by IndexedDB.
+window.testData = [
+ null,
+ null,
+ 2,
+ 2,
+ 10,
+ // FIXME: Dates.
+ "A big string",
+ "the BIGEST string",
+ "the BIGEST string"
+];
+
+function openDatabase()
+{
+ result = evalAndLog("indexedDB.open('someDB', 'some description')");
+ verifyResult(result);
+ result.onsuccess = openObjectStore;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openObjectStore()
+{
+ verifySuccessEvent(event);
+ window.db = evalAndLog("db = event.result");
+
+ deleteAllObjectStores(db);
+
+ result = evalAndLog("db.createObjectStore('someObjectStore')");
+ verifyResult(result);
+ result.onsuccess = openIndex;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openIndex()
+{
+ verifySuccessEvent(event);
+ window.objectStore = evalAndLog("objectStore = event.result");
+
+ result = evalAndLog("objectStore.createIndex('someIndex', 'x')");
+ verifyResult(result);
+ result.onsuccess = startAddingData;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function startAddingData()
+{
+ verifySuccessEvent(event);
+ window.indexObject = evalAndLog("indexObject = event.result");
+
+ window.nextToAdd = 0;
+ addData();
+}
+
+function addData()
+{
+ // We cheat when called for the first time; we're in the context of the objectStore success event.
+ verifySuccessEvent(event);
+
+ result = evalAndLog("objectStore.add({'x': testData[nextToAdd]}, nextToAdd)");
+ verifyResult(result);
+ result.onsuccess = ++window.nextToAdd < testData.length ? addData : scheduleTests;
+}
+
+function scheduleTests()
+{
+ debug("Scheduling tests...");
+ window.scheduledTests = [];
+ for (var i = 0; i < testData.length; ++i) {
+ /* left bound, is open, right bound, is open, ascending */
+ scheduledTests.unshift([i, true, null, null, true]);
+ scheduledTests.unshift([i, false, null, null, true]);
+ scheduledTests.unshift([null, null, i, true, true]);
+ scheduledTests.unshift([null, null, i, false, true]);
+ scheduledTests.unshift([i, true, null, null, false]);
+ scheduledTests.unshift([i, false, null, null, false]);
+ scheduledTests.unshift([null, null, i, true, false]);
+ scheduledTests.unshift([null, null, i, false, false]);
+ for (var j = 6; j < testData.length; ++j) {
+ scheduledTests.unshift([i, true, j, true, true]);
+ scheduledTests.unshift([i, true, j, false, true]);
+ scheduledTests.unshift([i, false, j, true, true]);
+ scheduledTests.unshift([i, false, j, false, true]);
+ scheduledTests.unshift([i, true, j, true, false]);
+ scheduledTests.unshift([i, true, j, false, false]);
+ scheduledTests.unshift([i, false, j, true, false]);
+ scheduledTests.unshift([i, false, j, false, false]);
+ }
+ }
+
+ debug("Running tests...");
+ setTimeout(runNextTest, 0);
+}
+
+function runNextTest()
+{
+ if (!scheduledTests.length) {
+ done();
+ return;
+ }
+
+ var test = scheduledTests.pop();
+ window.lower = test[0];
+ window.lowerIsOpen = test[1];
+ window.upper = test[2];
+ window.upperIsOpen = test[3];
+ window.ascending = test[4];
+
+ str = "Next test: ";
+ if (lower !== null) {
+ str += "lower ";
+ if (lowerIsOpen)
+ str += "open ";
+ str += "bound is " + lower + "; ";
+ }
+ if (upper !== null) {
+ str += "upper ";
+ if (upperIsOpen)
+ str += "open ";
+ str += "bound is " + upper + "; ";
+ }
+ if (ascending)
+ str += "sorted ascending.";
+ else
+ str += "sorted descending.";
+
+ debug("");
+ debug(str);
+
+ // Work around for duplicate values.
+ if (upper !== null) {
+ if (upperIsOpen) {
+ while (upper > 0 && testData[upper] === testData[upper - 1])
+ --window.upper;
+ } else {
+ while (upper < testData.length - 1 && testData[upper] === testData[upper + 1])
+ ++window.upper;
+ }
+ }
+ if (lower !== null) {
+ if (lowerIsOpen) {
+ while (lower < testData.length - 1 && testData[lower] === testData[lower + 1])
+ ++window.lower;
+ } else {
+ while (lower > 0 && testData[lower] === testData[lower - 1])
+ --window.lower;
+ }
+ }
+
+ if (ascending) {
+ if (lower !== null) {
+ if (!lowerIsOpen)
+ window.expectedIndex = lower;
+ else
+ window.expectedIndex = lower + 1;
+ } else
+ window.expectedIndex = 0;
+ } else {
+ if (upper !== null) {
+ if (!upperIsOpen)
+ window.expectedIndex = upper;
+ else
+ window.expectedIndex = upper - 1;
+ } else
+ window.expectedIndex = testData.length - 1;
+ }
+ testWithinBounds();
+
+ var keyRange;
+ if (lower !== null && upper !== null)
+ keyRange = IDBKeyRange.bound(testData[lower], testData[upper], lowerIsOpen, upperIsOpen);
+ else if (lower !== null)
+ keyRange = IDBKeyRange.leftBound(testData[lower], lowerIsOpen);
+ else
+ keyRange = IDBKeyRange.rightBound(testData[upper], upperIsOpen);
+
+ var request = indexObject.openCursor(keyRange, ascending ? IDBCursor.NEXT : IDBCursor.PREV);
+ request.onsuccess = cursorIteration;
+ request.onerror = unexpectedErrorCallback;
+}
+
+function testWithinBounds()
+{
+ if (expectedIndex < 0 || testData.length <= expectedIndex)
+ window.expectedIndex = null;
+ if (lower !== null && expectedIndex < lower)
+ window.expectedIndex = null;
+ if (upper !== null && upper < expectedIndex)
+ window.expectedIndex = null;
+ if (lower !== null && lowerIsOpen && expectedIndex <= lower)
+ window.expectedIndex = null;
+ if (upper !== null && upperIsOpen && upper <= expectedIndex)
+ window.expectedIndex = null;
+}
+
+function cursorIteration()
+{
+ if (expectedIndex === null) {
+ shouldBeNull("event.result");
+ setTimeout(runNextTest, 0);
+ return;
+ }
+ if (event.result === null) {
+ testFailed("Event.result should not be null.")
+ setTimeout(runNextTest, 0);
+ return;
+ }
+
+ shouldBe("event.result.value", "expectedIndex");
+ shouldBe("event.result.key", "testData[" + expectedIndex + "]");
+ window.expectedIndex = ascending ? expectedIndex + 1 : expectedIndex - 1;
+ testWithinBounds();
+
+ event.result.continue();
+}
+
+openDatabase(); // The first step.
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
index a60e857..890c00f 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
@@ -50,7 +50,7 @@ PASS store.name is "storeName"
PASS store.keyPath is null
PASS storeNames.contains('storeName') is true
PASS storeNames.length is 1
-event.result.createIndex('indexName', 'x')
+event.result.createIndex('indexName', 'x', true)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
PASS 'abort' in result is true
@@ -92,6 +92,27 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.result is "key"
+event.source.add({x: 'value'}, 'zzz')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+addAgainFailure():
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is IDBDatabaseException.UNKNOWN_ERR
store = event.source
store.get('key')
PASS 'onsuccess' in result is true
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics.html b/LayoutTests/storage/indexeddb/objectstore-basics.html
index 8b696c4..731d421 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics.html
+++ b/LayoutTests/storage/indexeddb/objectstore-basics.html
@@ -49,7 +49,7 @@ function createSuccess()
shouldBe("storeNames.length", "1");
// FIXME: test all of object store's methods.
- result = evalAndLog("event.result.createIndex('indexName', 'x')");
+ result = evalAndLog("event.result.createIndex('indexName', 'x', true)"); // true == unique requirement.
verifyResult(result);
result.onsuccess = addIndexSuccess;
result.onerror = unexpectedErrorCallback;
@@ -72,6 +72,19 @@ function addSuccess()
debug("addSuccess():");
verifySuccessEvent(event);
shouldBeEqualToString("event.result", "key");
+
+ result = evalAndLog("event.source.add({x: 'value'}, 'zzz')");
+ verifyResult(result);
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = addAgainFailure;
+}
+
+function addAgainFailure()
+{
+ debug("addAgainFailure():");
+ verifyErrorEvent(event);
+ // FIXME: This error code needs to be specced.
+ shouldBe("event.code", "IDBDatabaseException.UNKNOWN_ERR");
var store = evalAndLog("store = event.source");
result = evalAndLog("store.get('key')");
diff --git a/SunSpider/ChangeLog b/SunSpider/ChangeLog
index faa3002..279a389 100644
--- a/SunSpider/ChangeLog
+++ b/SunSpider/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-16 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Mark Rowe.
+ https://bugs.webkit.org/show_bug.cgi?id=45924
+
+ Modify the SunSpider harness to allow a path to be passed to the --suite
+ argument, supress the normal prepend-"tests/" behaviour for suite names
+ containing a '/'.
+
+ Also wrap the code in an anonymous function to move variables out of global
+ scope (currently the harness cannot handle running tests the overwrite the
+ variable 'j').
+
+ * resources/sunspider-standalone-driver.js:
+ * sunspider:
+
2010-08-27 Michael Saboff <msaboff@apple.com>
Reviewed by Stephanie Lewis.
diff --git a/SunSpider/resources/sunspider-standalone-driver.js b/SunSpider/resources/sunspider-standalone-driver.js
index 3a8a3e9..a015822 100644
--- a/SunSpider/resources/sunspider-standalone-driver.js
+++ b/SunSpider/resources/sunspider-standalone-driver.js
@@ -25,12 +25,14 @@
var results = new Array();
+(function(){
+
var time = 0;
var times = [];
times.length = tests.length;
for (var j = 0; j < tests.length; j++) {
- var testName = "tests/" + suiteName + "/" + tests[j] + ".js";
+ var testName = suitePath + "/" + tests[j] + ".js";
var startTime = new Date;
if (testName.indexOf('parse-only') >= 0)
checkSyntax(testName);
@@ -54,3 +56,6 @@ function recordResults(tests, times)
}
recordResults(tests, times);
+
+})();
+
diff --git a/SunSpider/sunspider b/SunSpider/sunspider
index dedc88f..dbe26cd 100755
--- a/SunSpider/sunspider
+++ b/SunSpider/sunspider
@@ -86,6 +86,9 @@ $suite = "sunspider-0.9.1" if (!$suite);
my $resultDirectory = "${suite}-results";
+my $suitePath = $suite;
+$suitePath = "tests/" . $suitePath unless ($suite =~ /\//);
+
$runShark = 1 if $runSharkCache;
$runShark = 20 if $runShark20;
$testRuns = 1 if $runShark;
@@ -129,7 +132,7 @@ my %uniqueCategories = ();
sub loadTestsList()
{
- open TESTLIST, "<", "tests/${suite}/LIST" or die "Can't find ./tests/${suite}/LIST";
+ open TESTLIST, "<", "${suitePath}/LIST" or die "Can't find ${suitePath}/LIST";
while (<TESTLIST>) {
chomp;
next unless !$testsPattern || /$testsPattern/;
@@ -151,7 +154,7 @@ my $resultsFile = "$resultDirectory/sunspider-results-$timeString.js";
sub writePrefixFile()
{
- my $prefix = "var suiteName = " . '"' . $suite . '"' . ";\n";
+ my $prefix = "var suitePath = " . '"' . $suitePath . '"' . ";\n";
$prefix .= "var tests = [ " . join(", ", map { '"' . $_ . '"' } @tests) . " ];\n";
$prefix .= "var categories = [ " . join(", ", map { '"' . $_ . '"' } @categories) . " ];\n";
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index bbbae3d..4712a0b 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -317,6 +317,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
html/parser/HTMLEntityParser.cpp \
html/parser/HTMLEntitySearch.cpp \
html/parser/HTMLFormattingElementList.cpp \
+ html/parser/HTMLParserIdioms.cpp \
html/parser/HTMLParserScheduler.cpp \
html/parser/HTMLPreloadScanner.cpp \
html/parser/HTMLScriptRunner.cpp \
@@ -739,7 +740,9 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
rendering/RenderSVGText.cpp \
rendering/RenderSVGTextPath.cpp \
rendering/RenderSVGTransformableContainer.cpp \
- rendering/RenderSVGViewportContainer.cpp
+ rendering/RenderSVGViewportContainer.cpp \
+ rendering/svg/SVGTextLayoutAttributes.cpp \
+ rendering/svg/SVGTextLayoutBuilder.cpp
endif
LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 4fb3c0a..eeb88b1 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -4,6 +4,7 @@ SET(WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/bindings"
"${WEBCORE_DIR}/bindings/generic"
"${WEBCORE_DIR}/bindings/js"
+ "${WEBCORE_DIR}/bindings/js/specialization"
"${WEBCORE_DIR}/bridge"
"${WEBCORE_DIR}/bridge/c"
"${WEBCORE_DIR}/bridge/jni/jsc"
@@ -45,6 +46,7 @@ SET(WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/plugins"
"${WEBCORE_DIR}/rendering"
"${WEBCORE_DIR}/rendering/style"
+ "${WEBCORE_DIR}/rendering/svg"
"${WEBCORE_DIR}/storage"
"${WEBCORE_DIR}/svg"
"${WEBCORE_DIR}/svg/animation"
@@ -162,6 +164,7 @@ SET(WebCore_IDL_FILES
dom/ErrorEvent.idl
dom/EventException.idl
dom/Event.idl
+ dom/HashChangeEvent.idl
dom/KeyboardEvent.idl
dom/MessageChannel.idl
dom/MessageEvent.idl
@@ -559,6 +562,7 @@ SET(WebCore_SOURCES
accessibility/AccessibilityTableHeaderContainer.cpp
accessibility/AccessibilityTableRow.cpp
+ bindings/js/specialization/JSBindingState.cpp
bindings/ScriptControllerBase.cpp
bindings/generic/ActiveDOMCallback.cpp
@@ -731,6 +735,7 @@ SET(WebCore_SOURCES
css/CSSPrimitiveValue.cpp
css/CSSProperty.cpp
css/CSSPropertyLonghand.cpp
+ css/CSSPropertySourceData.cpp
css/CSSReflectValue.cpp
css/CSSRule.cpp
css/CSSRuleList.cpp
@@ -1044,6 +1049,7 @@ SET(WebCore_SOURCES
html/parser/HTMLElementStack.cpp
html/parser/HTMLEntityParser.cpp
html/parser/HTMLEntitySearch.cpp
+ html/parser/HTMLParserIdioms.cpp
html/parser/HTMLParserScheduler.cpp
html/parser/HTMLFormattingElementList.cpp
html/parser/HTMLPreloadScanner.cpp
@@ -1322,9 +1328,7 @@ SET(WebCore_SOURCES
plugins/DOMPluginArray.cpp
plugins/DOMPlugin.cpp
plugins/PluginData.cpp
- plugins/PluginDataNone.cpp
plugins/PluginMainThreadScheduler.cpp
- plugins/PluginViewNone.cpp
rendering/AutoTableLayout.cpp
rendering/BidiRun.cpp
@@ -1565,6 +1569,8 @@ ENDIF ()
if (ENABLE_FILE_SYSTEM)
LIST(APPEND WebCore_SOURCES
+ bindings/js/JSDirectoryEntryCustom.cpp
+ bindings/js/JSEntryCustom.cpp
fileapi/DirectoryEntry.cpp
fileapi/DirectoryReader.cpp
fileapi/DOMFilePath.cpp
@@ -1573,6 +1579,7 @@ if (ENABLE_FILE_SYSTEM)
fileapi/EntryArray.cpp
fileapi/FileEntry.cpp
fileapi/FileSystemCallbacks.cpp
+ fileapi/FileWriter.cpp
fileapi/LocalFileSystem.cpp
platform/AsyncFileSystem.cpp
)
@@ -1588,22 +1595,14 @@ if (ENABLE_FILE_SYSTEM)
fileapi/FileCallback.idl
fileapi/FileEntry.idl
fileapi/FileSystemCallback.idl
+ fileapi/FileWriterCallback.idl
+ fileapi/FileWriter.idl
fileapi/Flags.idl
fileapi/Metadata.idl
fileapi/MetadataCallback.idl
)
ENDIF ()
-if (ENABLE_FILE_WRITER)
- LIST(APPEND WebCore_SOURCES
- fileapi/FileWriter.cpp
- )
- LIST(APPEND WebCore_IDL_FILES
- fileapi/FileWriterCallback.idl
- fileapi/FileWriter.idl
- )
-ENDIF ()
-
IF (ENABLE_SVG)
LIST(APPEND WebCore_SOURCES
bindings/js/JSSVGElementInstanceCustom.cpp
@@ -1662,6 +1661,8 @@ IF (ENABLE_SVG)
rendering/SVGTextQuery.cpp
rendering/style/SVGRenderStyle.cpp
rendering/style/SVGRenderStyleDefs.cpp
+ rendering/svg/SVGTextLayoutAttributes.cpp
+ rendering/svg/SVGTextLayoutBuilder.cpp
svg/ColorDistance.cpp
svg/SVGAElement.cpp
svg/SVGAltGlyphElement.cpp
diff --git a/WebCore/CMakeListsEfl.txt b/WebCore/CMakeListsEfl.txt
index 530acf3..c892cf4 100644
--- a/WebCore/CMakeListsEfl.txt
+++ b/WebCore/CMakeListsEfl.txt
@@ -58,6 +58,8 @@ LIST(APPEND WebCore_SOURCES
platform/graphics/efl/IntPointEfl.cpp
platform/posix/FileSystemPOSIX.cpp
platform/text/efl/TextBreakIteratorInternalICUEfl.cpp
+ plugins/PluginDataNone.cpp
+ plugins/PluginViewNone.cpp
)
IF (WTF_PLATFORM_CAIRO)
@@ -65,10 +67,10 @@ IF (WTF_PLATFORM_CAIRO)
"${WEBCORE_DIR}/platform/graphics/cairo"
)
LIST(APPEND WebCore_SOURCES
- platform/graphics/cairo/FontCacheCairo.cpp
+ platform/graphics/cairo/FontCacheFreeType.cpp
platform/graphics/cairo/FontCairo.cpp
platform/graphics/cairo/FontCustomPlatformData.cpp
- platform/graphics/cairo/FontPlatformDataCairo.cpp
+ platform/graphics/cairo/FontPlatformDataFreeType.cpp
platform/graphics/cairo/OwnPtrCairo.cpp
platform/graphics/cairo/PlatformRefPtrCairo.cpp
platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 730308a..1f755a4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,6974 @@
+2010-09-20 Vangelis Kokkevis <vangelis@chromium.org>
+
+ Reviewed by James Robinson.
+
+ [chromium] Making destructors of LayerChromium and ContentLayerChromium virtual
+ so that the derived class' destructor code gets called.
+ https://bugs.webkit.org/show_bug.cgi?id=46139
+
+ * platform/graphics/chromium/ContentLayerChromium.h:
+ * platform/graphics/chromium/LayerChromium.h:
+
+2010-09-20 Darin Adler <darin@apple.com>
+
+ Reviewed by James Robinson.
+
+ Deprecate the inputType function on HTMLInputElement
+ https://bugs.webkit.org/show_bug.cgi?id=46023
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::HTMLInputElement): Use m_deprecatedTypeNumber.
+ (WebCore::HTMLInputElement::isValidValue): Use deprecatedInputType.
+ (WebCore::HTMLInputElement::typeMismatch): Ditto.
+ (WebCore::HTMLInputElement::valueMissing): Ditto.
+ (WebCore::HTMLInputElement::rangeUnderflow): Ditto.
+ (WebCore::HTMLInputElement::rangeOverflow): Ditto.
+ (WebCore::HTMLInputElement::minimum): Ditto.
+ (WebCore::HTMLInputElement::maximum): Ditto.
+ (WebCore::HTMLInputElement::stepBase): Ditto.
+ (WebCore::HTMLInputElement::stepMismatch): Ditto.
+ (WebCore::HTMLInputElement::getStepParameters): Ditto.
+ (WebCore::HTMLInputElement::getAllowedValueStep): Ditto.
+ (WebCore::HTMLInputElement::isKeyboardFocusable): Ditto.
+ (WebCore::HTMLInputElement::shouldUseInputMethod): Ditto.
+ (WebCore::HTMLInputElement::handleBlurEvent): Ditto.
+ (WebCore::HTMLInputElement::setType): Added a comment.
+ (WebCore::HTMLInputElement::updateType): Replaced the setInputType function
+ with this. The type is always the type attribute value, so there is no value
+ in passing the type string in, and this is an internal implementation detail,
+ not a public function.
+ (WebCore::createFormControlTypes): Use deprecatedNumberOfTypes.
+ (WebCore::HTMLInputElement::formControlType): Use deprecatedInputType.
+ (WebCore::HTMLInputElement::saveFormControlState): Ditto.
+ (WebCore::HTMLInputElement::restoreFormControlState): Ditto.
+ (WebCore::HTMLInputElement::accessKeyAction): Ditto.
+ (WebCore::HTMLInputElement::mapToEntry): Ditto.
+ (WebCore::HTMLInputElement::parseMappedAttribute): Ditto.
+ (WebCore::HTMLInputElement::rendererIsNeeded): Ditto.
+ (WebCore::HTMLInputElement::createRenderer): Ditto.
+ (WebCore::HTMLInputElement::attach): Ditto.
+ (WebCore::HTMLInputElement::isSuccessfulSubmitButton): Ditto.
+ (WebCore::HTMLInputElement::appendFormData): Ditto.
+ (WebCore::HTMLInputElement::isTextField): Ditto.
+ (WebCore::HTMLInputElement::isTextType): Ditto.
+ (WebCore::HTMLInputElement::setChecked): Ditto.
+ (WebCore::HTMLInputElement::value): Ditto.
+ (WebCore::HTMLInputElement::valueWithDefault): Ditto.
+ (WebCore::HTMLInputElement::setSuggestedValue): Ditto.
+ (WebCore::HTMLInputElement::setValue): Ditto.
+ (WebCore::HTMLInputElement::parseToDouble): Ditto.
+ (WebCore::HTMLInputElement::valueAsDate): Ditto.
+ (WebCore::HTMLInputElement::setValueAsDate): Ditto.
+ (WebCore::HTMLInputElement::valueAsNumber): Ditto.
+ (WebCore::HTMLInputElement::setValueAsNumber): Ditto.
+ (WebCore::HTMLInputElement::serializeForDateTimeTypes): Ditto.
+ (WebCore::HTMLInputElement::serialize): Ditto.
+ (WebCore::HTMLInputElement::setValueFromRenderer): Ditto.
+ (WebCore::HTMLInputElement::storesValueSeparateFromAttribute): Ditto.
+ (WebCore::HTMLInputElement::preDispatchEventHandler): Ditto.
+ (WebCore::HTMLInputElement::postDispatchEventHandler): Ditto.
+ (WebCore::HTMLInputElement::defaultEventHandler): Ditto.
+ (WebCore::HTMLInputElement::handleBeforeTextInsertedEvent): Ditto.
+ (WebCore::HTMLInputElement::files): Ditto.
+ (WebCore::HTMLInputElement::isAcceptableValue): Ditto.
+ (WebCore::HTMLInputElement::sanitizeValue): Ditto.
+ (WebCore::HTMLInputElement::hasUnacceptableValue): Ditto.
+ (WebCore::HTMLInputElement::needsActivationCallback): Ditto.
+ (WebCore::HTMLInputElement::isRequiredFormControl): Ditto.
+ (WebCore::HTMLInputElement::recalcWillValidate): Ditto.
+ (WebCore::HTMLInputElement::parseToDateComponents): Ditto.
+ (WebCore::HTMLInputElement::dataList): Ditto.
+ (WebCore::HTMLInputElement::isSpeechEnabled): Ditto.
+
+ * html/HTMLInputElement.h: Renamed InputType to DeprecatedInputType since it
+ should not be used outside this class. Renamed numberOfTypes to
+ dprecatedNumberOfTypes for the same reason. Changed all code to use
+ deprecatedInputType function instead of m_type. Renamed inputType function
+ to deprecatedInputType. Replaced public setInputType function with private
+ updateType function. Renamed m_type data member to m_deprecatedTypeNumber.
+
+ * rendering/MediaControlElements.cpp:
+ (WebCore::MediaControlInputElement::MediaControlInputElement):
+ * rendering/RenderFileUploadControl.cpp:
+ (WebCore::RenderFileUploadControl::updateFromElement):
+ Use setType instead of setInputType.
+
+2010-09-20 Mihai Parparita <mihaip@chromium.org>
+
+ Unreviewed; an attempt to fix Windows build.
+
+ * WebCore.vcproj/WebCore.vcproj:
+
+2010-09-20 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ When PDF image is directly composited, it does not display
+ https://bugs.webkit.org/show_bug.cgi?id=46144
+
+ In the "direct image compositing" code path, we set the image directly
+ as the contents of the GraphicsLayer. However, this only works with
+ bitmap images, so we have to check that the image is a bitmap image.
+
+ Test: compositing/images/direct-pdf-image.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
+
+2010-09-20 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Crash when div with content set to image gets composited (Vimeo).
+ https://bugs.webkit.org/show_bug.cgi?id=46140
+
+ When CSS specifies that the content of an element is an image, we make
+ a RenderImage, and setStyle() before setting the image resource. In this
+ case the compositing code can attempt to access the cached image, which
+ would crash with a null deref.
+
+ Fix by null-checking m_imageResource.
+
+ Test: compositing/images/content-image.html
+
+ * rendering/RenderImage.h:
+ (WebCore::RenderImage::cachedImage):
+
+2010-09-20 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Hashchange event is no longer a simple event, needs to be its own interface
+ https://bugs.webkit.org/show_bug.cgi?id=36335
+
+ Add HashChangeEvent.idl and supporting files/changes.
+
+ Test: fast/loader/hashchange-event-properties.html
+
+ The original version of this patch was written by
+ Steven Lai <s3lance@hotmail.com>.
+
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSEventCustom.cpp:
+ (WebCore::toJS):
+ * bindings/v8/custom/V8EventCustom.cpp:
+ (WebCore::toV8):
+ * dom/Document.cpp:
+ (WebCore::Document::enqueueHashchangeEvent):
+ * dom/Event.cpp:
+ (WebCore::Event::isHashChangeEvent):
+ * dom/Event.h:
+ * dom/HashChangeEvent.h: Added.
+ (WebCore::HashChangeEvent::isHashChangeEvent):
+ (WebCore::HashChangeEvent::create):
+ (WebCore::HashChangeEvent::initHashChangeEvent):
+ (WebCore::HashChangeEvent::oldURL):
+ (WebCore::HashChangeEvent::newURL):
+ (WebCore::HashChangeEvent::HashChangeEvent):
+ * dom/HashChangeEvent.idl: Added.
+ * page/DOMWindow.idl:
+
+2010-09-20 Andy Estes <aestes@apple.com>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION (HTML5 Parser): Pages broken due to <tag<tag> parsing changes
+ https://bugs.webkit.org/show_bug.cgi?id=40961
+
+ Add an optional quirk to the HTML5 tokenizer that reverts it to WebKit's
+ legacy behavior when the start of a new token is encountered before the
+ current token is finished parsing. The legacy behavior is to emit the
+ current token as if it were properly closed and being parsing the new
+ token.
+
+ Test: fast/parser/pre-html5-parser-quirks.html
+
+ * html/parser/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::HTMLDocumentParser): Instantiate
+ m_tokenizer with the value of Settings::usePreHTML5ParserQuirks().
+ (WebCore::usePreHTMLParserQuirks): Add a helper function to return the
+ value of Settings::usePreHTML5ParserQuirks() if Settings is non-NULL.
+ * html/parser/HTMLPreloadScanner.cpp:
+ (WebCore::HTMLPreloadScanner::HTMLPreloadScanner): Instantiate
+ m_tokenizer with the value of Settings::usePreHTML5ParserQuirks().
+ * html/parser/HTMLTokenizer.cpp:
+ (WebCore::HTMLTokenizer::HTMLTokenizer):
+ (WebCore::HTMLTokenizer::nextToken): If the quirk is enabled and an
+ unexpected '<' is encountered in certain states, emit the current token
+ and reprocess the '<' as the start of a new token.
+ * html/parser/HTMLTokenizer.h:
+ (WebCore::HTMLTokenizer::create):
+ * html/parser/HTMLViewSourceParser.cpp:
+ (WebCore::HTMLViewSourceParser::HTMLViewSourceParser): Instantiate
+ m_tokenizer with the value of Settings::usePreHTML5ParserQuirks().
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ * page/Settings.h:
+ (WebCore::Settings::setUsePreHTML5ParserQuirks):
+ (WebCore::Settings::usePreHTML5ParserQuirks):
+
+2010-09-20 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46132, add an isVerticalBlockFlow() method to RenderStyle and
+ patch callers so that they don't have to check both top-to-bottom and bottom-to-top block flow.
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::availableLogicalWidth):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::logicalWidth):
+ (WebCore::RenderStyle::logicalHeight):
+ (WebCore::RenderStyle::logicalMinWidth):
+ (WebCore::RenderStyle::logicalMaxWidth):
+ (WebCore::RenderStyle::logicalMinHeight):
+ (WebCore::RenderStyle::logicalMaxHeight):
+ (WebCore::RenderStyle::borderStartWidth):
+ (WebCore::RenderStyle::borderEndWidth):
+ (WebCore::RenderStyle::marginStart):
+ (WebCore::RenderStyle::marginEnd):
+ (WebCore::RenderStyle::paddingStart):
+ (WebCore::RenderStyle::paddingEnd):
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::isVerticalBlockFlow):
+
+2010-09-20 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46124, add support for logical padding accessors to
+ RenderBoxModelObject.
+
+ Added fast/blockflow/percentage-padding.html even though it fails, so that when more of layout is patched
+ we can see it start passing.
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paddingTop):
+ (WebCore::RenderBoxModelObject::paddingBottom):
+ (WebCore::RenderBoxModelObject::paddingLeft):
+ (WebCore::RenderBoxModelObject::paddingRight):
+ (WebCore::RenderBoxModelObject::paddingBefore):
+ (WebCore::RenderBoxModelObject::paddingAfter):
+ (WebCore::RenderBoxModelObject::paddingStart):
+ (WebCore::RenderBoxModelObject::paddingEnd):
+ * rendering/RenderBoxModelObject.h:
+
+2010-09-20 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46126, add availableLogicalWidth() to RenderBox.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::availableWidth):
+ (WebCore::RenderBlock::availableLogicalWidth):
+ * rendering/RenderBlock.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::availableLogicalWidth):
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::availableWidth):
+
+2010-09-20 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ [chromium] Change compositor to use GraphicsContext3D rather than GLES2Context
+ https://bugs.webkit.org/show_bug.cgi?id=45912
+
+ Switched Chromium's compositor to use GraphicsContext3D to issue
+ its OpenGL rendering calls rather than the Chromium-specific
+ GLES2Context and command buffer OpenGL implementation.
+
+ The in-process software rendering path for GraphicsContext3D does
+ not yet work with the compositor, at least not on Mac OS X. This
+ will be worked on in subsequent bugs.
+
+ Tested manually with 3D CSS, WebGL and video content on Mac OS X
+ and Linux. No new tests.
+
+ * platform/graphics/chromium/Canvas2DLayerChromium.cpp:
+ (WebCore::Canvas2DLayerChromium::~Canvas2DLayerChromium):
+ (WebCore::Canvas2DLayerChromium::updateContents):
+ * platform/graphics/chromium/CanvasLayerChromium.cpp:
+ (WebCore::CanvasLayerChromium::SharedValues::SharedValues):
+ (WebCore::CanvasLayerChromium::SharedValues::~SharedValues):
+ (WebCore::CanvasLayerChromium::draw):
+ * platform/graphics/chromium/CanvasLayerChromium.h:
+ * platform/graphics/chromium/ContentLayerChromium.cpp:
+ (WebCore::ContentLayerChromium::SharedValues::SharedValues):
+ (WebCore::ContentLayerChromium::SharedValues::~SharedValues):
+ (WebCore::ContentLayerChromium::~ContentLayerChromium):
+ (WebCore::ContentLayerChromium::updateTextureRect):
+ (WebCore::ContentLayerChromium::draw):
+ * platform/graphics/chromium/ContentLayerChromium.h:
+ * platform/graphics/chromium/DrawingBufferChromium.cpp:
+ (WebCore::DrawingBuffer::publishToPlatformLayer):
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::loadShader):
+ (WebCore::LayerChromium::SharedValues::SharedValues):
+ (WebCore::LayerChromium::SharedValues::~SharedValues):
+ (WebCore::LayerChromium::createShaderProgram):
+ (WebCore::LayerChromium::layerRendererContext):
+ (WebCore::LayerChromium::drawTexturedQuad):
+ (WebCore::LayerChromium::drawDebugBorder):
+ (WebCore::LayerChromium::drawAsMask):
+ (WebCore::LayerChromium::prepareForDraw):
+ * platform/graphics/chromium/LayerChromium.h:
+ (WebCore::LayerChromium::SharedValues::context):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::create):
+ (WebCore::LayerRendererChromium::LayerRendererChromium):
+ (WebCore::LayerRendererChromium::context):
+ (WebCore::LayerRendererChromium::debugGLCall):
+ (WebCore::LayerRendererChromium::useShader):
+ (WebCore::LayerRendererChromium::prepareToDrawLayers):
+ (WebCore::LayerRendererChromium::updateRootLayerTextureRect):
+ (WebCore::LayerRendererChromium::drawLayers):
+ (WebCore::LayerRendererChromium::finish):
+ (WebCore::LayerRendererChromium::present):
+ (WebCore::LayerRendererChromium::getFramebufferPixels):
+ (WebCore::LayerRendererChromium::createLayerTexture):
+ (WebCore::LayerRendererChromium::drawLayerIntoStencilBuffer):
+ (WebCore::LayerRendererChromium::drawLayersRecursive):
+ (WebCore::LayerRendererChromium::drawLayer):
+ (WebCore::LayerRendererChromium::scissorToRect):
+ (WebCore::LayerRendererChromium::makeContextCurrent):
+ (WebCore::LayerRendererChromium::resizeOnscreenContent):
+ (WebCore::LayerRendererChromium::initializeSharedObjects):
+ (WebCore::LayerRendererChromium::cleanupSharedObjects):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ * platform/graphics/chromium/VideoLayerChromium.cpp:
+ (WebCore::VideoLayerChromium::createTextureRect):
+ (WebCore::VideoLayerChromium::updateTextureRect):
+ * platform/graphics/chromium/WebGLLayerChromium.cpp:
+ (WebCore::WebGLLayerChromium::updateContents):
+ * platform/graphics/gpu/SharedGraphicsContext3D.cpp:
+ (WebCore::SharedGraphicsContext3D::flush):
+ (WebCore::SharedGraphicsContext3D::supportsCopyTextureToParentTextureCHROMIUM):
+ (WebCore::SharedGraphicsContext3D::copyTextureToParentTextureCHROMIUM):
+ * platform/graphics/gpu/SharedGraphicsContext3D.h:
+
+2010-09-20 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46119, add logical accessors to RenderStyle. Not used by any RenderObjects yet, so no tests
+ until then.
+
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::logicalWidth):
+ (WebCore::RenderStyle::logicalHeight):
+ (WebCore::RenderStyle::logicalMinWidth):
+ (WebCore::RenderStyle::logicalMaxWidth):
+ (WebCore::RenderStyle::logicalMinHeight):
+ (WebCore::RenderStyle::logicalMaxHeight):
+ (WebCore::RenderStyle::borderBeforeWidth):
+ (WebCore::RenderStyle::borderAfterWidth):
+ (WebCore::RenderStyle::borderStartWidth):
+ (WebCore::RenderStyle::borderEndWidth):
+ (WebCore::RenderStyle::marginBefore):
+ (WebCore::RenderStyle::marginAfter):
+ (WebCore::RenderStyle::marginStart):
+ (WebCore::RenderStyle::marginEnd):
+ (WebCore::RenderStyle::paddingBefore):
+ (WebCore::RenderStyle::paddingAfter):
+ (WebCore::RenderStyle::paddingStart):
+ (WebCore::RenderStyle::paddingEnd):
+ * rendering/style/RenderStyle.h:
+
+2010-09-20 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46116, implement block-flow-aware logical properties.
+
+ This patch adds all the logical properties from the CSS3 Writing Mode draft for margins, padding, border,
+ width and height.
+
+ Added fast/css/logical-property-resolution.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ * css/CSSProperty.cpp:
+ (WebCore::resolveToPhysicalProperty):
+ (WebCore::CSSProperty::resolveDirectionAwareProperty):
+ * css/CSSProperty.h:
+ * css/CSSPropertyNames.in:
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyDeclarations):
+ (WebCore::CSSStyleSelector::applyProperty):
+
+2010-09-20 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46114, two tables repaint tests failing on bots.
+
+ Patch layoutRows to apply the layout delta when setting a new cell location prior to laying out the cell.
+
+ The layout delta is then removed after layout has happened when the repaint check is done. This change
+ makes cell layout match block child layout, and now the cells have the correct new location up front
+ when laying out (a necessity for pagination).
+
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::layoutRows):
+
+2010-09-20 Jacob Dinu <dinu.jacob@nokia.com>
+
+ Reviewed by Adam Barth.
+
+ When loading a cached page, dispatchDidCommitLoad is called after FrameLoader::open so
+ that all initialzations are done before calling client dispatchDidCommitLoad to avoid
+ client from accessing incorrect data.
+ https://bugs.webkit.org/show_bug.cgi?id=41155
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::commitProvisionalLoad):
+ (WebCore::FrameLoader::transitionToCommitted):
+
+2010-09-20 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Adam Roben.
+
+ REGRESSION: alternating animation direction doesn't work on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=46017
+
+ Animation-direction on Windows was broken because bitfields on
+ Windows are signed.
+
+ Fixed by making m_direction an unsigned in the bitfield, and
+ casting in the accessor.
+
+ Test: animations/animation-direction.html
+
+ * platform/animation/Animation.h:
+ (WebCore::Animation::direction):
+
+2010-09-20 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Pasteboard doesn't work in WebKit2.
+ https://bugs.webkit.org/show_bug.cgi?id=42317
+ <rdar://problem/7660537>
+
+ * loader/EmptyClients.h:
+ (WebCore::EmptyEditorClient::documentFragmentFromAttributedString): Changed parameter to
+ be a Vector of RefPtr.
+ * page/EditorClient.h:
+ * platform/mac/PasteboardMac.mm:
+ (WebCore::Pasteboard::documentFragmentWithRtf): Stylistic changes.
+
+2010-09-20 Yong Li <yoli@rim.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=39966
+ Make compareBorders() a consistent compare function which can beused by qsort().
+
+ New test case added: LayoutTests/tables/sort-collapsed-border-styles.html
+
+ * rendering/RenderTableCell.cpp:
+ (WebCore::compareBorders):
+ (WebCore::chooseBorder):
+ (WebCore::RenderTableCell::collapsedLeftBorder):
+ (WebCore::RenderTableCell::collapsedRightBorder):
+ (WebCore::RenderTableCell::collapsedTopBorder):
+ (WebCore::RenderTableCell::collapsedBottomBorder):
+ (WebCore::compareBorderStylesForQSort):
+
+2010-09-20 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Buildfix for PluginViewWin.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=46033
+
+ * plugins/win/PluginViewWin.cpp:
+ (WebCore::PluginView::paintIntoTransformedContext):
+ (WebCore::PluginView::snapshot):
+
+2010-09-18 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46030, aintitcool.com doesn't paginate correctly when printed.
+
+ This happens because the site always has a document width that will exceed the page width.
+ We incorrectly apply a double scale instead of clipping after the first scale still doesn't fit.
+ The fix for the issue is to cap the right layout overflow to the page width and to just clip out
+ any additional excess. This is the code in FrameView.cpp.
+
+ This patch also cleans up table cell invalidation to reduce the # of relayouts. This change is not
+ a correctness fix. It's just performance.
+
+ I'm not sure how to write a test for this, since the double scale is an artifact of how WebKit mac calls
+ back in when really printing.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::forceLayoutForPagination):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::layoutBlockChild):
+ (WebCore::RenderBlock::layoutPositionedObjects):
+ (WebCore::RenderBlock::positionNewFloats):
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::markForPaginationRelayout):
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::layoutHorizontalBox):
+ (WebCore::RenderFlexibleBox::layoutVerticalBox):
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::layoutRows):
+
+2010-09-20 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: merge Inspector client runtime events into the serialized inspector state object.
+
+ Drive-by rename getBackendSettings -> getInspectorState to better reflect the nature of the data.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45974
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorClient.h:
+ (WebCore::InspectorClient::updateInspectorStateCookie):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::saveApplicationSettings):
+ (WebCore::InspectorController::getInspectorState):
+ (WebCore::InspectorController::updateInspectorStateCookie):
+ (WebCore::InspectorController::restoreInspectorStateFromCookie):
+ (WebCore::InspectorController::getSettings):
+ (WebCore::InspectorController::setMonitoringXHREnabled):
+ (WebCore::InspectorController::restoreDebugger):
+ (WebCore::InspectorController::restoreProfiler):
+ (WebCore::InspectorController::setResourceTrackingEnabled):
+ (WebCore::InspectorController::ensureSettingsLoaded):
+ (WebCore::InspectorController::startTimelineProfiler):
+ (WebCore::InspectorController::stopTimelineProfiler):
+ (WebCore::InspectorController::enableProfiler):
+ (WebCore::InspectorController::disableProfiler):
+ (WebCore::InspectorController::enableDebuggerFromFrontend):
+ (WebCore::InspectorController::disableDebugger):
+ * inspector/InspectorController.h:
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype._handleContextMenuEvent):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
+ * inspector/front-end/Settings.js:
+ (WebInspector.Settings.initialize):
+ * inspector/front-end/inspector.js:
+ (WebInspector.doLoadedDone.populateInspectorState):
+ (WebInspector.doLoadedDone):
+
+2010-09-20 Dirk Schulze <krit@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ SVG Filter cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=45612
+
+ All effect inputs are stored in a Vector in FilterEffect instead of passing them via constructors to every effect type.
+ This simplifies the primitive subregion logic and centralizes it in determineFilterPrimitiveSubregion.
+ Just SourceGraphic, SourceAlpha and FETile still calculate filter primitive subregions on
+ their own. Working on it in a followup patch.
+ The subregions code is SVG specific and moving this calculation to FilterEffect is an
+ intermediate step before moving it to RenderSVGResourceFilterPrimitive in a following patch.
+ The new FilterEffectVector will also make it possible to add code to determine the
+ smallest used region of an effect and will help save memory and resources in the future.
+ subRegion got renamed to filterPrimitiveSubregion to match the name scheme. scaledSubRegion got
+ renamed to repaintRectInLocalCoordinates since this is its proper meaning.
+ Removed unnecessary member variables and functions from FilterEffect.
+
+ No new tests added since the functionality didn't change.
+
+ * platform/graphics/cairo/GraphicsContextCairo.cpp: scaledSubRegion was renamed to repaintRectInLocalCoordinates.
+ (WebCore::GraphicsContext::createShadowMask):
+ * platform/graphics/filters/FEBlend.cpp: Removed Filter effect inputs from constructor.
+ (WebCore::FEBlend::FEBlend):
+ (WebCore::FEBlend::create):
+ (WebCore::FEBlend::apply): Call inputFilterEffects to get input filter primitives.
+ (WebCore::FEBlend::externalRepresentation): Call inputFilterEffects to get input filter primitives.
+ * platform/graphics/filters/FEBlend.h:
+ * platform/graphics/filters/FEColorMatrix.cpp: Ditto.
+ (WebCore::FEColorMatrix::FEColorMatrix):
+ (WebCore::FEColorMatrix::create):
+ (WebCore::FEColorMatrix::apply):
+ (WebCore::FEColorMatrix::externalRepresentation):
+ * platform/graphics/filters/FEColorMatrix.h:
+ * platform/graphics/filters/FEComponentTransfer.cpp: Ditto.
+ (WebCore::FEComponentTransfer::FEComponentTransfer):
+ (WebCore::FEComponentTransfer::create):
+ (WebCore::FEComponentTransfer::apply):
+ (WebCore::FEComponentTransfer::externalRepresentation):
+ * platform/graphics/filters/FEComponentTransfer.h:
+ * platform/graphics/filters/FEComposite.cpp: Ditto.
+ (WebCore::FEComposite::FEComposite):
+ (WebCore::FEComposite::create):
+ (WebCore::FEComposite::apply):
+ (WebCore::FEComposite::externalRepresentation):
+ * platform/graphics/filters/FEComposite.h:
+ * platform/graphics/filters/FEGaussianBlur.cpp: Ditto.
+ (WebCore::FEGaussianBlur::FEGaussianBlur):
+ (WebCore::FEGaussianBlur::create):
+ (WebCore::FEGaussianBlur::apply):
+ (WebCore::FEGaussianBlur::externalRepresentation):
+ * platform/graphics/filters/FEGaussianBlur.h:
+ * platform/graphics/filters/Filter.h:
+ (WebCore::Filter::determineFilterPrimitiveSubregion): Renamed from calculateEffectSubRegion to match name scheme.
+ * platform/graphics/filters/FilterEffect.cpp:
+ (WebCore::FilterEffect::FilterEffect):
+ (WebCore::FilterEffect::determineFilterPrimitiveSubregion): The main place for subregion calculation.
+ (WebCore::FilterEffect::calculateDrawingIntRect): Takes repaintRectInLocalCoordinates now.
+ (WebCore::FilterEffect::calculateDrawingRect): ditto.
+ (WebCore::FilterEffect::getEffectContext): Check if ImageBuffer was created.
+ * platform/graphics/filters/FilterEffect.h: Changed names to match name scheme. Removed unnecessary member variables and functions.
+ Seperate SVG specific member variables and functions. Will get removed in followup patches.
+ (WebCore::FilterEffect::resultImage):
+ (WebCore::FilterEffect::setEffectBuffer):
+ (WebCore::FilterEffect::inputEffect):
+ (WebCore::FilterEffect::inputEffects):
+ (WebCore::FilterEffect::numberOfinputEffects):
+ (WebCore::FilterEffect::isAlphaImage):
+ (WebCore::FilterEffect::setIsAlphaImage):
+ (WebCore::FilterEffect::repaintRectInLocalCoordinates):
+ (WebCore::FilterEffect::setRepaintRectInLocalCoordinates):
+ (WebCore::FilterEffect::isSourceInput):
+ (WebCore::FilterEffect::hasX):
+ (WebCore::FilterEffect::setHasX):
+ (WebCore::FilterEffect::hasY):
+ (WebCore::FilterEffect::setHasY):
+ (WebCore::FilterEffect::hasWidth):
+ (WebCore::FilterEffect::setHasWidth):
+ (WebCore::FilterEffect::hasHeight):
+ (WebCore::FilterEffect::setHasHeight):
+ (WebCore::FilterEffect::filterPrimitiveSubregion):
+ (WebCore::FilterEffect::setFilterPrimitiveSubregion):
+ (WebCore::FilterEffect::effectBoundaries):
+ (WebCore::FilterEffect::setEffectBoundaries):
+ * platform/graphics/filters/SourceAlpha.cpp:
+ (WebCore::SourceAlpha::determineFilterPrimitiveSubregion): Renamed to match name scheme.
+ * platform/graphics/filters/SourceAlpha.h:
+ (WebCore::SourceAlpha::isSourceInput):
+ * platform/graphics/filters/SourceGraphic.cpp:
+ (WebCore::SourceGraphic::determineFilterPrimitiveSubregion): Ditto.
+ * platform/graphics/filters/SourceGraphic.h:
+ (WebCore::SourceGraphic::isSourceInput):
+ * rendering/RenderSVGResourceFilter.cpp: Adapt to renames in FilterEffect.
+ (WebCore::RenderSVGResourceFilter::applyResource):
+ (WebCore::RenderSVGResourceFilter::postApplyResource):
+ * svg/SVGFEBlendElement.cpp: Constructor of FEBlend doesn't take input effects. Adding them afterwards.
+ (WebCore::SVGFEBlendElement::build):
+ * svg/SVGFEColorMatrixElement.cpp: Ditto.
+ (WebCore::SVGFEColorMatrixElement::build):
+ * svg/SVGFEComponentTransferElement.cpp: Ditto.
+ (WebCore::SVGFEComponentTransferElement::build):
+ * svg/SVGFECompositeElement.cpp: Ditto.
+ (WebCore::SVGFECompositeElement::build):
+ * svg/SVGFEConvolveMatrixElement.cpp: Ditto.
+ (WebCore::SVGFEConvolveMatrixElement::build):
+ * svg/SVGFEDiffuseLightingElement.cpp: Ditto.
+ (WebCore::SVGFEDiffuseLightingElement::build):
+ * svg/SVGFEDisplacementMapElement.cpp: Ditto.
+ (WebCore::SVGFEDisplacementMapElement::build):
+ * svg/SVGFEGaussianBlurElement.cpp: Ditto.
+ (WebCore::SVGFEGaussianBlurElement::build):
+ * svg/SVGFEMergeElement.cpp: Ditto.
+ (WebCore::SVGFEMergeElement::build):
+ * svg/SVGFEMorphologyElement.cpp: Ditto.
+ (WebCore::SVGFEMorphologyElement::build):
+ * svg/SVGFEOffsetElement.cpp: Ditto.
+ (WebCore::SVGFEOffsetElement::build):
+ * svg/SVGFESpecularLightingElement.cpp: Ditto.
+ (WebCore::SVGFESpecularLightingElement::build):
+ * svg/SVGFETileElement.cpp: Ditto.
+ (WebCore::SVGFETileElement::build):
+ * svg/graphics/filters/SVGFEConvolveMatrix.cpp: Ditto.
+ (WebCore::FEConvolveMatrix::FEConvolveMatrix):
+ (WebCore::FEConvolveMatrix::create):
+ (WebCore::FEConvolveMatrix::apply):
+ (WebCore::FEConvolveMatrix::externalRepresentation):
+ * svg/graphics/filters/SVGFEConvolveMatrix.h:
+ * svg/graphics/filters/SVGFEDiffuseLighting.cpp: Ditto.
+ (WebCore::FEDiffuseLighting::FEDiffuseLighting):
+ (WebCore::FEDiffuseLighting::create):
+ (WebCore::FEDiffuseLighting::externalRepresentation):
+ * svg/graphics/filters/SVGFEDiffuseLighting.h:
+ * svg/graphics/filters/SVGFEDisplacementMap.cpp: Ditto.
+ (WebCore::FEDisplacementMap::FEDisplacementMap):
+ (WebCore::FEDisplacementMap::create):
+ (WebCore::FEDisplacementMap::apply):
+ (WebCore::FEDisplacementMap::externalRepresentation):
+ * svg/graphics/filters/SVGFEDisplacementMap.h:
+ * svg/graphics/filters/SVGFEFlood.cpp: Ditto.
+ (WebCore::FEFlood::apply):
+ * svg/graphics/filters/SVGFEImage.cpp: Ditto.
+ (WebCore::FEImage::apply):
+ * svg/graphics/filters/SVGFELighting.cpp: Ditto.
+ (WebCore::FELighting::FELighting):
+ (WebCore::FELighting::apply):
+ * svg/graphics/filters/SVGFELighting.h:
+ * svg/graphics/filters/SVGFEMerge.cpp: Ditto.
+ (WebCore::FEMerge::FEMerge):
+ (WebCore::FEMerge::create):
+ (WebCore::FEMerge::apply):
+ (WebCore::FEMerge::externalRepresentation):
+ * svg/graphics/filters/SVGFEMerge.h:
+ * svg/graphics/filters/SVGFEMorphology.cpp: Ditto.
+ (WebCore::FEMorphology::FEMorphology):
+ (WebCore::FEMorphology::create):
+ (WebCore::FEMorphology::apply):
+ (WebCore::FEMorphology::externalRepresentation):
+ * svg/graphics/filters/SVGFEMorphology.h:
+ * svg/graphics/filters/SVGFEOffset.cpp: Ditto.
+ (WebCore::FEOffset::FEOffset):
+ (WebCore::FEOffset::create):
+ (WebCore::FEOffset::apply):
+ (WebCore::FEOffset::externalRepresentation):
+ * svg/graphics/filters/SVGFEOffset.h:
+ * svg/graphics/filters/SVGFESpecularLighting.cpp: Ditto.
+ (WebCore::FESpecularLighting::FESpecularLighting):
+ (WebCore::FESpecularLighting::create):
+ (WebCore::FESpecularLighting::externalRepresentation):
+ * svg/graphics/filters/SVGFESpecularLighting.h:
+ * svg/graphics/filters/SVGFETile.cpp: Ditto.
+ (WebCore::FETile::FETile):
+ (WebCore::FETile::create):
+ (WebCore::FETile::determineFilterPrimitiveSubregion): Renamed to match name scheme.
+ (WebCore::FETile::apply):
+ (WebCore::FETile::externalRepresentation):
+ * svg/graphics/filters/SVGFETile.h:
+ * svg/graphics/filters/SVGFilter.cpp: Renamed itemBox to targetBoundingBox to match name scheme.
+ (WebCore::SVGFilter::SVGFilter):
+ (WebCore::SVGFilter::determineFilterPrimitiveSubregion): Renamed to match name scheme.
+ (WebCore::SVGFilter::create):
+ * svg/graphics/filters/SVGFilter.h:
+ (WebCore::SVGFilter::sourceImageRect):
+
+2010-09-20 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: highlight DOM node when hover on link element or DOM breakpoint
+ https://bugs.webkit.org/show_bug.cgi?id=45897
+
+ * inspector/front-end/BreakpointsSidebarPane.js:
+ (WebInspector.BreakpointItem):
+ (WebInspector.JSBreakpointItem):
+ (WebInspector.DOMBreakpointItem):
+ (WebInspector.DOMBreakpointItem.prototype.compareTo):
+ (WebInspector.DOMBreakpointItem.prototype._breakpointClicked):
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype.hide):
+ (WebInspector.ElementsPanel.prototype.reset):
+ (WebInspector.ElementsPanel.prototype.setDocument.selectNode):
+ (WebInspector.ElementsPanel.prototype._mouseMovedInCrumbs):
+ (WebInspector.ElementsPanel.prototype._mouseMovedOutOfCrumbs):
+ (WebInspector.ElementsPanel.prototype.linkifyNodeReference):
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeOutline.prototype.set focusedDOMNode):
+ (WebInspector.ElementsTreeOutline.prototype._onmousemove):
+ (WebInspector.ElementsTreeOutline.prototype._onmouseout):
+ * inspector/front-end/inspector.js:
+ (WebInspector.highlightDOMNode):
+ (WebInspector.highlightDOMNodeForTwoSeconds):
+ (WebInspector.wireElementWithDOMNode):
+ (WebInspector._updateFocusedNode):
+ (WebInspector.reset):
+ (WebInspector.updateFocusedNode):
+
+2010-09-19 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r67749.
+ http://trac.webkit.org/changeset/67749
+ https://bugs.webkit.org/show_bug.cgi?id=46068
+
+ breaking ToT chromium canary build (Requested by shans on
+ #webkit).
+
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::V8DOMWindowShell::createNewContext):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::registeredExtensionWithV8):
+ (WebCore::V8Proxy::registerExtension):
+ * bindings/v8/V8Proxy.h:
+ * loader/EmptyClients.h:
+ * loader/FrameLoaderClient.h:
+
+2010-09-19 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 46065 - Unify implementation of ToInt32 and ToUInt32, don't use fmod.
+
+ These methods implement the same conversion (see discussion in the notes
+ of sections of 9.5 and 9.6 of the spec), only differing in how the result
+ is interpretted.
+
+ Removing JSValue::toInt32 (since this has weird, non-spec function).
+ A couple of places in the binding are using this method, so adding
+ finiteInt32Value to the bindings to maintain current behaviour.
+
+ Test: fast/js/toInt32UInt32.html
+
+ * bindings/js/JSDOMBinding.h:
+ (WebCore::finiteInt32Value):
+ * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
+ (WebCore::JSHTMLOptionsCollection::add):
+ * bindings/js/JSSQLResultSetRowListCustom.cpp:
+ (WebCore::JSSQLResultSetRowList::item):
+ * bindings/js/JSSVGPODListCustom.h:
+ (WebCore::JSSVGPODListCustom::getItem):
+ (WebCore::JSSVGPODListCustom::insertItemBefore):
+ (WebCore::JSSVGPODListCustom::replaceItem):
+ (WebCore::JSSVGPODListCustom::removeItem):
+ * bindings/js/JSSVGPathSegListCustom.cpp:
+ (WebCore::JSSVGPathSegList::getItem):
+ (WebCore::JSSVGPathSegList::insertItemBefore):
+ (WebCore::JSSVGPathSegList::replaceItem):
+ (WebCore::JSSVGPathSegList::removeItem):
+
+2010-09-19 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] clipBoundingRect() should return rect relevant to current layer
+ https://bugs.webkit.org/show_bug.cgi?id=46059
+
+ r65791 inadvertently changed clipBoundingRect() to always use the GC painter
+ without checking the TransparencyLayer stack first.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContextPlatformPrivate::p):
+ (WebCore::GraphicsContextPlatformPrivate::clipBoundingRect):
+
+2010-09-19 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Replace WKBundleRangeRef with WKBundleRangeHandleRef.
+ https://bugs.webkit.org/show_bug.cgi?id=46054
+
+ * WebCore.exp.in:
+ * WebCore.xcodeproj/project.pbxproj:
+
+2010-09-19 Patrick Gansterer <paroga@paroga.com>
+
+ Unreviewed.
+
+ [WINCE] Buildfix for Gradient after r67801.
+
+ * platform/graphics/Gradient.h:
+ * platform/graphics/wince/GradientWinCE.cpp:
+ (WebCore::Gradient::getStops):
+
+2010-09-19 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [Chromium] Add is<input type>() functions to WebInputElement
+ https://bugs.webkit.org/show_bug.cgi?id=46035
+
+ * html/HTMLInputElement.h:
+ (WebCore::HTMLInputElement::isText): Added. It is used by WebKit/chromium.
+
+2010-09-18 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Path: Remove unused member variable
+ https://bugs.webkit.org/show_bug.cgi?id=46048
+
+ Path::m_lastMoveToIndex is not used for anything, so remove it.
+
+ * platform/graphics/Path.h:
+ * platform/graphics/qt/PathQt.cpp:
+ (WebCore::Path::Path):
+ (WebCore::Path::operator=):
+ (WebCore::Path::moveTo):
+
+2010-09-18 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Darin Adler.
+
+ Use AtomicString insted of String in XMLDocumentParser
+ https://bugs.webkit.org/show_bug.cgi?id=45990
+
+ Create AtomicString as early as possible.
+ This can avoid unnecessary memcpy of String content.
+
+ * dom/XMLDocumentParser.h:
+ * dom/XMLDocumentParserLibxml2.cpp:
+ (WebCore::toAtomicString):
+ (WebCore::handleElementNamespaces):
+ (WebCore::handleElementAttributes):
+ (WebCore::XMLDocumentParser::startElementNs):
+
+2010-09-18 Erik Arvidsson <arv@chromium.org>
+
+ Reviewed by Nate Chapin.
+
+ [Chromium] fast/dom/dataset-gc.html is failing
+ https://bugs.webkit.org/show_bug.cgi?id=45426
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/custom/V8DOMStringMapCustom.cpp:
+ (WebCore::toV8):
+ * dom/DOMStringMap.h:
+ * dom/DatasetDOMStringMap.h:
+ (WebCore::DatasetDOMStringMap::element):
+
+2010-09-18 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Oliver Hunt.
+
+ Gradient: Fast-path for the ideal case in sortStopsIfNecessary()
+ https://bugs.webkit.org/show_bug.cgi?id=46045
+
+ Avoid calling std::stable_sort for 2-stop gradients that are already in order.
+
+ * platform/graphics/Gradient.cpp:
+ (WebCore::Gradient::sortStopsIfNecessary):
+
+2010-09-18 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Andreas Kling.
+
+ [BREWMP] Fix a typo in key code name
+ https://bugs.webkit.org/show_bug.cgi?id=46003
+
+ AVK_CLR is the right Brew MP key code name for VK_BACK.
+
+ * platform/brew/PlatformKeyboardEventBrew.cpp:
+ (WebCore::windowsKeyCodeForKeyEvent):
+
+2010-09-18 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Oliver Hunt.
+
+ Gradient: Pre-reserve space for 2 color stops
+ https://bugs.webkit.org/show_bug.cgi?id=46044
+
+ Most gradients have only 2 color stops, pre-reserve space for these in m_stops
+ to avoid growing the vector dynamically in the common case.
+
+ * platform/graphics/Gradient.h:
+
+2010-09-18 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, rolling out r67792.
+ http://trac.webkit.org/changeset/67792
+ https://bugs.webkit.org/show_bug.cgi?id=45976
+
+ Broke over a hundred SVG tests.
+
+ * platform/graphics/GraphicsContext.cpp:
+ (WebCore::GraphicsContext::drawImage):
+ (WebCore::GraphicsContext::drawImageBuffer):
+ * platform/graphics/GraphicsContext.h:
+
+2010-09-18 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ webkitAnimationEnd event doesn't fire when skipping over final iteration
+ https://bugs.webkit.org/show_bug.cgi?id=46010
+
+ It's possible for AnimationBase::fireAnimationEventsIfNeeded to decide
+ that the animation is ended while we're in the looping state, if the
+ animation timer never fires during an iteration. That then fails the
+ assert in AnimationBase::updateStateMachine (we don't expect
+ AnimationStateInputEndTimerFired while in the looping state). Jump the
+ state to AnimationStateEnding, which is more accurate.
+
+ Test: animations/animation-end-event-short-iterations.html
+
+ * page/animation/AnimationBase.cpp:
+ (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
+
+2010-09-18 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Andreas Kling.
+
+ [BREWMP] Wrong key code type in keyIdentifierForBrewKeyCode
+ https://bugs.webkit.org/show_bug.cgi?id=46005
+
+ The type of key code in Brew MP is uint16. Take uint16 instead of int16 in keyIdentifierForBrewKeyCode.
+
+ * platform/brew/PlatformKeyboardEventBrew.cpp:
+ (WebCore::keyIdentifierForBrewKeyCode):
+
+2010-09-18 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Canvas drawImage with source or destination widths/heights of -1 renders incorrectly.
+ https://bugs.webkit.org/show_bug.cgi?id=45976
+
+ Specifying a -1 width or height for either the source or destination rectangle in drawImage
+ get improperly drawn with -1 replaced as the corresponding image width or height. This was because
+ the value -1 was being passed around to signal non-specified widths and heights and thus was
+ interpreted lower down in the drawImage implementation which disallowed any calls that actually
+ wanted to use -1 as the widths or heights. Fixed this by moving the default logic up and not using
+ -1 in-band signaling to denote default behavior.
+
+ Tests: canvas/philip/tests/2d.drawImage.negativeOneDest.html
+ canvas/philip/tests/2d.drawImage.negativeOneSource.html
+
+ * platform/graphics/GraphicsContext.cpp: Removed -1 in-band signals and replaced cascased calls to have
+ the desired replaces for unspecified widths and heights earlier on.
+ * platform/graphics/GraphicsContext.h: Removed faulty default value.
+
+2010-09-18 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Enable Platform Strategies on Qt
+
+ [Qt] Turn on PLATFORM_STRATEGIES
+ https://bugs.webkit.org/show_bug.cgi?id=45831
+
+ * WebCore.pro: Adding/removing implementation files
+ * platform/qt/Language.cpp: Added, WebCore::defaultLanguage() was
+ moved from platform/qt/Localizations.cpp
+ (WebCore::defaultLanguage): Moved from Localizations.cpp
+ * platform/qt/Localizations.cpp: Removed (code is now inside
+ WebCoreSupport/WebPlatformStrategies.cpp)
+ * plugins/qt/PluginDataQt.cpp: Removed (idem)
+
+2010-09-18 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Darin Adler.
+
+ Rename Wince files to WinCE
+ https://bugs.webkit.org/show_bug.cgi?id=37287
+
+ * loader/icon/wince/IconDatabaseWinCE.cpp: Copied from WebCore/loader/icon/wince/IconDatabaseWince.cpp.
+ * loader/icon/wince/IconDatabaseWince.cpp: Removed.
+ * page/wince/FrameWinCE.cpp: Copied from WebCore/page/wince/FrameWince.cpp.
+ * page/wince/FrameWince.cpp: Removed.
+ * platform/graphics/MediaPlayer.cpp:
+ * platform/graphics/wince/ColorWinCE.cpp: Copied from WebCore/platform/graphics/wince/ColorWince.cpp.
+ * platform/graphics/wince/ColorWince.cpp: Removed.
+ * platform/graphics/wince/FontCacheWinCE.cpp: Copied from WebCore/platform/graphics/wince/FontCacheWince.cpp.
+ * platform/graphics/wince/FontCacheWince.cpp: Removed.
+ * platform/graphics/wince/FontWinCE.cpp: Copied from WebCore/platform/graphics/wince/FontWince.cpp.
+ * platform/graphics/wince/FontWince.cpp: Removed.
+ * platform/graphics/wince/GlyphPageTreeNodeWinCE.cpp: Copied from WebCore/platform/graphics/wince/GlyphPageTreeNodeWince.cpp.
+ * platform/graphics/wince/GlyphPageTreeNodeWince.cpp: Removed.
+ * platform/graphics/wince/GradientWinCE.cpp: Copied from WebCore/platform/graphics/wince/GradientWince.cpp.
+ * platform/graphics/wince/GradientWince.cpp: Removed.
+ * platform/graphics/wince/GraphicsContextWinCE.cpp: Copied from WebCore/platform/graphics/wince/GraphicsContextWince.cpp.
+ * platform/graphics/wince/GraphicsContextWince.cpp: Removed.
+ * platform/graphics/wince/ImageBufferWinCE.cpp: Copied from WebCore/platform/graphics/wince/ImageBufferWince.cpp.
+ * platform/graphics/wince/ImageBufferWince.cpp: Removed.
+ * platform/graphics/wince/MediaPlayerPrivateWinCE.h: Copied from WebCore/platform/graphics/wince/MediaPlayerPrivateWince.h.
+ * platform/graphics/wince/MediaPlayerPrivateWince.h: Removed.
+ * platform/graphics/wince/PathWinCE.cpp: Copied from WebCore/platform/graphics/wince/PathWince.cpp.
+ * platform/graphics/wince/PathWince.cpp: Removed.
+ * platform/graphics/wince/PlatformPathWinCE.cpp: Copied from WebCore/platform/graphics/wince/PlatformPathWince.cpp.
+ * platform/graphics/wince/PlatformPathWinCE.h: Copied from WebCore/platform/graphics/wince/PlatformPathWince.h.
+ * platform/graphics/wince/PlatformPathWince.cpp: Removed.
+ * platform/graphics/wince/PlatformPathWince.h: Removed.
+ * platform/graphics/wince/SimpleFontDataWinCE.cpp: Copied from WebCore/platform/graphics/wince/SimpleFontDataWince.cpp.
+ * platform/graphics/wince/SimpleFontDataWince.cpp: Removed.
+ * platform/graphics/wince/WinCEGraphicsExtras.h: Copied from WebCore/platform/graphics/wince/WinceGraphicsExtras.h.
+ * platform/graphics/wince/WinceGraphicsExtras.h: Removed.
+ * platform/text/wince/TextBoundariesWinCE.cpp: Copied from WebCore/platform/text/wince/TextBoundariesWince.cpp.
+ * platform/text/wince/TextBoundariesWince.cpp: Removed.
+ * platform/text/wince/TextBreakIteratorWinCE.cpp: Copied from WebCore/platform/text/wince/TextBreakIteratorWince.cpp.
+ * platform/text/wince/TextBreakIteratorWince.cpp: Removed.
+ * platform/wince/CursorWinCE.cpp: Copied from WebCore/platform/wince/CursorWince.cpp.
+ * platform/wince/CursorWince.cpp: Removed.
+ * platform/wince/DragDataWinCE.cpp: Copied from WebCore/platform/wince/DragDataWince.cpp.
+ * platform/wince/DragDataWince.cpp: Removed.
+ * platform/wince/DragImageWinCE.cpp: Copied from WebCore/platform/wince/DragImageWince.cpp.
+ * platform/wince/DragImageWince.cpp: Removed.
+ * platform/wince/EditorWinCE.cpp: Copied from WebCore/platform/wince/EditorWince.cpp.
+ (WebCore::Editor::newGeneralClipboard):
+ * platform/wince/EditorWince.cpp: Removed.
+ * platform/wince/FileChooserWinCE.cpp: Copied from WebCore/platform/wince/FileChooserWince.cpp.
+ * platform/wince/FileChooserWince.cpp: Removed.
+ * platform/wince/FileSystemWinCE.cpp: Copied from WebCore/platform/wince/FileSystemWince.cpp.
+ * platform/wince/FileSystemWince.cpp: Removed.
+ * platform/wince/KURLWinCE.cpp: Copied from WebCore/platform/wince/KURLWince.cpp.
+ * platform/wince/KURLWince.cpp: Removed.
+ * platform/wince/KeygenWinCE.cpp: Copied from WebCore/platform/wince/KeygenWince.cpp.
+ * platform/wince/KeygenWince.cpp: Removed.
+ * platform/wince/MIMETypeRegistryWinCE.cpp: Copied from WebCore/platform/wince/MIMETypeRegistryWince.cpp.
+ * platform/wince/MIMETypeRegistryWince.cpp: Removed.
+ * platform/wince/PasteboardWinCE.cpp: Copied from WebCore/platform/wince/PasteboardWince.cpp.
+ * platform/wince/PasteboardWince.cpp: Removed.
+ * platform/wince/SearchPopupMenuWinCE.cpp: Copied from WebCore/platform/wince/SearchPopupMenuWince.cpp.
+ * platform/wince/SearchPopupMenuWince.cpp: Removed.
+ * platform/wince/SharedTimerWinCE.cpp: Copied from WebCore/platform/wince/SharedTimerWince.cpp.
+ * platform/wince/SharedTimerWince.cpp: Removed.
+ * rendering/RenderThemeWinCE.cpp: Copied from WebCore/rendering/RenderThemeWince.cpp.
+ (WebCore::RenderThemeWinCE::create):
+ (WebCore::RenderTheme::themeForPage):
+ (WebCore::RenderThemeWinCE::RenderThemeWinCE):
+ (WebCore::RenderThemeWinCE::~RenderThemeWinCE):
+ (WebCore::RenderThemeWinCE::platformActiveSelectionBackgroundColor):
+ (WebCore::RenderThemeWinCE::platformInactiveSelectionBackgroundColor):
+ (WebCore::RenderThemeWinCE::platformActiveSelectionForegroundColor):
+ (WebCore::RenderThemeWinCE::platformInactiveSelectionForegroundColor):
+ (WebCore::RenderThemeWinCE::supportsFocus):
+ (WebCore::RenderThemeWinCE::supportsFocusRing):
+ (WebCore::RenderThemeWinCE::determineClassicState):
+ (WebCore::RenderThemeWinCE::getThemeData):
+ (WebCore::RenderThemeWinCE::paintButton):
+ (WebCore::RenderThemeWinCE::setCheckboxSize):
+ (WebCore::RenderThemeWinCE::paintTextField):
+ (WebCore::RenderThemeWinCE::adjustMenuListStyle):
+ (WebCore::RenderThemeWinCE::paintMenuList):
+ (WebCore::RenderThemeWinCE::paintMenuListButton):
+ (WebCore::RenderThemeWinCE::systemFont):
+ (WebCore::RenderThemeWinCE::themeChanged):
+ (WebCore::RenderThemeWinCE::extraDefaultStyleSheet):
+ (WebCore::RenderThemeWinCE::extraQuirksStyleSheet):
+ (WebCore::RenderThemeWinCE::supportsHover):
+ (WebCore::RenderThemeWinCE::systemColor):
+ (WebCore::RenderThemeWinCE::adjustSliderThumbSize):
+ (WebCore::RenderThemeWinCE::adjustButtonInnerStyle):
+ (WebCore::RenderThemeWinCE::adjustSearchFieldStyle):
+ (WebCore::RenderThemeWinCE::paintSearchField):
+ (WebCore::RenderThemeWinCE::paintSearchFieldCancelButton):
+ (WebCore::RenderThemeWinCE::adjustSearchFieldCancelButtonStyle):
+ (WebCore::RenderThemeWinCE::adjustSearchFieldDecorationStyle):
+ (WebCore::RenderThemeWinCE::adjustSearchFieldResultsDecorationStyle):
+ (WebCore::RenderThemeWinCE::paintSearchFieldResultsDecoration):
+ (WebCore::RenderThemeWinCE::adjustSearchFieldResultsButtonStyle):
+ (WebCore::RenderThemeWinCE::paintSearchFieldResultsButton):
+ (WebCore::RenderThemeWinCE::adjustMenuListButtonStyle):
+ (WebCore::RenderThemeWinCE::paintSliderTrack):
+ (WebCore::RenderThemeWinCE::paintSliderThumb):
+ (WebCore::RenderThemeWinCE::paintMediaFullscreenButton):
+ (WebCore::RenderThemeWinCE::paintMediaMuteButton):
+ (WebCore::RenderThemeWinCE::paintMediaPlayButton):
+ (WebCore::RenderThemeWinCE::paintMediaSeekBackButton):
+ (WebCore::RenderThemeWinCE::paintMediaSeekForwardButton):
+ (WebCore::RenderThemeWinCE::paintMediaSliderTrack):
+ (WebCore::RenderThemeWinCE::paintMediaSliderThumb):
+ * rendering/RenderThemeWinCE.h: Copied from WebCore/rendering/RenderThemeWince.h.
+ * rendering/RenderThemeWince.cpp: Removed.
+ * rendering/RenderThemeWince.h: Removed.
+ * storage/wince/DatabaseThreadWinCE.cpp: Copied from WebCore/storage/wince/DatabaseThreadWince.cpp.
+ * storage/wince/DatabaseThreadWinCE.h: Copied from WebCore/storage/wince/DatabaseThreadWince.h.
+ * storage/wince/DatabaseThreadWince.cpp: Removed.
+ * storage/wince/DatabaseThreadWince.h: Removed.
+ * storage/wince/LocalStorageThreadWinCE.cpp: Copied from WebCore/storage/wince/LocalStorageThreadWince.cpp.
+ * storage/wince/LocalStorageThreadWinCE.h: Copied from WebCore/storage/wince/LocalStorageThreadWince.h.
+ * storage/wince/LocalStorageThreadWince.cpp: Removed.
+ * storage/wince/LocalStorageThreadWince.h: Removed.
+
+2010-09-18 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Eric Seidel.
+
+ Move Plugin*None.cpp from CMakeLists.txt into CMakeListsEfl.txt
+ https://bugs.webkit.org/show_bug.cgi?id=45900
+
+ PluginDataNone.cpp and PluginViewNone.cpp are not used by all port.
+ Move them into plaform sepcific build system.
+
+ * CMakeLists.txt:
+ * CMakeListsEfl.txt:
+
+2010-09-18 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Don't copy clip path to TransparencyLayer
+ https://bugs.webkit.org/show_bug.cgi?id=45965
+
+ We don't need to copy the GC's clip path to the TransparencyLayer since it will
+ clip anyway when ending the layer.
+
+ * platform/graphics/qt/TransparencyLayer.h:
+ (WebCore::TransparencyLayer::TransparencyLayer):
+
+2010-09-18 Patrick Gansterer <paroga@paroga.com>
+
+ Unreviewed.
+
+ [WINCE] Buildfix for FrameWince.cpp after r51353, r67762 and r67771.
+
+ * page/wince/FrameWince.cpp:
+ (WebCore::computePageRectsForFrame):
+ (WebCore::imageFromSelection):
+
+2010-09-18 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, a trivial change.
+
+ Run sort-Xcode-project-file.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2010-09-18 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Eric Seidel.
+
+ REGRESSION (r67762): Over 160 layout tests failing due to incorrect zoom factors in subframes
+ https://bugs.webkit.org/show_bug.cgi?id=46031
+
+ * page/Frame.cpp:
+ (WebCore::parentPageZoomFactor): Return the zoom factor of the parent frame.
+ (WebCore::parentTextZoomFactor): Ditto.
+
+2010-09-17 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Jon Honeycutt.
+
+ Need a way to load data (as plain text) in a WKPage
+ <rdar://problem/8424239>
+
+ * WebCore.exp.in:
+
+2010-09-17 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46027, image on gamespot.com paginates without bringing its enclosing border along.
+
+ Make sure that unsplittable objects like replaced elements propagate their pagination strut outward to the parent block
+ when appropriate. An image on a line did this, but a block-level image did not.
+
+ Added fast/multicol/image-inside-nested-blocks-with-border.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::layoutBlockChild):
+
+2010-09-17 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, build fix.
+
+ Move calls from frameView->pageZoomFactor() to frame->pageZoomFactor().
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleTouchEvent): Removed a helper function,
+ added direct calls to frame->pageZoomFactor().
+
+2010-09-17 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45993, convert printing to the new pagination model.
+
+ Make printing store the page height in the RenderView and push that into the layout state to
+ use the new pagination model. The old pagination model is retained because it is still used
+ for embedded WebViews.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::reset):
+ (WebCore::FrameView::layout):
+ (WebCore::FrameView::forceLayout):
+ (WebCore::FrameView::forceLayoutForPagination):
+ (WebCore::FrameView::adjustPageHeight):
+ * page/FrameView.h:
+ * page/PrintContext.cpp:
+ (WebCore::PrintContext::computePageRectsWithPageSizeInternal):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintChildren):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::calcHeight):
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::paintReplaced):
+ * rendering/RenderLineBoxList.cpp:
+ (WebCore::RenderLineBoxList::paint):
+ * rendering/RenderVideo.cpp:
+ (WebCore::RenderVideo::paintReplaced):
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::RenderView):
+ (WebCore::RenderView::layout):
+ (WebCore::RenderView::paint):
+ (WebCore::RenderView::setBestTruncatedAt):
+ * rendering/RenderView.h:
+ (WebCore::RenderView::popLayoutState):
+ (WebCore::RenderView::pageHeight):
+ (WebCore::RenderView::setPageHeight):
+ (WebCore::RenderView::bestTruncatedAt):
+ (WebCore::RenderView::truncatedAt):
+ (WebCore::RenderView::setTruncatedAt):
+ (WebCore::RenderView::printRect):
+ (WebCore::RenderView::setPrintRect):
+ (WebCore::RenderView::pushLayoutState):
+ (WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
+ (WebCore::LayoutStateMaintainer::push):
+ (WebCore::LayoutStateMaintainer::pop):
+
+2010-09-17 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Canvas sizing ignores intrinsic size
+ https://bugs.webkit.org/show_bug.cgi?id=46024
+
+ Updated fast/replaced/table-percent-height.html
+
+ * rendering/RenderEmbeddedObject.cpp:
+ (WebCore::RenderEmbeddedObject::RenderEmbeddedObject): If this is used as a proxy
+ for <video>, behave like it has an intrinsic size (e.g. preserve aspect ratio when
+ width is auto and height is specified).
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::calcAspectRatioWidth): Changed to explicitly invoke
+ RenderBox::calcReplacedHeight(), now that RenderReplaced has its own implementation
+ which we don’t want.
+ (WebCore::RenderImage::calcAspectRatioHeight): Similarly with calcReplacedWidth().
+ * rendering/RenderImage.h:
+ * rendering/RenderReplaced.cpp:
+ (WebCore::RenderReplaced::RenderReplaced): Initialize m_hasIntrinsicSize.
+ (WebCore::lengthIsSpecified): Added this helper function, based on RenderImage’s
+ is{Width,Height}Specified().
+ (WebCore::RenderReplaced::calcReplacedWidth): Moved from RenderVideo all the way
+ up here so other replaced objects could use this logic.
+ (WebCore::RenderReplaced::calcReplacedHeight): Ditto.
+ (WebCore::RenderReplaced::calcAspectRatioWidth): Ditto.
+ (WebCore::RenderReplaced::calcAspectRatioHeight): Ditto.
+ (WebCore::RenderReplaced::calcPrefWidths): Replaced with the RenderImage version
+ of the logic.
+ (WebCore::RenderReplaced::setIntrinsicSize): Added an assertion.
+ * rendering/RenderReplaced.h:
+ (WebCore::RenderReplaced::minimumReplacedHeight): Promoted from private to protected
+ to allow RenderVideo to call through.
+ (WebCore::RenderReplaced::setHasIntrinsicSize): Added this setter.
+ * rendering/RenderVideo.cpp:
+ (WebCore::RenderVideo::updateIntrinsicSize): Factor zoom into the intrinsic size,
+ the way other RenderReplaced objects do.
+ (WebCore::RenderVideo::calcReplacedWidth): Invoke the RenderReplaced implementation,
+ which matches what used to be here, skipping over the RenderImage implementation.
+ (WebCore::RenderVideo::calcReplacedHeight): Ditto.
+ (WebCore::RenderVideo::minimumReplacedHeight): Ditto.
+ * rendering/RenderVideo.h:
+
+2010-09-17 Darin Adler <darin@apple.com>
+
+ Build fix for platforms that compile Touch.
+
+ * dom/Touch.cpp:
+ (WebCore::contentsX):
+ (WebCore::contentsY):
+ Get zoom factor from Frame rather than FrameView.
+
+2010-09-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ REGRESSION (r60104): Zoom level is unexpectedly reset on page reload
+ https://bugs.webkit.org/show_bug.cgi?id=42863
+
+ Moved zoom level back from FrameView to Frame.
+ I had forgotten that FrameView's lifetime is much shorter than
+ Frame's, and until that is fixed it's best to leave this on Frame.
+
+ * WebCore.exp.in: Updated.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::styleForDocument):
+ (WebCore::CSSStyleSelector::applyProperty):
+ (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
+ * dom/Document.cpp:
+ (WebCore::Document::nodesFromRect):
+ (WebCore::Document::elementFromPoint):
+ (WebCore::Document::caretRangeFromPoint):
+ * dom/MouseRelatedEvent.cpp:
+ (WebCore::contentsX):
+ (WebCore::contentsY):
+ (WebCore::pageZoomFactor):
+ * dom/Node.cpp:
+ (WebCore::Node::dispatchMouseEvent):
+ (WebCore::Node::dispatchWheelEvent):
+ * html/HTMLBodyElement.cpp:
+ (WebCore::adjustForZoom):
+ (WebCore::HTMLBodyElement::scrollLeft):
+ (WebCore::HTMLBodyElement::setScrollLeft):
+ (WebCore::HTMLBodyElement::scrollTop):
+ (WebCore::HTMLBodyElement::setScrollTop):
+ (WebCore::HTMLBodyElement::scrollHeight):
+ (WebCore::HTMLBodyElement::scrollWidth):
+ * html/ImageDocument.cpp:
+ (WebCore::pageZoomFactor):
+ (WebCore::ImageDocument::scale):
+ (WebCore::ImageDocument::imageFitsInWindow):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::innerHeight):
+ (WebCore::DOMWindow::innerWidth):
+ (WebCore::DOMWindow::scrollX):
+ (WebCore::DOMWindow::scrollY):
+ (WebCore::DOMWindow::scrollTo):
+ * page/DragController.cpp:
+ (WebCore::elementUnderMouse):
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::zoomFactor):
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::currentScale):
+ (WebCore::SVGSVGElement::setCurrentScale):
+ Get zoom factor from Frame rather than FrameView.
+
+ * page/Frame.cpp:
+ (WebCore::parentPageZoomFactor): Moved back here from FrameView.
+ (WebCore::parentTextZoomFactor): Ditto.
+ (WebCore::Frame::Frame): Ditto.
+ (WebCore::Frame::setPageZoomFactor): Ditto.
+ (WebCore::Frame::setTextZoomFactor): Ditto.
+ (WebCore::Frame::setPageAndTextZoomFactors): Ditto.
+
+ * page/Frame.h: Moved functions and data for zooming back here
+ from FrameView.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::FrameView):
+ * page/FrameView.h:
+ Removed code from here.
+
+2010-09-17 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Reduce minimum DOMTimer interval
+ https://bugs.webkit.org/show_bug.cgi?id=45362
+
+ Reduced the minimum allowed DOMTimer interval to 4ms. This has us matching Chrome,
+ which hasn't had any problem with 4ms in the past 2 years, as well as increasing our
+ performance on perf tests that have tight frequent loops such as canvas "animation"
+ performance tests.
+
+ No new tests added. Can't reliably instrument a test in javascript to verify that
+ the minimum clamped interval time is in fact 4ms.
+
+ * WebCore.exp.in:
+ * page/DOMTimer.cpp: Removed old comments.
+ * page/DOMTimer.h: Removed old comments.
+ * page/Settings.cpp: Exposted new method to set minimum DOMTimer interval.
+ * page/Settings.h:
+
+2010-09-17 Marc-Antoine Ruel <maruel@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [Chromium] Split webcore_platform off webcore_remaining
+
+ Further reduce webcore_remaining size by moving platform/ code in its
+ own static libary.
+ https://bugs.webkit.org/show_bug.cgi?id=45915
+
+ * WebCore.gyp/WebCore.gyp:
+
+2010-09-13 Matt Perry <mpcomplete@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Have V8DOMWindowShell ask the embedder whether to run a V8 extension
+ in a particular script context.
+ https://bugs.webkit.org/show_bug.cgi?id=45721
+
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::V8DOMWindowShell::createNewContext):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::registeredExtensionWithV8):
+ (WebCore::V8Proxy::registerExtension):
+ * bindings/v8/V8Proxy.h:
+ * loader/EmptyClients.h:
+ (WebCore::EmptyFrameLoaderClient::allowScriptExtension):
+ * loader/FrameLoaderClient.h:
+
+2010-09-17 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ REGRESSION (r66711): Plug-in replacement text is never shown
+ https://bugs.webkit.org/show_bug.cgi?id=45997
+ <rdar://problem/8446766>
+
+ Don't return when the plug-in has replacement text.
+
+ * rendering/RenderEmbeddedObject.cpp:
+ (WebCore::RenderEmbeddedObject::paintReplaced):
+
+2010-09-17 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Unreviewed, build fix. Add files missed in r67704.
+
+ * CMakeLists.txt:
+
+2010-09-17 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Chris Marrin.
+
+ Remove scroll and clip layers for WKCACFLayerRenderer
+ https://bugs.webkit.org/show_bug.cgi?id=45922
+
+ WKCACFLayerRenderer no longer needs its own layers for managing scrolling
+ and clipping, because RenderLayerCompositor provides this functionality.
+
+ * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
+ (WebCore::MediaPlayerPrivateFullscreenWindow::setRootChildLayer): Remove call to setScrollFrame().
+ (WebCore::MediaPlayerPrivateFullscreenWindow::wndProc): Ditto.
+
+ * platform/graphics/win/WKCACFLayerRenderer.cpp: Remove references to scroll and clip layers
+ (WebCore::WKCACFLayerRenderer::WKCACFLayerRenderer):
+ (WebCore::WKCACFLayerRenderer::setRootChildLayer):
+ (WebCore::WKCACFLayerRenderer::destroyRenderer):
+ (WebCore::WKCACFLayerRenderer::resize):
+ * platform/graphics/win/WKCACFLayerRenderer.h:
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::layerTreeAsText): Dump the layers from the root platform layer.
+ (WebCore::RenderLayerCompositor::requiresScrollLayer): On Windows,
+ always say yes.
+
+2010-09-17 Jian Li <jianli@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ createBlobURL with no argument causes crash.
+ https://bugs.webkit.org/show_bug.cgi?id=45880
+
+ The fix is to check if the passing blob argument is NULL or not.
+
+ Test: fast/files/create-blob-url-crash.html
+
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::createPublicBlobURL):
+ * page/DOMWindow.idl: Add attribute to convert null string to undefined.
+
+2010-09-17 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Add WebKitAccelerated2dCanvasEnabled flag to WebKit for Mac
+ https://bugs.webkit.org/show_bug.cgi?id=45911
+
+ * WebCore.exp.in:
+
+2010-09-17 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ ASSERTION FAILED: m_loadEventDelayCount
+ https://bugs.webkit.org/show_bug.cgi?id=45790
+
+ * dom/AsyncScriptRunner.cpp:
+ (WebCore::AsyncScriptRunner::timerFired): Protect document before we go running scripts.
+
+2010-09-17 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ [CHROMIUM] GPU-accelerated canvas should work in test_shell.
+ https://bugs.webkit.org/show_bug.cgi?id=45968
+
+ In order for the shaders in GPU-accelerated canvas to work in both the
+ GraphicsContext3D / GLES2 path as well as chromium's test_shell (which
+ passes them to the Mesa backend unmodified), the precision specifiers
+ in the fragment shader have to be wrapped in #if GL_ES.
+
+ Soon to be covered by many layout tests.
+
+ * platform/graphics/gpu/SolidFillShader.cpp:
+ (WebCore::SolidFillShader::create):
+ * platform/graphics/gpu/TexShader.cpp:
+ (WebCore::TexShader::create):
+
+2010-09-17 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] [REGRESSION] Listbox rendering is incorrect
+ https://bugs.webkit.org/show_bug.cgi?id=45941
+
+ Only apply the shadow tiling optimization to a layer if the GraphicsContext
+ has a shadow.
+
+ This is covered by manual-tests/select-element-type-select.html.
+
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::drawBorderlessRectShadow): Before applying the tiled shadow optimization
+ first check to see if the context has a shadow at all.
+
+2010-09-17 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Oliver Hunt.
+
+ [GTK] FontPlatformDataFreeType should use smart pointers to hold its members
+ https://bugs.webkit.org/show_bug.cgi?id=45917
+
+ Have FontPlatformDataFreeType use smart pointers to hold its reference-counted
+ members. Also move the FcPattern specialization from OwnPtrCairo to PlatformRefPtrCairo
+ as this type is reference-counted.
+
+ No new tests as this should not introduce any functionality changes.
+
+ * platform/graphics/cairo/FontCacheFreeType.cpp:
+ (WebCore::FontCache::getFontDataForCharacters): Updated to reflect smart pointer changes.
+ (WebCore::FontCache::createFontPlatformData): Ditto.
+ * platform/graphics/cairo/FontPlatformDataFreeType.cpp:
+ (WebCore::FontPlatformData::FontPlatformData): Ditto.
+ (WebCore::FontPlatformData::operator=): Ditto.
+ (WebCore::FontPlatformData::~FontPlatformData): Ditto.
+ (WebCore::FontPlatformData::isFixedPitch): Ditto.
+ (WebCore::FontPlatformData::operator==): Ditto.
+ * platform/graphics/cairo/FontPlatformDataFreeType.h:
+ (WebCore::FontPlatformData::FontPlatformData): Ditto.
+ (WebCore::FontPlatformData::scaledFont): Ditto.
+ (WebCore::FontPlatformData::hash): Ditto.
+ (WebCore::FontPlatformData::isHashTableDeletedValue): Ditto.
+ * platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp:
+ (WebCore::GlyphPage::fill): Ditto.
+ * platform/graphics/cairo/OwnPtrCairo.cpp: Removed FcPattern specialization.
+ * platform/graphics/cairo/OwnPtrCairo.h: Ditto.
+ * platform/graphics/cairo/PlatformRefPtrCairo.cpp: Added FcPattern and cairo_scaled_font_t specializations.
+ (WTF::refPlatformPtr): Ditto.
+ (WTF::derefPlatformPtr): Ditto.
+ * platform/graphics/cairo/PlatformRefPtrCairo.h: Ditto.
+ * platform/graphics/cairo/SimpleFontDataCairo.cpp:
+ (WebCore::SimpleFontData::platformInit): Updated to reflect smart pointer changes.
+ (WebCore::SimpleFontData::containsCharacters): Ditto.
+ (WebCore::SimpleFontData::platformWidthForGlyph): Ditto.
+ * platform/graphics/gtk/FontGtk.cpp:
+ (WebCore::setPangoAttributes): Ditto.
+
+2010-09-14 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: show status message below call stack when debugger is paused on DOM breakpoint
+ https://bugs.webkit.org/show_bug.cgi?id=45114
+
+ * English.lproj/localizedStrings.js:
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::performSearch):
+ (WebCore::InspectorDOMAgent::shouldBreakOnNodeInsertion):
+ (WebCore::InspectorDOMAgent::shouldBreakOnNodeRemoval):
+ (WebCore::InspectorDOMAgent::shouldBreakOnAttributeModification):
+ (WebCore::InspectorDOMAgent::descriptionForDOMEvent):
+ * inspector/InspectorDOMAgent.h:
+ * inspector/InspectorDebuggerAgent.cpp:
+ (WebCore::InspectorDebuggerAgent::didPause):
+ * inspector/front-end/CallStackSidebarPane.js:
+ (WebInspector.CallStackSidebarPane):
+ (WebInspector.CallStackSidebarPane.prototype.updateStatus.formatters.s):
+ (WebInspector.CallStackSidebarPane.prototype.updateStatus.append):
+ (WebInspector.CallStackSidebarPane.prototype.updateStatus):
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype.linkifyNodeById):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.debuggerPaused):
+ * inspector/front-end/inspector.css:
+ (.pane > .body .placard + .info):
+ * inspector/front-end/inspector.js:
+ (WebInspector.pausedScript):
+ (WebInspector.formatLocalized):
+
+2010-09-17 Johnny Ding <jnd@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Stop history reload navigation to bypass WebKit's popup blocker.
+ Now history reload can only navigate the page in self frame, no matter
+ what target frame is defined in <base> and no new window can be created.
+ https://bugs.webkit.org/show_bug.cgi?id=45369
+
+ Test: fast/events/popup-blocked-from-history-reload.html
+
+ * loader/RedirectScheduler.cpp:
+ (WebCore::ScheduledNavigation::ScheduledNavigation):
+ (WebCore::ScheduledNavigation::wasUserGesture):
+ Move the m_wasUserGesture to base class ScheduledNavigation. Then all
+ asynchronous navigation situations can restore the correct gesture state
+ during the real navigation process.
+ (WebCore::ScheduledURLNavigation::ScheduledURLNavigation):
+ (WebCore::ScheduledURLNavigation::fire):
+ (WebCore::ScheduledURLNavigation::referrer):
+ (WebCore::ScheduledHistoryNavigation::ScheduledHistoryNavigation):
+ (WebCore::ScheduledHistoryNavigation::fire):
+ (WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
+ (WebCore::ScheduledFormSubmission::fire):
+ (WebCore::RedirectScheduler::scheduleHistoryNavigation):
+
+2010-09-16 Vangelis Kokkevis <vangelis@chromium.org>
+
+ Reviewed by James Robinson.
+
+ [chromium] Clip the update region of an ImageLayerChromium to actual size
+ of the image bitmap to prevent uninitialized memory access when uploading
+ the dirty region to the texture.
+ https://bugs.webkit.org/show_bug.cgi?id=45937
+
+
+ * platform/graphics/chromium/ImageLayerChromium.cpp:
+ (WebCore::ImageLayerChromium::updateContents):
+
+2010-09-17 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by David Hyatt.
+
+ Remove extraneous RenderObject traversal.
+ https://bugs.webkit.org/show_bug.cgi?id=45821
+
+ This code always exits in the first iteration of the loop,
+ because in the context of this call, node->renderer()->node() != 0
+ is always true.
+
+ No behavior change, covered by existing tests.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::canMouseDownStartSelect): Removed the loop.
+ (WebCore::EventHandler::canMouseDragExtendSelect): Ditto.
+
+2010-09-17 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: FrameLoader::loadedResourceFromMemoryCache reports
+ resource as not cached to InspectorController.
+ https://bugs.webkit.org/show_bug.cgi?id=45961
+
+ Web Inspector: FrameLoader::loadedResourceFromMemoryCache reports
+ resource as not cached to InspectorController.
+ There is one path in control flow that leads to resources being
+ reported as not cached. Patch to follow.
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::markResourceAsCached):
+ * inspector/InspectorController.h:
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::markAsCached):
+ (WebCore::InspectorResource::updateResponse):
+ * inspector/InspectorResource.h:
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::loadedResourceFromMemoryCache):
+
+2010-09-17 Alexander Pavlov <apavlov@chromium.org>
+
+ Unreviewed, build fix. Add files missed in the previous commit.
+
+ * GNUmakefile.am:
+ * css/CSSPropertySourceData.cpp: Added.
+ (WebCore::SourceRange::SourceRange):
+ (WebCore::SourceRange::operator=):
+ (WebCore::CSSPropertySourceData::CSSPropertySourceData):
+ (WebCore::CSSPropertySourceData::operator=):
+ (WebCore::CSSPropertySourceData::toString):
+ (WebCore::CSSPropertySourceData::hash):
+ (WebCore::CSSPropertySourceData::init):
+ * css/CSSPropertySourceData.h: Added.
+ (WebCore::CSSPropertySourceData::~CSSPropertySourceData):
+ (WebCore::CSSStyleSourceData::create):
+
+2010-09-15 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Provide source-based properties for style declarations to CSSParser clients
+
+ This change:
+ - Enables InspectorCSSStore to extract CSS stylesheet text for all source-based stylesheets,
+ even with the resource tracking turned off.
+ - Adds to CSSParser a capability of source-related style declaration data extraction:
+ * Start/end source offsets for a declaration, relative to the parent stylesheet start or the "style" attribute value.
+ * Start/end source offsets for CSS properties, relative to the declaration start.
+ * CSS property data: name, value, priority, WebCore parsability (i.e. if the property is understood by WebCore).
+ - Provides the extracted data to the WebInspector frontend via InspectorDOMAgent::getStyleSourceData().
+ https://bugs.webkit.org/show_bug.cgi?id=44949
+
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSGrammar.y:
+ * css/CSSMutableStyleDeclaration.h:
+ (WebCore::CSSMutableStyleDeclaration::node):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::CSSParser):
+ (WebCore::CSSParser::parseSheet):
+ (WebCore::CSSParser::parseDeclaration):
+ (WebCore::CSSParser::createStyleRule):
+ (WebCore::CSSParser::markRuleBodyStart):
+ (WebCore::CSSParser::markPropertyStart):
+ (WebCore::CSSParser::markPropertyEnd):
+ * css/CSSParser.h:
+ (WebCore::CSSParser::resetPropertyMarks):
+ * css/CSSPropertySourceData.cpp: Added.
+ (WebCore::SourceRange::SourceRange):
+ (WebCore::SourceRange::operator=):
+ (WebCore::CSSPropertySourceData::CSSPropertySourceData):
+ (WebCore::CSSPropertySourceData::operator=):
+ (WebCore::CSSPropertySourceData::toString):
+ (WebCore::CSSPropertySourceData::hash):
+ (WebCore::CSSPropertySourceData::init):
+ * css/CSSPropertySourceData.h: Added.
+ (WebCore::CSSPropertySourceData::~CSSPropertySourceData):
+ (WebCore::CSSStyleSourceData::create):
+ * inspector/Inspector.idl:
+ * inspector/InspectorCSSStore.cpp:
+ (WebCore::InspectorCSSStore::reset):
+ (WebCore::InspectorCSSStore::styleSheetText):
+ (WebCore::InspectorCSSStore::resourceStyleSheetText):
+ (WebCore::InspectorCSSStore::inlineStyleSheetText):
+ (WebCore::InspectorCSSStore::getStyleSourceData):
+ (WebCore::InspectorCSSStore::extractRanges):
+ (WebCore::InspectorCSSStore::getStyleAttributeRanges):
+ (WebCore::InspectorCSSStore::getParentStyleSheet):
+ (WebCore::InspectorCSSStore::inlineStyleElement):
+ * inspector/InspectorCSSStore.h:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::resourceContentForURL):
+ * inspector/InspectorController.h:
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::getStyleSourceData):
+ (WebCore::InspectorDOMAgent::buildObjectForStyle):
+ * inspector/InspectorDOMAgent.h:
+
+2010-09-17 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Show node description in inspector highlight
+ https://bugs.webkit.org/show_bug.cgi?id=20930
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::drawNodeHighlight):
+ (WebCore::InspectorController::drawElementTitle):
+ * inspector/InspectorController.h:
+
+2010-09-16 takano takumi <takano1@asia.apple.com>
+
+ Reviewed by Kent Tamura.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45020
+ Support "block-flow" and "writing-mode": interpret properties into RenderStyle
+
+ Fixed a regression in SVG test introduced by my previous change.
+
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::operator EWritingMode):
+ * css/SVGCSSParser.cpp:
+ (WebCore::CSSParser::parseSVGValue):
+
+2010-09-16 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ Add entry points to GraphicsContext3D needed for Chromium compositor port
+ https://bugs.webkit.org/show_bug.cgi?id=45939
+
+ Added entry points for two Chromium-specific extensions, and added
+ a flag to the GraphicsContext3D constructor, currently unsupported
+ by all ports (including Chromium), indicating whether the context
+ should render directly to the passed HostWindow or off-screen per
+ the current semantics. The switch to use GraphicsContext3D in
+ Chromium's compositor will follow in a subsequent patch.
+
+ No new tests; functionality is unchanged. Built and tested
+ Chromium and WebKit on Mac OS X.
+
+ * platform/graphics/GraphicsContext3D.cpp:
+ (WebCore::GraphicsContext3D::supportsMapSubCHROMIUM):
+ (WebCore::GraphicsContext3D::mapBufferSubDataCHROMIUM):
+ (WebCore::GraphicsContext3D::unmapBufferSubDataCHROMIUM):
+ (WebCore::GraphicsContext3D::mapTexSubImage2DCHROMIUM):
+ (WebCore::GraphicsContext3D::unmapTexSubImage2DCHROMIUM):
+ (WebCore::GraphicsContext3D::supportsCopyTextureToParentTextureCHROMIUM):
+ (WebCore::GraphicsContext3D::copyTextureToParentTextureCHROMIUM):
+ * platform/graphics/GraphicsContext3D.h:
+ * platform/graphics/mac/GraphicsContext3DMac.mm:
+ (WebCore::GraphicsContext3D::create):
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+ * platform/graphics/qt/GraphicsContext3DQt.cpp:
+ (WebCore::GraphicsContext3D::create):
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+
+2010-09-16 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by James Robinson.
+
+ In layerTreeAsText output, avoid printing properties which have their default values
+ https://bugs.webkit.org/show_bug.cgi?id=45931
+
+ Don't dump properties that have their default values to simplify output.
+
+ * platform/graphics/GraphicsLayer.cpp:
+ (WebCore::GraphicsLayer::dumpProperties):
+
+2010-09-16 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] GraphicsContext: Remove unused variable
+
+ GraphicsContextPlatformPrivate::redirect wasn't used for anything.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContextPlatformPrivate::p):
+ (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
+
+2010-09-16 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Remove unnecessary QPainter::clipPath() call in TransparencyLayer()
+ https://bugs.webkit.org/show_bug.cgi?id=45923
+
+ QPainter::clipPath() can be very expensive, so use QPainter::hasClipping()
+ instead of QPainter::clipPath().isEmpty().
+
+ * platform/graphics/qt/TransparencyLayer.h:
+ (WebCore::TransparencyLayer::TransparencyLayer):
+
+2010-09-16 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Eric Seidel.
+
+ Fix for regression from my previous check-in. Make sure not to move the LayoutRepainter line
+ below the setHeight(0) call. This meant it snagged the wrong rectangle and we ended up repainting
+ the world.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::layoutBlock):
+
+2010-09-16 takano takumi <takano1@asia.apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45020
+ Support "block-flow" and "writing-mode": interpret properties into RenderStyle
+
+ Added code that interprets "block-flow" property and "writing-mode" property settings
+ into a RenderStyle object.
+
+ Test: fast/text/international/block-flow-parser-test.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ (WebCore::CSSPrimitiveValue::operator EBlockFlowDirection):
+ * css/CSSPropertyNames.in:
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ * css/CSSValueKeywords.in:
+ * css/SVGCSSValueKeywords.in:
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::diff):
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::setBitDefaults):
+ (WebCore::InheritedFlags::blockFlow):
+ (WebCore::InheritedFlags::setBlockFlow):
+ (WebCore::InheritedFlags::initialBlockFlow):
+ * rendering/style/RenderStyleConstants.h:
+
+2010-09-16 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Implement dissolveDragImageToFraction
+ https://bugs.webkit.org/show_bug.cgi?id=45826
+
+ Convert the drag image from a GdkPixbuf to a Cairo surface. Not only
+ might this allow code to be shared between Cairo ports it prevents a
+ full data copy when the image is not resized and makes the implementation
+ of dissolveDragImageToFraction more straight-forward.
+
+ This feature is covered by manual-tests/drag-image.html.
+
+ * page/gtk/DragControllerGtk.cpp:
+ (WebCore::DragController::maxDragImageSize): Make the maximum size of the drag
+ image a little smaller.
+ * platform/DragImage.h: Changed the drag image type to be a cairo_surface_t*.
+ * platform/gtk/DragImageGtk.cpp:
+ (WebCore::dragImageSize): Reimplemented to reflect new drag image type.
+ (WebCore::deleteDragImage): Ditto.
+ (WebCore::scaleDragImage): Ditto.
+ (WebCore::dissolveDragImageToFraction): Filled the stub of this function.
+ (WebCore::createDragImageFromImage): Reimplemented to reflect new drag image type.
+ * platform/gtk/GtkVersioning.h: Added definition for gtk_widget_get_realized for older GTK+s.
+
+2010-09-15 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38402, paginate columns at layout time rather than at paint time.
+
+ This patch adds support for column breaking at layout time rather than at paint time. New variables have been
+ added to LayoutState and to ColumnInfo to track column information while laying out.
+
+ The basic idea behind this patch is to retain the columns' paint-time hackery of transforming one long vertical strip
+ into multiple columns. Now, however, layout is aware of the columns and will move objects up and down vertically in order
+ to ensure they don't intersect a break.
+
+ Many new tests added in fast/multicol and new results added for existing fast/multicol tests.
+
+ * rendering/ColumnInfo.h:
+ (WebCore::ColumnInfo::ColumnInfo):
+ (WebCore::ColumnInfo::columnCount):
+ (WebCore::ColumnInfo::columnHeight):
+ (WebCore::ColumnInfo::setColumnCountAndHeight):
+ (WebCore::ColumnInfo::setColumnHeight):
+ (WebCore::ColumnInfo::updateMinimumColumnHeight):
+ (WebCore::ColumnInfo::minimumColumnHeight):
+ (WebCore::ColumnInfo::forcedBreaks):
+ (WebCore::ColumnInfo::forcedBreakOffset):
+ (WebCore::ColumnInfo::maximumDistanceBetweenForcedBreaks):
+ (WebCore::ColumnInfo::clearForcedBreaks):
+ (WebCore::ColumnInfo::addForcedBreak):
+ * rendering/LayoutState.cpp:
+ (WebCore::LayoutState::LayoutState):
+ (WebCore::LayoutState::clearPaginationInformation):
+ (WebCore::LayoutState::pageY):
+ (WebCore::LayoutState::addForcedColumnBreak):
+ * rendering/LayoutState.h:
+ (WebCore::LayoutState::LayoutState):
+ (WebCore::LayoutState::paginatingColumns):
+ (WebCore::LayoutState::paginated):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::RenderBlock):
+ (WebCore::RenderBlock::~RenderBlock):
+ (WebCore::RenderBlock::layoutBlock):
+ (WebCore::RenderBlock::collapseMargins):
+ (WebCore::RenderBlock::estimateVerticalPosition):
+ (WebCore::RenderBlock::layoutBlockChild):
+ (WebCore::RenderBlock::layoutPositionedObjects):
+ (WebCore::RenderBlock::paintColumnRules):
+ (WebCore::RenderBlock::paintColumnContents):
+ (WebCore::RenderBlock::paintChildren):
+ (WebCore::RenderBlock::insertFloatingObject):
+ (WebCore::RenderBlock::removeFloatingObjects):
+ (WebCore::RenderBlock::positionNewFloats):
+ (WebCore::RenderBlock::positionNewFloatOnLine):
+ (WebCore::RenderBlock::lowestPosition):
+ (WebCore::RenderBlock::rightmostPosition):
+ (WebCore::RenderBlock::leftmostPosition):
+ (WebCore::RenderBlock::markAllDescendantsWithFloatsForLayout):
+ (WebCore::RenderBlock::markDescendantBlocksAndLinesForLayout):
+ (WebCore::RenderBlock::hitTestColumns):
+ (WebCore::RenderBlock::setDesiredColumnCountAndWidth):
+ (WebCore::RenderBlock::columnCount):
+ (WebCore::RenderBlock::columnRectAt):
+ (WebCore::RenderBlock::layoutColumns):
+ (WebCore::RenderBlock::adjustPointToColumnContents):
+ (WebCore::RenderBlock::adjustRectForColumns):
+ (WebCore::RenderBlock::adjustForColumns):
+ (WebCore::RenderBlock::setMaxTopMargins):
+ (WebCore::RenderBlock::setMaxBottomMargins):
+ (WebCore::RenderBlock::setPaginationStrut):
+ (WebCore::RenderBlock::setPageY):
+ (WebCore::RenderBlock::nextPageTop):
+ (WebCore::inNormalFlow):
+ (WebCore::RenderBlock::applyBeforeBreak):
+ (WebCore::RenderBlock::applyAfterBreak):
+ (WebCore::RenderBlock::adjustForUnsplittableChild):
+ (WebCore::RenderBlock::adjustLinePositionForPagination):
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::paginationStrut):
+ (WebCore::RenderBlock::pageY):
+ (WebCore::RenderBlock::maxTopPosMargin):
+ (WebCore::RenderBlock::maxTopNegMargin):
+ (WebCore::RenderBlock::maxBottomPosMargin):
+ (WebCore::RenderBlock::maxBottomNegMargin):
+ (WebCore::RenderBlock::initMaxMarginValues):
+ (WebCore::RenderBlock::FloatingObject::FloatingObject):
+ (WebCore::RenderBlock::FloatingObject::type):
+ (WebCore::RenderBlock::RenderBlockRareData::RenderBlockRareData):
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::layoutInlineChildren):
+ (WebCore::RenderBlock::determineStartPosition):
+ (WebCore::RenderBlock::skipLeadingWhitespace):
+ (WebCore::RenderBlock::findNextLineBreak):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::mapLocalToContainer):
+ (WebCore::RenderBox::computeRectForRepaint):
+ (WebCore::RenderBox::markDescendantBlocksAndLinesForLayout):
+ * rendering/RenderBox.h:
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::layoutBlock):
+ (WebCore::RenderFlexibleBox::layoutHorizontalBox):
+ (WebCore::RenderFlexibleBox::layoutVerticalBox):
+ * rendering/RenderFlexibleBox.h:
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::computeRectForRepaint):
+ (WebCore::RenderInline::mapLocalToContainer):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::updatePagination):
+ (WebCore::RenderLayer::paintChildLayerIntoColumns):
+ (WebCore::RenderLayer::hitTestChildLayerColumns):
+ * rendering/RenderLineBoxList.cpp:
+ (WebCore::RenderLineBoxList::paint):
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::RenderTable):
+ (WebCore::RenderTable::layout):
+ * rendering/RenderTable.h:
+ * rendering/RenderTableRow.cpp:
+ (WebCore::RenderTableRow::layout):
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::layoutRows):
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::RenderView):
+ (WebCore::RenderView::pushLayoutState):
+ * rendering/RenderView.h:
+ (WebCore::RenderView::setTruncatedAt):
+ (WebCore::RenderView::pushLayoutState):
+ (WebCore::RenderView::popLayoutState):
+ (WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
+ (WebCore::LayoutStateMaintainer::push):
+ * rendering/RootInlineBox.h:
+ (WebCore::RootInlineBox::RootInlineBox):
+ (WebCore::RootInlineBox::paginationStrut):
+ (WebCore::RootInlineBox::setPaginationStrut):
+
+2010-09-16 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Fix debug crash in HTMLFrameOwnerElement caused by content frame being used after destruction.
+ https://bugs.webkit.org/show_bug.cgi?id=45737
+
+ Test: fast/frames/frame-limit.html
+
+ * html/HTMLFrameOwnerElement.cpp:
+ (WebCore::HTMLFrameOwnerElement::willRemove):
+
+2010-09-16 Thomas Zander <t.zander@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45878
+
+ [Qt] Fixed incorrect Symbian scoping.
+
+ The missing install functionality is only true for mmp based systems.
+
+ * WebCore.pro: limit functionality to mmp systems.
+
+2010-09-16 Anders Carlsson <andersca@apple.com>
+
+ Fix clang build.
+
+ * page/animation/AnimationBase.h:
+ Fix struct/class mismatch.
+
+2010-09-16 Darin Adler <darin@apple.com>
+
+ Reviewed by Andreas Kling.
+
+ Reduce use of HTMLInputElement::inputType so we can remove it later
+ https://bugs.webkit.org/show_bug.cgi?id=45903
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::isFileUploadButton): Use isFileUpload.
+ (WebCore::AccessibilityRenderObject::isInputImage): Use isImageButton.
+ (WebCore::AccessibilityRenderObject::determineAccessibilityRole): Use
+ isCheckbox and isRadioButton.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::adjustRenderStyle): Use isImageButton.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::setBaseWritingDirection): Use isTextField.
+
+ * editing/ReplaceSelectionCommand.cpp:
+ (WebCore::ReplaceSelectionCommand::doApply): Use isPasswordField.
+
+ * editing/SelectionController.cpp:
+ (WebCore::SelectionController::isInPasswordField): Use isPasswordField.
+
+ * html/HTMLInputElement.h: Added isFileUpload, isImageButton, and isSubmitButton.
+
+ * page/Chrome.cpp:
+ (WebCore::Chrome::setToolTip): Use isSubmitButton and isFileUpload.
+
+ * page/DragController.cpp:
+ (WebCore::asFileInput): Use isFileUpload.
+
+ * page/EventHandler.cpp:
+ (WebCore::isSubmitImage): Use isImageButton.
+
+ * rendering/RenderFileUploadControl.cpp:
+ (WebCore::RenderFileUploadControl::updateFromElement): Use isFileUpload.
+
+2010-09-16 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: quick fix for crash in InspectorController::loadBreakpoints caused by empty main resource
+ https://bugs.webkit.org/show_bug.cgi?id=45901
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::breakpointsSettingKey):
+
+2010-09-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Prevent responseReceivedTime from being > endTime in case mixture of WebCore and Network stack info is used.
+ https://bugs.webkit.org/show_bug.cgi?id=45892
+
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::endTiming):
+
+2010-09-16 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: move resourceTracking flag under control of BackendSettings.
+
+ Four Inspector API methods about resourceTracking flag were removed.
+ Actual state of the flag is transfered as the response of setResourceTracking request.
+ Initial state of the flag on the frontend side is obtained from settings.backend.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45887
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::getBackendSettings):
+ (WebCore::InspectorController::populateScriptObjects):
+ (WebCore::InspectorController::setResourceTracking):
+ * inspector/InspectorController.h:
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
+ * inspector/front-end/Settings.js:
+ (WebInspector.Settings.initialize.populateBackendSettings):
+ (WebInspector.Settings.initialize):
+ * inspector/front-end/inspector.js:
+
+2010-09-16 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ BlobData should be copied for it to be used cross-thread in ThreadableBlobRegistry.
+ https://bugs.webkit.org/show_bug.cgi?id=45909
+
+ * fileapi/ThreadableBlobRegistry.cpp:
+ (WebCore::BlobRegistryContext::BlobRegistryContext):
+
+2010-09-16 Daniel Cheng <dcheng@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ [chromium] Fix incorrect drag node/selection painting.
+ https://bugs.webkit.org/show_bug.cgi?id=45573
+
+ Drag selections were being incorrectly clipped when dragging a selection
+ near the bottom of a page that was taller than the viewport. To fix
+ this, we use paintContents() instead of paint().
+
+ * page/chromium/FrameChromium.cpp:
+ (WebCore::Frame::nodeImage):
+ (WebCore::Frame::dragImageForSelection):
+
+2010-09-16 Daniel Cheng <dcheng@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Fix incorrect usage of dissolveDragImageToFraction().
+ https://bugs.webkit.org/show_bug.cgi?id=45835
+
+ createDragImageForSelection() was ignoring the return value of
+ dissolveDragImageToFraction(). This didn't happen to crash on most
+ platforms, since most implementations simply modified the image that was
+ passed in. However, Chromium Mac's implementation actually creates a new
+ image and returns that instead. This caused us to crash when copying the
+ image from the renderer to the browser process, since the memory had
+ already been freed.
+
+ * manual-tests/selection-drag-crash.html: Added.
+ * platform/DragImage.cpp:
+ (WebCore::createDragImageForSelection):
+
+2010-09-16 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r67628.
+ http://trac.webkit.org/changeset/67628
+ https://bugs.webkit.org/show_bug.cgi?id=45904
+
+ broke the build (Requested by eric_carlson on #webkit).
+
+ * page/ContextMenuController.cpp:
+ (WebCore::ContextMenuController::contextMenuItemSelected):
+ * platform/ContextMenu.cpp:
+ (WebCore::ContextMenu::populate):
+ (WebCore::ContextMenu::checkOrEnableIfNeeded):
+ * platform/ContextMenuItem.h:
+ * platform/LocalizationStrategy.h:
+ * platform/LocalizedStrings.cpp:
+ * platform/LocalizedStrings.h:
+ * platform/android/LocalizedStringsAndroid.cpp:
+ * platform/brew/LocalizedStringsBrew.cpp:
+ * platform/efl/LocalizedStringsEfl.cpp:
+ * platform/gtk/ContextMenuItemGtk.cpp:
+ (WebCore::gtkStockIDFromContextMenuAction):
+ * platform/gtk/LocalizedStringsGtk.cpp:
+ * platform/haiku/LocalizedStringsHaiku.cpp:
+ * platform/wx/LocalizedStringsWx.cpp:
+ * rendering/HitTestResult.cpp:
+ (WebCore::HitTestResult::absoluteMediaURL):
+ * rendering/HitTestResult.h:
+
+2010-09-16 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Simon Fraser.
+
+ CSS: Fix crash in getTimingFunctionValue()
+ https://bugs.webkit.org/show_bug.cgi?id=45896
+
+ Use a RefPtr to avoid deleting the TimingFunction prematurely.
+
+ This is covered by existing tests, e.g transitions/inherit-other-props.html
+ but will only actually crash on picky platforms (or in valgrind.)
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::getTimingFunctionValue):
+
+2010-09-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: prevent resource timing popover from having scrollers.
+ https://bugs.webkit.org/show_bug.cgi?id=45883
+
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype._showPopover):
+
+2010-09-15 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] enhanced context menu for media elements
+ https://bugs.webkit.org/show_bug.cgi?id=45021
+
+ New items in the media Element context menu:
+ - play/pause
+ - mute/unmute
+ - controls display control
+ - switch to fullscreen (for video only)
+ - loop playback control
+ - copy media url to clipboard
+ - open in new window
+
+ Test: media/context-menu-actions.html
+
+ * page/ContextMenuController.cpp:
+ (WebCore::ContextMenuController::contextMenuItemSelected):
+ * platform/ContextMenu.cpp:
+ (WebCore::ContextMenu::populate):
+ (WebCore::ContextMenu::checkOrEnableIfNeeded):
+ * platform/ContextMenuItem.h:
+ * platform/LocalizationStrategy.h:
+ * platform/LocalizedStrings.cpp:
+ (WebCore::contextMenuItemTagOpenMediaInNewWindow):
+ (WebCore::contextMenuItemTagCopyMediaLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ (WebCore::contextMenuItemTagMediaUnMute):
+ * platform/LocalizedStrings.h:
+ * platform/android/LocalizedStringsAndroid.cpp:
+ (WebCore::contextMenuItemTagOpenMediaInNewWindow):
+ (WebCore::contextMenuItemTagCopyMediaLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ (WebCore::contextMenuItemTagMediaUnMute):
+ * platform/brew/LocalizedStringsBrew.cpp:
+ (WebCore::contextMenuItemTagOpenMediaInNewWindow):
+ (WebCore::contextMenuItemTagCopyMediaLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ (WebCore::contextMenuItemTagMediaUnMute):
+ * platform/efl/LocalizedStringsEfl.cpp:
+ (WebCore::contextMenuItemTagOpenMediaInNewWindow):
+ (WebCore::contextMenuItemTagCopyMediaLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ (WebCore::contextMenuItemTagMediaUnMute):
+ * platform/gtk/ContextMenuItemGtk.cpp:
+ (WebCore::gtkStockIDFromContextMenuAction):
+ * platform/gtk/LocalizedStringsGtk.cpp:
+ (WebCore::contextMenuItemTagOpenMediaInNewWindow):
+ (WebCore::contextMenuItemTagCopyMediaLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ (WebCore::contextMenuItemTagMediaUnMute):
+ * platform/haiku/LocalizedStringsHaiku.cpp:
+ (WebCore::contextMenuItemTagOpenMediaInNewWindow):
+ (WebCore::contextMenuItemTagCopyMediaLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ (WebCore::contextMenuItemTagMediaUnMute):
+ * platform/wx/LocalizedStringsWx.cpp:
+ (WebCore::contextMenuItemTagOpenMediaInNewWindow):
+ (WebCore::contextMenuItemTagCopyMediaLinkToClipboard):
+ (WebCore::contextMenuItemTagToggleMediaControls):
+ (WebCore::contextMenuItemTagToggleMediaLoop):
+ (WebCore::contextMenuItemTagEnterVideoFullscreen):
+ (WebCore::contextMenuItemTagMediaPlay):
+ (WebCore::contextMenuItemTagMediaPause):
+ (WebCore::contextMenuItemTagMediaMute):
+ (WebCore::contextMenuItemTagMediaUnMute):
+ * rendering/HitTestResult.cpp:
+ (WebCore::HitTestResult::absoluteMediaURL):
+ (WebCore::HitTestResult::mediaSupportsFullscreen):
+ (WebCore::HitTestResult::mediaElement):
+ (WebCore::HitTestResult::toggleMediaControlsDisplay):
+ (WebCore::HitTestResult::toggleMediaLoopPlayback):
+ (WebCore::HitTestResult::enterFullscreenForVideo):
+ (WebCore::HitTestResult::mediaControlsEnabled):
+ (WebCore::HitTestResult::mediaLoopEnabled):
+ (WebCore::HitTestResult::mediaPlaying):
+ (WebCore::HitTestResult::toggleMediaPlayState):
+ (WebCore::HitTestResult::mediaHasAudio):
+ (WebCore::HitTestResult::mediaMuted):
+ (WebCore::HitTestResult::toggleMediaMuteState):
+ * rendering/HitTestResult.h:
+
+2010-09-16 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Crash in WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions
+ https://bugs.webkit.org/show_bug.cgi?id=45833
+
+ Test: fast/parser/x-frame-options-detached-document-crash.html
+
+ * dom/Document.cpp:
+ (WebCore::Document::processHttpEquiv): Other branches in this method already test for a null frame. So it seems to make sense to test that here as well.
+
+2010-09-16 Vangelis Kokkevis <vangelis@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] ImageLayerChromium needs to keep a ref to the Image it uses
+ so that it never tries to access an already destroyed Image.
+ https://bugs.webkit.org/show_bug.cgi?id=45869
+
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::setContentsToImage):
+ * platform/graphics/chromium/ImageLayerChromium.cpp:
+ (WebCore::ImageLayerChromium::setContents):
+ (WebCore::ImageLayerChromium::updateContents):
+ * platform/graphics/chromium/ImageLayerChromium.h:
+
+2010-09-16 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Add platform-specific Image methods
+ https://bugs.webkit.org/show_bug.cgi?id=28272
+
+ * platform/graphics/wince/ImageWinCE.cpp: Added.
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+ (WebCore::FrameData::clear):
+ (WebCore::BitmapImage::getHBITMAPOfSize):
+ (WebCore::BitmapImage::drawFrameMatchingSourceSize):
+ (WebCore::BitmapImage::draw):
+ (WebCore::Image::drawPattern):
+ (WebCore::BitmapImage::drawPattern):
+ (WebCore::BitmapImage::checkForSolidColor):
+
+2010-09-16 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: [REGRESSION] Scripts disappear from scripts panel after navigation
+ https://bugs.webkit.org/show_bug.cgi?id=45890
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::populateScriptObjects):
+ (WebCore::InspectorController::restoreDebugger):
+ (WebCore::InspectorController::restoreProfiler):
+ * inspector/InspectorController.h:
+
+2010-09-16 Satish Sampath <satish@chromium.org>
+
+ Unreviewed, fixing a build break with VS 2008.
+
+ Fix build break, add the namespace in a friend declaration to get MSVC recognize it properly.
+ https://bugs.webkit.org/show_bug.cgi?id=45893
+
+ * fileapi/FileWriter.h:
+
+2010-09-15 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GStreamer] XOverlay API changes break the build
+ https://bugs.webkit.org/show_bug.cgi?id=45810
+
+ Cope with the GStreamer XOverlay API change for the upcoming
+ 0.10.31 version.
+ No new tests, build fix only.
+
+ * platform/graphics/gstreamer/GStreamerGWorld.cpp:
+ (WebCore::GStreamerGWorld::setWindowOverlay):
+
+2010-09-16 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] V8 port: Fix debug build
+
+ Add missing inclusion of <wtf/text/CString.h> where necessary for debug builds.
+
+ * history/PageCache.cpp:
+ * html/HTMLElement.cpp:
+ * html/HTMLMediaElement.cpp:
+ * loader/DocumentLoader.cpp:
+ * loader/icon/IconDatabase.cpp:
+ * loader/icon/IconLoader.cpp:
+ * storage/AbstractDatabase.cpp:
+ * storage/Database.cpp:
+ * storage/DatabaseSync.cpp:
+ * storage/DatabaseTracker.cpp:
+
+2010-09-16 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45852
+ Range::selectNode and selectNodeContents misbehave when argument is in another document
+
+ Test: fast/dom/Range/select-node-different-document.html
+
+ There is nothing in DOM Traversal spec that says this shouldn't work, and it does work in
+ Firefox.
+
+ * dom/Range.cpp:
+ (WebCore::Range::setDocument):
+ (WebCore::Range::selectNode):
+ (WebCore::Range::selectNodeContents):
+ * dom/Range.h:
+
+2010-09-16 Andrey Kosyakov <caseq@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: [Resources panel] [HAR] Need a way to save timing data.
+ Added support to export HAR to file from Resources panel (conditional on Preferences)
+ Added support for HARLog (a higher-level aggregate than HAREntry)
+ https://bugs.webkit.org/show_bug.cgi?id=45663
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/HAREntry.js:
+ (WebInspector.HAREntry.prototype.build):
+ (WebInspector.HAREntry.prototype._buildTimings):
+ (WebInspector.HAREntry._toMilliseconds):
+ (WebInspector.HARLog):
+ (WebInspector.HARLog.prototype.build):
+ (WebInspector.HARLog.prototype._buildPages):
+ (WebInspector.HARLog.prototype._buildMainResourceTimings):
+ (WebInspector.HARLog.prototype._convertResource):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel):
+ (WebInspector.ResourcesPanel.prototype.hide):
+ (WebInspector.ResourcesPanel.prototype._contextMenu):
+ (WebInspector.ResourcesPanel.prototype._exportAll):
+ (WebInspector.ResourcesPanel.prototype._exportResource):
+ * inspector/front-end/Settings.js:
+ * inspector/front-end/utilities.js:
+ ():
+
+2010-09-16 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by Jian Li.
+
+ Unify FILE_SYSTEM and FILE_WRITER enables under the name FILE_SYSTEM.
+ https://bugs.webkit.org/show_bug.cgi?id=45798
+
+ * CMakeLists.txt:
+ * Configurations/FeatureDefines.xcconfig:
+ * GNUmakefile.am:
+ * WebCore.pro:
+ * dom/EventTarget.cpp:
+ * dom/EventTarget.h:
+ * dom/ExceptionCode.h:
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
+ * dom/ScriptExecutionContext.h:
+ * fileapi/AsyncFileWriter.h:
+ * fileapi/FileEntry.cpp:
+ * fileapi/FileEntry.h:
+ * fileapi/FileEntry.idl:
+ * fileapi/FileError.h:
+ * fileapi/FileError.idl:
+ * fileapi/FileException.h:
+ * fileapi/FileException.idl:
+ * fileapi/FileStreamProxy.cpp:
+ * fileapi/FileStreamProxy.h:
+ * fileapi/FileThread.cpp:
+ * fileapi/FileThread.h:
+ * fileapi/FileWriter.cpp:
+ * fileapi/FileWriter.h:
+ * fileapi/FileWriter.idl:
+ * fileapi/FileWriterCallback.h:
+ * fileapi/FileWriterCallback.idl:
+ * fileapi/FileWriterClient.h:
+ * page/DOMWindow.idl:
+ * platform/AsyncFileStream.h:
+ * platform/FileStream.cpp:
+ * platform/FileStream.h:
+ * platform/FileStreamClient.h:
+
+2010-09-16 Marc-Antoine Ruel <maruel@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Convert WebCore.gyp to use regexp to excludes files instead of listing them in sources!.
+
+ This is necessary because sources! is processed before sources/. This makes
+ applying broader pattern in sources/ more difficult since it overrides the files
+ listed in sources!. Having all them in sources/ permits controlling the ordering
+ of the regexp, thus the final list of included files.
+
+ Fix Harfbuzz and VDMX source files includes in WebCore.gypi and WebCore.gyp
+
+ https://bugs.webkit.org/show_bug.cgi?id=45823
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+
+2010-09-16 Nat Duca <nduca@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] Make compositor obey finish flag
+ https://bugs.webkit.org/show_bug.cgi?id=45552
+
+ The compositor should obey the finish flag on doComposite. This
+ flag causes the compositor to finish rendering before returning,
+ which is needed when resizing the window to avoid flashes of green.
+
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::finish):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+
+2010-09-16 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ GTK+ 3.x. updates, gtk_widget_size_request is deprecated and
+ "activate-slider" style property for scrollbars is gone.
+
+ * platform/gtk/PopupMenuGtk.cpp:
+ (WebCore::PopupMenuGtk::show):
+ * platform/gtk/gtk2drawing.c:
+ (moz_gtk_scrollbar_thumb_paint):
+ (moz_gtk_combo_box_paint):
+
+2010-09-16 Diego Gonzalez <diegohcg@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Remove FrameLoaderClientQt::webFrame() to use NetworkingContext to get the WebFrame to avoid layering violations
+ https://bugs.webkit.org/show_bug.cgi?id=42293
+
+ * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+ (WebCore::MediaPlayerPrivate::commitLoad):
+
+2010-09-16 Ryuan Choi <ryuan.choi@samsung.com>
+
+ Unreviewed build fix for EFL
+
+ [EFL] REGRESSION(67567) FontCacheCairo was removed
+ https://bugs.webkit.org/show_bug.cgi?id=45858
+
+ * CMakeListsEfl.txt:
+
+2010-09-16 Yong Li <yoli@rim.com>
+
+ Reviewed by George Staikos.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37117
+
+ Add platform-independent JPEG/PNG image encoders that
+ work with big endian RGBA source data.
+
+ There's no layout test because this patch does't make
+ any port start using the encoders.
+
+ * platform/image-encoders/JPEGImageEncoder.cpp: Added.
+ * platform/image-encoders/JPEGImageEncoder.h: Added.
+ * platform/image-encoders/PNGImageEncoder.cpp: Added.
+ * platform/image-encoders/PNGImageEncoder.h: Added.
+
+2010-09-15 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Allow the embedder to specify the base path for IndexedDB.
+ https://bugs.webkit.org/show_bug.cgi?id=45815
+
+ Existing tests provide coverage. Use the indexedDBPath parameter that's
+ already on the group settings object. Pass this parameter into the backend
+ which will use it rather than a hard coded tmp directory location. If
+ nothing is specified, assume it should be an in-memory temporary database.
+ (This is useful for bringup and Chromium's incognito mode.)
+
+ * storage/IDBFactory.cpp:
+ (WebCore::IDBFactory::open):
+ * storage/IDBFactoryBackendImpl.cpp:
+ (WebCore::openSQLiteDatabase):
+ (WebCore::createTables):
+ (WebCore::IDBFactoryBackendImpl::open):
+ * storage/IDBFactoryBackendImpl.h:
+ * storage/IDBFactoryBackendInterface.h:
+
+2010-09-16 Yong Li <yoli@rim.com>
+
+ Reviewed by George Staikos.
+
+ Fix the bug that GIF image down sampling can miss some lines.
+ https://bugs.webkit.org/show_bug.cgi?id=45322
+
+ Test: fast/images/gif-large-checkerboard.html
+
+ * platform/image-decoders/gif/GIFImageDecoder.cpp:
+ (WebCore::GIFImageDecoder::haveDecodedRow):
+
+2010-09-16 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Andreas Kling.
+
+ [GStreamer] un-needed header includes in MediaPlayerPrivate
+ https://bugs.webkit.org/show_bug.cgi?id=45877
+
+ Include only the headers we need.
+ No new tests, #includes cleanup only.
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+
+2010-09-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: console.group(object) does not allow object to be expanded.
+ https://bugs.webkit.org/show_bug.cgi?id=45806
+
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleGroup.prototype.addMessage):
+ * inspector/front-end/treeoutline.js:
+ (TreeElement.treeElementToggled):
+
+2010-09-08 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Complete index support for IndexedDB
+ https://bugs.webkit.org/show_bug.cgi?id=45386
+
+ Add the rest of the index related API for IndexedDB. This
+ includes cursor suport. A bunch of code was also refactored
+ since it is shared between indexes and objectStores.
+
+ Tests: storage/indexeddb/index-basics.html
+ storage/indexeddb/index-cursor.html
+ + additions to others.
+
+ * storage/IDBAny.cpp:
+ (WebCore::IDBAny::set):
+ * storage/IDBCursor.cpp:
+ (WebCore::IDBCursor::value):
+ * storage/IDBCursorBackendImpl.cpp:
+ (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl):
+ (WebCore::IDBCursorBackendImpl::value):
+ (WebCore::IDBCursorBackendImpl::update):
+ (WebCore::IDBCursorBackendImpl::continueFunction):
+ (WebCore::IDBCursorBackendImpl::remove):
+ (WebCore::IDBCursorBackendImpl::loadCurrentRow):
+ (WebCore::IDBCursorBackendImpl::database):
+ * storage/IDBCursorBackendImpl.h:
+ (WebCore::IDBCursorBackendImpl::create):
+ * storage/IDBCursorBackendInterface.h:
+ * storage/IDBFactoryBackendImpl.cpp:
+ (WebCore::createTables):
+ * storage/IDBIndex.cpp:
+ (WebCore::IDBIndex::openObjectCursor):
+ (WebCore::IDBIndex::openCursor):
+ (WebCore::IDBIndex::getObject):
+ (WebCore::IDBIndex::get):
+ * storage/IDBIndex.h:
+ (WebCore::IDBIndex::storeName):
+ * storage/IDBIndex.idl:
+ * storage/IDBIndexBackendImpl.cpp:
+ (WebCore::IDBIndexBackendImpl::storeName):
+ (WebCore::openCursorInternal):
+ (WebCore::IDBIndexBackendImpl::openObjectCursor):
+ (WebCore::IDBIndexBackendImpl::openCursor):
+ (WebCore::getInternal):
+ (WebCore::IDBIndexBackendImpl::getObject):
+ (WebCore::IDBIndexBackendImpl::get):
+ * storage/IDBIndexBackendImpl.h:
+ (WebCore::IDBIndexBackendImpl::objectStore):
+ * storage/IDBIndexBackendInterface.h:
+ * storage/IDBKey.cpp:
+ (WebCore::IDBKey::fromQuery):
+ (WebCore::IDBKey::whereSyntax):
+ (WebCore::IDBKey::leftCursorWhereFragment):
+ (WebCore::IDBKey::rightCursorWhereFragment):
+ * storage/IDBKey.h:
+ * storage/IDBKeyRange.cpp:
+ (WebCore::IDBKeyRange::leftWhereClauseComparisonOperator):
+ (WebCore::IDBKeyRange::rightWhereClauseComparisonOperator):
+ * storage/IDBKeyRange.h:
+ * storage/IDBObjectStoreBackendImpl.cpp:
+ (WebCore::IDBObjectStoreBackendImpl::openCursor):
+ * storage/IDBRequest.cpp:
+ (WebCore::IDBRequest::timerFired):
+
+2010-09-15 Simon Fraser <simon.fraser@apple.com>
+
+ Fix chromium build.
+
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+
+2010-09-15 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Adam Roben.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44715
+ maps.google.com flips upside down when zooming map using trackpad in WebKit2 on Mac
+
+ Remove the concept of geometry flipping from GraphicsLayer; geometry flipping will
+ be taken care of in platform code without the need to complicate the GraphicsLayer API.
+
+ RenderLayerCompositor no longer sets the geometry orientation for the root
+ platform layer; platform-specific code does this instead.
+
+ This fixes flipped layers in WebKit2, since WebKit2 was already flipping
+ geometry, and then RenderLayerCompositor was doing an additional flip.
+
+ * platform/graphics/GraphicsLayer.cpp:
+ (WebCore::GraphicsLayer::GraphicsLayer):
+ * platform/graphics/GraphicsLayer.h:
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ * platform/graphics/chromium/GraphicsLayerChromium.h:
+ * platform/graphics/mac/GraphicsLayerCA.h:
+ * platform/graphics/mac/GraphicsLayerCA.mm:
+ (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
+ (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
+ (WebCore::GraphicsLayerCA::defaultContentsOrientation):
+ * platform/graphics/qt/GraphicsLayerQt.cpp:
+ (WebCore::GraphicsLayerQtImpl::flushChanges):
+ * platform/graphics/qt/GraphicsLayerQt.h:
+ * platform/graphics/win/GraphicsLayerCACF.cpp:
+ (WebCore::GraphicsLayerCACF::swapFromOrToTiledLayer):
+ * platform/graphics/win/GraphicsLayerCACF.h:
+ * platform/graphics/win/WKCACFLayerRenderer.cpp:
+ (WebCore::WKCACFLayerRenderer::setRootChildLayer):
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::ensureRootPlatformLayer):
+
+2010-09-15 Julien Chaffraix <jchaffraix@codeaurora.org>
+
+ Unreviewed.
+
+ Reverting my changes as it is breaking several tests on Gtk and Qt.
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseColor):
+ * css/CSSParser.h:
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setStrokeColor):
+ (WebCore::CanvasRenderingContext2D::setFillColor):
+ * html/canvas/CanvasStyle.cpp:
+ (WebCore::CanvasStyle::createFromString):
+ * html/canvas/CanvasStyle.h:
+
+2010-09-15 Julien Chaffraix <jchaffraix@codeaurora.org>
+
+ Reviewed by Andreas Kling.
+
+ Parse system colors in the HTML5 canvas context.
+ https://bugs.webkit.org/show_bug.cgi?id=39168
+
+ Test: fast/css/test-setting-canvas-color.html
+
+ Based on previous work by Jan Erik Hanssen <jhanssen@codeaurora.org>
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseColor): Changed the function to better match our
+ early return policy. Also we now return false when we don't parse the color.
+ This is needed for createFromString to fallback to using parseSystemColor.
+
+ (WebCore::CSSParser::parseSystemColor): Made use of the RenderTheme to get
+ the system colors.
+
+ * css/CSSParser.h: Added the new parseSystemColor method.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setStrokeColor): Pass the document to createFromString.
+ (WebCore::CanvasRenderingContext2D::setFillColor): Ditto.
+ * html/canvas/CanvasStyle.cpp:
+ (WebCore::CanvasStyle::createFromString): Try to parse the color using CSSParser::parseColor
+ and fall back to parseSystemColor if it did not work.
+
+ * html/canvas/CanvasStyle.h: Added the new Document* parameter to createFromString.
+
+2010-09-14 Erik Arvidsson <arv@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ getComputedStyle() returns different values for different zoom levels
+ https://bugs.webkit.org/show_bug.cgi?id=32230
+
+ Test: fast/css/getComputedStyle/computed-style-with-zoom.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::zoomAdjustedPixelValue):
+ (WebCore::zoomAdjustedNumberValue):
+ (WebCore::valueForReflection):
+ (WebCore::getPositionOffsetValue):
+ (WebCore::getBorderRadiusCornerValue):
+ (WebCore::computedTransform):
+ (WebCore::CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword):
+ (WebCore::CSSComputedStyleDeclaration::valueForShadow):
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSComputedStyleDeclaration.h:
+ * css/SVGCSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getSVGPropertyCSSValue):
+ * rendering/RenderObject.h:
+ (WebCore::adjustForAbsoluteZoom):
+ * rendering/style/RenderStyle.h:
+ (WebCore::adjustForAbsoluteZoom):
+
+2010-09-14 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Fully separate Pango and FreeType font backends
+ https://bugs.webkit.org/show_bug.cgi?id=27442
+
+ Split FontPlatformData.h into separate versions for Pango, FreeType and WinCairo.
+ Include the correct file via #ifdef'd includes, like the Chromium port. Also split
+ FontCacheCairo.cpp into Pango and FreeType versions, as they had almost no code in
+ common. Finally, rename FontPlatformDataCairo to FontPlatformDataFreeType, as this
+ compilation unit is used only by the FreeType backend. This change is important to
+ prevent upcoming fixes to the FreeType backend from affecting other backends.
+
+ No new tests as functionality has not changed.
+
+ * CMakeListsEfl.txt: Update source lists.
+ * GNUmakefile.am: Update source lists.
+ * platform/graphics/cairo/FontCacheCairo.cpp: Removed.
+ * platform/graphics/cairo/FontCacheFreeType.cpp: Added.
+ (WebCore::FontCache::platformInit):
+ (WebCore::FontCache::getFontDataForCharacters):
+ (WebCore::FontCache::getSimilarFontPlatformData):
+ (WebCore::FontCache::getLastResortFallbackFont):
+ (WebCore::FontCache::getTraitsInFamily):
+ (WebCore::isWellKnownFontName):
+ (WebCore::FontCache::createFontPlatformData):
+ * platform/graphics/cairo/FontPlatformData.h:
+ * platform/graphics/cairo/FontPlatformDataFreeType.cpp: Renamed from WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp.
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::operator=):
+ (WebCore::FontPlatformData::init):
+ (WebCore::FontPlatformData::~FontPlatformData):
+ (WebCore::FontPlatformData::isFixedPitch):
+ (WebCore::FontPlatformData::operator==):
+ (WebCore::FontPlatformData::description):
+ * platform/graphics/cairo/FontPlatformDataFreeType.h: Added.
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::size):
+ (WebCore::FontPlatformData::setSize):
+ (WebCore::FontPlatformData::syntheticBold):
+ (WebCore::FontPlatformData::syntheticOblique):
+ (WebCore::FontPlatformData::scaledFont):
+ (WebCore::FontPlatformData::hash):
+ (WebCore::FontPlatformData::isHashTableDeletedValue):
+ (WebCore::FontPlatformData::hashTableDeletedFontValue):
+ * platform/graphics/gtk/FontCachePango.cpp: Added.
+ (WebCore::FontCache::platformInit):
+ (WebCore::FontCache::getFontDataForCharacters):
+ (WebCore::FontCache::getSimilarFontPlatformData):
+ (WebCore::FontCache::getLastResortFallbackFont):
+ (WebCore::FontCache::getTraitsInFamily):
+ (WebCore::FontCache::createFontPlatformData):
+ * platform/graphics/gtk/FontPlatformDataPango.h: Added.
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::size):
+ (WebCore::FontPlatformData::setSize):
+ (WebCore::FontPlatformData::syntheticBold):
+ (WebCore::FontPlatformData::syntheticOblique):
+ (WebCore::FontPlatformData::scaledFont):
+ (WebCore::FontPlatformData::hash):
+ (WebCore::FontPlatformData::isHashTableDeletedValue):
+ (WebCore::FontPlatformData::hashTableDeletedFontValue):
+ * platform/graphics/win/FontPlatformDataCairoWin.h: Added.
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::hfont):
+ (WebCore::FontPlatformData::useGDI):
+ (WebCore::FontPlatformData::fontFace):
+ (WebCore::FontPlatformData::size):
+ (WebCore::FontPlatformData::setSize):
+ (WebCore::FontPlatformData::syntheticBold):
+ (WebCore::FontPlatformData::syntheticOblique):
+ (WebCore::FontPlatformData::scaledFont):
+ (WebCore::FontPlatformData::hash):
+ (WebCore::FontPlatformData::isHashTableDeletedValue):
+
+2010-09-15 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ AX: when text is auto-truncated, accessibility bounds are wrong
+ https://bugs.webkit.org/show_bug.cgi?id=45793
+
+ Allow accessibility to retrieve the absoluteQuads of a text node that
+ clips to the ellipsis.
+
+ Test: accessibility/ellipsis-text.html
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::boundingBoxRect):
+ * rendering/RenderText.cpp:
+ (WebCore::ellipsisRectForBox):
+ Make a common method to retrieve the ellipsis rect.
+ (WebCore::RenderText::absoluteQuads):
+ Default into the absoluteQuads method that allows for ellipsis clipping.
+ (WebCore::RenderText::selectionRectForRepaint):
+ Use the common method for retrieving the ellipsis.
+ * rendering/RenderText.h:
+
+2010-09-15 Ariya Hidayat <ariya@sencha.com>
+
+ [Qt] Improve the speed of blur shadow
+ https://bugs.webkit.org/show_bug.cgi?id=44222
+
+ Rewrite the shadow blur function with loop unrolls and sliding step
+ unification for both horizontal and vertical directions.
+ This gives significant performance improvement on most cases.
+
+ * platform/graphics/qt/ContextShadow.cpp:
+ (WebCore::shadowBlur):
+
+2010-09-14 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ (Take 2). Web Inspector: Provide network-based load timing.
+ Before this change, inspector used timers taken from
+ within WebCore notifications (that are by definition
+ synchronous and serialized). As a result, timing was
+ affected by the routines running on the main thread
+ (JavaScript and such).
+ https://bugs.webkit.org/show_bug.cgi?id=45664
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::willSendRequest):
+ (WebCore::InspectorController::didFinishLoading):
+ (WebCore::InspectorController::didFailLoading):
+ * inspector/InspectorController.h:
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::endTiming):
+ * inspector/InspectorResource.h:
+ * loader/PingLoader.h:
+ (WebCore::PingLoader::didFinishLoading):
+ * loader/ResourceLoadNotifier.cpp:
+ (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::didFinishLoading):
+ * loader/ResourceLoader.h:
+ * loader/appcache/ApplicationCacheGroup.cpp:
+ (WebCore::ApplicationCacheGroup::didFinishLoading):
+ * loader/appcache/ApplicationCacheGroup.h:
+ * loader/icon/IconFetcher.cpp:
+ (WebCore::IconFetcher::didFinishLoading):
+ * loader/icon/IconFetcher.h:
+ * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+ (StreamingClient::didFinishLoading):
+ * platform/network/BlobResourceHandle.cpp:
+ (WebCore::BlobResourceHandle::notifyFinish):
+ * platform/network/ResourceHandleClient.h:
+ (WebCore::ResourceHandleClient::didFinishLoading):
+ * platform/network/ResourceLoadTiming.h:
+ (WebCore::ResourceLoadTiming::deepCopy):
+ (WebCore::ResourceLoadTiming::operator==):
+ (WebCore::ResourceLoadTiming::ResourceLoadTiming):
+ * platform/network/cf/ResourceHandleCFNet.cpp:
+ (WebCore::didFinishLoading):
+ * platform/network/curl/ResourceHandleCurl.cpp:
+ (WebCore::WebCoreSynchronousLoader::didFinishLoading):
+ * platform/network/curl/ResourceHandleManager.cpp:
+ (WebCore::ResourceHandleManager::downloadTimerCallback):
+ (WebCore::parseDataUrl):
+ * platform/network/mac/ResourceHandleMac.mm:
+ (-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
+ (WebCoreSynchronousLoaderClient::didFinishLoading):
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+ (WebCore::QNetworkReplyHandler::finish):
+ * platform/network/qt/ResourceHandleQt.cpp:
+ (WebCore::WebCoreSynchronousLoader::didFinishLoading):
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ (WebCore::WebCoreSynchronousLoader::didFinishLoading):
+ (WebCore::WebCoreSynchronousLoader::didFail):
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::WebCoreSynchronousLoader::didFinishLoading):
+ (WebCore::ResourceHandle::onRequestComplete):
+ (WebCore::ResourceHandle::fileLoadTimer):
+ (WebCore::ResourceHandle::cancel):
+
+2010-09-15 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r67551.
+ http://trac.webkit.org/changeset/67551
+ https://bugs.webkit.org/show_bug.cgi?id=45816
+
+ "Plugin tests fail" (Requested by yurys on #webkit).
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::willSendRequest):
+ (WebCore::InspectorController::didFinishLoading):
+ (WebCore::InspectorController::didFailLoading):
+ (WebCore::InspectorController::didCloseWebSocket):
+ * inspector/InspectorController.h:
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::endTiming):
+ * inspector/InspectorResource.h:
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::continueAfterContentPolicy):
+ (WebCore::MainResourceLoader::didFinishLoading):
+ * loader/MainResourceLoader.h:
+ * loader/NetscapePlugInStreamLoader.cpp:
+ (WebCore::NetscapePlugInStreamLoader::didFinishLoading):
+ * loader/PingLoader.h:
+ (WebCore::PingLoader::didFinishLoading):
+ * loader/ResourceLoadNotifier.cpp:
+ (WebCore::ResourceLoadNotifier::didFinishLoad):
+ (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
+ (WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
+ * loader/ResourceLoadNotifier.h:
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::didFinishLoading):
+ (WebCore::ResourceLoader::didFinishLoadingOnePart):
+ * loader/ResourceLoader.h:
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::didReceiveResponse):
+ (WebCore::SubresourceLoader::didFinishLoading):
+ * loader/SubresourceLoader.h:
+ * loader/appcache/ApplicationCacheGroup.cpp:
+ (WebCore::ApplicationCacheGroup::didFinishLoading):
+ * loader/appcache/ApplicationCacheGroup.h:
+ * loader/icon/IconFetcher.cpp:
+ (WebCore::IconFetcher::didFinishLoading):
+ * loader/icon/IconFetcher.h:
+ * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+ (StreamingClient::didFinishLoading):
+ * platform/network/BlobResourceHandle.cpp:
+ (WebCore::BlobResourceHandle::notifyFinish):
+ * platform/network/ResourceHandleClient.h:
+ (WebCore::ResourceHandleClient::didFinishLoading):
+ * platform/network/cf/ResourceHandleCFNet.cpp:
+ (WebCore::didFinishLoading):
+ (WebCore::WebCoreSynchronousLoaderClient::didFinishLoading):
+ * platform/network/curl/ResourceHandleCurl.cpp:
+ (WebCore::WebCoreSynchronousLoader::didFinishLoading):
+ * platform/network/curl/ResourceHandleManager.cpp:
+ (WebCore::ResourceHandleManager::downloadTimerCallback):
+ (WebCore::parseDataUrl):
+ * platform/network/mac/ResourceHandleMac.mm:
+ (-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
+ (WebCoreSynchronousLoaderClient::didFinishLoading):
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+ (WebCore::QNetworkReplyHandler::finish):
+ * platform/network/qt/ResourceHandleQt.cpp:
+ (WebCore::WebCoreSynchronousLoader::didFinishLoading):
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ (WebCore::WebCoreSynchronousLoader::didFinishLoading):
+ (WebCore::WebCoreSynchronousLoader::didFail):
+ (WebCore::finishedCallback):
+ (WebCore::parseDataUrl):
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::WebCoreSynchronousLoader::didFinishLoading):
+ (WebCore::ResourceHandle::onRequestComplete):
+ (WebCore::ResourceHandle::fileLoadTimer):
+ (WebCore::ResourceHandle::cancel):
+
+2010-09-14 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Provide network-based load timing.
+ Before this change, inspector used timers taken from
+ within WebCore notifications (that are by definition
+ synchronous and serialized). As a result, timing was
+ affected by the routines running on the main thread
+ (JavaScript and such).
+ https://bugs.webkit.org/show_bug.cgi?id=45664
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::willSendRequest):
+ (WebCore::InspectorController::didFinishLoading):
+ (WebCore::InspectorController::didFailLoading):
+ * inspector/InspectorController.h:
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::endTiming):
+ * inspector/InspectorResource.h:
+ * loader/PingLoader.h:
+ (WebCore::PingLoader::didFinishLoading):
+ * loader/ResourceLoadNotifier.cpp:
+ (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::didFinishLoading):
+ * loader/ResourceLoader.h:
+ * loader/appcache/ApplicationCacheGroup.cpp:
+ (WebCore::ApplicationCacheGroup::didFinishLoading):
+ * loader/appcache/ApplicationCacheGroup.h:
+ * loader/icon/IconFetcher.cpp:
+ (WebCore::IconFetcher::didFinishLoading):
+ * loader/icon/IconFetcher.h:
+ * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+ (StreamingClient::didFinishLoading):
+ * platform/network/BlobResourceHandle.cpp:
+ (WebCore::BlobResourceHandle::notifyFinish):
+ * platform/network/ResourceHandleClient.h:
+ (WebCore::ResourceHandleClient::didFinishLoading):
+ * platform/network/ResourceLoadTiming.h:
+ (WebCore::ResourceLoadTiming::deepCopy):
+ (WebCore::ResourceLoadTiming::operator==):
+ (WebCore::ResourceLoadTiming::ResourceLoadTiming):
+ * platform/network/cf/ResourceHandleCFNet.cpp:
+ (WebCore::didFinishLoading):
+ * platform/network/curl/ResourceHandleCurl.cpp:
+ (WebCore::WebCoreSynchronousLoader::didFinishLoading):
+ * platform/network/curl/ResourceHandleManager.cpp:
+ (WebCore::ResourceHandleManager::downloadTimerCallback):
+ (WebCore::parseDataUrl):
+ * platform/network/mac/ResourceHandleMac.mm:
+ (-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
+ (WebCoreSynchronousLoaderClient::didFinishLoading):
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+ (WebCore::QNetworkReplyHandler::finish):
+ * platform/network/qt/ResourceHandleQt.cpp:
+ (WebCore::WebCoreSynchronousLoader::didFinishLoading):
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ (WebCore::WebCoreSynchronousLoader::didFinishLoading):
+ (WebCore::WebCoreSynchronousLoader::didFail):
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::WebCoreSynchronousLoader::didFinishLoading):
+ (WebCore::ResourceHandle::onRequestComplete):
+ (WebCore::ResourceHandle::fileLoadTimer):
+ (WebCore::ResourceHandle::cancel):
+
+2010-09-14 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ WebInspector: small refactoring for monitorXHR backend property.
+
+ Our Inspector API is quite big and can be simplified a bit.
+ As example for single backend property like monitoringXHR we
+ have 4 functions in the API. Two functions for frontend
+ enableMonitoringXHR/disableMonitoringXHR and
+ two functions for backend monitoringXHRWasEnabled and
+ monitoringXHRWasDisabled. These functions can be replaced by
+ one setMonitoringXHR with one 'in' and one 'out' argument.
+ The initial state of the flag can be gathered from backend
+ with help of getSettings call where additional section was
+ added for backend state information.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45759
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ * inspector/InspectorController.h:
+ * inspector/front-end/ConsoleView.js:
+ * inspector/front-end/Settings.js:
+ * inspector/front-end/inspector.js:
+
+2010-09-15 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Multiline console does not work on Windows / Linux.
+ https://bugs.webkit.org/show_bug.cgi?id=45807
+
+ * inspector/front-end/ConsoleView.js:
+
+2010-09-15 Renata Hodovan <reni@inf.u-szeged.hu>
+
+ Reviewed by Dirk Schulze.
+
+ SVGFETurbulenceElement doesn't support dynamic invalidation, when attributes change.
+ A typo (noStich instead of nostitch) is also fixed in this patch.
+ https://bugs.webkit.org/show_bug.cgi?id=45809
+
+ Tests: svg/dynamic-updates/SVGFETurbulenceElement-dom-baseFrequency-attr.html
+ svg/dynamic-updates/SVGFETurbulenceElement-dom-numOctaves-attr.html
+ svg/dynamic-updates/SVGFETurbulenceElement-dom-seed-attr.html
+ svg/dynamic-updates/SVGFETurbulenceElement-dom-stitchTiles-attr.html
+ svg/dynamic-updates/SVGFETurbulenceElement-dom-type-attr.html
+ svg/dynamic-updates/SVGFETurbulenceElement-svgdom-baseFrequency-prop.html
+ svg/dynamic-updates/SVGFETurbulenceElement-svgdom-numOctaves-prop.html
+ svg/dynamic-updates/SVGFETurbulenceElement-svgdom-seed-prop.html
+ svg/dynamic-updates/SVGFETurbulenceElement-svgdom-stitchTiles-prop.html
+ svg/dynamic-updates/SVGFETurbulenceElement-svgdom-type-prop.html
+
+ * svg/SVGFETurbulenceElement.cpp:
+ (WebCore::SVGFETurbulenceElement::parseMappedAttribute):
+ (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
+ * svg/SVGFETurbulenceElement.h:
+
+2010-09-15 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [WINCE] Avoid memcpy in TextCodecWinCE::encode
+ https://bugs.webkit.org/show_bug.cgi?id=45468
+
+ * platform/text/wince/TextCodecWinCE.cpp:
+ (WebCore::TextCodecWinCE::encode):
+
+2010-09-14 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ Add custom binding code for DirectoryEntry to allow JSON parameters for Flags
+ https://bugs.webkit.org/show_bug.cgi?id=45724
+
+ No new tests; tests will be added later.
+
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSDirectoryEntryCustom.cpp: Added.
+ (WebCore::JSDirectoryEntry::getFile):
+ (WebCore::JSDirectoryEntry::getDirectory):
+ * bindings/v8/custom/V8DirectoryEntryCustom.cpp: Added.
+ (WebCore::V8DirectoryEntry::getDirectoryCallback):
+ (WebCore::V8DirectoryEntry::getFileCallback):
+ * fileapi/DirectoryEntry.h:
+ * fileapi/DirectoryEntry.idl:
+
+2010-09-14 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Only intercept ESC key press when autocorrection UI is visible.
+ https://bugs.webkit.org/show_bug.cgi?id=45071
+
+ Only intercept ESC key when autocorrection panel is shown. Otherwise pressing
+ ESC will cancel current loading like usual.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::isShowingCorrectionPanel): Query editor client whether autocorrection
+ panel is shown.
+
+ * editing/Editor.h: Added declaration of isShowingCorrectionPanel().
+
+ * editing/EditorCommand.cpp:
+ (WebCore::supportedDismissCorrectionPanel): Only support executeCancelOperation()
+ when autocorrection panel is shown.
+ (WebCore::createCommandMap): Replaced isSupported function pointer for
+ executeCancelOperation() command with supportedDismissCorrectionPanel().
+
+ * loader/EmptyClients.h:
+ (WebCore::EmptyEditorClient::isShowingCorrectionPanel): Dummy implementation of
+ new member method declared in base class.
+
+ * page/EditorClient.h: Declared new member method isShowingCorrectionPanel().
+
+2010-09-14 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r67503.
+ http://trac.webkit.org/changeset/67503
+ https://bugs.webkit.org/show_bug.cgi?id=45802
+
+ This patch broke GTK builds (Requested by jianli_ on #webkit).
+
+ * fileapi/ThreadableBlobRegistry.cpp:
+ (WebCore::BlobRegistryContext::BlobRegistryContext):
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::resourceData):
+ (WebCore::ResourceLoader::addData):
+ * platform/network/BlobResourceHandle.cpp:
+ * platform/network/BlobResourceHandle.h:
+ * platform/network/ResourceHandle.h:
+ * platform/network/mac/ResourceHandleMac.mm:
+ (WebCore::ResourceHandle::bufferedData):
+
+2010-09-14 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Zoom factor for checkboxes and radios.
+ https://bugs.webkit.org/show_bug.cgi?id=45776
+
+ RenderThemeQt does not consider RenderStyle::effectiveZoom when calculating sizes of
+ checkboxes and radios.
+
+ Even with this change the used QStyle must support different sizes for radios and checkboxes.
+ QWindowStyle and QMacStyle, for example, do not.
+
+ * platform/qt/RenderThemeQt.cpp:
+ (WebCore::RenderThemeQt::computeSizeBasedOnStyle):
+
+2010-09-14 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ audio engine: add AudioFileReader files (Mac implementation)
+ https://bugs.webkit.org/show_bug.cgi?id=36475
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/AudioFileReader.h: Added.
+ * platform/audio/mac/AudioFileReaderMac.cpp: Added.
+ (WebCore::createAudioBufferList):
+ (WebCore::destroyAudioBufferList):
+ (WebCore::AudioFileReader::AudioFileReader):
+ (WebCore::AudioFileReader::~AudioFileReader):
+ (WebCore::AudioFileReader::readProc):
+ (WebCore::AudioFileReader::getSizeProc):
+ (WebCore::AudioFileReader::createBus):
+ (WebCore::createBusFromAudioFile):
+ (WebCore::createBusFromInMemoryAudioFile):
+ * platform/audio/mac/AudioFileReaderMac.h: Added.
+ (WebCore::AudioFileReader::data):
+ (WebCore::AudioFileReader::dataSize):
+
+2010-09-14 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Drawing an image outside the bounds of a canvas still causes repaints
+ https://bugs.webkit.org/show_bug.cgi?id=45792
+
+ Some canvas examples, such as http://www.phoboslab.org/biolab/, draw
+ images outide the bounds of the canvas. If the canvas already had a
+ non-empty m_dirtyRect, such draws would cause us to do a repaint of
+ m_dirtyRect again (which goes through the platform-specific invalidation
+ machinery, which can be slow).
+
+ Optimize this by avoiding extra invalidation when the dirty rect
+ does not intersect the canvas bounds.
+
+ Not testable because this avoids additional repaints of m_dirtyRect, but
+ m_dirtyRect has to be non-empty for this to benefit.
+
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::didDraw):
+
+2010-09-14 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Links from "Profiles" don't lead to "Scripts"
+ https://bugs.webkit.org/show_bug.cgi?id=45756
+
+ * inspector/front-end/ProfileDataGridTree.js:
+ (WebInspector.ProfileDataGridNode.prototype.createCell): use standard routine to create resource link
+ * inspector/front-end/inspector.js: code cleanup: removed no-op method
+ (WebInspector.addMainEventListeners):
+
+2010-09-14 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Use codePage instead of TextEncoding
+ https://bugs.webkit.org/show_bug.cgi?id=45466
+
+ Use codePage as member variable to avoid repeated lookup.
+
+ * platform/text/wince/TextCodecWinCE.cpp:
+ (WebCore::newTextCodecWinCE):
+ (WebCore::TextCodecWinCE::TextCodecWinCE):
+ (WebCore::decode):
+ (WebCore::TextCodecWinCE::decode):
+ (WebCore::TextCodecWinCE::encode):
+ * platform/text/wince/TextCodecWinCE.h:
+
+2010-09-14 Adam Barth <abarth@webkit.org>
+
+ Attempted Chromium build fix. The compiler can't tell that
+ ASSERT_NOT_REACHED is not reached and so it demands an initialization
+ of this variable.
+
+ * html/HTMLFontElement.cpp:
+ (WebCore::HTMLFontElement::parseMappedAttribute):
+
+2010-09-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Wheeling over windowed plugins sometimes cause them to disappear
+
+ * plugins/qt/PluginContainerQt.cpp:
+ (PluginClientWrapper::x11Event): Pass on captured mouse wheel events
+ to the effective native window rather than the grandparent widget.
+ We were calling QWidget::winId() which caused a new X11 window to be
+ created for the grandparent widget and generally mess things up.
+
+2010-09-14 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after move of selectedText() method.
+
+ * platform/wx/PasteboardWx.cpp:
+ (WebCore::Pasteboard::writeSelection):
+
+2010-09-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Handle <font size=0> as <font size=1> like any other browser
+ https://bugs.webkit.org/show_bug.cgi?id=39148
+
+ Update font size parser to match HTML5 spec. The main difference here
+ is the handling of 0, which now maps to 1 instead of 3.
+
+ * html/HTMLFontElement.cpp:
+ (WebCore::parseFontSize):
+ (WebCore::HTMLFontElement::cssValueFromFontSizeNumber):
+
+2010-09-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ document.lastModified gives no output if the response doesn't have a Last-Modified header
+ https://bugs.webkit.org/show_bug.cgi?id=8475
+
+ Implement document.lastModified as per HTML5.
+
+ Tests: http/tests/misc/last-modified-parsing.html
+ http/tests/misc/no-last-modified.html
+
+ * dom/Document.cpp:
+ (WebCore::Document::lastModified):
+
+2010-09-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ `document.compatMode` is `undefined` when using `application/xhtml+xml`
+ https://bugs.webkit.org/show_bug.cgi?id=44422
+
+ Moving the compatMode IDL attribute from HTMLDocument.idl to
+ Document.idl fixes this bug and improve compliance with HTML5.
+
+ Test: fast/parser/compatMode-in-xhtml.xhtml
+
+ * dom/Document.cpp:
+ (WebCore::Document::compatMode):
+ * dom/Document.h:
+ * dom/Document.idl:
+ * html/HTMLDocument.cpp:
+ * html/HTMLDocument.h:
+
+2010-09-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Nate Chapin.
+
+ V8 security checks don't account for shadowing named frames
+ https://bugs.webkit.org/show_bug.cgi?id=45700
+
+ Test: http/tests/security/xss-DENIED-frame-name.html
+
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::V8DOMWindow::namedSecurityCheck):
+ - If the property name exists on the object, it will shadow the
+ named property lookup on the window object. That means we need
+ to block access if there's shadowing going on.
+ (WebCore::V8DOMWindow::indexedSecurityCheck):
+ - I made the corresponding change to this function too, but I don't
+ think this one can actually be triggered because JavaScript
+ variable names need to start with a non-digit.
+
+2010-09-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ incorrect tabindex parsing
+ https://bugs.webkit.org/show_bug.cgi?id=21076
+
+ Updated our integer parsing for tabindex to use the algorithm from the
+ HTML5 spec.
+
+ Test: fast/parser/tabindex-parsing-2.html
+
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::parseMappedAttribute):
+ * html/parser/HTMLParserIdioms.cpp:
+ (WebCore::parseHTMLInteger):
+ * html/parser/HTMLParserIdioms.h:
+
+2010-09-14 Brent Fulgham <bfulgham@webkit.org>
+
+ Build correction, no review.
+
+ * WebCore.vcproj/WebCore.vcproj: Exclude OwnPtrCairo.cpp from
+ non-Cairo based builds.
+
+2010-09-14 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ fast/files/apply-blob-url-to-img.html timeout on Leopard
+ https://bugs.webkit.org/show_bug.cgi?id=45576
+
+ The failure on Leopard is caused by the static method
+ ResourceHandle::supportsBufferedData that returns true to indicate that
+ the buffered data support is enabled for blob resource. However,
+ BlobResourceHandle does not support this and we need to override this.
+
+ The fix is to change supportsBufferedData method from static to virtual
+ so that we can override the default behavior in BlobResourceHandle.
+
+ * fileapi/ThreadableBlobRegistry.cpp: Copy BlobData to make it cross-thread.
+ (WebCore::BlobRegistryContext::BlobRegistryContext):
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::resourceData):
+ (WebCore::ResourceLoader::addData):
+ * platform/network/BlobResourceHandle.cpp:
+ (WebCore::BlobResourceHandle::supportsBufferedData): Override the default
+ behavior.
+ * platform/network/BlobResourceHandle.h:
+ * platform/network/ResourceHandle.h: Made supportsBufferedData virtual.
+ * platform/network/mac/ResourceHandleMac.mm:
+ (WebCore::ResourceHandle::bufferedData):
+
+2010-09-14 Brent Fulgham <bfulgham@webkit.org>
+
+ Build correction, no review.
+
+ * WebCore.vcproj/WebCore.vcproj: Add missing OwnPtrCairo.cpp
+ implementation file.
+ * platform/graphics/cairo/OwnPtrCairo.cpp: Add missing include
+ for <cairo.h>
+
+2010-09-14 Chris Guillory <chris.guillory@google.com>
+
+ Reviewed by Chris Fleizach.
+
+ Send all accessibility notifications to Chromium.
+ https://bugs.webkit.org/show_bug.cgi?id=45156
+
+ Use postAccessibilityNotification to pass accessibility notifications
+ to chromium.
+
+ Tests: platform/chromium/accessibility/post-notification-ActiveDescendantChanged.html
+ platform/chromium/accessibility/post-notification-CheckedStateChanged.html
+ platform/chromium/accessibility/post-notification-ChildrenChanged.html
+ platform/chromium/accessibility/post-notification-FocusedUIElementChanged.html
+ platform/chromium/accessibility/post-notification-LayoutComplete.html
+ platform/chromium/accessibility/post-notification-LiveRegionChanged.html
+ platform/chromium/accessibility/post-notification-LoadComplete.html
+ platform/chromium/accessibility/post-notification-MenuListValueChanged.html
+ platform/chromium/accessibility/post-notification-RowCollapsed.html
+ platform/chromium/accessibility/post-notification-RowCountChanged.html
+ platform/chromium/accessibility/post-notification-RowExpanded.html
+ platform/chromium/accessibility/post-notification-ScrolledToAnchor.html
+ platform/chromium/accessibility/post-notification-SelectedChildrenChanged.html
+ platform/chromium/accessibility/post-notification-SelectedTextChanged.html
+ platform/chromium/accessibility/post-notification-ValueChanged.html
+
+ * accessibility/chromium/AXObjectCacheChromium.cpp:
+ (WebCore::AXObjectCache::postPlatformNotification):
+ * page/chromium/ChromeClientChromium.h:
+
+2010-09-14 Darin Adler <darin@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Hang processing href attribute containing a million slashes
+ https://bugs.webkit.org/show_bug.cgi?id=45767
+
+ Test: fast/css/visited-link-hang.html
+
+ * platform/LinkHash.cpp:
+ (WebCore::findSlashDotDotSlash): Added a start position argument and
+ changed types to use size_t consistently instead of a mix.
+ (WebCore::findSlashSlash): Ditto.
+ (WebCore::findSlashDotSlash): Ditto.
+ (WebCore::squeezeOutNullCharacters): Added.
+ (WebCore::cleanSlashDotDotSlashes): Added. Factored out part
+ of cleanPath (see below).
+ (WebCore::mergeDoubleSlashes): Ditto.
+ (WebCore::cleanSlashDotSlashes): Ditto.
+ (WebCore::cleanPath): Changed algorithm to not remove as we go to
+ avoid N^2 behavior; instead replace with null characters and then
+ do a squeeze operation after the fact. Also moved the body of the
+ function out of line since we normally don't have to do any cleaning.
+ This whole thing should go at some point -- it's not the right
+ algorithm -- but this should eliminate the performance problems
+ without changing behavior.
+
+2010-09-14 Nico Weber <thakis@chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ [chromium]: On Mac, let image layer data row order match skia.
+ https://bugs.webkit.org/show_bug.cgi?id=45400
+
+ Make CoreGraphics texture row order match skia's row order, remove all
+ code that worked around this difference. This also fixes a problem where
+ image layers would be drawn upside down.
+
+ Covered by existing layout tests, but we don't run these with
+ compositing yet.
+
+ * platform/graphics/chromium/ContentLayerChromium.cpp:
+ (WebCore::ContentLayerChromium::SharedValues::SharedValues):
+ (WebCore::ContentLayerChromium::updateContents):
+ (WebCore::ContentLayerChromium::updateTextureRect):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::setRootLayerCanvasSize):
+ (WebCore::LayerRendererChromium::drawLayers):
+
+2010-09-14 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Tony Chang.
+
+ applyInlineStyleToNodeRange does not extend run properly
+ https://bugs.webkit.org/show_bug.cgi?id=45616
+
+ The bug was caused by applyInlineStyleToNodeRange's skipping a node whenever it has children.
+ Fixed the bug by only skipping a node that contains the past end node, contains non-editable region,
+ or has a non-editable parent node. Also fixed a bug that applyInlineStyleToNodeRange does not remove
+ styled elements in a run that are identical to the one added. addInlineStyleIfNeeded now removes
+ all styled elements in a run using removeStyleFromRunBeforeApplyingStyle before calling addInlineStyleIfNeeded.
+
+ Test: editing/style/inline-style-extend-run.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::containsNonEditableRegion): Added.
+ (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): See above.
+ (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle): Added, see above.
+ (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Added support for RemoveAlways.
+ (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement): Replaced RemoveAttributesAndElements by RemoveIfNeeded.
+ (WebCore::ApplyStyleCommand::extractInlineStyleToPushDown): Replaced RemoveAttributesAndElements by RemoveIfNeeded.
+ * editing/ApplyStyleCommand.h:
+
+2010-09-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] V8 port: Get inspector up and running
+ https://bugs.webkit.org/show_bug.cgi?id=45771
+
+ * inspector/front-end/WebKit.qrc: Add DebuggerScript.js
+
+2010-09-14 Oliver Hunt <oliver@apple.com>
+
+ PPC Build fix.
+
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::CloneDeserializer::readFile):
+ (WebCore::CloneDeserializer::readTerminal):
+
+2010-09-14 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Andreas Kling.
+
+ [chromium] Remove unused ICU headers
+ https://bugs.webkit.org/show_bug.cgi?id=45698
+
+ Remove unused headers.
+
+ * platform/graphics/chromium/FontCacheLinux.cpp:
+
+2010-09-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Numpad Enter key returns keyCode 0 instead of 13
+ https://bugs.webkit.org/show_bug.cgi?id=45014
+
+ Original patch by Jarred Nicholls <jarred.nicholls@gmail.com>
+
+ There is a missing case statement in the PlatformKeyboardEventQt.cpp
+ file to handle the Enter button on the number pad. Because it is not
+ handled, the keyCode returned in a JavaScript event is 0 rather than 13.
+
+ Test: manual-tests/qt/numpad-enter-key.html
+
+ * manual-tests/qt/numpad-enter-key.html: Added.
+ * platform/qt/PlatformKeyboardEventQt.cpp:
+ (WebCore::windowsKeyCodeForKeyEvent):
+
+2010-09-14 Evan Martin <evan@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] building without debug syms broke after recent refactoring
+ https://bugs.webkit.org/show_bug.cgi?id=45720
+
+ Now that we build WebCore as multiple libraries, we need to adjust the
+ flags to turn off debug symbols for all of these libraries.
+
+ No new tests; should only affect an uncommon build flag.
+
+ * WebCore.gyp/WebCore.gyp:
+
+2010-09-14 Tony Chang <tony@chromium.org>
+
+ Unreviewed, fix chromium compile.
+
+ * platform/graphics/chromium/ImageLayerChromium.h:
+
+2010-09-14 Nico Weber <thakis@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium]: crash less in compositor mode on mac
+ https://bugs.webkit.org/show_bug.cgi?id=45714
+
+ The contents image can go away when the dom is updated. Since the
+ layer tree is updated asynchronously, it needs to ref the native image,
+ else it will hold on to a stale object.
+
+ This still needs to be done for skia, too.
+
+ * platform/graphics/chromium/ImageLayerChromium.h:
+ * platform/graphics/chromium/ImageLayerChromium.cpp:
+
+2010-09-14 Andrey Kosyakov <caseq@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: [Resources panel] [HAR] Need a way to save timing data.
+ Added support for resource timings to HAREntry.
+ https://bugs.webkit.org/show_bug.cgi?id=45663
+
+ * inspector/front-end/HAREntry.js:
+ (WebInspector.HAREntry.prototype._buildTimings):
+ (WebInspector.HAREntry.prototype._toMilliseconds):
+ (WebInspector.HAREntry.prototype._interval):
+
+2010-09-14 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Always set LeftButton in PlatformMouseEvent
+ https://bugs.webkit.org/show_bug.cgi?id=45705
+
+ AEE_POINTER_GET_MOUSE_MODIFIERS always returns 0, so it is impossible to know
+ which button is pressed or released. The current code erroneously sets NoButton.
+ Set LeftButton unconditionally because Brew MP usually runs on touch device.
+
+ * platform/brew/PlatformMouseEventBrew.cpp:
+ (WebCore::PlatformMouseEvent::PlatformMouseEvent):
+
+2010-09-14 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Andreas Kling.
+
+ Move DebuggerScript.js from WebKit/chromium/src/js to WebCore/bindings/v8
+ https://bugs.webkit.org/show_bug.cgi?id=45739
+
+ * bindings/v8/DebuggerScript.js: Added.
+
+2010-09-10 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Implement on-demand reporting of empty CSS rules matched for a node by WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=45530
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::matchRules):
+ (WebCore::CSSStyleSelector::matchRulesForList):
+ (WebCore::CSSStyleSelector::matchUARules):
+ (WebCore::CSSStyleSelector::styleForElement):
+ (WebCore::CSSStyleSelector::pseudoStyleForElement):
+ (WebCore::CSSStyleSelector::styleRulesForElement):
+ (WebCore::CSSStyleSelector::pseudoStyleRulesForElement):
+ * css/CSSStyleSelector.h:
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::getStyles):
+ (WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
+
+2010-09-14 Hyung Song <beergun@company100.net>
+
+ Reviewed by Darin Adler.
+
+ [BREWMP] Set m_size in SharedBuffer::createWithContentsOfFile();
+ https://bugs.webkit.org/show_bug.cgi?id=45701
+
+ SharedBuffer::createWithContentsOfFile() reads file content and saves to
+ result.m_buffer directly, leaving result.m_size unchanged.
+
+ * platform/brew/SharedBufferBrew.cpp:
+ (WebCore::SharedBuffer::createWithContentsOfFile):
+
+2010-09-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Move adjustLexerState to the HTMLTokenizer
+ https://bugs.webkit.org/show_bug.cgi?id=45649
+
+ This function used let us share code between the tree builder and the
+ two other users of the HTMLTokenizer. However, now that the tree
+ builder is all grown up, it can't use this code anymore. The other
+ users would much rather this code lived on HTMLTokenizer and understood
+ <script>. This patch attempts to make them happy.
+
+ * html/parser/HTMLPreloadScanner.cpp:
+ (WebCore::HTMLPreloadScanner::processToken):
+ * html/parser/HTMLTokenizer.cpp:
+ (WebCore::HTMLTokenizer::updateStateFor):
+ * html/parser/HTMLTokenizer.h:
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::scriptEnabled):
+ * html/parser/HTMLTreeBuilder.h:
+ * html/parser/HTMLViewSourceParser.cpp:
+ (WebCore::HTMLViewSourceParser::updateTokenizerState):
+
+2010-09-14 Pierre-Antoine LaFayette <plafayet@codeaurora.org>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r52839): Incomplete repaint of IMG with text-align:center
+ https://bugs.webkit.org/show_bug.cgi?id=40142
+
+ http://trac.webkit.org/changeset/52839 didn't really deal with the inline replaced element case. This just generalizes to all inline content.
+
+ Patch by: Dave Hyatt
+
+ Tests: fast/repaint/block-layout-inline-children-float-positioned.html
+ fast/repaint/block-layout-inline-children-replaced.html
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::layoutInlineChildren):
+
+2010-09-14 Balazs Kelemen <kb@inf.u-szeged.hu>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Cookie operations should use NetworkingContext
+ https://bugs.webkit.org/show_bug.cgi?id=45745
+ No new functionality so no new tests.
+
+ * platform/qt/CookieJarQt.cpp:
+ (WebCore::cookieJar): Use the NetworkingContext for obtaining the QNetworkAccessManager
+ instead of directly accessing the FrameLoaderClient.
+
+2010-09-14 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r67449.
+ http://trac.webkit.org/changeset/67449
+ https://bugs.webkit.org/show_bug.cgi?id=45746
+
+ This change makes tree red. (Requested by pfeldman on
+ #webkit).
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
+ (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
+ (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
+ (WebCore::ApplyStyleCommand::extractInlineStyleToPushDown):
+ * editing/ApplyStyleCommand.h:
+
+2010-09-14 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, reverting changes r67451 and r67451.
+ Broke lots of builders.
+
+ Only intercept ESC key press when autocorrection UI is visible.
+ https://bugs.webkit.org/show_bug.cgi?id=45071
+
+ * editing/Editor.cpp:
+ * editing/Editor.h:
+ * editing/EditorCommand.cpp:
+ (WebCore::createCommandMap):
+ * loader/EmptyClients.h:
+ * page/EditorClient.h:
+
+2010-09-14 Kinuko Yasuda <kinuko@chromium.org>
+
+ Unreviewed; an attempt to fix Chromium Windows build.
+
+ * fileapi/FileEntry.cpp:
+
+2010-09-13 Andrey Kosyakov <caseq@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: provide support for opening external navigation for links within certain elements
+ Use default handling for clicks on links that have target="_blank".
+ Add option for external navigation to URL audit formatter.
+ https://bugs.webkit.org/show_bug.cgi?id=45671
+
+ * inspector/front-end/AuditFormatters.js:
+ (WebInspector.AuditFormatters.url):
+ * inspector/front-end/inspector.js:
+
+2010-09-14 Dan Bernstein <mitz@apple.com>
+
+ Build fix.
+
+ * editing/EditorCommand.cpp:
+
+2010-09-14 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Only intercept ESC key press when autocorrection UI is visible.
+ https://bugs.webkit.org/show_bug.cgi?id=45071
+
+ Only intercept ESC key when autocorrection panel is shown. Otherwise pressing
+ ESC will cancel current loading like usual.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::isShowingCorrectionPanel): Query editor client whether autocorrection
+ panel is shown.
+
+ * editing/Editor.h: Added declaration of isShowingCorrectionPanel().
+
+ * editing/EditorCommand.cpp:
+ (WebCore::supportedDismissCorrectionPanel): Only support executeCancelOperation()
+ when autocorrection panel is shown.
+ (WebCore::createCommandMap): Replaced isSupported function pointer for
+ executeCancelOperation() command with supportedDismissCorrectionPanel().
+
+ * loader/EmptyClients.h:
+ (WebCore::EmptyEditorClient::isShowingCorrectionPanel): Dummy implementation of
+ new member method declared in base class.
+
+ * page/EditorClient.h: Declared new member method isShowingCorrectionPanel().
+
+2010-09-14 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Remove TextBreakIteratorInternalICUBrew.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=45691
+
+ Brew MP no longer depends on ICU for internationalization.
+ Remove TextBreakIteratorInternalICUBrew.cpp.
+
+ * platform/text/brew/TextBreakIteratorInternalICUBrew.cpp: Removed.
+
+2010-09-14 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Tony Chang.
+
+ applyInlineStyleToNodeRange does not extend run properly
+ https://bugs.webkit.org/show_bug.cgi?id=45616
+
+ The bug was caused by applyInlineStyleToNodeRange's skipping a node whenever it has children.
+ Fixed the bug by only skipping a node that contains the past end node, contains non-editable region,
+ or has a non-editable parent node. Also fixed a bug that applyInlineStyleToNodeRange does not remove
+ styled elements in a run that are identical to the one added. addInlineStyleIfNeeded now removes
+ all styled elements in a run using removeStyleFromRunBeforeApplyingStyle before calling addInlineStyleIfNeeded.
+
+ Test: editing/style/inline-style-extend-run.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::containsNonEditableRegion): Added.
+ (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): See above.
+ (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle): Added, see above.
+ (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Added support for RemoveAlways.
+ (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement): Replaced RemoveAttributesAndElements by RemoveIfNeeded.
+ (WebCore::ApplyStyleCommand::extractInlineStyleToPushDown): Replaced RemoveAttributesAndElements by RemoveIfNeeded.
+ * editing/ApplyStyleCommand.h:
+
+2010-09-13 Yuta Kitamura <yutak@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Add one #if guard block to fix Qt builds.
+
+ Web Inspector: WebSocket in Resources tab
+ https://bugs.webkit.org/show_bug.cgi?id=40768
+
+ * inspector/InspectorResource.cpp:
+
+2010-09-13 Yuta Kitamura <yutak@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Add WebSocket resource type to Web Inspector.
+
+ When a new WebSocket connection is established, a line for that connection
+ will appear in Web Inspector's Resources tab. If the resource name is
+ clicked, the details of handshake request and response will be shown.
+
+ Web Inspector: WebSocket in Resources tab
+ https://bugs.webkit.org/show_bug.cgi?id=40768
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::addResource): WebSocket resource does not
+ have an associated loader, thus frame might be null. Need to check it.
+ (WebCore::InspectorController::removeResource): Ditto.
+ (WebCore::InspectorController::didCreateWebSocket):
+ (WebCore::InspectorController::willSendWebSocketHandshakeRequest):
+ (WebCore::InspectorController::didReceiveWebSocketHandshakeResponse):
+ (WebCore::InspectorController::didCloseWebSocket):
+ * inspector/InspectorController.h:
+ * inspector/InspectorResource.cpp: Add null checks of m_loader and m_frame,
+ because WebSocket does not have a loader and we need to allow null for
+ these variables.
+ (WebCore::createReadableStringFromBinary):
+ (WebCore::InspectorResource::InspectorResource):
+ (WebCore::InspectorResource::create): Factory function of
+ regular (non-WebSocket) resources.
+ (WebCore::InspectorResource::createWebSocket): Factory function of
+ WebSocket resources.
+ (WebCore::InspectorResource::updateWebSocketRequest):
+ (WebCore::InspectorResource::updateWebSocketResponse):
+ (WebCore::InspectorResource::updateScriptObject): m_frame->document() becomes
+ available when Frame::setDocument() is called. We cannot obtain documentURL
+ during the constructor or updateRequest() function, because m_frame->document()
+ is not available yet at that point and documentURL will contain a wrong URL.
+ As far as I know, updateScriptObject() is the only place where we can safely
+ obtain documentURL.
+ (WebCore::InspectorResource::cachedResource):
+ (WebCore::InspectorResource::type):
+ (WebCore::InspectorResource::resourceData):
+ * inspector/InspectorResource.h:
+ (WebCore::InspectorResource::):
+ (WebCore::InspectorResource::markWebSocket):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.Type.toString):
+ (WebInspector.Resource.prototype.set type):
+ (WebInspector.Resource.prototype._mimeTypeIsConsistentWithType):
+ * inspector/front-end/ResourceView.js:
+ (WebInspector.ResourceView.prototype._refreshRequestHeaders):
+ (WebInspector.ResourceView.prototype._refreshResponseHeaders):
+ (WebInspector.ResourceView.prototype._refreshHeaders):
+ * inspector/front-end/inspector.css:
+ (.resources-category-websockets, .resources-category-other):
+ (.resources-category-websockets .resources-graph-bar):
+ (.resources-category-websockets.resource-cached .resources-graph-bar):
+ * inspector/front-end/inspector.js:
+ (WebInspector.loaded):
+ (WebInspector.updateResource):
+ * websockets/WebSocketChannel.cpp:
+ (WebCore::WebSocketChannel::WebSocketChannel):
+ (WebCore::WebSocketChannel::disconnect):
+ (WebCore::WebSocketChannel::didOpen):
+ (WebCore::WebSocketChannel::didClose):
+ (WebCore::WebSocketChannel::processBuffer):
+ (WebCore::WebSocketChannel::identifier):
+ * websockets/WebSocketChannel.h:
+
+2010-09-13 W. James MacLean <wjmaclean@google.com>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] Thumbnails not generated for GPU Rendered Pages
+ https://bugs.webkit.org/show_bug.cgi?id=44127
+
+ Replicates existing functionality, use existing tests.
+ Adds pixel-readback for GPU composited pages to allow for thumbnailing,
+ printing and other services to work with GPU rendered pages.
+
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::getFramebufferPixels):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ (WebCore::LayerRendererChromium::rootLayerTextureSize):
+
+2010-09-13 Kinuko Yasuda <kinuko@chromium.org>
+
+ Unreviewed, build fix for Gtk.
+
+ * bindings/js/JSEntryCustom.cpp:
+
+2010-09-13 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Make FileEntry and DirectoryEntry methods accessible via Entry instance
+ https://bugs.webkit.org/show_bug.cgi?id=45553
+
+ FileEntry- and DirectoryEntry- specific methods must be available on Entry object based on its internal type.
+
+ Added custom toJS/toV8 implementation to Entry interface.
+
+ No new tests; test will be added later when we have complete implementation for the API.
+
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSEntryCustom.cpp: Added.
+ (WebCore::toJS):
+ * bindings/v8/custom/V8EntryCustom.cpp: Added.
+ (WebCore::toV8):
+ * fileapi/DirectoryEntry.h: Nits fix.
+ * fileapi/DirectoryEntry.idl: Added ConvertUndefinedOrNullToString to path parameter.
+ * fileapi/Entry.idl: Added CustomToJS attribute.
+ * fileapi/FileEntry.cpp:
+ (WebCore::FileEntry::createWriter):
+ (WebCore::FileEntry::file):
+ * fileapi/FileEntry.h:
+ * fileapi/FileEntry.idl:
+
+2010-09-13 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION: In Gmail, a crash occurs at getDoubleValue() when applying a text color to a new line
+ https://bugs.webkit.org/show_bug.cgi?id=45632
+
+ Test: editing/execCommand/query-font-size-with-typing-style.html
+
+ The crash was caused by selectionStartCSSPropertyValue's deleting nodeToRemove before
+ retrieving the font-size property. Fixed the bug by moving the removal code to the end of the function.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::selectionStartCSSPropertyValue):
+
+2010-09-13 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Darin Adler.
+
+ [BREWMP] Remove WebCore namespace in SSLKeyGeneratorBrew.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=45690
+
+ WebCore namespace is not required because getSupportedKeySizes and signedPublicKeyAndChallengeString are already
+ in namespace WebCore block.
+
+ * platform/brew/SSLKeyGeneratorBrew.cpp:
+ (WebCore::getSupportedKeySizes):
+ (WebCore::signedPublicKeyAndChallengeString):
+
+2010-09-13 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Code simplification needed in Atk Wrapper
+ https://bugs.webkit.org/show_bug.cgi?id=45687
+
+ Use TextIterator::rangeLength() to calculate endOffset
+
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (getSelectionOffsetsForObject): Don't manually iterate over a
+ artificial new range but just call TextIterator::rangeLength on
+ the range created between the start and end positions.
+
+2010-09-13 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Alice Liu.
+
+ Clean up xcode project.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2010-09-13 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ JavaScript dialog should not deactivate media element
+ https://bugs.webkit.org/show_bug.cgi?id=45688
+
+ Test: http/tests/media/reload-after-dialog.html
+
+ * bindings/generic/ActiveDOMCallback.cpp:
+ (WebCore::ActiveDOMObjectCallbackImpl::suspend): Add ReasonForSuspension parameter.
+
+ * bindings/js/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::setJavaScriptPaused): Pass new parameter to suspendActiveDOMObjects.
+
+ * dom/ActiveDOMObject.cpp:
+ (WebCore::ActiveDOMObject::suspend): Add ReasonForSuspension parameter.
+ * dom/ActiveDOMObject.h:
+
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): Ditto.
+ * dom/ScriptExecutionContext.h:
+
+ * history/CachedFrame.cpp:
+ (WebCore::CachedFrame::CachedFrame): Pass new parameter to suspendActiveDOMObjects.
+
+ * html/HTMLMarqueeElement.cpp:
+ (WebCore::HTMLMarqueeElement::suspend): Add ReasonForSuspension parameter.
+ * html/HTMLMarqueeElement.h:
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::stop): Deal with element being suspended.
+ (WebCore::HTMLMediaElement::suspend): Do nothing unless reason for suspension is document
+ becoming inactive.
+ * html/HTMLMediaElement.h:
+
+ * page/PageGroupLoadDeferrer.cpp:
+ (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer): Pass WillShowDialog to suspendActiveDOMObjects.
+
+ * page/SuspendableTimer.cpp:
+ (WebCore::SuspendableTimer::suspend): Add ReasonForSuspension parameter.
+ * page/SuspendableTimer.h:
+
+ * websockets/WebSocket.cpp:
+ (WebCore::WebSocket::suspend): Ditto.
+ * websockets/WebSocket.h:
+
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::suspend): Ditto.
+ * xml/XMLHttpRequest.h:
+
+2010-09-13 Sam Weinig <sam@webkit.org>
+
+ Fix the mac build.
+
+ * page/mac/EventHandlerMac.mm:
+ (WebCore::EventHandler::passMousePressEventToSubframe):
+
+2010-09-13 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Can't scroll on Bugzilla patch review pages on Mac with WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=43555
+
+ <rdar://problem/8421386> WebKit2: gmail.com is completely unresponsive to clicks
+ <rdar://problem/8276298> Can't scroll on Bugzilla patch review pages on Mac with WebKit2 (43555)
+
+ * page/mac/EventHandlerMac.mm:
+ (WebCore::EventHandler::passWheelEventToWidget):
+ (WebCore::frameHasPlatformWidget):
+ (WebCore::EventHandler::passMousePressEventToSubframe):
+ (WebCore::EventHandler::passMouseMoveEventToSubframe):
+ (WebCore::EventHandler::passMouseReleaseEventToSubframe):
+ Add WebKit2 mode for these functions based on the presence of a platform widget for a
+ FrameView.
+
+2010-09-13 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [WINCE] Buildfix for ViewportArguments.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=45678
+
+ Use fabs() instead of abs().
+ This patch also fixes the return value, when
+ the value is between -1 and 1.
+
+ * dom/ViewportArguments.cpp:
+ (WebCore::findUserScalableValue):
+
+2010-09-13 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Preparation for eliminating deprecatedParseURL
+ https://bugs.webkit.org/show_bug.cgi?id=45695
+
+ Added new HTMLParserIdioms source file, with a name inspired by the HTML
+ specification, which has a section defining things like "space character"
+ that talks about common parser idioms. These are idioms for the main HTML
+ parser and for parsers for various microlanguages as well.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ Added HTMLParserIdioms.
+
+ * css/CSSHelper.h: Fixed indentation and comments here. Point to the new
+ stripLeadingAndTrailingHTMLSpaces function.
+
+ * html/parser/HTMLParserIdioms.cpp: Added.
+ * html/parser/HTMLParserIdioms.h: Added.
+
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::skipLeadingWhitespace):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeLeadingWhitespace):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeLeadingNonWhitespace):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemainingWhitespace):
+ Updated for name changes.
+
+ * html/parser/HTMLTreeBuilder.h: Moved functions to HTMLParserIdioms.h.
+
+ * html/HTMLInputElement.cpp:
+ * html/HTMLMeterElement.cpp:
+ * html/HTMLProgressElement.cpp:
+ * html/StepRange.cpp:
+ * rendering/RenderSlider.cpp:
+ Updated includes.
+
+ * svg/SVGImageLoader.cpp:
+ (WebCore::SVGImageLoader::sourceURI): Fixed incorrect use of deprecatedParseURL.
+ This is for use on the attribute value before building the URL, not on the URL
+ after building it. I did not add a test case; this is an obscure corner and soon
+ we will be moving to stripLeadingAndTrailingHTMLSpaces anyway.
+ * wml/WMLImageLoader.cpp:
+ (WebCore::WMLImageLoader::sourceURI): Ditto.
+
+2010-09-13 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: REGRESSION: WebKit does not report label of web popup buttons
+ https://bugs.webkit.org/show_bug.cgi?id=45715
+
+ Test: platform/mac/accessibility/popup-button-title.html
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::title):
+
+2010-09-13 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ Expose Flags constructor if FileSystem API is Enabled
+ https://bugs.webkit.org/show_bug.cgi?id=45165
+
+ This change also includes:
+ - Changed Flags' attribute names from UPPERCASE to camelCase to reflect the recent spec change.
+ http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interface
+ - Enhanced EnabledAtRuntime attribute to take parameter that is used to generate a RuntimeEnabledFeatures method name.
+
+ No new tests; tests will be added when we fully expose the interface.
+
+ * bindings/v8/V8DOMWindowCustom.cpp: Added custom getter for FlagsConstructor.
+ * fileapi/Flags.idl: Changed attribute names to camelCase.
+ * page/DOMWindow.idl: Exposed Flags constructor.
+
+ * bindings/scripts/CodeGenerator.pm: Updated the WK_lcfirst hack to work around getter method for 'create' (create() should be avoided as it's widely used to instantiate an object).
+ * bindings/scripts/CodeGeneratorV8.pm: Added EnabledAtRuntime=FeatureName support.
+ * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
+ (WebDOMTestObj::create):
+ (WebDOMTestObj::setCreate):
+ * bindings/scripts/test/CPP/WebDOMTestObj.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ (webkit_dom_test_obj_set_property):
+ (webkit_dom_test_obj_get_property):
+ (webkit_dom_test_obj_class_init):
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.mm:
+ * bindings/scripts/test/TestObj.idl:
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::TestObjInternal::createAttrGetter):
+ (WebCore::TestObjInternal::createAttrSetter):
+ (WebCore::TestObjInternal::enabledAtRuntimeAttr1AttrGetter):
+ (WebCore::TestObjInternal::enabledAtRuntimeAttr1AttrSetter):
+ (WebCore::TestObjInternal::enabledAtRuntimeAttr2AttrGetter):
+ (WebCore::TestObjInternal::enabledAtRuntimeAttr2AttrSetter):
+ (WebCore::TestObjInternal::enabledAtRuntimeMethod1Callback):
+ (WebCore::TestObjInternal::enabledAtRuntimeMethod2Callback):
+ (WebCore::ConfigureV8TestObjTemplate):
+
+2010-09-13 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ "Implement" EOF processing in AfterBodyMode and AfterAfterBodyMode
+ https://bugs.webkit.org/show_bug.cgi?id=45647
+
+ Implements the notImplemented by doing nothing, which is the proper
+ behavior according to the spec.
+
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processEndOfFile):
+
+2010-09-13 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ More trivial EOF handling in tree builder
+ https://bugs.webkit.org/show_bug.cgi?id=45648
+
+ The spec says to treat these modes like the InBodyMode, which is what
+ this patch does. Doing so is indistinguishable from our current
+ behavior, which is why we didn't catch this based on tests.
+
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processEndOfFile):
+
+2010-09-13 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ SharedGraphicsContext3D's texture cache holds on to images after free
+ https://bugs.webkit.org/show_bug.cgi?id=45706
+
+ Each SharedGraphicsContext3D keeps a cache of uploaded textures keyed by NativeImagePtrs.
+ Whenever the backing native image is deleted it needs to let the SharedGraphicsContext3D know
+ so that the cache entry and associated texture can also be removed.
+
+ * platform/graphics/gpu/SharedGraphicsContext3D.cpp:
+ (WebCore::SharedGraphicsContext3D::SharedGraphicsContext3D):
+ (WebCore::SharedGraphicsContext3D::~SharedGraphicsContext3D):
+ (WebCore::SharedGraphicsContext3D::removeTextureFor):
+ (WebCore::SharedGraphicsContext3D::removeTexturesFor):
+ (WebCore::SharedGraphicsContext3D::allContexts):
+ * platform/graphics/gpu/SharedGraphicsContext3D.h:
+ * platform/graphics/skia/NativeImageSkia.cpp:
+ (WebCore::NativeImageSkia::~NativeImageSkia):
+ * platform/graphics/skia/NativeImageSkia.h:
+
+2010-09-13 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by David Kilzer.
+
+ AX: accessibilityIsIgnored is returning nil when return value expects a BOOL
+ https://bugs.webkit.org/show_bug.cgi?id=45548
+
+ Test: platform/mac/accessibility/element-is-ignored.html
+
+ * accessibility/mac/AccessibilityObjectWrapper.mm:
+ (-[AccessibilityObjectWrapper accessibilityIsIgnored]):
+
+2010-09-13 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ CrashTracer: 874 crashes in Safari at com.apple.WebCore: WebCore::AccessibilityTable::isTableExposableThroughAccessibility + 663
+ https://bugs.webkit.org/show_bug.cgi?id=45697
+
+ Inside of AccessibilityTableRow, parentTable() should not use getOrCreate() on the parent table, because the render table may
+ be in a bad state and accessing internal variables can lead to a crash.
+
+ Test: platform/mac/accessibility/updating-attribute-in-table-row-crash.html
+
+ * accessibility/AccessibilityTableRow.cpp:
+ (WebCore::AccessibilityTableRow::parentTable):
+
+2010-09-13 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Implement EOF handling in TextMode
+ https://bugs.webkit.org/show_bug.cgi?id=45644
+
+ This patch is actually covered by a bunch of tests. We were just
+ magically passing the tests before because of some nutty code in
+ Document.cpp.
+
+ * dom/Document.cpp:
+ (WebCore::Document::implicitClose):
+ - This code was masking the notImplemented in the tree builder.
+ I also removed the use of the setting because it wasn't working
+ properly anyway. I'll implement a working version shortly.
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processEndOfFile):
+ - Implement per the spec.
+
+2010-09-13 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Sam Weining.
+
+ Paste should be implemented in WebCore like Copy and Cut for Mac also.
+ https://bugs.webkit.org/show_bug.cgi?id=45494
+ <rdar://problem/7660537>
+
+ On the Mac platform, the implementation of the paste operation is all done
+ at the WebKit level. In order to support it on WebKit2 it is necessary to
+ refactor the code and move this functionality at the level of WebCore like
+ we already have on Windows.
+ The original code relies on some in AppKit functions that call back into
+ WebKit causing problems in WebKit2. All this functionality has been moved
+ at the level of the editor client where it can be dealt with appropriately.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::shouldInsertFragment):
+ * editing/mac/EditorMac.mm: extended to support Mail specific scenarios.
+ (WebCore::Editor::pasteWithPasteboard):
+ * loader/EmptyClients.h:
+ (WebCore::EmptyFrameLoaderClient::canShowMIMETypeAsHTML): Added.
+ (WebCore::EmptyEditorClient::documentFragmentFromAttributedString): Added.
+ (WebCore::EmptyEditorClient::setInsertionPasteboard): Added to support Mail.
+ * loader/FrameLoaderClient.h:
+ * page/EditorClient.h:
+ * platform/Pasteboard.h:
+ * platform/mac/PasteboardMac.mm:
+ (WebCore::Pasteboard::writeSelection): replaced call to Appkit with one that
+ doesn't calll back into WebKit.
+ (WebCore::Pasteboard::documentFragmentWithImageResource): Re-implemented at the
+ WebCore level.
+ (WebCore::Pasteboard::documentFragmentWithRtf): Re-implemented at the
+ WebCore level.
+ (WebCore::uniqueURLWithRelativePart): Added.
+ (WebCore::Pasteboard::documentFragment): Extended to include all the functionality
+ provided in documentFragmentFromPasteboard in WebHTMLView.mm.
+
+2010-09-13 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Gtk] Reduce the size of the shadow buffer in the paths using the clip region
+ https://bugs.webkit.org/show_bug.cgi?id=44699
+
+ Intersect the clip bounding rect with the path that we are going
+ to use to create the shadow in order to reduce the region we have
+ to blur.
+
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::drawPathShadow):
+
+210-09-13 Darin Fisher <darin@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add option to conditionally compile smooth scrolling support.
+ https://bugs.webkit.org/show_bug.cgi?id=45689
+
+ The OS(WINDOWS) conditional becomes unnecessary since
+ ENABLE(SMOOTH_SCROLLING) should only be specified on
+ platforms that have a smooth scrolling implementation.
+
+ * platform/ScrollAnimator.cpp:
+ * platform/ScrollAnimatorWin.cpp:
+ * platform/ScrollAnimatorWin.h:
+
+2010-09-13 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Kent Tamura.
+
+ Move functions of StyledMarkupAccumulator below that of MarkupAccumulator
+ https://bugs.webkit.org/show_bug.cgi?id=45624
+
+ Moved the declaration of StyledMarkupAccumulator and the definitions of its member functions
+ to below the definitions of MarkupAccumulator's member functions.
+
+ No new tests are added since this is a cleanup.
+
+ * editing/markup.cpp:
+ (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
+ (WebCore::StyledMarkupAccumulator::appendElement):
+ (WebCore::StyledMarkupAccumulator::shouldAnnotate):
+ (WebCore::StyledMarkupAccumulator::wrapWithNode):
+ (WebCore::StyledMarkupAccumulator::wrapWithStyleNode):
+ (WebCore::StyledMarkupAccumulator::takeResults):
+ (WebCore::StyledMarkupAccumulator::appendText):
+ (WebCore::StyledMarkupAccumulator::renderedText):
+ (WebCore::StyledMarkupAccumulator::stringValueForRange):
+ (WebCore::styleFromMatchedRulesForElement):
+ (WebCore::StyledMarkupAccumulator::removeExteriorStyles):
+ (WebCore::needInterchangeNewlineAfter):
+ (WebCore::styleFromMatchedRulesAndInlineDecl):
+ (WebCore::removeEnclosingMailBlockquoteStyle):
+ (WebCore::removeDefaultStyles):
+
+2010-09-13 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Leak in the GraphicsContextCairo drawPathShadow
+ https://bugs.webkit.org/show_bug.cgi?id=44959
+
+ Fix a leak of the cairo_path.
+
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::drawPathShadow):
+ * platform/graphics/cairo/OwnPtrCairo.cpp:
+ (WTF::cairo_path_t):
+ * platform/graphics/cairo/OwnPtrCairo.h:
+
+2010-09-13 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Fix </sarcasm>
+ https://bugs.webkit.org/show_bug.cgi?id=45645
+
+ Umm... Yeah.
+
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processEndTagForInBody):
+
+2010-09-13 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Reviewed by Darin Adler.
+
+ [WML] Fix build breaks when WML is enabled
+ https://bugs.webkit.org/show_bug.cgi?id=45628
+
+ There are build breaks by Bug 22382 when WML is enabled. The handleLinkClick() has an event parameter.
+ So, we need to set an event when wml invoke the handleLinkClick(). And, doTextFieldCommandFromEvent()
+ was moved to editor. So, we need to mofidy the invocation in WMLInputElement.cpp
+
+ * wml/WMLAElement.cpp:
+ (WebCore::WMLAElement::defaultEventHandler):
+ * wml/WMLInputElement.cpp:
+ (WebCore::WMLInputElement::defaultEventHandler):
+
+2010-09-13 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] When a feature is disabled by default, the source necessary to build it are not included in the distribution
+ https://bugs.webkit.org/show_bug.cgi?id=45230
+
+ No new tests as this is just a build change.
+
+ * GNUmakefile.am: Move as many sources as possible to the SOURCES primary.
+ Others should be moved over time as we solve issues with them.
+
+2010-09-13 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r64816-r64889): Crash in WebCore::AccessibilityRenderObject
+ https://bugs.webkit.org/show_bug.cgi?id=43807
+
+ Ensure that visiblePositionForPoint can handle non RenderBoxModelObject types.
+
+ Test: platform/mac/accessibility/visible-position-crash-for-text-node.html
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::visiblePositionForPoint):
+
+2010-09-13 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] DOM listeners get wrong keycodes for some keys
+ https://bugs.webkit.org/show_bug.cgi?id=43365
+
+ Produce the proper keycodes for the print screen key as well as the
+ keypad insert and delete keys.
+
+ * platform/qt/PlatformKeyboardEventQt.cpp:
+ (WebCore::windowsKeyCodeForKeyEvent): Fix keycode translation for the mentioned keys.
+
+2010-09-13 Jonathan Dixon <joth@chromium.org>
+
+ Reviewed by Steve Block.
+
+ [chromium] Port test shell geolocation fixes to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=45313
+
+ Also re-apply rolled out patch http://trac.webkit.org/changeset/66886 :-
+ Add missing virtual destructor to the abstract base class.
+
+ * platform/chromium/GeolocationServiceChromium.cpp:
+ (WebCore::GeolocationServiceBridge::~GeolocationServiceBridge):
+ * platform/chromium/GeolocationServiceChromium.h:
+
+2010-09-13 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: upstream testExpandScope debugger test
+ https://bugs.webkit.org/show_bug.cgi?id=45260
+
+ Test: inspector/debugger-expand-scope.html
+
+ * inspector/front-end/InjectedScript.js: return "Arguments" as class name for arguments variable in v8.
+ (injectedScriptConstructor.):
+
+2010-09-13 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] ATs should be able to select/unselect text
+ https://bugs.webkit.org/show_bug.cgi?id=25673
+
+ Implement AtkText's setSelection and removeSelection functions
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::visiblePositionRangeForRange):
+ Moved some GTK specific code from a ifdef-endif region to
+ AccessibilityObjectAtk.cpp
+ * accessibility/AccessibilityObject.h:
+ * accessibility/gtk/AccessibilityObjectAtk.cpp:
+ (WebCore::AccessibilityObject::getLengthForTextRange): New.
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (webkit_accessible_text_remove_selection): Implemented following
+ the lead of GAIL's implementation of the AtkText interface.
+ (webkit_accessible_text_set_selection): Implemented following
+ the lead of GAIL's implementation of the AtkText interface.
+ (webkit_accessible_text_set_caret_offset): Changed to directly use
+ visiblePositionRangeForRange now that there's no longer a problem
+ with that, as it was in the past (only worked for text controls).
+
+2010-08-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Antti Koivisto.
+
+ Update support for the viewport meta tag algorithm, to
+ match the following draft spec:
+
+ http://people.opera.com/rune/TR/ED-css-viewport-20100806/
+
+ Add common handling of viewport meta tag based on new Opera spec
+ https://bugs.webkit.org/show_bug.cgi?id=44201
+
+ Tests: fast/viewport/viewport-1.html
+ fast/viewport/viewport-10.html
+ fast/viewport/viewport-100.html
+ fast/viewport/viewport-101.html
+ fast/viewport/viewport-102.html
+ fast/viewport/viewport-103.html
+ fast/viewport/viewport-104.html
+ fast/viewport/viewport-105.html
+ fast/viewport/viewport-106.html
+ fast/viewport/viewport-107.html
+ fast/viewport/viewport-108.html
+ fast/viewport/viewport-109.html
+ fast/viewport/viewport-11.html
+ fast/viewport/viewport-110.html
+ fast/viewport/viewport-111.html
+ fast/viewport/viewport-112.html
+ fast/viewport/viewport-113.html
+ fast/viewport/viewport-114.html
+ fast/viewport/viewport-115.html
+ fast/viewport/viewport-116.html
+ fast/viewport/viewport-117.html
+ fast/viewport/viewport-118.html
+ fast/viewport/viewport-119.html
+ fast/viewport/viewport-12.html
+ fast/viewport/viewport-120.html
+ fast/viewport/viewport-121.html
+ fast/viewport/viewport-122.html
+ fast/viewport/viewport-123.html
+ fast/viewport/viewport-124.html
+ fast/viewport/viewport-125.html
+ fast/viewport/viewport-126.html
+ fast/viewport/viewport-127.html
+ fast/viewport/viewport-13.html
+ fast/viewport/viewport-14.html
+ fast/viewport/viewport-15.html
+ fast/viewport/viewport-16.html
+ fast/viewport/viewport-17.html
+ fast/viewport/viewport-18.html
+ fast/viewport/viewport-19.html
+ fast/viewport/viewport-2.html
+ fast/viewport/viewport-20.html
+ fast/viewport/viewport-21.html
+ fast/viewport/viewport-22.html
+ fast/viewport/viewport-23.html
+ fast/viewport/viewport-24.html
+ fast/viewport/viewport-25.html
+ fast/viewport/viewport-26.html
+ fast/viewport/viewport-27.html
+ fast/viewport/viewport-28.html
+ fast/viewport/viewport-29.html
+ fast/viewport/viewport-3.html
+ fast/viewport/viewport-30.html
+ fast/viewport/viewport-31.html
+ fast/viewport/viewport-32.html
+ fast/viewport/viewport-33.html
+ fast/viewport/viewport-34.html
+ fast/viewport/viewport-35.html
+ fast/viewport/viewport-36.html
+ fast/viewport/viewport-37.html
+ fast/viewport/viewport-38.html
+ fast/viewport/viewport-39.html
+ fast/viewport/viewport-4.html
+ fast/viewport/viewport-40.html
+ fast/viewport/viewport-41.html
+ fast/viewport/viewport-42.html
+ fast/viewport/viewport-43.html
+ fast/viewport/viewport-44.html
+ fast/viewport/viewport-45.html
+ fast/viewport/viewport-46.html
+ fast/viewport/viewport-47.html
+ fast/viewport/viewport-48.html
+ fast/viewport/viewport-49.html
+ fast/viewport/viewport-5.html
+ fast/viewport/viewport-50.html
+ fast/viewport/viewport-51.html
+ fast/viewport/viewport-52.html
+ fast/viewport/viewport-53.html
+ fast/viewport/viewport-54.html
+ fast/viewport/viewport-55.html
+ fast/viewport/viewport-56.html
+ fast/viewport/viewport-57.html
+ fast/viewport/viewport-58.html
+ fast/viewport/viewport-59.html
+ fast/viewport/viewport-6.html
+ fast/viewport/viewport-60.html
+ fast/viewport/viewport-61.html
+ fast/viewport/viewport-62.html
+ fast/viewport/viewport-63.html
+ fast/viewport/viewport-64.html
+ fast/viewport/viewport-65.html
+ fast/viewport/viewport-66.html
+ fast/viewport/viewport-67.html
+ fast/viewport/viewport-68.html
+ fast/viewport/viewport-69.html
+ fast/viewport/viewport-7.html
+ fast/viewport/viewport-70.html
+ fast/viewport/viewport-71.html
+ fast/viewport/viewport-72.html
+ fast/viewport/viewport-73.html
+ fast/viewport/viewport-74.html
+ fast/viewport/viewport-75.html
+ fast/viewport/viewport-76.html
+ fast/viewport/viewport-77.html
+ fast/viewport/viewport-78.html
+ fast/viewport/viewport-79.html
+ fast/viewport/viewport-8.html
+ fast/viewport/viewport-80.html
+ fast/viewport/viewport-81.html
+ fast/viewport/viewport-82.html
+ fast/viewport/viewport-83.html
+ fast/viewport/viewport-84.html
+ fast/viewport/viewport-85.html
+ fast/viewport/viewport-86.html
+ fast/viewport/viewport-87.html
+ fast/viewport/viewport-88.html
+ fast/viewport/viewport-9.html
+ fast/viewport/viewport-90.html
+
+ * dom/ViewportArguments.cpp:
+ (WebCore::findConfigurationForViewportData):
+ (WebCore::findSizeValue):
+ (WebCore::findScaleValue):
+ (WebCore::findUserScalableValue):
+ (WebCore::findTargetDensityDPIValue):
+ (WebCore::setViewportFeature):
+ * dom/ViewportArguments.h:
+ (WebCore::ViewportArguments::):
+ (WebCore::ViewportArguments::ViewportArguments):
+ (WebCore::ViewportArguments::hasCustomArgument):
+
+2010-09-13 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Don't add empty strings to list of supported image MIME types
+ https://bugs.webkit.org/show_bug.cgi?id=45643
+
+ After <http://trac.webkit.org/changeset/67355> getMIMETypeForExtension()
+ returns an empty string instead of "application/octet-stream" for unsupported
+ extensions. Don't add these to the list of supported types, and clean out
+ the logic that removed "application/octet-stream" from supported types.
+
+ Fixes crash in initializeMIMETypeRegistry() due to inserting String() into
+ a HashSet<String>.
+
+ * platform/MIMETypeRegistry.cpp:
+ (WebCore::initializeSupportedImageMIMETypes):
+ (WebCore::initializeSupportedImageMIMETypesForEncoding):
+
+2010-09-13 Adam Barth <abarth@webkit.org>
+
+ Attempted Qt build fix.
+
+ * html/parser/HTMLElementStack.cpp:
+
+2010-09-13 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Apply spec changes to InForeignContentMode
+ https://bugs.webkit.org/show_bug.cgi?id=45636
+
+ Now breaking out of foreign content doesn't always bring you back to
+ HTML. If you have a foreign content element that can contain HTML, you
+ just get brought back to that element.
+
+ * html/parser/HTMLElementStack.cpp:
+ (WebCore::HTMLNames::isForeignContentScopeMarker):
+ (WebCore::HTMLElementStack::popUntilForeignContentScopeMarker):
+ * html/parser/HTMLElementStack.h:
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processStartTag):
+ (WebCore::HTMLTreeBuilder::processEndOfFile):
+
+2010-09-13 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Convert notImplemented() to ASSERT_NOT_REACHED
+ https://bugs.webkit.org/show_bug.cgi?id=45639
+
+ The reason we never implemented this state is because it's not actually
+ reachable.
+
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processStartTag):
+
+2010-09-13 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [WINCE] Buildfix for ScrollAnimatorWin
+ https://bugs.webkit.org/show_bug.cgi?id=45595
+
+ Use fabs() instead of abs().
+
+ * platform/ScrollAnimatorWin.cpp:
+ (WebCore::ScrollAnimatorWin::scroll):
+ (WebCore::ScrollAnimatorWin::animateScroll):
+
+2010-09-13 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Remove fixed FIXME
+ https://bugs.webkit.org/show_bug.cgi?id=45637
+
+ The spec made assertions that were false. Hixie fixed the spec by
+ removing the assertions. There's no need to keep these FIXMEs in the
+ code.
+
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processEndTagForInCell):
+
+2010-09-12 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Remove FIXME now that the HTML5 spec has been updated
+ https://bugs.webkit.org/show_bug.cgi?id=45634
+
+ The spec changed to say what we do here so this FIXME isn't needed
+ anymore.
+
+ Tests: fast/parser/form-pointer-1.html
+ fast/parser/form-pointer-2.html
+ fast/parser/form-pointer-3.html
+ fast/parser/form-pointer-4.html
+
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processStartTagForInTable):
+
+2010-09-12 Robin Qiu <robin.qiu@torchmobile.com.cn>
+
+ Reviewed by Antonio Gomes.
+
+ https://bugs.webkit.org/show_bug.cgi?id=18768
+ Fixed a bug in scroll flow. When we don't have scrollbars, we need to
+ repaintFixedElementsAfterScrolling(), sendScrollEvent() ... as well as
+ scrollContents();
+
+ Tests: scrollbars/scrollevent-iframe-no-scrolling-wheel.html
+ scrollbars/scrollevent-iframe-no-scrolling.html
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::valueChanged): Added.
+ * page/FrameView.h: Added a new method.
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::valueChanged): Added.
+ (WebCore::ScrollView::updateScrollbars):
+ * platform/ScrollView.h: Added a new method.
+
+2010-09-10 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Tony Chang.
+
+ [Chromium] Implement textInputController.hasSpellingMarker() for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45441
+
+ Added an API for testing marker state.
+ We locate this here instead of DRT for sharing the logic between
+ multiple ports.
+
+ * WebCore.exp.in:
+ * editing/Editor.cpp:
+ (WebCore::Editor::selectionStartHasSpellingMarkerFor):
+ * editing/Editor.h:
+
+2010-09-12 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Adoption agency should use takeAllChildrenFrom
+ https://bugs.webkit.org/show_bug.cgi?id=45570
+
+ Before this patch, we were using an unsafe pattern of walking the
+ sibling list without grabbing references. Instead, we should use the
+ shiny new takeAllChildrenFrom method that shoves the children into a
+ vector first. Also, update takeAllChildrenFrom to handle the case
+ where the old parent is attached.
+
+ * dom/ContainerNode.cpp:
+ (WebCore::ContainerNode::takeAllChildrenFrom):
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
+ * html/parser/HTMLTreeBuilder.h:
+
+2010-09-12 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ isParsingFragment assert hit in new treebuilder
+ https://bugs.webkit.org/show_bug.cgi?id=45621
+
+ Update our list of special tags to match the spec.
+
+ * html/parser/HTMLTreeBuilder.cpp:
+
+2010-09-12 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Fix http/tests/navigation/reload-subframe-object.html
+
+ We need to bring our use of getMimeTypeForPath() and
+ getMimeTypeForExtension() into line with WebCore expectations.
+
+ We should use MIMETypeRegistry::getMIMETypeForExtension() for cases
+ where an empty mimetype should be returned if no match is found, and
+ MIMETypeRegistry::getMIMETypeForPath() for cases where
+ 'application/octet-stream' should be returned if no match is found.
+
+ Fixes http/tests/navigation/reload-subframe-object.html
+
+ Based on findings in webkit.org/b/31398 and webkit.org/b/15554.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45613
+
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+ (WebCore::QNetworkReplyHandler::sendResponseIfNeeded):
+ * platform/qt/MIMETypeRegistryQt.cpp:
+ (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
+
+2010-09-12 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ Neglect unlikely hyphenation opportunities
+ https://bugs.webkit.org/show_bug.cgi?id=45606
+
+ Avoid looking for hyphenation points in about 40% of the cases at the cost of missing about
+ 3% of the hyphenation opportunities.
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::tryHyphenating): Bail out if the widest the prefix before the hyphen can be is no more
+ than 5/4 the font size.
+
+2010-09-12 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] fix qt_webkit_version.pri install for in-Qt builds
+
+ Always add the target, even if building inside Qt - as opposed to the
+ headers and libraries, there are no rules for that coming from
+ qbase.pri.
+
+ Task-number: QTBUG-13306
+
+ * WebCore.pro:
+
+2010-09-12 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Let QtWebKit inject itself into the qt configuration
+
+ i.e., don't explicitly deal with qt_webkit_version.pri outside of the
+ webkit source directory.
+
+ Task-number: QTBUG-12379
+
+ * WebCore.pro:
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Build fix.
+
+ * WebCore.pro: Re-add erroneously removed sources.
+
+2010-09-12 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Remove Path::closeSubpath() workaround for broken miter joins
+ https://bugs.webkit.org/show_bug.cgi?id=45618
+
+ Removed Path::closeCanvasSubpath() and share the logic between Canvas and SVG
+ paths. The problem was actually in Qt's path stroker and has been fixed for Qt 4.7.1.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::closePath):
+ * platform/graphics/Path.h:
+ * platform/graphics/qt/PathQt.cpp:
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Fix the Gtk and minimal builds.
+
+ * plugins/PluginView.cpp:
+ (WebCore::PluginView::npObject): Correct the #ifdefs.
+ (WebCore::PluginView::bindingInstance): Moved npErr variable
+ into npObject() function where it is used.
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Prospective build fix for minimal build.
+
+ * plugins/PluginView.cpp: Guard newly added function
+ by ENABLE_NETSCAPE_PLUGIN feature.
+ (WebCore::PluginView::npObject):
+ * plugins/PluginView.h:
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Add support for binding QtWebKit to a QScriptEngine.
+
+ The ScriptController owns the V8 context, and this patch
+ for the Qt build also gives it a QScriptEngine, that has
+ been instructed to adopt the V8 context.
+
+ This is the enabler for the QObject bindings, used in
+ the API and DRT.
+
+ * WebCore.pro:
+ * bindings/v8/ScriptController.cpp: Include QScriptEngine
+ for the Qt build, to let the ~ScriptController destructor
+ find the QScriptEngine destructor (via OwnPtr).
+ * bindings/v8/ScriptController.h: Declare getters.
+ * bindings/v8/ScriptControllerQt.cpp: Added.
+ (WebCore::ScriptController::qtScriptEngine): Implement
+ engine adoption.
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Last bits and pieces for a V8 build.
+
+ When building with V8, get it from QtScript.
+
+ * WebCore.pro: Use QtScript, removed non-existant
+ bridge files from the build.
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Add PlatformBridge for V8 build.
+
+ Add the minimalisting platform bridge with the two
+ methods needed by NPV8Object.cpp.
+
+ * WebCore.pro:
+ * platform/qt/PlatformBridge.h: Added.
+ * platform/qt/PlatformBridgeQt.cpp: Added.
+ (WebCore::PlatformBridge::popupsAllowed):
+ (WebCore::PlatformBridge::pluginScriptableObject):
+ * plugins/PluginView.cpp: Refactor the plugin object
+ retrieval code into a separate function, called by
+ bindingInstance() and PlatformBridge.
+ (WebCore::PluginView::npObject):
+ (WebCore::PluginView::bindingInstance):
+ * plugins/PluginView.h:
+
+2010-09-11 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ http/tests/media/text-served-as-text.html failing on Windows (Debug+Release)
+ https://bugs.webkit.org/show_bug.cgi?id=45603
+
+ Disable the eat/text components under Windows the same way as we do on the Mac.
+
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ * platform/graphics/win/QTMovie.cpp:
+ * platform/graphics/win/QTMovie.h:
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ Fix compilation of the V8 bindings on X11 with Qt.
+
+ This changes brings the file in sync with its copy in bridge/,
+ adding additional conflicting X11 keywords to undef. This is
+ a temporary fix until the file is removed altogether, which is
+ tracked in https://bugs.webkit.org/show_bug.cgi?id=45617
+
+ * bindings/v8/npruntime_internal.h:
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ Fix compilation of the V8 bindings on X11 with Qt.
+
+ These headers include npruntime, which drag on X11Resources.h, which
+ among other things #define's None and Boolean. Later on v8.h is included,
+ which declares these in enums and therefore conflicts. npruntime_internal.h
+ was introduced exactly to address this problem by including npruntime.h
+ and undeff'ing the offending constants.
+
+ * bindings/v8/V8Helpers.h:
+ * bindings/v8/V8NPObject.h:
+ * bindings/v8/V8NPUtils.h:
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Gtk build fix.
+
+ Use false instead of False after
+ http://trac.webkit.org/changeset/67323
+
+ * plugins/gtk/PluginViewGtk.cpp:
+ (WebCore::PluginView::updatePluginWidget):
+ (WebCore::PluginView::paint):
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Fix the compilation of V8Binding.cpp when compiling with Qt.
+
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::WebCoreStringResource::WebCoreStringResource): In this
+ line an AtomicString should be converted to a WTF::String. The former
+ has a conversion operator to the latter, to be able to call the
+ WTF::String copy constructor. When compiling with Qt, then AtomicString
+ also has a conversion operator to QString _and_ WTF::String has an
+ implicit constructor that takes a QString. Therefore the compiler is
+ confused and not sure which conversion to prefer, the one that isn't
+ actually a conversion - going to WTF::String - or the conversion from
+ AtomicString to QString and then constructing the WTF::String from
+ a QString. To resolve this ambiguity we explicitly call the string()
+ helper function on the AtomicString, which is equivalent to the
+ operator WTF::String().
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ Fix the build without JSC.
+
+ Complement http://trac.webkit.org/changeset/59826 and
+ add missing JSC guards.
+
+ * plugins/PluginView.cpp:
+ (WebCore::PluginView::bindingInstance):
+ (WebCore::PluginView::privateBrowsingStateChanged):
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::PluginView::dispatchNPEvent):
+ (WebCore::PluginView::setNPWindowIfNeeded):
+ (WebCore::PluginView::platformStart):
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ Fix compilation with V8 and XPath enabled.
+
+ V8XPathNSResolver.cpp includes V8XPathNSResolver.h,
+ which includes V8DOMWrapper.h as its first header.
+ V8DOMWrapper.h then uses V8XPathNSResolver in an inline
+ function, and gcc doesn't seem to like this, because
+ at this point the type isn't known ("V8XPathNSResolver
+ has not been declared"). Forward declaring the type
+ doesn't help unfortunately: "incomplete type
+ 'WebCore::V8XPathNSResolver' used in nested name
+ specifier".
+
+ To resolve this circular dependency, this patch moves
+ the inline function into the .cpp file.
+
+ * bindings/v8/V8DOMWrapper.cpp:
+ (WebCore::V8DOMWrapper::getXPathNSResolver):
+ * bindings/v8/V8DOMWrapper.h:
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt][X11] Fix build with V8 against X11 headers.
+
+ Added "True" and "False" to the list of words
+ we free from the X11 macro jail.
+
+ * bridge/npruntime_internal.h:
+ * config.h: The V8 bindings end up indirectly pulling
+ in X11 headers and they use True/False. There's no
+ central header apart from this one, so include the
+ x11 fixing header here for Qt/X11/V8.
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::PluginView::paint): Use false instead of False
+ since False isn't available anymore.
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Fix compilation with V8 and Qt.
+
+ Use WebKit's page cache for ScriptCachedFrameData.
+
+ * bindings/v8/ScriptCachedFrameData.h:
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ Fix compiler warning.
+
+ NPClass has 13 members, the last one (NPConstructFunctionPtr construct) wasn't
+ initialized explicitly.
+
+ * bindings/v8/NPV8Object.cpp:
+
+2010-09-12 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [Gtk] get_n_selections and get_selection fail when selecting text across object boundaries
+ https://bugs.webkit.org/show_bug.cgi?id=26991
+
+ Fix AtkText getNSelections() and getSelection() to work properly
+
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (selectionBelongsToObject): Check that both the selection intersects
+ the node AND that the selection is not just "touching" one of the
+ boundaries for the selected node. We want to check whether the
+ node is actually inside the region, at least partially
+ (getSelectionOffsetsForObject): New function to get the start and
+ end offsets of a selection for a given accessible object.
+ (webkit_accessible_text_get_selection): Return zero when both
+ start and end offsets are equal, following the lead of GAIL.
+
+2010-09-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Sam Weinig.
+
+ Make SecurityOrigin::canDisplay an instance function
+ https://bugs.webkit.org/show_bug.cgi?id=45219
+
+ This function was secretly an instance function because callers needed
+ to pass in a document (which owns a SecurityOrigin). Only the
+ FrameLoader actually needs the method to be static.
+
+ * WebCore.exp.in:
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::isSafeToLoadURL):
+ * loader/Cache.cpp:
+ (WebCore::Cache::requestResource):
+ - Notice that DocLoader::doc() can never be 0.
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::loadFrameRequest):
+ * loader/PingLoader.cpp:
+ (WebCore::PingLoader::loadImage):
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::loadMediaPlayerProxyPlugin):
+ (WebCore::SubframeLoader::createJavaAppletWidget):
+ (WebCore::SubframeLoader::loadSubframe):
+ (WebCore::SubframeLoader::loadPlugin):
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::create):
+ * page/SecurityOrigin.cpp:
+ (WebCore::SecurityOrigin::canDisplay):
+ (WebCore::SecurityOrigin::deprecatedCanDisplay):
+ * page/SecurityOrigin.h:
+ * plugins/PluginView.cpp:
+ (WebCore::PluginView::load):
+
+2010-09-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Sam Weinig.
+
+ Make SecurityOrigin::canDisplay an instance function
+ https://bugs.webkit.org/show_bug.cgi?id=45219
+
+ This function was secretly an instance function because callers needed
+ to pass in a document (which owns a SecurityOrigin). Only the
+ FrameLoader actually needs the method to be static.
+
+ * WebCore.exp.in:
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::isSafeToLoadURL):
+ * loader/Cache.cpp:
+ (WebCore::Cache::requestResource):
+ - Notice that DocLoader::doc() can never be 0.
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::loadFrameRequest):
+ * loader/PingLoader.cpp:
+ (WebCore::PingLoader::loadImage):
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::loadMediaPlayerProxyPlugin):
+ (WebCore::SubframeLoader::createJavaAppletWidget):
+ (WebCore::SubframeLoader::loadSubframe):
+ (WebCore::SubframeLoader::loadPlugin):
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::create):
+ * page/SecurityOrigin.cpp:
+ (WebCore::SecurityOrigin::canDisplay):
+ (WebCore::SecurityOrigin::deprecatedCanDisplay):
+ * page/SecurityOrigin.h:
+ * plugins/PluginView.cpp:
+ (WebCore::PluginView::load):
+
+2010-09-11 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed.
+
+ [Qt] Trivial V8 build fix.
+
+ * WebCore.pri: Add storage, workers and css to the include paths for the
+ JS code generator.
+
+2010-09-11 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] V8 port: Fix "WTF::String::utf8" returns incomplete type WTF::CString
+ https://bugs.webkit.org/show_bug.cgi?id=45157
+
+ Include CString.h where necessary. Chromium builds would get it from
+ KURLGooglePrivate.h so this is only an issue for Qt + V8.
+
+ * bindings/v8/V8Proxy.cpp:
+ * inspector/InspectorDebuggerAgent.cpp:
+ * inspector/InspectorProfilerAgent.cpp:
+ * plugins/PluginDatabase.cpp:
+
+2010-09-11 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] V8 port: webkit project files changes
+ https://bugs.webkit.org/show_bug.cgi?id=45140
+
+ * WebCore.pro: Removed unecessary common.pri inclusion from earlier patch.
+
+2010-09-03 Vlad Burlik <volodimir.burlik@nokia.com>, Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] V8 port: webcore project files changes
+ https://bugs.webkit.org/show_bug.cgi?id=45141
+
+ Modify webcore project files to include V8 javascript engine. By default disabled.
+
+ * WebCore.pri:
+ * WebCore.pro:
+ * features.pri:
+
+2010-09-11 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Web Inspector: Include CString.h in generated files
+
+ This is necessary for generated code that uses the CString
+ returned by String::utf8() (from generateBackendDispatcher)
+
+ Chromium builds already get CString.h from KURLGooglePrivate.h
+ so this issue only occurs when building Qt against V8.
+
+ * inspector/CodeGeneratorInspector.pm:
+
+2010-09-11 Adele Peterson <adele@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=45587
+ Move line clamp code to its own function.
+
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::layoutVerticalBox):
+ (WebCore::RenderFlexibleBox::applyLineClamp):
+ * rendering/RenderFlexibleBox.h:
+
+2010-09-11 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ URIs in styles created via innerHTML are not resolved against the document's base URI
+ https://bugs.webkit.org/show_bug.cgi?id=45565
+
+ The dummy document used for fragment parsing created by
+ FragmentParsingContext should use the base URI of the fragment's
+ document. Since (HTML)Document doesn't expose a setter for the base URI
+ (and shouldn't), we allow it to be set by the constructor/create
+ function.
+
+ Also remove some obsolete code that references the legacy tree builder
+ from HTMLElement that I happened to notice.
+
+ Test: fast/innerHTML/innerHTML-uri-resolution.html
+
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ * dom/Document.h:
+ * html/HTMLDocument.cpp:
+ (WebCore::HTMLDocument::HTMLDocument):
+ * html/HTMLDocument.h:
+ (WebCore::HTMLDocument::create):
+ * html/HTMLElement.cpp:
+ (WebCore::createFragmentFromSource):
+ (WebCore::HTMLElement::setInnerHTML):
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::FragmentParsingContext::FragmentParsingContext):
+
+2010-09-10 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Add NetworkingContext to avoid layer violations
+ https://bugs.webkit.org/show_bug.cgi?id=42292
+
+ Activate NetworkingContext:
+
+ Since the ResourceHandle::create, ResourceHandle::start and
+ ResourceHandle::loadResourceSynchronously API's were modified,
+ having their Frame* parameter substituted by a NetworkingContext*,
+ all implementations of them were also modified.
+ This patch also modifies all functions that were calling the above
+ ones.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::loadResourceSynchronously):
+ * loader/FrameLoader.h:
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::loadNow):
+ * loader/PingLoader.cpp:
+ (WebCore::PingLoader::PingLoader):
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::load):
+ * loader/appcache/ApplicationCacheGroup.cpp:
+ (WebCore::ApplicationCacheGroup::createResourceHandle):
+ * loader/icon/IconFetcher.cpp:
+ (WebCore::IconFetcher::loadEntry):
+ * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+ (webKitWebSrcStart):
+ * platform/network/ResourceHandle.cpp:
+ (WebCore::ResourceHandle::create):
+ * platform/network/ResourceHandle.h:
+ * platform/network/ResourceHandleInternal.h:
+ (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+ * platform/network/cf/ResourceHandleCFNet.cpp:
+ (WebCore::ResourceHandle::start):
+ (WebCore::ResourceHandle::loadResourceSynchronously):
+ * platform/network/curl/ResourceHandleCurl.cpp:
+ (WebCore::ResourceHandle::start):
+ (WebCore::ResourceHandle::loadResourceSynchronously):
+ * platform/network/mac/ResourceHandleMac.mm:
+ (WebCore::ResourceHandle::start):
+ (WebCore::ResourceHandle::loadResourceSynchronously):
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+ (WebCore::QNetworkReplyHandler::QNetworkReplyHandler):
+ (WebCore::QNetworkReplyHandler::sendResponseIfNeeded):
+ (WebCore::QNetworkReplyHandler::start):
+ * platform/network/qt/ResourceHandleQt.cpp:
+ (WebCore::ResourceHandle::start):
+ (WebCore::ResourceHandle::willLoadFromCache):
+ (WebCore::ResourceHandle::loadResourceSynchronously):
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::start):
+
+2010-09-10 Jer Noble <jer.noble@apple.com>
+
+ No review; build fix only.
+
+ <CoreGraphics/CGAffineTransform.h> isn't on the build bots either. Wrap
+ all references to m_movieTransform in #if USE(ACCELERATED_COMPOSITING) guards.
+
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualContext):
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::naturalSize):
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::retrieveAndResetMovieTransform):
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
+
+2010-09-10 Jer Noble <jer.noble@apple.com>
+
+ No review; build fix only.
+
+ <CoreGraphics/CGFloat.h> does not exist on the build bots. Replace
+ instances of CGFAbs() with abs().
+
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::naturalSize):
+
+2010-09-10 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/8414282> Can’t dynamically change first-letter to/from floating
+
+ Test: fast/dynamic/first-letter-display-change.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::styleForFirstLetter): Factored this helper function out.
+ (WebCore::RenderBlock::updateFirstLetter): Renamed variables so that the
+ “update style” and “create new” branches use the same terminology. In the
+ update case, if the style change requires a new renderer, handle it.
+ * rendering/RenderTextFragment.h:
+ (WebCore::toRenderTextFragment): Added.
+
+2010-09-10 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove unnecessary constraint in WebCore of choosing either text zoom or full page zoom.
+ Precursor to <rdar://problem/7660657>
+ https://bugs.webkit.org/show_bug.cgi?id=45522
+
+ * GNUmakefile.am:
+ * WebCore.exp.in:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ Remove ZoomMode.h
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
+ Remove uses of shouldApplyTextZoom(), it had turned into just a compare to 1.0f.
+
+ * html/HTMLBodyElement.cpp:
+ (WebCore::adjustForZoom):
+ (WebCore::HTMLBodyElement::setScrollLeft):
+ (WebCore::HTMLBodyElement::setScrollTop):
+ Convert these to use the explicit pageZoomFactor() function, it made no sense for text zoom
+ anyway.
+
+ * page/Frame.h:
+ Remove include of ZoomMode.h
+
+ * page/FrameView.cpp:
+ (WebCore::parentPageZoomFactor):
+ (WebCore::parentTextZoomFactor):
+ (WebCore::FrameView::FrameView):
+ (WebCore::FrameView::setPageZoomFactor):
+ (WebCore::FrameView::setTextZoomFactor):
+ (WebCore::FrameView::setPageAndTextZoomFactors):
+ * page/FrameView.h:
+ (WebCore::FrameView::pageZoomFactor):
+ (WebCore::FrameView::textZoomFactor):
+ Change FrameView to store two values for zoom, one for page zoom and one for text zoom.
+
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ * page/Settings.h:
+ Removed zoom mode.
+
+ * page/ZoomMode.h: Removed.
+
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::zoomFactor):
+ Remove now unnecessary call to shouldApplyPageZoom since it will be 1 if it should
+ be ignored.
+
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::setCurrentScale):
+ Use explicit setPageZoomFactor function.
+
+2010-09-10 Ryuan Choi <ryuan.choi@samsung.com>
+
+ Unreviewed build fix for EFL.
+
+ [EFL] REGRESSION(67167) build break because of newly added JSBindingState.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=45537
+
+ * CMakeLists.txt:
+
+2010-09-10 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Move some Dashboard stuff from WebCore to WebKit along with a bit more FrameMac cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=45582
+
+ * WebCore.exp.in: Updated.
+
+ * WebCore.xcodeproj/project.pbxproj: Removed WebDashboardRegion.h/m.
+ * page/mac/WebDashboardRegion.h: Removed.
+ * page/mac/WebDashboardRegion.m: Removed.
+
+ * page/Frame.h: Removed unneeded #if. Removed dashboardRegionsDictionary function, now
+ handled in WebKit. Removed searchForNSLabelsAboveCell function, which had become dead code.
+ * page/mac/FrameMac.mm: Ditto. Also tweaked a place that said "int unsigned".
+
+2010-09-10 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Darin Adler.
+
+ Make middle clicks not fire DOM onclick events.
+ https://bugs.webkit.org/show_bug.cgi?id=22382
+
+ * html/HTMLAnchorElement.cpp: Explicitly include middle-clicks in the
+ computation of what constitutes a link click, since they're no longer
+ implicitly included.
+ (WebCore::isLinkClick):
+ * html/HTMLInputElement.cpp: Removed unneeded checks that click events
+ are coming from the left mouse button, since they all are now.
+ (WebCore::HTMLInputElement::preDispatchEventHandler):
+ (WebCore::HTMLInputElement::postDispatchEventHandler):
+ (WebCore::HTMLInputElement::defaultEventHandler):
+ * page/EventHandler.cpp: Changed logic to send a click event only for
+ the left button.
+ (WebCore::EventHandler::handleMouseDoubleClickEvent):
+ (WebCore::EventHandler::handleMouseReleaseEvent):
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Attempted build fix for Qt Minimal.
+
+ * dom/Element.cpp:
+ (WebCore::Element::getBoundingClientRect):
+
+2010-09-10 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Pseudostyle resolution corrupts cached child index values
+ https://bugs.webkit.org/show_bug.cgi?id=45574
+
+ Covered by fast/dom/firstline-fixed-crash.html and fast/dom/firstletter-tablecell-crash.html.
+
+ RenderBlock::updateFirstLetter() calls getCachedPseudoStyle() passing as the parent style the
+ style of the parent of the first letter, which is not always the parent of the element for
+ which we are getting :first-letter style. As a result, style resolution caches childIndex values
+ in the wrong element’s style.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::pseudoStyleForElement): Create the new style and inherit from
+ the parent style before matching rules, to avoid corrupting the parent style itself.
+ (WebCore::CSSStyleSelector::checkSelector): Always pass the element’s parent style as
+ the parent style here.
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::updateFirstLetter): Removed the null check that was added
+ in r67183.
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::findNextLineBreak): Removed the null check that was added
+ in r67184.
+
+2010-09-10 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Movies with track or movie matrices don't display in <video> elements (Safari 5/Windows)
+ https://bugs.webkit.org/show_bug.cgi?id=45333
+ rdar://problem/81333126
+
+ QuickTime will refuse to decode video frames for movies whose movie and track matrices
+ are non-identity. To work around this problem, extract the movie and track matrices
+ from the movie, and set that matrix on the video layer instead.
+
+ * WebCore.vcproj/QTMovieWin.vcproj:
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::LayoutClient::LayoutClient): Added.
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::LayoutClient::layoutSublayersOfLayer):
+ Layout the video layer according to its superlayer's size.
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualContext):
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::platformLayer):
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::naturalSize):
+ Apply the m_movieTransform to the size reported by QTMovie.
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::retrieveAndResetMovieTransform):
+ Calculate m_movieTransform and reset the movie and track matrices in the movie.
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::createLayerForMovie):
+ Create two nested layers instead of one.
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::destroyLayerForMovie):
+ Make sure to remove m_qtVideoLayer from any superlayer before dereferencing it.
+ * platform/graphics/win/QTMovie.cpp:
+ (QTMovie::videoTracks): Added.
+ (QTMovie::getTransform): Added.
+ (QTMovie::setTransform): Added.
+ (QTMovie::resetTransform): Added.
+ * platform/graphics/win/QTMovie.h:
+ * platform/graphics/win/QTTrack.cpp: Added.
+ * platform/graphics/win/QTTrack.h: Added.
+ * platform/graphics/win/WKCACFLayer.cpp:
+ (WebCore::WKCACFLayer::setBounds): Call setNeedsLayout() if a layoutClient is present.
+ (WebCore::WKCACFLayer::setFrame): Call setNeedsLayout() if a layoutClient is present.
+
+2010-09-10 Jer Noble <jer.noble@apple.com>
+
+ No review; build fix only.
+
+ Touch mediaControlsQuickTime in order to trigger the UserAgentStyleSheet.h to be rebuilt.
+
+ * css/mediaControlsQuickTime.css:
+ (audio::-webkit-media-controls-volume-slider-mute-button, video::-webkit-media-controls-volume-slider-mute-button):
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ There's a bunch of code that's copy/pasted (poorly) across all the
+ ports that really belongs in WebCore. This patch moves that logic into
+ DocumentLoader. This patch is a step on the path to having
+ DocumentLoader own DocumentWriter.
+
+ * WebCore.exp.in:
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::commitData):
+ * loader/DocumentLoader.h:
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::finishedLoadingDocument):
+
+2010-09-10 Cosmin Truta <ctruta@chromium.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ getBoundingClientRect Broken for SVG Elements
+ https://bugs.webkit.org/show_bug.cgi?id=42815
+
+ Use getBBox to retrieve the bounding rectangle for SVG elements.
+
+ Test: svg/dom/getBoundingClientRect.xhtml
+
+ * dom/Element.cpp:
+ (Element::getBoundingClientRect):
+
+2010-09-09 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Adopt shared control drawing for <video> controls on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=45490
+
+ * DerivedSources.make: Remove the OS check around mediaControlsQuickTime.css.
+ * rendering/RenderMediaControls.cpp:
+ (WebCore::determineState): Use WKMediaControllerThemeState flags instead of SafariTheme ones.
+ (WebCore::getUnzoomedRectAndAdjustCurrentContext): Added. Copied verbatim from RenderMediaMac.mm.
+ (WebCore::RenderMediaControls::adjustMediaSliderThumbSize): Use wkMeasureMediaUIPart to adjust the thumb size.
+ (WebCore::RenderMediaControls::paintMediaControlsPart): Use wkDrawMediaUIPart instead of paintThemePart.
+ (WebCore::RenderMediaControls::volumeSliderOffsetFromMuteButton): Added. Copied verbatim from RenderMediaMac.mm.
+ * rendering/RenderMediaControls.h:
+ * rendering/RenderThemeWin.cpp:
+ (WebCore::RenderThemeWin::adjustSliderThumbSize): Adjust both sliders and volume sliders.
+ (WebCore::RenderThemeWin::extraMediaControlsStyleSheet): Added. Returns the mediaControlsQuickTime sheet.
+ (WebCore::RenderThemeWin::paintMediaRewindButton): Added. Pass through to RenderMediaControls.
+ (WebCore::RenderThemeWin::paintMediaControlsBackground): Added. Pass through to RenderMediaControls.
+ (WebCore::RenderThemeWin::paintMediaVolumeSliderContainer): Added. Pass through to RenderMediaControls.
+ (WebCore::RenderThemeWin::paintMediaVolumeSliderTrack): Added. Pass through to RenderMediaControls.
+ (WebCore::RenderThemeWin::paintMediaVolumeSliderThumb): Added. Pass through to RenderMediaControls.
+ (WebCore::RenderThemeWin::volumeSliderOffsetFromMuteButton): Added. Pass through to RenderMediaControls.
+ * rendering/RenderThemeWin.h:
+
+2010-09-10 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Darin Adler.
+
+ Cleanup and simplification in advance of making middle clicks not send a
+ click event.
+ https://bugs.webkit.org/show_bug.cgi?id=22382
+
+ * editing/DeleteButton.cpp:
+ (WebCore::DeleteButton::defaultEventHandler): Removed unneeded code to
+ check if the event is a MouseEvent. Any click event will do.
+ * html/HTMLAnchorElement.cpp:
+ (WebCore::appendServerMapMousePosition): Added. Factors out the
+ modifications to the URL to add the mouse position to make the default
+ event handler function easier to read.
+ (WebCore::HTMLAnchorElement::defaultEventHandler): Reorganized to make
+ the enter key logic separate from the link clicking logic and simplify
+ the function. This makes minor functional changes like not calling
+ FrameLoader::urlSelected() for fake "keydown" events constructed from
+ JavaScript.
+ (WebCore::HTMLAnchorElement::isLiveLink): Refactored to use new shared
+ implementation in treatLinkAsLiveForEventType().
+ (WebCore::eventType): Factors out event type calculation (for
+ treatLinkAsLiveForEventType()) from the default event handler to make it
+ easier to read.
+ (WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType):
+ Implementation of the portions of isLiveLink() that are common with the
+ checks defaultEventHandler() wants to do.
+ (WebCore::isEnterKeyKeydownEvent): Added. Shared by the default
+ event handlers for all three anchor elements.
+ (WebCore::isMiddleMouseButtonEvent): Added. Shared by the isLinkClick
+ function below and some code in SVG. Later we can make this private to
+ this source file once we remove the unneeded SVG code.
+ (WebCore::isLinkClick): Added. Shared by the default event handlers for
+ all three anchor elements.
+ (WebCore::handleLinkClick): Ditto.
+ * html/HTMLAnchorElement.h: Added the new functions.
+ * svg/SVGAElement.cpp:
+ (WebCore::SVGAElement::defaultEventHandler): Removed lots of unneeded
+ logic and streamlined the code to more closely match the
+ HTMLAnchorElement code and share functions with it.
+ * wml/WMLAElement.cpp:
+ (WebCore::WMLAElement::defaultEventHandler): Ditto.
+
+2010-09-10 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Implement HTML5 definition of script for-event neutering
+ https://bugs.webkit.org/show_bug.cgi?id=45493
+
+ * dom/ScriptElement.cpp:
+ (WebCore::ScriptElementData::shouldExecuteAsJavaScript): Same behavior, but reads more like the spec. Removed obsolete comments about supporting for-event.
+ * html/parser/HTMLScriptRunner.cpp:
+ (WebCore::HTMLScriptRunner::executeScript): Moved to runScript.
+ (WebCore::HTMLScriptRunner::runScript): Checking shouldExecuteAsJavaScript() here means that external scripts which fail the check will never be requested.
+
+2010-09-10 Nat Duca <nduca@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] Accelerated Compositing: screen garbage when scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=45092
+
+ Split LayerRenderChromium::drawLayers into several different
+ functions, responsible for preparing the backbuffer, updating the
+ root texture, compositing and performing the final
+ swapbuffers. This are then used by the new
+ WebViewImpl::composite rendering path.
+
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::setBounds):
+ (WebCore::LayerChromium::setFrame):
+ (WebCore::LayerChromium::setNeedsDisplay):
+ (WebCore::LayerChromium::resetNeedsDisplay):
+ * platform/graphics/chromium/LayerChromium.h:
+ (WebCore::LayerChromium::dirtyRect):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::prepareToDrawLayers):
+ (WebCore::LayerRendererChromium::updateRootLayerTextureRect):
+ (WebCore::LayerRendererChromium::drawLayers):
+ (WebCore::LayerRendererChromium::present):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+
+2010-09-10 David Holloway <dhollowa@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Replace WebCore::HTMLFormElement::submissionTrigger with WebCore::HTMLFormElement::submittedByUserGesture.
+ Chromium AutoFill feature semantics changed with respect to what we mean by "user submitted" form. A
+ more accurate measure of the user manually submitting a form is via user gesture.
+ https://bugs.webkit.org/show_bug.cgi?id=45128
+
+ No new tests as this is only used by the Chromium WebKit API.
+
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::HTMLFormElement):
+ (WebCore::HTMLFormElement::prepareSubmit):
+ (WebCore::HTMLFormElement::submit):
+ (WebCore::HTMLFormElement::submittedByUserGesture):
+ * html/HTMLFormElement.h:
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Remove mention of "part" from Document.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=45566
+
+ This is an old KHTML name that's lingering around.
+
+ * dom/Document.cpp:
+ (WebCore::Document::parentDocument):
+
+2010-09-09 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Move functions from Frame to SelectionController as planned
+ https://bugs.webkit.org/show_bug.cgi?id=45508
+
+ Also removed Frame::dragCaretController since it just called Page::dragCaretController.
+
+ * editing/SelectionController.cpp:
+ (WebCore::SelectionController::setSelection):
+ (WebCore::SelectionController::modify):
+ (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
+ (WebCore::SelectionController::selectAll):
+ (WebCore::SelectionController::focusedOrActiveStateChanged):
+ (WebCore::SelectionController::notifyRendererOfSelectionChange):
+ (WebCore::isFrameElement):
+ (WebCore::SelectionController::setFocusedNodeIfNeeded):
+ (WebCore::SelectionController::paintDragCaret):
+ (WebCore::SelectionController::shouldDeleteSelection):
+ (WebCore::SelectionController::selectionBounds):
+ (WebCore::SelectionController::selectionTextRects):
+ (WebCore::scanForForm):
+ (WebCore::SelectionController::currentForm):
+ (WebCore::SelectionController::revealSelection):
+ (WebCore::SelectionController::setSelectionFromNone):
+ (WebCore::SelectionController::shouldChangeSelection):
+ * editing/SelectionController.h:
+ Moved functions here from Frame.
+
+ * page/Frame.cpp:
+ * page/Frame.h:
+ Moved functions to SelectionController.
+ Reorganized header to be easier to read and a bit more logical.
+
+ * WebCore.exp.in: Updated.
+
+ * dom/Document.cpp:
+ (WebCore::Document::nodeChildrenWillBeRemoved):
+ (WebCore::Document::nodeWillBeRemoved):
+ Call Page::dragCaretController directly.
+
+ * dom/Element.cpp:
+ (WebCore::Element::updateFocusAppearance):
+ * dom/InputElement.cpp:
+ (WebCore::InputElement::updateFocusAppearance):
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::editingStyleAtPosition):
+ * editing/DeleteSelectionCommand.cpp:
+ (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
+ * editing/Editor.cpp:
+ (WebCore::Editor::canSmartCopyOrDelete):
+ (WebCore::Editor::textDirectionForSelection):
+ (WebCore::Editor::appliedEditing):
+ (WebCore::Editor::insertTextWithoutSendingTextEvent):
+ (WebCore::Editor::advanceToNextMisspelling):
+ (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
+ (WebCore::Editor::revealSelectionAfterEditingOperation):
+ (WebCore::Editor::transpose):
+ (WebCore::Editor::changeSelectionAfterCommand):
+ (WebCore::Editor::computeAndSetTypingStyle):
+ (WebCore::Editor::selectionComputedStyle):
+ (WebCore::Editor::styleForSelectionStart):
+ (WebCore::Editor::findString):
+ * editing/EditorCommand.cpp:
+ (WebCore::executeDelete):
+ * editing/InsertLineBreakCommand.cpp:
+ (WebCore::InsertLineBreakCommand::doApply):
+ * editing/InsertTextCommand.cpp:
+ (WebCore::InsertTextCommand::input):
+ * editing/RemoveFormatCommand.cpp:
+ (WebCore::RemoveFormatCommand::doApply):
+ * editing/ReplaceSelectionCommand.cpp:
+ (WebCore::ReplaceSelectionCommand::doApply):
+ * editing/TypingCommand.cpp:
+ (WebCore::TypingCommand::insertTextRunWithoutNewlines):
+ (WebCore::TypingCommand::deleteKeyPressed):
+ (WebCore::TypingCommand::forwardDeleteKeyPressed):
+ * html/HTMLTextAreaElement.cpp:
+ (WebCore::HTMLTextAreaElement::updateFocusAppearance):
+ * page/ContextMenuController.cpp:
+ (WebCore::ContextMenuController::contextMenuItemSelected):
+ * page/DragController.cpp:
+ (WebCore::DragController::concludeEditDrag):
+ (WebCore::dragLocForSelectionDrag):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::selectClosestWordFromMouseEvent):
+ (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
+ (WebCore::EventHandler::handleMousePressEventTripleClick):
+ (WebCore::EventHandler::handleMousePressEventSingleClick):
+ (WebCore::EventHandler::updateSelectionForMouseDrag):
+ (WebCore::EventHandler::handleMouseReleaseEvent):
+ * page/FocusController.cpp:
+ (WebCore::FocusController::advanceFocusInDocumentOrder):
+ * page/chromium/EventHandlerChromium.cpp:
+ (WebCore::EventHandler::passMousePressEventToSubframe):
+ * page/chromium/FrameChromium.cpp:
+ (WebCore::Frame::dragImageForSelection):
+ * page/mac/FrameMac.mm:
+ (WebCore::Frame::selectionImage):
+ * platform/mac/ClipboardMac.mm:
+ (WebCore::ClipboardMac::writeRange):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintCaret):
+ Call functions on selection().
+
+2010-09-10 Justin Schuh <jschuh@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ SVGGElement::rendererIsNeeded should return false when parent isn't SVG
+ https://bugs.webkit.org/show_bug.cgi?id=45562
+
+ Test: svg/custom/g-outside-svg.html
+
+ * svg/SVGGElement.cpp:
+ (WebCore::SVGGElement::rendererIsNeeded):
+ * svg/SVGGElement.h:
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (HTML Parser): CNN's Money site is not formatted correctly with AdBlock installed
+ https://bugs.webkit.org/show_bug.cgi?id=41371
+
+ Drop support for closing comments with "-- >". This was an attempt to
+ be more IE-like in comment parsing, but it turns out to cause problems
+ for some high-profile sites. Firefox 4 is dropping support as well.
+ We expect the spec to change soon too.
+
+ * html/parser/HTMLTokenizer.cpp:
+ (WebCore::HTMLTokenizer::nextToken):
+ * html/parser/HTMLTokenizer.h:
+
+2010-09-10 Chris Marrin <cmarrin@apple.com>
+
+ Unreviewed.
+
+ Adding file that should have been in http://trac.webkit.org/changeset/67226 but
+ I forgot to svn add.
+
+ * platform/graphics/opengl: Added.
+ * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: Copied from platform/graphics/mac/GraphicsContext3DMac.mm.
+
+2010-09-10 Paul Sawaya <psawaya@apple.com>
+
+ Reviewed by Chris Marrin.
+
+ Refactored non-Mac specific code into GraphicsContext3DOpenGL.
+
+ Moving this file into platform/graphics/opengl and only building on Mac for now.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30625
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/graphics/mac/GraphicsContext3DMac.mm:
+ (WebCore::GraphicsContext3D::makeContextCurrent):
+ (WebCore::GraphicsContext3D::isErrorGeneratedOnOutOfBoundsAccesses):
+ * platform/graphics/opengl: Added.
+ * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: Copied from platform/graphics/mac/GraphicsContext3DMac.mm.
+ (WebCore::GraphicsContext3D::prepareTexture):
+ (WebCore::GraphicsContext3D::activeTexture):
+ (WebCore::GraphicsContext3D::attachShader):
+ (WebCore::GraphicsContext3D::bindAttribLocation):
+ (WebCore::GraphicsContext3D::bindBuffer):
+ (WebCore::GraphicsContext3D::bindFramebuffer):
+ (WebCore::GraphicsContext3D::bindRenderbuffer):
+ (WebCore::GraphicsContext3D::bindTexture):
+ (WebCore::GraphicsContext3D::blendColor):
+ (WebCore::GraphicsContext3D::blendEquation):
+ (WebCore::GraphicsContext3D::blendEquationSeparate):
+ (WebCore::GraphicsContext3D::blendFunc):
+ (WebCore::GraphicsContext3D::blendFuncSeparate):
+ (WebCore::GraphicsContext3D::bufferData):
+ (WebCore::GraphicsContext3D::bufferSubData):
+ (WebCore::GraphicsContext3D::checkFramebufferStatus):
+ (WebCore::GraphicsContext3D::clearColor):
+ (WebCore::GraphicsContext3D::clear):
+ (WebCore::GraphicsContext3D::clearDepth):
+ (WebCore::GraphicsContext3D::clearStencil):
+ (WebCore::GraphicsContext3D::colorMask):
+ (WebCore::GraphicsContext3D::compileShader):
+ (WebCore::GraphicsContext3D::copyTexImage2D):
+ (WebCore::GraphicsContext3D::copyTexSubImage2D):
+ (WebCore::GraphicsContext3D::cullFace):
+ (WebCore::GraphicsContext3D::depthFunc):
+ (WebCore::GraphicsContext3D::depthMask):
+ (WebCore::GraphicsContext3D::depthRange):
+ (WebCore::GraphicsContext3D::detachShader):
+ (WebCore::GraphicsContext3D::disable):
+ (WebCore::GraphicsContext3D::disableVertexAttribArray):
+ (WebCore::GraphicsContext3D::drawArrays):
+ (WebCore::GraphicsContext3D::drawElements):
+ (WebCore::GraphicsContext3D::enable):
+ (WebCore::GraphicsContext3D::enableVertexAttribArray):
+ (WebCore::GraphicsContext3D::finish):
+ (WebCore::GraphicsContext3D::flush):
+ (WebCore::GraphicsContext3D::framebufferRenderbuffer):
+ (WebCore::GraphicsContext3D::framebufferTexture2D):
+ (WebCore::GraphicsContext3D::frontFace):
+ (WebCore::GraphicsContext3D::generateMipmap):
+ (WebCore::GraphicsContext3D::getActiveAttrib):
+ (WebCore::GraphicsContext3D::getActiveUniform):
+ (WebCore::GraphicsContext3D::getAttachedShaders):
+ (WebCore::GraphicsContext3D::getAttribLocation):
+ (WebCore::GraphicsContext3D::getError):
+ (WebCore::GraphicsContext3D::getString):
+ (WebCore::GraphicsContext3D::hint):
+ (WebCore::GraphicsContext3D::isBuffer):
+ (WebCore::GraphicsContext3D::isEnabled):
+ (WebCore::GraphicsContext3D::isFramebuffer):
+ (WebCore::GraphicsContext3D::isProgram):
+ (WebCore::GraphicsContext3D::isRenderbuffer):
+ (WebCore::GraphicsContext3D::isShader):
+ (WebCore::GraphicsContext3D::isTexture):
+ (WebCore::GraphicsContext3D::lineWidth):
+ (WebCore::GraphicsContext3D::linkProgram):
+ (WebCore::GraphicsContext3D::pixelStorei):
+ (WebCore::GraphicsContext3D::polygonOffset):
+ (WebCore::GraphicsContext3D::readPixels):
+ (WebCore::GraphicsContext3D::releaseShaderCompiler):
+ (WebCore::GraphicsContext3D::renderbufferStorage):
+ (WebCore::GraphicsContext3D::sampleCoverage):
+ (WebCore::GraphicsContext3D::scissor):
+ (WebCore::GraphicsContext3D::shaderSource):
+ (WebCore::GraphicsContext3D::stencilFunc):
+ (WebCore::GraphicsContext3D::stencilFuncSeparate):
+ (WebCore::GraphicsContext3D::stencilMask):
+ (WebCore::GraphicsContext3D::stencilMaskSeparate):
+ (WebCore::GraphicsContext3D::stencilOp):
+ (WebCore::GraphicsContext3D::stencilOpSeparate):
+ (WebCore::GraphicsContext3D::texParameterf):
+ (WebCore::GraphicsContext3D::texParameteri):
+ (WebCore::GraphicsContext3D::uniform1f):
+ (WebCore::GraphicsContext3D::uniform1fv):
+ (WebCore::GraphicsContext3D::uniform2f):
+ (WebCore::GraphicsContext3D::uniform2fv):
+ (WebCore::GraphicsContext3D::uniform3f):
+ (WebCore::GraphicsContext3D::uniform3fv):
+ (WebCore::GraphicsContext3D::uniform4f):
+ (WebCore::GraphicsContext3D::uniform4fv):
+ (WebCore::GraphicsContext3D::uniform1i):
+ (WebCore::GraphicsContext3D::uniform1iv):
+ (WebCore::GraphicsContext3D::uniform2i):
+ (WebCore::GraphicsContext3D::uniform2iv):
+ (WebCore::GraphicsContext3D::uniform3i):
+ (WebCore::GraphicsContext3D::uniform3iv):
+ (WebCore::GraphicsContext3D::uniform4i):
+ (WebCore::GraphicsContext3D::uniform4iv):
+ (WebCore::GraphicsContext3D::uniformMatrix2fv):
+ (WebCore::GraphicsContext3D::uniformMatrix3fv):
+ (WebCore::GraphicsContext3D::uniformMatrix4fv):
+ (WebCore::GraphicsContext3D::useProgram):
+ (WebCore::GraphicsContext3D::validateProgram):
+ (WebCore::GraphicsContext3D::vertexAttrib1f):
+ (WebCore::GraphicsContext3D::vertexAttrib1fv):
+ (WebCore::GraphicsContext3D::vertexAttrib2f):
+ (WebCore::GraphicsContext3D::vertexAttrib2fv):
+ (WebCore::GraphicsContext3D::vertexAttrib3f):
+ (WebCore::GraphicsContext3D::vertexAttrib3fv):
+ (WebCore::GraphicsContext3D::vertexAttrib4f):
+ (WebCore::GraphicsContext3D::vertexAttrib4fv):
+ (WebCore::GraphicsContext3D::vertexAttribPointer):
+ (WebCore::GraphicsContext3D::viewport):
+ (WebCore::GraphicsContext3D::getBooleanv):
+ (WebCore::GraphicsContext3D::getBufferParameteriv):
+ (WebCore::GraphicsContext3D::getFloatv):
+ (WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
+ (WebCore::GraphicsContext3D::getIntegerv):
+ (WebCore::GraphicsContext3D::getProgramiv):
+ (WebCore::GraphicsContext3D::getProgramInfoLog):
+ (WebCore::GraphicsContext3D::getRenderbufferParameteriv):
+ (WebCore::GraphicsContext3D::getShaderiv):
+ (WebCore::GraphicsContext3D::getShaderInfoLog):
+ (WebCore::GraphicsContext3D::getShaderSource):
+ (WebCore::GraphicsContext3D::getTexParameterfv):
+ (WebCore::GraphicsContext3D::getTexParameteriv):
+ (WebCore::GraphicsContext3D::getUniformfv):
+ (WebCore::GraphicsContext3D::getUniformiv):
+ (WebCore::GraphicsContext3D::getUniformLocation):
+ (WebCore::GraphicsContext3D::getVertexAttribfv):
+ (WebCore::GraphicsContext3D::getVertexAttribiv):
+ (WebCore::GraphicsContext3D::getVertexAttribOffset):
+ (WebCore::GraphicsContext3D::texImage2D):
+ (WebCore::GraphicsContext3D::texSubImage2D):
+ (WebCore::GraphicsContext3D::createBuffer):
+ (WebCore::GraphicsContext3D::createFramebuffer):
+ (WebCore::GraphicsContext3D::createProgram):
+ (WebCore::GraphicsContext3D::createRenderbuffer):
+ (WebCore::GraphicsContext3D::createShader):
+ (WebCore::GraphicsContext3D::createTexture):
+ (WebCore::GraphicsContext3D::deleteBuffer):
+ (WebCore::GraphicsContext3D::deleteFramebuffer):
+ (WebCore::GraphicsContext3D::deleteProgram):
+ (WebCore::GraphicsContext3D::deleteRenderbuffer):
+ (WebCore::GraphicsContext3D::deleteShader):
+ (WebCore::GraphicsContext3D::deleteTexture):
+
+2010-09-10 Oliver Hunt <oliver@apple.com>
+
+ Qt build fix.
+
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::CloneDeserializer::deserialize):
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove useless FrameLoader method
+ https://bugs.webkit.org/show_bug.cgi?id=45492
+
+ This method has one caller, and that caller already has a more direct
+ way of accessing the correct DocumentLoader.
+
+ * loader/FrameLoader.cpp:
+ * loader/FrameLoader.h:
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::addData):
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Main resource bytes shouldn't bounce through FrameLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45496
+
+ After the MainResourceLoader hands the bytes for the main resource to
+ the DocumentLoader, the DocumentLoader hands the bytes to the
+ FrameLoaderClient. The FrameLoaderClient, in turn, returns the bytes
+ to WebCore. Prior to this patch, the FrameLoaderClient returned the
+ bytes to the FrameLoader. However, the FrameLoader was actually adding
+ any value.
+
+ In this patch, we change the FrameLoaderClient to return the bytes to
+ the DocumentLoader directly. In a future patch, we'll cut out the
+ FrameLoaderClient middleman and handle the bytes internally in the
+ DocumentLoader.
+
+ * WebCore.exp.in:
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::addData):
+ * loader/DocumentLoader.h:
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::finishedLoadingDocument):
+ * loader/FrameLoader.h:
+
+2010-09-10 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Speed up deserialisation of strings
+ https://bugs.webkit.org/show_bug.cgi?id=45555
+
+ Rather than building a list of Identifiers for the string pool
+ we now build a list of a tuple of UString and JSString*. This
+ doesn't hurt the property name case as ustring->identifier conversion
+ is essentially free if the ustring has already been converted to
+ an Identifier, but saves an unnecessary Identifier creation for
+ strings we only ever use to create JSStrings. We also reduce
+ GC pressure for duplicate strings by caching the JSStrings.
+
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::CloneDeserializer::CachedString::CachedString):
+ (WebCore::CloneDeserializer::CachedString::jsString):
+ (WebCore::CloneDeserializer::CachedString::ustring):
+ (WebCore::CloneDeserializer::readStringData):
+ (WebCore::CloneDeserializer::putProperty):
+ (WebCore::CloneDeserializer::readFile):
+ (WebCore::CloneDeserializer::readTerminal):
+ (WebCore::CloneDeserializer::deserialize):
+
+2010-09-10 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Antonio Gomes.
+
+ REGRESSION(r67176): editing/selection/doubleclick-inline-first-last-contenteditable.html crashes
+ https://bugs.webkit.org/show_bug.cgi?id=45525
+
+ The crash was caused by ancestorToRetainStructureAndAppearance not taking into consideration
+ the case where there is no common block ancestor. Fixed this by adding a null check.
+
+ Test: editing/pasteboard/copy-without-common-block-crash.html
+
+ * editing/markup.cpp:
+ (WebCore::ancestorToRetainStructureAndAppearance): Added a null check.
+
+2010-09-09 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ [FileSystem] Do not call EntriesCallback more than once if there're no entries.
+ https://bugs.webkit.org/show_bug.cgi?id=45498
+
+ No new tests, layout-tests that confirm the behavior will be added in later patches.
+
+ * fileapi/FileSystemCallbacks.cpp:
+ (WebCore::EntriesCallbacks::EntriesCallbacks):
+ (WebCore::EntriesCallbacks::didReadDirectoryEntry):
+ (WebCore::EntriesCallbacks::didReadDirectoryEntries):
+
+2010-09-10 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Darin Adler.
+
+ Use String::fromUTF8 instead of UTF8Encoding().decode
+ in the libxml XMLDocumentParser
+ https://bugs.webkit.org/show_bug.cgi?id=45488
+
+ * dom/XMLDocumentParserLibxml2.cpp:
+ (WebCore::toString):
+
+2010-09-10 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by David Kilzer.
+
+ AX: accessibility not returning strings when visibility is hidden
+ https://bugs.webkit.org/show_bug.cgi?id=45116
+
+ AX code uses plainText() in TextIterator to get the text for a node.
+ However, when that node is not visible, no text is returned because TextIterator ignores
+ clipped nodes and other hidden elements.
+
+ Solution is to add a new text iterator behavior for ignoring style visiblity. This allows
+ for text to allows be returned for accessibility purposes.
+
+ Test: platform/mac/accessibility/clipped-text-under-element.html
+
+ * WebCore.exp.in:
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::textUnderElement):
+ (WebCore::AccessibilityRenderObject::stringValue):
+ Use the new flag for plainText
+ * editing/TextIterator.cpp:
+ (WebCore::TextIterator::TextIterator):
+ (WebCore::TextIterator::handleTextNode):
+ (WebCore::TextIterator::handleTextBox):
+ (WebCore::TextIterator::handleTextNodeFirstLetter):
+ (WebCore::TextIterator::handleReplacedElement):
+ Use the new flag to NOT skip hidden elements.
+ (WebCore::plainTextToMallocAllocatedBuffer):
+ (WebCore::plainText):
+ * editing/TextIterator.h:
+ Add the new text iterator behavior.
+
+2010-09-10 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by David Kilzer.
+
+ Mail crashes with searching for next misspelled word with VoiceOver
+ https://bugs.webkit.org/show_bug.cgi?id=45501
+
+ Test: platform/mac/accessibility/crash-in-element-for-text-marker.html
+
+ * accessibility/mac/AccessibilityObjectWrapper.mm:
+ (-[AccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
+ Check that the AX object is not nil before asking for the wrapper().
+
+2010-09-10 Michael Nordman <michaeln@google.com>
+
+ Reviewed by Dumitru Daniliuc.
+
+ Decouple Blob from ScriptExecutionContext.
+ https://bugs.webkit.org/show_bug.cgi?id=45410
+
+ - Removed ScriptExecutionContext pointers from Blob and File constructors.
+ - Removed ScriptExecutionContext's collection of Blobs instance in that context.
+ - Refactored BlobURL to make a distinction between 'public' blob urls and 'internal'
+ urls that are used solely as identifiers. The former requires a SecurityOrigin to
+ to manufacture, the latter does not.
+ - Added a constant and accessor for the blob protocol scheme on the BlobURL class.
+
+ No new tests are added since this is a cleanup.
+
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::CloneDeserializer::readFile):
+ (WebCore::CloneDeserializer::readTerminal):
+ * bindings/v8/SerializedScriptValue.cpp:
+ (WebCore::ZigZag::Reader::readBlob):
+ (WebCore::ZigZag::Reader::readFile):
+ (WebCore::ZigZag::Reader::readFileList):
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
+ (WebCore::ScriptExecutionContext::createPublicBlobURL):
+ (WebCore::ScriptExecutionContext::revokePublicBlobURL):
+ * dom/ScriptExecutionContext.h:
+ * fileapi/Blob.cpp:
+ (WebCore::Blob::Blob):
+ (WebCore::Blob::~Blob):
+ (WebCore::Blob::slice):
+ * fileapi/Blob.h:
+ (WebCore::Blob::create):
+ (WebCore::Blob::url):
+ * fileapi/Blob.idl:
+ * fileapi/BlobBuilder.cpp:
+ (WebCore::BlobBuilder::getBlob):
+ * fileapi/BlobBuilder.h:
+ * fileapi/BlobBuilder.idl:
+ * fileapi/BlobURL.cpp:
+ (WebCore::BlobURL::createPublicURL):
+ (WebCore::BlobURL::createInternalURL):
+ (WebCore::BlobURL::getOrigin):
+ (WebCore::BlobURL::getIdentifier):
+ (WebCore::BlobURL::createBlobURL):
+ * fileapi/BlobURL.h:
+ (WebCore::BlobURL::blobProtocol):
+ (WebCore::BlobURL::BlobURL):
+ * fileapi/File.cpp:
+ (WebCore::File::File):
+ * fileapi/File.h:
+ (WebCore::File::create):
+ * fileapi/FileReader.cpp: Register a public url to perform the read.
+ (WebCore::FileReader::cleanup):
+ (WebCore::FileReader::start):
+ (WebCore::FileReader::didFinishLoading):
+ (WebCore::FileReader::failed):
+ * fileapi/FileReader.h: Added m_urlForReading data member.
+ * fileapi/FileReaderSync.cpp:
+ (WebCore::FileReaderSync::read): Register a public url to perform the read.
+ * fileapi/ThreadableBlobRegistry.cpp:
+ (WebCore::ThreadableBlobRegistry::registerBlobURL):
+ (WebCore::ThreadableBlobRegistry::unregisterBlobURL):
+ * fileapi/ThreadableBlobRegistry.h:
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::appendFormData):
+ (WebCore::HTMLInputElement::setFileListFromRenderer):
+ * page/SecurityOrigin.cpp: Use BlobURL.blobProtocol().
+ (WebCore::SecurityOrigin::create):
+ (WebCore::SecurityOrigin::canRequest):
+ (WebCore::SecurityOrigin::canDisplay):
+ * platform/chromium/ClipboardChromium.cpp:
+ (WebCore::ClipboardChromium::files):
+ * platform/gtk/ClipboardGtk.cpp:
+ (WebCore::ClipboardGtk::files):
+ * platform/mac/ClipboardMac.mm:
+ (WebCore::ClipboardMac::files):
+ * platform/win/ClipboardWin.cpp:
+ (WebCore::ClipboardWin::files):
+
+2010-09-10 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ GDK_DISPLAY was removed in GTK+ 3.x, re-declare it when built
+ against that.
+
+ * platform/gtk/GtkVersioning.h:
+
+2010-09-10 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ Fix compilation with GTK+ 3.x.
+
+ GDK key macros were renamed from GDK_FOO to GDK_KEY_FOO, we need
+ to include the compat header provided if we want to keep using the
+ old names.
+
+ * platform/gtk/GtkVersioning.h: add the compatibility header.
+ * platform/gtk/KeyEventGtk.cpp: include GtkVersioning.h
+
+2010-09-09 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Factor out the NestingLevelIncrementer
+ https://bugs.webkit.org/show_bug.cgi?id=45471
+
+ No new tests because no new functionality.
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/parser/HTMLDocumentParser.cpp:
+ * html/parser/HTMLDocumentParser.h:
+ * html/parser/HTMLScriptRunner.cpp:
+ * html/parser/NestingLevelIncrementer.h: Added.
+ (WebCore::NestingLevelIncrementer::NestingLevelIncrementer):
+ (WebCore::NestingLevelIncrementer::~NestingLevelIncrementer):
+
+2010-09-10 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ SVG text chunk concept needs to be integrated in the InlineBox structure
+ https://bugs.webkit.org/show_bug.cgi?id=45533
+
+ Begin rewriting the SVG text layout code. As first step move the text chunk concept right into the inline box structure.
+ This obsoletes the whole text chunk part concept (see SVGTextChunkLayoutInfo.h for details), and will soon simplify the
+ whole layout code a lot. Previously we hacked around the fact that a single InlineTextBox could contain multiple text chunks
+ For example: <text x="20 30 40">ABC</text> only led to the creation of one InlineTextBox containing three chunks. When
+ painting such an InlineTextBox, we had to do nasty hacks (same for text selection etc.)
+
+ This is finally fixed by incorporating the knownledge about text chunks into the line layout algorithm.
+ Note, this has no impact on HTML at all, no worries.
+
+ It's even required to do it this way as BiDi reordering shouldn't happen across text chunks.
+ These are only the first bits, and currently slows down text layouting. Follow-up patches will remove the old layout
+ algorithm, and will rely on the stored SVGTextLayoutAttributes in the RenerSVGInlineText renderers (instead of computing again).
+
+ * Android.mk: Add rendering/svg/SVGTextLayoutAttributes.* & rendering/svg/SVGTextLayoutBuilder.* to build.
+ * CMakeLists.txt: Ditto.
+ * GNUmakefile.am: Ditto.
+ * WebCore.gyp/WebCore.gyp: Ditto.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.vcproj/WebCoreCommon.vsprops: Ditto. (Recognize new rendering/svg directory.)
+ * WebCore.vcproj/copyForwardingHeaders.cmd: Ditto. (Copy forwarding headers from rendering/svg directory.)
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * rendering/RenderBlockLineLayout.cpp: This is the key of the new concept, take text chunks into account when building the InlineBox structure.
+ (WebCore::RenderBlock::findNextLineBreak): Split midpointState, if we encounter the beginning of a new text chunk.
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::isSVGInline): New method, which will be used to identify RenderSVGInline objects.
+ * rendering/RenderSVGInline.h:
+ (WebCore::RenderSVGInline::isSVGInline): Return true.
+ * rendering/RenderSVGInlineText.cpp:
+ (WebCore::RenderSVGInlineText::linesBoundingBox): Overriden, to simplify the calculations for SVG.
+ (WebCore::RenderSVGInlineText::characterStartsNewTextChunk): Determines wheter the given position starts a new text chunk.
+ * rendering/RenderSVGInlineText.h:
+ (WebCore::RenderSVGInlineText::storeLayoutAttributes): Stores the layout attributes calculated in the text layout process (will be used everywhere in follow-up patches).
+ * rendering/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::layout): Invoke SVGTextLayoutBuilder before creating the inline box tree, so we can decide which characters start new text chunks.
+ * rendering/RenderText.h: Made linesBoundingBox() virtual so RenderSVGInlineText can override it.
+ * rendering/svg: Added.
+ * rendering/svg/SVGTextLayoutAttributes.cpp: Added. Holds x/y/dx/dy/rotate values and all kerning/ligature information used during layout.
+ * rendering/svg/SVGTextLayoutAttributes.h: Added.
+ * rendering/svg/SVGTextLayoutBuilder.cpp: Added.
+ * rendering/svg/SVGTextLayoutBuilder.h: Added.
+
+2010-09-10 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unreviewed fix after r67085.
+
+ * WebCore.pro: Fix previously moved filenames.
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Inline FrameLoader::committedLoad into its one caller
+ https://bugs.webkit.org/show_bug.cgi?id=45481
+
+ This saves one round-trip through the FrameLoader when loading
+ documents.
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::commitLoad):
+ * loader/FrameLoader.cpp:
+ * loader/FrameLoader.h:
+
+2010-09-10 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Remove ImageBuffer::toDataURL implementation
+ https://bugs.webkit.org/show_bug.cgi?id=45478
+
+ At the moment ImageBuffer::toDataURL uses JPEGEncoder.h and PNGEncoder.h.
+ Both files are not in the repository. So remove the implementation for now.
+
+ * platform/graphics/wince/ImageBufferWince.cpp:
+ (WebCore::ImageBuffer::toDataURL):
+
+2010-09-10 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ WebGL: Fix GCC warnings about suggested parentheses around && within ||
+ https://bugs.webkit.org/show_bug.cgi?id=45534
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::getVertexAttrib):
+ (WebCore::WebGLRenderingContext::readPixels):
+ (WebCore::WebGLRenderingContext::texParameter):
+ (WebCore::WebGLRenderingContext::handleNPOTTextures):
+
+2010-09-09 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Add navigation items into the Elements panel context menu.
+
+ For all anchors that have the class of "webkit-html-resource-link" or "webkit-html-external-link",
+ a custom context menu with the items "Open Link in New Window" (invokes InspectorBackend.openInInspectedWindow() with
+ the related URL) and "Open Link in Resources Panel" (opens the related resource in the Resources panel) is shown
+ (the latter item is displayed only if the corresponding resource is known to the Web Inspector).
+ https://bugs.webkit.org/show_bug.cgi?id=34250
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype.populateHrefContextMenu):
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeOutline.prototype._contextMenuEventFired):
+ (WebInspector.ElementsTreeElement.prototype._attributeHTML):
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylesSidebarPane.prototype._contextMenuEventFired):
+ * inspector/front-end/inspector.js:
+ (WebInspector.openResource):
+ (WebInspector.resourceURLForRelatedNode):
+
+2010-09-10 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by James Robinson.
+
+ Make sure skia is not Chromium specific
+ https://bugs.webkit.org/show_bug.cgi?id=39672
+
+ Move Image::loadPlatformResource to platform/graphics/chromium/ImageChromium.cpp.
+ Other ports can use ImageSkia.cpp.
+
+ No new tests because this is pure refacotring.
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * platform/graphics/chromium/ImageChromium.cpp: Added.
+ (WebCore::Image::loadPlatformResource):
+ * platform/graphics/skia/ImageSkia.cpp:
+
+2010-09-09 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Joseph Pecoraro.
+
+ WebInspector: Selecting 'inspect element' always shows body in inspector instead of clicked element.
+
+ 1. Open any page
+ 2. Right-click on any element, select "Inspect Element"
+ 3. Web Inspector is opened but the <body> element (for HTML) is focused rather than the selected element
+ 4. Inspect the Web Inspector. An error message is logged in the console.
+
+ The regression was introduced in http://trac.webkit.org/changeset/66012 - focusNode() is invoked in
+ InspectorController::populateScriptObjects() before the main document is set for the InspectorDOMAgent
+ instance (which makes focusNode() bail out prematurely).
+
+ https://bugs.webkit.org/show_bug.cgi?id=45374
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::populateScriptObjects):
+
+2010-09-10 Cris Neckar <cdn@chromium.org>
+
+ Reviewed by Chris Fleizach.
+
+ Null deref in RenderBlock::updateFirstLetter(). Check for null psuedo style.
+ https://bugs.webkit.org/show_bug.cgi?id=45404
+
+ Test: fast/dom/firstletter-tablecell-crash.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::updateFirstLetter):
+
+2010-09-10 Cris Neckar <cdn@chromium.org>
+
+ Reviewed by Chris Fleizach.
+
+ Null deref in RenderBlock::findNextLineBreak(). Check for null style with
+ first-line style and fixed position.
+ https://bugs.webkit.org/show_bug.cgi?id=45350
+
+ Test: fast/dom/firstline-fixed-crash.html
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::findNextLineBreak):
+
+2010-09-10 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Remove support for non-lazy attach and fix frames to load from insertedIntoDocument instead of attach
+ https://bugs.webkit.org/show_bug.cgi?id=45365
+
+ This change is the last piece of the puzzle which was preventing us from
+ removing all eager-attach logic and moving WebCore to using an entirely
+ recalcStyle-driven, on-demand renderer creation system, instead of every
+ element being synchronously attached during parsing, regardless of whether
+ it was ever going to be displayed or not.
+
+ This does not change the places we call lazyAttach vs. attach. This only
+ changes the behavior of frame/plugin elements when lazyAttach is called.
+ Previously lazyAttach would eager-attach those elements (and their ancestors)
+ because they were marked as canLazyAttach() { return false; }.
+
+ This is a very tricky change, please review carefully.
+
+ Mostly I'm moving logic which used to be in attach() into
+ insertedIntoDocument. Once it was there, there was no longer any reason
+ why frame elements couldn't lazyAttach, thus removing the need
+ for the non-lazy attach code path entirely.
+ We've not yet converted all callsites over to using lazyAttach() instead
+ of attach() however.
+
+ In order to move frame loading logic into insertedIntoDocument
+ instead of attach, I needed to make sure that any javascript calls
+ during the load would see an attached element. Thus I needed to mark
+ the element as needing style resolve so that it would attach itself
+ if needed.
+
+ I was not able to just call lazyAttach() from insertedIntoDocument directly
+ due to two conflicting assumptions in the rendering tree:
+ 1. ContainerNode::attach() assumes its "safe" to call attach on all children
+ without checking first if the child is already attached. This seems sane
+ since its strange to think of a subtree as being attached w/o ancestors
+ already being attached. Although it is a hard rule that subtrees may not
+ have renderers w/o ancestors also having renderers, I do not believe it's
+ a hard rule that subtrees may not be attached. Remember, attached() does
+ not imply renderer()! It's possible ContainerNode::attach()'s assumption is wrong here.
+ 2. Node::attach() asserts !attached(). This makes sense and I would not
+ want to remove this assert, however it means that if insertedIntoDocument
+ were to call lazyAttach() (thus marking the element as attached()) then
+ all callers would need to check if the element was already attached after
+ insertedIntoDocument (called by appendChild, parserAppendChild, etc.)
+ before calling attach or lazyAttach(). The following example:
+ element.innerHTML = "<span><iframe></span>" is one case where this
+ ASSERT would be hit if insertedIntoDocument called lazyAttach, since
+ ContainerNode::attach() (called on the span by in appendChild(DocumentFragment) code)
+ does not check if iframe is already attached.
+
+ Note: One subtle change here is that synchronous javascript which results
+ from javascript: or beforeload is now run as part of insertedIntoDocument
+ (thus any insert/append call *even* parserAddChild) instead of being
+ run during attach (technically in the post-attach callbacks).
+
+ This is covered by numerous layout tests.
+
+ * dom/ContainerNode.cpp:
+ (WebCore::willRemoveChild):
+ (WebCore::willRemoveChildren):
+ - Since insertedIntoDocument starts a load and yet does not mark the
+ element as attached, we need to always call willRemove().
+ See note above as to why we don't just mark attached() in insertedIntoDocument.
+ * dom/Node.cpp:
+ (WebCore::Node::markAncestorsWithChildNeedsStyleRecalc):
+ - Share some code between lazyAttach and setNeedsStyleRecalc.
+ (WebCore::Node::setNeedsStyleRecalc):
+ - Use the new markAncestorsWithChildNeedsStyleRecalc
+ (WebCore::Node::lazyAttach):
+ - Remove the non-lazy code path, and use markAncestorsWithChildNeedsStyleRecalc.
+ - Add an option to lazyAttach without marking attached(), used by HTMLFrameElementBase::insertedIntoDocument.
+ * dom/Node.h:
+ * html/HTMLFrameElementBase.cpp:
+ - m_shouldOpenURLAfterAttach is no longer needed, yay!
+ - m_checkAttachedTimer no longer has anything to do with attached(), so renamed it.
+ I also documented that the newly named m_checkInDocumentTimer is all about the
+ "magic iframe" performance quirk. (Which is actually speced in HTML5).
+ I was initially baffled by this code, so I documented it.
+ (WebCore::HTMLFrameElementBase::HTMLFrameElementBase)
+ (WebCore::HTMLFrameElementBase::insertedIntoDocument):
+ - This is the meat of this change, see discussion above.
+ (WebCore::HTMLFrameElementBase::attach):
+ - Code deleted or moved to insertedIntoDocument.
+ (WebCore::HTMLFrameElementBase::width):
+ - Fixed a bug in height()/width() which was probably causing crashes
+ and was causing incorrect behavior after this change.
+ renderBox() is not necessarily valid unless layout is up to date.
+ Updating layout, can cause renderBox() to go invalid, thus this
+ could have been a null-pointer crash.
+ (WebCore::HTMLFrameElementBase::height): see width()
+ (WebCore::HTMLFrameElementBase::setRemainsAliveOnRemovalFromTree): Timer rename.
+ (WebCore::HTMLFrameElementBase::checkInDocumentTimerFired): Timer rename.
+ * html/HTMLFrameElementBase.h:
+ * html/HTMLFrameOwnerElement.cpp:
+ (WebCore::HTMLFrameOwnerElement::willRemove):
+ - Disconnecting the owner element removes the frame from the frame tree.
+ frameDetached() calls Page::frameCount which expects that the frame is
+ already gone at this point and asserts when it's not. It's unclear how
+ this worked before, except that the frame removal was likely done in the
+ post-attach callback, so the frameCount was wrong (too high) during
+ frameDetached(), but was fixed up in the post-detach callback.
+ * html/parser/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::attachAtSite):
+ - Simplified this code, and added a check for the case when the node was already removed.
+ Since the load logic is now run during insertedIntoDocument instead of attach(),
+ synchronous javascript is now running during insertedIntoDocument and we need to
+ make sure that the child is still in the tree.
+
+2010-09-10 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, rolling out r67178.
+ http://trac.webkit.org/changeset/67178
+ https://bugs.webkit.org/show_bug.cgi?id=45524
+
+ re-roll-out patch to put original changes back in
+
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::parametersForPlugin):
+ (WebCore::HTMLObjectElement::updateWidget):
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::resourceWillUsePlugin):
+ * loader/SubframeLoader.h:
+
2010-09-10 Dirk Pranke <dpranke@chromium.org>
Reviewed by Kent Tamura.
diff --git a/WebCore/Configurations/FeatureDefines.xcconfig b/WebCore/Configurations/FeatureDefines.xcconfig
index 8f8c213..81d912f 100644
--- a/WebCore/Configurations/FeatureDefines.xcconfig
+++ b/WebCore/Configurations/FeatureDefines.xcconfig
@@ -69,7 +69,6 @@ ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
ENABLE_FILTERS = $(ENABLE_FILTERS_$(REAL_PLATFORM_NAME));
ENABLE_FILTERS_macosx = ENABLE_FILTERS;
-ENABLE_FILE_WRITER = ;
ENABLE_FILE_SYSTEM = ;
ENABLE_FULLSCREEN_API = ENABLE_FULLSCREEN_API;
ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
@@ -121,4 +120,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_WRITER) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/WebCore/Configurations/Version.xcconfig b/WebCore/Configurations/Version.xcconfig
index bc7cdb8..533d5e2 100644
--- a/WebCore/Configurations/Version.xcconfig
+++ b/WebCore/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 8;
+MINOR_VERSION = 9;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp
index 7a0c2fd..bab8109 100644
--- a/WebCore/DerivedSources.cpp
+++ b/WebCore/DerivedSources.cpp
@@ -118,6 +118,7 @@
#include "JSFlags.cpp"
#include "JSGeolocation.cpp"
#include "JSGeoposition.cpp"
+#include "JSHashChangeEvent.cpp"
#include "JSHistory.cpp"
#include "JSHTMLAllCollection.cpp"
#include "JSHTMLAnchorElement.cpp"
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index c37efb3..adbd30c 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -164,6 +164,8 @@ DOM_CLASSES = \
Flags \
Geolocation \
Geoposition \
+ HashChangeEvent \
+ History \
HTMLAllCollection \
HTMLAnchorElement \
HTMLAppletElement \
@@ -236,7 +238,6 @@ DOM_CLASSES = \
HTMLTitleElement \
HTMLUListElement \
HTMLVideoElement \
- History \
IDBAny \
IDBCursor \
IDBDatabaseError \
@@ -676,10 +677,8 @@ endif
ifeq ($(findstring ENABLE_VIDEO,$(FEATURE_DEFINES)), ENABLE_VIDEO)
USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/css/mediaControls.css
-ifeq ($(OS),MACOS)
USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/css/mediaControlsQuickTime.css
endif
-endif
ifeq ($(findstring ENABLE_FULLSCREEN_API,$(FEATURE_DEFINES)), ENABLE_FULLSCREEN_API)
USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/css/fullscreen.css
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index 28cdf1a..a3720e2 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 01d11cf..1a0a754 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -52,6 +52,7 @@ webcore_cppflags += \
-I$(srcdir)/WebCore/plugins \
-I$(srcdir)/WebCore/rendering \
-I$(srcdir)/WebCore/rendering/style \
+ -I$(srcdir)/WebCore/rendering/svg \
-I$(srcdir)/WebCore/storage \
-I$(srcdir)/WebCore/svg \
-I$(srcdir)/WebCore/svg/animation \
@@ -245,6 +246,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSGeolocation.h \
DerivedSources/WebCore/JSGeoposition.cpp \
DerivedSources/WebCore/JSGeoposition.h \
+ DerivedSources/WebCore/JSHashChangeEvent.cpp \
+ DerivedSources/WebCore/JSHashChangeEvent.h \
DerivedSources/WebCore/JSHistory.cpp \
DerivedSources/WebCore/JSHistory.h \
DerivedSources/WebCore/JSHTMLAllCollection.cpp \
@@ -392,8 +395,6 @@ webcore_built_sources += \
DerivedSources/WebCore/JSHTMLUListElement.h \
DerivedSources/WebCore/JSHTMLVideoElement.cpp \
DerivedSources/WebCore/JSHTMLVideoElement.h \
- DerivedSources/WebCore/JSTimeRanges.cpp \
- DerivedSources/WebCore/JSTimeRanges.h \
DerivedSources/WebCore/JSImageData.cpp \
DerivedSources/WebCore/JSImageData.h \
DerivedSources/WebCore/JSInjectedScriptHost.cpp \
@@ -486,12 +487,15 @@ webcore_built_sources += \
DerivedSources/WebCore/JSStyleSheet.h \
DerivedSources/WebCore/JSStyleSheetList.cpp \
DerivedSources/WebCore/JSStyleSheetList.h \
+ DerivedSources/WebCore/JSSVGElementWrapperFactory.cpp \
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/JSTimeRanges.cpp \
+ DerivedSources/WebCore/JSTimeRanges.h \
DerivedSources/WebCore/JSTiming.cpp \
DerivedSources/WebCore/JSTiming.h \
DerivedSources/WebCore/JSTouch.cpp \
@@ -552,56 +556,43 @@ webcore_built_sources += \
DerivedSources/WebCore/JSXMLSerializer.h \
DerivedSources/WebCore/JSXSLTProcessor.cpp \
DerivedSources/WebCore/JSXSLTProcessor.h \
+ DerivedSources/WebCore/MathMLElementFactory.cpp \
+ DerivedSources/WebCore/MathMLElementFactory.h \
+ DerivedSources/WebCore/MathMLNames.cpp \
+ DerivedSources/WebCore/MathMLNames.h \
+ DerivedSources/WebCore/SVGElementFactory.cpp \
+ DerivedSources/WebCore/SVGNames.cpp \
DerivedSources/WebCore/UserAgentStyleSheetsData.cpp \
DerivedSources/WebCore/UserAgentStyleSheets.h \
+ DerivedSources/WebCore/XLinkNames.cpp \
DerivedSources/WebCore/XMLNames.cpp \
DerivedSources/WebCore/XMLNames.h \
DerivedSources/WebCore/XMLNSNames.cpp \
DerivedSources/WebCore/XMLNSNames.h
-webcoregtk_dom_sources = \
- WebCore/bindings/gobject/ConvertToUTF8String.cpp \
- WebCore/bindings/gobject/ConvertToUTF8String.h \
- WebCore/bindings/gobject/GObjectEventListener.cpp \
- WebCore/bindings/gobject/GObjectEventListener.h \
- WebCore/bindings/gobject/WebKitDOMBinding.cpp \
- WebCore/bindings/gobject/WebKitDOMBinding.h \
- WebCore/bindings/gobject/WebKitDOMEventTarget.cpp \
- WebCore/bindings/gobject/WebKitDOMEventTarget.h \
- WebCore/bindings/gobject/WebKitDOMEventTargetPrivate.h \
- WebCore/bindings/gobject/WebKitHTMLElementWrapperFactory.cpp \
- WebCore/bindings/gobject/WebKitHTMLElementWrapperFactory.h \
- WebCore/bindings/gobject/WebKitDOMObject.cpp \
- WebCore/bindings/gobject/WebKitDOMObject.h
-
-webcoregtk_sources += $(webcoregtk_dom_sources)
-
webcore_sources += \
- WebCore/WebCorePrefix.h \
- WebCore/accessibility/AXObjectCache.cpp \
- WebCore/accessibility/AXObjectCache.h \
- WebCore/accessibility/AccessibilityARIAGrid.cpp \
- WebCore/accessibility/AccessibilityARIAGrid.h \
WebCore/accessibility/AccessibilityARIAGridCell.cpp \
WebCore/accessibility/AccessibilityARIAGridCell.h \
+ WebCore/accessibility/AccessibilityARIAGrid.cpp \
+ WebCore/accessibility/AccessibilityARIAGrid.h \
WebCore/accessibility/AccessibilityARIAGridRow.cpp \
WebCore/accessibility/AccessibilityARIAGridRow.h \
WebCore/accessibility/AccessibilityImageMapLink.cpp \
WebCore/accessibility/AccessibilityImageMapLink.h \
- WebCore/accessibility/AccessibilityList.cpp \
- WebCore/accessibility/AccessibilityList.h \
WebCore/accessibility/AccessibilityListBox.cpp \
WebCore/accessibility/AccessibilityListBox.h \
WebCore/accessibility/AccessibilityListBoxOption.cpp \
WebCore/accessibility/AccessibilityListBoxOption.h \
+ WebCore/accessibility/AccessibilityList.cpp \
+ WebCore/accessibility/AccessibilityList.h \
WebCore/accessibility/AccessibilityMediaControls.cpp \
WebCore/accessibility/AccessibilityMediaControls.h \
WebCore/accessibility/AccessibilityMenuList.cpp \
WebCore/accessibility/AccessibilityMenuList.h \
- WebCore/accessibility/AccessibilityMenuListPopup.cpp \
- WebCore/accessibility/AccessibilityMenuListPopup.h \
WebCore/accessibility/AccessibilityMenuListOption.cpp \
WebCore/accessibility/AccessibilityMenuListOption.h \
+ WebCore/accessibility/AccessibilityMenuListPopup.cpp \
+ WebCore/accessibility/AccessibilityMenuListPopup.h \
WebCore/accessibility/AccessibilityObject.cpp \
WebCore/accessibility/AccessibilityObject.h \
WebCore/accessibility/AccessibilityProgressIndicator.cpp \
@@ -612,26 +603,41 @@ webcore_sources += \
WebCore/accessibility/AccessibilityScrollbar.h \
WebCore/accessibility/AccessibilitySlider.cpp \
WebCore/accessibility/AccessibilitySlider.h \
- WebCore/accessibility/AccessibilityTable.cpp \
- WebCore/accessibility/AccessibilityTable.h \
WebCore/accessibility/AccessibilityTableCell.cpp \
WebCore/accessibility/AccessibilityTableCell.h \
WebCore/accessibility/AccessibilityTableColumn.cpp \
WebCore/accessibility/AccessibilityTableColumn.h \
+ WebCore/accessibility/AccessibilityTable.cpp \
+ WebCore/accessibility/AccessibilityTable.h \
WebCore/accessibility/AccessibilityTableHeaderContainer.cpp \
WebCore/accessibility/AccessibilityTableHeaderContainer.h \
WebCore/accessibility/AccessibilityTableRow.cpp \
WebCore/accessibility/AccessibilityTableRow.h \
+ WebCore/accessibility/AXObjectCache.cpp \
+ WebCore/accessibility/AXObjectCache.h \
WebCore/bindings/generic/ActiveDOMCallback.cpp \
WebCore/bindings/generic/ActiveDOMCallback.h \
WebCore/bindings/generic/BindingFrame.h \
WebCore/bindings/generic/BindingLocation.h \
- WebCore/bindings/generic/BindingSecurity.h \
WebCore/bindings/generic/BindingSecurityBase.cpp \
WebCore/bindings/generic/BindingSecurityBase.h \
+ WebCore/bindings/generic/BindingSecurity.h \
WebCore/bindings/generic/GenericBinding.h \
WebCore/bindings/generic/RuntimeEnabledFeatures.cpp \
WebCore/bindings/generic/RuntimeEnabledFeatures.h \
+ WebCore/bindings/gobject/ConvertToUTF8String.cpp \
+ WebCore/bindings/gobject/ConvertToUTF8String.h \
+ WebCore/bindings/gobject/GObjectEventListener.cpp \
+ WebCore/bindings/gobject/GObjectEventListener.h \
+ WebCore/bindings/gobject/WebKitDOMBinding.cpp \
+ WebCore/bindings/gobject/WebKitDOMBinding.h \
+ WebCore/bindings/gobject/WebKitDOMEventTarget.cpp \
+ WebCore/bindings/gobject/WebKitDOMEventTarget.h \
+ WebCore/bindings/gobject/WebKitDOMEventTargetPrivate.h \
+ WebCore/bindings/gobject/WebKitDOMObject.cpp \
+ WebCore/bindings/gobject/WebKitDOMObject.h \
+ WebCore/bindings/gobject/WebKitHTMLElementWrapperFactory.cpp \
+ WebCore/bindings/gobject/WebKitHTMLElementWrapperFactory.h \
WebCore/bindings/js/CachedScriptSourceProvider.h \
WebCore/bindings/js/DOMObjectHashTableMap.cpp \
WebCore/bindings/js/DOMObjectHashTableMap.h \
@@ -639,38 +645,52 @@ webcore_sources += \
WebCore/bindings/js/DOMWrapperWorld.h \
WebCore/bindings/js/GCController.cpp \
WebCore/bindings/js/GCController.h \
+ WebCore/bindings/js/JavaScriptCallFrame.cpp \
+ WebCore/bindings/js/JavaScriptCallFrame.h \
WebCore/bindings/js/JSAttrCustom.cpp \
- WebCore/bindings/js/JSCDATASectionCustom.cpp \
- WebCore/bindings/js/JSDataGridColumnListCustom.cpp \
- WebCore/bindings/js/JSDataGridDataSource.cpp \
- WebCore/bindings/js/JSDataGridDataSource.h \
- WebCore/bindings/js/JSDebugWrapperSet.cpp \
- WebCore/bindings/js/JSDebugWrapperSet.h \
- WebCore/bindings/js/JSCSSRuleCustom.cpp \
- WebCore/bindings/js/JSCSSRuleListCustom.cpp \
- WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp \
- WebCore/bindings/js/JSCSSStyleDeclarationCustom.h \
- WebCore/bindings/js/JSCSSValueCustom.cpp \
+ WebCore/bindings/js/JSAudioConstructor.cpp \
+ WebCore/bindings/js/JSAudioConstructor.h \
WebCore/bindings/js/JSCallbackData.cpp \
WebCore/bindings/js/JSCallbackData.h \
- WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp \
WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp \
+ WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp \
+ WebCore/bindings/js/JSCDATASectionCustom.cpp \
WebCore/bindings/js/JSClipboardCustom.cpp \
WebCore/bindings/js/JSConsoleCustom.cpp \
WebCore/bindings/js/JSCoordinatesCustom.cpp \
+ WebCore/bindings/js/JSCSSRuleCustom.cpp \
+ WebCore/bindings/js/JSCSSRuleListCustom.cpp \
+ WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp \
+ WebCore/bindings/js/JSCSSStyleDeclarationCustom.h \
+ WebCore/bindings/js/JSCSSValueCustom.cpp \
WebCore/bindings/js/JSCustomPositionCallback.cpp \
WebCore/bindings/js/JSCustomPositionCallback.h \
WebCore/bindings/js/JSCustomPositionErrorCallback.cpp \
WebCore/bindings/js/JSCustomPositionErrorCallback.h \
+ WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp \
WebCore/bindings/js/JSCustomVoidCallback.cpp \
WebCore/bindings/js/JSCustomVoidCallback.h \
WebCore/bindings/js/JSCustomXPathNSResolver.cpp \
WebCore/bindings/js/JSCustomXPathNSResolver.h \
+ WebCore/bindings/js/JSDataGridColumnListCustom.cpp \
+ WebCore/bindings/js/JSDataGridDataSource.cpp \
+ WebCore/bindings/js/JSDataGridDataSource.h \
+ WebCore/bindings/js/JSDebugWrapperSet.cpp \
+ WebCore/bindings/js/JSDebugWrapperSet.h \
+ WebCore/bindings/js/JSDedicatedWorkerContextCustom.cpp \
+ WebCore/bindings/js/JSDeviceMotionEventCustom.cpp \
+ WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp \
+ WebCore/bindings/js/JSDirectoryEntryCustom.cpp \
+ WebCore/bindings/js/JSDocumentCustom.cpp \
+ WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp \
WebCore/bindings/js/JSDOMBinding.cpp \
WebCore/bindings/js/JSDOMBinding.h \
WebCore/bindings/js/JSDOMFormDataCustom.cpp \
WebCore/bindings/js/JSDOMGlobalObject.cpp \
WebCore/bindings/js/JSDOMGlobalObject.h \
+ WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp \
+ WebCore/bindings/js/JSDOMPluginArrayCustom.cpp \
+ WebCore/bindings/js/JSDOMPluginCustom.cpp \
WebCore/bindings/js/JSDOMStringMapCustom.cpp \
WebCore/bindings/js/JSDOMStringMapCustom.h \
WebCore/bindings/js/JSDOMWindowBase.cpp \
@@ -681,10 +701,8 @@ webcore_sources += \
WebCore/bindings/js/JSDOMWindowShell.h \
WebCore/bindings/js/JSDOMWrapper.cpp \
WebCore/bindings/js/JSDOMWrapper.h \
- WebCore/bindings/js/JSDeviceMotionEventCustom.cpp \
- WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp \
- WebCore/bindings/js/JSDocumentCustom.cpp \
WebCore/bindings/js/JSElementCustom.cpp \
+ WebCore/bindings/js/JSEntryCustom.cpp \
WebCore/bindings/js/JSEventCustom.cpp \
WebCore/bindings/js/JSEventListener.cpp \
WebCore/bindings/js/JSEventListener.h \
@@ -694,6 +712,8 @@ webcore_sources += \
WebCore/bindings/js/JSExceptionBase.cpp \
WebCore/bindings/js/JSExceptionBase.h \
WebCore/bindings/js/JSGeolocationCustom.cpp \
+ WebCore/bindings/js/JSHistoryCustom.cpp \
+ WebCore/bindings/js/JSHistoryCustom.h \
WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp \
WebCore/bindings/js/JSHTMLAppletElementCustom.cpp \
WebCore/bindings/js/JSHTMLAppletElementCustom.h \
@@ -714,8 +734,6 @@ webcore_sources += \
WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp \
WebCore/bindings/js/JSHTMLSelectElementCustom.cpp \
WebCore/bindings/js/JSHTMLSelectElementCustom.h \
- WebCore/bindings/js/JSHistoryCustom.cpp \
- WebCore/bindings/js/JSHistoryCustom.h \
WebCore/bindings/js/JSImageConstructor.cpp \
WebCore/bindings/js/JSImageConstructor.h \
WebCore/bindings/js/JSImageDataCustom.cpp \
@@ -732,7 +750,6 @@ webcore_sources += \
WebCore/bindings/js/JSMessageEventCustom.cpp \
WebCore/bindings/js/JSMessagePortCustom.cpp \
WebCore/bindings/js/JSMessagePortCustom.h \
- WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp \
WebCore/bindings/js/JSNamedNodeMapCustom.cpp \
WebCore/bindings/js/JSNavigatorCustom.cpp \
WebCore/bindings/js/JSNodeCustom.cpp \
@@ -744,26 +761,40 @@ webcore_sources += \
WebCore/bindings/js/JSNodeListCustom.cpp \
WebCore/bindings/js/JSOptionConstructor.cpp \
WebCore/bindings/js/JSOptionConstructor.h \
- WebCore/bindings/js/JSDOMPluginArrayCustom.cpp \
- WebCore/bindings/js/JSDOMPluginCustom.cpp \
WebCore/bindings/js/JSPluginElementFunctions.cpp \
WebCore/bindings/js/JSPluginElementFunctions.h \
WebCore/bindings/js/JSPopStateEventCustom.cpp \
WebCore/bindings/js/JSScriptProfileNodeCustom.cpp \
+ WebCore/bindings/js/JSSharedWorkerCustom.cpp \
+ WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp \
+ WebCore/bindings/js/JSSQLTransactionCustom.cpp \
+ WebCore/bindings/js/JSSQLTransactionSyncCustom.cpp \
+ WebCore/bindings/js/JSStorageCustom.cpp \
WebCore/bindings/js/JSStorageCustom.h \
WebCore/bindings/js/JSStyleSheetCustom.cpp \
WebCore/bindings/js/JSStyleSheetListCustom.cpp \
+ WebCore/bindings/js/JSSVGContextCache.h \
+ WebCore/bindings/js/JSSVGElementInstanceCustom.cpp \
+ WebCore/bindings/js/JSSVGLengthCustom.cpp \
+ WebCore/bindings/js/JSSVGMatrixCustom.cpp \
+ WebCore/bindings/js/JSSVGPathSegCustom.cpp \
+ WebCore/bindings/js/JSSVGPathSegListCustom.cpp \
+ WebCore/bindings/js/JSSVGPODListCustom.h \
+ WebCore/bindings/js/JSSVGPODTypeWrapper.h \
WebCore/bindings/js/JSTextCustom.cpp \
WebCore/bindings/js/JSTreeWalkerCustom.cpp \
WebCore/bindings/js/JSWebKitCSSMatrixCustom.cpp \
WebCore/bindings/js/JSWebKitPointCustom.cpp \
+ WebCore/bindings/js/JSWebSocketCustom.cpp \
+ WebCore/bindings/js/JSWorkerContextBase.cpp \
+ WebCore/bindings/js/JSWorkerContextBase.h \
+ WebCore/bindings/js/JSWorkerContextCustom.cpp \
WebCore/bindings/js/JSWorkerContextErrorHandler.cpp \
WebCore/bindings/js/JSWorkerContextErrorHandler.h \
+ WebCore/bindings/js/JSWorkerCustom.cpp \
WebCore/bindings/js/JSXMLHttpRequestCustom.cpp \
WebCore/bindings/js/JSXMLHttpRequestUploadCustom.cpp \
WebCore/bindings/js/JSXSLTProcessorCustom.cpp \
- WebCore/bindings/js/JavaScriptCallFrame.cpp \
- WebCore/bindings/js/JavaScriptCallFrame.h \
WebCore/bindings/js/ScheduledAction.cpp \
WebCore/bindings/js/ScheduledAction.h \
WebCore/bindings/js/ScriptCachedFrameData.cpp \
@@ -796,41 +827,43 @@ webcore_sources += \
WebCore/bindings/js/ScriptState.cpp \
WebCore/bindings/js/ScriptState.h \
WebCore/bindings/js/ScriptString.h \
- WebCore/bindings/js/ScriptWrappable.h \
WebCore/bindings/js/ScriptValue.cpp \
WebCore/bindings/js/ScriptValue.h \
+ WebCore/bindings/js/ScriptWrappable.h \
WebCore/bindings/js/SerializedScriptValue.cpp \
WebCore/bindings/js/SerializedScriptValue.h \
- WebCore/bindings/js/StringSourceProvider.h \
- WebCore/bindings/js/WebCoreJSClientData.h \
WebCore/bindings/js/specialization/JSBindingState.cpp \
WebCore/bindings/js/specialization/JSBindingState.h \
+ WebCore/bindings/js/StringSourceProvider.h \
+ WebCore/bindings/js/WebCoreJSClientData.h \
+ WebCore/bindings/js/WorkerScriptController.cpp \
+ WebCore/bindings/js/WorkerScriptController.h \
WebCore/bindings/ScriptControllerBase.cpp \
WebCore/bindings/ScriptControllerBase.h \
WebCore/bridge/Bridge.h \
- WebCore/bridge/IdentifierRep.cpp \
- WebCore/bridge/IdentifierRep.h \
- WebCore/bridge/NP_jsobject.cpp \
- WebCore/bridge/NP_jsobject.h \
- WebCore/bridge/c/CRuntimeObject.cpp \
- WebCore/bridge/c/CRuntimeObject.h \
WebCore/bridge/c/c_class.cpp \
WebCore/bridge/c/c_class.h \
WebCore/bridge/c/c_instance.cpp \
WebCore/bridge/c/c_instance.h \
WebCore/bridge/c/c_runtime.cpp \
WebCore/bridge/c/c_runtime.h \
+ WebCore/bridge/c/CRuntimeObject.cpp \
+ WebCore/bridge/c/CRuntimeObject.h \
WebCore/bridge/c/c_utility.cpp \
WebCore/bridge/c/c_utility.h \
+ WebCore/bridge/IdentifierRep.cpp \
+ WebCore/bridge/IdentifierRep.h \
WebCore/bridge/jni/JNIBridge.h \
- WebCore/bridge/jni/JNIUtility.h \
WebCore/bridge/jni/jni_jsobject.h \
- WebCore/bridge/jni/jsc/JNIBridgeJSC.h \
+ WebCore/bridge/jni/JNIUtility.h \
WebCore/bridge/jni/jsc/JavaClassJSC.h \
WebCore/bridge/jni/jsc/JavaInstanceJSC.h \
- WebCore/bridge/jsc/BridgeJSC.h \
+ WebCore/bridge/jni/jsc/JNIBridgeJSC.h \
WebCore/bridge/jsc/BridgeJSC.cpp \
+ WebCore/bridge/jsc/BridgeJSC.h \
WebCore/bridge/npapi.h \
+ WebCore/bridge/NP_jsobject.cpp \
+ WebCore/bridge/NP_jsobject.h \
WebCore/bridge/npruntime.cpp \
WebCore/bridge/npruntime.h \
WebCore/bridge/npruntime_impl.h \
@@ -846,6 +879,7 @@ webcore_sources += \
WebCore/bridge/runtime_root.cpp \
WebCore/bridge/runtime_root.h \
WebCore/config.h \
+ WebCore/css/Counter.h \
WebCore/css/CSSBorderImageValue.cpp \
WebCore/css/CSSBorderImageValue.h \
WebCore/css/CSSCanvasValue.cpp \
@@ -902,10 +936,12 @@ webcore_sources += \
WebCore/css/CSSProperty.h \
WebCore/css/CSSPropertyLonghand.cpp \
WebCore/css/CSSPropertyLonghand.h \
+ WebCore/css/CSSPropertySourceData.cpp \
+ WebCore/css/CSSPropertySourceData.h \
WebCore/css/CSSQuirkPrimitiveValue.h \
+ WebCore/css/CSSReflectionDirection.h \
WebCore/css/CSSReflectValue.cpp \
WebCore/css/CSSReflectValue.h \
- WebCore/css/CSSReflectionDirection.h \
WebCore/css/CSSRule.cpp \
WebCore/css/CSSRule.h \
WebCore/css/CSSRuleList.cpp \
@@ -938,7 +974,6 @@ webcore_sources += \
WebCore/css/CSSVariablesDeclaration.h \
WebCore/css/CSSVariablesRule.cpp \
WebCore/css/CSSVariablesRule.h \
- WebCore/css/Counter.h \
WebCore/css/DashboardRegion.h \
WebCore/css/FontFamilyValue.cpp \
WebCore/css/FontFamilyValue.h \
@@ -970,6 +1005,9 @@ webcore_sources += \
WebCore/css/StyleSheet.h \
WebCore/css/StyleSheetList.cpp \
WebCore/css/StyleSheetList.h \
+ WebCore/css/SVGCSSComputedStyleDeclaration.cpp \
+ WebCore/css/SVGCSSParser.cpp \
+ WebCore/css/SVGCSSStyleSelector.cpp \
WebCore/css/WebKitCSSKeyframeRule.cpp \
WebCore/css/WebKitCSSKeyframeRule.h \
WebCore/css/WebKitCSSKeyframesRule.cpp \
@@ -995,8 +1033,6 @@ webcore_sources += \
WebCore/dom/BeforeUnloadEvent.h \
WebCore/dom/CDATASection.cpp \
WebCore/dom/CDATASection.h \
- WebCore/dom/CSSMappedAttributeDeclaration.cpp \
- WebCore/dom/CSSMappedAttributeDeclaration.h \
WebCore/dom/CharacterData.cpp \
WebCore/dom/CharacterData.h \
WebCore/dom/CheckedRadioButtons.cpp \
@@ -1009,32 +1045,29 @@ webcore_sources += \
WebCore/dom/ClientRect.h \
WebCore/dom/ClientRectList.cpp \
WebCore/dom/ClientRectList.h \
- WebCore/dom/Clipboard.cpp \
- WebCore/dom/Clipboard.h \
WebCore/dom/ClipboardAccessPolicy.h \
+ WebCore/dom/Clipboard.cpp \
WebCore/dom/ClipboardEvent.cpp \
WebCore/dom/ClipboardEvent.h \
+ WebCore/dom/Clipboard.h \
WebCore/dom/Comment.cpp \
WebCore/dom/Comment.h \
WebCore/dom/CompositionEvent.cpp \
WebCore/dom/CompositionEvent.h \
+ WebCore/dom/ContainerNodeAlgorithms.h \
WebCore/dom/ContainerNode.cpp \
WebCore/dom/ContainerNode.h \
- WebCore/dom/ContainerNodeAlgorithms.h \
WebCore/dom/CrossThreadTask.h \
+ WebCore/dom/CSSMappedAttributeDeclaration.cpp \
+ WebCore/dom/CSSMappedAttributeDeclaration.h \
WebCore/dom/CustomEvent.cpp \
WebCore/dom/CustomEvent.h \
- WebCore/dom/DOMCoreException.h \
- WebCore/dom/DOMImplementation.cpp \
- WebCore/dom/DOMImplementation.h \
- WebCore/dom/DOMStringList.cpp \
- WebCore/dom/DOMStringList.h \
- WebCore/dom/DOMStringMap.cpp \
- WebCore/dom/DOMStringMap.h \
WebCore/dom/DatasetDOMStringMap.cpp \
WebCore/dom/DatasetDOMStringMap.h \
WebCore/dom/DecodedDataDocumentParser.cpp \
WebCore/dom/DecodedDataDocumentParser.h \
+ WebCore/dom/default/PlatformMessagePortChannel.cpp \
+ WebCore/dom/default/PlatformMessagePortChannel.h \
WebCore/dom/DeviceMotionClient.h \
WebCore/dom/DeviceMotionController.cpp \
WebCore/dom/DeviceMotionController.h \
@@ -1042,23 +1075,31 @@ webcore_sources += \
WebCore/dom/DeviceMotionData.h \
WebCore/dom/DeviceMotionEvent.cpp \
WebCore/dom/DeviceMotionEvent.h \
- WebCore/dom/DeviceOrientation.cpp \
- WebCore/dom/DeviceOrientation.h \
WebCore/dom/DeviceOrientationClient.h \
WebCore/dom/DeviceOrientationController.cpp \
WebCore/dom/DeviceOrientationController.h \
+ WebCore/dom/DeviceOrientation.cpp \
WebCore/dom/DeviceOrientationEvent.cpp \
WebCore/dom/DeviceOrientationEvent.h \
+ WebCore/dom/DeviceOrientation.h \
WebCore/dom/Document.cpp \
- WebCore/dom/Document.h \
WebCore/dom/DocumentFragment.cpp \
WebCore/dom/DocumentFragment.h \
- WebCore/dom/DocumentMarker.h \
+ WebCore/dom/Document.h \
WebCore/dom/DocumentMarkerController.cpp \
WebCore/dom/DocumentMarkerController.h \
+ WebCore/dom/DocumentMarker.h \
WebCore/dom/DocumentParser.cpp \
+ WebCore/dom/DocumentParser.h \
WebCore/dom/DocumentType.cpp \
WebCore/dom/DocumentType.h \
+ WebCore/dom/DOMCoreException.h \
+ WebCore/dom/DOMImplementation.cpp \
+ WebCore/dom/DOMImplementation.h \
+ WebCore/dom/DOMStringList.cpp \
+ WebCore/dom/DOMStringList.h \
+ WebCore/dom/DOMStringMap.cpp \
+ WebCore/dom/DOMStringMap.h \
WebCore/dom/DynamicNodeList.cpp \
WebCore/dom/DynamicNodeList.h \
WebCore/dom/EditingText.cpp \
@@ -1073,8 +1114,8 @@ webcore_sources += \
WebCore/dom/ErrorEvent.cpp \
WebCore/dom/ErrorEvent.h \
WebCore/dom/Event.cpp \
- WebCore/dom/Event.h \
WebCore/dom/EventException.h \
+ WebCore/dom/Event.h \
WebCore/dom/EventListener.h \
WebCore/dom/EventNames.cpp \
WebCore/dom/EventNames.h \
@@ -1087,6 +1128,7 @@ webcore_sources += \
WebCore/dom/FragmentScriptingPermission.h \
WebCore/dom/InputElement.cpp \
WebCore/dom/InputElement.h \
+ WebCore/dom/HashChangeEvent.h \
WebCore/dom/KeyboardEvent.cpp \
WebCore/dom/KeyboardEvent.h \
WebCore/dom/MappedAttributeEntry.h \
@@ -1094,26 +1136,26 @@ webcore_sources += \
WebCore/dom/MessageChannel.h \
WebCore/dom/MessageEvent.cpp \
WebCore/dom/MessageEvent.h \
- WebCore/dom/MessagePort.cpp \
- WebCore/dom/MessagePort.h \
WebCore/dom/MessagePortChannel.cpp \
WebCore/dom/MessagePortChannel.h \
+ WebCore/dom/MessagePort.cpp \
+ WebCore/dom/MessagePort.h \
WebCore/dom/MouseEvent.cpp \
WebCore/dom/MouseEvent.h \
WebCore/dom/MouseRelatedEvent.cpp \
WebCore/dom/MouseRelatedEvent.h \
WebCore/dom/MutationEvent.cpp \
WebCore/dom/MutationEvent.h \
- WebCore/dom/NameNodeList.cpp \
- WebCore/dom/NameNodeList.h \
WebCore/dom/NamedNodeMap.cpp \
WebCore/dom/NamedNodeMap.h \
+ WebCore/dom/NameNodeList.cpp \
+ WebCore/dom/NameNodeList.h \
WebCore/dom/Node.cpp \
- WebCore/dom/Node.h \
- WebCore/dom/NodeFilter.cpp \
- WebCore/dom/NodeFilter.h \
WebCore/dom/NodeFilterCondition.cpp \
WebCore/dom/NodeFilterCondition.h \
+ WebCore/dom/NodeFilter.cpp \
+ WebCore/dom/NodeFilter.h \
+ WebCore/dom/Node.h \
WebCore/dom/NodeIterator.cpp \
WebCore/dom/NodeIterator.h \
WebCore/dom/NodeList.h \
@@ -1122,20 +1164,20 @@ webcore_sources += \
WebCore/dom/NodeWithIndex.h \
WebCore/dom/Notation.cpp \
WebCore/dom/Notation.h \
- WebCore/dom/OptionGroupElement.cpp \
- WebCore/dom/OptionGroupElement.h \
WebCore/dom/OptionElement.cpp \
WebCore/dom/OptionElement.h \
+ WebCore/dom/OptionGroupElement.cpp \
+ WebCore/dom/OptionGroupElement.h \
WebCore/dom/OverflowEvent.cpp \
WebCore/dom/OverflowEvent.h \
WebCore/dom/PageTransitionEvent.cpp \
WebCore/dom/PageTransitionEvent.h \
WebCore/dom/PendingScript.cpp \
WebCore/dom/PendingScript.h \
- WebCore/dom/Position.cpp \
- WebCore/dom/Position.h \
WebCore/dom/PopStateEvent.cpp \
WebCore/dom/PopStateEvent.h \
+ WebCore/dom/Position.cpp \
+ WebCore/dom/Position.h \
WebCore/dom/PositionIterator.cpp \
WebCore/dom/PositionIterator.h \
WebCore/dom/ProcessingInstruction.cpp \
@@ -1144,10 +1186,10 @@ webcore_sources += \
WebCore/dom/ProgressEvent.h \
WebCore/dom/QualifiedName.cpp \
WebCore/dom/QualifiedName.h \
- WebCore/dom/Range.cpp \
- WebCore/dom/Range.h \
WebCore/dom/RangeBoundaryPoint.h \
+ WebCore/dom/Range.cpp \
WebCore/dom/RangeException.h \
+ WebCore/dom/Range.h \
WebCore/dom/RawDataDocumentParser.h \
WebCore/dom/RegisteredEventListener.cpp \
WebCore/dom/RegisteredEventListener.h \
@@ -1167,17 +1209,18 @@ webcore_sources += \
WebCore/dom/StaticHashSetNodeList.h \
WebCore/dom/StaticNodeList.cpp \
WebCore/dom/StaticNodeList.h \
- WebCore/dom/StyleElement.cpp \
- WebCore/dom/StyleElement.h \
WebCore/dom/StyledElement.cpp \
WebCore/dom/StyledElement.h \
+ WebCore/dom/StyleElement.cpp \
+ WebCore/dom/StyleElement.h \
WebCore/dom/TagNodeList.cpp \
WebCore/dom/TagNodeList.h \
WebCore/dom/Text.cpp \
- WebCore/dom/Text.h \
WebCore/dom/TextEvent.cpp \
WebCore/dom/TextEvent.h \
- WebCore/dom/DocumentParser.h \
+ WebCore/dom/Text.h \
+ WebCore/dom/TransformSource.h \
+ WebCore/dom/TransformSourceLibxslt.cpp \
WebCore/dom/Traversal.cpp \
WebCore/dom/Traversal.h \
WebCore/dom/TreeDepthLimit.h \
@@ -1204,8 +1247,6 @@ webcore_sources += \
WebCore/dom/XMLDocumentParserLibxml2.cpp \
WebCore/dom/XMLDocumentParserScope.cpp \
WebCore/dom/XMLDocumentParserScope.h \
- WebCore/dom/default/PlatformMessagePortChannel.cpp \
- WebCore/dom/default/PlatformMessagePortChannel.h \
WebCore/editing/AppendNodeCommand.cpp \
WebCore/editing/AppendNodeCommand.h \
WebCore/editing/ApplyStyleCommand.cpp \
@@ -1216,10 +1257,10 @@ webcore_sources += \
WebCore/editing/CompositeEditCommand.h \
WebCore/editing/CreateLinkCommand.cpp \
WebCore/editing/CreateLinkCommand.h \
- WebCore/editing/DeleteButton.cpp \
- WebCore/editing/DeleteButton.h \
WebCore/editing/DeleteButtonController.cpp \
WebCore/editing/DeleteButtonController.h \
+ WebCore/editing/DeleteButton.cpp \
+ WebCore/editing/DeleteButton.h \
WebCore/editing/DeleteFromTextNodeCommand.cpp \
WebCore/editing/DeleteFromTextNodeCommand.h \
WebCore/editing/DeleteSelectionCommand.cpp \
@@ -1229,13 +1270,16 @@ webcore_sources += \
WebCore/editing/EditCommand.h \
WebCore/editing/EditingBehavior.h \
WebCore/editing/EditingBehaviorTypes.h \
- WebCore/editing/Editor.cpp \
- WebCore/editing/Editor.h \
WebCore/editing/EditorCommand.cpp \
+ WebCore/editing/Editor.cpp \
WebCore/editing/EditorDeleteAction.h \
+ WebCore/editing/Editor.h \
WebCore/editing/EditorInsertAction.h \
WebCore/editing/FormatBlockCommand.cpp \
WebCore/editing/FormatBlockCommand.h \
+ WebCore/editing/gtk/SelectionControllerGtk.cpp \
+ WebCore/editing/htmlediting.cpp \
+ WebCore/editing/htmlediting.h \
WebCore/editing/HTMLInterchange.cpp \
WebCore/editing/HTMLInterchange.h \
WebCore/editing/IndentOutdentCommand.cpp \
@@ -1254,6 +1298,8 @@ webcore_sources += \
WebCore/editing/InsertTextCommand.h \
WebCore/editing/JoinTextNodesCommand.cpp \
WebCore/editing/JoinTextNodesCommand.h \
+ WebCore/editing/markup.cpp \
+ WebCore/editing/markup.h \
WebCore/editing/MergeIdenticalElementsCommand.cpp \
WebCore/editing/MergeIdenticalElementsCommand.h \
WebCore/editing/ModifySelectionListLevel.cpp \
@@ -1297,25 +1343,39 @@ webcore_sources += \
WebCore/editing/VisiblePosition.h \
WebCore/editing/VisibleSelection.cpp \
WebCore/editing/VisibleSelection.h \
- WebCore/editing/WrapContentsInDummySpanCommand.cpp \
- WebCore/editing/WrapContentsInDummySpanCommand.h \
- WebCore/editing/htmlediting.cpp \
- WebCore/editing/htmlediting.h \
- WebCore/editing/markup.cpp \
- WebCore/editing/markup.h \
WebCore/editing/visible_units.cpp \
WebCore/editing/visible_units.h \
- WebCore/editing/gtk/SelectionControllerGtk.cpp \
- WebCore/fileapi/Blob.cpp \
- WebCore/fileapi/Blob.h \
+ WebCore/editing/WrapContentsInDummySpanCommand.cpp \
+ WebCore/editing/WrapContentsInDummySpanCommand.h \
+ WebCore/fileapi/AsyncFileWriter.h \
WebCore/fileapi/BlobBuilder.cpp \
WebCore/fileapi/BlobBuilder.h \
+ WebCore/fileapi/Blob.cpp \
+ WebCore/fileapi/Blob.h \
WebCore/fileapi/BlobURL.cpp \
WebCore/fileapi/BlobURL.h \
+ WebCore/fileapi/DirectoryEntry.cpp \
+ WebCore/fileapi/DirectoryEntry.h \
+ WebCore/fileapi/DirectoryReader.cpp \
+ WebCore/fileapi/DirectoryReader.h \
+ WebCore/fileapi/DOMFilePath.cpp \
+ WebCore/fileapi/DOMFilePath.h \
+ WebCore/fileapi/DOMFileSystem.cpp \
+ WebCore/fileapi/DOMFileSystem.h \
+ WebCore/fileapi/EntriesCallback.h \
+ WebCore/fileapi/EntryArray.cpp \
+ WebCore/fileapi/EntryArray.h \
+ WebCore/fileapi/EntryCallback.h \
+ WebCore/fileapi/Entry.cpp \
+ WebCore/fileapi/Entry.h \
+ WebCore/fileapi/ErrorCallback.h \
+ WebCore/fileapi/FileCallback.h \
WebCore/fileapi/File.cpp \
- WebCore/fileapi/File.h \
+ WebCore/fileapi/FileEntry.cpp \
+ WebCore/fileapi/FileEntry.h \
WebCore/fileapi/FileError.h \
WebCore/fileapi/FileException.h \
+ WebCore/fileapi/File.h \
WebCore/fileapi/FileList.cpp \
WebCore/fileapi/FileList.h \
WebCore/fileapi/FileReader.cpp \
@@ -1324,14 +1384,26 @@ webcore_sources += \
WebCore/fileapi/FileReaderSync.h \
WebCore/fileapi/FileStreamProxy.cpp \
WebCore/fileapi/FileStreamProxy.h \
+ WebCore/fileapi/FileSystemCallback.h \
+ WebCore/fileapi/FileSystemCallbacks.cpp \
+ WebCore/fileapi/FileSystemCallbacks.h \
WebCore/fileapi/FileThread.cpp \
WebCore/fileapi/FileThread.h \
WebCore/fileapi/FileThreadTask.h \
+ WebCore/fileapi/FileWriterCallback.h \
+ WebCore/fileapi/FileWriterClient.h \
+ WebCore/fileapi/FileWriter.cpp \
+ WebCore/fileapi/FileWriter.h \
+ WebCore/fileapi/Flags.h \
+ WebCore/fileapi/LocalFileSystem.cpp \
+ WebCore/fileapi/LocalFileSystem.h \
+ WebCore/fileapi/MetadataCallback.h \
+ WebCore/fileapi/Metadata.h \
WebCore/fileapi/ThreadableBlobRegistry.cpp \
WebCore/fileapi/ThreadableBlobRegistry.h \
+ WebCore/history/BackForwardControllerClient.h \
WebCore/history/BackForwardController.cpp \
WebCore/history/BackForwardController.h \
- WebCore/history/BackForwardControllerClient.h \
WebCore/history/BackForwardList.h \
WebCore/history/BackForwardListImpl.cpp \
WebCore/history/BackForwardListImpl.h \
@@ -1346,13 +1418,22 @@ webcore_sources += \
WebCore/history/PageCache.h \
WebCore/html/AsyncImageResizer.cpp \
WebCore/html/AsyncImageResizer.h \
+ WebCore/html/canvas/CanvasContextAttributes.h \
+ WebCore/html/canvas/CanvasGradient.cpp \
+ WebCore/html/canvas/CanvasGradient.h \
+ WebCore/html/canvas/CanvasPattern.cpp \
+ WebCore/html/canvas/CanvasPattern.h \
+ WebCore/html/canvas/CanvasPixelArray.cpp \
+ WebCore/html/canvas/CanvasPixelArray.h \
+ WebCore/html/canvas/CanvasRenderingContext2D.cpp \
+ WebCore/html/canvas/CanvasRenderingContext2D.h \
+ WebCore/html/canvas/CanvasRenderingContext.cpp \
+ WebCore/html/canvas/CanvasRenderingContext.h \
+ WebCore/html/canvas/CanvasStyle.cpp \
+ WebCore/html/canvas/CanvasStyle.h \
WebCore/html/CollectionCache.cpp \
WebCore/html/CollectionCache.h \
WebCore/html/CollectionType.h \
- WebCore/html/DOMDataGridDataSource.cpp \
- WebCore/html/DOMDataGridDataSource.h \
- WebCore/html/DOMFormData.cpp \
- WebCore/html/DOMFormData.h \
WebCore/html/DataGridColumn.cpp \
WebCore/html/DataGridColumn.h \
WebCore/html/DataGridColumnList.cpp \
@@ -1360,10 +1441,14 @@ webcore_sources += \
WebCore/html/DataGridDataSource.h \
WebCore/html/DateComponents.cpp \
WebCore/html/DateComponents.h \
- WebCore/html/FTPDirectoryDocument.cpp \
- WebCore/html/FTPDirectoryDocument.h \
+ WebCore/html/DOMDataGridDataSource.cpp \
+ WebCore/html/DOMDataGridDataSource.h \
+ WebCore/html/DOMFormData.cpp \
+ WebCore/html/DOMFormData.h \
WebCore/html/FormDataList.cpp \
WebCore/html/FormDataList.h \
+ WebCore/html/FTPDirectoryDocument.cpp \
+ WebCore/html/FTPDirectoryDocument.h \
WebCore/html/HTMLAllCollection.cpp \
WebCore/html/HTMLAllCollection.h \
WebCore/html/HTMLAnchorElement.cpp \
@@ -1372,8 +1457,8 @@ webcore_sources += \
WebCore/html/HTMLAppletElement.h \
WebCore/html/HTMLAreaElement.cpp \
WebCore/html/HTMLAreaElement.h \
- WebCore/html/HTMLBRElement.cpp \
- WebCore/html/HTMLBRElement.h \
+ WebCore/html/HTMLAudioElement.cpp \
+ WebCore/html/HTMLAudioElement.h \
WebCore/html/HTMLBaseElement.cpp \
WebCore/html/HTMLBaseElement.h \
WebCore/html/HTMLBaseFontElement.cpp \
@@ -1382,14 +1467,14 @@ webcore_sources += \
WebCore/html/HTMLBlockquoteElement.h \
WebCore/html/HTMLBodyElement.cpp \
WebCore/html/HTMLBodyElement.h \
+ WebCore/html/HTMLBRElement.cpp \
+ WebCore/html/HTMLBRElement.h \
WebCore/html/HTMLButtonElement.cpp \
WebCore/html/HTMLButtonElement.h \
WebCore/html/HTMLCanvasElement.cpp \
WebCore/html/HTMLCanvasElement.h \
WebCore/html/HTMLCollection.cpp \
WebCore/html/HTMLCollection.h \
- WebCore/html/HTMLDListElement.cpp \
- WebCore/html/HTMLDListElement.h \
WebCore/html/HTMLDataGridCellElement.cpp \
WebCore/html/HTMLDataGridCellElement.h \
WebCore/html/HTMLDataGridColElement.cpp \
@@ -1404,6 +1489,8 @@ webcore_sources += \
WebCore/html/HTMLDirectoryElement.h \
WebCore/html/HTMLDivElement.cpp \
WebCore/html/HTMLDivElement.h \
+ WebCore/html/HTMLDListElement.cpp \
+ WebCore/html/HTMLDListElement.h \
WebCore/html/HTMLDocument.cpp \
WebCore/html/HTMLDocument.h \
WebCore/html/HTMLElement.cpp \
@@ -1420,20 +1507,20 @@ webcore_sources += \
WebCore/html/HTMLFormControlElement.h \
WebCore/html/HTMLFormElement.cpp \
WebCore/html/HTMLFormElement.h \
- WebCore/html/HTMLFrameElement.cpp \
- WebCore/html/HTMLFrameElement.h \
WebCore/html/HTMLFrameElementBase.cpp \
WebCore/html/HTMLFrameElementBase.h \
+ WebCore/html/HTMLFrameElement.cpp \
+ WebCore/html/HTMLFrameElement.h \
WebCore/html/HTMLFrameOwnerElement.cpp \
WebCore/html/HTMLFrameOwnerElement.h \
WebCore/html/HTMLFrameSetElement.cpp \
WebCore/html/HTMLFrameSetElement.h \
- WebCore/html/HTMLHRElement.cpp \
- WebCore/html/HTMLHRElement.h \
WebCore/html/HTMLHeadElement.cpp \
WebCore/html/HTMLHeadElement.h \
WebCore/html/HTMLHeadingElement.cpp \
WebCore/html/HTMLHeadingElement.h \
+ WebCore/html/HTMLHRElement.cpp \
+ WebCore/html/HTMLHRElement.h \
WebCore/html/HTMLHtmlElement.cpp \
WebCore/html/HTMLHtmlElement.h \
WebCore/html/HTMLIFrameElement.cpp \
@@ -1448,18 +1535,20 @@ webcore_sources += \
WebCore/html/HTMLIsIndexElement.h \
WebCore/html/HTMLKeygenElement.cpp \
WebCore/html/HTMLKeygenElement.h \
- WebCore/html/HTMLLIElement.cpp \
- WebCore/html/HTMLLIElement.h \
WebCore/html/HTMLLabelElement.cpp \
WebCore/html/HTMLLabelElement.h \
WebCore/html/HTMLLegendElement.cpp \
WebCore/html/HTMLLegendElement.h \
+ WebCore/html/HTMLLIElement.cpp \
+ WebCore/html/HTMLLIElement.h \
WebCore/html/HTMLLinkElement.cpp \
WebCore/html/HTMLLinkElement.h \
WebCore/html/HTMLMapElement.cpp \
WebCore/html/HTMLMapElement.h \
WebCore/html/HTMLMarqueeElement.cpp \
WebCore/html/HTMLMarqueeElement.h \
+ WebCore/html/HTMLMediaElement.cpp \
+ WebCore/html/HTMLMediaElement.h \
WebCore/html/HTMLMenuElement.cpp \
WebCore/html/HTMLMenuElement.h \
WebCore/html/HTMLMetaElement.cpp \
@@ -1470,10 +1559,12 @@ webcore_sources += \
WebCore/html/HTMLModElement.h \
WebCore/html/HTMLNameCollection.cpp \
WebCore/html/HTMLNameCollection.h \
- WebCore/html/HTMLOListElement.cpp \
- WebCore/html/HTMLOListElement.h \
+ WebCore/html/HTMLNoScriptElement.cpp \
+ WebCore/html/HTMLNoScriptElement.h \
WebCore/html/HTMLObjectElement.cpp \
WebCore/html/HTMLObjectElement.h \
+ WebCore/html/HTMLOListElement.cpp \
+ WebCore/html/HTMLOListElement.h \
WebCore/html/HTMLOptGroupElement.cpp \
WebCore/html/HTMLOptGroupElement.h \
WebCore/html/HTMLOptionElement.cpp \
@@ -1501,6 +1592,8 @@ webcore_sources += \
WebCore/html/HTMLScriptElement.h \
WebCore/html/HTMLSelectElement.cpp \
WebCore/html/HTMLSelectElement.h \
+ WebCore/html/HTMLSourceElement.cpp \
+ WebCore/html/HTMLSourceElement.h \
WebCore/html/HTMLStyleElement.cpp \
WebCore/html/HTMLStyleElement.h \
WebCore/html/HTMLTableCaptionElement.cpp \
@@ -1525,6 +1618,8 @@ webcore_sources += \
WebCore/html/HTMLTitleElement.h \
WebCore/html/HTMLUListElement.cpp \
WebCore/html/HTMLUListElement.h \
+ WebCore/html/HTMLVideoElement.cpp \
+ WebCore/html/HTMLVideoElement.h \
WebCore/html/HTMLViewSourceDocument.cpp \
WebCore/html/HTMLViewSourceDocument.h \
WebCore/html/ImageData.cpp \
@@ -1538,26 +1633,6 @@ webcore_sources += \
WebCore/html/MediaDocument.cpp \
WebCore/html/MediaDocument.h \
WebCore/html/MediaError.h \
- WebCore/html/PluginDocument.cpp \
- WebCore/html/PluginDocument.h \
- WebCore/html/StepRange.cpp \
- WebCore/html/StepRange.h \
- WebCore/html/TextDocument.cpp \
- WebCore/html/TextDocument.h \
- WebCore/html/TextMetrics.h \
- WebCore/html/canvas/CanvasContextAttributes.h \
- WebCore/html/canvas/CanvasGradient.cpp \
- WebCore/html/canvas/CanvasGradient.h \
- WebCore/html/canvas/CanvasPattern.cpp \
- WebCore/html/canvas/CanvasPattern.h \
- WebCore/html/canvas/CanvasPixelArray.cpp \
- WebCore/html/canvas/CanvasPixelArray.h \
- WebCore/html/canvas/CanvasRenderingContext.cpp \
- WebCore/html/canvas/CanvasRenderingContext.h \
- WebCore/html/canvas/CanvasRenderingContext2D.cpp \
- WebCore/html/canvas/CanvasRenderingContext2D.h \
- WebCore/html/canvas/CanvasStyle.cpp \
- WebCore/html/canvas/CanvasStyle.h \
WebCore/html/parser/CSSPreloadScanner.cpp \
WebCore/html/parser/CSSPreloadScanner.h \
WebCore/html/parser/HTMLConstructionSite.cpp \
@@ -1574,6 +1649,8 @@ webcore_sources += \
WebCore/html/parser/HTMLFormattingElementList.cpp \
WebCore/html/parser/HTMLFormattingElementList.h \
WebCore/html/parser/HTMLInputStream.h \
+ WebCore/html/parser/HTMLParserIdioms.cpp \
+ WebCore/html/parser/HTMLParserIdioms.h \
WebCore/html/parser/HTMLParserScheduler.cpp \
WebCore/html/parser/HTMLParserScheduler.h \
WebCore/html/parser/HTMLPreloadScanner.cpp \
@@ -1588,10 +1665,20 @@ webcore_sources += \
WebCore/html/parser/HTMLTreeBuilder.h \
WebCore/html/parser/HTMLViewSourceParser.cpp \
WebCore/html/parser/HTMLViewSourceParser.h \
+ WebCore/html/parser/NestingLevelIncrementer.h \
WebCore/html/parser/TextDocumentParser.cpp \
WebCore/html/parser/TextDocumentParser.h \
WebCore/html/parser/TextViewSourceParser.cpp \
WebCore/html/parser/TextViewSourceParser.h \
+ WebCore/html/PluginDocument.cpp \
+ WebCore/html/PluginDocument.h \
+ WebCore/html/StepRange.cpp \
+ WebCore/html/StepRange.h \
+ WebCore/html/TextDocument.cpp \
+ WebCore/html/TextDocument.h \
+ WebCore/html/TextMetrics.h \
+ WebCore/html/TimeRanges.cpp \
+ WebCore/html/TimeRanges.h \
WebCore/html/ValidityState.cpp \
WebCore/html/ValidityState.h \
WebCore/html/VoidCallback.h \
@@ -1600,9 +1687,9 @@ webcore_sources += \
WebCore/icu/unicode/putil.h \
WebCore/icu/unicode/ubrk.h \
WebCore/icu/unicode/uchar.h \
- WebCore/icu/unicode/ucnv.h \
WebCore/icu/unicode/ucnv_cb.h \
WebCore/icu/unicode/ucnv_err.h \
+ WebCore/icu/unicode/ucnv.h \
WebCore/icu/unicode/ucol.h \
WebCore/icu/unicode/uconfig.h \
WebCore/icu/unicode/uenum.h \
@@ -1616,9 +1703,9 @@ webcore_sources += \
WebCore/icu/unicode/uset.h \
WebCore/icu/unicode/ushape.h \
WebCore/icu/unicode/ustring.h \
- WebCore/icu/unicode/utf.h \
WebCore/icu/unicode/utf16.h \
WebCore/icu/unicode/utf8.h \
+ WebCore/icu/unicode/utf.h \
WebCore/icu/unicode/utf_old.h \
WebCore/icu/unicode/utypes.h \
WebCore/icu/unicode/uversion.h \
@@ -1632,6 +1719,9 @@ webcore_sources += \
WebCore/inspector/InspectorApplicationCacheAgent.h \
WebCore/inspector/InspectorBackend.cpp \
WebCore/inspector/InspectorBackend.h \
+ WebCore/inspector/InspectorClient.h \
+ WebCore/inspector/InspectorController.cpp \
+ WebCore/inspector/InspectorController.h \
WebCore/inspector/InspectorCSSStore.cpp \
WebCore/inspector/InspectorCSSStore.h \
WebCore/inspector/InspectorDatabaseResource.cpp \
@@ -1642,9 +1732,6 @@ webcore_sources += \
WebCore/inspector/InspectorDOMAgent.h \
WebCore/inspector/InspectorDOMStorageResource.cpp \
WebCore/inspector/InspectorDOMStorageResource.h \
- WebCore/inspector/InspectorClient.h \
- WebCore/inspector/InspectorController.cpp \
- WebCore/inspector/InspectorController.h \
WebCore/inspector/InspectorFrontendClient.h \
WebCore/inspector/InspectorFrontendClientLocal.cpp \
WebCore/inspector/InspectorFrontendClientLocal.h \
@@ -1667,9 +1754,28 @@ webcore_sources += \
WebCore/inspector/ScriptGCEventListener.h \
WebCore/inspector/TimelineRecordFactory.cpp \
WebCore/inspector/TimelineRecordFactory.h \
+ WebCore/loader/appcache/ApplicationCache.cpp \
+ WebCore/loader/appcache/ApplicationCacheGroup.cpp \
+ WebCore/loader/appcache/ApplicationCacheGroup.h \
+ WebCore/loader/appcache/ApplicationCache.h \
+ WebCore/loader/appcache/ApplicationCacheHost.cpp \
+ WebCore/loader/appcache/ApplicationCacheHost.h \
+ WebCore/loader/appcache/ApplicationCacheResource.cpp \
+ WebCore/loader/appcache/ApplicationCacheResource.h \
+ WebCore/loader/appcache/ApplicationCacheStorage.cpp \
+ WebCore/loader/appcache/ApplicationCacheStorage.h \
+ WebCore/loader/appcache/DOMApplicationCache.cpp \
+ WebCore/loader/appcache/DOMApplicationCache.h \
+ WebCore/loader/appcache/ManifestParser.cpp \
+ WebCore/loader/appcache/ManifestParser.h \
+ WebCore/loader/archive/ArchiveFactory.cpp \
+ WebCore/loader/archive/ArchiveFactory.h \
+ WebCore/loader/archive/Archive.h \
+ WebCore/loader/archive/ArchiveResourceCollection.cpp \
+ WebCore/loader/archive/ArchiveResourceCollection.h \
+ WebCore/loader/archive/ArchiveResource.cpp \
+ WebCore/loader/archive/ArchiveResource.h \
WebCore/loader/Cache.cpp \
- WebCore/loader/Cache.h \
- WebCore/loader/CachePolicy.h \
WebCore/loader/CachedCSSStyleSheet.cpp \
WebCore/loader/CachedCSSStyleSheet.h \
WebCore/loader/CachedFont.cpp \
@@ -1677,48 +1783,63 @@ webcore_sources += \
WebCore/loader/CachedImage.cpp \
WebCore/loader/CachedImage.h \
WebCore/loader/CachedMetadata.h \
- WebCore/loader/CachedResource.cpp \
- WebCore/loader/CachedResource.h \
WebCore/loader/CachedResourceClient.h \
WebCore/loader/CachedResourceClientWalker.cpp \
WebCore/loader/CachedResourceClientWalker.h \
+ WebCore/loader/CachedResource.cpp \
+ WebCore/loader/CachedResource.h \
WebCore/loader/CachedResourceHandle.cpp \
WebCore/loader/CachedResourceHandle.h \
+ WebCore/loader/CachedResourceLoader.cpp \
+ WebCore/loader/CachedResourceLoader.h \
WebCore/loader/CachedScript.cpp \
WebCore/loader/CachedScript.h \
WebCore/loader/CachedXSLStyleSheet.cpp \
WebCore/loader/CachedXSLStyleSheet.h \
+ WebCore/loader/Cache.h \
+ WebCore/loader/CachePolicy.h \
WebCore/loader/CrossOriginAccessControl.cpp \
WebCore/loader/CrossOriginAccessControl.h \
WebCore/loader/CrossOriginPreflightResultCache.cpp \
WebCore/loader/CrossOriginPreflightResultCache.h \
- WebCore/loader/CachedResourceLoader.cpp \
- WebCore/loader/CachedResourceLoader.h \
- WebCore/loader/DocumentLoadTiming.h \
WebCore/loader/DocumentLoader.cpp \
WebCore/loader/DocumentLoader.h \
+ WebCore/loader/DocumentLoadTiming.h \
WebCore/loader/DocumentThreadableLoader.cpp \
WebCore/loader/DocumentThreadableLoader.h \
WebCore/loader/DocumentWriter.cpp \
WebCore/loader/DocumentWriter.h \
WebCore/loader/EmptyClients.h \
- WebCore/loader/FTPDirectoryParser.cpp \
- WebCore/loader/FTPDirectoryParser.h \
WebCore/loader/FormState.cpp \
WebCore/loader/FormState.h \
WebCore/loader/FormSubmission.cpp \
WebCore/loader/FormSubmission.h \
+ WebCore/loader/FrameLoaderClient.h \
WebCore/loader/FrameLoader.cpp \
WebCore/loader/FrameLoader.h \
- WebCore/loader/FrameLoaderClient.h \
WebCore/loader/FrameLoaderStateMachine.cpp \
WebCore/loader/FrameLoaderStateMachine.h \
WebCore/loader/FrameLoaderTypes.h \
WebCore/loader/FrameNetworkingContext.h \
+ WebCore/loader/FTPDirectoryParser.cpp \
+ WebCore/loader/FTPDirectoryParser.h \
WebCore/loader/HistoryController.cpp \
WebCore/loader/HistoryController.h \
+ WebCore/loader/icon/IconDatabaseClient.h \
+ WebCore/loader/icon/IconDatabase.cpp \
+ WebCore/loader/icon/IconDatabase.h \
+ WebCore/loader/icon/IconDatabaseNone.cpp \
+ WebCore/loader/icon/IconFetcher.h \
+ WebCore/loader/icon/IconLoader.cpp \
+ WebCore/loader/icon/IconLoader.h \
+ WebCore/loader/icon/IconRecord.cpp \
+ WebCore/loader/icon/IconRecord.h \
+ WebCore/loader/icon/PageURLRecord.cpp \
+ WebCore/loader/icon/PageURLRecord.h \
WebCore/loader/ImageLoader.cpp \
WebCore/loader/ImageLoader.h \
+ WebCore/loader/loader.cpp \
+ WebCore/loader/loader.h \
WebCore/loader/MainResourceLoader.cpp \
WebCore/loader/MainResourceLoader.h \
WebCore/loader/NavigationAction.cpp \
@@ -1747,36 +1868,69 @@ webcore_sources += \
WebCore/loader/SinkDocument.h \
WebCore/loader/SubframeLoader.cpp \
WebCore/loader/SubframeLoader.h \
+ WebCore/loader/SubresourceLoaderClient.h \
WebCore/loader/SubresourceLoader.cpp \
WebCore/loader/SubresourceLoader.h \
- WebCore/loader/SubresourceLoaderClient.h \
WebCore/loader/SubstituteData.h \
WebCore/loader/SubstituteResource.h \
WebCore/loader/TextResourceDecoder.cpp \
WebCore/loader/TextResourceDecoder.h \
- WebCore/loader/ThreadableLoader.cpp \
- WebCore/loader/ThreadableLoader.h \
WebCore/loader/ThreadableLoaderClient.h \
WebCore/loader/ThreadableLoaderClientWrapper.h \
+ WebCore/loader/ThreadableLoader.cpp \
+ WebCore/loader/ThreadableLoader.h \
WebCore/loader/WorkerThreadableLoader.cpp \
WebCore/loader/WorkerThreadableLoader.h \
- WebCore/loader/archive/Archive.h \
- WebCore/loader/archive/ArchiveFactory.cpp \
- WebCore/loader/archive/ArchiveFactory.h \
- WebCore/loader/archive/ArchiveResource.cpp \
- WebCore/loader/archive/ArchiveResource.h \
- WebCore/loader/archive/ArchiveResourceCollection.cpp \
- WebCore/loader/archive/ArchiveResourceCollection.h \
- WebCore/loader/icon/IconFetcher.h \
- WebCore/loader/icon/IconLoader.cpp \
- WebCore/loader/icon/IconLoader.h \
- WebCore/loader/loader.cpp \
- WebCore/loader/loader.h \
+ WebCore/mathml/MathMLElement.cpp \
+ WebCore/mathml/MathMLElement.h \
+ WebCore/mathml/MathMLInlineContainerElement.cpp \
+ WebCore/mathml/MathMLInlineContainerElement.h \
+ WebCore/mathml/MathMLMathElement.cpp \
+ WebCore/mathml/MathMLMathElement.h \
+ WebCore/mathml/MathMLTextElement.cpp \
+ WebCore/mathml/MathMLTextElement.h \
+ WebCore/mathml/RenderMathMLBlock.cpp \
+ WebCore/mathml/RenderMathMLBlock.h \
+ WebCore/mathml/RenderMathMLFenced.cpp \
+ WebCore/mathml/RenderMathMLFenced.h \
+ WebCore/mathml/RenderMathMLFraction.cpp \
+ WebCore/mathml/RenderMathMLFraction.h \
+ WebCore/mathml/RenderMathMLMath.cpp \
+ WebCore/mathml/RenderMathMLMath.h \
+ WebCore/mathml/RenderMathMLOperator.cpp \
+ WebCore/mathml/RenderMathMLOperator.h \
+ WebCore/mathml/RenderMathMLRoot.cpp \
+ WebCore/mathml/RenderMathMLRoot.h \
+ WebCore/mathml/RenderMathMLRow.cpp \
+ WebCore/mathml/RenderMathMLRow.h \
+ WebCore/mathml/RenderMathMLSquareRoot.cpp \
+ WebCore/mathml/RenderMathMLSquareRoot.h \
+ WebCore/mathml/RenderMathMLSubSup.cpp \
+ WebCore/mathml/RenderMathMLSubSup.h \
+ WebCore/mathml/RenderMathMLUnderOver.cpp \
+ WebCore/mathml/RenderMathMLUnderOver.h \
+ WebCore/notifications/NotificationCenter.cpp \
+ WebCore/notifications/NotificationCenter.h \
+ WebCore/notifications/NotificationContents.h \
+ WebCore/notifications/Notification.cpp \
+ WebCore/notifications/Notification.h \
+ WebCore/notifications/NotificationPresenter.h \
+ WebCore/page/animation/AnimationBase.cpp \
+ WebCore/page/animation/AnimationBase.h \
+ WebCore/page/animation/AnimationController.cpp \
+ WebCore/page/animation/AnimationController.h \
+ WebCore/page/animation/AnimationControllerPrivate.h \
+ WebCore/page/animation/CompositeAnimation.cpp \
+ WebCore/page/animation/CompositeAnimation.h \
+ WebCore/page/animation/ImplicitAnimation.cpp \
+ WebCore/page/animation/ImplicitAnimation.h \
+ WebCore/page/animation/KeyframeAnimation.cpp \
+ WebCore/page/animation/KeyframeAnimation.h \
WebCore/page/BarInfo.cpp \
WebCore/page/BarInfo.h \
+ WebCore/page/ChromeClient.h \
WebCore/page/Chrome.cpp \
WebCore/page/Chrome.h \
- WebCore/page/ChromeClient.h \
WebCore/page/Console.cpp \
WebCore/page/Console.h \
WebCore/page/ContextMenuClient.h \
@@ -1809,15 +1963,15 @@ webcore_sources += \
WebCore/page/FrameTree.h \
WebCore/page/FrameView.cpp \
WebCore/page/FrameView.h \
- WebCore/page/Geolocation.cpp \
- WebCore/page/Geolocation.h \
+ WebCore/page/GeolocationControllerClient.h \
WebCore/page/GeolocationController.cpp \
WebCore/page/GeolocationController.h \
- WebCore/page/GeolocationControllerClient.h \
+ WebCore/page/Geolocation.cpp \
WebCore/page/GeolocationError.h \
- WebCore/page/GeolocationPosition.h \
+ WebCore/page/Geolocation.h \
WebCore/page/GeolocationPositionCache.cpp \
WebCore/page/GeolocationPositionCache.h \
+ WebCore/page/GeolocationPosition.h \
WebCore/page/Geoposition.h \
WebCore/page/GroupSettings.cpp \
WebCore/page/GroupSettings.h \
@@ -1833,26 +1987,26 @@ webcore_sources += \
WebCore/page/MouseEventWithHitTestResults.h \
WebCore/page/Navigation.cpp \
WebCore/page/Navigation.h \
- WebCore/page/Navigator.cpp \
- WebCore/page/Navigator.h \
WebCore/page/NavigatorBase.cpp \
WebCore/page/NavigatorBase.h \
+ WebCore/page/Navigator.cpp \
+ WebCore/page/Navigator.h \
WebCore/page/OriginAccessEntry.cpp \
WebCore/page/OriginAccessEntry.h \
WebCore/page/Page.cpp \
- WebCore/page/Page.h \
WebCore/page/PageGroup.cpp \
WebCore/page/PageGroup.h \
WebCore/page/PageGroupLoadDeferrer.cpp \
WebCore/page/PageGroupLoadDeferrer.h \
+ WebCore/page/Page.h \
WebCore/page/Performance.cpp \
WebCore/page/Performance.h \
+ WebCore/page/PluginHalterClient.h \
WebCore/page/PluginHalter.cpp \
WebCore/page/PluginHalter.h \
- WebCore/page/PluginHalterClient.h \
WebCore/page/PositionCallback.h \
- WebCore/page/PositionError.h \
WebCore/page/PositionErrorCallback.h \
+ WebCore/page/PositionError.h \
WebCore/page/PositionOptions.h \
WebCore/page/PrintContext.cpp \
WebCore/page/PrintContext.h \
@@ -1865,13 +2019,17 @@ webcore_sources += \
WebCore/page/Settings.h \
WebCore/page/SpatialNavigation.cpp \
WebCore/page/SpatialNavigation.h \
+ WebCore/page/SpeechInputClient.h \
+ WebCore/page/SpeechInput.cpp \
+ WebCore/page/SpeechInput.h \
+ WebCore/page/SpeechInputListener.h \
WebCore/page/SuspendableTimer.cpp \
WebCore/page/SuspendableTimer.h \
WebCore/page/Timing.cpp \
WebCore/page/Timing.h \
+ WebCore/page/UserContentTypes.h \
WebCore/page/UserContentURLPattern.cpp \
WebCore/page/UserContentURLPattern.h \
- WebCore/page/UserContentTypes.h \
WebCore/page/UserScript.h \
WebCore/page/UserScriptTypes.h \
WebCore/page/UserStyleSheet.h \
@@ -1879,20 +2037,15 @@ webcore_sources += \
WebCore/page/WebKitPoint.h \
WebCore/page/WindowFeatures.cpp \
WebCore/page/WindowFeatures.h \
+ WebCore/page/WorkerNavigator.cpp \
+ WebCore/page/WorkerNavigator.h \
WebCore/page/XSSAuditor.cpp \
WebCore/page/XSSAuditor.h \
- WebCore/page/ZoomMode.h \
- WebCore/page/animation/AnimationBase.cpp \
- WebCore/page/animation/AnimationBase.h \
- WebCore/page/animation/AnimationController.cpp \
- WebCore/page/animation/AnimationController.h \
- WebCore/page/animation/AnimationControllerPrivate.h \
- WebCore/page/animation/CompositeAnimation.cpp \
- WebCore/page/animation/CompositeAnimation.h \
- WebCore/page/animation/ImplicitAnimation.cpp \
- WebCore/page/animation/ImplicitAnimation.h \
- WebCore/page/animation/KeyframeAnimation.cpp \
- WebCore/page/animation/KeyframeAnimation.h \
+ WebCore/platform/animation/Animation.cpp \
+ WebCore/platform/animation/Animation.h \
+ WebCore/platform/animation/AnimationList.cpp \
+ WebCore/platform/animation/AnimationList.h \
+ WebCore/platform/animation/TimingFunction.h \
WebCore/platform/Arena.cpp \
WebCore/platform/Arena.h \
WebCore/platform/AsyncFileStream.h \
@@ -1918,111 +2071,52 @@ webcore_sources += \
WebCore/platform/EventLoop.h \
WebCore/platform/FileChooser.cpp \
WebCore/platform/FileChooser.h \
+ WebCore/platform/FileStreamClient.h \
WebCore/platform/FileStream.cpp \
WebCore/platform/FileStream.h \
- WebCore/platform/FileStreamClient.h \
WebCore/platform/FileSystem.cpp \
WebCore/platform/FileSystem.h \
WebCore/platform/FloatConversion.h \
WebCore/platform/GeolocationService.cpp \
WebCore/platform/GeolocationService.h \
- WebCore/platform/HostWindow.h \
- WebCore/platform/KillRing.h \
- WebCore/platform/KillRingNone.cpp \
- WebCore/platform/KURL.cpp \
- WebCore/platform/KURL.h \
- WebCore/platform/KURLHash.h \
- WebCore/platform/Language.h \
- WebCore/platform/Length.cpp \
- WebCore/platform/Length.h \
- WebCore/platform/LengthBox.h \
- WebCore/platform/LengthSize.h \
- WebCore/platform/LinkHash.cpp \
- WebCore/platform/LinkHash.h \
- WebCore/platform/LocalizedStrings.h \
- WebCore/platform/Logging.cpp \
- WebCore/platform/Logging.h \
- WebCore/platform/MIMETypeRegistry.cpp \
- WebCore/platform/MIMETypeRegistry.h \
- WebCore/platform/mock/DeviceOrientationClientMock.cpp \
- WebCore/platform/mock/DeviceOrientationClientMock.h \
- WebCore/platform/mock/GeolocationServiceMock.cpp \
- WebCore/platform/mock/GeolocationServiceMock.h \
- WebCore/platform/mock/SpeechInputClientMock.cpp \
- WebCore/platform/mock/SpeechInputClientMock.h \
- WebCore/platform/NotImplemented.h \
- WebCore/platform/Pasteboard.h \
- WebCore/platform/PlatformKeyboardEvent.h \
- WebCore/platform/PlatformMenuDescription.h \
- WebCore/platform/PlatformMouseEvent.h \
- WebCore/platform/PlatformScreen.h \
- WebCore/platform/PlatformWheelEvent.h \
- WebCore/platform/PopupMenu.h \
- WebCore/platform/PopupMenuClient.h \
- WebCore/platform/PopupMenuStyle.h \
- WebCore/platform/PurgeableBuffer.h \
- WebCore/platform/SSLKeyGenerator.h \
- WebCore/platform/ScrollAnimator.cpp \
- WebCore/platform/ScrollAnimator.h \
- WebCore/platform/ScrollTypes.h \
- WebCore/platform/ScrollView.cpp \
- WebCore/platform/ScrollView.h \
- WebCore/platform/SchemeRegistry.cpp \
- WebCore/platform/SchemeRegistry.h \
- WebCore/platform/Scrollbar.cpp \
- WebCore/platform/Scrollbar.h \
- WebCore/platform/ScrollbarClient.cpp \
- WebCore/platform/ScrollbarClient.h \
- WebCore/platform/ScrollbarTheme.h \
- WebCore/platform/ScrollbarThemeComposite.cpp \
- WebCore/platform/ScrollbarThemeComposite.h \
- WebCore/platform/SearchPopupMenu.h \
- WebCore/platform/SecureTextInput.h \
- WebCore/platform/SharedBuffer.cpp \
- WebCore/platform/SharedBuffer.h \
- WebCore/platform/SharedTimer.h \
- WebCore/platform/Sound.h \
- WebCore/platform/SuddenTermination.h \
- WebCore/platform/SystemTime.h \
- WebCore/platform/ThemeTypes.h \
- WebCore/platform/ThreadCheck.h \
- WebCore/platform/ThreadGlobalData.cpp \
- WebCore/platform/ThreadGlobalData.h \
- WebCore/platform/ThreadTimers.cpp \
- WebCore/platform/ThreadTimers.h \
- WebCore/platform/Timer.cpp \
- WebCore/platform/Timer.h \
- WebCore/platform/TreeShared.h \
- WebCore/platform/UUID.cpp \
- WebCore/platform/UUID.h \
- WebCore/platform/Widget.cpp \
- WebCore/platform/Widget.h \
- WebCore/platform/WindowsKeyboardCodes.h \
- WebCore/platform/animation/Animation.cpp \
- WebCore/platform/animation/Animation.h \
- WebCore/platform/animation/AnimationList.cpp \
- WebCore/platform/animation/AnimationList.h \
- WebCore/platform/animation/TimingFunction.h \
WebCore/platform/graphics/BitmapImage.cpp \
WebCore/platform/graphics/BitmapImage.h \
WebCore/platform/graphics/Color.cpp \
WebCore/platform/graphics/Color.h \
WebCore/platform/graphics/ColorSpace.h \
WebCore/platform/graphics/DashArray.h \
- WebCore/platform/graphics/FloatPoint.cpp \
- WebCore/platform/graphics/FloatPoint.h \
+ WebCore/platform/graphics/filters/FEBlend.cpp \
+ WebCore/platform/graphics/filters/FEBlend.h \
+ WebCore/platform/graphics/filters/FEColorMatrix.cpp \
+ WebCore/platform/graphics/filters/FEColorMatrix.h \
+ WebCore/platform/graphics/filters/FEComponentTransfer.cpp \
+ WebCore/platform/graphics/filters/FEComponentTransfer.h \
+ WebCore/platform/graphics/filters/FEComposite.cpp \
+ WebCore/platform/graphics/filters/FEComposite.h \
+ WebCore/platform/graphics/filters/FEGaussianBlur.cpp \
+ WebCore/platform/graphics/filters/FEGaussianBlur.h \
+ WebCore/platform/graphics/filters/FilterEffect.cpp \
+ WebCore/platform/graphics/filters/FilterEffect.h \
+ WebCore/platform/graphics/filters/Filter.h \
+ WebCore/platform/graphics/filters/ImageBufferFilter.cpp \
+ WebCore/platform/graphics/filters/ImageBufferFilter.h \
+ WebCore/platform/graphics/filters/SourceAlpha.cpp \
+ WebCore/platform/graphics/filters/SourceAlpha.h \
+ WebCore/platform/graphics/filters/SourceGraphic.cpp \
+ WebCore/platform/graphics/filters/SourceGraphic.h \
WebCore/platform/graphics/FloatPoint3D.cpp \
WebCore/platform/graphics/FloatPoint3D.h \
+ WebCore/platform/graphics/FloatPoint.cpp \
+ WebCore/platform/graphics/FloatPoint.h \
WebCore/platform/graphics/FloatQuad.cpp \
WebCore/platform/graphics/FloatQuad.h \
WebCore/platform/graphics/FloatRect.cpp \
WebCore/platform/graphics/FloatRect.h \
WebCore/platform/graphics/FloatSize.cpp \
WebCore/platform/graphics/FloatSize.h \
- WebCore/platform/graphics/Font.cpp \
- WebCore/platform/graphics/Font.h \
WebCore/platform/graphics/FontCache.cpp \
WebCore/platform/graphics/FontCache.h \
+ WebCore/platform/graphics/Font.cpp \
WebCore/platform/graphics/FontData.cpp \
WebCore/platform/graphics/FontData.h \
WebCore/platform/graphics/FontDescription.cpp \
@@ -2032,6 +2126,7 @@ webcore_sources += \
WebCore/platform/graphics/FontFamily.cpp \
WebCore/platform/graphics/FontFamily.h \
WebCore/platform/graphics/FontFastPath.cpp \
+ WebCore/platform/graphics/Font.h \
WebCore/platform/graphics/FontRenderingMode.h \
WebCore/platform/graphics/FontSelector.h \
WebCore/platform/graphics/FontSmoothingMode.h \
@@ -2052,10 +2147,10 @@ webcore_sources += \
WebCore/platform/graphics/GraphicsTypes.cpp \
WebCore/platform/graphics/GraphicsTypes.h \
WebCore/platform/graphics/Icon.h \
- WebCore/platform/graphics/Image.cpp \
- WebCore/platform/graphics/Image.h \
WebCore/platform/graphics/ImageBuffer.cpp \
WebCore/platform/graphics/ImageBuffer.h \
+ WebCore/platform/graphics/Image.cpp \
+ WebCore/platform/graphics/Image.h \
WebCore/platform/graphics/ImageObserver.h \
WebCore/platform/graphics/ImageSource.cpp \
WebCore/platform/graphics/ImageSource.h \
@@ -2065,7 +2160,9 @@ webcore_sources += \
WebCore/platform/graphics/IntRect.h \
WebCore/platform/graphics/IntSize.h \
WebCore/platform/graphics/IntSizeHash.h \
+ WebCore/platform/graphics/MediaPlayer.cpp \
WebCore/platform/graphics/MediaPlayer.h \
+ WebCore/platform/graphics/MediaPlayerPrivate.h \
WebCore/platform/graphics/Path.cpp \
WebCore/platform/graphics/Path.h \
WebCore/platform/graphics/PathTraversalState.cpp \
@@ -2083,17 +2180,13 @@ webcore_sources += \
WebCore/platform/graphics/StrokeStyleApplier.h \
WebCore/platform/graphics/TextRenderingMode.h \
WebCore/platform/graphics/TextRun.h \
- WebCore/platform/graphics/TypesettingFeatures.h \
- WebCore/platform/graphics/UnitBezier.h \
- WebCore/platform/graphics/WidthIterator.cpp \
- WebCore/platform/graphics/WidthIterator.h \
WebCore/platform/graphics/transforms/AffineTransform.cpp \
WebCore/platform/graphics/transforms/AffineTransform.h \
WebCore/platform/graphics/transforms/IdentityTransformOperation.h \
- WebCore/platform/graphics/transforms/MatrixTransformOperation.cpp \
- WebCore/platform/graphics/transforms/MatrixTransformOperation.h \
WebCore/platform/graphics/transforms/Matrix3DTransformOperation.cpp \
WebCore/platform/graphics/transforms/Matrix3DTransformOperation.h \
+ WebCore/platform/graphics/transforms/MatrixTransformOperation.cpp \
+ WebCore/platform/graphics/transforms/MatrixTransformOperation.h \
WebCore/platform/graphics/transforms/PerspectiveTransformOperation.cpp \
WebCore/platform/graphics/transforms/PerspectiveTransformOperation.h \
WebCore/platform/graphics/transforms/RotateTransformOperation.cpp \
@@ -2102,13 +2195,41 @@ webcore_sources += \
WebCore/platform/graphics/transforms/ScaleTransformOperation.h \
WebCore/platform/graphics/transforms/SkewTransformOperation.cpp \
WebCore/platform/graphics/transforms/SkewTransformOperation.h \
+ WebCore/platform/graphics/transforms/TransformationMatrix.cpp \
+ WebCore/platform/graphics/transforms/TransformationMatrix.h \
WebCore/platform/graphics/transforms/TransformOperation.h \
WebCore/platform/graphics/transforms/TransformOperations.cpp \
WebCore/platform/graphics/transforms/TransformOperations.h \
- WebCore/platform/graphics/transforms/TransformationMatrix.cpp \
- WebCore/platform/graphics/transforms/TransformationMatrix.h \
WebCore/platform/graphics/transforms/TranslateTransformOperation.cpp \
WebCore/platform/graphics/transforms/TranslateTransformOperation.h \
+ WebCore/platform/graphics/TypesettingFeatures.h \
+ WebCore/platform/graphics/UnitBezier.h \
+ WebCore/platform/graphics/WidthIterator.cpp \
+ WebCore/platform/graphics/WidthIterator.h \
+ WebCore/platform/HostWindow.h \
+ WebCore/platform/KillRing.h \
+ WebCore/platform/KillRingNone.cpp \
+ WebCore/platform/KURL.cpp \
+ WebCore/platform/KURL.h \
+ WebCore/platform/KURLHash.h \
+ WebCore/platform/Language.h \
+ WebCore/platform/LengthBox.h \
+ WebCore/platform/Length.cpp \
+ WebCore/platform/Length.h \
+ WebCore/platform/LengthSize.h \
+ WebCore/platform/LinkHash.cpp \
+ WebCore/platform/LinkHash.h \
+ WebCore/platform/LocalizedStrings.h \
+ WebCore/platform/Logging.cpp \
+ WebCore/platform/Logging.h \
+ WebCore/platform/MIMETypeRegistry.cpp \
+ WebCore/platform/MIMETypeRegistry.h \
+ WebCore/platform/mock/DeviceOrientationClientMock.cpp \
+ WebCore/platform/mock/DeviceOrientationClientMock.h \
+ WebCore/platform/mock/GeolocationServiceMock.cpp \
+ WebCore/platform/mock/GeolocationServiceMock.h \
+ WebCore/platform/mock/SpeechInputClientMock.cpp \
+ WebCore/platform/mock/SpeechInputClientMock.h \
WebCore/platform/network/AuthenticationChallengeBase.cpp \
WebCore/platform/network/AuthenticationChallengeBase.h \
WebCore/platform/network/AuthenticationClient.h \
@@ -2123,30 +2244,80 @@ webcore_sources += \
WebCore/platform/network/Credential.cpp \
WebCore/platform/network/Credential.h \
WebCore/platform/network/DNS.h \
- WebCore/platform/network/FormData.cpp \
- WebCore/platform/network/FormData.h \
WebCore/platform/network/FormDataBuilder.cpp \
WebCore/platform/network/FormDataBuilder.h \
- WebCore/platform/network/HTTPHeaderMap.h \
+ WebCore/platform/network/FormData.cpp \
+ WebCore/platform/network/FormData.h \
WebCore/platform/network/HTTPHeaderMap.cpp \
+ WebCore/platform/network/HTTPHeaderMap.h \
WebCore/platform/network/HTTPParsers.cpp \
WebCore/platform/network/HTTPParsers.h \
+ WebCore/platform/network/NetworkingContext.h \
WebCore/platform/network/NetworkStateNotifier.cpp \
WebCore/platform/network/NetworkStateNotifier.h \
- WebCore/platform/network/NetworkingContext.h \
WebCore/platform/network/ProtectionSpace.cpp \
WebCore/platform/network/ProtectionSpace.h \
WebCore/platform/network/ResourceErrorBase.cpp \
WebCore/platform/network/ResourceErrorBase.h \
+ WebCore/platform/network/ResourceHandleClient.h \
WebCore/platform/network/ResourceHandle.cpp \
WebCore/platform/network/ResourceHandle.h \
- WebCore/platform/network/ResourceHandleClient.h \
WebCore/platform/network/ResourceHandleInternal.h \
WebCore/platform/network/ResourceLoadTiming.h \
WebCore/platform/network/ResourceRequestBase.cpp \
WebCore/platform/network/ResourceRequestBase.h \
WebCore/platform/network/ResourceResponseBase.cpp \
WebCore/platform/network/ResourceResponseBase.h \
+ WebCore/platform/network/SocketStreamErrorBase.cpp \
+ WebCore/platform/network/SocketStreamErrorBase.h \
+ WebCore/platform/network/SocketStreamHandleBase.cpp \
+ WebCore/platform/network/SocketStreamHandleBase.h \
+ WebCore/platform/network/SocketStreamHandleClient.h \
+ WebCore/platform/NotImplemented.h \
+ WebCore/platform/Pasteboard.h \
+ WebCore/platform/PlatformKeyboardEvent.h \
+ WebCore/platform/PlatformMenuDescription.h \
+ WebCore/platform/PlatformMouseEvent.h \
+ WebCore/platform/PlatformScreen.h \
+ WebCore/platform/PlatformWheelEvent.h \
+ WebCore/platform/PopupMenuClient.h \
+ WebCore/platform/PopupMenu.h \
+ WebCore/platform/PopupMenuStyle.h \
+ WebCore/platform/PurgeableBuffer.h \
+ WebCore/platform/SchemeRegistry.cpp \
+ WebCore/platform/SchemeRegistry.h \
+ WebCore/platform/ScrollAnimator.cpp \
+ WebCore/platform/ScrollAnimator.h \
+ WebCore/platform/ScrollbarClient.cpp \
+ WebCore/platform/ScrollbarClient.h \
+ WebCore/platform/Scrollbar.cpp \
+ WebCore/platform/Scrollbar.h \
+ WebCore/platform/ScrollbarThemeComposite.cpp \
+ WebCore/platform/ScrollbarThemeComposite.h \
+ WebCore/platform/ScrollbarTheme.h \
+ WebCore/platform/ScrollTypes.h \
+ WebCore/platform/ScrollView.cpp \
+ WebCore/platform/ScrollView.h \
+ WebCore/platform/SearchPopupMenu.h \
+ WebCore/platform/SecureTextInput.h \
+ WebCore/platform/SharedBuffer.cpp \
+ WebCore/platform/SharedBuffer.h \
+ WebCore/platform/SharedTimer.h \
+ WebCore/platform/Sound.h \
+ WebCore/platform/sql/SQLiteAuthorizer.cpp \
+ WebCore/platform/sql/SQLiteDatabase.cpp \
+ WebCore/platform/sql/SQLiteDatabase.h \
+ WebCore/platform/sql/SQLiteFileSystem.cpp \
+ WebCore/platform/sql/SQLiteFileSystem.h \
+ WebCore/platform/sql/SQLiteStatement.cpp \
+ WebCore/platform/sql/SQLiteStatement.h \
+ WebCore/platform/sql/SQLiteTransaction.cpp \
+ WebCore/platform/sql/SQLiteTransaction.h \
+ WebCore/platform/sql/SQLValue.cpp \
+ WebCore/platform/sql/SQLValue.h \
+ WebCore/platform/SSLKeyGenerator.h \
+ WebCore/platform/SuddenTermination.h \
+ WebCore/platform/SystemTime.h \
WebCore/platform/text/Base64.cpp \
WebCore/platform/text/Base64.h \
WebCore/platform/text/BidiContext.cpp \
@@ -2163,47 +2334,63 @@ webcore_sources += \
WebCore/platform/text/RegularExpression.h \
WebCore/platform/text/SegmentedString.cpp \
WebCore/platform/text/SegmentedString.h \
- WebCore/platform/text/String.cpp \
WebCore/platform/text/StringBuffer.h \
WebCore/platform/text/StringBuilder.cpp \
WebCore/platform/text/StringBuilder.h \
+ WebCore/platform/text/String.cpp \
WebCore/platform/text/SuffixTree.h \
- WebCore/platform/text/TextBoundaries.h \
WebCore/platform/text/TextBoundaries.cpp \
+ WebCore/platform/text/TextBoundaries.h \
WebCore/platform/text/TextBreakIterator.h \
WebCore/platform/text/TextCodec.cpp \
WebCore/platform/text/TextCodec.h \
WebCore/platform/text/TextCodecLatin1.cpp \
WebCore/platform/text/TextCodecLatin1.h \
- WebCore/platform/text/TextCodecUTF16.cpp \
- WebCore/platform/text/TextCodecUTF16.h \
WebCore/platform/text/TextCodecUserDefined.cpp \
WebCore/platform/text/TextCodecUserDefined.h \
+ WebCore/platform/text/TextCodecUTF16.cpp \
+ WebCore/platform/text/TextCodecUTF16.h \
WebCore/platform/text/TextDirection.h \
WebCore/platform/text/TextEncoding.cpp \
- WebCore/platform/text/TextEncoding.h \
WebCore/platform/text/TextEncodingDetector.h \
WebCore/platform/text/TextEncodingDetectorNone.cpp \
+ WebCore/platform/text/TextEncoding.h \
WebCore/platform/text/TextEncodingRegistry.cpp \
WebCore/platform/text/TextEncodingRegistry.h \
WebCore/platform/text/TextStream.cpp \
WebCore/platform/text/TextStream.h \
- WebCore/platform/text/UnicodeRange.cpp \
- WebCore/platform/text/UnicodeRange.h \
WebCore/platform/text/transcoder/FontTranscoder.cpp \
WebCore/platform/text/transcoder/FontTranscoder.h \
- WebCore/plugins/DOMMimeType.cpp \
- WebCore/plugins/DOMMimeType.h \
+ WebCore/platform/text/UnicodeRange.cpp \
+ WebCore/platform/text/UnicodeRange.h \
+ WebCore/platform/ThemeTypes.h \
+ WebCore/platform/ThreadCheck.h \
+ WebCore/platform/ThreadGlobalData.cpp \
+ WebCore/platform/ThreadGlobalData.h \
+ WebCore/platform/ThreadTimers.cpp \
+ WebCore/platform/ThreadTimers.h \
+ WebCore/platform/Timer.cpp \
+ WebCore/platform/Timer.h \
+ WebCore/platform/TreeShared.h \
+ WebCore/platform/UUID.cpp \
+ WebCore/platform/UUID.h \
+ WebCore/platform/Widget.cpp \
+ WebCore/platform/Widget.h \
+ WebCore/platform/WindowsKeyboardCodes.h \
WebCore/plugins/DOMMimeTypeArray.cpp \
WebCore/plugins/DOMMimeTypeArray.h \
- WebCore/plugins/DOMPlugin.cpp \
- WebCore/plugins/DOMPlugin.h \
+ WebCore/plugins/DOMMimeType.cpp \
+ WebCore/plugins/DOMMimeType.h \
WebCore/plugins/DOMPluginArray.cpp \
WebCore/plugins/DOMPluginArray.h \
- WebCore/plugins/PluginData.cpp \
- WebCore/plugins/PluginData.h \
+ WebCore/plugins/DOMPlugin.cpp \
+ WebCore/plugins/DOMPlugin.h \
+ WebCore/plugins/npapi.cpp \
+ WebCore/plugins/npfunctions.h \
WebCore/plugins/PluginDatabase.cpp \
WebCore/plugins/PluginDatabase.h \
+ WebCore/plugins/PluginData.cpp \
+ WebCore/plugins/PluginData.h \
WebCore/plugins/PluginDebug.cpp \
WebCore/plugins/PluginDebug.h \
WebCore/plugins/PluginMainThreadScheduler.cpp \
@@ -2213,15 +2400,15 @@ webcore_sources += \
WebCore/plugins/PluginQuirkSet.h \
WebCore/plugins/PluginStream.cpp \
WebCore/plugins/PluginStream.h \
+ WebCore/plugins/PluginViewBase.h \
WebCore/plugins/PluginView.cpp \
WebCore/plugins/PluginView.h \
- WebCore/plugins/PluginViewBase.h \
- WebCore/plugins/npapi.cpp \
- WebCore/plugins/npfunctions.h \
WebCore/rendering/AutoTableLayout.cpp \
WebCore/rendering/AutoTableLayout.h \
WebCore/rendering/BidiRun.cpp \
WebCore/rendering/BidiRun.h \
+ WebCore/rendering/break_lines.cpp \
+ WebCore/rendering/break_lines.h \
WebCore/rendering/ColumnInfo.h \
WebCore/rendering/CounterNode.cpp \
WebCore/rendering/CounterNode.h \
@@ -2242,16 +2429,17 @@ webcore_sources += \
WebCore/rendering/InlineTextBox.h \
WebCore/rendering/LayoutState.cpp \
WebCore/rendering/LayoutState.h \
+ WebCore/rendering/MediaControlElements.cpp \
WebCore/rendering/MediaControlElements.h \
WebCore/rendering/OverlapTestRequestClient.h \
WebCore/rendering/PaintInfo.h \
WebCore/rendering/PaintPhase.h \
+ WebCore/rendering/PointerEventsHitRules.cpp \
+ WebCore/rendering/PointerEventsHitRules.h \
WebCore/rendering/RenderApplet.cpp \
WebCore/rendering/RenderApplet.h \
WebCore/rendering/RenderArena.cpp \
WebCore/rendering/RenderArena.h \
- WebCore/rendering/RenderBR.cpp \
- WebCore/rendering/RenderBR.h \
WebCore/rendering/RenderBlock.cpp \
WebCore/rendering/RenderBlock.h \
WebCore/rendering/RenderBlockLineLayout.cpp \
@@ -2259,6 +2447,8 @@ webcore_sources += \
WebCore/rendering/RenderBox.h \
WebCore/rendering/RenderBoxModelObject.cpp \
WebCore/rendering/RenderBoxModelObject.h \
+ WebCore/rendering/RenderBR.cpp \
+ WebCore/rendering/RenderBR.h \
WebCore/rendering/RenderButton.cpp \
WebCore/rendering/RenderButton.h \
WebCore/rendering/RenderCounter.cpp \
@@ -2273,10 +2463,12 @@ webcore_sources += \
WebCore/rendering/RenderFileUploadControl.h \
WebCore/rendering/RenderFlexibleBox.cpp \
WebCore/rendering/RenderFlexibleBox.h \
- WebCore/rendering/RenderFrame.cpp \
- WebCore/rendering/RenderFrame.h \
+ WebCore/rendering/RenderForeignObject.cpp \
+ WebCore/rendering/RenderForeignObject.h \
WebCore/rendering/RenderFrameBase.cpp \
WebCore/rendering/RenderFrameBase.h \
+ WebCore/rendering/RenderFrame.cpp \
+ WebCore/rendering/RenderFrame.h \
WebCore/rendering/RenderFrameSet.cpp \
WebCore/rendering/RenderFrameSet.h \
WebCore/rendering/RenderHTMLCanvas.cpp \
@@ -2293,9 +2485,9 @@ webcore_sources += \
WebCore/rendering/RenderIndicator.h \
WebCore/rendering/RenderInline.cpp \
WebCore/rendering/RenderInline.h \
+ WebCore/rendering/RenderLayerBacking.h \
WebCore/rendering/RenderLayer.cpp \
WebCore/rendering/RenderLayer.h \
- WebCore/rendering/RenderLayerBacking.h \
WebCore/rendering/RenderLineBoxList.cpp \
WebCore/rendering/RenderLineBoxList.h \
WebCore/rendering/RenderListBox.cpp \
@@ -2306,27 +2498,31 @@ webcore_sources += \
WebCore/rendering/RenderListMarker.h \
WebCore/rendering/RenderMarquee.cpp \
WebCore/rendering/RenderMarquee.h \
+ WebCore/rendering/RenderMedia.cpp \
+ WebCore/rendering/RenderMedia.h \
WebCore/rendering/RenderMenuList.cpp \
WebCore/rendering/RenderMenuList.h \
WebCore/rendering/RenderMeter.cpp \
WebCore/rendering/RenderMeter.h \
- WebCore/rendering/RenderObject.cpp \
- WebCore/rendering/RenderObject.h \
WebCore/rendering/RenderObjectChildList.cpp \
WebCore/rendering/RenderObjectChildList.h \
+ WebCore/rendering/RenderObject.cpp \
+ WebCore/rendering/RenderObject.h \
WebCore/rendering/RenderOverflow.h \
WebCore/rendering/RenderPart.cpp \
WebCore/rendering/RenderPart.h \
+ WebCore/rendering/RenderPath.cpp \
+ WebCore/rendering/RenderPath.h \
WebCore/rendering/RenderProgress.cpp \
WebCore/rendering/RenderProgress.h \
WebCore/rendering/RenderReplaced.cpp \
WebCore/rendering/RenderReplaced.h \
WebCore/rendering/RenderReplica.cpp \
WebCore/rendering/RenderReplica.h \
- WebCore/rendering/RenderRuby.cpp \
- WebCore/rendering/RenderRuby.h \
WebCore/rendering/RenderRubyBase.cpp \
WebCore/rendering/RenderRubyBase.h \
+ WebCore/rendering/RenderRuby.cpp \
+ WebCore/rendering/RenderRuby.h \
WebCore/rendering/RenderRubyRun.cpp \
WebCore/rendering/RenderRubyRun.h \
WebCore/rendering/RenderRubyText.cpp \
@@ -2337,35 +2533,89 @@ webcore_sources += \
WebCore/rendering/RenderScrollbarPart.h \
WebCore/rendering/RenderScrollbarTheme.cpp \
WebCore/rendering/RenderScrollbarTheme.h \
- WebCore/rendering/RenderSVGResourceContainer.cpp \
- WebCore/rendering/RenderSVGResourceContainer.h \
WebCore/rendering/RenderSelectionInfo.h \
WebCore/rendering/RenderSlider.cpp \
WebCore/rendering/RenderSlider.h \
- WebCore/rendering/RenderTable.cpp \
- WebCore/rendering/RenderTable.h \
+ WebCore/rendering/RenderSVGBlock.cpp \
+ WebCore/rendering/RenderSVGBlock.h \
+ WebCore/rendering/RenderSVGContainer.cpp \
+ WebCore/rendering/RenderSVGContainer.h \
+ WebCore/rendering/RenderSVGGradientStop.cpp \
+ WebCore/rendering/RenderSVGGradientStop.h \
+ WebCore/rendering/RenderSVGHiddenContainer.cpp \
+ WebCore/rendering/RenderSVGHiddenContainer.h \
+ WebCore/rendering/RenderSVGImage.cpp \
+ WebCore/rendering/RenderSVGImage.h \
+ WebCore/rendering/RenderSVGInline.cpp \
+ WebCore/rendering/RenderSVGInline.h \
+ WebCore/rendering/RenderSVGInlineText.cpp \
+ WebCore/rendering/RenderSVGInlineText.h \
+ WebCore/rendering/RenderSVGModelObject.cpp \
+ WebCore/rendering/RenderSVGModelObject.h \
+ WebCore/rendering/RenderSVGResourceClipper.cpp \
+ WebCore/rendering/RenderSVGResourceClipper.h \
+ WebCore/rendering/RenderSVGResourceContainer.cpp \
+ WebCore/rendering/RenderSVGResourceContainer.h \
+ WebCore/rendering/RenderSVGResource.cpp \
+ WebCore/rendering/RenderSVGResourceFilter.cpp \
+ WebCore/rendering/RenderSVGResourceFilter.h \
+ WebCore/rendering/RenderSVGResourceFilterPrimitive.cpp \
+ WebCore/rendering/RenderSVGResourceFilterPrimitive.h \
+ WebCore/rendering/RenderSVGResourceGradient.cpp \
+ WebCore/rendering/RenderSVGResourceGradient.h \
+ WebCore/rendering/RenderSVGResource.h \
+ WebCore/rendering/RenderSVGResourceLinearGradient.cpp \
+ WebCore/rendering/RenderSVGResourceLinearGradient.h \
+ WebCore/rendering/RenderSVGResourceMarker.cpp \
+ WebCore/rendering/RenderSVGResourceMarker.h \
+ WebCore/rendering/RenderSVGResourceMasker.cpp \
+ WebCore/rendering/RenderSVGResourceMasker.h \
+ WebCore/rendering/RenderSVGResourcePattern.cpp \
+ WebCore/rendering/RenderSVGResourcePattern.h \
+ WebCore/rendering/RenderSVGResourceRadialGradient.cpp \
+ WebCore/rendering/RenderSVGResourceRadialGradient.h \
+ WebCore/rendering/RenderSVGResourceSolidColor.cpp \
+ WebCore/rendering/RenderSVGResourceSolidColor.h \
+ WebCore/rendering/RenderSVGRoot.cpp \
+ WebCore/rendering/RenderSVGRoot.h \
+ WebCore/rendering/RenderSVGShadowTreeRootContainer.cpp \
+ WebCore/rendering/RenderSVGShadowTreeRootContainer.h \
+ WebCore/rendering/RenderSVGText.cpp \
+ WebCore/rendering/RenderSVGText.h \
+ WebCore/rendering/RenderSVGTextPath.cpp \
+ WebCore/rendering/RenderSVGTextPath.h \
+ WebCore/rendering/RenderSVGTransformableContainer.cpp \
+ WebCore/rendering/RenderSVGTransformableContainer.h \
+ WebCore/rendering/RenderSVGTSpan.cpp \
+ WebCore/rendering/RenderSVGTSpan.h \
+ WebCore/rendering/RenderSVGViewportContainer.cpp \
+ WebCore/rendering/RenderSVGViewportContainer.h \
WebCore/rendering/RenderTableCell.cpp \
WebCore/rendering/RenderTableCell.h \
WebCore/rendering/RenderTableCol.cpp \
WebCore/rendering/RenderTableCol.h \
+ WebCore/rendering/RenderTable.cpp \
+ WebCore/rendering/RenderTable.h \
WebCore/rendering/RenderTableRow.cpp \
WebCore/rendering/RenderTableRow.h \
WebCore/rendering/RenderTableSection.cpp \
WebCore/rendering/RenderTableSection.h \
- WebCore/rendering/RenderText.cpp \
- WebCore/rendering/RenderText.h \
WebCore/rendering/RenderTextControl.cpp \
WebCore/rendering/RenderTextControl.h \
WebCore/rendering/RenderTextControlMultiLine.cpp \
WebCore/rendering/RenderTextControlMultiLine.h \
WebCore/rendering/RenderTextControlSingleLine.cpp \
WebCore/rendering/RenderTextControlSingleLine.h \
+ WebCore/rendering/RenderText.cpp \
WebCore/rendering/RenderTextFragment.cpp \
WebCore/rendering/RenderTextFragment.h \
+ WebCore/rendering/RenderText.h \
WebCore/rendering/RenderTheme.cpp \
WebCore/rendering/RenderTheme.h \
WebCore/rendering/RenderTreeAsText.cpp \
WebCore/rendering/RenderTreeAsText.h \
+ WebCore/rendering/RenderVideo.cpp \
+ WebCore/rendering/RenderVideo.h \
WebCore/rendering/RenderView.cpp \
WebCore/rendering/RenderView.h \
WebCore/rendering/RenderWidget.cpp \
@@ -2379,14 +2629,6 @@ webcore_sources += \
WebCore/rendering/ScrollBehavior.h \
WebCore/rendering/ShadowElement.cpp \
WebCore/rendering/ShadowElement.h \
- WebCore/rendering/TableLayout.h \
- WebCore/rendering/TextControlInnerElements.cpp \
- WebCore/rendering/TextControlInnerElements.h \
- WebCore/rendering/TrailingFloatsRootInlineBox.h \
- WebCore/rendering/TransformState.cpp \
- WebCore/rendering/TransformState.h \
- WebCore/rendering/break_lines.cpp \
- WebCore/rendering/break_lines.h \
WebCore/rendering/style/BorderData.h \
WebCore/rendering/style/BorderValue.h \
WebCore/rendering/style/CollapsedBorderValue.h \
@@ -2406,9 +2648,9 @@ webcore_sources += \
WebCore/rendering/style/NinePieceImage.cpp \
WebCore/rendering/style/NinePieceImage.h \
WebCore/rendering/style/OutlineValue.h \
+ WebCore/rendering/style/RenderStyleConstants.h \
WebCore/rendering/style/RenderStyle.cpp \
WebCore/rendering/style/RenderStyle.h \
- WebCore/rendering/style/RenderStyleConstants.h \
WebCore/rendering/style/ShadowData.cpp \
WebCore/rendering/style/ShadowData.h \
WebCore/rendering/style/StyleBackgroundData.cpp \
@@ -2441,18 +2683,661 @@ webcore_sources += \
WebCore/rendering/style/StyleTransformData.h \
WebCore/rendering/style/StyleVisualData.cpp \
WebCore/rendering/style/StyleVisualData.h \
+ WebCore/rendering/style/SVGRenderStyle.cpp \
+ WebCore/rendering/style/SVGRenderStyleDefs.cpp \
+ WebCore/rendering/style/SVGRenderStyleDefs.h \
+ WebCore/rendering/style/SVGRenderStyle.h \
+ WebCore/rendering/SVGCharacterData.cpp \
+ WebCore/rendering/SVGCharacterData.h \
+ WebCore/rendering/SVGCharacterLayoutInfo.cpp \
+ WebCore/rendering/SVGCharacterLayoutInfo.h \
+ WebCore/rendering/SVGImageBufferTools.cpp \
+ WebCore/rendering/SVGImageBufferTools.h \
+ WebCore/rendering/SVGInlineFlowBox.cpp \
+ WebCore/rendering/SVGInlineFlowBox.h \
+ WebCore/rendering/SVGInlineTextBox.cpp \
+ WebCore/rendering/SVGInlineTextBox.h \
+ WebCore/rendering/SVGMarkerData.h \
+ WebCore/rendering/SVGMarkerLayoutInfo.cpp \
+ WebCore/rendering/SVGMarkerLayoutInfo.h \
+ WebCore/rendering/SVGRenderSupport.cpp \
+ WebCore/rendering/SVGRenderSupport.h \
+ WebCore/rendering/SVGRenderTreeAsText.cpp \
+ WebCore/rendering/SVGRenderTreeAsText.h \
+ WebCore/rendering/SVGResourcesCache.cpp \
+ WebCore/rendering/SVGResourcesCache.h \
+ WebCore/rendering/SVGResources.cpp \
+ WebCore/rendering/SVGResourcesCycleSolver.cpp \
+ WebCore/rendering/SVGResourcesCycleSolver.h \
+ WebCore/rendering/SVGResources.h \
+ WebCore/rendering/SVGRootInlineBox.cpp \
+ WebCore/rendering/SVGRootInlineBox.h \
+ WebCore/rendering/SVGShadowTreeElements.cpp \
+ WebCore/rendering/SVGShadowTreeElements.h \
+ WebCore/rendering/svg/SVGTextLayoutAttributes.cpp \
+ WebCore/rendering/svg/SVGTextLayoutAttributes.h \
+ WebCore/rendering/svg/SVGTextLayoutBuilder.cpp \
+ WebCore/rendering/svg/SVGTextLayoutBuilder.h \
+ WebCore/rendering/SVGTextChunkLayoutInfo.cpp \
+ WebCore/rendering/SVGTextChunkLayoutInfo.h \
+ WebCore/rendering/SVGTextLayoutUtilities.cpp \
+ WebCore/rendering/SVGTextLayoutUtilities.h \
+ WebCore/rendering/SVGTextQuery.cpp \
+ WebCore/rendering/SVGTextQuery.h \
+ WebCore/rendering/TableLayout.h \
+ WebCore/rendering/TextControlInnerElements.cpp \
+ WebCore/rendering/TextControlInnerElements.h \
+ WebCore/rendering/TrailingFloatsRootInlineBox.h \
+ WebCore/rendering/TransformState.cpp \
+ WebCore/rendering/TransformState.h \
+ WebCore/storage/AbstractDatabase.cpp \
+ WebCore/storage/AbstractDatabase.h \
+ WebCore/storage/ChangeVersionWrapper.cpp \
+ WebCore/storage/ChangeVersionWrapper.h \
+ WebCore/storage/DatabaseAuthorizer.cpp \
+ WebCore/storage/DatabaseAuthorizer.h \
+ WebCore/storage/DatabaseCallback.h \
+ WebCore/storage/Database.cpp \
+ WebCore/storage/DatabaseDetails.h \
+ WebCore/storage/Database.h \
+ WebCore/storage/DatabaseSync.cpp \
+ WebCore/storage/DatabaseSync.h \
+ WebCore/storage/DatabaseTask.cpp \
+ WebCore/storage/DatabaseTask.h \
+ WebCore/storage/DatabaseThread.cpp \
+ WebCore/storage/DatabaseThread.h \
+ WebCore/storage/DatabaseTrackerClient.h \
+ WebCore/storage/DatabaseTracker.cpp \
+ WebCore/storage/DatabaseTracker.h \
+ WebCore/storage/IDBAny.cpp \
+ WebCore/storage/IDBAny.h \
+ WebCore/storage/IDBCallbacks.h \
+ WebCore/storage/IDBCursorBackendImpl.cpp \
+ WebCore/storage/IDBCursorBackendImpl.h \
+ WebCore/storage/IDBCursorBackendInterface.h \
+ WebCore/storage/IDBCursor.cpp \
+ WebCore/storage/IDBCursor.h \
+ WebCore/storage/IDBDatabaseBackendImpl.cpp \
+ WebCore/storage/IDBDatabaseBackendImpl.h \
+ WebCore/storage/IDBDatabaseBackendInterface.h \
+ WebCore/storage/IDBDatabase.cpp \
+ WebCore/storage/IDBDatabaseError.h \
+ WebCore/storage/IDBDatabaseException.h \
+ WebCore/storage/IDBDatabase.h \
+ WebCore/storage/IDBErrorEvent.cpp \
+ WebCore/storage/IDBErrorEvent.h \
+ WebCore/storage/IDBEvent.cpp \
+ WebCore/storage/IDBEvent.h \
+ WebCore/storage/IDBFactoryBackendImpl.cpp \
+ WebCore/storage/IDBFactoryBackendImpl.h \
+ WebCore/storage/IDBFactoryBackendInterface.cpp \
+ WebCore/storage/IDBFactoryBackendInterface.h \
+ WebCore/storage/IDBFactory.cpp \
+ WebCore/storage/IDBFactory.h \
+ WebCore/storage/IDBIndexBackendImpl.cpp \
+ WebCore/storage/IDBIndexBackendImpl.h \
+ WebCore/storage/IDBIndexBackendInterface.h \
+ WebCore/storage/IDBIndexBackendInterface.h \
+ WebCore/storage/IDBIndex.cpp \
+ WebCore/storage/IDBIndex.h \
+ WebCore/storage/IDBKey.h \
+ WebCore/storage/IDBKeyRange.cpp \
+ WebCore/storage/IDBKeyRange.h \
+ WebCore/storage/IDBObjectStoreBackendImpl.cpp \
+ WebCore/storage/IDBObjectStoreBackendImpl.h \
+ WebCore/storage/IDBObjectStoreBackendInterface.h \
+ WebCore/storage/IDBObjectStoreBackendInterface.h \
+ WebCore/storage/IDBObjectStore.cpp \
+ WebCore/storage/IDBObjectStore.h \
+ WebCore/storage/IDBRequest.cpp \
+ WebCore/storage/IDBRequest.h \
+ WebCore/storage/IDBSuccessEvent.cpp \
+ WebCore/storage/IDBSuccessEvent.h \
+ WebCore/storage/IDBTransactionBackendInterface.h \
+ WebCore/storage/IDBTransaction.cpp \
+ WebCore/storage/IDBTransaction.h \
+ WebCore/storage/LocalStorageTask.cpp \
+ WebCore/storage/LocalStorageTask.h \
+ WebCore/storage/LocalStorageThread.cpp \
+ WebCore/storage/LocalStorageThread.h \
+ WebCore/storage/OriginQuotaManager.cpp \
+ WebCore/storage/OriginQuotaManager.h \
+ WebCore/storage/OriginUsageRecord.cpp \
+ WebCore/storage/OriginUsageRecord.h \
+ WebCore/storage/SQLError.h \
+ WebCore/storage/SQLException.h \
+ WebCore/storage/SQLResultSet.cpp \
+ WebCore/storage/SQLResultSet.h \
+ WebCore/storage/SQLResultSetRowList.cpp \
+ WebCore/storage/SQLResultSetRowList.h \
+ WebCore/storage/SQLStatementCallback.h \
+ WebCore/storage/SQLStatement.cpp \
+ WebCore/storage/SQLStatementErrorCallback.h \
+ WebCore/storage/SQLStatement.h \
+ WebCore/storage/SQLStatementSync.cpp \
+ WebCore/storage/SQLStatementSync.h \
+ WebCore/storage/SQLTransactionCallback.h \
+ WebCore/storage/SQLTransactionClient.cpp \
+ WebCore/storage/SQLTransactionClient.h \
+ WebCore/storage/SQLTransactionCoordinator.cpp \
+ WebCore/storage/SQLTransactionCoordinator.h \
+ WebCore/storage/SQLTransaction.cpp \
+ WebCore/storage/SQLTransactionErrorCallback.h \
+ WebCore/storage/SQLTransaction.h \
+ WebCore/storage/SQLTransactionSyncCallback.h \
+ WebCore/storage/SQLTransactionSync.cpp \
+ WebCore/storage/SQLTransactionSync.h \
+ WebCore/storage/StorageArea.h \
+ WebCore/storage/StorageAreaImpl.cpp \
+ WebCore/storage/StorageAreaImpl.h \
+ WebCore/storage/StorageAreaSync.cpp \
+ WebCore/storage/StorageAreaSync.h \
+ WebCore/storage/Storage.cpp \
+ WebCore/storage/StorageEvent.cpp \
+ WebCore/storage/StorageEventDispatcher.cpp \
+ WebCore/storage/StorageEventDispatcher.h \
+ WebCore/storage/StorageEvent.h \
+ WebCore/storage/Storage.h \
+ WebCore/storage/StorageMap.cpp \
+ WebCore/storage/StorageMap.h \
+ WebCore/storage/StorageNamespace.cpp \
+ WebCore/storage/StorageNamespace.h \
+ WebCore/storage/StorageNamespaceImpl.cpp \
+ WebCore/storage/StorageNamespaceImpl.h \
+ WebCore/storage/StorageSyncManager.cpp \
+ WebCore/storage/StorageSyncManager.h \
+ WebCore/svg/animation/SMILTimeContainer.cpp \
+ WebCore/svg/animation/SMILTimeContainer.h \
+ WebCore/svg/animation/SMILTime.cpp \
+ WebCore/svg/animation/SMILTime.h \
+ WebCore/svg/animation/SVGSMILElement.cpp \
+ WebCore/svg/animation/SVGSMILElement.h \
+ WebCore/svg/ColorDistance.cpp \
+ WebCore/svg/ColorDistance.h \
+ WebCore/svg/ElementTimeControl.h \
+ WebCore/svg/GradientAttributes.h \
+ WebCore/svg/graphics/filters/SVGDistantLightSource.h \
+ WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp \
+ WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h \
+ WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp \
+ WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h \
+ WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp \
+ WebCore/svg/graphics/filters/SVGFEDisplacementMap.h \
+ WebCore/svg/graphics/filters/SVGFEFlood.cpp \
+ WebCore/svg/graphics/filters/SVGFEFlood.h \
+ WebCore/svg/graphics/filters/SVGFEImage.cpp \
+ WebCore/svg/graphics/filters/SVGFEImage.h \
+ WebCore/svg/graphics/filters/SVGFELighting.cpp \
+ WebCore/svg/graphics/filters/SVGFELighting.h \
+ WebCore/svg/graphics/filters/SVGFEMerge.cpp \
+ WebCore/svg/graphics/filters/SVGFEMerge.h \
+ WebCore/svg/graphics/filters/SVGFEMorphology.cpp \
+ WebCore/svg/graphics/filters/SVGFEMorphology.h \
+ WebCore/svg/graphics/filters/SVGFEOffset.cpp \
+ WebCore/svg/graphics/filters/SVGFEOffset.h \
+ WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp \
+ WebCore/svg/graphics/filters/SVGFESpecularLighting.h \
+ WebCore/svg/graphics/filters/SVGFETile.cpp \
+ WebCore/svg/graphics/filters/SVGFETile.h \
+ WebCore/svg/graphics/filters/SVGFETurbulence.cpp \
+ WebCore/svg/graphics/filters/SVGFETurbulence.h \
+ WebCore/svg/graphics/filters/SVGFilterBuilder.cpp \
+ WebCore/svg/graphics/filters/SVGFilterBuilder.h \
+ WebCore/svg/graphics/filters/SVGFilter.cpp \
+ WebCore/svg/graphics/filters/SVGFilter.h \
+ WebCore/svg/graphics/filters/SVGLightSource.cpp \
+ WebCore/svg/graphics/filters/SVGLightSource.h \
+ WebCore/svg/graphics/filters/SVGPointLightSource.h \
+ WebCore/svg/graphics/filters/SVGSpotLightSource.h \
+ WebCore/svg/graphics/SVGImage.cpp \
+ WebCore/svg/graphics/SVGImage.h \
+ WebCore/svg/LinearGradientAttributes.h \
+ WebCore/svg/PatternAttributes.h \
+ WebCore/svg/RadialGradientAttributes.h \
+ WebCore/svg/SVGAElement.cpp \
+ WebCore/svg/SVGAElement.h \
+ WebCore/svg/SVGAltGlyphElement.cpp \
+ WebCore/svg/SVGAltGlyphElement.h \
+ WebCore/svg/SVGAngle.cpp \
+ WebCore/svg/SVGAngle.h \
+ WebCore/svg/SVGAnimateColorElement.cpp \
+ WebCore/svg/SVGAnimateColorElement.h \
+ WebCore/svg/SVGAnimatedPathData.cpp \
+ WebCore/svg/SVGAnimatedPathData.h \
+ WebCore/svg/SVGAnimatedPoints.cpp \
+ WebCore/svg/SVGAnimatedPoints.h \
+ WebCore/svg/SVGAnimatedProperty.h \
+ WebCore/svg/SVGAnimatedPropertySynchronizer.h \
+ WebCore/svg/SVGAnimatedPropertyTraits.h \
+ WebCore/svg/SVGAnimatedTemplate.h \
+ WebCore/svg/SVGAnimateElement.cpp \
+ WebCore/svg/SVGAnimateElement.h \
+ WebCore/svg/SVGAnimateMotionElement.cpp \
+ WebCore/svg/SVGAnimateMotionElement.h \
+ WebCore/svg/SVGAnimateTransformElement.cpp \
+ WebCore/svg/SVGAnimateTransformElement.h \
+ WebCore/svg/SVGAnimationElement.cpp \
+ WebCore/svg/SVGAnimationElement.h \
+ WebCore/svg/SVGCircleElement.cpp \
+ WebCore/svg/SVGCircleElement.h \
+ WebCore/svg/SVGClipPathElement.cpp \
+ WebCore/svg/SVGClipPathElement.h \
+ WebCore/svg/SVGColor.cpp \
+ WebCore/svg/SVGColor.h \
+ WebCore/svg/SVGComponentTransferFunctionElement.cpp \
+ WebCore/svg/SVGComponentTransferFunctionElement.h \
+ WebCore/svg/SVGCursorElement.cpp \
+ WebCore/svg/SVGCursorElement.h \
+ WebCore/svg/SVGDefsElement.cpp \
+ WebCore/svg/SVGDefsElement.h \
+ WebCore/svg/SVGDescElement.cpp \
+ WebCore/svg/SVGDescElement.h \
+ WebCore/svg/SVGDocument.cpp \
+ WebCore/svg/SVGDocumentExtensions.cpp \
+ WebCore/svg/SVGDocumentExtensions.h \
+ WebCore/svg/SVGDocument.h \
+ WebCore/svg/SVGElement.cpp \
+ WebCore/svg/SVGElement.h \
+ WebCore/svg/SVGElementInstance.cpp \
+ WebCore/svg/SVGElementInstance.h \
+ WebCore/svg/SVGElementInstanceList.cpp \
+ WebCore/svg/SVGElementInstanceList.h \
+ WebCore/svg/SVGElementRareData.h \
+ WebCore/svg/SVGEllipseElement.cpp \
+ WebCore/svg/SVGEllipseElement.h \
+ WebCore/svg/SVGException.h \
+ WebCore/svg/SVGExternalResourcesRequired.cpp \
+ WebCore/svg/SVGExternalResourcesRequired.h \
+ WebCore/svg/SVGFEBlendElement.cpp \
+ WebCore/svg/SVGFEBlendElement.h \
+ WebCore/svg/SVGFEColorMatrixElement.cpp \
+ WebCore/svg/SVGFEColorMatrixElement.h \
+ WebCore/svg/SVGFEComponentTransferElement.cpp \
+ WebCore/svg/SVGFEComponentTransferElement.h \
+ WebCore/svg/SVGFECompositeElement.cpp \
+ WebCore/svg/SVGFECompositeElement.h \
+ WebCore/svg/SVGFEConvolveMatrixElement.cpp \
+ WebCore/svg/SVGFEConvolveMatrixElement.h \
+ WebCore/svg/SVGFEDiffuseLightingElement.cpp \
+ WebCore/svg/SVGFEDiffuseLightingElement.h \
+ WebCore/svg/SVGFEDisplacementMapElement.cpp \
+ WebCore/svg/SVGFEDisplacementMapElement.h \
+ WebCore/svg/SVGFEDistantLightElement.cpp \
+ WebCore/svg/SVGFEDistantLightElement.h \
+ WebCore/svg/SVGFEFloodElement.cpp \
+ WebCore/svg/SVGFEFloodElement.h \
+ WebCore/svg/SVGFEFuncAElement.cpp \
+ WebCore/svg/SVGFEFuncAElement.h \
+ WebCore/svg/SVGFEFuncBElement.cpp \
+ WebCore/svg/SVGFEFuncBElement.h \
+ WebCore/svg/SVGFEFuncGElement.cpp \
+ WebCore/svg/SVGFEFuncGElement.h \
+ WebCore/svg/SVGFEFuncRElement.cpp \
+ WebCore/svg/SVGFEFuncRElement.h \
+ WebCore/svg/SVGFEGaussianBlurElement.cpp \
+ WebCore/svg/SVGFEGaussianBlurElement.h \
+ WebCore/svg/SVGFEImageElement.cpp \
+ WebCore/svg/SVGFEImageElement.h \
+ WebCore/svg/SVGFELightElement.cpp \
+ WebCore/svg/SVGFELightElement.h \
+ WebCore/svg/SVGFEMergeElement.cpp \
+ WebCore/svg/SVGFEMergeElement.h \
+ WebCore/svg/SVGFEMergeNodeElement.cpp \
+ WebCore/svg/SVGFEMergeNodeElement.h \
+ WebCore/svg/SVGFEMorphologyElement.cpp \
+ WebCore/svg/SVGFEMorphologyElement.h \
+ WebCore/svg/SVGFEOffsetElement.cpp \
+ WebCore/svg/SVGFEOffsetElement.h \
+ WebCore/svg/SVGFEPointLightElement.cpp \
+ WebCore/svg/SVGFEPointLightElement.h \
+ WebCore/svg/SVGFESpecularLightingElement.cpp \
+ WebCore/svg/SVGFESpecularLightingElement.h \
+ WebCore/svg/SVGFESpotLightElement.cpp \
+ WebCore/svg/SVGFESpotLightElement.h \
+ WebCore/svg/SVGFETileElement.cpp \
+ WebCore/svg/SVGFETileElement.h \
+ WebCore/svg/SVGFETurbulenceElement.cpp \
+ WebCore/svg/SVGFETurbulenceElement.h \
+ WebCore/svg/SVGFilterElement.cpp \
+ WebCore/svg/SVGFilterElement.h \
+ WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp \
+ WebCore/svg/SVGFilterPrimitiveStandardAttributes.h \
+ WebCore/svg/SVGFitToViewBox.cpp \
+ WebCore/svg/SVGFitToViewBox.h \
+ WebCore/svg/SVGFont.cpp \
+ WebCore/svg/SVGFontData.cpp \
+ WebCore/svg/SVGFontData.h \
+ WebCore/svg/SVGFontElement.cpp \
+ WebCore/svg/SVGFontElement.h \
+ WebCore/svg/SVGFontFaceElement.cpp \
+ WebCore/svg/SVGFontFaceElement.h \
+ WebCore/svg/SVGFontFaceFormatElement.cpp \
+ WebCore/svg/SVGFontFaceFormatElement.h \
+ WebCore/svg/SVGFontFaceNameElement.cpp \
+ WebCore/svg/SVGFontFaceNameElement.h \
+ WebCore/svg/SVGFontFaceSrcElement.cpp \
+ WebCore/svg/SVGFontFaceSrcElement.h \
+ WebCore/svg/SVGFontFaceUriElement.cpp \
+ WebCore/svg/SVGFontFaceUriElement.h \
+ WebCore/svg/SVGForeignObjectElement.cpp \
+ WebCore/svg/SVGForeignObjectElement.h \
+ WebCore/svg/SVGGElement.cpp \
+ WebCore/svg/SVGGElement.h \
+ WebCore/svg/SVGGlyphElement.cpp \
+ WebCore/svg/SVGGlyphElement.h \
+ WebCore/svg/SVGGlyphMap.h \
+ WebCore/svg/SVGGradientElement.cpp \
+ WebCore/svg/SVGGradientElement.h \
+ WebCore/svg/SVGHKernElement.cpp \
+ WebCore/svg/SVGHKernElement.h \
+ WebCore/svg/SVGImageElement.cpp \
+ WebCore/svg/SVGImageElement.h \
+ WebCore/svg/SVGImageLoader.cpp \
+ WebCore/svg/SVGImageLoader.h \
+ WebCore/svg/SVGLangSpace.cpp \
+ WebCore/svg/SVGLangSpace.h \
+ WebCore/svg/SVGLength.cpp \
+ WebCore/svg/SVGLength.h \
+ WebCore/svg/SVGLengthList.cpp \
+ WebCore/svg/SVGLengthList.h \
+ WebCore/svg/SVGLinearGradientElement.cpp \
+ WebCore/svg/SVGLinearGradientElement.h \
+ WebCore/svg/SVGLineElement.cpp \
+ WebCore/svg/SVGLineElement.h \
+ WebCore/svg/SVGList.h \
+ WebCore/svg/SVGListTraits.h \
+ WebCore/svg/SVGLocatable.cpp \
+ WebCore/svg/SVGLocatable.h \
+ WebCore/svg/SVGMarkerElement.cpp \
+ WebCore/svg/SVGMarkerElement.h \
+ WebCore/svg/SVGMaskElement.cpp \
+ WebCore/svg/SVGMaskElement.h \
+ WebCore/svg/SVGMetadataElement.cpp \
+ WebCore/svg/SVGMetadataElement.h \
+ WebCore/svg/SVGMissingGlyphElement.cpp \
+ WebCore/svg/SVGMissingGlyphElement.h \
+ WebCore/svg/SVGMPathElement.cpp \
+ WebCore/svg/SVGMPathElement.h \
+ WebCore/svg/SVGNumberList.cpp \
+ WebCore/svg/SVGNumberList.h \
+ WebCore/svg/SVGPaint.cpp \
+ WebCore/svg/SVGPaint.h \
+ WebCore/svg/SVGParserUtilities.cpp \
+ WebCore/svg/SVGParserUtilities.h \
+ WebCore/svg/SVGPathBlender.cpp \
+ WebCore/svg/SVGPathBlender.h \
+ WebCore/svg/SVGPathBuilder.cpp \
+ WebCore/svg/SVGPathBuilder.h \
+ WebCore/svg/SVGPathByteStreamBuilder.cpp \
+ WebCore/svg/SVGPathByteStreamBuilder.h \
+ WebCore/svg/SVGPathByteStream.h \
+ WebCore/svg/SVGPathByteStreamSource.cpp \
+ WebCore/svg/SVGPathByteStreamSource.h \
+ WebCore/svg/SVGPathConsumer.h \
+ WebCore/svg/SVGPathElement.cpp \
+ WebCore/svg/SVGPathElement.h \
+ WebCore/svg/SVGPathParser.cpp \
+ WebCore/svg/SVGPathParserFactory.cpp \
+ WebCore/svg/SVGPathParserFactory.h \
+ WebCore/svg/SVGPathParser.h \
+ WebCore/svg/SVGPathSegArc.cpp \
+ WebCore/svg/SVGPathSegArc.h \
+ WebCore/svg/SVGPathSegClosePath.cpp \
+ WebCore/svg/SVGPathSegClosePath.h \
+ WebCore/svg/SVGPathSeg.cpp \
+ WebCore/svg/SVGPathSegCurvetoCubic.cpp \
+ WebCore/svg/SVGPathSegCurvetoCubic.h \
+ WebCore/svg/SVGPathSegCurvetoCubicSmooth.cpp \
+ WebCore/svg/SVGPathSegCurvetoCubicSmooth.h \
+ WebCore/svg/SVGPathSegCurvetoQuadratic.cpp \
+ WebCore/svg/SVGPathSegCurvetoQuadratic.h \
+ WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.cpp \
+ WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h \
+ WebCore/svg/SVGPathSeg.h \
+ WebCore/svg/SVGPathSegLineto.cpp \
+ WebCore/svg/SVGPathSegLineto.h \
+ WebCore/svg/SVGPathSegLinetoHorizontal.cpp \
+ WebCore/svg/SVGPathSegLinetoHorizontal.h \
+ WebCore/svg/SVGPathSegLinetoVertical.cpp \
+ WebCore/svg/SVGPathSegLinetoVertical.h \
+ WebCore/svg/SVGPathSegListBuilder.cpp \
+ WebCore/svg/SVGPathSegListBuilder.h \
+ WebCore/svg/SVGPathSegList.cpp \
+ WebCore/svg/SVGPathSegList.h \
+ WebCore/svg/SVGPathSegListSource.cpp \
+ WebCore/svg/SVGPathSegListSource.h \
+ WebCore/svg/SVGPathSegMoveto.cpp \
+ WebCore/svg/SVGPathSegMoveto.h \
+ WebCore/svg/SVGPathSource.h \
+ WebCore/svg/SVGPathStringBuilder.cpp \
+ WebCore/svg/SVGPathStringBuilder.h \
+ WebCore/svg/SVGPathStringSource.cpp \
+ WebCore/svg/SVGPathStringSource.h \
+ WebCore/svg/SVGPathTraversalStateBuilder.cpp \
+ WebCore/svg/SVGPathTraversalStateBuilder.h \
+ WebCore/svg/SVGPatternElement.cpp \
+ WebCore/svg/SVGPatternElement.h \
+ WebCore/svg/SVGPointList.cpp \
+ WebCore/svg/SVGPointList.h \
+ WebCore/svg/SVGPolyElement.cpp \
+ WebCore/svg/SVGPolyElement.h \
+ WebCore/svg/SVGPolygonElement.cpp \
+ WebCore/svg/SVGPolygonElement.h \
+ WebCore/svg/SVGPolylineElement.cpp \
+ WebCore/svg/SVGPolylineElement.h \
+ WebCore/svg/SVGPreserveAspectRatio.cpp \
+ WebCore/svg/SVGPreserveAspectRatio.h \
+ WebCore/svg/SVGRadialGradientElement.cpp \
+ WebCore/svg/SVGRadialGradientElement.h \
+ WebCore/svg/SVGRectElement.cpp \
+ WebCore/svg/SVGRectElement.h \
+ WebCore/svg/SVGRenderingIntent.h \
+ WebCore/svg/SVGScriptElement.cpp \
+ WebCore/svg/SVGScriptElement.h \
+ WebCore/svg/SVGSetElement.cpp \
+ WebCore/svg/SVGSetElement.h \
+ WebCore/svg/SVGStopElement.cpp \
+ WebCore/svg/SVGStopElement.h \
+ WebCore/svg/SVGStringList.cpp \
+ WebCore/svg/SVGStringList.h \
+ WebCore/svg/SVGStylable.cpp \
+ WebCore/svg/SVGStylable.h \
+ WebCore/svg/SVGStyledElement.cpp \
+ WebCore/svg/SVGStyledElement.h \
+ WebCore/svg/SVGStyledLocatableElement.cpp \
+ WebCore/svg/SVGStyledLocatableElement.h \
+ WebCore/svg/SVGStyledTransformableElement.cpp \
+ WebCore/svg/SVGStyledTransformableElement.h \
+ WebCore/svg/SVGStyleElement.cpp \
+ WebCore/svg/SVGStyleElement.h \
+ WebCore/svg/SVGSVGElement.cpp \
+ WebCore/svg/SVGSVGElement.h \
+ WebCore/svg/SVGSwitchElement.cpp \
+ WebCore/svg/SVGSwitchElement.h \
+ WebCore/svg/SVGSymbolElement.cpp \
+ WebCore/svg/SVGSymbolElement.h \
+ WebCore/svg/SVGTests.cpp \
+ WebCore/svg/SVGTests.h \
+ WebCore/svg/SVGTextContentElement.cpp \
+ WebCore/svg/SVGTextContentElement.h \
+ WebCore/svg/SVGTextElement.cpp \
+ WebCore/svg/SVGTextElement.h \
+ WebCore/svg/SVGTextPathElement.cpp \
+ WebCore/svg/SVGTextPathElement.h \
+ WebCore/svg/SVGTextPositioningElement.cpp \
+ WebCore/svg/SVGTextPositioningElement.h \
+ WebCore/svg/SVGTitleElement.cpp \
+ WebCore/svg/SVGTitleElement.h \
+ WebCore/svg/SVGTransformable.cpp \
+ WebCore/svg/SVGTransformable.h \
+ WebCore/svg/SVGTransform.cpp \
+ WebCore/svg/SVGTransformDistance.cpp \
+ WebCore/svg/SVGTransformDistance.h \
+ WebCore/svg/SVGTransform.h \
+ WebCore/svg/SVGTransformList.cpp \
+ WebCore/svg/SVGTransformList.h \
+ WebCore/svg/SVGTRefElement.cpp \
+ WebCore/svg/SVGTRefElement.h \
+ WebCore/svg/SVGTSpanElement.cpp \
+ WebCore/svg/SVGTSpanElement.h \
+ WebCore/svg/SVGUnitTypes.h \
+ WebCore/svg/SVGURIReference.cpp \
+ WebCore/svg/SVGURIReference.h \
+ WebCore/svg/SVGUseElement.cpp \
+ WebCore/svg/SVGUseElement.h \
+ WebCore/svg/SVGViewElement.cpp \
+ WebCore/svg/SVGViewElement.h \
+ WebCore/svg/SVGViewSpec.cpp \
+ WebCore/svg/SVGViewSpec.h \
+ WebCore/svg/SVGVKernElement.cpp \
+ WebCore/svg/SVGVKernElement.h \
+ WebCore/svg/SVGZoomAndPan.cpp \
+ WebCore/svg/SVGZoomAndPan.h \
+ WebCore/svg/SVGZoomEvent.cpp \
+ WebCore/svg/SVGZoomEvent.h \
+ WebCore/WebCorePrefix.h \
+ WebCore/websockets/ThreadableWebSocketChannelClientWrapper.h \
+ WebCore/websockets/ThreadableWebSocketChannel.cpp \
+ WebCore/websockets/ThreadableWebSocketChannel.h \
+ WebCore/websockets/WebSocketChannelClient.h \
+ WebCore/websockets/WebSocketChannel.cpp \
+ WebCore/websockets/WebSocketChannel.h \
+ WebCore/websockets/WebSocket.cpp \
+ WebCore/websockets/WebSocket.h \
+ WebCore/websockets/WebSocketHandshake.cpp \
+ WebCore/websockets/WebSocketHandshake.h \
+ WebCore/websockets/WebSocketHandshakeRequest.cpp \
+ WebCore/websockets/WebSocketHandshakeRequest.h \
+ WebCore/websockets/WebSocketHandshakeResponse.cpp \
+ WebCore/websockets/WebSocketHandshakeResponse.h \
+ WebCore/websockets/WorkerThreadableWebSocketChannel.cpp \
+ WebCore/websockets/WorkerThreadableWebSocketChannel.h \
+ WebCore/wml/WMLAccessElement.cpp \
+ WebCore/wml/WMLAElement.cpp \
+ WebCore/wml/WMLAnchorElement.cpp \
+ WebCore/wml/WMLBRElement.cpp \
+ WebCore/wml/WMLCardElement.cpp \
+ WebCore/wml/WMLDocument.cpp \
+ WebCore/wml/WMLDoElement.cpp \
+ WebCore/wml/WMLElement.cpp \
+ WebCore/wml/WMLErrorHandling.cpp \
+ WebCore/wml/WMLEventHandlingElement.cpp \
+ WebCore/wml/WMLFieldSetElement.cpp \
+ WebCore/wml/WMLFormControlElement.cpp \
+ WebCore/wml/WMLGoElement.cpp \
+ WebCore/wml/WMLImageElement.cpp \
+ WebCore/wml/WMLImageLoader.cpp \
+ WebCore/wml/WMLInputElement.cpp \
+ WebCore/wml/WMLInsertedLegendElement.cpp \
+ WebCore/wml/WMLIntrinsicEvent.cpp \
+ WebCore/wml/WMLIntrinsicEventHandler.cpp \
+ WebCore/wml/WMLMetaElement.cpp \
+ WebCore/wml/WMLNoopElement.cpp \
+ WebCore/wml/WMLOnEventElement.cpp \
+ WebCore/wml/WMLOptGroupElement.cpp \
+ WebCore/wml/WMLOptionElement.cpp \
+ WebCore/wml/WMLPageState.cpp \
+ WebCore/wml/WMLPElement.cpp \
+ WebCore/wml/WMLPostfieldElement.cpp \
+ WebCore/wml/WMLPrevElement.cpp \
+ WebCore/wml/WMLRefreshElement.cpp \
+ WebCore/wml/WMLSelectElement.cpp \
+ WebCore/wml/WMLSetvarElement.cpp \
+ WebCore/wml/WMLTableElement.cpp \
+ WebCore/wml/WMLTaskElement.cpp \
+ WebCore/wml/WMLTemplateElement.cpp \
+ WebCore/wml/WMLTimerElement.cpp \
+ WebCore/wml/WMLVariables.cpp \
+ WebCore/workers/AbstractWorker.cpp \
+ WebCore/workers/AbstractWorker.h \
+ WebCore/workers/DedicatedWorkerContext.cpp \
+ WebCore/workers/DedicatedWorkerContext.h \
+ WebCore/workers/DedicatedWorkerThread.cpp \
+ WebCore/workers/DedicatedWorkerThread.h \
+ WebCore/workers/DefaultSharedWorkerRepository.cpp \
+ WebCore/workers/DefaultSharedWorkerRepository.h \
+ WebCore/workers/SharedWorkerContext.cpp \
+ WebCore/workers/SharedWorkerContext.h \
+ WebCore/workers/SharedWorker.cpp \
+ WebCore/workers/SharedWorker.h \
+ WebCore/workers/SharedWorkerRepository.h \
+ WebCore/workers/SharedWorkerThread.cpp \
+ WebCore/workers/SharedWorkerThread.h \
+ WebCore/workers/WorkerContext.cpp \
+ WebCore/workers/WorkerContext.h \
+ WebCore/workers/WorkerContextProxy.h \
+ WebCore/workers/Worker.cpp \
+ WebCore/workers/Worker.h \
+ WebCore/workers/WorkerLoaderProxy.h \
+ WebCore/workers/WorkerLocation.cpp \
+ WebCore/workers/WorkerLocation.h \
+ WebCore/workers/WorkerMessagingProxy.cpp \
+ WebCore/workers/WorkerMessagingProxy.h \
+ WebCore/workers/WorkerObjectProxy.h \
+ WebCore/workers/WorkerReportingProxy.h \
+ WebCore/workers/WorkerRunLoop.cpp \
+ WebCore/workers/WorkerRunLoop.h \
+ WebCore/workers/WorkerScriptLoaderClient.h \
+ WebCore/workers/WorkerScriptLoader.cpp \
+ WebCore/workers/WorkerScriptLoader.h \
+ WebCore/workers/WorkerThread.cpp \
+ WebCore/workers/WorkerThread.h \
WebCore/xml/DOMParser.cpp \
WebCore/xml/DOMParser.h \
+ WebCore/xml/NativeXPathNSResolver.cpp \
+ WebCore/xml/NativeXPathNSResolver.h \
WebCore/xml/XMLHttpRequest.cpp \
- WebCore/xml/XMLHttpRequest.h \
WebCore/xml/XMLHttpRequestException.h \
+ WebCore/xml/XMLHttpRequest.h \
WebCore/xml/XMLHttpRequestProgressEvent.h \
WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp \
WebCore/xml/XMLHttpRequestProgressEventThrottle.h \
WebCore/xml/XMLHttpRequestUpload.cpp \
WebCore/xml/XMLHttpRequestUpload.h \
WebCore/xml/XMLSerializer.cpp \
- WebCore/xml/XMLSerializer.h
+ WebCore/xml/XMLSerializer.h \
+ WebCore/xml/XPathEvaluator.cpp \
+ WebCore/xml/XPathEvaluator.h \
+ WebCore/xml/XPathException.h \
+ WebCore/xml/XPathExpression.cpp \
+ WebCore/xml/XPathExpression.h \
+ WebCore/xml/XPathExpressionNode.cpp \
+ WebCore/xml/XPathExpressionNode.h \
+ WebCore/xml/XPathFunctions.cpp \
+ WebCore/xml/XPathFunctions.h \
+ WebCore/xml/XPathNamespace.cpp \
+ WebCore/xml/XPathNamespace.h \
+ WebCore/xml/XPathNodeSet.cpp \
+ WebCore/xml/XPathNodeSet.h \
+ WebCore/xml/XPathNSResolver.cpp \
+ WebCore/xml/XPathNSResolver.h \
+ WebCore/xml/XPathParser.cpp \
+ WebCore/xml/XPathParser.h \
+ WebCore/xml/XPathPath.cpp \
+ WebCore/xml/XPathPath.h \
+ WebCore/xml/XPathPredicate.cpp \
+ WebCore/xml/XPathPredicate.h \
+ WebCore/xml/XPathResult.cpp \
+ WebCore/xml/XPathResult.h \
+ WebCore/xml/XPathStep.cpp \
+ WebCore/xml/XPathStep.h \
+ WebCore/xml/XPathUtil.cpp \
+ WebCore/xml/XPathUtil.h \
+ WebCore/xml/XPathValue.cpp \
+ WebCore/xml/XPathValue.h \
+ WebCore/xml/XPathVariableReference.cpp \
+ WebCore/xml/XPathVariableReference.h \
+ WebCore/xml/XSLImportRule.cpp \
+ WebCore/xml/XSLImportRule.h \
+ WebCore/xml/XSLStyleSheet.h \
+ WebCore/xml/XSLStyleSheetLibxslt.cpp \
+ WebCore/xml/XSLTExtensions.cpp \
+ WebCore/xml/XSLTExtensions.h \
+ WebCore/xml/XSLTProcessor.cpp \
+ WebCore/xml/XSLTProcessor.h \
+ WebCore/xml/XSLTProcessorLibxslt.cpp \
+ WebCore/xml/XSLTUnicodeSort.cpp \
+ WebCore/xml/XSLTUnicodeSort.h
webcoregtk_sources += \
WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp \
@@ -2464,26 +3349,41 @@ webcoregtk_sources += \
WebCore/page/gtk/EventHandlerGtk.cpp \
WebCore/page/gtk/FrameGtk.cpp \
WebCore/platform/graphics/cairo/CairoPath.h \
- WebCore/platform/graphics/cairo/FontCacheCairo.cpp \
WebCore/platform/graphics/cairo/FontCairo.cpp \
WebCore/platform/graphics/cairo/FontCustomPlatformData.h \
WebCore/platform/graphics/cairo/FontPlatformData.h \
- WebCore/platform/graphics/cairo/OwnPtrCairo.cpp \
- WebCore/platform/graphics/cairo/OwnPtrCairo.h \
WebCore/platform/graphics/cairo/GradientCairo.cpp \
WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp \
WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h \
WebCore/platform/graphics/cairo/ImageBufferCairo.cpp \
WebCore/platform/graphics/cairo/ImageBufferData.h \
WebCore/platform/graphics/cairo/ImageCairo.cpp \
+ WebCore/platform/graphics/cairo/OwnPtrCairo.cpp \
+ WebCore/platform/graphics/cairo/OwnPtrCairo.h \
WebCore/platform/graphics/cairo/PathCairo.cpp \
WebCore/platform/graphics/cairo/PatternCairo.cpp \
WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp \
WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h \
WebCore/platform/graphics/cairo/TransformationMatrixCairo.cpp \
- WebCore/platform/graphics/gtk/ColorGtk.cpp \
+ WebCore/platform/graphics/gstreamer/DataSourceGStreamer.cpp \
+ WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h \
+ WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.cpp \
+ WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.h \
+ WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp \
+ WebCore/platform/graphics/gstreamer/GStreamerGWorld.h \
+ WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp \
+ WebCore/platform/graphics/gstreamer/ImageGStreamer.h \
+ WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp \
+ WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h \
+ WebCore/platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp \
+ WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h \
+ WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp \
+ WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h \
+ WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp \
+ WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h \
WebCore/platform/graphics/gtk/CairoUtilities.cpp \
WebCore/platform/graphics/gtk/CairoUtilities.h \
+ WebCore/platform/graphics/gtk/ColorGtk.cpp \
WebCore/platform/graphics/gtk/FontGtk.cpp \
WebCore/platform/graphics/gtk/IconGtk.cpp \
WebCore/platform/graphics/gtk/ImageBufferGtk.cpp \
@@ -2505,6 +3405,8 @@ webcoregtk_sources += \
WebCore/platform/gtk/EventLoopGtk.cpp \
WebCore/platform/gtk/FileChooserGtk.cpp \
WebCore/platform/gtk/FileSystemGtk.cpp \
+ WebCore/platform/gtk/GeolocationServiceGtk.cpp \
+ WebCore/platform/gtk/GeolocationServiceGtk.h \
WebCore/platform/gtk/GOwnPtrGtk.cpp \
WebCore/platform/gtk/GOwnPtrGtk.h \
WebCore/platform/gtk/GRefPtrGtk.cpp \
@@ -2571,10 +3473,12 @@ webcoregtk_sources += \
WebCore/platform/network/soup/ResourceRequestSoup.cpp \
WebCore/platform/network/soup/ResourceResponse.h \
WebCore/platform/network/soup/ResourceResponseSoup.cpp \
+ WebCore/platform/network/soup/SocketStreamError.h \
+ WebCore/platform/network/soup/SocketStreamHandle.h \
+ WebCore/platform/network/soup/SocketStreamHandleSoup.cpp \
WebCore/plugins/gtk/PluginDataGtk.cpp \
WebCore/plugins/gtk/PluginPackageGtk.cpp \
- WebCore/plugins/gtk/PluginViewGtk.cpp \
- WebCore/workers/SharedWorkerRepository.h
+ WebCore/plugins/gtk/PluginViewGtk.cpp
if TARGET_X11
webcoregtk_sources += \
@@ -2620,10 +3524,7 @@ endif
# ---
if ENABLE_CHANNEL_MESSAGING
FEATURE_DEFINES += ENABLE_CHANNEL_MESSAGING=1
-
-webcore_cppflags += \
- -DENABLE_CHANNEL_MESSAGING=1
-
+webcore_cppflags += -DENABLE_CHANNEL_MESSAGING=1
endif # END ENABLE_CHANNEL_MESSAGING
# ---
@@ -2631,22 +3532,18 @@ endif # END ENABLE_CHANNEL_MESSAGING
# ---
if ENABLE_FAST_MOBILE_SCROLLING
FEATURE_DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1
-
-webcore_cppflags += \
- -DENABLE_FAST_MOBILE_SCROLLING=1
-
+webcore_cppflags += -DENABLE_FAST_MOBILE_SCROLLING=1
endif # END ENABLE_FAST_MOBILE_SCROLLING
# ---
-# Freetype font backend
+# FreeType font backend
# ---
if USE_FREETYPE
-webcoregtk_cppflags += \
- -DUSE_FREETYPE=1
-
+webcoregtk_cppflags += -DUSE_FREETYPE=1
webcoregtk_sources += \
+ WebCore/platform/graphics/cairo/FontCacheFreeType.cpp \
WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp \
- WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp \
+ WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp \
WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp \
WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp
endif # END USE_FREETYPE
@@ -2655,10 +3552,9 @@ endif # END USE_FREETYPE
# Pango font backend
# ---
if USE_PANGO
-webcoregtk_cppflags += \
- -DUSE_PANGO=1
-
+webcoregtk_cppflags += -DUSE_PANGO=1
webcoregtk_sources += \
+ WebCore/platform/graphics/gtk/FontCachePango.cpp \
WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp \
WebCore/platform/graphics/gtk/FontPlatformDataPango.cpp \
WebCore/platform/graphics/gtk/GlyphPageTreeNodePango.cpp \
@@ -2669,39 +3565,28 @@ endif # END USE_PANGO
# HTML Data Grid - disable for now.
# ----
FEATURE_DEFINES += ENABLE_DATAGRID=0
-
-webcore_cppflags += \
- -DENABLE_DATAGRID=0
+webcore_cppflags += -DENABLE_DATAGRID=0
# ----
# HTML Meter Element - disable for now.
# ----
FEATURE_DEFINES += ENABLE_METER_TAG=0
-
-webcore_cppflags += \
- -DENABLE_METER_TAG=0
+webcore_cppflags += -DENABLE_METER_TAG=0
# ----
# HTML Progress Element
# ----
FEATURE_DEFINES += ENABLE_PROGRESS_TAG=1
-
-webcore_cppflags += \
- -DENABLE_PROGRESS_TAG=1
+webcore_cppflags += -DENABLE_PROGRESS_TAG=1
# ----
# JavaScript Debugger/Profiler
# ----
if ENABLE_JAVASCRIPT_DEBUGGER
FEATURE_DEFINES += ENABLE_JAVASCRIPT_DEBUGGER=1
-
-webcore_cppflags += \
- -DENABLE_JAVASCRIPT_DEBUGGER=1
-
+webcore_cppflags += -DENABLE_JAVASCRIPT_DEBUGGER=1
else
-webcore_cppflags += \
- -DENABLE_JAVASCRIPT_DEBUGGER=0
-
+webcore_cppflags += -DENABLE_JAVASCRIPT_DEBUGGER=0
endif # END ENABLE_JAVASCRIPT_DEBUGGER
# ----
@@ -2709,31 +3594,10 @@ endif # END ENABLE_JAVASCRIPT_DEBUGGER
# ----
if ENABLE_OFFLINE_WEB_APPLICATIONS
FEATURE_DEFINES += ENABLE_OFFLINE_WEB_APPLICATIONS=1
-
-webcore_cppflags += \
- -DENABLE_OFFLINE_WEB_APPLICATIONS=1
-
+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 \
- WebCore/loader/appcache/ApplicationCache.h \
- WebCore/loader/appcache/ApplicationCacheGroup.cpp \
- WebCore/loader/appcache/ApplicationCacheGroup.h \
- WebCore/loader/appcache/ApplicationCacheHost.cpp \
- WebCore/loader/appcache/ApplicationCacheHost.h \
- WebCore/loader/appcache/ApplicationCacheResource.cpp \
- WebCore/loader/appcache/ApplicationCacheResource.h \
- WebCore/loader/appcache/ApplicationCacheStorage.cpp \
- WebCore/loader/appcache/ApplicationCacheStorage.h \
- WebCore/loader/appcache/DOMApplicationCache.cpp \
- WebCore/loader/appcache/DOMApplicationCache.h \
- WebCore/loader/appcache/ManifestParser.cpp \
- WebCore/loader/appcache/ManifestParser.h
-
endif # END ENABLE_OFFLINE_WEB_APPLICATIONS
# ----
@@ -2741,10 +3605,7 @@ endif # END ENABLE_OFFLINE_WEB_APPLICATIONS
# ----
if ENABLE_DATABASE
FEATURE_DEFINES += ENABLE_DATABASE=1
-
-webcore_cppflags += \
- -DENABLE_DATABASE=1
-
+webcore_cppflags += -DENABLE_DATABASE=1
webcore_built_sources += \
DerivedSources/WebCore/JSDatabase.cpp \
DerivedSources/WebCore/JSDatabase.h \
@@ -2774,73 +3635,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSSQLTransactionSync.h \
DerivedSources/WebCore/JSSQLTransactionSyncCallback.cpp \
DerivedSources/WebCore/JSSQLTransactionSyncCallback.h
-
-webcore_sources += \
- WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp \
- WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp \
- WebCore/bindings/js/JSSQLTransactionCustom.cpp \
- WebCore/bindings/js/JSSQLTransactionSyncCustom.cpp \
- WebCore/platform/sql/SQLValue.cpp \
- WebCore/platform/sql/SQLValue.h \
- WebCore/platform/sql/SQLiteAuthorizer.cpp \
- WebCore/platform/sql/SQLiteDatabase.cpp \
- WebCore/platform/sql/SQLiteDatabase.h \
- WebCore/platform/sql/SQLiteFileSystem.cpp \
- WebCore/platform/sql/SQLiteFileSystem.h \
- WebCore/platform/sql/SQLiteStatement.cpp \
- WebCore/platform/sql/SQLiteStatement.h \
- WebCore/platform/sql/SQLiteTransaction.cpp \
- WebCore/platform/sql/SQLiteTransaction.h \
- WebCore/storage/AbstractDatabase.cpp \
- WebCore/storage/AbstractDatabase.h \
- WebCore/storage/ChangeVersionWrapper.cpp \
- WebCore/storage/ChangeVersionWrapper.h \
- WebCore/storage/Database.cpp \
- WebCore/storage/Database.h \
- WebCore/storage/DatabaseAuthorizer.cpp \
- WebCore/storage/DatabaseAuthorizer.h \
- WebCore/storage/DatabaseCallback.h \
- WebCore/storage/DatabaseDetails.h \
- WebCore/storage/DatabaseSync.cpp \
- WebCore/storage/DatabaseSync.h \
- WebCore/storage/DatabaseTask.cpp \
- WebCore/storage/DatabaseTask.h \
- WebCore/storage/DatabaseThread.cpp \
- WebCore/storage/DatabaseThread.h \
- WebCore/storage/DatabaseTracker.cpp \
- WebCore/storage/DatabaseTracker.h \
- WebCore/storage/DatabaseTrackerClient.h \
- WebCore/storage/OriginQuotaManager.cpp \
- WebCore/storage/OriginQuotaManager.h \
- WebCore/storage/OriginUsageRecord.cpp \
- WebCore/storage/OriginUsageRecord.h \
- WebCore/storage/SQLError.h \
- WebCore/storage/SQLException.h \
- WebCore/storage/SQLResultSet.cpp \
- WebCore/storage/SQLResultSet.h \
- WebCore/storage/SQLResultSetRowList.cpp \
- WebCore/storage/SQLResultSetRowList.h \
- WebCore/storage/SQLStatement.cpp \
- 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 \
- WebCore/storage/SQLTransactionClient.cpp \
- WebCore/storage/SQLTransactionClient.h \
- WebCore/storage/SQLTransactionCoordinator.h \
- WebCore/storage/SQLTransactionCoordinator.cpp \
- WebCore/storage/SQLTransactionErrorCallback.h \
- WebCore/storage/SQLTransactionSync.cpp \
- WebCore/storage/SQLTransactionSync.h \
- WebCore/storage/SQLTransactionSyncCallback.h
-
else
webcore_cppflags += -DENABLE_DATABASE=0
-
endif # END ENABLE_DATABASE
# ----
@@ -2849,9 +3645,7 @@ endif # END ENABLE_DATABASE
if ENABLE_DATALIST
FEATURE_DEFINES += ENABLE_DATALIST=1
HTML_FEATURES += ENABLE_DATALIST=1
-
webcore_cppflags += -DENABLE_DATALIST=1
-
endif # END ENABLE_DATALIST
# ----
@@ -2859,13 +3653,9 @@ endif # END ENABLE_DATALIST
# ----
if !ENABLE_EVENTSOURCE
global_cppflags += -DENABLE_EVENTSOURCE=0
-endif
-
-if ENABLE_EVENTSOURCE
+else
FEATURE_DEFINES += ENABLE_EVENTSOURCE=1
-
-webcore_cppflags += \
- -DENABLE_EVENTSOURCE=1
+webcore_cppflags += -DENABLE_EVENTSOURCE=1
endif # ENABLE_EVENTSOURCE
# ----
@@ -2873,10 +3663,7 @@ endif # ENABLE_EVENTSOURCE
# ----
if ENABLE_INDEXED_DATABASE
FEATURE_DEFINES += ENABLE_INDEXED_DATABASE=1
-
-webcore_cppflags += \
- -DENABLE_INDEXED_DATABASE=1
-
+webcore_cppflags += -DENABLE_INDEXED_DATABASE=1
webcore_built_sources += \
DerivedSources/WebCore/JSIDBAny.cpp \
DerivedSources/WebCore/JSIDBAny.h \
@@ -2904,55 +3691,6 @@ webcore_built_sources += \
DerivedSources/WebCore/JSIDBSuccessEvent.h \
DerivedSources/WebCore/JSIDBTransaction.cpp \
DerivedSources/WebCore/JSIDBTransaction.h
-
-webcore_sources += \
- WebCore/storage/IDBAny.cpp \
- WebCore/storage/IDBAny.h \
- WebCore/storage/IDBCallbacks.h \
- WebCore/storage/IDBCursorBackendImpl.cpp \
- WebCore/storage/IDBCursorBackendImpl.h \
- WebCore/storage/IDBCursorBackendInterface.h \
- WebCore/storage/IDBCursor.cpp \
- WebCore/storage/IDBCursor.h \
- WebCore/storage/IDBDatabaseBackendImpl.cpp \
- WebCore/storage/IDBDatabaseBackendImpl.h \
- WebCore/storage/IDBDatabaseBackendInterface.h \
- WebCore/storage/IDBDatabase.cpp \
- WebCore/storage/IDBDatabaseError.h \
- WebCore/storage/IDBDatabaseException.h \
- WebCore/storage/IDBDatabase.h \
- WebCore/storage/IDBErrorEvent.cpp \
- WebCore/storage/IDBErrorEvent.h \
- WebCore/storage/IDBEvent.cpp \
- WebCore/storage/IDBEvent.h \
- WebCore/storage/IDBFactoryBackendImpl.cpp \
- WebCore/storage/IDBFactoryBackendImpl.h
- WebCore/storage/IDBFactoryBackendInterface.cpp \
- WebCore/storage/IDBFactoryBackendInterface.h \
- WebCore/storage/IDBFactory.cpp \
- WebCore/storage/IDBFactory.h \
- WebCore/storage/IDBIndexBackendImpl.cpp \
- WebCore/storage/IDBIndexBackendImpl.h \
- WebCore/storage/IDBIndexBackendInterface.h \
- WebCore/storage/IDBIndexBackendInterface.h \
- WebCore/storage/IDBIndex.cpp \
- WebCore/storage/IDBIndex.h \
- WebCore/storage/IDBKey.h \
- WebCore/storage/IDBKeyRange.cpp \
- WebCore/storage/IDBKeyRange.h \
- WebCore/storage/IDBObjectStoreBackendImpl.cpp \
- WebCore/storage/IDBObjectStoreBackendImpl.h \
- WebCore/storage/IDBObjectStoreBackendInterface.h \
- WebCore/storage/IDBObjectStoreBackendInterface.h \
- WebCore/storage/IDBObjectStore.cpp \
- WebCore/storage/IDBObjectStore.h \
- WebCore/storage/IDBRequest.cpp \
- WebCore/storage/IDBRequest.h \
- WebCore/storage/IDBSuccessEvent.cpp \
- WebCore/storage/IDBSuccessEvent.h \
- WebCore/storage/IDBTransactionBackendInterface.h \
- WebCore/storage/IDBTransaction.cpp \
- WebCore/storage/IDBTransaction.h
endif # END ENABLE_INDEXED_DATABASE
# ----
@@ -2961,11 +3699,8 @@ endif # END ENABLE_INDEXED_DATABASE
if ENABLE_DIRECTORY_UPLOAD
FEATURE_DEFINES += ENABLE_DIRECTORY_UPLOAD=1
webcore_cppflags += -DENABLE_DIRECTORY_UPLOAD=1
-
else
-
webcore_cppflags += -DENABLE_DIRECTORY_UPLOAD=0
-
endif # END ENABLE_DIRECTORY_UPLOAD
# ----
@@ -2973,129 +3708,63 @@ endif # END ENABLE_DIRECTORY_UPLOAD
# ----
if ENABLE_DOM_STORAGE
FEATURE_DEFINES += ENABLE_DOM_STORAGE=1
-
-webcore_cppflags += \
- -DENABLE_DOM_STORAGE=1
-
+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 \
- WebCore/storage/LocalStorageTask.h \
- WebCore/storage/LocalStorageThread.cpp \
- WebCore/storage/LocalStorageThread.h \
- WebCore/storage/Storage.cpp \
- WebCore/storage/Storage.h \
- WebCore/storage/StorageArea.h \
- WebCore/storage/StorageAreaImpl.cpp \
- WebCore/storage/StorageAreaImpl.h \
- WebCore/storage/StorageAreaSync.cpp \
- WebCore/storage/StorageAreaSync.h \
- WebCore/storage/StorageEvent.cpp \
- WebCore/storage/StorageEventDispatcher.h \
- WebCore/storage/StorageEventDispatcher.cpp \
- WebCore/storage/StorageEvent.h \
- WebCore/storage/StorageMap.cpp \
- WebCore/storage/StorageMap.h \
- WebCore/storage/StorageNamespace.cpp \
- WebCore/storage/StorageNamespace.h \
- WebCore/storage/StorageNamespaceImpl.cpp \
- WebCore/storage/StorageNamespaceImpl.h \
- WebCore/storage/StorageSyncManager.cpp \
- WebCore/storage/StorageSyncManager.h
endif # END ENABLE_DOM_STORAGE
# ----
# FileSystem API support
# ----
if ENABLE_FILE_SYSTEM
-
FEATURE_DEFINES += ENABLE_FILE_SYSTEM=1
webcore_cppflags += -DENABLE_FILE_SYSTEM=1
-
webcore_built_sources += \
- DerivedSources/WebCore/JSDirectoryEntry.cpp \
- DerivedSources/WebCore/JSDirectoryEntry.h \
- DerivedSources/WebCore/JSDirectoryReader.cpp \
- DerivedSources/WebCore/JSDirectoryReader.h \
- DerivedSources/WebCore/JSDOMFileSystem.cpp \
- DerivedSources/WebCore/JSDOMFileSystem.h \
- DerivedSources/WebCore/JSEntriesCallback.cpp \
- DerivedSources/WebCore/JSEntriesCallback.h \
- DerivedSources/WebCore/JSEntry.cpp \
- DerivedSources/WebCore/JSEntry.h \
- DerivedSources/WebCore/JSEntryArray.cpp \
- DerivedSources/WebCore/JSEntryArray.h \
- DerivedSources/WebCore/JSEntryCallback.cpp \
- DerivedSources/WebCore/JSEntryCallback.h \
- DerivedSources/WebCore/JSErrorCallback.cpp \
- DerivedSources/WebCore/JSErrorCallback.h \
- DerivedSources/WebCore/JSFileCallback.cpp \
- DerivedSources/WebCore/JSFileCallback.h \
- DerivedSources/WebCore/JSFileEntry.cpp \
- DerivedSources/WebCore/JSFileEntry.h \
- DerivedSources/WebCore/JSFileSystemCallback.cpp \
- DerivedSources/WebCore/JSFileSystemCallback.h \
- DerivedSources/WebCore/JSFlags.cpp \
- DerivedSources/WebCore/JSFlags.h \
- DerivedSources/WebCore/JSMetadata.cpp \
- DerivedSources/WebCore/JSMetadata.h \
- DerivedSources/WebCore/JSMetadataCallback.cpp \
- DerivedSources/WebCore/JSMetadataCallback.h
-
-webcore_sources += \
- WebCore/fileapi/DirectoryEntry.cpp \
- WebCore/fileapi/DirectoryEntry.h \
- WebCore/fileapi/DirectoryReader.cpp \
- WebCore/fileapi/DirectoryReader.h \
- WebCore/fileapi/DOMFilePath.cpp \
- WebCore/fileapi/DOMFilePath.h \
- WebCore/fileapi/DOMFileSystem.cpp \
- WebCore/fileapi/DOMFileSystem.h \
- WebCore/fileapi/EntriesCallback.h \
- WebCore/fileapi/Entry.cpp \
- WebCore/fileapi/Entry.h \
- WebCore/fileapi/EntryArray.cpp \
- WebCore/fileapi/EntryArray.h \
- WebCore/fileapi/EntryCallback.h \
- WebCore/fileapi/ErrorCallback.h \
- WebCore/fileapi/FileCallback.h \
- WebCore/fileapi/FileEntry.cpp \
- WebCore/fileapi/FileEntry.h \
- WebCore/fileapi/FileSystemCallback.h \
- WebCore/fileapi/FileSystemCallbacks.cpp \
- WebCore/fileapi/FileSystemCallbacks.h \
- WebCore/fileapi/Flags.h \
- WebCore/fileapi/LocalFileSystem.cpp \
- WebCore/fileapi/LocalFileSystem.h \
- WebCore/fileapi/Metadata.h \
- WebCore/fileapi/MetadataCallback.h
-
+ DerivedSources/WebCore/JSDirectoryEntry.cpp \
+ DerivedSources/WebCore/JSDirectoryEntry.h \
+ DerivedSources/WebCore/JSDirectoryReader.cpp \
+ DerivedSources/WebCore/JSDirectoryReader.h \
+ DerivedSources/WebCore/JSDOMFileSystem.cpp \
+ DerivedSources/WebCore/JSDOMFileSystem.h \
+ DerivedSources/WebCore/JSEntriesCallback.cpp \
+ DerivedSources/WebCore/JSEntriesCallback.h \
+ DerivedSources/WebCore/JSEntry.cpp \
+ DerivedSources/WebCore/JSEntry.h \
+ DerivedSources/WebCore/JSEntryArray.cpp \
+ DerivedSources/WebCore/JSEntryArray.h \
+ DerivedSources/WebCore/JSEntryCallback.cpp \
+ DerivedSources/WebCore/JSEntryCallback.h \
+ DerivedSources/WebCore/JSErrorCallback.cpp \
+ DerivedSources/WebCore/JSErrorCallback.h \
+ DerivedSources/WebCore/JSFileCallback.cpp \
+ DerivedSources/WebCore/JSFileCallback.h \
+ DerivedSources/WebCore/JSFileEntry.cpp \
+ DerivedSources/WebCore/JSFileEntry.h \
+ DerivedSources/WebCore/JSFileSystemCallback.cpp \
+ DerivedSources/WebCore/JSFileSystemCallback.h \
+ DerivedSources/WebCore/JSFileWriter.cpp \
+ DerivedSources/WebCore/JSFileWriter.h \
+ DerivedSources/WebCore/JSFileWriterCallback.cpp \
+ DerivedSources/WebCore/JSFileWriterCallback.h \
+ DerivedSources/WebCore/JSFlags.cpp \
+ DerivedSources/WebCore/JSFlags.h \
+ DerivedSources/WebCore/JSMetadata.cpp \
+ DerivedSources/WebCore/JSMetadata.h \
+ DerivedSources/WebCore/JSMetadataCallback.cpp \
+ DerivedSources/WebCore/JSMetadataCallback.h
endif # END ENABLE_FILE_SYSTEM
# ----
# Speech Input API support
# ----
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/SpeechInputListener.h
-
else
-
webcore_cppflags += -DENABLE_INPUT_SPEECH=0
-
endif # END ENABLE_INPUT_SPEECH
# ----
@@ -3103,22 +3772,8 @@ endif # END ENABLE_INPUT_SPEECH
# ----
if ENABLE_ICONDATABASE
webcore_cppflags += -DENABLE_ICONDATABASE=1
-
-webcore_sources += \
- WebCore/loader/icon/IconDatabase.cpp \
- WebCore/loader/icon/IconDatabase.h \
- WebCore/loader/icon/IconDatabaseClient.h \
- WebCore/loader/icon/IconRecord.cpp \
- WebCore/loader/icon/IconRecord.h \
- WebCore/loader/icon/PageURLRecord.cpp \
- WebCore/loader/icon/PageURLRecord.h
-
else
-webcore_sources += \
- WebCore/loader/icon/IconDatabaseNone.cpp
-
webcore_cppflags += -DENABLE_ICONDATABASE=0
-
endif # END ENABLE_ICONDATABASE
# ----
@@ -3126,23 +3781,17 @@ endif # END ENABLE_ICONDATABASE
# ----
if ENABLE_IMAGE_RESIZER
FEATURE_DEFINES += ENABLE_IMAGE_RESIZER=1
-
webcore_cppflags += -DENABLE_IMAGE_RESIZER=1
-
else
webcore_cppflags += -DENABLE_IMAGE_RESIZER=0
-
endif # END ENABLE_IMAGE_RESIZER
# ----
# Orientation Events
# ----
if ENABLE_ORIENTATION_EVENTS
-
FEATURE_DEFINES += ENABLE_ORIENTATION_EVENTS=1
-
webcore_cppflags += -DENABLE_ORIENTATION_EVENTS=1
-
endif # END ENABLE_ORIENTATION_EVENTS
# ----
@@ -3150,59 +3799,17 @@ endif # END ENABLE_ORIENTATION_EVENTS
# ----
if ENABLE_VIDEO
FEATURE_DEFINES += ENABLE_VIDEO=1
-
HTML_FEATURES += ENABLE_VIDEO=1
webcore_cppflags += -DENABLE_VIDEO=1
if ENABLE_DEBUG
webcore_cppflags += -DGST_DISABLE_DEPRECATED
endif # END ENABLE_DEBUG
-
-webcore_sources += \
- WebCore/bindings/js/JSAudioConstructor.cpp \
- WebCore/bindings/js/JSAudioConstructor.h \
- WebCore/html/HTMLAudioElement.cpp \
- WebCore/html/HTMLAudioElement.h \
- WebCore/html/HTMLMediaElement.cpp \
- WebCore/html/HTMLMediaElement.h \
- WebCore/html/HTMLSourceElement.cpp \
- WebCore/html/HTMLSourceElement.h \
- WebCore/html/HTMLVideoElement.cpp \
- WebCore/html/HTMLVideoElement.h \
- WebCore/html/TimeRanges.cpp \
- WebCore/html/TimeRanges.h \
- WebCore/platform/graphics/MediaPlayer.cpp \
- WebCore/platform/graphics/MediaPlayerPrivate.h \
- WebCore/rendering/MediaControlElements.cpp \
- WebCore/rendering/RenderMedia.cpp \
- WebCore/rendering/RenderMedia.h \
- WebCore/rendering/RenderVideo.cpp \
- WebCore/rendering/RenderVideo.h
-
-webcoregtk_sources += \
- WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp \
- WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h \
- WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp \
- WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h \
- WebCore/platform/graphics/gstreamer/DataSourceGStreamer.cpp \
- WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h \
- WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.cpp \
- WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.h \
- WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp \
- WebCore/platform/graphics/gstreamer/GStreamerGWorld.h \
- WebCore/platform/graphics/gstreamer/ImageGStreamer.h \
- WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp \
- WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h \
- WebCore/platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp \
- WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp \
- WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h
-
webcore_libadd += \
-lgstinterfaces-0.10 \
-lgstvideo-0.10 \
-lgstpbutils-0.10 \
-lgstapp-0.10
-
endif # END ENABLE_VIDEO
# ----
@@ -3210,32 +3817,23 @@ endif # END ENABLE_VIDEO
# ----
if ENABLE_XHTMLMP
FEATURE_DEFINES += ENABLE_XHTMLMP=1
-
webcore_cppflags += -DENABLE_XHTMLMP=1
-
-webcore_sources += \
- WebCore/html/HTMLNoScriptElement.cpp \
- WebCore/html/HTMLNoScriptElement.h
endif # END ENABLE_XHTMLMP
# ----
# Sandboxed IFrame Support
# ----
if ENABLE_SANDBOX
-
HTML_FEATURES += ENABLE_SANDBOX=1
webcore_cppflags += -DENABLE_SANDBOX=1
-
endif # END ENABLE_SANDBOX
# ----
# Ruby Support
# ----
if ENABLE_RUBY
-
HTML_FEATURES += ENABLE_RUBY=1
webcore_cppflags += -DENABLE_RUBY=1
-
endif # END ENABLE_RUBY
# ----
@@ -3243,9 +3841,7 @@ endif # END ENABLE_RUBY
# ----
if ENABLE_XPATH
FEATURE_DEFINES += ENABLE_XPATH=1
-
webcore_cppflags += -DENABLE_XPATH=1
-
webcore_built_sources += \
DerivedSources/WebCore/JSXPathEvaluator.cpp \
DerivedSources/WebCore/JSXPathEvaluator.h \
@@ -3260,42 +3856,7 @@ webcore_built_sources += \
DerivedSources/WebCore/XPathGrammar.cpp \
DerivedSources/WebCore/XPathGrammar.h
-webcore_sources += \
- WebCore/xml/NativeXPathNSResolver.cpp \
- WebCore/xml/NativeXPathNSResolver.h \
- WebCore/xml/XPathEvaluator.cpp \
- WebCore/xml/XPathEvaluator.h \
- WebCore/xml/XPathException.h \
- WebCore/xml/XPathExpression.cpp \
- WebCore/xml/XPathExpression.h \
- WebCore/xml/XPathExpressionNode.cpp \
- WebCore/xml/XPathExpressionNode.h \
- WebCore/xml/XPathFunctions.cpp \
- WebCore/xml/XPathFunctions.h \
- WebCore/xml/XPathNSResolver.cpp \
- WebCore/xml/XPathNSResolver.h \
- WebCore/xml/XPathNamespace.cpp \
- WebCore/xml/XPathNamespace.h \
- WebCore/xml/XPathNodeSet.cpp \
- WebCore/xml/XPathNodeSet.h \
- WebCore/xml/XPathParser.cpp \
- WebCore/xml/XPathParser.h \
- WebCore/xml/XPathPath.cpp \
- WebCore/xml/XPathPath.h \
- WebCore/xml/XPathPredicate.cpp \
- WebCore/xml/XPathPredicate.h \
- WebCore/xml/XPathResult.cpp \
- WebCore/xml/XPathResult.h \
- WebCore/xml/XPathStep.cpp \
- WebCore/xml/XPathStep.h \
- WebCore/xml/XPathUtil.cpp \
- WebCore/xml/XPathUtil.h \
- WebCore/xml/XPathValue.cpp \
- WebCore/xml/XPathValue.h \
- WebCore/xml/XPathVariableReference.cpp \
- WebCore/xml/XPathVariableReference.h
# XPath grammar
-
$(GENSOURCES_WEBCORE)/XPathGrammar.h: $(GENSOURCES_WEBCORE)/XPathGrammar.cpp;
# NOTE: older versions of bison do not inject an inclusion guard, so we do it
@@ -3308,7 +3869,6 @@ $(GENSOURCES_WEBCORE)/XPathGrammar.cpp: $(WebCore)/xml/XPathGrammar.y
cat $(GENSOURCES_WEBCORE)/XPathGrammar.cpp.h $(GENSOURCES_WEBCORE)/XPathGrammar.hpp >> $(GENSOURCES_WEBCORE)/XPathGrammar.h
echo '#endif' >> $(GENSOURCES_WEBCORE)/XPathGrammar.h
rm -f $(GENSOURCES_WEBCORE)/XPathGrammar.cpp.h $(GENSOURCES_WEBCORE)/XPathGrammar.hpp
-
endif # END ENABLE_XPATH
# ----
@@ -3316,23 +3876,7 @@ endif # END ENABLE_XPATH
# ----
if ENABLE_XSLT
FEATURE_DEFINES += ENABLE_XSLT=1
-
webcore_cppflags += -DENABLE_XSLT=1
-
-webcore_sources += \
- WebCore/dom/TransformSourceLibxslt.cpp \
- WebCore/dom/TransformSource.h \
- WebCore/xml/XSLImportRule.cpp \
- WebCore/xml/XSLImportRule.h \
- WebCore/xml/XSLStyleSheetLibxslt.cpp \
- WebCore/xml/XSLStyleSheet.h \
- WebCore/xml/XSLTExtensions.cpp \
- WebCore/xml/XSLTExtensions.h \
- WebCore/xml/XSLTProcessor.cpp \
- WebCore/xml/XSLTProcessorLibxslt.cpp \
- WebCore/xml/XSLTProcessor.h \
- WebCore/xml/XSLTUnicodeSort.cpp \
- WebCore/xml/XSLTUnicodeSort.h
endif # END ENABLE_XSLT
# ----
@@ -3340,45 +3884,7 @@ endif # END ENABLE_XSLT
# ----
if ENABLE_WORKERS
FEATURE_DEFINES += ENABLE_WORKERS=1
-
-webcore_cppflags += \
- -DENABLE_WORKERS=1
-
-webcore_sources += \
- WebCore/bindings/js/JSDedicatedWorkerContextCustom.cpp \
- WebCore/bindings/js/JSWorkerContextBase.cpp \
- WebCore/bindings/js/JSWorkerContextBase.h \
- WebCore/bindings/js/JSWorkerContextCustom.cpp \
- WebCore/bindings/js/JSWorkerCustom.cpp \
- WebCore/bindings/js/WorkerScriptController.cpp \
- WebCore/bindings/js/WorkerScriptController.h \
- WebCore/page/WorkerNavigator.cpp \
- WebCore/page/WorkerNavigator.h \
- WebCore/workers/AbstractWorker.cpp \
- WebCore/workers/AbstractWorker.h \
- WebCore/workers/DedicatedWorkerContext.cpp \
- WebCore/workers/DedicatedWorkerContext.h \
- WebCore/workers/DedicatedWorkerThread.cpp \
- WebCore/workers/DedicatedWorkerThread.h \
- WebCore/workers/Worker.cpp \
- WebCore/workers/Worker.h \
- WebCore/workers/WorkerContext.cpp \
- WebCore/workers/WorkerContext.h \
- WebCore/workers/WorkerContextProxy.h \
- WebCore/workers/WorkerLoaderProxy.h \
- WebCore/workers/WorkerLocation.cpp \
- WebCore/workers/WorkerLocation.h \
- WebCore/workers/WorkerMessagingProxy.cpp \
- WebCore/workers/WorkerMessagingProxy.h \
- WebCore/workers/WorkerObjectProxy.h \
- WebCore/workers/WorkerReportingProxy.h \
- WebCore/workers/WorkerRunLoop.cpp \
- WebCore/workers/WorkerRunLoop.h \
- WebCore/workers/WorkerScriptLoader.cpp \
- WebCore/workers/WorkerScriptLoader.h \
- WebCore/workers/WorkerScriptLoaderClient.h \
- WebCore/workers/WorkerThread.cpp \
- WebCore/workers/WorkerThread.h
+webcore_cppflags += -DENABLE_WORKERS=1
endif
# ---
@@ -3386,21 +3892,7 @@ endif
# ---
if ENABLE_SHARED_WORKERS
FEATURE_DEFINES += ENABLE_SHARED_WORKERS=1
-
-webcore_cppflags += \
- -DENABLE_SHARED_WORKERS=1
-
-webcore_sources += \
- WebCore/bindings/js/JSSharedWorkerCustom.cpp \
- WebCore/workers/DefaultSharedWorkerRepository.cpp \
- WebCore/workers/DefaultSharedWorkerRepository.h \
- WebCore/workers/SharedWorker.cpp \
- WebCore/workers/SharedWorker.h \
- WebCore/workers/SharedWorkerContext.cpp \
- WebCore/workers/SharedWorkerContext.h \
- WebCore/workers/SharedWorkerThread.cpp \
- WebCore/workers/SharedWorkerThread.h
-
+webcore_cppflags += -DENABLE_SHARED_WORKERS=1
endif
# ----
@@ -3408,56 +3900,13 @@ endif
# ----
if ENABLE_WML
FEATURE_DEFINES += ENABLE_WML=1
-
+webcore_cppflags += -DENABLE_WML=1
webcore_built_sources += \
DerivedSources/WebCore/WMLElementFactory.cpp \
DerivedSources/WebCore/WMLNames.cpp
-webcore_cppflags += \
- -DENABLE_WML=1
-
-webcore_sources += \
- WebCore/wml/WMLAElement.cpp \
- WebCore/wml/WMLAccessElement.cpp \
- WebCore/wml/WMLAnchorElement.cpp \
- WebCore/wml/WMLBRElement.cpp \
- WebCore/wml/WMLCardElement.cpp \
- WebCore/wml/WMLDoElement.cpp \
- WebCore/wml/WMLDocument.cpp \
- WebCore/wml/WMLElement.cpp \
- WebCore/wml/WMLErrorHandling.cpp \
- WebCore/wml/WMLEventHandlingElement.cpp \
- WebCore/wml/WMLFieldSetElement.cpp \
- WebCore/wml/WMLFormControlElement.cpp \
- WebCore/wml/WMLGoElement.cpp \
- WebCore/wml/WMLImageElement.cpp \
- WebCore/wml/WMLImageLoader.cpp \
- WebCore/wml/WMLInputElement.cpp \
- WebCore/wml/WMLInsertedLegendElement.cpp \
- WebCore/wml/WMLIntrinsicEvent.cpp \
- WebCore/wml/WMLIntrinsicEventHandler.cpp \
- WebCore/wml/WMLMetaElement.cpp \
- WebCore/wml/WMLNoopElement.cpp \
- WebCore/wml/WMLOnEventElement.cpp \
- WebCore/wml/WMLPElement.cpp \
- WebCore/wml/WMLOptGroupElement.cpp \
- WebCore/wml/WMLOptionElement.cpp \
- WebCore/wml/WMLPageState.cpp \
- WebCore/wml/WMLPostfieldElement.cpp \
- WebCore/wml/WMLPrevElement.cpp \
- WebCore/wml/WMLRefreshElement.cpp \
- WebCore/wml/WMLSelectElement.cpp \
- WebCore/wml/WMLSetvarElement.cpp \
- WebCore/wml/WMLTableElement.cpp \
- WebCore/wml/WMLTaskElement.cpp \
- WebCore/wml/WMLTemplateElement.cpp \
- WebCore/wml/WMLTimerElement.cpp \
- WebCore/wml/WMLVariables.cpp
-
# WML tag and attribute names
-DerivedSources/WebCore/WMLNames.cpp: DerivedSources/WebCore/WMLElementFactory.cpp;
-
-DerivedSources/WebCore/WMLElementFactory.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/wml/WMLTagNames.in $(WebCore)/wml/WMLAttributeNames.in
+DerivedSources/WebCore/WMLNames.cpp DerivedSources/WebCore/WMLElementFactory.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/wml/WMLTagNames.in $(WebCore)/wml/WMLAttributeNames.in
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/wml/WMLTagNames.in --attrs $(WebCore)/wml/WMLAttributeNames.in --factory --wrapperFactory --outputDir "$(GENSOURCES_WEBCORE)"
endif # END ENABLE_WML
@@ -3465,31 +3914,8 @@ endif # END ENABLE_WML
# Filters
# ----
if ENABLE_FILTERS
-
FEATURE_DEFINES += ENABLE_FILTERS=1
webcore_cppflags += -DENABLE_FILTERS=1
-
-webcore_sources += \
- WebCore/platform/graphics/filters/FEBlend.cpp \
- WebCore/platform/graphics/filters/FEBlend.h \
- WebCore/platform/graphics/filters/FEColorMatrix.cpp \
- WebCore/platform/graphics/filters/FEColorMatrix.h \
- WebCore/platform/graphics/filters/FEComponentTransfer.cpp \
- WebCore/platform/graphics/filters/FEComponentTransfer.h \
- WebCore/platform/graphics/filters/FEComposite.cpp \
- WebCore/platform/graphics/filters/FEComposite.h \
- WebCore/platform/graphics/filters/FEGaussianBlur.cpp \
- WebCore/platform/graphics/filters/FEGaussianBlur.h \
- WebCore/platform/graphics/filters/Filter.h \
- WebCore/platform/graphics/filters/FilterEffect.cpp \
- WebCore/platform/graphics/filters/FilterEffect.h \
- WebCore/platform/graphics/filters/ImageBufferFilter.cpp \
- WebCore/platform/graphics/filters/ImageBufferFilter.h \
- WebCore/platform/graphics/filters/SourceAlpha.cpp \
- WebCore/platform/graphics/filters/SourceAlpha.h \
- WebCore/platform/graphics/filters/SourceGraphic.cpp \
- WebCore/platform/graphics/filters/SourceGraphic.h
-
if ENABLE_SVG
SVG_FEATURES += ENABLE_FILTERS=1
endif
@@ -3502,67 +3928,20 @@ endif # END ENABLE_FILTERS
if ENABLE_GEOLOCATION
FEATURE_DEFINES += ENABLE_GEOLOCATION=1
-webcore_cppflags += \
- -DENABLE_GEOLOCATION=1
-
-webcoregtk_sources += \
- WebCore/platform/gtk/GeolocationServiceGtk.cpp \
- WebCore/platform/gtk/GeolocationServiceGtk.h
+webcore_cppflags += -DENABLE_GEOLOCATION=1
endif # END ENABLE_GEOLOCATION
# ----
# MathML support
# ----
if ENABLE_MATHML
-
FEATURE_DEFINES += ENABLE_MATHML=1
-
-webcore_cppflags += \
- -DENABLE_MATHML=1
-
-webcore_sources += \
- WebCore/mathml/MathMLElement.cpp \
- WebCore/mathml/MathMLElement.h \
- WebCore/mathml/MathMLInlineContainerElement.cpp \
- WebCore/mathml/MathMLInlineContainerElement.h \
- WebCore/mathml/MathMLMathElement.cpp \
- WebCore/mathml/MathMLMathElement.h \
- WebCore/mathml/MathMLTextElement.cpp \
- WebCore/mathml/MathMLTextElement.h \
- WebCore/mathml/RenderMathMLBlock.cpp \
- WebCore/mathml/RenderMathMLBlock.h \
- WebCore/mathml/RenderMathMLFenced.cpp \
- WebCore/mathml/RenderMathMLFenced.h \
- WebCore/mathml/RenderMathMLFraction.cpp \
- WebCore/mathml/RenderMathMLFraction.h \
- WebCore/mathml/RenderMathMLMath.cpp \
- WebCore/mathml/RenderMathMLMath.h \
- WebCore/mathml/RenderMathMLOperator.cpp \
- WebCore/mathml/RenderMathMLOperator.h \
- WebCore/mathml/RenderMathMLRoot.cpp \
- WebCore/mathml/RenderMathMLRoot.h \
- WebCore/mathml/RenderMathMLRow.cpp \
- WebCore/mathml/RenderMathMLRow.h \
- WebCore/mathml/RenderMathMLSquareRoot.cpp \
- WebCore/mathml/RenderMathMLSquareRoot.h \
- WebCore/mathml/RenderMathMLSubSup.cpp \
- WebCore/mathml/RenderMathMLSubSup.h \
- WebCore/mathml/RenderMathMLUnderOver.cpp \
- WebCore/mathml/RenderMathMLUnderOver.h
-
+webcore_cppflags += -DENABLE_MATHML=1
endif # END ENABLE_MATHML
-webcore_built_sources += \
- DerivedSources/WebCore/MathMLElementFactory.cpp \
- DerivedSources/WebCore/MathMLElementFactory.h \
- DerivedSources/WebCore/MathMLNames.cpp \
- DerivedSources/WebCore/MathMLNames.h
-
# MathML tag and attribute names, and element factory
DerivedSources/WebCore/MathMLElementFactory.h: DerivedSources/WebCore/MathMLElementFactory.cpp
-
DerivedSources/WebCore/MathMLNames.h: DerivedSources/WebCore/MathMLNames.cpp
-
DerivedSources/WebCore/MathMLElementFactory.cpp DerivedSources/WebCore/MathMLNames.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/mathml/mathtags.in $(WebCore)/mathml/mathattrs.in
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/mathml/mathtags.in --attrs $(WebCore)/mathml/mathattrs.in --factory --wrapperFactory --outputDir "$(GENSOURCES_WEBCORE)"
@@ -3571,18 +3950,7 @@ DerivedSources/WebCore/MathMLElementFactory.cpp DerivedSources/WebCore/MathMLNam
# ----
if ENABLE_NOTIFICATIONS
FEATURE_DEFINES += ENABLE_NOTIFICATIONS=1
-
-webcore_cppflags += \
- -DENABLE_NOTIFICATIONS=1
-
-webcore_sources += \
- WebCore/notifications/Notification.cpp \
- WebCore/notifications/Notification.h \
- WebCore/notifications/NotificationCenter.cpp \
- WebCore/notifications/NotificationCenter.h \
- WebCore/notifications/NotificationPresenter.h \
- WebCore/notifications/NotificationContents.h
-
+webcore_cppflags += -DENABLE_NOTIFICATIONS=1
endif # END ENABLE_NOTIFICATIONS
# ----
@@ -3592,13 +3960,9 @@ endif # END ENABLE_NOTIFICATIONS
# ----
if ENABLE_SVG
FEATURE_DEFINES += ENABLE_SVG=1
-
+webcore_cppflags += -DENABLE_SVG=1
WEBCORE_CSS_PROPERTY_NAMES += $(WebCore)/css/SVGCSSPropertyNames.in
WEBCORE_CSS_VALUE_KEYWORDS += $(WebCore)/css/SVGCSSValueKeywords.in
-
-webcore_cppflags += \
- -DENABLE_SVG=1
-
webcore_built_sources += \
DerivedSources/WebCore/JSElementTimeControl.h \
DerivedSources/WebCore/JSSVGAElement.cpp \
@@ -3885,463 +4249,6 @@ webcore_built_sources += \
DerivedSources/WebCore/JSSVGZoomEvent.cpp \
DerivedSources/WebCore/JSSVGZoomEvent.h
-webcore_sources += \
- WebCore/bindings/js/JSSVGContextCache.h \
- WebCore/bindings/js/JSSVGElementInstanceCustom.cpp \
- WebCore/bindings/js/JSSVGLengthCustom.cpp \
- WebCore/bindings/js/JSSVGMatrixCustom.cpp \
- WebCore/bindings/js/JSSVGPODListCustom.h \
- WebCore/bindings/js/JSSVGPODTypeWrapper.h \
- WebCore/bindings/js/JSSVGPathSegCustom.cpp \
- WebCore/bindings/js/JSSVGPathSegListCustom.cpp \
- WebCore/css/SVGCSSComputedStyleDeclaration.cpp \
- WebCore/css/SVGCSSParser.cpp \
- WebCore/css/SVGCSSStyleSelector.cpp \
- WebCore/rendering/PointerEventsHitRules.cpp \
- WebCore/rendering/PointerEventsHitRules.h \
- WebCore/rendering/RenderForeignObject.cpp \
- WebCore/rendering/RenderForeignObject.h \
- WebCore/rendering/RenderPath.cpp \
- WebCore/rendering/RenderPath.h \
- WebCore/rendering/RenderSVGBlock.cpp \
- WebCore/rendering/RenderSVGBlock.h \
- WebCore/rendering/RenderSVGContainer.cpp \
- WebCore/rendering/RenderSVGContainer.h \
- WebCore/rendering/RenderSVGGradientStop.cpp \
- WebCore/rendering/RenderSVGGradientStop.h \
- WebCore/rendering/RenderSVGHiddenContainer.cpp \
- WebCore/rendering/RenderSVGHiddenContainer.h \
- WebCore/rendering/RenderSVGImage.cpp \
- WebCore/rendering/RenderSVGImage.h \
- WebCore/rendering/RenderSVGInline.cpp \
- WebCore/rendering/RenderSVGInline.h \
- WebCore/rendering/RenderSVGInlineText.cpp \
- WebCore/rendering/RenderSVGInlineText.h \
- WebCore/rendering/RenderSVGModelObject.cpp \
- WebCore/rendering/RenderSVGModelObject.h \
- WebCore/rendering/RenderSVGResource.cpp \
- WebCore/rendering/RenderSVGResource.h \
- WebCore/rendering/RenderSVGResourceClipper.cpp \
- WebCore/rendering/RenderSVGResourceClipper.h \
- WebCore/rendering/RenderSVGResourceFilter.cpp \
- WebCore/rendering/RenderSVGResourceFilter.h \
- WebCore/rendering/RenderSVGResourceFilterPrimitive.cpp \
- WebCore/rendering/RenderSVGResourceFilterPrimitive.h \
- WebCore/rendering/RenderSVGResourceGradient.cpp \
- WebCore/rendering/RenderSVGResourceGradient.h \
- WebCore/rendering/RenderSVGResourceLinearGradient.cpp \
- WebCore/rendering/RenderSVGResourceLinearGradient.h \
- WebCore/rendering/RenderSVGResourceMarker.cpp \
- WebCore/rendering/RenderSVGResourceMarker.h \
- WebCore/rendering/RenderSVGResourceMasker.cpp \
- WebCore/rendering/RenderSVGResourceMasker.h \
- WebCore/rendering/RenderSVGResourcePattern.cpp \
- WebCore/rendering/RenderSVGResourcePattern.h \
- WebCore/rendering/RenderSVGResourceRadialGradient.cpp \
- WebCore/rendering/RenderSVGResourceRadialGradient.h \
- WebCore/rendering/RenderSVGResourceSolidColor.cpp \
- WebCore/rendering/RenderSVGResourceSolidColor.h \
- WebCore/rendering/RenderSVGRoot.cpp \
- WebCore/rendering/RenderSVGRoot.h \
- WebCore/rendering/RenderSVGShadowTreeRootContainer.cpp \
- WebCore/rendering/RenderSVGShadowTreeRootContainer.h \
- WebCore/rendering/RenderSVGTSpan.cpp \
- WebCore/rendering/RenderSVGTSpan.h \
- WebCore/rendering/RenderSVGText.cpp \
- WebCore/rendering/RenderSVGText.h \
- WebCore/rendering/RenderSVGTextPath.cpp \
- WebCore/rendering/RenderSVGTextPath.h \
- WebCore/rendering/RenderSVGTransformableContainer.cpp \
- WebCore/rendering/RenderSVGTransformableContainer.h \
- WebCore/rendering/RenderSVGViewportContainer.cpp \
- WebCore/rendering/RenderSVGViewportContainer.h \
- WebCore/rendering/SVGCharacterData.cpp \
- WebCore/rendering/SVGCharacterData.h \
- WebCore/rendering/SVGCharacterLayoutInfo.cpp \
- WebCore/rendering/SVGCharacterLayoutInfo.h \
- WebCore/rendering/SVGInlineFlowBox.cpp \
- WebCore/rendering/SVGInlineFlowBox.h \
- WebCore/rendering/SVGImageBufferTools.cpp \
- WebCore/rendering/SVGImageBufferTools.h \
- WebCore/rendering/SVGInlineTextBox.cpp \
- WebCore/rendering/SVGInlineTextBox.h \
- WebCore/rendering/SVGMarkerData.h \
- WebCore/rendering/SVGMarkerLayoutInfo.cpp \
- WebCore/rendering/SVGMarkerLayoutInfo.h \
- WebCore/rendering/SVGRenderSupport.cpp \
- WebCore/rendering/SVGRenderSupport.h \
- WebCore/rendering/SVGRenderTreeAsText.cpp \
- WebCore/rendering/SVGRenderTreeAsText.h \
- WebCore/rendering/SVGResources.cpp \
- WebCore/rendering/SVGResources.h \
- WebCore/rendering/SVGResourcesCache.cpp \
- WebCore/rendering/SVGResourcesCache.h \
- WebCore/rendering/SVGResourcesCycleSolver.cpp \
- WebCore/rendering/SVGResourcesCycleSolver.h \
- WebCore/rendering/SVGRootInlineBox.cpp \
- WebCore/rendering/SVGRootInlineBox.h \
- WebCore/rendering/SVGShadowTreeElements.cpp \
- WebCore/rendering/SVGShadowTreeElements.h \
- WebCore/rendering/SVGTextChunkLayoutInfo.cpp \
- WebCore/rendering/SVGTextChunkLayoutInfo.h \
- WebCore/rendering/SVGTextLayoutUtilities.cpp \
- WebCore/rendering/SVGTextLayoutUtilities.h \
- WebCore/rendering/SVGTextQuery.cpp \
- WebCore/rendering/SVGTextQuery.h \
- WebCore/rendering/style/SVGRenderStyle.cpp \
- WebCore/rendering/style/SVGRenderStyle.h \
- WebCore/rendering/style/SVGRenderStyleDefs.cpp \
- WebCore/rendering/style/SVGRenderStyleDefs.h \
- WebCore/svg/ColorDistance.cpp \
- WebCore/svg/ColorDistance.h \
- WebCore/svg/ElementTimeControl.h \
- WebCore/svg/GradientAttributes.h \
- WebCore/svg/LinearGradientAttributes.h \
- WebCore/svg/PatternAttributes.h \
- WebCore/svg/RadialGradientAttributes.h \
- WebCore/svg/SVGAElement.cpp \
- WebCore/svg/SVGAElement.h \
- WebCore/svg/SVGAltGlyphElement.cpp \
- WebCore/svg/SVGAltGlyphElement.h \
- WebCore/svg/SVGAngle.cpp \
- WebCore/svg/SVGAngle.h \
- WebCore/svg/SVGAnimateColorElement.cpp \
- WebCore/svg/SVGAnimateColorElement.h \
- WebCore/svg/SVGAnimateElement.cpp \
- WebCore/svg/SVGAnimateElement.h \
- WebCore/svg/SVGAnimateMotionElement.cpp \
- WebCore/svg/SVGAnimateMotionElement.h \
- WebCore/svg/SVGAnimateTransformElement.cpp \
- WebCore/svg/SVGAnimateTransformElement.h \
- WebCore/svg/SVGAnimatedPathData.cpp \
- WebCore/svg/SVGAnimatedPathData.h \
- WebCore/svg/SVGAnimatedPoints.cpp \
- WebCore/svg/SVGAnimatedPoints.h \
- WebCore/svg/SVGAnimatedProperty.h \
- WebCore/svg/SVGAnimatedPropertySynchronizer.h \
- WebCore/svg/SVGAnimatedPropertyTraits.h \
- WebCore/svg/SVGAnimatedTemplate.h \
- WebCore/svg/SVGAnimationElement.cpp \
- WebCore/svg/SVGAnimationElement.h \
- WebCore/svg/SVGCircleElement.cpp \
- WebCore/svg/SVGCircleElement.h \
- WebCore/svg/SVGClipPathElement.cpp \
- WebCore/svg/SVGClipPathElement.h \
- WebCore/svg/SVGColor.cpp \
- WebCore/svg/SVGColor.h \
- WebCore/svg/SVGComponentTransferFunctionElement.cpp \
- WebCore/svg/SVGComponentTransferFunctionElement.h \
- WebCore/svg/SVGCursorElement.cpp \
- WebCore/svg/SVGCursorElement.h \
- WebCore/svg/SVGDefsElement.cpp \
- WebCore/svg/SVGDefsElement.h \
- WebCore/svg/SVGDescElement.cpp \
- WebCore/svg/SVGDescElement.h \
- WebCore/svg/SVGDocument.cpp \
- WebCore/svg/SVGDocument.h \
- WebCore/svg/SVGDocumentExtensions.cpp \
- WebCore/svg/SVGDocumentExtensions.h \
- WebCore/svg/SVGElement.cpp \
- WebCore/svg/SVGElement.h \
- WebCore/svg/SVGElementInstance.cpp \
- WebCore/svg/SVGElementInstance.h \
- WebCore/svg/SVGElementInstanceList.cpp \
- WebCore/svg/SVGElementInstanceList.h \
- WebCore/svg/SVGElementRareData.h \
- WebCore/svg/SVGEllipseElement.cpp \
- WebCore/svg/SVGEllipseElement.h \
- WebCore/svg/SVGException.h \
- WebCore/svg/SVGExternalResourcesRequired.cpp \
- WebCore/svg/SVGExternalResourcesRequired.h \
- WebCore/svg/SVGFEBlendElement.cpp \
- WebCore/svg/SVGFEBlendElement.h \
- WebCore/svg/SVGFEColorMatrixElement.cpp \
- WebCore/svg/SVGFEColorMatrixElement.h \
- WebCore/svg/SVGFEComponentTransferElement.cpp \
- WebCore/svg/SVGFEComponentTransferElement.h \
- WebCore/svg/SVGFECompositeElement.cpp \
- WebCore/svg/SVGFECompositeElement.h \
- WebCore/svg/SVGFEConvolveMatrixElement.cpp \
- WebCore/svg/SVGFEConvolveMatrixElement.h \
- WebCore/svg/SVGFEDiffuseLightingElement.cpp \
- WebCore/svg/SVGFEDiffuseLightingElement.h \
- WebCore/svg/SVGFEDisplacementMapElement.cpp \
- WebCore/svg/SVGFEDisplacementMapElement.h \
- WebCore/svg/SVGFEDistantLightElement.cpp \
- WebCore/svg/SVGFEDistantLightElement.h \
- WebCore/svg/SVGFEFloodElement.cpp \
- WebCore/svg/SVGFEFloodElement.h \
- WebCore/svg/SVGFEFuncAElement.cpp \
- WebCore/svg/SVGFEFuncAElement.h \
- WebCore/svg/SVGFEFuncBElement.cpp \
- WebCore/svg/SVGFEFuncBElement.h \
- WebCore/svg/SVGFEFuncGElement.cpp \
- WebCore/svg/SVGFEFuncGElement.h \
- WebCore/svg/SVGFEFuncRElement.cpp \
- WebCore/svg/SVGFEFuncRElement.h \
- WebCore/svg/SVGFEGaussianBlurElement.cpp \
- WebCore/svg/SVGFEGaussianBlurElement.h \
- WebCore/svg/SVGFEImageElement.cpp \
- WebCore/svg/SVGFEImageElement.h \
- WebCore/svg/SVGFELightElement.cpp \
- WebCore/svg/SVGFELightElement.h \
- WebCore/svg/SVGFEMergeElement.cpp \
- WebCore/svg/SVGFEMergeElement.h \
- WebCore/svg/SVGFEMergeNodeElement.cpp \
- WebCore/svg/SVGFEMergeNodeElement.h \
- WebCore/svg/SVGFEMorphologyElement.cpp \
- WebCore/svg/SVGFEMorphologyElement.h \
- WebCore/svg/SVGFEOffsetElement.cpp \
- WebCore/svg/SVGFEOffsetElement.h \
- WebCore/svg/SVGFEPointLightElement.cpp \
- WebCore/svg/SVGFEPointLightElement.h \
- WebCore/svg/SVGFESpecularLightingElement.cpp \
- WebCore/svg/SVGFESpecularLightingElement.h \
- WebCore/svg/SVGFESpotLightElement.cpp \
- WebCore/svg/SVGFESpotLightElement.h \
- WebCore/svg/SVGFETileElement.cpp \
- WebCore/svg/SVGFETileElement.h \
- WebCore/svg/SVGFETurbulenceElement.cpp \
- WebCore/svg/SVGFETurbulenceElement.h \
- WebCore/svg/SVGFilterElement.cpp \
- WebCore/svg/SVGFilterElement.h \
- WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp \
- WebCore/svg/SVGFilterPrimitiveStandardAttributes.h \
- WebCore/svg/SVGFitToViewBox.cpp \
- WebCore/svg/SVGFitToViewBox.h \
- WebCore/svg/SVGFont.cpp \
- WebCore/svg/SVGFontData.cpp \
- WebCore/svg/SVGFontData.h \
- WebCore/svg/SVGFontElement.cpp \
- WebCore/svg/SVGFontElement.h \
- WebCore/svg/SVGFontFaceElement.cpp \
- WebCore/svg/SVGFontFaceElement.h \
- WebCore/svg/SVGFontFaceFormatElement.cpp \
- WebCore/svg/SVGFontFaceFormatElement.h \
- WebCore/svg/SVGFontFaceNameElement.cpp \
- WebCore/svg/SVGFontFaceNameElement.h \
- WebCore/svg/SVGFontFaceSrcElement.cpp \
- WebCore/svg/SVGFontFaceSrcElement.h \
- WebCore/svg/SVGFontFaceUriElement.cpp \
- WebCore/svg/SVGFontFaceUriElement.h \
- WebCore/svg/SVGForeignObjectElement.cpp \
- WebCore/svg/SVGForeignObjectElement.h \
- WebCore/svg/SVGGElement.cpp \
- WebCore/svg/SVGGElement.h \
- WebCore/svg/SVGGlyphElement.cpp \
- WebCore/svg/SVGGlyphElement.h \
- WebCore/svg/SVGGlyphMap.h \
- WebCore/svg/SVGGradientElement.cpp \
- WebCore/svg/SVGGradientElement.h \
- WebCore/svg/SVGHKernElement.cpp \
- WebCore/svg/SVGHKernElement.h \
- WebCore/svg/SVGImageElement.cpp \
- WebCore/svg/SVGImageElement.h \
- WebCore/svg/SVGImageLoader.cpp \
- WebCore/svg/SVGImageLoader.h \
- WebCore/svg/SVGLangSpace.cpp \
- WebCore/svg/SVGLangSpace.h \
- WebCore/svg/SVGLength.cpp \
- WebCore/svg/SVGLength.h \
- WebCore/svg/SVGLengthList.cpp \
- WebCore/svg/SVGLengthList.h \
- WebCore/svg/SVGLineElement.cpp \
- WebCore/svg/SVGLineElement.h \
- WebCore/svg/SVGLinearGradientElement.cpp \
- WebCore/svg/SVGLinearGradientElement.h \
- WebCore/svg/SVGList.h \
- WebCore/svg/SVGListTraits.h \
- WebCore/svg/SVGLocatable.cpp \
- WebCore/svg/SVGLocatable.h \
- WebCore/svg/SVGMPathElement.cpp \
- WebCore/svg/SVGMPathElement.h \
- WebCore/svg/SVGMarkerElement.cpp \
- WebCore/svg/SVGMarkerElement.h \
- WebCore/svg/SVGMaskElement.cpp \
- WebCore/svg/SVGMaskElement.h \
- WebCore/svg/SVGMetadataElement.cpp \
- WebCore/svg/SVGMetadataElement.h \
- WebCore/svg/SVGMissingGlyphElement.cpp \
- WebCore/svg/SVGMissingGlyphElement.h \
- WebCore/svg/SVGNumberList.cpp \
- WebCore/svg/SVGNumberList.h \
- WebCore/svg/SVGPaint.cpp \
- WebCore/svg/SVGPaint.h \
- WebCore/svg/SVGParserUtilities.cpp \
- WebCore/svg/SVGParserUtilities.h \
- WebCore/svg/SVGPathBlender.cpp \
- WebCore/svg/SVGPathBlender.h \
- WebCore/svg/SVGPathBuilder.cpp \
- WebCore/svg/SVGPathBuilder.h \
- WebCore/svg/SVGPathByteStream.h \
- WebCore/svg/SVGPathByteStreamBuilder.cpp \
- WebCore/svg/SVGPathByteStreamBuilder.h \
- WebCore/svg/SVGPathByteStreamSource.cpp \
- WebCore/svg/SVGPathByteStreamSource.h \
- WebCore/svg/SVGPathConsumer.h \
- WebCore/svg/SVGPathElement.cpp \
- WebCore/svg/SVGPathElement.h \
- WebCore/svg/SVGPathParser.cpp \
- WebCore/svg/SVGPathParser.h \
- WebCore/svg/SVGPathParserFactory.cpp \
- WebCore/svg/SVGPathParserFactory.h \
- WebCore/svg/SVGPathSeg.cpp \
- WebCore/svg/SVGPathSeg.h \
- WebCore/svg/SVGPathSegArc.cpp \
- WebCore/svg/SVGPathSegArc.h \
- WebCore/svg/SVGPathSegClosePath.cpp \
- WebCore/svg/SVGPathSegClosePath.h \
- WebCore/svg/SVGPathSegCurvetoCubic.cpp \
- WebCore/svg/SVGPathSegCurvetoCubic.h \
- WebCore/svg/SVGPathSegCurvetoCubicSmooth.cpp \
- WebCore/svg/SVGPathSegCurvetoCubicSmooth.h \
- WebCore/svg/SVGPathSegCurvetoQuadratic.cpp \
- WebCore/svg/SVGPathSegCurvetoQuadratic.h \
- WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.cpp \
- WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h \
- WebCore/svg/SVGPathSegLineto.cpp \
- WebCore/svg/SVGPathSegLineto.h \
- WebCore/svg/SVGPathSegLinetoHorizontal.cpp \
- WebCore/svg/SVGPathSegLinetoHorizontal.h \
- WebCore/svg/SVGPathSegLinetoVertical.cpp \
- WebCore/svg/SVGPathSegLinetoVertical.h \
- WebCore/svg/SVGPathSegList.cpp \
- WebCore/svg/SVGPathSegList.h \
- WebCore/svg/SVGPathSegListBuilder.cpp \
- WebCore/svg/SVGPathSegListBuilder.h \
- WebCore/svg/SVGPathSegListSource.cpp \
- WebCore/svg/SVGPathSegListSource.h \
- WebCore/svg/SVGPathSegMoveto.cpp \
- WebCore/svg/SVGPathSegMoveto.h \
- WebCore/svg/SVGPathSource.h \
- WebCore/svg/SVGPathStringBuilder.cpp \
- WebCore/svg/SVGPathStringBuilder.h \
- WebCore/svg/SVGPathStringSource.cpp \
- WebCore/svg/SVGPathStringSource.h \
- WebCore/svg/SVGPathTraversalStateBuilder.cpp \
- WebCore/svg/SVGPathTraversalStateBuilder.h \
- WebCore/svg/SVGPatternElement.cpp \
- WebCore/svg/SVGPatternElement.h \
- WebCore/svg/SVGPointList.cpp \
- WebCore/svg/SVGPointList.h \
- WebCore/svg/SVGPolyElement.cpp \
- WebCore/svg/SVGPolyElement.h \
- WebCore/svg/SVGPolygonElement.cpp \
- WebCore/svg/SVGPolygonElement.h \
- WebCore/svg/SVGPolylineElement.cpp \
- WebCore/svg/SVGPolylineElement.h \
- WebCore/svg/SVGPreserveAspectRatio.cpp \
- WebCore/svg/SVGPreserveAspectRatio.h \
- WebCore/svg/SVGRadialGradientElement.cpp \
- WebCore/svg/SVGRadialGradientElement.h \
- WebCore/svg/SVGRectElement.cpp \
- WebCore/svg/SVGRectElement.h \
- WebCore/svg/SVGRenderingIntent.h \
- WebCore/svg/SVGSVGElement.cpp \
- WebCore/svg/SVGSVGElement.h \
- WebCore/svg/SVGScriptElement.cpp \
- WebCore/svg/SVGScriptElement.h \
- WebCore/svg/SVGSetElement.cpp \
- WebCore/svg/SVGSetElement.h \
- WebCore/svg/SVGStopElement.cpp \
- WebCore/svg/SVGStopElement.h \
- WebCore/svg/SVGStringList.cpp \
- WebCore/svg/SVGStringList.h \
- WebCore/svg/SVGStylable.cpp \
- WebCore/svg/SVGStylable.h \
- WebCore/svg/SVGStyleElement.cpp \
- WebCore/svg/SVGStyleElement.h \
- WebCore/svg/SVGStyledElement.cpp \
- WebCore/svg/SVGStyledElement.h \
- WebCore/svg/SVGStyledLocatableElement.cpp \
- WebCore/svg/SVGStyledLocatableElement.h \
- WebCore/svg/SVGStyledTransformableElement.cpp \
- WebCore/svg/SVGStyledTransformableElement.h \
- WebCore/svg/SVGSwitchElement.cpp \
- WebCore/svg/SVGSwitchElement.h \
- WebCore/svg/SVGSymbolElement.cpp \
- WebCore/svg/SVGSymbolElement.h \
- WebCore/svg/SVGTRefElement.cpp \
- WebCore/svg/SVGTRefElement.h \
- WebCore/svg/SVGTSpanElement.cpp \
- WebCore/svg/SVGTSpanElement.h \
- WebCore/svg/SVGTests.cpp \
- WebCore/svg/SVGTests.h \
- WebCore/svg/SVGTextContentElement.cpp \
- WebCore/svg/SVGTextContentElement.h \
- WebCore/svg/SVGTextElement.cpp \
- WebCore/svg/SVGTextElement.h \
- WebCore/svg/SVGTextPathElement.cpp \
- WebCore/svg/SVGTextPathElement.h \
- WebCore/svg/SVGTextPositioningElement.cpp \
- WebCore/svg/SVGTextPositioningElement.h \
- WebCore/svg/SVGTitleElement.cpp \
- WebCore/svg/SVGTitleElement.h \
- WebCore/svg/SVGTransform.cpp \
- WebCore/svg/SVGTransform.h \
- WebCore/svg/SVGTransformDistance.cpp \
- WebCore/svg/SVGTransformDistance.h \
- WebCore/svg/SVGTransformList.cpp \
- WebCore/svg/SVGTransformList.h \
- WebCore/svg/SVGTransformable.cpp \
- WebCore/svg/SVGTransformable.h \
- WebCore/svg/SVGURIReference.cpp \
- WebCore/svg/SVGURIReference.h \
- WebCore/svg/SVGUnitTypes.h \
- WebCore/svg/SVGUseElement.cpp \
- WebCore/svg/SVGUseElement.h \
- WebCore/svg/SVGViewElement.cpp \
- WebCore/svg/SVGViewElement.h \
- WebCore/svg/SVGVKernElement.cpp \
- WebCore/svg/SVGVKernElement.h \
- WebCore/svg/SVGViewSpec.cpp \
- WebCore/svg/SVGViewSpec.h \
- WebCore/svg/SVGZoomAndPan.cpp \
- WebCore/svg/SVGZoomAndPan.h \
- WebCore/svg/SVGZoomEvent.cpp \
- WebCore/svg/SVGZoomEvent.h \
- WebCore/svg/animation/SMILTime.cpp \
- WebCore/svg/animation/SMILTime.h \
- WebCore/svg/animation/SMILTimeContainer.cpp \
- WebCore/svg/animation/SMILTimeContainer.h \
- WebCore/svg/animation/SVGSMILElement.cpp \
- WebCore/svg/animation/SVGSMILElement.h \
- WebCore/svg/graphics/SVGImage.cpp \
- WebCore/svg/graphics/SVGImage.h \
- WebCore/svg/graphics/filters/SVGDistantLightSource.h \
- WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp \
- WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h \
- WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp \
- WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h \
- WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp \
- WebCore/svg/graphics/filters/SVGFEDisplacementMap.h \
- WebCore/svg/graphics/filters/SVGFEFlood.cpp \
- WebCore/svg/graphics/filters/SVGFEFlood.h \
- WebCore/svg/graphics/filters/SVGFEImage.cpp \
- WebCore/svg/graphics/filters/SVGFEImage.h \
- WebCore/svg/graphics/filters/SVGFELighting.cpp \
- WebCore/svg/graphics/filters/SVGFELighting.h \
- WebCore/svg/graphics/filters/SVGFEMerge.cpp \
- WebCore/svg/graphics/filters/SVGFEMerge.h \
- WebCore/svg/graphics/filters/SVGFEMorphology.cpp \
- WebCore/svg/graphics/filters/SVGFEMorphology.h \
- WebCore/svg/graphics/filters/SVGFEOffset.cpp \
- WebCore/svg/graphics/filters/SVGFEOffset.h \
- WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp \
- WebCore/svg/graphics/filters/SVGFESpecularLighting.h \
- WebCore/svg/graphics/filters/SVGFETile.cpp \
- WebCore/svg/graphics/filters/SVGFETile.h \
- WebCore/svg/graphics/filters/SVGFETurbulence.cpp \
- WebCore/svg/graphics/filters/SVGFETurbulence.h \
- WebCore/svg/graphics/filters/SVGFilter.cpp \
- WebCore/svg/graphics/filters/SVGFilter.h \
- WebCore/svg/graphics/filters/SVGFilterBuilder.h \
- WebCore/svg/graphics/filters/SVGFilterBuilder.cpp \
- WebCore/svg/graphics/filters/SVGLightSource.cpp \
- WebCore/svg/graphics/filters/SVGLightSource.h \
- WebCore/svg/graphics/filters/SVGPointLightSource.h \
- WebCore/svg/graphics/filters/SVGSpotLightSource.h
-
# SVG Features
if ENABLE_SVG_USE
FEATURE_DEFINES += ENABLE_SVG_USE=1
@@ -4375,12 +4282,6 @@ endif
endif # END ENABLE_SVG
-webcore_built_sources += \
- DerivedSources/WebCore/JSSVGElementWrapperFactory.cpp \
- DerivedSources/WebCore/SVGElementFactory.cpp \
- DerivedSources/WebCore/SVGNames.cpp \
- DerivedSources/WebCore/XLinkNames.cpp
-
# SVG tag and attribute names (need to pass an extra flag if svg experimental features are enabled)
DerivedSources/WebCore/SVGNames.cpp: DerivedSources/WebCore/SVGElementFactory.cpp;
DerivedSources/WebCore/JSSVGElementWrapperFactory.cpp: DerivedSources/WebCore/SVGElementFactory.cpp
@@ -4391,13 +4292,11 @@ DerivedSources/WebCore/SVGElementFactory.cpp: $(WebCore)/dom/make_names.pl $(Web
else
DerivedSources/WebCore/SVGElementFactory.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/svg/svgtags.in $(WebCore)/svg/svgattrs.in
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/svg/svgtags.in --attrs $(WebCore)/svg/svgattrs.in --factory --wrapperFactory --outputDir "$(GENSOURCES_WEBCORE)"
-
endif # SVG_FLAGS
# end SVG Features
DerivedSources/WebCore/XLinkNames.h: DerivedSources/WebCore/XLinkNames.cpp;
-
DerivedSources/WebCore/XLinkNames.cpp : $(WebCore)/dom/make_names.pl $(WebCore)/svg/xlinkattrs.in
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --attrs $(WebCore)/svg/xlinkattrs.in --outputDir "$(GENSOURCES_WEBCORE)"
@@ -4406,47 +4305,10 @@ DerivedSources/WebCore/XLinkNames.cpp : $(WebCore)/dom/make_names.pl $(WebCore)/
# ----
if ENABLE_WEB_SOCKETS
FEATURE_DEFINES += ENABLE_WEB_SOCKETS=1
-
-webcore_cppflags += \
- -DENABLE_WEB_SOCKETS=1
-
+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 \
- WebCore/platform/network/SocketStreamErrorBase.h \
- WebCore/platform/network/SocketStreamHandleBase.cpp \
- WebCore/platform/network/SocketStreamHandleBase.h \
- WebCore/platform/network/SocketStreamHandleClient.h \
- WebCore/websockets/WebSocket.cpp \
- WebCore/websockets/WebSocket.h \
- WebCore/websockets/WebSocketChannel.cpp \
- WebCore/websockets/WebSocketChannel.h \
- WebCore/websockets/WebSocketChannelClient.h \
- WebCore/websockets/WebSocketHandshake.cpp \
- WebCore/websockets/WebSocketHandshake.h \
- WebCore/websockets/WebSocketHandshakeRequest.cpp \
- WebCore/websockets/WebSocketHandshakeRequest.h \
- WebCore/websockets/WebSocketHandshakeResponse.cpp \
- WebCore/websockets/WebSocketHandshakeResponse.h
-
-if ENABLE_WORKERS
-webcore_sources += \
- WebCore/websockets/ThreadableWebSocketChannel.cpp \
- WebCore/websockets/ThreadableWebSocketChannel.h \
- WebCore/websockets/ThreadableWebSocketChannelClientWrapper.h \
- WebCore/websockets/WorkerThreadableWebSocketChannel.cpp \
- WebCore/websockets/WorkerThreadableWebSocketChannel.h
-endif
-
-webcoregtk_sources += \
- WebCore/platform/network/soup/SocketStreamError.h \
- WebCore/platform/network/soup/SocketStreamHandle.h \
- WebCore/platform/network/soup/SocketStreamHandleSoup.cpp
-
else
webcore_cppflags += -DENABLE_WEB_SOCKETS=0
endif # END ENABLE_WEB_SOCKETS
@@ -4459,28 +4321,6 @@ FEATURE_DEFINES += ENABLE_BLOB=1
webcore_cppflags += -DENABLE_BLOB=1
endif # END ENABLE_BLOB
-# ---
-# FileWriter support
-# ---
-if ENABLE_FILE_WRITER
-FEATURE_DEFINES += ENABLE_FILE_WRITER=1
-webcore_cppflags += -DENABLE_FILE_WRITER=1
-
-webcore_built_sources += \
- DerivedSources/WebCore/JSFileWriter.cpp \
- DerivedSources/WebCore/JSFileWriter.h
- DerivedSources/WebCore/JSFileWriterCallback.cpp \
- DerivedSources/WebCore/JSFileWriterCallback.h
-
-webcore_sources += \
- WebCore/fileapi/AsyncFileWriter.h \
- WebCore/fileapi/FileWriterClient.h \
- WebCore/fileapi/FileWriter.cpp \
- WebCore/fileapi/FileWriter.h \
- WebCore/fileapi/FileWriterCallback.h
-
-endif # END ENABLE_FILE_WRITER
-
DerivedSources/WebCore/CSSPropertyNames.h: $(WEBCORE_CSS_PROPERTY_NAMES) $(WebCore)/css/makeprop.pl
if sort $(WEBCORE_CSS_PROPERTY_NAMES) | uniq -d | grep -E '^[^#]'; then echo 'Duplicate value!'; exit 1; fi
cat $(WEBCORE_CSS_PROPERTY_NAMES) > CSSPropertyNames.in
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index a2d5a39..d2a6edb 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -170,7 +170,6 @@ __ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestERKN3WTF6StringEb
__ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestERKNS_14SubstituteDataEb
__ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestEb
__ZN7WebCore11FrameLoader6reloadEb
-__ZN7WebCore11FrameLoader7addDataEPKci
__ZN7WebCore11Geolocation12setIsAllowedEb
__ZN7WebCore11GeolocationD1Ev
__ZN7WebCore11HistoryItem10targetItemEv
@@ -263,6 +262,7 @@ __ZN7WebCore12SchedulePairC1EP9NSRunLoopPK10__CFString
__ZN7WebCore12SharedBuffer10wrapNSDataEP6NSData
__ZN7WebCore12SharedBuffer12createNSDataEv
__ZN7WebCore12SharedBuffer24createWithContentsOfFileERKN3WTF6StringE
+__ZN7WebCore12SharedBufferC1EPKci
__ZN7WebCore12SharedBufferD1Ev
__ZN7WebCore12TextEncodingC1ERKN3WTF6StringE
__ZN7WebCore12TextIterator11rangeLengthEPKNS_5RangeEb
@@ -291,6 +291,7 @@ __ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
__ZN7WebCore13toJSDOMWindowEN3JSC7JSValueE
__ZN7WebCore14CachedResource12removeClientEPNS_20CachedResourceClientE
__ZN7WebCore14CachedResource9addClientEPNS_20CachedResourceClientE
+__ZN7WebCore14DocumentLoader10commitDataEPKci
__ZN7WebCore14DocumentLoader13attachToFrameEv
__ZN7WebCore14DocumentLoader15detachFromFrameEv
__ZN7WebCore14DocumentLoader18addArchiveResourceEN3WTF10PassRefPtrINS_15ArchiveResourceEEE
@@ -314,7 +315,6 @@ __ZN7WebCore14SVGSMILElement13isSMILElementEPNS_4NodeE
__ZN7WebCore14SchemeRegistry24registerURLSchemeAsLocalERKN3WTF6StringE
__ZN7WebCore14SchemeRegistry25registerURLSchemeAsSecureERKN3WTF6StringE
__ZN7WebCore14SchemeRegistry32registerURLSchemeAsEmptyDocumentERKN3WTF6StringE
-__ZN7WebCore14SecurityOrigin10canDisplayERKNS_4KURLERKN3WTF6StringEPNS_8DocumentE
__ZN7WebCore14SecurityOrigin16createFromStringERKN3WTF6StringE
__ZN7WebCore14SecurityOrigin18setLocalLoadPolicyENS0_15LocalLoadPolicyE
__ZN7WebCore14SecurityOrigin18shouldHideReferrerERKNS_4KURLERKN3WTF6StringE
@@ -341,7 +341,6 @@ __ZN7WebCore15DatabaseTracker9setClientEPNS_21DatabaseTrackerClientE
__ZN7WebCore15FocusController10setFocusedEb
__ZN7WebCore15FocusController15setFocusedFrameEN3WTF10PassRefPtrINS_5FrameEEE
__ZN7WebCore15FocusController15setInitialFocusENS_14FocusDirectionEPNS_13KeyboardEventE
-__ZNK7WebCore15FocusController18focusedOrMainFrameEv
__ZN7WebCore15FocusController9setActiveEb
__ZN7WebCore15GraphicsContext12setFillColorERKNS_5ColorENS_10ColorSpaceE
__ZN7WebCore15GraphicsContext4clipERKNS_9FloatRectE
@@ -423,7 +422,9 @@ __ZN7WebCore19ResourceRequestBase19addHTTPHeaderFieldsERKNS_13HTTPHeaderMapE
__ZN7WebCore19ResourceRequestBase6setURLERKNS_4KURLE
__ZN7WebCore19SelectionController10setFocusedEb
__ZN7WebCore19SelectionController12setSelectionERKNS_16VisibleSelectionEbbbNS0_19CursorAlignOnScrollENS_15TextGranularityENS_20DirectionalityPolicyE
+__ZN7WebCore19SelectionController15revealSelectionERKNS_15ScrollAlignmentEb
__ZN7WebCore19SelectionController16setSelectedRangeEPNS_5RangeENS_9EAffinityEb
+__ZN7WebCore19SelectionController20setSelectionFromNoneEv
__ZN7WebCore19SelectionController5clearEv
__ZN7WebCore19SelectionController6modifyENS0_11EAlterationENS0_10EDirectionENS_15TextGranularityEb
__ZN7WebCore19SelectionController9selectAllEv
@@ -517,7 +518,7 @@ __ZN7WebCore31contextMenuItemTagMakeUpperCaseEv
__ZN7WebCore31contextMenuItemTagStartSpeakingEv
__ZN7WebCore32contextMenuItemTagInspectElementEv
__ZN7WebCore32contextMenuItemTagSmartCopyPasteEv
-__ZN7WebCore32plainTextToMallocAllocatedBufferEPKNS_5RangeERjb
+__ZN7WebCore32plainTextToMallocAllocatedBufferEPKNS_5RangeERjbNS_20TextIteratorBehaviorE
__ZN7WebCore33contextMenuItemTagTextReplacementEv
__ZN7WebCore33setDefaultThreadViolationBehaviorENS_23ThreadViolationBehaviorENS_20ThreadViolationRoundE
__ZN7WebCore34contextMenuItemTagDefaultDirectionEv
@@ -575,15 +576,17 @@ __ZN7WebCore4PageC1ERKNS0_11PageClientsE
__ZN7WebCore4PageD1Ev
__ZN7WebCore4coreEP20NSURLProtectionSpace
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE
+__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_5RangeE
__ZN7WebCore5Cache11setDisabledEb
__ZN7WebCore5Cache13getStatisticsEv
__ZN7WebCore5Cache13setCapacitiesEjjj
__ZN7WebCore5Frame10createViewERKNS_7IntSizeERKNS_5ColorEbS3_bNS_13ScrollbarModeEbS7_b
__ZN7WebCore5Frame14frameForWidgetEPKNS_6WidgetE
-__ZN7WebCore5Frame15revealSelectionERKNS_15ScrollAlignmentEb
-__ZN7WebCore5Frame20setSelectionFromNoneEv
+__ZN7WebCore5Frame17setPageZoomFactorEf
+__ZN7WebCore5Frame17setTextZoomFactorEf
__ZN7WebCore5Frame23visiblePositionForPointERKNS_8IntPointE
__ZN7WebCore5Frame25matchLabelsAgainstElementEP7NSArrayPNS_7ElementE
+__ZN7WebCore5Frame25setPageAndTextZoomFactorsEff
__ZN7WebCore5Frame28searchForLabelsBeforeElementEP7NSArrayPNS_7ElementEPmPb
__ZN7WebCore5Frame6createEPNS_4PageEPNS_21HTMLFrameOwnerElementEPNS_17FrameLoaderClientE
__ZN7WebCore5Frame7setViewEN3WTF10PassRefPtrINS_9FrameViewEEE
@@ -685,7 +688,6 @@ __ZN7WebCore8FormData6createEPKvm
__ZN7WebCore8FormDataD1Ev
__ZN7WebCore8IntPointC1ERK8_NSPoint
__ZN7WebCore8PositionC1EN3WTF10PassRefPtrINS_4NodeEEEi
-__ZN7WebCore8Settings11setZoomModeENS_8ZoomModeE
__ZN7WebCore8Settings14setJavaEnabledEb
__ZN7WebCore8Settings15setWebGLEnabledEb
__ZN7WebCore8Settings16setUsesPageCacheEb
@@ -704,6 +706,7 @@ __ZN7WebCore8Settings21setShowRepaintCounterEb
__ZN7WebCore8Settings21setStandardFontFamilyERKN3WTF12AtomicStringE
__ZN7WebCore8Settings21setWebSecurityEnabledEb
__ZN7WebCore8Settings22setLocalStorageEnabledEb
+__ZN7WebCore8Settings22setMinDOMTimerIntervalEd
__ZN7WebCore8Settings22setSansSerifFontFamilyERKN3WTF12AtomicStringE
__ZN7WebCore8Settings22setSessionStorageQuotaEj
__ZN7WebCore8Settings22setShowsURLsInToolTipsEb
@@ -729,6 +732,7 @@ __ZN7WebCore8Settings27setFTPDirectoryTemplatePathERKN3WTF6StringE
__ZN7WebCore8Settings27setLoadsImagesAutomaticallyEb
__ZN7WebCore8Settings27setLocalStorageDatabasePathERKN3WTF6StringE
__ZN7WebCore8Settings28setForceFTPDirectoryListingsEb
+__ZN7WebCore8Settings29setAccelerated2dCanvasEnabledEb
__ZN7WebCore8Settings29setAuthorAndUserStylesEnabledEb
__ZN7WebCore8Settings29setWebArchiveDebugModeEnabledEb
__ZN7WebCore8Settings30setAllowFileAccessFromFileURLsEb
@@ -761,13 +765,11 @@ __ZN7WebCore9FrameTree7setNameERKN3WTF12AtomicStringE
__ZN7WebCore9FrameTree9clearNameEv
__ZN7WebCore9FrameView11forceLayoutEb
__ZN7WebCore9FrameView12setMediaTypeERKN3WTF6StringE
-__ZN7WebCore9FrameView13setZoomFactorEfNS_8ZoomModeE
__ZN7WebCore9FrameView14adjustViewSizeEv
__ZN7WebCore9FrameView14setMarginWidthEi
__ZN7WebCore9FrameView14setNeedsLayoutEv
__ZN7WebCore9FrameView14setTransparentEb
__ZN7WebCore9FrameView15setMarginHeightEi
-__ZN7WebCore9FrameView16adjustPageHeightEPffff
__ZN7WebCore9FrameView16setPaintBehaviorEj
__ZN7WebCore9FrameView18updateControlTintsEv
__ZN7WebCore9FrameView20enterCompositingModeEv
@@ -775,6 +777,7 @@ __ZN7WebCore9FrameView21flushDeferredRepaintsEv
__ZN7WebCore9FrameView22setBaseBackgroundColorENS_5ColorE
__ZN7WebCore9FrameView23updateCanHaveScrollbarsEv
__ZN7WebCore9FrameView24forceLayoutForPaginationERKNS_9FloatSizeEfNS_5Frame19AdjustViewSizeOrNotE
+__ZN7WebCore9FrameView26adjustPageHeightDeprecatedEPffff
__ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb
__ZN7WebCore9FrameView29syncCompositingStateRecursiveEv
__ZN7WebCore9FrameView37updateLayoutAndStyleIfNeededRecursiveEv
@@ -933,7 +936,9 @@ __ZNK7WebCore14DocumentLoader3urlEv
__ZNK7WebCore14RenderListItem10markerTextEv
__ZNK7WebCore14ResourceHandle10connectionEv
__ZNK7WebCore14ResourceLoader11frameLoaderEv
+__ZNK7WebCore14SecurityOrigin10canDisplayERKNS_4KURLE
__ZNK7WebCore14SecurityOrigin5equalEPKS0_
+__ZNK7WebCore15FocusController18focusedOrMainFrameEv
__ZNK7WebCore15GraphicsContext15platformContextEv
__ZNK7WebCore15GraphicsContext16paintingDisabledEv
__ZNK7WebCore15ProgressTracker17estimatedProgressEv
@@ -956,8 +961,11 @@ __ZNK7WebCore19AnimationController24numberOfActiveAnimationsEv
__ZNK7WebCore19ResourceRequestBase10httpMethodEv
__ZNK7WebCore19ResourceRequestBase3urlEv
__ZNK7WebCore19ResourceRequestBase7isEmptyEv
+__ZNK7WebCore19SelectionController11currentFormEv
__ZNK7WebCore19SelectionController17isInPasswordFieldEv
__ZNK7WebCore19SelectionController18isFocusedAndActiveEv
+__ZNK7WebCore19SelectionController31getClippedVisibleTextRectanglesERN3WTF6VectorINS_9FloatRectELm0EEE
+__ZNK7WebCore19SelectionController6boundsEb
__ZNK7WebCore20ResourceResponseBase14httpStatusCodeEv
__ZNK7WebCore20ResourceResponseBase14httpStatusTextEv
__ZNK7WebCore20ResourceResponseBase15httpHeaderFieldEPKc
@@ -988,15 +996,11 @@ __ZNK7WebCore4Page10pluginDataEv
__ZNK7WebCore4Page15backForwardListEv
__ZNK7WebCore4Page34inLowQualityImageInterpolationModeEv
__ZNK7WebCore4Page9groupNameEv
-__ZNK7WebCore5Frame11currentFormEv
__ZNK7WebCore5Frame13ownerRendererEv
__ZNK7WebCore5Frame14selectionImageEb
__ZNK7WebCore5Frame15contentRendererEv
__ZNK7WebCore5Frame15layerTreeAsTextEv
-__ZNK7WebCore5Frame15selectionBoundsEb
__ZNK7WebCore5Frame18documentTypeStringEv
-__ZNK7WebCore5Frame18selectionTextRectsERN3WTF6VectorINS_9FloatRectELm0EEENS0_30SelectionRectRespectTransformsEb
-__ZNK7WebCore5Frame20selectionGranularityEv
__ZNK7WebCore5Frame8settingsEv
__ZNK7WebCore5Frame9domWindowEv
__ZNK7WebCore5Range11startOffsetERi
@@ -1019,6 +1023,7 @@ __ZNK7WebCore6Editor22selectionStartHasStyleEPNS_19CSSStyleDeclarationE
__ZNK7WebCore6Editor23getCompositionSelectionERjS1_
__ZNK7WebCore6Editor30applyEditingStyleToBodyElementEv
__ZNK7WebCore6Editor31fontAttributesForSelectionStartEv
+__ZNK7WebCore6Editor34selectionStartHasSpellingMarkerForEii
__ZNK7WebCore6Editor37baseWritingDirectionForSelectionStartEv
__ZNK7WebCore6Editor6canCutEv
__ZNK7WebCore6Editor7Command11isSupportedEv
@@ -1045,6 +1050,7 @@ __ZNK7WebCore7IntSizecv7_NSSizeEv
__ZNK7WebCore8Document11completeURLERKN3WTF6StringE
__ZNK7WebCore8Document13axObjectCacheEv
__ZNK7WebCore8Document14getElementByIdERKN3WTF12AtomicStringE
+__ZNK7WebCore8Document16dashboardRegionsEv
__ZNK7WebCore8Document20cacheDocumentElementEv
__ZNK7WebCore8Document31displayStringModifiedByEncodingERKN3WTF6StringE
__ZNK7WebCore8Document4bodyEv
@@ -1138,6 +1144,7 @@ _wkSignalCFReadStreamEnd
_wkSignalCFReadStreamError
_wkSignalCFReadStreamHasBytes
+
#if ENABLE(3D_RENDERING)
_WebCoreHas3DRendering
#endif
@@ -1157,8 +1164,6 @@ __ZNK7WebCore11ContextMenu19platformDescriptionEv
#endif
#if ENABLE(DASHBOARD_SUPPORT)
-.objc_class_name_WebDashboardRegion
-__ZN7WebCore5Frame26dashboardRegionsDictionaryEv
__ZN7WebCore8Settings41setUsesDashboardBackwardCompatibilityModeEb
#endif
diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
index 6282530..2745cfa 100644
--- a/WebCore/WebCore.gyp/WebCore.gyp
+++ b/WebCore/WebCore.gyp/WebCore.gyp
@@ -95,6 +95,12 @@
}, # target webkit_system_interface
], # targets
}], # condition OS == "mac"
+ ['OS!="win" and remove_webcore_debug_symbols==1', {
+ # Remove -g from all targets defined here.
+ 'target_defaults': {
+ 'cflags!': ['-g'],
+ },
+ }],
], # conditions
'variables': {
@@ -163,6 +169,7 @@
'../plugins/chromium',
'../rendering',
'../rendering/style',
+ '../rendering/svg',
'../storage',
'../storage/chromium',
'../svg',
@@ -799,13 +806,6 @@
'include_dirs+++': ['../dom'],
},
}],
- ['OS!="win" and remove_webcore_debug_symbols==1', {
- 'configurations': {
- 'Debug': {
- 'cflags!': ['-g'],
- }
- },
- }],
],
},
{
@@ -982,6 +982,9 @@
'<@(webcore_files)',
],
'sources/': [
+ # Start by excluding everything then include svg files only. Note that
+ # css/SVG* and bindings/v8/custom/V8SVG* are still built in
+ # webcore_remaining.
['exclude', '.*'],
['include', 'svg/'],
['include', 'css/svg/'],
@@ -992,7 +995,7 @@
],
},
{
- 'target_name': 'webcore_remaining',
+ 'target_name': 'webcore_platform',
'type': '<(library)',
'dependencies': [
'webcore_prerequisites',
@@ -1007,137 +1010,38 @@
'../../WebKit/mac/WebCoreSupport/WebSystemInterface.mm',
],
'sources/': [
- # Exclude JSC custom bindings.
- ['exclude', 'bindings/js'],
-
- # Fortunately, many things can be excluded by using broad patterns.
+ # Start by excluding everything then include platform files only.
+ ['exclude', '.*'],
+ ['include', 'platform/'],
# Exclude things that don't apply to the Chromium platform on the basis
# of their enclosing directories and tags at the ends of their
# filenames.
- ['exclude', '(android|cairo|cf|cg|curl|gtk|haiku|linux|mac|opentype|posix|qt|soup|symbian|win|wx)/'],
+ ['exclude', '(android|cairo|cf|cg|curl|gtk|haiku|linux|mac|opentype|posix|qt|soup|svg|symbian|win|wx)/'],
['exclude', '(?<!Chromium)(Android|Cairo|CF|CG|Curl|Gtk|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|Wx)\\.(cpp|mm?)$'],
- ['include', 'platform/graphics/opentype/OpenTypeSanitizer\\.cpp$'],
- # JSC-only.
- ['exclude', 'inspector/JavaScript[^/]*\\.cpp$'],
-
- # ENABLE_OFFLINE_WEB_APPLICATIONS, exclude most of webcore's impl
- ['exclude', 'loader/appcache/'],
- ['include', 'loader/appcache/ApplicationCacheHost\.h$'],
- ['include', 'loader/appcache/DOMApplicationCache\.(h|cpp)$'],
-
- # Exclude some DB-related files.
- ['exclude', 'platform/sql/SQLiteFileSystem.cpp'],
- ['exclude', 'storage/DatabaseTracker.cpp'],
- ['exclude', 'storage/DatabaseTrackerClient.h'],
- ['exclude', 'storage/OriginQuotaManager.cpp'],
- ['exclude', 'storage/OriginQuotaManager.h'],
- ['exclude', 'storage/OriginUsageRecord.cpp'],
- ['exclude', 'storage/OriginUsageRecord.h'],
- ['exclude', 'storage/SQLTransactionClient.cpp'],
-
- # Exclude SVG.
- ['exclude', 'svg/'],
- ['exclude', 'css/svg/'],
- ['exclude', 'rendering/style/SVG'],
- ['exclude', 'rendering/RenderSVG'],
- ['exclude', 'rendering/SVG'],
- ],
- 'sources!': [
# A few things can't be excluded by patterns. List them individually.
- # Don't build StorageNamespace. We have our own implementation.
- '../storage/StorageNamespace.cpp',
-
- # Don't build StorageEventDispatcher. We have our own implementation.
- '../storage/StorageEventDispatcher.cpp',
-
- # Don't build IDBFactoryBackendInterface. We have our own implementation.
- '../storage/IDBFactoryBackendInterface.cpp',
-
- # Don't build IDBKeyPathBackendImpl. We have our own implementation.
- '../storage/IDBKeyPathBackendImpl.cpp',
-
- # Use history/BackForwardListChromium.cpp instead.
- '../history/BackForwardListImpl.cpp',
+ ['include', 'platform/graphics/opentype/OpenTypeSanitizer\\.cpp$'],
- # Use loader/icon/IconDatabaseNone.cpp instead.
- '../loader/icon/IconDatabase.cpp',
+ # Exclude some DB-related files.
+ ['exclude', 'platform/sql/SQLiteFileSystem\\.cpp$'],
# Use platform/KURLGoogle.cpp instead.
- '../platform/KURL.cpp',
+ ['exclude', 'platform/KURL\\.cpp$'],
# Use platform/MIMETypeRegistryChromium.cpp instead.
- '../platform/MIMETypeRegistry.cpp',
+ ['exclude', 'platform/MIMETypeRegistry\\.cpp$'],
# Theme.cpp is used only if we're using USE_NEW_THEME. We are not for
# Windows and Linux. We manually include Theme.cpp for the Mac below.
- '../platform/Theme.cpp',
-
- # Exclude some, but not all, of plugins.
- '../plugins/PluginDatabase.cpp',
- '../plugins/PluginMainThreadScheduler.cpp',
- '../plugins/PluginPackage.cpp',
- '../plugins/PluginStream.cpp',
- '../plugins/PluginView.cpp',
- '../plugins/npapi.cpp',
+ ['exclude', 'platform/Theme\\.cpp$'],
# Use LinkHashChromium.cpp instead
- '../platform/LinkHash.cpp',
-
- # Don't build these.
- # FIXME: I don't know exactly why these are excluded. It would
- # be nice to provide more explicit comments. Some of these do actually
- # compile.
- '../dom/StaticStringList.cpp',
- '../loader/icon/IconFetcher.cpp',
- '../loader/UserStyleSheetLoader.cpp',
-
- # We use a multi-process version from the WebKit API.
- '../dom/default/PlatformMessagePortChannel.cpp',
- '../dom/default/PlatformMessagePortChannel.h',
-
+ ['exclude', 'platform/LinkHash\\.cpp$'],
],
- 'link_settings': {
- 'mac_bundle_resources': [
- '../Resources/aliasCursor.png',
- '../Resources/cellCursor.png',
- '../Resources/contextMenuCursor.png',
- '../Resources/copyCursor.png',
- '../Resources/crossHairCursor.png',
- '../Resources/eastResizeCursor.png',
- '../Resources/eastWestResizeCursor.png',
- '../Resources/helpCursor.png',
- '../Resources/linkCursor.png',
- '../Resources/missingImage.png',
- '../Resources/moveCursor.png',
- '../Resources/noDropCursor.png',
- '../Resources/noneCursor.png',
- '../Resources/northEastResizeCursor.png',
- '../Resources/northEastSouthWestResizeCursor.png',
- '../Resources/northResizeCursor.png',
- '../Resources/northSouthResizeCursor.png',
- '../Resources/northWestResizeCursor.png',
- '../Resources/northWestSouthEastResizeCursor.png',
- '../Resources/notAllowedCursor.png',
- '../Resources/progressCursor.png',
- '../Resources/southEastResizeCursor.png',
- '../Resources/southResizeCursor.png',
- '../Resources/southWestResizeCursor.png',
- '../Resources/verticalTextCursor.png',
- '../Resources/waitCursor.png',
- '../Resources/westResizeCursor.png',
- '../Resources/zoomInCursor.png',
- '../Resources/zoomOutCursor.png',
- ],
- },
'conditions': [
['OS=="linux" or OS=="freebsd"', {
- 'sources': [
- '../platform/graphics/chromium/VDMXParser.cpp',
- '../platform/graphics/chromium/HarfbuzzSkia.cpp',
- ],
'sources/': [
# Cherry-pick files excluded by the broader regular expressions above.
['include', 'platform/chromium/KeyCodeConversionGtk\\.cpp$'],
@@ -1215,53 +1119,181 @@
# Chromium Mac does not use skia.
['exclude', 'platform/graphics/skia/[^/]*Skia\\.(cpp|h)$'],
- ],
- 'sources!': [
+
# The Mac uses platform/mac/KillRingMac.mm instead of the dummy
# implementation.
- '../platform/KillRingNone.cpp',
+ ['exclude', 'platform/KillRingNone\\.cpp$'],
# The Mac currently uses FontCustomPlatformData.cpp from
# platform/graphics/mac, included by regex above, instead.
- '../platform/graphics/skia/FontCustomPlatformData.cpp',
+ ['exclude', 'platform/graphics/skia/FontCustomPlatformData\\.cpp$'],
# The Mac currently uses ScrollbarThemeChromiumMac.mm, which is not
# related to ScrollbarThemeChromium.cpp.
- '../platform/chromium/ScrollbarThemeChromium.cpp',
+ ['exclude', 'platform/chromium/ScrollbarThemeChromium\\.cpp$'],
+
+ # The Mac currently uses ImageChromiumMac.mm from
+ # platform/graphics/chromium, included by regex above, instead.
+ ['exclude', 'platform/graphics/chromium/ImageChromium\\.cpp$'],
# The Mac uses ImageSourceCG.cpp from platform/graphics/cg, included
# by regex above, instead.
- '../platform/graphics/ImageSource.cpp',
-
- # RenderThemeChromiumSkia is not used on mac since RenderThemeChromiumMac
- # does not reference the Skia code that is used by Windows and Linux.
- '../rendering/RenderThemeChromiumSkia.cpp',
+ ['exclude', 'platform/graphics/ImageSource\\.cpp$'],
# Skia image-decoders are also not used on mac. CoreGraphics
# is used directly instead.
- '../platform/image-decoders/ImageDecoder.h',
- '../platform/image-decoders/bmp/BMPImageDecoder.cpp',
- '../platform/image-decoders/bmp/BMPImageDecoder.h',
- '../platform/image-decoders/bmp/BMPImageReader.cpp',
- '../platform/image-decoders/bmp/BMPImageReader.h',
- '../platform/image-decoders/gif/GIFImageDecoder.cpp',
- '../platform/image-decoders/gif/GIFImageDecoder.h',
- '../platform/image-decoders/gif/GIFImageReader.cpp',
- '../platform/image-decoders/gif/GIFImageReader.h',
- '../platform/image-decoders/ico/ICOImageDecoder.cpp',
- '../platform/image-decoders/ico/ICOImageDecoder.h',
- '../platform/image-decoders/jpeg/JPEGImageDecoder.cpp',
- '../platform/image-decoders/jpeg/JPEGImageDecoder.h',
- '../platform/image-decoders/png/PNGImageDecoder.cpp',
- '../platform/image-decoders/png/PNGImageDecoder.h',
- '../platform/image-decoders/skia/ImageDecoderSkia.cpp',
- '../platform/image-decoders/xbm/XBMImageDecoder.cpp',
- '../platform/image-decoders/xbm/XBMImageDecoder.h',
+ ['exclude', 'platform/image-decoders/ImageDecoder\\.h$'],
+ ['exclude', 'platform/image-decoders/bmp/BMPImageDecoder\\.(cpp|h)$'],
+ ['exclude', 'platform/image-decoders/bmp/BMPImageReader\\.(cpp|h)$'],
+ ['exclude', 'platform/image-decoders/gif/GIFImageDecoder\\.(cpp|h)$'],
+ ['exclude', 'platform/image-decoders/gif/GIFImageReader\\.(cpp|h)$'],
+ ['exclude', 'platform/image-decoders/ico/ICOImageDecoder\\.(cpp|h)$'],
+ ['exclude', 'platform/image-decoders/jpeg/JPEGImageDecoder\\.(cpp|h)$'],
+ ['exclude', 'platform/image-decoders/png/PNGImageDecoder\\.(cpp|h)$'],
+ ['exclude', 'platform/image-decoders/skia/ImageDecoderSkia\\.cpp$'],
+ ['exclude', 'platform/image-decoders/xbm/XBMImageDecoder\\.(cpp|h)$'],
# Again, Skia is not used on Mac.
- '../platform/chromium/DragImageChromiumSkia.cpp',
+ ['exclude', 'platform/chromium/DragImageChromiumSkia\\.cpp$'],
+ ],
+ }],
+ ['OS!="linux" and OS!="freebsd"', {
+ 'sources/': [
+ ['exclude', '(Gtk|Linux)\\.cpp$'],
+ ['exclude', 'Harfbuzz[^/]+\\.(cpp|h)$'],
+ ['exclude', 'VDMX[^/]+\\.(cpp|h)$'],
+ ],
+ }],
+ ['OS!="mac"', {
+ 'sources/': [['exclude', 'Mac\\.(cpp|mm?)$']]
+ }],
+ ['OS!="win"', {
+ 'sources/': [
+ ['exclude', 'Win\\.cpp$'],
+ ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$']
+ ],
+ }],
+ ['OS=="win"', {
+ 'sources/': [
+ ['exclude', 'Posix\\.cpp$'],
],
}],
+ ],
+ },
+ {
+ 'target_name': 'webcore_remaining',
+ 'type': '<(library)',
+ 'dependencies': [
+ 'webcore_prerequisites',
+ ],
+ # This is needed for mac because of webkit_system_interface. It'd be nice
+ # if this hard dependency could be split off the rest.
+ 'hard_dependency': 1,
+ 'sources': [
+ '<@(webcore_files)',
+ ],
+ 'sources/': [
+ # Exclude JSC custom bindings.
+ ['exclude', 'bindings/js'],
+
+ # Fortunately, many things can be excluded by using broad patterns.
+
+ # Exclude things that don't apply to the Chromium platform on the basis
+ # of their enclosing directories and tags at the ends of their
+ # filenames.
+ ['exclude', '(android|cairo|cf|cg|curl|gtk|haiku|linux|mac|opentype|platform|posix|qt|soup|svg|symbian|win|wx)/'],
+ ['exclude', '(?<!Chromium)(Android|Cairo|CF|CG|Curl|Gtk|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|Wx)\\.(cpp|mm?)$'],
+
+ # Exclude most of SVG except css and javascript bindings.
+ ['exclude', 'rendering/style/SVG[^/]+.(cpp|h)$'],
+ ['exclude', 'rendering/RenderSVG[^/]+.(cpp|h)$'],
+ ['exclude', 'rendering/SVG[^/]+.(cpp|h)$'],
+
+ # JSC-only.
+ ['exclude', 'inspector/JavaScript[^/]*\\.cpp$'],
+
+ # ENABLE_OFFLINE_WEB_APPLICATIONS, exclude most of webcore's impl
+ ['exclude', 'loader/appcache/'],
+ ['include', 'loader/appcache/ApplicationCacheHost\.h$'],
+ ['include', 'loader/appcache/DOMApplicationCache\.(h|cpp)$'],
+
+ # Exclude some DB-related files.
+ ['exclude', 'storage/DatabaseTracker\\.cpp$'],
+ ['exclude', 'storage/DatabaseTrackerClient\\.h$'],
+ ['exclude', 'storage/OriginQuotaManager\\.(cpp|h)$'],
+ ['exclude', 'storage/OriginUsageRecord\\.(cpp|h)$'],
+ ['exclude', 'storage/SQLTransactionClient\\.cpp$'],
+
+ # Don't build StorageNamespace. We have our own implementation.
+ ['exclude', 'storage/StorageNamespace\\.cpp$'],
+
+ # Don't build StorageEventDispatcher. We have our own implementation.
+ ['exclude', 'storage/StorageEventDispatcher\\.cpp$'],
+
+ # Don't build IDBFactoryBackendInterface. We have our own implementation.
+ ['exclude', 'storage/IDBFactoryBackendInterface\\.cpp$'],
+
+ # Don't build IDBKeyPathBackendImpl. We have our own implementation.
+ ['exclude', 'storage/IDBKeyPathBackendImpl\\.cpp$'],
+
+ # Use history/BackForwardListChromium.cpp instead.
+ ['exclude', 'history/BackForwardListImpl\\.cpp$'],
+
+ # Use loader/icon/IconDatabaseNone.cpp instead.
+ ['exclude', 'loader/icon/IconDatabase\\.cpp$'],
+
+ # Exclude some, but not all, of plugins.
+ ['exclude', 'plugins/PluginDatabase\\.cpp$'],
+ ['exclude', 'plugins/PluginMainThreadScheduler\\.cpp$'],
+ ['exclude', 'plugins/PluginPackage\\.cpp$'],
+ ['exclude', 'plugins/PluginStream\\.cpp$'],
+ ['exclude', 'plugins/PluginView\\.cpp$'],
+ ['exclude', 'plugins/npapi\\.cpp$'],
+
+ # FIXME: I don't know exactly why these are excluded. It would
+ # be nice to provide more explicit comments. Some of these do actually
+ # compile.
+ ['exclude', 'dom/StaticStringList\\.cpp$'],
+ ['exclude', 'loader/icon/IconFetcher\\.cpp$'],
+ ['exclude', 'loader/UserStyleSheetLoader\\.cpp$'],
+
+ # We use a multi-process version from the WebKit API.
+ ['exclude', 'dom/default/PlatformMessagePortChannel\\.(cpp|h)$'],
+ ],
+ 'link_settings': {
+ 'mac_bundle_resources': [
+ '../Resources/aliasCursor.png',
+ '../Resources/cellCursor.png',
+ '../Resources/contextMenuCursor.png',
+ '../Resources/copyCursor.png',
+ '../Resources/crossHairCursor.png',
+ '../Resources/eastResizeCursor.png',
+ '../Resources/eastWestResizeCursor.png',
+ '../Resources/helpCursor.png',
+ '../Resources/linkCursor.png',
+ '../Resources/missingImage.png',
+ '../Resources/moveCursor.png',
+ '../Resources/noDropCursor.png',
+ '../Resources/noneCursor.png',
+ '../Resources/northEastResizeCursor.png',
+ '../Resources/northEastSouthWestResizeCursor.png',
+ '../Resources/northResizeCursor.png',
+ '../Resources/northSouthResizeCursor.png',
+ '../Resources/northWestResizeCursor.png',
+ '../Resources/northWestSouthEastResizeCursor.png',
+ '../Resources/notAllowedCursor.png',
+ '../Resources/progressCursor.png',
+ '../Resources/southEastResizeCursor.png',
+ '../Resources/southResizeCursor.png',
+ '../Resources/southWestResizeCursor.png',
+ '../Resources/verticalTextCursor.png',
+ '../Resources/waitCursor.png',
+ '../Resources/westResizeCursor.png',
+ '../Resources/zoomInCursor.png',
+ '../Resources/zoomOutCursor.png',
+ ],
+ },
+ 'conditions': [
['OS=="win"', {
'sources/': [
['exclude', 'Posix\\.cpp$'],
@@ -1272,8 +1304,17 @@
['include', '/TransparencyWin\\.cpp$'],
],
}],
+ ['OS=="mac"', {
+ 'sources/': [
+ # RenderThemeChromiumSkia is not used on mac since RenderThemeChromiumMac
+ # does not reference the Skia code that is used by Windows and Linux.
+ ['exclude', 'rendering/RenderThemeChromiumSkia\\.cpp$'],
+ ],
+ }],
['OS!="linux" and OS!="freebsd"', {
- 'sources/': [['exclude', '(Gtk|Linux)\\.cpp$']]
+ 'sources/': [
+ ['exclude', '(Gtk|Linux)\\.cpp$'],
+ ],
}],
['OS!="mac"', {
'sources/': [['exclude', 'Mac\\.(cpp|mm?)$']]
@@ -1290,6 +1331,7 @@
'target_name': 'webcore',
'type': 'none',
'dependencies': [
+ 'webcore_platform',
'webcore_remaining',
# Exported.
'webcore_bindings',
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 88f0149..528dc3c 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -56,6 +56,7 @@
'dom/EventException.idl',
'dom/EventListener.idl',
'dom/EventTarget.idl',
+ 'dom/HashChangeEvent.idl',
'dom/KeyboardEvent.idl',
'dom/MessageChannel.idl',
'dom/MessageEvent.idl',
@@ -564,6 +565,7 @@
'bindings/js/JSDebugWrapperSet.h',
'bindings/js/JSDeviceMotionEventCustom.cpp',
'bindings/js/JSDeviceOrientationEventCustom.cpp',
+ 'bindings/js/JSDirectoryEntryCustom.cpp',
'bindings/js/JSDocumentCustom.cpp',
'bindings/js/JSDOMApplicationCacheCustom.cpp',
'bindings/js/JSDOMBinding.cpp',
@@ -581,6 +583,7 @@
'bindings/js/JSDOMWrapper.cpp',
'bindings/js/JSDOMWrapper.h',
'bindings/js/JSElementCustom.cpp',
+ 'bindings/js/JSEntryCustom.cpp',
'bindings/js/JSEventCustom.cpp',
'bindings/js/JSEventListener.cpp',
'bindings/js/JSEventListener.h',
@@ -759,12 +762,14 @@
'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
'bindings/v8/custom/V8DeviceMotionEventCustom.cpp',
'bindings/v8/custom/V8DeviceOrientationEventCustom.cpp',
+ 'bindings/v8/custom/V8DirectoryEntryCustom.cpp',
'bindings/v8/custom/V8DocumentLocationCustom.cpp',
'bindings/v8/custom/V8DOMFormDataCustom.cpp',
'bindings/v8/custom/V8DOMStringMapCustom.cpp',
'bindings/v8/custom/V8DOMWindowCustom.cpp',
'bindings/v8/custom/V8DocumentCustom.cpp',
'bindings/v8/custom/V8ElementCustom.cpp',
+ 'bindings/v8/custom/V8EntryCustom.cpp',
'bindings/v8/custom/V8EventCustom.cpp',
'bindings/v8/custom/V8EventSourceConstructor.cpp',
'bindings/v8/custom/V8GeolocationCustom.cpp',
@@ -1006,6 +1011,8 @@
'css/CSSProperty.h',
'css/CSSPropertyLonghand.cpp',
'css/CSSPropertyLonghand.h',
+ 'css/CSSPropertySourceData.cpp',
+ 'css/CSSPropertySourceData.h',
'css/CSSQuirkPrimitiveValue.h',
'css/CSSReflectValue.cpp',
'css/CSSReflectValue.h',
@@ -1197,6 +1204,7 @@
'dom/FragmentScriptingPermission.h',
'dom/InputElement.cpp',
'dom/InputElement.h',
+ 'dom/HashChangeEvent.h',
'dom/KeyboardEvent.cpp',
'dom/KeyboardEvent.h',
'dom/MappedAttributeEntry.h',
@@ -1783,6 +1791,8 @@
'html/parser/HTMLFormattingElementList.cpp',
'html/parser/HTMLFormattingElementList.h',
'html/parser/HTMLInputStream.h',
+ 'html/parser/HTMLParserIdioms.cpp',
+ 'html/parser/HTMLParserIdioms.h',
'html/parser/HTMLParserScheduler.cpp',
'html/parser/HTMLParserScheduler.h',
'html/parser/HTMLPreloadScanner.cpp',
@@ -1797,6 +1807,7 @@
'html/parser/HTMLTreeBuilder.h',
'html/parser/HTMLViewSourceParser.cpp',
'html/parser/HTMLViewSourceParser.h',
+ 'html/parser/NestingLevelIncrementer.h',
'html/parser/TextDocumentParser.cpp',
'html/parser/TextDocumentParser.h',
'html/parser/TextViewSourceParser.cpp',
@@ -2169,7 +2180,6 @@
'page/WorkerNavigator.h',
'page/XSSAuditor.cpp',
'page/XSSAuditor.h',
- 'page/ZoomMode.h',
'platform/animation/Animation.cpp',
'platform/animation/Animation.h',
'platform/animation/AnimationList.cpp',
@@ -2311,10 +2321,13 @@
'platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp',
'platform/graphics/chromium/GraphicsLayerChromium.cpp',
'platform/graphics/chromium/GraphicsLayerChromium.h',
+ 'platform/graphics/chromium/HarfbuzzSkia.cpp',
+ 'platform/graphics/chromium/HarfbuzzSkia.h',
'platform/graphics/chromium/IconChromiumLinux.cpp',
'platform/graphics/chromium/IconChromiumMac.cpp',
'platform/graphics/chromium/IconChromiumWin.cpp',
'platform/graphics/chromium/ImageBufferData.h',
+ 'platform/graphics/chromium/ImageChromium.cpp',
'platform/graphics/chromium/ImageChromiumMac.mm',
'platform/graphics/chromium/ImageLayerChromium.cpp',
'platform/graphics/chromium/ImageLayerChromium.h',
@@ -2334,6 +2347,8 @@
'platform/graphics/chromium/UniscribeHelperTextRun.h',
'platform/graphics/chromium/VideoLayerChromium.cpp',
'platform/graphics/chromium/VideoLayerChromium.h',
+ 'platform/graphics/chromium/VDMXParser.cpp',
+ 'platform/graphics/chromium/VDMXParser.h',
'platform/graphics/chromium/WebGLLayerChromium.cpp',
'platform/graphics/chromium/WebGLLayerChromium.h',
'platform/graphics/cocoa/FontPlatformData.h',
@@ -3330,6 +3345,10 @@
'rendering/style/StyleTransformData.h',
'rendering/style/StyleVisualData.cpp',
'rendering/style/StyleVisualData.h',
+ 'rendering/svg/SVGTextLayoutAttributes.cpp',
+ 'rendering/svg/SVGTextLayoutAttributes.h',
+ 'rendering/svg/SVGTextLayoutBuilder.cpp',
+ 'rendering/svg/SVGTextLayoutBuilder.h',
'rendering/AutoTableLayout.cpp',
'rendering/AutoTableLayout.h',
'rendering/BidiRun.cpp',
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index 48bd9ee..37bb205 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -63,6 +63,11 @@ STYLESHEETS_EMBED = \
$$PWD/css/themeQtNoListboxes.css \
$$PWD/css/themeQtMaemo5.css
+v8 {
+ IDL_BINDINGS += \
+ html/canvas/CanvasPixelArray.idl
+}
+
IDL_BINDINGS += \
css/Counter.idl \
css/CSSCharsetRule.idl \
@@ -118,6 +123,7 @@ IDL_BINDINGS += \
dom/EventException.idl \
# dom/EventListener.idl \
# dom/EventTarget.idl \
+ dom/HashChangeEvent.idl \
dom/KeyboardEvent.idl \
dom/MouseEvent.idl \
dom/MessageChannel.idl \
@@ -495,10 +501,13 @@ IDL_BINDINGS += \
INSPECTOR_INTERFACES = inspector/Inspector.idl
INSPECTOR_BACKEND_STUB_QRC = inspector/front-end/InspectorBackendStub.qrc
+v8: wrapperFactoryArg = --wrapperFactoryV8
+else: wrapperFactoryArg = --wrapperFactory
+
mathmlnames.output = $${WC_GENERATED_SOURCES_DIR}/MathMLNames.cpp
mathmlnames.input = MATHML_NAMES
mathmlnames.wkScript = $$PWD/dom/make_names.pl
-mathmlnames.commands = perl -I$$PWD/bindings/scripts $$mathmlnames.wkScript --tags $$PWD/mathml/mathtags.in --attrs $$PWD/mathml/mathattrs.in --extraDefines \"$${DEFINES}\" --preprocessor \"$${QMAKE_MOC} -E\" --factory --wrapperFactory --outputDir $$WC_GENERATED_SOURCES_DIR
+mathmlnames.commands = perl -I$$PWD/bindings/scripts $$mathmlnames.wkScript --tags $$PWD/mathml/mathtags.in --attrs $$PWD/mathml/mathattrs.in --extraDefines \"$${DEFINES}\" --preprocessor \"$${QMAKE_MOC} -E\" --factory $$wrapperFactoryArg --outputDir $$WC_GENERATED_SOURCES_DIR
mathmlnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/MathMLElementFactory.cpp
addExtraCompiler(mathmlnames)
@@ -506,7 +515,7 @@ contains(DEFINES, ENABLE_WML=1) {
wmlnames.output = $${WC_GENERATED_SOURCES_DIR}/WMLNames.cpp
wmlnames.input = WML_NAMES
wmlnames.wkScript = $$PWD/dom/make_names.pl
- wmlnames.commands = perl -I$$PWD/bindings/scripts $$wmlnames.wkScript --tags $$PWD/wml/WMLTagNames.in --attrs $$PWD/wml/WMLAttributeNames.in --extraDefines \"$${DEFINES}\" --preprocessor \"$${QMAKE_MOC} -E\" --factory --wrapperFactory --outputDir $$WC_GENERATED_SOURCES_DIR
+ wmlnames.commands = perl -I$$PWD/bindings/scripts $$wmlnames.wkScript --tags $$PWD/wml/WMLTagNames.in --attrs $$PWD/wml/WMLAttributeNames.in --extraDefines \"$${DEFINES}\" --preprocessor \"$${QMAKE_MOC} -E\" --factory $$wrapperFactoryArg --outputDir $$WC_GENERATED_SOURCES_DIR
wmlnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/WMLElementFactory.cpp
addExtraCompiler(wmlnames)
}
@@ -516,8 +525,13 @@ svgnames.output = $${WC_GENERATED_SOURCES_DIR}/SVGNames.cpp
svgnames.input = SVG_NAMES
svgnames.depends = $$PWD/svg/svgattrs.in
svgnames.wkScript = $$PWD/dom/make_names.pl
-svgnames.commands = perl -I$$PWD/bindings/scripts $$svgnames.wkScript --tags $$PWD/svg/svgtags.in --attrs $$PWD/svg/svgattrs.in --extraDefines \"$${DEFINES}\" --preprocessor \"$${QMAKE_MOC} -E\" --factory --wrapperFactory --outputDir $$WC_GENERATED_SOURCES_DIR
-svgnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/SVGElementFactory.cpp $${WC_GENERATED_SOURCES_DIR}/JSSVGElementWrapperFactory.cpp
+svgnames.commands = perl -I$$PWD/bindings/scripts $$svgnames.wkScript --tags $$PWD/svg/svgtags.in --attrs $$PWD/svg/svgattrs.in --extraDefines \"$${DEFINES}\" --preprocessor \"$${QMAKE_MOC} -E\" --factory $$wrapperFactoryArg --outputDir $$WC_GENERATED_SOURCES_DIR
+svgnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/SVGElementFactory.cpp
+v8 {
+ svgnames.wkExtraSources += $${WC_GENERATED_SOURCES_DIR}/V8SVGElementWrapperFactory.cpp
+} else {
+ svgnames.wkExtraSources += $${WC_GENERATED_SOURCES_DIR}/JSSVGElementWrapperFactory.cpp
+}
addExtraCompiler(svgnames)
# GENERATOR 5-D:
@@ -545,15 +559,26 @@ cssvalues.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_WC_GENERATED_SOURCES_DIR}/${QMAK
addExtraCompiler(cssvalues)
# GENERATOR 1: IDL compiler
-idl.output = $${WC_GENERATED_SOURCES_DIR}/JS${QMAKE_FILE_BASE}.cpp
idl.input = IDL_BINDINGS
idl.wkScript = $$PWD/bindings/scripts/generate-bindings.pl
-idl.commands = perl -I$$PWD/bindings/scripts $$idl.wkScript --defines \"$${FEATURE_DEFINES_JAVASCRIPT}\" --generator JS --include $$PWD/dom --include $$PWD/fileapi --include $$PWD/html --include $$PWD/xml --include $$PWD/svg --outputDir $$WC_GENERATED_SOURCES_DIR --preprocessor \"$${QMAKE_MOC} -E\" ${QMAKE_FILE_NAME}
-idl.depends = $$PWD/bindings/scripts/CodeGenerator.pm \
- $$PWD/bindings/scripts/CodeGeneratorJS.pm \
- $$PWD/bindings/scripts/IDLParser.pm \
- $$PWD/bindings/scripts/IDLStructure.pm \
- $$PWD/bindings/scripts/InFilesParser.pm
+v8: generator = V8
+else: generator = JS
+idl.commands = perl -I$$PWD/bindings/scripts $$idl.wkScript --defines \"$${FEATURE_DEFINES_JAVASCRIPT}\" --generator $$generator --include $$PWD/dom --include $$PWD/fileapi --include $$PWD/html --include $$PWD/xml --include $$PWD/svg --include $$PWD/storage --include $$PWD/css --include $$PWD/workers --outputDir $$WC_GENERATED_SOURCES_DIR --preprocessor \"$${QMAKE_MOC} -E\" ${QMAKE_FILE_NAME}
+v8 {
+ idl.output = $${WC_GENERATED_SOURCES_DIR}/V8${QMAKE_FILE_BASE}.cpp
+ idl.depends = $$PWD/bindings/scripts/CodeGenerator.pm \
+ $$PWD/bindings/scripts/CodeGeneratorV8.pm \
+ $$PWD/bindings/scripts/IDLParser.pm \
+ $$PWD/bindings/scripts/IDLStructure.pm \
+ $$PWD/bindings/scripts/InFilesParser.pm
+} else {
+ idl.output = $${WC_GENERATED_SOURCES_DIR}/JS${QMAKE_FILE_BASE}.cpp
+ idl.depends = $$PWD/bindings/scripts/CodeGenerator.pm \
+ $$PWD/bindings/scripts/CodeGeneratorJS.pm \
+ $$PWD/bindings/scripts/IDLParser.pm \
+ $$PWD/bindings/scripts/IDLStructure.pm \
+ $$PWD/bindings/scripts/InFilesParser.pm
+}
addExtraCompiler(idl)
# GENERATOR 2: inspector idl compiler
@@ -594,9 +619,14 @@ addExtraCompiler(cssbison)
htmlnames.output = $${WC_GENERATED_SOURCES_DIR}/HTMLNames.cpp
htmlnames.input = HTML_NAMES
htmlnames.wkScript = $$PWD/dom/make_names.pl
-htmlnames.commands = perl -I$$PWD/bindings/scripts $$htmlnames.wkScript --tags $$PWD/html/HTMLTagNames.in --attrs $$PWD/html/HTMLAttributeNames.in --extraDefines \"$${DEFINES}\" --preprocessor \"$${QMAKE_MOC} -E\" --factory --wrapperFactory --outputDir $$WC_GENERATED_SOURCES_DIR
htmlnames.depends = $$PWD/html/HTMLAttributeNames.in
-htmlnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/HTMLElementFactory.cpp $${WC_GENERATED_SOURCES_DIR}/JSHTMLElementWrapperFactory.cpp
+htmlnames.commands = perl -I$$PWD/bindings/scripts $$htmlnames.wkScript --tags $$PWD/html/HTMLTagNames.in --attrs $$PWD/html/HTMLAttributeNames.in --extraDefines \"$${DEFINES}\" --preprocessor \"$${QMAKE_MOC} -E\" --factory $$wrapperFactoryArg --outputDir $$WC_GENERATED_SOURCES_DIR
+htmlnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/HTMLElementFactory.cpp
+v8 {
+ htmlnames.wkExtraSources += $${WC_GENERATED_SOURCES_DIR}/V8HTMLElementWrapperFactory.cpp
+} else {
+ htmlnames.wkExtraSources += $${WC_GENERATED_SOURCES_DIR}/JSHTMLElementWrapperFactory.cpp
+}
addExtraCompiler(htmlnames)
# GENERATOR 5-B:
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 01bdc75..9a9a3e5 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -6,6 +6,17 @@ meegotouch {
DEFINES += WTF_USE_MEEGOTOUCH=1
}
+v8:exists($$[QT_INSTALL_PREFIX]/src/3rdparty/v8/include/v8.h) {
+ message(Using V8 with QtScript)
+ QT += script
+ INCLUDEPATH += $$[QT_INSTALL_PREFIX]/src/3rdparty/v8/include
+
+ DEFINES *= V8_BINDING=1
+ DEFINES += WTF_CHANGES=1
+ DEFINES *= WTF_USE_V8=1
+ DEFINES += USING_V8_SHARED
+}
+
symbian: {
TARGET.EPOCALLOWDLLDATA=1
# DRM and Allfiles capabilites need to be audited to be signed on Symbian
@@ -23,6 +34,13 @@ symbian: {
TARGET.UID3 = 0xE00267C2
}
webkitlibs.sources = QtWebKit$${QT_LIBINFIX}.dll
+ v8 {
+ webkitlibs.sources += v8.dll
+ QMAKE_CXXFLAGS.ARMCC += -OTime -O3
+ QMAKE_CXXFLAGS.ARMCC += --fpu softvfp+vfpv2 --fpmode fast
+ LIBS += -llibpthread
+ }
+
CONFIG(QTDIR_build): webkitlibs.sources = $$QMAKE_LIBDIR_QT/$$webkitlibs.sources
webkitlibs.path = /sys/bin
vendorinfo = \
@@ -91,7 +109,7 @@ CONFIG(QTDIR_build) {
symbian: TARGET =$$TARGET$${QT_LIBINFIX}
}
moduleFile=$$PWD/../WebKit/qt/qt_webkit_version.pri
-include($$moduleFile)
+isEmpty(QT_BUILD_TREE):include($$moduleFile)
VERSION = $${QT_WEBKIT_MAJOR_VERSION}.$${QT_WEBKIT_MINOR_VERSION}.$${QT_WEBKIT_PATCH_VERSION}
unix {
@@ -150,7 +168,7 @@ contains(DEFINES, WTF_USE_QT_MOBILE_THEME=1) {
}
include($$PWD/../JavaScriptCore/JavaScriptCore.pri)
-addJavaScriptCoreLib(../JavaScriptCore)
+!v8: addJavaScriptCoreLib(../JavaScriptCore)
webkit2 {
include($$PWD/../WebKit2/WebKit2.pri)
@@ -178,16 +196,28 @@ defineTest(addExtraCompiler) {
}
include(WebCore.pri)
+v8 {
+ WEBCORE_INCLUDEPATH = \
+ $$PWD/bindings/v8 \
+ $$PWD/bindings/v8/custom \
+ $$PWD/bindings/v8/specialization \
+ $$PWD/bridge/qt/v8
+
+} else {
+ WEBCORE_INCLUDEPATH = \
+ $$PWD/bridge/jsc \
+ $$PWD/bindings/js \
+ $$PWD/bindings/js/specialization \
+ $$PWD/bridge/c
+}
+
+
WEBCORE_INCLUDEPATH = \
$$PWD \
$$PWD/accessibility \
$$PWD/bindings \
$$PWD/bindings/generic \
- $$PWD/bindings/js \
- $$PWD/bindings/js/specialization \
$$PWD/bridge \
- $$PWD/bridge/c \
- $$PWD/bridge/jsc \
$$PWD/css \
$$PWD/dom \
$$PWD/dom/default \
@@ -220,6 +250,7 @@ WEBCORE_INCLUDEPATH = \
$$PWD/plugins \
$$PWD/rendering \
$$PWD/rendering/style \
+ $$PWD/rendering/svg \
$$PWD/storage \
$$PWD/svg \
$$PWD/svg/animation \
@@ -229,7 +260,8 @@ WEBCORE_INCLUDEPATH = \
$$PWD/wml \
$$PWD/workers \
$$PWD/xml \
- $$WC_GENERATED_SOURCES_DIR
+ $$WC_GENERATED_SOURCES_DIR \
+ $$WEBCORE_INCLUDEPATH
WEBCORE_INCLUDEPATH = \
$$PWD/bridge/qt \
@@ -286,128 +318,290 @@ SOURCES += \
accessibility/AccessibilityTableHeaderContainer.cpp \
accessibility/AccessibilityTableRow.cpp \
accessibility/AXObjectCache.cpp \
- bindings/generic/ActiveDOMCallback.cpp \
- bindings/generic/RuntimeEnabledFeatures.cpp \
- bindings/js/GCController.cpp \
- bindings/js/DOMObjectHashTableMap.cpp \
- bindings/js/DOMWrapperWorld.cpp \
- bindings/js/JSCallbackData.cpp \
- bindings/js/JSAttrCustom.cpp \
- bindings/js/JSCDATASectionCustom.cpp \
- bindings/js/JSCanvasRenderingContextCustom.cpp \
- bindings/js/JSCanvasRenderingContext2DCustom.cpp \
- bindings/js/JSClipboardCustom.cpp \
- bindings/js/JSConsoleCustom.cpp \
- bindings/js/JSCSSRuleCustom.cpp \
- bindings/js/JSCSSRuleListCustom.cpp \
- bindings/js/JSCSSStyleDeclarationCustom.cpp \
- bindings/js/JSCSSValueCustom.cpp \
- bindings/js/JSCoordinatesCustom.cpp \
- bindings/js/JSCustomPositionCallback.cpp \
- bindings/js/JSCustomPositionErrorCallback.cpp \
- bindings/js/JSCustomVoidCallback.cpp \
- bindings/js/JSCustomXPathNSResolver.cpp \
- bindings/js/JSDataGridColumnListCustom.cpp \
- bindings/js/JSDataGridDataSource.cpp \
- bindings/js/JSDebugWrapperSet.cpp \
- bindings/js/JSDesktopNotificationsCustom.cpp \
- bindings/js/JSDeviceMotionEventCustom.cpp \
- bindings/js/JSDeviceOrientationEventCustom.cpp \
- bindings/js/JSDocumentCustom.cpp \
- bindings/js/JSDOMFormDataCustom.cpp \
- bindings/js/JSDOMGlobalObject.cpp \
- bindings/js/JSDOMStringMapCustom.cpp \
- bindings/js/JSDOMWindowBase.cpp \
- bindings/js/JSDOMWindowCustom.cpp \
- bindings/js/JSDOMWindowShell.cpp \
- bindings/js/JSDOMWrapper.cpp \
- bindings/js/JSElementCustom.cpp \
- bindings/js/JSEventCustom.cpp \
- bindings/js/JSEventSourceCustom.cpp \
- bindings/js/JSEventTarget.cpp \
- bindings/js/JSExceptionBase.cpp \
- bindings/js/JSGeolocationCustom.cpp \
- bindings/js/JSHistoryCustom.cpp \
- bindings/js/JSHTMLAppletElementCustom.cpp \
- bindings/js/JSHTMLCanvasElementCustom.cpp \
- bindings/js/JSHTMLAllCollectionCustom.cpp \
- bindings/js/JSHTMLCollectionCustom.cpp \
- bindings/js/JSHTMLDataGridElementCustom.cpp \
- bindings/js/JSHTMLDocumentCustom.cpp \
- bindings/js/JSHTMLElementCustom.cpp \
- bindings/js/JSHTMLEmbedElementCustom.cpp \
- bindings/js/JSHTMLFormElementCustom.cpp \
- bindings/js/JSHTMLFrameElementCustom.cpp \
- bindings/js/JSHTMLFrameSetElementCustom.cpp \
- bindings/js/JSHTMLInputElementCustom.cpp \
- bindings/js/JSHTMLObjectElementCustom.cpp \
- bindings/js/JSHTMLOptionsCollectionCustom.cpp \
- bindings/js/JSHTMLSelectElementCustom.cpp \
- bindings/js/JSImageConstructor.cpp \
- bindings/js/JSImageDataCustom.cpp \
- bindings/js/JSInjectedScriptHostCustom.cpp \
- bindings/js/JSInspectorFrontendHostCustom.cpp \
- bindings/js/JSLocationCustom.cpp \
- bindings/js/JSNamedNodeMapCustom.cpp \
- bindings/js/JSNavigatorCustom.cpp \
- bindings/js/JSNodeCustom.cpp \
- bindings/js/JSNodeFilterCondition.cpp \
- bindings/js/JSNodeFilterCustom.cpp \
- bindings/js/JSNodeIteratorCustom.cpp \
- bindings/js/JSNodeListCustom.cpp \
- bindings/js/JSOptionConstructor.cpp \
- bindings/js/JSScriptProfileNodeCustom.cpp \
- bindings/js/JSStyleSheetCustom.cpp \
- bindings/js/JSStyleSheetListCustom.cpp \
- bindings/js/JSTextCustom.cpp \
- bindings/js/JSTreeWalkerCustom.cpp \
- bindings/js/JSWebKitCSSMatrixCustom.cpp \
- bindings/js/JSWebKitPointCustom.cpp \
- bindings/js/JSXMLHttpRequestCustom.cpp \
- bindings/js/JSXMLHttpRequestUploadCustom.cpp \
- bindings/js/JSDOMPluginCustom.cpp \
- bindings/js/JSDOMPluginArrayCustom.cpp \
- bindings/js/JSMessageChannelCustom.cpp \
- bindings/js/JSMessageEventCustom.cpp \
- bindings/js/JSMessagePortCustom.cpp \
- bindings/js/JSMessagePortCustom.h \
- bindings/js/JSDOMMimeTypeArrayCustom.cpp \
- bindings/js/JSDOMBinding.cpp \
- bindings/js/JSEventListener.cpp \
- bindings/js/JSLazyEventListener.cpp \
- bindings/js/JSMainThreadExecState.cpp \
- bindings/js/JSPluginElementFunctions.cpp \
- bindings/js/JSPopStateEventCustom.cpp \
- bindings/js/JSWorkerContextErrorHandler.cpp \
- bindings/js/ScriptCachedFrameData.cpp \
- bindings/js/ScriptCallFrame.cpp \
- bindings/js/ScriptCallStack.cpp \
- bindings/js/ScriptController.cpp \
- bindings/js/ScriptDebugServer.cpp \
- bindings/js/ScriptEventListener.cpp \
- bindings/js/ScriptFunctionCall.cpp \
- bindings/js/ScriptGCEvent.cpp \
- bindings/js/ScriptObject.cpp \
- bindings/js/ScriptProfile.cpp \
- bindings/js/ScriptState.cpp \
- bindings/js/ScriptValue.cpp \
- bindings/js/ScheduledAction.cpp \
- bindings/js/SerializedScriptValue.cpp \
- bindings/js/specialization/JSBindingState.cpp \
- bindings/ScriptControllerBase.cpp \
- bridge/IdentifierRep.cpp \
- bridge/NP_jsobject.cpp \
- bridge/npruntime.cpp \
- bridge/runtime_array.cpp \
- bridge/runtime_method.cpp \
- bridge/runtime_object.cpp \
- bridge/runtime_root.cpp \
- bridge/c/CRuntimeObject.cpp \
- bridge/c/c_class.cpp \
- bridge/c/c_instance.cpp \
- bridge/c/c_runtime.cpp \
- bridge/c/c_utility.cpp \
- bridge/jsc/BridgeJSC.cpp \
+ bindings/generic/ActiveDOMCallback.cpp
+
+v8 {
+ SOURCES += \
+ bindings/generic/RuntimeEnabledFeatures.cpp
+
+ include($$PWD/../JavaScriptCore/pcre/pcre.pri)
+ include($$PWD/../JavaScriptCore/wtf/wtf.pri)
+
+ SOURCES += \
+ bindings/generic/BindingSecurityBase.cpp \
+ \
+ bindings/v8/WorldContextHandle.cpp \
+ bindings/v8/V8IsolatedContext.cpp \
+ bindings/v8/custom/V8HistoryCustom.cpp \
+ bindings/v8/custom/V8PopStateEventCustom.cpp \
+ bindings/v8/ScriptGCEvent.cpp
+
+
+ SOURCES += \
+ bindings/v8/custom/V8CustomXPathNSResolver.cpp \
+ \
+ bindings/v8/ChildThreadDOMData.cpp \
+ bindings/v8/DateExtension.cpp \
+ bindings/v8/DOMData.cpp \
+ bindings/v8/DOMDataStore.cpp \
+ bindings/v8/MainThreadDOMData.cpp \
+ bindings/v8/NPV8Object.cpp \
+ bindings/v8/ScheduledAction.cpp \
+ bindings/v8/ScopedDOMDataStore.cpp \
+# bindings/v8/ScriptArray.cpp \
+ bindings/v8/ScriptCachedFrameData.cpp \
+ bindings/v8/ScriptCallFrame.cpp \
+ bindings/v8/ScriptCallStack.cpp \
+ bindings/ScriptControllerBase.cpp \
+ bindings/v8/ScriptController.cpp \
+ bindings/v8/ScriptEventListener.cpp \
+ bindings/v8/ScriptFunctionCall.cpp \
+ bindings/v8/ScriptInstance.cpp \
+ bindings/v8/ScriptObject.cpp \
+ bindings/v8/ScriptScope.cpp \
+ bindings/v8/ScriptState.cpp \
+ bindings/v8/ScriptStringImpl.cpp \
+ bindings/v8/ScriptValue.cpp \
+ bindings/v8/StaticDOMDataStore.cpp \
+ bindings/v8/SerializedScriptValue.cpp \
+ bindings/v8/V8AbstractEventListener.cpp \
+ bindings/v8/V8Binding.cpp \
+ bindings/v8/V8Collection.cpp \
+ bindings/v8/V8ConsoleMessage.cpp \
+ bindings/v8/V8DOMMap.cpp \
+ bindings/v8/V8DOMWrapper.cpp \
+ bindings/v8/V8DataGridDataSource.cpp \
+ bindings/v8/V8EventListenerList.cpp \
+ bindings/v8/V8GCController.cpp \
+ bindings/v8/V8GCForContextDispose.cpp \
+ bindings/v8/V8Helpers.cpp \
+ bindings/v8/V8HiddenPropertyName.cpp \
+ bindings/v8/IsolatedWorld.cpp \
+ bindings/v8/V8LazyEventListener.cpp \
+ bindings/v8/V8NPObject.cpp \
+ bindings/v8/V8NPUtils.cpp \
+ bindings/v8/V8NodeFilterCondition.cpp \
+ bindings/v8/V8Proxy.cpp \
+ bindings/v8/V8Utilities.cpp \
+ bindings/v8/V8WorkerContextEventListener.cpp \
+ bindings/v8/WorkerContextExecutionProxy.cpp \
+ bindings/v8/WorkerScriptController.cpp \
+ \
+ bindings/v8/V8DOMWindowShell.cpp \
+ bindings/v8/DOMWrapperWorld.cpp \
+ \
+ bindings/v8/npruntime.cpp \
+ \
+ bindings/v8/custom/V8CSSRuleCustom.cpp \
+ bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \
+ bindings/v8/custom/V8CSSStyleSheetCustom.cpp \
+ bindings/v8/custom/V8CSSValueCustom.cpp \
+ bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \
+ bindings/v8/custom/V8CanvasPixelArrayCustom.cpp \
+ bindings/v8/custom/V8ClipboardCustom.cpp \
+ bindings/v8/custom/V8CoordinatesCustom.cpp \
+ bindings/v8/custom/V8InjectedScriptHostCustom.cpp \
+ bindings/v8/custom/V8InspectorFrontendHostCustom.cpp \
+ bindings/v8/custom/V8CustomEventListener.cpp \
+ bindings/v8/custom/V8DOMStringMapCustom.cpp
+
+ SOURCES += \
+ bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp \
+ bindings/v8/custom/V8CustomVoidCallback.cpp \
+ bindings/v8/custom/V8DOMFormDataCustom.cpp \
+ bindings/v8/custom/V8DOMWindowCustom.cpp \
+ bindings/v8/custom/V8DataGridColumnListCustom.cpp \
+# bindings/v8/custom/V8DatabaseCustom.cpp \
+ bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp \
+ bindings/v8/custom/V8DocumentCustom.cpp \
+ bindings/v8/custom/V8DocumentLocationCustom.cpp \
+ bindings/v8/custom/V8ElementCustom.cpp \
+ bindings/v8/custom/V8EventCustom.cpp \
+ bindings/v8/custom/V8EventSourceConstructor.cpp \
+ bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
+
+ contains(DEFINES, ENABLE_VIDEO=1) {
+ SOURCES += \
+ bindings/v8/custom/V8HTMLAudioElementConstructor.cpp
+ }
+
+ SOURCES += \
+ bindings/v8/custom/V8HTMLCanvasElementCustom.cpp \
+ bindings/v8/custom/V8HTMLCollectionCustom.cpp \
+ bindings/v8/custom/V8HTMLDataGridElementCustom.cpp \
+ bindings/v8/custom/V8HTMLDocumentCustom.cpp \
+ bindings/v8/custom/V8HTMLElementCustom.cpp \
+ bindings/v8/custom/V8HTMLFormElementCustom.cpp \
+ bindings/v8/custom/V8HTMLFrameElementCustom.cpp \
+ bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp \
+# bindings/v8/custom/V8HTMLIFrameElementCustom.cpp \
+ bindings/v8/custom/V8HTMLImageElementConstructor.cpp \
+ bindings/v8/custom/V8HTMLInputElementCustom.cpp \
+ bindings/v8/custom/V8HTMLOptionElementConstructor.cpp \
+ bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp \
+ bindings/v8/custom/V8HTMLPlugInElementCustom.cpp \
+ bindings/v8/custom/V8HTMLSelectElementCustom.cpp \
+ bindings/v8/custom/V8LocationCustom.cpp \
+ bindings/v8/custom/V8MessageChannelConstructor.cpp \
+ bindings/v8/custom/V8MessagePortCustom.cpp \
+ bindings/v8/custom/V8MessageEventCustom.cpp \
+ bindings/v8/custom/V8NamedNodeMapCustom.cpp \
+ bindings/v8/custom/V8NamedNodesCollection.cpp \
+ bindings/v8/custom/V8NodeCustom.cpp \
+ bindings/v8/custom/V8NodeListCustom.cpp \
+ bindings/v8/custom/V8SQLResultSetRowListCustom.cpp \
+ bindings/v8/custom/V8SQLTransactionCustom.cpp \
+ bindings/v8/custom/V8WebSocketCustom.cpp \
+ \
+ bindings/v8/custom/V8SharedWorkerCustom.cpp \
+ bindings/v8/custom/V8StorageCustom.cpp \
+ bindings/v8/custom/V8StyleSheetCustom.cpp \
+ bindings/v8/custom/V8StyleSheetListCustom.cpp \
+ bindings/v8/custom/V8WebKitCSSMatrixConstructor.cpp \
+ bindings/v8/custom/V8WebKitPointConstructor.cpp \
+ bindings/v8/custom/V8WorkerContextCustom.cpp \
+ bindings/v8/custom/V8WorkerCustom.cpp \
+ bindings/v8/custom/V8XMLHttpRequestConstructor.cpp \
+ bindings/v8/custom/V8XMLHttpRequestCustom.cpp \
+ \
+ bindings/v8/custom/V8SVGDocumentCustom.cpp \
+ bindings/v8/custom/V8SVGElementCustom.cpp \
+ bindings/v8/custom/V8SVGLengthCustom.cpp \
+ bindings/v8/custom/V8SVGMatrixCustom.cpp \
+ bindings/v8/custom/V8SVGPathSegCustom.cpp \
+ \
+ bindings/v8/specialization/V8BindingState.cpp\
+ \
+ bindings/v8/custom/V8NotificationCenterCustom.cpp \
+ bindings/v8/custom/V8ConsoleCustom.cpp \
+# bindings/v8/custom/V8DatabaseSyncCustom.cpp \
+ bindings/v8/custom/V8SQLTransactionSyncCustom.cpp \
+ bindings/v8/V8WorkerContextErrorHandler.cpp
+} else {
+ SOURCES += \
+ bindings/js/GCController.cpp \
+ bindings/js/DOMObjectHashTableMap.cpp \
+ bindings/js/DOMWrapperWorld.cpp \
+ bindings/js/JSCallbackData.cpp \
+ bindings/js/JSAttrCustom.cpp \
+ bindings/js/JSCDATASectionCustom.cpp \
+ bindings/js/JSCanvasRenderingContextCustom.cpp \
+ bindings/js/JSCanvasRenderingContext2DCustom.cpp \
+ bindings/js/JSClipboardCustom.cpp \
+ bindings/js/JSConsoleCustom.cpp \
+ bindings/js/JSCSSRuleCustom.cpp \
+ bindings/js/JSCSSRuleListCustom.cpp \
+ bindings/js/JSCSSStyleDeclarationCustom.cpp \
+ bindings/js/JSCSSValueCustom.cpp \
+ bindings/js/JSCoordinatesCustom.cpp \
+ bindings/js/JSCustomPositionCallback.cpp \
+ bindings/js/JSCustomPositionErrorCallback.cpp \
+ bindings/js/JSCustomVoidCallback.cpp \
+ bindings/js/JSCustomXPathNSResolver.cpp \
+ bindings/js/JSDataGridColumnListCustom.cpp \
+ bindings/js/JSDataGridDataSource.cpp \
+ bindings/js/JSDebugWrapperSet.cpp \
+ bindings/js/JSDesktopNotificationsCustom.cpp \
+ bindings/js/JSDeviceMotionEventCustom.cpp \
+ bindings/js/JSDeviceOrientationEventCustom.cpp \
+ bindings/js/JSDocumentCustom.cpp \
+ bindings/js/JSDOMFormDataCustom.cpp \
+ bindings/js/JSDOMGlobalObject.cpp \
+ bindings/js/JSDOMStringMapCustom.cpp \
+ bindings/js/JSDOMWindowBase.cpp \
+ bindings/js/JSDOMWindowCustom.cpp \
+ bindings/js/JSDOMWindowShell.cpp \
+ bindings/js/JSDOMWrapper.cpp \
+ bindings/js/JSElementCustom.cpp \
+ bindings/js/JSEventCustom.cpp \
+ bindings/js/JSEventSourceCustom.cpp \
+ bindings/js/JSEventTarget.cpp \
+ bindings/js/JSExceptionBase.cpp \
+ bindings/js/JSGeolocationCustom.cpp \
+ bindings/js/JSHistoryCustom.cpp \
+ bindings/js/JSHTMLAppletElementCustom.cpp \
+ bindings/js/JSHTMLCanvasElementCustom.cpp \
+ bindings/js/JSHTMLAllCollectionCustom.cpp \
+ bindings/js/JSHTMLCollectionCustom.cpp \
+ bindings/js/JSHTMLDataGridElementCustom.cpp \
+ bindings/js/JSHTMLDocumentCustom.cpp \
+ bindings/js/JSHTMLElementCustom.cpp \
+ bindings/js/JSHTMLEmbedElementCustom.cpp \
+ bindings/js/JSHTMLFormElementCustom.cpp \
+ bindings/js/JSHTMLFrameElementCustom.cpp \
+ bindings/js/JSHTMLFrameSetElementCustom.cpp \
+ bindings/js/JSHTMLInputElementCustom.cpp \
+ bindings/js/JSHTMLObjectElementCustom.cpp \
+ bindings/js/JSHTMLOptionsCollectionCustom.cpp \
+ bindings/js/JSHTMLSelectElementCustom.cpp \
+ bindings/js/JSImageConstructor.cpp \
+ bindings/js/JSImageDataCustom.cpp \
+ bindings/js/JSInjectedScriptHostCustom.cpp \
+ bindings/js/JSInspectorFrontendHostCustom.cpp \
+ bindings/js/JSLocationCustom.cpp \
+ bindings/js/JSNamedNodeMapCustom.cpp \
+ bindings/js/JSNavigatorCustom.cpp \
+ bindings/js/JSNodeCustom.cpp \
+ bindings/js/JSNodeFilterCondition.cpp \
+ bindings/js/JSNodeFilterCustom.cpp \
+ bindings/js/JSNodeIteratorCustom.cpp \
+ bindings/js/JSNodeListCustom.cpp \
+ bindings/js/JSOptionConstructor.cpp \
+ bindings/js/JSScriptProfileNodeCustom.cpp \
+ bindings/js/JSStyleSheetCustom.cpp \
+ bindings/js/JSStyleSheetListCustom.cpp \
+ bindings/js/JSTextCustom.cpp \
+ bindings/js/JSTreeWalkerCustom.cpp \
+ bindings/js/JSWebKitCSSMatrixCustom.cpp \
+ bindings/js/JSWebKitPointCustom.cpp \
+ bindings/js/JSXMLHttpRequestCustom.cpp \
+ bindings/js/JSXMLHttpRequestUploadCustom.cpp \
+ bindings/js/JSDOMPluginCustom.cpp \
+ bindings/js/JSDOMPluginArrayCustom.cpp \
+ bindings/js/JSMessageChannelCustom.cpp \
+ bindings/js/JSMessageEventCustom.cpp \
+ bindings/js/JSMessagePortCustom.cpp \
+ bindings/js/JSMessagePortCustom.h \
+ bindings/js/JSDOMMimeTypeArrayCustom.cpp \
+ bindings/js/JSDOMBinding.cpp \
+ bindings/js/JSEventListener.cpp \
+ bindings/js/JSLazyEventListener.cpp \
+ bindings/js/JSMainThreadExecState.cpp \
+ bindings/js/JSPluginElementFunctions.cpp \
+ bindings/js/JSPopStateEventCustom.cpp \
+ bindings/js/JSWorkerContextErrorHandler.cpp \
+ bindings/js/ScriptCachedFrameData.cpp \
+ bindings/js/ScriptCallFrame.cpp \
+ bindings/js/ScriptCallStack.cpp \
+ bindings/js/ScriptController.cpp \
+ bindings/js/ScriptDebugServer.cpp \
+ bindings/js/ScriptEventListener.cpp \
+ bindings/js/ScriptFunctionCall.cpp \
+ bindings/js/ScriptGCEvent.cpp \
+ bindings/js/ScriptObject.cpp \
+ bindings/js/ScriptProfile.cpp \
+ bindings/js/ScriptState.cpp \
+ bindings/js/ScriptValue.cpp \
+ bindings/js/ScheduledAction.cpp \
+ bindings/js/SerializedScriptValue.cpp \
+ bindings/js/specialization/JSBindingState.cpp \
+ bindings/ScriptControllerBase.cpp \
+ bridge/IdentifierRep.cpp \
+ bridge/NP_jsobject.cpp \
+ bridge/npruntime.cpp \
+ bridge/runtime_array.cpp \
+ bridge/runtime_method.cpp \
+ bridge/runtime_object.cpp \
+ bridge/runtime_root.cpp \
+ bridge/c/CRuntimeObject.cpp \
+ bridge/c/c_class.cpp \
+ bridge/c/c_instance.cpp \
+ bridge/c/c_runtime.cpp \
+ bridge/c/c_utility.cpp \
+ bridge/jsc/BridgeJSC.cpp
+}
+
+SOURCES += \
css/CSSBorderImageValue.cpp \
css/CSSCanvasValue.cpp \
css/CSSCharsetRule.cpp \
@@ -435,6 +629,7 @@ SOURCES += \
css/CSSPrimitiveValue.cpp \
css/CSSProperty.cpp \
css/CSSPropertyLonghand.cpp \
+ css/CSSPropertySourceData.cpp \
css/CSSReflectValue.cpp \
css/CSSRule.cpp \
css/CSSRuleList.cpp \
@@ -751,6 +946,7 @@ SOURCES += \
html/parser/HTMLEntityParser.cpp \
html/parser/HTMLEntitySearch.cpp \
html/parser/HTMLFormattingElementList.cpp \
+ html/parser/HTMLParserIdioms.cpp \
html/parser/HTMLParserScheduler.cpp \
html/parser/HTMLPreloadScanner.cpp \
html/parser/HTMLScriptRunner.cpp \
@@ -984,6 +1180,8 @@ SOURCES += \
platform/text/transcoder/FontTranscoder.cpp \
platform/UUID.cpp \
platform/Widget.cpp \
+ platform/PlatformStrategies.cpp \
+ platform/LocalizedStrings.cpp \
plugins/PluginDatabase.cpp \
plugins/PluginDebug.cpp \
plugins/PluginPackage.cpp \
@@ -1116,86 +1314,166 @@ HEADERS += \
accessibility/AccessibilityTableRow.h \
accessibility/AXObjectCache.h \
bindings/ScriptControllerBase.h \
- bindings/generic/ActiveDOMCallback.h \
- bindings/js/CachedScriptSourceProvider.h \
- bindings/js/GCController.h \
- bindings/js/DOMObjectHashTableMap.h \
- bindings/js/DOMWrapperWorld.h \
- bindings/js/JSCallbackData.h \
- bindings/js/JSAudioConstructor.h \
- bindings/js/JSCSSStyleDeclarationCustom.h \
- bindings/js/JSCustomPositionCallback.h \
- bindings/js/JSCustomPositionErrorCallback.h \
- bindings/js/JSCustomVoidCallback.h \
- bindings/js/JSCustomXPathNSResolver.h \
- bindings/js/JSDataGridDataSource.h \
- bindings/js/JSDebugWrapperSet.h \
- bindings/js/JSDOMBinding.h \
- bindings/js/JSDOMGlobalObject.h \
- bindings/js/JSDOMStringMapCustom.h \
- bindings/js/JSDOMWindowBase.h \
- bindings/js/JSDOMWindowCustom.h \
- bindings/js/JSDOMWindowShell.h \
- bindings/js/JSDOMWrapper.h \
- bindings/js/JSEventListener.h \
- bindings/js/JSEventTarget.h \
- bindings/js/JSHistoryCustom.h \
- bindings/js/JSHTMLAppletElementCustom.h \
- bindings/js/JSHTMLEmbedElementCustom.h \
- bindings/js/JSHTMLInputElementCustom.h \
- bindings/js/JSHTMLObjectElementCustom.h \
- bindings/js/JSHTMLSelectElementCustom.h \
- bindings/js/JSImageConstructor.h \
- bindings/js/JSLazyEventListener.h \
- bindings/js/JSLocationCustom.h \
- bindings/js/JSNodeCustom.h \
- bindings/js/JSNodeFilterCondition.h \
- bindings/js/JSOptionConstructor.h \
- bindings/js/JSPluginElementFunctions.h \
- bindings/js/JSStorageCustom.h \
- bindings/js/JSWorkerContextBase.h \
- bindings/js/JSWorkerContextErrorHandler.h \
- bindings/js/JavaScriptCallFrame.h \
- bindings/js/ScheduledAction.h \
- bindings/js/ScriptCachedFrameData.h \
- bindings/js/ScriptCallFrame.h \
- bindings/js/ScriptCallStack.h \
- bindings/js/ScriptController.h \
- bindings/js/ScriptEventListener.h \
- bindings/js/ScriptFunctionCall.h \
- bindings/js/ScriptGCEvent.h \
- bindings/js/ScriptHeapSnapshot.h \
- bindings/js/ScriptObject.h \
- bindings/js/ScriptProfile.h \
- bindings/js/ScriptProfileNode.h \
- bindings/js/ScriptProfiler.h \
- bindings/js/ScriptSourceCode.h \
- bindings/js/ScriptSourceProvider.h \
- bindings/js/ScriptState.h \
- bindings/js/ScriptValue.h \
- bindings/js/ScriptWrappable.h \
- bindings/js/SerializedScriptValue.h \
- bindings/js/StringSourceProvider.h \
- bindings/js/WebCoreJSClientData.h \
- bindings/js/WorkerScriptController.h \
- bridge/Bridge.h \
- bridge/c/CRuntimeObject.h \
- bridge/c/c_class.h \
- bridge/c/c_instance.h \
- bridge/c/c_runtime.h \
- bridge/c/c_utility.h \
- bridge/jsc/BridgeJSC.h \
- bridge/IdentifierRep.h \
- bridge/NP_jsobject.h \
- bridge/npruntime.h \
- bridge/qt/qt_class.h \
- bridge/qt/qt_instance.h \
- bridge/qt/qt_runtime.h \
- bridge/qt/qt_pixmapruntime.h \
- bridge/runtime_array.h \
- bridge/runtime_method.h \
- bridge/runtime_object.h \
- bridge/runtime_root.h \
+ bindings/generic/ActiveDOMCallback.h
+
+v8 {
+ HEADERS += \
+ bindings/v8/custom/V8CustomEventListener.h \
+ bindings/v8/custom/V8CustomPositionCallback.h \
+ bindings/v8/custom/V8CustomPositionErrorCallback.h \
+ bindings/v8/custom/V8CustomVoidCallback.h \
+ bindings/v8/custom/V8CustomXPathNSResolver.h \
+ bindings/v8/custom/V8HTMLAudioElementConstructor.h \
+ bindings/v8/custom/V8HTMLImageElementConstructor.h \
+ bindings/v8/custom/V8HTMLOptionElementConstructor.h \
+ bindings/v8/custom/V8HTMLSelectElementCustom.h \
+ bindings/v8/custom/V8MessagePortCustom.h \
+ bindings/v8/custom/V8NamedNodesCollection.h \
+ \
+ bindings/v8/ChildThreadDOMData.h \
+ bindings/v8/DateExtension.h \
+ bindings/v8/DOMData.h \
+ bindings/v8/DOMDataStore.h \
+ bindings/v8/DOMWrapperWorld.h \
+ bindings/v8/IsolatedWorld.h \
+ bindings/v8/MainThreadDOMData.h \
+ bindings/v8/npruntime_impl.h \
+ bindings/v8/npruntime_internal.h \
+ bindings/v8/npruntime_priv.h \
+ bindings/v8/NPV8Object.h \
+ bindings/v8/OwnHandle.h \
+ bindings/generic/RuntimeEnabledFeatures.h \
+ bindings/v8/ScheduledAction.h \
+ bindings/v8/ScopedDOMDataStore.h \
+# bindings/v8/ScriptArray.h \
+ bindings/v8/ScriptCachedFrameData.h \
+ bindings/v8/ScriptCallFrame.h \
+ bindings/v8/ScriptCallStack.h \
+ bindings/v8/ScriptController.h \
+ bindings/v8/ScriptEventListener.h \
+ bindings/v8/ScriptFunctionCall.h \
+ bindings/v8/ScriptInstance.h \
+ bindings/v8/ScriptObject.h \
+ bindings/v8/ScriptProfile.h \
+ bindings/v8/ScriptProfiler.h \
+ bindings/v8/ScriptScope.h \
+ bindings/v8/ScriptSourceCode.h \
+ bindings/v8/ScriptState.h \
+ bindings/v8/ScriptString.h \
+ bindings/v8/ScriptStringImpl.h \
+ bindings/v8/ScriptValue.h \
+ bindings/v8/ScriptWrappable.h \
+ bindings/v8/SerializedScriptValue.h \
+ bindings/v8/SharedPersistent.h \
+ bindings/v8/StaticDOMDataStore.h \
+ bindings/v8/V8AbstractEventListener.h \
+ bindings/v8/V8Binding.h \
+ bindings/v8/V8Collection.h \
+ bindings/v8/V8ConsoleMessage.h \
+ bindings/v8/V8DataGridDataSource.h \
+ bindings/v8/V8DOMMap.h \
+ bindings/v8/V8DOMWindowShell.h \
+ bindings/v8/V8DOMWrapper.h \
+ bindings/v8/V8EventListenerList.h \
+ bindings/v8/V8GCController.h \
+ bindings/v8/V8Helpers.h \
+ bindings/v8/V8HiddenPropertyName.h \
+ bindings/v8/V8IsolatedContext.h \
+ bindings/v8/V8LazyEventListener.h \
+ bindings/v8/V8NodeFilterCondition.h \
+ bindings/v8/V8NPObject.h \
+ bindings/v8/V8NPUtils.h \
+ bindings/v8/V8Proxy.h \
+ bindings/v8/V8SVGPODTypeWrapper.h \
+ bindings/v8/V8Utilities.h \
+ bindings/v8/V8WorkerContextEventListener.h \
+ bindings/v8/WorkerContextExecutionProxy.h \
+ bindings/v8/WorkerScriptController.h \
+ bindings/v8/WorldContextHandle.h
+} else {
+ HEADERS += \
+ bindings/js/CachedScriptSourceProvider.h \
+ bindings/js/GCController.h \
+ bindings/js/DOMObjectHashTableMap.h \
+ bindings/js/DOMWrapperWorld.h \
+ bindings/js/JSCallbackData.h \
+ bindings/js/JSAudioConstructor.h \
+ bindings/js/JSCSSStyleDeclarationCustom.h \
+ bindings/js/JSCustomPositionCallback.h \
+ bindings/js/JSCustomPositionErrorCallback.h \
+ bindings/js/JSCustomVoidCallback.h \
+ bindings/js/JSCustomXPathNSResolver.h \
+ bindings/js/JSDataGridDataSource.h \
+ bindings/js/JSDebugWrapperSet.h \
+ bindings/js/JSDOMBinding.h \
+ bindings/js/JSDOMGlobalObject.h \
+ bindings/js/JSDOMStringMapCustom.h \
+ bindings/js/JSDOMWindowBase.h \
+ bindings/js/JSDOMWindowCustom.h \
+ bindings/js/JSDOMWindowShell.h \
+ bindings/js/JSDOMWrapper.h \
+ bindings/js/JSEventListener.h \
+ bindings/js/JSEventTarget.h \
+ bindings/js/JSHistoryCustom.h \
+ bindings/js/JSHTMLAppletElementCustom.h \
+ bindings/js/JSHTMLEmbedElementCustom.h \
+ bindings/js/JSHTMLInputElementCustom.h \
+ bindings/js/JSHTMLObjectElementCustom.h \
+ bindings/js/JSHTMLSelectElementCustom.h \
+ bindings/js/JSImageConstructor.h \
+ bindings/js/JSLazyEventListener.h \
+ bindings/js/JSLocationCustom.h \
+ bindings/js/JSNodeCustom.h \
+ bindings/js/JSNodeFilterCondition.h \
+ bindings/js/JSOptionConstructor.h \
+ bindings/js/JSPluginElementFunctions.h \
+ bindings/js/JSStorageCustom.h \
+ bindings/js/JSWorkerContextBase.h \
+ bindings/js/JSWorkerContextErrorHandler.h \
+ bindings/js/JavaScriptCallFrame.h \
+ bindings/js/ScheduledAction.h \
+ bindings/js/ScriptCachedFrameData.h \
+ bindings/js/ScriptCallFrame.h \
+ bindings/js/ScriptCallStack.h \
+ bindings/js/ScriptController.h \
+ bindings/js/ScriptEventListener.h \
+ bindings/js/ScriptFunctionCall.h \
+ bindings/js/ScriptGCEvent.h \
+ bindings/js/ScriptHeapSnapshot.h \
+ bindings/js/ScriptObject.h \
+ bindings/js/ScriptProfile.h \
+ bindings/js/ScriptProfileNode.h \
+ bindings/js/ScriptProfiler.h \
+ bindings/js/ScriptSourceCode.h \
+ bindings/js/ScriptSourceProvider.h \
+ bindings/js/ScriptState.h \
+ bindings/js/ScriptValue.h \
+ bindings/js/ScriptWrappable.h \
+ bindings/js/SerializedScriptValue.h \
+ bindings/js/StringSourceProvider.h \
+ bindings/js/WebCoreJSClientData.h \
+ bindings/js/WorkerScriptController.h \
+ bridge/Bridge.h \
+ bridge/c/CRuntimeObject.h \
+ bridge/c/c_class.h \
+ bridge/c/c_instance.h \
+ bridge/c/c_runtime.h \
+ bridge/c/c_utility.h \
+ bridge/jsc/BridgeJSC.h \
+ bridge/IdentifierRep.h \
+ bridge/NP_jsobject.h \
+ bridge/npruntime.h \
+ bridge/qt/qt_class.h \
+ bridge/qt/qt_instance.h \
+ bridge/qt/qt_runtime.h \
+ bridge/qt/qt_pixmapruntime.h \
+ bridge/runtime_array.h \
+ bridge/runtime_method.h \
+ bridge/runtime_object.h \
+ bridge/runtime_root.h
+}
+
+HEADERS += \
css/CSSBorderImageValue.h \
css/CSSCanvasValue.h \
css/CSSCharsetRule.h \
@@ -1438,6 +1716,7 @@ HEADERS += \
html/DOMDataGridDataSource.h \
html/DOMFormData.h \
html/FormDataList.h \
+ html/FTPDirectoryDocument.h \
html/HTMLAllCollection.h \
html/HTMLAnchorElement.h \
html/HTMLAppletElement.h \
@@ -1524,8 +1803,11 @@ HEADERS += \
html/HTMLVideoElement.h \
html/HTMLViewSourceDocument.h \
html/ImageData.h \
+ html/ImageDocument.h \
html/ImageResizerThread.h \
html/LabelsNodeList.h \
+ html/MediaDocument.h \
+ html/PluginDocument.h \
html/StepRange.h \
html/TextDocument.h \
html/TimeRanges.h \
@@ -1591,21 +1873,17 @@ HEADERS += \
loader/FormState.h \
loader/FrameLoader.h \
loader/FrameLoaderStateMachine.h \
- loader/FTPDirectoryDocument.h \
loader/FTPDirectoryParser.h \
loader/icon/IconDatabase.h \
loader/icon/IconLoader.h \
loader/icon/IconRecord.h \
loader/icon/PageURLRecord.h \
- loader/ImageDocument.h \
loader/ImageLoader.h \
loader/loader.h \
loader/MainResourceLoader.h \
- loader/MediaDocument.h \
loader/NavigationAction.h \
loader/NetscapePlugInStreamLoader.h \
loader/PlaceholderDocument.h \
- loader/PluginDocument.h \
loader/ProgressTracker.h \
loader/Request.h \
loader/ResourceLoader.h \
@@ -1678,7 +1956,6 @@ HEADERS += \
page/WindowFeatures.h \
page/WorkerNavigator.h \
page/XSSAuditor.h \
- page/ZoomMode.h \
platform/animation/Animation.h \
platform/animation/AnimationList.h \
platform/Arena.h \
@@ -1759,6 +2036,7 @@ HEADERS += \
platform/text/LineEnding.h \
platform/LinkHash.h \
platform/Logging.h \
+ platform/Language.h \
platform/MIMETypeRegistry.h \
platform/network/AuthenticationChallengeBase.h \
platform/network/AuthenticationClient.h \
@@ -1821,6 +2099,8 @@ HEADERS += \
platform/ThreadTimers.h \
platform/Timer.h \
platform/Widget.h \
+ platform/PlatformStrategies.h \
+ platform/LocalizedStrings.h \
plugins/DOMMimeTypeArray.h \
plugins/DOMMimeType.h \
plugins/DOMPluginArray.h \
@@ -1969,6 +2249,8 @@ HEADERS += \
rendering/style/StyleVisualData.h \
rendering/style/SVGRenderStyleDefs.h \
rendering/style/SVGRenderStyle.h \
+ rendering/svg/SVGTextLayoutAttributes.h \
+ rendering/svg/SVGTextLayoutBuilder.h \
rendering/SVGCharacterData.h \
rendering/SVGCharacterLayoutInfo.h \
rendering/SVGImageBufferTools.h \
@@ -2230,15 +2512,24 @@ HEADERS += \
$$PWD/../WebKit/qt/WebCoreSupport/QtPlatformPlugin.h \
$$PWD/../WebKit/qt/WebCoreSupport/PopupMenuQt.h \
$$PWD/../WebKit/qt/WebCoreSupport/SearchPopupMenuQt.h \
+ $$PWD/../WebKit/qt/WebCoreSupport/WebPlatformStrategies.h \
$$PWD/platform/network/qt/DnsPrefetchHelper.h
+v8 {
+ SOURCES += \
+ bindings/v8/ScriptControllerQt.cpp \
+ platform/qt/PlatformBridgeQt.cpp
+} else {
+ SOURCES += \
+ bindings/js/ScriptControllerQt.cpp \
+ bridge/qt/qt_class.cpp \
+ bridge/qt/qt_instance.cpp \
+ bridge/qt/qt_pixmapruntime.cpp \
+ bridge/qt/qt_runtime.cpp
+}
+
SOURCES += \
accessibility/qt/AccessibilityObjectQt.cpp \
- bindings/js/ScriptControllerQt.cpp \
- bridge/qt/qt_class.cpp \
- bridge/qt/qt_instance.cpp \
- bridge/qt/qt_pixmapruntime.cpp \
- bridge/qt/qt_runtime.cpp \
page/qt/DragControllerQt.cpp \
page/qt/EventHandlerQt.cpp \
page/qt/FrameQt.cpp \
@@ -2286,7 +2577,6 @@ SOURCES += \
platform/graphics/qt/SimpleFontDataQt.cpp \
platform/graphics/qt/TileQt.cpp \
platform/qt/KURLQt.cpp \
- platform/qt/Localizations.cpp \
platform/qt/MIMETypeRegistryQt.cpp \
platform/qt/PasteboardQt.cpp \
platform/qt/PlatformKeyboardEventQt.cpp \
@@ -2301,13 +2591,13 @@ SOURCES += \
platform/qt/SharedTimerQt.cpp \
platform/qt/SoundQt.cpp \
platform/qt/LoggingQt.cpp \
+ platform/qt/Language.cpp \
platform/qt/TemporaryLinkStubsQt.cpp \
platform/text/qt/TextBoundariesQt.cpp \
platform/text/qt/TextBreakIteratorQt.cpp \
platform/text/qt/TextCodecQt.cpp \
platform/qt/WheelEventQt.cpp \
platform/qt/WidgetQt.cpp \
- plugins/qt/PluginDataQt.cpp \
../WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp \
../WebKit/qt/WebCoreSupport/ChromeClientQt.cpp \
../WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp \
@@ -2324,6 +2614,7 @@ SOURCES += \
../WebKit/qt/WebCoreSupport/PopupMenuQt.cpp \
../WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp \
../WebKit/qt/WebCoreSupport/SearchPopupMenuQt.cpp \
+ ../WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp \
../WebKit/qt/Api/qwebframe.cpp \
../WebKit/qt/Api/qgraphicswebview.cpp \
../WebKit/qt/Api/qwebpage.cpp \
@@ -2504,16 +2795,24 @@ contains(DEFINES, ENABLE_DATABASE=1) {
storage/SQLTransaction.cpp \
storage/SQLTransactionClient.cpp \
storage/SQLTransactionCoordinator.cpp \
- storage/SQLTransactionSync.cpp \
- bindings/js/JSCustomSQLStatementErrorCallback.cpp \
- bindings/js/JSSQLResultSetRowListCustom.cpp \
- bindings/js/JSSQLTransactionCustom.cpp \
- bindings/js/JSSQLTransactionSyncCustom.cpp
+ storage/SQLTransactionSync.cpp
+
+ !v8 {
+ SOURCES += \
+ bindings/js/JSCustomSQLStatementErrorCallback.cpp \
+ bindings/js/JSSQLResultSetRowListCustom.cpp \
+ bindings/js/JSSQLTransactionCustom.cpp \
+ bindings/js/JSSQLTransactionSyncCustom.cpp
+ }
}
contains(DEFINES, ENABLE_INDEXED_DATABASE=1) {
+ !v8 {
+ HEADERS += \
+ bindings/js/IDBBindingUtilities.h \
+ }
+
HEADERS += \
- bindings/js/IDBBindingUtilities.h \
storage/IDBAny.h \
storage/IDBCallbacks.h \
storage/IDBCursor.h \
@@ -2542,10 +2841,14 @@ contains(DEFINES, ENABLE_INDEXED_DATABASE=1) {
storage/IDBTransaction.h \
storage/IDBTransactionBackendInterface.h
+ !v8 {
+ SOURCES += \
+ bindings/js/IDBBindingUtilities.cpp \
+ bindings/js/JSIDBAnyCustom.cpp \
+ bindings/js/JSIDBKeyCustom.cpp
+ }
+
SOURCES += \
- bindings/js/IDBBindingUtilities.cpp \
- bindings/js/JSIDBAnyCustom.cpp \
- bindings/js/JSIDBKeyCustom.cpp \
storage/IDBAny.cpp \
storage/IDBCursor.cpp \
storage/IDBCursorBackendImpl.cpp \
@@ -2602,8 +2905,11 @@ contains(DEFINES, ENABLE_DOM_STORAGE=1) {
storage/StorageNamespaceImpl.h \
storage/StorageSyncManager.h
+ !v8 {
+ SOURCES += \
+ bindings/js/JSStorageCustom.cpp
+ }
SOURCES += \
- bindings/js/JSStorageCustom.cpp \
storage/LocalStorageTask.cpp \
storage/LocalStorageThread.cpp \
storage/Storage.cpp \
@@ -2619,6 +2925,7 @@ contains(DEFINES, ENABLE_DOM_STORAGE=1) {
contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
HEADERS += \
+ fileapi/AsyncFileWriter.h \
fileapi/DirectoryEntry.h \
fileapi/DirectoryReader.h \
fileapi/DOMFilePath.h \
@@ -2632,6 +2939,9 @@ contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
fileapi/FileEntry.h \
fileapi/FileSystemCallback.h \
fileapi/FileSystemCallbacks.h \
+ fileapi/FileWriter.h \
+ fileapi/FileWriterCallback.h \
+ fileapi/FileWriterClient.h \
fileapi/Flags.h \
fileapi/LocalFileSystem.h \
fileapi/Metadata.h \
@@ -2640,6 +2950,8 @@ contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
platform/AsyncFileSystemCallbacks.h
SOURCES += \
+ bindings/js/JSDirectoryEntryCustom.cpp \
+ bindings/js/JSEntryCustom.cpp \
fileapi/DirectoryEntry.cpp \
fileapi/DirectoryReader.cpp \
fileapi/DOMFilePath.cpp \
@@ -2648,21 +2960,11 @@ contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
fileapi/EntryArray.cpp \
fileapi/FileEntry.cpp \
fileapi/FileSystemCallbacks.cpp \
+ fileapi/FileWriter.cpp \
fileapi/LocalFileSystem.cpp \
platform/AsyncFileSystem.cpp
}
-contains(DEFINES, ENABLE_FILE_WRITER=1) {
- HEADERS += \
- fileapi/AsyncFileWriter.h \
- fileapi/FileWriter.h \
- fileapi/FileWriterCallback.h \
- fileapi/FileWriterClient.h
-
- SOURCES += \
- fileapi/FileWriter.cpp
-}
-
contains(DEFINES, ENABLE_ICONDATABASE=1) {
SOURCES += \
loader/icon/IconDatabase.cpp \
@@ -2674,12 +2976,15 @@ contains(DEFINES, ENABLE_ICONDATABASE=1) {
}
contains(DEFINES, ENABLE_WORKERS=1) {
+ !v8 {
+ SOURCES += \
+ bindings/js/JSDedicatedWorkerContextCustom.cpp \
+ bindings/js/JSWorkerContextBase.cpp \
+ bindings/js/JSWorkerContextCustom.cpp \
+ bindings/js/JSWorkerCustom.cpp \
+ bindings/js/WorkerScriptController.cpp
+ }
SOURCES += \
- bindings/js/JSDedicatedWorkerContextCustom.cpp \
- bindings/js/JSWorkerContextBase.cpp \
- bindings/js/JSWorkerContextCustom.cpp \
- bindings/js/JSWorkerCustom.cpp \
- bindings/js/WorkerScriptController.cpp \
loader/WorkerThreadableLoader.cpp \
page/WorkerNavigator.cpp \
workers/AbstractWorker.cpp \
@@ -2695,8 +3000,11 @@ contains(DEFINES, ENABLE_WORKERS=1) {
}
contains(DEFINES, ENABLE_SHARED_WORKERS=1) {
+ !v8 {
+ SOURCES += \
+ bindings/js/JSSharedWorkerCustom.cpp
+ }
SOURCES += \
- bindings/js/JSSharedWorkerCustom.cpp \
workers/DefaultSharedWorkerRepository.cpp \
workers/SharedWorker.cpp \
workers/SharedWorkerContext.cpp \
@@ -2719,8 +3027,12 @@ contains(DEFINES, ENABLE_VIDEO=1) {
platform/graphics/MediaPlayer.cpp \
rendering/MediaControlElements.cpp \
rendering/RenderVideo.cpp \
- rendering/RenderMedia.cpp \
- bindings/js/JSAudioConstructor.cpp
+ rendering/RenderMedia.cpp
+
+ !v8 {
+ SOURCES += \
+ bindings/js/JSAudioConstructor.cpp
+ }
!lessThan(QT_MINOR_VERSION, 6):contains(MOBILITY_CONFIG, multimedia) {
HEADERS += platform/graphics/qt/MediaPlayerPrivateQt.h
@@ -2774,8 +3086,14 @@ unix:!mac:CONFIG += link_pkgconfig
contains(DEFINES, ENABLE_XSLT=1) {
tobe|!tobe: QT += xmlpatterns
+ v8 {
+ SOURCES += \
+ bindings/v8/custom/V8XSLTProcessorCustom.cpp
+ } else {
+ SOURCES += \
+ bindings/js/JSXSLTProcessorCustom.cpp
+ }
SOURCES += \
- bindings/js/JSXSLTProcessorCustom.cpp \
dom/TransformSourceQt.cpp \
xml/XSLStyleSheetQt.cpp \
xml/XSLTProcessor.cpp \
@@ -2881,22 +3199,34 @@ contains(DEFINES, ENABLE_GEOLOCATION=1) {
CONFIG += mobility
MOBILITY += location
+
+ v8 {
+ SOURCES += \
+ bindings/v8/custom/V8CustomPositionCallback.cpp \
+ bindings/v8/custom/V8CustomPositionErrorCallback.cpp \
+ bindings/v8/custom/V8GeolocationCustom.cpp
+ }
}
contains(DEFINES, ENABLE_SVG=1) {
+ !v8 {
+ SOURCES += \
+ # TODO: this-one-is-not-auto-added! FIXME! tmp/SVGElementFactory.cpp \
+ bindings/js/JSSVGElementInstanceCustom.cpp \
+ bindings/js/JSSVGLengthCustom.cpp \
+ bindings/js/JSSVGMatrixCustom.cpp \
+ bindings/js/JSSVGPathSegCustom.cpp \
+ bindings/js/JSSVGPathSegListCustom.cpp
+ }
+
SOURCES += \
-# TODO: this-one-is-not-auto-added! FIXME! tmp/SVGElementFactory.cpp \
- bindings/js/JSSVGElementInstanceCustom.cpp \
- bindings/js/JSSVGLengthCustom.cpp \
- bindings/js/JSSVGMatrixCustom.cpp \
- bindings/js/JSSVGPathSegCustom.cpp \
- bindings/js/JSSVGPathSegListCustom.cpp \
css/SVGCSSComputedStyleDeclaration.cpp \
css/SVGCSSParser.cpp \
css/SVGCSSStyleSelector.cpp \
rendering/style/SVGRenderStyle.cpp \
rendering/style/SVGRenderStyleDefs.cpp \
- svg/SVGZoomEvent.cpp \
+ rendering/svg/SVGTextLayoutAttributes.cpp \
+ rendering/svg/SVGTextLayoutBuilder.cpp \
rendering/PointerEventsHitRules.cpp \
svg/SVGDocumentExtensions.cpp \
svg/SVGImageLoader.cpp \
@@ -3042,6 +3372,7 @@ contains(DEFINES, ENABLE_SVG=1) {
svg/SVGViewSpec.cpp \
svg/SVGVKernElement.cpp \
svg/SVGZoomAndPan.cpp \
+ svg/SVGZoomEvent.cpp \
svg/animation/SMILTime.cpp \
svg/animation/SMILTimeContainer.cpp \
svg/animation/SVGSMILElement.cpp \
@@ -3108,10 +3439,23 @@ contains(DEFINES, ENABLE_SVG=1) {
}
contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=1) {
- SOURCES += \
- bindings/js/JSJavaScriptCallFrameCustom.cpp \
- bindings/js/ScriptProfiler.cpp \
- bindings/js/JavaScriptCallFrame.cpp \
+ v8 {
+ SOURCES += \
+ bindings/v8/ScriptDebugServer.cpp \
+ bindings/v8/ScriptProfiler.cpp \
+ bindings/v8/ScriptHeapSnapshot.cpp \
+ bindings/v8/JavaScriptCallFrame.cpp \
+ bindings/v8/custom/V8ScriptProfileCustom.cpp \
+ bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp \
+ bindings/v8/custom/V8ScriptProfileNodeCustom.cpp \
+ bindings/v8/ScriptProfileNode.cpp \
+ bindings/v8/ScriptProfile.cpp
+ } else {
+ SOURCES += \
+ bindings/js/JSJavaScriptCallFrameCustom.cpp \
+ bindings/js/ScriptProfiler.cpp \
+ bindings/js/JavaScriptCallFrame.cpp
+ }
}
contains(DEFINES, ENABLE_OFFLINE_WEB_APPLICATIONS=1) {
@@ -3122,8 +3466,12 @@ SOURCES += \
loader/appcache/ApplicationCacheStorage.cpp \
loader/appcache/ApplicationCacheResource.cpp \
loader/appcache/DOMApplicationCache.cpp \
- loader/appcache/ManifestParser.cpp \
- bindings/js/JSDOMApplicationCacheCustom.cpp
+ loader/appcache/ManifestParser.cpp
+
+ !v8 {
+ SOURCES += \
+ bindings/js/JSDOMApplicationCacheCustom.cpp
+ }
}
contains(DEFINES, ENABLE_WEB_SOCKETS=1) {
@@ -3147,8 +3495,12 @@ contains(DEFINES, ENABLE_WEB_SOCKETS=1) {
websockets/ThreadableWebSocketChannel.cpp \
platform/network/SocketStreamErrorBase.cpp \
platform/network/SocketStreamHandleBase.cpp \
- platform/network/qt/SocketStreamHandleQt.cpp \
- bindings/js/JSWebSocketCustom.cpp
+ platform/network/qt/SocketStreamHandleQt.cpp
+
+ !v8 {
+ SOURCES += \
+ bindings/js/JSWebSocketCustom.cpp
+ }
contains(DEFINES, ENABLE_WORKERS=1) {
HEADERS += \
@@ -3161,8 +3513,12 @@ contains(DEFINES, ENABLE_WEB_SOCKETS=1) {
contains(DEFINES, ENABLE_3D_CANVAS=1) {
tobe|!tobe: QT += opengl
+ !v8 {
+ HEADERS += \
+ bindings/js/JSArrayBufferViewHelper.h
+ }
+
HEADERS += \
- bindings/js/JSArrayBufferViewHelper.h \
html/canvas/CanvasContextAttributes.h \
html/canvas/WebGLObject.h \
html/canvas/WebGLActiveInfo.h \
@@ -3187,17 +3543,20 @@ HEADERS += \
html/canvas/Uint16Array.h \
platform/graphics/GraphicsContext3D.h
+ !v8 {
+ SOURCES += \
+ bindings/js/JSArrayBufferCustom.cpp \
+ bindings/js/JSArrayBufferViewCustom.cpp \
+ bindings/js/JSInt8ArrayCustom.cpp \
+ bindings/js/JSFloat32ArrayCustom.cpp \
+ bindings/js/JSInt32ArrayCustom.cpp \
+ bindings/js/JSWebGLRenderingContextCustom.cpp \
+ bindings/js/JSInt16ArrayCustom.cpp \
+ bindings/js/JSUint8ArrayCustom.cpp \
+ bindings/js/JSUint32ArrayCustom.cpp \
+ bindings/js/JSUint16ArrayCustom.cpp
+ }
SOURCES += \
- bindings/js/JSArrayBufferCustom.cpp \
- bindings/js/JSArrayBufferViewCustom.cpp \
- bindings/js/JSInt8ArrayCustom.cpp \
- bindings/js/JSFloat32ArrayCustom.cpp \
- bindings/js/JSInt32ArrayCustom.cpp \
- bindings/js/JSWebGLRenderingContextCustom.cpp \
- bindings/js/JSInt16ArrayCustom.cpp \
- bindings/js/JSUint8ArrayCustom.cpp \
- bindings/js/JSUint32ArrayCustom.cpp \
- bindings/js/JSUint16ArrayCustom.cpp \
html/canvas/CanvasContextAttributes.cpp \
html/canvas/WebGLObject.cpp \
html/canvas/ArrayBuffer.cpp \
@@ -3220,7 +3579,7 @@ SOURCES += \
html/canvas/Uint32Array.cpp \
html/canvas/Uint16Array.cpp \
platform/graphics/GraphicsContext3D.cpp \
- platform/graphics/qt/GraphicsContext3DQt.cpp \
+ platform/graphics/qt/GraphicsContext3DQt.cpp
}
@@ -3232,6 +3591,25 @@ contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) {
}
}
+!symbian-abld:!symbian-sbsv2 {
+ modfile.files = $$moduleFile
+ modfile.path = $$[QMAKE_MKSPECS]/modules
+
+ INSTALLS += modfile
+} else {
+ # INSTALLS is not implemented in qmake's mmp generators, copy headers manually
+
+ inst_modfile.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
+ inst_modfile.input = moduleFile
+ inst_modfile.output = $$[QMAKE_MKSPECS]/modules
+ inst_modfile.CONFIG = no_clean
+
+ QMAKE_EXTRA_COMPILERS += inst_modfile
+
+ install.depends += compiler_inst_modfile_make_all
+ QMAKE_EXTRA_TARGETS += install
+}
+
include($$PWD/../WebKit/qt/Api/headers.pri)
HEADERS += $$WEBKIT_API_HEADERS
@@ -3249,10 +3627,7 @@ HEADERS += $$WEBKIT_API_HEADERS
!isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
else: target.path = $$[QT_INSTALL_LIBS]
- modfile.files = $$moduleFile
- modfile.path = $$[QMAKE_MKSPECS]/modules
-
- INSTALLS += target headers modfile
+ INSTALLS += target headers
} else {
# INSTALLS is not implemented in qmake's mmp generators, copy headers manually
inst_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
@@ -3264,15 +3639,7 @@ HEADERS += $$WEBKIT_API_HEADERS
QMAKE_EXTRA_COMPILERS += inst_headers
- inst_modfile.commands = $$inst_headers.commands
- inst_modfile.input = moduleFile
- inst_modfile.output = $$[QMAKE_MKSPECS]/modules
- inst_modfile.CONFIG = no_clean
-
- QMAKE_EXTRA_COMPILERS += inst_modfile
-
- install.depends += compiler_inst_headers_make_all compiler_inst_modfile_make_all
- QMAKE_EXTRA_TARGETS += install
+ install.depends += compiler_inst_headers_make_all
}
win32-*|wince* {
diff --git a/WebCore/WebCore.vcproj/QTMovieWin.vcproj b/WebCore/WebCore.vcproj/QTMovieWin.vcproj
index 04b360f..adda5e0 100644
--- a/WebCore/WebCore.vcproj/QTMovieWin.vcproj
+++ b/WebCore/WebCore.vcproj/QTMovieWin.vcproj
@@ -40,7 +40,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\QTInternalSDK\CIncludes&quot;;&quot;$(WebKitLibrariesDir)\QuickTime SDK\CIncludes&quot;;&quot;$(ProgramFiles)/QuickTime SDK/cincludes&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;"
- PreprocessorDefinitions="_USRDLL;QTMOVIEWIN_EXPORTS"
+ PreprocessorDefinitions="_USRDLL;QTMOVIEWIN_EXPORTS;TARGET_OS_WIN32"
DisableSpecificWarnings="4819"
/>
<Tool
@@ -113,7 +113,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\QTInternalSDK\CIncludes&quot;;&quot;$(WebKitLibrariesDir)\QuickTime SDK\CIncludes&quot;;&quot;$(ProgramFiles)/QuickTime SDK/cincludes&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;"
- PreprocessorDefinitions="_USRDLL;QTMOVIEWIN_EXPORTS"
+ PreprocessorDefinitions="_USRDLL;QTMOVIEWIN_EXPORTS;TARGET_OS_WIN32"
DisableSpecificWarnings="4819"
/>
<Tool
@@ -185,7 +185,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\QTInternalSDK\CIncludes&quot;;&quot;$(WebKitLibrariesDir)\QuickTime SDK\CIncludes&quot;;&quot;$(ProgramFiles)/QuickTime SDK/cincludes&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;"
- PreprocessorDefinitions="_USRDLL;QTMOVIEWIN_EXPORTS"
+ PreprocessorDefinitions="_USRDLL;QTMOVIEWIN_EXPORTS;TARGET_OS_WIN32"
DisableSpecificWarnings="4819"
/>
<Tool
@@ -257,7 +257,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\QTInternalSDK\CIncludes&quot;;&quot;$(WebKitLibrariesDir)\QuickTime SDK\CIncludes&quot;;&quot;$(ProgramFiles)/QuickTime SDK/cincludes&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;"
- PreprocessorDefinitions="_USRDLL;QTMOVIEWIN_EXPORTS"
+ PreprocessorDefinitions="_USRDLL;QTMOVIEWIN_EXPORTS;TARGET_OS_WIN32"
DisableSpecificWarnings="4819"
/>
<Tool
@@ -341,6 +341,10 @@
RelativePath="..\platform\graphics\win\QTPixelBuffer.cpp"
>
</File>
+ <File
+ RelativePath="..\platform\graphics\win\QTTrack.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Header Files"
@@ -375,6 +379,10 @@
RelativePath="..\platform\graphics\win\QTPixelBuffer.h"
>
</File>
+ <File
+ RelativePath="..\platform\graphics\win\QTTrack.h"
+ >
+ </File>
</Filter>
<Filter
Name="Resource Files"
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 92e9ee3..414a67d 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -5300,6 +5300,62 @@
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSGeoposition.h"
>
</File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHashChangeEvent.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\JSHashChangeEvent.h"
+ >
+ </File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHistory.cpp"
>
@@ -23360,10 +23416,6 @@
RelativePath="..\page\XSSAuditor.h"
>
</File>
- <File
- RelativePath="..\page\ZoomMode.h"
- >
- </File>
<Filter
Name="win"
>
@@ -26599,6 +26651,42 @@
</FileConfiguration>
</File>
<File
+ RelativePath="..\platform\graphics\cairo\OwnPtrCairo.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_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath="..\platform\graphics\cairo\PathCairo.cpp"
>
<FileConfiguration
@@ -29393,6 +29481,14 @@
>
</File>
<File
+ RelativePath="..\css\CSSPropertySourceData.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\css\CSSPropertySourceData.h"
+ >
+ </File>
+ <File
RelativePath="..\css\CSSQuirkPrimitiveValue.h"
>
</File>
@@ -33154,6 +33250,26 @@
>
</File>
</Filter>
+ <Filter
+ Name="svg"
+ >
+ <File
+ RelativePath="..\rendering\svg\SVGTextLayoutAttributes.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\rendering\svg\SVGTextLayoutAttributes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\rendering\svg\SVGTextLayoutBuilder.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\rendering\svg\SVGTextLayoutBuilder.h"
+ >
+ </File>
+ </Filter>
</Filter>
<Filter
Name="xml"
@@ -33873,6 +33989,10 @@
>
</File>
<File
+ RelativePath="..\dom\HashChangeEvent.h"
+ >
+ </File>
+ <File
RelativePath="..\dom\InputElement.h"
>
</File>
@@ -42016,6 +42136,14 @@
>
</File>
<File
+ RelativePath="..\html\parser\HTMLParserIdioms.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLParserIdioms.h"
+ >
+ </File>
+ <File
RelativePath="..\html\parser\HTMLParserScheduler.cpp"
>
</File>
@@ -42072,6 +42200,10 @@
>
</File>
<File
+ RelativePath="..\html\parser\NestingLevelIncrementer.h"
+ >
+ </File>
+ <File
RelativePath="..\html\parser\TextDocumentParser.cpp"
>
</File>
@@ -42496,6 +42628,62 @@
>
</File>
<File
+ RelativePath="..\bindings\js\specialization\JSBindingState.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\specialization\JSBindingState.h"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\JSCallbackData.cpp"
>
<FileConfiguration
@@ -44464,6 +44652,10 @@
</FileConfiguration>
</File>
<File
+ RelativePath="..\bindings\js\JSEntryCustom.cpp"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\JSEventCustom.cpp"
>
<FileConfiguration
@@ -46676,6 +46868,10 @@
>
</File>
<File
+ RelativePath="..\bindings\js\JSDirectoryEntryCustom.cpp"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\JSImageConstructor.cpp"
>
<FileConfiguration
@@ -49787,62 +49983,6 @@
RelativePath="..\bindings\js\WorkerScriptController.h"
>
</File>
- <File
- RelativePath="..\bindings\js\specialization\JSBindingState.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\specialization\JSBindingState.h"
- >
- </File>
</Filter>
</Filter>
<Filter
diff --git a/WebCore/WebCore.vcproj/WebCoreCommon.vsprops b/WebCore/WebCore.vcproj/WebCoreCommon.vsprops
index 8677c0e..edc8ee1 100644
--- a/WebCore/WebCore.vcproj/WebCoreCommon.vsprops
+++ b/WebCore/WebCore.vcproj/WebCoreCommon.vsprops
@@ -7,7 +7,7 @@
>
<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)..\fileapi&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)..\bindings\js\specialization&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)..\html\parser&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)..\mathml&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;;&quot;$(WebKitLibrariesDir)\include\zlib&quot;"
+ 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)..\fileapi&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\rendering\style&quot;;&quot;$(ProjectDir)..\rendering\svg&quot;;&quot;$(ProjectDir)..\bindings&quot;;&quot;$(ProjectDir)..\bindings\generic&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\bindings\js\specialization&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)..\html\parser&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)..\mathml&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;;&quot;$(WebKitLibrariesDir)\include\zlib&quot;"
PreprocessorDefinitions="__WIN32__;DISABLE_3D_RENDERING;WEBCORE_CONTEXT_MENUS"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="WebCorePrefix.h"
diff --git a/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd b/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd
index 7ad3217..d76cfd6 100755
--- a/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd
+++ b/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd
@@ -57,6 +57,7 @@ xcopy /y /d "%ProjectDir%..\plugins\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\plugins\win\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\rendering\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\rendering\style\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\rendering\svg\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\editing\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\dom\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\xml\*.h" "%WebKitOutputDir%\include\WebCore"
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 8893d0a..735e9d5 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -152,6 +152,10 @@
088451160F267B63007F139E /* WMLInputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 088451140F267B63007F139E /* WMLInputElement.h */; };
0885067F11DA045B00182B98 /* PaintInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067D11DA045B00182B98 /* PaintInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
0885068011DA045B00182B98 /* PaintPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067E11DA045B00182B98 /* PaintPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088C2F7912390081003D65CE /* SVGTextLayoutAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 088C2F7512390080003D65CE /* SVGTextLayoutAttributes.cpp */; };
+ 088C2F7A12390081003D65CE /* SVGTextLayoutAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */; };
+ 088C2F7B12390081003D65CE /* SVGTextLayoutBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 088C2F7712390081003D65CE /* SVGTextLayoutBuilder.cpp */; };
+ 088C2F7C12390081003D65CE /* SVGTextLayoutBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 088C2F7812390081003D65CE /* SVGTextLayoutBuilder.h */; };
088C97120ECB6D92000534BA /* WMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA3AB490E556F2400E9C0C0 /* WMLNames.cpp */; };
088C97130ECB6D9D000534BA /* WMLNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CA3AB480E556F2400E9C0C0 /* WMLNames.h */; };
088C97510ECB6E28000534BA /* WMLAElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6B99180E52E37300487BB7 /* WMLAElement.cpp */; };
@@ -892,7 +896,6 @@
448AD27C0A48137A0023D179 /* JSHTMLOptionsCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 448AD27A0A4813790023D179 /* JSHTMLOptionsCollectionCustom.cpp */; };
449B19F50FA72ECE0015CA4A /* HTMLParserQuirks.h in Headers */ = {isa = PBXBuildFile; fileRef = 449B19F30FA72ECE0015CA4A /* HTMLParserQuirks.h */; settings = {ATTRIBUTES = (Private, ); }; };
4614A1FE0B23A8D600446E1C /* copyCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 4614A1FD0B23A8D600446E1C /* copyCursor.png */; };
- 4617E7B1121E078F005EC8A8 /* AsyncFileWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4617E7B0121E078F005EC8A8 /* AsyncFileWriter.h */; };
464EA2730B8A350B00A8E6E3 /* crossHairCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 464EA2710B8A350B00A8E6E3 /* crossHairCursor.png */; };
464EA2740B8A350B00A8E6E3 /* notAllowedCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 464EA2720B8A350B00A8E6E3 /* notAllowedCursor.png */; };
46BD16E30B279473001F0839 /* noneCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46BD16E20B279473001F0839 /* noneCursor.png */; };
@@ -1354,7 +1357,7 @@
65DF31FF09D1CC60000BE325 /* JSProcessingInstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DF31EB09D1CC60000BE325 /* JSProcessingInstruction.cpp */; };
65DF320009D1CC60000BE325 /* JSProcessingInstruction.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DF31EC09D1CC60000BE325 /* JSProcessingInstruction.h */; };
65DF320109D1CC60000BE325 /* JSRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DF31ED09D1CC60000BE325 /* JSRange.cpp */; };
- 65DF320209D1CC60000BE325 /* JSRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DF31EE09D1CC60000BE325 /* JSRange.h */; };
+ 65DF320209D1CC60000BE325 /* JSRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DF31EE09D1CC60000BE325 /* JSRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
65DF320309D1CC60000BE325 /* JSText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DF31EF09D1CC60000BE325 /* JSText.cpp */; };
65DF320409D1CC60000BE325 /* JSText.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DF31F009D1CC60000BE325 /* JSText.h */; };
65DF320509D1CC60000BE325 /* JSWheelEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DF31F109D1CC60000BE325 /* JSWheelEvent.cpp */; };
@@ -1450,6 +1453,8 @@
81BE20D311F4BC3200915DFA /* JSIDBCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 81BE20A811F4B66F00915DFA /* JSIDBCursor.h */; };
82B658981189E39200E052A1 /* InspectorCSSStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 82B658971189E39200E052A1 /* InspectorCSSStore.h */; settings = {ATTRIBUTES = (Private, ); }; };
82B6589A1189E47600E052A1 /* InspectorCSSStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 82B658991189E47600E052A1 /* InspectorCSSStore.cpp */; };
+ 82E3D8DE122EA0D1003AE5BC /* CSSPropertySourceData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 82E3D8DC122EA0D1003AE5BC /* CSSPropertySourceData.cpp */; };
+ 82E3D8DF122EA0D1003AE5BC /* CSSPropertySourceData.h in Headers */ = {isa = PBXBuildFile; fileRef = 82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */; settings = {ATTRIBUTES = (Private, ); }; };
8419D2A7120D92D000141F8F /* SVGPathByteStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 8419D2A4120D92D000141F8F /* SVGPathByteStream.h */; };
8419D2A8120D92D000141F8F /* SVGPathByteStreamBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8419D2A5120D92D000141F8F /* SVGPathByteStreamBuilder.cpp */; };
8419D2A9120D92D000141F8F /* SVGPathByteStreamBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8419D2A6120D92D000141F8F /* SVGPathByteStreamBuilder.h */; };
@@ -1483,6 +1488,9 @@
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 */; };
+ 8482B7461198C35400BFB005 /* HashChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2442BBF81194C9D300D49469 /* HashChangeEvent.h */; };
+ 8482B7511198CB6B00BFB005 /* JSHashChangeEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8482B74F1198CB6B00BFB005 /* JSHashChangeEvent.cpp */; };
+ 8482B7521198CB6B00BFB005 /* JSHashChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 8482B7501198CB6B00BFB005 /* JSHashChangeEvent.h */; };
8485227B1190162C006EDC7F /* JSSVGHKernElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 848522771190162C006EDC7F /* JSSVGHKernElement.cpp */; };
8485227C1190162C006EDC7F /* JSSVGHKernElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 848522781190162C006EDC7F /* JSSVGHKernElement.h */; };
8485227D1190162C006EDC7F /* JSSVGVKernElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 848522791190162C006EDC7F /* JSSVGVKernElement.cpp */; };
@@ -2381,6 +2389,8 @@
893C47B81238A099002B3D86 /* JSFileCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C47B61238A099002B3D86 /* JSFileCallback.h */; };
893C47BB1238A0A9002B3D86 /* JSFileWriterCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47B91238A0A9002B3D86 /* JSFileWriterCallback.cpp */; };
893C47BC1238A0A9002B3D86 /* JSFileWriterCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C47BA1238A0A9002B3D86 /* JSFileWriterCallback.h */; };
+ 893C47CC123EEBA2002B3D86 /* JSEntryCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47CA123EEBA2002B3D86 /* JSEntryCustom.cpp */; };
+ 893C47DF123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47DE123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp */; };
89878552122CA064003AABDA /* DirectoryEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89878539122CA064003AABDA /* DirectoryEntry.cpp */; };
89878553122CA064003AABDA /* DirectoryEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987853A122CA064003AABDA /* DirectoryEntry.h */; };
89878554122CA064003AABDA /* DirectoryReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987853B122CA064003AABDA /* DirectoryReader.cpp */; };
@@ -2444,6 +2454,7 @@
89D08DA012228451001241DF /* AsyncFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 89D08D9D12228451001241DF /* AsyncFileSystem.h */; };
89D08DA112228451001241DF /* AsyncFileSystemCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 89D08D9E12228451001241DF /* AsyncFileSystemCallbacks.h */; };
8A12E35D11FA33280025836A /* DocumentLoadTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A12E35C11FA33280025836A /* DocumentLoadTiming.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 8A309C9F123950BE00CB9204 /* NestingLevelIncrementer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A309C9E123950BE00CB9204 /* NestingLevelIncrementer.h */; };
8A413AE01207BBA50082016E /* AsyncScriptRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A413ADE1207BBA50082016E /* AsyncScriptRunner.h */; settings = {ATTRIBUTES = (Private, ); }; };
8A413AE11207BBA50082016E /* AsyncScriptRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A413ADF1207BBA50082016E /* AsyncScriptRunner.cpp */; };
8A7CC96B12076D73001D4588 /* PendingScript.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A7CC96A12076D73001D4588 /* PendingScript.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2657,6 +2668,8 @@
93E227E40AF589AD00D48324 /* SubresourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */; };
93E241FF0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E241FE0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
93E2425F0B2B509500C732A1 /* HTMLFrameOwnerElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E2425E0B2B509500C732A1 /* HTMLFrameOwnerElement.cpp */; };
+ 93E2A306123E9DC0009FE12A /* HTMLParserIdioms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E2A304123E9DC0009FE12A /* HTMLParserIdioms.cpp */; };
+ 93E2A307123E9DC0009FE12A /* HTMLParserIdioms.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E2A305123E9DC0009FE12A /* HTMLParserIdioms.h */; };
93E62D9B0985F41600E1B5E3 /* SystemTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E62D990985F41600E1B5E3 /* SystemTime.h */; settings = {ATTRIBUTES = (Private, ); }; };
93EB169509F880B00091F8FF /* WebCoreSystemInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93EB169409F880B00091F8FF /* WebCoreSystemInterface.mm */; };
93EB169709F880C00091F8FF /* WebCoreSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EB169609F880C00091F8FF /* WebCoreSystemInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2685,7 +2698,6 @@
93F199EC08245E59001E9ABC /* XSLStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BC06F24A06D18A7E004A6FA3 /* XSLStyleSheet.h */; };
93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC06F24C06D18A7E004A6FA3 /* XSLTProcessor.h */; };
93F199F008245E59001E9ABC /* WebCoreView.h in Headers */ = {isa = PBXBuildFile; fileRef = BE855F7F0701E83500239769 /* WebCoreView.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 93F199F108245E59001E9ABC /* WebDashboardRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 5150C2A10702629000AF642C /* WebDashboardRegion.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F19A2608245E59001E9ABC /* CursorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784F002DE375901EA4122 /* CursorMac.mm */; };
93F19A3C08245E59001E9ABC /* DeprecatedPtrListImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587851602DE375901EA4122 /* DeprecatedPtrListImpl.cpp */; };
93F19A5F08245E59001E9ABC /* WebCoreViewFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = F587855502DE375901EA4122 /* WebCoreViewFactory.m */; };
@@ -2705,7 +2717,6 @@
93F19B0408245E59001E9ABC /* XSLTProcessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC06F24B06D18A7E004A6FA3 /* XSLTProcessor.cpp */; };
93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC06F24D06D18A7E004A6FA3 /* XSLTProcessorLibxslt.cpp */; };
93F19B0708245E59001E9ABC /* WebCoreView.m in Sources */ = {isa = PBXBuildFile; fileRef = BE8560510701F91100239769 /* WebCoreView.m */; };
- 93F19B0808245E59001E9ABC /* WebDashboardRegion.m in Sources */ = {isa = PBXBuildFile; fileRef = 5150C2A50702629800AF642C /* WebDashboardRegion.m */; settings = {COMPILER_FLAGS = "-Wno-cast-qual"; }; };
93F19B1308245E59001E9ABC /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C2869302846DCD018635CA /* ApplicationServices.framework */; };
93F19B1408245E59001E9ABC /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C2869402846DCD018635CA /* Carbon.framework */; };
93F19B1508245E59001E9ABC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C2869502846DCD018635CA /* Cocoa.framework */; };
@@ -2858,7 +2869,6 @@
A622A8FB122C44A600A785B3 /* BindingSecurity.h in Headers */ = {isa = PBXBuildFile; fileRef = A622A8F5122C44A600A785B3 /* BindingSecurity.h */; };
A622A8FC122C44A600A785B3 /* BindingSecurityBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A622A8F6122C44A600A785B3 /* BindingSecurityBase.cpp */; };
A622A8FD122C44A600A785B3 /* BindingSecurityBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A622A8F7122C44A600A785B3 /* BindingSecurityBase.h */; };
- A622A8FE122C44A600A785B3 /* BindingUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = A622A8F8122C44A600A785B3 /* BindingUtilities.h */; };
A622A8FF122C44A600A785B3 /* GenericBinding.h in Headers */ = {isa = PBXBuildFile; fileRef = A622A8F9122C44A600A785B3 /* GenericBinding.h */; };
A718760E0B2A120100A16ECE /* DragActions.h in Headers */ = {isa = PBXBuildFile; fileRef = A718760D0B2A120100A16ECE /* DragActions.h */; settings = {ATTRIBUTES = (Private, ); }; };
A71878900B2D04AC00A16ECE /* DragControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */; };
@@ -5154,7 +5164,6 @@
CE02F0C411E83ADD00C6684A /* ScriptControllerBase.h in Headers */ = {isa = PBXBuildFile; fileRef = CE02F0C311E83ADD00C6684A /* ScriptControllerBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
CE057FA51220731100A476D5 /* DocumentMarkerController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE057FA31220731100A476D5 /* DocumentMarkerController.cpp */; };
CE057FA61220731100A476D5 /* DocumentMarkerController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE057FA41220731100A476D5 /* DocumentMarkerController.h */; settings = {ATTRIBUTES = (Private, ); }; };
- CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */ = {isa = PBXBuildFile; fileRef = CE172E001136E8CE0062A533 /* ZoomMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
CE4C00E410F6F7BA00CA38F5 /* HTMLNoScriptElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE4C00E310F6F7BA00CA38F5 /* HTMLNoScriptElement.cpp */; };
CE4C00E610F6F7C100CA38F5 /* HTMLNoScriptElement.h in Headers */ = {isa = PBXBuildFile; fileRef = CE4C00E510F6F7C100CA38F5 /* HTMLNoScriptElement.h */; };
CE54FD381016D9A6008B44C8 /* ScriptSourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = CE54FD371016D9A6008B44C8 /* ScriptSourceProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5394,6 +5403,7 @@
FABE72FE1059C21100D999DD /* MathMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72FC1059C21100D999DD /* MathMLNames.cpp */; };
FAC12CC41120DA6900DACC36 /* RenderMathMLSubSup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAC12CC21120DA6900DACC36 /* RenderMathMLSubSup.cpp */; };
FAC12CC51120DA6900DACC36 /* RenderMathMLSubSup.h in Headers */ = {isa = PBXBuildFile; fileRef = FAC12CC31120DA6900DACC36 /* RenderMathMLSubSup.h */; };
+ FBC220DF1237FBEB00BCF788 /* GraphicsContext3DOpenGL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FBC220DE1237FBEB00BCF788 /* GraphicsContext3DOpenGL.cpp */; };
FE6FD4880F676E5700092873 /* Coordinates.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6FD4850F676E5700092873 /* Coordinates.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6FD48D0F676E9300092873 /* JSCoordinates.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE6FD48B0F676E9300092873 /* JSCoordinates.cpp */; };
FE6FD48E0F676E9300092873 /* JSCoordinates.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6FD48C0F676E9300092873 /* JSCoordinates.h */; };
@@ -5985,6 +5995,10 @@
088451140F267B63007F139E /* WMLInputElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLInputElement.h; sourceTree = "<group>"; };
0885067D11DA045B00182B98 /* PaintInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintInfo.h; sourceTree = "<group>"; };
0885067E11DA045B00182B98 /* PaintPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintPhase.h; sourceTree = "<group>"; };
+ 088C2F7512390080003D65CE /* SVGTextLayoutAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextLayoutAttributes.cpp; sourceTree = "<group>"; };
+ 088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutAttributes.h; sourceTree = "<group>"; };
+ 088C2F7712390081003D65CE /* SVGTextLayoutBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextLayoutBuilder.cpp; sourceTree = "<group>"; };
+ 088C2F7812390081003D65CE /* SVGTextLayoutBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutBuilder.h; sourceTree = "<group>"; };
0893E4650ECB68F400A28563 /* WMLPageState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLPageState.cpp; sourceTree = "<group>"; };
0893E4660ECB68F400A28563 /* WMLPageState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLPageState.h; sourceTree = "<group>"; };
089582530E857A7E00F82C83 /* ImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageLoader.cpp; sourceTree = "<group>"; };
@@ -6485,6 +6499,7 @@
1CFAE3220A6D6A3F0032593D /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libobjc.dylib; path = /usr/lib/libobjc.dylib; sourceTree = "<absolute>"; };
200B190811C277D900DCCD3A /* ScriptBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptBreakpoint.cpp; sourceTree = "<group>"; };
228C284410D82500009D0D0E /* ScriptWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappable.h; sourceTree = "<group>"; };
+ 2442BBF81194C9D300D49469 /* HashChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashChangeEvent.h; sourceTree = "<group>"; };
24F54EAA101FE914000AE741 /* ApplicationCacheHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplicationCacheHost.cpp; sourceTree = "<group>"; };
24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationCacheHost.h; sourceTree = "<group>"; };
2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserGestureIndicator.cpp; sourceTree = "<group>"; };
@@ -6776,7 +6791,6 @@
449098B10F8F82520076A327 /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; };
449B19F30FA72ECE0015CA4A /* HTMLParserQuirks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLParserQuirks.h; sourceTree = "<group>"; };
4614A1FD0B23A8D600446E1C /* copyCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = copyCursor.png; sourceTree = "<group>"; };
- 4617E7B0121E078F005EC8A8 /* AsyncFileWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncFileWriter.h; sourceTree = "<group>"; };
464EA2710B8A350B00A8E6E3 /* crossHairCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = crossHairCursor.png; sourceTree = "<group>"; };
464EA2720B8A350B00A8E6E3 /* notAllowedCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = notAllowedCursor.png; sourceTree = "<group>"; };
46BD16E20B279473001F0839 /* noneCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = noneCursor.png; sourceTree = "<group>"; };
@@ -7063,8 +7077,6 @@
514C76680CE923A1007EF3CD /* ResourceRequestBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceRequestBase.h; sourceTree = "<group>"; };
514C76690CE923A1007EF3CD /* ResourceResponseBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceResponseBase.cpp; sourceTree = "<group>"; };
514C766A0CE923A1007EF3CD /* ResourceResponseBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceResponseBase.h; sourceTree = "<group>"; };
- 5150C2A10702629000AF642C /* WebDashboardRegion.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDashboardRegion.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- 5150C2A50702629800AF642C /* WebDashboardRegion.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDashboardRegion.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
515788C01207852C00A37C4A /* VisitedLinkStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkStrategy.h; sourceTree = "<group>"; };
515B03970CD1642A00B7EA9C /* SQLStatement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLStatement.h; sourceTree = "<group>"; };
515B03980CD1642A00B7EA9C /* SQLStatement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLStatement.cpp; sourceTree = "<group>"; };
@@ -7403,6 +7415,8 @@
81BE20A811F4B66F00915DFA /* JSIDBCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBCursor.h; sourceTree = "<group>"; };
82B658971189E39200E052A1 /* InspectorCSSStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorCSSStore.h; sourceTree = "<group>"; };
82B658991189E47600E052A1 /* InspectorCSSStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorCSSStore.cpp; sourceTree = "<group>"; };
+ 82E3D8DC122EA0D1003AE5BC /* CSSPropertySourceData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPropertySourceData.cpp; sourceTree = "<group>"; };
+ 82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPropertySourceData.h; sourceTree = "<group>"; };
8419D2A4120D92D000141F8F /* SVGPathByteStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathByteStream.h; sourceTree = "<group>"; };
8419D2A5120D92D000141F8F /* SVGPathByteStreamBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathByteStreamBuilder.cpp; sourceTree = "<group>"; };
8419D2A6120D92D000141F8F /* SVGPathByteStreamBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathByteStreamBuilder.h; sourceTree = "<group>"; };
@@ -7437,6 +7451,9 @@
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>"; };
+ 8482B7441198C32E00BFB005 /* HashChangeEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HashChangeEvent.idl; sourceTree = "<group>"; };
+ 8482B74F1198CB6B00BFB005 /* JSHashChangeEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHashChangeEvent.cpp; sourceTree = "<group>"; };
+ 8482B7501198CB6B00BFB005 /* JSHashChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHashChangeEvent.h; sourceTree = "<group>"; };
848522771190162C006EDC7F /* JSSVGHKernElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGHKernElement.cpp; sourceTree = "<group>"; };
848522781190162C006EDC7F /* JSSVGHKernElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGHKernElement.h; sourceTree = "<group>"; };
848522791190162C006EDC7F /* JSSVGVKernElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGVKernElement.cpp; sourceTree = "<group>"; };
@@ -8284,6 +8301,8 @@
893C47B61238A099002B3D86 /* JSFileCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileCallback.h; sourceTree = "<group>"; };
893C47B91238A0A9002B3D86 /* JSFileWriterCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileWriterCallback.cpp; sourceTree = "<group>"; };
893C47BA1238A0A9002B3D86 /* JSFileWriterCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileWriterCallback.h; sourceTree = "<group>"; };
+ 893C47CA123EEBA2002B3D86 /* JSEntryCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntryCustom.cpp; sourceTree = "<group>"; };
+ 893C47DE123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryEntryCustom.cpp; sourceTree = "<group>"; };
89878539122CA064003AABDA /* DirectoryEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DirectoryEntry.cpp; path = fileapi/DirectoryEntry.cpp; sourceTree = "<group>"; };
8987853A122CA064003AABDA /* DirectoryEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DirectoryEntry.h; path = fileapi/DirectoryEntry.h; sourceTree = "<group>"; };
8987853B122CA064003AABDA /* DirectoryReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DirectoryReader.cpp; path = fileapi/DirectoryReader.cpp; sourceTree = "<group>"; };
@@ -8347,6 +8366,7 @@
89D08D9D12228451001241DF /* AsyncFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncFileSystem.h; sourceTree = "<group>"; };
89D08D9E12228451001241DF /* AsyncFileSystemCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncFileSystemCallbacks.h; sourceTree = "<group>"; };
8A12E35C11FA33280025836A /* DocumentLoadTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentLoadTiming.h; sourceTree = "<group>"; };
+ 8A309C9E123950BE00CB9204 /* NestingLevelIncrementer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NestingLevelIncrementer.h; path = parser/NestingLevelIncrementer.h; sourceTree = "<group>"; };
8A413ADE1207BBA50082016E /* AsyncScriptRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncScriptRunner.h; sourceTree = "<group>"; };
8A413ADF1207BBA50082016E /* AsyncScriptRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AsyncScriptRunner.cpp; sourceTree = "<group>"; };
8A7CC96A12076D73001D4588 /* PendingScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PendingScript.h; sourceTree = "<group>"; };
@@ -8578,6 +8598,8 @@
93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubresourceLoader.cpp; sourceTree = "<group>"; };
93E241FE0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLFrameOwnerElement.h; sourceTree = "<group>"; };
93E2425E0B2B509500C732A1 /* HTMLFrameOwnerElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLFrameOwnerElement.cpp; sourceTree = "<group>"; };
+ 93E2A304123E9DC0009FE12A /* HTMLParserIdioms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLParserIdioms.cpp; path = parser/HTMLParserIdioms.cpp; sourceTree = "<group>"; };
+ 93E2A305123E9DC0009FE12A /* HTMLParserIdioms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLParserIdioms.h; path = parser/HTMLParserIdioms.h; sourceTree = "<group>"; };
93E62D990985F41600E1B5E3 /* SystemTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SystemTime.h; sourceTree = "<group>"; };
93EB169409F880B00091F8FF /* WebCoreSystemInterface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreSystemInterface.mm; sourceTree = "<group>"; };
93EB169609F880C00091F8FF /* WebCoreSystemInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreSystemInterface.h; sourceTree = "<group>"; };
@@ -8753,7 +8775,6 @@
A622A8F5122C44A600A785B3 /* BindingSecurity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BindingSecurity.h; path = generic/BindingSecurity.h; sourceTree = "<group>"; };
A622A8F6122C44A600A785B3 /* BindingSecurityBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BindingSecurityBase.cpp; path = generic/BindingSecurityBase.cpp; sourceTree = "<group>"; };
A622A8F7122C44A600A785B3 /* BindingSecurityBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BindingSecurityBase.h; path = generic/BindingSecurityBase.h; sourceTree = "<group>"; };
- A622A8F8122C44A600A785B3 /* BindingUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BindingUtilities.h; path = generic/BindingUtilities.h; sourceTree = "<group>"; };
A622A8F9122C44A600A785B3 /* GenericBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GenericBinding.h; path = generic/GenericBinding.h; sourceTree = "<group>"; };
A718760D0B2A120100A16ECE /* DragActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragActions.h; sourceTree = "<group>"; };
A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragControllerMac.mm; sourceTree = "<group>"; };
@@ -11004,7 +11025,6 @@
CE02F0C311E83ADD00C6684A /* ScriptControllerBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptControllerBase.h; sourceTree = "<group>"; };
CE057FA31220731100A476D5 /* DocumentMarkerController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentMarkerController.cpp; sourceTree = "<group>"; };
CE057FA41220731100A476D5 /* DocumentMarkerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentMarkerController.h; sourceTree = "<group>"; };
- CE172E001136E8CE0062A533 /* ZoomMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZoomMode.h; sourceTree = "<group>"; };
CE4C00E310F6F7BA00CA38F5 /* HTMLNoScriptElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLNoScriptElement.cpp; sourceTree = "<group>"; };
CE4C00E510F6F7C100CA38F5 /* HTMLNoScriptElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLNoScriptElement.h; sourceTree = "<group>"; };
CE54FD371016D9A6008B44C8 /* ScriptSourceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptSourceProvider.h; sourceTree = "<group>"; };
@@ -11290,6 +11310,7 @@
FABE72FC1059C21100D999DD /* MathMLNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLNames.cpp; sourceTree = "<group>"; };
FAC12CC21120DA6900DACC36 /* RenderMathMLSubSup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLSubSup.cpp; sourceTree = "<group>"; };
FAC12CC31120DA6900DACC36 /* RenderMathMLSubSup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLSubSup.h; sourceTree = "<group>"; };
+ FBC220DE1237FBEB00BCF788 /* GraphicsContext3DOpenGL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DOpenGL.cpp; sourceTree = "<group>"; };
FE49EF970DC51462004266E1 /* DashboardSupportCSSPropertyNames.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DashboardSupportCSSPropertyNames.in; sourceTree = "<group>"; };
FE6FD4850F676E5700092873 /* Coordinates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Coordinates.h; sourceTree = "<group>"; };
FE6FD4860F676E5700092873 /* Coordinates.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Coordinates.idl; sourceTree = "<group>"; };
@@ -11419,6 +11440,17 @@
tabWidth = 4;
usesTabs = 0;
};
+ 088C2F7412390080003D65CE /* svg */ = {
+ isa = PBXGroup;
+ children = (
+ 088C2F7512390080003D65CE /* SVGTextLayoutAttributes.cpp */,
+ 088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */,
+ 088C2F7712390081003D65CE /* SVGTextLayoutBuilder.cpp */,
+ 088C2F7812390081003D65CE /* SVGTextLayoutBuilder.h */,
+ );
+ path = svg;
+ sourceTree = "<group>";
+ };
089C1665FE841158C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
@@ -11510,11 +11542,11 @@
children = (
1A569CC50D7E2B82007C3983 /* c */,
1A569CCE0D7E2B82007C3983 /* jni */,
+ 59B5977111086556007159E8 /* jsc */,
1A569CE20D7E2B82007C3983 /* objc */,
599E758F11055A1F00D904FA /* Bridge.h */,
1A71D5790F33819000F9CE4E /* IdentifierRep.cpp */,
1A71D57A0F33819000F9CE4E /* IdentifierRep.h */,
- 59B5977111086556007159E8 /* jsc */,
1A569CDA0D7E2B82007C3983 /* NP_jsobject.cpp */,
1A569CDB0D7E2B82007C3983 /* NP_jsobject.h */,
1A569CDC0D7E2B82007C3983 /* npapi.h */,
@@ -12061,7 +12093,6 @@
49EECDC710503C2300099FAB /* ArrayBufferView.cpp */,
49EECDC810503C2300099FAB /* ArrayBufferView.h */,
49EECDC910503C2300099FAB /* ArrayBufferView.idl */,
- 4617E7B0121E078F005EC8A8 /* AsyncFileWriter.h */,
6E4E91A710F7FB3100A2779C /* CanvasContextAttributes.cpp */,
6E4E91A810F7FB3100A2779C /* CanvasContextAttributes.h */,
49484FB3102CF23C00187DD3 /* CanvasGradient.cpp */,
@@ -12503,7 +12534,6 @@
656B84D70AEA1CE900A095B4 /* network */ = {
isa = PBXGroup;
children = (
- 628D214B12131ED10055DCFC /* NetworkingContext.h */,
B2F34FE70E82F81700F627CD /* cf */,
656B84E70AEA1DAE00A095B4 /* mac */,
934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */,
@@ -12530,6 +12560,7 @@
514C765C0CE923A1007EF3CD /* HTTPHeaderMap.h */,
514C765D0CE923A1007EF3CD /* HTTPParsers.cpp */,
514C765E0CE923A1007EF3CD /* HTTPParsers.h */,
+ 628D214B12131ED10055DCFC /* NetworkingContext.h */,
1A7FA61A0DDA3BBE0028F8A5 /* NetworkStateNotifier.cpp */,
1A7FA6180DDA3B3A0028F8A5 /* NetworkStateNotifier.h */,
514C765F0CE923A1007EF3CD /* ProtectionSpace.cpp */,
@@ -12789,7 +12820,6 @@
E1271A510EEECD1C00F61213 /* WorkerNavigator.idl */,
97DD4D840FDF4D6D00ECF9A4 /* XSSAuditor.cpp */,
97DD4D850FDF4D6E00ECF9A4 /* XSSAuditor.h */,
- CE172E001136E8CE0062A533 /* ZoomMode.h */,
);
path = page;
sourceTree = "<group>";
@@ -14085,8 +14115,6 @@
BE983D95052A2E0A00892D85 /* WebCoreKeyboardUIMode.h */,
F587855402DE375901EA4122 /* WebCoreViewFactory.h */,
F587855502DE375901EA4122 /* WebCoreViewFactory.m */,
- 5150C2A10702629000AF642C /* WebDashboardRegion.h */,
- 5150C2A50702629800AF642C /* WebDashboardRegion.m */,
);
path = mac;
sourceTree = "<group>";
@@ -14115,10 +14143,10 @@
2ED609BA1145B07100C8684E /* DOMFormData.cpp */,
2ED609BB1145B07100C8684E /* DOMFormData.h */,
2E0888C3114883A900AF4265 /* DOMFormData.idl */,
- 97205AAD123928CA00B17380 /* FTPDirectoryDocument.cpp */,
- 97205AAE123928CA00B17380 /* FTPDirectoryDocument.h */,
A8136D370973A8E700D74463 /* FormDataList.cpp */,
A8136D360973A8E700D74463 /* FormDataList.h */,
+ 97205AAD123928CA00B17380 /* FTPDirectoryDocument.cpp */,
+ 97205AAE123928CA00B17380 /* FTPDirectoryDocument.h */,
BC97E239109144950010D361 /* HTMLAllCollection.cpp */,
BC97E238109144950010D361 /* HTMLAllCollection.h */,
BC97E23C109146F10010D361 /* HTMLAllCollection.idl */,
@@ -14471,9 +14499,9 @@
977B384C122883E900B81FF8 /* HTMLConstructionSite.h */,
977B384D122883E900B81FF8 /* HTMLDocumentParser.cpp */,
977B384E122883E900B81FF8 /* HTMLDocumentParser.h */,
- 977B384F122883E900B81FF8 /* HTMLEntityNames.in */,
977B371F1228721700B81FF8 /* HTMLElementStack.cpp */,
977B37201228721700B81FF8 /* HTMLElementStack.h */,
+ 977B384F122883E900B81FF8 /* HTMLEntityNames.in */,
977B3850122883E900B81FF8 /* HTMLEntityParser.cpp */,
977B3851122883E900B81FF8 /* HTMLEntityParser.h */,
977B3852122883E900B81FF8 /* HTMLEntitySearch.cpp */,
@@ -14482,6 +14510,8 @@
977B3855122883E900B81FF8 /* HTMLFormattingElementList.cpp */,
977B3856122883E900B81FF8 /* HTMLFormattingElementList.h */,
97BC849A12370A4B000C6161 /* HTMLInputStream.h */,
+ 93E2A304123E9DC0009FE12A /* HTMLParserIdioms.cpp */,
+ 93E2A305123E9DC0009FE12A /* HTMLParserIdioms.h */,
977B3857122883E900B81FF8 /* HTMLParserScheduler.cpp */,
977B3858122883E900B81FF8 /* HTMLParserScheduler.h */,
977B3859122883E900B81FF8 /* HTMLPreloadScanner.cpp */,
@@ -14496,6 +14526,7 @@
977B37221228721700B81FF8 /* HTMLTreeBuilder.h */,
977B3860122883E900B81FF8 /* HTMLViewSourceParser.cpp */,
977B3861122883E900B81FF8 /* HTMLViewSourceParser.h */,
+ 8A309C9E123950BE00CB9204 /* NestingLevelIncrementer.h */,
97BC84811236FD93000C6161 /* TextDocumentParser.cpp */,
97BC84821236FD93000C6161 /* TextDocumentParser.h */,
97BC84A212370DC7000C6161 /* TextViewSourceParser.cpp */,
@@ -15205,6 +15236,8 @@
14E8378D09F85D4F00B85AE4 /* JSEvent.h */,
BC60D9BD0D2A269A00B9918F /* JSEventException.cpp */,
BC60D9BE0D2A269A00B9918F /* JSEventException.h */,
+ 8482B74F1198CB6B00BFB005 /* JSHashChangeEvent.cpp */,
+ 8482B7501198CB6B00BFB005 /* JSHashChangeEvent.h */,
A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */,
A86629CD09DA2B47009633A5 /* JSKeyboardEvent.h */,
E107400B0E77BDC00033AF24 /* JSMessageChannel.cpp */,
@@ -15940,6 +15973,7 @@
B5320D68122A24E9002D1440 /* cocoa */,
A75E8B7F0E1DE2B0007F2481 /* filters */,
B27535490B053814002CE64F /* mac */,
+ FBC220DD1237FBEB00BCF788 /* opengl */,
F4EAF4AB10C74268009100D3 /* opentype */,
49E911B20EF86D27009D0CAF /* transforms */,
490707E41219C04300D90E51 /* ANGLEWebKitBridge.cpp */,
@@ -16152,7 +16186,6 @@
A622A8F5122C44A600A785B3 /* BindingSecurity.h */,
A622A8F6122C44A600A785B3 /* BindingSecurityBase.cpp */,
A622A8F7122C44A600A785B3 /* BindingSecurityBase.h */,
- A622A8F8122C44A600A785B3 /* BindingUtilities.h */,
A622A8F9122C44A600A785B3 /* GenericBinding.h */,
);
name = generic;
@@ -16193,8 +16226,8 @@
BCCE58A71061E82F008FB35A /* Callback Objects */,
BCCE58B41061E925008FB35A /* Constructors */,
BC4EDEF70C08F414007EDD49 /* Custom */,
- A622A8EF122C444500A785B3 /* specialization */,
14DFB33F0A7DF7630018F769 /* Derived Sources */,
+ A622A8EF122C444500A785B3 /* specialization */,
BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */,
93F8B3060A300FEA00F61AB8 /* CodeGeneratorJS.pm */,
BC53DA61114314BD000D817E /* DOMObjectHashTableMap.cpp */,
@@ -16348,6 +16381,7 @@
33503CBF10179C1A003B47E1 /* JSDesktopNotificationsCustom.cpp */,
31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */,
590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */,
+ 893C47DE123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp */,
49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
1AC226160DB69F740089B669 /* JSDOMApplicationCacheCustom.cpp */,
2E0888E5114884E200AF4265 /* JSDOMFormDataCustom.cpp */,
@@ -16358,6 +16392,7 @@
BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */,
652FBBBB0DE27CB60001D386 /* JSDOMWindowCustom.h */,
BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */,
+ 893C47CA123EEBA2002B3D86 /* JSEntryCustom.cpp */,
BCEFAF4D0C317E6900FA81F6 /* JSEventCustom.cpp */,
BC275B8011C5D2B400C9206C /* JSEventSourceCustom.cpp */,
49EECF7210508D9C00099FAB /* JSFloat32ArrayCustom.cpp */,
@@ -16559,7 +16594,6 @@
BCB16BFB0979C38700467741 /* loader */ = {
isa = PBXGroup;
children = (
- 628D214D12131EF40055DCFC /* FrameNetworkingContext.h */,
1A8F6BB00DB55CDC001DB794 /* appcache */,
512DD8E80D91E691000F89EE /* archive */,
5126E6B60A2E3AEF005C29FA /* icon */,
@@ -16580,6 +16614,8 @@
E47B4BE70E71241600038854 /* CachedResourceHandle.cpp */,
E47B4BE60E71241600038854 /* CachedResourceHandle.h */,
E472053A0E5A053A0006BB4D /* CachedResourceHandle.h */,
+ BCB16C100979C3BD00467741 /* CachedResourceLoader.cpp */,
+ BCB16C110979C3BD00467741 /* CachedResourceLoader.h */,
BCB16C0A0979C3BD00467741 /* CachedScript.cpp */,
BCB16C0B0979C3BD00467741 /* CachedScript.h */,
BCB16C0E0979C3BD00467741 /* CachedXSLStyleSheet.cpp */,
@@ -16589,8 +16625,6 @@
E1C416110F6562FD0092D2FB /* CrossOriginAccessControl.h */,
E1C415DD0F655D7C0092D2FB /* CrossOriginPreflightResultCache.cpp */,
E1C415D90F655D6F0092D2FB /* CrossOriginPreflightResultCache.h */,
- BCB16C100979C3BD00467741 /* CachedResourceLoader.cpp */,
- BCB16C110979C3BD00467741 /* CachedResourceLoader.h */,
93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */,
656D371E0ADBA5DE00A4554D /* DocumentLoader.h */,
8A12E35C11FA33280025836A /* DocumentLoadTiming.h */,
@@ -16609,6 +16643,7 @@
D000EBA011BDAFD400C47726 /* FrameLoaderStateMachine.cpp */,
D000EBA111BDAFD400C47726 /* FrameLoaderStateMachine.h */,
93B77A370ADD792500EA4B81 /* FrameLoaderTypes.h */,
+ 628D214D12131EF40055DCFC /* FrameNetworkingContext.h */,
51C81B870C4422F70019ECE3 /* FTPDirectoryParser.cpp */,
51C81B880C4422F70019ECE3 /* FTPDirectoryParser.h */,
97DCE1FF10807C750057D394 /* HistoryController.cpp */,
@@ -17041,6 +17076,8 @@
0F6ECD440F252F3700BDE271 /* CSSPropertyLonghand.cpp */,
0F6ECD430F252F3700BDE271 /* CSSPropertyLonghand.h */,
BCEA4789097CAAC80094C9E4 /* CSSPropertyNames.in */,
+ 82E3D8DC122EA0D1003AE5BC /* CSSPropertySourceData.cpp */,
+ 82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */,
A80E6CC00A1989CA007FB8C5 /* CSSQuirkPrimitiveValue.h */,
9362640A0DE1137D009D5A00 /* CSSReflectionDirection.h */,
BC5A12DD0DC0414800C9AFAD /* CSSReflectValue.cpp */,
@@ -17092,6 +17129,7 @@
A80E6CC90A1989CA007FB8C5 /* FontFamilyValue.h */,
A80E6CC70A1989CA007FB8C5 /* FontValue.cpp */,
A80E6CC30A1989CA007FB8C5 /* FontValue.h */,
+ CD4E0AFA11F7BC27009D3811 /* fullscreen.css */,
93CA4C9909DF93FA00DF8677 /* html.css */,
93CA4C9A09DF93FA00DF8677 /* make-css-file-arrays.pl */,
93CA4C9B09DF93FA00DF8677 /* makeprop.pl */,
@@ -17153,7 +17191,6 @@
BC9ADD220CC4032600098C4C /* WebKitCSSTransformValue.h */,
31611E540E1C4D4A00F6A579 /* WebKitCSSTransformValue.idl */,
4CDE54EC0E5579780089E26C /* wml.css */,
- CD4E0AFA11F7BC27009D3811 /* fullscreen.css */,
);
path = css;
sourceTree = "<group>";
@@ -17164,6 +17201,7 @@
isa = PBXGroup;
children = (
BC8C8FAA0DDCD2F200B592F4 /* style */,
+ 088C2F7412390080003D65CE /* svg */,
A8CFF04B0A154F09000A4234 /* AutoTableLayout.cpp */,
A8CFF0490A154F09000A4234 /* AutoTableLayout.h */,
BCE7898A1120E8020060ECE5 /* BidiRun.cpp */,
@@ -17580,6 +17618,8 @@
93831B560D087D6000E5C984 /* ExceptionCode.cpp */,
935FBCF109BA143B00E230B1 /* ExceptionCode.h */,
A853123C11D0471B00D4D077 /* FragmentScriptingPermission.h */,
+ 8482B7441198C32E00BFB005 /* HashChangeEvent.idl */,
+ 2442BBF81194C9D300D49469 /* HashChangeEvent.h */,
08700BE60F086C5300919419 /* InputElement.cpp */,
08591AA40F085C4E009BACB1 /* InputElement.h */,
85031B2D0A44EFC700F992E0 /* KeyboardEvent.cpp */,
@@ -17771,6 +17811,14 @@
path = mathml;
sourceTree = "<group>";
};
+ FBC220DD1237FBEB00BCF788 /* opengl */ = {
+ isa = PBXGroup;
+ children = (
+ FBC220DE1237FBEB00BCF788 /* GraphicsContext3DOpenGL.cpp */,
+ );
+ path = opengl;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
@@ -17778,7 +17826,6 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
- B5320D6B122A24E9002D1440 /* FontPlatformData.h in Headers */,
B5B5DC6A119BB3D5002A8790 /* AbstractDatabase.h in Headers */,
41E1B1D10FF5986900576B3B /* AbstractWorker.h in Headers */,
29A8122E0FBB9C1D00510293 /* AccessibilityARIAGridCell.h in Headers */,
@@ -17805,6 +17852,7 @@
B5D31DFB11CF610B009F22B4 /* ActiveDOMCallback.h in Headers */,
E1C4DE690EA75C1E0023CCD6 /* ActiveDOMObject.h in Headers */,
84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */,
+ 490707E71219C04300D90E51 /* ANGLEWebKitBridge.h in Headers */,
49E912AB0EFAC906009D0CAF /* Animation.h in Headers */,
316FE1120E6E1DA700BF6088 /* AnimationBase.h in Headers */,
316FE1140E6E1DA700BF6088 /* AnimationController.h in Headers */,
@@ -17824,6 +17872,10 @@
BCFB2F77097A2E1A00BA703D /* Arena.h in Headers */,
49EECDE310503C2400099FAB /* ArrayBuffer.h in Headers */,
49EECDE010503C2400099FAB /* ArrayBufferView.h in Headers */,
+ 2EF1BFF7121CB0BD00C27627 /* AsyncFileStream.h in Headers */,
+ 89D08DA012228451001241DF /* AsyncFileSystem.h in Headers */,
+ 89D08DA112228451001241DF /* AsyncFileSystemCallbacks.h in Headers */,
+ 976D6C77122B8A3D001FD1F7 /* AsyncFileWriter.h in Headers */,
B0149E7E11A4B21500196A7B /* AsyncImageResizer.h in Headers */,
8A413AE01207BBA50082016E /* AsyncScriptRunner.h in Headers */,
37C61F0112095C87007A3C67 /* AtomicStringKeyedMRUCache.h in Headers */,
@@ -17850,7 +17902,18 @@
B2C3DA250D006C1D00EF6F26 /* BidiResolver.h in Headers */,
BCE789861120E7A60060ECE5 /* BidiRun.h in Headers */,
938192050F87E1EC00D5352A /* BinaryPropertyList.h in Headers */,
+ A622A8FA122C44A600A785B3 /* BindingLocation.h in Headers */,
+ A622A8FB122C44A600A785B3 /* BindingSecurity.h in Headers */,
+ A622A8FD122C44A600A785B3 /* BindingSecurityBase.h in Headers */,
A89943280B42338800D7C802 /* BitmapImage.h in Headers */,
+ 976D6C79122B8A3D001FD1F7 /* Blob.h in Headers */,
+ 976D6C7C122B8A3D001FD1F7 /* BlobBuilder.h in Headers */,
+ 2EDEF1F4121B0EFC00726DB2 /* BlobData.h in Headers */,
+ 2EDEF1F5121B0EFC00726DB2 /* BlobRegistry.h in Headers */,
+ 2EDEF1F7121B0EFC00726DB2 /* BlobRegistryImpl.h in Headers */,
+ 2EB4BCD3121F03E300EC4885 /* BlobResourceHandle.h in Headers */,
+ 2EDEF1F8121B0EFC00726DB2 /* BlobStorageData.h in Headers */,
+ 976D6C7F122B8A3D001FD1F7 /* BlobURL.h in Headers */,
93F199BE08245E59001E9ABC /* BlockExceptions.h in Headers */,
BC5EB5E10E81BE8700B25965 /* BorderData.h in Headers */,
BC5EB5DB0E81B7EA00B25965 /* BorderValue.h in Headers */,
@@ -17873,6 +17936,7 @@
BCFB2E5E0979E46400BA703D /* CachedResourceClient.h in Headers */,
BCB16C220979C3BD00467741 /* CachedResourceClientWalker.h in Headers */,
E47B4BE80E71241600038854 /* CachedResourceHandle.h in Headers */,
+ BCB16C2A0979C3BD00467741 /* CachedResourceLoader.h in Headers */,
BCB16C240979C3BD00467741 /* CachedScript.h in Headers */,
BCD533640ED6848900887468 /* CachedScriptSourceProvider.h in Headers */,
BCB16C280979C3BD00467741 /* CachedXSLStyleSheet.h in Headers */,
@@ -17909,6 +17973,7 @@
B22279630D00BF220071B782 /* ColorDistance.h in Headers */,
EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */,
9382DF5810A8D5C900925652 /* ColorSpace.h in Headers */,
+ BCDD454E1236C95C009A7985 /* ColumnInfo.h in Headers */,
6550B6A2099DF0270090D781 /* Comment.h in Headers */,
37C236111097EE7700EF9F72 /* ComplexTextController.h in Headers */,
316FE1160E6E1DA700BF6088 /* CompositeAnimation.h in Headers */,
@@ -17968,11 +18033,13 @@
A80E6D000A1989CA007FB8C5 /* CSSPageRule.h in Headers */,
BC772B3E0C4EA91E0083285F /* CSSParser.h in Headers */,
BC02A4B70E0997B9004B6D2B /* CSSParserValues.h in Headers */,
+ 977B3863122883E900B81FF8 /* CSSPreloadScanner.h in Headers */,
A80E6CE60A1989CA007FB8C5 /* CSSPrimitiveValue.h in Headers */,
E1ED8AC30CC49BE000BFC557 /* CSSPrimitiveValueMappings.h in Headers */,
A80E6CFF0A1989CA007FB8C5 /* CSSProperty.h in Headers */,
0F6ECD450F252F3700BDE271 /* CSSPropertyLonghand.h in Headers */,
656580F409D12B20000E61D7 /* CSSPropertyNames.h in Headers */,
+ 82E3D8DF122EA0D1003AE5BC /* CSSPropertySourceData.h in Headers */,
A80E6CEA0A1989CA007FB8C5 /* CSSQuirkPrimitiveValue.h in Headers */,
9362640B0DE1137D009D5A00 /* CSSReflectionDirection.h in Headers */,
BC5A12E00DC0414800C9AFAD /* CSSReflectValue.h in Headers */,
@@ -18034,13 +18101,15 @@
59309A1311F4AE6A00250603 /* DeviceOrientationClientMock.h in Headers */,
59A8F1D611A69513001AC34A /* DeviceOrientationController.h in Headers */,
59A85EA4119D68EC00DEF1EF /* DeviceOrientationEvent.h in Headers */,
+ 89878553122CA064003AABDA /* DirectoryEntry.h in Headers */,
+ 89878555122CA064003AABDA /* DirectoryReader.h in Headers */,
B2F34FE60E82F81400F627CD /* DNS.h in Headers */,
- BCB16C2A0979C3BD00467741 /* CachedResourceLoader.h in Headers */,
A8185F4009765766005826D9 /* Document.h in Headers */,
A8185F3D09765766005826D9 /* DocumentFragment.h in Headers */,
656D37360ADBA5DE00A4554D /* DocumentLoader.h in Headers */,
8A12E35D11FA33280025836A /* DocumentLoadTiming.h in Headers */,
ED2BA83C09A24B91006C0AC4 /* DocumentMarker.h in Headers */,
+ CE057FA61220731100A476D5 /* DocumentMarkerController.h in Headers */,
BCCFBAE80B5152ED0001F1D7 /* DocumentParser.h in Headers */,
0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */,
A8185F3909765766005826D9 /* DocumentType.h in Headers */,
@@ -18128,6 +18197,8 @@
BC00F0060E0A185500FD04E3 /* DOMFileInternal.h in Headers */,
BC00F0070E0A185500FD04E3 /* DOMFileList.h in Headers */,
BC00F0090E0A185500FD04E3 /* DOMFileListInternal.h in Headers */,
+ 89878557122CA064003AABDA /* DOMFilePath.h in Headers */,
+ 89878559122CA064003AABDA /* DOMFileSystem.h in Headers */,
2ED609BD1145B07100C8684E /* DOMFormData.h in Headers */,
BC1A37B6097C715F0019F3D8 /* DOMHTML.h in Headers */,
85DF81270AA7787200486AD7 /* DOMHTMLAnchorElement.h in Headers */,
@@ -18819,6 +18890,11 @@
5DC87EF011716DF2001C0E6D /* EmptyProtocolDefinitions.h in Headers */,
A8EA7EC20A1945D000A8EF5F /* Entity.h in Headers */,
A8EA7EC00A1945D000A8EF5F /* EntityReference.h in Headers */,
+ 8987855A122CA064003AABDA /* EntriesCallback.h in Headers */,
+ 8987855C122CA064003AABDA /* Entry.h in Headers */,
+ 8987855E122CA064003AABDA /* EntryArray.h in Headers */,
+ 8987855F122CA064003AABDA /* EntryCallback.h in Headers */,
+ 89878560122CA064003AABDA /* ErrorCallback.h in Headers */,
2ECF7AE210162B5800427DE7 /* ErrorEvent.h in Headers */,
85031B420A44EFC700F992E0 /* Event.h in Headers */,
BC60D90C0D2A17CE00B9918F /* EventException.h in Headers */,
@@ -18836,12 +18912,31 @@
A75E8B8D0E1DE2D6007F2481 /* FEComponentTransfer.h in Headers */,
A75E8B8F0E1DE2D6007F2481 /* FEComposite.h in Headers */,
84801955108BAFB300CB2B1F /* FEGaussianBlur.h in Headers */,
+ 976D6C81122B8A3D001FD1F7 /* File.h in Headers */,
+ 893C47A71238908B002B3D86 /* FileCallback.h in Headers */,
066C772B0AB603B700238CC4 /* FileChooser.h in Headers */,
+ 89878562122CA064003AABDA /* FileEntry.h in Headers */,
+ 976D6C83122B8A3D001FD1F7 /* FileError.h in Headers */,
+ 2EDF369F122C94C8002F7D4E /* FileException.h in Headers */,
+ 976D6C86122B8A3D001FD1F7 /* FileList.h in Headers */,
+ 976D6C89122B8A3D001FD1F7 /* FileReader.h in Headers */,
+ 2EDF369D122C94B4002F7D4E /* FileReaderSync.h in Headers */,
+ 2EF1BFEB121C9F4200C27627 /* FileStream.h in Headers */,
+ 2EF1BFF9121CB0CE00C27627 /* FileStreamClient.h in Headers */,
+ 976D6C8C122B8A3D001FD1F7 /* FileStreamProxy.h in Headers */,
514B3F730C722047000530DF /* FileSystem.h in Headers */,
+ 89878563122CA064003AABDA /* FileSystemCallback.h in Headers */,
+ 89878565122CA064003AABDA /* FileSystemCallbacks.h in Headers */,
+ 976D6C8E122B8A3D001FD1F7 /* FileThread.h in Headers */,
+ 976D6C8F122B8A3D001FD1F7 /* FileThreadTask.h in Headers */,
+ 976D6C91122B8A3D001FD1F7 /* FileWriter.h in Headers */,
+ 893C47A81238908B002B3D86 /* FileWriterCallback.h in Headers */,
+ 976D6C93122B8A3D001FD1F7 /* FileWriterClient.h in Headers */,
BC5EB69F0E81DAEB00B25965 /* FillLayer.h in Headers */,
845E72F80FD261EE00A87D79 /* Filter.h in Headers */,
08C9251A0FCC7C4A00480DEC /* FilterEffect.h in Headers */,
A8CFF04F0A154F09000A4234 /* FixedTableLayout.h in Headers */,
+ 89878566122CA064003AABDA /* Flags.h in Headers */,
49EECDE610503C2400099FAB /* Float32Array.h in Headers */,
BC073BAA0C399B1F000F5979 /* FloatConversion.h in Headers */,
B27535690B053814002CE64F /* FloatPoint.h in Headers */,
@@ -18859,6 +18954,7 @@
B2C3DA680D006CD600EF6F26 /* FontFallbackList.h in Headers */,
B2C3DA6A0D006CD600EF6F26 /* FontFamily.h in Headers */,
A80E6CF30A1989CA007FB8C5 /* FontFamilyValue.h in Headers */,
+ B5320D6B122A24E9002D1440 /* FontPlatformData.h in Headers */,
37ACCE420DA2980F0089E602 /* FontRenderingMode.h in Headers */,
B2C3DA6B0D006CD600EF6F26 /* FontSelector.h in Headers */,
37202199106213C600F25C4B /* FontSmoothingMode.h in Headers */,
@@ -18883,12 +18979,14 @@
628D214E12131EF40055DCFC /* FrameNetworkingContext.h in Headers */,
65A21485097A3F5300B9050A /* FrameTree.h in Headers */,
65CBFEFA0974F607001DAC25 /* FrameView.h in Headers */,
+ 97205AB0123928CA00B17380 /* FTPDirectoryDocument.h in Headers */,
51C81B8A0C4422F70019ECE3 /* FTPDirectoryParser.h in Headers */,
935C477509AC4D8E00A6AAB4 /* GapRects.h in Headers */,
1432E8470C51493800B1500F /* GCController.h in Headers */,
C0C054CC1118C8E400CE2636 /* generate-bindings.pl in Headers */,
BC23F0DB0DAFF4A4009FDC91 /* GeneratedImage.h in Headers */,
BCE04C8A0DAFF7A0007A0F41 /* Generator.h in Headers */,
+ A622A8FF122C44A600A785B3 /* GenericBinding.h in Headers */,
FE80D7C60E9C1F25000D6F75 /* Geolocation.h in Headers */,
BC56CB2210D5AC8000A77C64 /* GeolocationController.h in Headers */,
BC56CB2310D5AC8000A77C64 /* GeolocationControllerClient.h in Headers */,
@@ -18909,7 +19007,9 @@
0F580B060F12A2550051D689 /* GraphicsLayerCA.h in Headers */,
0F580B0E0F12A2690051D689 /* GraphicsLayerClient.h in Headers */,
B2A015AB0AF6CD53006BCE0E /* GraphicsTypes.h in Headers */,
+ C50B561712119D23008B46E0 /* GroupSettings.h in Headers */,
7693BAD2106C2DCA007B0823 /* HaltablePlugin.h in Headers */,
+ 8482B7461198C35400BFB005 /* HashChangeEvent.h in Headers */,
BC94D1540C275C8B006BC617 /* History.h in Headers */,
97DCE20210807C750057D394 /* HistoryController.h in Headers */,
51741D110B07259A00ED442C /* HistoryItem.h in Headers */,
@@ -18930,6 +19030,7 @@
A81369D2097374F600D74463 /* HTMLButtonElement.h in Headers */,
93F199E508245E59001E9ABC /* HTMLCanvasElement.h in Headers */,
A8DF3FD0097FA0FC0052981B /* HTMLCollection.h in Headers */,
+ 977B3865122883E900B81FF8 /* HTMLConstructionSite.h in Headers */,
BC77CDBC0FEFF1420070887B /* HTMLDataGridCellElement.h in Headers */,
BC77CB870FEBF5AF0070887B /* HTMLDataGridColElement.h in Headers */,
BC212A1F0FE8333200EC3708 /* HTMLDataGridElement.h in Headers */,
@@ -18939,12 +19040,18 @@
A8EA7CB70A192B9C00A8EF5F /* HTMLDivElement.h in Headers */,
A8EA79F70A1916DF00A8EF5F /* HTMLDListElement.h in Headers */,
93F198E508245E59001E9ABC /* HTMLDocument.h in Headers */,
+ 977B3867122883E900B81FF8 /* HTMLDocumentParser.h in Headers */,
93309DE8099E64920056E581 /* htmlediting.h in Headers */,
93F198E608245E59001E9ABC /* HTMLElement.h in Headers */,
A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */,
+ 977B37241228721700B81FF8 /* HTMLElementStack.h in Headers */,
A871D45C0A127CBC00B12A68 /* HTMLEmbedElement.h in Headers */,
+ 977B386A122883E900B81FF8 /* HTMLEntityParser.h in Headers */,
+ 977B386C122883E900B81FF8 /* HTMLEntitySearch.h in Headers */,
+ 977B386D122883E900B81FF8 /* HTMLEntityTable.h in Headers */,
A81369D4097374F600D74463 /* HTMLFieldSetElement.h in Headers */,
A8CFF7A60A156978000A4234 /* HTMLFontElement.h in Headers */,
+ 977B386F122883E900B81FF8 /* HTMLFormattingElementList.h in Headers */,
A8DF3FCE097FA0FC0052981B /* HTMLFormCollection.h in Headers */,
A81369CE097374F600D74463 /* HTMLFormControlElement.h in Headers */,
A81369D0097374F600D74463 /* HTMLFormElement.h in Headers */,
@@ -18960,6 +19067,7 @@
A8EA7D2D0A19385500A8EF5F /* HTMLImageElement.h in Headers */,
A8EA7D2B0A19385500A8EF5F /* HTMLImageLoader.h in Headers */,
A81369CC097374F600D74463 /* HTMLInputElement.h in Headers */,
+ 97BC849B12370A4B000C6161 /* HTMLInputStream.h in Headers */,
93309DE6099E64920056E581 /* HTMLInterchange.h in Headers */,
A81369CA097374F600D74463 /* HTMLIsIndexElement.h in Headers */,
A81369E4097374F600D74463 /* HTMLKeygenElement.h in Headers */,
@@ -18984,13 +19092,18 @@
A8EA7CB50A192B9C00A8EF5F /* HTMLParagraphElement.h in Headers */,
A871D4580A127CBC00B12A68 /* HTMLParamElement.h in Headers */,
BC588AF00BFA6CF900EE679E /* HTMLParserErrorCodes.h in Headers */,
+ 93E2A307123E9DC0009FE12A /* HTMLParserIdioms.h in Headers */,
449B19F50FA72ECE0015CA4A /* HTMLParserQuirks.h in Headers */,
+ 977B3871122883E900B81FF8 /* HTMLParserScheduler.h in Headers */,
A871D4560A127CBC00B12A68 /* HTMLPlugInElement.h in Headers */,
4415292E0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.h in Headers */,
A8EA7CB00A192B9C00A8EF5F /* HTMLPreElement.h in Headers */,
+ 977B3873122883E900B81FF8 /* HTMLPreloadScanner.h in Headers */,
A43BF5991149290A00C643CA /* HTMLProgressElement.h in Headers */,
A8CFF7A30A156978000A4234 /* HTMLQuoteElement.h in Headers */,
A871DC250A15205700B12A68 /* HTMLScriptElement.h in Headers */,
+ 977B3875122883E900B81FF8 /* HTMLScriptRunner.h in Headers */,
+ 977B3876122883E900B81FF8 /* HTMLScriptRunnerHost.h in Headers */,
A81369D8097374F600D74463 /* HTMLSelectElement.h in Headers */,
E44613A80CD6331000FADA75 /* HTMLSourceElement.h in Headers */,
A871DC230A15205700B12A68 /* HTMLStyleElement.h in Headers */,
@@ -19004,9 +19117,12 @@
A871DB250A150BD600B12A68 /* HTMLTableSectionElement.h in Headers */,
A81369D6097374F600D74463 /* HTMLTextAreaElement.h in Headers */,
A871DC280A15205700B12A68 /* HTMLTitleElement.h in Headers */,
+ 977B3878122883E900B81FF8 /* HTMLTokenizer.h in Headers */,
+ 977B37261228721700B81FF8 /* HTMLTreeBuilder.h in Headers */,
A8EA79F20A1916DF00A8EF5F /* HTMLUListElement.h in Headers */,
E44613AB0CD6331000FADA75 /* HTMLVideoElement.h in Headers */,
BCCD74DC0A4C8D35005FDA6D /* HTMLViewSourceDocument.h in Headers */,
+ 977B387A122883E900B81FF8 /* HTMLViewSourceParser.h in Headers */,
514C76710CE923A1007EF3CD /* HTTPHeaderMap.h in Headers */,
514C76730CE923A1007EF3CD /* HTTPParsers.h in Headers */,
375CD232119D43C800A2A859 /* Hyphenation.h in Headers */,
@@ -19050,7 +19166,9 @@
C0C054CE1118C8E400CE2636 /* IDLStructure.pm in Headers */,
B27535700B053814002CE64F /* Image.h in Headers */,
B2A10B920B3818BD00099AA4 /* ImageBuffer.h in Headers */,
+ BCA979171215D055005C485C /* ImageBufferData.h in Headers */,
A779791A0D6B9D0C003851B9 /* ImageData.h in Headers */,
+ 97205AB61239291000B17380 /* ImageDocument.h in Headers */,
089582560E857A7E00F82C83 /* ImageLoader.h in Headers */,
BC7F44A80B9E324E00A9D081 /* ImageObserver.h in Headers */,
B0149E8011A4B21500196A7B /* ImageResizerThread.h in Headers */,
@@ -19084,6 +19202,7 @@
F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */,
F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */,
7A0E770F10C00A8800A0276E /* InspectorFrontendHost.h in Headers */,
+ 9F0D6B2F121BFEBA006C0288 /* InspectorProfilerAgent.h in Headers */,
41F062010F5F0B6600A07EAC /* InspectorResource.h in Headers */,
7AB0B1C11211A62200A76940 /* InspectorStorageAgent.h in Headers */,
754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */,
@@ -19118,6 +19237,8 @@
BC124F000C26447A009E2349 /* JSBarInfo.h in Headers */,
BC946348107A936600857193 /* JSBeforeLoadEvent.h in Headers */,
51721FD311D27EF200638B42 /* JSBeforeProcessEvent.h in Headers */,
+ A622A8EE122C442A00A785B3 /* JSBinding.h in Headers */,
+ A622A8F3122C444500A785B3 /* JSBindingState.h in Headers */,
2E2D99CE10E2BBDA00496337 /* JSBlob.h in Headers */,
89CD029411C85B870070B791 /* JSBlobBuilder.h in Headers */,
1449E24C107D4A8400B5793F /* JSCallbackData.h in Headers */,
@@ -19165,12 +19286,15 @@
4162A4581011464700DFF3ED /* JSDedicatedWorkerContext.h in Headers */,
31FB1A66120A5D3F00DC02A0 /* JSDeviceMotionEvent.h in Headers */,
59A86008119DAFA100DEF1EF /* JSDeviceOrientationEvent.h in Headers */,
+ 8987858B122CA26A003AABDA /* JSDirectoryEntry.h in Headers */,
+ 8987858D122CA26A003AABDA /* JSDirectoryReader.h in Headers */,
659DDC8309E198BA001BF3C6 /* JSDocument.h in Headers */,
1A494EDF0A123F4C00FDAFC1 /* JSDocumentFragment.h in Headers */,
65DF31F609D1CC60000BE325 /* JSDocumentType.h in Headers */,
1AC2260D0DB69F190089B669 /* JSDOMApplicationCache.h in Headers */,
93B70D6409EB0C7C009D8468 /* JSDOMBinding.h in Headers */,
BC60D7C10D29A46300B9918F /* JSDOMCoreException.h in Headers */,
+ 898785A5122CA2A7003AABDA /* JSDOMFileSystem.h in Headers */,
2E0888D51148848A00AF4265 /* JSDOMFormData.h in Headers */,
E1C36C030EB076D6007410BC /* JSDOMGlobalObject.h in Headers */,
65DF31F809D1CC60000BE325 /* JSDOMImplementation.h in Headers */,
@@ -19189,6 +19313,11 @@
65DF31FA09D1CC60000BE325 /* JSElement.h in Headers */,
65DF323009D1DDBC000BE325 /* JSEntity.h in Headers */,
93F9B7750BA5FDDD00854064 /* JSEntityReference.h in Headers */,
+ 898785A7122CA2A7003AABDA /* JSEntriesCallback.h in Headers */,
+ 898785A9122CA2A7003AABDA /* JSEntry.h in Headers */,
+ 898785AB122CA2A7003AABDA /* JSEntryArray.h in Headers */,
+ 898785AD122CA2A7003AABDA /* JSEntryCallback.h in Headers */,
+ 898785AF122CA2A7003AABDA /* JSErrorCallback.h in Headers */,
2ECF7ADD10162B3800427DE7 /* JSErrorEvent.h in Headers */,
14E8378E09F85D4F00B85AE4 /* JSEvent.h in Headers */,
BC60D9C00D2A269A00B9918F /* JSEventException.h in Headers */,
@@ -19197,12 +19326,21 @@
BC60901F0E91B8EC000C68B5 /* JSEventTarget.h in Headers */,
3314ACEC10892086000F0E56 /* JSExceptionBase.h in Headers */,
BC00F0150E0A189500FD04E3 /* JSFile.h in Headers */,
+ 893C47B81238A099002B3D86 /* JSFileCallback.h in Headers */,
+ 898785B1122CA2A7003AABDA /* JSFileEntry.h in Headers */,
2E3BC0CB117D3E0800B9409A /* JSFileError.h in Headers */,
+ 898785F1122E1E87003AABDA /* JSFileException.h in Headers */,
BC00F0170E0A189500FD04E3 /* JSFileList.h in Headers */,
2E94F43C119207DA00B7F75D /* JSFileReader.h in Headers */,
+ 898785F5122E1EAC003AABDA /* JSFileReaderSync.h in Headers */,
+ 898785B3122CA2A7003AABDA /* JSFileSystemCallback.h in Headers */,
+ 46DA844E1224A0710060D006 /* JSFileWriter.h in Headers */,
+ 893C47BC1238A0A9002B3D86 /* JSFileWriterCallback.h in Headers */,
+ 898785B5122CA2A7003AABDA /* JSFlags.h in Headers */,
49EECF03105070C400099FAB /* JSFloat32Array.h in Headers */,
FE80DA640E9C4703000D6F75 /* JSGeolocation.h in Headers */,
FE80DA660E9C4703000D6F75 /* JSGeoposition.h in Headers */,
+ 8482B7521198CB6B00BFB005 /* JSHashChangeEvent.h in Headers */,
BC94D14F0C275C68006BC617 /* JSHistory.h in Headers */,
BC97E413109154FA0010D361 /* JSHTMLAllCollection.h in Headers */,
1A4A2DF00A1B852A00C807F8 /* JSHTMLAnchorElement.h in Headers */,
@@ -19311,6 +19449,8 @@
75793EC90D0CE72D007FC0AC /* JSMessageEvent.h in Headers */,
E1ADEDDA0E76BD93004A1A5E /* JSMessagePort.h in Headers */,
41F584C7104652CB009CAA64 /* JSMessagePortCustom.h in Headers */,
+ 898785B7122CA2A7003AABDA /* JSMetadata.h in Headers */,
+ 898785B9122CA2A7003AABDA /* JSMetadataCallback.h in Headers */,
A86629D109DA2B48009633A5 /* JSMouseEvent.h in Headers */,
65DF31FC09D1CC60000BE325 /* JSMutationEvent.h in Headers */,
BCD9C2C10C17B69E005C90A2 /* JSNamedNodeMap.h in Headers */,
@@ -19565,6 +19705,7 @@
BCB16C2D0979C3BD00467741 /* loader.h in Headers */,
656D37320ADBA5DE00A4554D /* LoaderNSURLExtras.h in Headers */,
06E81ED70AB5D5E900C87837 /* LocalCurrentGraphicsContext.h in Headers */,
+ 89878568122CA064003AABDA /* LocalFileSystem.h in Headers */,
BC5CFCA911F793320099ED09 /* LocalizationStrategy.h in Headers */,
935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */,
511F23180DC160DA004F0032 /* LocalStorageTask.h in Headers */,
@@ -19583,6 +19724,7 @@
49E911C70EF86D47009D0CAF /* MatrixTransformOperation.h in Headers */,
931BCC611124DFCB00BE70DD /* MediaCanStartListener.h in Headers */,
ABFE7E130D32FAF60066F4D2 /* MediaControlElements.h in Headers */,
+ 97205AB81239291000B17380 /* MediaDocument.h in Headers */,
E44613AD0CD6331000FADA75 /* MediaError.h in Headers */,
4E1959220A39DABA00220FE5 /* MediaFeatureNames.h in Headers */,
A8EA800E0A19516E00A8EF5F /* MediaList.h in Headers */,
@@ -19598,6 +19740,8 @@
75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */,
E1ADECBF0E76ACF1004A1A5E /* MessagePort.h in Headers */,
41BF700C0FE86F49005E8DEC /* MessagePortChannel.h in Headers */,
+ 89878569122CA064003AABDA /* Metadata.h in Headers */,
+ 8987856A122CA064003AABDA /* MetadataCallback.h in Headers */,
BC772C4F0C4EB3040083285F /* MIMETypeRegistry.h in Headers */,
C6D74AD509AA282E000B0A52 /* ModifySelectionListLevel.h in Headers */,
85031B460A44EFC700F992E0 /* MouseEvent.h in Headers */,
@@ -19612,6 +19756,7 @@
93CCF0270AF6C52900018E89 /* NavigationAction.h in Headers */,
A9C6E5A60D746458006442E9 /* Navigator.h in Headers */,
E12719C70EEEC16800F61213 /* NavigatorBase.h in Headers */,
+ 8A309C9F123950BE00CB9204 /* NestingLevelIncrementer.h in Headers */,
656D37430ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h in Headers */,
628D214C12131ED10055DCFC /* NetworkingContext.h in Headers */,
1A7FA6190DDA3B3A0028F8A5 /* NetworkStateNotifier.h in Headers */,
@@ -19674,6 +19819,7 @@
8A7CC96B12076D73001D4588 /* PendingScript.h in Headers */,
8A844D0511D3C18E0014065C /* Performance.h in Headers */,
49D5DC2E0F423A73008F20FD /* PerspectiveTransformOperation.h in Headers */,
+ D0FF2A5E11F8C45A007E74E0 /* PingLoader.h in Headers */,
377C4CDF1014E9F600B9AE42 /* PlaceholderDocument.h in Headers */,
935C476809AC4D4300A6AAB4 /* PlatformKeyboardEvent.h in Headers */,
932871C00B20DEB70049035A /* PlatformMenuDescription.h in Headers */,
@@ -19684,6 +19830,7 @@
B2C3DA2B0D006C1D00EF6F26 /* PlatformString.h in Headers */,
935C476B09AC4D4F00A6AAB4 /* PlatformWheelEvent.h in Headers */,
A9C6E4F40D745E48006442E9 /* PluginData.h in Headers */,
+ 97205ABC1239292700B17380 /* PluginDocument.h in Headers */,
7693BAD4106C2DCA007B0823 /* PluginHalter.h in Headers */,
7693BAD5106C2DCA007B0823 /* PluginHalterClient.h in Headers */,
1ADA14110E1AE5D900023EE5 /* PluginMainThreadScheduler.h in Headers */,
@@ -19877,6 +20024,7 @@
E11C9D9B0EB3681200E409DB /* ScriptExecutionContext.h in Headers */,
41002CCD0F66EDEF009E660D /* ScriptFunctionCall.h in Headers */,
4FD8D0F3119C718B002FA825 /* ScriptGCEvent.h in Headers */,
+ 9F3B947E12241758005304E7 /* ScriptHeapSnapshot.h in Headers */,
934CC1170EDCAC7300A658F2 /* ScriptInstance.h in Headers */,
41F066E40F64BCF600A07EAC /* ScriptObject.h in Headers */,
9F72304F11184B4100AD0126 /* ScriptProfile.h in Headers */,
@@ -20191,6 +20339,8 @@
0842BC811190147200C7D08F /* SVGTextChunkLayoutInfo.h in Headers */,
B2227AC80D00BF220071B782 /* SVGTextContentElement.h in Headers */,
B2227ACB0D00BF220071B782 /* SVGTextElement.h in Headers */,
+ 088C2F7A12390081003D65CE /* SVGTextLayoutAttributes.h in Headers */,
+ 088C2F7C12390081003D65CE /* SVGTextLayoutBuilder.h in Headers */,
083F529A11957FBE00653EBE /* SVGTextLayoutUtilities.h in Headers */,
B2227ACE0D00BF220071B782 /* SVGTextPathElement.h in Headers */,
B2227AD10D00BF220071B782 /* SVGTextPositioningElement.h in Headers */,
@@ -20226,6 +20376,8 @@
B2C3DA420D006C1D00EF6F26 /* TextCodecUTF16.h in Headers */,
AB014DE40E689A4300E10445 /* TextControlInnerElements.h in Headers */,
B2C3DA450D006C1D00EF6F26 /* TextDirection.h in Headers */,
+ 97BC84B412371180000C6161 /* TextDocument.h in Headers */,
+ 97BC84841236FD93000C6161 /* TextDocumentParser.h in Headers */,
B2C3DA470D006C1D00EF6F26 /* TextEncoding.h in Headers */,
C105DA640F3AA6B8001DD44F /* TextEncodingDetector.h in Headers */,
B2C3DA490D006C1D00EF6F26 /* TextEncodingRegistry.h in Headers */,
@@ -20237,9 +20389,11 @@
93F198F608245E59001E9ABC /* TextResourceDecoder.h in Headers */,
A824B4650E2EF2EA0081A7B7 /* TextRun.h in Headers */,
B2C3DA4B0D006C1D00EF6F26 /* TextStream.h in Headers */,
+ 97BC84A512370DC8000C6161 /* TextViewSourceParser.h in Headers */,
BCE658FF0EA9248A007E4533 /* Theme.h in Headers */,
BCE659E60EA92FB2007E4533 /* ThemeMac.h in Headers */,
BCE659A90EA927B9007E4533 /* ThemeTypes.h in Headers */,
+ 976D6C95122B8A3D001FD1F7 /* ThreadableBlobRegistry.h in Headers */,
0B90561B0F2578BF0095FF6A /* ThreadableLoader.h in Headers */,
0B90561C0F2578BF0095FF6A /* ThreadableLoaderClient.h in Headers */,
5112247410CFB8D8008099D7 /* ThreadableWebSocketChannel.h in Headers */,
@@ -20301,7 +20455,6 @@
37F818FD0D657606005E1F05 /* WebCoreURLResponse.h in Headers */,
93F199F008245E59001E9ABC /* WebCoreView.h in Headers */,
93F199B308245E59001E9ABC /* WebCoreViewFactory.h in Headers */,
- 93F199F108245E59001E9ABC /* WebDashboardRegion.h in Headers */,
BC6DADEF0A195FDF00E5CD14 /* WebFontCache.h in Headers */,
A7D20F6D107F438B00A80392 /* WebGLActiveInfo.h in Headers */,
49C7B9C91042D32F0009D447 /* WebGLBuffer.h in Headers */,
@@ -20429,108 +20582,6 @@
93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
- CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
- D0FF2A5E11F8C45A007E74E0 /* PingLoader.h in Headers */,
- C50B561712119D23008B46E0 /* GroupSettings.h in Headers */,
- BCA979171215D055005C485C /* ImageBufferData.h in Headers */,
- 490707E71219C04300D90E51 /* ANGLEWebKitBridge.h in Headers */,
- 2EDEF1F4121B0EFC00726DB2 /* BlobData.h in Headers */,
- 2EDEF1F5121B0EFC00726DB2 /* BlobRegistry.h in Headers */,
- 2EDEF1F7121B0EFC00726DB2 /* BlobRegistryImpl.h in Headers */,
- 2EDEF1F8121B0EFC00726DB2 /* BlobStorageData.h in Headers */,
- 2EF1BFEB121C9F4200C27627 /* FileStream.h in Headers */,
- 2EF1BFF7121CB0BD00C27627 /* AsyncFileStream.h in Headers */,
- 2EF1BFF9121CB0CE00C27627 /* FileStreamClient.h in Headers */,
- 4617E7B1121E078F005EC8A8 /* AsyncFileWriter.h in Headers */,
- CE057FA61220731100A476D5 /* DocumentMarkerController.h in Headers */,
- 9F0D6B2F121BFEBA006C0288 /* InspectorProfilerAgent.h in Headers */,
- 2EB4BCD3121F03E300EC4885 /* BlobResourceHandle.h in Headers */,
- 46DA844E1224A0710060D006 /* JSFileWriter.h in Headers */,
- 9F3B947E12241758005304E7 /* ScriptHeapSnapshot.h in Headers */,
- 89D08DA012228451001241DF /* AsyncFileSystem.h in Headers */,
- 89D08DA112228451001241DF /* AsyncFileSystemCallbacks.h in Headers */,
- 977B37241228721700B81FF8 /* HTMLElementStack.h in Headers */,
- 977B37261228721700B81FF8 /* HTMLTreeBuilder.h in Headers */,
- 977B3863122883E900B81FF8 /* CSSPreloadScanner.h in Headers */,
- 977B3865122883E900B81FF8 /* HTMLConstructionSite.h in Headers */,
- 977B3867122883E900B81FF8 /* HTMLDocumentParser.h in Headers */,
- 977B386A122883E900B81FF8 /* HTMLEntityParser.h in Headers */,
- 977B386C122883E900B81FF8 /* HTMLEntitySearch.h in Headers */,
- 977B386D122883E900B81FF8 /* HTMLEntityTable.h in Headers */,
- 977B386F122883E900B81FF8 /* HTMLFormattingElementList.h in Headers */,
- 977B3871122883E900B81FF8 /* HTMLParserScheduler.h in Headers */,
- 977B3873122883E900B81FF8 /* HTMLPreloadScanner.h in Headers */,
- 977B3875122883E900B81FF8 /* HTMLScriptRunner.h in Headers */,
- 977B3876122883E900B81FF8 /* HTMLScriptRunnerHost.h in Headers */,
- 977B3878122883E900B81FF8 /* HTMLTokenizer.h in Headers */,
- 977B387A122883E900B81FF8 /* HTMLViewSourceParser.h in Headers */,
- 976D6C77122B8A3D001FD1F7 /* AsyncFileWriter.h in Headers */,
- 976D6C79122B8A3D001FD1F7 /* Blob.h in Headers */,
- 976D6C7C122B8A3D001FD1F7 /* BlobBuilder.h in Headers */,
- 976D6C7F122B8A3D001FD1F7 /* BlobURL.h in Headers */,
- 976D6C81122B8A3D001FD1F7 /* File.h in Headers */,
- 976D6C83122B8A3D001FD1F7 /* FileError.h in Headers */,
- 976D6C86122B8A3D001FD1F7 /* FileList.h in Headers */,
- 976D6C89122B8A3D001FD1F7 /* FileReader.h in Headers */,
- 976D6C8C122B8A3D001FD1F7 /* FileStreamProxy.h in Headers */,
- 976D6C8E122B8A3D001FD1F7 /* FileThread.h in Headers */,
- 976D6C8F122B8A3D001FD1F7 /* FileThreadTask.h in Headers */,
- 976D6C91122B8A3D001FD1F7 /* FileWriter.h in Headers */,
- 976D6C93122B8A3D001FD1F7 /* FileWriterClient.h in Headers */,
- 976D6C95122B8A3D001FD1F7 /* ThreadableBlobRegistry.h in Headers */,
- 2EDF369D122C94B4002F7D4E /* FileReaderSync.h in Headers */,
- 2EDF369F122C94C8002F7D4E /* FileException.h in Headers */,
- 89878553122CA064003AABDA /* DirectoryEntry.h in Headers */,
- 89878555122CA064003AABDA /* DirectoryReader.h in Headers */,
- 89878557122CA064003AABDA /* DOMFilePath.h in Headers */,
- 89878559122CA064003AABDA /* DOMFileSystem.h in Headers */,
- 8987855A122CA064003AABDA /* EntriesCallback.h in Headers */,
- 8987855C122CA064003AABDA /* Entry.h in Headers */,
- 8987855E122CA064003AABDA /* EntryArray.h in Headers */,
- 8987855F122CA064003AABDA /* EntryCallback.h in Headers */,
- 89878560122CA064003AABDA /* ErrorCallback.h in Headers */,
- 89878562122CA064003AABDA /* FileEntry.h in Headers */,
- 89878563122CA064003AABDA /* FileSystemCallback.h in Headers */,
- 89878565122CA064003AABDA /* FileSystemCallbacks.h in Headers */,
- 89878566122CA064003AABDA /* Flags.h in Headers */,
- 89878568122CA064003AABDA /* LocalFileSystem.h in Headers */,
- 89878569122CA064003AABDA /* Metadata.h in Headers */,
- 8987856A122CA064003AABDA /* MetadataCallback.h in Headers */,
- 8987858B122CA26A003AABDA /* JSDirectoryEntry.h in Headers */,
- 8987858D122CA26A003AABDA /* JSDirectoryReader.h in Headers */,
- 898785A5122CA2A7003AABDA /* JSDOMFileSystem.h in Headers */,
- 898785A7122CA2A7003AABDA /* JSEntriesCallback.h in Headers */,
- 898785A9122CA2A7003AABDA /* JSEntry.h in Headers */,
- 898785AB122CA2A7003AABDA /* JSEntryArray.h in Headers */,
- 898785AD122CA2A7003AABDA /* JSEntryCallback.h in Headers */,
- 898785AF122CA2A7003AABDA /* JSErrorCallback.h in Headers */,
- 898785B1122CA2A7003AABDA /* JSFileEntry.h in Headers */,
- 898785B3122CA2A7003AABDA /* JSFileSystemCallback.h in Headers */,
- 898785B5122CA2A7003AABDA /* JSFlags.h in Headers */,
- 898785B7122CA2A7003AABDA /* JSMetadata.h in Headers */,
- 898785B9122CA2A7003AABDA /* JSMetadataCallback.h in Headers */,
- 898785F1122E1E87003AABDA /* JSFileException.h in Headers */,
- 898785F5122E1EAC003AABDA /* JSFileReaderSync.h in Headers */,
- BCDD454E1236C95C009A7985 /* ColumnInfo.h in Headers */,
- 97BC84841236FD93000C6161 /* TextDocumentParser.h in Headers */,
- 97BC849B12370A4B000C6161 /* HTMLInputStream.h in Headers */,
- 97BC84A512370DC8000C6161 /* TextViewSourceParser.h in Headers */,
- 97BC84B412371180000C6161 /* TextDocument.h in Headers */,
- 97205AB0123928CA00B17380 /* FTPDirectoryDocument.h in Headers */,
- 97205AB61239291000B17380 /* ImageDocument.h in Headers */,
- 97205AB81239291000B17380 /* MediaDocument.h in Headers */,
- 97205ABC1239292700B17380 /* PluginDocument.h in Headers */,
- A622A8EE122C442A00A785B3 /* JSBinding.h in Headers */,
- A622A8F3122C444500A785B3 /* JSBindingState.h in Headers */,
- A622A8FA122C44A600A785B3 /* BindingLocation.h in Headers */,
- A622A8FB122C44A600A785B3 /* BindingSecurity.h in Headers */,
- A622A8FD122C44A600A785B3 /* BindingSecurityBase.h in Headers */,
- A622A8FE122C44A600A785B3 /* BindingUtilities.h in Headers */,
- A622A8FF122C44A600A785B3 /* GenericBinding.h in Headers */,
- 893C47A71238908B002B3D86 /* FileCallback.h in Headers */,
- 893C47A81238908B002B3D86 /* FileWriterCallback.h in Headers */,
- 893C47B81238A099002B3D86 /* JSFileCallback.h in Headers */,
- 893C47BC1238A0A9002B3D86 /* JSFileWriterCallback.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -20856,6 +20907,7 @@
B5D31DFA11CF610B009F22B4 /* ActiveDOMCallback.cpp in Sources */,
E1C4DE6E0EA75C650023CCD6 /* ActiveDOMObject.cpp in Sources */,
84D0C4041115F1D40018AA34 /* AffineTransform.cpp in Sources */,
+ 490707E61219C04300D90E51 /* ANGLEWebKitBridge.cpp in Sources */,
49E912AA0EFAC906009D0CAF /* Animation.cpp in Sources */,
316FE1110E6E1DA700BF6088 /* AnimationBase.cpp in Sources */,
316FE1130E6E1DA700BF6088 /* AnimationController.cpp in Sources */,
@@ -20873,6 +20925,7 @@
BCFB2F76097A2E1A00BA703D /* Arena.cpp in Sources */,
49EECDE210503C2400099FAB /* ArrayBuffer.cpp in Sources */,
49EECDDF10503C2400099FAB /* ArrayBufferView.cpp in Sources */,
+ 89D08D9F12228451001241DF /* AsyncFileSystem.cpp in Sources */,
B0149E7D11A4B21500196A7B /* AsyncImageResizer.cpp in Sources */,
8A413AE11207BBA50082016E /* AsyncScriptRunner.cpp in Sources */,
A8C4A80E09D563270003AC8D /* Attr.cpp in Sources */,
@@ -20893,7 +20946,14 @@
B2C3DA230D006C1D00EF6F26 /* BidiContext.cpp in Sources */,
BCE7898B1120E8020060ECE5 /* BidiRun.cpp in Sources */,
938192030F87E1E600D5352A /* BinaryPropertyList.cpp in Sources */,
+ A622A8FC122C44A600A785B3 /* BindingSecurityBase.cpp in Sources */,
A89943290B42338800D7C802 /* BitmapImage.cpp in Sources */,
+ 976D6C78122B8A3D001FD1F7 /* Blob.cpp in Sources */,
+ 976D6C7B122B8A3D001FD1F7 /* BlobBuilder.cpp in Sources */,
+ 2EDEF1F3121B0EFC00726DB2 /* BlobData.cpp in Sources */,
+ 2EDEF1F6121B0EFC00726DB2 /* BlobRegistryImpl.cpp in Sources */,
+ 2EB4BCD2121F03E300EC4885 /* BlobResourceHandle.cpp in Sources */,
+ 976D6C7E122B8A3D001FD1F7 /* BlobURL.cpp in Sources */,
93F19AE108245E59001E9ABC /* BlockExceptions.mm in Sources */,
BCEA4854097D93020094C9E4 /* break_lines.cpp in Sources */,
93309DDA099E64920056E581 /* BreakBlockquoteCommand.cpp in Sources */,
@@ -20911,6 +20971,7 @@
BCB16C1F0979C3BD00467741 /* CachedResource.cpp in Sources */,
BCB16C210979C3BD00467741 /* CachedResourceClientWalker.cpp in Sources */,
E47B4BE90E71241600038854 /* CachedResourceHandle.cpp in Sources */,
+ BCB16C290979C3BD00467741 /* CachedResourceLoader.cpp in Sources */,
BCB16C230979C3BD00467741 /* CachedScript.cpp in Sources */,
BCB16C270979C3BD00467741 /* CachedXSLStyleSheet.cpp in Sources */,
6E4E91AC10F7FB3100A2779C /* CanvasContextAttributes.cpp in Sources */,
@@ -20992,9 +21053,11 @@
A80E6CF50A1989CA007FB8C5 /* CSSPageRule.cpp in Sources */,
BC772B3D0C4EA91E0083285F /* CSSParser.cpp in Sources */,
BC02A5400E099C5A004B6D2B /* CSSParserValues.cpp in Sources */,
+ 977B3862122883E900B81FF8 /* CSSPreloadScanner.cpp in Sources */,
A80E6D050A1989CA007FB8C5 /* CSSPrimitiveValue.cpp in Sources */,
A80E6CF70A1989CA007FB8C5 /* CSSProperty.cpp in Sources */,
0F6ECD460F252F3700BDE271 /* CSSPropertyLonghand.cpp in Sources */,
+ 82E3D8DE122EA0D1003AE5BC /* CSSPropertySourceData.cpp in Sources */,
BC5A12DF0DC0414800C9AFAD /* CSSReflectValue.cpp in Sources */,
A80E6D060A1989CA007FB8C5 /* CSSRule.cpp in Sources */,
A80E6D090A1989CA007FB8C5 /* CSSRuleList.cpp in Sources */,
@@ -21040,12 +21103,14 @@
59309A1111F4AE5800250603 /* DeviceOrientationClientMock.cpp in Sources */,
59A8F1D411A69508001AC34A /* DeviceOrientationController.cpp in Sources */,
59A85EA2119D68D900DEF1EF /* DeviceOrientationEvent.cpp in Sources */,
+ 89878552122CA064003AABDA /* DirectoryEntry.cpp in Sources */,
+ 89878554122CA064003AABDA /* DirectoryReader.cpp in Sources */,
B2F34FE90E82F82700F627CD /* DNSCFNet.cpp in Sources */,
- BCB16C290979C3BD00467741 /* CachedResourceLoader.cpp in Sources */,
A8185F3C09765766005826D9 /* Document.cpp in Sources */,
A8185F3F09765766005826D9 /* DocumentFragment.cpp in Sources */,
93E227E00AF589AD00D48324 /* DocumentLoader.cpp in Sources */,
1C26497A0D7E248A00BD10F2 /* DocumentLoaderMac.cpp in Sources */,
+ CE057FA51220731100A476D5 /* DocumentMarkerController.cpp in Sources */,
A8C2280E11D4A59700D5A7D3 /* DocumentParser.cpp in Sources */,
0B9056190F2578BE0095FF6A /* DocumentThreadableLoader.cpp in Sources */,
A8185F3A09765766005826D9 /* DocumentType.cpp in Sources */,
@@ -21091,6 +21156,8 @@
BC00F0050E0A185500FD04E3 /* DOMFile.mm in Sources */,
2E3BC109117D479800B9409A /* DOMFileError.mm in Sources */,
BC00F0080E0A185500FD04E3 /* DOMFileList.mm in Sources */,
+ 89878556122CA064003AABDA /* DOMFilePath.cpp in Sources */,
+ 89878558122CA064003AABDA /* DOMFileSystem.cpp in Sources */,
2ED609BC1145B07100C8684E /* DOMFormData.cpp in Sources */,
BC1A37B7097C715F0019F3D8 /* DOMHTML.mm in Sources */,
85DF81280AA7787200486AD7 /* DOMHTMLAnchorElement.mm in Sources */,
@@ -21358,6 +21425,8 @@
A8CFF6CB0A1561CD000A4234 /* EllipsisBox.cpp in Sources */,
A8EA7EC30A1945D000A8EF5F /* Entity.cpp in Sources */,
A8EA7EC10A1945D000A8EF5F /* EntityReference.cpp in Sources */,
+ 8987855B122CA064003AABDA /* Entry.cpp in Sources */,
+ 8987855D122CA064003AABDA /* EntryArray.cpp in Sources */,
2ECF7AE110162B5800427DE7 /* ErrorEvent.cpp in Sources */,
85031B410A44EFC700F992E0 /* Event.cpp in Sources */,
93C09A810B064F00005ABD4D /* EventHandler.cpp in Sources */,
@@ -21374,11 +21443,22 @@
A75E8B8C0E1DE2D6007F2481 /* FEComponentTransfer.cpp in Sources */,
A75E8B8E0E1DE2D6007F2481 /* FEComposite.cpp in Sources */,
84801954108BAFB300CB2B1F /* FEGaussianBlur.cpp in Sources */,
+ 976D6C80122B8A3D001FD1F7 /* File.cpp in Sources */,
934FE9E50B5CA539003E4A73 /* FileChooser.cpp in Sources */,
066C772D0AB603D200238CC4 /* FileChooserMac.mm in Sources */,
+ 89878561122CA064003AABDA /* FileEntry.cpp in Sources */,
+ 976D6C85122B8A3D001FD1F7 /* FileList.cpp in Sources */,
+ 976D6C88122B8A3D001FD1F7 /* FileReader.cpp in Sources */,
+ 2EDF369C122C94B4002F7D4E /* FileReaderSync.cpp in Sources */,
+ 2EF1BFEA121C9F4200C27627 /* FileStream.cpp in Sources */,
+ 976D6C8B122B8A3D001FD1F7 /* FileStreamProxy.cpp in Sources */,
+ C57FEDE11212EE9C0097BE65 /* FileSystem.cpp in Sources */,
+ 89878564122CA064003AABDA /* FileSystemCallbacks.cpp in Sources */,
5160306C0CC4362300C8AC25 /* FileSystemCF.cpp in Sources */,
514B3F760C722055000530DF /* FileSystemMac.mm in Sources */,
5160300B0CC4251200C8AC25 /* FileSystemPOSIX.cpp in Sources */,
+ 976D6C8D122B8A3D001FD1F7 /* FileThread.cpp in Sources */,
+ 976D6C90122B8A3D001FD1F7 /* FileWriter.cpp in Sources */,
BC5EB69E0E81DAEB00B25965 /* FillLayer.cpp in Sources */,
08C925190FCC7C4A00480DEC /* FilterEffect.cpp in Sources */,
A8CFF04D0A154F09000A4234 /* FixedTableLayout.cpp in Sources */,
@@ -21407,6 +21487,7 @@
A80E6CEC0A1989CA007FB8C5 /* FontFamilyValue.cpp in Sources */,
72626E020EF022FE00A07E20 /* FontFastPath.cpp in Sources */,
B2AFFC800D00A5C10030074D /* FontMac.mm in Sources */,
+ B5320D6C122A24E9002D1440 /* FontPlatformDataCocoa.mm in Sources */,
B734B181119B9911006587BD /* FontTranscoder.cpp in Sources */,
A80E6CF10A1989CA007FB8C5 /* FontValue.cpp in Sources */,
D05CED290A40BB2C00C5AF38 /* FormatBlockCommand.cpp in Sources */,
@@ -21422,6 +21503,7 @@
65BF02450974819000C43196 /* FrameMac.mm in Sources */,
65A21484097A3F5300B9050A /* FrameTree.cpp in Sources */,
65CBFEF90974F607001DAC25 /* FrameView.cpp in Sources */,
+ 97205AAF123928CA00B17380 /* FTPDirectoryDocument.cpp in Sources */,
51C81B890C4422F70019ECE3 /* FTPDirectoryParser.cpp in Sources */,
1432E8490C51493F00B1500F /* GCController.cpp in Sources */,
BCE04C940DAFF902007A0F41 /* GeneratedImage.cpp in Sources */,
@@ -21436,11 +21518,13 @@
6E21C6C01126338500A7BE02 /* GraphicsContext3D.cpp in Sources */,
6E21C6C21126339900A7BE02 /* GraphicsContext3DCG.cpp in Sources */,
49FFBF1D11C8550E006A7118 /* GraphicsContext3DMac.mm in Sources */,
+ FBC220DF1237FBEB00BCF788 /* GraphicsContext3DOpenGL.cpp in Sources */,
B2ED97710B1F55CE00257D0F /* GraphicsContextCG.cpp in Sources */,
B277B4040B22F37C0004BEC6 /* GraphicsContextMac.mm in Sources */,
0F580B0C0F12A2690051D689 /* GraphicsLayer.cpp in Sources */,
0F580B050F12A2550051D689 /* GraphicsLayerCA.mm in Sources */,
B2A015AA0AF6CD53006BCE0E /* GraphicsTypes.cpp in Sources */,
+ C50B561612119D23008B46E0 /* GroupSettings.cpp in Sources */,
BC94D1530C275C8B006BC617 /* History.cpp in Sources */,
97DCE20110807C750057D394 /* HistoryController.cpp in Sources */,
51741D120B07259A00ED442C /* HistoryItem.cpp in Sources */,
@@ -21460,6 +21544,7 @@
A81369D3097374F600D74463 /* HTMLButtonElement.cpp in Sources */,
93F19AFD08245E59001E9ABC /* HTMLCanvasElement.cpp in Sources */,
A8DF3FD1097FA0FC0052981B /* HTMLCollection.cpp in Sources */,
+ 977B3864122883E900B81FF8 /* HTMLConstructionSite.cpp in Sources */,
BC77CDB80FEFF1210070887B /* HTMLDataGridCellElement.cpp in Sources */,
BC77CBAA0FEBF6C90070887B /* HTMLDataGridColElement.cpp in Sources */,
BCF524600FEBEE5D0095BF26 /* HTMLDataGridElement.cpp in Sources */,
@@ -21469,13 +21554,18 @@
A8EA7CB10A192B9C00A8EF5F /* HTMLDivElement.cpp in Sources */,
A8EA79F50A1916DF00A8EF5F /* HTMLDListElement.cpp in Sources */,
93F19A9108245E59001E9ABC /* HTMLDocument.cpp in Sources */,
+ 977B3866122883E900B81FF8 /* HTMLDocumentParser.cpp in Sources */,
93309DE7099E64920056E581 /* htmlediting.cpp in Sources */,
93F19A9208245E59001E9ABC /* HTMLElement.cpp in Sources */,
A17C81220F2A5CF7005DAAEB /* HTMLElementFactory.cpp in Sources */,
+ 977B37231228721700B81FF8 /* HTMLElementStack.cpp in Sources */,
A871D45F0A127CBC00B12A68 /* HTMLEmbedElement.cpp in Sources */,
+ 977B3869122883E900B81FF8 /* HTMLEntityParser.cpp in Sources */,
+ 977B386B122883E900B81FF8 /* HTMLEntitySearch.cpp in Sources */,
A8BC04921214F69600B5F122 /* HTMLEntityTable.cpp in Sources */,
A81369D5097374F600D74463 /* HTMLFieldSetElement.cpp in Sources */,
A8CFF7A20A156978000A4234 /* HTMLFontElement.cpp in Sources */,
+ 977B386E122883E900B81FF8 /* HTMLFormattingElementList.cpp in Sources */,
A8DF3FCF097FA0FC0052981B /* HTMLFormCollection.cpp in Sources */,
A81369CF097374F600D74463 /* HTMLFormControlElement.cpp in Sources */,
A81369D1097374F600D74463 /* HTMLFormElement.cpp in Sources */,
@@ -21516,12 +21606,16 @@
A8EA7CB20A192B9C00A8EF5F /* HTMLParagraphElement.cpp in Sources */,
A871D4590A127CBC00B12A68 /* HTMLParamElement.cpp in Sources */,
BC588B4B0BFA723C00EE679E /* HTMLParserErrorCodes.cpp in Sources */,
+ 93E2A306123E9DC0009FE12A /* HTMLParserIdioms.cpp in Sources */,
+ 977B3870122883E900B81FF8 /* HTMLParserScheduler.cpp in Sources */,
A871D4570A127CBC00B12A68 /* HTMLPlugInElement.cpp in Sources */,
4415292F0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.cpp in Sources */,
A8EA7CAD0A192B9C00A8EF5F /* HTMLPreElement.cpp in Sources */,
+ 977B3872122883E900B81FF8 /* HTMLPreloadScanner.cpp in Sources */,
A43BF5981149290A00C643CA /* HTMLProgressElement.cpp in Sources */,
A8CFF7A50A156978000A4234 /* HTMLQuoteElement.cpp in Sources */,
A871DC220A15205700B12A68 /* HTMLScriptElement.cpp in Sources */,
+ 977B3874122883E900B81FF8 /* HTMLScriptRunner.cpp in Sources */,
A81369D9097374F600D74463 /* HTMLSelectElement.cpp in Sources */,
E44613A70CD6331000FADA75 /* HTMLSourceElement.cpp in Sources */,
A871DC260A15205700B12A68 /* HTMLStyleElement.cpp in Sources */,
@@ -21535,9 +21629,12 @@
A871DB260A150BD600B12A68 /* HTMLTableSectionElement.cpp in Sources */,
A81369D7097374F600D74463 /* HTMLTextAreaElement.cpp in Sources */,
A871DC290A15205700B12A68 /* HTMLTitleElement.cpp in Sources */,
+ 977B3877122883E900B81FF8 /* HTMLTokenizer.cpp in Sources */,
+ 977B37251228721700B81FF8 /* HTMLTreeBuilder.cpp in Sources */,
A8EA79F30A1916DF00A8EF5F /* HTMLUListElement.cpp in Sources */,
E44613AA0CD6331000FADA75 /* HTMLVideoElement.cpp in Sources */,
BCCD74E50A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp in Sources */,
+ 977B3879122883E900B81FF8 /* HTMLViewSourceParser.cpp in Sources */,
0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */,
514C76720CE923A1007EF3CD /* HTTPParsers.cpp in Sources */,
371A67CB11C6C7DB00047B8B /* HyphenationCF.cpp in Sources */,
@@ -21573,6 +21670,7 @@
B2A10B940B3818D700099AA4 /* ImageBufferCG.cpp in Sources */,
B275355E0B053814002CE64F /* ImageCG.cpp in Sources */,
A77979190D6B9D0C003851B9 /* ImageData.cpp in Sources */,
+ 97205AB51239291000B17380 /* ImageDocument.cpp in Sources */,
089582550E857A7E00F82C83 /* ImageLoader.cpp in Sources */,
B275357B0B053814002CE64F /* ImageMac.mm in Sources */,
B0149E7F11A4B21500196A7B /* ImageResizerThread.cpp in Sources */,
@@ -21604,6 +21702,7 @@
4F4F5FFB11CBD2E100A186BF /* InspectorFrontend.cpp in Sources */,
F344C75811294FF600F26EEE /* InspectorFrontendClientLocal.cpp in Sources */,
7A0E770E10C00A8800A0276E /* InspectorFrontendHost.cpp in Sources */,
+ 9F0D6B2E121BFEBA006C0288 /* InspectorProfilerAgent.cpp in Sources */,
41F062020F5F0B6600A07EAC /* InspectorResource.cpp in Sources */,
7AB0B1C01211A62200A76940 /* InspectorStorageAgent.cpp in Sources */,
754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */,
@@ -21640,6 +21739,7 @@
BC124EFF0C26447A009E2349 /* JSBarInfo.cpp in Sources */,
BC946346107A934B00857193 /* JSBeforeLoadEvent.cpp in Sources */,
51721FD211D27EF200638B42 /* JSBeforeProcessEvent.cpp in Sources */,
+ A622A8F2122C444500A785B3 /* JSBindingState.cpp in Sources */,
2E2D99CD10E2BBDA00496337 /* JSBlob.cpp in Sources */,
89CD029311C85B870070B791 /* JSBlobBuilder.cpp in Sources */,
1449E287107D4DB400B5793F /* JSCallbackData.cpp in Sources */,
@@ -21703,6 +21803,9 @@
31FB1A6C120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp in Sources */,
59A86006119DAF7F00DEF1EF /* JSDeviceOrientationEvent.cpp in Sources */,
590E1B4B11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp in Sources */,
+ 8987858A122CA26A003AABDA /* JSDirectoryEntry.cpp in Sources */,
+ 893C47DF123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp in Sources */,
+ 8987858C122CA26A003AABDA /* JSDirectoryReader.cpp in Sources */,
659DDC8209E198BA001BF3C6 /* JSDocument.cpp in Sources */,
49C7BA8D1042F5B10009D447 /* JSDocumentCustom.cpp in Sources */,
1A494EDE0A123F4C00FDAFC1 /* JSDocumentFragment.cpp in Sources */,
@@ -21711,6 +21814,7 @@
1AC226170DB69F740089B669 /* JSDOMApplicationCacheCustom.cpp in Sources */,
93B70D6309EB0C7C009D8468 /* JSDOMBinding.cpp in Sources */,
BC60D7C00D29A46300B9918F /* JSDOMCoreException.cpp in Sources */,
+ 898785A4122CA2A7003AABDA /* JSDOMFileSystem.cpp in Sources */,
2E0888D41148848A00AF4265 /* JSDOMFormData.cpp in Sources */,
2E0888E6114884E200AF4265 /* JSDOMFormDataCustom.cpp in Sources */,
E1C36CBD0EB08062007410BC /* JSDOMGlobalObject.cpp in Sources */,
@@ -21736,6 +21840,12 @@
BC2ED5550C6B9BD300920BFF /* JSElementCustom.cpp in Sources */,
65DF322F09D1DDBC000BE325 /* JSEntity.cpp in Sources */,
93F9B7740BA5FDDC00854064 /* JSEntityReference.cpp in Sources */,
+ 898785A6122CA2A7003AABDA /* JSEntriesCallback.cpp in Sources */,
+ 898785A8122CA2A7003AABDA /* JSEntry.cpp in Sources */,
+ 898785AA122CA2A7003AABDA /* JSEntryArray.cpp in Sources */,
+ 898785AC122CA2A7003AABDA /* JSEntryCallback.cpp in Sources */,
+ 893C47CC123EEBA2002B3D86 /* JSEntryCustom.cpp in Sources */,
+ 898785AE122CA2A7003AABDA /* JSErrorCallback.cpp in Sources */,
2ECF7ADC10162B3800427DE7 /* JSErrorEvent.cpp in Sources */,
14E8378409F85D1C00B85AE4 /* JSEvent.cpp in Sources */,
BCEFAF4E0C317E6900FA81F6 /* JSEventCustom.cpp in Sources */,
@@ -21746,14 +21856,23 @@
BC6090200E91B8EC000C68B5 /* JSEventTarget.cpp in Sources */,
3314ACEB10892086000F0E56 /* JSExceptionBase.cpp in Sources */,
BC00F0140E0A189500FD04E3 /* JSFile.cpp in Sources */,
+ 893C47B71238A099002B3D86 /* JSFileCallback.cpp in Sources */,
+ 898785B0122CA2A7003AABDA /* JSFileEntry.cpp in Sources */,
2E3BC0CA117D3E0800B9409A /* JSFileError.cpp in Sources */,
+ 898785F0122E1E87003AABDA /* JSFileException.cpp in Sources */,
BC00F0160E0A189500FD04E3 /* JSFileList.cpp in Sources */,
2E94F43B119207DA00B7F75D /* JSFileReader.cpp in Sources */,
+ 898785F4122E1EAC003AABDA /* JSFileReaderSync.cpp in Sources */,
+ 898785B2122CA2A7003AABDA /* JSFileSystemCallback.cpp in Sources */,
+ 46DA844D1224A0710060D006 /* JSFileWriter.cpp in Sources */,
+ 893C47BB1238A0A9002B3D86 /* JSFileWriterCallback.cpp in Sources */,
+ 898785B4122CA2A7003AABDA /* JSFlags.cpp in Sources */,
49EECF02105070C400099FAB /* JSFloat32Array.cpp in Sources */,
49EECF7910508D9C00099FAB /* JSFloat32ArrayCustom.cpp in Sources */,
FE80DA630E9C4703000D6F75 /* JSGeolocation.cpp in Sources */,
FE80D7AB0E9C1ED2000D6F75 /* JSGeolocationCustom.cpp in Sources */,
FE80DA650E9C4703000D6F75 /* JSGeoposition.cpp in Sources */,
+ 8482B7511198CB6B00BFB005 /* JSHashChangeEvent.cpp in Sources */,
BC94D14E0C275C68006BC617 /* JSHistory.cpp in Sources */,
BCE7B1930D4E86960075A539 /* JSHistoryCustom.cpp in Sources */,
BC97E412109154FA0010D361 /* JSHTMLAllCollection.cpp in Sources */,
@@ -21890,6 +22009,8 @@
410B7E721045FAB000D8224F /* JSMessageEventCustom.cpp in Sources */,
E1ADEDDB0E76BD93004A1A5E /* JSMessagePort.cpp in Sources */,
E1ADED470E76B8DD004A1A5E /* JSMessagePortCustom.cpp in Sources */,
+ 898785B6122CA2A7003AABDA /* JSMetadata.cpp in Sources */,
+ 898785B8122CA2A7003AABDA /* JSMetadataCallback.cpp in Sources */,
A86629D209DA2B48009633A5 /* JSMouseEvent.cpp in Sources */,
65DF31FB09D1CC60000BE325 /* JSMutationEvent.cpp in Sources */,
BCD9C2C00C17B69E005C90A2 /* JSNamedNodeMap.cpp in Sources */,
@@ -22175,6 +22296,7 @@
BCB16C2C0979C3BD00467741 /* loader.cpp in Sources */,
656D37330ADBA5DE00A4554D /* LoaderNSURLExtras.mm in Sources */,
06E81EEC0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm in Sources */,
+ 89878567122CA064003AABDA /* LocalFileSystem.cpp in Sources */,
C046E1AC1208A9FE00BA2CF7 /* LocalizedStrings.cpp in Sources */,
511F23170DC160DA004F0032 /* LocalStorageTask.cpp in Sources */,
511F23190DC160DA004F0032 /* LocalStorageThread.cpp in Sources */,
@@ -22193,6 +22315,7 @@
49D5DC2B0F423A73008F20FD /* Matrix3DTransformOperation.cpp in Sources */,
49E911C60EF86D47009D0CAF /* MatrixTransformOperation.cpp in Sources */,
ABFE7E120D32FAF60066F4D2 /* MediaControlElements.cpp in Sources */,
+ 97205AB71239291000B17380 /* MediaDocument.cpp in Sources */,
4E1959210A39DABA00220FE5 /* MediaFeatureNames.cpp in Sources */,
A8EA80090A19516E00A8EF5F /* MediaList.cpp in Sources */,
E44613E30CD6819F00FADA75 /* MediaPlayer.cpp in Sources */,
@@ -22266,12 +22389,14 @@
8A7CC97012076F8A001D4588 /* PendingScript.cpp in Sources */,
8A844D0411D3C18E0014065C /* Performance.cpp in Sources */,
49D5DC2D0F423A73008F20FD /* PerspectiveTransformOperation.cpp in Sources */,
+ D0FF2A5D11F8C45A007E74E0 /* PingLoader.cpp in Sources */,
377C4CE01014E9F600B9AE42 /* PlaceholderDocument.cpp in Sources */,
41BF700F0FE86F61005E8DEC /* PlatformMessagePortChannel.cpp in Sources */,
935C477109AC4D7300A6AAB4 /* PlatformMouseEventMac.mm in Sources */,
BC94D1080C274F88006BC617 /* PlatformScreenMac.mm in Sources */,
1AD8F81C11CAB9E900E93E54 /* PlatformStrategies.cpp in Sources */,
A9C6E4F30D745E48006442E9 /* PluginData.cpp in Sources */,
+ 97205ABB1239292700B17380 /* PluginDocument.cpp in Sources */,
7693BAD3106C2DCA007B0823 /* PluginHalter.cpp in Sources */,
1ADA14100E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp in Sources */,
76FF17E311235673001D61B5 /* PluginViewNone.cpp in Sources */,
@@ -22731,6 +22856,8 @@
0853D73211C9109000B2FD42 /* SVGTextChunkLayoutInfo.cpp in Sources */,
B2227AC70D00BF220071B782 /* SVGTextContentElement.cpp in Sources */,
B2227ACA0D00BF220071B782 /* SVGTextElement.cpp in Sources */,
+ 088C2F7912390081003D65CE /* SVGTextLayoutAttributes.cpp in Sources */,
+ 088C2F7B12390081003D65CE /* SVGTextLayoutBuilder.cpp in Sources */,
083F529911957FBE00653EBE /* SVGTextLayoutUtilities.cpp in Sources */,
B2227ACD0D00BF220071B782 /* SVGTextPathElement.cpp in Sources */,
B2227AD00D00BF220071B782 /* SVGTextPositioningElement.cpp in Sources */,
@@ -22762,6 +22889,8 @@
B2C3DA3F0D006C1D00EF6F26 /* TextCodecUserDefined.cpp in Sources */,
B2C3DA410D006C1D00EF6F26 /* TextCodecUTF16.cpp in Sources */,
AB014DE30E689A4300E10445 /* TextControlInnerElements.cpp in Sources */,
+ 97BC84B312371180000C6161 /* TextDocument.cpp in Sources */,
+ 97BC84831236FD93000C6161 /* TextDocumentParser.cpp in Sources */,
B2C3DA460D006C1D00EF6F26 /* TextEncoding.cpp in Sources */,
C105DA620F3AA68F001DD44F /* TextEncodingDetectorICU.cpp in Sources */,
B2C3DA480D006C1D00EF6F26 /* TextEncodingRegistry.cpp in Sources */,
@@ -22769,8 +22898,10 @@
93309E1B099E64920056E581 /* TextIterator.cpp in Sources */,
93F19A9D08245E59001E9ABC /* TextResourceDecoder.cpp in Sources */,
B2C3DA4A0D006C1D00EF6F26 /* TextStream.cpp in Sources */,
+ 97BC84A412370DC8000C6161 /* TextViewSourceParser.cpp in Sources */,
BCE65D320EAD1211007E4533 /* Theme.cpp in Sources */,
BCE659E90EA92FFA007E4533 /* ThemeMac.mm in Sources */,
+ 976D6C94122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp in Sources */,
0B90561E0F257E930095FF6A /* ThreadableLoader.cpp in Sources */,
5112247210CFB8C6008099D7 /* ThreadableWebSocketChannel.cpp in Sources */,
51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */,
@@ -22813,7 +22944,6 @@
37F818FE0D657606005E1F05 /* WebCoreURLResponse.mm in Sources */,
93F19B0708245E59001E9ABC /* WebCoreView.m in Sources */,
93F19A5F08245E59001E9ABC /* WebCoreViewFactory.m in Sources */,
- 93F19B0808245E59001E9ABC /* WebDashboardRegion.m in Sources */,
BC6DADFA0A19602B00E5CD14 /* WebFontCache.mm in Sources */,
49C7B9C81042D32F0009D447 /* WebGLBuffer.cpp in Sources */,
6E4E91AE10F7FB3100A2779C /* WebGLContextAttributes.cpp in Sources */,
@@ -22931,78 +23061,6 @@
93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
- D0FF2A5D11F8C45A007E74E0 /* PingLoader.cpp in Sources */,
- C50B561612119D23008B46E0 /* GroupSettings.cpp in Sources */,
- 490707E61219C04300D90E51 /* ANGLEWebKitBridge.cpp in Sources */,
- C57FEDE11212EE9C0097BE65 /* FileSystem.cpp in Sources */,
- 2EDEF1F3121B0EFC00726DB2 /* BlobData.cpp in Sources */,
- 2EDEF1F6121B0EFC00726DB2 /* BlobRegistryImpl.cpp in Sources */,
- 2EF1BFEA121C9F4200C27627 /* FileStream.cpp in Sources */,
- CE057FA51220731100A476D5 /* DocumentMarkerController.cpp in Sources */,
- 9F0D6B2E121BFEBA006C0288 /* InspectorProfilerAgent.cpp in Sources */,
- 2EB4BCD2121F03E300EC4885 /* BlobResourceHandle.cpp in Sources */,
- 46DA844D1224A0710060D006 /* JSFileWriter.cpp in Sources */,
- 89D08D9F12228451001241DF /* AsyncFileSystem.cpp in Sources */,
- 977B37231228721700B81FF8 /* HTMLElementStack.cpp in Sources */,
- 977B37251228721700B81FF8 /* HTMLTreeBuilder.cpp in Sources */,
- 977B3862122883E900B81FF8 /* CSSPreloadScanner.cpp in Sources */,
- 977B3864122883E900B81FF8 /* HTMLConstructionSite.cpp in Sources */,
- 977B3866122883E900B81FF8 /* HTMLDocumentParser.cpp in Sources */,
- 977B3869122883E900B81FF8 /* HTMLEntityParser.cpp in Sources */,
- 977B386B122883E900B81FF8 /* HTMLEntitySearch.cpp in Sources */,
- 977B386E122883E900B81FF8 /* HTMLFormattingElementList.cpp in Sources */,
- 977B3870122883E900B81FF8 /* HTMLParserScheduler.cpp in Sources */,
- 977B3872122883E900B81FF8 /* HTMLPreloadScanner.cpp in Sources */,
- 977B3874122883E900B81FF8 /* HTMLScriptRunner.cpp in Sources */,
- 977B3877122883E900B81FF8 /* HTMLTokenizer.cpp in Sources */,
- 977B3879122883E900B81FF8 /* HTMLViewSourceParser.cpp in Sources */,
- B5320D6C122A24E9002D1440 /* FontPlatformDataCocoa.mm in Sources */,
- 976D6C78122B8A3D001FD1F7 /* Blob.cpp in Sources */,
- 976D6C7B122B8A3D001FD1F7 /* BlobBuilder.cpp in Sources */,
- 976D6C7E122B8A3D001FD1F7 /* BlobURL.cpp in Sources */,
- 976D6C80122B8A3D001FD1F7 /* File.cpp in Sources */,
- 976D6C85122B8A3D001FD1F7 /* FileList.cpp in Sources */,
- 976D6C88122B8A3D001FD1F7 /* FileReader.cpp in Sources */,
- 976D6C8B122B8A3D001FD1F7 /* FileStreamProxy.cpp in Sources */,
- 976D6C8D122B8A3D001FD1F7 /* FileThread.cpp in Sources */,
- 976D6C90122B8A3D001FD1F7 /* FileWriter.cpp in Sources */,
- 976D6C94122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp in Sources */,
- 2EDF369C122C94B4002F7D4E /* FileReaderSync.cpp in Sources */,
- 89878552122CA064003AABDA /* DirectoryEntry.cpp in Sources */,
- 89878554122CA064003AABDA /* DirectoryReader.cpp in Sources */,
- 89878556122CA064003AABDA /* DOMFilePath.cpp in Sources */,
- 89878558122CA064003AABDA /* DOMFileSystem.cpp in Sources */,
- 8987855B122CA064003AABDA /* Entry.cpp in Sources */,
- 8987855D122CA064003AABDA /* EntryArray.cpp in Sources */,
- 89878561122CA064003AABDA /* FileEntry.cpp in Sources */,
- 89878564122CA064003AABDA /* FileSystemCallbacks.cpp in Sources */,
- 89878567122CA064003AABDA /* LocalFileSystem.cpp in Sources */,
- 8987858A122CA26A003AABDA /* JSDirectoryEntry.cpp in Sources */,
- 8987858C122CA26A003AABDA /* JSDirectoryReader.cpp in Sources */,
- 898785A4122CA2A7003AABDA /* JSDOMFileSystem.cpp in Sources */,
- 898785A6122CA2A7003AABDA /* JSEntriesCallback.cpp in Sources */,
- 898785A8122CA2A7003AABDA /* JSEntry.cpp in Sources */,
- 898785AA122CA2A7003AABDA /* JSEntryArray.cpp in Sources */,
- 898785AC122CA2A7003AABDA /* JSEntryCallback.cpp in Sources */,
- 898785AE122CA2A7003AABDA /* JSErrorCallback.cpp in Sources */,
- 898785B0122CA2A7003AABDA /* JSFileEntry.cpp in Sources */,
- 898785B2122CA2A7003AABDA /* JSFileSystemCallback.cpp in Sources */,
- 898785B4122CA2A7003AABDA /* JSFlags.cpp in Sources */,
- 898785B6122CA2A7003AABDA /* JSMetadata.cpp in Sources */,
- 898785B8122CA2A7003AABDA /* JSMetadataCallback.cpp in Sources */,
- 898785F0122E1E87003AABDA /* JSFileException.cpp in Sources */,
- 898785F4122E1EAC003AABDA /* JSFileReaderSync.cpp in Sources */,
- 97BC84831236FD93000C6161 /* TextDocumentParser.cpp in Sources */,
- 97BC84A412370DC8000C6161 /* TextViewSourceParser.cpp in Sources */,
- 97BC84B312371180000C6161 /* TextDocument.cpp in Sources */,
- 97205AAF123928CA00B17380 /* FTPDirectoryDocument.cpp in Sources */,
- 97205AB51239291000B17380 /* ImageDocument.cpp in Sources */,
- 97205AB71239291000B17380 /* MediaDocument.cpp in Sources */,
- 97205ABB1239292700B17380 /* PluginDocument.cpp in Sources */,
- A622A8F2122C444500A785B3 /* JSBindingState.cpp in Sources */,
- A622A8FC122C44A600A785B3 /* BindingSecurityBase.cpp in Sources */,
- 893C47B71238A099002B3D86 /* JSFileCallback.cpp in Sources */,
- 893C47BB1238A0A9002B3D86 /* JSFileWriterCallback.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/accessibility/AccessibilityAllInOne.cpp b/WebCore/accessibility/AccessibilityAllInOne.cpp
index 28b1c9b..28b1c9b 100755..100644
--- a/WebCore/accessibility/AccessibilityAllInOne.cpp
+++ b/WebCore/accessibility/AccessibilityAllInOne.cpp
diff --git a/WebCore/accessibility/AccessibilityObject.cpp b/WebCore/accessibility/AccessibilityObject.cpp
index a6bb033..3ddcdc5 100644
--- a/WebCore/accessibility/AccessibilityObject.cpp
+++ b/WebCore/accessibility/AccessibilityObject.cpp
@@ -373,22 +373,7 @@ VisiblePositionRange AccessibilityObject::styleRangeForPosition(const VisiblePos
// NOTE: Consider providing this utility method as AX API
VisiblePositionRange AccessibilityObject::visiblePositionRangeForRange(const PlainTextRange& range) const
{
- unsigned textLength = text().length();
-#if PLATFORM(GTK)
- // Gtk ATs need this for all text objects; not just text controls.
- if (!textLength) {
- Node* node = this->node();
- RenderObject* renderer = node ? node->renderer() : 0;
- if (renderer && renderer->isText()) {
- RenderText* renderText = toRenderText(renderer);
- textLength = renderText ? renderText->textLength() : 0;
- }
- // Get the text length from the elements under the
- // accessibility object if the value is still zero.
- if (!textLength && allowsTextRanges())
- textLength = textUnderElement().length();
- }
-#endif
+ unsigned textLength = getLengthForTextRange();
if (range.start + range.length > textLength)
return VisiblePositionRange();
diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h
index 0e44d1b..e8f6d1b 100644
--- a/WebCore/accessibility/AccessibilityObject.h
+++ b/WebCore/accessibility/AccessibilityObject.h
@@ -574,8 +574,10 @@ protected:
#if PLATFORM(GTK)
bool allowsTextRanges() const;
+ unsigned getLengthForTextRange() const;
#else
bool allowsTextRanges() const { return isTextControl(); }
+ unsigned getLengthForTextRange() const { return text().length(); }
#endif
#if PLATFORM(MAC)
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index e292971..5ca78ca 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -503,7 +503,7 @@ bool AccessibilityRenderObject::isFileUploadButton() const
{
if (m_renderer && m_renderer->node() && m_renderer->node()->hasTagName(inputTag)) {
HTMLInputElement* input = static_cast<HTMLInputElement*>(m_renderer->node());
- return input->inputType() == HTMLInputElement::FILE;
+ return input->isFileUpload();
}
return false;
@@ -514,7 +514,7 @@ bool AccessibilityRenderObject::isInputImage() const
Node* elementNode = node();
if (roleValue() == ButtonRole && elementNode && elementNode->hasTagName(inputTag)) {
HTMLInputElement* input = static_cast<HTMLInputElement*>(elementNode);
- return input->inputType() == HTMLInputElement::IMAGE;
+ return input->isImageButton();
}
return false;
@@ -1025,7 +1025,7 @@ String AccessibilityRenderObject::textUnderElement() const
// catch stale WebCoreAXObject (see <rdar://problem/3960196>)
if (frame->document() != node->document())
return String();
- return plainText(rangeOfContents(node).get());
+ return plainText(rangeOfContents(node).get(), TextIteratorIgnoresStyleVisibility);
}
}
@@ -1140,7 +1140,7 @@ String AccessibilityRenderObject::stringValue() const
if (startVisiblePosition.isNull() || endVisiblePosition.isNull())
return String();
- return plainText(makeRange(startVisiblePosition, endVisiblePosition).get());
+ return plainText(makeRange(startVisiblePosition, endVisiblePosition).get(), TextIteratorIgnoresStyleVisibility);
}
if (isTextControl())
@@ -1310,10 +1310,9 @@ String AccessibilityRenderObject::title() const
|| ariaRole == RadioButtonRole
|| ariaRole == CheckBoxRole
|| ariaRole == TabRole
- || isHeading())
- return textUnderElement();
-
- if (isLink())
+ || ariaRole == PopUpButtonRole
+ || isHeading()
+ || isLink())
return textUnderElement();
return String();
@@ -1393,7 +1392,9 @@ IntRect AccessibilityRenderObject::boundingBoxRect() const
// 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() || isWebArea())
+ if (obj->isText())
+ toRenderText(obj)->absoluteQuads(quads, RenderText::ClipToEllipsis);
+ else if (isWebArea())
obj->absoluteQuads(quads);
else
obj->absoluteFocusRingQuads(quads);
@@ -2538,6 +2539,9 @@ void AccessibilityRenderObject::setSelectedVisiblePositionRange(const VisiblePos
VisiblePosition AccessibilityRenderObject::visiblePositionForPoint(const IntPoint& point) const
{
+ if (!m_renderer)
+ return VisiblePosition();
+
// convert absolute point to view coordinates
FrameView* frameView = m_renderer->document()->topDocument()->renderer()->view()->frameView();
RenderView* renderView = topRenderer();
@@ -2557,13 +2561,16 @@ VisiblePosition AccessibilityRenderObject::visiblePositionForPoint(const IntPoin
HitTestResult result(ourpoint);
renderView->layer()->hitTest(request, result);
innerNode = result.innerNode();
- if (!innerNode || !innerNode->renderer())
+ if (!innerNode)
+ return VisiblePosition();
+
+ RenderObject* renderer = innerNode->renderer();
+ if (!renderer)
return VisiblePosition();
pointResult = result.localPoint();
// done if hit something other than a widget
- RenderBoxModelObject* renderer = innerNode->renderBoxModelObject();
if (!renderer->isWidget())
break;
@@ -3029,9 +3036,9 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
if (node && node->hasTagName(inputTag)) {
HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
- if (input->inputType() == HTMLInputElement::CHECKBOX)
+ if (input->isCheckbox())
return CheckBoxRole;
- if (input->inputType() == HTMLInputElement::RADIO)
+ if (input->isRadioButton())
return RadioButtonRole;
if (input->isTextButton())
return ButtonRole;
diff --git a/WebCore/accessibility/AccessibilityTableRow.cpp b/WebCore/accessibility/AccessibilityTableRow.cpp
index e2a1157..5e9f05c 100644
--- a/WebCore/accessibility/AccessibilityTableRow.cpp
+++ b/WebCore/accessibility/AccessibilityTableRow.cpp
@@ -93,7 +93,8 @@ AccessibilityObject* AccessibilityTableRow::parentTable() const
if (!m_renderer || !m_renderer->isTableRow())
return 0;
- return axObjectCache()->getOrCreate(toRenderTableRow(m_renderer)->table());
+ // Do not use getOrCreate. parentTable() can be called while the render tree is being modified.
+ return axObjectCache()->get(toRenderTableRow(m_renderer)->table());
}
AccessibilityObject* AccessibilityTableRow::headerObject()
diff --git a/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp b/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
index d906a91..3ff0837 100644
--- a/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
+++ b/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
@@ -60,30 +60,34 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific
return;
ChromeClientChromium* client = toChromeClientChromium(obj->documentFrameView());
- if (client) {
- switch (notification) {
- case AXCheckedStateChanged:
- client->didChangeAccessibilityObjectState(obj);
- break;
- case AXChildrenChanged:
- client->didChangeAccessibilityObjectChildren(obj);
- break;
- case AXActiveDescendantChanged:
- case AXFocusedUIElementChanged:
- case AXLayoutComplete:
- case AXLiveRegionChanged:
- case AXLoadComplete:
- case AXMenuListValueChanged:
- case AXRowCollapsed:
- case AXRowCountChanged:
- case AXRowExpanded:
- case AXScrolledToAnchor:
- case AXSelectedChildrenChanged:
- case AXSelectedTextChanged:
- case AXValueChanged:
- break;
- }
+ if (!client)
+ return;
+
+ // TODO: Remove after the new postAccessibilityNotification is used downstream.
+ switch (notification) {
+ case AXCheckedStateChanged:
+ client->didChangeAccessibilityObjectState(obj);
+ break;
+ case AXChildrenChanged:
+ client->didChangeAccessibilityObjectChildren(obj);
+ break;
+ case AXActiveDescendantChanged:
+ case AXFocusedUIElementChanged:
+ case AXLayoutComplete:
+ case AXLiveRegionChanged:
+ case AXLoadComplete:
+ case AXMenuListValueChanged:
+ case AXRowCollapsed:
+ case AXRowCountChanged:
+ case AXRowExpanded:
+ case AXScrolledToAnchor:
+ case AXSelectedChildrenChanged:
+ case AXSelectedTextChanged:
+ case AXValueChanged:
+ break;
}
+
+ client->postAccessibilityNotification(obj, notification);
}
void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*)
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
index b22a51e..7f9fd1a 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
@@ -20,6 +20,8 @@
#include "config.h"
#include "AccessibilityObject.h"
+#include "RenderObject.h"
+#include "RenderText.h"
#include <glib-object.h>
@@ -102,6 +104,29 @@ bool AccessibilityObject::allowsTextRanges() const
return isTextControl() || isWebArea() || isGroup() || isLink() || isHeading();
}
+unsigned AccessibilityObject::getLengthForTextRange() const
+{
+ unsigned textLength = text().length();
+
+ if (textLength)
+ return textLength;
+
+ // Gtk ATs need this for all text objects; not just text controls.
+ Node* node = this->node();
+ RenderObject* renderer = node ? node->renderer() : 0;
+ if (renderer && renderer->isText()) {
+ RenderText* renderText = toRenderText(renderer);
+ textLength = renderText ? renderText->textLength() : 0;
+ }
+
+ // Get the text length from the elements under the
+ // accessibility object if the value is still zero.
+ if (!textLength && allowsTextRanges())
+ textLength = textUnderElement().length();
+
+ return textLength;
+}
+
} // namespace WebCore
#endif // HAVE(ACCESSIBILITY)
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index 90f363f..01dddd1 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -58,6 +58,7 @@
#include "RenderListMarker.h"
#include "RenderText.h"
#include "TextEncoding.h"
+#include "TextIterator.h"
#include <wtf/text/CString.h>
#include <wtf/text/AtomicString.h>
@@ -1342,8 +1343,64 @@ static bool selectionBelongsToObject(AccessibilityObject* coreObject, VisibleSel
if (!coreObject->isAccessibilityRenderObject())
return false;
- Node* node = static_cast<AccessibilityRenderObject*>(coreObject)->renderer()->node();
- return node == selection.base().containerNode();
+ RefPtr<Range> range = selection.toNormalizedRange();
+ if (!range)
+ return false;
+
+ // We want to check that both the selection intersects the node
+ // AND that the selection is not just "touching" one of the
+ // boundaries for the selected node. We want to check whether the
+ // node is actually inside the region, at least partially
+ Node* node = coreObject->node();
+ Node* lastDescendant = node->lastDescendant();
+ ExceptionCode ec = 0;
+ return (range->intersectsNode(node, ec)
+ && (range->endContainer() != node || range->endOffset())
+ && (range->startContainer() != lastDescendant || range->startOffset() != lastOffsetInNode(lastDescendant)));
+}
+
+static void getSelectionOffsetsForObject(AccessibilityObject* coreObject, VisibleSelection& selection, gint& startOffset, gint& endOffset)
+{
+ if (!coreObject->isAccessibilityRenderObject())
+ return;
+
+ // Early return if the selection doesn't affect the selected node
+ if (!selectionBelongsToObject(coreObject, selection))
+ return;
+
+ // We need to find the exact start and end positions in the
+ // selected node that intersects the selection, to later on get
+ // the right values for the effective start and end offsets
+ ExceptionCode ec = 0;
+ Position nodeRangeStart;
+ Position nodeRangeEnd;
+ Node* node = coreObject->node();
+ RefPtr<Range> selRange = selection.toNormalizedRange();
+
+ // If the selection affects the selected node and its first
+ // possible position is also in the selection, we must set
+ // nodeRangeStart to that position, otherwise to the selection's
+ // start position (it would belong to the node anyway)
+ Node* firstLeafNode = node->firstDescendant();
+ if (selRange->isPointInRange(firstLeafNode, 0, ec))
+ nodeRangeStart = firstPositionInNode(firstLeafNode);
+ else
+ nodeRangeStart = selRange->startPosition();
+
+ // If the selection affects the selected node and its last
+ // possible position is also in the selection, we must set
+ // nodeRangeEnd to that position, otherwise to the selection's
+ // end position (it would belong to the node anyway)
+ Node* lastLeafNode = node->lastDescendant();
+ if (selRange->isPointInRange(lastLeafNode, lastOffsetInNode(lastLeafNode), ec))
+ nodeRangeEnd = lastPositionInNode(lastLeafNode);
+ else
+ nodeRangeEnd = selRange->endPosition();
+
+ // Set values for start and end offsets
+ RefPtr<Range> nodeRange = Range::create(node->document(), nodeRangeStart, nodeRangeEnd);
+ startOffset = nodeRangeStart.offsetInContainerNode();
+ endOffset = startOffset + TextIterator::rangeLength(nodeRange.get());
}
static gint webkit_accessible_text_get_n_selections(AtkText* text)
@@ -1351,6 +1408,10 @@ static gint webkit_accessible_text_get_n_selections(AtkText* text)
AccessibilityObject* coreObject = core(text);
VisibleSelection selection = coreObject->selection();
+ // Only range selections are needed for the purpose of this method
+ if (!selection.isRange())
+ return 0;
+
// We don't support multiple selections for now, so there's only
// two possibilities
// Also, we don't want to do anything if the selection does not
@@ -1360,25 +1421,26 @@ static gint webkit_accessible_text_get_n_selections(AtkText* text)
return !selectionBelongsToObject(coreObject, selection) || selection.isNone() ? 0 : 1;
}
-static gchar* webkit_accessible_text_get_selection(AtkText* text, gint selection_num, gint* start_offset, gint* end_offset)
+static gchar* webkit_accessible_text_get_selection(AtkText* text, gint selectionNum, gint* startOffset, gint* endOffset)
{
- AccessibilityObject* coreObject = core(text);
- VisibleSelection selection = coreObject->selection();
+ // Default values, unless the contrary is proved
+ *startOffset = *endOffset = 0;
// WebCore does not support multiple selection, so anything but 0 does not make sense for now.
- // Also, we don't want to do anything if the selection does not
- // belong to the currently selected object. We have to check since
- // there's no way to get the selection for a given object, only
- // the global one (the API is a bit confusing)
- if (selection_num != 0 || !selectionBelongsToObject(coreObject, selection)) {
- *start_offset = *end_offset = 0;
+ if (selectionNum)
return 0;
- }
- *start_offset = selection.start().offsetInContainerNode();
- *end_offset = selection.end().offsetInContainerNode();
+ // Get the offsets of the selection for the selected object
+ AccessibilityObject* coreObject = core(text);
+ VisibleSelection selection = coreObject->selection();
+ getSelectionOffsetsForObject(coreObject, selection, *startOffset, *endOffset);
+
+ // Return 0 instead of "", as that's the expected result for
+ // this AtkText method when there's no selection
+ if (*startOffset == *endOffset)
+ return 0;
- return webkit_accessible_text_get_text(text, *start_offset, *end_offset);
+ return webkit_accessible_text_get_text(text, *startOffset, *endOffset);
}
static gboolean webkit_accessible_text_add_selection(AtkText* text, gint start_offset, gint end_offset)
@@ -1387,32 +1449,51 @@ static gboolean webkit_accessible_text_add_selection(AtkText* text, gint start_o
return FALSE;
}
-static gboolean webkit_accessible_text_remove_selection(AtkText* text, gint selection_num)
+static gboolean webkit_accessible_text_set_selection(AtkText* text, gint selectionNum, gint startOffset, gint endOffset)
{
- notImplemented();
- return FALSE;
+ // WebCore does not support multiple selection, so anything but 0 does not make sense for now.
+ if (selectionNum)
+ return FALSE;
+
+ // Consider -1 and out-of-bound values and correct them to length
+ gint textCount = webkit_accessible_text_get_character_count(text);
+ if (startOffset < 0 || startOffset > textCount)
+ startOffset = textCount;
+ if (endOffset < 0 || endOffset > textCount)
+ endOffset = textCount;
+
+ AccessibilityObject* coreObject = core(text);
+ PlainTextRange textRange(startOffset, endOffset - startOffset);
+ VisiblePositionRange range = coreObject->visiblePositionRangeForRange(textRange);
+ coreObject->setSelectedVisiblePositionRange(range);
+
+ return TRUE;
}
-static gboolean webkit_accessible_text_set_selection(AtkText* text, gint selection_num, gint start_offset, gint end_offset)
+static gboolean webkit_accessible_text_remove_selection(AtkText* text, gint selectionNum)
{
- notImplemented();
- return FALSE;
+ // WebCore does not support multiple selection, so anything but 0 does not make sense for now.
+ if (selectionNum)
+ return FALSE;
+
+ // Do nothing if current selection doesn't belong to the object
+ if (!webkit_accessible_text_get_n_selections(text))
+ return FALSE;
+
+ // Set a new 0-sized selection to the caret position, in order
+ // to simulate selection removal (GAIL style)
+ gint caretOffset = webkit_accessible_text_get_caret_offset(text);
+ return webkit_accessible_text_set_selection(text, selectionNum, caretOffset, caretOffset);
}
static gboolean webkit_accessible_text_set_caret_offset(AtkText* text, gint offset)
{
AccessibilityObject* coreObject = core(text);
- // FIXME: We need to reimplement visiblePositionRangeForRange here
- // because the actual function checks the offset is within the
- // boundaries of text().length(), but text() only works for text
- // controls...
- VisiblePosition startPosition = coreObject->visiblePositionForIndex(offset);
- startPosition.setAffinity(DOWNSTREAM);
- VisiblePosition endPosition = coreObject->visiblePositionForIndex(offset);
- VisiblePositionRange range = VisiblePositionRange(startPosition, endPosition);
-
+ PlainTextRange textRange(offset, 0);
+ VisiblePositionRange range = coreObject->visiblePositionRangeForRange(textRange);
coreObject->setSelectedVisiblePositionRange(range);
+
return TRUE;
}
diff --git a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
index 859a799..e3e28d7 100644
--- a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
+++ b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
@@ -1972,11 +1972,11 @@ static NSString* roleValueToNSString(AccessibilityRole value)
- (BOOL)accessibilityIsIgnored
{
if (!m_object)
- return nil;
+ return YES;
m_object->updateBackingStore();
if (!m_object)
- return nil;
+ return YES;
if (m_object->isAttachment())
return [[self attachmentView] accessibilityIsIgnored];
@@ -2354,7 +2354,10 @@ static RenderObject* rendererForView(NSView* view)
// dispatch
if ([attribute isEqualToString:@"AXUIElementForTextMarker"]) {
VisiblePosition visiblePos = visiblePositionForTextMarker(textMarker);
- return m_object->accessibilityObjectForPosition(visiblePos)->wrapper();
+ AccessibilityObject* axObject = m_object->accessibilityObjectForPosition(visiblePos);
+ if (!axObject)
+ return nil;
+ return axObject->wrapper();
}
if ([attribute isEqualToString:@"AXTextMarkerRangeForUIElement"]) {
diff --git a/WebCore/bindings/generic/ActiveDOMCallback.cpp b/WebCore/bindings/generic/ActiveDOMCallback.cpp
index f62bf83..bc93de5 100644
--- a/WebCore/bindings/generic/ActiveDOMCallback.cpp
+++ b/WebCore/bindings/generic/ActiveDOMCallback.cpp
@@ -76,7 +76,7 @@ public:
ActiveDOMObject::contextDestroyed();
}
virtual bool canSuspend() const { return false; }
- virtual void suspend()
+ virtual void suspend(ReasonForSuspension)
{
MutexLocker locker(m_mutex);
m_suspended = true;
diff --git a/WebCore/bindings/js/JSDOMBinding.h b/WebCore/bindings/js/JSDOMBinding.h
index 749b0d7..f0bd2e2 100644
--- a/WebCore/bindings/js/JSDOMBinding.h
+++ b/WebCore/bindings/js/JSDOMBinding.h
@@ -267,6 +267,13 @@ namespace WebCore {
String valueToStringWithNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null
String valueToStringWithUndefinedOrNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null or undefined
+ inline int32_t finiteInt32Value(JSC::JSValue value, JSC::ExecState* exec, bool& okay)
+ {
+ double number = value.toNumber(exec);
+ okay = isfinite(number);
+ return JSC::toInt32(number);
+ }
+
// Returns a Date instance for the specified value, or null if the value is NaN or infinity.
JSC::JSValue jsDateOrNull(JSC::ExecState*, double);
// NaN if the value can't be converted to a date.
diff --git a/WebCore/bindings/js/JSDirectoryEntryCustom.cpp b/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
new file mode 100644
index 0000000..35a6c32
--- /dev/null
+++ b/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "JSDirectoryEntry.h"
+
+#include "JSDOMBinding.h"
+#include "JSEntryCallback.h"
+#include "JSErrorCallback.h"
+#include "JSFlags.h"
+#include <wtf/Assertions.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSDirectoryEntry::getFile(ExecState* exec)
+{
+ DirectoryEntry* imp = static_cast<DirectoryEntry*>(impl());
+ const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
+ if (exec->hadException())
+ return jsUndefined();
+
+ int argsCount = exec->argumentCount();
+ if (argsCount <= 1) {
+ imp->getFile(path);
+ return jsUndefined();
+ }
+
+ RefPtr<Flags> flags;
+ if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject() && !exec->argument(1).inherits(&JSFlags::s_info)) {
+ JSObject* object = exec->argument(1).getObject();
+ flags = Flags::create();
+ JSValue jsCreate = object->get(exec, Identifier(exec, "create"));
+ flags->setCreate(jsCreate.toBoolean(exec));
+ JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
+ flags->setExclusive(jsExclusive.toBoolean(exec));
+ } else
+ flags = adoptRef(toFlags(exec->argument(1)));
+ if (exec->hadException())
+ return jsUndefined();
+ RefPtr<EntryCallback> successCallback;
+ if (exec->argumentCount() > 2 && !exec->argument(2).isNull() && !exec->argument(2).isUndefined()) {
+ if (!exec->argument(2).isObject()) {
+ setDOMException(exec, TYPE_MISMATCH_ERR);
+ return jsUndefined();
+ }
+ successCallback = JSEntryCallback::create(asObject(exec->argument(2)), globalObject());
+ }
+ RefPtr<ErrorCallback> errorCallback;
+ if (exec->argumentCount() > 3 && !exec->argument(3).isNull() && !exec->argument(3).isUndefined()) {
+ if (!exec->argument(3).isObject()) {
+ setDOMException(exec, TYPE_MISMATCH_ERR);
+ return jsUndefined();
+ }
+ errorCallback = JSErrorCallback::create(asObject(exec->argument(3)), globalObject());
+ }
+
+ imp->getFile(path, flags, successCallback, errorCallback);
+ return jsUndefined();
+}
+
+JSValue JSDirectoryEntry::getDirectory(ExecState* exec)
+{
+ DirectoryEntry* imp = static_cast<DirectoryEntry*>(impl());
+ const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
+ if (exec->hadException())
+ return jsUndefined();
+
+ int argsCount = exec->argumentCount();
+ if (argsCount <= 1) {
+ imp->getDirectory(path);
+ return jsUndefined();
+ }
+
+ RefPtr<Flags> flags;
+ if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject() && !exec->argument(1).inherits(&JSFlags::s_info)) {
+ JSObject* object = exec->argument(1).getObject();
+ flags = Flags::create();
+ JSValue jsCreate = object->get(exec, Identifier(exec, "create"));
+ flags->setCreate(jsCreate.toBoolean(exec));
+ JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
+ flags->setExclusive(jsExclusive.toBoolean(exec));
+ } else
+ flags = adoptRef(toFlags(exec->argument(1)));
+ if (exec->hadException())
+ return jsUndefined();
+ RefPtr<EntryCallback> successCallback;
+ if (exec->argumentCount() > 2 && !exec->argument(2).isNull() && !exec->argument(2).isUndefined()) {
+ if (!exec->argument(2).isObject()) {
+ setDOMException(exec, TYPE_MISMATCH_ERR);
+ return jsUndefined();
+ }
+ successCallback = JSEntryCallback::create(asObject(exec->argument(2)), globalObject());
+ }
+ RefPtr<ErrorCallback> errorCallback;
+ if (exec->argumentCount() > 3 && !exec->argument(3).isNull() && !exec->argument(3).isUndefined()) {
+ if (!exec->argument(3).isObject()) {
+ setDOMException(exec, TYPE_MISMATCH_ERR);
+ return jsUndefined();
+ }
+ errorCallback = JSErrorCallback::create(asObject(exec->argument(3)), globalObject());
+ }
+
+ imp->getDirectory(path, flags, successCallback, errorCallback);
+ return jsUndefined();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/bindings/js/JSEntryCustom.cpp b/WebCore/bindings/js/JSEntryCustom.cpp
new file mode 100644
index 0000000..59d7e3c
--- /dev/null
+++ b/WebCore/bindings/js/JSEntryCustom.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "JSEntry.h"
+
+#include "Entry.h"
+#include "JSDOMBinding.h"
+#include "JSDirectoryEntry.h"
+#include "JSFileEntry.h"
+#include <wtf/Assertions.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Entry* entry)
+{
+ if (!entry)
+ return jsNull();
+
+ if (entry->isFile())
+ return getDOMObjectWrapper<JSFileEntry>(exec, globalObject, static_cast<FileEntry*>(entry));
+
+ ASSERT(entry->isDirectory());
+ return getDOMObjectWrapper<JSDirectoryEntry>(exec, globalObject, static_cast<DirectoryEntry*>(entry));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/bindings/js/JSEventCustom.cpp b/WebCore/bindings/js/JSEventCustom.cpp
index 7479020..d2e9d61 100644
--- a/WebCore/bindings/js/JSEventCustom.cpp
+++ b/WebCore/bindings/js/JSEventCustom.cpp
@@ -42,6 +42,7 @@
#include "JSDeviceMotionEvent.h"
#include "JSDeviceOrientationEvent.h"
#include "JSErrorEvent.h"
+#include "JSHashChangeEvent.h"
#include "JSKeyboardEvent.h"
#include "JSMessageEvent.h"
#include "JSMouseEvent.h"
@@ -58,6 +59,7 @@
#include "JSXMLHttpRequestProgressEvent.h"
#include "BeforeLoadEvent.h"
#include "ErrorEvent.h"
+#include "HashChangeEvent.h"
#include "KeyboardEvent.h"
#include "MessageEvent.h"
#include "MouseEvent.h"
@@ -170,6 +172,8 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Event* event)
else if (event->isErrorEvent())
wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, ErrorEvent, event);
#endif
+ else if (event->isHashChangeEvent())
+ wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, HashChangeEvent, event);
else if (event->isPopStateEvent())
wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, PopStateEvent, event);
else if (event->isCustomEvent())
diff --git a/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp b/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
index dc2f7cb..6143c1e 100644
--- a/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
@@ -76,7 +76,7 @@ JSValue JSHTMLOptionsCollection::add(ExecState* exec)
imp->add(option, ec);
else {
bool ok;
- int index = exec->argument(1).toInt32(exec, ok);
+ int index = finiteInt32Value(exec->argument(1), exec, ok);
if (exec->hadException())
return jsUndefined();
if (!ok)
diff --git a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
index 2a504d3..e9a97ed 100644
--- a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
+++ b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
@@ -42,7 +42,7 @@ namespace WebCore {
JSValue JSSQLResultSetRowList::item(ExecState* exec)
{
bool indexOk;
- int index = exec->argument(0).toInt32(exec, indexOk);
+ int index = finiteInt32Value(exec->argument(0), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
diff --git a/WebCore/bindings/js/JSSVGPODListCustom.h b/WebCore/bindings/js/JSSVGPODListCustom.h
index 9db5618..c2af93f 100644
--- a/WebCore/bindings/js/JSSVGPODListCustom.h
+++ b/WebCore/bindings/js/JSSVGPODListCustom.h
@@ -119,7 +119,7 @@ static JSC::JSValue getItem(JSPODListType* wrapper, JSC::ExecState* exec,
typename JSSVGPODListTraits<PODType>::ConversionCallback)
{
bool indexOk = false;
- unsigned index = exec->argument(0).toUInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(0), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return JSC::jsUndefined();
@@ -136,7 +136,7 @@ static JSC::JSValue insertItemBefore(JSPODListType* wrapper, JSC::ExecState* exe
typename JSSVGPODListTraits<PODType>::ConversionCallback conversion)
{
bool indexOk = false;
- unsigned index = exec->argument(1).toUInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(1), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return JSC::jsUndefined();
@@ -153,7 +153,7 @@ static JSC::JSValue replaceItem(JSPODListType* wrapper, JSC::ExecState* exec,
typename JSSVGPODListTraits<PODType>::ConversionCallback conversion)
{
bool indexOk = false;
- unsigned index = exec->argument(1).toUInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(1), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return JSC::jsUndefined();
@@ -170,7 +170,7 @@ static JSC::JSValue removeItem(JSPODListType* wrapper, JSC::ExecState* exec,
typename JSSVGPODListTraits<PODType>::ConversionCallback)
{
bool indexOk = false;
- unsigned index = exec->argument(0).toUInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(0), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return JSC::jsUndefined();
diff --git a/WebCore/bindings/js/JSSVGPathSegListCustom.cpp b/WebCore/bindings/js/JSSVGPathSegListCustom.cpp
index 850e533..9767c1a 100644
--- a/WebCore/bindings/js/JSSVGPathSegListCustom.cpp
+++ b/WebCore/bindings/js/JSSVGPathSegListCustom.cpp
@@ -71,7 +71,7 @@ JSValue JSSVGPathSegList::getItem(ExecState* exec)
ExceptionCode ec = 0;
bool indexOk;
- unsigned index = exec->argument(0).toInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(0), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
@@ -92,7 +92,7 @@ JSValue JSSVGPathSegList::insertItemBefore(ExecState* exec)
SVGPathSeg* newItem = toSVGPathSeg(exec->argument(0));
bool indexOk;
- unsigned index = exec->argument(1).toInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(1), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
@@ -114,7 +114,7 @@ JSValue JSSVGPathSegList::replaceItem(ExecState* exec)
SVGPathSeg* newItem = toSVGPathSeg(exec->argument(0));
bool indexOk;
- unsigned index = exec->argument(1).toInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(1), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
@@ -135,7 +135,7 @@ JSValue JSSVGPathSegList::removeItem(ExecState* exec)
ExceptionCode ec = 0;
bool indexOk;
- unsigned index = exec->argument(0).toInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(0), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
diff --git a/WebCore/bindings/js/ScriptDebugServer.cpp b/WebCore/bindings/js/ScriptDebugServer.cpp
index ecb7fa6..1decefa 100644
--- a/WebCore/bindings/js/ScriptDebugServer.cpp
+++ b/WebCore/bindings/js/ScriptDebugServer.cpp
@@ -406,7 +406,7 @@ void ScriptDebugServer::setJavaScriptPaused(Frame* frame, bool paused)
Document* document = frame->document();
if (paused)
- document->suspendActiveDOMObjects();
+ document->suspendActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused);
else
document->resumeActiveDOMObjects();
diff --git a/WebCore/bindings/js/SerializedScriptValue.cpp b/WebCore/bindings/js/SerializedScriptValue.cpp
index fcd3314..8ccaf9c 100644
--- a/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -762,6 +762,25 @@ public:
}
private:
+ struct CachedString {
+ CachedString(const UString& string)
+ : m_string(string)
+ {
+ }
+
+ JSValue jsString(ExecState* exec)
+ {
+ if (!m_jsString)
+ m_jsString = JSC::jsString(exec, m_string);
+ return m_jsString;
+ }
+ const UString& ustring() { return m_string; }
+
+ private:
+ UString m_string;
+ JSValue m_jsString;
+ };
+
CloneDeserializer(ExecState* exec, JSGlobalObject* globalObject, const Vector<uint8_t>& buffer)
: CloneBase(exec)
, m_globalObject(globalObject)
@@ -903,13 +922,13 @@ private:
return true;
}
- bool readStringData(Identifier& ident)
+ bool readStringData(CachedString*& cachedString)
{
bool scratch;
- return readStringData(ident, scratch);
+ return readStringData(cachedString, scratch);
}
- bool readStringData(Identifier& ident, bool& wasTerminator)
+ bool readStringData(CachedString*& cachedString, bool& wasTerminator)
{
if (m_failed)
return false;
@@ -930,7 +949,7 @@ private:
fail();
return false;
}
- ident = m_constantPool[index];
+ cachedString = &m_constantPool[index];
return true;
}
UString str;
@@ -938,8 +957,8 @@ private:
fail();
return false;
}
- ident = Identifier(m_exec, str);
- m_constantPool.append(ident);
+ m_constantPool.append(str);
+ cachedString = &m_constantPool.last();
return true;
}
@@ -958,26 +977,24 @@ private:
array->put(m_exec, index, value);
}
- void putProperty(JSObject* object, Identifier& property, JSValue value)
+ void putProperty(JSObject* object, const Identifier& property, JSValue value)
{
object->putDirect(property, value);
}
bool readFile(RefPtr<File>& file)
{
- Identifier path;
+ CachedString* path = 0;
if (!readStringData(path))
return 0;
- Identifier url;
+ CachedString* url = 0;
if (!readStringData(url))
return 0;
- Identifier type;
+ CachedString* type = 0;
if (!readStringData(type))
return 0;
- if (m_isDOMGlobalObject) {
- ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject())->scriptExecutionContext();
- file = File::create(scriptExecutionContext, String(path.ustring().impl()), KURL(KURL(), String(url.ustring().impl())), String(type.ustring().impl()));
- }
+ if (m_isDOMGlobalObject)
+ file = File::create(String(path->ustring().impl()), KURL(KURL(), String(url->ustring().impl())), String(type->ustring().impl()));
return true;
}
@@ -1063,10 +1080,10 @@ private:
return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), result.get());
}
case BlobTag: {
- Identifier url;
+ CachedString* url = 0;
if (!readStringData(url))
return JSValue();
- Identifier type;
+ CachedString* type = 0;
if (!readStringData(type))
return JSValue();
unsigned long long size = 0;
@@ -1074,26 +1091,24 @@ private:
return JSValue();
if (!m_isDOMGlobalObject)
return jsNull();
- ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject())->scriptExecutionContext();
- ASSERT(scriptExecutionContext);
- return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), Blob::create(scriptExecutionContext, KURL(KURL(), url.ustring().impl()), String(type.ustring().impl()), size));
+ return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), Blob::create(KURL(KURL(), url->ustring().impl()), String(type->ustring().impl()), size));
}
case StringTag: {
- Identifier ident;
- if (!readStringData(ident))
+ CachedString* cachedString = 0;
+ if (!readStringData(cachedString))
return JSValue();
- return jsString(m_exec, ident.ustring());
+ return cachedString->jsString(m_exec);
}
case EmptyStringTag:
return jsEmptyString(&m_exec->globalData());
case RegExpTag: {
- Identifier pattern;
+ CachedString* pattern = 0;
if (!readStringData(pattern))
return JSValue();
- Identifier flags;
+ CachedString* flags = 0;
if (!readStringData(flags))
return JSValue();
- RefPtr<RegExp> regExp = RegExp::create(&m_exec->globalData(), pattern.ustring(), flags.ustring());
+ RefPtr<RegExp> regExp = RegExp::create(&m_exec->globalData(), pattern->ustring(), flags->ustring());
return new (m_exec) RegExpObject(m_exec->lexicalGlobalObject(), m_globalObject->regExpStructure(), regExp);
}
default:
@@ -1107,7 +1122,7 @@ private:
const uint8_t* m_ptr;
const uint8_t* m_end;
unsigned m_version;
- Vector<Identifier> m_constantPool;
+ Vector<CachedString> m_constantPool;
};
JSValue CloneDeserializer::deserialize()
@@ -1196,9 +1211,9 @@ JSValue CloneDeserializer::deserialize()
tickCount = ticksUntilNextCheck();
}
- Identifier ident;
+ CachedString* cachedString = 0;
bool wasTerminator = false;
- if (!readStringData(ident, wasTerminator)) {
+ if (!readStringData(cachedString, wasTerminator)) {
if (!wasTerminator)
goto error;
JSObject* outObject = outputObjectStack.last();
@@ -1209,11 +1224,11 @@ JSValue CloneDeserializer::deserialize()
}
if (JSValue terminal = readTerminal()) {
- putProperty(outputObjectStack.last(), ident, terminal);
+ putProperty(outputObjectStack.last(), Identifier(m_exec, cachedString->ustring()), terminal);
goto objectStartVisitMember;
}
stateStack.append(ObjectEndVisitMember);
- propertyNameStack.append(ident);
+ propertyNameStack.append(Identifier(m_exec, cachedString->ustring()));
goto stateUnknown;
}
case ObjectEndVisitMember: {
diff --git a/WebCore/bindings/scripts/CodeGenerator.pm b/WebCore/bindings/scripts/CodeGenerator.pm
index adc47d0..ec762b6 100644
--- a/WebCore/bindings/scripts/CodeGenerator.pm
+++ b/WebCore/bindings/scripts/CodeGenerator.pm
@@ -344,10 +344,6 @@ sub WK_ucfirst
my $ret = ucfirst($param);
$ret =~ s/Xml/XML/ if $ret =~ /^Xml[^a-z]/;
- # For HTML5 FileSystem API Flags attributes.
- $ret =~ s/^CREATE/Create/ if $ret =~ /^CREATE$/;
- $ret =~ s/^EXCLUSIVE/Exclusive/ if $ret =~ /^EXCLUSIVE$/;
-
return $ret;
}
@@ -364,8 +360,9 @@ sub WK_lcfirst
$ret =~ s/xSLT/xslt/ if $ret =~ /^xSLT/;
# For HTML5 FileSystem API Flags attributes.
- $ret =~ s/^cREATE/isCreate/ if $ret =~ /^cREATE$/;
- $ret =~ s/^eXCLUSIVE/isExclusive/ if $ret =~ /^eXCLUSIVE$/;
+ # (create is widely used to instantiate an object and must be avoided.)
+ $ret =~ s/^create/isCreate/ if $ret =~ /^create$/;
+ $ret =~ s/^exclusive/isExclusive/ if $ret =~ /^exclusive$/;
return $ret;
}
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 06bce04..f74f2b1 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -1984,8 +1984,7 @@ END
# Setup the enable-at-runtime attrs if we have them
foreach my $runtime_attr (@enabledAtRuntime) {
- # A function named RuntimeEnabledFeatures::{methodName}Enabled() need to be written by hand.
- $enable_function = "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($runtime_attr->signature->name) . "Enabled";
+ my $enable_function = GetRuntimeEnableFunctionName($runtime_attr->signature);
my $conditionalString = GenerateConditionalString($runtime_attr->signature);
push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString;
push(@implContent, " if (${enable_function}()) {\n");
@@ -2034,7 +2033,7 @@ END
my $conditional = "";
if ($attrExt->{"EnabledAtRuntime"}) {
# Only call Set()/SetAccessor() if this method should be enabled
- $enable_function = "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($function->signature->name) . "Enabled";
+ $enable_function = GetRuntimeEnableFunctionName($function->signature);
$conditional = "if (${enable_function}())\n ";
}
@@ -2509,6 +2508,7 @@ sub HasCustomToV8Implementation {
# We generate a custom converter (but JSC doesn't) for the following:
return 1 if $interfaceName eq "CSSStyleSheet";
return 1 if $interfaceName eq "CanvasPixelArray";
+ return 1 if $interfaceName eq "DOMStringMap";
return 1 if $interfaceName eq "DOMWindow";
return 1 if $interfaceName eq "Element";
return 1 if $interfaceName eq "HTMLDocument";
@@ -3389,6 +3389,18 @@ sub ConvertToV8Parameter
}
}
+# Returns the RuntimeEnabledFeatures function name that is hooked up to check if a method/attribute is enabled.
+sub GetRuntimeEnableFunctionName
+{
+ my $signature = shift;
+
+ # If a parameter is given (e.g. "EnabledAtRuntime=FeatureName") return the RuntimeEnabledFeatures::{FeatureName}Enabled() method.
+ return "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($signature->extendedAttributes->{"EnabledAtRuntime"}) . "Enabled" if ($signature->extendedAttributes->{"EnabledAtRuntime"} && $signature->extendedAttributes->{"EnabledAtRuntime"} ne "1");
+
+ # Otherwise return a function named RuntimeEnabledFeatures::{methodName}Enabled().
+ return "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($signature->name) . "Enabled";
+}
+
sub DebugPrint
{
my $output = shift;
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
index 9cceb3c..579295f 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
@@ -199,7 +199,7 @@ void WebDOMTestObj::setXMLObjAttr(const WebDOMTestObj& newXMLObjAttr)
impl()->setXMLObjAttr(toWebCore(newXMLObjAttr));
}
-bool WebDOMTestObj::CREATE() const
+bool WebDOMTestObj::create() const
{
if (!impl())
return false;
@@ -207,12 +207,12 @@ bool WebDOMTestObj::CREATE() const
return impl()->isCreate();
}
-void WebDOMTestObj::setCREATE(bool newCREATE)
+void WebDOMTestObj::setCreate(bool newCreate)
{
if (!impl())
return;
- impl()->setCreate(newCREATE);
+ impl()->setCreate(newCreate);
}
WebDOMString WebDOMTestObj::reflectedStringAttr() const
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
index 037a1d3..cd6caaa 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
@@ -72,8 +72,8 @@ public:
void setTestObjAttr(const WebDOMTestObj&);
WebDOMTestObj XMLObjAttr() const;
void setXMLObjAttr(const WebDOMTestObj&);
- bool CREATE() const;
- void setCREATE(bool);
+ bool create() const;
+ void setCreate(bool);
WebDOMString reflectedStringAttr() const;
void setReflectedStringAttr(const WebDOMString&);
int reflectedIntegralAttr() const;
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index 63bc368..5236267 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -63,7 +63,7 @@ static const HashTableValue JSTestObjTableValues[34] =
{ "stringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t)setJSTestObjStringAttr THUNK_GENERATOR(0) },
{ "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr THUNK_GENERATOR(0) },
{ "XMLObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjXMLObjAttr), (intptr_t)setJSTestObjXMLObjAttr THUNK_GENERATOR(0) },
- { "CREATE", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t)setJSTestObjCreate THUNK_GENERATOR(0) },
+ { "create", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t)setJSTestObjCreate THUNK_GENERATOR(0) },
{ "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) },
{ "reflectedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t)setJSTestObjReflectedIntegralAttr THUNK_GENERATOR(0) },
{ "reflectedBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedBooleanAttr), (intptr_t)setJSTestObjReflectedBooleanAttr THUNK_GENERATOR(0) },
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
index 132b215..1ad29cb 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
@@ -64,8 +64,8 @@ enum {
- (void)setTestObjAttr:(DOMTestObj *)newTestObjAttr;
- (DOMTestObj *)XMLObjAttr;
- (void)setXMLObjAttr:(DOMTestObj *)newXMLObjAttr;
-- (BOOL)CREATE;
-- (void)setCREATE:(BOOL)newCREATE;
+- (BOOL)create;
+- (void)setCreate:(BOOL)newCreate;
- (NSString *)reflectedStringAttr;
- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr;
- (int)reflectedIntegralAttr;
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
index 9725b24..6788075 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
@@ -168,16 +168,16 @@
IMPL->setXMLObjAttr(core(newXMLObjAttr));
}
-- (BOOL)CREATE
+- (BOOL)create
{
WebCore::JSMainThreadNullState state;
return IMPL->isCreate();
}
-- (void)setCREATE:(BOOL)newCREATE
+- (void)setCreate:(BOOL)newCreate
{
WebCore::JSMainThreadNullState state;
- IMPL->setCreate(newCREATE);
+ IMPL->setCreate(newCreate);
}
- (NSString *)reflectedStringAttr
diff --git a/WebCore/bindings/scripts/test/TestObj.idl b/WebCore/bindings/scripts/test/TestObj.idl
index 89dfdf7..22ed680 100644
--- a/WebCore/bindings/scripts/test/TestObj.idl
+++ b/WebCore/bindings/scripts/test/TestObj.idl
@@ -44,7 +44,7 @@ module test {
JS, V8
// WK_ucfirst, WK_lcfirst exceptional cases.
attribute TestObj XMLObjAttr;
- attribute boolean CREATE;
+ attribute boolean create;
// Reflected DOM attributes
attribute [Reflect] DOMString reflectedStringAttr;
@@ -142,6 +142,14 @@ module test {
[ClassMethod] void classMethod();
[ClassMethod] long classMethodWithOptional(in [Optional] long arg);
+#if defined(TESTING_V8)
+ // 'EnabledAtRuntime' methods and attributes.
+ [EnabledAtRuntime] void enabledAtRuntimeMethod1(in int intArg);
+ [EnabledAtRuntime=FeatureName] void enabledAtRuntimeMethod2(in int intArg);
+ attribute [EnabledAtRuntime] long enabledAtRuntimeAttr1;
+ attribute [EnabledAtRuntime=FeatureName] long enabledAtRuntimeAttr2;
+#endif
+
// ObjectiveC reserved words.
readonly attribute long description;
attribute long id;
diff --git a/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp b/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
index 340dca7..267f1f0 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
@@ -70,24 +70,16 @@ v8::Persistent<v8::FunctionTemplate> V8TestInterface::GetTemplate()
return V8TestInterfaceCache;
}
-TestInterface* V8TestInterface::toNative(v8::Handle<v8::Object> object)
-{
- return reinterpret_cast<TestInterface*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
-}
-
bool V8TestInterface::HasInstance(v8::Handle<v8::Value> value)
{
return GetRawTemplate()->HasInstance(value);
}
-v8::Handle<v8::Object> V8TestInterface::wrap(TestInterface* impl)
+v8::Handle<v8::Object> V8TestInterface::wrapSlow(TestInterface* impl)
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = getDOMObjectMap().get(impl);
- if (!wrapper.IsEmpty())
- return wrapper;
wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
if (wrapper.IsEmpty())
return wrapper;
@@ -97,18 +89,6 @@ v8::Handle<v8::Object> V8TestInterface::wrap(TestInterface* impl)
return wrapper;
}
-v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface > impl)
-{
- return toV8(impl.get());
-}
-
-v8::Handle<v8::Value> toV8(TestInterface* impl)
-{
- if (!impl)
- return v8::Null();
- return V8TestInterface::wrap(impl);
-}
-
void V8TestInterface::derefObject(void* object)
{
static_cast<TestInterface*>(object)->deref();
diff --git a/WebCore/bindings/scripts/test/V8/V8TestInterface.h b/WebCore/bindings/scripts/test/V8/V8TestInterface.h
index afdf381..c1e319b 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestInterface.h
+++ b/WebCore/bindings/scripts/test/V8/V8TestInterface.h
@@ -24,6 +24,7 @@
#define V8TestInterface_h
#include "TestInterface.h"
+#include "V8DOMWrapper.h"
#include "WrapperTypeInfo.h"
#include "wtf/text/StringHash.h"
#include <v8.h>
@@ -37,16 +38,38 @@ public:
static bool HasInstance(v8::Handle<v8::Value> value);
static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
static v8::Persistent<v8::FunctionTemplate> GetTemplate();
- static TestInterface* toNative(v8::Handle<v8::Object>);
- static v8::Handle<v8::Object> wrap(TestInterface*);
+ static TestInterface* toNative(v8::Handle<v8::Object> object)
+ {
+ return reinterpret_cast<TestInterface*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
+ }
+ inline static v8::Handle<v8::Object> wrap(TestInterface*);
static void derefObject(void*);
static WrapperTypeInfo info;
static v8::Handle<v8::Value> constructorCallback(const v8::Arguments& args);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+private:
+ static v8::Handle<v8::Object> wrapSlow(TestInterface*);
};
-v8::Handle<v8::Value> toV8(TestInterface*);
-v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface >);
+
+v8::Handle<v8::Object> V8TestInterface::wrap(TestInterface* impl)
+{
+ v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return V8TestInterface::wrapSlow(impl);
+}
+
+inline v8::Handle<v8::Value> toV8(TestInterface* impl)
+{
+ if (!impl)
+ return v8::Null();
+ return V8TestInterface::wrap(impl);
+}
+inline v8::Handle<v8::Value> toV8(PassRefPtr< TestInterface > impl)
+{
+ return toV8(impl.get());
+}
}
#endif // V8TestInterface_h
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index 8f824d9..44f0d3e 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -35,6 +35,7 @@
#include "V8IsolatedContext.h"
#include "V8Proxy.h"
#include "V8TestCallback.h"
+#include "V8int.h"
#include "V8log.h"
#include <wtf/GetPtr.h>
#include <wtf/RefCounted.h>
@@ -172,16 +173,16 @@ static void XMLObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
return;
}
-static v8::Handle<v8::Value> CREATEAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+static v8::Handle<v8::Value> createAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.CREATE._get");
+ INC_STATS("DOM.TestObj.create._get");
TestObj* imp = V8TestObj::toNative(info.Holder());
return v8Boolean(imp->isCreate());
}
-static void CREATEAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+static void createAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.CREATE._set");
+ INC_STATS("DOM.TestObj.create._set");
TestObj* imp = V8TestObj::toNative(info.Holder());
bool v = value->BooleanValue();
imp->setCreate(v);
@@ -515,6 +516,38 @@ static void conditionalAttr3AttrSetter(v8::Local<v8::String> name, v8::Local<v8:
#endif // ENABLE(Condition1) || ENABLE(Condition2)
+static v8::Handle<v8::Value> enabledAtRuntimeAttr1AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeAttr1._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->enabledAtRuntimeAttr1());
+}
+
+static void enabledAtRuntimeAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeAttr1._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setEnabledAtRuntimeAttr1(v);
+ return;
+}
+
+static v8::Handle<v8::Value> enabledAtRuntimeAttr2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeAttr2._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->enabledAtRuntimeAttr2());
+}
+
+static void enabledAtRuntimeAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeAttr2._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setEnabledAtRuntimeAttr2(v);
+ return;
+}
+
static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.TestObj.description._get");
@@ -1020,6 +1053,24 @@ static v8::Handle<v8::Value> classMethodWithOptionalCallback(const v8::Arguments
return v8::Integer::New(TestObj::classMethodWithOptional(arg));
}
+static v8::Handle<v8::Value> enabledAtRuntimeMethod1Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeMethod1");
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(args[0]) ? V8int::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
+ imp->enabledAtRuntimeMethod1(intArg);
+ return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> enabledAtRuntimeMethod2Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeMethod2");
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(args[0]) ? V8int::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
+ imp->enabledAtRuntimeMethod2(intArg);
+ return v8::Handle<v8::Value>();
+}
+
} // namespace TestObjInternal
static const BatchedAttribute TestObjAttrs[] = {
@@ -1041,8 +1092,8 @@ static const BatchedAttribute TestObjAttrs[] = {
{"testObjAttr", TestObjInternal::testObjAttrAttrGetter, TestObjInternal::testObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'XMLObjAttr' (Type: 'attribute' ExtAttr: '')
{"XMLObjAttr", TestObjInternal::XMLObjAttrAttrGetter, TestObjInternal::XMLObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- // Attribute 'CREATE' (Type: 'attribute' ExtAttr: '')
- {"CREATE", TestObjInternal::CREATEAttrGetter, TestObjInternal::CREATEAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'create' (Type: 'attribute' ExtAttr: '')
+ {"create", TestObjInternal::createAttrGetter, TestObjInternal::createAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect')
{"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'reflectedIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect')
@@ -1157,6 +1208,18 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
+ if (RuntimeEnabledFeatures::enabledAtRuntimeAttr1Enabled()) {
+ static const BatchedAttribute attrData =\
+ // Attribute 'enabledAtRuntimeAttr1' (Type: 'attribute' ExtAttr: 'EnabledAtRuntime')
+ {"enabledAtRuntimeAttr1", TestObjInternal::enabledAtRuntimeAttr1AttrGetter, TestObjInternal::enabledAtRuntimeAttr1AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
+ configureAttribute(instance, proto, attrData);
+ }
+ if (RuntimeEnabledFeatures::featureNameEnabled()) {
+ static const BatchedAttribute attrData =\
+ // Attribute 'enabledAtRuntimeAttr2' (Type: 'attribute' ExtAttr: 'EnabledAtRuntime')
+ {"enabledAtRuntimeAttr2", TestObjInternal::enabledAtRuntimeAttr2AttrGetter, TestObjInternal::enabledAtRuntimeAttr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
+ configureAttribute(instance, proto, attrData);
+ }
// Custom Signature 'voidMethodWithArgs'
const int voidMethodWithArgsArgc = 3;
@@ -1195,6 +1258,10 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
proto->Set(v8::String::New("customArgsAndException"), v8::FunctionTemplate::New(TestObjInternal::customArgsAndExceptionCallback, v8::Handle<v8::Value>(), customArgsAndExceptionSignature));
desc->Set(v8::String::New("classMethod"), v8::FunctionTemplate::New(TestObjInternal::classMethodCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
desc->Set(v8::String::New("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjInternal::classMethodWithOptionalCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
+ if (RuntimeEnabledFeatures::enabledAtRuntimeMethod1Enabled())
+ proto->Set(v8::String::New("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod1Callback, v8::Handle<v8::Value>(), defaultSignature));
+ if (RuntimeEnabledFeatures::featureNameEnabled())
+ proto->Set(v8::String::New("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod2Callback, v8::Handle<v8::Value>(), defaultSignature));
batchConfigureConstants(desc, proto, TestObjConsts, sizeof(TestObjConsts) / sizeof(*TestObjConsts));
// Custom toString template
@@ -1214,24 +1281,16 @@ v8::Persistent<v8::FunctionTemplate> V8TestObj::GetTemplate()
return V8TestObjCache;
}
-TestObj* V8TestObj::toNative(v8::Handle<v8::Object> object)
-{
- return reinterpret_cast<TestObj*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
-}
-
bool V8TestObj::HasInstance(v8::Handle<v8::Value> value)
{
return GetRawTemplate()->HasInstance(value);
}
-v8::Handle<v8::Object> V8TestObj::wrap(TestObj* impl)
+v8::Handle<v8::Object> V8TestObj::wrapSlow(TestObj* impl)
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = getDOMObjectMap().get(impl);
- if (!wrapper.IsEmpty())
- return wrapper;
wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
if (wrapper.IsEmpty())
return wrapper;
@@ -1241,18 +1300,6 @@ v8::Handle<v8::Object> V8TestObj::wrap(TestObj* impl)
return wrapper;
}
-v8::Handle<v8::Value> toV8(PassRefPtr<TestObj > impl)
-{
- return toV8(impl.get());
-}
-
-v8::Handle<v8::Value> toV8(TestObj* impl)
-{
- if (!impl)
- return v8::Null();
- return V8TestObj::wrap(impl);
-}
-
void V8TestObj::derefObject(void* object)
{
static_cast<TestObj*>(object)->deref();
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.h b/WebCore/bindings/scripts/test/V8/V8TestObj.h
index d9715c9..1e60488 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.h
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.h
@@ -22,6 +22,7 @@
#define V8TestObj_h
#include "TestObj.h"
+#include "V8DOMWrapper.h"
#include "WrapperTypeInfo.h"
#include "wtf/text/StringHash.h"
#include <v8.h>
@@ -35,8 +36,11 @@ public:
static bool HasInstance(v8::Handle<v8::Value> value);
static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
static v8::Persistent<v8::FunctionTemplate> GetTemplate();
- static TestObj* toNative(v8::Handle<v8::Object>);
- static v8::Handle<v8::Object> wrap(TestObj*);
+ static TestObj* toNative(v8::Handle<v8::Object> object)
+ {
+ return reinterpret_cast<TestObj*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
+ }
+ inline static v8::Handle<v8::Object> wrap(TestObj*);
static void derefObject(void*);
static WrapperTypeInfo info;
static v8::Handle<v8::Value> customMethodCallback(const v8::Arguments&);
@@ -44,10 +48,29 @@ public:
static v8::Handle<v8::Value> customAttrAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);
static void customAttrAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+private:
+ static v8::Handle<v8::Object> wrapSlow(TestObj*);
};
-v8::Handle<v8::Value> toV8(TestObj*);
-v8::Handle<v8::Value> toV8(PassRefPtr<TestObj >);
+
+v8::Handle<v8::Object> V8TestObj::wrap(TestObj* impl)
+{
+ v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return V8TestObj::wrapSlow(impl);
+}
+
+inline v8::Handle<v8::Value> toV8(TestObj* impl)
+{
+ if (!impl)
+ return v8::Null();
+ return V8TestObj::wrap(impl);
+}
+inline v8::Handle<v8::Value> toV8(PassRefPtr< TestObj > impl)
+{
+ return toV8(impl.get());
+}
}
#endif // V8TestObj_h
diff --git a/WebKit/chromium/src/js/DebuggerScript.js b/WebCore/bindings/v8/DebuggerScript.js
index 5a8a7bf..0222296 100644
--- a/WebKit/chromium/src/js/DebuggerScript.js
+++ b/WebCore/bindings/v8/DebuggerScript.js
@@ -144,7 +144,7 @@ DebuggerScript.currentCallFrame = function(execState, args)
var frameCount = execState.frameCount();
if (frameCount === 0)
return undefined;
-
+
var topFrame;
for (var i = frameCount - 1; i >= 0; i--) {
var frameMirror = execState.frame(i);
@@ -211,14 +211,14 @@ DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
var functionName;
if (func)
functionName = func.name() || func.inferredName();
-
+
// Get script ID.
var script = func.script();
var sourceID = script && script.id();
-
+
// Get line number.
var line = DebuggerScript._v8ToWebkitLineNumber(frameMirror.sourceLine());
-
+
// Get this object.
var thisObject = frameMirror.details_.receiver();
@@ -228,21 +228,40 @@ DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
for (var i = 0; i < frameMirror.scopeCount(); i++) {
var scopeMirror = frameMirror.scope(i);
var scopeObjectMirror = scopeMirror.scopeObject();
- var properties = scopeObjectMirror.properties();
- var scopeObject = {};
- for (var j = 0; j < properties.length; j++)
- scopeObject[properties[j].name()] = properties[j].value_;
- // Reset scope object prototype to null so that the proto properties
- // don't appear in th local scope section.
- scopeObject.__proto__ = null;
+
+ var scopeObject;
+ switch (scopeMirror.scopeType()) {
+ case ScopeType.Local:
+ case ScopeType.Closure:
+ // For transient objects we create a "persistent" copy that contains
+ // the same properties.
+ scopeObject = {};
+ // Reset scope object prototype to null so that the proto properties
+ // don't appear in the local scope section.
+ scopeObject.__proto__ = null;
+ var properties = scopeObjectMirror.properties();
+ for (var j = 0; j < properties.length; j++) {
+ var name = properties[j].name();
+ if (name.charAt(0) === ".")
+ continue; // Skip internal variables like ".arguments"
+ scopeObject[name] = properties[j].value_;
+ }
+ break;
+ case ScopeType.Global:
+ case ScopeType.With:
+ case ScopeType.Catch:
+ scopeObject = scopeMirror.details_.object();
+ break;
+ }
+
scopeType.push(scopeMirror.scopeType());
scopeChain.push(scopeObject);
}
-
+
function evaluate(expression) {
return frameMirror.evaluate(expression, false).value();
}
-
+
return {
"sourceID": sourceID,
"line": line,
diff --git a/WebCore/bindings/v8/NPV8Object.cpp b/WebCore/bindings/v8/NPV8Object.cpp
index 15382ad..fb97d59 100644
--- a/WebCore/bindings/v8/NPV8Object.cpp
+++ b/WebCore/bindings/v8/NPV8Object.cpp
@@ -107,7 +107,7 @@ NPObject* v8ObjectToNPObject(v8::Handle<v8::Object> object)
static NPClass V8NPObjectClass = { NP_CLASS_STRUCT_VERSION,
allocV8NPObject,
freeV8NPObject,
- 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
// NPAPI's npruntime functions.
NPClass* npScriptObjectClass = &V8NPObjectClass;
diff --git a/WebCore/bindings/v8/ScriptCachedFrameData.h b/WebCore/bindings/v8/ScriptCachedFrameData.h
index f700a48..1aa1f62 100644
--- a/WebCore/bindings/v8/ScriptCachedFrameData.h
+++ b/WebCore/bindings/v8/ScriptCachedFrameData.h
@@ -51,7 +51,7 @@ public:
} // namespace WebCore
-#elif PLATFORM(ANDROID)
+#elif PLATFORM(ANDROID) || PLATFORM(QT)
// FIXME: the right guard should be ENABLE(PAGE_CACHE). Replace with the right guard, once
// https://bugs.webkit.org/show_bug.cgi?id=35061 is fixed.
//
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index 903b11c..5023254 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -64,6 +64,10 @@
#include <wtf/StdLibExtras.h>
#include <wtf/text/CString.h>
+#if PLATFORM(QT)
+#include <QScriptEngine>
+#endif
+
namespace WebCore {
void ScriptController::initializeThreading()
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index 525476d..3bc42ef 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -44,6 +44,13 @@
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
+#if PLATFORM(QT)
+#include <qglobal.h>
+QT_BEGIN_NAMESPACE
+class QScriptEngine;
+QT_END_NAMESPACE
+#endif
+
struct NPObject;
namespace WebCore {
@@ -178,6 +185,10 @@ public:
NPObject* windowScriptNPObject();
#endif
+#if PLATFORM(QT)
+ QScriptEngine* qtScriptEngine();
+#endif
+
// Dummy method to avoid a bunch of ifdef's in WebCore.
void evaluateInWorld(const ScriptSourceCode&, DOMWrapperWorld*);
static void getAllWorlds(Vector<DOMWrapperWorld*>& worlds);
@@ -193,6 +204,9 @@ private:
OwnPtr<V8Proxy> m_proxy;
typedef HashMap<Widget*, NPObject*> PluginObjectMap;
+#if PLATFORM(QT)
+ OwnPtr<QScriptEngine> m_qtScriptEngine;
+#endif
// A mapping between Widgets and their corresponding script object.
// This list is used so that when the plugin dies, we can immediately
diff --git a/WebCore/bindings/v8/ScriptControllerQt.cpp b/WebCore/bindings/v8/ScriptControllerQt.cpp
new file mode 100644
index 0000000..246921e
--- /dev/null
+++ b/WebCore/bindings/v8/ScriptControllerQt.cpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScriptController.h"
+
+#include <QScriptEngine>
+
+namespace WebCore {
+
+QScriptEngine* ScriptController::qtScriptEngine()
+{
+ if (!m_qtScriptEngine) {
+ v8::HandleScope handleScope;
+ v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(m_frame);
+ v8::Context::Scope scope(v8Context);
+ if (v8Context.IsEmpty())
+ return 0;
+ m_qtScriptEngine = new QScriptEngine(QScriptEngine::AdoptCurrentContext);
+ }
+ return m_qtScriptEngine.get();
+}
+
+}
+// vim: ts=4 sw=4 et
diff --git a/WebCore/bindings/v8/ScriptValue.cpp b/WebCore/bindings/v8/ScriptValue.cpp
index ebe9ccc..ebe9ccc 100755..100644
--- a/WebCore/bindings/v8/ScriptValue.cpp
+++ b/WebCore/bindings/v8/ScriptValue.cpp
diff --git a/WebCore/bindings/v8/SerializedScriptValue.cpp b/WebCore/bindings/v8/SerializedScriptValue.cpp
index 0b908b8..4e5354e 100644
--- a/WebCore/bindings/v8/SerializedScriptValue.cpp
+++ b/WebCore/bindings/v8/SerializedScriptValue.cpp
@@ -879,7 +879,7 @@ private:
return false;
if (!doReadUint64(&size))
return false;
- PassRefPtr<Blob> blob = Blob::create(getScriptExecutionContext(), KURL(ParsedURLString, url), type, size);
+ PassRefPtr<Blob> blob = Blob::create(KURL(ParsedURLString, url), type, size);
*value = toV8(blob);
return true;
}
@@ -895,7 +895,7 @@ private:
return false;
if (!readWebCoreString(&type))
return false;
- PassRefPtr<File> file = File::create(getScriptExecutionContext(), path, KURL(ParsedURLString, url), type);
+ PassRefPtr<File> file = File::create(path, KURL(ParsedURLString, url), type);
*value = toV8(file);
return true;
}
@@ -916,7 +916,7 @@ private:
return false;
if (!readWebCoreString(&type))
return false;
- fileList->append(File::create(getScriptExecutionContext(), path, KURL(ParsedURLString, urlString), type));
+ fileList->append(File::create(path, KURL(ParsedURLString, urlString), type));
}
*value = toV8(fileList);
return true;
diff --git a/WebCore/bindings/v8/V8Binding.cpp b/WebCore/bindings/v8/V8Binding.cpp
index bfbc647..d0bf0ca 100644
--- a/WebCore/bindings/v8/V8Binding.cpp
+++ b/WebCore/bindings/v8/V8Binding.cpp
@@ -61,7 +61,7 @@ public:
}
explicit WebCoreStringResource(const AtomicString& string)
- : m_plainString(string)
+ : m_plainString(string.string())
, m_atomicString(string)
{
#ifndef NDEBUG
diff --git a/WebCore/bindings/v8/V8Helpers.h b/WebCore/bindings/v8/V8Helpers.h
index e90f5d6..43d765a 100644
--- a/WebCore/bindings/v8/V8Helpers.h
+++ b/WebCore/bindings/v8/V8Helpers.h
@@ -31,7 +31,7 @@
#ifndef V8Helpers_h
#define V8Helpers_h
-#include "npruntime.h"
+#include "npruntime_internal.h"
#include <v8.h>
namespace WebCore {
diff --git a/WebCore/bindings/v8/V8NPObject.h b/WebCore/bindings/v8/V8NPObject.h
index a540ca9..832d649 100644
--- a/WebCore/bindings/v8/V8NPObject.h
+++ b/WebCore/bindings/v8/V8NPObject.h
@@ -34,7 +34,7 @@
#if PLATFORM(CHROMIUM)
#include <bindings/npruntime.h>
#else
-#include "npruntime.h"
+#include "npruntime_internal.h"
#endif
#include <v8.h>
diff --git a/WebCore/bindings/v8/V8NPUtils.h b/WebCore/bindings/v8/V8NPUtils.h
index 78414b4..dc6185b 100644
--- a/WebCore/bindings/v8/V8NPUtils.h
+++ b/WebCore/bindings/v8/V8NPUtils.h
@@ -33,7 +33,7 @@
#if PLATFORM(CHROMIUM)
#include <bindings/npruntime.h>
#else
-#include "npruntime.h"
+#include "npruntime_internal.h"
#endif
#include <v8.h>
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index b9e4b7f..27e09e6 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -77,6 +77,7 @@
#include <wtf/StdLibExtras.h>
#include <wtf/StringExtras.h>
#include <wtf/UnusedParam.h>
+#include <wtf/text/CString.h>
#ifdef ANDROID_INSTRUMENT
#include "TimeCounter.h"
diff --git a/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp b/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
index 7ca18ab..c8a975b 100644
--- a/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
@@ -33,6 +33,7 @@
#include "DOMStringMap.h"
#include "V8Binding.h"
+#include "V8DOMWrapper.h"
namespace WebCore {
@@ -93,4 +94,16 @@ v8::Handle<v8::Value> V8DOMStringMap::namedPropertySetter(v8::Local<v8::String>
return value;
}
+v8::Handle<v8::Value> toV8(DOMStringMap* impl)
+{
+ if (!impl)
+ return v8::Null();
+ v8::Handle<v8::Object> wrapper = V8DOMStringMap::wrap(impl);
+ // Add a hidden reference from the element to the DOMStringMap.
+ Element* element = impl->element();
+ if (!wrapper.IsEmpty() && element)
+ V8DOMWrapper::setHiddenWindowReference(element->document()->frame(), wrapper);
+ return wrapper;
+}
+
} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 45cb1b4..f7c75f7 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -605,9 +605,11 @@ bool V8DOMWindow::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::V
if (key->IsString()) {
String name = toWebCoreString(key);
-
- // Allow access of GET and HAS if index is a subframe.
- if ((type == v8::ACCESS_GET || type == v8::ACCESS_HAS) && target->tree()->child(name))
+ // Notice that we can't call HasRealNamedProperty for ACCESS_HAS
+ // because that would generate infinite recursion.
+ if (type == v8::ACCESS_HAS && target->tree()->child(name))
+ return true;
+ if (type == v8::ACCESS_GET && target->tree()->child(name) && !host->HasRealNamedProperty(key->ToString()))
return true;
}
@@ -628,8 +630,11 @@ bool V8DOMWindow::indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t inde
if (!target)
return false;
- // Allow access of GET and HAS if index is a subframe.
- if ((type == v8::ACCESS_GET || type == v8::ACCESS_HAS) && target->tree()->child(index))
+ // Notice that we can't call HasRealNamedProperty for ACCESS_HAS
+ // because that would generate infinite recursion.
+ if (type == v8::ACCESS_HAS && target->tree()->child(index))
+ return true;
+ if (type == v8::ACCESS_GET && target->tree()->child(index) && !host->HasRealIndexedProperty(index))
return true;
return V8BindingSecurity::canAccessFrame(V8BindingState::Only(), target, false);
diff --git a/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp b/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
new file mode 100644
index 0000000..286b154
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
@@ -0,0 +1,139 @@
+/*
+ * 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 "V8DirectoryEntry.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "DirectoryEntry.h"
+#include "ExceptionCode.h"
+#include "V8Binding.h"
+#include "V8BindingMacros.h"
+#include "V8EntryCallback.h"
+#include "V8ErrorCallback.h"
+#include "V8Flags.h"
+#include "V8Proxy.h"
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8DirectoryEntry::getDirectoryCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.DirectoryEntry.getDirectory");
+ DirectoryEntry* imp = V8DirectoryEntry::toNative(args.Holder());
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, path, args[0]);
+ if (args.Length() <= 1) {
+ imp->getDirectory(path);
+ return v8::Handle<v8::Value>();
+ }
+ RefPtr<Flags> flags;
+ if (!isUndefinedOrNull(args[1]) && args[1]->IsObject() && !V8Flags::HasInstance(args[1])) {
+ EXCEPTION_BLOCK(v8::Handle<v8::Object>, object, v8::Handle<v8::Object>::Cast(args[1]));
+ flags = Flags::create();
+ v8::Local<v8::Value> v8Create = object->Get(v8::String::New("create"));
+ if (!v8Create.IsEmpty() && !isUndefinedOrNull(v8Create)) {
+ EXCEPTION_BLOCK(bool, isCreate, v8Create->BooleanValue());
+ flags->setCreate(isCreate);
+ }
+ v8::Local<v8::Value> v8Exclusive = object->Get(v8::String::New("exclusive"));
+ if (!v8Exclusive.IsEmpty() && !isUndefinedOrNull(v8Exclusive)) {
+ EXCEPTION_BLOCK(bool, isExclusive, v8Exclusive->BooleanValue());
+ flags->setExclusive(isExclusive);
+ }
+ } else {
+ EXCEPTION_BLOCK(Flags*, tmp_flags, V8Flags::HasInstance(args[1]) ? V8Flags::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
+ flags = adoptRef(tmp_flags);
+ }
+ RefPtr<EntryCallback> successCallback;
+ if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
+ if (!args[2]->IsObject())
+ return throwError(TYPE_MISMATCH_ERR);
+ successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext());
+ }
+ RefPtr<ErrorCallback> errorCallback;
+ if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) {
+ if (!args[3]->IsObject())
+ return throwError(TYPE_MISMATCH_ERR);
+ errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext());
+ }
+ imp->getDirectory(path, flags, successCallback, errorCallback);
+ return v8::Handle<v8::Value>();
+}
+
+v8::Handle<v8::Value> V8DirectoryEntry::getFileCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.DirectoryEntry.getFile");
+ DirectoryEntry* imp = V8DirectoryEntry::toNative(args.Holder());
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, path, args[0]);
+ if (args.Length() <= 1) {
+ imp->getFile(path);
+ return v8::Handle<v8::Value>();
+ }
+ RefPtr<Flags> flags;
+ if (!isUndefinedOrNull(args[1]) && args[1]->IsObject() && !V8Flags::HasInstance(args[1])) {
+ EXCEPTION_BLOCK(v8::Handle<v8::Object>, object, v8::Handle<v8::Object>::Cast(args[1]));
+ flags = Flags::create();
+ v8::Local<v8::Value> v8Create = object->Get(v8::String::New("create"));
+ if (!v8Create.IsEmpty() && !isUndefinedOrNull(v8Create)) {
+ EXCEPTION_BLOCK(bool, isCreate, v8Create->BooleanValue());
+ flags->setCreate(isCreate);
+ }
+ v8::Local<v8::Value> v8Exclusive = object->Get(v8::String::New("exclusive"));
+ if (!v8Exclusive.IsEmpty() && !isUndefinedOrNull(v8Exclusive)) {
+ EXCEPTION_BLOCK(bool, isExclusive, v8Exclusive->BooleanValue());
+ flags->setExclusive(isExclusive);
+ }
+ } else {
+ EXCEPTION_BLOCK(Flags*, tmp_flags, V8Flags::HasInstance(args[1]) ? V8Flags::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
+ flags = adoptRef(tmp_flags);
+ }
+ RefPtr<EntryCallback> successCallback;
+ if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
+ if (!args[2]->IsObject())
+ return throwError(TYPE_MISMATCH_ERR);
+ successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext());
+ }
+ RefPtr<ErrorCallback> errorCallback;
+ if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) {
+ if (!args[3]->IsObject())
+ return throwError(TYPE_MISMATCH_ERR);
+ errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext());
+ }
+ imp->getFile(path, flags, successCallback, errorCallback);
+ return v8::Handle<v8::Value>();
+}
+
+
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/bindings/v8/custom/V8EntryCustom.cpp b/WebCore/bindings/v8/custom/V8EntryCustom.cpp
new file mode 100644
index 0000000..c02cd6f
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8EntryCustom.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Entry.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "V8Attr.h"
+#include "V8Binding.h"
+#include "V8BindingState.h"
+#include "V8DirectoryEntry.h"
+#include "V8Entry.h"
+#include "V8FileEntry.h"
+#include "V8Proxy.h"
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+v8::Handle<v8::Value> toV8(Entry* impl)
+{
+ if (!impl)
+ return v8::Null();
+
+ if (impl->isFile())
+ return toV8(static_cast<FileEntry*>(impl));
+
+ ASSERT(impl->isDirectory());
+ return toV8(static_cast<DirectoryEntry*>(impl));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/bindings/v8/custom/V8EventCustom.cpp b/WebCore/bindings/v8/custom/V8EventCustom.cpp
index e0bb02b..f96ba7a 100644
--- a/WebCore/bindings/v8/custom/V8EventCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8EventCustom.cpp
@@ -43,6 +43,7 @@
#include "V8DeviceMotionEvent.h"
#include "V8DeviceOrientationEvent.h"
#include "V8ErrorEvent.h"
+#include "V8HashChangeEvent.h"
#include "V8IDBErrorEvent.h"
#include "V8IDBSuccessEvent.h"
#include "V8KeyboardEvent.h"
@@ -120,6 +121,8 @@ v8::Handle<v8::Value> toV8(Event* impl)
#endif
return toV8(static_cast<UIEvent*>(impl));
}
+ if (impl->isHashChangeEvent())
+ return toV8(static_cast<HashChangeEvent*>(impl));
if (impl->isMutationEvent())
return toV8(static_cast<MutationEvent*>(impl));
if (impl->isOverflowEvent())
diff --git a/WebCore/bindings/v8/npruntime_internal.h b/WebCore/bindings/v8/npruntime_internal.h
index 75bf2b0..40d639f 100644
--- a/WebCore/bindings/v8/npruntime_internal.h
+++ b/WebCore/bindings/v8/npruntime_internal.h
@@ -38,4 +38,16 @@
#undef Auto
#undef Complex
#undef Status
+ #undef CursorShape
+ #undef FocusIn
+ #undef FocusOut
+ #undef KeyPress
+ #undef KeyRelease
+ #undef Unsorted
+ #undef Bool
+ #undef FontChange
+ #undef GrayScale
+ #undef NormalState
+ #undef True
+ #undef False
#endif
diff --git a/WebCore/bridge/npruntime_internal.h b/WebCore/bridge/npruntime_internal.h
index 736a7f1..550c34c 100644
--- a/WebCore/bridge/npruntime_internal.h
+++ b/WebCore/bridge/npruntime_internal.h
@@ -48,4 +48,6 @@
#undef FontChange
#undef GrayScale
#undef NormalState
+ #undef True
+ #undef False
#endif
diff --git a/WebCore/config.h b/WebCore/config.h
index 188f212..8a82914 100644
--- a/WebCore/config.h
+++ b/WebCore/config.h
@@ -315,3 +315,12 @@ typedef float CGFloat;
#if PLATFORM(WIN) && PLATFORM(CG)
#define WTF_USE_SAFARI_THEME 1
#endif
+<<<<<<< HEAD
+=======
+
+#if PLATFORM(QT) && USE(V8) && defined(Q_WS_X11)
+/* protect ourselves from evil X11 defines */
+#include <bridge/npruntime_internal.h>
+#endif
+
+>>>>>>> webkit.org at r67908
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp
index d5330c6..369ece9 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -162,6 +162,7 @@ static const int computedProperties[] = {
CSSPropertyWebkitBackgroundComposite,
CSSPropertyWebkitBackgroundOrigin,
CSSPropertyWebkitBackgroundSize,
+ CSSPropertyWebkitBlockFlow,
CSSPropertyWebkitBorderFit,
CSSPropertyWebkitBorderHorizontalSpacing,
CSSPropertyWebkitBorderImage,
@@ -347,7 +348,17 @@ static PassRefPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image)
return CSSBorderImageValue::create(imageValue, rect, valueForRepeatRule(image.horizontalRule()), valueForRepeatRule(image.verticalRule()));
}
-static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection)
+inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(int value, const RenderStyle* style)
+{
+ return CSSPrimitiveValue::create(adjustForAbsoluteZoom(value, style), CSSPrimitiveValue::CSS_PX);
+}
+
+inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value, const RenderStyle* style)
+{
+ return CSSPrimitiveValue::create(value / style->effectiveZoom(), CSSPrimitiveValue::CSS_NUMBER);
+}
+
+static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection, const RenderStyle* style)
{
if (!reflection)
return CSSPrimitiveValue::createIdentifier(CSSValueNone);
@@ -356,7 +367,7 @@ static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection
if (reflection->offset().isPercent())
offset = CSSPrimitiveValue::create(reflection->offset().percent(), CSSPrimitiveValue::CSS_PERCENTAGE);
else
- offset = CSSPrimitiveValue::create(reflection->offset().value(), CSSPrimitiveValue::CSS_PX);
+ offset = zoomAdjustedPixelValue(reflection->offset().value(), style);
return CSSReflectValue::create(reflection->direction(), offset.release(), valueForNinePieceImage(reflection->mask()));
}
@@ -384,8 +395,11 @@ static PassRefPtr<CSSValue> getPositionOffsetValue(RenderStyle* style, int prope
return 0;
}
- if (style->position() == AbsolutePosition || style->position() == FixedPosition)
+ if (style->position() == AbsolutePosition || style->position() == FixedPosition) {
+ if (l.type() == WebCore::Fixed)
+ return zoomAdjustedPixelValue(l.value(), style);
return CSSPrimitiveValue::create(l);
+ }
if (style->position() == RelativePosition)
// FIXME: It's not enough to simply return "auto" values for one offset if the other side is defined.
@@ -404,22 +418,22 @@ PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo
return CSSPrimitiveValue::createColor(color.rgb());
}
-static PassRefPtr<CSSValue> getBorderRadiusCornerValue(LengthSize radius)
+static PassRefPtr<CSSValue> getBorderRadiusCornerValue(LengthSize radius, const RenderStyle* style)
{
RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
if (radius.width() == radius.height()) {
if (radius.width().type() == Percent)
return CSSPrimitiveValue::create(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE);
- return CSSPrimitiveValue::create(radius.width().value(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(radius.width().value(), style);
}
if (radius.width().type() == Percent)
list->append(CSSPrimitiveValue::create(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE));
else
- list->append(CSSPrimitiveValue::create(radius.width().value(), CSSPrimitiveValue::CSS_PX));
+ list->append(zoomAdjustedPixelValue(radius.width().value(), style));
if (radius.height().type() == Percent)
list->append(CSSPrimitiveValue::create(radius.height().percent(), CSSPrimitiveValue::CSS_PERCENTAGE));
else
- list->append(CSSPrimitiveValue::create(radius.height().value(), CSSPrimitiveValue::CSS_PX));
+ list->append(zoomAdjustedPixelValue(radius.height().value(), style));
return list.release();
}
@@ -458,8 +472,8 @@ static PassRefPtr<CSSValue> computedTransform(RenderObject* renderer, const Rend
transformVal->append(CSSPrimitiveValue::create(transform.b(), CSSPrimitiveValue::CSS_NUMBER));
transformVal->append(CSSPrimitiveValue::create(transform.c(), CSSPrimitiveValue::CSS_NUMBER));
transformVal->append(CSSPrimitiveValue::create(transform.d(), CSSPrimitiveValue::CSS_NUMBER));
- transformVal->append(CSSPrimitiveValue::create(transform.e(), CSSPrimitiveValue::CSS_NUMBER));
- transformVal->append(CSSPrimitiveValue::create(transform.f(), CSSPrimitiveValue::CSS_NUMBER));
+ transformVal->append(zoomAdjustedNumberValue(transform.e(), style));
+ transformVal->append(zoomAdjustedNumberValue(transform.f(), style));
} else {
transformVal = WebKitCSSTransformValue::create(WebKitCSSTransformValue::Matrix3DTransformOperation);
@@ -478,9 +492,9 @@ static PassRefPtr<CSSValue> computedTransform(RenderObject* renderer, const Rend
transformVal->append(CSSPrimitiveValue::create(transform.m33(), CSSPrimitiveValue::CSS_NUMBER));
transformVal->append(CSSPrimitiveValue::create(transform.m34(), CSSPrimitiveValue::CSS_NUMBER));
- transformVal->append(CSSPrimitiveValue::create(transform.m41(), CSSPrimitiveValue::CSS_NUMBER));
- transformVal->append(CSSPrimitiveValue::create(transform.m42(), CSSPrimitiveValue::CSS_NUMBER));
- transformVal->append(CSSPrimitiveValue::create(transform.m43(), CSSPrimitiveValue::CSS_NUMBER));
+ transformVal->append(zoomAdjustedNumberValue(transform.m41(), style));
+ transformVal->append(zoomAdjustedNumberValue(transform.m42(), style));
+ transformVal->append(zoomAdjustedNumberValue(transform.m43(), style));
transformVal->append(CSSPrimitiveValue::create(transform.m44(), CSSPrimitiveValue::CSS_NUMBER));
}
@@ -534,12 +548,12 @@ static PassRefPtr<CSSValue> getTimingFunctionValue(const AnimationList* animList
}
} else {
// Note that initialAnimationTimingFunction() is used for both transitions and animations
- const TimingFunction* tf = Animation::initialAnimationTimingFunction().get();
+ RefPtr<TimingFunction> tf = Animation::initialAnimationTimingFunction();
if (tf->isCubicBezierTimingFunction()) {
- const CubicBezierTimingFunction* ctf = static_cast<const CubicBezierTimingFunction*>(tf);
+ const CubicBezierTimingFunction* ctf = static_cast<const CubicBezierTimingFunction*>(tf.get());
list->append(CSSCubicBezierTimingFunctionValue::create(ctf->x1(), ctf->y1(), ctf->x2(), ctf->y2()));
} else if (tf->isStepsTimingFunction()) {
- const StepsTimingFunction* stf = static_cast<const StepsTimingFunction*>(tf);
+ const StepsTimingFunction* stf = static_cast<const StepsTimingFunction*>(tf.get());
list->append(CSSStepsTimingFunctionValue::create(stf->numberOfSteps(), stf->stepAtStart()));
} else {
list->append(CSSLinearTimingFunctionValue::create());
@@ -603,7 +617,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringK
if (int keywordSize = style->fontDescription().keywordSize())
return CSSPrimitiveValue::createIdentifier(cssIdentifierForFontSizeKeyword(keywordSize));
- return CSSPrimitiveValue::create(style->fontDescription().computedPixelSize(), CSSPrimitiveValue::CSS_PX);
+
+ return zoomAdjustedPixelValue(style->fontDescription().computedPixelSize(), style.get());
}
bool CSSComputedStyleDeclaration::useFixedFontDefaultSize() const
@@ -618,7 +633,7 @@ bool CSSComputedStyleDeclaration::useFixedFontDefaultSize() const
return style->fontDescription().useFixedDefaultSize();
}
-PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadow(const ShadowData* shadow, int id) const
+PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadow(const ShadowData* shadow, int id, RenderStyle* style) const
{
if (!shadow)
return CSSPrimitiveValue::createIdentifier(CSSValueNone);
@@ -627,10 +642,10 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadow(const ShadowDat
RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
for (const ShadowData* s = shadow; s; s = s->next()) {
- RefPtr<CSSPrimitiveValue> x = CSSPrimitiveValue::create(s->x(), CSSPrimitiveValue::CSS_PX);
- RefPtr<CSSPrimitiveValue> y = CSSPrimitiveValue::create(s->y(), CSSPrimitiveValue::CSS_PX);
- RefPtr<CSSPrimitiveValue> blur = CSSPrimitiveValue::create(s->blur(), CSSPrimitiveValue::CSS_PX);
- RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ? 0 : CSSPrimitiveValue::create(s->spread(), CSSPrimitiveValue::CSS_PX);
+ RefPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(s->x(), style);
+ RefPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(s->y(), style);
+ RefPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(s->blur(), style);
+ RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ? 0 : zoomAdjustedPixelValue(s->spread(), style);
RefPtr<CSSPrimitiveValue> style = propertyID == CSSPropertyTextShadow || s->style() == Normal ? 0 : CSSPrimitiveValue::createIdentifier(CSSValueInset);
RefPtr<CSSPrimitiveValue> color = CSSPrimitiveValue::createColor(s->color().rgb());
list->prepend(ShadowValue::create(x.release(), y.release(), blur.release(), spread.release(), style.release(), color.release()));
@@ -738,10 +753,14 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
if (!style)
return 0;
+<<<<<<< HEAD
propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->direction());
#ifdef ANDROID_LAYOUT
const Settings * settings = node->document()->frame() ? node->document()->frame()->settings() : 0;
#endif
+=======
+ propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->direction(), style->blockFlow());
+>>>>>>> webkit.org at r67908
switch (static_cast<CSSPropertyID>(propertyID)) {
case CSSPropertyInvalid:
@@ -797,14 +816,14 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return CSSPrimitiveValue::createIdentifier(CSSValueSeparate);
case CSSPropertyBorderSpacing: {
RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
- list->append(CSSPrimitiveValue::create(style->horizontalBorderSpacing(), CSSPrimitiveValue::CSS_PX));
- list->append(CSSPrimitiveValue::create(style->verticalBorderSpacing(), CSSPrimitiveValue::CSS_PX));
+ list->append(zoomAdjustedPixelValue(style->horizontalBorderSpacing(), style.get()));
+ list->append(zoomAdjustedPixelValue(style->verticalBorderSpacing(), style.get()));
return list.release();
}
case CSSPropertyWebkitBorderHorizontalSpacing:
- return CSSPrimitiveValue::create(style->horizontalBorderSpacing(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(style->horizontalBorderSpacing(), style.get());
case CSSPropertyWebkitBorderVerticalSpacing:
- return CSSPrimitiveValue::create(style->verticalBorderSpacing(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(style->verticalBorderSpacing(), style.get());
case CSSPropertyBorderTopColor:
return m_allowVisitedStyle ? CSSPrimitiveValue::createColor(style->visitedDependentColor(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidColor(style.get(), style->borderTopColor());
case CSSPropertyBorderRightColor:
@@ -822,13 +841,13 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyBorderLeftStyle:
return CSSPrimitiveValue::create(style->borderLeftStyle());
case CSSPropertyBorderTopWidth:
- return CSSPrimitiveValue::create(style->borderTopWidth(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(style->borderTopWidth(), style.get());
case CSSPropertyBorderRightWidth:
- return CSSPrimitiveValue::create(style->borderRightWidth(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(style->borderRightWidth(), style.get());
case CSSPropertyBorderBottomWidth:
- return CSSPrimitiveValue::create(style->borderBottomWidth(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(style->borderBottomWidth(), style.get());
case CSSPropertyBorderLeftWidth:
- return CSSPrimitiveValue::create(style->borderLeftWidth(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(style->borderLeftWidth(), style.get());
case CSSPropertyBottom:
return getPositionOffsetValue(style.get(), CSSPropertyBottom);
case CSSPropertyWebkitBoxAlign:
@@ -854,9 +873,9 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return CSSPrimitiveValue::create(boxPack);
}
case CSSPropertyWebkitBoxReflect:
- return valueForReflection(style->boxReflect());
+ return valueForReflection(style->boxReflect(), style.get());
case CSSPropertyWebkitBoxShadow:
- return valueForShadow(style->boxShadow(), propertyID);
+ return valueForShadow(style->boxShadow(), propertyID, style.get());
case CSSPropertyCaptionSide:
return CSSPrimitiveValue::create(style->captionSide());
case CSSPropertyClear:
@@ -876,7 +895,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyWebkitColumnRuleStyle:
return CSSPrimitiveValue::create(style->columnRuleStyle());
case CSSPropertyWebkitColumnRuleWidth:
- return CSSPrimitiveValue::create(style->columnRuleWidth(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(style->columnRuleWidth(), style.get());
case CSSPropertyWebkitColumnSpan:
if (style->columnSpan())
return CSSPrimitiveValue::createIdentifier(CSSValueAll);
@@ -928,7 +947,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return list.release();
}
case CSSPropertyFontSize:
- return CSSPrimitiveValue::create(style->fontDescription().computedPixelSize(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(style->fontDescription().computedPixelSize(), style.get());
case CSSPropertyFontStyle:
if (style->fontDescription().italic())
return CSSPrimitiveValue::createIdentifier(CSSValueItalic);
@@ -962,7 +981,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return CSSPrimitiveValue::createIdentifier(CSSValueNormal);
case CSSPropertyHeight:
if (renderer)
- return CSSPrimitiveValue::create(sizingBox(renderer).height(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(sizingBox(renderer).height(), style.get());
return CSSPrimitiveValue::create(style->height());
case CSSPropertyWebkitHighlight:
if (style->highlight() == nullAtom)
@@ -987,7 +1006,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyLetterSpacing:
if (!style->letterSpacing())
return CSSPrimitiveValue::createIdentifier(CSSValueNormal);
- return CSSPrimitiveValue::create(style->letterSpacing(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(style->letterSpacing(), style.get());
case CSSPropertyWebkitLineClamp:
if (style->lineClamp().isNone())
return CSSPrimitiveValue::createIdentifier(CSSValueNone);
@@ -1001,8 +1020,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
// for how high to be in pixels does include things like minimum font size and the zoom factor.
// On the other hand, since font-size doesn't include the zoom factor, we really can't do
// that here either.
- return CSSPrimitiveValue::create(static_cast<int>(length.percent() * style->fontDescription().specifiedSize()) / 100, CSSPrimitiveValue::CSS_PX);
- return CSSPrimitiveValue::create(length.value(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(static_cast<int>(length.percent() * style->fontDescription().specifiedSize()) / 100, style.get());
+ return zoomAdjustedPixelValue(length.value(), style.get());
}
case CSSPropertyListStyleImage:
if (style->listStyleImage())
@@ -1015,22 +1034,22 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyMarginTop:
if (renderer && renderer->isBox())
// FIXME: Supposed to return the percentage if percentage was specified.
- return CSSPrimitiveValue::create(toRenderBox(renderer)->marginTop(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(toRenderBox(renderer)->marginTop(), style.get());
return CSSPrimitiveValue::create(style->marginTop());
case CSSPropertyMarginRight:
if (renderer && renderer->isBox())
// FIXME: Supposed to return the percentage if percentage was specified.
- return CSSPrimitiveValue::create(toRenderBox(renderer)->marginRight(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(toRenderBox(renderer)->marginRight(), style.get());
return CSSPrimitiveValue::create(style->marginRight());
case CSSPropertyMarginBottom:
if (renderer && renderer->isBox())
// FIXME: Supposed to return the percentage if percentage was specified.
- return CSSPrimitiveValue::create(toRenderBox(renderer)->marginBottom(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(toRenderBox(renderer)->marginBottom(), style.get());
return CSSPrimitiveValue::create(style->marginBottom());
case CSSPropertyMarginLeft:
if (renderer && renderer->isBox())
// FIXME: Supposed to return the percentage if percentage was specified.
- return CSSPrimitiveValue::create(toRenderBox(renderer)->marginLeft(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(toRenderBox(renderer)->marginLeft(), style.get());
return CSSPrimitiveValue::create(style->marginLeft());
case CSSPropertyWebkitMarqueeDirection:
return CSSPrimitiveValue::create(style->marqueeDirection());
@@ -1109,7 +1128,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
return CSSPrimitiveValue::create(style->outlineStyle());
case CSSPropertyOutlineWidth:
- return CSSPrimitiveValue::create(style->outlineWidth(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(style->outlineWidth(), style.get());
case CSSPropertyOverflow:
return CSSPrimitiveValue::create(max(style->overflowX(), style->overflowY()));
case CSSPropertyOverflowX:
@@ -1122,19 +1141,19 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return CSSPrimitiveValue::create(style->overflowY());
case CSSPropertyPaddingTop:
if (renderer && renderer->isBox())
- return CSSPrimitiveValue::create(toRenderBox(renderer)->paddingTop(false), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(toRenderBox(renderer)->paddingTop(false), style.get());
return CSSPrimitiveValue::create(style->paddingTop());
case CSSPropertyPaddingRight:
if (renderer && renderer->isBox())
- return CSSPrimitiveValue::create(toRenderBox(renderer)->paddingRight(false), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(toRenderBox(renderer)->paddingRight(false), style.get());
return CSSPrimitiveValue::create(style->paddingRight());
case CSSPropertyPaddingBottom:
if (renderer && renderer->isBox())
- return CSSPrimitiveValue::create(toRenderBox(renderer)->paddingBottom(false), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(toRenderBox(renderer)->paddingBottom(false), style.get());
return CSSPrimitiveValue::create(style->paddingBottom());
case CSSPropertyPaddingLeft:
if (renderer && renderer->isBox())
- return CSSPrimitiveValue::create(toRenderBox(renderer)->paddingLeft(false), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(toRenderBox(renderer)->paddingLeft(false), style.get());
return CSSPrimitiveValue::create(style->paddingLeft());
case CSSPropertyPageBreakAfter:
return CSSPrimitiveValue::create(style->pageBreakAfter());
@@ -1168,7 +1187,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyTextIndent:
return CSSPrimitiveValue::create(style->textIndent());
case CSSPropertyTextShadow:
- return valueForShadow(style->textShadow(), propertyID);
+ return valueForShadow(style->textShadow(), propertyID, style.get());
case CSSPropertyTextRendering:
return CSSPrimitiveValue::create(style->fontDescription().textRenderingMode());
case CSSPropertyTextOverflow:
@@ -1184,7 +1203,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyWebkitTextStrokeColor:
return currentColorOrValidColor(style.get(), style->textStrokeColor());
case CSSPropertyWebkitTextStrokeWidth:
- return CSSPrimitiveValue::create(style->textStrokeWidth(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(style->textStrokeWidth(), style.get());
case CSSPropertyTextTransform:
return CSSPrimitiveValue::create(style->textTransform());
case CSSPropertyTop:
@@ -1243,12 +1262,12 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return CSSPrimitiveValue::create(style->widows(), CSSPrimitiveValue::CSS_NUMBER);
case CSSPropertyWidth:
if (renderer)
- return CSSPrimitiveValue::create(sizingBox(renderer).width(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(sizingBox(renderer).width(), style.get());
return CSSPrimitiveValue::create(style->width());
case CSSPropertyWordBreak:
return CSSPrimitiveValue::create(style->wordBreak());
case CSSPropertyWordSpacing:
- return CSSPrimitiveValue::create(style->wordSpacing(), CSSPrimitiveValue::CSS_PX);
+ return zoomAdjustedPixelValue(style->wordSpacing(), style.get());
case CSSPropertyWordWrap:
return CSSPrimitiveValue::create(style->wordWrap());
case CSSPropertyWebkitLineBreak:
@@ -1287,10 +1306,10 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
region->m_label = styleRegion.label;
LengthBox offset = styleRegion.offset;
- region->setTop(CSSPrimitiveValue::create(offset.top().value(), CSSPrimitiveValue::CSS_PX));
- region->setRight(CSSPrimitiveValue::create(offset.right().value(), CSSPrimitiveValue::CSS_PX));
- region->setBottom(CSSPrimitiveValue::create(offset.bottom().value(), CSSPrimitiveValue::CSS_PX));
- region->setLeft(CSSPrimitiveValue::create(offset.left().value(), CSSPrimitiveValue::CSS_PX));
+ region->setTop(zoomAdjustedPixelValue(offset.top().value(), style.get()));
+ region->setRight(zoomAdjustedPixelValue(offset.right().value(), style.get()));
+ region->setBottom(zoomAdjustedPixelValue(offset.bottom().value(), style.get()));
+ region->setLeft(zoomAdjustedPixelValue(offset.left().value(), style.get()));
region->m_isRectangle = (styleRegion.type == StyleDashboardRegion::Rectangle);
region->m_isCircle = (styleRegion.type == StyleDashboardRegion::Circle);
@@ -1392,6 +1411,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return CSSPrimitiveValue::create(style->appearance());
case CSSPropertyWebkitBackfaceVisibility:
return CSSPrimitiveValue::createIdentifier((style->backfaceVisibility() == BackfaceVisibilityHidden) ? CSSValueHidden : CSSValueVisible);
+ case CSSPropertyWebkitBlockFlow:
+ return CSSPrimitiveValue::create(style->blockFlow());
case CSSPropertyWebkitBorderImage:
return valueForNinePieceImage(style->borderImage());
case CSSPropertyWebkitMaskBoxImage:
@@ -1411,8 +1432,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
if (renderer) {
IntRect box = sizingBox(renderer);
- list->append(CSSPrimitiveValue::create(style->perspectiveOriginX().calcMinValue(box.width()), CSSPrimitiveValue::CSS_PX));
- list->append(CSSPrimitiveValue::create(style->perspectiveOriginY().calcMinValue(box.height()), CSSPrimitiveValue::CSS_PX));
+ list->append(zoomAdjustedPixelValue(style->perspectiveOriginX().calcMinValue(box.width()), style.get()));
+ list->append(zoomAdjustedPixelValue(style->perspectiveOriginY().calcMinValue(box.height()), style.get()));
}
else {
list->append(CSSPrimitiveValue::create(style->perspectiveOriginX()));
@@ -1429,21 +1450,21 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyWebkitUserSelect:
return CSSPrimitiveValue::create(style->userSelect());
case CSSPropertyBorderBottomLeftRadius:
- return getBorderRadiusCornerValue(style->borderBottomLeftRadius());
+ return getBorderRadiusCornerValue(style->borderBottomLeftRadius(), style.get());
case CSSPropertyBorderBottomRightRadius:
- return getBorderRadiusCornerValue(style->borderBottomRightRadius());
+ return getBorderRadiusCornerValue(style->borderBottomRightRadius(), style.get());
case CSSPropertyBorderTopLeftRadius:
- return getBorderRadiusCornerValue(style->borderTopLeftRadius());
+ return getBorderRadiusCornerValue(style->borderTopLeftRadius(), style.get());
case CSSPropertyBorderTopRightRadius:
- return getBorderRadiusCornerValue(style->borderTopRightRadius());
+ return getBorderRadiusCornerValue(style->borderTopRightRadius(), style.get());
case CSSPropertyClip: {
if (!style->hasClip())
return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
RefPtr<Rect> rect = Rect::create();
- rect->setTop(CSSPrimitiveValue::create(style->clip().top().value(), CSSPrimitiveValue::CSS_PX));
- rect->setRight(CSSPrimitiveValue::create(style->clip().right().value(), CSSPrimitiveValue::CSS_PX));
- rect->setBottom(CSSPrimitiveValue::create(style->clip().bottom().value(), CSSPrimitiveValue::CSS_PX));
- rect->setLeft(CSSPrimitiveValue::create(style->clip().left().value(), CSSPrimitiveValue::CSS_PX));
+ rect->setTop(zoomAdjustedPixelValue(style->clip().top().value(), style.get()));
+ rect->setRight(zoomAdjustedPixelValue(style->clip().right().value(), style.get()));
+ rect->setBottom(zoomAdjustedPixelValue(style->clip().bottom().value(), style.get()));
+ rect->setLeft(zoomAdjustedPixelValue(style->clip().left().value(), style.get()));
return CSSPrimitiveValue::create(rect.release());
}
case CSSPropertyWebkitTransform:
@@ -1452,15 +1473,15 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
if (renderer) {
IntRect box = sizingBox(renderer);
- list->append(CSSPrimitiveValue::create(style->transformOriginX().calcMinValue(box.width()), CSSPrimitiveValue::CSS_PX));
- list->append(CSSPrimitiveValue::create(style->transformOriginY().calcMinValue(box.height()), CSSPrimitiveValue::CSS_PX));
+ list->append(zoomAdjustedPixelValue(style->transformOriginX().calcMinValue(box.width()), style.get()));
+ list->append(zoomAdjustedPixelValue(style->transformOriginY().calcMinValue(box.height()), style.get()));
if (style->transformOriginZ() != 0)
- list->append(CSSPrimitiveValue::create(style->transformOriginZ(), CSSPrimitiveValue::CSS_PX));
+ list->append(zoomAdjustedPixelValue(style->transformOriginZ(), style.get()));
} else {
list->append(CSSPrimitiveValue::create(style->transformOriginX()));
list->append(CSSPrimitiveValue::create(style->transformOriginY()));
if (style->transformOriginZ() != 0)
- list->append(CSSPrimitiveValue::create(style->transformOriginZ(), CSSPrimitiveValue::CSS_PX));
+ list->append(zoomAdjustedPixelValue(style->transformOriginZ(), style.get()));
}
return list.release();
}
@@ -1511,6 +1532,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyListStyle:
case CSSPropertyMargin:
case CSSPropertyPadding:
+ case CSSPropertyWebkitWritingMode:
break;
/* Unimplemented CSS 3 properties (including CSS3 shorthand properties) */
@@ -1540,10 +1562,28 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyWebkitBorderStartColor:
case CSSPropertyWebkitBorderStartStyle:
case CSSPropertyWebkitBorderStartWidth:
+ case CSSPropertyWebkitBorderAfter:
+ case CSSPropertyWebkitBorderAfterColor:
+ case CSSPropertyWebkitBorderAfterStyle:
+ case CSSPropertyWebkitBorderAfterWidth:
+ case CSSPropertyWebkitBorderBefore:
+ case CSSPropertyWebkitBorderBeforeColor:
+ case CSSPropertyWebkitBorderBeforeStyle:
+ case CSSPropertyWebkitBorderBeforeWidth:
case CSSPropertyWebkitMarginEnd:
case CSSPropertyWebkitMarginStart:
+ case CSSPropertyWebkitMarginAfter:
+ case CSSPropertyWebkitMarginBefore:
case CSSPropertyWebkitPaddingEnd:
case CSSPropertyWebkitPaddingStart:
+ case CSSPropertyWebkitPaddingAfter:
+ case CSSPropertyWebkitPaddingBefore:
+ case CSSPropertyWebkitLogicalWidth:
+ case CSSPropertyWebkitLogicalHeight:
+ case CSSPropertyWebkitMinLogicalWidth:
+ case CSSPropertyWebkitMinLogicalHeight:
+ case CSSPropertyWebkitMaxLogicalWidth:
+ case CSSPropertyWebkitMaxLogicalHeight:
ASSERT_NOT_REACHED();
break;
diff --git a/WebCore/css/CSSComputedStyleDeclaration.h b/WebCore/css/CSSComputedStyleDeclaration.h
index d4b7df2..718eb2d 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.h
+++ b/WebCore/css/CSSComputedStyleDeclaration.h
@@ -74,7 +74,7 @@ private:
virtual String removeProperty(int propertyID, ExceptionCode&);
virtual void setProperty(int propertyId, const String& value, bool important, ExceptionCode&);
- PassRefPtr<CSSValue> valueForShadow(const ShadowData*, int) const;
+ PassRefPtr<CSSValue> valueForShadow(const ShadowData*, int, RenderStyle*) const;
PassRefPtr<CSSPrimitiveValue> currentColorOrValidColor(RenderStyle*, const Color&) const;
RefPtr<Node> m_node;
diff --git a/WebCore/css/CSSGrammar.y b/WebCore/css/CSSGrammar.y
index 86a2f7c..c55f998 100644
--- a/WebCore/css/CSSGrammar.y
+++ b/WebCore/css/CSSGrammar.y
@@ -314,7 +314,7 @@ webkit_keyframe_rule:
;
webkit_decls:
- WEBKIT_DECLS_SYM '{' maybe_space declaration_list '}' {
+ WEBKIT_DECLS_SYM '{' maybe_space_before_declaration declaration_list '}' {
/* can be empty */
}
;
@@ -903,8 +903,15 @@ unary_operator:
| '+' { $$ = 1; }
;
+maybe_space_before_declaration:
+ maybe_space {
+ CSSParser* p = static_cast<CSSParser*>(parser);
+ p->markPropertyStart();
+ }
+ ;
+
ruleset:
- selector_list '{' maybe_space declaration_list closing_brace {
+ selector_list '{' maybe_space_before_declaration declaration_list closing_brace {
CSSParser* p = static_cast<CSSParser*>(parser);
$$ = p->createStyleRule($1);
}
@@ -1355,6 +1362,8 @@ declaration_list:
decl_list:
declaration ';' maybe_space {
+ CSSParser* p = static_cast<CSSParser*>(parser);
+ p->markPropertyStart();
$$ = $1;
}
| declaration invalid_block_list maybe_space {
@@ -1364,12 +1373,16 @@ decl_list:
$$ = false;
}
| error ';' maybe_space {
+ CSSParser* p = static_cast<CSSParser*>(parser);
+ p->markPropertyStart();
$$ = false;
}
| error invalid_block_list error ';' maybe_space {
$$ = false;
}
| decl_list declaration ';' maybe_space {
+ CSSParser* p = static_cast<CSSParser*>(parser);
+ p->markPropertyStart();
$$ = $1;
if ($2)
$$ = $2;
@@ -1386,15 +1399,21 @@ declaration:
property ':' maybe_space expr prio {
$$ = false;
CSSParser* p = static_cast<CSSParser*>(parser);
+ bool isPropertyParsed = false;
if ($1 && $4) {
p->m_valueList = p->sinkFloatingValueList($4);
int oldParsedProperties = p->m_numParsedProperties;
$$ = p->parseValue($1, $5);
- if (!$$)
+ if (!$$) {
+ if (static_cast<int>(p->m_numParsedProperties) == oldParsedProperties)
+ isPropertyParsed = true;
p->rollbackLastProperties(p->m_numParsedProperties - oldParsedProperties);
+ } else
+ isPropertyParsed = true;
delete p->m_valueList;
p->m_valueList = 0;
}
+ p->markPropertyEnd($5, isPropertyParsed);
}
|
variable_reference maybe_space {
@@ -1417,11 +1436,15 @@ declaration:
/* The default movable type template has letter-spacing: .none; Handle this by looking for
error tokens at the start of an expr, recover the expr and then treat as an error, cleaning
up and deleting the shifted expr. */
+ CSSParser* p = static_cast<CSSParser*>(parser);
+ p->markPropertyEnd(false, false);
$$ = false;
}
|
property ':' maybe_space expr prio error {
/* When we encounter something like p {color: red !important fail;} we should drop the declaration */
+ CSSParser* p = static_cast<CSSParser*>(parser);
+ p->markPropertyEnd(false, false);
$$ = false;
}
|
@@ -1432,11 +1455,15 @@ declaration:
|
property ':' maybe_space {
/* div { font-family: } Just reduce away this property with no value. */
+ CSSParser* p = static_cast<CSSParser*>(parser);
+ p->markPropertyEnd(false, false);
$$ = false;
}
|
property ':' maybe_space error {
/* if we come across rules with invalid values like this case: p { weight: *; }, just discard the rule */
+ CSSParser* p = static_cast<CSSParser*>(parser);
+ p->markPropertyEnd(false, false);
$$ = false;
}
|
diff --git a/WebCore/css/CSSHelper.h b/WebCore/css/CSSHelper.h
index 331815e..ffd9166 100644
--- a/WebCore/css/CSSHelper.h
+++ b/WebCore/css/CSSHelper.h
@@ -26,17 +26,14 @@
namespace WebCore {
- // Used in many inappropriate contexts throughout WebCore. We'll have to examine and test
- // each call site to find out whether it needs the various things this function does. That
- // includes trimming leading and trailing control characters (including whitespace), removing
- // url() or URL() if it surrounds the entire string, removing matching quote marks if present,
- // and stripping all characters in the range U+0000-U+000C. Probably no caller needs this.
- String deprecatedParseURL(const String&);
+// Used in many inappropriate contexts throughout WebCore. Most callers should be using
+// stripLeadingAndTrailingHTMLSpaces instead.
+String deprecatedParseURL(const String&);
- // We always assume 96 CSS pixels in a CSS inch. This is the cold hard truth of the Web.
- // At high DPI, we may scale a CSS pixel, but the ratio of the CSS pixel to the so-called
- // "absolute" CSS length units like inch and pt is always fixed and never changes.
- const float cssPixelsPerInch = 96;
+// We always assume 96 CSS pixels in a CSS inch. This is the cold hard truth of the Web.
+// At high DPI, we may scale a CSS pixel, but the ratio of the CSS pixel to the so-called
+// "absolute" CSS length units like inch and pt is always fixed and never changes.
+const float cssPixelsPerInch = 96;
} // namespace WebCore
diff --git a/WebCore/css/CSSMutableStyleDeclaration.h b/WebCore/css/CSSMutableStyleDeclaration.h
index f7759f4..d629bcf 100644
--- a/WebCore/css/CSSMutableStyleDeclaration.h
+++ b/WebCore/css/CSSMutableStyleDeclaration.h
@@ -83,6 +83,8 @@ public:
void setNode(Node* node) { m_node = node; }
+ Node* node() const { return m_node; }
+
virtual bool isMutableStyleDeclaration() const { return true; }
virtual String cssText() const;
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index 8398bd0..d4fb713 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -44,6 +44,7 @@
#include "CSSPrimitiveValue.h"
#include "CSSProperty.h"
#include "CSSPropertyNames.h"
+#include "CSSPropertySourceData.h"
#include "CSSQuirkPrimitiveValue.h"
#include "CSSReflectValue.h"
#include "CSSRuleList.h"
@@ -151,7 +152,10 @@ CSSParser::CSSParser(bool strictParsing)
, m_defaultNamespace(starAtom)
, m_ruleBodyStartOffset(0)
, m_ruleBodyEndOffset(0)
- , m_ruleRanges(0)
+ , m_propertyStartOffset(UINT_MAX)
+ , m_propertyEndOffset(UINT_MAX)
+ , m_ruleRangeMap(0)
+ , m_currentStyleData(0)
, m_data(0)
, yy_start(1)
, m_lineNumber(0)
@@ -163,6 +167,7 @@ CSSParser::CSSParser(bool strictParsing)
#if YYDEBUG > 0
cssyydebug = 1;
#endif
+ CSSPropertySourceData::init();
}
CSSParser::~CSSParser()
@@ -225,19 +230,22 @@ void CSSParser::setupParser(const char* prefix, const String& string, const char
resetRuleBodyMarks();
}
-void CSSParser::parseSheet(CSSStyleSheet* sheet, const String& string, int startLineNumber, StyleRuleRanges* ruleRangeMap)
+void CSSParser::parseSheet(CSSStyleSheet* sheet, const String& string, int startLineNumber, StyleRuleRangeMap* ruleRangeMap)
{
#ifdef ANDROID_INSTRUMENT
android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter);
#endif
m_styleSheet = sheet;
m_defaultNamespace = starAtom; // Reset the default namespace.
- m_ruleRanges = ruleRangeMap;
+ m_ruleRangeMap = ruleRangeMap;
+ if (ruleRangeMap)
+ m_currentStyleData = CSSStyleSourceData::create();
m_lineNumber = startLineNumber;
setupParser("", string, "");
cssyyparse(this);
- m_ruleRanges = 0;
+ m_ruleRangeMap = 0;
+ m_currentStyleData = 0;
m_rule = 0;
#ifdef ANDROID_INSTRUMENT
android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__);
@@ -367,13 +375,20 @@ void CSSParser::parseSelector(const String& string, Document* doc, CSSSelectorLi
#endif
}
-bool CSSParser::parseDeclaration(CSSMutableStyleDeclaration* declaration, const String& string)
+bool CSSParser::parseDeclaration(CSSMutableStyleDeclaration* declaration, const String& string, CSSStyleSourceData* styleSourceData)
{
+<<<<<<< HEAD
#ifdef ANDROID_INSTRUMENT
android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter);
#endif
+=======
+ // Length of the "@-webkit-decls{" prefix.
+ static const unsigned prefixLength = 15;
+
+>>>>>>> webkit.org at r67908
ASSERT(!declaration->stylesheet() || declaration->stylesheet()->isCSSStyleSheet());
m_styleSheet = static_cast<CSSStyleSheet*>(declaration->stylesheet());
+ m_currentStyleData = styleSourceData;
setupParser("@-webkit-decls{", string, "} ");
cssyyparse(this);
@@ -388,9 +403,23 @@ bool CSSParser::parseDeclaration(CSSMutableStyleDeclaration* declaration, const
clearProperties();
}
+<<<<<<< HEAD
#ifdef ANDROID_INSTRUMENT
android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__);
#endif
+=======
+ if (m_currentStyleData) {
+ m_currentStyleData->styleBodyRange.start = 0;
+ m_currentStyleData->styleBodyRange.end = string.length();
+ for (Vector<CSSPropertySourceData>::iterator it = m_currentStyleData->propertyData.begin(); it != m_currentStyleData->propertyData.end(); ++it) {
+ (*it).range.start -= prefixLength;
+ (*it).range.end -= prefixLength;
+ }
+ }
+
+ if (!m_ruleRangeMap)
+ m_currentStyleData = 0;
+>>>>>>> webkit.org at r67908
return ok;
}
@@ -805,6 +834,8 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyBorderLeftStyle:
case CSSPropertyWebkitBorderStartStyle:
case CSSPropertyWebkitBorderEndStyle:
+ case CSSPropertyWebkitBorderBeforeStyle:
+ case CSSPropertyWebkitBorderAfterStyle:
case CSSPropertyWebkitColumnRuleStyle:
if (id >= CSSValueNone && id <= CSSValueDouble)
validPrimitive = true;
@@ -851,6 +882,8 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyBorderLeftColor:
case CSSPropertyWebkitBorderStartColor:
case CSSPropertyWebkitBorderEndColor:
+ case CSSPropertyWebkitBorderBeforeColor:
+ case CSSPropertyWebkitBorderAfterColor:
case CSSPropertyColor: // <color> | inherit
case CSSPropertyTextLineThroughColor: // CSS3 text decoration colors
case CSSPropertyTextUnderlineColor:
@@ -1002,6 +1035,8 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyBorderLeftWidth:
case CSSPropertyWebkitBorderStartWidth:
case CSSPropertyWebkitBorderEndWidth:
+ case CSSPropertyWebkitBorderBeforeWidth:
+ case CSSPropertyWebkitBorderAfterWidth:
case CSSPropertyWebkitColumnRuleWidth:
if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick)
validPrimitive = true;
@@ -1037,11 +1072,15 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyPaddingLeft: ////
case CSSPropertyWebkitPaddingStart:
case CSSPropertyWebkitPaddingEnd:
+ case CSSPropertyWebkitPaddingBefore:
+ case CSSPropertyWebkitPaddingAfter:
validPrimitive = (!id && validUnit(value, FLength | FPercent | FNonNeg, m_strict));
break;
case CSSPropertyMaxHeight: // <length> | <percentage> | none | inherit
case CSSPropertyMaxWidth: // <length> | <percentage> | none | inherit
+ case CSSPropertyWebkitMaxLogicalWidth:
+ case CSSPropertyWebkitMaxLogicalHeight:
if (id == CSSValueNone || id == CSSValueIntrinsic || id == CSSValueMinIntrinsic) {
validPrimitive = true;
break;
@@ -1049,6 +1088,8 @@ bool CSSParser::parseValue(int propId, bool important)
/* nobreak */
case CSSPropertyMinHeight: // <length> | <percentage> | inherit
case CSSPropertyMinWidth: // <length> | <percentage> | inherit
+ case CSSPropertyWebkitMinLogicalWidth:
+ case CSSPropertyWebkitMinLogicalHeight:
if (id == CSSValueIntrinsic || id == CSSValueMinIntrinsic)
validPrimitive = true;
else
@@ -1081,6 +1122,8 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyHeight: // <length> | <percentage> | auto | inherit
case CSSPropertyWidth: // <length> | <percentage> | auto | inherit
+ case CSSPropertyWebkitLogicalWidth:
+ case CSSPropertyWebkitLogicalHeight:
if (id == CSSValueAuto || id == CSSValueIntrinsic || id == CSSValueMinIntrinsic)
validPrimitive = true;
else
@@ -1098,6 +1141,8 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyMarginLeft: ////
case CSSPropertyWebkitMarginStart:
case CSSPropertyWebkitMarginEnd:
+ case CSSPropertyWebkitMarginBefore:
+ case CSSPropertyWebkitMarginAfter:
if (id == CSSValueAuto)
validPrimitive = true;
else
@@ -1667,19 +1712,29 @@ bool CSSParser::parseValue(int propId, bool important)
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 CSSPropertyWebkitBorderBefore:
+ {
+ const int properties[3] = { CSSPropertyWebkitBorderBeforeWidth, CSSPropertyWebkitBorderBeforeStyle,
+ CSSPropertyWebkitBorderBeforeColor };
+ return parseShorthand(propId, properties, 3, important);
+ }
+ case CSSPropertyWebkitBorderAfter:
+ {
+ const int properties[3] = { CSSPropertyWebkitBorderAfterWidth, CSSPropertyWebkitBorderAfterStyle,
+ CSSPropertyWebkitBorderAfterColor };
+ return parseShorthand(propId, properties, 3, important);
+ }
case CSSPropertyOutline:
// [ 'outline-color' || 'outline-style' || 'outline-width' ] | inherit
{
@@ -1773,6 +1828,7 @@ bool CSSParser::parseValue(int propId, bool important)
break;
#endif
+<<<<<<< HEAD
#ifdef ANDROID_CSS_RING
case CSSPropertyWebkitRing:
{
@@ -1810,6 +1866,20 @@ bool CSSParser::parseValue(int propId, bool important)
m_valueList->next();
break;
#endif
+=======
+ // CSS Text Layout Module Level 3: Vertical writing support
+ case CSSPropertyWebkitBlockFlow:
+ // [ "tb" | "rl" | "lr" | "bt" ]
+ if (id == CSSValueTb || id == CSSValueRl || id == CSSValueLr || id == CSSValueBt)
+ validPrimitive = true;
+ break;
+
+ case CSSPropertyWebkitWritingMode:
+ // [ "lr-tb" | "rl-tb" | "tb-rl" | "bt-rl" | "tb-lr" | "bt-lr" ]
+ if (id == CSSValueLrTb || id == CSSValueRlTb || id == CSSValueTbRl || id == CSSValueBtRl || id == CSSValueTbLr || id == CSSValueBtLr)
+ validPrimitive = true;
+ break;
+>>>>>>> webkit.org at r67908
#if ENABLE(SVG)
default:
@@ -5507,8 +5577,12 @@ CSSRule* CSSParser::createStyleRule(Vector<CSSSelector*>* selectors)
rule->setDeclaration(CSSMutableStyleDeclaration::create(rule.get(), m_parsedProperties, m_numParsedProperties));
result = rule.get();
m_parsedStyleObjects.append(rule.release());
- if (m_ruleRanges)
- m_ruleRanges->set(result, std::pair<unsigned, unsigned>(m_ruleBodyStartOffset, m_ruleBodyEndOffset));
+ if (m_ruleRangeMap) {
+ ASSERT(m_currentStyleData);
+ m_currentStyleData->styleBodyRange = SourceRange(m_ruleBodyStartOffset, m_ruleBodyEndOffset);
+ m_ruleRangeMap->set(result, m_currentStyleData.release());
+ m_currentStyleData = CSSStyleSourceData::create();
+ }
}
resetRuleBodyMarks();
clearProperties();
@@ -5767,7 +5841,9 @@ void CSSParser::updateLastSelectorLineAndPosition()
void CSSParser::markRuleBodyStart()
{
unsigned offset = yytext - m_data;
- if (!m_ruleBodyStartOffset || offset < m_ruleBodyStartOffset)
+ if (*yytext == '{')
+ ++offset; // Skip the rule body opening brace.
+ if (offset > m_ruleBodyStartOffset)
m_ruleBodyStartOffset = offset;
}
@@ -5778,6 +5854,39 @@ void CSSParser::markRuleBodyEnd()
m_ruleBodyEndOffset = offset;
}
+void CSSParser::markPropertyStart()
+{
+ unsigned offset = yytext - m_data;
+ m_propertyStartOffset = offset;
+}
+
+void CSSParser::markPropertyEnd(bool isImportantFound, bool isPropertyParsed)
+{
+ unsigned offset = yytext - m_data;
+ if (*yytext == ';') // Include semicolon into the property text.
+ ++offset;
+ m_propertyEndOffset = offset;
+ if (m_propertyStartOffset != UINT_MAX && m_currentStyleData) {
+ // This stuff is only executed when the style data retrieval is requested by client.
+ const unsigned start = m_propertyStartOffset;
+ const unsigned end = m_propertyEndOffset;
+ ASSERT(start < end);
+ String propertyString = String(m_data + start, end - start).stripWhiteSpace();
+ if (propertyString.endsWith(";", true))
+ propertyString = propertyString.left(propertyString.length() - 1);
+ Vector<String> propertyComponents;
+ size_t colonIndex = propertyString.find(":");
+ ASSERT(colonIndex != notFound);
+
+ String name = propertyString.left(colonIndex).stripWhiteSpace();
+ String value = propertyString.substring(colonIndex + 1, propertyString.length()).stripWhiteSpace();
+ // The property range is relative to the declaration start offset.
+ m_currentStyleData->propertyData.append(
+ CSSPropertySourceData(name, value, isImportantFound, isPropertyParsed, SourceRange(m_propertyStartOffset - m_ruleBodyStartOffset, m_propertyEndOffset - m_ruleBodyStartOffset)));
+ }
+ resetPropertyMarks();
+}
+
static int cssPropertyID(const UChar* propertyName, unsigned length)
{
if (!length)
diff --git a/WebCore/css/CSSParser.h b/WebCore/css/CSSParser.h
index 47f0bed..f8b24df 100644
--- a/WebCore/css/CSSParser.h
+++ b/WebCore/css/CSSParser.h
@@ -25,6 +25,7 @@
#include "Color.h"
#include "CSSParserValues.h"
+#include "CSSPropertySourceData.h"
#include "CSSSelectorList.h"
#include "MediaQuery.h"
#include <wtf/HashMap.h>
@@ -55,18 +56,16 @@ namespace WebCore {
class CSSParser {
public:
- typedef HashMap<CSSStyleRule*, std::pair<unsigned, unsigned> > StyleRuleRanges;
-
CSSParser(bool strictParsing = true);
~CSSParser();
- void parseSheet(CSSStyleSheet*, const String&, int startLineNumber = 0, StyleRuleRanges* ruleRangeMap = 0);
+ void parseSheet(CSSStyleSheet*, const String&, int startLineNumber = 0, StyleRuleRangeMap* ruleRangeMap = 0);
PassRefPtr<CSSRule> parseRule(CSSStyleSheet*, const String&);
PassRefPtr<CSSRule> parseKeyframeRule(CSSStyleSheet*, const String&);
bool parseValue(CSSMutableStyleDeclaration*, int propId, const String&, bool important);
static bool parseColor(RGBA32& color, const String&, bool strict = false);
bool parseColor(CSSMutableStyleDeclaration*, const String&);
- bool parseDeclaration(CSSMutableStyleDeclaration*, const String&);
+ bool parseDeclaration(CSSMutableStyleDeclaration*, const String&, CSSStyleSourceData* styleSourceData = 0);
bool parseMediaQuery(MediaList*, const String&);
Document* document() const;
@@ -244,10 +243,16 @@ namespace WebCore {
// tokenizer methods and data
unsigned m_ruleBodyStartOffset;
unsigned m_ruleBodyEndOffset;
- StyleRuleRanges* m_ruleRanges;
+ unsigned m_propertyStartOffset;
+ unsigned m_propertyEndOffset;
+ StyleRuleRangeMap* m_ruleRangeMap;
+ RefPtr<CSSStyleSourceData> m_currentStyleData;
void markRuleBodyStart();
void markRuleBodyEnd();
+ void markPropertyStart();
+ void markPropertyEnd(bool isImportantFound, bool isPropertyParsed);
void resetRuleBodyMarks() { m_ruleBodyStartOffset = m_ruleBodyEndOffset = 0; }
+ void resetPropertyMarks() { m_propertyStartOffset = m_propertyEndOffset = UINT_MAX; }
int lex(void* yylval);
int token() { return yyTok; }
UChar* text(int* length);
diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h
index 3da5cf6..a452733 100644
--- a/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/WebCore/css/CSSPrimitiveValueMappings.h
@@ -2003,6 +2003,43 @@ template<> inline CSSPrimitiveValue::operator TextDirection() const
}
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBlockFlowDirection e)
+ : m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
+{
+ switch (e) {
+ case TopToBottomBlockFlow:
+ m_value.ident = CSSValueTb;
+ break;
+ case RightToLeftBlockFlow:
+ m_value.ident = CSSValueRl;
+ break;
+ case LeftToRightBlockFlow:
+ m_value.ident = CSSValueLr;
+ break;
+ case BottomToTopBlockFlow:
+ m_value.ident = CSSValueBt;
+ break;
+ }
+}
+
+template<> inline CSSPrimitiveValue::operator EBlockFlowDirection() const
+{
+ switch (m_value.ident) {
+ case CSSValueTb:
+ return TopToBottomBlockFlow;
+ case CSSValueRl:
+ return RightToLeftBlockFlow;
+ case CSSValueLr:
+ return LeftToRightBlockFlow;
+ case CSSValueBt:
+ return BottomToTopBlockFlow;
+ default:
+ ASSERT_NOT_REACHED();
+ return TopToBottomBlockFlow;
+ }
+}
+
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPointerEvents e)
: m_type(CSS_IDENT)
, m_hasCachedCSSText(false)
@@ -2647,7 +2684,23 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWritingMode e)
template<> inline CSSPrimitiveValue::operator EWritingMode() const
{
- return static_cast<EWritingMode>(m_value.ident - CSSValueLrTb);
+ switch (m_value.ident) {
+ case CSSValueLrTb:
+ return WM_LRTB;
+ case CSSValueLr:
+ return WM_LR;
+ case CSSValueRlTb:
+ return WM_RLTB;
+ case CSSValueRl:
+ return WM_RL;
+ case CSSValueTbRl:
+ return WM_TBRL;
+ case CSSValueTb:
+ return WM_TB;
+ default:
+ ASSERT_NOT_REACHED();
+ return WM_LRTB;
+ }
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVectorEffect e)
diff --git a/WebCore/css/CSSProperty.cpp b/WebCore/css/CSSProperty.cpp
index 453b381..7779aad 100644
--- a/WebCore/css/CSSProperty.cpp
+++ b/WebCore/css/CSSProperty.cpp
@@ -23,6 +23,7 @@
#include "CSSPropertyNames.h"
#include "PlatformString.h"
+#include "RenderStyleConstants.h"
namespace WebCore {
@@ -38,37 +39,246 @@ bool operator==(const CSSProperty& a, const CSSProperty& b)
return a.m_id == b.m_id && a.m_important == b.m_important && a.m_value == b.m_value;
}
-int CSSProperty::resolveDirectionAwareProperty(int propertyID, TextDirection direction)
-{
- switch (static_cast<CSSPropertyID>(propertyID)) {
- case CSSPropertyWebkitMarginEnd:
- return direction == LTR ? CSSPropertyMarginRight : CSSPropertyMarginLeft;
- case CSSPropertyWebkitMarginStart:
- return direction == LTR ? CSSPropertyMarginLeft : CSSPropertyMarginRight;
+enum LogicalBoxSide { BeforeSide, EndSide, AfterSide, StartSide };
+enum PhysicalBoxSide { TopSide, RightSide, BottomSide, LeftSide };
- case CSSPropertyWebkitPaddingEnd:
- return direction == LTR ? CSSPropertyPaddingRight : CSSPropertyPaddingLeft;
- case CSSPropertyWebkitPaddingStart:
- return direction == LTR ? CSSPropertyPaddingLeft : CSSPropertyPaddingRight;
+static int resolveToPhysicalProperty(TextDirection direction, EBlockFlowDirection blockDirection, LogicalBoxSide logicalSide, const int* properties)
+{
+ if (direction == LTR) {
+ if (blockDirection == TopToBottomBlockFlow) {
+ // The common case. The logical and physical box sides match.
+ // Left = Start, Right = End, Before = Top, After = Bottom
+ return properties[logicalSide];
+ }
+
+ if (blockDirection == BottomToTopBlockFlow) {
+ // Start = Left, End = Right, Before = Bottom, After = Top.
+ switch (logicalSide) {
+ case StartSide:
+ return properties[LeftSide];
+ case EndSide:
+ return properties[RightSide];
+ case BeforeSide:
+ return properties[BottomSide];
+ default:
+ return properties[TopSide];
+ }
+ }
+
+ if (blockDirection == LeftToRightBlockFlow) {
+ // Start = Top, End = Bottom, Before = Left, After = Right.
+ switch (logicalSide) {
+ case StartSide:
+ return properties[TopSide];
+ case EndSide:
+ return properties[BottomSide];
+ case BeforeSide:
+ return properties[LeftSide];
+ default:
+ return properties[RightSide];
+ }
+ }
+
+ // Start = Top, End = Bottom, Before = Right, After = Left
+ switch (logicalSide) {
+ case StartSide:
+ return properties[TopSide];
+ case EndSide:
+ return properties[BottomSide];
+ case BeforeSide:
+ return properties[RightSide];
+ default:
+ return properties[LeftSide];
+ }
+ }
- 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;
+ if (blockDirection == TopToBottomBlockFlow) {
+ // Start = Right, End = Left, Before = Top, After = Bottom
+ switch (logicalSide) {
+ case StartSide:
+ return properties[RightSide];
+ case EndSide:
+ return properties[LeftSide];
+ case BeforeSide:
+ return properties[TopSide];
+ default:
+ return properties[BottomSide];
+ }
+ }
+
+ if (blockDirection == BottomToTopBlockFlow) {
+ // Start = Right, End = Left, Before = Bottom, After = Top
+ switch (logicalSide) {
+ case StartSide:
+ return properties[RightSide];
+ case EndSide:
+ return properties[LeftSide];
+ case BeforeSide:
+ return properties[BottomSide];
+ default:
+ return properties[TopSide];
+ }
+ }
+
+ if (blockDirection == LeftToRightBlockFlow) {
+ // Start = Bottom, End = Top, Before = Left, After = Right
+ switch (logicalSide) {
+ case StartSide:
+ return properties[BottomSide];
+ case EndSide:
+ return properties[TopSide];
+ case BeforeSide:
+ return properties[LeftSide];
+ default:
+ return properties[RightSide];
+ }
+ }
+
+ // Start = Bottom, End = Top, Before = Right, After = Left
+ switch (logicalSide) {
+ case StartSide:
+ return properties[BottomSide];
+ case EndSide:
+ return properties[TopSide];
+ case BeforeSide:
+ return properties[RightSide];
+ default:
+ return properties[LeftSide];
+ }
+}
- 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;
+enum LogicalExtent { LogicalWidth, LogicalHeight };
+static int resolveToPhysicalProperty(EBlockFlowDirection blockDirection, LogicalExtent logicalSide, const int* properties)
+{
+ if (blockDirection == TopToBottomBlockFlow || blockDirection == BottomToTopBlockFlow)
+ return properties[logicalSide];
+ return logicalSide == LogicalWidth ? properties[1] : properties[0];
+}
+
+int CSSProperty::resolveDirectionAwareProperty(int propertyID, TextDirection direction, EBlockFlowDirection blockDirection)
+{
+ switch (static_cast<CSSPropertyID>(propertyID)) {
+ case CSSPropertyWebkitMarginEnd: {
+ const int properties[4] = { CSSPropertyMarginTop, CSSPropertyMarginRight, CSSPropertyMarginBottom, CSSPropertyMarginLeft };
+ return resolveToPhysicalProperty(direction, blockDirection, EndSide, properties);
+ }
+ case CSSPropertyWebkitMarginStart: {
+ const int properties[4] = { CSSPropertyMarginTop, CSSPropertyMarginRight, CSSPropertyMarginBottom, CSSPropertyMarginLeft };
+ return resolveToPhysicalProperty(direction, blockDirection, StartSide, properties);
+ }
+ case CSSPropertyWebkitMarginBefore: {
+ const int properties[4] = { CSSPropertyMarginTop, CSSPropertyMarginRight, CSSPropertyMarginBottom, CSSPropertyMarginLeft };
+ return resolveToPhysicalProperty(direction, blockDirection, BeforeSide, properties);
+ }
+ case CSSPropertyWebkitMarginAfter: {
+ const int properties[4] = { CSSPropertyMarginTop, CSSPropertyMarginRight, CSSPropertyMarginBottom, CSSPropertyMarginLeft };
+ return resolveToPhysicalProperty(direction, blockDirection, AfterSide, properties);
+ }
+ case CSSPropertyWebkitPaddingEnd: {
+ const int properties[4] = { CSSPropertyPaddingTop, CSSPropertyPaddingRight, CSSPropertyPaddingBottom, CSSPropertyPaddingLeft };
+ return resolveToPhysicalProperty(direction, blockDirection, EndSide, properties);
+ }
+ case CSSPropertyWebkitPaddingStart: {
+ const int properties[4] = { CSSPropertyPaddingTop, CSSPropertyPaddingRight, CSSPropertyPaddingBottom, CSSPropertyPaddingLeft };
+ return resolveToPhysicalProperty(direction, blockDirection, StartSide, properties);
+ }
+ case CSSPropertyWebkitPaddingBefore: {
+ const int properties[4] = { CSSPropertyPaddingTop, CSSPropertyPaddingRight, CSSPropertyPaddingBottom, CSSPropertyPaddingLeft };
+ return resolveToPhysicalProperty(direction, blockDirection, BeforeSide, properties);
+ }
+ case CSSPropertyWebkitPaddingAfter: {
+ const int properties[4] = { CSSPropertyPaddingTop, CSSPropertyPaddingRight, CSSPropertyPaddingBottom, CSSPropertyPaddingLeft };
+ return resolveToPhysicalProperty(direction, blockDirection, AfterSide, properties);
+ }
+ case CSSPropertyWebkitBorderEnd: {
+ const int properties[4] = { CSSPropertyBorderTop, CSSPropertyBorderRight, CSSPropertyBorderBottom, CSSPropertyBorderLeft };
+ return resolveToPhysicalProperty(direction, blockDirection, EndSide, properties);
+ }
+ case CSSPropertyWebkitBorderStart: {
+ const int properties[4] = { CSSPropertyBorderTop, CSSPropertyBorderRight, CSSPropertyBorderBottom, CSSPropertyBorderLeft };
+ return resolveToPhysicalProperty(direction, blockDirection, StartSide, properties);
+ }
+ case CSSPropertyWebkitBorderBefore: {
+ const int properties[4] = { CSSPropertyBorderTop, CSSPropertyBorderRight, CSSPropertyBorderBottom, CSSPropertyBorderLeft };
+ return resolveToPhysicalProperty(direction, blockDirection, BeforeSide, properties);
+ }
+ case CSSPropertyWebkitBorderAfter: {
+ const int properties[4] = { CSSPropertyBorderTop, CSSPropertyBorderRight, CSSPropertyBorderBottom, CSSPropertyBorderLeft };
+ return resolveToPhysicalProperty(direction, blockDirection, AfterSide, properties);
+ }
+ case CSSPropertyWebkitBorderEndColor: {
+ const int properties[4] = { CSSPropertyBorderTopColor, CSSPropertyBorderRightColor, CSSPropertyBorderBottomColor, CSSPropertyBorderLeftColor };
+ return resolveToPhysicalProperty(direction, blockDirection, EndSide, properties);
+ }
+ case CSSPropertyWebkitBorderStartColor: {
+ const int properties[4] = { CSSPropertyBorderTopColor, CSSPropertyBorderRightColor, CSSPropertyBorderBottomColor, CSSPropertyBorderLeftColor };
+ return resolveToPhysicalProperty(direction, blockDirection, StartSide, properties);
+ }
+ case CSSPropertyWebkitBorderBeforeColor: {
+ const int properties[4] = { CSSPropertyBorderTopColor, CSSPropertyBorderRightColor, CSSPropertyBorderBottomColor, CSSPropertyBorderLeftColor };
+ return resolveToPhysicalProperty(direction, blockDirection, BeforeSide, properties);
+ }
+ case CSSPropertyWebkitBorderAfterColor: {
+ const int properties[4] = { CSSPropertyBorderTopColor, CSSPropertyBorderRightColor, CSSPropertyBorderBottomColor, CSSPropertyBorderLeftColor };
+ return resolveToPhysicalProperty(direction, blockDirection, AfterSide, properties);
+ }
+ case CSSPropertyWebkitBorderEndStyle: {
+ const int properties[4] = { CSSPropertyBorderTopStyle, CSSPropertyBorderRightStyle, CSSPropertyBorderBottomStyle, CSSPropertyBorderLeftStyle };
+ return resolveToPhysicalProperty(direction, blockDirection, EndSide, properties);
+ }
+ case CSSPropertyWebkitBorderStartStyle: {
+ const int properties[4] = { CSSPropertyBorderTopStyle, CSSPropertyBorderRightStyle, CSSPropertyBorderBottomStyle, CSSPropertyBorderLeftStyle };
+ return resolveToPhysicalProperty(direction, blockDirection, StartSide, properties);
+ }
+ case CSSPropertyWebkitBorderBeforeStyle: {
+ const int properties[4] = { CSSPropertyBorderTopStyle, CSSPropertyBorderRightStyle, CSSPropertyBorderBottomStyle, CSSPropertyBorderLeftStyle };
+ return resolveToPhysicalProperty(direction, blockDirection, BeforeSide, properties);
+ }
+ case CSSPropertyWebkitBorderAfterStyle: {
+ const int properties[4] = { CSSPropertyBorderTopStyle, CSSPropertyBorderRightStyle, CSSPropertyBorderBottomStyle, CSSPropertyBorderLeftStyle };
+ return resolveToPhysicalProperty(direction, blockDirection, AfterSide, properties);
+ }
+ case CSSPropertyWebkitBorderEndWidth: {
+ const int properties[4] = { CSSPropertyBorderTopWidth, CSSPropertyBorderRightWidth, CSSPropertyBorderBottomWidth, CSSPropertyBorderLeftWidth };
+ return resolveToPhysicalProperty(direction, blockDirection, EndSide, properties);
+ }
+ case CSSPropertyWebkitBorderStartWidth: {
+ const int properties[4] = { CSSPropertyBorderTopWidth, CSSPropertyBorderRightWidth, CSSPropertyBorderBottomWidth, CSSPropertyBorderLeftWidth };
+ return resolveToPhysicalProperty(direction, blockDirection, StartSide, properties);
+ }
+ case CSSPropertyWebkitBorderBeforeWidth: {
+ const int properties[4] = { CSSPropertyBorderTopWidth, CSSPropertyBorderRightWidth, CSSPropertyBorderBottomWidth, CSSPropertyBorderLeftWidth };
+ return resolveToPhysicalProperty(direction, blockDirection, BeforeSide, properties);
+ }
+ case CSSPropertyWebkitBorderAfterWidth: {
+ const int properties[4] = { CSSPropertyBorderTopWidth, CSSPropertyBorderRightWidth, CSSPropertyBorderBottomWidth, CSSPropertyBorderLeftWidth };
+ return resolveToPhysicalProperty(direction, blockDirection, AfterSide, properties);
+ }
+ case CSSPropertyWebkitLogicalWidth: {
+ const int properties[2] = { CSSPropertyWidth, CSSPropertyHeight };
+ return resolveToPhysicalProperty(blockDirection, LogicalWidth, properties);
+ }
+ case CSSPropertyWebkitLogicalHeight: {
+ const int properties[2] = { CSSPropertyWidth, CSSPropertyHeight };
+ return resolveToPhysicalProperty(blockDirection, LogicalHeight, properties);
+ }
+ case CSSPropertyWebkitMinLogicalWidth: {
+ const int properties[2] = { CSSPropertyMinWidth, CSSPropertyMinHeight };
+ return resolveToPhysicalProperty(blockDirection, LogicalWidth, properties);
+ }
+ case CSSPropertyWebkitMinLogicalHeight: {
+ const int properties[2] = { CSSPropertyMinWidth, CSSPropertyMinHeight };
+ return resolveToPhysicalProperty(blockDirection, LogicalHeight, properties);
+ }
+ case CSSPropertyWebkitMaxLogicalWidth: {
+ const int properties[2] = { CSSPropertyMaxWidth, CSSPropertyMaxHeight };
+ return resolveToPhysicalProperty(blockDirection, LogicalWidth, properties);
+ }
+ case CSSPropertyWebkitMaxLogicalHeight: {
+ const int properties[2] = { CSSPropertyMaxWidth, CSSPropertyMaxHeight };
+ return resolveToPhysicalProperty(blockDirection, LogicalHeight, properties);
+ }
default:
return propertyID;
}
diff --git a/WebCore/css/CSSProperty.h b/WebCore/css/CSSProperty.h
index 7a3da68..0da6050 100644
--- a/WebCore/css/CSSProperty.h
+++ b/WebCore/css/CSSProperty.h
@@ -22,6 +22,7 @@
#define CSSProperty_h
#include "CSSValue.h"
+#include "RenderStyleConstants.h"
#include "TextDirection.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
@@ -59,7 +60,7 @@ public:
String cssText() const;
- static int resolveDirectionAwareProperty(int propertyID, TextDirection);
+ static int resolveDirectionAwareProperty(int propertyID, TextDirection, EBlockFlowDirection);
friend bool operator==(const CSSProperty&, const CSSProperty&);
diff --git a/WebCore/css/CSSPropertyNames.in b/WebCore/css/CSSPropertyNames.in
index a3063db..addecca 100644
--- a/WebCore/css/CSSPropertyNames.in
+++ b/WebCore/css/CSSPropertyNames.in
@@ -20,8 +20,10 @@ font-style
font-variant
font-weight
text-rendering
+-webkit-block-flow
-webkit-font-smoothing
-webkit-text-size-adjust
+-webkit-writing-mode
zoom
# line height needs to be right after the above high-priority properties
@@ -173,6 +175,14 @@ z-index
# a single value: -webkit-background-size: l; is equivalent to background-size: l l;
# whereas background-size: l; is equivalent to background-size: l auto;
-webkit-background-size
+-webkit-border-after
+-webkit-border-after-color
+-webkit-border-after-style
+-webkit-border-after-width
+-webkit-border-before
+-webkit-border-before-color
+-webkit-border-before-style
+-webkit-border-before-width
-webkit-border-end
-webkit-border-end-color
-webkit-border-end-style
@@ -220,8 +230,12 @@ z-index
-webkit-hyphens
-webkit-line-break
-webkit-line-clamp
+-webkit-logical-width
+-webkit-logical-height
-webkit-margin-bottom-collapse
-webkit-margin-collapse
+-webkit-margin-after
+-webkit-margin-before
-webkit-margin-end
-webkit-margin-start
-webkit-margin-top-collapse
@@ -246,7 +260,13 @@ z-index
-webkit-mask-repeat-y
-webkit-mask-size
-webkit-match-nearest-mail-blockquote-color
+-webkit-max-logical-width
+-webkit-max-logical-height
+-webkit-min-logical-width
+-webkit-min-logical-height
-webkit-nbsp-mode
+-webkit-padding-after
+-webkit-padding-before
-webkit-padding-end
-webkit-padding-start
-webkit-perspective
diff --git a/WebCore/css/CSSPropertySourceData.cpp b/WebCore/css/CSSPropertySourceData.cpp
new file mode 100644
index 0000000..1628031
--- /dev/null
+++ b/WebCore/css/CSSPropertySourceData.cpp
@@ -0,0 +1,135 @@
+/*
+ * 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"
+
+#ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC
+#define CSSPROPERTYSOURCEDATA_HIDE_GLOBALS 1
+#endif
+
+#include "CSSPropertySourceData.h"
+
+#include "PlatformString.h"
+#include <wtf/StaticConstructors.h>
+#include <wtf/text/StringHash.h>
+
+namespace WebCore {
+
+SourceRange::SourceRange()
+ : start(0)
+ , end(0)
+{
+}
+
+SourceRange::SourceRange(unsigned start, unsigned end)
+ : start(start)
+ , end(end)
+{
+}
+
+SourceRange& SourceRange::operator=(const SourceRange& other)
+{
+ this->start = other.start;
+ this->end = other.end;
+ return *this;
+}
+
+CSSPropertySourceData::CSSPropertySourceData(const String& name, const String& value, bool important, bool parsedOk, const SourceRange& range)
+ : name(name)
+ , value(value)
+ , important(important)
+ , parsedOk(parsedOk)
+ , range(range)
+{
+}
+
+CSSPropertySourceData::CSSPropertySourceData(const CSSPropertySourceData& other)
+ : name(other.name)
+ , value(other.value)
+ , important(other.important)
+ , parsedOk(other.parsedOk)
+ , range(other.range)
+{
+}
+
+CSSPropertySourceData::CSSPropertySourceData()
+ : name("")
+ , value("")
+ , important(false)
+ , parsedOk(false)
+ , range(SourceRange(0, 0))
+{
+}
+
+CSSPropertySourceData& CSSPropertySourceData::operator=(const CSSPropertySourceData& other)
+{
+ name = other.name;
+ value = other.value;
+ important = other.important;
+ parsedOk = other.parsedOk;
+ range = other.range;
+ return *this;
+}
+
+String CSSPropertySourceData::toString() const
+{
+ DEFINE_STATIC_LOCAL(String, emptyValue, ("e"));
+ DEFINE_STATIC_LOCAL(String, importantSuffix, (" !important"));
+ if (!name && value == emptyValue)
+ return String();
+
+ String result = name;
+ result += ": ";
+ result += value;
+ if (important)
+ result += importantSuffix;
+ result += ";";
+ return result;
+}
+
+unsigned CSSPropertySourceData::hash() const
+{
+ return StringHash::hash(name) + 3 * StringHash::hash(value) + 7 * important + 13 * parsedOk + 31;
+}
+
+// Global init routines
+DEFINE_GLOBAL(CSSPropertySourceData, emptyCSSPropertySourceData, "", "e", false, false)
+
+// static
+void CSSPropertySourceData::init()
+{
+ static bool initialized;
+ if (!initialized) {
+ new ((void *) &emptyCSSPropertySourceData) CSSPropertySourceData("", "e", false, false, SourceRange(0, 0));
+ initialized = true;
+ }
+}
+
+} // namespace WebCore
diff --git a/WebCore/css/CSSPropertySourceData.h b/WebCore/css/CSSPropertySourceData.h
new file mode 100644
index 0000000..beae9d0
--- /dev/null
+++ b/WebCore/css/CSSPropertySourceData.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CSSPropertySourceData_h
+#define CSSPropertySourceData_h
+
+#include "PlatformString.h"
+#include <utility>
+#include <wtf/Forward.h>
+#include <wtf/HashMap.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class CSSStyleRule;
+
+struct SourceRange {
+ SourceRange();
+ SourceRange(unsigned start, unsigned end);
+ SourceRange& operator=(const SourceRange& other);
+
+ unsigned start;
+ unsigned end;
+};
+
+struct CSSPropertySourceData {
+ static void init();
+
+ CSSPropertySourceData(const String& name, const String& value, bool important, bool parsedOk, const SourceRange& range);
+ CSSPropertySourceData(const CSSPropertySourceData& other);
+ CSSPropertySourceData();
+ ALWAYS_INLINE ~CSSPropertySourceData() { }
+
+ CSSPropertySourceData& operator=(const CSSPropertySourceData& other);
+ String toString() const;
+ unsigned hash() const;
+
+ String name;
+ String value;
+ bool important;
+ bool parsedOk;
+ SourceRange range;
+};
+
+#ifndef CSSPROPERTYSOURCEDATA_HIDE_GLOBALS
+extern const CSSPropertySourceData emptyCSSPropertySourceData;
+#endif
+
+struct CSSStyleSourceData : public RefCounted<CSSStyleSourceData> {
+ static PassRefPtr<CSSStyleSourceData> create()
+ {
+ return adoptRef(new CSSStyleSourceData());
+ }
+
+ // Range of the style text in the enclosing source.
+ SourceRange styleBodyRange;
+ Vector<CSSPropertySourceData> propertyData;
+};
+typedef HashMap<CSSStyleRule*, RefPtr<CSSStyleSourceData> > StyleRuleRangeMap;
+
+} // namespace WebCore
+
+#endif // CSSPropertySourceData_h
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index 60dfb84..abc4c22 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -654,7 +654,7 @@ void CSSStyleSelector::resolveVariablesForDeclaration(CSSMutableStyleDeclaration
}
}
-void CSSStyleSelector::matchRules(CSSRuleSet* rules, int& firstRuleIndex, int& lastRuleIndex)
+void CSSStyleSelector::matchRules(CSSRuleSet* rules, int& firstRuleIndex, int& lastRuleIndex, bool includeEmptyRules)
{
m_matchedRules.clear();
@@ -664,16 +664,16 @@ void CSSStyleSelector::matchRules(CSSRuleSet* rules, int& firstRuleIndex, int& l
// We need to collect the rules for id, class, tag, and everything else into a buffer and
// then sort the buffer.
if (m_element->hasID())
- matchRulesForList(rules->getIDRules(m_element->idForStyleResolution().impl()), firstRuleIndex, lastRuleIndex);
+ matchRulesForList(rules->getIDRules(m_element->idForStyleResolution().impl()), firstRuleIndex, lastRuleIndex, includeEmptyRules);
if (m_element->hasClass()) {
ASSERT(m_styledElement);
const SpaceSplitString& classNames = m_styledElement->classNames();
size_t size = classNames.size();
for (size_t i = 0; i < size; ++i)
- matchRulesForList(rules->getClassRules(classNames[i].impl()), firstRuleIndex, lastRuleIndex);
+ matchRulesForList(rules->getClassRules(classNames[i].impl()), firstRuleIndex, lastRuleIndex, includeEmptyRules);
}
- matchRulesForList(rules->getTagRules(m_element->localName().impl()), firstRuleIndex, lastRuleIndex);
- matchRulesForList(rules->getUniversalRules(), firstRuleIndex, lastRuleIndex);
+ matchRulesForList(rules->getTagRules(m_element->localName().impl()), firstRuleIndex, lastRuleIndex, includeEmptyRules);
+ matchRulesForList(rules->getUniversalRules(), firstRuleIndex, lastRuleIndex, includeEmptyRules);
// If we didn't match any rules, we're done.
if (m_matchedRules.isEmpty())
@@ -695,7 +695,7 @@ void CSSStyleSelector::matchRules(CSSRuleSet* rules, int& firstRuleIndex, int& l
}
}
-void CSSStyleSelector::matchRulesForList(CSSRuleDataList* rules, int& firstRuleIndex, int& lastRuleIndex)
+void CSSStyleSelector::matchRulesForList(CSSRuleDataList* rules, int& firstRuleIndex, int& lastRuleIndex, bool includeEmptyRules)
{
if (!rules)
return;
@@ -703,9 +703,9 @@ void CSSStyleSelector::matchRulesForList(CSSRuleDataList* rules, int& firstRuleI
for (CSSRuleData* d = rules->first(); d; d = d->next()) {
CSSStyleRule* rule = d->rule();
if (checkSelector(d->selector())) {
- // If the rule has no properties to apply, then ignore it.
+ // If the rule has no properties to apply, then ignore it in the non-debug mode.
CSSMutableStyleDeclaration* decl = rule->declaration();
- if (!decl || !decl->length())
+ if (!decl || (!decl->length() && !includeEmptyRules))
continue;
// If we're matching normal rules, set a pseudo bit if
@@ -1083,28 +1083,28 @@ void CSSStyleSelector::matchUARules(int& firstUARule, int& lastUARule)
// First we match rules from the user agent sheet.
CSSRuleSet* userAgentStyleSheet = m_medium->mediaTypeMatchSpecific("print")
? defaultPrintStyle : defaultStyle;
- matchRules(userAgentStyleSheet, firstUARule, lastUARule);
+ matchRules(userAgentStyleSheet, firstUARule, lastUARule, false);
// In quirks mode, we match rules from the quirks user agent sheet.
if (!m_checker.m_strictParsing)
- matchRules(defaultQuirksStyle, firstUARule, lastUARule);
+ matchRules(defaultQuirksStyle, firstUARule, lastUARule, false);
// If we're in view source mode, then we match rules from the view source style sheet.
if (m_checker.m_document->frame() && m_checker.m_document->frame()->inViewSourceMode()) {
if (!defaultViewSourceStyle)
loadViewSourceStyle();
- matchRules(defaultViewSourceStyle, firstUARule, lastUARule);
+ matchRules(defaultViewSourceStyle, firstUARule, lastUARule, false);
}
}
PassRefPtr<RenderStyle> CSSStyleSelector::styleForDocument(Document* document)
{
- FrameView* view = document->view();
+ Frame* frame = document->frame();
RefPtr<RenderStyle> documentStyle = RenderStyle::create();
documentStyle->setDisplay(BLOCK);
documentStyle->setVisuallyOrdered(document->visuallyOrdered());
- documentStyle->setZoom(view ? view->pageZoomFactor() : 1);
+ documentStyle->setZoom(frame ? frame->pageZoomFactor() : 1);
FontDescription fontDescription;
fontDescription.setUsePrinterFont(document->printing());
@@ -1247,7 +1247,7 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForElement(Element* e, RenderStyl
if (!resolveForRootDefault) {
// 4. Now we check user sheet rules.
if (m_matchAuthorAndUserStyles)
- matchRules(m_userStyle.get(), firstUserRule, lastUserRule);
+ matchRules(m_userStyle.get(), firstUserRule, lastUserRule, false);
// 5. Now check author rules, beginning first with presentational attributes
// mapped from HTML.
@@ -1286,7 +1286,7 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForElement(Element* e, RenderStyl
// 6. Check the rules in author sheets next.
if (m_matchAuthorAndUserStyles)
- matchRules(m_authorStyle.get(), firstAuthorRule, lastAuthorRule);
+ matchRules(m_authorStyle.get(), firstAuthorRule, lastAuthorRule, false);
// 7. Now check our inline style attribute.
if (m_matchAuthorAndUserStyles && m_styledElement) {
@@ -1503,8 +1503,10 @@ PassRefPtr<RenderStyle> CSSStyleSelector::pseudoStyleForElement(PseudoId pseudo,
}
initForStyleResolve(e, parentStyle, pseudo);
- m_style = parentStyle;
-
+ m_style = RenderStyle::create();
+ if (parentStyle)
+ m_style->inheritFrom(parentStyle);
+
m_checker.m_matchVisitedPseudoClass = matchVisitedPseudoClass;
// Since we don't use pseudo-elements in any of our quirk/print user agent rules, don't waste time walking
@@ -1515,17 +1517,13 @@ PassRefPtr<RenderStyle> CSSStyleSelector::pseudoStyleForElement(PseudoId pseudo,
matchUARules(firstUARule, lastUARule);
if (m_matchAuthorAndUserStyles) {
- matchRules(m_userStyle.get(), firstUserRule, lastUserRule);
- matchRules(m_authorStyle.get(), firstAuthorRule, lastAuthorRule);
+ matchRules(m_userStyle.get(), firstUserRule, lastUserRule, false);
+ matchRules(m_authorStyle.get(), firstAuthorRule, lastAuthorRule, false);
}
if (m_matchedDecls.isEmpty() && !visitedStyle)
return 0;
- m_style = RenderStyle::create();
- if (parentStyle)
- m_style->inheritFrom(parentStyle);
-
m_style->setStyleType(pseudo);
m_lineHeightValue = 0;
@@ -1798,7 +1796,7 @@ void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e)
if (e && e->isFormControlElement() && style->fontSize() >= 11) {
// Don't apply intrinsic margins to image buttons. The designer knows how big the images are,
// so we have to treat all image buttons as though they were explicitly sized.
- if (!e->hasTagName(inputTag) || static_cast<HTMLInputElement*>(e)->inputType() != HTMLInputElement::IMAGE)
+ if (!e->hasTagName(inputTag) || !static_cast<HTMLInputElement*>(e)->isImageButton())
addIntrinsicMargins(style);
}
@@ -1845,12 +1843,12 @@ void CSSStyleSelector::cacheBorderAndBackground()
}
}
-PassRefPtr<CSSRuleList> CSSStyleSelector::styleRulesForElement(Element* e, bool authorOnly)
+PassRefPtr<CSSRuleList> CSSStyleSelector::styleRulesForElement(Element* e, bool authorOnly, bool includeEmptyRules)
{
- return pseudoStyleRulesForElement(e, NOPSEUDO, authorOnly);
+ return pseudoStyleRulesForElement(e, NOPSEUDO, authorOnly, includeEmptyRules);
}
-PassRefPtr<CSSRuleList> CSSStyleSelector::pseudoStyleRulesForElement(Element* e, PseudoId pseudoId, bool authorOnly)
+PassRefPtr<CSSRuleList> CSSStyleSelector::pseudoStyleRulesForElement(Element* e, PseudoId pseudoId, bool authorOnly, bool includeEmptyRules)
{
if (!e || !e->document()->haveStylesheetsLoaded())
return 0;
@@ -1868,14 +1866,14 @@ PassRefPtr<CSSRuleList> CSSStyleSelector::pseudoStyleRulesForElement(Element* e,
// Now we check user sheet rules.
if (m_matchAuthorAndUserStyles) {
int firstUserRule = -1, lastUserRule = -1;
- matchRules(m_userStyle.get(), firstUserRule, lastUserRule);
+ matchRules(m_userStyle.get(), firstUserRule, lastUserRule, includeEmptyRules);
}
}
if (m_matchAuthorAndUserStyles) {
// Check the rules in author sheets.
int firstAuthorRule = -1, lastAuthorRule = -1;
- matchRules(m_authorStyle.get(), firstAuthorRule, lastAuthorRule);
+ matchRules(m_authorStyle.get(), firstAuthorRule, lastAuthorRule, includeEmptyRules);
}
m_checker.m_collectRulesOnly = false;
@@ -1888,7 +1886,7 @@ bool CSSStyleSelector::checkSelector(CSSSelector* sel)
m_dynamicPseudo = NOPSEUDO;
// Check the selector
- SelectorMatch match = m_checker.checkSelector(sel, m_element, &m_selectorAttrs, m_dynamicPseudo, false, false, style(), m_parentStyle);
+ SelectorMatch match = m_checker.checkSelector(sel, m_element, &m_selectorAttrs, m_dynamicPseudo, false, false, style(), m_parentNode ? m_parentNode->renderStyle() : 0);
if (match != SelectorMatches)
return false;
@@ -2925,7 +2923,7 @@ void CSSStyleSelector::applyDeclarations(bool isImportant, int startIndex, int e
if (applyFirst) {
COMPILE_ASSERT(firstCSSProperty == CSSPropertyColor, CSS_color_is_first_property);
- COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 12, CSS_zoom_is_end_of_first_prop_range);
+ COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 14, CSS_zoom_is_end_of_first_prop_range);
COMPILE_ASSERT(CSSPropertyLineHeight == CSSPropertyZoom + 1, CSS_line_height_is_after_zoom);
// give special priority to font-xxx, color properties, etc
@@ -3113,7 +3111,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
bool isInherit = m_parentNode && valueType == CSSValue::CSS_INHERIT;
bool isInitial = valueType == CSSValue::CSS_INITIAL || (!m_parentNode && valueType == CSSValue::CSS_INHERIT);
- id = CSSProperty::resolveDirectionAwareProperty(id, m_style->direction());
+ id = CSSProperty::resolveDirectionAwareProperty(id, m_style->direction(), m_style->blockFlow());
if (m_checker.m_matchVisitedPseudoClass && !isValidVisitedLinkProperty(id)) {
// Limit the properties that can be applied to only the ones honored by :visited.
@@ -4151,10 +4149,8 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
else if (CSSPrimitiveValue::isUnitTypeLength(type)) {
double multiplier = zoomFactor;
if (m_style->textSizeAdjust()) {
- if (FrameView* view = m_checker.m_document->view()) {
- if (view->shouldApplyTextZoom())
- multiplier *= view->textZoomFactor();
- }
+ if (Frame* frame = m_checker.m_document->frame())
+ multiplier *= frame->textZoomFactor();
}
lineHeight = Length(primitiveValue->computeLengthIntForLength(style(), m_rootElementStyle, multiplier), Fixed);
} else if (type == CSSPrimitiveValue::CSS_PERCENTAGE)
@@ -5478,10 +5474,28 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
case CSSPropertyWebkitBorderStartColor:
case CSSPropertyWebkitBorderStartStyle:
case CSSPropertyWebkitBorderStartWidth:
+ case CSSPropertyWebkitBorderBefore:
+ case CSSPropertyWebkitBorderBeforeColor:
+ case CSSPropertyWebkitBorderBeforeStyle:
+ case CSSPropertyWebkitBorderBeforeWidth:
+ case CSSPropertyWebkitBorderAfter:
+ case CSSPropertyWebkitBorderAfterColor:
+ case CSSPropertyWebkitBorderAfterStyle:
+ case CSSPropertyWebkitBorderAfterWidth:
case CSSPropertyWebkitMarginEnd:
case CSSPropertyWebkitMarginStart:
+ case CSSPropertyWebkitMarginBefore:
+ case CSSPropertyWebkitMarginAfter:
case CSSPropertyWebkitPaddingEnd:
case CSSPropertyWebkitPaddingStart:
+ case CSSPropertyWebkitPaddingBefore:
+ case CSSPropertyWebkitPaddingAfter:
+ case CSSPropertyWebkitLogicalWidth:
+ case CSSPropertyWebkitLogicalHeight:
+ case CSSPropertyWebkitMinLogicalWidth:
+ case CSSPropertyWebkitMinLogicalHeight:
+ case CSSPropertyWebkitMaxLogicalWidth:
+ case CSSPropertyWebkitMaxLogicalHeight:
ASSERT_NOT_REACHED();
break;
@@ -5525,6 +5539,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
return;
#endif
+<<<<<<< HEAD
#ifdef ANDROID_CSS_RING
case CSSPropertyWebkitRing:
if (valueType != CSSValue::CSS_INHERIT || !m_parentNode) return;
@@ -5668,6 +5683,54 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
return;
}
#endif
+=======
+ // CSS Text Layout Module Level 3: Vertical writing support
+ case CSSPropertyWebkitBlockFlow:
+ HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(blockFlow, BlockFlow)
+ return;
+
+ case CSSPropertyWebkitWritingMode:
+ // The 'writing-mode' property is a shorthand property for the 'direction' property and the 'block-flow' property.
+ if (isInherit) {
+ m_style->setDirection(m_parentStyle->direction());
+ m_style->setBlockFlow(m_parentStyle->blockFlow());
+ } else if (isInitial) {
+ m_style->setDirection(m_style->initialDirection());
+ m_style->setBlockFlow(m_style->initialBlockFlow());
+ } else {
+ if (!primitiveValue)
+ return;
+ switch (primitiveValue->getIdent()) {
+ case CSSValueLrTb:
+ m_style->setDirection(LTR);
+ m_style->setBlockFlow(TopToBottomBlockFlow);
+ break;
+ case CSSValueRlTb:
+ m_style->setDirection(RTL);
+ m_style->setBlockFlow(TopToBottomBlockFlow);
+ break;
+ case CSSValueTbRl:
+ m_style->setDirection(LTR);
+ m_style->setBlockFlow(RightToLeftBlockFlow);
+ break;
+ case CSSValueBtRl:
+ m_style->setDirection(RTL);
+ m_style->setBlockFlow(RightToLeftBlockFlow);
+ break;
+ case CSSValueTbLr:
+ m_style->setDirection(LTR);
+ m_style->setBlockFlow(LeftToRightBlockFlow);
+ break;
+ case CSSValueBtLr:
+ m_style->setDirection(RTL);
+ m_style->setBlockFlow(LeftToRightBlockFlow);
+ break;
+ default:
+ break;
+ }
+ }
+ return;
+>>>>>>> webkit.org at r67908
#if ENABLE(SVG)
default:
@@ -6375,8 +6438,8 @@ float CSSStyleSelector::getComputedSizeFromSpecifiedSize(Document* document, Ren
float zoomFactor = 1.0f;
if (!useSVGZoomRules) {
zoomFactor = style->effectiveZoom();
- if (document->view() && document->view()->shouldApplyTextZoom())
- zoomFactor *= document->view()->textZoomFactor();
+ if (Frame* frame = document->frame())
+ zoomFactor *= frame->textZoomFactor();
}
// We support two types of minimum font size. The first is a hard override that applies to
diff --git a/WebCore/css/CSSStyleSelector.h b/WebCore/css/CSSStyleSelector.h
index 4a4565d..b77f23c 100644
--- a/WebCore/css/CSSStyleSelector.h
+++ b/WebCore/css/CSSStyleSelector.h
@@ -119,8 +119,8 @@ public:
public:
// These methods will give back the set of rules that matched for a given element (or a pseudo-element).
- PassRefPtr<CSSRuleList> styleRulesForElement(Element*, bool authorOnly);
- PassRefPtr<CSSRuleList> pseudoStyleRulesForElement(Element*, PseudoId, bool authorOnly);
+ PassRefPtr<CSSRuleList> styleRulesForElement(Element*, bool authorOnly, bool includeEmptyRules = false);
+ PassRefPtr<CSSRuleList> pseudoStyleRulesForElement(Element*, PseudoId, bool authorOnly, bool includeEmptyRules = false);
// 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).
@@ -186,8 +186,8 @@ public:
void addMatchedRule(CSSRuleData* rule) { m_matchedRules.append(rule); }
void addMatchedDeclaration(CSSMutableStyleDeclaration* decl);
- void matchRules(CSSRuleSet*, int& firstRuleIndex, int& lastRuleIndex);
- void matchRulesForList(CSSRuleDataList*, int& firstRuleIndex, int& lastRuleIndex);
+ void matchRules(CSSRuleSet*, int& firstRuleIndex, int& lastRuleIndex, bool includeEmptyRules);
+ void matchRulesForList(CSSRuleDataList*, int& firstRuleIndex, int& lastRuleIndex, bool includeEmptyRules);
void sortMatchedRules(unsigned start, unsigned end);
template <bool firstPass>
diff --git a/WebCore/css/CSSValueKeywords.in b/WebCore/css/CSSValueKeywords.in
index 1e7c2b5..990bb36 100644
--- a/WebCore/css/CSSValueKeywords.in
+++ b/WebCore/css/CSSValueKeywords.in
@@ -742,3 +742,17 @@ windowed
# none
manual
# auto
+
+# -webkit-block-flow
+tb
+rl
+lr
+bt
+
+# -webkit-writing-mode
+lr-tb
+rl-tb
+tb-rl
+bt-rl
+tb-lr
+bt-lr
diff --git a/WebCore/css/SVGCSSComputedStyleDeclaration.cpp b/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
index 410eede..0cf6181 100644
--- a/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
@@ -180,7 +180,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getSVGPropertyCSSValue(int pro
return 0;
}
case CSSPropertyWebkitSvgShadow:
- return valueForShadow(svgStyle->shadow(), propertyID);
+ return valueForShadow(svgStyle->shadow(), propertyID, style);
case CSSPropertyVectorEffect:
return CSSPrimitiveValue::create(svgStyle->vectorEffect());
case CSSPropertyMarker:
diff --git a/WebCore/css/SVGCSSParser.cpp b/WebCore/css/SVGCSSParser.cpp
index 535b273..3c42d40 100644
--- a/WebCore/css/SVGCSSParser.cpp
+++ b/WebCore/css/SVGCSSParser.cpp
@@ -232,7 +232,7 @@ bool CSSParser::parseSVGValue(int propId, bool important)
case CSSPropertyWritingMode:
// lr-tb | rl_tb | tb-rl | lr | rl | tb | inherit
- if (id >= CSSValueLrTb && id <= CSSValueTb)
+ if (id == CSSValueLrTb || id == CSSValueRlTb || id == CSSValueTbRl || id == CSSValueLr || id == CSSValueRl || id == CSSValueTb)
valid_primitive = true;
break;
diff --git a/WebCore/css/SVGCSSValueKeywords.in b/WebCore/css/SVGCSSValueKeywords.in
index 420fbd8..a2c9f83 100644
--- a/WebCore/css/SVGCSSValueKeywords.in
+++ b/WebCore/css/SVGCSSValueKeywords.in
@@ -276,12 +276,3 @@ reset-size
# CSS_PROP_VECTOR_EFFECT
# none
non-scaling-stroke
-
-
-# CSS_PROP_WRITING_MODE
-lr-tb
-rl-tb
-tb-rl
-lr
-rl
-tb
diff --git a/WebCore/css/mediaControlsQuickTime.css b/WebCore/css/mediaControlsQuickTime.css
index d2c731f..06f31ae 100644
--- a/WebCore/css/mediaControlsQuickTime.css
+++ b/WebCore/css/mediaControlsQuickTime.css
@@ -221,4 +221,4 @@ audio::-webkit-media-controls-volume-slider-mute-button, video::-webkit-media-co
width: 14px;
height: 12px;
-}
+}
diff --git a/WebCore/dom/ActiveDOMObject.cpp b/WebCore/dom/ActiveDOMObject.cpp
index 98c9761..0b70b24 100644
--- a/WebCore/dom/ActiveDOMObject.cpp
+++ b/WebCore/dom/ActiveDOMObject.cpp
@@ -66,7 +66,7 @@ bool ActiveDOMObject::canSuspend() const
return false;
}
-void ActiveDOMObject::suspend()
+void ActiveDOMObject::suspend(ReasonForSuspension)
{
}
diff --git a/WebCore/dom/ActiveDOMObject.h b/WebCore/dom/ActiveDOMObject.h
index 73b52d5..a6ec7d3 100644
--- a/WebCore/dom/ActiveDOMObject.h
+++ b/WebCore/dom/ActiveDOMObject.h
@@ -48,8 +48,13 @@ namespace WebCore {
// However, 'suspend' can be called even if canSuspend() would return 'false'. That
// happens in step-by-step JS debugging for example - in this case it would be incorrect
// to stop the object. Exact semantics of suspend is up to the object then.
+ enum ReasonForSuspension {
+ JavaScriptDebuggerPaused,
+ WillShowDialog,
+ DocumentWillBecomeInactive
+ };
virtual bool canSuspend() const;
- virtual void suspend();
+ virtual void suspend(ReasonForSuspension);
virtual void resume();
virtual void stop();
diff --git a/WebCore/dom/AsyncScriptRunner.cpp b/WebCore/dom/AsyncScriptRunner.cpp
index 86251b8..a72df7c 100644
--- a/WebCore/dom/AsyncScriptRunner.cpp
+++ b/WebCore/dom/AsyncScriptRunner.cpp
@@ -78,6 +78,8 @@ void AsyncScriptRunner::timerFired(Timer<AsyncScriptRunner>* timer)
{
ASSERT_UNUSED(timer, timer == &m_timer);
+ RefPtr<Document> protect(m_document);
+
Vector<pair<ScriptElementData*, CachedResourceHandle<CachedScript> > > scripts;
scripts.swap(m_scriptsToExecuteSoon);
size_t size = scripts.size();
diff --git a/WebCore/dom/ContainerNode.cpp b/WebCore/dom/ContainerNode.cpp
index 46de749..2dd50bb 100644
--- a/WebCore/dom/ContainerNode.cpp
+++ b/WebCore/dom/ContainerNode.cpp
@@ -72,7 +72,6 @@ void ContainerNode::removeAllChildren()
removeAllChildrenInContainer<Node, ContainerNode>(this);
}
-
void ContainerNode::takeAllChildrenFrom(ContainerNode* oldParent)
{
NodeVector children;
@@ -82,10 +81,14 @@ void ContainerNode::takeAllChildrenFrom(ContainerNode* oldParent)
for (unsigned i = 0; i < children.size(); ++i) {
ExceptionCode ec = 0;
+ if (children[i]->attached())
+ children[i]->detach();
// FIXME: We need a no mutation event version of adoptNode.
RefPtr<Node> child = document()->adoptNode(children[i].release(), ec);
ASSERT(!ec);
- parserAddChild(child.release());
+ parserAddChild(child.get());
+ if (attached() && !child->attached())
+ child->attach();
}
}
@@ -359,9 +362,7 @@ static void willRemoveChild(Node* child)
// fire removed from document mutation events.
dispatchChildRemovalEvents(child);
-
- if (child->attached())
- child->willRemove();
+ child->willRemove();
}
static void willRemoveChildren(ContainerNode* container)
@@ -373,9 +374,7 @@ static void willRemoveChildren(ContainerNode* container)
for (RefPtr<Node> child = container->firstChild(); child; child = child->nextSibling()) {
// fire removed from document mutation events.
dispatchChildRemovalEvents(child.get());
-
- if (child->attached())
- child->willRemove();
+ child->willRemove();
}
}
diff --git a/WebCore/dom/DOMStringMap.h b/WebCore/dom/DOMStringMap.h
index e91d884..86a22b0 100644
--- a/WebCore/dom/DOMStringMap.h
+++ b/WebCore/dom/DOMStringMap.h
@@ -32,6 +32,7 @@
namespace WebCore {
+class Element;
typedef int ExceptionCode;
class DOMStringMap : public Noncopyable {
@@ -47,6 +48,8 @@ public:
virtual void setItem(const String& name, const String& value, ExceptionCode&) = 0;
virtual void deleteItem(const String& name, ExceptionCode&) = 0;
+ virtual Element* element() = 0;
+
protected:
DOMStringMap()
{
diff --git a/WebCore/dom/DatasetDOMStringMap.h b/WebCore/dom/DatasetDOMStringMap.h
index f82eaa5..632e365 100644
--- a/WebCore/dom/DatasetDOMStringMap.h
+++ b/WebCore/dom/DatasetDOMStringMap.h
@@ -49,6 +49,8 @@ public:
virtual void setItem(const String& name, const String& value, ExceptionCode&);
virtual void deleteItem(const String& name, ExceptionCode&);
+ virtual Element* element() { return m_element; }
+
private:
DatasetDOMStringMap(Element* element)
: m_element(element)
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index a92c5ab..262dad2 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -43,6 +43,7 @@
#include "Console.h"
#include "CookieJar.h"
#include "CustomEvent.h"
+#include "DateComponents.h"
#include "DOMImplementation.h"
#include "DOMWindow.h"
#include "DeviceMotionEvent.h"
@@ -64,6 +65,7 @@
#include "FrameLoader.h"
#include "FrameTree.h"
#include "FrameView.h"
+#include "HashChangeEvent.h"
#include "HTMLAllCollection.h"
#include "HTMLAnchorElement.h"
#include "HTMLBodyElement.h"
@@ -369,7 +371,7 @@ private:
Document* m_document;
};
-Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
+Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML, const KURL& baseURL)
: ContainerNode(0)
, m_compatibilityMode(NoQuirksMode)
, m_compatibilityModeLocked(false)
@@ -439,7 +441,15 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
if (frame || !url.isEmpty())
setURL(url);
+<<<<<<< HEAD
#if !PLATFORM(ANDROID)
+=======
+ // Setting of m_baseURL needs to happen after the setURL call, since that
+ // calls updateBaseURL, which would clobber the passed in value.
+ if (!baseURL.isNull())
+ m_baseURL = baseURL;
+
+>>>>>>> webkit.org at r67908
m_axObjectCache = 0;
#endif
@@ -623,6 +633,11 @@ void Document::setCompatibilityMode(CompatibilityMode mode)
}
}
+String Document::compatMode() const
+{
+ return inQuirksMode() ? "BackCompat" : "CSS1Compat";
+}
+
void Document::resetLinkColor()
{
m_linkColor = Color(0, 0, 238);
@@ -1079,7 +1094,7 @@ PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned
if (!frameView)
return 0;
- float zoomFactor = frameView->pageZoomFactor();
+ float zoomFactor = frame->pageZoomFactor();
IntPoint point = roundedIntPoint(FloatPoint(centerX * zoomFactor + view()->scrollX(), centerY * zoomFactor + view()->scrollY()));
IntSize padding(hPadding, vPadding);
@@ -1132,7 +1147,7 @@ Element* Document::elementFromPoint(int x, int y) const
if (!frameView)
return 0;
- float zoomFactor = frameView->pageZoomFactor();
+ float zoomFactor = frame->pageZoomFactor();
IntPoint point = roundedIntPoint(FloatPoint(x * zoomFactor + view()->scrollX(), y * zoomFactor + view()->scrollY()));
if (!frameView->visibleContentRect().contains(point))
@@ -1162,7 +1177,7 @@ PassRefPtr<Range> Document::caretRangeFromPoint(int x, int y)
if (!frameView)
return 0;
- float zoomFactor = frameView->pageZoomFactor();
+ float zoomFactor = frame->pageZoomFactor();
IntPoint point = roundedIntPoint(FloatPoint(x * zoomFactor + view()->scrollX(), y * zoomFactor + view()->scrollY()));
if (!frameView->visibleContentRect().contains(point))
@@ -2000,26 +2015,6 @@ void Document::close()
}
}
-// FIXME: These settings probably don't work anymore. We should either remove
-// them or make them work properly.
-#ifdef BUILDING_ON_LEOPARD
-static bool shouldCreateImplicitHead(Document* document)
-{
- ASSERT(document);
- Settings* settings = document->page() ? document->page()->settings() : 0;
- return settings ? !settings->needsLeopardMailQuirks() : true;
-}
-#elif defined(BUILDING_ON_TIGER)
-static bool shouldCreateImplicitHead(Document* document)
-{
- ASSERT(document);
- Settings* settings = document->page() ? document->page()->settings() : 0;
- return settings ? !settings->needsTigerMailQuirks() : true;
-}
-#else
-inline bool shouldCreateImplicitHead(Document*) { return true; }
-#endif
-
void Document::implicitClose()
{
// If we're in the middle of recalcStyle, we need to defer the close until the style information is accurate and all elements are re-attached.
@@ -2046,21 +2041,6 @@ void Document::implicitClose()
// Parser should have picked up all preloads by now
m_cachedResourceLoader->clearPreloads();
- // Create a head and a body if we don't have those yet (e.g. for about:blank).
- if (!this->body() && isHTMLDocument()) {
- if (Node* documentElement = this->documentElement()) {
- ExceptionCode ec = 0;
-
- // The implicit <head> isn't expected in older versions of Mail - <rdar://problem/6863795>
- if (!head() && shouldCreateImplicitHead(this)) {
- documentElement->appendChild(HTMLHeadElement::create(this), ec);
- ASSERT(!ec);
- }
- documentElement->appendChild(HTMLBodyElement::create(this), ec);
- ASSERT(!ec);
- }
- }
-
// FIXME: We kick off the icon loader when the Document is done parsing.
// There are earlier opportunities we could start it:
// -When the <head> finishes parsing
@@ -2591,13 +2571,15 @@ void Document::processHttpEquiv(const String& equiv, const String& content)
else if (equalIgnoringCase(equiv, "x-dns-prefetch-control"))
parseDNSPrefetchControlHeader(content);
else if (equalIgnoringCase(equiv, "x-frame-options")) {
- FrameLoader* frameLoader = frame->loader();
- if (frameLoader->shouldInterruptLoadForXFrameOptions(content, url())) {
- frameLoader->stopAllLoaders();
- frame->redirectScheduler()->scheduleLocationChange(blankURL(), String());
-
- DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to display document because display forbidden by X-Frame-Options.\n"));
- frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage, 1, String());
+ if (frame) {
+ FrameLoader* frameLoader = frame->loader();
+ if (frameLoader->shouldInterruptLoadForXFrameOptions(content, url())) {
+ frameLoader->stopAllLoaders();
+ frame->redirectScheduler()->scheduleLocationChange(blankURL(), String());
+
+ DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to display document because display forbidden by X-Frame-Options.\n"));
+ frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage, 1, String());
+ }
}
}
}
@@ -3321,7 +3303,7 @@ void Document::nodeChildrenWillBeRemoved(ContainerNode* container)
if (Frame* frame = this->frame()) {
for (Node* n = container->firstChild(); n; n = n->nextSibling()) {
frame->selection()->nodeWillBeRemoved(n);
- frame->dragCaretController()->nodeWillBeRemoved(n);
+ frame->page()->dragCaretController()->nodeWillBeRemoved(n);
}
}
}
@@ -3340,7 +3322,7 @@ void Document::nodeWillBeRemoved(Node* n)
if (Frame* frame = this->frame()) {
frame->selection()->nodeWillBeRemoved(n);
- frame->dragCaretController()->nodeWillBeRemoved(n);
+ frame->page()->dragCaretController()->nodeWillBeRemoved(n);
}
#if ENABLE(FULLSCREEN_API)
@@ -3695,15 +3677,24 @@ void Document::setDomain(const String& newDomain, ExceptionCode& ec)
m_frame->script()->updateSecurityOrigin();
}
+// http://www.whatwg.org/specs/web-apps/current-work/#dom-document-lastmodified
String Document::lastModified() const
{
- Frame* f = frame();
- if (!f)
- return String();
- DocumentLoader* loader = f->loader()->documentLoader();
- if (!loader)
- return String();
- return loader->response().httpHeaderField("Last-Modified");
+ DateComponents date;
+ bool foundDate = false;
+ if (m_frame) {
+ String httpLastModified = m_frame->loader()->documentLoader()->response().httpHeaderField("Last-Modified");
+ if (!httpLastModified.isEmpty()) {
+ date.setMillisecondsSinceEpochForDateTime(parseDate(httpLastModified));
+ foundDate = true;
+ }
+ }
+ // FIXME: If this document came from the file system, the HTML5
+ // specificiation tells us to read the last modification date from the file
+ // system.
+ if (!foundDate)
+ date.setMillisecondsSinceEpochForDateTime(currentTimeMS());
+ return String::format("%02d/%02d/%04d %02d:%02d:%02d", date.month() + 1, date.monthDay(), date.fullYear(), date.hour(), date.minute(), date.second());
}
static bool isValidNameNonASCII(const UChar* characters, unsigned length)
@@ -4037,10 +4028,9 @@ bool Document::inDesignMode() const
Document* Document::parentDocument() const
{
- Frame* childPart = frame();
- if (!childPart)
+ if (!m_frame)
return 0;
- Frame* parent = childPart->tree()->parent();
+ Frame* parent = m_frame->tree()->parent();
if (!parent)
return 0;
return parent->document();
@@ -4711,11 +4701,9 @@ void Document::enqueuePageshowEvent(PageshowEventPersistence persisted)
dispatchWindowEvent(PageTransitionEvent::create(eventNames().pageshowEvent, persisted), this);
}
-void Document::enqueueHashchangeEvent(const String& /*oldURL*/, const String& /*newURL*/)
+void Document::enqueueHashchangeEvent(const String& oldURL, const String& newURL)
{
- // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36335 Hashchange event is now its own interface and takes two
- // URL arguments which we need to pass in here.
- enqueueEvent(Event::create(eventNames().hashchangeEvent, false, false));
+ enqueueEvent(HashChangeEvent::create(oldURL, newURL));
}
void Document::enqueuePopstateEvent(PassRefPtr<SerializedScriptValue> stateObject)
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index a8e3562..c1065fb 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -579,6 +579,8 @@ public:
void lockCompatibilityMode() { m_compatibilityModeLocked = true; }
CompatibilityMode compatibilityMode() const { return m_compatibilityMode; }
+ String compatMode() const;
+
bool inQuirksMode() const { return m_compatibilityMode == QuirksMode; }
bool inLimitedQuirksMode() const { return m_compatibilityMode == LimitedQuirksMode; }
bool inNoQuirksMode() const { return m_compatibilityMode == NoQuirksMode; }
@@ -1033,7 +1035,7 @@ public:
bool isDelayingLoadEvent() const { return m_loadEventDelayCount; }
protected:
- Document(Frame*, const KURL&, bool isXHTML, bool isHTML);
+ Document(Frame*, const KURL& url, bool isXHTML, bool isHTML, const KURL& baseURL = KURL());
void clearXMLVersion() { m_xmlVersion = String(); }
diff --git a/WebCore/dom/Document.idl b/WebCore/dom/Document.idl
index 0bd93b8..296bd44 100644
--- a/WebCore/dom/Document.idl
+++ b/WebCore/dom/Document.idl
@@ -233,6 +233,8 @@ module core {
// HTML 5
NodeList getElementsByClassName(in DOMString tagname);
+ readonly attribute DOMString compatMode;
+
// NodeSelector - Selector API
Element querySelector(in DOMString selectors)
raises(DOMException);
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index 6ff47e0..5f53c2d 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -50,6 +50,7 @@
#include "RenderLayer.h"
#include "RenderView.h"
#include "RenderWidget.h"
+#include "SVGStyledLocatableElement.h"
#include "Settings.h"
#include "TextIterator.h"
#include "XMLNames.h"
@@ -476,12 +477,25 @@ PassRefPtr<ClientRectList> Element::getClientRects() const
PassRefPtr<ClientRect> Element::getBoundingClientRect() const
{
document()->updateLayoutIgnorePendingStylesheets();
- RenderBoxModelObject* renderBoxModelObject = this->renderBoxModelObject();
- if (!renderBoxModelObject)
- return ClientRect::create();
Vector<FloatQuad> quads;
- renderBoxModelObject->absoluteQuads(quads);
+#if ENABLE(SVG)
+ if (isSVGElement()) {
+ // Get the bounding rectangle from the SVG model.
+ const SVGElement* svgElement = static_cast<const SVGElement*>(this);
+ if (svgElement->isStyledLocatable()) {
+ if (renderer()) {
+ const FloatRect& localRect = static_cast<const SVGStyledLocatableElement*>(svgElement)->getBBox();
+ quads.append(renderer()->localToAbsoluteQuad(localRect));
+ }
+ }
+ } else
+#endif
+ {
+ // Get the bounding rectangle from the box model.
+ if (renderBoxModelObject())
+ renderBoxModelObject()->absoluteQuads(quads);
+ }
if (quads.isEmpty())
return ClientRect::create();
@@ -495,7 +509,8 @@ PassRefPtr<ClientRect> Element::getBoundingClientRect() const
result.move(-visibleContentRect.x(), -visibleContentRect.y());
}
- adjustIntRectForAbsoluteZoom(result, renderBoxModelObject);
+ if (renderBoxModelObject())
+ adjustIntRectForAbsoluteZoom(result, renderBoxModelObject());
return ClientRect::create(result);
}
@@ -1347,9 +1362,9 @@ void Element::updateFocusAppearance(bool /*restorePreviousSelection*/)
// FIXME: We should restore the previous selection if there is one.
VisibleSelection newSelection = VisibleSelection(Position(this, 0), DOWNSTREAM);
- if (frame->shouldChangeSelection(newSelection)) {
+ if (frame->selection()->shouldChangeSelection(newSelection)) {
frame->selection()->setSelection(newSelection);
- frame->revealSelection();
+ frame->selection()->revealSelection();
}
} else if (renderer() && !renderer()->isWidget())
renderer()->enclosingLayer()->scrollRectToVisible(getRect());
diff --git a/WebCore/dom/Event.cpp b/WebCore/dom/Event.cpp
index c76f951..bb404fa 100644
--- a/WebCore/dom/Event.cpp
+++ b/WebCore/dom/Event.cpp
@@ -172,6 +172,11 @@ bool Event::isBeforeLoadEvent() const
return false;
}
+bool Event::isHashChangeEvent() const
+{
+ return false;
+}
+
#if ENABLE(SVG)
bool Event::isSVGZoomEvent() const
{
diff --git a/WebCore/dom/Event.h b/WebCore/dom/Event.h
index b992237..2a00eee 100644
--- a/WebCore/dom/Event.h
+++ b/WebCore/dom/Event.h
@@ -123,6 +123,7 @@ namespace WebCore {
virtual bool isWebKitAnimationEvent() const;
virtual bool isWebKitTransitionEvent() const;
virtual bool isBeforeLoadEvent() const;
+ virtual bool isHashChangeEvent() const;
#if ENABLE(SVG)
virtual bool isSVGZoomEvent() const;
#endif
diff --git a/WebCore/dom/EventTarget.cpp b/WebCore/dom/EventTarget.cpp
index effd2a2..d2b6f49 100644
--- a/WebCore/dom/EventTarget.cpp
+++ b/WebCore/dom/EventTarget.cpp
@@ -162,7 +162,7 @@ FileReader* EventTarget::toFileReader()
return 0;
}
#endif
-#if ENABLE(FILE_WRITER)
+#if ENABLE(FILE_SYSTEM)
FileWriter* EventTarget::toFileWriter()
{
return 0;
diff --git a/WebCore/dom/EventTarget.h b/WebCore/dom/EventTarget.h
index b2985f7..de7c2e0 100644
--- a/WebCore/dom/EventTarget.h
+++ b/WebCore/dom/EventTarget.h
@@ -124,7 +124,7 @@ namespace WebCore {
#if ENABLE(BLOB)
virtual FileReader* toFileReader();
#endif
-#if ENABLE(FILE_WRITER)
+#if ENABLE(FILE_SYSTEM)
virtual FileWriter* toFileWriter();
#endif
diff --git a/WebCore/dom/ExceptionCode.h b/WebCore/dom/ExceptionCode.h
index ed15a2e..cbbf650 100644
--- a/WebCore/dom/ExceptionCode.h
+++ b/WebCore/dom/ExceptionCode.h
@@ -61,7 +61,7 @@ namespace WebCore {
// Introduced in File API:
// http://www.w3.org/TR/file-upload/#dfn-fileerror
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
NOT_READABLE_ERR = 24,
ENCODING_ERR = 26,
#endif
diff --git a/WebCore/dom/HashChangeEvent.h b/WebCore/dom/HashChangeEvent.h
new file mode 100644
index 0000000..f1fa6af
--- /dev/null
+++ b/WebCore/dom/HashChangeEvent.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 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
+ * 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 HashChangeEvent_h
+#define HashChangeEvent_h
+
+#include "Event.h"
+#include "EventNames.h"
+
+namespace WebCore {
+
+class HashChangeEvent : public Event {
+public:
+ virtual bool isHashChangeEvent() const { return true; }
+
+ static PassRefPtr<HashChangeEvent> create(const String& oldURL, const String& newURL)
+ {
+ return adoptRef(new HashChangeEvent(oldURL, newURL));
+ }
+
+ void initHashChangeEvent(const AtomicString& eventType, bool canBubble, bool cancelable, const String& oldURL, const String& newURL)
+ {
+ if (dispatched())
+ return;
+
+ initEvent(eventType, canBubble, cancelable);
+
+ m_oldURL = oldURL;
+ m_newURL = newURL;
+ }
+
+ const String& oldURL() const { return m_oldURL; }
+ const String& newURL() const { return m_newURL; }
+
+private:
+ HashChangeEvent(const String& oldURL, const String& newURL)
+ : Event(eventNames().hashchangeEvent, false, false)
+ , m_oldURL(oldURL)
+ , m_newURL(newURL)
+ {}
+
+ String m_oldURL;
+ String m_newURL;
+};
+
+} // namespace WebCore
+
+#endif // HashChangeEvent_h
diff --git a/WebCore/page/ZoomMode.h b/WebCore/dom/HashChangeEvent.idl
index 3f02184..63073c4 100644
--- a/WebCore/page/ZoomMode.h
+++ b/WebCore/dom/HashChangeEvent.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Research in Motion Ltd. http://www.rim.com/
+ * Copyright (C) 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
@@ -17,16 +17,19 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef ZoomMode_h
-#define ZoomMode_h
+module events {
-namespace WebCore {
-
-enum ZoomMode {
- ZoomPage,
- ZoomTextOnly
-};
+ // Introduced in http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-hashchange
+ interface [
+ GenerateConstructor
+ ] HashChangeEvent : Event {
+ void initHashChangeEvent(in DOMString type,
+ in boolean canBubble,
+ in boolean cancelable,
+ in DOMString oldURL,
+ in DOMString newURL);
+ readonly attribute DOMString oldURL;
+ readonly attribute DOMString newURL;
+ };
}
-
-#endif
diff --git a/WebCore/dom/InputElement.cpp b/WebCore/dom/InputElement.cpp
index f0284d8..b2a9714 100644
--- a/WebCore/dom/InputElement.cpp
+++ b/WebCore/dom/InputElement.cpp
@@ -99,7 +99,7 @@ void InputElement::updateFocusAppearance(InputElementData& data, InputElement* i
Document* document = element->document();
if (document && document->frame())
- document->frame()->revealSelection();
+ document->frame()->selection()->revealSelection();
}
void InputElement::updateSelectionRange(InputElement* inputElement, Element* element, int start, int end)
diff --git a/WebCore/dom/MouseRelatedEvent.cpp b/WebCore/dom/MouseRelatedEvent.cpp
index ce4c175..61c35e8 100644
--- a/WebCore/dom/MouseRelatedEvent.cpp
+++ b/WebCore/dom/MouseRelatedEvent.cpp
@@ -57,7 +57,7 @@ static int contentsX(AbstractView* abstractView)
FrameView* frameView = frame->view();
if (!frameView)
return 0;
- return frameView->scrollX() / frameView->pageZoomFactor();
+ return frameView->scrollX() / frame->pageZoomFactor();
}
static int contentsY(AbstractView* abstractView)
@@ -70,7 +70,7 @@ static int contentsY(AbstractView* abstractView)
FrameView* frameView = frame->view();
if (!frameView)
return 0;
- return frameView->scrollY() / frameView->pageZoomFactor();
+ return frameView->scrollY() / frame->pageZoomFactor();
}
MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubble, bool cancelable, PassRefPtr<AbstractView> viewArg,
@@ -126,10 +126,7 @@ static float pageZoomFactor(UIEvent* event)
Frame* frame = window->frame();
if (!frame)
return 1;
- FrameView* view = frame->view();
- if (!view)
- return 1;
- return view->pageZoomFactor();
+ return frame->pageZoomFactor();
}
void MouseRelatedEvent::computePageLocation()
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 9b27089..92b42fe 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -723,6 +723,15 @@ inline void Node::setStyleChange(StyleChangeType changeType)
m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType;
}
+inline void Node::markAncestorsWithChildNeedsStyleRecalc()
+{
+ for (Node* p = parentNode(); p && !p->childNeedsStyleRecalc(); p = p->parentNode())
+ p->setChildNeedsStyleRecalc();
+
+ if (document()->childNeedsStyleRecalc())
+ document()->scheduleStyleRecalc();
+}
+
void Node::setNeedsStyleRecalc(StyleChangeType changeType)
{
ASSERT(changeType != NoStyleChange);
@@ -733,49 +742,20 @@ void Node::setNeedsStyleRecalc(StyleChangeType changeType)
if (changeType > existingChangeType)
setStyleChange(changeType);
- if (existingChangeType == NoStyleChange) {
- for (Node* p = parentNode(); p && !p->childNeedsStyleRecalc(); p = p->parentNode())
- p->setChildNeedsStyleRecalc();
-
- if (document()->childNeedsStyleRecalc())
- document()->scheduleStyleRecalc();
- }
+ if (existingChangeType == NoStyleChange)
+ markAncestorsWithChildNeedsStyleRecalc();
}
-static Node* outermostLazyAttachedAncestor(Node* start)
+void Node::lazyAttach(ShouldSetAttached shouldSetAttached)
{
- Node* p = start;
- for (Node* next = p->parentNode(); !next->renderer(); p = next, next = next->parentNode()) {}
- return p;
-}
-
-void Node::lazyAttach()
-{
- bool mustDoFullAttach = false;
-
for (Node* n = this; n; n = n->traverseNextNode(this)) {
- if (!n->canLazyAttach()) {
- mustDoFullAttach = true;
- break;
- }
-
if (n->firstChild())
n->setChildNeedsStyleRecalc();
n->setStyleChange(FullStyleChange);
- n->setAttached();
- }
-
- if (mustDoFullAttach) {
- Node* lazyAttachedAncestor = outermostLazyAttachedAncestor(this);
- if (lazyAttachedAncestor->attached())
- lazyAttachedAncestor->detach();
- lazyAttachedAncestor->attach();
- } else {
- for (Node* p = parentNode(); p && !p->childNeedsStyleRecalc(); p = p->parentNode())
- p->setChildNeedsStyleRecalc();
- if (document()->childNeedsStyleRecalc())
- document()->scheduleStyleRecalc();
+ if (shouldSetAttached == SetAttached)
+ n->setAttached();
}
+ markAncestorsWithChildNeedsStyleRecalc();
}
void Node::setFocus(bool b)
@@ -2939,8 +2919,8 @@ bool Node::dispatchMouseEvent(const AtomicString& eventType, int button, int det
int adjustedPageX = pageX;
int adjustedPageY = pageY;
- if (FrameView* view = document()->view()) {
- float pageZoom = view->pageZoomFactor();
+ if (Frame* frame = document()->frame()) {
+ float pageZoom = frame->pageZoomFactor();
if (pageZoom != 1.0f) {
// Adjust our pageX and pageY to account for the page zoom.
adjustedPageX = lroundf(pageX / pageZoom);
@@ -2996,8 +2976,8 @@ void Node::dispatchWheelEvent(PlatformWheelEvent& e)
int adjustedPageX = pos.x();
int adjustedPageY = pos.y();
- if (FrameView* view = document()->view()) {
- float pageZoom = view->pageZoomFactor();
+ if (Frame* frame = document()->frame()) {
+ float pageZoom = frame->pageZoomFactor();
if (pageZoom != 1.0f) {
// Adjust our pageX and pageY to account for the page zoom.
adjustedPageX = lroundf(pos.x() / pageZoom);
diff --git a/WebCore/dom/Node.h b/WebCore/dom/Node.h
index c7f07f1..603829b 100644
--- a/WebCore/dom/Node.h
+++ b/WebCore/dom/Node.h
@@ -310,8 +310,11 @@ public:
void setIsLink() { setFlag(IsLinkFlag); }
void clearIsLink() { clearFlag(IsLinkFlag); }
- void lazyAttach();
- virtual bool canLazyAttach() { return true; }
+ enum ShouldSetAttached {
+ SetAttached,
+ DoNotSetAttached
+ };
+ void lazyAttach(ShouldSetAttached = SetAttached);
virtual void setFocus(bool b = true);
virtual void setActive(bool f = true, bool /*pause*/ = false) { setFlag(f, IsActiveFlag); }
@@ -693,6 +696,9 @@ private:
void setStyleChange(StyleChangeType);
+ // Used to share code between lazyAttach and setNeedsStyleRecalc.
+ void markAncestorsWithChildNeedsStyleRecalc();
+
virtual void refEventTarget() { ref(); }
virtual void derefEventTarget() { deref(); }
diff --git a/WebCore/dom/Range.cpp b/WebCore/dom/Range.cpp
index d93a58e..95502df 100644
--- a/WebCore/dom/Range.cpp
+++ b/WebCore/dom/Range.cpp
@@ -107,6 +107,17 @@ Range::~Range()
#endif
}
+void Range::setDocument(Document* document)
+{
+ ASSERT(m_ownerDocument != document);
+ if (m_ownerDocument)
+ m_ownerDocument->detachRange(this);
+ m_ownerDocument = document;
+ m_start.setToStartOfNode(document);
+ m_end.setToStartOfNode(document);
+ m_ownerDocument->attachRange(this);
+}
+
Node* Range::startContainer(ExceptionCode& ec) const
{
if (!m_start.container()) {
@@ -1316,6 +1327,9 @@ void Range::selectNode(Node* refNode, ExceptionCode& ec)
return;
}
+ if (m_ownerDocument != refNode->document())
+ setDocument(refNode->document());
+
ec = 0;
setStartBefore(refNode, ec);
if (ec)
@@ -1358,6 +1372,9 @@ void Range::selectNodeContents(Node* refNode, ExceptionCode& ec)
}
}
+ if (m_ownerDocument != refNode->document())
+ setDocument(refNode->document());
+
m_start.setToStartOfNode(refNode);
m_end.setToEndOfNode(refNode);
}
diff --git a/WebCore/dom/Range.h b/WebCore/dom/Range.h
index c81bf45..9834aec 100644
--- a/WebCore/dom/Range.h
+++ b/WebCore/dom/Range.h
@@ -135,6 +135,8 @@ private:
Range(PassRefPtr<Document>);
Range(PassRefPtr<Document>, PassRefPtr<Node> startContainer, int startOffset, PassRefPtr<Node> endContainer, int endOffset);
+ void setDocument(Document*);
+
Node* checkNodeWOffset(Node*, int offset, ExceptionCode&) const;
void checkNodeBA(Node*, ExceptionCode&) const;
void checkDeleteExtract(ExceptionCode&);
diff --git a/WebCore/dom/ScriptElement.cpp b/WebCore/dom/ScriptElement.cpp
index bb46f0a..46c85e3 100644
--- a/WebCore/dom/ScriptElement.cpp
+++ b/WebCore/dom/ScriptElement.cpp
@@ -264,6 +264,8 @@ bool ScriptElementData::shouldExecuteAsJavaScript() const
WinIE 7 accepts ecmascript and jscript, but Mozilla 1.8 doesn't.
Neither Mozilla 1.8 nor WinIE 7 accept leading or trailing whitespace.
We want to accept all the values that either of these browsers accept, but not other values.
+
+ FIXME: Is this HTML5 compliant?
*/
String type = m_scriptElement->typeAttributeValue();
if (!type.isEmpty()) {
@@ -276,20 +278,20 @@ bool ScriptElementData::shouldExecuteAsJavaScript() const
}
// No type or language is specified, so we assume the script to be JavaScript.
- // We don't yet support setting event listeners via the 'for' attribute for scripts.
- // If there is such an attribute it's likely better to not execute the script than to do so
- // immediately and unconditionally.
- // FIXME: After <rdar://problem/4471751> / https://bugs.webkit.org/show_bug.cgi?id=16915 are resolved
- // and we support the for syntax in script tags, this check can be removed and we should just
- // return 'true' here.
+
String forAttribute = m_scriptElement->forAttributeValue();
String eventAttribute = m_scriptElement->eventAttributeValue();
- if (forAttribute.isEmpty() || eventAttribute.isEmpty())
- return true;
+ if (!forAttribute.isEmpty() && !eventAttribute.isEmpty()) {
+ forAttribute = forAttribute.stripWhiteSpace();
+ if (!equalIgnoringCase(forAttribute, "window"))
+ return false;
+
+ eventAttribute = eventAttribute.stripWhiteSpace();
+ if (!equalIgnoringCase(eventAttribute, "onload") && !equalIgnoringCase(eventAttribute, "onload()"))
+ return false;
+ }
- forAttribute = forAttribute.stripWhiteSpace();
- eventAttribute = eventAttribute.stripWhiteSpace();
- return equalIgnoringCase(forAttribute, "window") && (equalIgnoringCase(eventAttribute, "onload") || equalIgnoringCase(eventAttribute, "onload()"));
+ return true;
}
String ScriptElementData::scriptCharset() const
diff --git a/WebCore/dom/ScriptExecutionContext.cpp b/WebCore/dom/ScriptExecutionContext.cpp
index d014d47..bfda17b 100644
--- a/WebCore/dom/ScriptExecutionContext.cpp
+++ b/WebCore/dom/ScriptExecutionContext.cpp
@@ -87,20 +87,17 @@ ScriptExecutionContext::~ScriptExecutionContext()
m_databaseThread = 0;
}
#endif
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
if (m_fileThread) {
m_fileThread->stop();
m_fileThread = 0;
}
#endif
- HashSet<Blob*>::iterator blobsEnd = m_blobs.end();
- for (HashSet<Blob*>::iterator iter = m_blobs.begin(); iter != blobsEnd; ++iter)
- (*iter)->contextDestroyed();
#if ENABLE(BLOB)
HashSet<String>::iterator publicBlobURLsEnd = m_publicBlobURLs.end();
for (HashSet<String>::iterator iter = m_publicBlobURLs.begin(); iter != publicBlobURLsEnd; ++iter)
- ThreadableBlobRegistry::unregisterBlobURL(this, KURL(ParsedURLString, *iter));
+ ThreadableBlobRegistry::unregisterBlobURL(KURL(ParsedURLString, *iter));
#endif
}
@@ -175,18 +172,6 @@ void ScriptExecutionContext::destroyedMessagePort(MessagePort* port)
m_messagePorts.remove(port);
}
-void ScriptExecutionContext::addBlob(Blob* blob)
-{
- ASSERT(blob);
- m_blobs.add(blob);
-}
-
-void ScriptExecutionContext::removeBlob(Blob* blob)
-{
- ASSERT(blob);
- m_blobs.remove(blob);
-}
-
bool ScriptExecutionContext::canSuspendActiveDOMObjects()
{
// No protection against m_activeDOMObjects changing during iteration: canSuspend() shouldn't execute arbitrary JS.
@@ -199,13 +184,13 @@ bool ScriptExecutionContext::canSuspendActiveDOMObjects()
return true;
}
-void ScriptExecutionContext::suspendActiveDOMObjects()
+void ScriptExecutionContext::suspendActiveDOMObjects(ActiveDOMObject::ReasonForSuspension why)
{
// No protection against m_activeDOMObjects changing during iteration: suspend() shouldn't execute arbitrary JS.
HashMap<ActiveDOMObject*, void*>::iterator activeObjectsEnd = m_activeDOMObjects.end();
for (HashMap<ActiveDOMObject*, void*>::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) {
ASSERT(iter->first->scriptExecutionContext() == this);
- iter->first->suspend();
+ iter->first->suspend(why);
}
}
@@ -277,8 +262,10 @@ DOMTimer* ScriptExecutionContext::findTimeout(int timeoutId)
#if ENABLE(BLOB)
KURL ScriptExecutionContext::createPublicBlobURL(Blob* blob)
{
- KURL publicURL = BlobURL::createURL(this);
- ThreadableBlobRegistry::registerBlobURL(this, publicURL, blob->url());
+ if (!blob)
+ return KURL();
+ KURL publicURL = BlobURL::createPublicURL(securityOrigin());
+ ThreadableBlobRegistry::registerBlobURL(publicURL, blob->url());
m_publicBlobURLs.add(publicURL.string());
return publicURL;
}
@@ -286,13 +273,13 @@ KURL ScriptExecutionContext::createPublicBlobURL(Blob* blob)
void ScriptExecutionContext::revokePublicBlobURL(const KURL& url)
{
if (m_publicBlobURLs.contains(url.string())) {
- ThreadableBlobRegistry::unregisterBlobURL(this, url);
+ ThreadableBlobRegistry::unregisterBlobURL(url);
m_publicBlobURLs.remove(url.string());
}
}
#endif
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
FileThread* ScriptExecutionContext::fileThread()
{
if (!m_fileThread) {
diff --git a/WebCore/dom/ScriptExecutionContext.h b/WebCore/dom/ScriptExecutionContext.h
index 30c12e5..d39cb64 100644
--- a/WebCore/dom/ScriptExecutionContext.h
+++ b/WebCore/dom/ScriptExecutionContext.h
@@ -27,6 +27,7 @@
#ifndef ScriptExecutionContext_h
#define ScriptExecutionContext_h
+#include "ActiveDOMObject.h"
#include "Console.h"
#include "KURL.h"
#include <wtf/Forward.h>
@@ -44,7 +45,6 @@
namespace WebCore {
- class ActiveDOMObject;
class Blob;
#if ENABLE(DATABASE)
class Database;
@@ -52,7 +52,7 @@ namespace WebCore {
class DatabaseThread;
#endif
class DOMTimer;
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
class FileThread;
#endif
class MessagePort;
@@ -99,7 +99,7 @@ namespace WebCore {
bool canSuspendActiveDOMObjects();
// Active objects can be asked to suspend even if canSuspendActiveDOMObjects() returns 'false' -
// step-by-step JS debugging is one example.
- void suspendActiveDOMObjects();
+ void suspendActiveDOMObjects(ActiveDOMObject::ReasonForSuspension);
void resumeActiveDOMObjects();
void stopActiveDOMObjects();
void createdActiveDOMObject(ActiveDOMObject*, void* upcastPointer);
@@ -131,8 +131,6 @@ namespace WebCore {
void removeTimeout(int timeoutId);
DOMTimer* findTimeout(int timeoutId);
- void addBlob(Blob*);
- void removeBlob(Blob*);
#if ENABLE(BLOB)
KURL createPublicBlobURL(Blob*);
void revokePublicBlobURL(const KURL&);
@@ -142,7 +140,7 @@ namespace WebCore {
JSC::JSGlobalData* globalData();
#endif
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
FileThread* fileThread();
void stopFileThread();
#endif
@@ -167,7 +165,6 @@ namespace WebCore {
HashMap<int, DOMTimer*> m_timeouts;
- HashSet<Blob*> m_blobs;
#if ENABLE(BLOB)
HashSet<String> m_publicBlobURLs;
#endif
@@ -180,7 +177,7 @@ namespace WebCore {
bool m_hasOpenDatabases; // This never changes back to false, even after the database thread is closed.
#endif
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
RefPtr<FileThread> m_fileThread;
#endif
};
diff --git a/WebCore/dom/Touch.cpp b/WebCore/dom/Touch.cpp
index 585d9d4..fbb3fed 100644
--- a/WebCore/dom/Touch.cpp
+++ b/WebCore/dom/Touch.cpp
@@ -40,7 +40,7 @@ static int contentsX(Frame* frame)
FrameView* frameView = frame->view();
if (!frameView)
return 0;
- return frameView->scrollX() / frameView->pageZoomFactor();
+ return frameView->scrollX() / frame->pageZoomFactor();
}
static int contentsY(Frame* frame)
@@ -50,11 +50,10 @@ static int contentsY(Frame* frame)
FrameView* frameView = frame->view();
if (!frameView)
return 0;
- return frameView->scrollY() / frameView->pageZoomFactor();
+ return frameView->scrollY() / frame->pageZoomFactor();
}
-Touch::Touch(Frame* frame, EventTarget* target, unsigned identifier,
- int screenX, int screenY, int pageX, int pageY)
+Touch::Touch(Frame* frame, EventTarget* target, unsigned identifier, int screenX, int screenY, int pageX, int pageY)
: m_target(target)
, m_identifier(identifier)
, m_clientX(pageX - contentsX(frame))
@@ -69,4 +68,3 @@ Touch::Touch(Frame* frame, EventTarget* target, unsigned identifier,
} // namespace WebCore
#endif
-
diff --git a/WebCore/dom/ViewportArguments.cpp b/WebCore/dom/ViewportArguments.cpp
index 9f831dd..356f9ed 100644
--- a/WebCore/dom/ViewportArguments.cpp
+++ b/WebCore/dom/ViewportArguments.cpp
@@ -5,6 +5,7 @@
* (C) 2006 Alexey Proskuryakov (ap@webkit.org)
* Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -31,76 +32,275 @@
#include "DOMWindow.h"
#include "Document.h"
#include "Frame.h"
+#include "IntSize.h"
#include "Page.h"
#include "PlatformString.h"
#include "ScriptableDocumentParser.h"
+using namespace std;
+
namespace WebCore {
+ViewportConfiguration findConfigurationForViewportData(ViewportArguments args, int desktopWidth, int deviceWidth, int deviceHeight, int deviceDPI, IntSize visibleViewport)
+{
+ ViewportConfiguration result;
+
+ float availableWidth = visibleViewport.width();
+ float availableHeight = visibleViewport.height();
+
+ ASSERT(availableWidth > 0 && availableHeight > 0);
+
+ switch (int(args.width)) {
+ case ViewportArguments::ValueDesktopWidth:
+ args.width = desktopWidth;
+ break;
+ case ViewportArguments::ValueDeviceWidth:
+ args.width = deviceWidth;
+ break;
+ case ViewportArguments::ValueDeviceHeight:
+ args.width = deviceHeight;
+ break;
+ }
+
+ switch (int(args.height)) {
+ case ViewportArguments::ValueDesktopWidth:
+ args.height = desktopWidth;
+ break;
+ case ViewportArguments::ValueDeviceWidth:
+ args.height = deviceWidth;
+ break;
+ case ViewportArguments::ValueDeviceHeight:
+ args.height = deviceHeight;
+ break;
+ }
+
+ result.devicePixelRatio = float(deviceDPI / 160.0);
+
+ // Resolve non-'auto' width and height to pixel values.
+ if (deviceDPI != 1.0) {
+ deviceWidth /= result.devicePixelRatio;
+ deviceHeight /= result.devicePixelRatio;
+
+ if (args.width != ViewportArguments::ValueAuto)
+ args.width /= result.devicePixelRatio;
+ if (args.height != ViewportArguments::ValueAuto)
+ args.height /= result.devicePixelRatio;
+ }
+
+ // Clamp values to range defined by spec and resolve minimum-scale and maximum-scale values
+ if (args.width != ViewportArguments::ValueAuto)
+ args.width = min(float(10000), max(args.width, float(1)));
+ if (args.height != ViewportArguments::ValueAuto)
+ args.height = min(float(10000), max(args.height, float(1)));
+
+ if (args.initialScale != ViewportArguments::ValueAuto)
+ args.initialScale = min(float(10), max(args.initialScale, float(0.1)));
+ if (args.minimumScale != ViewportArguments::ValueAuto)
+ args.minimumScale = min(float(10), max(args.minimumScale, float(0.1)));
+ if (args.maximumScale != ViewportArguments::ValueAuto)
+ args.maximumScale = min(float(10), max(args.maximumScale, float(0.1)));
+
+ // Resolve minimum-scale and maximum-scale values according to spec.
+ if (args.minimumScale == ViewportArguments::ValueAuto)
+ result.minimumScale = float(0.25);
+ else
+ result.minimumScale = args.minimumScale;
+
+ if (args.maximumScale == ViewportArguments::ValueAuto) {
+ result.maximumScale = float(5.0);
+ result.minimumScale = min(float(5.0), result.minimumScale);
+ } else
+ result.maximumScale = args.maximumScale;
+ result.maximumScale = max(result.minimumScale, result.maximumScale);
+
+ // Resolve initial-scale value.
+ result.initialScale = args.initialScale;
+ if (result.initialScale == ViewportArguments::ValueAuto) {
+ result.initialScale = availableWidth / desktopWidth;
+ if (args.width != ViewportArguments::ValueAuto)
+ result.initialScale = availableWidth / args.width;
+ if (args.height != ViewportArguments::ValueAuto) {
+ // if 'auto', the initial-scale will be negative here and thus ignored.
+ result.initialScale = max(result.initialScale, availableHeight / args.height);
+ }
+ }
+
+ // Constrain initial-scale value to minimum-scale/maximum-scale range.
+ result.initialScale = min(result.maximumScale, max(result.minimumScale, result.initialScale));
+
+ // Resolve width value.
+ float width;
+ if (args.width != ViewportArguments::ValueAuto)
+ width = args.width;
+ else {
+ if (args.initialScale == ViewportArguments::ValueAuto)
+ width = desktopWidth;
+ else if (args.height != ViewportArguments::ValueAuto)
+ width = args.height * (availableWidth / availableHeight);
+ else
+ width = availableWidth / result.initialScale;
+ }
+
+ // Resolve height value.
+ float height;
+ if (args.height != ViewportArguments::ValueAuto)
+ height = args.height;
+ else
+ height = width * availableHeight / availableWidth;
+
+ // Extend width and height to fill the visual viewport for the resolved initial-scale.
+ width = max(width, availableWidth / result.initialScale);
+ height = max(height, availableHeight / result.initialScale);
+ result.layoutViewport.setWidth(width);
+ result.layoutViewport.setHeight(height);
+
+ // Update minimum scale factor, to never allow zooming out more than viewport
+ result.minimumScale = max(result.minimumScale, max(availableWidth / width, availableHeight / height));
+
+ return result;
+}
+
+static float findSizeValue(const String& keyString, const String& valueString, Document* document)
+{
+ // 1) Non-negative number values are translated to px lengths.
+ // 2) Negative number values are translated to auto.
+ // 3) device-width and device-height are used as keywords.
+ // 4) Other keywords and unknown values translate to 0.0.
+
+ if (equalIgnoringCase(valueString, "desktop-width"))
+ return ViewportArguments::ValueDesktopWidth;
+ if (equalIgnoringCase(valueString, "device-width"))
+ return ViewportArguments::ValueDeviceWidth;
+ if (equalIgnoringCase(valueString, "device-height"))
+ return ViewportArguments::ValueDeviceHeight;
+
+ bool ok;
+ float value = valueString.toFloat(&ok);
+ if (!ok) {
+ reportViewportWarning(document, UnrecognizedViewportArgumentError, keyString);
+ return float(0.0);
+ }
+
+ if (value < 0)
+ return ViewportArguments::ValueAuto;
+
+ if (keyString == "width")
+ reportViewportWarning(document, DeviceWidthShouldBeUsedWarning, keyString);
+ else if (keyString == "height")
+ reportViewportWarning(document, DeviceHeightShouldBeUsedWarning, keyString);
+
+ return value;
+}
+
+static float findScaleValue(const String& keyString, const String& valueString, Document* document)
+{
+ // 1) Non-negative number values are translated to <number> values.
+ // 2) Negative number values are translated to auto.
+ // 3) yes is translated to 1.0.
+ // 4) device-width and device-height are translated to 10.0.
+ // 5) no and unknown values are translated to 0.0
+
+ if (equalIgnoringCase(valueString, "yes"))
+ return float(1.0);
+ if (equalIgnoringCase(valueString, "no"))
+ return float(0.0);
+ if (equalIgnoringCase(valueString, "desktop-width"))
+ return float(10.0);
+ if (equalIgnoringCase(valueString, "device-width"))
+ return float(10.0);
+ if (equalIgnoringCase(valueString, "device-height"))
+ return float(10.0);
+
+ bool ok;
+ float value = valueString.toFloat(&ok);
+ if (!ok) {
+ reportViewportWarning(document, UnrecognizedViewportArgumentError, keyString);
+ return float(0.0);
+ }
+
+ if (value < 0)
+ return ViewportArguments::ValueAuto;
+
+ if (value > 10.0)
+ reportViewportWarning(document, MaximumScaleTooLargeError, keyString);
+
+ return value;
+}
+
+static bool findUserScalableValue(const String& keyString, const String& valueString, Document* document)
+{
+ // yes and no are used as keywords.
+ // Numbers >= 1, numbers <= -1, device-width and device-height are mapped to yes.
+ // Numbers in the range <-1, 1>, and unknown values, are mapped to no.
+
+ if (equalIgnoringCase(valueString, "yes"))
+ return true;
+ if (equalIgnoringCase(valueString, "no"))
+ return false;
+ if (equalIgnoringCase(valueString, "desktop-width"))
+ return true;
+ if (equalIgnoringCase(valueString, "device-width"))
+ return true;
+ if (equalIgnoringCase(valueString, "device-height"))
+ return true;
+
+ bool ok;
+ float value = valueString.toFloat(&ok);
+ if (!ok) {
+ reportViewportWarning(document, UnrecognizedViewportArgumentError, keyString);
+ return false;
+ }
+
+ if (fabs(value) < 1)
+ return false;
+
+ return true;
+}
+
+static float findTargetDensityDPIValue(const String& keyString, const String& valueString, Document* document)
+{
+ if (equalIgnoringCase(valueString, "device-dpi"))
+ return ViewportArguments::ValueDeviceDPI;
+ if (equalIgnoringCase(valueString, "low-dpi"))
+ return ViewportArguments::ValueLowDPI;
+ if (equalIgnoringCase(valueString, "medium-dpi"))
+ return ViewportArguments::ValueMediumDPI;
+ if (equalIgnoringCase(valueString, "high-dpi"))
+ return ViewportArguments::ValueHighDPI;
+
+ bool ok;
+ float value = valueString.toFloat(&ok);
+ if (!ok) {
+ reportViewportWarning(document, UnrecognizedViewportArgumentError, keyString);
+ return ViewportArguments::ValueAuto;
+ }
+
+ if (value < 70 || value > 400) {
+ reportViewportWarning(document, TargetDensityDpiTooSmallOrLargeError, keyString);
+ return ViewportArguments::ValueAuto;
+ }
+
+ return value;
+}
+
void setViewportFeature(const String& keyString, const String& valueString, Document* document, void* data)
{
ViewportArguments* arguments = static_cast<ViewportArguments*>(data);
- float value = ViewportArguments::ValueUndefined;
- bool didUseConstants = false;
- if (equalIgnoringCase(valueString, "yes"))
- value = 1;
- else if (equalIgnoringCase(valueString, "device-width")) {
- didUseConstants = true;
- if (document->page())
- value = document->page()->chrome()->windowRect().width();
- } else if (equalIgnoringCase(valueString, "device-height")) {
- didUseConstants = true;
- if (document->page())
- value = document->page()->chrome()->windowRect().height();
- } else if (equalIgnoringCase(valueString, "device-dpi")) {
- didUseConstants = true;
- // Default of today is 160dpi, resulting in a scaleFactor of 1.0.
- if (document->page())
- value = 160 * document->page()->chrome()->scaleFactor();
- } else if (equalIgnoringCase(valueString, "low-dpi")) {
- didUseConstants = true;
- value = 120;
- } else if (equalIgnoringCase(valueString, "medium-dpi")) {
- didUseConstants = true;
- value = 160;
- } else if (equalIgnoringCase(valueString, "high-dpi")) {
- didUseConstants = true;
- value = 240;
- } else if (equalIgnoringCase(valueString, "default")) // This allows us to distinguish the omission of a key from asking for the default value.
- value = -2;
- else if (valueString.length()) // listing a key with no value is shorthand for key=default
- value = valueString.toFloat();
-
- if (keyString == "initial-scale")
- arguments->initialScale = value;
+ if (keyString == "width")
+ arguments->width = findSizeValue(keyString, valueString, document);
+ else if (keyString == "height")
+ arguments->height = findSizeValue(keyString, valueString, document);
+ else if (keyString == "initial-scale")
+ arguments->initialScale = findScaleValue(keyString, valueString, document);
else if (keyString == "minimum-scale")
- arguments->minimumScale = value;
- else if (keyString == "maximum-scale") {
- arguments->maximumScale = value;
- if (value > 10.0)
- reportViewportWarning(document, MaximumScaleTooLargeError, keyString);
- } else if (keyString == "user-scalable")
- arguments->userScalable = value;
- else if (keyString == "width") {
- if (document->page() && value == document->page()->chrome()->windowRect().width() && !didUseConstants)
- reportViewportWarning(document, DeviceWidthShouldBeUsedWarning, keyString);
- else if (document->page() && value == document->page()->chrome()->windowRect().height() && !didUseConstants)
- reportViewportWarning(document, DeviceHeightShouldBeUsedWarning, keyString);
-
- arguments->width = value;
- } else if (keyString == "height") {
- if (document->page() && value == document->page()->chrome()->windowRect().width() && !didUseConstants)
- reportViewportWarning(document, DeviceWidthShouldBeUsedWarning, keyString);
- else if (document->page() && value == document->page()->chrome()->windowRect().height() && !didUseConstants)
- reportViewportWarning(document, DeviceHeightShouldBeUsedWarning, keyString);
- arguments->height = value;
- } else if (keyString == "target-densitydpi" || keyString == "target-densityDpi") {
- if (!didUseConstants && (value < 70 || value > 400))
- reportViewportWarning(document, TargetDensityDpiTooSmallOrLargeError, keyString);
- arguments->targetDensityDpi = value;
- } else
- reportViewportWarning(document, UnrecognizedViewportArgumentError, keyString);
+ arguments->minimumScale = findScaleValue(keyString, valueString, document);
+ else if (keyString == "maximum-scale")
+ arguments->maximumScale = findScaleValue(keyString, valueString, document);
+ else if (keyString == "user-scalable")
+ arguments->userScalable = findUserScalableValue(keyString, valueString, document);
+ else if (keyString == "target-densitydpi")
+ arguments->targetDensityDpi = findTargetDensityDPIValue(keyString, valueString, document);
}
static const char* viewportErrorMessageTemplate(ViewportErrorCode errorCode)
diff --git a/WebCore/dom/ViewportArguments.h b/WebCore/dom/ViewportArguments.h
index 1fac0df..5731842 100644
--- a/WebCore/dom/ViewportArguments.h
+++ b/WebCore/dom/ViewportArguments.h
@@ -5,6 +5,7 @@
* (C) 2006 Alexey Proskuryakov (ap@webkit.org)
* Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -26,6 +27,7 @@
#ifndef ViewportArguments_h
#define ViewportArguments_h
+#include "IntSize.h"
#include <wtf/Forward.h>
namespace WebCore {
@@ -40,18 +42,37 @@ enum ViewportErrorCode {
TargetDensityDpiTooSmallOrLargeError
};
+struct ViewportConfiguration {
+ IntSize layoutViewport;
+
+ float devicePixelRatio;
+
+ float initialScale;
+ float minimumScale;
+ float maximumScale;
+};
+
struct ViewportArguments {
- enum { ValueUndefined = -1 };
+ enum {
+ ValueAuto = -1,
+ ValueDesktopWidth = -2,
+ ValueDeviceWidth = -3,
+ ValueDeviceHeight = -4,
+ ValueDeviceDPI = -5,
+ ValueLowDPI = -6,
+ ValueMediumDPI = -7,
+ ValueHighDPI = -8
+ };
ViewportArguments()
- : initialScale(ValueUndefined)
- , minimumScale(ValueUndefined)
- , maximumScale(ValueUndefined)
- , width(ValueUndefined)
- , height(ValueUndefined)
- , targetDensityDpi(ValueUndefined)
- , userScalable(ValueUndefined)
+ : initialScale(ValueAuto)
+ , minimumScale(ValueAuto)
+ , maximumScale(ValueAuto)
+ , width(ValueAuto)
+ , height(ValueAuto)
+ , targetDensityDpi(ValueAuto)
+ , userScalable(ValueAuto)
{
}
@@ -66,10 +87,12 @@ struct ViewportArguments {
bool hasCustomArgument() const
{
- return initialScale != ValueUndefined || minimumScale != ValueUndefined || maximumScale != ValueUndefined || width != ValueUndefined || height != ValueUndefined || userScalable != ValueUndefined || targetDensityDpi != ValueUndefined;
+ return initialScale != ValueAuto || minimumScale != ValueAuto || maximumScale != ValueAuto || width != ValueAuto || height != ValueAuto || userScalable != ValueAuto || targetDensityDpi != ValueAuto;
}
};
+ViewportConfiguration findConfigurationForViewportData(ViewportArguments args, int desktopWidth, int deviceWidth, int deviceHeight, int deviceDPI, IntSize visibleViewport);
+
void setViewportFeature(const String& keyString, const String& valueString, Document*, void* data);
void reportViewportWarning(Document*, ViewportErrorCode, const String& replacement);
diff --git a/WebCore/dom/XMLDocumentParser.h b/WebCore/dom/XMLDocumentParser.h
index 47e65c6..358be1f 100644
--- a/WebCore/dom/XMLDocumentParser.h
+++ b/WebCore/dom/XMLDocumentParser.h
@@ -320,9 +320,9 @@ public:
int m_scriptStartLine;
bool m_parsingFragment;
- String m_defaultNamespaceURI;
+ AtomicString m_defaultNamespaceURI;
- typedef HashMap<String, String> PrefixForNamespaceMap;
+ typedef HashMap<AtomicString, AtomicString> PrefixForNamespaceMap;
PrefixForNamespaceMap m_prefixToNamespaceMap;
SegmentedString m_pendingSrc;
FragmentScriptingPermission m_scriptingPermission;
diff --git a/WebCore/dom/XMLDocumentParserLibxml2.cpp b/WebCore/dom/XMLDocumentParserLibxml2.cpp
index 927fbbe..5539072 100644
--- a/WebCore/dom/XMLDocumentParserLibxml2.cpp
+++ b/WebCore/dom/XMLDocumentParserLibxml2.cpp
@@ -1,11 +1,12 @@
/*
- * Copyright (C) 2000 Peter Kelly (pmk@post.com)
+ * Copyright (C) 2000 Peter Kelly <pmk@post.com>
* Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
- * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
+ * Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
+ * Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
* Copyright (C) 2008 Holger Hans Peter Freyther
* Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -671,17 +672,26 @@ void XMLDocumentParser::doWrite(const String& parseString)
}
}
-static inline String toString(const xmlChar* str, unsigned len)
+static inline String toString(const xmlChar* string, size_t size)
{
- return UTF8Encoding().decode(reinterpret_cast<const char*>(str), len);
+ return String::fromUTF8(reinterpret_cast<const char*>(string), size);
}
-static inline String toString(const xmlChar* str)
+static inline String toString(const xmlChar* string)
{
- if (!str)
- return String();
+ return String::fromUTF8(reinterpret_cast<const char*>(string));
+}
- return UTF8Encoding().decode(reinterpret_cast<const char*>(str), strlen(reinterpret_cast<const char*>(str)));
+static inline AtomicString toAtomicString(const xmlChar* string, size_t size)
+{
+ // FIXME: Use AtomicString::fromUTF8.
+ return AtomicString(toString(string, size));
+}
+
+static inline AtomicString toAtomicString(const xmlChar* string)
+{
+ // FIXME: Use AtomicString::fromUTF8.
+ return AtomicString(toString(string));
}
struct _xmlSAX2Namespace {
@@ -695,7 +705,7 @@ static inline void handleElementNamespaces(Element* newElement, const xmlChar**
xmlSAX2Namespace* namespaces = reinterpret_cast<xmlSAX2Namespace*>(libxmlNamespaces);
for (int i = 0; i < nb_namespaces; i++) {
AtomicString namespaceQName = xmlnsAtom;
- String namespaceURI = toString(namespaces[i].uri);
+ AtomicString namespaceURI = toAtomicString(namespaces[i].uri);
if (namespaces[i].prefix)
namespaceQName = "xmlns:" + toString(namespaces[i].prefix);
newElement->setAttributeNS(XMLNSNames::xmlnsNamespaceURI, namespaceQName, namespaceURI, ec, scriptingPermission);
@@ -717,12 +727,11 @@ static inline void handleElementAttributes(Element* newElement, const xmlChar**
{
xmlSAX2Attributes* attributes = reinterpret_cast<xmlSAX2Attributes*>(libxmlAttributes);
for (int i = 0; i < nb_attributes; i++) {
- String attrLocalName = toString(attributes[i].localname);
- int valueLength = (int) (attributes[i].end - attributes[i].value);
- String attrValue = toString(attributes[i].value, valueLength);
+ int valueLength = static_cast<int>(attributes[i].end - attributes[i].value);
+ AtomicString attrValue = toAtomicString(attributes[i].value, valueLength);
String attrPrefix = toString(attributes[i].prefix);
- String attrURI = attrPrefix.isEmpty() ? String() : toString(attributes[i].uri);
- String attrQName = attrPrefix.isEmpty() ? attrLocalName : attrPrefix + ":" + attrLocalName;
+ AtomicString attrURI = attrPrefix.isEmpty() ? AtomicString() : toAtomicString(attributes[i].uri);
+ AtomicString attrQName = attrPrefix.isEmpty() ? toAtomicString(attributes[i].localname) : AtomicString(attrPrefix + ":" + toString(attributes[i].localname));
newElement->setAttributeNS(attrURI, attrQName, attrValue, ec, scriptingPermission);
if (ec) // exception setting attributes
@@ -752,9 +761,9 @@ void XMLDocumentParser::startElementNs(const xmlChar* xmlLocalName, const xmlCha
exitText();
- String localName = toString(xmlLocalName);
- String uri = toString(xmlURI);
- String prefix = toString(xmlPrefix);
+ AtomicString localName = toAtomicString(xmlLocalName);
+ AtomicString uri = toAtomicString(xmlURI);
+ AtomicString prefix = toAtomicString(xmlPrefix);
if (m_parsingFragment && uri.isNull()) {
if (!prefix.isNull())
diff --git a/WebCore/editing/ApplyStyleCommand.cpp b/WebCore/editing/ApplyStyleCommand.cpp
index d104cbe..b2e93ec 100644
--- a/WebCore/editing/ApplyStyleCommand.cpp
+++ b/WebCore/editing/ApplyStyleCommand.cpp
@@ -464,7 +464,7 @@ PassRefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::editingStyleAtPosition
}
if (shouldIncludeTypingStyle == IncludeTypingStyle) {
- CSSMutableStyleDeclaration* typingStyle = pos.node()->document()->frame()->typingStyle();
+ CSSMutableStyleDeclaration* typingStyle = pos.node()->document()->frame()->selection()->typingStyle();
if (typingStyle)
style->merge(typingStyle);
}
@@ -1071,6 +1071,20 @@ void ApplyStyleCommand::fixRangeAndApplyInlineStyle(CSSMutableStyleDeclaration*
applyInlineStyleToNodeRange(style, startNode, pastEndNode);
}
+static bool containsNonEditableRegion(Node* node)
+{
+ if (!node->isContentEditable())
+ return true;
+
+ Node* sibling = node->traverseNextSibling();
+ for (Node* descendent = node->firstChild(); descendent && descendent != sibling; descendent = descendent->traverseNextNode()) {
+ if (!descendent->isContentEditable())
+ return true;
+ }
+
+ return false;
+}
+
void ApplyStyleCommand::applyInlineStyleToNodeRange(CSSMutableStyleDeclaration* style, Node* node, Node* pastEndNode)
{
for (Node* next; node && node != pastEndNode; node = next) {
@@ -1098,32 +1112,62 @@ void ApplyStyleCommand::applyInlineStyleToNodeRange(CSSMutableStyleDeclaration*
continue;
if (node->childNodeCount()) {
- if (editingIgnoresContent(node))
+ if (node->contains(pastEndNode) || containsNonEditableRegion(node) || !node->parentNode()->isContentEditable())
+ continue;
+ if (editingIgnoresContent(node)) {
next = node->traverseNextSibling();
- continue;
+ continue;
+ }
}
Node* runEnd = node;
Node* sibling = node->nextSibling();
- StyleChange startChange(style, Position(node, 0));
while (sibling && sibling != pastEndNode && !sibling->contains(pastEndNode)
&& (!isBlock(sibling) || sibling->hasTagName(brTag))
- && StyleChange(style, Position(sibling, 0)) == startChange) {
+ && !containsNonEditableRegion(sibling)) {
runEnd = sibling;
sibling = runEnd->nextSibling();
}
next = runEnd->traverseNextSibling();
+
+ if (!removeStyleFromRunBeforeApplyingStyle(style, node, runEnd))
+ continue;
addInlineStyleIfNeeded(style, node, runEnd, m_removeOnly ? DoNotAddStyledElement : AddStyledElement);
}
}
+bool ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle(CSSMutableStyleDeclaration* style, Node*& runStart, Node*& runEnd)
+{
+ Node* pastEndNode = runEnd->traverseNextSibling();
+ Node* next;
+ for (Node* node = runStart; node && node != pastEndNode; node = next) {
+ next = node->traverseNextNode();
+ if (!node->isHTMLElement())
+ continue;
+
+ Node* previousSibling = node->previousSibling();
+ Node* nextSibling = node->nextSibling();
+ Node* parent = node->parentNode();
+ removeInlineStyleFromElement(style, static_cast<HTMLElement*>(node), RemoveAlways);
+ if (!node->inDocument()) {
+ // FIXME: We might need to update the start and the end of current selection here but need a test.
+ if (runStart == node)
+ runStart = previousSibling ? previousSibling->nextSibling() : parent->firstChild();
+ if (runEnd == node)
+ runEnd = nextSibling ? nextSibling->previousSibling() : parent->lastChild();
+ }
+ }
+
+ return true;
+}
+
bool ApplyStyleCommand::removeInlineStyleFromElement(CSSMutableStyleDeclaration* style, HTMLElement* element, InlineStyleRemovalMode mode)
{
ASSERT(style);
ASSERT(element);
if (m_styledInlineElement && element->hasTagName(m_styledInlineElement->tagQName())) {
- if (mode == RemoveAttributesAndElements)
+ if (mode != RemoveNone)
removeNodePreservingChildren(element);
return true;
}
@@ -1220,10 +1264,12 @@ bool ApplyStyleCommand::removeImplicitlyStyledElement(CSSMutableStyleDeclaration
else
mapValue = CSSPrimitiveValue::createIdentifier(equivalent.primitiveId).get();
- if (equivalent.isValueList && styleValue->isValueList() && static_cast<CSSValueList*>(styleValue.get())->hasValue(mapValue.get()))
- continue; // If CSS value assumes CSSValueList, then only skip if the value was present in style to apply.
- else if (mapValue && styleValue->cssText() == mapValue->cssText())
- continue; // If CSS value is primitive, then skip if they are equal.
+ if (mode != RemoveAlways) {
+ if (equivalent.isValueList && styleValue->isValueList() && static_cast<CSSValueList*>(styleValue.get())->hasValue(mapValue.get()))
+ continue; // If CSS value assumes CSSValueList, then only skip if the value was present in style to apply.
+ else if (mapValue && styleValue->cssText() == mapValue->cssText())
+ continue; // If CSS value is primitive, then skip if they are equal.
+ }
if (extractedStyle)
extractedStyle->setProperty(equivalent.propertyID, mapValue->cssText());
@@ -1342,7 +1388,7 @@ PassRefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::extractInlineStyleToPu
if (!style) {
style = CSSMutableStyleDeclaration::create();
- removeImplicitlyStyledElement(styleToApply, element, RemoveAttributesAndElements, style.get());
+ removeImplicitlyStyledElement(styleToApply, element, RemoveIfNeeded, style.get());
return style.release();
}
@@ -1364,7 +1410,7 @@ PassRefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::extractInlineStyleToPu
if (isSpanWithoutAttributesOrUnstyleStyleSpan(element))
removeNodePreservingChildren(element);
- removeImplicitlyStyledElement(styleToApply, element, RemoveAttributesAndElements, style.get());
+ removeImplicitlyStyledElement(styleToApply, element, RemoveIfNeeded, style.get());
return style.release();
}
diff --git a/WebCore/editing/ApplyStyleCommand.h b/WebCore/editing/ApplyStyleCommand.h
index 9f297e2..78f592e 100644
--- a/WebCore/editing/ApplyStyleCommand.h
+++ b/WebCore/editing/ApplyStyleCommand.h
@@ -42,7 +42,7 @@ enum ShouldIncludeTypingStyle {
class ApplyStyleCommand : public CompositeEditCommand {
public:
enum EPropertyLevel { PropertyDefault, ForceBlockProperties };
- enum InlineStyleRemovalMode { RemoveAttributesAndElements, RemoveNone };
+ enum InlineStyleRemovalMode { RemoveIfNeeded, RemoveAlways, RemoveNone };
enum EAddStyledElement { AddStyledElement, DoNotAddStyledElement };
static PassRefPtr<ApplyStyleCommand> create(Document* document, CSSStyleDeclaration* style, EditAction action = EditActionChangeAttributes, EPropertyLevel level = PropertyDefault)
@@ -71,11 +71,12 @@ private:
CSSMutableStyleDeclaration* style() const { return m_style.get(); }
// style-removal helpers
- bool removeInlineStyleFromElement(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveAttributesAndElements);
+ bool removeStyleFromRunBeforeApplyingStyle(CSSMutableStyleDeclaration* style, Node*& runStart, Node*& runEnd);
+ bool removeInlineStyleFromElement(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveIfNeeded);
inline bool shouldRemoveInlineStyleFromElement(CSSMutableStyleDeclaration* style, HTMLElement* element) {return removeInlineStyleFromElement(style, element, RemoveNone);}
bool removeImplicitlyStyledElement(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode, CSSMutableStyleDeclaration* extractedStyle = 0);
void replaceWithSpanOrRemoveIfWithoutAttributes(HTMLElement*&);
- bool removeCSSStyle(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveAttributesAndElements);
+ bool removeCSSStyle(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveIfNeeded);
HTMLElement* highestAncestorWithConflictingInlineStyle(CSSMutableStyleDeclaration*, Node*);
PassRefPtr<CSSMutableStyleDeclaration> extractInlineStyleToPushDown(CSSMutableStyleDeclaration*, Node*, bool isStyledElement);
void applyInlineStyleToPushDown(Node*, CSSMutableStyleDeclaration *style);
diff --git a/WebCore/editing/DeleteButton.cpp b/WebCore/editing/DeleteButton.cpp
index 91991cf..7f2fec0 100644
--- a/WebCore/editing/DeleteButton.cpp
+++ b/WebCore/editing/DeleteButton.cpp
@@ -50,14 +50,10 @@ PassRefPtr<DeleteButton> DeleteButton::create(Document* document)
void DeleteButton::defaultEventHandler(Event* event)
{
- // FIXME: Is it really import to check the type of the event?
- // Seems OK to respond to any event named click even if it does not have the correct type.
- if (event->isMouseEvent()) {
- if (event->type() == eventNames().clickEvent) {
- document()->frame()->editor()->deleteButtonController()->deleteTarget();
- event->setDefaultHandled();
- // FIXME: Shouldn't we return here instead of falling through?
- }
+ if (event->type() == eventNames().clickEvent) {
+ document()->frame()->editor()->deleteButtonController()->deleteTarget();
+ event->setDefaultHandled();
+ return;
}
HTMLImageElement::defaultEventHandler(event);
diff --git a/WebCore/editing/DeleteSelectionCommand.cpp b/WebCore/editing/DeleteSelectionCommand.cpp
index 70f0e88..4aa5c3c 100644
--- a/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/WebCore/editing/DeleteSelectionCommand.cpp
@@ -714,7 +714,7 @@ void DeleteSelectionCommand::calculateTypingStyleAfterDelete()
// In this case if we start typing, the new characters should have the same style as the just deleted ones,
// but, if we change the selection, come back and start typing that style should be lost. Also see
// preserveTypingStyle() below.
- document()->frame()->setTypingStyle(m_typingStyle.get());
+ document()->frame()->selection()->setTypingStyle(m_typingStyle);
}
void DeleteSelectionCommand::clearTransientState()
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index c515bfc..24c1680 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -257,7 +257,7 @@ bool Editor::smartInsertDeleteEnabled()
bool Editor::canSmartCopyOrDelete()
{
- return client() && client()->smartInsertDeleteEnabled() && m_frame->selectionGranularity() == WordGranularity;
+ return client() && client()->smartInsertDeleteEnabled() && m_frame->selection()->granularity() == WordGranularity;
}
bool Editor::isSelectTrailingWhitespaceEnabled()
@@ -341,6 +341,7 @@ void Editor::pasteAsPlainTextWithPasteboard(Pasteboard* pasteboard)
pasteAsPlainText(text, canSmartReplaceWithPasteboard(pasteboard));
}
+#if !PLATFORM(MAC)
void Editor::pasteWithPasteboard(Pasteboard* pasteboard, bool allowPlainText)
{
RefPtr<Range> range = selectedRange();
@@ -349,6 +350,7 @@ void Editor::pasteWithPasteboard(Pasteboard* pasteboard, bool allowPlainText)
if (fragment && shouldInsertFragment(fragment, range, EditorInsertActionPasted))
pasteAsFragment(fragment, canSmartReplaceWithPasteboard(pasteboard), chosePlainText);
}
+#endif
bool Editor::canSmartReplaceWithPasteboard(Pasteboard* pasteboard)
{
@@ -359,10 +361,12 @@ bool Editor::shouldInsertFragment(PassRefPtr<DocumentFragment> fragment, PassRef
{
if (!client())
return false;
-
- Node* child = fragment->firstChild();
- if (child && fragment->lastChild() == child && child->isCharacterDataNode())
- return client()->shouldInsertText(static_cast<CharacterData*>(child)->data(), replacingDOMRange.get(), givenAction);
+
+ if (fragment) {
+ Node* child = fragment->firstChild();
+ if (child && fragment->lastChild() == child && child->isCharacterDataNode())
+ return client()->shouldInsertText(static_cast<CharacterData*>(child)->data(), replacingDOMRange.get(), givenAction);
+ }
return client()->shouldInsertNode(fragment.get(), replacingDOMRange.get(), givenAction);
}
@@ -551,7 +555,7 @@ WritingDirection Editor::textDirectionForSelection(bool& hasNestedOrMultipleEmbe
}
if (m_frame->selection()->isCaret()) {
- if (CSSMutableStyleDeclaration* typingStyle = m_frame->typingStyle()) {
+ if (CSSMutableStyleDeclaration* typingStyle = m_frame->selection()->typingStyle()) {
RefPtr<CSSValue> unicodeBidi = typingStyle->getPropertyCSSValue(CSSPropertyUnicodeBidi);
if (unicodeBidi) {
ASSERT(unicodeBidi->isPrimitiveValue());
@@ -947,12 +951,6 @@ String Editor::selectionStartCSSPropertyValue(int propertyID)
String value = selectionStyle->getPropertyValue(propertyID);
- if (nodeToRemove) {
- ExceptionCode ec = 0;
- nodeToRemove->remove(ec);
- ASSERT(!ec);
- }
-
// If background color is transparent, traverse parent nodes until we hit a different value or document root
// Also, if the selection is a range, ignore the background color at the start of selection,
// and find the background color of the common ancestor.
@@ -969,11 +967,17 @@ String Editor::selectionStartCSSPropertyValue(int propertyID)
}
if (propertyID == CSSPropertyFontSize) {
- RefPtr<CSSValue> value = selectionStyle->getPropertyCSSValue(CSSPropertyFontSize);
- ASSERT(value->isPrimitiveValue());
- int fontPixelSize = static_cast<CSSPrimitiveValue*>(value.get())->getIntValue(CSSPrimitiveValue::CSS_PX);
+ RefPtr<CSSValue> cssValue = selectionStyle->getPropertyCSSValue(CSSPropertyFontSize);
+ ASSERT(cssValue->isPrimitiveValue());
+ int fontPixelSize = static_cast<CSSPrimitiveValue*>(cssValue.get())->getIntValue(CSSPrimitiveValue::CSS_PX);
int size = CSSStyleSelector::legacyFontSize(m_frame->document(), fontPixelSize, selectionStyle->useFixedFontDefaultSize());
- return String::number(size);
+ value = String::number(size);
+ }
+
+ if (nodeToRemove) {
+ ExceptionCode ec = 0;
+ nodeToRemove->remove(ec);
+ ASSERT(!ec);
}
return value;
@@ -1011,7 +1015,7 @@ void Editor::appliedEditing(PassRefPtr<EditCommand> cmd)
changeSelectionAfterCommand(newSelection, false, false);
if (!cmd->preservesTypingStyle())
- m_frame->setTypingStyle(0);
+ m_frame->selection()->clearTypingStyle();
// Command will be equal to last edit command only in the case of typing
if (m_lastEditCommand.get() == cmd)
@@ -1116,7 +1120,7 @@ bool Editor::insertTextWithoutSendingTextEvent(const String& text, bool selectIn
// Reveal the current selection
if (Frame* editedFrame = document->frame())
if (Page* page = editedFrame->page())
- page->focusController()->focusedOrMainFrame()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
+ page->focusController()->focusedOrMainFrame()->selection()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
}
}
@@ -1193,8 +1197,6 @@ void Editor::copy()
didWriteSelectionToPasteboard();
}
-#if !PLATFORM(MAC)
-
void Editor::paste()
{
ASSERT(m_frame->document());
@@ -1211,8 +1213,6 @@ void Editor::paste()
loader->setAllowStaleResources(false);
}
-#endif
-
void Editor::pasteAsPlainText()
{
if (tryDHTMLPaste())
@@ -1451,9 +1451,7 @@ void Editor::toggleUnderline()
void Editor::setBaseWritingDirection(WritingDirection direction)
{
Node* focusedNode = frame()->document()->focusedNode();
- if (focusedNode && (focusedNode->hasTagName(textareaTag)
- || (focusedNode->hasTagName(inputTag) && (static_cast<HTMLInputElement*>(focusedNode)->inputType() == HTMLInputElement::TEXT
- || static_cast<HTMLInputElement*>(focusedNode)->inputType() == HTMLInputElement::SEARCH)))) {
+ if (focusedNode && (focusedNode->hasTagName(textareaTag) || (focusedNode->hasTagName(inputTag) && static_cast<HTMLInputElement*>(focusedNode)->isTextField()))) {
if (direction == NaturalWritingDirection)
return;
static_cast<HTMLElement*>(focusedNode)->setAttribute(dirAttr, direction == LeftToRightWritingDirection ? "ltr" : "rtl");
@@ -2132,7 +2130,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
// FIXME 4859190: This gets confused with doubled punctuation at the end of a paragraph
RefPtr<Range> badGrammarRange = TextIterator::subrange(grammarSearchRange.get(), grammarPhraseOffset + grammarDetail.location, grammarDetail.length);
frame()->selection()->setSelection(VisibleSelection(badGrammarRange.get(), SEL_DEFAULT_AFFINITY));
- frame()->revealSelection();
+ frame()->selection()->revealSelection();
client()->updateSpellingUIWithGrammarString(badGrammarPhrase, grammarDetail);
frame()->document()->markers()->addMarker(badGrammarRange.get(), DocumentMarker::Grammar, grammarDetail.userDescription);
@@ -2143,7 +2141,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
RefPtr<Range> misspellingRange = TextIterator::subrange(spellingSearchRange.get(), misspellingOffset, misspelledWord.length());
frame()->selection()->setSelection(VisibleSelection(misspellingRange.get(), DOWNSTREAM));
- frame()->revealSelection();
+ frame()->selection()->revealSelection();
client()->updateSpellingUIWithMisspelledWord(misspelledWord);
frame()->document()->markers()->addMarker(misspellingRange.get(), DocumentMarker::Spelling);
@@ -2435,7 +2433,7 @@ void Editor::markMisspellingsAfterTypingToPosition(const VisiblePosition &p)
if (!autocorrectedString.isEmpty()) {
VisibleSelection newSelection(misspellingRange.get(), DOWNSTREAM);
if (newSelection != frame()->selection()->selection()) {
- if (!frame()->shouldChangeSelection(newSelection))
+ if (!frame()->selection()->shouldChangeSelection(newSelection))
return;
frame()->selection()->setSelection(newSelection);
}
@@ -2709,7 +2707,7 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions textCh
}
}
if (doReplacement && !shouldShowCorrectionPanel && selectionToReplace != m_frame->selection()->selection()) {
- if (m_frame->shouldChangeSelection(selectionToReplace)) {
+ if (m_frame->selection()->shouldChangeSelection(selectionToReplace)) {
m_frame->selection()->setSelection(selectionToReplace);
selectionChanged = true;
} else {
@@ -2854,6 +2852,15 @@ void Editor::handleCancelOperation()
#endif
}
+bool Editor::isShowingCorrectionPanel()
+{
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+ if (client())
+ return client()->isShowingCorrectionPanel();
+#endif
+ return false;
+}
+
PassRefPtr<Range> Editor::rangeForPoint(const IntPoint& windowPoint)
{
Document* document = m_frame->documentAtPoint(windowPoint);
@@ -2875,7 +2882,7 @@ void Editor::revealSelectionAfterEditingOperation()
if (m_ignoreCompositionSelectionChange)
return;
- m_frame->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
+ m_frame->selection()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
}
void Editor::setIgnoreCompositionSelectionChange(bool ignore)
@@ -2952,7 +2959,7 @@ void Editor::transpose()
// Select the two characters.
if (newSelection != m_frame->selection()->selection()) {
- if (!m_frame->shouldChangeSelection(newSelection))
+ if (!m_frame->selection()->shouldChangeSelection(newSelection))
return;
m_frame->selection()->setSelection(newSelection);
}
@@ -3125,7 +3132,7 @@ void Editor::changeSelectionAfterCommand(const VisibleSelection& newSelection, b
// The old selection can be invalid here and calling shouldChangeSelection can produce some strange calls.
// See <rdar://problem/5729315> Some shouldChangeSelectedDOMRange contain Ranges for selections that are no longer valid
bool selectionDidNotChangeDOMPosition = newSelection == m_frame->selection()->selection();
- if (selectionDidNotChangeDOMPosition || m_frame->shouldChangeSelection(newSelection))
+ if (selectionDidNotChangeDOMPosition || m_frame->selection()->shouldChangeSelection(newSelection))
m_frame->selection()->setSelection(newSelection, closeTyping, clearTypingStyle);
// Some editing operations change the selection visually without affecting its position within the DOM.
@@ -3196,18 +3203,18 @@ bool Editor::shouldChangeSelection(const VisibleSelection& oldSelection, const V
return client()->shouldChangeSelectedRange(oldSelection.toNormalizedRange().get(), newSelection.toNormalizedRange().get(), affinity, stillSelecting);
}
-void Editor::computeAndSetTypingStyle(CSSStyleDeclaration *style, EditAction editingAction)
+void Editor::computeAndSetTypingStyle(CSSStyleDeclaration* style, EditAction editingAction)
{
if (!style || !style->length()) {
- m_frame->clearTypingStyle();
+ m_frame->selection()->clearTypingStyle();
return;
}
// Calculate the current typing style.
RefPtr<CSSMutableStyleDeclaration> mutableStyle = style->makeMutable();
- if (m_frame->typingStyle()) {
- m_frame->typingStyle()->merge(mutableStyle.get());
- mutableStyle = m_frame->typingStyle();
+ if (m_frame->selection()->typingStyle()) {
+ m_frame->selection()->typingStyle()->merge(mutableStyle.get());
+ mutableStyle = m_frame->selection()->typingStyle();
}
RefPtr<CSSValue> unicodeBidi;
@@ -3236,7 +3243,7 @@ void Editor::computeAndSetTypingStyle(CSSStyleDeclaration *style, EditAction edi
applyCommand(ApplyStyleCommand::create(m_frame->document(), blockStyle.get(), editingAction));
// Set the remaining style as the typing style.
- m_frame->setTypingStyle(mutableStyle.get());
+ m_frame->selection()->setTypingStyle(mutableStyle.release());
}
PassRefPtr<CSSComputedStyleDeclaration> Editor::selectionComputedStyle(Node*& nodeToRemove) const
@@ -3264,10 +3271,10 @@ PassRefPtr<CSSComputedStyleDeclaration> Editor::selectionComputedStyle(Node*& no
RefPtr<Element> styleElement = element;
ExceptionCode ec = 0;
- if (m_frame->typingStyle()) {
+ if (m_frame->selection()->typingStyle()) {
styleElement = m_frame->document()->createElement(spanTag, false);
- styleElement->setAttribute(styleAttr, m_frame->typingStyle()->cssText().impl(), ec);
+ styleElement->setAttribute(styleAttr, m_frame->selection()->typingStyle()->cssText(), ec);
ASSERT(!ec);
styleElement->appendChild(m_frame->document()->createEditingTextNode(""), ec);
@@ -3368,13 +3375,13 @@ RenderStyle* Editor::styleForSelectionStart(Node *&nodeToRemove) const
if (!position.node())
return 0;
- if (!m_frame->typingStyle())
+ if (!m_frame->selection()->typingStyle())
return position.node()->renderer()->style();
RefPtr<Element> styleElement = m_frame->document()->createElement(spanTag, false);
ExceptionCode ec = 0;
- String styleText = m_frame->typingStyle()->cssText() + " display: inline";
+ String styleText = m_frame->selection()->typingStyle()->cssText() + " display: inline";
styleElement->setAttribute(styleAttr, styleText.impl(), ec);
ASSERT(!ec);
@@ -3471,7 +3478,7 @@ bool Editor::findString(const String& target, bool forward, bool caseFlag, bool
return false;
m_frame->selection()->setSelection(VisibleSelection(resultRange.get(), DOWNSTREAM));
- m_frame->revealSelection();
+ m_frame->selection()->revealSelection();
return true;
}
@@ -3591,4 +3598,24 @@ void Editor::respondToChangedSelection(const VisibleSelection& oldSelection, boo
respondToChangedSelection(oldSelection);
}
+bool Editor::selectionStartHasSpellingMarkerFor(int from, int length) const
+{
+ Node* node = m_frame->selection()->start().node();
+ if (!node || !node->renderer())
+ return false;
+ ASSERT(node->renderer()->isText());
+
+ unsigned int startOffset = static_cast<unsigned int>(from);
+ unsigned int endOffset = static_cast<unsigned int>(from + length);
+ Vector<DocumentMarker> markers = m_frame->document()->markers()->markersForNode(node);
+ for (size_t i = 0; i < markers.size(); ++i) {
+ DocumentMarker marker = markers[i];
+ if (marker.startOffset <= startOffset && endOffset <= marker.endOffset && marker.type == DocumentMarker::Spelling)
+ return true;
+ }
+
+ return false;
+}
+
+
} // namespace WebCore
diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h
index 2c06cea..7a4a185 100644
--- a/WebCore/editing/Editor.h
+++ b/WebCore/editing/Editor.h
@@ -313,6 +313,7 @@ public:
void handleCancelOperation();
void startCorrectionPanelTimer();
void handleRejectedCorrection();
+ bool isShowingCorrectionPanel();
void pasteAsFragment(PassRefPtr<DocumentFragment>, bool smartReplace, bool matchStyle);
void pasteAsPlainText(const String&, bool smartReplace);
@@ -360,6 +361,8 @@ public:
NSWritingDirection baseWritingDirectionForSelectionStart() const;
#endif
+ bool selectionStartHasSpellingMarkerFor(int from, int length) const;
+
private:
Frame* m_frame;
OwnPtr<DeleteButtonController> m_deleteButtonController;
diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp
index 4f53ae9..1b1f14f 100644
--- a/WebCore/editing/EditorCommand.cpp
+++ b/WebCore/editing/EditorCommand.cpp
@@ -322,7 +322,7 @@ static bool executeDelete(Frame* frame, Event*, EditorCommandSource source, cons
case CommandFromDOMWithUserInterface:
// If the current selection is a caret, delete the preceding character. IE performs forwardDelete, but we currently side with Firefox.
// Doesn't scroll to make the selection visible, or modify the kill ring (this time, siding with IE, not Firefox).
- TypingCommand::deleteKeyPressed(frame->document(), frame->selectionGranularity() == WordGranularity);
+ TypingCommand::deleteKeyPressed(frame->document(), frame->selection()->granularity() == WordGranularity);
return true;
}
ASSERT_NOT_REACHED();
@@ -1122,6 +1122,13 @@ static bool supportedPaste(Frame* frame, EditorCommandSource source)
return false;
}
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+static bool supportedDismissCorrectionPanel(Frame* frame, EditorCommandSource source)
+{
+ return supportedFromMenuOrKeyBinding(frame, source) && frame->editor()->isShowingCorrectionPanel();
+}
+#endif
+
// Enabled functions
static bool enabled(Frame*, Event*, EditorCommandSource)
@@ -1467,7 +1474,7 @@ static const CommandMap& createCommandMap()
{ "Yank", { executeYank, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "YankAndSelect", { executeYankAndSelect, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
- { "CancelOperation", { executeCancelOperation, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+ { "CancelOperation", { executeCancelOperation, supportedDismissCorrectionPanel, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
#endif
};
diff --git a/WebCore/editing/InsertLineBreakCommand.cpp b/WebCore/editing/InsertLineBreakCommand.cpp
index dbe4b39..8ac1167 100644
--- a/WebCore/editing/InsertLineBreakCommand.cpp
+++ b/WebCore/editing/InsertLineBreakCommand.cpp
@@ -165,7 +165,7 @@ void InsertLineBreakCommand::doApply()
// Handle the case where there is a typing style.
- CSSMutableStyleDeclaration* typingStyle = document()->frame()->typingStyle();
+ CSSMutableStyleDeclaration* typingStyle = document()->frame()->selection()->typingStyle();
if (typingStyle && typingStyle->length() > 0) {
// Apply the typing style to the inserted line break, so that if the selection
diff --git a/WebCore/editing/InsertTextCommand.cpp b/WebCore/editing/InsertTextCommand.cpp
index cfaf219..b6c8236 100644
--- a/WebCore/editing/InsertTextCommand.cpp
+++ b/WebCore/editing/InsertTextCommand.cpp
@@ -190,7 +190,7 @@ void InsertTextCommand::input(const String& text, bool selectInsertedText)
setEndingSelection(forcedEndingSelection);
// Handle the case where there is a typing style.
- CSSMutableStyleDeclaration* typingStyle = document()->frame()->typingStyle();
+ CSSMutableStyleDeclaration* typingStyle = document()->frame()->selection()->typingStyle();
RefPtr<CSSComputedStyleDeclaration> endingStyle = endPosition.computedStyle();
RefPtr<CSSValue> unicodeBidi;
RefPtr<CSSValue> direction;
diff --git a/WebCore/editing/RemoveFormatCommand.cpp b/WebCore/editing/RemoveFormatCommand.cpp
index 257172b..65f6008 100644
--- a/WebCore/editing/RemoveFormatCommand.cpp
+++ b/WebCore/editing/RemoveFormatCommand.cpp
@@ -78,7 +78,7 @@ void RemoveFormatCommand::doApply()
// Insert the content with the default style.
// See <rdar://problem/5794382> RemoveFormat doesn't always reset text alignment
- frame->setTypingStyle(defaultStyle.get());
+ frame->selection()->setTypingStyle(defaultStyle.release());
inputText(string, true);
}
diff --git a/WebCore/editing/ReplaceSelectionCommand.cpp b/WebCore/editing/ReplaceSelectionCommand.cpp
index 38f3ed2..49bdaca 100644
--- a/WebCore/editing/ReplaceSelectionCommand.cpp
+++ b/WebCore/editing/ReplaceSelectionCommand.cpp
@@ -898,7 +898,7 @@ void ReplaceSelectionCommand::doApply()
// FIXME: Can this wait until after the operation has been performed? There doesn't seem to be
// any work performed after this that queries or uses the typing style.
if (Frame* frame = document()->frame())
- frame->clearTypingStyle();
+ frame->selection()->clearTypingStyle();
bool handledStyleSpans = handleStyleSpansBeforeInsertion(fragment, insertionPos);
@@ -1062,7 +1062,7 @@ void ReplaceSelectionCommand::doApply()
if (m_smartReplace && currentRoot) {
// Disable smart replace for password fields.
Node* start = currentRoot->shadowAncestorNode();
- if (start->hasTagName(inputTag) && static_cast<HTMLInputElement*>(start)->inputType() == HTMLInputElement::PASSWORD)
+ if (start->hasTagName(inputTag) && static_cast<HTMLInputElement*>(start)->isPasswordField())
m_smartReplace = false;
}
if (m_smartReplace) {
diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp
index 99b2224..c04fe25 100644
--- a/WebCore/editing/SelectionController.cpp
+++ b/WebCore/editing/SelectionController.cpp
@@ -29,6 +29,7 @@
#include "DeleteSelectionCommand.h"
#include "Document.h"
#include "Editor.h"
+#include "EditorClient.h"
#include "Element.h"
#include "EventHandler.h"
#include "ExceptionCode.h"
@@ -38,7 +39,8 @@
#include "FrameTree.h"
#include "FrameView.h"
#include "GraphicsContext.h"
-#include "HTMLFrameOwnerElement.h"
+#include "HTMLFormElement.h"
+#include "HTMLFrameElementBase.h"
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "HitTestRequest.h"
@@ -46,8 +48,10 @@
#include "Page.h"
#include "Range.h"
#include "RenderLayer.h"
+#include "RenderTextControl.h"
#include "RenderTheme.h"
#include "RenderView.h"
+#include "RenderWidget.h"
#include "SecureTextInput.h"
#include "Settings.h"
#include "TextIterator.h"
@@ -107,7 +111,7 @@ void SelectionController::moveTo(const Position &base, const Position &extent, E
setSelection(VisibleSelection(base, extent, affinity), true, true, userTriggered);
}
-void SelectionController::setSelection(const VisibleSelection& s, bool closeTyping, bool clearTypingStyle, bool userTriggered, CursorAlignOnScroll align, TextGranularity granularity, DirectionalityPolicy directionalityPolicy)
+void SelectionController::setSelection(const VisibleSelection& s, bool closeTyping, bool shouldClearTypingStyle, bool userTriggered, CursorAlignOnScroll align, TextGranularity granularity, DirectionalityPolicy directionalityPolicy)
{
m_granularity = granularity;
@@ -134,15 +138,15 @@ void SelectionController::setSelection(const VisibleSelection& s, bool closeTypi
// <http://bugs.webkit.org/show_bug.cgi?id=23464>: Infinite recursion at SelectionController::setSelection
// if document->frame() == m_frame we can get into an infinite loop
if (document && document->frame() && document->frame() != m_frame && document != m_frame->document()) {
- document->frame()->selection()->setSelection(s, closeTyping, clearTypingStyle, userTriggered);
+ document->frame()->selection()->setSelection(s, closeTyping, shouldClearTypingStyle, userTriggered);
return;
}
if (closeTyping)
TypingCommand::closeTyping(m_frame->editor()->lastEditCommand());
- if (clearTypingStyle)
- m_frame->clearTypingStyle();
+ if (shouldClearTypingStyle)
+ clearTypingStyle();
if (m_selection == s)
return;
@@ -154,7 +158,7 @@ void SelectionController::setSelection(const VisibleSelection& s, bool closeTypi
m_caretRectNeedsUpdate = true;
if (!s.isNone())
- m_frame->setFocusedNodeIfNeeded();
+ setFocusedNodeIfNeeded();
updateAppearance();
@@ -162,7 +166,7 @@ void SelectionController::setSelection(const VisibleSelection& s, bool closeTypi
// It will be restored by the vertical arrow navigation code if necessary.
m_xPosForVerticalArrowNavigation = NoXPosForVerticalArrowNavigation;
selectFrameElementInParentIfFullySelected();
- m_frame->notifyRendererOfSelectionChange(userTriggered);
+ notifyRendererOfSelectionChange(userTriggered);
m_frame->editor()->respondToChangedSelection(oldSelection, closeTyping);
if (userTriggered) {
ScrollAlignment alignment;
@@ -172,7 +176,7 @@ void SelectionController::setSelection(const VisibleSelection& s, bool closeTypi
else
alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded;
- m_frame->revealSelection(alignment, true);
+ revealSelection(alignment, true);
}
notifyAccessibilityForSelectionChange();
@@ -287,8 +291,7 @@ void SelectionController::willBeModified(EAlteration alter, EDirection direction
TextDirection SelectionController::directionOfEnclosingBlock()
{
- Node* n = m_selection.extent().node();
- Node* enclosingBlockNode = enclosingBlock(n);
+ Node* enclosingBlockNode = enclosingBlock(m_selection.extent().node());
if (!enclosingBlockNode)
return LTR;
RenderObject* renderer = enclosingBlockNode->renderer();
@@ -638,7 +641,7 @@ bool SelectionController::modify(EAlteration alter, EDirection direction, TextGr
trialSelectionController.setIsDirectional(m_isDirectional);
trialSelectionController.modify(alter, direction, granularity, false, settings);
- bool change = m_frame->shouldChangeSelection(trialSelectionController.selection());
+ bool change = shouldChangeSelection(trialSelectionController.selection());
if (!change)
return false;
}
@@ -734,7 +737,7 @@ bool SelectionController::modify(EAlteration alter, int verticalDistance, bool u
trialSelectionController.setIsDirectional(m_isDirectional);
trialSelectionController.modify(alter, verticalDistance, false);
- bool change = m_frame->shouldChangeSelection(trialSelectionController.selection());
+ bool change = shouldChangeSelection(trialSelectionController.selection());
if (!change)
return false;
}
@@ -1243,7 +1246,7 @@ void SelectionController::selectFrameElementInParentIfFullySelected()
// Focus on the parent frame, and then select from before this element to after.
VisibleSelection newSelection(beforeOwnerElement, afterOwnerElement);
- if (parent->shouldChangeSelection(newSelection)) {
+ if (parent->selection()->shouldChangeSelection(newSelection)) {
page->focusController()->setFocusedFrame(parent);
parent->selection()->setSelection(newSelection);
}
@@ -1269,10 +1272,10 @@ void SelectionController::selectAll()
if (!root)
return;
VisibleSelection newSelection(VisibleSelection::selectionFromContentsOfNode(root));
- if (m_frame->shouldChangeSelection(newSelection))
+ if (shouldChangeSelection(newSelection))
setSelection(newSelection);
selectFrameElementInParentIfFullySelected();
- m_frame->notifyRendererOfSelectionChange(true);
+ notifyRendererOfSelectionChange(true);
}
bool SelectionController::setSelectedRange(Range* range, EAffinity affinity, bool closeTyping)
@@ -1329,7 +1332,7 @@ bool SelectionController::isInPasswordField() const
if (!startNode->hasTagName(inputTag))
return false;
- return static_cast<HTMLInputElement*>(startNode)->inputType() == HTMLInputElement::PASSWORD;
+ return static_cast<HTMLInputElement*>(startNode)->isPasswordField();
}
bool SelectionController::caretRendersInsideNode(Node* node) const
@@ -1347,11 +1350,11 @@ void SelectionController::focusedOrActiveStateChanged()
// RenderObject::selectionForegroundColor() check if the frame is active,
// we have to update places those colors were painted.
if (RenderView* view = toRenderView(m_frame->document()->renderer()))
- view->repaintRectangleInViewAndCompositedLayers(enclosingIntRect(m_frame->selectionBounds()));
+ view->repaintRectangleInViewAndCompositedLayers(enclosingIntRect(bounds()));
// Caret appears in the active frame.
if (activeAndFocused)
- m_frame->setSelectionFromNone();
+ setSelectionFromNone();
setCaretVisible(activeAndFocused);
// Update for caps lock state
@@ -1502,6 +1505,207 @@ void SelectionController::caretBlinkTimerFired(Timer<SelectionController>*)
#endif
}
+void SelectionController::notifyRendererOfSelectionChange(bool userTriggered)
+{
+ m_frame->document()->updateStyleIfNeeded();
+
+ if (!rootEditableElement())
+ return;
+
+ RenderObject* renderer = rootEditableElement()->shadowAncestorNode()->renderer();
+ if (!renderer || !renderer->isTextControl())
+ return;
+
+ toRenderTextControl(renderer)->selectionChanged(userTriggered);
+}
+
+// Helper function that tells whether a particular node is an element that has an entire
+// Frame and FrameView, a <frame>, <iframe>, or <object>.
+static bool isFrameElement(const Node* n)
+{
+ if (!n)
+ return false;
+ RenderObject* renderer = n->renderer();
+ if (!renderer || !renderer->isWidget())
+ return false;
+ Widget* widget = toRenderWidget(renderer)->widget();
+ return widget && widget->isFrameView();
+}
+
+void SelectionController::setFocusedNodeIfNeeded()
+{
+ if (isNone() || !isFocused())
+ return;
+
+ bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsingEnabled();
+ if (caretBrowsing) {
+ if (Node* anchor = enclosingAnchorElement(base())) {
+ m_frame->page()->focusController()->setFocusedNode(anchor, m_frame);
+ return;
+ }
+ }
+
+ if (Node* target = rootEditableElement()) {
+ RenderObject* renderer = target->renderer();
+
+ // Walk up the render tree to search for a node to focus.
+ // Walking up the DOM tree wouldn't work for shadow trees, like those behind the engine-based text fields.
+ while (renderer) {
+ // We don't want to set focus on a subframe when selecting in a parent frame,
+ // so add the !isFrameElement check here. There's probably a better way to make this
+ // work in the long term, but this is the safest fix at this time.
+ if (target && target->isMouseFocusable() && !isFrameElement(target)) {
+ m_frame->page()->focusController()->setFocusedNode(target, m_frame);
+ return;
+ }
+ renderer = renderer->parent();
+ if (renderer)
+ target = renderer->node();
+ }
+ m_frame->document()->setFocusedNode(0);
+ }
+
+ if (caretBrowsing)
+ m_frame->page()->focusController()->setFocusedNode(0, m_frame);
+}
+
+void SelectionController::paintDragCaret(GraphicsContext* p, int tx, int ty, const IntRect& clipRect) const
+{
+#if ENABLE(TEXT_CARET)
+ SelectionController* dragCaretController = m_frame->page()->dragCaretController();
+ ASSERT(dragCaretController->selection().isCaret());
+ if (dragCaretController->selection().start().node()->document()->frame() == m_frame)
+ dragCaretController->paintCaret(p, tx, ty, clipRect);
+#else
+ UNUSED_PARAM(p);
+ UNUSED_PARAM(tx);
+ UNUSED_PARAM(ty);
+ UNUSED_PARAM(clipRect);
+#endif
+}
+
+bool SelectionController::shouldDeleteSelection(const VisibleSelection& selection) const
+{
+ return m_frame->editor()->client()->shouldDeleteRange(selection.toNormalizedRange().get());
+}
+
+FloatRect SelectionController::bounds(bool clipToVisibleContent) const
+{
+ RenderView* root = m_frame->contentRenderer();
+ FrameView* view = m_frame->view();
+ if (!root || !view)
+ return IntRect();
+
+ IntRect selectionRect = root->selectionBounds(clipToVisibleContent);
+ return clipToVisibleContent ? intersection(selectionRect, view->visibleContentRect()) : selectionRect;
+}
+
+void SelectionController::getClippedVisibleTextRectangles(Vector<FloatRect>& rectangles) const
+{
+ RenderView* root = m_frame->contentRenderer();
+ if (!root)
+ return;
+
+ FloatRect visibleContentRect = m_frame->view()->visibleContentRect();
+
+ Vector<FloatQuad> quads;
+ toNormalizedRange()->textQuads(quads, true);
+
+ // FIXME: We are appending empty rectangles to the list for those that fall outside visibleContentRect.
+ // It might be better to omit those rectangles entirely.
+ size_t size = quads.size();
+ for (size_t i = 0; i < size; ++i)
+ rectangles.append(intersection(quads[i].enclosingBoundingBox(), visibleContentRect));
+}
+
+// Scans logically forward from "start", including any child frames.
+static HTMLFormElement* scanForForm(Node* start)
+{
+ for (Node* node = start; node; node = node->traverseNextNode()) {
+ if (node->hasTagName(formTag))
+ return static_cast<HTMLFormElement*>(node);
+ if (node->isHTMLElement() && static_cast<HTMLElement*>(node)->isFormControlElement())
+ return static_cast<HTMLFormControlElement*>(node)->form();
+ if (node->hasTagName(frameTag) || node->hasTagName(iframeTag)) {
+ Node* childDocument = static_cast<HTMLFrameElementBase*>(node)->contentDocument();
+ if (HTMLFormElement* frameResult = scanForForm(childDocument))
+ return frameResult;
+ }
+ }
+ return 0;
+}
+
+// We look for either the form containing the current focus, or for one immediately after it
+HTMLFormElement* SelectionController::currentForm() const
+{
+ // Start looking either at the active (first responder) node, or where the selection is.
+ Node* start = m_frame->document()->focusedNode();
+ if (!start)
+ start = this->start().node();
+
+ // Try walking up the node tree to find a form element.
+ Node* node;
+ for (node = start; node; node = node->parentNode()) {
+ if (node->hasTagName(formTag))
+ return static_cast<HTMLFormElement*>(node);
+ if (node->isHTMLElement() && static_cast<HTMLElement*>(node)->isFormControlElement())
+ return static_cast<HTMLFormControlElement*>(node)->form();
+ }
+
+ // Try walking forward in the node tree to find a form element.
+ return scanForForm(start);
+}
+
+void SelectionController::revealSelection(const ScrollAlignment& alignment, bool revealExtent)
+{
+ IntRect rect;
+
+ switch (selectionType()) {
+ case VisibleSelection::NoSelection:
+ return;
+ case VisibleSelection::CaretSelection:
+ rect = absoluteCaretBounds();
+ break;
+ case VisibleSelection::RangeSelection:
+ rect = revealExtent ? VisiblePosition(extent()).absoluteCaretBounds() : enclosingIntRect(bounds(false));
+ break;
+ }
+
+ Position start = this->start();
+ ASSERT(start.node());
+ if (start.node() && start.node()->renderer()) {
+ // FIXME: This code only handles scrolling the startContainer's layer, but
+ // the selection rect could intersect more than just that.
+ // See <rdar://problem/4799899>.
+ if (RenderLayer* layer = start.node()->renderer()->enclosingLayer()) {
+ layer->scrollRectToVisible(rect, false, alignment, alignment);
+ updateAppearance();
+ }
+ }
+}
+
+void SelectionController::setSelectionFromNone()
+{
+ // Put a caret inside the body if the entire frame is editable (either the
+ // entire WebView is editable or designMode is on for this document).
+
+ Document* document = m_frame->document();
+ bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsingEnabled();
+ if (!isNone() || !(m_frame->isContentEditable() || caretBrowsing))
+ return;
+
+ Node* node = document->documentElement();
+ while (node && !node->hasTagName(bodyTag))
+ node = node->traverseNextNode();
+ if (node)
+ setSelection(VisibleSelection(Position(node, 0), DOWNSTREAM));
+}
+
+bool SelectionController::shouldChangeSelection(const VisibleSelection& newSelection) const
+{
+ return m_frame->editor()->shouldChangeSelection(selection(), newSelection, newSelection.affinity(), false);
+}
+
#ifndef NDEBUG
void SelectionController::formatForDebugger(char* buffer, unsigned length) const
diff --git a/WebCore/editing/SelectionController.h b/WebCore/editing/SelectionController.h
index 5fa2769..90018cd 100644
--- a/WebCore/editing/SelectionController.h
+++ b/WebCore/editing/SelectionController.h
@@ -26,8 +26,10 @@
#ifndef SelectionController_h
#define SelectionController_h
+#include "CSSMutableStyleDeclaration.h"
#include "IntRect.h"
#include "Range.h"
+#include "ScrollBehavior.h"
#include "Timer.h"
#include "VisibleSelection.h"
#include <wtf/Noncopyable.h>
@@ -36,6 +38,7 @@ namespace WebCore {
class Frame;
class GraphicsContext;
+class HTMLFormElement;
class RenderObject;
class RenderView;
class Settings;
@@ -149,6 +152,26 @@ public:
void showTreeForThis() const;
#endif
+ bool shouldChangeSelection(const VisibleSelection&) const;
+ bool shouldDeleteSelection(const VisibleSelection&) const;
+ void setFocusedNodeIfNeeded();
+ void notifyRendererOfSelectionChange(bool userTriggered);
+
+ void paintDragCaret(GraphicsContext*, int tx, int ty, const IntRect& clipRect) const;
+
+ CSSMutableStyleDeclaration* typingStyle() const;
+ void setTypingStyle(PassRefPtr<CSSMutableStyleDeclaration>);
+ void clearTypingStyle();
+
+ FloatRect bounds(bool clipToVisibleContent = true) const;
+
+ void getClippedVisibleTextRectangles(Vector<FloatRect>&) const;
+
+ HTMLFormElement* currentForm() const;
+
+ void revealSelection(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, bool revealExtent = false);
+ void setSelectionFromNone();
+
private:
enum EPositionType { START, END, BASE, EXTENT };
@@ -193,6 +216,8 @@ private:
VisibleSelection m_selection;
TextGranularity m_granularity;
+ RefPtr<CSSMutableStyleDeclaration> m_typingStyle;
+
Timer<SelectionController> m_caretBlinkTimer;
IntRect m_caretRect; // caret rect in coords local to the renderer responsible for painting the caret
@@ -209,6 +234,21 @@ private:
bool m_caretPaint;
};
+inline CSSMutableStyleDeclaration* SelectionController::typingStyle() const
+{
+ return m_typingStyle.get();
+}
+
+inline void SelectionController::clearTypingStyle()
+{
+ m_typingStyle.clear();
+}
+
+inline void SelectionController::setTypingStyle(PassRefPtr<CSSMutableStyleDeclaration> style)
+{
+ m_typingStyle = style;
+}
+
#if !(PLATFORM(MAC) || PLATFORM(GTK))
inline void SelectionController::notifyAccessibilityForSelectionChange()
{
diff --git a/WebCore/editing/TextIterator.cpp b/WebCore/editing/TextIterator.cpp
index daba80e..d5a03ef 100644
--- a/WebCore/editing/TextIterator.cpp
+++ b/WebCore/editing/TextIterator.cpp
@@ -261,6 +261,7 @@ TextIterator::TextIterator()
, m_entersTextControls(false)
, m_emitsTextWithoutTranscoding(false)
, m_handledFirstLetter(false)
+ , m_ignoresStyleVisibility(false)
{
}
@@ -278,6 +279,7 @@ TextIterator::TextIterator(const Range* r, TextIteratorBehavior behavior)
, m_entersTextControls(behavior & TextIteratorEntersTextControls)
, m_emitsTextWithoutTranscoding(behavior & TextIteratorEmitsTextsWithoutTranscoding)
, m_handledFirstLetter(false)
+ , m_ignoresStyleVisibility(behavior & TextIteratorIgnoresStyleVisibility)
{
// FIXME: should support TextIteratorEndsAtEditingBoundary http://webkit.org/b/43609
ASSERT(behavior != TextIteratorEndsAtEditingBoundary);
@@ -444,7 +446,7 @@ void TextIterator::advance()
bool TextIterator::handleTextNode()
{
- if (m_fullyClippedStack.top())
+ if (m_fullyClippedStack.top() && !m_ignoresStyleVisibility)
return false;
RenderText* renderer = toRenderText(m_node->renderer());
@@ -469,7 +471,7 @@ bool TextIterator::handleTextNode()
return false;
}
}
- if (renderer->style()->visibility() != VISIBLE)
+ if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility)
return false;
int strLength = str.length();
int end = (m_node == m_endContainer) ? m_endOffset : INT_MAX;
@@ -490,7 +492,7 @@ bool TextIterator::handleTextNode()
return false;
}
}
- if (renderer->style()->visibility() != VISIBLE)
+ if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility)
return false;
m_lastTextNodeEndedWithCollapsedSpace = true; // entire block is collapsed space
return true;
@@ -516,7 +518,7 @@ bool TextIterator::handleTextNode()
void TextIterator::handleTextBox()
{
RenderText* renderer = m_firstLetterText ? m_firstLetterText : toRenderText(m_node->renderer());
- if (renderer->style()->visibility() != VISIBLE) {
+ if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility) {
m_textBox = 0;
return;
}
@@ -600,7 +602,7 @@ void TextIterator::handleTextNodeFirstLetter(RenderTextFragment* renderer)
{
if (renderer->firstLetter()) {
RenderObject* r = renderer->firstLetter();
- if (r->style()->visibility() != VISIBLE)
+ if (r->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility)
return;
for (RenderObject *currChild = r->firstChild(); currChild; currChild->nextSibling()) {
if (currChild->isText()) {
@@ -622,7 +624,7 @@ bool TextIterator::handleReplacedElement()
return false;
RenderObject* renderer = m_node->renderer();
- if (renderer->style()->visibility() != VISIBLE)
+ if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility)
return false;
if (m_lastTextNodeEndedWithCollapsedSpace) {
@@ -2214,7 +2216,7 @@ PassRefPtr<Range> TextIterator::rangeFromLocationAndLength(Element* scope, int r
// --------
-UChar* plainTextToMallocAllocatedBuffer(const Range* r, unsigned& bufferLength, bool isDisplayString)
+UChar* plainTextToMallocAllocatedBuffer(const Range* r, unsigned& bufferLength, bool isDisplayString, TextIteratorBehavior defaultBehavior)
{
UChar* result = 0;
@@ -2226,7 +2228,11 @@ UChar* plainTextToMallocAllocatedBuffer(const Range* r, unsigned& bufferLength,
OwnPtr<Vector<TextSegment> > textSegments;
Vector<UChar> textBuffer;
textBuffer.reserveInitialCapacity(cMaxSegmentSize);
- for (TextIterator it(r, isDisplayString ? TextIteratorDefaultBehavior : TextIteratorEmitsTextsWithoutTranscoding); !it.atEnd(); it.advance()) {
+ TextIteratorBehavior behavior = defaultBehavior;
+ if (!isDisplayString)
+ behavior = static_cast<TextIteratorBehavior>(behavior | TextIteratorEmitsTextsWithoutTranscoding);
+
+ for (TextIterator it(r, behavior); !it.atEnd(); it.advance()) {
if (textBuffer.size() && textBuffer.size() + it.length() > cMaxSegmentSize) {
UChar* newSegmentBuffer = static_cast<UChar*>(malloc(textBuffer.size() * sizeof(UChar)));
if (!newSegmentBuffer)
@@ -2275,10 +2281,10 @@ exit:
return result;
}
-String plainText(const Range* r)
+String plainText(const Range* r, TextIteratorBehavior defaultBehavior)
{
unsigned length;
- UChar* buf = plainTextToMallocAllocatedBuffer(r, length, false);
+ UChar* buf = plainTextToMallocAllocatedBuffer(r, length, false, defaultBehavior);
if (!buf)
return "";
String result(buf, length);
diff --git a/WebCore/editing/TextIterator.h b/WebCore/editing/TextIterator.h
index 805e060..7fd87bd 100644
--- a/WebCore/editing/TextIterator.h
+++ b/WebCore/editing/TextIterator.h
@@ -35,6 +35,15 @@ namespace WebCore {
class RenderText;
class RenderTextFragment;
+enum TextIteratorBehavior {
+ TextIteratorDefaultBehavior = 0,
+ TextIteratorEmitsCharactersBetweenAllVisiblePositions = 1 << 0,
+ TextIteratorEntersTextControls = 1 << 1,
+ TextIteratorEmitsTextsWithoutTranscoding = 1 << 2,
+ TextIteratorEndsAtEditingBoundary = 1 << 3,
+ TextIteratorIgnoresStyleVisibility = 1 << 4
+};
+
// FIXME: Can't really answer this question correctly without knowing the white-space mode.
// FIXME: Move this somewhere else in the editing directory. It doesn't belong here.
inline bool isCollapsibleWhitespace(UChar c)
@@ -48,8 +57,8 @@ inline bool isCollapsibleWhitespace(UChar c)
}
}
-String plainText(const Range*);
-UChar* plainTextToMallocAllocatedBuffer(const Range*, unsigned& bufferLength, bool isDisplayString);
+String plainText(const Range*, TextIteratorBehavior defaultBehavior = TextIteratorDefaultBehavior);
+UChar* plainTextToMallocAllocatedBuffer(const Range*, unsigned& bufferLength, bool isDisplayString, TextIteratorBehavior defaultBehavior = TextIteratorDefaultBehavior);
PassRefPtr<Range> findPlainText(const Range*, const String&, bool forward, bool caseSensitive);
class BitStack {
@@ -71,14 +80,6 @@ private:
// at points where replaced elements break up the text flow. The text comes back in
// chunks so as to optimize for performance of the iteration.
-enum TextIteratorBehavior {
- TextIteratorDefaultBehavior = 0,
- TextIteratorEmitsCharactersBetweenAllVisiblePositions = 1 << 0,
- TextIteratorEntersTextControls = 1 << 1,
- TextIteratorEmitsTextsWithoutTranscoding = 1 << 2,
- TextIteratorEndsAtEditingBoundary = 1 << 3
-};
-
class TextIterator {
public:
TextIterator();
@@ -173,6 +174,8 @@ private:
bool m_emitsTextWithoutTranscoding;
// Used when deciding text fragment created by :first-letter should be looked into.
bool m_handledFirstLetter;
+ // Used when the visibility of the style should not affect text gathering.
+ bool m_ignoresStyleVisibility;
};
// Iterates through the DOM range, returning all the text, and 0-length boundaries
diff --git a/WebCore/editing/TypingCommand.cpp b/WebCore/editing/TypingCommand.cpp
index 81a6d5c..1d1183a 100644
--- a/WebCore/editing/TypingCommand.cpp
+++ b/WebCore/editing/TypingCommand.cpp
@@ -356,7 +356,7 @@ void TypingCommand::insertText(const String &text, bool selectInsertedText)
void TypingCommand::insertTextRunWithoutNewlines(const String &text, bool selectInsertedText)
{
RefPtr<InsertTextCommand> command;
- if (!document()->frame()->typingStyle() && !m_commands.isEmpty()) {
+ if (!document()->frame()->selection()->typingStyle() && !m_commands.isEmpty()) {
EditCommand* lastCommand = m_commands.last().get();
if (lastCommand->isInsertTextCommand())
command = static_cast<InsertTextCommand*>(lastCommand);
@@ -496,7 +496,7 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
if (selectionToDelete.isNone())
return;
- if (selectionToDelete.isCaret() || !document()->frame()->shouldDeleteSelection(selectionToDelete))
+ if (selectionToDelete.isCaret() || !document()->frame()->selection()->shouldDeleteSelection(selectionToDelete))
return;
if (killRing)
@@ -579,7 +579,7 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity, bool ki
if (selectionToDelete.isNone())
return;
- if (selectionToDelete.isCaret() || !document()->frame()->shouldDeleteSelection(selectionToDelete))
+ if (selectionToDelete.isCaret() || !document()->frame()->selection()->shouldDeleteSelection(selectionToDelete))
return;
if (killRing)
diff --git a/WebCore/editing/mac/EditorMac.mm b/WebCore/editing/mac/EditorMac.mm
index ac658c8..f010908 100644
--- a/WebCore/editing/mac/EditorMac.mm
+++ b/WebCore/editing/mac/EditorMac.mm
@@ -29,9 +29,14 @@
#import "ColorMac.h"
#import "ClipboardMac.h"
#import "CachedResourceLoader.h"
+#import "DocumentFragment.h"
+#import "Editor.h"
+#import "EditorClient.h"
#import "Frame.h"
#import "FrameView.h"
+#import "Pasteboard.h"
#import "RenderBlock.h"
+#import "RuntimeApplicationChecks.h"
namespace WebCore {
@@ -55,20 +60,32 @@ void Editor::showColorPanel()
[[NSApplication sharedApplication] orderFrontColorPanel:nil];
}
-// FIXME: We want to use the platform-independent code instead. But when we last
-// tried to do so it seemed that we first need to move more of the logic from
-// -[WebHTMLView.cpp _documentFragmentFromPasteboard] into PasteboardMac.
-
-void Editor::paste()
+void Editor::pasteWithPasteboard(Pasteboard* pasteboard, bool allowPlainText)
{
- ASSERT(m_frame->document());
- FrameView* view = m_frame->view();
- if (!view)
- return;
- CachedResourceLoader* loader = m_frame->document()->cachedResourceLoader();
- loader->setAllowStaleResources(true);
- [view->documentView() tryToPerform:@selector(paste:) with:nil];
- loader->setAllowStaleResources(false);
+ RefPtr<Range> range = selectedRange();
+ bool choosePlainText;
+
+ m_frame->editor()->client()->setInsertionPasteboard([NSPasteboard generalPasteboard]);
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+ RefPtr<DocumentFragment> fragment = pasteboard->documentFragment(m_frame, range, allowPlainText, choosePlainText);
+ if (fragment && shouldInsertFragment(fragment, range, EditorInsertActionPasted))
+ pasteAsFragment(fragment, canSmartReplaceWithPasteboard(pasteboard), false);
+#else
+ // Mail is ignoring the frament passed to the delegate and creates a new one.
+ // We want to avoid creating the fragment twice.
+ if (applicationIsAppleMail()) {
+ if (shouldInsertFragment(NULL, range, EditorInsertActionPasted)) {
+ RefPtr<DocumentFragment> fragment = pasteboard->documentFragment(m_frame, range, allowPlainText, choosePlainText);
+ if (fragment)
+ pasteAsFragment(fragment, canSmartReplaceWithPasteboard(pasteboard), false);
+ }
+ } else {
+ RefPtr<DocumentFragment>fragment = pasteboard->documentFragment(m_frame, range, allowPlainText, choosePlainText);
+ if (fragment && shouldInsertFragment(fragment, range, EditorInsertActionPasted))
+ pasteAsFragment(fragment, canSmartReplaceWithPasteboard(pasteboard), false);
+ }
+#endif
+ m_frame->editor()->client()->setInsertionPasteboard(nil);
}
NSDictionary* Editor::fontAttributesForSelectionStart() const
diff --git a/WebCore/editing/markup.cpp b/WebCore/editing/markup.cpp
index d4996ea..a279808 100644
--- a/WebCore/editing/markup.cpp
+++ b/WebCore/editing/markup.cpp
@@ -190,34 +190,6 @@ private:
const bool m_shouldResolveURLs;
};
-class StyledMarkupAccumulator : public MarkupAccumulator {
-public:
- enum RangeFullySelectsNode { DoesFullySelectNode, DoesNotFullySelectNode };
-
- StyledMarkupAccumulator(Vector<Node*>* nodes, EAbsoluteURLs shouldResolveURLs, EAnnotateForInterchange shouldAnnotate, const Range* range)
- : MarkupAccumulator(nodes, shouldResolveURLs, range)
- , m_shouldAnnotate(shouldAnnotate)
- {
- }
- void wrapWithNode(Node*, bool convertBlocksToInlines = false, RangeFullySelectsNode = DoesFullySelectNode);
- void wrapWithStyleNode(CSSStyleDeclaration*, Document*, bool isBlock = false);
- String takeResults();
-
-protected:
- virtual void appendText(Vector<UChar>& out, Text*);
- String renderedText(const Node*, const Range*);
- String stringValueForRange(const Node*, const Range*);
- void removeExteriorStyles(CSSMutableStyleDeclaration*);
- void appendElement(Vector<UChar>& out, Element* element, bool addDisplayInline, RangeFullySelectsNode);
- void appendElement(Vector<UChar>& out, Element* element, Namespaces*) { appendElement(out, element, false, DoesFullySelectNode); }
-
- bool shouldAnnotate() { return m_shouldAnnotate == AnnotateForInterchange; }
-
-private:
- Vector<String> m_reversedPrecedingMarkup;
- const EAnnotateForInterchange m_shouldAnnotate;
-};
-
void MarkupAccumulator::appendString(const String& string)
{
m_succeedingMarkup.append(string);
@@ -239,37 +211,6 @@ void MarkupAccumulator::appendEndTag(Node* node)
m_succeedingMarkup.append(String::adopt(markup));
}
-void StyledMarkupAccumulator::wrapWithNode(Node* node, bool convertBlocksToInlines, RangeFullySelectsNode rangeFullySelectsNode)
-{
- Vector<UChar> markup;
- if (node->isElementNode())
- appendElement(markup, static_cast<Element*>(node), convertBlocksToInlines && isBlock(const_cast<Node*>(node)), rangeFullySelectsNode);
- else
- appendStartMarkup(markup, node, 0);
- m_reversedPrecedingMarkup.append(String::adopt(markup));
- appendEndTag(node);
- if (m_nodes)
- m_nodes->append(node);
-}
-
-void StyledMarkupAccumulator::wrapWithStyleNode(CSSStyleDeclaration* style, Document* document, bool isBlock)
-{
- // All text-decoration-related elements should have been treated as special ancestors
- // If we ever hit this ASSERT, we should export StyleChange in ApplyStyleCommand and use it here
- ASSERT(propertyMissingOrEqualToNone(style, CSSPropertyTextDecoration) && propertyMissingOrEqualToNone(style, CSSPropertyWebkitTextDecorationsInEffect));
- DEFINE_STATIC_LOCAL(const String, divStyle, ("<div style=\""));
- DEFINE_STATIC_LOCAL(const String, divClose, ("</div>"));
- DEFINE_STATIC_LOCAL(const String, styleSpanOpen, ("<span class=\"" AppleStyleSpanClass "\" style=\""));
- DEFINE_STATIC_LOCAL(const String, styleSpanClose, ("</span>"));
- Vector<UChar> openTag;
- append(openTag, isBlock ? divStyle : styleSpanOpen);
- appendAttributeValue(openTag, style->cssText(), document->isHTMLDocument());
- openTag.append('\"');
- openTag.append('>');
- m_reversedPrecedingMarkup.append(String::adopt(openTag));
- m_succeedingMarkup.append(isBlock ? divClose : styleSpanClose);
-}
-
// FIXME: This is a very inefficient way of accumulating the markup.
// We're converting results of appendStartMarkup and appendEndMarkup from Vector<UChar> to String
// and then back to Vector<UChar> and again to String here.
@@ -290,30 +231,6 @@ String MarkupAccumulator::takeResults()
return String::adopt(result);
}
-String StyledMarkupAccumulator::takeResults()
-{
- size_t length = 0;
-
- size_t preCount = m_reversedPrecedingMarkup.size();
- for (size_t i = 0; i < preCount; ++i)
- length += m_reversedPrecedingMarkup[i].length();
-
- size_t postCount = m_succeedingMarkup.size();
- for (size_t i = 0; i < postCount; ++i)
- length += m_succeedingMarkup[i].length();
-
- Vector<UChar> result;
- result.reserveInitialCapacity(length);
-
- for (size_t i = preCount; i > 0; --i)
- append(result, m_reversedPrecedingMarkup[i - 1]);
-
- for (size_t i = 0; i < postCount; ++i)
- append(result, m_succeedingMarkup[i]);
-
- return String::adopt(result);
-}
-
void MarkupAccumulator::appendAttributeValue(Vector<UChar>& result, const String& attribute, bool documentIsHTML)
{
appendCharactersReplacingEntities(result, attribute.characters(), attribute.length(),
@@ -344,20 +261,6 @@ void MarkupAccumulator::appendQuotedURLAttributeValue(Vector<UChar>& result, con
result.append(quoteChar);
}
-String StyledMarkupAccumulator::stringValueForRange(const Node* node, const Range* range)
-{
- if (!range)
- return node->nodeValue();
-
- String str = node->nodeValue();
- ExceptionCode ec;
- if (node == range->endContainer(ec))
- str.truncate(range->endOffset(ec));
- if (node == range->startContainer(ec))
- str.remove(0, range->startOffset(ec));
- return str;
-}
-
void MarkupAccumulator::appendNodeValue(Vector<UChar>& out, const Node* node, const Range* range, EntityMask entityMask)
{
String str = node->nodeValue();
@@ -378,59 +281,6 @@ void MarkupAccumulator::appendNodeValue(Vector<UChar>& out, const Node* node, co
appendCharactersReplacingEntities(out, characters, length, entityMask);
}
-String StyledMarkupAccumulator::renderedText(const Node* node, const Range* range)
-{
- if (!node->isTextNode())
- return String();
-
- ExceptionCode ec;
- const Text* textNode = static_cast<const Text*>(node);
- unsigned startOffset = 0;
- unsigned endOffset = textNode->length();
-
- if (range && node == range->startContainer(ec))
- startOffset = range->startOffset(ec);
- if (range && node == range->endContainer(ec))
- endOffset = range->endOffset(ec);
-
- Position start(const_cast<Node*>(node), startOffset);
- Position end(const_cast<Node*>(node), endOffset);
- return plainText(Range::create(node->document(), start, end).get());
-}
-
-static PassRefPtr<CSSMutableStyleDeclaration> styleFromMatchedRulesForElement(Element* element, bool authorOnly = true)
-{
- RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
- RefPtr<CSSRuleList> matchedRules = element->document()->styleSelector()->styleRulesForElement(element, authorOnly);
- if (matchedRules) {
- for (unsigned i = 0; i < matchedRules->length(); i++) {
- if (matchedRules->item(i)->type() == CSSRule::STYLE_RULE) {
- RefPtr<CSSMutableStyleDeclaration> s = static_cast<CSSStyleRule*>(matchedRules->item(i))->style();
- style->merge(s.get(), true);
- }
- }
- }
-
- return style.release();
-}
-
-static void removeEnclosingMailBlockquoteStyle(CSSMutableStyleDeclaration* style, Node* node)
-{
- Node* blockquote = nearestMailBlockquote(node);
- if (!blockquote || !blockquote->parentNode())
- return;
-
- removeStylesAddedByNode(style, blockquote);
-}
-
-static void removeDefaultStyles(CSSMutableStyleDeclaration* style, Document* document)
-{
- if (!document || !document->documentElement())
- return;
-
- prepareEditingStyleToApplyAt(style, Position(document->documentElement(), 0));
-}
-
bool MarkupAccumulator::shouldAddNamespaceElement(const Element* element)
{
// Don't add namespace attribute if it is already defined for this elem.
@@ -500,20 +350,6 @@ void MarkupAccumulator::appendText(Vector<UChar>& out, Text* text)
appendNodeValue(out, text, m_range, entityMaskForText(text));
}
-void StyledMarkupAccumulator::appendText(Vector<UChar>& out, Text* text)
-{
- if (!shouldAnnotate() || (text->parentElement() && text->parentElement()->tagQName() == textareaTag)) {
- MarkupAccumulator::appendText(out, text);
- return;
- }
-
- bool useRenderedText = !enclosingNodeWithTag(Position(text, 0), selectTag);
- String content = useRenderedText ? renderedText(text, m_range) : stringValueForRange(text, m_range);
- Vector<UChar> buffer;
- appendCharactersReplacingEntities(buffer, content.characters(), content.length(), EntityMaskInPCDATA);
- append(out, convertHTMLTextToInterchangeFormat(String::adopt(buffer), text));
-}
-
void MarkupAccumulator::appendComment(Vector<UChar>& out, const String& comment)
{
// FIXME: Comment content is not escaped, but XMLSerializer (and possibly other callers) should raise an exception if it includes "-->".
@@ -561,11 +397,6 @@ void MarkupAccumulator::appendProcessingInstruction(Vector<UChar>& out, const St
append(out, "?>");
}
-void StyledMarkupAccumulator::removeExteriorStyles(CSSMutableStyleDeclaration* style)
-{
- style->removeProperty(CSSPropertyFloat);
-}
-
void MarkupAccumulator::appendElement(Vector<UChar>& out, Element* element, Namespaces* namespaces)
{
appendOpenTag(out, element, namespaces);
@@ -578,66 +409,6 @@ void MarkupAccumulator::appendElement(Vector<UChar>& out, Element* element, Name
appendCloseTag(out, element);
}
-void StyledMarkupAccumulator::appendElement(Vector<UChar>& out, Element* element, bool addDisplayInline, RangeFullySelectsNode rangeFullySelectsNode)
-{
- bool documentIsHTML = element->document()->isHTMLDocument();
- appendOpenTag(out, element, 0);
-
- NamedNodeMap* attributes = element->attributes();
- unsigned length = attributes->length();
- for (unsigned int i = 0; i < length; i++) {
- Attribute* attribute = attributes->attributeItem(i);
- // We'll handle the style attribute separately, below.
- if (attribute->name() == styleAttr && element->isHTMLElement() && (shouldAnnotate() || addDisplayInline))
- continue;
- appendAttribute(out, element, *attribute, 0);
- }
-
- if (element->isHTMLElement() && (shouldAnnotate() || addDisplayInline)) {
- RefPtr<CSSMutableStyleDeclaration> style = static_cast<HTMLElement*>(element)->getInlineStyleDecl()->copy();
- if (shouldAnnotate()) {
- RefPtr<CSSMutableStyleDeclaration> styleFromMatchedRules = styleFromMatchedRulesForElement(const_cast<Element*>(element));
- // Styles from the inline style declaration, held in the variable "style", take precedence
- // over those from matched rules.
- styleFromMatchedRules->merge(style.get());
- style = styleFromMatchedRules;
-
- RefPtr<CSSComputedStyleDeclaration> computedStyleForElement = computedStyle(element);
- RefPtr<CSSMutableStyleDeclaration> fromComputedStyle = CSSMutableStyleDeclaration::create();
-
- {
- CSSMutableStyleDeclaration::const_iterator end = style->end();
- for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) {
- const CSSProperty& property = *it;
- CSSValue* value = property.value();
- // The property value, if it's a percentage, may not reflect the actual computed value.
- // For example: style="height: 1%; overflow: visible;" in quirksmode
- // FIXME: There are others like this, see <rdar://problem/5195123> Slashdot copy/paste fidelity problem
- if (value->cssValueType() == CSSValue::CSS_PRIMITIVE_VALUE)
- if (static_cast<CSSPrimitiveValue*>(value)->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE)
- if (RefPtr<CSSValue> computedPropertyValue = computedStyleForElement->getPropertyCSSValue(property.id()))
- fromComputedStyle->addParsedProperty(CSSProperty(property.id(), computedPropertyValue));
- }
- }
- style->merge(fromComputedStyle.get());
- }
- if (addDisplayInline)
- style->setProperty(CSSPropertyDisplay, CSSValueInline, true);
- // If the node is not fully selected by the range, then we don't want to keep styles that affect its relationship to the nodes around it
- // only the ones that affect it and the nodes within it.
- if (rangeFullySelectsNode == DoesNotFullySelectNode)
- removeExteriorStyles(style.get());
- if (style->length() > 0) {
- DEFINE_STATIC_LOCAL(const String, stylePrefix, (" style=\""));
- append(out, stylePrefix);
- appendAttributeValue(out, style->cssText(), documentIsHTML);
- out.append('\"');
- }
- }
-
- appendCloseTag(out, element);
-}
-
void MarkupAccumulator::appendOpenTag(Vector<UChar>& out, Element* element, Namespaces* namespaces)
{
out.append('<');
@@ -794,30 +565,219 @@ static void completeURLs(Node* node, const String& baseURL)
for (size_t i = 0; i < numChanges; ++i)
changes[i].apply();
}
+
+class StyledMarkupAccumulator : public MarkupAccumulator {
+public:
+ enum RangeFullySelectsNode { DoesFullySelectNode, DoesNotFullySelectNode };
-static bool needInterchangeNewlineAfter(const VisiblePosition& v)
+ StyledMarkupAccumulator(Vector<Node*>* nodes, EAbsoluteURLs shouldResolveURLs, EAnnotateForInterchange shouldAnnotate, const Range* range)
+ : MarkupAccumulator(nodes, shouldResolveURLs, range)
+ , m_shouldAnnotate(shouldAnnotate)
+ {
+ }
+ void wrapWithNode(Node*, bool convertBlocksToInlines = false, RangeFullySelectsNode = DoesFullySelectNode);
+ void wrapWithStyleNode(CSSStyleDeclaration*, Document*, bool isBlock = false);
+ String takeResults();
+
+protected:
+ virtual void appendText(Vector<UChar>& out, Text*);
+ String renderedText(const Node*, const Range*);
+ String stringValueForRange(const Node*, const Range*);
+ void removeExteriorStyles(CSSMutableStyleDeclaration*);
+ void appendElement(Vector<UChar>& out, Element* element, bool addDisplayInline, RangeFullySelectsNode);
+ void appendElement(Vector<UChar>& out, Element* element, Namespaces*) { appendElement(out, element, false, DoesFullySelectNode); }
+
+ bool shouldAnnotate() { return m_shouldAnnotate == AnnotateForInterchange; }
+
+private:
+ Vector<String> m_reversedPrecedingMarkup;
+ const EAnnotateForInterchange m_shouldAnnotate;
+};
+
+void StyledMarkupAccumulator::wrapWithNode(Node* node, bool convertBlocksToInlines, RangeFullySelectsNode rangeFullySelectsNode)
{
- VisiblePosition next = v.next();
- Node* upstreamNode = next.deepEquivalent().upstream().node();
- Node* downstreamNode = v.deepEquivalent().downstream().node();
- // Add an interchange newline if a paragraph break is selected and a br won't already be added to the markup to represent it.
- return isEndOfParagraph(v) && isStartOfParagraph(next) && !(upstreamNode->hasTagName(brTag) && upstreamNode == downstreamNode);
+ Vector<UChar> markup;
+ if (node->isElementNode())
+ appendElement(markup, static_cast<Element*>(node), convertBlocksToInlines && isBlock(const_cast<Node*>(node)), rangeFullySelectsNode);
+ else
+ appendStartMarkup(markup, node, 0);
+ m_reversedPrecedingMarkup.append(String::adopt(markup));
+ appendEndTag(node);
+ if (m_nodes)
+ m_nodes->append(node);
}
-static PassRefPtr<CSSMutableStyleDeclaration> styleFromMatchedRulesAndInlineDecl(const Node* node)
+void StyledMarkupAccumulator::wrapWithStyleNode(CSSStyleDeclaration* style, Document* document, bool isBlock)
{
- if (!node->isHTMLElement())
- return 0;
+ // All text-decoration-related elements should have been treated as special ancestors
+ // If we ever hit this ASSERT, we should export StyleChange in ApplyStyleCommand and use it here
+ ASSERT(propertyMissingOrEqualToNone(style, CSSPropertyTextDecoration) && propertyMissingOrEqualToNone(style, CSSPropertyWebkitTextDecorationsInEffect));
+ DEFINE_STATIC_LOCAL(const String, divStyle, ("<div style=\""));
+ DEFINE_STATIC_LOCAL(const String, divClose, ("</div>"));
+ DEFINE_STATIC_LOCAL(const String, styleSpanOpen, ("<span class=\"" AppleStyleSpanClass "\" style=\""));
+ DEFINE_STATIC_LOCAL(const String, styleSpanClose, ("</span>"));
+ Vector<UChar> openTag;
+ append(openTag, isBlock ? divStyle : styleSpanOpen);
+ appendAttributeValue(openTag, style->cssText(), document->isHTMLDocument());
+ openTag.append('\"');
+ openTag.append('>');
+ m_reversedPrecedingMarkup.append(String::adopt(openTag));
+ m_succeedingMarkup.append(isBlock ? divClose : styleSpanClose);
+}
+
+String StyledMarkupAccumulator::takeResults()
+{
+ size_t length = 0;
+
+ size_t preCount = m_reversedPrecedingMarkup.size();
+ for (size_t i = 0; i < preCount; ++i)
+ length += m_reversedPrecedingMarkup[i].length();
+
+ size_t postCount = m_succeedingMarkup.size();
+ for (size_t i = 0; i < postCount; ++i)
+ length += m_succeedingMarkup[i].length();
+
+ Vector<UChar> result;
+ result.reserveInitialCapacity(length);
+
+ for (size_t i = preCount; i > 0; --i)
+ append(result, m_reversedPrecedingMarkup[i - 1]);
+
+ for (size_t i = 0; i < postCount; ++i)
+ append(result, m_succeedingMarkup[i]);
+
+ return String::adopt(result);
+}
+
+void StyledMarkupAccumulator::appendText(Vector<UChar>& out, Text* text)
+{
+ if (!shouldAnnotate() || (text->parentElement() && text->parentElement()->tagQName() == textareaTag)) {
+ MarkupAccumulator::appendText(out, text);
+ return;
+ }
+
+ bool useRenderedText = !enclosingNodeWithTag(Position(text, 0), selectTag);
+ String content = useRenderedText ? renderedText(text, m_range) : stringValueForRange(text, m_range);
+ Vector<UChar> buffer;
+ appendCharactersReplacingEntities(buffer, content.characters(), content.length(), EntityMaskInPCDATA);
+ append(out, convertHTMLTextToInterchangeFormat(String::adopt(buffer), text));
+}
- // FIXME: Having to const_cast here is ugly, but it is quite a bit of work to untangle
- // the non-const-ness of styleFromMatchedRulesForElement.
- HTMLElement* element = const_cast<HTMLElement*>(static_cast<const HTMLElement*>(node));
- RefPtr<CSSMutableStyleDeclaration> style = styleFromMatchedRulesForElement(element);
- RefPtr<CSSMutableStyleDeclaration> inlineStyleDecl = element->getInlineStyleDecl();
- style->merge(inlineStyleDecl.get());
+String StyledMarkupAccumulator::renderedText(const Node* node, const Range* range)
+{
+ if (!node->isTextNode())
+ return String();
+
+ ExceptionCode ec;
+ const Text* textNode = static_cast<const Text*>(node);
+ unsigned startOffset = 0;
+ unsigned endOffset = textNode->length();
+
+ if (range && node == range->startContainer(ec))
+ startOffset = range->startOffset(ec);
+ if (range && node == range->endContainer(ec))
+ endOffset = range->endOffset(ec);
+
+ Position start(const_cast<Node*>(node), startOffset);
+ Position end(const_cast<Node*>(node), endOffset);
+ return plainText(Range::create(node->document(), start, end).get());
+}
+
+String StyledMarkupAccumulator::stringValueForRange(const Node* node, const Range* range)
+{
+ if (!range)
+ return node->nodeValue();
+
+ String str = node->nodeValue();
+ ExceptionCode ec;
+ if (node == range->endContainer(ec))
+ str.truncate(range->endOffset(ec));
+ if (node == range->startContainer(ec))
+ str.remove(0, range->startOffset(ec));
+ return str;
+}
+
+static PassRefPtr<CSSMutableStyleDeclaration> styleFromMatchedRulesForElement(Element* element, bool authorOnly = true)
+{
+ RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
+ RefPtr<CSSRuleList> matchedRules = element->document()->styleSelector()->styleRulesForElement(element, authorOnly);
+ if (matchedRules) {
+ for (unsigned i = 0; i < matchedRules->length(); i++) {
+ if (matchedRules->item(i)->type() == CSSRule::STYLE_RULE) {
+ RefPtr<CSSMutableStyleDeclaration> s = static_cast<CSSStyleRule*>(matchedRules->item(i))->style();
+ style->merge(s.get(), true);
+ }
+ }
+ }
+
return style.release();
}
+void StyledMarkupAccumulator::appendElement(Vector<UChar>& out, Element* element, bool addDisplayInline, RangeFullySelectsNode rangeFullySelectsNode)
+{
+ bool documentIsHTML = element->document()->isHTMLDocument();
+ appendOpenTag(out, element, 0);
+
+ NamedNodeMap* attributes = element->attributes();
+ unsigned length = attributes->length();
+ for (unsigned int i = 0; i < length; i++) {
+ Attribute* attribute = attributes->attributeItem(i);
+ // We'll handle the style attribute separately, below.
+ if (attribute->name() == styleAttr && element->isHTMLElement() && (shouldAnnotate() || addDisplayInline))
+ continue;
+ appendAttribute(out, element, *attribute, 0);
+ }
+
+ if (element->isHTMLElement() && (shouldAnnotate() || addDisplayInline)) {
+ RefPtr<CSSMutableStyleDeclaration> style = static_cast<HTMLElement*>(element)->getInlineStyleDecl()->copy();
+ if (shouldAnnotate()) {
+ RefPtr<CSSMutableStyleDeclaration> styleFromMatchedRules = styleFromMatchedRulesForElement(const_cast<Element*>(element));
+ // Styles from the inline style declaration, held in the variable "style", take precedence
+ // over those from matched rules.
+ styleFromMatchedRules->merge(style.get());
+ style = styleFromMatchedRules;
+
+ RefPtr<CSSComputedStyleDeclaration> computedStyleForElement = computedStyle(element);
+ RefPtr<CSSMutableStyleDeclaration> fromComputedStyle = CSSMutableStyleDeclaration::create();
+
+ {
+ CSSMutableStyleDeclaration::const_iterator end = style->end();
+ for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) {
+ const CSSProperty& property = *it;
+ CSSValue* value = property.value();
+ // The property value, if it's a percentage, may not reflect the actual computed value.
+ // For example: style="height: 1%; overflow: visible;" in quirksmode
+ // FIXME: There are others like this, see <rdar://problem/5195123> Slashdot copy/paste fidelity problem
+ if (value->cssValueType() == CSSValue::CSS_PRIMITIVE_VALUE)
+ if (static_cast<CSSPrimitiveValue*>(value)->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE)
+ if (RefPtr<CSSValue> computedPropertyValue = computedStyleForElement->getPropertyCSSValue(property.id()))
+ fromComputedStyle->addParsedProperty(CSSProperty(property.id(), computedPropertyValue));
+ }
+ }
+ style->merge(fromComputedStyle.get());
+ }
+ if (addDisplayInline)
+ style->setProperty(CSSPropertyDisplay, CSSValueInline, true);
+ // If the node is not fully selected by the range, then we don't want to keep styles that affect its relationship to the nodes around it
+ // only the ones that affect it and the nodes within it.
+ if (rangeFullySelectsNode == DoesNotFullySelectNode)
+ removeExteriorStyles(style.get());
+ if (style->length() > 0) {
+ DEFINE_STATIC_LOCAL(const String, stylePrefix, (" style=\""));
+ append(out, stylePrefix);
+ appendAttributeValue(out, style->cssText(), documentIsHTML);
+ out.append('\"');
+ }
+ }
+
+ appendCloseTag(out, element);
+}
+
+void StyledMarkupAccumulator::removeExteriorStyles(CSSMutableStyleDeclaration* style)
+{
+ style->removeProperty(CSSPropertyFloat);
+}
+
static Node* serializeNodes(StyledMarkupAccumulator& accumulator, Node* startNode, Node* pastEnd)
{
Vector<Node*> ancestorsToClose;
@@ -896,6 +856,9 @@ static Node* ancestorToRetainStructureAndAppearance(Node* commonAncestor)
{
Node* commonAncestorBlock = enclosingBlock(commonAncestor);
+ if (!commonAncestorBlock)
+ return 0;
+
if (commonAncestorBlock->hasTagName(tbodyTag) || commonAncestorBlock->hasTagName(trTag)) {
Node* table = commonAncestorBlock->parentNode();
while (table && !table->hasTagName(tableTag))
@@ -932,6 +895,29 @@ static bool propertyMissingOrEqualToNone(CSSStyleDeclaration* style, int propert
return static_cast<CSSPrimitiveValue*>(value.get())->getIdent() == CSSValueNone;
}
+static bool needInterchangeNewlineAfter(const VisiblePosition& v)
+{
+ VisiblePosition next = v.next();
+ Node* upstreamNode = next.deepEquivalent().upstream().node();
+ Node* downstreamNode = v.deepEquivalent().downstream().node();
+ // Add an interchange newline if a paragraph break is selected and a br won't already be added to the markup to represent it.
+ return isEndOfParagraph(v) && isStartOfParagraph(next) && !(upstreamNode->hasTagName(brTag) && upstreamNode == downstreamNode);
+}
+
+static PassRefPtr<CSSMutableStyleDeclaration> styleFromMatchedRulesAndInlineDecl(const Node* node)
+{
+ if (!node->isHTMLElement())
+ return 0;
+
+ // FIXME: Having to const_cast here is ugly, but it is quite a bit of work to untangle
+ // the non-const-ness of styleFromMatchedRulesForElement.
+ HTMLElement* element = const_cast<HTMLElement*>(static_cast<const HTMLElement*>(node));
+ RefPtr<CSSMutableStyleDeclaration> style = styleFromMatchedRulesForElement(element);
+ RefPtr<CSSMutableStyleDeclaration> inlineStyleDecl = element->getInlineStyleDecl();
+ style->merge(inlineStyleDecl.get());
+ return style.release();
+}
+
static bool isElementPresentational(const Node* node)
{
if (node->hasTagName(uTag) || node->hasTagName(sTag) || node->hasTagName(strikeTag)
@@ -996,6 +982,23 @@ static Node* highestAncestorToWrapMarkup(const Range* range, Node* fullySelected
return specialCommonAncestor;
}
+static void removeEnclosingMailBlockquoteStyle(CSSMutableStyleDeclaration* style, Node* node)
+{
+ Node* blockquote = nearestMailBlockquote(node);
+ if (!blockquote || !blockquote->parentNode())
+ return;
+
+ removeStylesAddedByNode(style, blockquote);
+}
+
+static void removeDefaultStyles(CSSMutableStyleDeclaration* style, Document* document)
+{
+ if (!document || !document->documentElement())
+ return;
+
+ prepareEditingStyleToApplyAt(style, Position(document->documentElement(), 0));
+}
+
// FIXME: Shouldn't we omit style info when annotate == DoNotAnnotateForInterchange?
// FIXME: At least, annotation and style info should probably not be included in range.markupString()
String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterchange shouldAnnotate, bool convertBlocksToInlines, EAbsoluteURLs shouldResolveURLs)
diff --git a/WebCore/features.pri b/WebCore/features.pri
index 1b9f704..df1c91f 100644
--- a/WebCore/features.pri
+++ b/WebCore/features.pri
@@ -166,6 +166,7 @@ contains(DEFINES, ENABLE_WCSS=1) {
## Forward enabled feature macros to JavaScript enabled features macros
FEATURE_DEFINES_JAVASCRIPT = LANGUAGE_JAVASCRIPT=1
+v8: FEATURE_DEFINES_JAVASCRIPT += V8_BINDING=1
contains(DEFINES, ENABLE_CHANNEL_MESSAGING=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_CHANNEL_MESSAGING=1
contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_ORIENTATION_EVENTS=1
contains(DEFINES, ENABLE_DASHBOARD_SUPPORT=0): DASHBOARDSUPPORTCSSPROPERTIES -= $$PWD/css/DashboardSupportCSSPropertyNames.in
diff --git a/WebCore/fileapi/AsyncFileWriter.h b/WebCore/fileapi/AsyncFileWriter.h
index cdb815c..ff6c1fa 100644
--- a/WebCore/fileapi/AsyncFileWriter.h
+++ b/WebCore/fileapi/AsyncFileWriter.h
@@ -31,7 +31,7 @@
#ifndef AsyncFileWriter_h
#define AsyncFileWriter_h
-#if ENABLE(FILE_WRITER)
+#if ENABLE(FILE_SYSTEM)
#include "PlatformString.h"
#include <wtf/RefCounted.h>
@@ -54,7 +54,7 @@ public:
} // namespace
-#endif // ENABLE(FILE_WRITER)
+#endif // ENABLE(FILE_SYSTEM)
#endif // AsyncFileWriter_h
diff --git a/WebCore/fileapi/Blob.cpp b/WebCore/fileapi/Blob.cpp
index 5fed327..d5a5602 100644
--- a/WebCore/fileapi/Blob.cpp
+++ b/WebCore/fileapi/Blob.cpp
@@ -33,57 +33,37 @@
#include "BlobURL.h"
#include "File.h"
-#include "ScriptExecutionContext.h"
#include "ThreadableBlobRegistry.h"
namespace WebCore {
-Blob::Blob(ScriptExecutionContext* scriptExecutionContext, PassOwnPtr<BlobData> blobData, long long size)
- : m_scriptExecutionContext(scriptExecutionContext)
- , m_type(blobData->contentType())
+Blob::Blob(PassOwnPtr<BlobData> blobData, long long size)
+ : m_type(blobData->contentType())
, m_size(size)
{
ASSERT(blobData);
- m_scriptExecutionContext->addBlob(this);
-
// Create a new internal URL and register it with the provided blob data.
- m_url = BlobURL::createURL(scriptExecutionContext);
- ThreadableBlobRegistry::registerBlobURL(scriptExecutionContext, m_url, blobData);
+ m_internalURL = BlobURL::createInternalURL();
+ ThreadableBlobRegistry::registerBlobURL(m_internalURL, blobData);
}
-Blob::Blob(ScriptExecutionContext* scriptExecutionContext, const KURL& srcURL, const String& type, long long size)
- : m_scriptExecutionContext(scriptExecutionContext)
- , m_type(type)
+Blob::Blob(const KURL& srcURL, const String& type, long long size)
+ : m_type(type)
, m_size(size)
{
- m_scriptExecutionContext->addBlob(this);
-
// Create a new internal URL and register it with the same blob data as the source URL.
- m_url = BlobURL::createURL(scriptExecutionContext);
- ThreadableBlobRegistry::registerBlobURL(scriptExecutionContext, m_url, srcURL);
+ m_internalURL = BlobURL::createInternalURL();
+ ThreadableBlobRegistry::registerBlobURL(m_internalURL, srcURL);
}
Blob::~Blob()
{
- // The internal URL is only used to refer to the Blob object. So we need to unregister the URL when the object is GC-ed.
- if (m_scriptExecutionContext) {
- m_scriptExecutionContext->removeBlob(this);
- ThreadableBlobRegistry::unregisterBlobURL(m_scriptExecutionContext, m_url);
- }
-}
-
-void Blob::contextDestroyed()
-{
- ASSERT(m_scriptExecutionContext);
-
- // Unregister the internal URL before the context is gone.
- ThreadableBlobRegistry::unregisterBlobURL(m_scriptExecutionContext, m_url);
- m_scriptExecutionContext = 0;
+ ThreadableBlobRegistry::unregisterBlobURL(m_internalURL);
}
#if ENABLE(BLOB)
-PassRefPtr<Blob> Blob::slice(ScriptExecutionContext* scriptExecutionContext, long long start, long long length, const String& contentType) const
+PassRefPtr<Blob> Blob::slice(long long start, long long length, const String& contentType) const
{
// When we slice a file for the first time, we obtain a snapshot of the file by capturing its current size and modification time.
// The modification time will be used to verify if the file has been changed or not, when the underlying data are accessed.
@@ -114,9 +94,9 @@ PassRefPtr<Blob> Blob::slice(ScriptExecutionContext* scriptExecutionContext, lon
if (isFile())
blobData->appendFile(static_cast<const File*>(this)->path(), start, length, modificationTime);
else
- blobData->appendBlob(m_url, start, length);
+ blobData->appendBlob(m_internalURL, start, length);
- return Blob::create(scriptExecutionContext, blobData.release(), length);
+ return Blob::create(blobData.release(), length);
}
#endif
diff --git a/WebCore/fileapi/Blob.h b/WebCore/fileapi/Blob.h
index 0d5649c..2690ff5 100644
--- a/WebCore/fileapi/Blob.h
+++ b/WebCore/fileapi/Blob.h
@@ -41,46 +41,42 @@
namespace WebCore {
-class ScriptExecutionContext;
-
class Blob : public RefCounted<Blob> {
public:
- static PassRefPtr<Blob> create(ScriptExecutionContext* scriptExecutionContext, PassOwnPtr<BlobData> blobData, long long size)
+ static PassRefPtr<Blob> create(PassOwnPtr<BlobData> blobData, long long size)
{
- return adoptRef(new Blob(scriptExecutionContext, blobData, size));
+ return adoptRef(new Blob(blobData, size));
}
// For deserialization.
- static PassRefPtr<Blob> create(ScriptExecutionContext* scriptExecutionContext, const KURL& srcURL, const String& type, long long size)
+ static PassRefPtr<Blob> create(const KURL& srcURL, const String& type, long long size)
{
- return adoptRef(new Blob(scriptExecutionContext, srcURL, type, size));
+ return adoptRef(new Blob(srcURL, type, size));
}
virtual ~Blob();
- void contextDestroyed();
-
- const KURL& url() const { return m_url; }
+ const KURL& url() const { return m_internalURL; }
const String& type() const { return m_type; }
virtual unsigned long long size() const { return static_cast<unsigned long long>(m_size); }
virtual bool isFile() const { return false; }
#if ENABLE(BLOB)
- PassRefPtr<Blob> slice(ScriptExecutionContext*, long long start, long long length, const String& contentType = String()) const;
+ PassRefPtr<Blob> slice(long long start, long long length, const String& contentType = String()) const;
#endif
protected:
- Blob(ScriptExecutionContext*, PassOwnPtr<BlobData>, long long size);
+ Blob(PassOwnPtr<BlobData>, long long size);
// For deserialization.
- Blob(ScriptExecutionContext*, const KURL& srcURL, const String& type, long long size);
+ Blob(const KURL& srcURL, const String& type, long long size);
- // This is an internal URL referring to the blob data associated with this object.
- // It is only used by FileReader to read the blob data via loading from the blob URL resource.
- KURL m_url;
+ // This is an internal URL referring to the blob data associated with this object. It serves
+ // as an identifier for this blob. The internal URL is never used to source the blob's content
+ // into an HTML or for FileRead'ing, public blob URLs must be used for those purposes.
+ KURL m_internalURL;
- ScriptExecutionContext* m_scriptExecutionContext;
String m_type;
long long m_size;
};
diff --git a/WebCore/fileapi/Blob.idl b/WebCore/fileapi/Blob.idl
index b220233..297d039 100644
--- a/WebCore/fileapi/Blob.idl
+++ b/WebCore/fileapi/Blob.idl
@@ -38,7 +38,7 @@ module html {
#if !defined(LANGUAGE_OBJECTIVE_C)
#if defined(ENABLE_BLOB) && ENABLE_BLOB
- [CallWith=ScriptExecutionContext] Blob slice(in long long start, in long long length, in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
+ Blob slice(in long long start, in long long length, in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
#endif
#endif
};
diff --git a/WebCore/fileapi/BlobBuilder.cpp b/WebCore/fileapi/BlobBuilder.cpp
index e10df6b..34864a5 100644
--- a/WebCore/fileapi/BlobBuilder.cpp
+++ b/WebCore/fileapi/BlobBuilder.cpp
@@ -117,13 +117,13 @@ bool BlobBuilder::append(PassRefPtr<Blob> blob)
return true;
}
-PassRefPtr<Blob> BlobBuilder::getBlob(ScriptExecutionContext* scriptExecutionContext, const String& contentType)
+PassRefPtr<Blob> BlobBuilder::getBlob(const String& contentType)
{
OwnPtr<BlobData> blobData = BlobData::create();
blobData->setContentType(contentType);
blobData->swapItems(m_items);
- RefPtr<Blob> blob = Blob::create(scriptExecutionContext, blobData.release(), m_size);
+ RefPtr<Blob> blob = Blob::create(blobData.release(), m_size);
// After creating a blob from the current blob data, we do not need to keep the data around any more. Instead, we only
// need to keep a reference to the URL of the blob just created.
diff --git a/WebCore/fileapi/BlobBuilder.h b/WebCore/fileapi/BlobBuilder.h
index 20e510a..a981e31 100644
--- a/WebCore/fileapi/BlobBuilder.h
+++ b/WebCore/fileapi/BlobBuilder.h
@@ -41,7 +41,6 @@
namespace WebCore {
class Blob;
-class ScriptExecutionContext;
class TextEncoding;
typedef int ExceptionCode;
@@ -54,7 +53,7 @@ public:
bool append(const String& text, ExceptionCode&);
bool append(const String& text, const String& ending, ExceptionCode&);
- PassRefPtr<Blob> getBlob(ScriptExecutionContext*, const String& contentType = String());
+ PassRefPtr<Blob> getBlob(const String& contentType = String());
private:
BlobBuilder();
diff --git a/WebCore/fileapi/BlobBuilder.idl b/WebCore/fileapi/BlobBuilder.idl
index 53c7add..0da9314 100644
--- a/WebCore/fileapi/BlobBuilder.idl
+++ b/WebCore/fileapi/BlobBuilder.idl
@@ -35,7 +35,7 @@ module html {
NoStaticTables
] BlobBuilder {
#if !defined(LANGUAGE_OBJECTIVE_C)
- [CallWith=ScriptExecutionContext] Blob getBlob(in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
+ Blob getBlob(in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
#endif
void append(in Blob blob);
void append(in DOMString value, in [Optional, ConvertUndefinedOrNullToNullString] DOMString endings) raises (DOMException);
diff --git a/WebCore/fileapi/BlobURL.cpp b/WebCore/fileapi/BlobURL.cpp
index c5571a7..47ebe8d 100644
--- a/WebCore/fileapi/BlobURL.cpp
+++ b/WebCore/fileapi/BlobURL.cpp
@@ -34,28 +34,27 @@
#include "KURL.h"
#include "PlatformString.h"
-#include "ScriptExecutionContext.h"
#include "SecurityOrigin.h"
#include "UUID.h"
namespace WebCore {
-KURL BlobURL::createURL(ScriptExecutionContext* scriptExecutionContext)
+const char BlobURL::kBlobProtocol[] = "blob";
+
+KURL BlobURL::createPublicURL(SecurityOrigin* securityOrigin)
{
- // Create the blob URL in the following format:
- // blob:%escaped_origin%/%UUID%
- // The origin of the host page is encoded in the URL value to allow easy lookup of the origin when the security check needs
- // to be performed.
- String urlString = "blob:";
- urlString += encodeWithURLEscapeSequences(scriptExecutionContext->securityOrigin()->toString());
- urlString += "/";
- urlString += createCanonicalUUIDString();
- return KURL(ParsedURLString, urlString);
+ ASSERT(securityOrigin);
+ return createBlobURL(securityOrigin->toString());
+}
+
+KURL BlobURL::createInternalURL()
+{
+ return createBlobURL("blobinternal://");
}
KURL BlobURL::getOrigin(const KURL& url)
{
- ASSERT(url.protocolIs("blob"));
+ ASSERT(url.protocolIs(kBlobProtocol));
unsigned startIndex = url.pathStart();
unsigned afterEndIndex = url.pathAfterLastSlash();
@@ -65,10 +64,20 @@ KURL BlobURL::getOrigin(const KURL& url)
String BlobURL::getIdentifier(const KURL& url)
{
- ASSERT(url.protocolIs("blob"));
+ ASSERT(url.protocolIs(kBlobProtocol));
unsigned startIndex = url.pathAfterLastSlash();
return url.string().substring(startIndex);
}
+KURL BlobURL::createBlobURL(const String& originString)
+{
+ String urlString = kBlobProtocol;
+ urlString += ":";
+ urlString += encodeWithURLEscapeSequences(originString);
+ urlString += "/";
+ urlString += createCanonicalUUIDString();
+ return KURL(ParsedURLString, urlString);
+}
+
} // namespace WebCore
diff --git a/WebCore/fileapi/BlobURL.h b/WebCore/fileapi/BlobURL.h
index e73b771..4526e63 100644
--- a/WebCore/fileapi/BlobURL.h
+++ b/WebCore/fileapi/BlobURL.h
@@ -35,13 +35,29 @@
namespace WebCore {
-class ScriptExecutionContext;
+class SecurityOrigin;
+// Blob URLs are of the form
+// blob:%escaped_origin%/%UUID%
+// For public urls, the origin of the host page is encoded in the URL value to
+// allow easy lookup of the origin when security checks need to be performed.
+// When loading blobs via ResourceHandle or when reading blobs via FileReader
+// the loader conducts security checks that examine the origin of host page
+// encoded in the public blob url. The origin baked into internal blob urls
+// is a simple constant value, "blobinternal://", internal urls should not
+// be used with ResourceHandle or FileReader.
class BlobURL {
public:
- static KURL createURL(ScriptExecutionContext*);
+ static KURL createPublicURL(SecurityOrigin*);
+ static KURL createInternalURL();
static KURL getOrigin(const KURL&);
- static String getIdentifier(const KURL& url);
+ static String getIdentifier(const KURL&);
+ static const char* blobProtocol() { return kBlobProtocol; }
+
+private:
+ static KURL createBlobURL(const String& originString);
+ static const char kBlobProtocol[];
+ BlobURL() { }
};
}
diff --git a/WebCore/fileapi/DOMFilePath.cpp b/WebCore/fileapi/DOMFilePath.cpp
index 2da057c..1e0d788 100644
--- a/WebCore/fileapi/DOMFilePath.cpp
+++ b/WebCore/fileapi/DOMFilePath.cpp
@@ -61,7 +61,7 @@ String DOMFilePath::getName(const String& path)
{
int index = path.reverseFind(DOMFilePath::separator);
if (index != -1)
- return path.substring(index);
+ return path.substring(index + 1);
return path;
}
diff --git a/WebCore/fileapi/DirectoryEntry.h b/WebCore/fileapi/DirectoryEntry.h
index 3cd8ab5..c76b204 100644
--- a/WebCore/fileapi/DirectoryEntry.h
+++ b/WebCore/fileapi/DirectoryEntry.h
@@ -54,8 +54,8 @@ public:
virtual bool isDirectory() const { return true; }
PassRefPtr<DirectoryReader> createReader();
- void getFile(const String& path, PassRefPtr<Flags> options = 0, PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
- void getDirectory(const String& path, PassRefPtr<Flags> options = 0, PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
+ void getFile(const String& path, PassRefPtr<Flags> = 0, PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0);
+ void getDirectory(const String& path, PassRefPtr<Flags> = 0, PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0);
private:
DirectoryEntry(DOMFileSystem* fileSystem, const String& fullPath);
diff --git a/WebCore/fileapi/DirectoryEntry.idl b/WebCore/fileapi/DirectoryEntry.idl
index ac30c7f..7a0efdd 100644
--- a/WebCore/fileapi/DirectoryEntry.idl
+++ b/WebCore/fileapi/DirectoryEntry.idl
@@ -35,7 +35,7 @@ module storage {
GenerateToJS
] DirectoryEntry : Entry {
DirectoryReader createReader();
- void getFile(in DOMString path, in [Optional] Flags options, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
- void getDirectory(in DOMString path, in [Optional] Flags options, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ [Custom] void getFile(in [ConvertUndefinedOrNullToNullString] DOMString path, in [Optional] Flags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ [Custom] void getDirectory(in [ConvertUndefinedOrNullToNullString] DOMString path, in [Optional] Flags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
};
}
diff --git a/WebCore/fileapi/Entry.cpp b/WebCore/fileapi/Entry.cpp
index fbbedf2..969ae2b 100644
--- a/WebCore/fileapi/Entry.cpp
+++ b/WebCore/fileapi/Entry.cpp
@@ -45,12 +45,8 @@ namespace WebCore {
Entry::Entry(DOMFileSystem* fileSystem, const String& fullPath)
: m_fileSystem(fileSystem)
, m_fullPath(fullPath)
+ , m_name(DOMFilePath::getName(fullPath))
{
- size_t index = fullPath.reverseFind("/");
- if (index != notFound)
- m_name = fullPath.substring(index);
- else
- m_name = fullPath;
}
void Entry::getMetadata(PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
diff --git a/WebCore/fileapi/Entry.idl b/WebCore/fileapi/Entry.idl
index e2c1e12..b674455 100644
--- a/WebCore/fileapi/Entry.idl
+++ b/WebCore/fileapi/Entry.idl
@@ -30,7 +30,8 @@
module storage {
interface [
- Conditional=FILE_SYSTEM
+ Conditional=FILE_SYSTEM,
+ CustomToJS
] Entry {
readonly attribute boolean isFile;
readonly attribute boolean isDirectory;
@@ -39,8 +40,8 @@ module storage {
readonly attribute DOMFileSystem filesystem;
void getMetadata(in [Optional, Callback] MetadataCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
- void moveTo(in Entry parent, in [Optional] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
- void copyTo(in Entry parent, in [Optional] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ void moveTo(in Entry parent, in [Optional, ConvertUndefinedOrNullToNullString] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ void copyTo(in Entry parent, in [Optional, ConvertUndefinedOrNullToNullString] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void remove(in [Optional, Callback] VoidCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void getParent(in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
};
diff --git a/WebCore/fileapi/File.cpp b/WebCore/fileapi/File.cpp
index 150a05b..51ada6c 100644
--- a/WebCore/fileapi/File.cpp
+++ b/WebCore/fileapi/File.cpp
@@ -26,7 +26,6 @@
#include "config.h"
#include "File.h"
-#include "BlobRegistry.h"
#include "FileSystem.h"
#include "MIMETypeRegistry.h"
@@ -45,23 +44,23 @@ static PassOwnPtr<BlobData> createBlobDataForFile(const String& path)
return blobData.release();
}
-File::File(ScriptExecutionContext* scriptExecutionContext, const String& path)
- : Blob(scriptExecutionContext, createBlobDataForFile(path), -1)
+File::File(const String& path)
+ : Blob(createBlobDataForFile(path), -1)
, m_path(path)
, m_name(pathGetFileName(path))
{
}
-File::File(ScriptExecutionContext* scriptExecutionContext, const String& path, const KURL& url, const String& type)
- : Blob(scriptExecutionContext, url, type, -1)
+File::File(const String& path, const KURL& url, const String& type)
+ : Blob(url, type, -1)
, m_path(path)
{
m_name = pathGetFileName(path);
}
#if ENABLE(DIRECTORY_UPLOAD)
-File::File(ScriptExecutionContext* scriptExecutionContext, const String& relativePath, const String& path)
- : Blob(scriptExecutionContext, createBlobDataForFile(path), -1)
+File::File(const String& relativePath, const String& path)
+ : Blob(createBlobDataForFile(path), -1)
, m_path(path)
, m_relativePath(relativePath)
{
diff --git a/WebCore/fileapi/File.h b/WebCore/fileapi/File.h
index d6446d3..06b03cd 100644
--- a/WebCore/fileapi/File.h
+++ b/WebCore/fileapi/File.h
@@ -34,25 +34,24 @@
namespace WebCore {
class KURL;
-class ScriptExecutionContext;
class File : public Blob {
public:
- static PassRefPtr<File> create(ScriptExecutionContext* scriptExecutionContext, const String& path)
+ static PassRefPtr<File> create(const String& path)
{
- return adoptRef(new File(scriptExecutionContext, path));
+ return adoptRef(new File(path));
}
// For deserialization.
- static PassRefPtr<File> create(ScriptExecutionContext* scriptExecutionContext, const String& path, const KURL& srcURL, const String& type)
+ static PassRefPtr<File> create(const String& path, const KURL& srcURL, const String& type)
{
- return adoptRef(new File(scriptExecutionContext, path, srcURL, type));
+ return adoptRef(new File(path, srcURL, type));
}
#if ENABLE(DIRECTORY_UPLOAD)
- static PassRefPtr<File> create(ScriptExecutionContext* scriptExecutionContext, const String& relativePath, const String& path)
+ static PassRefPtr<File> create(const String& relativePath, const String& path)
{
- return adoptRef(new File(scriptExecutionContext, relativePath, path));
+ return adoptRef(new File(relativePath, path));
}
#endif
@@ -74,13 +73,13 @@ public:
unsigned long long fileSize() const { return size(); }
private:
- File(ScriptExecutionContext*, const String& path);
+ File(const String& path);
// For deserialization.
- File(ScriptExecutionContext*, const String& path, const KURL& srcURL, const String& type);
+ File(const String& path, const KURL& srcURL, const String& type);
#if ENABLE(DIRECTORY_UPLOAD)
- File(ScriptExecutionContext*, const String& relativePath, const String& path);
+ File(const String& relativePath, const String& path);
#endif
String m_path;
diff --git a/WebCore/fileapi/FileEntry.cpp b/WebCore/fileapi/FileEntry.cpp
index e2a583c..2d1e623 100644
--- a/WebCore/fileapi/FileEntry.cpp
+++ b/WebCore/fileapi/FileEntry.cpp
@@ -33,6 +33,10 @@
#if ENABLE(FILE_SYSTEM)
+#include "ErrorCallback.h"
+#include "FileCallback.h"
+#include "FileWriterCallback.h"
+
namespace WebCore {
FileEntry::FileEntry(DOMFileSystem* fileSystem, const String& fullPath)
@@ -40,6 +44,16 @@ FileEntry::FileEntry(DOMFileSystem* fileSystem, const String& fullPath)
{
}
+void FileEntry::createWriter(PassRefPtr<FileWriterCallback>, PassRefPtr<ErrorCallback>)
+{
+ // FIXME: to be implemented.
+}
+
+void FileEntry::file(PassRefPtr<FileCallback>, PassRefPtr<ErrorCallback>)
+{
+ // FIXME: to be implemented.
+}
+
} // namespace
#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/fileapi/FileEntry.h b/WebCore/fileapi/FileEntry.h
index abcc6bb..2c85d73 100644
--- a/WebCore/fileapi/FileEntry.h
+++ b/WebCore/fileapi/FileEntry.h
@@ -34,6 +34,8 @@
#if ENABLE(FILE_SYSTEM)
#include "Entry.h"
+#include "FileCallback.h"
+#include "FileWriterCallback.h"
namespace WebCore {
@@ -45,6 +47,10 @@ public:
{
return adoptRef(new FileEntry(fileSystem, fullPath));
}
+
+ void createWriter(PassRefPtr<FileWriterCallback>, PassRefPtr<ErrorCallback> = 0);
+ void file(PassRefPtr<FileCallback>, PassRefPtr<ErrorCallback> = 0);
+
virtual bool isFile() const { return true; }
private:
diff --git a/WebCore/fileapi/FileEntry.idl b/WebCore/fileapi/FileEntry.idl
index af3b807..eb913b8 100644
--- a/WebCore/fileapi/FileEntry.idl
+++ b/WebCore/fileapi/FileEntry.idl
@@ -34,5 +34,7 @@ module storage {
GenerateNativeConverter,
GenerateToJS
] FileEntry : Entry {
+ void createWriter(in [Callback] FileWriterCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ void file(in [Callback] FileCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
};
}
diff --git a/WebCore/fileapi/FileError.h b/WebCore/fileapi/FileError.h
index 1c74c07..3528109 100644
--- a/WebCore/fileapi/FileError.h
+++ b/WebCore/fileapi/FileError.h
@@ -31,7 +31,7 @@
#ifndef FileError_h
#define FileError_h
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#include "ExceptionCode.h"
#include <wtf/PassRefPtr.h>
@@ -55,6 +55,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // FileError_h
diff --git a/WebCore/fileapi/FileError.idl b/WebCore/fileapi/FileError.idl
index a5e2bac..c5dedbe 100644
--- a/WebCore/fileapi/FileError.idl
+++ b/WebCore/fileapi/FileError.idl
@@ -30,7 +30,7 @@
module html {
interface [
- Conditional=BLOB|FILE_WRITER,
+ Conditional=BLOB|FILE_SYSTEM,
DontCheckEnums,
NoStaticTables
] FileError {
diff --git a/WebCore/fileapi/FileException.h b/WebCore/fileapi/FileException.h
index 4419eb7..e90ab90 100644
--- a/WebCore/fileapi/FileException.h
+++ b/WebCore/fileapi/FileException.h
@@ -31,7 +31,7 @@
#ifndef FileException_h
#define FileException_h
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#include "ExceptionBase.h"
@@ -60,7 +60,7 @@ private:
} // namespace WebCore
-#endif // ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // FileException_h
diff --git a/WebCore/fileapi/FileException.idl b/WebCore/fileapi/FileException.idl
index cd53a7e..0b2ab9c 100644
--- a/WebCore/fileapi/FileException.idl
+++ b/WebCore/fileapi/FileException.idl
@@ -30,7 +30,7 @@
module html {
interface [
- Conditional=BLOB|FILE_WRITER,
+ Conditional=BLOB|FILE_SYSTEM,
DontCheckEnums,
NoStaticTables
] FileException {
diff --git a/WebCore/fileapi/FileReader.cpp b/WebCore/fileapi/FileReader.cpp
index 747b6ff..8036468 100644
--- a/WebCore/fileapi/FileReader.cpp
+++ b/WebCore/fileapi/FileReader.cpp
@@ -36,6 +36,7 @@
#include "Base64.h"
#include "Blob.h"
+#include "BlobURL.h"
#include "CrossThreadTask.h"
#include "File.h"
#include "Logging.h"
@@ -44,6 +45,7 @@
#include "ResourceRequest.h"
#include "ScriptExecutionContext.h"
#include "TextResourceDecoder.h"
+#include "ThreadableBlobRegistry.h"
#include "ThreadableLoader.h"
#include <wtf/CurrentTime.h>
@@ -154,17 +156,27 @@ void FileReader::terminate()
{
if (m_loader) {
m_loader->cancel();
- m_loader = 0;
+ cleanup();
}
m_state = Completed;
}
+void FileReader::cleanup()
+{
+ m_loader = 0;
+ ThreadableBlobRegistry::unregisterBlobURL(m_urlForReading);
+ m_urlForReading = KURL();
+}
+
void FileReader::start()
{
m_state = Opening;
- // The blob is read by routing through the request handling layer given the blob url.
- ResourceRequest request(m_blob->url());
+ // The blob is read by routing through the request handling layer given a temporary public url.
+ m_urlForReading = BlobURL::createPublicURL(scriptExecutionContext()->securityOrigin());
+ ThreadableBlobRegistry::registerBlobURL(m_urlForReading, m_blob->url());
+
+ ResourceRequest request(m_urlForReading);
request.setHTTPMethod("GET");
ThreadableLoaderOptions options;
@@ -230,7 +242,7 @@ void FileReader::didFinishLoading(unsigned long)
fireEvent(eventNames().loadEvent);
fireEvent(eventNames().loadendEvent);
- m_loader = 0;
+ cleanup();
}
void FileReader::didFail(const ResourceError&)
@@ -247,7 +259,7 @@ void FileReader::failed(int httpStatusCode)
fireEvent(eventNames().errorEvent);
fireEvent(eventNames().loadendEvent);
- m_loader = 0;
+ cleanup();
}
ExceptionCode FileReader::httpStatusCodeToExceptionCode(int httpStatusCode)
diff --git a/WebCore/fileapi/FileReader.h b/WebCore/fileapi/FileReader.h
index 48ce229..68c0f83 100644
--- a/WebCore/fileapi/FileReader.h
+++ b/WebCore/fileapi/FileReader.h
@@ -36,6 +36,7 @@
#include "ActiveDOMObject.h"
#include "EventTarget.h"
#include "FileError.h"
+#include "KURL.h"
#include "PlatformString.h"
#include "ScriptString.h"
#include "TextEncoding.h"
@@ -130,6 +131,7 @@ private:
virtual EventTargetData* ensureEventTargetData() { return &m_eventTargetData; }
void terminate();
+ void cleanup();
void readInternal(Blob*, ReadType);
void failed(int httpStatusCode);
void fireErrorEvent(int httpStatusCode);
@@ -141,6 +143,7 @@ private:
EventTargetData m_eventTargetData;
RefPtr<Blob> m_blob;
+ KURL m_urlForReading;
ReadType m_readType;
TextEncoding m_encoding;
diff --git a/WebCore/fileapi/FileReaderSync.cpp b/WebCore/fileapi/FileReaderSync.cpp
index a907044..6c76714 100644
--- a/WebCore/fileapi/FileReaderSync.cpp
+++ b/WebCore/fileapi/FileReaderSync.cpp
@@ -36,11 +36,13 @@
#include "Base64.h"
#include "Blob.h"
+#include "BlobURL.h"
#include "FileReader.h"
#include "ResourceRequest.h"
#include "ScriptExecutionContext.h"
#include "TextEncoding.h"
#include "TextResourceDecoder.h"
+#include "ThreadableBlobRegistry.h"
#include "ThreadableLoader.h"
namespace WebCore {
@@ -149,12 +151,16 @@ const ScriptString& FileReaderSync::readAsDataURL(ScriptExecutionContext* script
void FileReaderSync::read(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ReadType readType, ExceptionCode& ec)
{
- // The blob is read by routing through the request handling layer given the blob url.
- ResourceRequest request(blob->url());
+ // The blob is read by routing through the request handling layer given the temporary public url.
+ KURL urlForReading = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin());
+ ThreadableBlobRegistry::registerBlobURL(urlForReading, blob->url());
+
+ ResourceRequest request(urlForReading);
request.setHTTPMethod("GET");
FileReaderSyncLoader loader((readType == ReadAsBinaryString) ? &m_result : 0);
loader.start(scriptExecutionContext, request, ec);
+ ThreadableBlobRegistry::unregisterBlobURL(urlForReading);
if (ec)
return;
diff --git a/WebCore/fileapi/FileStreamProxy.cpp b/WebCore/fileapi/FileStreamProxy.cpp
index 30813d3..5daf983 100644
--- a/WebCore/fileapi/FileStreamProxy.cpp
+++ b/WebCore/fileapi/FileStreamProxy.cpp
@@ -30,7 +30,7 @@
#include "config.h"
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#include "FileStreamProxy.h"
@@ -216,4 +216,4 @@ void FileStreamProxy::truncateOnFileThread(long long position)
} // namespace WebCore
-#endif // ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
diff --git a/WebCore/fileapi/FileStreamProxy.h b/WebCore/fileapi/FileStreamProxy.h
index 35a3af8..ce9a105 100644
--- a/WebCore/fileapi/FileStreamProxy.h
+++ b/WebCore/fileapi/FileStreamProxy.h
@@ -32,7 +32,7 @@
#ifndef FileStreamProxy_h
#define FileStreamProxy_h
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#include "AsyncFileStream.h"
#include <wtf/Forward.h>
@@ -87,6 +87,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // FileStreamProxy_h
diff --git a/WebCore/fileapi/FileSystemCallbacks.cpp b/WebCore/fileapi/FileSystemCallbacks.cpp
index 741df78..d59e47a 100644
--- a/WebCore/fileapi/FileSystemCallbacks.cpp
+++ b/WebCore/fileapi/FileSystemCallbacks.cpp
@@ -128,13 +128,12 @@ EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback,
, m_successCallback(successCallback)
, m_fileSystem(fileSystem)
, m_basePath(basePath)
+ , m_entries(EntryArray::create())
{
}
void EntriesCallbacks::didReadDirectoryEntry(const String& name, bool isDirectory)
{
- if (!m_entries)
- m_entries = EntryArray::create();
if (isDirectory)
m_entries->append(DirectoryEntry::create(m_fileSystem, DOMFilePath::append(m_basePath, name)));
else
@@ -143,15 +142,14 @@ void EntriesCallbacks::didReadDirectoryEntry(const String& name, bool isDirector
void EntriesCallbacks::didReadDirectoryEntries(bool hasMore)
{
- ASSERT(m_entries);
if (m_successCallback) {
m_successCallback->handleEvent(m_entries.get());
- m_entries->clear();
- if (!hasMore) {
- // If there're no more entries, call back once more with an empty array.
- m_successCallback->handleEvent(m_entries.get());
+ if (!m_entries->isEmpty() && !hasMore) {
+ // If we have returned some entries and there're no more coming entries (hasMore==false), call back once more with an empty array.
+ m_successCallback->handleEvent(EntryArray::create().get());
m_successCallback.clear();
}
+ m_entries->clear();
}
}
diff --git a/WebCore/fileapi/FileThread.cpp b/WebCore/fileapi/FileThread.cpp
index 4e48cfb..4d55630 100644
--- a/WebCore/fileapi/FileThread.cpp
+++ b/WebCore/fileapi/FileThread.cpp
@@ -30,7 +30,7 @@
#include "config.h"
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#include "FileThread.h"
@@ -116,4 +116,4 @@ void* FileThread::runLoop()
} // namespace WebCore
-#endif // ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
diff --git a/WebCore/fileapi/FileThread.h b/WebCore/fileapi/FileThread.h
index 16acacc..d7aabf7 100644
--- a/WebCore/fileapi/FileThread.h
+++ b/WebCore/fileapi/FileThread.h
@@ -31,7 +31,7 @@
#ifndef FileThread_h
#define FileThread_h
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#include <wtf/MessageQueue.h>
#include <wtf/PassOwnPtr.h>
@@ -83,6 +83,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // FileThread_h
diff --git a/WebCore/fileapi/FileWriter.cpp b/WebCore/fileapi/FileWriter.cpp
index 7ead354..a9f9afd 100644
--- a/WebCore/fileapi/FileWriter.cpp
+++ b/WebCore/fileapi/FileWriter.cpp
@@ -30,7 +30,7 @@
#include "config.h"
-#if ENABLE(FILE_WRITER)
+#if ENABLE(FILE_SYSTEM)
#include "FileWriter.h"
@@ -196,4 +196,4 @@ void FileWriter::fireEvent(const AtomicString& type)
} // namespace WebCore
-#endif // ENABLE(FILE_WRITER)
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/fileapi/FileWriter.h b/WebCore/fileapi/FileWriter.h
index b0af7ea..0737085 100644
--- a/WebCore/fileapi/FileWriter.h
+++ b/WebCore/fileapi/FileWriter.h
@@ -31,7 +31,7 @@
#ifndef FileWriter_h
#define FileWriter_h
-#if ENABLE(FILE_WRITER)
+#if ENABLE(FILE_SYSTEM)
#include "ActiveDOMObject.h"
#include "EventTarget.h"
@@ -103,7 +103,7 @@ private:
virtual ~FileWriter();
- friend class RefCounted<FileWriter>;
+ friend class WTF::RefCounted<FileWriter>;
// EventTarget
virtual void refEventTarget() { ref(); }
@@ -125,6 +125,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(FILE_WRITER)
+#endif // ENABLE(FILE_SYSTEM)
#endif // FileWriter_h
diff --git a/WebCore/fileapi/FileWriter.idl b/WebCore/fileapi/FileWriter.idl
index bb95ee1..4d46e9e 100644
--- a/WebCore/fileapi/FileWriter.idl
+++ b/WebCore/fileapi/FileWriter.idl
@@ -30,7 +30,7 @@
module html {
interface [
- Conditional=FILE_WRITER,
+ Conditional=FILE_SYSTEM,
CallWith=ScriptExecutionContext,
EventTarget,
NoStaticTables
diff --git a/WebCore/fileapi/FileWriterCallback.h b/WebCore/fileapi/FileWriterCallback.h
index f5f4d37..3f9e746 100644
--- a/WebCore/fileapi/FileWriterCallback.h
+++ b/WebCore/fileapi/FileWriterCallback.h
@@ -31,7 +31,7 @@
#ifndef FileWriterCallback_h
#define FileWriterCallback_h
-#if ENABLE(FILE_SYSTEM) && ENABLE(FILE_WRITER)
+#if ENABLE(FILE_SYSTEM)
#include <wtf/RefCounted.h>
@@ -47,6 +47,6 @@ public:
} // namespace
-#endif // ENABLE(FILE_SYSTEM) && ENABLE(FILE_WRITER)
+#endif // ENABLE(FILE_SYSTEM)
#endif // FileWriterCallback_h
diff --git a/WebCore/fileapi/FileWriterCallback.idl b/WebCore/fileapi/FileWriterCallback.idl
index ba77891..df82fed 100644
--- a/WebCore/fileapi/FileWriterCallback.idl
+++ b/WebCore/fileapi/FileWriterCallback.idl
@@ -30,7 +30,7 @@
module fileapi {
interface [
- Conditional=FILE_SYSTEM&FILE_WRITER,
+ Conditional=FILE_SYSTEM,
Callback
] FileWriterCallback {
boolean handleEvent(in FileWriter fileWriter);
diff --git a/WebCore/fileapi/FileWriterClient.h b/WebCore/fileapi/FileWriterClient.h
index 091b1c1..1bebbd6 100644
--- a/WebCore/fileapi/FileWriterClient.h
+++ b/WebCore/fileapi/FileWriterClient.h
@@ -31,7 +31,7 @@
#ifndef FileWriterClient_h
#define FileWriterClient_h
-#if ENABLE(FILE_WRITER)
+#if ENABLE(FILE_SYSTEM)
#include "ExceptionCode.h"
@@ -48,6 +48,6 @@ public:
} // namespace
-#endif // ENABLE(FILE_WRITER)
+#endif // ENABLE(FILE_SYSTEM)
#endif // FileWriterClient_h
diff --git a/WebCore/fileapi/Flags.idl b/WebCore/fileapi/Flags.idl
index cfe73d2..29658a1 100644
--- a/WebCore/fileapi/Flags.idl
+++ b/WebCore/fileapi/Flags.idl
@@ -30,9 +30,10 @@
module storage {
interface [
- Conditional=FILE_SYSTEM
+ Conditional=FILE_SYSTEM,
+ CanBeConstructed
] Flags {
- attribute boolean CREATE;
- attribute boolean EXCLUSIVE;
+ attribute boolean create;
+ attribute boolean exclusive;
};
}
diff --git a/WebCore/fileapi/ThreadableBlobRegistry.cpp b/WebCore/fileapi/ThreadableBlobRegistry.cpp
index 034557b..f74c680 100644
--- a/WebCore/fileapi/ThreadableBlobRegistry.cpp
+++ b/WebCore/fileapi/ThreadableBlobRegistry.cpp
@@ -34,7 +34,6 @@
#include "BlobData.h"
#include "BlobRegistry.h"
-#include "ScriptExecutionContext.h"
#include <wtf/MainThread.h>
namespace WebCore {
@@ -42,7 +41,7 @@ namespace WebCore {
struct BlobRegistryContext {
BlobRegistryContext(const KURL& url, PassOwnPtr<BlobData> blobData)
: url(url.copy())
- , blobData(blobData)
+ , blobData(blobData->copy())
{
}
@@ -70,7 +69,7 @@ static void registerBlobURLTask(void* context)
blobRegistry().registerBlobURL(blobRegistryContext->url, blobRegistryContext->blobData.release());
}
-void ThreadableBlobRegistry::registerBlobURL(ScriptExecutionContext*, const KURL& url, PassOwnPtr<BlobData> blobData)
+void ThreadableBlobRegistry::registerBlobURL(const KURL& url, PassOwnPtr<BlobData> blobData)
{
if (isMainThread())
blobRegistry().registerBlobURL(url, blobData);
@@ -86,7 +85,7 @@ static void registerBlobURLFromTask(void* context)
blobRegistry().registerBlobURL(blobRegistryContext->url, blobRegistryContext->srcURL);
}
-void ThreadableBlobRegistry::registerBlobURL(ScriptExecutionContext*, const KURL& url, const KURL& srcURL)
+void ThreadableBlobRegistry::registerBlobURL(const KURL& url, const KURL& srcURL)
{
if (isMainThread())
blobRegistry().registerBlobURL(url, srcURL);
@@ -102,7 +101,7 @@ static void unregisterBlobURLTask(void* context)
blobRegistry().unregisterBlobURL(blobRegistryContext->url);
}
-void ThreadableBlobRegistry::unregisterBlobURL(ScriptExecutionContext*, const KURL& url)
+void ThreadableBlobRegistry::unregisterBlobURL(const KURL& url)
{
if (isMainThread())
blobRegistry().unregisterBlobURL(url);
@@ -114,15 +113,15 @@ void ThreadableBlobRegistry::unregisterBlobURL(ScriptExecutionContext*, const KU
#else
-void ThreadableBlobRegistry::registerBlobURL(ScriptExecutionContext*, const KURL&, PassOwnPtr<BlobData>)
+void ThreadableBlobRegistry::registerBlobURL(const KURL&, PassOwnPtr<BlobData>)
{
}
-void ThreadableBlobRegistry::registerBlobURL(ScriptExecutionContext*, const KURL&, const KURL&)
+void ThreadableBlobRegistry::registerBlobURL(const KURL&, const KURL&)
{
}
-void ThreadableBlobRegistry::unregisterBlobURL(ScriptExecutionContext*, const KURL&)
+void ThreadableBlobRegistry::unregisterBlobURL(const KURL&)
{
}
#endif // ENABL(BLOB)
diff --git a/WebCore/fileapi/ThreadableBlobRegistry.h b/WebCore/fileapi/ThreadableBlobRegistry.h
index 7dce6bb..fe7df7f 100644
--- a/WebCore/fileapi/ThreadableBlobRegistry.h
+++ b/WebCore/fileapi/ThreadableBlobRegistry.h
@@ -37,13 +37,12 @@ namespace WebCore {
class BlobData;
class KURL;
-class ScriptExecutionContext;
class ThreadableBlobRegistry {
public:
- static void registerBlobURL(ScriptExecutionContext*, const KURL&, PassOwnPtr<BlobData>);
- static void registerBlobURL(ScriptExecutionContext*, const KURL&, const KURL& srcURL);
- static void unregisterBlobURL(ScriptExecutionContext*, const KURL&);
+ static void registerBlobURL(const KURL&, PassOwnPtr<BlobData>);
+ static void registerBlobURL(const KURL&, const KURL& srcURL);
+ static void unregisterBlobURL(const KURL&);
};
} // namespace WebCore
diff --git a/WebCore/history/CachedFrame.cpp b/WebCore/history/CachedFrame.cpp
index f0a4fed..470e03f 100644
--- a/WebCore/history/CachedFrame.cpp
+++ b/WebCore/history/CachedFrame.cpp
@@ -128,7 +128,7 @@ CachedFrame::CachedFrame(Frame* frame)
ASSERT(m_view);
// Active DOM objects must be suspended before we cached the frame script data
- m_document->suspendActiveDOMObjects();
+ m_document->suspendActiveDOMObjects(ActiveDOMObject::DocumentWillBecomeInactive);
m_cachedFrameScriptData = adoptPtr(new ScriptCachedFrameData(frame));
// Custom scrollbar renderers will get reattached when the document comes out of the page cache
diff --git a/WebCore/history/PageCache.cpp b/WebCore/history/PageCache.cpp
index 228f7ea..a5b29ce 100644
--- a/WebCore/history/PageCache.cpp
+++ b/WebCore/history/PageCache.cpp
@@ -44,6 +44,7 @@
#include "SharedWorkerRepository.h"
#include "SystemTime.h"
#include <wtf/CurrentTime.h>
+#include <wtf/text/CString.h>
using namespace std;
diff --git a/WebCore/html/HTMLAnchorElement.cpp b/WebCore/html/HTMLAnchorElement.cpp
index e1ee86a..995552e 100644
--- a/WebCore/html/HTMLAnchorElement.cpp
+++ b/WebCore/html/HTMLAnchorElement.cpp
@@ -2,7 +2,7 @@
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Simon Hausmann <hausmann@kde.org>
- * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* This library is free software; you can redistribute it and/or
@@ -105,117 +105,67 @@ bool HTMLAnchorElement::isKeyboardFocusable(KeyboardEvent* event) const
return hasNonEmptyBoundingBox();
}
-void HTMLAnchorElement::defaultEventHandler(Event* evt)
+static void appendServerMapMousePosition(String& url, Event* event)
{
- // React on clicks and on keypresses.
- // Don't make this KEYUP_EVENT again, it makes khtml follow links it shouldn't,
- // when pressing Enter in the combo.
- if (isLink() && (evt->type() == eventNames().clickEvent || (evt->type() == eventNames().keydownEvent && focused()))) {
- MouseEvent* e = 0;
- if (evt->type() == eventNames().clickEvent && evt->isMouseEvent())
- e = static_cast<MouseEvent*>(evt);
+ if (!event->isMouseEvent())
+ return;
- KeyboardEvent* k = 0;
- if (evt->type() == eventNames().keydownEvent && evt->isKeyboardEvent())
- k = static_cast<KeyboardEvent*>(evt);
+ ASSERT(event->target());
+ Node* target = event->target()->toNode();
+ ASSERT(target);
+ if (!target->hasTagName(imgTag))
+ return;
- if (e && e->button() == RightButton) {
- HTMLElement::defaultEventHandler(evt);
- return;
- }
+ HTMLImageElement* imageElement = static_cast<HTMLImageElement*>(event->target()->toNode());
+ if (!imageElement || !imageElement->isServerMap())
+ return;
- // If the link is editable, then we need to check the settings to see whether or not to follow the link
- if (isContentEditable()) {
- EditableLinkBehavior editableLinkBehavior = EditableLinkDefaultBehavior;
- if (Settings* settings = document()->settings())
- editableLinkBehavior = settings->editableLinkBehavior();
-
- switch (editableLinkBehavior) {
- // Always follow the link (Safari 2.0 behavior)
- default:
- case EditableLinkDefaultBehavior:
- case EditableLinkAlwaysLive:
- break;
-
- case EditableLinkNeverLive:
- HTMLElement::defaultEventHandler(evt);
- return;
+ RenderImage* renderer = toRenderImage(imageElement->renderer());
+ if (!renderer)
+ return;
- // If the selection prior to clicking on this link resided in the same editable block as this link,
- // and the shift key isn't pressed, we don't want to follow the link
- case EditableLinkLiveWhenNotFocused:
- if (e && !e->shiftKey() && m_rootEditableElementForSelectionOnMouseDown == rootEditableElement()) {
- HTMLElement::defaultEventHandler(evt);
- return;
- }
- break;
-
- // Only follow the link if the shift key is down (WinIE/Firefox behavior)
- case EditableLinkOnlyLiveWithShiftKey:
- if (e && !e->shiftKey()) {
- HTMLElement::defaultEventHandler(evt);
- return;
- }
- break;
- }
- }
+ // FIXME: This should probably pass true for useTransforms.
+ FloatPoint absolutePosition = renderer->absoluteToLocal(FloatPoint(static_cast<MouseEvent*>(event)->pageX(), static_cast<MouseEvent*>(event)->pageY()));
+ int x = absolutePosition.x();
+ int y = absolutePosition.y();
+ url += "?";
+ url += String::number(x);
+ url += ",";
+ url += String::number(y);
+}
- if (k) {
- if (k->keyIdentifier() != "Enter") {
- HTMLElement::defaultEventHandler(evt);
- return;
- }
- evt->setDefaultHandled();
- dispatchSimulatedClick(evt);
+void HTMLAnchorElement::defaultEventHandler(Event* event)
+{
+ if (isLink()) {
+ if (focused() && isEnterKeyKeydownEvent(event) && treatLinkAsLiveForEventType(NonMouseEvent)) {
+ event->setDefaultHandled();
+ dispatchSimulatedClick(event);
return;
}
- String url = deprecatedParseURL(getAttribute(hrefAttr));
-
- ASSERT(evt->target());
- ASSERT(evt->target()->toNode());
- if (evt->target()->toNode()->hasTagName(imgTag)) {
- HTMLImageElement* img = static_cast<HTMLImageElement*>(evt->target()->toNode());
- if (img && img->isServerMap()) {
- RenderImage* r = toRenderImage(img->renderer());
- if (r && e) {
- // FIXME: broken with transforms
- FloatPoint absPos = r->localToAbsolute();
- int x = e->pageX() - absPos.x();
- int y = e->pageY() - absPos.y();
- url += "?";
- url += String::number(x);
- url += ",";
- url += String::number(y);
- } else {
- evt->setDefaultHandled();
- HTMLElement::defaultEventHandler(evt);
- return;
- }
- }
+ if (isLinkClick(event) && treatLinkAsLiveForEventType(eventType(event))) {
+ String url = deprecatedParseURL(getAttribute(hrefAttr));
+ appendServerMapMousePosition(url, event);
+ handleLinkClick(event, document(), url, getAttribute(targetAttr), hasRel(RelationNoReferrer));
+ return;
}
- if (!evt->defaultPrevented() && document()->frame())
- document()->frame()->loader()->urlSelected(document()->completeURL(url), getAttribute(targetAttr), evt, false, false, true, hasRel(RelationNoReferrer) ? NoReferrer : SendReferrer);
-
- evt->setDefaultHandled();
- } else if (isLink() && isContentEditable()) {
- // This keeps track of the editable block that the selection was in (if it was in one) just before the link was clicked
- // for the LiveWhenNotFocused editable link behavior
- if (evt->type() == eventNames().mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() != RightButton && document()->frame() && document()->frame()->selection()) {
- MouseEvent* e = static_cast<MouseEvent*>(evt);
-
- m_rootEditableElementForSelectionOnMouseDown = document()->frame()->selection()->rootEditableElement();
- m_wasShiftKeyDownOnMouseDown = e && e->shiftKey();
- } else if (evt->type() == eventNames().mouseoverEvent) {
- // These are cleared on mouseover and not mouseout because their values are needed for drag events, but these happen
- // after mouse out events.
- m_rootEditableElementForSelectionOnMouseDown = 0;
- m_wasShiftKeyDownOnMouseDown = false;
+ if (isContentEditable()) {
+ // This keeps track of the editable block that the selection was in (if it was in one) just before the link was clicked
+ // for the LiveWhenNotFocused editable link behavior
+ if (event->type() == eventNames().mousedownEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() != RightButton && document()->frame() && document()->frame()->selection()) {
+ m_rootEditableElementForSelectionOnMouseDown = document()->frame()->selection()->rootEditableElement();
+ m_wasShiftKeyDownOnMouseDown = static_cast<MouseEvent*>(event)->shiftKey();
+ } else if (event->type() == eventNames().mouseoverEvent) {
+ // These are cleared on mouseover and not mouseout because their values are needed for drag events,
+ // but drag events happen after mouse out events.
+ m_rootEditableElementForSelectionOnMouseDown = 0;
+ m_wasShiftKeyDownOnMouseDown = false;
+ }
}
}
- HTMLElement::defaultEventHandler(evt);
+ HTMLElement::defaultEventHandler(event);
}
void HTMLAnchorElement::setActive(bool down, bool pause)
@@ -512,32 +462,69 @@ String HTMLAnchorElement::toString() const
bool HTMLAnchorElement::isLiveLink() const
{
- if (!isLink())
- return false;
+ return isLink() && treatLinkAsLiveForEventType(m_wasShiftKeyDownOnMouseDown ? MouseEventWithShiftKey : MouseEventWithoutShiftKey);
+}
+
+HTMLAnchorElement::EventType HTMLAnchorElement::eventType(Event* event)
+{
+ if (!event->isMouseEvent())
+ return NonMouseEvent;
+ return static_cast<MouseEvent*>(event)->shiftKey() ? MouseEventWithShiftKey : MouseEventWithoutShiftKey;
+}
+
+bool HTMLAnchorElement::treatLinkAsLiveForEventType(EventType eventType) const
+{
if (!isContentEditable())
return true;
-
- EditableLinkBehavior editableLinkBehavior = EditableLinkDefaultBehavior;
- if (Settings* settings = document()->settings())
- editableLinkBehavior = settings->editableLinkBehavior();
-
- switch (editableLinkBehavior) {
- default:
- case EditableLinkDefaultBehavior:
- case EditableLinkAlwaysLive:
- return true;
-
- case EditableLinkNeverLive:
- return false;
-
- // Don't set the link to be live if the current selection is in the same editable block as
- // this link or if the shift key is down
- case EditableLinkLiveWhenNotFocused:
- return m_wasShiftKeyDownOnMouseDown || m_rootEditableElementForSelectionOnMouseDown != rootEditableElement();
-
- case EditableLinkOnlyLiveWithShiftKey:
- return m_wasShiftKeyDownOnMouseDown;
+
+ Settings* settings = document()->settings();
+ if (!settings)
+ return true;
+
+ switch (settings->editableLinkBehavior()) {
+ case EditableLinkDefaultBehavior:
+ case EditableLinkAlwaysLive:
+ return true;
+
+ case EditableLinkNeverLive:
+ return false;
+
+ // If the selection prior to clicking on this link resided in the same editable block as this link,
+ // and the shift key isn't pressed, we don't want to follow the link.
+ case EditableLinkLiveWhenNotFocused:
+ return eventType == MouseEventWithShiftKey || (eventType == MouseEventWithoutShiftKey && m_rootEditableElementForSelectionOnMouseDown != rootEditableElement());
+
+ case EditableLinkOnlyLiveWithShiftKey:
+ return eventType == MouseEventWithShiftKey;
}
+
+ ASSERT_NOT_REACHED();
+ return false;
+}
+
+bool isEnterKeyKeydownEvent(Event* event)
+{
+ return event->type() == eventNames().keydownEvent && event->isKeyboardEvent() && static_cast<KeyboardEvent*>(event)->keyIdentifier() == "Enter";
+}
+
+bool isMiddleMouseButtonEvent(Event* event)
+{
+ return event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() == MiddleButton;
+}
+
+bool isLinkClick(Event* event)
+{
+ return event->type() == eventNames().clickEvent || (event->type() == eventNames().mouseupEvent && isMiddleMouseButtonEvent(event));
+}
+
+void handleLinkClick(Event* event, Document* document, const String& url, const String& target, bool hideReferrer)
+{
+ event->setDefaultHandled();
+
+ Frame* frame = document->frame();
+ if (!frame)
+ return;
+ frame->loader()->urlSelected(document->completeURL(url), target, event, false, false, true, hideReferrer ? NoReferrer : SendReferrer);
}
}
diff --git a/WebCore/html/HTMLAnchorElement.h b/WebCore/html/HTMLAnchorElement.h
index a5ef167..16baff1 100644
--- a/WebCore/html/HTMLAnchorElement.h
+++ b/WebCore/html/HTMLAnchorElement.h
@@ -2,7 +2,7 @@
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Simon Hausmann <hausmann@kde.org>
- * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 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
@@ -109,11 +109,26 @@ private:
virtual short tabIndex() const;
virtual bool draggable() const;
+ enum EventType {
+ MouseEventWithoutShiftKey,
+ MouseEventWithShiftKey,
+ NonMouseEvent,
+ };
+ static EventType eventType(Event*);
+ bool treatLinkAsLiveForEventType(EventType) const;
+
RefPtr<Element> m_rootEditableElementForSelectionOnMouseDown;
bool m_wasShiftKeyDownOnMouseDown;
uint32_t m_linkRelations;
};
+// Functions shared with the other anchor elements (SVG and WML).
+
+bool isEnterKeyKeydownEvent(Event*);
+bool isMiddleMouseButtonEvent(Event*);
+bool isLinkClick(Event*);
+void handleLinkClick(Event*, Document*, const String& url, const String& target, bool hideReferrer = false);
+
} // namespace WebCore
#endif // HTMLAnchorElement_h
diff --git a/WebCore/html/HTMLBodyElement.cpp b/WebCore/html/HTMLBodyElement.cpp
index 98e0d6f..05c13ac 100644
--- a/WebCore/html/HTMLBodyElement.cpp
+++ b/WebCore/html/HTMLBodyElement.cpp
@@ -275,9 +275,9 @@ void HTMLBodyElement::setVLink(const String& value)
setAttribute(vlinkAttr, value);
}
-static int adjustForZoom(int value, FrameView* frameView)
+static int adjustForZoom(int value, Document* document)
{
- float zoomFactor = frameView->zoomFactor();
+ float zoomFactor = document->frame()->pageZoomFactor();
if (zoomFactor == 1)
return value;
// Needed because of truncation (rather than rounding) when scaling up.
@@ -289,57 +289,63 @@ static int adjustForZoom(int value, FrameView* frameView)
int HTMLBodyElement::scrollLeft() const
{
// Update the document's layout.
- Document* doc = document();
- doc->updateLayoutIgnorePendingStylesheets();
- FrameView* view = doc->view();
- return view ? adjustForZoom(view->scrollX(), view) : 0;
+ Document* document = this->document();
+ document->updateLayoutIgnorePendingStylesheets();
+ FrameView* view = document->view();
+ return view ? adjustForZoom(view->scrollX(), document) : 0;
}
void HTMLBodyElement::setScrollLeft(int scrollLeft)
{
Document* document = this->document();
document->updateLayoutIgnorePendingStylesheets();
- FrameView* view = document->view();
+ Frame* frame = document->frame();
+ if (!frame)
+ return;
+ FrameView* view = frame->view();
if (!view)
return;
- view->setScrollPosition(IntPoint(static_cast<int>(scrollLeft * view->zoomFactor()), view->scrollY()));
+ view->setScrollPosition(IntPoint(static_cast<int>(scrollLeft * frame->pageZoomFactor()), view->scrollY()));
}
int HTMLBodyElement::scrollTop() const
{
// Update the document's layout.
- Document* doc = document();
- doc->updateLayoutIgnorePendingStylesheets();
- FrameView* view = doc->view();
- return view ? adjustForZoom(view->scrollY(), view) : 0;
+ Document* document = this->document();
+ document->updateLayoutIgnorePendingStylesheets();
+ FrameView* view = document->view();
+ return view ? adjustForZoom(view->scrollY(), document) : 0;
}
void HTMLBodyElement::setScrollTop(int scrollTop)
{
Document* document = this->document();
document->updateLayoutIgnorePendingStylesheets();
- FrameView* view = document->view();
+ Frame* frame = document->frame();
+ if (!frame)
+ return;
+ FrameView* view = frame->view();
if (!view)
return;
- view->setScrollPosition(IntPoint(view->scrollX(), static_cast<int>(scrollTop * view->zoomFactor())));
+ view->setScrollPosition(IntPoint(view->scrollX(), static_cast<int>(scrollTop * frame->pageZoomFactor())));
}
int HTMLBodyElement::scrollHeight() const
{
// Update the document's layout.
- Document* doc = document();
- doc->updateLayoutIgnorePendingStylesheets();
- FrameView* view = doc->view();
- return view ? adjustForZoom(view->contentsHeight(), view) : 0;
+ Document* document = this->document();
+ document->updateLayoutIgnorePendingStylesheets();
+ FrameView* view = document->view();
+ return view ? adjustForZoom(view->contentsHeight(), document) : 0;
}
int HTMLBodyElement::scrollWidth() const
{
// Update the document's layout.
- Document* doc = document();
- doc->updateLayoutIgnorePendingStylesheets();
- FrameView* view = doc->view();
- return view ? adjustForZoom(view->contentsWidth(), view) : 0;
+ Document* document = this->document();
+ document->updateLayoutIgnorePendingStylesheets();
+ FrameView* view = document->view();
+ return view ? adjustForZoom(view->contentsWidth(), document) : 0;
}
void HTMLBodyElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp
index 3838f14..6f46ab4 100644
--- a/WebCore/html/HTMLCanvasElement.cpp
+++ b/WebCore/html/HTMLCanvasElement.cpp
@@ -193,7 +193,7 @@ void HTMLCanvasElement::didDraw(const FloatRect& rect)
FloatRect destRect = ro->contentBoxRect();
FloatRect r = mapRect(rect, FloatRect(0, 0, size().width(), size().height()), destRect);
r.intersect(destRect);
- if (m_dirtyRect.contains(r))
+ if (r.isEmpty() || m_dirtyRect.contains(r))
return;
m_dirtyRect.unite(r);
diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp
index 26e8314..f9efc4f 100644
--- a/WebCore/html/HTMLDocument.cpp
+++ b/WebCore/html/HTMLDocument.cpp
@@ -80,8 +80,8 @@ namespace WebCore {
using namespace HTMLNames;
-HTMLDocument::HTMLDocument(Frame* frame, const KURL& url)
- : Document(frame, url, false, true)
+HTMLDocument::HTMLDocument(Frame* frame, const KURL& url, const KURL& baseURL)
+ : Document(frame, url, false, true, baseURL)
{
clearXMLVersion();
}
@@ -136,11 +136,6 @@ void HTMLDocument::setDesignMode(const String& value)
Document::setDesignMode(mode);
}
-String HTMLDocument::compatMode() const
-{
- return inQuirksMode() ? "BackCompat" : "CSS1Compat";
-}
-
Element* HTMLDocument::activeElement()
{
if (Node* node = focusedNode())
diff --git a/WebCore/html/HTMLDocument.h b/WebCore/html/HTMLDocument.h
index ae65d42..37edd87 100644
--- a/WebCore/html/HTMLDocument.h
+++ b/WebCore/html/HTMLDocument.h
@@ -35,9 +35,9 @@ class HTMLElement;
class HTMLDocument : public Document, public CachedResourceClient {
public:
- static PassRefPtr<HTMLDocument> create(Frame* frame, const KURL& url)
+ static PassRefPtr<HTMLDocument> create(Frame* frame, const KURL& url, const KURL& baseURL = KURL())
{
- return adoptRef(new HTMLDocument(frame, url));
+ return adoptRef(new HTMLDocument(frame, url, baseURL));
}
virtual ~HTMLDocument();
@@ -50,7 +50,6 @@ public:
String designMode() const;
void setDesignMode(const String&);
- String compatMode() const;
virtual void setCompatibilityModeFromDoctype();
Element* activeElement();
@@ -81,7 +80,7 @@ public:
bool hasExtraNamedItem(AtomicStringImpl* name);
protected:
- HTMLDocument(Frame*, const KURL&);
+ HTMLDocument(Frame* frame, const KURL& url, const KURL& baseURL = KURL());
#ifdef ANDROID_INSTRUMENT
// Overridden to resolve the ambiguous
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index 0862130..a56efdc 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -39,6 +39,7 @@
#include "HTMLElementFactory.h"
#include "HTMLFormElement.h"
#include "HTMLNames.h"
+#include "HTMLParserIdioms.h"
#include "RenderWordBreak.h"
#include "ScriptEventListener.h"
#include "Settings.h"
@@ -46,6 +47,7 @@
#include "TextIterator.h"
#include "markup.h"
#include <wtf/StdLibExtras.h>
+#include <wtf/text/CString.h>
namespace WebCore {
@@ -142,12 +144,10 @@ void HTMLElement::parseMappedAttribute(Attribute* attr)
setContentEditable(attr);
} else if (attr->name() == tabindexAttr) {
indexstring = getAttribute(tabindexAttr);
- if (indexstring.length()) {
- bool parsedOK;
- int tabindex = indexstring.toIntStrict(&parsedOK);
- if (parsedOK)
- // Clamp tabindex to the range of 'short' to match Firefox's behavior.
- setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max()))));
+ int tabindex = 0;
+ if (parseHTMLInteger(indexstring, tabindex)) {
+ // Clamp tabindex to the range of 'short' to match Firefox's behavior.
+ setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max()))));
}
} else if (attr->name() == langAttr) {
// FIXME: Implement
@@ -266,11 +266,6 @@ String HTMLElement::outerHTML() const
return createMarkup(this);
}
-static bool useLegacyTreeBuilder(Document*)
-{
- return false;
-}
-
// FIXME: This logic should move into Range::createContextualFragment
PassRefPtr<DocumentFragment> HTMLElement::deprecatedCreateContextualFragment(const String& markup, FragmentScriptingPermission scriptingPermission)
{
@@ -341,13 +336,6 @@ static PassRefPtr<DocumentFragment> createFragmentFromSource(const String& marku
Document* document = contextElement->document();
RefPtr<DocumentFragment> fragment;
- if (useLegacyTreeBuilder(document)) {
- fragment = contextElement->deprecatedCreateContextualFragment(markup);
- if (!fragment)
- ec = NO_MODIFICATION_ALLOWED_ERR;
- return fragment;
- }
-
fragment = DocumentFragment::create(document);
if (document->isHTMLDocument()) {
fragment->parseHTML(markup, contextElement);
@@ -364,14 +352,6 @@ static PassRefPtr<DocumentFragment> createFragmentFromSource(const String& marku
void HTMLElement::setInnerHTML(const String& html, ExceptionCode& ec)
{
- // FIXME: This code can be removed, it's handled by the HTMLDocumentParser correctly.
- if (useLegacyTreeBuilder(document()) && (hasLocalName(scriptTag) || hasLocalName(styleTag))) {
- // Script and CSS source shouldn't be parsed as HTML.
- removeChildren();
- appendChild(document()->createTextNode(html), ec);
- return;
- }
-
RefPtr<DocumentFragment> fragment = createFragmentFromSource(html, this, ec);
if (fragment)
replaceChildrenWithFragment(this, fragment.release(), ec);
diff --git a/WebCore/html/HTMLFontElement.cpp b/WebCore/html/HTMLFontElement.cpp
index 81ae415..5239834 100644
--- a/WebCore/html/HTMLFontElement.cpp
+++ b/WebCore/html/HTMLFontElement.cpp
@@ -27,6 +27,7 @@
#include "CSSPropertyNames.h"
#include "CSSValueKeywords.h"
#include "HTMLNames.h"
+#include "HTMLParserIdioms.h"
using namespace WTF;
@@ -45,49 +46,78 @@ PassRefPtr<HTMLFontElement> HTMLFontElement::create(const QualifiedName& tagName
return adoptRef(new HTMLFontElement(tagName, document));
}
-// Allows leading spaces.
-// Allows trailing nonnumeric characters.
-// Returns 10 for any size greater than 9.
-static bool parseFontSizeNumber(const String& s, int& size)
+// http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#fonts-and-colors
+static bool parseFontSize(const String& input, int& size)
{
- unsigned pos = 0;
-
- // Skip leading spaces.
- while (isSpaceOrNewline(s[pos]))
- ++pos;
-
- // Skip a plus or minus.
- bool sawPlus = false;
- bool sawMinus = false;
- if (s[pos] == '+') {
- ++pos;
- sawPlus = true;
- } else if (s[pos] == '-') {
- ++pos;
- sawMinus = true;
+
+ // Step 1
+ // Step 2
+ const UChar* position = input.characters();
+ const UChar* end = position + input.length();
+
+ // Step 3
+ while (position < end) {
+ if (!isHTMLSpace(*position))
+ break;
+ ++position;
}
-
- // Parse a single digit.
- if (!isASCIIDigit(s[pos]))
+
+ // Step 4
+ if (position == end)
return false;
- int num = s[pos++] - '0';
-
- // Check for an additional digit.
- if (isASCIIDigit(s[pos]))
- num = 10;
-
- if (sawPlus) {
- size = num + 3;
- return true;
+ ASSERT(position < end);
+
+ // Step 5
+ enum {
+ RelativePlus,
+ RelativeMinus,
+ Absolute
+ } mode;
+
+ switch (*position) {
+ case '+':
+ mode = RelativePlus;
+ ++position;
+ break;
+ case '-':
+ mode = RelativeMinus;
+ ++position;
+ break;
+ default:
+ mode = Absolute;
+ break;
}
-
- // Don't return 0 (which means 3) or a negative number (which means the same as 1).
- if (sawMinus) {
- size = num == 1 ? 2 : 1;
- return true;
+
+ // Step 6
+ Vector<UChar, 16> digits;
+ while (position < end) {
+ if (!isASCIIDigit(*position))
+ break;
+ digits.append(*position++);
}
-
- size = num;
+
+ // Step 7
+ if (digits.isEmpty())
+ return false;
+
+ // Step 8
+ int value = charactersToIntStrict(digits.data(), digits.size());
+
+ // Step 9
+ if (mode == RelativePlus)
+ value += 3;
+ else if (mode == RelativeMinus)
+ value = 3 - value;
+
+ // Step 10
+ if (value > 7)
+ value = 7;
+
+ // Step 11
+ if (value < 1)
+ value = 1;
+
+ size = value;
return true;
}
@@ -105,32 +135,35 @@ bool HTMLFontElement::mapToEntry(const QualifiedName& attrName, MappedAttributeE
bool HTMLFontElement::cssValueFromFontSizeNumber(const String& s, int& size)
{
- int num;
- if (!parseFontSizeNumber(s, num))
+ int num = 0;
+ if (!parseFontSize(s, num))
return false;
-
+
switch (num) {
- case 2:
- size = CSSValueSmall;
- break;
- case 0: // treat 0 the same as 3, because people expect it to be between -1 and +1
- case 3:
- size = CSSValueMedium;
- break;
- case 4:
- size = CSSValueLarge;
- break;
- case 5:
- size = CSSValueXLarge;
- break;
- case 6:
- size = CSSValueXxLarge;
- break;
- default:
- if (num > 6)
- size = CSSValueWebkitXxxLarge;
- else
- size = CSSValueXSmall;
+ case 1:
+ // FIXME: The spec says that we're supposed to use CSSValueXxSmall here.
+ size = CSSValueXSmall;
+ break;
+ case 2:
+ size = CSSValueSmall;
+ break;
+ case 3:
+ size = CSSValueMedium;
+ break;
+ case 4:
+ size = CSSValueLarge;
+ break;
+ case 5:
+ size = CSSValueXLarge;
+ break;
+ case 6:
+ size = CSSValueXxLarge;
+ break;
+ case 7:
+ size = CSSValueWebkitXxxLarge;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
}
return true;
}
@@ -138,7 +171,7 @@ bool HTMLFontElement::cssValueFromFontSizeNumber(const String& s, int& size)
void HTMLFontElement::parseMappedAttribute(Attribute* attr)
{
if (attr->name() == sizeAttr) {
- int size;
+ int size = 0;
if (cssValueFromFontSizeNumber(attr->value(), size))
addCSSProperty(attr, CSSPropertyFontSize, size);
} else if (attr->name() == colorAttr) {
diff --git a/WebCore/html/HTMLFormElement.cpp b/WebCore/html/HTMLFormElement.cpp
index 56ffd0f..db5da66 100644
--- a/WebCore/html/HTMLFormElement.cpp
+++ b/WebCore/html/HTMLFormElement.cpp
@@ -65,7 +65,7 @@ using namespace HTMLNames;
HTMLFormElement::HTMLFormElement(const QualifiedName& tagName, Document* document)
: HTMLElement(tagName, document)
- , m_submissionTrigger(NotSubmittedByJavaScript)
+ , m_wasUserSubmitted(false)
, m_autocomplete(true)
, m_insubmit(false)
, m_doingsubmit(false)
@@ -106,13 +106,13 @@ bool HTMLFormElement::rendererIsNeeded(RenderStyle* style)
{
if (!isDemoted())
return HTMLElement::rendererIsNeeded(style);
-
+
Node* node = parentNode();
RenderObject* parentRenderer = node->renderer();
bool parentIsTableElementPart = (parentRenderer->isTable() && node->hasTagName(tableTag))
|| (parentRenderer->isTableRow() && node->hasTagName(trTag))
|| (parentRenderer->isTableSection() && node->hasTagName(tbodyTag))
- || (parentRenderer->isTableCol() && node->hasTagName(colTag))
+ || (parentRenderer->isTableCol() && node->hasTagName(colTag))
|| (parentRenderer->isTableCell() && node->hasTagName(trTag));
if (!parentIsTableElementPart)
@@ -139,7 +139,7 @@ void HTMLFormElement::removedFromDocument()
{
if (document()->isHTMLDocument())
static_cast<HTMLDocument*>(document())->removeNamedItem(m_name);
-
+
HTMLElement::removedFromDocument();
}
@@ -263,7 +263,7 @@ bool HTMLFormElement::prepareSubmit(Event* event)
m_insubmit = false;
if (m_doingsubmit)
- submit(event, true, false, NotSubmittedByJavaScript);
+ submit(event, true, true, NotSubmittedByJavaScript);
return m_doingsubmit;
}
@@ -271,12 +271,12 @@ bool HTMLFormElement::prepareSubmit(Event* event)
void HTMLFormElement::submit(Frame* javaScriptActiveFrame)
{
if (javaScriptActiveFrame)
- submit(0, false, !javaScriptActiveFrame->script()->anyPageIsProcessingUserGesture(), SubmittedByJavaScript);
+ submit(0, false, javaScriptActiveFrame->script()->anyPageIsProcessingUserGesture(), SubmittedByJavaScript);
else
- submit(0, false, false, NotSubmittedByJavaScript);
+ submit(0, false, true, NotSubmittedByJavaScript);
}
-void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool lockHistory, FormSubmissionTrigger formSubmissionTrigger)
+void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool processingUserGesture, FormSubmissionTrigger formSubmissionTrigger)
{
FrameView* view = document()->view();
Frame* frame = document()->frame();
@@ -289,11 +289,11 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool lockH
}
m_insubmit = true;
- m_submissionTrigger = formSubmissionTrigger;
+ m_wasUserSubmitted = processingUserGesture;
HTMLFormControlElement* firstSuccessfulSubmitButton = 0;
bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button?
-
+
for (unsigned i = 0; i < m_associatedElements.size(); ++i) {
HTMLFormControlElement* control = m_associatedElements[i];
if (needButtonActivation) {
@@ -307,11 +307,11 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool lockH
if (needButtonActivation && firstSuccessfulSubmitButton)
firstSuccessfulSubmitButton->setActivatedSubmit(true);
- frame->loader()->submitForm(FormSubmission::create(this, m_attributes, event, lockHistory, formSubmissionTrigger));
+ frame->loader()->submitForm(FormSubmission::create(this, m_attributes, event, !processingUserGesture, formSubmissionTrigger));
if (needButtonActivation && firstSuccessfulSubmitButton)
firstSuccessfulSubmitButton->setActivatedSubmit(false);
-
+
m_doingsubmit = m_insubmit = false;
}
@@ -355,7 +355,7 @@ void HTMLFormElement::parseMappedAttribute(Attribute* attr)
} else if (attr->name() == autocompleteAttr) {
m_autocomplete = !equalIgnoringCase(attr->value(), "off");
if (!m_autocomplete)
- document()->registerForDocumentActivationCallbacks(this);
+ document()->registerForDocumentActivationCallbacks(this);
else
document()->unregisterForDocumentActivationCallbacks(this);
} else if (attr->name() == onsubmitAttr)
@@ -482,9 +482,9 @@ String HTMLFormElement::target() const
return getAttribute(targetAttr);
}
-FormSubmissionTrigger HTMLFormElement::submissionTrigger() const
+bool HTMLFormElement::wasUserSubmitted() const
{
- return m_submissionTrigger;
+ return m_wasUserSubmitted;
}
HTMLFormControlElement* HTMLFormElement::defaultButton() const
@@ -556,13 +556,13 @@ void HTMLFormElement::getNamedElements(const AtomicString& name, Vector<RefPtr<N
}
// name has been accessed, remember it
if (namedItems.size() && aliasElem != namedItems.first())
- addElementAlias(static_cast<HTMLFormControlElement*>(namedItems.first().get()), name);
+ addElementAlias(static_cast<HTMLFormControlElement*>(namedItems.first().get()), name);
}
void HTMLFormElement::documentDidBecomeActive()
{
ASSERT(!m_autocomplete);
-
+
for (unsigned i = 0; i < m_associatedElements.size(); ++i)
m_associatedElements[i]->reset();
}
diff --git a/WebCore/html/HTMLFormElement.h b/WebCore/html/HTMLFormElement.h
index 151b2e8..b996d9d 100644
--- a/WebCore/html/HTMLFormElement.h
+++ b/WebCore/html/HTMLFormElement.h
@@ -42,7 +42,7 @@ class TextEncoding;
struct CollectionCache;
-class HTMLFormElement : public HTMLElement {
+class HTMLFormElement : public HTMLElement {
public:
static PassRefPtr<HTMLFormElement> create(Document*);
static PassRefPtr<HTMLFormElement> create(const QualifiedName&, Document*);
@@ -98,7 +98,7 @@ public:
virtual String target() const;
- FormSubmissionTrigger submissionTrigger() const;
+ bool wasUserSubmitted() const;
HTMLFormControlElement* defaultButton() const;
@@ -117,7 +117,7 @@ private:
virtual bool rendererIsNeeded(RenderStyle*);
virtual void insertedIntoDocument();
virtual void removedFromDocument();
-
+
virtual void handleLocalEvents(Event*);
virtual void parseMappedAttribute(Attribute*);
@@ -129,7 +129,7 @@ private:
virtual void willMoveToNewOwnerDocument();
virtual void didMoveToNewOwnerDocument();
- void submit(Event*, bool activateSubmitButton, bool lockHistory, FormSubmissionTrigger);
+ void submit(Event*, bool activateSubmitButton, bool processingUserGesture, FormSubmissionTrigger);
unsigned formElementIndex(HTMLFormControlElement*);
// Returns true if the submission should be proceeded.
@@ -147,11 +147,11 @@ private:
OwnPtr<CollectionCache> m_collectionCache;
CheckedRadioButtons m_checkedRadioButtons;
-
+
Vector<HTMLFormControlElement*> m_associatedElements;
Vector<HTMLImageElement*> m_imageElements;
- FormSubmissionTrigger m_submissionTrigger;
+ bool m_wasUserSubmitted;
bool m_autocomplete : 1;
bool m_insubmit : 1;
diff --git a/WebCore/html/HTMLFrameElementBase.cpp b/WebCore/html/HTMLFrameElementBase.cpp
index b967926..8cca465 100644
--- a/WebCore/html/HTMLFrameElementBase.cpp
+++ b/WebCore/html/HTMLFrameElementBase.cpp
@@ -52,9 +52,8 @@ HTMLFrameElementBase::HTMLFrameElementBase(const QualifiedName& tagName, Documen
, m_scrolling(ScrollbarAuto)
, m_marginWidth(-1)
, m_marginHeight(-1)
- , m_checkAttachedTimer(this, &HTMLFrameElementBase::checkAttachedTimerFired)
+ , m_checkInDocumentTimer(this, &HTMLFrameElementBase::checkInDocumentTimerFired)
, m_viewSource(false)
- , m_shouldOpenURLAfterAttach(false)
, m_remainsAliveOnRemovalFromTree(false)
{
}
@@ -183,33 +182,31 @@ void HTMLFrameElementBase::updateOnReparenting()
void HTMLFrameElementBase::insertedIntoDocument()
{
HTMLFrameOwnerElement::insertedIntoDocument();
-
- // We delay frame loading until after the render tree is fully constructed.
- // Othewise, a synchronous load that executed JavaScript would see incorrect
- // (0) values for the frame's renderer-dependent properties, like width.
- m_shouldOpenURLAfterAttach = true;
- if (m_remainsAliveOnRemovalFromTree)
+ if (m_remainsAliveOnRemovalFromTree) {
updateOnReparenting();
-}
-
-void HTMLFrameElementBase::removedFromDocument()
-{
- m_shouldOpenURLAfterAttach = false;
+ setRemainsAliveOnRemovalFromTree(false);
+ return;
+ }
+ // DocumentFragments don't kick of any loads.
+ if (!document()->frame())
+ return;
- HTMLFrameOwnerElement::removedFromDocument();
+ // Loads may cause synchronous javascript execution (e.g. beforeload or
+ // src=javascript), which could try to access the renderer before the normal
+ // parser machinery would call lazyAttach() and set us as needing style
+ // resolve. Any code which expects this to be attached will resolve style
+ // before using renderer(), so this will make sure we attach in time.
+ // FIXME: Normally lazyAttach marks the renderer as attached(), but we don't
+ // want to do that here, as as callers expect to call attach() right after
+ // this and attach() will ASSERT(!attached())
+ ASSERT(!renderer()); // This recalc is unecessary if we already have a renderer.
+ lazyAttach(DoNotSetAttached);
+ setNameAndOpenURL();
}
void HTMLFrameElementBase::attach()
{
- if (m_shouldOpenURLAfterAttach) {
- m_shouldOpenURLAfterAttach = false;
- if (!m_remainsAliveOnRemovalFromTree)
- queuePostAttachCallback(&HTMLFrameElementBase::setNameAndOpenURLCallback, this);
- }
-
- setRemainsAliveOnRemovalFromTree(false);
-
HTMLFrameOwnerElement::attach();
if (RenderPart* part = renderPart()) {
@@ -258,19 +255,17 @@ bool HTMLFrameElementBase::isURLAttribute(Attribute *attr) const
int HTMLFrameElementBase::width() const
{
+ document()->updateLayoutIgnorePendingStylesheets();
if (!renderBox())
return 0;
-
- document()->updateLayoutIgnorePendingStylesheets();
return renderBox()->width();
}
int HTMLFrameElementBase::height() const
{
+ document()->updateLayoutIgnorePendingStylesheets();
if (!renderBox())
return 0;
-
- document()->updateLayoutIgnorePendingStylesheets();
return renderBox()->height();
}
@@ -281,12 +276,12 @@ void HTMLFrameElementBase::setRemainsAliveOnRemovalFromTree(bool value)
// There is a possibility that JS will do document.adoptNode() on this element but will not insert it into the tree.
// Start the async timer that is normally stopped by attach(). If it's not stopped and fires, it'll unload the frame.
if (value)
- m_checkAttachedTimer.startOneShot(0);
+ m_checkInDocumentTimer.startOneShot(0);
else
- m_checkAttachedTimer.stop();
+ m_checkInDocumentTimer.stop();
}
-void HTMLFrameElementBase::checkAttachedTimerFired(Timer<HTMLFrameElementBase>*)
+void HTMLFrameElementBase::checkInDocumentTimerFired(Timer<HTMLFrameElementBase>*)
{
ASSERT(!attached());
ASSERT(m_remainsAliveOnRemovalFromTree);
diff --git a/WebCore/html/HTMLFrameElementBase.h b/WebCore/html/HTMLFrameElementBase.h
index 1b6e2a3..ae41e75 100644
--- a/WebCore/html/HTMLFrameElementBase.h
+++ b/WebCore/html/HTMLFrameElementBase.h
@@ -50,15 +50,10 @@ protected:
bool isURLAllowed() const;
virtual void parseMappedAttribute(Attribute*);
-
virtual void insertedIntoDocument();
- virtual void removedFromDocument();
-
virtual void attach();
private:
- virtual bool canLazyAttach() { return false; }
-
virtual bool supportsFocus() const;
virtual void setFocus(bool);
@@ -67,7 +62,7 @@ private:
virtual void setName();
virtual void willRemove();
- void checkAttachedTimerFired(Timer<HTMLFrameElementBase>*);
+ void checkInDocumentTimerFired(Timer<HTMLFrameElementBase>*);
void updateOnReparenting();
bool viewSourceMode() const { return m_viewSource; }
@@ -85,12 +80,19 @@ private:
int m_marginWidth;
int m_marginHeight;
- Timer<HTMLFrameElementBase> m_checkAttachedTimer;
+ // This is a performance optimization some call "magic iframe" which avoids
+ // tearing down the frame hierarchy when a web page calls adoptNode on a
+ // frame owning element but does not immediately insert it into the new
+ // document before JavaScript yields to WebCore. If the element is not yet
+ // in a document by the time this timer fires, the frame hierarchy teardown
+ // will continue. This can also be seen as implementation of:
+ // "Removing an iframe from a Document does not cause its browsing context
+ // to be discarded. Indeed, an iframe's browsing context can survive its
+ // original parent Document if its iframe is moved to another Document."
+ // From HTML5: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#the-iframe-element
+ Timer<HTMLFrameElementBase> m_checkInDocumentTimer;
bool m_viewSource;
-
- bool m_shouldOpenURLAfterAttach;
-
bool m_remainsAliveOnRemovalFromTree;
};
diff --git a/WebCore/html/HTMLFrameOwnerElement.cpp b/WebCore/html/HTMLFrameOwnerElement.cpp
index 3f946f0..2a7b610 100644
--- a/WebCore/html/HTMLFrameOwnerElement.cpp
+++ b/WebCore/html/HTMLFrameOwnerElement.cpp
@@ -51,9 +51,12 @@ RenderPart* HTMLFrameOwnerElement::renderPart() const
void HTMLFrameOwnerElement::willRemove()
{
+ // FIXME: It is unclear why this can't be moved to removedFromDocument()
+ // this is the only implementation of willRemove in WebCore!
if (Frame* frame = contentFrame()) {
- frame->disconnectOwnerElement();
+ RefPtr<Frame> protect(frame);
frame->loader()->frameDetached();
+ frame->disconnectOwnerElement();
}
HTMLElement::willRemove();
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 7bc49fc..a44b68c 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -50,7 +50,7 @@
#include "HTMLImageLoader.h"
#include "HTMLNames.h"
#include "HTMLOptionElement.h"
-#include "HTMLTreeBuilder.h"
+#include "HTMLParserIdioms.h"
#include "KeyboardEvent.h"
#include "LocalizedStrings.h"
#include "MouseEvent.h"
@@ -154,7 +154,7 @@ HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document* docum
, m_xPos(0)
, m_yPos(0)
, m_maxResults(-1)
- , m_type(TEXT)
+ , m_deprecatedTypeNumber(TEXT)
, m_checked(false)
, m_defaultChecked(false)
, m_useDefaultChecked(true)
@@ -244,7 +244,7 @@ bool HTMLInputElement::isValidValue(const String& value) const
{
// Should not call isValidValue() for the following types because
// we can't set string values for these types.
- if (inputType() == CHECKBOX || inputType() == FILE || inputType() == RADIO) {
+ if (deprecatedInputType() == CHECKBOX || deprecatedInputType() == FILE || deprecatedInputType() == RADIO) {
ASSERT_NOT_REACHED();
return false;
}
@@ -259,7 +259,7 @@ bool HTMLInputElement::isValidValue(const String& value) const
bool HTMLInputElement::typeMismatch(const String& value) const
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case COLOR:
return !isValidColorString(value);
case NUMBER:
@@ -284,7 +284,7 @@ bool HTMLInputElement::typeMismatch(const String& value) const
case MONTH:
case TIME:
case WEEK:
- return !parseToDateComponents(inputType(), value, 0);
+ return !parseToDateComponents(deprecatedInputType(), value, 0);
case BUTTON:
case CHECKBOX:
case FILE:
@@ -310,7 +310,7 @@ bool HTMLInputElement::valueMissing(const String& value) const
if (!isRequiredFormControl() || readOnly() || disabled())
return false;
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case DATE:
case DATETIME:
case DATETIMELOCAL:
@@ -382,7 +382,7 @@ bool HTMLInputElement::tooLong(const String& value, NeedsToCheckDirtyFlag check)
bool HTMLInputElement::rangeUnderflow(const String& value) const
{
const double nan = numeric_limits<double>::quiet_NaN();
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case DATE:
case DATETIME:
case DATETIMELOCAL:
@@ -419,7 +419,7 @@ bool HTMLInputElement::rangeUnderflow(const String& value) const
bool HTMLInputElement::rangeOverflow(const String& value) const
{
const double nan = numeric_limits<double>::quiet_NaN();
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case DATE:
case DATETIME:
case DATETIMELOCAL:
@@ -455,7 +455,7 @@ bool HTMLInputElement::rangeOverflow(const String& value) const
double HTMLInputElement::minimum() const
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case DATE:
return parseToDouble(getAttribute(minAttr), DateComponents::minimumDate());
case DATETIME:
@@ -495,7 +495,7 @@ double HTMLInputElement::minimum() const
double HTMLInputElement::maximum() const
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case DATE:
return parseToDouble(getAttribute(maxAttr), DateComponents::maximumDate());
case DATETIME:
@@ -542,7 +542,7 @@ double HTMLInputElement::maximum() const
double HTMLInputElement::stepBase() const
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case RANGE:
return minimum();
case DATE:
@@ -581,7 +581,7 @@ bool HTMLInputElement::stepMismatch(const String& value) const
double step;
if (!getAllowedValueStep(&step))
return false;
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case RANGE:
// stepMismatch doesn't occur for RANGE. RenderSlider guarantees the
// value matches to step on user input, and sanitation takes care
@@ -646,7 +646,7 @@ bool HTMLInputElement::getStepParameters(double* defaultStep, double* stepScaleF
{
ASSERT(defaultStep);
ASSERT(stepScaleFactor);
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case NUMBER:
case RANGE:
*defaultStep = numberDefaultStep;
@@ -715,11 +715,11 @@ bool HTMLInputElement::getAllowedValueStep(double* step) const
return true;
}
// For DATE, MONTH, WEEK, the parsed value should be an integer.
- if (inputType() == DATE || inputType() == MONTH || inputType() == WEEK)
+ if (deprecatedInputType() == DATE || deprecatedInputType() == MONTH || deprecatedInputType() == WEEK)
parsed = max(round(parsed), 1.0);
double result = parsed * stepScaleFactor;
// For DATETIME, DATETIMELOCAL, TIME, the result should be an integer.
- if (inputType() == DATETIME || inputType() == DATETIMELOCAL || inputType() == TIME)
+ if (deprecatedInputType() == DATETIME || deprecatedInputType() == DATETIMELOCAL || deprecatedInputType() == TIME)
result = max(round(result), 1.0);
ASSERT(result > 0);
*step = result;
@@ -777,14 +777,14 @@ bool HTMLInputElement::isKeyboardFocusable(KeyboardEvent* event) const
if (!HTMLFormControlElementWithState::isKeyboardFocusable(event))
return false;
- if (inputType() == RADIO) {
+ if (deprecatedInputType() == RADIO) {
// Never allow keyboard tabbing to leave you in the same radio group. Always
// skip any other elements in the group.
Node* currentFocusedNode = document()->focusedNode();
if (currentFocusedNode && currentFocusedNode->hasTagName(inputTag)) {
HTMLInputElement* focusedInput = static_cast<HTMLInputElement*>(currentFocusedNode);
- if (focusedInput->inputType() == RADIO && focusedInput->form() == form() && focusedInput->name() == name())
+ if (focusedInput->deprecatedInputType() == RADIO && focusedInput->form() == form() && focusedInput->name() == name())
return false;
}
@@ -821,7 +821,7 @@ bool HTMLInputElement::shouldUseInputMethod() const
// can access the underlying password and display it in clear text --
// e.g. you can use it to access the stored password for any site
// with only trivial effort.
- return isTextField() && inputType() != PASSWORD;
+ return isTextField() && deprecatedInputType() != PASSWORD;
}
void HTMLInputElement::handleFocusEvent()
@@ -831,7 +831,7 @@ void HTMLInputElement::handleFocusEvent()
void HTMLInputElement::handleBlurEvent()
{
- if (inputType() == NUMBER) {
+ if (deprecatedInputType() == NUMBER) {
// Reset the renderer value, which might be unmatched with the element value.
setFormControlValueMatchesRenderer(false);
// We need to reset the renderer value explicitly because an unacceptable
@@ -844,6 +844,10 @@ void HTMLInputElement::handleBlurEvent()
void HTMLInputElement::setType(const String& t)
{
+ // FIXME: This should just call setAttribute. No reason to handle the empty string specially.
+ // We should write a test case to show that setting to the empty string does not remove the
+ // attribute in other browsers and then fix this. Note that setting to null *does* remove
+ // the attribute and setAttribute implements that.
if (t.isEmpty()) {
int exccode;
removeAttribute(typeAttr, exccode);
@@ -851,7 +855,7 @@ void HTMLInputElement::setType(const String& t)
setAttribute(typeAttr, t);
}
-typedef HashMap<String, HTMLInputElement::InputType, CaseFoldingHash> InputTypeMap;
+typedef HashMap<String, HTMLInputElement::DeprecatedInputType, CaseFoldingHash> InputTypeMap;
static PassOwnPtr<InputTypeMap> createTypeMap()
{
OwnPtr<InputTypeMap> map = adoptPtr(new InputTypeMap);
@@ -882,19 +886,24 @@ static PassOwnPtr<InputTypeMap> createTypeMap()
return map.release();
}
-void HTMLInputElement::setInputType(const String& t)
+void HTMLInputElement::updateType()
{
static const InputTypeMap* typeMap = createTypeMap().leakPtr();
+<<<<<<< HEAD
InputType newType = t.isNull() ? TEXT : typeMap->get(t);
#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
if (newType == PASSWORD && document()->focusedNode() == this)
android::WebViewCore::getWebViewCore(document()->view())->updateTextfield(this, true, String());
#endif
+=======
+ const AtomicString& typeString = fastGetAttribute(typeAttr);
+ DeprecatedInputType newType = typeString.isEmpty() ? TEXT : typeMap->get(typeString);
+>>>>>>> webkit.org at r67908
// IMPORTANT: Don't allow the type to be changed to FILE after the first
// type change, otherwise a JavaScript programmer would be able to set a text
// field's value to something like /etc/passwd and then change it to a file field.
- if (inputType() != newType) {
+ if (deprecatedInputType() != newType) {
if (newType == FILE && m_haveType)
// Set the attribute back to the old value.
// Useful in case we were called from inside parseMappedAttribute.
@@ -910,12 +919,12 @@ void HTMLInputElement::setInputType(const String& t)
detach();
bool didStoreValue = storesValueSeparateFromAttribute();
- bool wasPasswordField = inputType() == PASSWORD;
+ bool wasPasswordField = deprecatedInputType() == PASSWORD;
bool didRespectHeightAndWidth = respectHeightAndWidthAttrs();
- m_type = newType;
+ m_deprecatedTypeNumber = newType;
setNeedsWillValidateCheck();
bool willStoreValue = storesValueSeparateFromAttribute();
- bool isPasswordField = inputType() == PASSWORD;
+ bool isPasswordField = deprecatedInputType() == PASSWORD;
bool willRespectHeightAndWidth = respectHeightAndWidthAttrs();
if (didStoreValue && !willStoreValue && !m_data.value().isNull()) {
@@ -957,13 +966,13 @@ void HTMLInputElement::setInputType(const String& t)
}
m_haveType = true;
- if (inputType() != IMAGE && m_imageLoader)
+ if (deprecatedInputType() != IMAGE && m_imageLoader)
m_imageLoader.clear();
}
static const AtomicString* createFormControlTypes()
{
- AtomicString* types = new AtomicString[HTMLInputElement::numberOfTypes];
+ AtomicString* types = new AtomicString[HTMLInputElement::deprecatedNumberOfTypes];
// The values must be lowercased because they will be the return values of
// input.type and it must be lowercase according to DOM Level 2.
types[HTMLInputElement::BUTTON] = "button";
@@ -996,12 +1005,12 @@ static const AtomicString* createFormControlTypes()
const AtomicString& HTMLInputElement::formControlType() const
{
static const AtomicString* formControlTypes = createFormControlTypes();
- return formControlTypes[inputType()];
+ return formControlTypes[deprecatedInputType()];
}
bool HTMLInputElement::saveFormControlState(String& result) const
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case BUTTON:
case COLOR:
case DATE:
@@ -1042,8 +1051,8 @@ bool HTMLInputElement::saveFormControlState(String& result) const
void HTMLInputElement::restoreFormControlState(const String& state)
{
- ASSERT(inputType() != PASSWORD); // should never save/restore password fields
- switch (inputType()) {
+ ASSERT(deprecatedInputType() != PASSWORD); // should never save/restore password fields
+ switch (deprecatedInputType()) {
case BUTTON:
case COLOR:
case DATE:
@@ -1090,7 +1099,7 @@ bool HTMLInputElement::canHaveSelection() const
void HTMLInputElement::accessKeyAction(bool sendToAnyElement)
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case BUTTON:
case CHECKBOX:
case FILE:
@@ -1137,7 +1146,7 @@ bool HTMLInputElement::mapToEntry(const QualifiedName& attrName, MappedAttribute
}
if (attrName == alignAttr) {
- if (inputType() == IMAGE) {
+ if (deprecatedInputType() == IMAGE) {
// Share with <img> since the alignment behavior is the same.
result = eReplaced;
return false;
@@ -1170,7 +1179,7 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
unregisterForActivationCallbackIfNeeded();
}
} else if (attr->name() == typeAttr) {
- setInputType(attr->value());
+ updateType();
} else if (attr->name() == valueAttr) {
// We only need to setChanged if the form is looking at the default value right now.
if (m_data.value().isNull())
@@ -1190,10 +1199,10 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
} else if (attr->name() == sizeAttr)
InputElement::parseSizeAttribute(m_data, this, attr);
else if (attr->name() == altAttr) {
- if (renderer() && inputType() == IMAGE)
+ if (renderer() && deprecatedInputType() == IMAGE)
toRenderImage(renderer())->updateAltText();
} else if (attr->name() == srcAttr) {
- if (renderer() && inputType() == IMAGE) {
+ if (renderer() && deprecatedInputType() == IMAGE) {
if (!m_imageLoader)
m_imageLoader = adoptPtr(new HTMLImageLoader(this));
m_imageLoader->updateFromElementIgnoringPreviousError();
@@ -1207,7 +1216,7 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
addCSSLength(attr, CSSPropertyMarginLeft, attr->value());
addCSSLength(attr, CSSPropertyMarginRight, attr->value());
} else if (attr->name() == alignAttr) {
- if (inputType() == IMAGE)
+ if (deprecatedInputType() == IMAGE)
addHTMLAlignment(attr);
} else if (attr->name() == widthAttr) {
if (respectHeightAndWidthAttrs())
@@ -1233,7 +1242,7 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
setNeedsStyleRecalc();
else if (attr->name() == minAttr
|| attr->name() == maxAttr) {
- if (inputType() == RANGE) {
+ if (deprecatedInputType() == RANGE) {
// Sanitize the value.
setValue(value());
setNeedsStyleRecalc();
@@ -1262,14 +1271,14 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
bool HTMLInputElement::rendererIsNeeded(RenderStyle *style)
{
- if (inputType() == HIDDEN)
+ if (deprecatedInputType() == HIDDEN)
return false;
return HTMLFormControlElementWithState::rendererIsNeeded(style);
}
RenderObject* HTMLInputElement::createRenderer(RenderArena *arena, RenderStyle *style)
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case BUTTON:
case RESET:
case SUBMIT:
@@ -1313,13 +1322,13 @@ void HTMLInputElement::attach()
{
if (!m_inited) {
if (!m_haveType)
- setInputType(getAttribute(typeAttr));
+ updateType();
m_inited = true;
}
HTMLFormControlElementWithState::attach();
- if (inputType() == IMAGE) {
+ if (deprecatedInputType() == IMAGE) {
if (!m_imageLoader)
m_imageLoader = adoptPtr(new HTMLImageLoader(this));
m_imageLoader->updateFromElement();
@@ -1335,7 +1344,7 @@ void HTMLInputElement::attach()
}
}
- if (inputType() == RADIO)
+ if (deprecatedInputType() == RADIO)
updateCheckedRadioButtons();
if (document()->focusedNode() == this)
@@ -1368,7 +1377,7 @@ bool HTMLInputElement::isSuccessfulSubmitButton() const
{
// HTML spec says that buttons must have names to be considered successful.
// However, other browsers do not impose this constraint. So we do likewise.
- return !disabled() && (inputType() == IMAGE || inputType() == SUBMIT);
+ return !disabled() && (deprecatedInputType() == IMAGE || deprecatedInputType() == SUBMIT);
}
bool HTMLInputElement::isActivatedSubmit() const
@@ -1384,10 +1393,10 @@ void HTMLInputElement::setActivatedSubmit(bool flag)
bool HTMLInputElement::appendFormData(FormDataList& encoding, bool multipart)
{
// image generates its own names, but for other types there is no form data unless there's a name
- if (name().isEmpty() && inputType() != IMAGE)
+ if (name().isEmpty() && deprecatedInputType() != IMAGE)
return false;
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case COLOR:
case DATE:
case DATETIME:
@@ -1460,7 +1469,7 @@ bool HTMLInputElement::appendFormData(FormDataList& encoding, bool multipart)
// If no filename at all is entered, return successful but empty.
// Null would be more logical, but Netscape posts an empty file. Argh.
if (!numFiles) {
- encoding.appendBlob(name(), File::create(document()->scriptExecutionContext(), ""));
+ encoding.appendBlob(name(), File::create(""));
return true;
}
@@ -1483,7 +1492,7 @@ void HTMLInputElement::reset()
bool HTMLInputElement::isTextField() const
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case COLOR:
case DATE:
case DATETIME:
@@ -1517,7 +1526,7 @@ bool HTMLInputElement::isTextField() const
bool HTMLInputElement::isTextType() const
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case EMAIL:
case PASSWORD:
case SEARCH:
@@ -1573,7 +1582,7 @@ void HTMLInputElement::setChecked(bool nowChecked, bool sendChangeEvent)
// unchecked to match other browsers. DOM is not a useful standard for this
// because it says only to fire change events at "lose focus" time, which is
// definitely wrong in practice for these types of elements.
- if (sendChangeEvent && inDocument() && (inputType() != RADIO || nowChecked))
+ if (sendChangeEvent && inDocument() && (deprecatedInputType() != RADIO || nowChecked))
dispatchFormControlChangeEvent();
}
@@ -1611,7 +1620,7 @@ void HTMLInputElement::copyNonAttributeProperties(const Element* source)
String HTMLInputElement::value() const
{
- if (inputType() == FILE) {
+ if (deprecatedInputType() == FILE) {
if (!m_fileList->isEmpty()) {
// HTML5 tells us that we're supposed to use this goofy value for
// file input controls. Historically, browsers reveals the real
@@ -1632,9 +1641,9 @@ String HTMLInputElement::value() const
// For Checkbox Types just use "on" or "" based off the checked() state of the control.
// For a Range Input use the calculated default value.
if (value.isNull()) {
- if (inputType() == CHECKBOX || inputType() == RADIO)
+ if (deprecatedInputType() == CHECKBOX || deprecatedInputType() == RADIO)
return checked() ? "on" : "";
- if (inputType() == RANGE)
+ if (deprecatedInputType() == RANGE)
return serializeForNumberType(StepRange(this).defaultValue());
}
}
@@ -1646,7 +1655,7 @@ String HTMLInputElement::valueWithDefault() const
{
String v = value();
if (v.isNull()) {
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case BUTTON:
case CHECKBOX:
case COLOR:
@@ -1694,7 +1703,7 @@ const String& HTMLInputElement::suggestedValue() const
void HTMLInputElement::setSuggestedValue(const String& value)
{
- if (inputType() != TEXT)
+ if (deprecatedInputType() != TEXT)
return;
setFormControlValueMatchesRenderer(false);
m_data.setSuggestedValue(sanitizeValue(value));
@@ -1709,12 +1718,12 @@ void HTMLInputElement::setValue(const String& value, bool sendChangeEvent)
// For security reasons, we don't allow setting the filename, but we do allow clearing it.
// The HTML5 spec (as of the 10/24/08 working draft) says that the value attribute isn't applicable to the file upload control
// but we don't want to break existing websites, who may be relying on this method to clear things.
- if (inputType() == FILE && !value.isEmpty())
+ if (deprecatedInputType() == FILE && !value.isEmpty())
return;
setFormControlValueMatchesRenderer(false);
if (storesValueSeparateFromAttribute()) {
- if (inputType() == FILE)
+ if (deprecatedInputType() == FILE)
m_fileList->clear();
else {
m_data.setValue(sanitizeValue(value));
@@ -1750,14 +1759,14 @@ void HTMLInputElement::setValue(const String& value, bool sendChangeEvent)
double HTMLInputElement::parseToDouble(const String& src, double defaultValue) const
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case DATE:
case DATETIME:
case DATETIMELOCAL:
case TIME:
case WEEK: {
DateComponents date;
- if (!parseToDateComponents(inputType(), src, &date))
+ if (!parseToDateComponents(deprecatedInputType(), src, &date))
return defaultValue;
double msec = date.millisecondsSinceEpoch();
ASSERT(isfinite(msec));
@@ -1765,7 +1774,7 @@ double HTMLInputElement::parseToDouble(const String& src, double defaultValue) c
}
case MONTH: {
DateComponents date;
- if (!parseToDateComponents(inputType(), src, &date))
+ if (!parseToDateComponents(deprecatedInputType(), src, &date))
return defaultValue;
double months = date.monthsSinceEpoch();
ASSERT(isfinite(months));
@@ -1804,7 +1813,7 @@ double HTMLInputElement::parseToDouble(const String& src, double defaultValue) c
double HTMLInputElement::valueAsDate() const
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case DATE:
case DATETIME:
case TIME:
@@ -1812,7 +1821,7 @@ double HTMLInputElement::valueAsDate() const
return parseToDouble(value(), DateComponents::invalidMilliseconds());
case MONTH: {
DateComponents date;
- if (!parseToDateComponents(inputType(), value(), &date))
+ if (!parseToDateComponents(deprecatedInputType(), value(), &date))
return DateComponents::invalidMilliseconds();
double msec = date.millisecondsSinceEpoch();
ASSERT(isfinite(msec));
@@ -1846,7 +1855,7 @@ double HTMLInputElement::valueAsDate() const
void HTMLInputElement::setValueAsDate(double value, ExceptionCode& ec)
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case DATE:
case DATETIME:
case TIME:
@@ -1890,7 +1899,7 @@ void HTMLInputElement::setValueAsDate(double value, ExceptionCode& ec)
double HTMLInputElement::valueAsNumber() const
{
const double nan = numeric_limits<double>::quiet_NaN();
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case DATE:
case DATETIME:
case DATETIMELOCAL:
@@ -1929,7 +1938,7 @@ void HTMLInputElement::setValueAsNumber(double newValue, ExceptionCode& ec)
ec = NOT_SUPPORTED_ERR;
return;
}
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case DATE:
case DATETIME:
case DATETIMELOCAL:
@@ -1967,7 +1976,7 @@ String HTMLInputElement::serializeForDateTimeTypes(double value) const
{
bool success = false;
DateComponents date;
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case DATE:
success = date.setMillisecondsSinceEpochForDate(value);
break;
@@ -2024,7 +2033,7 @@ String HTMLInputElement::serialize(double value) const
{
if (!isfinite(value))
return String();
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case DATE:
case DATETIME:
case DATETIMELOCAL:
@@ -2076,7 +2085,7 @@ bool HTMLInputElement::searchEventsShouldBeDispatched() const
void HTMLInputElement::setValueFromRenderer(const String& value)
{
// File upload controls will always use setFileListFromRenderer.
- ASSERT(inputType() != FILE);
+ ASSERT(deprecatedInputType() != FILE);
m_data.setSuggestedValue(String());
updatePlaceholderVisibility(false);
InputElement::setValueFromRenderer(m_data, this, this, value);
@@ -2107,15 +2116,15 @@ void HTMLInputElement::setFileListFromRenderer(const Vector<String>& paths)
for (int i = 0; i < size; i++) {
// Normalize backslashes to slashes before exposing the relative path to script.
String relativePath = paths[i].substring(1 + rootPath.length()).replace('\\','/');
- m_fileList->append(File::create(document()->scriptExecutionContext(), relativePath, paths[i]));
+ m_fileList->append(File::create(relativePath, paths[i]));
}
} else {
for (int i = 0; i < size; i++)
- m_fileList->append(File::create(document()->scriptExecutionContext(), paths[i]));
+ m_fileList->append(File::create(paths[i]));
}
#else
for (int i = 0; i < size; i++)
- m_fileList->append(File::create(document()->scriptExecutionContext(), paths[i]));
+ m_fileList->append(File::create(paths[i]));
#endif
setFormControlValueMatchesRenderer(true);
@@ -2125,7 +2134,7 @@ void HTMLInputElement::setFileListFromRenderer(const Vector<String>& paths)
bool HTMLInputElement::storesValueSeparateFromAttribute() const
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case BUTTON:
case CHECKBOX:
case HIDDEN:
@@ -2166,17 +2175,14 @@ struct EventHandlingState : FastAllocBase {
, m_checked(checked) { }
};
-void* HTMLInputElement::preDispatchEventHandler(Event *evt)
+void* HTMLInputElement::preDispatchEventHandler(Event* evt)
{
// preventDefault or "return false" are used to reverse the automatic checking/selection we do here.
// This result gives us enough info to perform the "undo" in postDispatch of the action we take here.
void* result = 0;
- if ((inputType() == CHECKBOX || inputType() == RADIO) && evt->isMouseEvent()
- && evt->type() == eventNames().clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
-
+ if ((deprecatedInputType() == CHECKBOX || deprecatedInputType() == RADIO) && evt->type() == eventNames().clickEvent) {
OwnPtr<EventHandlingState> state = adoptPtr(new EventHandlingState(indeterminate(), checked()));
-
- if (inputType() == CHECKBOX) {
+ if (deprecatedInputType() == CHECKBOX) {
if (indeterminate())
setIndeterminate(false);
else
@@ -2203,11 +2209,10 @@ void* HTMLInputElement::preDispatchEventHandler(Event *evt)
void HTMLInputElement::postDispatchEventHandler(Event *evt, void* data)
{
- if ((inputType() == CHECKBOX || inputType() == RADIO) && evt->isMouseEvent()
- && evt->type() == eventNames().clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+ if ((deprecatedInputType() == CHECKBOX || deprecatedInputType() == RADIO) && evt->type() == eventNames().clickEvent) {
if (EventHandlingState* state = reinterpret_cast<EventHandlingState*>(data)) {
- if (inputType() == CHECKBOX) {
+ if (deprecatedInputType() == CHECKBOX) {
// Reverse the checking we did in preDispatch.
if (evt->defaultPrevented() || evt->defaultHandled()) {
setIndeterminate(state->m_indeterminate);
@@ -2220,7 +2225,7 @@ void HTMLInputElement::postDispatchEventHandler(Event *evt, void* data)
// Make sure it is still a radio button and only do the restoration if it still
// belongs to our group.
- if (input && input->form() == form() && input->inputType() == RADIO && input->name() == name()) {
+ if (input && input->form() == form() && input->deprecatedInputType() == RADIO && input->name() == name()) {
// Ok, the old radio button is still in our form and in our group and is still a
// radio button, so it's safe to restore selection to it.
input->setChecked(true);
@@ -2246,7 +2251,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
if (isTextField() && evt->type() == eventNames().textInputEvent && evt->isTextEvent() && static_cast<TextEvent*>(evt)->data() == "\n")
implicitSubmission = true;
- if (inputType() == IMAGE && evt->isMouseEvent() && evt->type() == eventNames().clickEvent) {
+ if (deprecatedInputType() == IMAGE && evt->isMouseEvent() && evt->type() == eventNames().clickEvent) {
// record the mouse position for when we get the DOMActivate event
MouseEvent* me = static_cast<MouseEvent*>(evt);
// FIXME: We could just call offsetX() and offsetY() on the event,
@@ -2287,10 +2292,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
return;
}
- if (inputType() == RADIO
- && evt->isMouseEvent()
- && evt->type() == eventNames().clickEvent
- && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+ if (deprecatedInputType() == RADIO && evt->type() == eventNames().clickEvent) {
evt->setDefaultHandled();
return;
}
@@ -2310,10 +2312,10 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
// on the element, or presses enter while it is the active element. JavaScript code wishing to activate the element
// must dispatch a DOMActivate event - a click event will not do the job.
if (evt->type() == eventNames().DOMActivateEvent && !disabled()) {
- if (inputType() == IMAGE || inputType() == SUBMIT || inputType() == RESET) {
+ if (deprecatedInputType() == IMAGE || deprecatedInputType() == SUBMIT || deprecatedInputType() == RESET) {
if (!form())
return;
- if (inputType() == RESET)
+ if (deprecatedInputType() == RESET)
form()->reset();
else {
m_activeSubmit = true;
@@ -2327,7 +2329,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
}
m_activeSubmit = false;
}
- } else if (inputType() == FILE && renderer())
+ } else if (deprecatedInputType() == FILE && renderer())
toRenderFileUploadControl(renderer())->click();
}
@@ -2339,7 +2341,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
int charCode = static_cast<KeyboardEvent*>(evt)->charCode();
if (charCode == '\r') {
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case CHECKBOX:
case COLOR:
case DATE:
@@ -2372,7 +2374,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
break;
}
} else if (charCode == ' ') {
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case BUTTON:
case CHECKBOX:
case FILE:
@@ -2399,7 +2401,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
String key = static_cast<KeyboardEvent*>(evt)->keyIdentifier();
if (key == "U+0020") {
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case BUTTON:
case CHECKBOX:
case FILE:
@@ -2416,7 +2418,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
}
}
- if (inputType() == RADIO && (key == "Up" || key == "Down" || key == "Left" || key == "Right")) {
+ if (deprecatedInputType() == RADIO && (key == "Up" || key == "Down" || key == "Left" || key == "Right")) {
// Left and up mean "previous radio button".
// Right and down mean "next radio button".
// Tested in WinIE, and even for RTL, left still means previous radio button (and so moves
@@ -2438,7 +2440,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
break;
if (n->hasTagName(inputTag)) {
HTMLInputElement* inputElt = static_cast<HTMLInputElement*>(n);
- if (inputElt->inputType() == RADIO && inputElt->name() == name() && inputElt->isFocusable()) {
+ if (inputElt->deprecatedInputType() == RADIO && inputElt->name() == name() && inputElt->isFocusable()) {
inputElt->setChecked(true);
document()->setFocusedNode(inputElt);
inputElt->dispatchSimulatedClick(evt, false, false);
@@ -2457,7 +2459,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
String key = static_cast<KeyboardEvent*>(evt)->keyIdentifier();
if (key == "U+0020") {
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case BUTTON:
case CHECKBOX:
case FILE:
@@ -2520,7 +2522,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
RefPtr<HTMLFormElement> formForSubmission = form();
// If there is no form and the element is an <isindex>, then create a temporary form just to be used for submission.
- if (!formForSubmission && inputType() == ISINDEX)
+ if (!formForSubmission && deprecatedInputType() == ISINDEX)
formForSubmission = createTemporaryFormForIsIndex();
// Form may never have been present, or may have been destroyed by code responding to the change event.
@@ -2551,7 +2553,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
if (isTextField() && renderer() && (evt->isMouseEvent() || evt->isDragEvent() || evt->isWheelEvent() || evt->type() == eventNames().blurEvent || evt->type() == eventNames().focusEvent))
toRenderTextControlSingleLine(renderer())->forwardEvent(evt);
- if (inputType() == RANGE && renderer() && (evt->isMouseEvent() || evt->isDragEvent() || evt->isWheelEvent()))
+ if (deprecatedInputType() == RANGE && renderer() && (evt->isMouseEvent() || evt->isDragEvent() || evt->isWheelEvent()))
toRenderSlider(renderer())->forwardEvent(evt);
if (!callBaseClassEarly && !evt->defaultHandled())
@@ -2560,7 +2562,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
void HTMLInputElement::handleBeforeTextInsertedEvent(Event* event)
{
- if (inputType() == NUMBER) {
+ if (deprecatedInputType() == NUMBER) {
BeforeTextInsertedEvent* textEvent = static_cast<BeforeTextInsertedEvent*>(event);
unsigned length = textEvent->text().length();
bool hasInvalidChar = false;
@@ -2679,21 +2681,21 @@ void HTMLInputElement::setAutofilled(bool b)
FileList* HTMLInputElement::files()
{
- if (inputType() != FILE)
+ if (deprecatedInputType() != FILE)
return 0;
return m_fileList.get();
}
bool HTMLInputElement::isAcceptableValue(const String& proposedValue) const
{
- if (inputType() != NUMBER)
+ if (deprecatedInputType() != NUMBER)
return true;
return proposedValue.isEmpty() || parseToDoubleForNumberType(proposedValue, 0);
}
String HTMLInputElement::sanitizeValue(const String& proposedValue) const
{
- if (inputType() == NUMBER)
+ if (deprecatedInputType() == NUMBER)
return parseToDoubleForNumberType(proposedValue, 0) ? proposedValue : String();
if (isTextField())
@@ -2702,7 +2704,7 @@ String HTMLInputElement::sanitizeValue(const String& proposedValue) const
// If the proposedValue is null than this is a reset scenario and we
// want the range input's value attribute to take priority over the
// calculated default (middle) value.
- if (inputType() == RANGE && !proposedValue.isNull())
+ if (deprecatedInputType() == RANGE && !proposedValue.isNull())
return serializeForNumberType(StepRange(this).clampValue(proposedValue));
return proposedValue;
@@ -2710,12 +2712,12 @@ String HTMLInputElement::sanitizeValue(const String& proposedValue) const
bool HTMLInputElement::hasUnacceptableValue() const
{
- return inputType() == NUMBER && renderer() && !isAcceptableValue(toRenderTextControl(renderer())->text());
+ return deprecatedInputType() == NUMBER && renderer() && !isAcceptableValue(toRenderTextControl(renderer())->text());
}
bool HTMLInputElement::needsActivationCallback()
{
- return inputType() == PASSWORD || m_autocomplete == Off;
+ return deprecatedInputType() == PASSWORD || m_autocomplete == Off;
}
void HTMLInputElement::registerForActivationCallbackIfNeeded()
@@ -2735,7 +2737,7 @@ bool HTMLInputElement::isRequiredFormControl() const
if (!required())
return false;
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case CHECKBOX:
case DATE:
case DATETIME:
@@ -2825,7 +2827,7 @@ void HTMLInputElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons
bool HTMLInputElement::recalcWillValidate() const
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case CHECKBOX:
case COLOR:
case DATE:
@@ -2857,7 +2859,7 @@ bool HTMLInputElement::recalcWillValidate() const
return false;
}
-bool HTMLInputElement::parseToDateComponents(InputType type, const String& formString, DateComponents* out)
+bool HTMLInputElement::parseToDateComponents(DeprecatedInputType type, const String& formString, DateComponents* out)
{
if (formString.isEmpty())
return false;
@@ -2899,7 +2901,7 @@ HTMLDataListElement* HTMLInputElement::dataList() const
if (!m_hasNonEmptyList)
return 0;
- switch (inputType()) {
+ switch (deprecatedInputType()) {
case COLOR:
case DATE:
case DATETIME:
@@ -3005,7 +3007,7 @@ void HTMLInputElement::setWapInputFormat(String& mask)
#if ENABLE(INPUT_SPEECH)
bool HTMLInputElement::isSpeechEnabled() const
{
- switch (inputType()) {
+ switch (deprecatedInputType()) {
// FIXME: Add support for RANGE, EMAIL, URL, COLOR and DATE/TIME input types.
case NUMBER:
case PASSWORD:
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index e023796..7e601ca 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -40,7 +40,7 @@ class VisibleSelection;
class HTMLInputElement : public HTMLTextFormControlElement, public InputElement {
public:
- enum InputType {
+ enum DeprecatedInputType {
TEXT = 0, // TEXT must be 0.
PASSWORD,
ISINDEX,
@@ -65,9 +65,9 @@ public:
MONTH,
TIME,
WEEK,
- // If you add new types or change the order of enum values, update numberOfTypes below.
+ // If you add new types or change the order of enum values, update deprecatedNumberOfTypes below.
};
- static const int numberOfTypes = WEEK + 1;
+ static const int deprecatedNumberOfTypes = WEEK + 1;
static PassRefPtr<HTMLInputElement> create(const QualifiedName&, Document*, HTMLFormElement*);
virtual ~HTMLInputElement();
@@ -101,17 +101,29 @@ public:
// stepUp()/stepDown() for user-interaction.
void stepUpFromRenderer(int);
- bool isTextButton() const { return m_type == SUBMIT || m_type == RESET || m_type == BUTTON; }
- virtual bool isRadioButton() const { return m_type == RADIO; }
+ bool isTextButton() const { return deprecatedInputType() == SUBMIT || deprecatedInputType() == RESET || deprecatedInputType() == BUTTON; }
+
+ virtual bool isRadioButton() const { return deprecatedInputType() == RADIO; }
virtual bool isTextField() const;
- virtual bool isSearchField() const { return m_type == SEARCH; }
- virtual bool isInputTypeHidden() const { return m_type == HIDDEN; }
- virtual bool isPasswordField() const { return m_type == PASSWORD; }
- virtual bool isCheckbox() const { return m_type == CHECKBOX; }
- bool isTelephoneField() const { return m_type == TELEPHONE; }
- bool isNumberField() const { return m_type == NUMBER; }
- bool isEmailField() const { return m_type == EMAIL; }
- bool isUrlField() const { return m_type == URL; }
+ virtual bool isSearchField() const { return deprecatedInputType() == SEARCH; }
+ virtual bool isInputTypeHidden() const { return deprecatedInputType() == HIDDEN; }
+ virtual bool isPasswordField() const { return deprecatedInputType() == PASSWORD; }
+ virtual bool isCheckbox() const { return deprecatedInputType() == CHECKBOX; }
+
+ // FIXME: It's highly likely that any call site calling this function should instead
+ // be using a different one. Many input elements behave like text fields, and in addition
+ // any unknown input type is treated as text. Consider, for example, isTextField or
+ // isTextField && !isPasswordField.
+ bool isText() const { return deprecatedInputType() == TEXT; }
+
+ bool isEmailField() const { return deprecatedInputType() == EMAIL; }
+ bool isFileUpload() const { return deprecatedInputType() == FILE; }
+ bool isImageButton() const { return deprecatedInputType() == IMAGE; }
+ bool isNumberField() const { return deprecatedInputType() == NUMBER; }
+ bool isSubmitButton() const { return deprecatedInputType() == SUBMIT; }
+ bool isTelephoneField() const { return deprecatedInputType() == TELEPHONE; }
+ bool isURLField() const { return deprecatedInputType() == URL; }
+
#if ENABLE(INPUT_SPEECH)
virtual bool isSpeechEnabled() const;
#endif
@@ -164,8 +176,7 @@ public:
virtual bool isActivatedSubmit() const;
virtual void setActivatedSubmit(bool flag);
- InputType inputType() const { return static_cast<InputType>(m_type); }
- void setInputType(const String&);
+ DeprecatedInputType deprecatedInputType() const { return static_cast<DeprecatedInputType>(m_deprecatedTypeNumber); }
String altText() const;
@@ -202,10 +213,10 @@ public:
void addSearchResult();
void onSearch();
- // Parses the specified string as the InputType, and returns true if it is successfully parsed.
+ // Parses the specified string as the DeprecatedInputType, and returns true if it is successfully parsed.
// An instance pointed by the DateComponents* parameter will have parsed values and be
// modified even if the parsing fails. The DateComponents* parameter may be 0.
- static bool parseToDateComponents(InputType, const String&, DateComponents*);
+ static bool parseToDateComponents(DeprecatedInputType, const String&, DateComponents*);
#if ENABLE(DATALIST)
HTMLElement* list() const;
@@ -229,7 +240,7 @@ private:
virtual bool isKeyboardFocusable(KeyboardEvent*) const;
virtual bool isMouseFocusable() const;
- virtual bool isEnumeratable() const { return inputType() != IMAGE; }
+ virtual bool isEnumeratable() const { return deprecatedInputType() != IMAGE; }
virtual void updateFocusAppearance(bool restorePreviousSelection);
virtual void aboutToUnload();
virtual bool shouldUseInputMethod() const;
@@ -237,15 +248,15 @@ private:
virtual const AtomicString& formControlName() const;
// isChecked is used by the rendering tree/CSS while checked() is used by JS to determine checked state
- virtual bool isChecked() const { return checked() && (inputType() == CHECKBOX || inputType() == RADIO); }
+ virtual bool isChecked() const { return checked() && (deprecatedInputType() == CHECKBOX || deprecatedInputType() == RADIO); }
virtual bool isIndeterminate() const { return indeterminate(); }
virtual bool isTextFormControl() const { return isTextField(); }
- virtual bool hasSpinButton() const { return m_type == NUMBER || m_type == DATE || m_type == DATETIME || m_type == DATETIMELOCAL || m_type == MONTH || m_type == TIME || m_type == WEEK; }
+ virtual bool hasSpinButton() const { return deprecatedInputType() == NUMBER || deprecatedInputType() == DATE || deprecatedInputType() == DATETIME || deprecatedInputType() == DATETIMELOCAL || deprecatedInputType() == MONTH || deprecatedInputType() == TIME || deprecatedInputType() == WEEK; }
virtual bool canTriggerImplicitSubmission() const { return isTextField(); }
- bool allowsIndeterminate() const { return inputType() == CHECKBOX || inputType() == RADIO; }
+ bool allowsIndeterminate() const { return deprecatedInputType() == CHECKBOX || deprecatedInputType() == RADIO; }
virtual const AtomicString& formControlType() const;
@@ -270,7 +281,7 @@ private:
virtual bool isSuccessfulSubmitButton() const;
// Report if this input type uses height & width attributes
- bool respectHeightAndWidthAttrs() const { return inputType() == IMAGE || inputType() == HIDDEN; }
+ bool respectHeightAndWidthAttrs() const { return deprecatedInputType() == IMAGE || deprecatedInputType() == HIDDEN; }
virtual void reset();
@@ -298,7 +309,7 @@ private:
virtual bool supportsMaxLength() const { return isTextType(); }
bool isTextType() const;
- virtual bool supportsPlaceholder() const { return isTextType() || inputType() == ISINDEX; }
+ virtual bool supportsPlaceholder() const { return isTextType() || deprecatedInputType() == ISINDEX; }
virtual bool isEmptyValue() const { return value().isEmpty(); }
virtual void handleFocusEvent();
virtual void handleBlurEvent();
@@ -309,6 +320,8 @@ private:
virtual bool isRequiredFormControl() const;
virtual bool recalcWillValidate() const;
+ void updateType();
+
void updateCheckedRadioButtons();
void handleBeforeTextInsertedEvent(Event*);
@@ -348,7 +361,7 @@ private:
short m_maxResults;
OwnPtr<HTMLImageLoader> m_imageLoader;
RefPtr<FileList> m_fileList;
- unsigned m_type : 5; // InputType
+ unsigned m_deprecatedTypeNumber : 5; // DeprecatedInputType
bool m_checked : 1;
bool m_defaultChecked : 1;
bool m_useDefaultChecked : 1;
diff --git a/WebCore/html/HTMLMarqueeElement.cpp b/WebCore/html/HTMLMarqueeElement.cpp
index ada26c1..8128188 100644
--- a/WebCore/html/HTMLMarqueeElement.cpp
+++ b/WebCore/html/HTMLMarqueeElement.cpp
@@ -132,7 +132,7 @@ bool HTMLMarqueeElement::canSuspend() const
return true;
}
-void HTMLMarqueeElement::suspend()
+void HTMLMarqueeElement::suspend(ReasonForSuspension)
{
if (RenderMarquee* marqueeRenderer = renderMarquee())
marqueeRenderer->suspend();
diff --git a/WebCore/html/HTMLMarqueeElement.h b/WebCore/html/HTMLMarqueeElement.h
index 1b3229a..a4825fc 100644
--- a/WebCore/html/HTMLMarqueeElement.h
+++ b/WebCore/html/HTMLMarqueeElement.h
@@ -49,7 +49,7 @@ private:
// ActiveDOMObject
virtual bool canSuspend() const;
- virtual void suspend();
+ virtual void suspend(ReasonForSuspension);
virtual void resume();
RenderMarquee* renderMarquee() const;
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 827158e..f753183 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -64,6 +64,7 @@
#include <limits>
#include <wtf/CurrentTime.h>
#include <wtf/MathExtras.h>
+#include <wtf/text/CString.h>
#if USE(ACCELERATED_COMPOSITING)
#include "RenderView.h"
@@ -747,19 +748,16 @@ bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidSourceAction acti
if (!url.isValid()) {
LOG(Media, "HTMLMediaElement::isSafeToLoadURL(%s) -> FALSE because url is invalid", urlForLogging(url.string()).utf8().data());
return false;
- }
-
- Frame* frame = document()->frame();
- FrameLoader* loader = frame ? frame->loader() : 0;
+ }
- // don't allow remote to local urls, and check with the frame loader client.
- if (!loader || !SecurityOrigin::canDisplay(url, String(), document())) {
+ Frame* frame = document()->frame();
+ if (!frame || !document()->securityOrigin()->canDisplay(url)) {
if (actionIfInvalid == Complain)
FrameLoader::reportLocalLoadFailed(frame, url.string());
LOG(Media, "HTMLMediaElement::isSafeToLoadURL(%s) -> FALSE rejected by SecurityOrigin", urlForLogging(url.string()).utf8().data());
return false;
}
-
+
return true;
}
@@ -2029,29 +2027,38 @@ bool HTMLMediaElement::canSuspend() const
void HTMLMediaElement::stop()
{
LOG(Media, "HTMLMediaElement::stop");
- suspend();
-}
-
-void HTMLMediaElement::suspend()
-{
- LOG(Media, "HTMLMediaElement::suspend");
-
if (m_isFullscreen)
exitFullscreen();
-
+
m_inActiveDocument = false;
userCancelledLoad();
-
+
// Stop the playback without generating events
setPausedInternal(true);
-
+
if (renderer())
renderer()->updateFromElement();
-
+
stopPeriodicTimers();
cancelPendingEventsAndCallbacks();
}
+void HTMLMediaElement::suspend(ReasonForSuspension why)
+{
+ LOG(Media, "HTMLMediaElement::suspend");
+
+ switch (why)
+ {
+ case DocumentWillBecomeInactive:
+ stop();
+ break;
+ case JavaScriptDebuggerPaused:
+ case WillShowDialog:
+ // Do nothing, we don't pause media playback in these cases.
+ break;
+ }
+}
+
void HTMLMediaElement::resume()
{
LOG(Media, "HTMLMediaElement::resume");
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index adea0fd..db75a9c 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -199,7 +199,7 @@ private:
// ActiveDOMObject functions.
virtual bool canSuspend() const;
- virtual void suspend();
+ virtual void suspend(ReasonForSuspension);
virtual void resume();
virtual void stop();
virtual bool hasPendingActivity() const;
diff --git a/WebCore/html/HTMLMeterElement.cpp b/WebCore/html/HTMLMeterElement.cpp
index aaba125..5419a22 100644
--- a/WebCore/html/HTMLMeterElement.cpp
+++ b/WebCore/html/HTMLMeterElement.cpp
@@ -28,7 +28,7 @@
#include "FormDataList.h"
#include "HTMLFormElement.h"
#include "HTMLNames.h"
-#include "HTMLTreeBuilder.h"
+#include "HTMLParserIdioms.h"
#include "RenderMeter.h"
#include <wtf/StdLibExtras.h>
diff --git a/WebCore/html/HTMLObjectElement.cpp b/WebCore/html/HTMLObjectElement.cpp
index 56a6095..e9c6f60 100644
--- a/WebCore/html/HTMLObjectElement.cpp
+++ b/WebCore/html/HTMLObjectElement.cpp
@@ -163,6 +163,7 @@ static void mapDataParamToSrc(Vector<String>* paramNames, Vector<String>* paramV
void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType)
{
HashSet<StringImpl*, CaseFoldingHash> uniqueParamNames;
+ String urlParameter;
// Scan the PARAM children and store their name/value pairs.
// Get the URL and type from the params if we don't already have them.
@@ -180,8 +181,8 @@ void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<S
paramValues.append(p->value());
// FIXME: url adjustment does not belong in this function.
- if (url.isEmpty() && (equalIgnoringCase(name, "src") || equalIgnoringCase(name, "movie") || equalIgnoringCase(name, "code") || equalIgnoringCase(name, "url")))
- url = deprecatedParseURL(p->value());
+ if (url.isEmpty() && urlParameter.isEmpty() && (equalIgnoringCase(name, "src") || equalIgnoringCase(name, "movie") || equalIgnoringCase(name, "code") || equalIgnoringCase(name, "url")))
+ urlParameter = deprecatedParseURL(p->value());
// FIXME: serviceType calculation does not belong in this function.
if (serviceType.isEmpty() && equalIgnoringCase(name, "type")) {
serviceType = p->value();
@@ -217,9 +218,15 @@ void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<S
mapDataParamToSrc(&paramNames, &paramValues);
- // If we still don't have a type, try to map from a specific CLASSID to a type.
- if (serviceType.isEmpty())
- serviceType = serviceTypeForClassId(classId());
+ // HTML5 says that an object resource's URL is specified by the object's data
+ // attribute, not by a param element. However, for compatibility, allow the
+ // resource's URL to be given by a param named "src", "movie", "code" or "url"
+ // if we know that resource points to a plug-in.
+ if (url.isEmpty() && !urlParameter.isEmpty()) {
+ SubframeLoader* loader = document()->frame()->loader()->subframeLoader();
+ if (loader->resourceWillUsePlugin(urlParameter, serviceType))
+ url = urlParameter;
+ }
}
@@ -250,7 +257,12 @@ void HTMLObjectElement::updateWidget(bool onlyCreateNonNetscapePlugins)
return;
String url = this->url();
+
+ // If the object does not specify a MIME type via a type attribute, but does
+ // contain a classid attribute, try to map the classid to a MIME type.
String serviceType = this->serviceType();
+ if (serviceType.isEmpty())
+ serviceType = serviceTypeForClassId(classId());
// FIXME: These should be joined into a PluginParameters class.
Vector<String> paramNames;
diff --git a/WebCore/html/HTMLPlugInImageElement.h b/WebCore/html/HTMLPlugInImageElement.h
index 60ad0e6..9616fe8 100644
--- a/WebCore/html/HTMLPlugInImageElement.h
+++ b/WebCore/html/HTMLPlugInImageElement.h
@@ -59,7 +59,6 @@ protected:
bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType);
private:
- virtual bool canLazyAttach() { return false; }
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
virtual void recalcStyle(StyleChange);
diff --git a/WebCore/html/HTMLProgressElement.cpp b/WebCore/html/HTMLProgressElement.cpp
index de65fcb..e707592 100644
--- a/WebCore/html/HTMLProgressElement.cpp
+++ b/WebCore/html/HTMLProgressElement.cpp
@@ -28,7 +28,7 @@
#include "FormDataList.h"
#include "HTMLFormElement.h"
#include "HTMLNames.h"
-#include "HTMLTreeBuilder.h"
+#include "HTMLParserIdioms.h"
#include "RenderProgress.h"
#include <wtf/StdLibExtras.h>
diff --git a/WebCore/html/HTMLTextAreaElement.cpp b/WebCore/html/HTMLTextAreaElement.cpp
index 3e34844..ad6c1b3 100644
--- a/WebCore/html/HTMLTextAreaElement.cpp
+++ b/WebCore/html/HTMLTextAreaElement.cpp
@@ -226,7 +226,7 @@ void HTMLTextAreaElement::updateFocusAppearance(bool restorePreviousSelection)
}
if (document()->frame())
- document()->frame()->revealSelection();
+ document()->frame()->selection()->revealSelection();
}
void HTMLTextAreaElement::defaultEventHandler(Event* event)
diff --git a/WebCore/html/ImageDocument.cpp b/WebCore/html/ImageDocument.cpp
index 6951b7b..db53837 100644
--- a/WebCore/html/ImageDocument.cpp
+++ b/WebCore/html/ImageDocument.cpp
@@ -117,10 +117,10 @@ inline PassRefPtr<ImageDocumentElement> ImageDocumentElement::create(ImageDocume
// --------
-static float pageZoomFactor(Document* document)
+static float pageZoomFactor(const Document* document)
{
- FrameView* view = document->view();
- return view ? view->pageZoomFactor() : 1;
+ Frame* frame = document->frame();
+ return frame ? frame->pageZoomFactor() : 1;
}
void ImageDocumentParser::appendBytes(DocumentWriter*, const char*, int, bool)
@@ -231,7 +231,7 @@ float ImageDocument::scale() const
if (!view)
return 1;
- IntSize imageSize = m_imageElement->cachedImage()->imageSize(view->pageZoomFactor());
+ IntSize imageSize = m_imageElement->cachedImage()->imageSize(pageZoomFactor(this));
IntSize windowSize = IntSize(view->width(), view->height());
float widthScale = (float)windowSize.width() / imageSize.width();
@@ -319,8 +319,10 @@ bool ImageDocument::imageFitsInWindow() const
return true;
FrameView* view = frame()->view();
+ if (!view)
+ return true;
- IntSize imageSize = m_imageElement->cachedImage()->imageSize(view->pageZoomFactor());
+ IntSize imageSize = m_imageElement->cachedImage()->imageSize(pageZoomFactor(this));
IntSize windowSize = IntSize(view->width(), view->height());
return imageSize.width() <= windowSize.width() && imageSize.height() <= windowSize.height();
diff --git a/WebCore/html/StepRange.cpp b/WebCore/html/StepRange.cpp
index aeaf62f..68b0ebd 100644
--- a/WebCore/html/StepRange.cpp
+++ b/WebCore/html/StepRange.cpp
@@ -23,9 +23,9 @@
#include "HTMLInputElement.h"
#include "HTMLNames.h"
-#include "HTMLTreeBuilder.h"
-#include "PlatformString.h"
+#include "HTMLParserIdioms.h"
#include <wtf/MathExtras.h>
+#include <wtf/text/WTFString.h>
using namespace std;
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 338960c..0fb7ed5 100755..100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -659,7 +659,7 @@ void CanvasRenderingContext2D::closePath()
FloatRect boundRect = m_path.boundingRect();
if (boundRect.width() || boundRect.height())
- m_path.closeCanvasSubpath();
+ m_path.closeSubpath();
}
void CanvasRenderingContext2D::moveTo(float x, float y)
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index bda3569..68a6954 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -1756,7 +1756,7 @@ WebGLGetInfo WebGLRenderingContext::getVertexAttrib(unsigned long index, unsigne
}
switch (pname) {
case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
- if (!isGLES2Compliant() && !index && m_vertexAttribState[0].bufferBinding == m_vertexAttrib0Buffer
+ if ((!isGLES2Compliant() && !index && m_vertexAttribState[0].bufferBinding == m_vertexAttrib0Buffer)
|| index >= m_vertexAttribState.size()
|| !m_vertexAttribState[index].bufferBinding
|| !m_vertexAttribState[index].bufferBinding->object())
@@ -1943,8 +1943,8 @@ void WebGLRenderingContext::readPixels(long x, long y, long width, long height,
return;
}
// Validate array type against pixel type.
- if (type == GraphicsContext3D::UNSIGNED_BYTE && !pixels->isUnsignedByteArray()
- || type != GraphicsContext3D::UNSIGNED_BYTE && !pixels->isUnsignedShortArray()) {
+ if ((type == GraphicsContext3D::UNSIGNED_BYTE && !pixels->isUnsignedByteArray())
+ || (type != GraphicsContext3D::UNSIGNED_BYTE && !pixels->isUnsignedShortArray())) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
@@ -2221,8 +2221,8 @@ void WebGLRenderingContext::texParameter(unsigned long target, unsigned long pna
break;
case GraphicsContext3D::TEXTURE_WRAP_S:
case GraphicsContext3D::TEXTURE_WRAP_T:
- if (isFloat && paramf != GraphicsContext3D::CLAMP_TO_EDGE && paramf != GraphicsContext3D::MIRRORED_REPEAT && paramf != GraphicsContext3D::REPEAT
- || !isFloat && parami != GraphicsContext3D::CLAMP_TO_EDGE && parami != GraphicsContext3D::MIRRORED_REPEAT && parami != GraphicsContext3D::REPEAT) {
+ if ((isFloat && paramf != GraphicsContext3D::CLAMP_TO_EDGE && paramf != GraphicsContext3D::MIRRORED_REPEAT && paramf != GraphicsContext3D::REPEAT)
+ || (!isFloat && parami != GraphicsContext3D::CLAMP_TO_EDGE && parami != GraphicsContext3D::MIRRORED_REPEAT && parami != GraphicsContext3D::REPEAT)) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
return;
}
@@ -3012,8 +3012,8 @@ void WebGLRenderingContext::handleNPOTTextures(bool prepareToDraw)
{
bool resetActiveUnit = false;
for (unsigned ii = 0; ii < m_textureUnits.size(); ++ii) {
- if (m_textureUnits[ii].m_texture2DBinding && m_textureUnits[ii].m_texture2DBinding->needToUseBlackTexture()
- || m_textureUnits[ii].m_textureCubeMapBinding && m_textureUnits[ii].m_textureCubeMapBinding->needToUseBlackTexture()) {
+ if ((m_textureUnits[ii].m_texture2DBinding && m_textureUnits[ii].m_texture2DBinding->needToUseBlackTexture())
+ || (m_textureUnits[ii].m_textureCubeMapBinding && m_textureUnits[ii].m_textureCubeMapBinding->needToUseBlackTexture())) {
if (ii != m_activeTextureUnit) {
m_context->activeTexture(ii);
resetActiveUnit = true;
diff --git a/WebCore/html/parser/HTMLConstructionSite.cpp b/WebCore/html/parser/HTMLConstructionSite.cpp
index 0172b3d..6215bba 100644
--- a/WebCore/html/parser/HTMLConstructionSite.cpp
+++ b/WebCore/html/parser/HTMLConstructionSite.cpp
@@ -114,19 +114,19 @@ PassRefPtr<ChildType> HTMLConstructionSite::attach(ContainerNode* parent, PassRe
void HTMLConstructionSite::attachAtSite(const AttachmentSite& site, PassRefPtr<Node> prpChild)
{
+ // FIXME: It's 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.
RefPtr<Node> child = prpChild;
- if (site.nextChild) {
+ if (site.nextChild)
site.parent->parserInsertBefore(child, site.nextChild);
- if (site.parent->attached() && !child->attached())
- child->attach();
- return;
- }
- site.parent->parserAddChild(child);
- // 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.
- if (site.parent->attached() && !child->attached())
+ else
+ site.parent->parserAddChild(child);
+
+ // JavaScript run from beforeload (or DOM Mutation or event handlers)
+ // might have removed the child, in which case we should not attach it.
+ if (child->parentNode() && site.parent->attached() && !child->attached())
child->attach();
}
diff --git a/WebCore/html/parser/HTMLDocumentParser.cpp b/WebCore/html/parser/HTMLDocumentParser.cpp
index a442d54..2da403f 100644
--- a/WebCore/html/parser/HTMLDocumentParser.cpp
+++ b/WebCore/html/parser/HTMLDocumentParser.cpp
@@ -36,6 +36,8 @@
#include "HTMLScriptRunner.h"
#include "HTMLTreeBuilder.h"
#include "HTMLDocument.h"
+#include "NestingLevelIncrementer.h"
+#include "Settings.h"
#include "XSSAuditor.h"
#include <wtf/CurrentTime.h>
@@ -53,23 +55,6 @@ using namespace HTMLNames;
namespace {
-class NestingLevelIncrementer : public Noncopyable {
-public:
- explicit NestingLevelIncrementer(int& counter)
- : m_counter(&counter)
- {
- ++(*m_counter);
- }
-
- ~NestingLevelIncrementer()
- {
- --(*m_counter);
- }
-
-private:
- int* m_counter;
-};
-
// This is a direct transcription of step 4 from:
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#fragment-case
HTMLTokenizer::State tokenizerStateForContextElement(Element* contextElement, bool reportErrors)
@@ -99,7 +84,7 @@ HTMLTokenizer::State tokenizerStateForContextElement(Element* contextElement, bo
HTMLDocumentParser::HTMLDocumentParser(HTMLDocument* document, bool reportErrors)
: ScriptableDocumentParser(document)
- , m_tokenizer(HTMLTokenizer::create())
+ , m_tokenizer(HTMLTokenizer::create(usePreHTML5ParserQuirks(document)))
, m_scriptRunner(HTMLScriptRunner::create(document, this))
, m_treeBuilder(HTMLTreeBuilder::create(m_tokenizer.get(), document, reportErrors))
, m_parserScheduler(HTMLParserScheduler::create(this))
@@ -112,7 +97,7 @@ HTMLDocumentParser::HTMLDocumentParser(HTMLDocument* document, bool reportErrors
// minimize code duplication between these constructors.
HTMLDocumentParser::HTMLDocumentParser(DocumentFragment* fragment, Element* contextElement, FragmentScriptingPermission scriptingPermission)
: ScriptableDocumentParser(fragment->document())
- , m_tokenizer(HTMLTokenizer::create())
+ , m_tokenizer(HTMLTokenizer::create(usePreHTML5ParserQuirks(fragment->document())))
, m_treeBuilder(HTMLTreeBuilder::create(m_tokenizer.get(), fragment, contextElement, scriptingPermission))
, m_endWasDelayed(false)
, m_writeNestingLevel(0)
@@ -547,5 +532,11 @@ void HTMLDocumentParser::parseDocumentFragment(const String& source, DocumentFra
ASSERT(!parser->processingData()); // Make sure we're done. <rdar://problem/3963151>
parser->detach(); // Allows ~DocumentParser to assert it was detached before destruction.
}
+
+bool HTMLDocumentParser::usePreHTML5ParserQuirks(Document* document)
+{
+ ASSERT(document);
+ return document->settings() && document->settings()->usePreHTML5ParserQuirks();
+}
}
diff --git a/WebCore/html/parser/HTMLDocumentParser.h b/WebCore/html/parser/HTMLDocumentParser.h
index 6d5b6d7..e65a582 100644
--- a/WebCore/html/parser/HTMLDocumentParser.h
+++ b/WebCore/html/parser/HTMLDocumentParser.h
@@ -66,6 +66,8 @@ public:
void resumeParsingAfterYield();
static void parseDocumentFragment(const String&, DocumentFragment*, Element* contextElement, FragmentScriptingPermission = FragmentScriptingAllowed);
+
+ static bool usePreHTML5ParserQuirks(Document*);
protected:
virtual void insert(const SegmentedString&);
@@ -139,7 +141,7 @@ private:
OwnPtr<HTMLParserScheduler> m_parserScheduler;
bool m_endWasDelayed;
- int m_writeNestingLevel;
+ unsigned m_writeNestingLevel;
};
}
diff --git a/WebCore/html/parser/HTMLElementStack.cpp b/WebCore/html/parser/HTMLElementStack.cpp
index b6f4111..123778d 100644
--- a/WebCore/html/parser/HTMLElementStack.cpp
+++ b/WebCore/html/parser/HTMLElementStack.cpp
@@ -28,6 +28,8 @@
#include "Element.h"
#include "HTMLNames.h"
+#include "MathMLNames.h"
+#include "SVGNames.h"
#include <wtf/PassOwnPtr.h>
#if ENABLE(SVG)
@@ -92,6 +94,19 @@ inline bool isTableRowScopeMarker(Element* element)
|| element->hasTagName(htmlTag);
}
+inline bool isForeignContentScopeMarker(Element* element)
+{
+ return element->hasTagName(MathMLNames::miTag)
+ || element->hasTagName(MathMLNames::moTag)
+ || element->hasTagName(MathMLNames::mnTag)
+ || element->hasTagName(MathMLNames::msTag)
+ || element->hasTagName(MathMLNames::mtextTag)
+ || element->hasTagName(SVGNames::foreignObjectTag)
+ || element->hasTagName(SVGNames::descTag)
+ || element->hasTagName(SVGNames::titleTag)
+ || element->namespaceURI() == HTMLNames::xhtmlNamespaceURI;
+}
+
inline bool isButtonScopeMarker(Element* element)
{
return isScopeMarker(element)
@@ -186,12 +201,6 @@ void HTMLElementStack::pop()
popCommon();
}
-void HTMLElementStack::popUntilElementWithNamespace(const AtomicString& namespaceURI)
-{
- while (top()->namespaceURI() != namespaceURI)
- pop();
-}
-
void HTMLElementStack::popUntil(const AtomicString& tagName)
{
while (!top()->hasLocalName(tagName)) {
@@ -247,6 +256,12 @@ void HTMLElementStack::popUntilTableRowScopeMarker()
pop();
}
+void HTMLElementStack::popUntilForeignContentScopeMarker()
+{
+ while (!isForeignContentScopeMarker(top()))
+ pop();
+}
+
void HTMLElementStack::pushHTMLHtmlElement(PassRefPtr<Element> element)
{
ASSERT(!m_top); // <html> should always be the bottom of the stack.
diff --git a/WebCore/html/parser/HTMLElementStack.h b/WebCore/html/parser/HTMLElementStack.h
index 73cfcb1..47fa603 100644
--- a/WebCore/html/parser/HTMLElementStack.h
+++ b/WebCore/html/parser/HTMLElementStack.h
@@ -90,7 +90,6 @@ public:
void pop();
void popUntil(const AtomicString& tagName);
- void popUntilElementWithNamespace(const AtomicString& namespaceURI);
void popUntil(Element*);
void popUntilPopped(const AtomicString& tagName);
void popUntilPopped(Element*);
@@ -98,6 +97,7 @@ public:
void popUntilTableScopeMarker(); // "clear the stack back to a table context" in the spec.
void popUntilTableBodyScopeMarker(); // "clear the stack back to a table body context" in the spec.
void popUntilTableRowScopeMarker(); // "clear the stack back to a table row context" in the spec.
+ void popUntilForeignContentScopeMarker();
void popHTMLHeadElement();
void popHTMLBodyElement();
void popAll();
diff --git a/WebCore/html/parser/HTMLParserIdioms.cpp b/WebCore/html/parser/HTMLParserIdioms.cpp
new file mode 100644
index 0000000..a558cf5
--- /dev/null
+++ b/WebCore/html/parser/HTMLParserIdioms.cpp
@@ -0,0 +1,144 @@
+/*
+ * 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 "HTMLParserIdioms.h"
+
+#include <wtf/MathExtras.h>
+#include <wtf/dtoa.h>
+#include <wtf/text/AtomicString.h>
+
+namespace WebCore {
+
+String stripLeadingAndTrailingHTMLSpaces(const String& string)
+{
+ const UChar* characters = string.characters();
+ unsigned length = string.length();
+
+ unsigned numLeadingSpaces;
+ for (numLeadingSpaces = 0; numLeadingSpaces < length; ++numLeadingSpaces) {
+ if (isNotHTMLSpace(characters[numLeadingSpaces]))
+ break;
+ }
+
+ if (numLeadingSpaces == length)
+ return emptyAtom;
+
+ unsigned numTrailingSpaces;
+ for (numTrailingSpaces = 0; numTrailingSpaces < length; ++numTrailingSpaces) {
+ if (isNotHTMLSpace(characters[length - numTrailingSpaces - 1]))
+ break;
+ }
+
+ ASSERT(numLeadingSpaces + numTrailingSpaces < length);
+
+ return string.substring(numLeadingSpaces, length - numTrailingSpaces);
+}
+
+String serializeForNumberType(double number)
+{
+ // According to HTML5, "the best representation of the number n as a floating
+ // point number" is a string produced by applying ToString() to n.
+ NumberToStringBuffer buffer;
+ unsigned length = numberToString(number, buffer);
+ return String(buffer, length);
+}
+
+bool parseToDoubleForNumberType(const String& string, double* result)
+{
+ // See HTML5 2.4.4.3 `Real numbers.'
+
+ // String::toDouble() accepts leading + and whitespace characters, which are not valid here.
+ UChar firstCharacter = string[0];
+ if (firstCharacter != '-' && !isASCIIDigit(firstCharacter))
+ return false;
+
+ bool valid = false;
+ double value = string.toDouble(&valid);
+ if (!valid)
+ return false;
+
+ // NaN and infinity are considered valid by String::toDouble, but not valid here.
+ if (!isfinite(value))
+ return false;
+
+ if (result) {
+ // The following expression converts -0 to +0.
+ *result = value ? value : 0;
+ }
+
+ return true;
+}
+
+// http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-integers
+bool parseHTMLInteger(const String& input, int& value)
+{
+ // Step 1
+ // Step 2
+ const UChar* position = input.characters();
+ const UChar* end = position + input.length();
+
+ // Step 3
+ int sign = 1;
+
+ // Step 4
+ while (position < end) {
+ if (!isHTMLSpace(*position))
+ break;
+ ++position;
+ }
+
+ // Step 5
+ if (position == end)
+ return false;
+ ASSERT(position < end);
+
+ // Step 6
+ if (*position == '-') {
+ sign = -1;
+ ++position;
+ } else if (*position == '+')
+ ++position;
+ if (position == end)
+ return false;
+ ASSERT(position < end);
+
+ // Step 7
+ if (!isASCIIDigit(*position))
+ return false;
+
+ // Step 8
+ Vector<UChar, 16> digits;
+ while (position < end) {
+ if (!isASCIIDigit(*position))
+ break;
+ digits.append(*position++);
+ }
+
+ // Step 9
+ value = sign * charactersToIntStrict(digits.data(), digits.size());
+ return true;
+}
+
+}
diff --git a/WebCore/html/parser/HTMLParserIdioms.h b/WebCore/html/parser/HTMLParserIdioms.h
new file mode 100644
index 0000000..f4704f7
--- /dev/null
+++ b/WebCore/html/parser/HTMLParserIdioms.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HTMLParserIdioms_h
+#define HTMLParserIdioms_h
+
+#include <wtf/Forward.h>
+#include <wtf/unicode/Unicode.h>
+
+namespace WebCore {
+
+// Space characters as defined by the HTML specification.
+bool isHTMLSpace(UChar);
+bool isNotHTMLSpace(UChar);
+
+// Strip leading and trailing whitespace as defined by the HTML specification.
+String stripLeadingAndTrailingHTMLSpaces(const String&);
+
+// An implementation of the HTML specification's algorithm to convert a number to a string for number and range types.
+String serializeForNumberType(double);
+
+// Convert the specified string to a double. If the conversion fails, the return value is false.
+// Leading or trailing illegal characters cause failure, as does passing an empty string.
+// The double* parameter may be 0 to check if the string can be parsed without getting the result.
+bool parseToDoubleForNumberType(const String&, double*);
+
+// http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-integers
+bool parseHTMLInteger(const String&, int&);
+
+// Inline implementations of some of the functions declared above.
+
+inline bool isHTMLSpace(UChar character)
+{
+ // FIXME: Consider branch permutations as we did in isASCIISpace.
+ return character == '\t' || character == '\x0A' || character == '\x0C' || character == '\x0D' || character == ' ';
+}
+
+inline bool isNotHTMLSpace(UChar character)
+{
+ return !isHTMLSpace(character);
+}
+
+}
+
+#endif
diff --git a/WebCore/html/parser/HTMLPreloadScanner.cpp b/WebCore/html/parser/HTMLPreloadScanner.cpp
index 5283fa3..7859dd8 100644
--- a/WebCore/html/parser/HTMLPreloadScanner.cpp
+++ b/WebCore/html/parser/HTMLPreloadScanner.cpp
@@ -31,8 +31,8 @@
#include "CSSHelper.h"
#include "CachedResourceLoader.h"
#include "Document.h"
+#include "HTMLDocumentParser.h"
#include "HTMLTokenizer.h"
-#include "HTMLTreeBuilder.h"
#include "HTMLLinkElement.h"
#include "HTMLNames.h"
@@ -121,7 +121,7 @@ private:
HTMLPreloadScanner::HTMLPreloadScanner(Document* document)
: m_document(document)
, m_cssScanner(document)
- , m_tokenizer(HTMLTokenizer::create())
+ , m_tokenizer(HTMLTokenizer::create(HTMLDocumentParser::usePreHTML5ParserQuirks(document)))
, m_bodySeen(false)
, m_inStyle(false)
{
@@ -157,13 +157,7 @@ void HTMLPreloadScanner::processToken()
return;
PreloadTask task(m_token);
- m_tokenizer->setState(HTMLTreeBuilder::adjustedLexerState(m_tokenizer->state(), task.tagName(), m_document->frame()));
- if (task.tagName() == scriptTag) {
- // The tree builder handles scriptTag separately from the other tokenizer
- // state adjustments, so we need to handle it separately too.
- ASSERT(m_tokenizer->state() == HTMLTokenizer::DataState);
- m_tokenizer->setState(HTMLTokenizer::ScriptDataState);
- }
+ m_tokenizer->updateStateFor(task.tagName(), m_document->frame());
if (task.tagName() == bodyTag)
m_bodySeen = true;
diff --git a/WebCore/html/parser/HTMLScriptRunner.cpp b/WebCore/html/parser/HTMLScriptRunner.cpp
index e1fc120..4f54f42 100644
--- a/WebCore/html/parser/HTMLScriptRunner.cpp
+++ b/WebCore/html/parser/HTMLScriptRunner.cpp
@@ -35,6 +35,7 @@
#include "HTMLScriptRunnerHost.h"
#include "HTMLInputStream.h"
#include "HTMLNames.h"
+#include "NestingLevelIncrementer.h"
#include "NotImplemented.h"
#include "ScriptElement.h"
#include "ScriptSourceCode.h"
@@ -43,24 +44,6 @@ namespace WebCore {
using namespace HTMLNames;
-// FIXME: Factor out to avoid duplication with HTMLDocumentParser.
-class NestingLevelIncrementer : public Noncopyable {
-public:
- explicit NestingLevelIncrementer(unsigned& nestingLevel)
- : m_nestingLevel(&nestingLevel)
- {
- ++(*m_nestingLevel);
- }
-
- ~NestingLevelIncrementer()
- {
- --(*m_nestingLevel);
- }
-
-private:
- unsigned* m_nestingLevel;
-};
-
HTMLScriptRunner::HTMLScriptRunner(Document* document, HTMLScriptRunnerHost* host)
: m_document(document)
, m_host(host)
@@ -155,20 +138,16 @@ void HTMLScriptRunner::executePendingScriptAndDispatchEvent(PendingScript& pendi
if (errorOccurred)
scriptElement->dispatchEvent(createScriptErrorEvent());
else {
- executeScript(scriptElement.get(), sourceCode);
+ executeScript(sourceCode);
scriptElement->dispatchEvent(createScriptLoadEvent());
}
}
ASSERT(!m_scriptNestingLevel);
}
-void HTMLScriptRunner::executeScript(Element* element, const ScriptSourceCode& sourceCode) const
+void HTMLScriptRunner::executeScript(const ScriptSourceCode& sourceCode) const
{
ASSERT(m_document);
- ScriptElement* scriptElement = toScriptElement(element);
- ASSERT(scriptElement);
- if (!scriptElement->shouldExecuteAsJavaScript())
- return;
ASSERT(isExecutingScript());
if (!m_document->frame())
return;
@@ -317,9 +296,11 @@ void HTMLScriptRunner::runScript(Element* script, int startingLineNumber)
InsertionPointRecord insertionPointRecord(m_host->inputStream());
NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel);
- // Check script type and language, current code uses ScriptElement::shouldExecuteAsJavaScript(), but that may not be HTML5 compliant.
- notImplemented(); // event for support
-
+ ScriptElement* scriptElement = toScriptElement(script);
+ ASSERT(scriptElement);
+ if (!scriptElement->shouldExecuteAsJavaScript())
+ return;
+
if (script->hasAttribute(srcAttr)) {
if (script->hasAttribute(asyncAttr)) // Async takes precendence over defer.
return; // Asynchronous scripts handle themselves.
@@ -335,7 +316,7 @@ void HTMLScriptRunner::runScript(Element* script, int startingLineNumber)
// ASSERT(document()->haveStylesheetsLoaded());
ASSERT(isExecutingScript());
ScriptSourceCode sourceCode(script->textContent(), documentURLForScriptExecution(m_document), startingLineNumber);
- executeScript(script, sourceCode);
+ executeScript(sourceCode);
}
}
}
diff --git a/WebCore/html/parser/HTMLScriptRunner.h b/WebCore/html/parser/HTMLScriptRunner.h
index 47c96fd..be21dd2 100644
--- a/WebCore/html/parser/HTMLScriptRunner.h
+++ b/WebCore/html/parser/HTMLScriptRunner.h
@@ -68,7 +68,7 @@ private:
void executeParsingBlockingScript();
void executePendingScriptAndDispatchEvent(PendingScript&);
- void executeScript(Element*, const ScriptSourceCode&) const;
+ void executeScript(const ScriptSourceCode&) const;
bool haveParsingBlockingScript() const;
bool executeParsingBlockingScripts();
diff --git a/WebCore/html/parser/HTMLTokenizer.cpp b/WebCore/html/parser/HTMLTokenizer.cpp
index f5405ff..305fca2 100644
--- a/WebCore/html/parser/HTMLTokenizer.cpp
+++ b/WebCore/html/parser/HTMLTokenizer.cpp
@@ -30,6 +30,7 @@
#include "HTMLEntityParser.h"
#include "HTMLToken.h"
+#include "HTMLTreeBuilder.h"
#include "HTMLNames.h"
#include "NotImplemented.h"
#include <wtf/ASCIICType.h>
@@ -102,8 +103,9 @@ inline bool isEndTagBufferingState(HTMLTokenizer::State state)
}
-HTMLTokenizer::HTMLTokenizer()
+HTMLTokenizer::HTMLTokenizer(bool usePreHTML5ParserQuirks)
: m_inputStreamPreprocessor(this)
+ , m_usePreHTML5ParserQuirks(usePreHTML5ParserQuirks)
{
reset();
}
@@ -171,7 +173,7 @@ inline bool HTMLTokenizer::processEntity(SegmentedString& source)
// Sometimes there's more complicated logic in the spec that separates when
// we consume the next input character and when we switch to a particular
-// state. We handle those cases by advancing the source directly and using
+// state. We handle those cases by advancing the source directly and using
// this macro to switch to the indicated state.
#define SWITCH_TO(stateName) \
do { \
@@ -277,7 +279,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
// http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-inbody
// Note that this logic is different than the generic \r\n collapsing
- // handled in the input stream preprocessor. This logic is here as an
+ // handled in the input stream preprocessor. This logic is here as an
// "authoring convenience" so folks can write:
//
// <pre>
@@ -435,6 +437,8 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
ADVANCE_TO(SelfClosingStartTagState);
else if (cc == '>')
return emitAndResumeIn(source, DataState);
+ else if (m_usePreHTML5ParserQuirks && cc == '<')
+ return emitAndReconsumeIn(source, DataState);
else if (isASCIIUpper(cc)) {
m_token->appendToName(toLowerCase(cc));
ADVANCE_TO(TagNameState);
@@ -876,6 +880,8 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
ADVANCE_TO(SelfClosingStartTagState);
else if (cc == '>')
return emitAndResumeIn(source, DataState);
+ else if (m_usePreHTML5ParserQuirks && cc == '<')
+ return emitAndReconsumeIn(source, DataState);
else if (isASCIIUpper(cc)) {
m_token->addNewAttribute();
m_token->beginAttributeName(source.numberOfCharactersConsumed());
@@ -908,6 +914,9 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
} else if (cc == '>') {
m_token->endAttributeName(source.numberOfCharactersConsumed());
return emitAndResumeIn(source, DataState);
+ } else if (m_usePreHTML5ParserQuirks && cc == '<') {
+ m_token->endAttributeName(source.numberOfCharactersConsumed());
+ return emitAndReconsumeIn(source, DataState);
} else if (isASCIIUpper(cc)) {
m_token->appendToAttributeName(toLowerCase(cc));
ADVANCE_TO(AttributeNameState);
@@ -933,6 +942,8 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
ADVANCE_TO(BeforeAttributeValueState);
else if (cc == '>')
return emitAndResumeIn(source, DataState);
+ else if (m_usePreHTML5ParserQuirks && cc == '<')
+ return emitAndReconsumeIn(source, DataState);
else if (isASCIIUpper(cc)) {
m_token->addNewAttribute();
m_token->beginAttributeName(source.numberOfCharactersConsumed());
@@ -1054,7 +1065,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
m_token->appendToAttributeValue(*iter);
}
// We're supposed to switch back to the attribute value state that
- // we were in when we were switched into this state. Rather than
+ // we were in when we were switched into this state. Rather than
// keeping track of this explictly, we observe that the previous
// state can be determined by m_additionalAllowedCharacter.
if (m_additionalAllowedCharacter == '"')
@@ -1075,6 +1086,8 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
ADVANCE_TO(SelfClosingStartTagState);
else if (cc == '>')
return emitAndResumeIn(source, DataState);
+ else if (m_usePreHTML5ParserQuirks && cc == '<')
+ return emitAndReconsumeIn(source, DataState);
else if (cc == InputStreamPreprocessor::endOfFileMarker) {
parseError();
RECONSUME_IN(DataState);
@@ -1213,13 +1226,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
BEGIN_STATE(CommentEndState) {
if (cc == '>')
return emitAndResumeIn(source, DataState);
- else if (isTokenizerWhitespace(cc)) {
- parseError();
- m_token->appendToComment('-');
- m_token->appendToComment('-');
- m_token->appendToComment(cc);
- ADVANCE_TO(CommentEndSpaceState);
- } else if (cc == '!') {
+ else if (cc == '!') {
parseError();
ADVANCE_TO(CommentEndBangState);
} else if (cc == '-') {
@@ -1260,24 +1267,6 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
}
END_STATE()
- BEGIN_STATE(CommentEndSpaceState) {
- if (isTokenizerWhitespace(cc)) {
- m_token->appendToComment(cc);
- ADVANCE_TO(CommentEndSpaceState);
- } else if (cc == '-')
- ADVANCE_TO(CommentEndDashState);
- else if (cc == '>')
- return emitAndResumeIn(source, DataState);
- else if (cc == InputStreamPreprocessor::endOfFileMarker) {
- parseError();
- return emitAndReconsumeIn(source, DataState);
- } else {
- m_token->appendToComment(cc);
- ADVANCE_TO(CommentState);
- }
- }
- END_STATE()
-
BEGIN_STATE(DOCTYPEState) {
if (isTokenizerWhitespace(cc))
ADVANCE_TO(BeforeDOCTYPENameState);
@@ -1656,6 +1645,23 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
return false;
}
+void HTMLTokenizer::updateStateFor(const AtomicString& tagName, Frame* frame)
+{
+ if (tagName == textareaTag || tagName == titleTag)
+ setState(RCDATAState);
+ else if (tagName == plaintextTag)
+ setState(PLAINTEXTState);
+ else if (tagName == scriptTag)
+ setState(ScriptDataState);
+ else if (tagName == styleTag
+ || tagName == iframeTag
+ || tagName == xmpTag
+ || (tagName == noembedTag && HTMLTreeBuilder::pluginsEnabled(frame))
+ || tagName == noframesTag
+ || (tagName == noscriptTag && HTMLTreeBuilder::scriptEnabled(frame)))
+ setState(RAWTEXTState);
+}
+
inline bool HTMLTokenizer::temporaryBufferIs(const String& expectedString)
{
return vectorEqualsString(m_temporaryBuffer, expectedString);
diff --git a/WebCore/html/parser/HTMLTokenizer.h b/WebCore/html/parser/HTMLTokenizer.h
index bab77f3..f16b049 100644
--- a/WebCore/html/parser/HTMLTokenizer.h
+++ b/WebCore/html/parser/HTMLTokenizer.h
@@ -36,6 +36,7 @@
namespace WebCore {
class Element;
+class Frame;
class HTMLToken;
class HTMLTokenizer : public Noncopyable {
@@ -96,7 +97,6 @@ public:
CommentEndDashState,
CommentEndState,
CommentEndBangState,
- CommentEndSpaceState,
DOCTYPEState,
BeforeDOCTYPENameState,
DOCTYPENameState,
@@ -119,12 +119,12 @@ public:
CDATASectionDoubleRightSquareBracketState,
};
- static PassOwnPtr<HTMLTokenizer> create() { return adoptPtr(new HTMLTokenizer); }
+ static PassOwnPtr<HTMLTokenizer> create(bool usePreHTML5ParserQuirks) { return adoptPtr(new HTMLTokenizer(usePreHTML5ParserQuirks)); }
~HTMLTokenizer();
void reset();
- // This function returns true if it emits a token. Otherwise, callers
+ // This function returns true if it emits a token. Otherwise, callers
// must provide the same (in progress) token on the next call (unless
// they call reset() first).
bool nextToken(SegmentedString&, HTMLToken&);
@@ -135,6 +135,22 @@ public:
State state() const { return m_state; }
void setState(State state) { m_state = state; }
+ // Updates the tokenizer's state according to the given tag name. This is
+ // an approximation of how the tree builder would update the tokenizer's
+ // state. This method is useful for approximating HTML tokenization. To
+ // get exactly the correct tokenization, you need the real tree builder.
+ //
+ // The main failures in the approximation are as follows:
+ //
+ // * The first set of character tokens emitted for a <pre> element might
+ // contain an extra leading newline.
+ // * The replacement of U+0000 with U+FFFD will not be sensitive to the
+ // tree builder's insertion mode.
+ // * CDATA sections in foreign content will be tokenized as bogus comments
+ // instead of as character tokens.
+ //
+ void updateStateFor(const AtomicString& tagName, Frame*);
+
// Hack to skip leading newline in <pre>/<listing> for authoring ease.
// http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-inbody
void setSkipLeadingNewLineForListing(bool value) { m_skipLeadingNewLineForListing = value; }
@@ -177,8 +193,8 @@ private:
// Every branch in this function is expensive, so we have a
// fast-reject branch for characters that don't require special
- // handling. Please run the parser benchmark whenever you touch
- // this function. It's very hot.
+ // handling. Please run the parser benchmark whenever you touch
+ // this function. It's very hot.
static const UChar specialCharacterMask = '\n' | '\r' | '\0';
if (m_nextInputCharacter & ~specialCharacterMask) {
m_skipNextNewLine = false;
@@ -238,7 +254,7 @@ private:
bool m_skipNextNewLine;
};
- HTMLTokenizer();
+ HTMLTokenizer(bool usePreHTML5ParserQuirks);
inline bool processEntity(SegmentedString&);
@@ -257,7 +273,7 @@ private:
inline bool temporaryBufferIs(const String&);
// Sometimes we speculatively consume input characters and we don't
- // know whether they represent end tags or RCDATA, etc. These
+ // know whether they represent end tags or RCDATA, etc. These
// functions help manage these state.
inline void addToPossibleEndTag(UChar cc);
inline void saveEndTagNameIfNeeded();
@@ -269,7 +285,7 @@ private:
Vector<UChar, 32> m_appropriateEndTagName;
- // m_token is owned by the caller. If nextToken is not on the stack,
+ // m_token is owned by the caller. If nextToken is not on the stack,
// this member might be pointing to unallocated memory.
HTMLToken* m_token;
int m_lineNumber;
@@ -282,7 +298,7 @@ private:
Vector<UChar, 32> m_temporaryBuffer;
// We occationally want to emit both a character token and an end tag
- // token (e.g., when lexing script). We buffer the name of the end tag
+ // token (e.g., when lexing script). We buffer the name of the end tag
// token here so we remember it next time we re-enter the tokenizer.
Vector<UChar, 32> m_bufferedEndTagName;
@@ -291,6 +307,8 @@ private:
// http://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-stream
InputStreamPreprocessor m_inputStreamPreprocessor;
+
+ bool m_usePreHTML5ParserQuirks;
};
}
diff --git a/WebCore/html/parser/HTMLTreeBuilder.cpp b/WebCore/html/parser/HTMLTreeBuilder.cpp
index 406bb6c..afac2a0 100644
--- a/WebCore/html/parser/HTMLTreeBuilder.cpp
+++ b/WebCore/html/parser/HTMLTreeBuilder.cpp
@@ -26,16 +26,17 @@
#include "config.h"
#include "HTMLTreeBuilder.h"
+#include "CharacterNames.h"
#include "Comment.h"
#include "DocumentFragment.h"
#include "DocumentType.h"
-#include "Element.h"
#include "Frame.h"
#include "HTMLDocument.h"
#include "HTMLElementFactory.h"
#include "HTMLFormElement.h"
#include "HTMLHtmlElement.h"
#include "HTMLNames.h"
+#include "HTMLParserIdioms.h"
#include "HTMLScriptElement.h"
#include "HTMLToken.h"
#include "HTMLTokenizer.h"
@@ -44,15 +45,10 @@
#include "NotImplemented.h"
#include "SVGNames.h"
#include "ScriptController.h"
-#include "Settings.h"
#include "Text.h"
#include "XLinkNames.h"
#include "XMLNSNames.h"
#include "XMLNames.h"
-// FIXME: Remove this include once we find a home for the free functions that
-// are using it.
-#include <wtf/dtoa.h>
-#include <wtf/UnusedParam.h>
namespace WebCore {
@@ -62,42 +58,19 @@ static const int uninitializedLineNumberValue = -1;
namespace {
-inline bool isTreeBuilderWhitepace(UChar c)
+inline bool isHTMLSpaceOrReplacementCharacter(UChar character)
{
- // FIXME: Consider branch permutations.
- return c == '\t' || c == '\x0A' || c == '\x0C' || c == '\x0D' || c == ' ';
-}
-
-inline bool isNotTreeBuilderWhitepace(UChar c)
-{
- return !isTreeBuilderWhitepace(c);
-}
-
-inline bool isTreeBuilderWhitepaceOrReplacementCharacter(UChar c)
-{
- return isTreeBuilderWhitepace(c) || c == 0xFFFD;
-}
-
-template<bool isSpecialCharacter(UChar c)>
-inline bool isAllSpecialCharacters(const String& string)
-{
- const UChar* characters = string.characters();
- const unsigned length = string.length();
- for (unsigned i = 0; i < length; ++i) {
- if (!isSpecialCharacter(characters[i]))
- return false;
- }
- return true;
+ return isHTMLSpace(character) || character == replacementCharacter;
}
inline bool isAllWhitespace(const String& string)
{
- return isAllSpecialCharacters<isTreeBuilderWhitepace>(string);
+ return string.isAllSpecialCharacters<isHTMLSpace>();
}
inline bool isAllWhitespaceOrReplacementCharacters(const String& string)
{
- return isAllSpecialCharacters<isTreeBuilderWhitepaceOrReplacementCharacter>(string);
+ return string.isAllSpecialCharacters<isHTMLSpaceOrReplacementCharacter>();
}
bool isNumberedHeaderTag(const AtomicString& tagName)
@@ -132,11 +105,14 @@ bool isTableBodyContextTag(const AtomicString& tagName)
// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#special
bool isSpecialNode(Node* node)
{
+ if (node->hasTagName(SVGNames::foreignObjectTag))
+ return true;
if (node->namespaceURI() != xhtmlNamespaceURI)
return false;
- // FIXME: This list is out of sync with the spec.
const AtomicString& tagName = node->localName();
return tagName == addressTag
+ || tagName == appletTag
+ || tagName == areaTag
|| tagName == articleTag
|| tagName == asideTag
|| tagName == baseTag
@@ -146,6 +122,7 @@ bool isSpecialNode(Node* node)
|| tagName == bodyTag
|| tagName == brTag
|| tagName == buttonTag
+ || tagName == captionTag
|| tagName == centerTag
|| tagName == colTag
|| tagName == colgroupTag
@@ -158,6 +135,7 @@ bool isSpecialNode(Node* node)
|| tagName == dtTag
|| tagName == embedTag
|| tagName == fieldsetTag
+ || tagName == figcaptionTag
|| tagName == figureTag
|| tagName == footerTag
|| tagName == formTag
@@ -176,12 +154,14 @@ bool isSpecialNode(Node* node)
|| tagName == liTag
|| tagName == linkTag
|| tagName == listingTag
+ || tagName == marqueeTag
|| tagName == menuTag
|| tagName == metaTag
|| tagName == navTag
|| tagName == noembedTag
|| tagName == noframesTag
|| tagName == noscriptTag
+ || tagName == objectTag
|| tagName == olTag
|| tagName == pTag
|| tagName == paramTag
@@ -191,8 +171,12 @@ bool isSpecialNode(Node* node)
|| tagName == sectionTag
|| tagName == selectTag
|| tagName == styleTag
+ || tagName == summaryTag
+ || tagName == tableTag
|| isTableBodyContextTag(tagName)
+ || tagName == tdTag
|| tagName == textareaTag
+ || tagName == thTag
|| tagName == titleTag
|| tagName == trTag
|| tagName == ulTag
@@ -268,17 +252,17 @@ public:
void skipLeadingWhitespace()
{
- skipLeading<isTreeBuilderWhitepace>();
+ skipLeading<isHTMLSpace>();
}
String takeLeadingWhitespace()
{
- return takeLeading<isTreeBuilderWhitepace>();
+ return takeLeading<isHTMLSpace>();
}
String takeLeadingNonWhitespace()
{
- return takeLeading<isNotTreeBuilderWhitepace>();
+ return takeLeading<isNotHTMLSpace>();
}
String takeRemaining()
@@ -301,7 +285,7 @@ public:
Vector<UChar> whitespace;
do {
UChar cc = *m_current++;
- if (isTreeBuilderWhitepace(cc))
+ if (isHTMLSpace(cc))
whitespace.append(cc);
} while (m_current < m_end);
// Returning the null string when there aren't any whitespace
@@ -402,7 +386,7 @@ HTMLTreeBuilder::FragmentParsingContext::FragmentParsingContext()
}
HTMLTreeBuilder::FragmentParsingContext::FragmentParsingContext(DocumentFragment* fragment, Element* contextElement, FragmentScriptingPermission scriptingPermission)
- : m_dummyDocumentForFragmentParsing(HTMLDocument::create(0, KURL()))
+ : m_dummyDocumentForFragmentParsing(HTMLDocument::create(0, KURL(), fragment->document()->baseURI()))
, m_fragment(fragment)
, m_contextElement(contextElement)
, m_scriptingPermission(scriptingPermission)
@@ -441,25 +425,6 @@ PassRefPtr<Element> HTMLTreeBuilder::takeScriptToProcess(int& scriptStartLine)
return m_scriptToProcess.release();
}
-HTMLTokenizer::State HTMLTreeBuilder::adjustedLexerState(HTMLTokenizer::State state, const AtomicString& tagName, Frame* frame)
-{
- if (tagName == textareaTag || tagName == titleTag)
- return HTMLTokenizer::RCDATAState;
-
- if (tagName == styleTag
- || tagName == iframeTag
- || tagName == xmpTag
- || (tagName == noembedTag && pluginsEnabled(frame))
- || tagName == noframesTag
- || (tagName == noscriptTag && scriptEnabled(frame)))
- return HTMLTokenizer::RAWTEXTState;
-
- if (tagName == plaintextTag)
- return HTMLTokenizer::PLAINTEXTState;
-
- return state;
-}
-
void HTMLTreeBuilder::constructTreeFromToken(HTMLToken& rawToken)
{
AtomicHTMLToken token(rawToken);
@@ -1121,8 +1086,6 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token)
parseError(token);
if (m_tree.form())
return;
- // FIXME: This deviates from the spec:
- // http://www.w3.org/Bugs/Public/show_bug.cgi?id=10216
m_tree.insertHTMLFormElement(token, true);
m_tree.openElements()->pop();
return;
@@ -1477,7 +1440,6 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
processStartTag(token);
break;
case InForeignContentMode: {
- // FIXME: We're missing a bunch of if branches here.
if (shouldProcessUsingSecondaryInsertionMode(token, m_tree.currentElement())) {
processUsingSecondaryInsertionModeAndAdjustInsertionMode(token);
return;
@@ -1522,8 +1484,10 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
|| token.name() == ulTag
|| token.name() == varTag
|| (token.name() == fontTag && (token.getAttributeItem(colorAttr) || token.getAttributeItem(faceAttr) || token.getAttributeItem(sizeAttr)))) {
- m_tree.openElements()->popUntilElementWithNamespace(xhtmlNamespaceURI);
- setInsertionMode(m_secondaryInsertionMode);
+ parseError(token);
+ m_tree.openElements()->popUntilForeignContentScopeMarker();
+ if (insertionMode() == InForeignContentMode && m_tree.openElements()->hasOnlyHTMLElementsInScope())
+ setInsertionMode(m_secondaryInsertionMode);
processStartTag(token);
return;
}
@@ -1539,7 +1503,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
break;
}
case TextMode:
- notImplemented();
+ ASSERT_NOT_REACHED();
break;
}
}
@@ -1601,21 +1565,6 @@ HTMLElementStack::ElementRecord* HTMLTreeBuilder::furthestBlockForFormattingElem
return 0;
}
-// FIXME: This should have a whitty name.
-// FIXME: This must be implemented in many other places in WebCore.
-void HTMLTreeBuilder::reparentChildren(Element* oldParent, Element* newParent)
-{
- Node* child = oldParent->firstChild();
- while (child) {
- Node* nextChild = child->nextSibling();
- oldParent->parserRemoveChild(child);
- newParent->parserAddChild(child);
- if (newParent->attached() && !child->attached())
- child->attach();
- child = nextChild;
- }
-}
-
// http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-inbody
void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
{
@@ -1708,7 +1657,7 @@ void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
// 8
RefPtr<Element> newElement = m_tree.createHTMLElementFromElementRecord(formattingElementRecord);
// 9
- reparentChildren(furthestBlock->element(), newElement.get());
+ newElement->takeAllChildrenFrom(furthestBlock->element());
// 10
Element* furthestBlockElement = furthestBlock->element();
// FIXME: All this creation / parserAddChild / attach business should
@@ -1886,9 +1835,6 @@ void HTMLTreeBuilder::processEndTagForInCell(AtomicHTMLToken& token)
m_tree.openElements()->popUntilPopped(token.name());
m_tree.activeFormattingElements()->clearToLastMarker();
setInsertionMode(InRowMode);
- // FIXME: The fragment case of this ASSERT is a spec bug:
- // http://www.w3.org/Bugs/Public/show_bug.cgi?id=10338
- ASSERT(m_tree.currentElement()->hasTagName(trTag) || (isParsingFragment() && m_fragmentContext.contextElement()->hasTagName(trTag)));
return;
}
if (token.name() == bodyTag
@@ -1902,8 +1848,6 @@ void HTMLTreeBuilder::processEndTagForInCell(AtomicHTMLToken& token)
|| isTableBodyContextTag(token.name())) {
if (!m_tree.openElements()->inTableScope(token.name())) {
ASSERT(isParsingFragment());
- // FIXME: It is unclear what the exact ASSERT should be.
- // http://www.w3.org/Bugs/Public/show_bug.cgi?id=10098
parseError(token);
return;
}
@@ -2020,10 +1964,6 @@ void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken& token)
m_tree.openElements()->popUntilNumberedHeaderElementPopped();
return;
}
- if (token.name() == "sarcasm") {
- notImplemented(); // Take a deep breath.
- return;
- }
if (isFormattingTag(token.name())) {
callTheAdoptionAgency(token);
return;
@@ -2608,14 +2548,15 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
// Fall through
case InBodyMode:
case InCellMode:
- ASSERT(insertionMode() == InBodyMode || insertionMode() == InCellMode);
- notImplemented(); // Emit parse error based on what elemtns are still open.
+ case InCaptionMode:
+ case InRowMode:
+ ASSERT(insertionMode() == InBodyMode || insertionMode() == InCellMode || insertionMode() == InCaptionMode || insertionMode() == InRowMode);
+ notImplemented(); // Emit parse error based on what elements are still open.
break;
case AfterBodyMode:
case AfterAfterBodyMode:
ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
- notImplemented();
- break;
+ return;
case InHeadNoscriptMode:
ASSERT(insertionMode() == InHeadNoscriptMode);
defaultForInHeadNoscript();
@@ -2647,9 +2588,11 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
return;
case InForeignContentMode:
parseError(token);
- // FIXME: Following the spec would infinitely recurse on <svg><svg>
- // http://www.w3.org/Bugs/Public/show_bug.cgi?id=10115
- m_tree.openElements()->popUntilElementWithNamespace(xhtmlNamespaceURI);
+ m_tree.openElements()->popUntilForeignContentScopeMarker();
+ // FIXME: The spec adds the following condition before setting the
+ // insertion mode. However, this condition causes an infinite loop.
+ // See http://www.w3.org/Bugs/Public/show_bug.cgi?id=10621
+ // if (insertionMode() == InForeignContentMode && m_tree.openElements()->hasOnlyHTMLElementsInScope())
setInsertionMode(m_secondaryInsertionMode);
processEndOfFile(token);
return;
@@ -2658,10 +2601,13 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
processEndOfFile(token);
return;
case TextMode:
- case InCaptionMode:
- case InRowMode:
- notImplemented();
- break;
+ parseError(token);
+ if (m_tree.currentElement()->hasTagName(scriptTag))
+ notImplemented(); // mark the script element as "already started".
+ m_tree.openElements()->pop();
+ setInsertionMode(m_originalInsertionMode);
+ processEndOfFile(token);
+ return;
}
ASSERT(m_tree.openElements()->top());
m_tree.openElements()->popAll();
@@ -2813,9 +2759,7 @@ bool HTMLTreeBuilder::scriptEnabled(Frame* frame)
{
if (!frame)
return false;
- if (ScriptController* scriptController = frame->script())
- return scriptController->canExecuteScripts(NotAboutToExecuteScript);
- return false;
+ return frame->script()->canExecuteScripts(NotAboutToExecuteScript);
}
bool HTMLTreeBuilder::pluginsEnabled(Frame* frame)
@@ -2825,41 +2769,4 @@ bool HTMLTreeBuilder::pluginsEnabled(Frame* frame)
return frame->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiatePlugin);
}
-// FIXME: Move this function to a more appropriate place.
-String serializeForNumberType(double number)
-{
- // According to HTML5, "the best representation of the number n as a floating
- // point number" is a string produced by applying ToString() to n.
- NumberToStringBuffer buffer;
- unsigned length = numberToString(number, buffer);
- return String(buffer, length);
-}
-
-// FIXME: Move this function to a more appropriate place.
-bool parseToDoubleForNumberType(const String& src, double* out)
-{
- // See HTML5 2.4.4.3 `Real numbers.'
-
- if (src.isEmpty())
- return false;
- // String::toDouble() accepts leading + \t \n \v \f \r and SPACE, which are invalid in HTML5.
- // So, check the first character.
- if (src[0] != '-' && (src[0] < '0' || src[0] > '9'))
- return false;
-
- bool valid = false;
- double value = src.toDouble(&valid);
- if (!valid)
- return false;
- // NaN and Infinity are not valid numbers according to the standard.
- if (!isfinite(value))
- return false;
- // -0 -> 0
- if (!value)
- value = 0;
- if (out)
- *out = value;
- return true;
-}
-
}
diff --git a/WebCore/html/parser/HTMLTreeBuilder.h b/WebCore/html/parser/HTMLTreeBuilder.h
index 4634f0a..d522ea8 100644
--- a/WebCore/html/parser/HTMLTreeBuilder.h
+++ b/WebCore/html/parser/HTMLTreeBuilder.h
@@ -76,8 +76,6 @@ public:
// Done, close any open tags, etc.
void finished();
- static HTMLTokenizer::State adjustedLexerState(HTMLTokenizer::State, const AtomicString& tagName, Frame*);
-
static bool scriptEnabled(Frame*);
static bool pluginsEnabled(Frame*);
@@ -170,7 +168,6 @@ private:
PassRefPtr<NamedNodeMap> attributesForIsindexInput(AtomicHTMLToken&);
HTMLElementStack::ElementRecord* furthestBlockForFormattingElement(Element*);
- void reparentChildren(Element* oldParent, Element* newParent);
void callTheAdoptionAgency(AtomicHTMLToken&);
void closeTheCell();
@@ -257,18 +254,6 @@ private:
int m_lastScriptElementStartLine;
};
-// FIXME: Move these functions to a more appropriate place.
-
-// Converts the specified string to a floating number.
-// If the conversion fails, the return value is false. Take care that leading
-// or trailing unnecessary characters make failures. This returns false for an
-// empty string input.
-// The double* parameter may be 0.
-bool parseToDoubleForNumberType(const String&, double*);
-// Converts the specified number to a string. This is an implementation of
-// HTML5's "algorithm to convert a number to a string" for NUMBER/RANGE types.
-String serializeForNumberType(double);
-
}
#endif
diff --git a/WebCore/html/parser/HTMLViewSourceParser.cpp b/WebCore/html/parser/HTMLViewSourceParser.cpp
index 8a7984d..ace8590 100644
--- a/WebCore/html/parser/HTMLViewSourceParser.cpp
+++ b/WebCore/html/parser/HTMLViewSourceParser.cpp
@@ -26,15 +26,15 @@
#include "config.h"
#include "HTMLViewSourceParser.h"
+#include "HTMLDocumentParser.h"
#include "HTMLNames.h"
-#include "HTMLTreeBuilder.h"
#include "HTMLViewSourceDocument.h"
namespace WebCore {
HTMLViewSourceParser::HTMLViewSourceParser(HTMLViewSourceDocument* document)
: DecodedDataDocumentParser(document)
- , m_tokenizer(HTMLTokenizer::create())
+ , m_tokenizer(HTMLTokenizer::create(HTMLDocumentParser::usePreHTML5ParserQuirks(document)))
{
}
@@ -87,13 +87,7 @@ void HTMLViewSourceParser::updateTokenizerState()
return;
AtomicString tagName(m_token.name().data(), m_token.name().size());
- m_tokenizer->setState(HTMLTreeBuilder::adjustedLexerState(m_tokenizer->state(), tagName, document()->frame()));
- if (tagName == HTMLNames::scriptTag) {
- // The tree builder handles scriptTag separately from the other tokenizer
- // state adjustments, so we need to handle it separately too.
- ASSERT(m_tokenizer->state() == HTMLTokenizer::DataState);
- m_tokenizer->setState(HTMLTokenizer::ScriptDataState);
- }
+ m_tokenizer->updateStateFor(tagName, document()->frame());
}
void HTMLViewSourceParser::finish()
diff --git a/WebCore/html/parser/NestingLevelIncrementer.h b/WebCore/html/parser/NestingLevelIncrementer.h
new file mode 100644
index 0000000..c597876
--- /dev/null
+++ b/WebCore/html/parser/NestingLevelIncrementer.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NestingLevelIncrementer_h
+#define NestingLevelIncrementer_h
+
+namespace WebCore {
+
+class NestingLevelIncrementer : public Noncopyable {
+public:
+ explicit NestingLevelIncrementer(unsigned& nestingLevel)
+ : m_nestingLevel(&nestingLevel)
+ {
+ ++(*m_nestingLevel);
+ }
+
+ ~NestingLevelIncrementer()
+ {
+ --(*m_nestingLevel);
+ }
+
+private:
+ unsigned* m_nestingLevel;
+};
+
+}
+
+#endif
diff --git a/WebCore/inspector/CodeGeneratorInspector.pm b/WebCore/inspector/CodeGeneratorInspector.pm
index c7907b4..80e243b 100644
--- a/WebCore/inspector/CodeGeneratorInspector.pm
+++ b/WebCore/inspector/CodeGeneratorInspector.pm
@@ -606,6 +606,7 @@ sub generateSource
my @sourceContent = split("\r", $licenseTemplate);
push(@sourceContent, "\n#include \"config.h\"");
push(@sourceContent, "#include \"$className.h\"");
+ push(@sourceContent, "#include <wtf/text/CString.h>");
push(@sourceContent, "");
push(@sourceContent, "#if ENABLE(INSPECTOR)");
push(@sourceContent, "");
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index 169b188..ae136b2 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -44,13 +44,9 @@ module core {
[notify] void evaluateForTestInFrontend(out long testCallId, out String script);
[notify] void disconnectFromBackend();
[notify] void inspectedURLChanged(out String url);
- [notify] void monitoringXHRWasEnabled();
- [notify] void monitoringXHRWasDisabled();
[notify] void removeResource(out unsigned long identifier);
[notify] void reset();
[notify] void resetProfilesPanel();
- [notify] void resourceTrackingWasEnabled();
- [notify] void resourceTrackingWasDisabled();
[notify] void searchingForNodeWasEnabled();
[notify] void searchingForNodeWasDisabled();
[notify] void setChildNodes(out long parentId, out Array nodes);
@@ -102,6 +98,7 @@ module core {
[handler=Controller] void populateScriptObjects();
[handler=Controller] void getSettings(out Object settings);
+ [handler=Controller] void getInspectorState(out Object state);
[handler=Controller] void storeLastActivePanel(in String panelName);
[handler=Controller] void saveApplicationSettings(in String settings);
@@ -110,11 +107,9 @@ module core {
[handler=Controller] void enableSearchingForNode();
[handler=Controller] void disableSearchingForNode();
- [handler=Controller] void enableMonitoringXHR();
- [handler=Controller] void disableMonitoringXHR();
+ [handler=Controller] void setMonitoringXHREnabled(in boolean enable, out boolean newState);
- [handler=Controller] void enableResourceTracking(in boolean always);
- [handler=Controller] void disableResourceTracking(in boolean always);
+ [handler=Controller] void setResourceTrackingEnabled(in boolean enabled, in boolean always, out boolean newState);
[handler=Controller] void getResourceContent(in unsigned long identifier, out String content);
[handler=Controller] void reloadPage();
@@ -188,7 +183,7 @@ module core {
[handler=DOM] void getInlineStyle(in long nodeId, out Value style);
[handler=DOM] void getComputedStyle(in long nodeId, out Value style);
[handler=DOM] void getStyleSheet(in long styleSheetId, out Object styleSheet);
- [handler=DOM] void getRuleRanges(in long styleSheetId, out Value ranges);
+ [handler=DOM] void getStyleSourceData(in long styleSheetId, out Object styleSourceData);
[handler=DOM] void applyStyleText(in long styleId, in String styleText, in String propertyName, out boolean success, out Value style, out Array changedProperties);
[handler=DOM] void setStyleText(in long styleId, in String styleText, out boolean success);
[handler=DOM] void setStyleProperty(in long styleId, in String name, in String value, out boolean success);
diff --git a/WebCore/inspector/InspectorCSSStore.cpp b/WebCore/inspector/InspectorCSSStore.cpp
index c2dc4f1..b019860 100644
--- a/WebCore/inspector/InspectorCSSStore.cpp
+++ b/WebCore/inspector/InspectorCSSStore.cpp
@@ -37,11 +37,18 @@
#include "CSSStyleDeclaration.h"
#include "CSSStyleRule.h"
#include "CSSStyleSheet.h"
+#include "CachedResource.h"
+#include "DocumentLoader.h"
+#include "Element.h"
+#include "Frame.h"
#include "HTMLHeadElement.h"
#include "InspectorController.h"
#include "InspectorResource.h"
+#include "Node.h"
#include "PlatformString.h"
+#include "SharedBuffer.h"
#include "StyleSheetList.h"
+#include "TextEncoding.h"
namespace WebCore {
@@ -67,6 +74,7 @@ void InspectorCSSStore::reset()
m_styleSheetToOffsets.clear();
m_styleSheetToId.clear();
m_idToStyleSheet.clear();
+ m_idToStyleSheetText.clear();
m_idToDisabledStyle.clear();
m_documentNodeToInspectorStyleSheetMap.clear();
@@ -104,48 +112,145 @@ CSSStyleSheet* InspectorCSSStore::inspectorStyleSheet(Document* ownerDocument, b
return inspectorStyleSheet;
}
-HashMap<long, SourceRange> InspectorCSSStore::getRuleRanges(CSSStyleSheet* styleSheet)
+String InspectorCSSStore::styleSheetText(long styleSheetId)
{
+ IdToStyleSheetTextMap::iterator it = m_idToStyleSheetText.find(styleSheetId);
+ if (it != m_idToStyleSheetText.end())
+ return it->second;
+
+ CSSStyleSheet* styleSheet = styleSheetForId(styleSheetId);
+ if (!styleSheet)
+ return String();
+
+ String result;
+ bool success = false;
+ Node* ownerNode = styleSheet->ownerNode();
+ if (ownerNode && ownerNode->nodeType() == Node::ELEMENT_NODE) {
+ Element* ownerElement = static_cast<Element*>(ownerNode);
+ if (ownerElement->tagName().lower() == "style") {
+ result = inlineStyleSheetText(styleSheet);
+ success = true;
+ }
+ }
+ if (!success)
+ success = resourceStyleSheetText(styleSheet, &result);
+
+ if (success)
+ m_idToStyleSheetText.set(styleSheetId, result);
+ return result;
+}
+
+bool InspectorCSSStore::resourceStyleSheetText(CSSStyleSheet* styleSheet, String* result)
+{
+ return m_inspectorController->resourceContentForURL(styleSheet->finalURL(), styleSheet->document(), result);
+}
+
+String InspectorCSSStore::inlineStyleSheetText(CSSStyleSheet* styleSheet)
+{
+ Node* ownerNode = styleSheet->ownerNode();
+ if (!ownerNode || ownerNode->nodeType() != Node::ELEMENT_NODE || m_styleSheetToId.find(styleSheet) == m_styleSheetToId.end())
+ return String();
+ Element* ownerElement = static_cast<Element*>(ownerNode);
+ if (ownerElement->tagName().lower() != "style")
+ return String();
+ return ownerElement->innerText();
+}
+
+
+// All ranges are: [start; end) (start - inclusive, end - exclusive).
+bool InspectorCSSStore::getStyleSourceData(CSSStyleDeclaration* style, RefPtr<CSSStyleSourceData>* result)
+{
+ if (!style)
+ return false;
+
+ Element* element = inlineStyleElement(style);
+ if (element) {
+ // Inline: style="...".
+ RefPtr<CSSStyleSourceData> styleSourceData = CSSStyleSourceData::create();
+ bool success = getStyleAttributeRanges(element, &styleSourceData);
+ if (!success)
+ return false;
+ *result = styleSourceData;
+ return true;
+ }
+
+ CSSStyleSheet* styleSheet = getParentStyleSheet(style);
if (!styleSheet)
- return HashMap<long, SourceRange>();
- RefPtr<CSSRuleList> originalRuleList = CSSRuleList::create(styleSheet, false);
+ return false;
+
+ Vector<RefPtr<CSSStyleSourceData> >* rangesVector = 0;
StyleSheetToOffsetsMap::iterator it = m_styleSheetToOffsets.find(styleSheet);
- Vector<SourceRange>* offsetVector = 0;
if (it == m_styleSheetToOffsets.end()) {
- InspectorResource* resource = m_inspectorController->resourceForURL(styleSheet->finalURL().string());
- if (resource) {
- offsetVector = new Vector<SourceRange>;
+ String text = styleSheetText(bindStyleSheet(styleSheet));
+ if (!text.isEmpty()) {
RefPtr<CSSStyleSheet> newStyleSheet = CSSStyleSheet::create(styleSheet->ownerNode());
CSSParser p;
- CSSParser::StyleRuleRanges ruleRangeMap;
- p.parseSheet(newStyleSheet.get(), resource->sourceString(), 0, &ruleRangeMap);
- for (unsigned i = 0, length = newStyleSheet->length(); i < length; ++i) {
- CSSStyleRule* rule = asCSSStyleRule(newStyleSheet->item(i));
- if (!rule)
- continue;
- HashMap<CSSStyleRule*, std::pair<unsigned, unsigned> >::iterator it = ruleRangeMap.find(rule);
- if (it != ruleRangeMap.end())
- offsetVector->append(it->second);
- }
- m_styleSheetToOffsets.set(styleSheet, offsetVector);
+ StyleRuleRangeMap ruleRangeMap;
+ p.parseSheet(newStyleSheet.get(), text, 0, &ruleRangeMap);
+ rangesVector = new Vector<RefPtr<CSSStyleSourceData> >;
+ extractRanges(newStyleSheet.get(), ruleRangeMap, rangesVector);
+ m_styleSheetToOffsets.set(styleSheet, rangesVector);
}
} else
- offsetVector = it->second;
- if (!offsetVector)
- return HashMap<long, SourceRange>();
+ rangesVector = it->second;
+ if (!rangesVector)
+ return false;
unsigned ruleIndex = 0;
- HashMap<long, SourceRange> result;
for (unsigned i = 0, length = styleSheet->length(); i < length; ++i) {
- ASSERT(ruleIndex < offsetVector->size());
CSSStyleRule* rule = asCSSStyleRule(styleSheet->item(i));
if (!rule)
continue;
- // This maps the style id to the rule body range.
- result.set(bindStyle(rule->style()), offsetVector->at(ruleIndex));
+ if (rule->style() == style) {
+ ASSERT(ruleIndex < rangesVector->size());
+ *result = rangesVector->at(ruleIndex);
+ return true;
+ }
ruleIndex++;
}
- return result;
+ return false;
+}
+
+void InspectorCSSStore::extractRanges(CSSStyleSheet* styleSheet, const StyleRuleRangeMap& ruleRangeMap, Vector<RefPtr<CSSStyleSourceData> >* rangesVector)
+{
+ for (unsigned i = 0, length = styleSheet->length(); i < length; ++i) {
+ CSSStyleRule* rule = asCSSStyleRule(styleSheet->item(i));
+ if (!rule)
+ continue;
+ StyleRuleRangeMap::const_iterator it = ruleRangeMap.find(rule);
+ if (it != ruleRangeMap.end())
+ rangesVector->append(it->second);
+ }
+}
+
+bool InspectorCSSStore::getStyleAttributeRanges(Node* node, RefPtr<CSSStyleSourceData>* result)
+{
+ if (!node || !node->isStyledElement())
+ return false;
+
+ String styleText = static_cast<StyledElement*>(node)->getAttribute("style");
+ if (styleText.isEmpty()) {
+ (*result)->styleBodyRange.start = 0;
+ (*result)->styleBodyRange.end = 0;
+ return true;
+ }
+
+ RefPtr<CSSMutableStyleDeclaration> tempDeclaration = CSSMutableStyleDeclaration::create();
+ CSSParser p;
+ p.parseDeclaration(tempDeclaration.get(), styleText, result->get());
+ return true;
+}
+
+CSSStyleSheet* InspectorCSSStore::getParentStyleSheet(CSSStyleDeclaration* style)
+{
+ if (!style)
+ return 0;
+
+ StyleSheet* styleSheet = style->stylesheet();
+ if (styleSheet && styleSheet->isCSSStyleSheet())
+ return static_cast<CSSStyleSheet*>(styleSheet);
+
+ return 0;
}
CSSStyleRule* InspectorCSSStore::asCSSStyleRule(StyleBase* styleBase)
@@ -217,6 +322,17 @@ long InspectorCSSStore::bindRule(CSSStyleRule* rule)
return id;
}
+// static
+Element* InspectorCSSStore::inlineStyleElement(CSSStyleDeclaration* style)
+{
+ if (!style || !style->isMutableStyleDeclaration())
+ return 0;
+ Node* node = static_cast<CSSMutableStyleDeclaration*>(style)->node();
+ if (!node || !node->isStyledElement() || static_cast<StyledElement*>(node)->getInlineStyleDecl() != style)
+ return 0;
+ return static_cast<Element*>(node);
+}
+
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorCSSStore.h b/WebCore/inspector/InspectorCSSStore.h
index 82de622..9b329df 100644
--- a/WebCore/inspector/InspectorCSSStore.h
+++ b/WebCore/inspector/InspectorCSSStore.h
@@ -29,46 +29,54 @@
#ifndef InspectorCSSStore_h
#define InspectorCSSStore_h
+#include "CSSPropertySourceData.h"
+#include "Cache.h"
+
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/RefPtr.h>
-#include <wtf/text/StringHash.h>
namespace WebCore {
-class Document;
-class InspectorController;
class CSSMutableStyleDeclaration;
class CSSStyleDeclaration;
class CSSRuleList;
class CSSStyleRule;
class CSSStyleSheet;
+class Document;
+class Element;
+class InspectorController;
+class Node;
class StyleBase;
typedef std::pair<String, String> PropertyValueAndPriority;
-typedef std::pair<unsigned, unsigned> SourceRange;
typedef HashMap<String, PropertyValueAndPriority> DisabledStyleDeclaration;
typedef HashMap<CSSStyleDeclaration*, long> StyleToIdMap;
typedef HashMap<long, RefPtr<CSSStyleDeclaration> > IdToStyleMap;
typedef HashMap<CSSStyleRule*, long> RuleToIdMap;
typedef HashMap<long, RefPtr<CSSStyleRule> > IdToRuleMap;
-typedef HashMap<CSSStyleSheet*, Vector<SourceRange>* > StyleSheetToOffsetsMap;
+typedef HashMap<CSSStyleSheet*, Vector<RefPtr<CSSStyleSourceData> >* > StyleSheetToOffsetsMap;
typedef HashMap<CSSStyleSheet*, long> StyleSheetToIdMap;
typedef HashMap<long, RefPtr<CSSStyleSheet> > IdToStyleSheetMap;
+typedef HashMap<long, String> IdToStyleSheetTextMap;
typedef HashMap<long, DisabledStyleDeclaration> IdToDisabledStyleMap;
typedef HashMap<RefPtr<Document>, RefPtr<CSSStyleSheet> > DocumentToStyleSheetMap;
class InspectorCSSStore {
public:
+ static CSSStyleSheet* getParentStyleSheet(CSSStyleDeclaration*);
+ static Element* inlineStyleElement(CSSStyleDeclaration*);
+
InspectorCSSStore(InspectorController* inspectorController);
~InspectorCSSStore();
void reset();
- HashMap<long, SourceRange> getRuleRanges(CSSStyleSheet*);
+ bool getStyleSourceData(CSSStyleDeclaration*, RefPtr<CSSStyleSourceData>* result);
CSSStyleDeclaration* styleForId(long styleId);
CSSStyleSheet* styleSheetForId(long styleSheetId);
CSSStyleRule* ruleForId(long styleRuleId);
DisabledStyleDeclaration* disabledStyleForId(long styleId, bool createIfAbsent);
+ String styleSheetText(long styleSheetId);
CSSStyleSheet* inspectorStyleSheet(Document* ownerDocument, bool createIfAbsent);
void removeDocument(Document*);
@@ -78,6 +86,10 @@ public:
private:
static CSSStyleRule* asCSSStyleRule(StyleBase*);
+ String inlineStyleSheetText(CSSStyleSheet*);
+ bool resourceStyleSheetText(CSSStyleSheet*, String* result);
+ void extractRanges(CSSStyleSheet*, const StyleRuleRangeMap&, Vector<RefPtr<CSSStyleSourceData> >* rangesVector);
+ bool getStyleAttributeRanges(Node* parentNode, RefPtr<CSSStyleSourceData>* result);
StyleToIdMap m_styleToId;
IdToStyleMap m_idToStyle;
@@ -85,8 +97,9 @@ private:
IdToRuleMap m_idToRule;
StyleSheetToOffsetsMap m_styleSheetToOffsets;
StyleSheetToIdMap m_styleSheetToId;
- IdToStyleSheetMap m_idToStyleSheet;
IdToDisabledStyleMap m_idToDisabledStyle;
+ IdToStyleSheetMap m_idToStyleSheet;
+ IdToStyleSheetTextMap m_idToStyleSheetText;
DocumentToStyleSheetMap m_documentNodeToInspectorStyleSheetMap;
InspectorController* m_inspectorController;
diff --git a/WebCore/inspector/InspectorClient.h b/WebCore/inspector/InspectorClient.h
index acd8b28..bb71b13 100644
--- a/WebCore/inspector/InspectorClient.h
+++ b/WebCore/inspector/InspectorClient.h
@@ -54,10 +54,7 @@ public:
// Navigation can cause some WebKit implementations to change the view / page / inspector controller instance.
// However, there are some inspector controller states that should survive navigation (such as tracking resources
// or recording timeline). Following callbacks allow embedders to track these states.
- virtual void resourceTrackingWasEnabled() { };
- virtual void resourceTrackingWasDisabled() { };
- virtual void timelineProfilerWasStarted() { };
- virtual void timelineProfilerWasStopped() { };
+ virtual void updateInspectorStateCookie(const String&) { };
};
} // namespace WebCore
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 1e131f7..5f8f190 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -33,6 +33,7 @@
#if ENABLE(INSPECTOR)
#include "CachedResource.h"
+#include "CachedResourceLoader.h"
#include "Chrome.h"
#include "Console.h"
#include "ConsoleMessage.h"
@@ -71,6 +72,7 @@
#include "InspectorTimelineAgent.h"
#include "InspectorValues.h"
#include "InspectorWorkerResource.h"
+#include "IntRect.h"
#include "Page.h"
#include "ProgressTracker.h"
#include "Range.h"
@@ -117,26 +119,28 @@ using namespace std;
namespace WebCore {
-static const char* const resourceTrackingEnabledSettingName = "resourceTrackingEnabled";
-static const char* const debuggerEnabledSettingName = "debuggerEnabled";
-static const char* const profilerEnabledSettingName = "profilerEnabled";
-static const char* const inspectorAttachedHeightName = "inspectorAttachedHeight";
+static const char* const frontendSettingsSettingName = "frontendSettings";
+
+static const char* const debuggerAlwaysEnabledSettingName = "debuggerEnabled";
static const char* const lastActivePanel = "lastActivePanel";
+static const char* const monitoringXHRSettingName = "xhrMonitor";
+static const char* const resourceTrackingAlwaysEnabledSettingName = "resourceTrackingEnabled";
+static const char* const profilerAlwaysEnabledSettingName = "profilerEnabled";
+
+static const char* const timelineProfilerEnabledStateName = "timelineProfilerEnabled";
+static const char* const resourceTrackingEnabledStateName = "resourceTrackingEnabled";
+static const char* const monitoringXHRStateName = "monitoringXHREnabled";
+
+static const char* const inspectorAttachedHeightName = "inspectorAttachedHeight";
+
const char* const InspectorController::ElementsPanel = "elements";
const char* const InspectorController::ConsolePanel = "console";
const char* const InspectorController::ScriptsPanel = "scripts";
const char* const InspectorController::ProfilesPanel = "profiles";
-static const char* const monitoringXHRSettingName = "xhrMonitor";
static int connectedFrontendCount = 0;
-const String& InspectorController::frontendSettingsSettingName()
-{
- DEFINE_STATIC_LOCAL(String, settingName, ("frontendSettings"));
- return settingName;
-}
-
const String& InspectorController::inspectorStartsAttachedSettingName()
{
DEFINE_STATIC_LOCAL(String, settingName, ("inspectorStartsAttached"));
@@ -240,7 +244,7 @@ void InspectorController::setSetting(const String& key, const String& value)
void InspectorController::saveApplicationSettings(const String& settings)
{
- setSetting(InspectorController::frontendSettingsSettingName(), settings);
+ setSetting(frontendSettingsSettingName, settings);
}
void InspectorController::saveSessionSettings(const String& settingsJSON)
@@ -248,10 +252,46 @@ void InspectorController::saveSessionSettings(const String& settingsJSON)
m_sessionSettings = InspectorValue::parseJSON(settingsJSON);
}
+void InspectorController::getInspectorState(RefPtr<InspectorObject>* state)
+{
+ (*state)->setBoolean(monitoringXHRStateName, m_monitoringXHR);
+ (*state)->setBoolean(resourceTrackingEnabledStateName, m_resourceTrackingEnabled);
+}
+
+void InspectorController::updateInspectorStateCookie()
+{
+ RefPtr<InspectorObject> state = InspectorObject::create();
+ state->setBoolean(monitoringXHRStateName, m_monitoringXHR);
+ state->setBoolean(resourceTrackingEnabledStateName, m_resourceTrackingEnabled);
+ state->setBoolean(timelineProfilerEnabledStateName, m_timelineAgent);
+ m_client->updateInspectorStateCookie(state->toJSONString());
+}
+
+void InspectorController::restoreInspectorStateFromCookie(const String& inspectorStateString)
+{
+ RefPtr<InspectorValue> inspectorStateValue = InspectorValue::parseJSON(inspectorStateString);
+ if (!inspectorStateValue)
+ return;
+
+ RefPtr<InspectorObject> inspectorState = inspectorStateValue->asObject();
+ if (!inspectorState)
+ return;
+
+ inspectorState->getBoolean(monitoringXHRStateName, &m_monitoringXHR);
+ inspectorState->getBoolean(resourceTrackingEnabledStateName, &m_resourceTrackingEnabled);
+
+ bool timelineProfilerEnabled = false;
+ inspectorState->getBoolean(timelineProfilerEnabledStateName, &timelineProfilerEnabled);
+ if (timelineProfilerEnabled)
+ startTimelineProfiler();
+ else
+ stopTimelineProfiler();
+}
+
void InspectorController::getSettings(RefPtr<InspectorObject>* settings)
{
*settings = InspectorObject::create();
- (*settings)->setString("application", setting(frontendSettingsSettingName()));
+ (*settings)->setString("application", setting(frontendSettingsSettingName));
(*settings)->setString("session", m_sessionSettings->toJSONString());
}
@@ -460,18 +500,14 @@ void InspectorController::setSearchingForNode(bool enabled)
}
}
-void InspectorController::setMonitoringXHR(bool enabled)
+void InspectorController::setMonitoringXHREnabled(bool enabled, bool* newState)
{
+ *newState = enabled;
if (m_monitoringXHR == enabled)
return;
m_monitoringXHR = enabled;
setSetting(monitoringXHRSettingName, enabled ? "true" : "false");
- if (m_frontend) {
- if (enabled)
- m_frontend->monitoringXHRWasEnabled();
- else
- m_frontend->monitoringXHRWasDisabled();
- }
+ updateInspectorStateCookie();
}
void InspectorController::connectFrontend()
@@ -500,6 +536,13 @@ void InspectorController::connectFrontend()
connectedFrontendCount++;
}
+void InspectorController::reuseFrontend()
+{
+ connectFrontend();
+ restoreDebugger();
+ restoreProfiler();
+}
+
void InspectorController::show()
{
if (!enabled())
@@ -604,18 +647,12 @@ void InspectorController::populateScriptObjects()
if (m_showAfterVisible == lastActivePanel)
m_showAfterVisible = setting(lastActivePanel);
- if (m_nodeToFocus)
- focusNode();
- showPanel(m_showAfterVisible);
- if (m_resourceTrackingEnabled)
- m_frontend->resourceTrackingWasEnabled();
+ showPanel(m_showAfterVisible);
if (m_searchingForNode)
m_frontend->searchingForNodeWasEnabled();
- if (m_monitoringXHR)
- m_frontend->monitoringXHRWasEnabled();
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (m_profilerAgent->enabled())
@@ -628,6 +665,9 @@ void InspectorController::populateScriptObjects()
m_domAgent->setDocument(m_inspectedPage->mainFrame()->document());
+ if (m_nodeToFocus)
+ focusNode();
+
if (m_expiredConsoleMessageCount)
m_frontend->updateConsoleMessageExpiredCount(m_expiredConsoleMessageCount);
unsigned messageCount = m_consoleMessages.size();
@@ -661,17 +701,31 @@ void InspectorController::populateScriptObjects()
m_frontend->evaluateForTestInFrontend((*it).first, (*it).second);
m_pendingEvaluateTestCommands.clear();
+ restoreDebugger();
+ restoreProfiler();
+}
+
+void InspectorController::restoreDebugger()
+{
+ ASSERT(m_frontend);
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (InspectorDebuggerAgent::isDebuggerAlwaysEnabled())
enableDebuggerFromFrontend(false);
else {
- String debuggerEnabled = setting(debuggerEnabledSettingName);
+ String debuggerEnabled = setting(debuggerAlwaysEnabledSettingName);
if (debuggerEnabled == "true" || m_attachDebuggerWhenShown)
enableDebugger();
}
+#endif
+}
+
+void InspectorController::restoreProfiler()
+{
+ ASSERT(m_frontend);
+#if ENABLE(JAVASCRIPT_DEBUGGER)
m_profilerAgent->setFrontend(m_frontend.get());
if (!ScriptProfiler::isProfilerAlwaysEnabled()) {
- String profilerEnabledSetting = setting(profilerEnabledSettingName);
+ String profilerEnabledSetting = setting(profilerAlwaysEnabledSettingName);
if (profilerEnabledSetting == "true")
enableProfiler();
}
@@ -798,6 +852,8 @@ void InspectorController::addResource(InspectorResource* resource)
m_knownResources.add(resource->requestURL());
Frame* frame = resource->frame();
+ if (!frame)
+ return;
ResourcesMap* resourceMap = m_frameResources.get(frame);
if (resourceMap)
resourceMap->set(resource->identifier(), resource);
@@ -816,6 +872,8 @@ void InspectorController::removeResource(InspectorResource* resource)
m_knownResources.remove(requestURL);
Frame* frame = resource->frame();
+ if (!frame)
+ return;
ResourcesMap* resourceMap = m_frameResources.get(frame);
if (!resourceMap) {
ASSERT_NOT_REACHED();
@@ -957,7 +1015,7 @@ void InspectorController::willSendRequest(unsigned long identifier, ResourceRequ
// Redirect may have empty URL and we'd like to not crash with invalid HashMap entry.
// See http/tests/misc/will-send-request-returns-null-on-redirect.html
if (!request.url().isEmpty()) {
- resource->endTiming();
+ resource->endTiming(0);
resource->updateResponse(redirectResponse);
// We always store last redirect by the original id key. Rest of the redirects are stored within the last one.
@@ -980,6 +1038,15 @@ void InspectorController::willSendRequest(unsigned long identifier, ResourceRequ
resource->updateScriptObject(m_frontend.get());
}
+void InspectorController::markResourceAsCached(unsigned long identifier)
+{
+ if (!enabled())
+ return;
+
+ if (RefPtr<InspectorResource> resource = getTrackedResource(identifier))
+ resource->markAsCached();
+}
+
void InspectorController::didReceiveResponse(unsigned long identifier, const ResourceResponse& response)
{
if (!enabled())
@@ -1014,7 +1081,7 @@ void InspectorController::didReceiveContentLength(unsigned long identifier, int
resource->updateScriptObject(m_frontend.get());
}
-void InspectorController::didFinishLoading(unsigned long identifier)
+void InspectorController::didFinishLoading(unsigned long identifier, double finishTime)
{
if (!enabled())
return;
@@ -1026,7 +1093,7 @@ void InspectorController::didFinishLoading(unsigned long identifier)
if (!resource)
return;
- resource->endTiming();
+ resource->endTiming(finishTime);
// No need to mute this event for main resource since it happens after did commit load.
if (m_frontend)
@@ -1051,7 +1118,7 @@ void InspectorController::didFailLoading(unsigned long identifier, const Resourc
return;
resource->markFailed();
- resource->endTiming();
+ resource->endTiming(0);
// No need to mute this event for main resource since it happens after did commit load.
if (m_frontend)
@@ -1094,40 +1161,33 @@ void InspectorController::scriptImported(unsigned long identifier, const String&
resource->updateScriptObject(m_frontend.get());
}
-void InspectorController::enableResourceTracking(bool always, bool reload)
+void InspectorController::setResourceTrackingEnabled(bool enable)
{
if (!enabled())
return;
- if (always)
- setSetting(resourceTrackingEnabledSettingName, "true");
-
- if (m_resourceTrackingEnabled)
- return;
-
ASSERT(m_inspectedPage);
- m_resourceTrackingEnabled = true;
- if (m_frontend)
- m_frontend->resourceTrackingWasEnabled();
- m_client->resourceTrackingWasEnabled();
-
- if (reload)
- m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true);
+ m_resourceTrackingEnabled = enable;
+ updateInspectorStateCookie();
}
-void InspectorController::disableResourceTracking(bool always)
+void InspectorController::setResourceTrackingEnabled(bool enable, bool always, bool* newState)
{
- if (!enabled())
- return;
+ *newState = enable;
if (always)
- setSetting(resourceTrackingEnabledSettingName, "false");
+ setSetting(resourceTrackingAlwaysEnabledSettingName, enable ? "true" : "false");
+
+ if (m_resourceTrackingEnabled == enable)
+ return;
ASSERT(m_inspectedPage);
- m_resourceTrackingEnabled = false;
- if (m_frontend)
- m_frontend->resourceTrackingWasDisabled();
- m_client->resourceTrackingWasDisabled();
+ m_resourceTrackingEnabled = enable;
+
+ if (enable)
+ m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true);
+
+ updateInspectorStateCookie();
}
void InspectorController::ensureSettingsLoaded()
@@ -1136,14 +1196,15 @@ void InspectorController::ensureSettingsLoaded()
return;
m_settingsLoaded = true;
- String resourceTracking = setting(resourceTrackingEnabledSettingName);
- if (resourceTracking == "true")
+ String resourceTrackingAlwaysEnabled = setting(resourceTrackingAlwaysEnabledSettingName);
+ if (resourceTrackingAlwaysEnabled == "true")
m_resourceTrackingEnabled = true;
- m_client->resourceTrackingWasEnabled();
- String monitoringXHR = setting(monitoringXHRSettingName);
- if (monitoringXHR == "true")
+ String monitoringXHRAlwaysEnabled = setting(monitoringXHRSettingName);
+ if (monitoringXHRAlwaysEnabled == "true")
m_monitoringXHR = true;
+
+ updateInspectorStateCookie();
}
void InspectorController::startTimelineProfiler()
@@ -1157,7 +1218,8 @@ void InspectorController::startTimelineProfiler()
m_timelineAgent = new InspectorTimelineAgent(m_frontend.get());
if (m_frontend)
m_frontend->timelineProfilerWasStarted();
- m_client->timelineProfilerWasStarted();
+
+ updateInspectorStateCookie();
}
void InspectorController::stopTimelineProfiler()
@@ -1171,7 +1233,8 @@ void InspectorController::stopTimelineProfiler()
m_timelineAgent = 0;
if (m_frontend)
m_frontend->timelineProfilerWasStopped();
- m_client->timelineProfilerWasStopped();
+
+ updateInspectorStateCookie();
}
#if ENABLE(WORKERS)
@@ -1442,6 +1505,56 @@ InspectorDOMStorageResource* InspectorController::getDOMStorageResourceForId(lon
}
#endif
+#if ENABLE(WEB_SOCKETS)
+void InspectorController::didCreateWebSocket(unsigned long identifier, const KURL& requestURL, const KURL& documentURL)
+{
+ if (!enabled())
+ return;
+ ASSERT(m_inspectedPage);
+
+ RefPtr<InspectorResource> resource = InspectorResource::createWebSocket(identifier, requestURL, documentURL);
+ addResource(resource.get());
+
+ if (m_frontend)
+ resource->updateScriptObject(m_frontend.get());
+}
+
+void InspectorController::willSendWebSocketHandshakeRequest(unsigned long identifier, const WebSocketHandshakeRequest& request)
+{
+ RefPtr<InspectorResource> resource = getTrackedResource(identifier);
+ if (!resource)
+ return;
+ resource->startTiming();
+ resource->updateWebSocketRequest(request);
+ if (m_frontend)
+ resource->updateScriptObject(m_frontend.get());
+}
+
+void InspectorController::didReceiveWebSocketHandshakeResponse(unsigned long identifier, const WebSocketHandshakeResponse& response)
+{
+ RefPtr<InspectorResource> resource = getTrackedResource(identifier);
+ if (!resource)
+ return;
+ // Calling resource->markResponseReceivedTime() here makes resources bar chart confusing, because
+ // we cannot apply the "latency + download" model of regular resources to WebSocket connections.
+ // FIXME: Design a new UI for bar charts of WebSocket resources, and record timing here.
+ resource->updateWebSocketResponse(response);
+ if (m_frontend)
+ resource->updateScriptObject(m_frontend.get());
+}
+
+void InspectorController::didCloseWebSocket(unsigned long identifier)
+{
+ RefPtr<InspectorResource> resource = getTrackedResource(identifier);
+ if (!resource)
+ return;
+
+ resource->endTiming(0);
+ if (m_frontend)
+ resource->updateScriptObject(m_frontend.get());
+}
+#endif // ENABLE(WEB_SOCKETS)
+
#if ENABLE(JAVASCRIPT_DEBUGGER)
void InspectorController::addProfile(PassRefPtr<ScriptProfile> prpProfile, unsigned lineNumber, const String& sourceURL)
{
@@ -1493,14 +1606,14 @@ bool InspectorController::profilerEnabled() const
void InspectorController::enableProfiler(bool always, bool skipRecompile)
{
if (always)
- setSetting(profilerEnabledSettingName, "true");
+ setSetting(profilerAlwaysEnabledSettingName, "true");
m_profilerAgent->enable(skipRecompile);
}
void InspectorController::disableProfiler(bool always)
{
if (always)
- setSetting(profilerEnabledSettingName, "false");
+ setSetting(profilerAlwaysEnabledSettingName, "false");
m_profilerAgent->disable();
}
#endif
@@ -1510,7 +1623,7 @@ void InspectorController::enableDebuggerFromFrontend(bool always)
{
ASSERT(!debuggerEnabled());
if (always)
- setSetting(debuggerEnabledSettingName, "true");
+ setSetting(debuggerAlwaysEnabledSettingName, "true");
ASSERT(m_inspectedPage);
@@ -1541,7 +1654,7 @@ void InspectorController::disableDebugger(bool always)
return;
if (always)
- setSetting(debuggerEnabledSettingName, "false");
+ setSetting(debuggerAlwaysEnabledSettingName, "false");
ASSERT(m_inspectedPage);
@@ -1558,7 +1671,6 @@ void InspectorController::resume()
if (m_debuggerAgent)
m_debuggerAgent->resume();
}
-// JavaScriptDebugListener functions
#endif
@@ -1585,6 +1697,8 @@ void InspectorController::didEvaluateForTestInFrontend(long callId, const String
String InspectorController::breakpointsSettingKey()
{
DEFINE_STATIC_LOCAL(String, keyPrefix, ("breakpoints:"));
+ if (!m_mainResource)
+ return "";
return keyPrefix + InspectorDebuggerAgent::md5Base16(m_mainResource->requestURL());
}
@@ -1744,6 +1858,84 @@ void InspectorController::drawNodeHighlight(GraphicsContext& context) const
drawHighlightForLineBoxesOrSVGRenderer(context, lineBoxQuads);
}
+
+ // Draw node title if necessary.
+
+ if (!m_highlightedNode->isElementNode())
+ return;
+
+ WebCore::Settings* settings = containingFrame->settings();
+ drawElementTitle(context, boundingBox, overlayRect, settings);
+}
+
+void InspectorController::drawElementTitle(GraphicsContext& context, const IntRect& boundingBox, const FloatRect& overlayRect, WebCore::Settings* settings) const
+{
+ static const int rectInflatePx = 4;
+ static const int fontHeightPx = 12;
+ static const int borderWidthPx = 1;
+ static const Color tooltipBackgroundColor(255, 255, 194, 255);
+ static const Color tooltipBorderColor(Color::black);
+ static const Color tooltipFontColor(Color::black);
+
+ Element* element = static_cast<Element*>(m_highlightedNode.get());
+ bool isXHTML = element->document()->isXHTMLDocument();
+ String nodeTitle = isXHTML ? element->nodeName() : element->nodeName().lower();
+ const AtomicString& idValue = element->getIdAttribute();
+ if (!idValue.isNull() && !idValue.isEmpty()) {
+ nodeTitle += "#";
+ nodeTitle += idValue;
+ }
+ if (element->hasClass() && element->isStyledElement()) {
+ const SpaceSplitString& classNamesString = static_cast<StyledElement*>(element)->classNames();
+ size_t classNameCount = classNamesString.size();
+ if (classNameCount) {
+ HashSet<AtomicString> usedClassNames;
+ for (size_t i = 0; i < classNameCount; ++i) {
+ const AtomicString& className = classNamesString[i];
+ if (usedClassNames.contains(className))
+ continue;
+ usedClassNames.add(className);
+ nodeTitle += ".";
+ nodeTitle += className;
+ }
+ }
+ }
+ nodeTitle += " [";
+ nodeTitle += String::number(boundingBox.width());
+ nodeTitle.append(static_cast<UChar>(0x00D7)); // &times;
+ nodeTitle += String::number(boundingBox.height());
+ nodeTitle += "]";
+
+ FontDescription desc;
+ FontFamily family;
+ family.setFamily(settings->fixedFontFamily());
+ desc.setFamily(family);
+ desc.setComputedSize(fontHeightPx);
+ Font font = Font(desc, 0, 0);
+ font.update(0);
+
+ TextRun nodeTitleRun(nodeTitle);
+ IntPoint titleBasePoint = boundingBox.bottomLeft();
+ titleBasePoint.move(rectInflatePx, rectInflatePx);
+ IntRect titleRect = enclosingIntRect(font.selectionRectForText(nodeTitleRun, titleBasePoint, fontHeightPx));
+ titleRect.inflate(rectInflatePx);
+
+ // The initial offsets needed to compensate for a 1px-thick border stroke (which is not a part of the rectangle).
+ int dx = -borderWidthPx;
+ int dy = borderWidthPx;
+ if (titleRect.right() > overlayRect.right())
+ dx += overlayRect.right() - titleRect.right();
+ if (titleRect.x() + dx < overlayRect.x())
+ dx = overlayRect.x() - titleRect.x();
+ if (titleRect.bottom() > overlayRect.bottom())
+ dy += overlayRect.bottom() - titleRect.bottom() - borderWidthPx;
+ titleRect.move(dx, dy);
+ context.setStrokeColor(tooltipBorderColor, DeviceColorSpace);
+ context.setStrokeThickness(borderWidthPx);
+ context.setFillColor(tooltipBackgroundColor, DeviceColorSpace);
+ context.drawRect(titleRect);
+ context.setFillColor(tooltipFontColor, DeviceColorSpace);
+ context.drawText(font, nodeTitleRun, IntPoint(titleRect.x() + rectInflatePx, titleRect.y() + font.height()));
}
void InspectorController::openInInspectedWindow(const String& url)
@@ -1840,6 +2032,49 @@ void InspectorController::getResourceContent(unsigned long identifier, String* c
*content = resource ? resource->sourceString() : String();
}
+bool InspectorController::resourceContentForURL(const KURL& url, Document* frameDocument, String* result)
+{
+ if (!frameDocument)
+ return false;
+
+ String textEncodingName;
+ RefPtr<SharedBuffer> buffer;
+ if (equalIgnoringFragmentIdentifier(url, frameDocument->frame()->loader()->documentLoader()->requestURL())) {
+ textEncodingName = frameDocument->inputEncoding();
+ buffer = frameDocument->frame()->loader()->provisionalDocumentLoader()->mainResourceData();
+ } else {
+ const String& urlString = url.string();
+ CachedResource* cachedResource = frameDocument->cachedResourceLoader()->cachedResource(urlString);
+ if (!cachedResource)
+ cachedResource = cache()->resourceForURL(urlString);
+
+ ASSERT(cachedResource); // FIXME(apavlov): This might be too aggressive.
+
+ bool isUnpurgeable = true;
+ if (cachedResource->isPurgeable()) {
+ // If the resource is purgeable then make it unpurgeable to get
+ // its data. This might fail, in which case we return an
+ // empty String.
+ if (!cachedResource->makePurgeable(false))
+ isUnpurgeable = false;
+ }
+ if (isUnpurgeable) {
+ textEncodingName = cachedResource->encoding();
+ buffer = cachedResource->data();
+ }
+ }
+
+ if (buffer) {
+ TextEncoding encoding(textEncodingName);
+ if (!encoding.isValid())
+ encoding = WindowsLatin1Encoding();
+ *result = encoding.decode(buffer->data(), buffer->size());
+ return true;
+ }
+
+ return false;
+}
+
void InspectorController::reloadPage()
{
m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true);
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 40099c6..6752044 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -50,6 +50,7 @@ class Database;
class Document;
class DocumentLoader;
class Element;
+class FloatRect;
class GraphicsContext;
class HitTestResult;
class InjectedScript;
@@ -72,6 +73,7 @@ class InspectorStorageAgent;
class InspectorTimelineAgent;
class InspectorValue;
class InspectorWorkerResource;
+class IntRect;
class KURL;
class Node;
class Page;
@@ -89,6 +91,11 @@ class StorageArea;
class InspectorApplicationCacheAgent;
#endif
+#if ENABLE(WEB_SOCKETS)
+class WebSocketHandshakeRequest;
+class WebSocketHandshakeResponse;
+#endif
+
class InspectorController : public Noncopyable {
public:
typedef HashMap<unsigned long, RefPtr<InspectorResource> > ResourcesMap;
@@ -122,6 +129,8 @@ public:
void saveSessionSettings(const String&);
void getSettings(RefPtr<InspectorObject>*);
+ void restoreInspectorStateFromCookie(const String& inspectorState);
+
void inspect(Node*);
void highlight(Node*);
void hideHighlight();
@@ -136,6 +145,7 @@ public:
// transport via InspectorClient. After migration, webInspector parameter should
// be removed.
void connectFrontend();
+ void reuseFrontend();
void disconnectFrontend();
void addMessageToConsole(MessageSource, MessageType, MessageLevel, ScriptCallStack*, const String& message);
@@ -158,15 +168,16 @@ public:
void identifierForInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&);
void willSendRequest(unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse);
+ void markResourceAsCached(unsigned long identifier);
void didReceiveResponse(unsigned long identifier, const ResourceResponse&);
void didReceiveContentLength(unsigned long identifier, int lengthReceived);
- void didFinishLoading(unsigned long identifier);
+ void didFinishLoading(unsigned long identifier, double finishTime);
void didFailLoading(unsigned long identifier, const ResourceError&);
void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
void scriptImported(unsigned long identifier, const String& sourceString);
- void enableResourceTracking(bool always = false, bool reload = true);
- void disableResourceTracking(bool always = false);
+ void setResourceTrackingEnabled(bool enabled);
+ void setResourceTrackingEnabled(bool enabled, bool always, bool* newState);
bool resourceTrackingEnabled() const { return m_resourceTrackingEnabled; }
void ensureSettingsLoaded();
@@ -209,13 +220,21 @@ public:
void setDOMStorageItem(long storageId, const String& key, const String& value, bool* success);
void removeDOMStorageItem(long storageId, const String& key, bool* success);
#endif
+#if ENABLE(WEB_SOCKETS)
+ void didCreateWebSocket(unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
+ void willSendWebSocketHandshakeRequest(unsigned long identifier, const WebSocketHandshakeRequest&);
+ void didReceiveWebSocketHandshakeResponse(unsigned long identifier, const WebSocketHandshakeResponse&);
+ void didCloseWebSocket(unsigned long identifier);
+#endif
const ResourcesMap& resources() const { return m_resources; }
InspectorResource* resourceForURL(const String& url);
+ bool resourceContentForURL(const KURL& url, Document* loaderDocument, String* result);
bool hasFrontend() const { return m_frontend; }
void drawNodeHighlight(GraphicsContext&) const;
void openInInspectedWindow(const String& url);
+ void drawElementTitle(GraphicsContext&, const IntRect& boundingBox, const FloatRect& overlayRect, WebCore::Settings*) const;
void count(const String& title, unsigned lineNumber, const String& sourceID);
@@ -258,13 +277,16 @@ public:
static const String& inspectorStartsAttachedSettingName();
private:
- static const String& frontendSettingsSettingName();
+ void updateInspectorStateCookie();
+ void getInspectorState(RefPtr<InspectorObject>* state);
friend class InspectorBackend;
friend class InspectorBackendDispatcher;
friend class InjectedScriptHost;
void populateScriptObjects();
+ void restoreDebugger();
+ void restoreProfiler();
void unbindAllResources();
// Following are used from InspectorBackend and internally.
@@ -272,9 +294,7 @@ private:
void enableSearchingForNode() { setSearchingForNode(true); }
void disableSearchingForNode() { setSearchingForNode(false); }
- void setMonitoringXHR(bool enabled);
- void enableMonitoringXHR() { setMonitoringXHR(true); }
- void disableMonitoringXHR() { setMonitoringXHR(false); }
+ void setMonitoringXHREnabled(bool enabled, bool* newState);
void storeLastActivePanel(const String& panelName);
InspectorDOMAgent* domAgent() { return m_domAgent.get(); }
void releaseFrontendLifetimeAgents();
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index 23c22aa..f1df5b0 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -37,6 +37,7 @@
#include "CSSComputedStyleDeclaration.h"
#include "CSSMutableStyleDeclaration.h"
#include "CSSPropertyNames.h"
+#include "CSSPropertySourceData.h"
#include "CSSRule.h"
#include "CSSRuleList.h"
#include "CSSStyleRule.h"
@@ -707,7 +708,7 @@ void InspectorDOMAgent::performSearch(const String& whitespaceTrimmedQuery, bool
m_pendingMatchJobs.append(new MatchPlainTextJob(document, escapedQuery));
continue;
}
-
+
m_pendingMatchJobs.append(new MatchExactIdJob(document, whitespaceTrimmedQuery));
m_pendingMatchJobs.append(new MatchExactClassNamesJob(document, whitespaceTrimmedQuery));
m_pendingMatchJobs.append(new MatchExactTagNamesJob(document, tagNameQuery));
@@ -776,38 +777,70 @@ void InspectorDOMAgent::removeDOMBreakpoint(long nodeId, long type)
bool InspectorDOMAgent::shouldBreakOnNodeInsertion(Node*, Node* parent, PassRefPtr<InspectorValue>* details)
{
- if (!hasBreakpoint(parent, SubtreeModified))
- return false;
- RefPtr<InspectorObject> detailsObject = InspectorObject::create();
- detailsObject->setObject("breakpoint", createBreakpoint(parent, SubtreeModified));
- *details = detailsObject;
- return true;
+ if (hasBreakpoint(parent, SubtreeModified)) {
+ *details = descriptionForDOMEvent(parent, SubtreeModified, true);
+ return true;
+ }
+ return false;
}
bool InspectorDOMAgent::shouldBreakOnNodeRemoval(Node* node, PassRefPtr<InspectorValue>* details)
{
- bool hasNodeRemovedBreakpoint = hasBreakpoint(node, NodeRemoved);
- bool hasAnyBreakpoint = hasNodeRemovedBreakpoint || hasBreakpoint(innerParentNode(node), SubtreeModified);
- if (!hasAnyBreakpoint)
- return false;
-
- RefPtr<InspectorObject> detailsObject = InspectorObject::create();
- if (hasNodeRemovedBreakpoint)
- detailsObject->setObject("breakpoint", createBreakpoint(node, NodeRemoved));
- else
- detailsObject->setObject("breakpoint", createBreakpoint(innerParentNode(node), SubtreeModified));
- *details = detailsObject;
- return true;
+ if (hasBreakpoint(node, NodeRemoved)) {
+ *details = descriptionForDOMEvent(node, NodeRemoved, false);
+ return true;
+ }
+ if (hasBreakpoint(innerParentNode(node), SubtreeModified)) {
+ *details = descriptionForDOMEvent(node, SubtreeModified, false);
+ return true;
+ }
+ return false;
}
bool InspectorDOMAgent::shouldBreakOnAttributeModification(Element* element, PassRefPtr<InspectorValue>* details)
{
- if (!hasBreakpoint(element, AttributeModified))
- return false;
- RefPtr<InspectorObject> detailsObject = InspectorObject::create();
- detailsObject->setObject("breakpoint", createBreakpoint(element, AttributeModified));
- *details = detailsObject;
- return true;
+ if (hasBreakpoint(element, AttributeModified)) {
+ *details = descriptionForDOMEvent(element, AttributeModified, false);
+ return true;
+ }
+ return false;
+}
+
+PassRefPtr<InspectorValue> InspectorDOMAgent::descriptionForDOMEvent(Node* target, long breakpointType, bool insertion)
+{
+ ASSERT(hasBreakpoint(target, breakpointType));
+
+ RefPtr<InspectorObject> description = InspectorObject::create();
+ Node* breakpointOwner = target;
+ if ((1 << breakpointType) & inheritableDOMBreakpointTypesMask) {
+ // For inheritable breakpoint types, target node isn't always the same as the node that owns a breakpoint.
+ // Target node may be unknown to frontend, so we need to push it first.
+ long targetNodeId = pushNodePathToFrontend(target);
+ ASSERT(targetNodeId);
+ description->setNumber("targetNodeId", targetNodeId);
+
+ // Find breakpoint owner node.
+ if (!insertion)
+ breakpointOwner = innerParentNode(target);
+ ASSERT(breakpointOwner);
+ while (!(m_breakpoints.get(breakpointOwner) & (1 << breakpointType))) {
+ breakpointOwner = innerParentNode(breakpointOwner);
+ ASSERT(breakpointOwner);
+ }
+
+ if (breakpointType == SubtreeModified)
+ description->setBoolean("insertion", insertion);
+ }
+
+ long breakpointOwnerNodeId = m_documentNodeToIdMap.get(breakpointOwner);
+ ASSERT(breakpointOwnerNodeId);
+
+ RefPtr<InspectorObject> breakpoint = InspectorObject::create();
+ breakpoint->setNumber("nodeId", breakpointOwnerNodeId);
+ breakpoint->setNumber("type", breakpointType);
+ description->setObject("breakpoint", breakpoint);
+
+ return description;
}
String InspectorDOMAgent::documentURLString(Document* document) const
@@ -1087,23 +1120,6 @@ void InspectorDOMAgent::didModifyDOMAttr(Element* element)
m_frontend->attributesUpdated(id, buildArrayForElementAttributes(element));
}
-PassRefPtr<InspectorObject> InspectorDOMAgent::createBreakpoint(Node* node, long type)
-{
- RefPtr<InspectorObject> breakpoint = InspectorObject::create();
-
- // Find breakpoint owner.
- while (!(m_breakpoints.get(node) & (1 << type))) {
- node = innerParentNode(node);
- ASSERT(node);
- }
- long nodeId = m_documentNodeToIdMap.get(node);
- ASSERT(nodeId);
-
- breakpoint->setNumber("nodeId", nodeId);
- breakpoint->setNumber("type", type);
- return breakpoint.release();
-}
-
bool InspectorDOMAgent::hasBreakpoint(Node* node, long type)
{
uint32_t rootBit = 1 << type;
@@ -1148,7 +1164,7 @@ void InspectorDOMAgent::getStyles(long nodeId, bool authorOnly, RefPtr<Inspector
result->setObject("computedStyle", buildObjectForStyle(computedStyleInfo.get(), false));
CSSStyleSelector* selector = element->ownerDocument()->styleSelector();
- RefPtr<CSSRuleList> matchedRules = selector->styleRulesForElement(element, authorOnly);
+ RefPtr<CSSRuleList> matchedRules = selector->styleRulesForElement(element, authorOnly, true);
result->setArray("matchedCSSRules", buildArrayForCSSRules(node->ownerDocument(), matchedRules.get()));
result->setObject("styleAttributes", buildObjectForAttributeStyles(element));
@@ -1163,7 +1179,7 @@ void InspectorDOMAgent::getStyles(long nodeId, bool authorOnly, RefPtr<Inspector
parentStyle->setObject("inlineStyle", buildObjectForStyle(parentElement->style(), true));
CSSStyleSelector* parentSelector = parentElement->ownerDocument()->styleSelector();
- RefPtr<CSSRuleList> parentMatchedRules = parentSelector->styleRulesForElement(parentElement, authorOnly);
+ RefPtr<CSSRuleList> parentMatchedRules = parentSelector->styleRulesForElement(parentElement, authorOnly, true);
parentStyle->setArray("matchedCSSRules", buildArrayForCSSRules(parentElement->ownerDocument(), parentMatchedRules.get()));
parentElement = parentElement->parentElement();
@@ -1191,26 +1207,34 @@ void InspectorDOMAgent::getStyleSheet(long styleSheetId, RefPtr<InspectorObject>
*styleSheetObject = buildObjectForStyleSheet(styleSheet->document(), styleSheet);
}
-void InspectorDOMAgent::getRuleRanges(long styleSheetId, RefPtr<InspectorValue>* ruleRange)
+void InspectorDOMAgent::getStyleSourceData(long styleId, RefPtr<InspectorObject>* dataObject)
{
- CSSStyleSheet* styleSheet = cssStore()->styleSheetForId(styleSheetId);
- if (styleSheet && styleSheet->document()) {
- HashMap<long, SourceRange> ruleRanges = cssStore()->getRuleRanges(styleSheet);
- if (!ruleRanges.size())
- return;
- RefPtr<InspectorObject> result = InspectorObject::create();
- for (HashMap<long, SourceRange>::iterator it = ruleRanges.begin(); it != ruleRanges.end(); ++it) {
- if (it->second.second) {
- RefPtr<InspectorObject> ruleRange = InspectorObject::create();
- result->setObject(String::number(it->first).utf8().data(), ruleRange);
- RefPtr<InspectorObject> bodyRange = InspectorObject::create();
- ruleRange->setObject("bodyRange", bodyRange);
- bodyRange->setNumber("start", it->second.first);
- bodyRange->setNumber("end", it->second.second);
- }
- }
- *ruleRange = result.release();
+ CSSStyleDeclaration* style = cssStore()->styleForId(styleId);
+ if (!style)
+ return;
+ RefPtr<CSSStyleSourceData> sourceData = CSSStyleSourceData::create();
+ bool success = cssStore()->getStyleSourceData(style, &sourceData);
+ if (!success)
+ return;
+ RefPtr<InspectorObject> result = InspectorObject::create();
+ RefPtr<InspectorObject> bodyRange = InspectorObject::create();
+ result->setObject("bodyRange", bodyRange);
+ bodyRange->setNumber("start", sourceData->styleBodyRange.start);
+ bodyRange->setNumber("end", sourceData->styleBodyRange.end);
+ RefPtr<InspectorArray> propertyRanges = InspectorArray::create();
+ result->setArray("propertyData", propertyRanges);
+ Vector<CSSPropertySourceData>& propertyData = sourceData->propertyData;
+ for (Vector<CSSPropertySourceData>::iterator it = propertyData.begin(); it != propertyData.end(); ++it) {
+ RefPtr<InspectorObject> propertyRange = InspectorObject::create();
+ propertyRange->setString("name", it->name);
+ propertyRange->setString("value", it->value);
+ propertyRange->setBoolean("important", it->important);
+ propertyRange->setBoolean("parsed", it->parsedOk);
+ propertyRange->setNumber("start", it->range.start);
+ propertyRange->setNumber("end", it->range.end);
+ propertyRanges->pushObject(propertyRange);
}
+ *dataObject = result.release();
}
void InspectorDOMAgent::getInlineStyle(long nodeId, RefPtr<InspectorValue>* style)
@@ -1267,7 +1291,7 @@ PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForPseudoElements(Elemen
RefPtr<RenderStyle> renderStyle = element->styleForRenderer();
for (PseudoId pseudoId = FIRST_PUBLIC_PSEUDOID; pseudoId < AFTER_LAST_INTERNAL_PSEUDOID; pseudoId = static_cast<PseudoId>(pseudoId + 1)) {
- RefPtr<CSSRuleList> matchedRules = selector->pseudoStyleRulesForElement(element, pseudoId, authorOnly);
+ RefPtr<CSSRuleList> matchedRules = selector->pseudoStyleRulesForElement(element, pseudoId, authorOnly, true);
if (matchedRules && matchedRules->length()) {
RefPtr<InspectorObject> pseudoStyles = InspectorObject::create();
pseudoStyles->setNumber("pseudoId", static_cast<int>(pseudoId));
@@ -1469,7 +1493,7 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForStyle(CSSStyleDecla
if (bind) {
long styleId = cssStore()->bindStyle(style);
result->setNumber("id", styleId);
- CSSStyleSheet* parentStyleSheet = getParentStyleSheet(style);
+ CSSStyleSheet* parentStyleSheet = InspectorCSSStore::getParentStyleSheet(style);
if (parentStyleSheet)
result->setNumber("parentStyleSheetId", cssStore()->bindStyleSheet(parentStyleSheet));
@@ -1681,20 +1705,6 @@ PassRefPtr<InspectorArray> InspectorDOMAgent::toArray(const Vector<String>& data
return result.release();
}
-CSSStyleSheet* InspectorDOMAgent::getParentStyleSheet(CSSStyleDeclaration* style)
-{
- CSSStyleSheet* parentStyleSheet = style->parentRule() ? style->parentRule()->parentStyleSheet() : 0;
- if (!parentStyleSheet) {
- StyleBase* parent = style->parent();
- if (parent && parent->isCSSStyleSheet()) {
- parentStyleSheet = static_cast<CSSStyleSheet*>(parent);
- if (!parentStyleSheet->length())
- return 0;
- }
- }
- return parentStyleSheet;
-}
-
void InspectorDOMAgent::onMatchJobsTimer(Timer<InspectorDOMAgent>*)
{
if (!m_pendingMatchJobs.size()) {
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index 9751e8e..7d86997 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -123,7 +123,7 @@ namespace WebCore {
void getInlineStyle(long nodeId, RefPtr<InspectorValue>* styles);
void getComputedStyle(long nodeId, RefPtr<InspectorValue>* styles);
void getStyleSheet(long styleSheetId, RefPtr<InspectorObject>* styleSheetObject);
- void getRuleRanges(long styleSheetId, RefPtr<InspectorValue>* ruleRange);
+ void getStyleSourceData(long styleId, RefPtr<InspectorObject>* dataObject);
void applyStyleText(long styleId, const String& styleText, const String& propertyName, bool* success, RefPtr<InspectorValue>* styleObject, RefPtr<InspectorArray>* changedProperties);
void setStyleText(long styleId, const String& cssText, bool* success);
void setStyleProperty(long styleId, const String& name, const String& value, bool* success);
@@ -148,7 +148,6 @@ namespace WebCore {
void copyNode(long nodeId);
private:
- static CSSStyleSheet* getParentStyleSheet(CSSStyleDeclaration*);
void startListening(Document* document);
void stopListening(Document* document);
@@ -162,8 +161,8 @@ namespace WebCore {
bool pushDocumentToFrontend();
bool hasBreakpoint(Node* node, long type);
- PassRefPtr<InspectorObject> createBreakpoint(Node* node, long type);
void updateSubtreeBreakpoints(Node* root, uint32_t rootMask, bool value);
+ PassRefPtr<InspectorValue> descriptionForDOMEvent(Node* target, long breakpointType, bool insertion);
PassRefPtr<InspectorObject> buildObjectForAttributeStyles(Element* element);
PassRefPtr<InspectorArray> buildArrayForCSSRules(Document* ownerDocument, CSSRuleList*);
diff --git a/WebCore/inspector/InspectorDebuggerAgent.cpp b/WebCore/inspector/InspectorDebuggerAgent.cpp
index fd9fdf3..3875be0 100644
--- a/WebCore/inspector/InspectorDebuggerAgent.cpp
+++ b/WebCore/inspector/InspectorDebuggerAgent.cpp
@@ -38,6 +38,7 @@
#include "PlatformString.h"
#include "ScriptDebugServer.h"
#include <wtf/MD5.h>
+#include <wtf/text/CString.h>
namespace WebCore {
@@ -292,7 +293,7 @@ void InspectorDebuggerAgent::didPause(ScriptState* scriptState)
m_pausedScriptState = scriptState;
RefPtr<InspectorObject> details = InspectorObject::create();
details->setValue("callFrames", currentCallFrames());
- details->setValue("reason", m_breakProgramReason);
+ details->setValue("status", m_breakProgramReason);
m_frontend->pausedScript(details);
}
diff --git a/WebCore/inspector/InspectorProfilerAgent.cpp b/WebCore/inspector/InspectorProfilerAgent.cpp
index 9161c3b..09b2b32 100644
--- a/WebCore/inspector/InspectorProfilerAgent.cpp
+++ b/WebCore/inspector/InspectorProfilerAgent.cpp
@@ -43,6 +43,7 @@
#include "ScriptProfile.h"
#include "ScriptProfiler.h"
#include <wtf/OwnPtr.h>
+#include <wtf/text/CString.h>
#if USE(JSC)
#include "JSDOMWindow.h"
diff --git a/WebCore/inspector/InspectorResource.cpp b/WebCore/inspector/InspectorResource.cpp
index be77827..ac2c9a0 100644
--- a/WebCore/inspector/InspectorResource.cpp
+++ b/WebCore/inspector/InspectorResource.cpp
@@ -43,14 +43,39 @@
#include "ResourceLoadTiming.h"
#include "ResourceRequest.h"
#include "ResourceResponse.h"
+#include "StringBuffer.h"
#include "TextEncoding.h"
+#include "WebSocketHandshakeRequest.h"
+#include "WebSocketHandshakeResponse.h"
+
+#include <wtf/Assertions.h>
namespace WebCore {
+#if ENABLE(WEB_SOCKETS)
+// Create human-readable binary representation, like "01:23:45:67:89:AB:CD:EF".
+static String createReadableStringFromBinary(const unsigned char* value, size_t length)
+{
+ ASSERT(length > 0);
+ static const char hexDigits[17] = "0123456789ABCDEF";
+ size_t bufferSize = length * 3 - 1;
+ StringBuffer buffer(bufferSize);
+ size_t index = 0;
+ for (size_t i = 0; i < length; ++i) {
+ if (i > 0)
+ buffer[index++] = ':';
+ buffer[index++] = hexDigits[value[i] >> 4];
+ buffer[index++] = hexDigits[value[i] & 0xF];
+ }
+ ASSERT(index == bufferSize);
+ return String::adopt(buffer);
+}
+#endif
+
InspectorResource::InspectorResource(unsigned long identifier, DocumentLoader* loader, const KURL& requestURL)
: m_identifier(identifier)
, m_loader(loader)
- , m_frame(loader->frame())
+ , m_frame(loader ? loader->frame() : 0)
, m_requestURL(requestURL)
, m_expectedContentLength(0)
, m_cached(false)
@@ -66,6 +91,9 @@ InspectorResource::InspectorResource(unsigned long identifier, DocumentLoader* l
, m_connectionID(0)
, m_connectionReused(false)
, m_isMainResource(false)
+#if ENABLE(WEB_SOCKETS)
+ , m_isWebSocket(false)
+#endif
{
}
@@ -88,6 +116,12 @@ PassRefPtr<InspectorResource> InspectorResource::appendRedirect(unsigned long id
return redirect;
}
+PassRefPtr<InspectorResource> InspectorResource::create(unsigned long identifier, DocumentLoader* loader, const KURL& requestURL)
+{
+ ASSERT(loader);
+ return adoptRef(new InspectorResource(identifier, loader, requestURL));
+}
+
PassRefPtr<InspectorResource> InspectorResource::createCached(unsigned long identifier, DocumentLoader* loader, const CachedResource* cachedResource)
{
PassRefPtr<InspectorResource> resource = create(identifier, loader, KURL(ParsedURLString, cachedResource->url()));
@@ -107,6 +141,16 @@ PassRefPtr<InspectorResource> InspectorResource::createCached(unsigned long iden
return resource;
}
+#if ENABLE(WEB_SOCKETS)
+PassRefPtr<InspectorResource> InspectorResource::createWebSocket(unsigned long identifier, const KURL& requestURL, const KURL& documentURL)
+{
+ RefPtr<InspectorResource> resource = adoptRef(new InspectorResource(identifier, 0, requestURL));
+ resource->markWebSocket();
+ resource->m_documentURL = documentURL;
+ return resource.release();
+}
+#endif
+
void InspectorResource::updateRequest(const ResourceRequest& request)
{
m_requestHeaderFields = request.httpHeaderFields();
@@ -117,6 +161,11 @@ void InspectorResource::updateRequest(const ResourceRequest& request)
m_changes.set(RequestChange);
}
+void InspectorResource::markAsCached()
+{
+ m_cached = true;
+}
+
void InspectorResource::updateResponse(const ResourceResponse& response)
{
m_expectedContentLength = response.expectedContentLength();
@@ -134,7 +183,7 @@ void InspectorResource::updateResponse(const ResourceResponse& response)
m_connectionID = response.connectionID();
m_connectionReused = response.connectionReused();
m_loadTiming = response.resourceLoadTiming();
- m_cached = response.wasCached();
+ m_cached = m_cached || response.wasCached();
if (!m_cached && m_loadTiming && m_loadTiming->requestTime)
m_responseReceivedTime = m_loadTiming->requestTime + m_loadTiming->receiveHeadersEnd / 1000.0;
@@ -146,6 +195,27 @@ void InspectorResource::updateResponse(const ResourceResponse& response)
m_changes.set(TypeChange);
}
+#if ENABLE(WEB_SOCKETS)
+void InspectorResource::updateWebSocketRequest(const WebSocketHandshakeRequest& request)
+{
+ m_requestHeaderFields = request.headerFields();
+ m_requestMethod = "GET"; // Currently we always use "GET" to request handshake.
+ m_webSocketRequestKey3.set(new WebSocketHandshakeRequest::Key3(request.key3()));
+ m_changes.set(RequestChange);
+ m_changes.set(TypeChange);
+}
+
+void InspectorResource::updateWebSocketResponse(const WebSocketHandshakeResponse& response)
+{
+ m_responseStatusCode = response.statusCode();
+ m_responseStatusText = response.statusText();
+ m_responseHeaderFields = response.headerFields();
+ m_webSocketChallengeResponse.set(new WebSocketHandshakeResponse::ChallengeResponse(response.challengeResponse()));
+ m_changes.set(ResponseChange);
+ m_changes.set(TypeChange);
+}
+#endif // ENABLE(WEB_SOCKETS)
+
static PassRefPtr<InspectorObject> buildHeadersObject(const HTTPHeaderMap& headers)
{
RefPtr<InspectorObject> object = InspectorObject::create();
@@ -183,8 +253,10 @@ void InspectorResource::updateScriptObject(InspectorFrontend* frontend)
RefPtr<InspectorObject> jsonObject = InspectorObject::create();
jsonObject->setNumber("id", m_identifier);
if (m_changes.hasChange(RequestChange)) {
+ if (m_frame)
+ m_documentURL = m_frame->document()->url();
jsonObject->setString("url", m_requestURL.string());
- jsonObject->setString("documentURL", m_frame->document()->url().string());
+ jsonObject->setString("documentURL", m_documentURL.string());
jsonObject->setString("host", m_requestURL.host());
jsonObject->setString("path", m_requestURL.path());
jsonObject->setString("lastPathComponent", m_requestURL.lastPathComponent());
@@ -194,6 +266,10 @@ void InspectorResource::updateScriptObject(InspectorFrontend* frontend)
jsonObject->setString("requestMethod", m_requestMethod);
jsonObject->setString("requestFormData", m_requestFormData);
jsonObject->setBoolean("didRequestChange", true);
+#if ENABLE(WEB_SOCKETS)
+ if (m_webSocketRequestKey3)
+ jsonObject->setString("webSocketRequestKey3", createReadableStringFromBinary(m_webSocketRequestKey3->value, sizeof(m_webSocketRequestKey3->value)));
+#endif
}
if (m_changes.hasChange(ResponseChange)) {
@@ -209,6 +285,10 @@ void InspectorResource::updateScriptObject(InspectorFrontend* frontend)
jsonObject->setBoolean("cached", m_cached);
if (m_loadTiming && !m_cached)
jsonObject->setObject("timing", buildObjectForTiming(m_loadTiming.get()));
+#if ENABLE(WEB_SOCKETS)
+ if (m_webSocketChallengeResponse)
+ jsonObject->setString("webSocketChallengeResponse", createReadableStringFromBinary(m_webSocketChallengeResponse->value, sizeof(m_webSocketChallengeResponse->value)));
+#endif
jsonObject->setBoolean("didResponseChange", true);
}
@@ -267,6 +347,8 @@ CachedResource* InspectorResource::cachedResource() const
// Try hard to find a corresponding CachedResource. During preloading, CachedResourceLoader may not have the resource in document resources set yet,
// but Inspector will already try to fetch data that is only available via CachedResource (and it won't update once the resource is added,
// because m_changes will not have the appropriate bits set).
+ if (!m_frame)
+ return 0;
const String& url = m_requestURL.string();
CachedResource* cachedResource = m_frame->document()->cachedResourceLoader()->cachedResource(url);
if (!cachedResource)
@@ -303,6 +385,12 @@ InspectorResource::Type InspectorResource::type() const
if (!m_overrideContent.isNull())
return m_overrideContentType;
+#if ENABLE(WEB_SOCKETS)
+ if (m_isWebSocket)
+ return WebSocket;
+#endif
+
+ ASSERT(m_loader);
if (equalIgnoringFragmentIdentifier(m_requestURL, m_loader->requestURL())) {
InspectorResource::Type resourceType = cachedResourceType();
if (resourceType == Other)
@@ -342,7 +430,7 @@ String InspectorResource::sourceString() const
PassRefPtr<SharedBuffer> InspectorResource::resourceData(String* textEncodingName) const
{
- if (equalIgnoringFragmentIdentifier(m_requestURL, m_loader->requestURL())) {
+ if (m_loader && equalIgnoringFragmentIdentifier(m_requestURL, m_loader->requestURL())) {
*textEncodingName = m_frame->document()->inputEncoding();
return m_loader->mainResourceData();
}
@@ -372,9 +460,18 @@ void InspectorResource::startTiming()
m_changes.set(TimingChange);
}
-void InspectorResource::endTiming()
+void InspectorResource::endTiming(double actualEndTime)
{
- m_endTime = currentTime();
+ if (actualEndTime) {
+ m_endTime = actualEndTime;
+ // In case of fast load (or in case of cached resources), endTime on network stack
+ // can be less then m_responseReceivedTime measured in WebCore. Normalize it here,
+ // prefer actualEndTime to m_responseReceivedTime.
+ if (m_endTime < m_responseReceivedTime)
+ m_responseReceivedTime = m_endTime;
+ } else
+ m_endTime = currentTime();
+
m_finished = true;
m_changes.set(TimingChange);
m_changes.set(CompletionChange);
diff --git a/WebCore/inspector/InspectorResource.h b/WebCore/inspector/InspectorResource.h
index 4004142..914232e 100644
--- a/WebCore/inspector/InspectorResource.h
+++ b/WebCore/inspector/InspectorResource.h
@@ -34,6 +34,8 @@
#include "HTTPHeaderMap.h"
#include "KURL.h"
#include "ScriptString.h"
+#include "WebSocketHandshakeRequest.h"
+#include "WebSocketHandshakeResponse.h"
#include <wtf/CurrentTime.h>
#include <wtf/OwnPtr.h>
@@ -51,6 +53,11 @@ namespace WebCore {
class ResourceRequest;
class ResourceResponse;
+#if ENABLE(WEB_SOCKETS)
+ class WebSocketHandshakeRequest;
+ class WebSocketHandshakeResponse;
+#endif
+
class InspectorResource : public RefCounted<InspectorResource> {
public:
@@ -63,16 +70,19 @@ namespace WebCore {
Script,
XHR,
Media,
+ WebSocket,
Other
};
- static PassRefPtr<InspectorResource> create(unsigned long identifier, DocumentLoader* loader, const KURL& requestURL)
- {
- return adoptRef(new InspectorResource(identifier, loader, requestURL));
- }
+ static PassRefPtr<InspectorResource> create(unsigned long identifier, DocumentLoader* loader, const KURL& requestURL);
static PassRefPtr<InspectorResource> createCached(unsigned long identifier, DocumentLoader*, const CachedResource*);
+#if ENABLE(WEB_SOCKETS)
+ // WebSocket resource doesn't have its loader. For WebSocket resources, m_loader and m_frame will become null.
+ static PassRefPtr<InspectorResource> createWebSocket(unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
+#endif
+
~InspectorResource();
PassRefPtr<InspectorResource> appendRedirect(unsigned long identifier, const KURL& redirectURL);
@@ -80,8 +90,14 @@ namespace WebCore {
void releaseScriptObject(InspectorFrontend* frontend);
void updateRequest(const ResourceRequest&);
+ void markAsCached();
void updateResponse(const ResourceResponse&);
+#if ENABLE(WEB_SOCKETS)
+ void updateWebSocketRequest(const WebSocketHandshakeRequest&);
+ void updateWebSocketResponse(const WebSocketHandshakeResponse&);
+#endif
+
void setOverrideContent(const ScriptString& data, Type);
String sourceString() const;
@@ -102,7 +118,7 @@ namespace WebCore {
void startTiming();
void markLoadEventTime();
void markDOMContentEventTime();
- void endTiming();
+ void endTiming(double actualEndTime);
void markFailed();
void addLength(int lengthReceived);
@@ -149,10 +165,15 @@ namespace WebCore {
Type cachedResourceType() const;
CachedResource* cachedResource() const;
+#if ENABLE(WEB_SOCKETS)
+ void markWebSocket() { m_isWebSocket = true; }
+#endif
+
unsigned long m_identifier;
RefPtr<DocumentLoader> m_loader;
RefPtr<Frame> m_frame;
KURL m_requestURL;
+ KURL m_documentURL;
HTTPHeaderMap m_requestHeaderFields;
HTTPHeaderMap m_responseHeaderFields;
String m_mimeType;
@@ -179,6 +200,15 @@ namespace WebCore {
String m_requestMethod;
String m_requestFormData;
Vector<RefPtr<InspectorResource> > m_redirects;
+
+#if ENABLE(WEB_SOCKETS)
+ bool m_isWebSocket;
+
+ // The following fields are not used for resources other than WebSocket.
+ // We allocate them dynamically to reduce memory consumption for regular resources.
+ OwnPtr<WebSocketHandshakeRequest::Key3> m_webSocketRequestKey3;
+ OwnPtr<WebSocketHandshakeResponse::ChallengeResponse> m_webSocketChallengeResponse;
+#endif
};
} // namespace WebCore
diff --git a/WebCore/inspector/front-end/AuditFormatters.js b/WebCore/inspector/front-end/AuditFormatters.js
index de277ad..1bc1803 100755..100644
--- a/WebCore/inspector/front-end/AuditFormatters.js
+++ b/WebCore/inspector/front-end/AuditFormatters.js
@@ -79,8 +79,14 @@ WebInspector.AuditFormatters = {
return parent;
},
- url: function(url, displayText)
+ url: function(url, displayText, allowExternalNavigation)
{
- return WebInspector.linkifyURLAsNode(url, displayText || url, null, (url in WebInspector.resourceURLMap));
+ var a = document.createElement("a");
+ a.href = url;
+ a.title = url;
+ a.textContent = displayText || url;
+ if (allowExternalNavigation)
+ a.target = "_blank";
+ return a;
}
};
diff --git a/WebCore/inspector/front-end/BreakpointsSidebarPane.js b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
index cda72fb..9688f3e 100644
--- a/WebCore/inspector/front-end/BreakpointsSidebarPane.js
+++ b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
@@ -97,6 +97,7 @@ WebInspector.BreakpointItem = function(breakpoint)
this._breakpoint = breakpoint;
this._element = document.createElement("li");
+ this._element.addEventListener("click", this._breakpointClicked.bind(this), false);
var checkboxElement = document.createElement("input");
checkboxElement.className = "checkbox-elem";
@@ -141,8 +142,6 @@ WebInspector.JSBreakpointItem = function(breakpoint)
{
WebInspector.BreakpointItem.call(this, breakpoint);
- this._element.addEventListener("click", this._breakpointClicked.bind(this), false);
-
var displayName = this._breakpoint.url ? WebInspector.displayNameForURL(this._breakpoint.url) : WebInspector.UIString("(program)");
var labelElement = document.createTextNode(displayName + ":" + this._breakpoint.line);
this._element.appendChild(labelElement);
@@ -183,8 +182,7 @@ WebInspector.DOMBreakpointItem = function(breakpoint)
{
WebInspector.BreakpointItem.call(this, breakpoint);
- var node = WebInspector.domAgent.nodeForId(this._breakpoint.nodeId);
- var link = WebInspector.panels.elements.linkifyNodeReference(node);
+ var link = WebInspector.panels.elements.linkifyNodeById(this._breakpoint.nodeId);
this._element.appendChild(link);
var type = WebInspector.DOMBreakpoint.labelForType(this._breakpoint.type);
@@ -198,6 +196,11 @@ WebInspector.DOMBreakpointItem.prototype = {
if (this._breakpoint.type != other._breakpoint.type)
return this._breakpoint.type < other._breakpoint.type ? -1 : 1;
return 0;
+ },
+
+ _breakpointClicked: function()
+ {
+ WebInspector.updateFocusedNode(this._breakpoint.nodeId);
}
}
diff --git a/WebCore/inspector/front-end/CallStackSidebarPane.js b/WebCore/inspector/front-end/CallStackSidebarPane.js
index 60eee34..91f35a6 100644
--- a/WebCore/inspector/front-end/CallStackSidebarPane.js
+++ b/WebCore/inspector/front-end/CallStackSidebarPane.js
@@ -26,7 +26,6 @@
WebInspector.CallStackSidebarPane = function()
{
WebInspector.SidebarPane.call(this, WebInspector.UIString("Call Stack"));
-
}
WebInspector.CallStackSidebarPane.prototype = {
@@ -83,6 +82,39 @@ WebInspector.CallStackSidebarPane.prototype = {
}
},
+ updateStatus: function(status)
+ {
+ var statusElement = document.createElement("div");
+ statusElement.className = "info";
+
+ var breakpointType = status.breakpoint.type;
+ var substitutions = [WebInspector.DOMBreakpoint.labelForType(breakpointType), WebInspector.panels.elements.linkifyNodeById(status.breakpoint.nodeId)];
+ var formatters = {
+ s: function(substitution)
+ {
+ return substitution;
+ }
+ };
+ function append(a, b)
+ {
+ if (typeof b === "string")
+ b = document.createTextNode(b);
+ statusElement.appendChild(b);
+ }
+ if (breakpointType === WebInspector.DOMBreakpoint.Types.SubtreeModified) {
+ var targetNode = WebInspector.panels.elements.linkifyNodeById(status.targetNodeId);
+ if (status.insertion) {
+ if (status.targetNodeId !== status.breakpoint.nodeId)
+ WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to its descendant %s.", substitutions.concat(targetNode), formatters, "", append);
+ else
+ WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to that node.", substitutions, formatters, "", append);
+ } else
+ WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because its descendant %s was removed.", substitutions.concat(targetNode), formatters, "", append);
+ } else
+ WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s.", substitutions, formatters, "", append);
+ this.bodyElement.appendChild(statusElement);
+ },
+
get selectedCallFrame()
{
return this._selectedCallFrame;
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index 9785cd0..6f8bd8b 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -400,10 +400,13 @@ WebInspector.ConsoleView.prototype = {
}
var contextMenu = new WebInspector.ContextMenu();
- if (!WebInspector.monitoringXHREnabled)
- contextMenu.appendCheckboxItem(WebInspector.UIString("XMLHttpRequest logging"), InspectorBackend.enableMonitoringXHR.bind(InspectorBackend), false);
- else
- contextMenu.appendCheckboxItem(WebInspector.UIString("XMLHttpRequest logging"), InspectorBackend.disableMonitoringXHR.bind(InspectorBackend), true);
+
+ function monitoringXHRWasChanged(newState)
+ {
+ WebInspector.monitoringXHREnabled = newState;
+ }
+ var itemAction = InspectorBackend.setMonitoringXHREnabled.bind(InspectorBackend, !WebInspector.monitoringXHREnabled, monitoringXHRWasChanged);
+ contextMenu.appendCheckboxItem(WebInspector.UIString("XMLHttpRequest logging"), itemAction, WebInspector.monitoringXHREnabled);
contextMenu.appendItem(WebInspector.UIString("Clear Console"), this.requestClearMessages.bind(this));
contextMenu.show(event);
},
@@ -518,7 +521,7 @@ WebInspector.ConsoleView.prototype = {
_enterKeyPressed: function(event)
{
- if (event.altKey)
+ if (event.altKey || event.ctrlKey)
return;
event.preventDefault();
@@ -1091,7 +1094,7 @@ WebInspector.ConsoleGroup.prototype = {
if (msg.type === WebInspector.ConsoleMessage.MessageType.StartGroup || msg.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed) {
this.messagesElement.parentNode.insertBefore(element, this.messagesElement);
- element.addEventListener("click", this._titleClicked.bind(this), true);
+ element.addEventListener("click", this._titleClicked.bind(this), false);
var groupElement = element.enclosingNodeOrSelfWithClass("console-group");
if (groupElement && msg.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed)
groupElement.addStyleClass("collapsed");
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index c60d4b1..72b23e1 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -147,7 +147,7 @@ WebInspector.ElementsPanel.prototype = {
{
WebInspector.Panel.prototype.hide.call(this);
- WebInspector.hoveredDOMNode = null;
+ WebInspector.highlightDOMNode(0);
InspectorBackend.disableSearchingForNode();
},
@@ -165,7 +165,7 @@ WebInspector.ElementsPanel.prototype = {
this.rootDOMNode = null;
this.focusedDOMNode = null;
- WebInspector.hoveredDOMNode = null;
+ WebInspector.highlightDOMNode(0);
this.recentlyModifiedNodes = [];
@@ -187,9 +187,7 @@ WebInspector.ElementsPanel.prototype = {
inspectedRootDocument.addEventListener("DOMNodeRemoved", this._nodeRemoved.bind(this));
inspectedRootDocument.addEventListener("DOMAttrModified", this._attributesUpdated.bind(this));
- this.treeOutline.suppressSelectHighlight = true;
this.rootDOMNode = inspectedRootDocument;
- this.treeOutline.suppressSelectHighlight = false;
function selectNode(candidateFocusNode)
{
@@ -199,11 +197,9 @@ WebInspector.ElementsPanel.prototype = {
if (!candidateFocusNode)
return;
- this.treeOutline.suppressSelectHighlight = true;
this.focusedDOMNode = candidateFocusNode;
if (this.treeOutline.selectedTreeElement)
this.treeOutline.selectedTreeElement.expand();
- this.treeOutline.suppressSelectHighlight = false;
}
function selectLastSelectedNode(nodeId)
@@ -261,6 +257,23 @@ WebInspector.ElementsPanel.prototype = {
this._nodeSearchButton.toggled = false;
},
+ populateHrefContextMenu: function(contextMenu, event, anchorElement)
+ {
+ if (!anchorElement.href)
+ return false;
+
+ var resourceURL = WebInspector.resourceURLForRelatedNode(this.focusedDOMNode, anchorElement.href);
+ if (!resourceURL)
+ return false;
+
+ // Add resource-related actions.
+ // Keep these consistent with those added in WebInspector.StylesSidebarPane.prototype._populateHrefContextMenu().
+ contextMenu.appendItem(WebInspector.UIString("Open Link in New Window"), WebInspector.openResource.bind(null, resourceURL, false));
+ if (WebInspector.resourceForURL(resourceURL))
+ contextMenu.appendItem(WebInspector.UIString("Open Link in Resources Panel"), WebInspector.openResource.bind(null, resourceURL, true));
+ return true;
+ },
+
_updateMatchesCount: function()
{
WebInspector.updateSearchMatchesCount(this._searchResults.length, this);
@@ -561,7 +574,7 @@ WebInspector.ElementsPanel.prototype = {
var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY);
var crumbElement = nodeUnderMouse.enclosingNodeOrSelfWithClass("crumb");
- WebInspector.hoveredDOMNode = (crumbElement ? crumbElement.representedObject : null);
+ WebInspector.highlightDOMNode(crumbElement ? crumbElement.representedObject.id : 0);
if ("_mouseOutOfCrumbsTimeout" in this) {
clearTimeout(this._mouseOutOfCrumbsTimeout);
@@ -575,7 +588,7 @@ WebInspector.ElementsPanel.prototype = {
if (nodeUnderMouse && nodeUnderMouse.isDescendant(this.crumbsElement))
return;
- WebInspector.hoveredDOMNode = null;
+ WebInspector.highlightDOMNode(0);
this._mouseOutOfCrumbsTimeout = setTimeout(this.updateBreadcrumbSizes.bind(this), 1000);
},
@@ -761,11 +774,19 @@ WebInspector.ElementsPanel.prototype = {
{
var link = document.createElement("span");
link.className = "node-link";
- link.addEventListener("click", WebInspector.updateFocusedNode.bind(WebInspector, node.id), false);
this.decorateNodeLabel(node, link);
+ WebInspector.wireElementWithDOMNode(link, node.id);
return link;
},
+ linkifyNodeById: function(nodeId)
+ {
+ var node = WebInspector.domAgent.nodeForId(nodeId);
+ if (!node)
+ return document.createTextNode(WebInspector.UIString("<node>"));
+ return this.linkifyNodeReference(node);
+ },
+
updateBreadcrumbSizes: function(focusedCrumb)
{
if (!this.visible)
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index 10131f4..e261234 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -93,27 +93,8 @@ WebInspector.ElementsTreeOutline.prototype = {
// and the select() call would change the focusedDOMNode and reenter this setter. So to
// avoid calling focusedNodeChanged() twice, first check if _focusedDOMNode is the same
// node as the one passed in.
- if (this._focusedDOMNode === x) {
+ if (this._focusedDOMNode === x)
this.focusedNodeChanged();
-
- if (x && !this.suppressSelectHighlight) {
- InspectorBackend.highlightDOMNode(x.id);
-
- if ("_restorePreviousHighlightNodeTimeout" in this)
- clearTimeout(this._restorePreviousHighlightNodeTimeout);
-
- function restoreHighlightToHoveredNode()
- {
- var hoveredNode = WebInspector.hoveredDOMNode;
- if (hoveredNode)
- InspectorBackend.highlightDOMNode(hoveredNode.id);
- else
- InspectorBackend.hideDOMNodeHighlight();
- }
-
- this._restorePreviousHighlightNodeTimeout = setTimeout(restoreHighlightToHoveredNode, 2000);
- }
- }
},
get editing()
@@ -260,7 +241,7 @@ WebInspector.ElementsTreeOutline.prototype = {
element._createTooltipForNode();
}
- WebInspector.hoveredDOMNode = (element ? element.representedObject : null);
+ WebInspector.highlightDOMNode(element ? element.representedObject.id : 0);
},
_onmouseout: function(event)
@@ -274,7 +255,7 @@ WebInspector.ElementsTreeOutline.prototype = {
delete this._previousHoveredElement;
}
- WebInspector.hoveredDOMNode = null;
+ WebInspector.highlightDOMNode(0);
},
_contextMenuEventFired: function(event)
@@ -285,12 +266,21 @@ WebInspector.ElementsTreeOutline.prototype = {
var contextMenu = new WebInspector.ContextMenu();
+ var href = event.target.enclosingNodeOrSelfWithClass("webkit-html-resource-link") || event.target.enclosingNodeOrSelfWithClass("webkit-html-external-link");
var tag = event.target.enclosingNodeOrSelfWithClass("webkit-html-tag");
var textNode = event.target.enclosingNodeOrSelfWithClass("webkit-html-text-node");
- if (tag && listItem.treeElement._populateTagContextMenu)
+ var needSeparator;
+ if (href)
+ needSeparator = WebInspector.panels.elements.populateHrefContextMenu(contextMenu, event, href);
+ if (tag && listItem.treeElement._populateTagContextMenu) {
+ if (needSeparator)
+ contextMenu.appendSeparator();
listItem.treeElement._populateTagContextMenu(contextMenu, event);
- else if (textNode && listItem.treeElement._populateTextContextMenu)
+ } else if (textNode && listItem.treeElement._populateTextContextMenu) {
+ if (needSeparator)
+ contextMenu.appendSeparator();
listItem.treeElement._populateTextContextMenu(contextMenu, textNode);
+ }
contextMenu.show(event);
}
}
@@ -1189,29 +1179,6 @@ WebInspector.ElementsTreeElement.prototype = {
this._highlightSearchResults();
},
- _rewriteAttrHref: function(node, hrefValue)
- {
- if (!hrefValue || hrefValue.indexOf("://") > 0)
- return hrefValue;
-
- for (var frameOwnerCandidate = node; frameOwnerCandidate; frameOwnerCandidate = frameOwnerCandidate.parentNode) {
- if (frameOwnerCandidate.documentURL) {
- var result = WebInspector.completeURL(frameOwnerCandidate.documentURL, hrefValue);
- if (result)
- return result;
- break;
- }
- }
-
- // documentURL not found or has bad value
- for (var url in WebInspector.resourceURLMap) {
- var match = url.match(WebInspector.URLRegExp);
- if (match && match[4] === hrefValue)
- return url;
- }
- return hrefValue;
- },
-
_attributeHTML: function(name, value, node, linkify)
{
var hasText = (value.length > 0);
@@ -1221,7 +1188,7 @@ WebInspector.ElementsTreeElement.prototype = {
html += "=&#8203;\"";
if (linkify && (name === "src" || name === "href")) {
- var rewrittenHref = this._rewriteAttrHref(node, value);
+ var rewrittenHref = WebInspector.resourceURLForRelatedNode(node, value);
value = value.replace(/([\/;:\)\]\}])/g, "$1\u200B");
html += linkify(rewrittenHref, value, "webkit-html-attribute-value", node.nodeName.toLowerCase() === "a");
} else {
diff --git a/WebCore/inspector/front-end/HAREntry.js b/WebCore/inspector/front-end/HAREntry.js
index 9f188ed..85e4f59 100644
--- a/WebCore/inspector/front-end/HAREntry.js
+++ b/WebCore/inspector/front-end/HAREntry.js
@@ -42,7 +42,7 @@ WebInspector.HAREntry.prototype = {
return {
pageref: this._resource.documentURL,
startedDateTime: new Date(this._resource.startTime * 1000),
- time: this._toMilliseconds(this._resource.duration),
+ time: WebInspector.HAREntry._toMilliseconds(this._resource.duration),
request: this._buildRequest(),
response: this._buildResponse(),
// cache: {...}, -- Not supproted yet.
@@ -95,14 +95,34 @@ WebInspector.HAREntry.prototype = {
_buildTimings: function()
{
+ var waitForConnection = this._interval("connectStart", "connectEnd");
+ var blocked;
+ var connect;
+ var dns = this._interval("dnsStart", "dnsEnd");
+ var send = this._interval("sendStart", "sendEnd");
+ var ssl = this._interval("sslStart", "sslEnd");
+
+ if (ssl !== -1 && send !== -1)
+ send -= ssl;
+
+ if (this._resource.connectionReused) {
+ connect = -1;
+ blocked = waitForConnection;
+ } else {
+ blocked = 0;
+ connect = waitForConnection;
+ if (dns !== -1)
+ connect -= dns;
+ }
+
return {
- blocked: -1, // Not available.
- dns: -1, // Not available.
- connect: -1, // Not available.
- send: -1, // Not available.
- wait: this._toMilliseconds(this._resource.latency),
- receive: this._toMilliseconds(this._resource.receiveDuration),
- ssl: -1 // Not available.
+ blocked: blocked,
+ dns: dns,
+ connect: connect,
+ send: send,
+ wait: this._interval("sendEnd", "receiveHeadersEnd"),
+ receive: WebInspector.HAREntry._toMilliseconds(this._resource.receiveDuration),
+ ssl: ssl
};
},
@@ -130,8 +150,65 @@ WebInspector.HAREntry.prototype = {
return parameters.slice();
},
- _toMilliseconds: function(time)
+ _interval: function(start, end)
+ {
+ var timing = this._resource.timing;
+ if (!timing)
+ return -1;
+ var startTime = timing[start];
+ return typeof startTime !== "number" || startTime === -1 ? -1 : Math.round(timing[end] - startTime);
+ }
+};
+
+WebInspector.HAREntry._toMilliseconds = function(time)
+{
+ return time === -1 ? -1 : Math.round(time * 1000);
+}
+
+WebInspector.HARLog = function()
+{
+}
+
+WebInspector.HARLog.prototype = {
+ build: function()
+ {
+ var webKitVersion = /AppleWebKit\/([^ ]+)/.exec(window.navigator.userAgent);
+
+ return {
+ version: "1.2",
+ creator: {
+ name: "WebInspector",
+ version: webKitVersion ? webKitVersion[1] : "n/a"
+ },
+ pages: this._buildPages(),
+ entries: Object.properties(WebInspector.resources).map(this._convertResource)
+ }
+ },
+
+ _buildPages: function()
+ {
+ return [
+ {
+ startedDateTime: new Date(WebInspector.mainResource.startTime * 1000),
+ id: WebInspector.mainResource.documentURL,
+ title: "",
+ pageTimings: this._buildMainResourceTimings()
+ }
+ ];
+ },
+
+ _buildMainResourceTimings: function()
+ {
+ var resourcesPanel = WebInspector.panels.resources;
+ var startTime = WebInspector.mainResource.startTime;
+ return {
+ onContentLoad: WebInspector.HAREntry._toMilliseconds(resourcesPanel.mainResourceDOMContentTime - startTime),
+ onLoad: WebInspector.HAREntry._toMilliseconds(resourcesPanel.mainResourceLoadTime - startTime),
+ }
+ },
+
+ _convertResource: function(id)
{
- return time === -1 ? -1 : Math.round(time * 1000);
+ return (new WebInspector.HAREntry(WebInspector.resources[id])).build();
}
};
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index d4e3d80..5544ed5 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -464,6 +464,10 @@ InjectedScript.prototype = {
return str.replace(/^\[object (.*)\]$/i, "$1");
} else {
// V8
+ if (isFinite(obj.length) && typeof obj.callee === "function") {
+ // Arguments.constructor === Object in V8
+ return "Arguments";
+ }
return obj.constructor && obj.constructor.name || "Object";
}
},
diff --git a/WebCore/inspector/front-end/ProfileDataGridTree.js b/WebCore/inspector/front-end/ProfileDataGridTree.js
index b10f392..adf34f1 100644
--- a/WebCore/inspector/front-end/ProfileDataGridTree.js
+++ b/WebCore/inspector/front-end/ProfileDataGridTree.js
@@ -96,19 +96,10 @@ WebInspector.ProfileDataGridNode.prototype = {
cell.addStyleClass("highlight");
if (this.profileNode.url) {
- var fileName = WebInspector.displayNameForURL(this.profileNode.url);
-
- var urlElement = document.createElement("a");
- urlElement.className = "profile-node-file webkit-html-resource-link";
- urlElement.href = this.profileNode.url;
- urlElement.lineNumber = this.profileNode.lineNumber;
- urlElement.preferredPanel = "scripts";
-
+ var lineNumber;
if (this.profileNode.lineNumber > 0)
- urlElement.textContent = fileName + ":" + this.profileNode.lineNumber;
- else
- urlElement.textContent = fileName;
-
+ lineNumber = this.profileNode.lineNumber;
+ var urlElement = WebInspector.linkifyResourceAsNode(this.profileNode.url, "scripts", lineNumber, "profile-node-file");
cell.insertBefore(urlElement, cell.firstChild);
}
diff --git a/WebCore/inspector/front-end/Resource.js b/WebCore/inspector/front-end/Resource.js
index de87047..ea9052d 100644
--- a/WebCore/inspector/front-end/Resource.js
+++ b/WebCore/inspector/front-end/Resource.js
@@ -45,7 +45,8 @@ WebInspector.Resource.Type = {
Script: 4,
XHR: 5,
Media: 6,
- Other: 7,
+ WebSocket: 7,
+ Other: 8,
isTextType: function(type)
{
@@ -76,6 +77,8 @@ WebInspector.Resource.Type = {
return "XHR";
case this.Media:
return "media";
+ case this.WebSocket:
+ return "WebSocket";
case this.Other:
default:
return "other";
@@ -372,6 +375,9 @@ WebInspector.Resource.prototype = {
case WebInspector.Resource.Type.XHR:
this.category = WebInspector.resourceCategories.xhr;
break;
+ case WebInspector.Resource.Type.WebSocket:
+ this.category = WebInspector.resourceCategories.websocket;
+ break;
case WebInspector.Resource.Type.Other:
default:
this.category = WebInspector.resourceCategories.other;
@@ -584,7 +590,8 @@ WebInspector.Resource.prototype = {
if (typeof this.type === "undefined"
|| this.type === WebInspector.Resource.Type.Other
- || this.type === WebInspector.Resource.Type.XHR)
+ || this.type === WebInspector.Resource.Type.XHR
+ || this.type === WebInspector.Resource.Type.WebSocket)
return true;
if (this.mimeType in WebInspector.MIMETypes)
diff --git a/WebCore/inspector/front-end/ResourceView.js b/WebCore/inspector/front-end/ResourceView.js
index 7ce09b6..1c2574f 100644
--- a/WebCore/inspector/front-end/ResourceView.js
+++ b/WebCore/inspector/front-end/ResourceView.js
@@ -279,13 +279,19 @@ WebInspector.ResourceView.prototype = {
_refreshRequestHeaders: function()
{
- this._refreshHeaders(WebInspector.UIString("Request Headers"), this.resource.sortedRequestHeaders, this.requestHeadersTreeElement);
+ var additionalRow = null;
+ if (typeof this.resource.webSocketRequestKey3 !== "undefined")
+ additionalRow = {header: "(Key3)", value: this.resource.webSocketRequestKey3};
+ this._refreshHeaders(WebInspector.UIString("Request Headers"), this.resource.sortedRequestHeaders, additionalRow, this.requestHeadersTreeElement);
this._refreshFormData();
},
_refreshResponseHeaders: function()
{
- this._refreshHeaders(WebInspector.UIString("Response Headers"), this.resource.sortedResponseHeaders, this.responseHeadersTreeElement);
+ var additionalRow = null;
+ if (typeof this.resource.webSocketChallengeResponse !== "undefined")
+ additionalRow = {header: "(Challenge Response)", value: this.resource.webSocketChallengeResponse};
+ this._refreshHeaders(WebInspector.UIString("Response Headers"), this.resource.sortedResponseHeaders, additionalRow, this.responseHeadersTreeElement);
},
_refreshHTTPInformation: function()
@@ -316,7 +322,7 @@ WebInspector.ResourceView.prototype = {
}
},
- _refreshHeaders: function(title, headers, headersTreeElement)
+ _refreshHeaders: function(title, headers, additionalRow, headersTreeElement)
{
headersTreeElement.removeChildren();
@@ -333,6 +339,15 @@ WebInspector.ResourceView.prototype = {
headerTreeElement.selectable = false;
headersTreeElement.appendChild(headerTreeElement);
}
+
+ if (additionalRow) {
+ var title = "<div class=\"header-name\">" + additionalRow.header.escapeHTML() + ":</div>";
+ title += "<div class=\"header-value source-code\">" + additionalRow.value.escapeHTML() + "</div>"
+
+ var headerTreeElement = new TreeElement(title, null, false);
+ headerTreeElement.selectable = false;
+ headersTreeElement.appendChild(headerTreeElement);
+ }
}
}
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index 27df5cf..f329b1a 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -47,6 +47,8 @@ WebInspector.ResourcesPanel = function()
this.filter(this.filterAllElement, false);
this.graphsTreeElement.children[0].select();
this._resourceTrackingEnabled = false;
+
+ this.sidebarElement.addEventListener("contextmenu", this._contextMenu.bind(this), true);
}
WebInspector.ResourcesPanel.prototype = {
@@ -751,16 +753,23 @@ WebInspector.ResourcesPanel.prototype = {
_toggleResourceTracking: function(optionalAlways)
{
+ function callback(newState) {
+ if (newState)
+ WebInspector.panels.resources.resourceTrackingWasEnabled();
+ else
+ WebInspector.panels.resources.resourceTrackingWasDisabled();
+ }
+
if (this._resourceTrackingEnabled) {
this.largerResourcesButton.visible = false;
this.sortingSelectElement.visible = false;
WebInspector.resources = {};
WebInspector.resourceURLMap = {};
- InspectorBackend.disableResourceTracking(true);
+ InspectorBackend.setResourceTrackingEnabled(false, true, callback);
} else {
this.largerResourcesButton.visible = true;
this.sortingSelectElement.visible = true;
- InspectorBackend.enableResourceTracking(!!optionalAlways);
+ InspectorBackend.setResourceTrackingEnabled(true, !!optionalAlways, callback);
}
},
@@ -857,7 +866,7 @@ WebInspector.ResourcesPanel.prototype = {
var title = document.createElement("span");
title.className = "resource-timing-bar-title";
- if (i >= rows.length - 2)
+ if (total - rows[i].end < rows[i].start)
title.style.right = (scale * (total - rows[i].end) + 3) + "px";
else
title.style.left = (scale * rows[i].start + 3) + "px";
@@ -876,6 +885,36 @@ WebInspector.ResourcesPanel.prototype = {
{
WebInspector.Panel.prototype.hide.call(this);
this._popoverHelper.hidePopup();
+ },
+
+ _contextMenu: function(event)
+ {
+ // createBlobURL is enabled conditionally, do not expose resource export if it's not available.
+ if (typeof window.createBlobURL !== "function" || !Preferences.resourceExportEnabled)
+ return;
+
+ var contextMenu = new WebInspector.ContextMenu();
+ var resourceTreeItem = event.target.enclosingNodeOrSelfWithClass("resource-sidebar-tree-item");
+ if (resourceTreeItem && resourceTreeItem.treeElement) {
+ var resource = resourceTreeItem.treeElement.representedObject;
+ contextMenu.appendItem(WebInspector.UIString("Export to HAR"), this._exportResource.bind(this, resource));
+ }
+ contextMenu.appendItem(WebInspector.UIString("Export all to HAR"), this._exportAll.bind(this));
+ contextMenu.show(event);
+ },
+
+ _exportAll: function()
+ {
+ var harArchive = {
+ log: (new WebInspector.HARLog()).build()
+ }
+ offerFileForDownload(JSON.stringify(harArchive));
+ },
+
+ _exportResource: function(resource)
+ {
+ var har = (new WebInspector.HAREntry(resource)).build();
+ offerFileForDownload(JSON.stringify(har));
}
}
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index c5267f7..715339d 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -375,7 +375,7 @@ WebInspector.ScriptsPanel.prototype = {
InjectedScriptAccess.get(callFrame.worldId).evaluateInCallFrame(callFrame.id, code, objectGroup, evalCallback);
},
- debuggerPaused: function(callFrames)
+ debuggerPaused: function(details)
{
WebInspector.breakpointManager.removeOneTimeBreakpoint();
this._paused = true;
@@ -384,8 +384,11 @@ WebInspector.ScriptsPanel.prototype = {
this._updateDebuggerButtons();
- this.sidebarPanes.callstack.update(callFrames, this._sourceIDMap);
- this.sidebarPanes.callstack.selectedCallFrame = callFrames[0];
+ this.sidebarPanes.callstack.update(details.callFrames, this._sourceIDMap);
+ this.sidebarPanes.callstack.selectedCallFrame = details.callFrames[0];
+
+ if (details.status)
+ this.sidebarPanes.callstack.updateStatus(details.status);
WebInspector.currentPanel = this;
window.focus();
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js
index 41d82f9..63f2641 100644
--- a/WebCore/inspector/front-end/Settings.js
+++ b/WebCore/inspector/front-end/Settings.js
@@ -44,7 +44,8 @@ var Preferences = {
profilerAlwaysEnabled: false,
auditsPanelEnabled: true,
onlineDetectionEnabled: true,
- domBreakpointsEnabled: false
+ domBreakpointsEnabled: false,
+ resourceExportEnabled: false
}
WebInspector.Settings = function(sessionScope)
diff --git a/WebCore/inspector/front-end/StylesSidebarPane.js b/WebCore/inspector/front-end/StylesSidebarPane.js
index 1dddde7..6aff37d 100644
--- a/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -64,6 +64,7 @@ WebInspector.StylesSidebarPane = function(computedStylePane)
this.titleElement.appendChild(this.settingsSelectElement);
this._computedStylePane = computedStylePane;
+ this.element.addEventListener("contextmenu", this._contextMenuEventFired.bind(this), true);
}
// Taken from http://www.w3.org/TR/CSS21/propidx.html.
@@ -105,6 +106,17 @@ WebInspector.StylesSidebarPane.prototype = {
this.settingsSelectElement[2].selected = true;
},
+ _contextMenuEventFired: function(event)
+ {
+ var href = event.target.enclosingNodeOrSelfWithClass("webkit-html-resource-link") || event.target.enclosingNodeOrSelfWithClass("webkit-html-external-link");
+ if (href) {
+ var contextMenu = new WebInspector.ContextMenu();
+ var filled = WebInspector.panels.elements.populateHrefContextMenu(contextMenu, event, href);
+ if (filled)
+ contextMenu.show(event);
+ }
+ },
+
update: function(node, editedSection, forceUpdate)
{
var refresh = false;
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index f90a9fe..c222f0e 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -266,5 +266,6 @@
<file>Images/warningOrangeDot.png</file>
<file>Images/warningsErrors.png</file>
<file>Images/whiteConnectorPoint.png</file>
+ <file alias="DebuggerScript.js">../../bindings/v8/DebuggerScript.js</file>
</qresource>
</RCC>
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index 4319816..6d8571c 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -1693,6 +1693,10 @@ li.editing .swatch, li.editing .enabled-button, li.editing-sub-part .delete-but
color: gray;
}
+.pane > .body .placard + .info {
+ border-top: 1px solid gray
+}
+
.pane.expanded > .body, .pane.expanded > .growbar {
display: block;
}
@@ -2835,7 +2839,8 @@ button.enable-toggle-status-bar-item.toggled-on .glyph {
}
.resources-category-documents, .resources-category-stylesheets, .resources-category-images,
-.resources-category-scripts, .resources-category-xhr, .resources-category-fonts, .resources-category-other {
+.resources-category-scripts, .resources-category-xhr, .resources-category-fonts,
+.resources-category-websockets, .resources-category-other {
display: none;
}
@@ -2845,6 +2850,7 @@ button.enable-toggle-status-bar-item.toggled-on .glyph {
.filter-all .resources-category-scripts, .filter-scripts .resources-category-scripts,
.filter-all .resources-category-xhr, .filter-xhr .resources-category-xhr,
.filter-all .resources-category-fonts, .filter-fonts .resources-category-fonts,
+.filter-all .resources-category-websockets, .filter-websockets .resources-category-websockets,
.filter-all .resources-category-other, .filter-other .resources-category-other,
.resource-sidebar-tree-item.selected {
display: list-item;
@@ -2920,6 +2926,15 @@ button.enable-toggle-status-bar-item.toggled-on .glyph {
-webkit-border-image: url(Images/timelineHollowPillYellow.png) 6 7 6 7;
}
+/* FIXME: Create bar images for WebSocket. */
+.resources-category-websockets .resources-graph-bar {
+ -webkit-border-image: url(Images/timelinePillGray.png) 6 7 6 7;
+}
+
+.resources-category-websockets.resource-cached .resources-graph-bar {
+ -webkit-border-image: url(Images/timelineHollowPillGray.png) 6 7 6 7;
+}
+
#resource-views {
position: absolute;
top: 23px;
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 840745f..f6fa06b 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -403,45 +403,44 @@ var WebInspector = {
}
},
- get hoveredDOMNode()
+ highlightDOMNode: function(nodeId)
{
- return this._hoveredDOMNode;
- },
+ if ("_hideDOMNodeHighlightTimeout" in this) {
+ clearTimeout(this._hideDOMNodeHighlightTimeout);
+ delete this._hideDOMNodeHighlightTimeout;
+ }
- set hoveredDOMNode(x)
- {
- if (this._hoveredDOMNode === x)
+ if (this._highlightedDOMNodeId === nodeId)
return;
- this._hoveredDOMNode = x;
-
- if (this._hoveredDOMNode)
- this._updateHoverHighlightSoon(this.showingDOMNodeHighlight ? 50 : 500);
+ this._highlightedDOMNodeId = nodeId;
+ if (nodeId)
+ InspectorBackend.highlightDOMNode(nodeId);
else
- this._updateHoverHighlight();
+ InspectorBackend.hideDOMNodeHighlight();
},
- _updateHoverHighlightSoon: function(delay)
+ highlightDOMNodeForTwoSeconds: function(nodeId)
{
- if ("_updateHoverHighlightTimeout" in this)
- clearTimeout(this._updateHoverHighlightTimeout);
- this._updateHoverHighlightTimeout = setTimeout(this._updateHoverHighlight.bind(this), delay);
+ this.highlightDOMNode(nodeId);
+ this._hideDOMNodeHighlightTimeout = setTimeout(this.highlightDOMNode.bind(this, 0), 2000);
},
- _updateHoverHighlight: function()
+ wireElementWithDOMNode: function(element, nodeId)
{
- if ("_updateHoverHighlightTimeout" in this) {
- clearTimeout(this._updateHoverHighlightTimeout);
- delete this._updateHoverHighlightTimeout;
- }
+ element.addEventListener("click", this._updateFocusedNode.bind(this, nodeId), false);
+ element.addEventListener("mouseover", this.highlightDOMNode.bind(this, nodeId), false);
+ element.addEventListener("mouseout", this.highlightDOMNode.bind(this, 0), false);
+ },
- if (this._hoveredDOMNode) {
- InspectorBackend.highlightDOMNode(this._hoveredDOMNode.id);
- this.showingDOMNodeHighlight = true;
- } else {
- InspectorBackend.hideDOMNodeHighlight();
- this.showingDOMNodeHighlight = false;
- }
+ _updateFocusedNode: function(nodeId)
+ {
+ var node = WebInspector.domAgent.nodeForId(nodeId);
+ if (!node)
+ return;
+
+ this.currentPanel = this.panels.elements;
+ this.panels.elements.focusedDOMNode = node;
}
}
@@ -517,6 +516,7 @@ WebInspector.doLoadedDone = function()
scripts: new WebInspector.ResourceCategory("scripts", WebInspector.UIString("Scripts"), "rgb(255,121,0)"),
xhr: new WebInspector.ResourceCategory("xhr", WebInspector.UIString("XHR"), "rgb(231,231,10)"),
fonts: new WebInspector.ResourceCategory("fonts", WebInspector.UIString("Fonts"), "rgb(255,82,62)"),
+ websocket: new WebInspector.ResourceCategory("websockets", WebInspector.UIString("WebSocket"), "rgb(186,186,186)"), // FIXME: Decide the color.
other: new WebInspector.ResourceCategory("other", WebInspector.UIString("Other"), "rgb(186,186,186)")
};
@@ -582,6 +582,16 @@ WebInspector.doLoadedDone = function()
this.extensionServer.initExtensions();
+ function populateInspectorState(inspectorState)
+ {
+ WebInspector.monitoringXHREnabled = inspectorState.monitoringXHREnabled;
+ if (inspectorState.resourceTrackingEnabled)
+ WebInspector.panels.resources.resourceTrackingWasEnabled();
+ else
+ WebInspector.panels.resources.resourceTrackingWasDisabled();
+ }
+ InspectorBackend.getInspectorState(populateInspectorState);
+
InspectorBackend.populateScriptObjects();
// As a DOMAgent method, this needs to happen after the frontend has loaded and the agent is available.
@@ -720,22 +730,10 @@ WebInspector.disconnectFromBackend = function()
InspectorFrontendHost.disconnectFromBackend();
}
-WebInspector.documentMouseOver = function(event)
-{
- if (event.target.tagName !== "A")
- return;
-
- const anchor = event.target;
- if (!anchor.hasStyleClass("webkit-html-resource-link"))
- return;
- if (anchor.href && anchor.href.indexOf("/data:") != -1)
- return;
-}
-
WebInspector.documentClick = function(event)
{
var anchor = event.target.enclosingNodeOrSelfWithNodeName("a");
- if (!anchor)
+ if (!anchor || anchor.target === "_blank")
return;
// Prevent the link from navigating, since we don't do any navigation by following links normally.
@@ -788,6 +786,16 @@ WebInspector.documentClick = function(event)
followLink();
}
+WebInspector.openResource = function(resourceURL, inResourcesPanel)
+{
+ var resource = WebInspector.resourceForURL(resourceURL);
+ if (inResourcesPanel && resource) {
+ WebInspector.panels.resources.showResource(resource);
+ WebInspector.showPanel("resources");
+ } else
+ InspectorBackend.openInInspectedWindow(resource ? resource.url : resourceURL);
+}
+
WebInspector._registerShortcuts = function()
{
var shortcut = WebInspector.KeyboardShortcut;
@@ -1223,6 +1231,8 @@ WebInspector.updateResource = function(payload)
resource.requestMethod = payload.requestMethod;
resource.requestFormData = payload.requestFormData;
resource.documentURL = payload.documentURL;
+ if (typeof payload.webSocketRequestKey3 !== "undefined")
+ resource.webSocketRequestKey3 = payload.webSocketRequestKey3;
if (resource.mainResource)
this.mainResource = resource;
@@ -1247,6 +1257,8 @@ WebInspector.updateResource = function(payload)
resource.connectionReused = payload.connectionReused;
resource.timing = payload.timing;
resource.cached = payload.cached;
+ if (typeof payload.webSocketChallengeResponse !== "undefined")
+ resource.webSocketChallengeResponse = payload.webSocketChallengeResponse;
}
if (payload.didTypeChange) {
@@ -1370,16 +1382,6 @@ WebInspector.updateNetworkState = function(isNowOnline)
this.panels.storage.updateNetworkState(isNowOnline);
}
-WebInspector.resourceTrackingWasEnabled = function()
-{
- this.panels.resources.resourceTrackingWasEnabled();
-}
-
-WebInspector.resourceTrackingWasDisabled = function()
-{
- this.panels.resources.resourceTrackingWasDisabled();
-}
-
WebInspector.searchingForNodeWasEnabled = function()
{
this.panels.elements.searchingForNodeWasEnabled();
@@ -1390,16 +1392,6 @@ WebInspector.searchingForNodeWasDisabled = function()
this.panels.elements.searchingForNodeWasDisabled();
}
-WebInspector.monitoringXHRWasEnabled = function()
-{
- this.monitoringXHREnabled = true;
-}
-
-WebInspector.monitoringXHRWasDisabled = function()
-{
- this.monitoringXHREnabled = false;
-}
-
WebInspector.attachDebuggerWhenShown = function()
{
this.panels.scripts.attachDebuggerWhenShown();
@@ -1447,7 +1439,7 @@ WebInspector.failedToParseScriptSource = function(sourceURL, source, startingLin
WebInspector.pausedScript = function(details)
{
- this.panels.scripts.debuggerPaused(details.callFrames);
+ this.panels.scripts.debuggerPaused(details);
InspectorFrontendHost.bringToFront();
}
@@ -1474,7 +1466,7 @@ WebInspector.reset = function()
this.resourceURLMap = {};
this.cookieDomains = {};
this.applicationCacheDomains = {};
- this.hoveredDOMNode = null;
+ this.highlightDOMNode(0);
delete this.mainResource;
@@ -1683,13 +1675,8 @@ WebInspector.drawLoadingPieChart = function(canvas, percent) {
WebInspector.updateFocusedNode = function(nodeId)
{
- var node = WebInspector.domAgent.nodeForId(nodeId);
- if (!node)
- // FIXME: Should we deselect if null is passed in?
- return;
-
- this.currentPanel = this.panels.elements;
- this.panels.elements.focusedDOMNode = node;
+ this._updateFocusedNode(nodeId);
+ this.highlightDOMNodeForTwoSeconds(nodeId);
}
WebInspector.displayNameForURL = function(url)
@@ -1804,7 +1791,6 @@ WebInspector.linkifyURLAsNode = function(url, linkText, classes, isExternal, too
a.title = url;
else if (typeof tooltipText !== "string" || tooltipText.length)
a.title = tooltipText;
- a.target = "_blank";
a.textContent = linkText;
return a;
@@ -1828,6 +1814,29 @@ WebInspector.linkifyResourceAsNode = function(url, preferredPanel, lineNumber, c
return node;
}
+WebInspector.resourceURLForRelatedNode = function(node, url)
+{
+ if (!url || url.indexOf("://") > 0)
+ return url;
+
+ for (var frameOwnerCandidate = node; frameOwnerCandidate; frameOwnerCandidate = frameOwnerCandidate.parentNode) {
+ if (frameOwnerCandidate.documentURL) {
+ var result = WebInspector.completeURL(frameOwnerCandidate.documentURL, url);
+ if (result)
+ return result;
+ break;
+ }
+ }
+
+ // documentURL not found or has bad value
+ for (var resourceURL in WebInspector.resourceURLMap) {
+ var match = resourceURL.match(WebInspector.URLRegExp);
+ if (match && match[4] === url)
+ return resourceURL;
+ }
+ return url;
+},
+
WebInspector.completeURL = function(baseURL, href)
{
var match = baseURL.match(WebInspector.URLRegExp);
@@ -1850,7 +1859,6 @@ WebInspector.addMainEventListeners = function(doc)
doc.defaultView.addEventListener("focus", this.windowFocused.bind(this), false);
doc.defaultView.addEventListener("blur", this.windowBlurred.bind(this), false);
doc.addEventListener("click", this.documentClick.bind(this), true);
- doc.addEventListener("mouseover", this.documentMouseOver.bind(this), true);
}
WebInspector._searchFieldManualFocus = function(event)
@@ -2008,6 +2016,11 @@ WebInspector.UIString = function(string)
return String.vsprintf(string, Array.prototype.slice.call(arguments, 1));
}
+WebInspector.formatLocalized = function(format, substitutions, formatters, initialValue, append)
+{
+ return String.format(WebInspector.UIString(format), substitutions, formatters, initialValue, append);
+}
+
WebInspector.isMac = function()
{
if (!("_isMac" in this))
diff --git a/WebCore/inspector/front-end/treeoutline.js b/WebCore/inspector/front-end/treeoutline.js
index 5891401..c2a3fe7 100644
--- a/WebCore/inspector/front-end/treeoutline.js
+++ b/WebCore/inspector/front-end/treeoutline.js
@@ -651,6 +651,7 @@ TreeElement.treeElementToggled = function(event)
else
element.treeElement.expand();
}
+ event.stopPropagation();
}
TreeElement.treeElementDoubleClicked = function(event)
diff --git a/WebCore/inspector/front-end/utilities.js b/WebCore/inspector/front-end/utilities.js
index e8adff6..5e41da6 100644
--- a/WebCore/inspector/front-end/utilities.js
+++ b/WebCore/inspector/front-end/utilities.js
@@ -984,3 +984,12 @@ function createSearchRegex(query)
}
return new RegExp(regex, "i");
}
+
+function offerFileForDownload(contents)
+{
+ var builder = new BlobBuilder();
+ builder.append(contents);
+ var blob = builder.getBlob("application/octet-stream");
+ var url = window.createBlobURL(blob);
+ window.open(url);
+}
diff --git a/WebCore/loader/Cache.cpp b/WebCore/loader/Cache.cpp
index 7acbd56..dbcec00 100644
--- a/WebCore/loader/Cache.cpp
+++ b/WebCore/loader/Cache.cpp
@@ -99,17 +99,16 @@ CachedResource* Cache::requestResource(CachedResourceLoader* cachedResourceLoade
// Would it be better to just go on with the cache code and let it fail later?
if (url.isEmpty())
return 0;
-
+
// Look up the resource in our map.
CachedResource* resource = resourceForURL(url.string());
-
+
if (resource && requestIsPreload && !resource->isPreloaded())
return 0;
-
- if (SecurityOrigin::restrictAccessToLocal() && !SecurityOrigin::canDisplay(url, String(), cachedResourceLoader->doc())) {
- Document* doc = cachedResourceLoader->doc();
- if (doc && !requestIsPreload)
- FrameLoader::reportLocalLoadFailed(doc->frame(), url.string());
+
+ if (!cachedResourceLoader->doc()->securityOrigin()->canDisplay(url)) {
+ if (!requestIsPreload)
+ FrameLoader::reportLocalLoadFailed(cachedResourceLoader->doc()->frame(), url.string());
return 0;
}
diff --git a/WebCore/loader/DocumentLoader.cpp b/WebCore/loader/DocumentLoader.cpp
index 1bb2f87..b0c0e0a 100644
--- a/WebCore/loader/DocumentLoader.cpp
+++ b/WebCore/loader/DocumentLoader.cpp
@@ -43,6 +43,7 @@
#include "Event.h"
#include "Frame.h"
#include "FrameLoader.h"
+#include "FrameLoaderClient.h"
#include "FrameTree.h"
#include "HistoryItem.h"
#include "Logging.h"
@@ -53,6 +54,7 @@
#include "SharedBuffer.h"
#include <wtf/Assertions.h>
+#include <wtf/text/CString.h>
#include <wtf/unicode/Unicode.h>
namespace WebCore {
@@ -281,8 +283,27 @@ void DocumentLoader::commitLoad(const char* data, int length)
RefPtr<DocumentLoader> protect(this);
commitIfReady();
- if (FrameLoader* frameLoader = DocumentLoader::frameLoader())
- frameLoader->committedLoad(this, data, length);
+ FrameLoader* frameLoader = DocumentLoader::frameLoader();
+ if (!frameLoader)
+ return;
+ if (ArchiveFactory::isArchiveMimeType(response().mimeType()))
+ return;
+ frameLoader->client()->committedLoad(this, data, length);
+}
+
+void DocumentLoader::commitData(const char* bytes, int length)
+{
+ // Set the text encoding. This is safe to call multiple times.
+ bool userChosen = true;
+ String encoding = overrideEncoding();
+ if (encoding.isNull()) {
+ userChosen = false;
+ encoding = response().textEncodingName();
+ }
+ // FIXME: DocumentWriter should be owned by DocumentLoader.
+ m_frame->loader()->writer()->setEncoding(encoding, userChosen);
+ ASSERT(m_frame->document()->parsing());
+ m_frame->loader()->writer()->addData(bytes, length);
}
bool DocumentLoader::doesProgressiveLoad(const String& MIMEType) const
@@ -547,7 +568,7 @@ void DocumentLoader::substituteResourceDeliveryTimerFired(Timer<DocumentLoader>*
loader->didReceiveResponse(resource->response());
loader->didReceiveData(data->data(), data->size(), data->size(), true);
- loader->didFinishLoading();
+ loader->didFinishLoading(0);
} else {
// A null resource means that we should fail the load.
// FIXME: Maybe we should use another error here - something like "not in cache".
diff --git a/WebCore/loader/DocumentLoader.h b/WebCore/loader/DocumentLoader.h
index bc81350..ebb6525 100644
--- a/WebCore/loader/DocumentLoader.h
+++ b/WebCore/loader/DocumentLoader.h
@@ -215,6 +215,10 @@ namespace WebCore {
DocumentLoadTiming* timing() { return &m_documentLoadTiming; }
void resetTiming() { m_documentLoadTiming = DocumentLoadTiming(); }
+ // The WebKit layer calls this function when it's ready for the data to
+ // actually be added to the document.
+ void commitData(const char* bytes, int length);
+
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
ApplicationCacheHost* applicationCacheHost() const { return m_applicationCacheHost.get(); }
#endif
diff --git a/WebCore/loader/EmptyClients.h b/WebCore/loader/EmptyClients.h
index e012b64..f295663 100644
--- a/WebCore/loader/EmptyClients.h
+++ b/WebCore/loader/EmptyClients.h
@@ -309,6 +309,7 @@ public:
virtual bool canHandleRequest(const ResourceRequest&) const { return false; }
virtual bool canShowMIMEType(const String&) const { return false; }
+ virtual bool canShowMIMETypeAsHTML(const String&) const { return false; }
virtual bool representationExistsForURLScheme(const String&) const { return false; }
virtual String generatedMIMETypeForURLScheme(const String&) const { return ""; }
@@ -442,6 +443,8 @@ public:
virtual void markedTextAbandoned(Frame*) { }
virtual NSString* userVisibleString(NSURL*) { return 0; }
+ virtual DocumentFragment* documentFragmentFromAttributedString(NSAttributedString*, Vector<RefPtr<ArchiveResource> >&) { return 0; };
+ virtual void setInsertionPasteboard(NSPasteboard*) { };
#ifdef BUILDING_ON_TIGER
virtual NSArray* pasteboardTypesForSelection(Frame*) { return 0; }
#endif
@@ -475,6 +478,7 @@ public:
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
virtual void showCorrectionPanel(const FloatRect&, const String&, const String&, Editor*) { }
virtual void dismissCorrectionPanel(bool) { }
+ virtual bool isShowingCorrectionPanel() { return false; }
#endif
virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&) { }
virtual void updateSpellingUIWithMisspelledWord(const String&) { }
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 17db3fa..35909ea 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -1107,14 +1107,6 @@ void FrameLoader::willSetEncoding()
receivedFirstData();
}
-void FrameLoader::addData(const char* bytes, int length)
-{
- ASSERT(m_workingURL.isEmpty());
- ASSERT(m_frame->document());
- ASSERT(m_frame->document()->parsing());
- writer()->addData(bytes, length);
-}
-
#if ENABLE(WML)
static inline bool frameContainsWMLContent(Frame* frame)
{
@@ -1283,9 +1275,10 @@ void FrameLoader::loadFrameRequest(const FrameLoadRequest& request, bool lockHis
referrer = m_outgoingReferrer;
ASSERT(frame()->document());
- if (SchemeRegistry::shouldTreatURLAsLocal(url.string()) && !isFeedWithNestedProtocolInHTTPFamily(url)) {
- if (!SecurityOrigin::canDisplay(url, String(), frame()->document()) && !SecurityOrigin::canDisplay(url, referrer, 0)) {
- FrameLoader::reportLocalLoadFailed(m_frame, url.string());
+ // FIXME: Should we move the isFeedWithNestedProtocolInHTTPFamily logic inside SecurityOrigin::canDisplay?
+ if (!isFeedWithNestedProtocolInHTTPFamily(url)) {
+ if (!frame()->document()->securityOrigin()->canDisplay(url) && !SecurityOrigin::deprecatedCanDisplay(referrer, url)) {
+ reportLocalLoadFailed(m_frame, url.string());
return;
}
}
@@ -1519,11 +1512,6 @@ const ResourceRequest& FrameLoader::initialRequest() const
return activeDocumentLoader()->originalRequest();
}
-void FrameLoader::receivedData(const char* data, int length)
-{
- activeDocumentLoader()->receivedData(data, length);
-}
-
bool FrameLoader::willLoadMediaElementURL(KURL& url)
{
ResourceRequest request(url);
@@ -1880,6 +1868,14 @@ void FrameLoader::commitProvisionalLoad()
if (cachedPage && cachedPage->document()) {
prepareForCachedPageRestore();
cachedPage->restore(m_frame->page());
+
+ dispatchDidCommitLoad();
+
+ // If we have a title let the WebView know about it.
+ String title = m_documentLoader->title();
+ if (!title.isNull())
+ m_client->dispatchDidReceiveTitle(title);
+
checkCompleted();
} else {
KURL url = pdl->substituteData().responseURL();
@@ -1960,7 +1956,6 @@ void FrameLoader::transitionToCommitted(PassRefPtr<CachedPage> cachedPage)
// Handle adding the URL to the back/forward list.
DocumentLoader* dl = m_documentLoader.get();
- String ptitle = dl->title();
switch (m_loadType) {
case FrameLoadTypeForward:
@@ -2037,14 +2032,6 @@ void FrameLoader::transitionToCommitted(PassRefPtr<CachedPage> cachedPage)
if (!m_client->hasHTMLView())
receivedFirstData();
- else if (cachedPage) {
- // For non-cached HTML pages, these methods are called in receivedFirstData().
- dispatchDidCommitLoad();
-
- // If we have a title let the WebView know about it.
- if (!ptitle.isNull())
- m_client->dispatchDidReceiveTitle(ptitle);
- }
}
void FrameLoader::clientRedirectCancelledOrFinished(bool cancelWithLoadInProgress)
@@ -2260,8 +2247,10 @@ void FrameLoader::finishedLoadingDocument(DocumentLoader* loader)
if (!archive)
return;
- loader->addAllArchiveResources(archive.get());
+ // FIXME: The remainder of this function should be in DocumentLoader.
+ loader->addAllArchiveResources(archive.get());
+
ArchiveResource* mainResource = archive->mainResource();
loader->setParsedArchiveData(mainResource->data());
@@ -2270,9 +2259,11 @@ void FrameLoader::finishedLoadingDocument(DocumentLoader* loader)
closeURL();
didOpenURL(mainResource->url());
+ ASSERT(m_frame->document());
String userChosenEncoding = documentLoader()->overrideEncoding();
bool encodingIsUserChosen = !userChosenEncoding.isNull();
writer()->setEncoding(encodingIsUserChosen ? userChosenEncoding : mainResource->textEncoding(), encodingIsUserChosen);
+<<<<<<< HEAD
ASSERT(m_frame->document());
@@ -2280,6 +2271,9 @@ void FrameLoader::finishedLoadingDocument(DocumentLoader* loader)
#else
m_client->finishedLoading(loader);
#endif // ARCHIVE
+=======
+ writer()->addData(mainResource->data()->data(), mainResource->data()->size());
+>>>>>>> webkit.org at r67908
}
bool FrameLoader::isReplacing() const
@@ -2738,6 +2732,7 @@ void FrameLoader::addHTTPOriginIfNeeded(ResourceRequest& request, String origin)
request.setHTTPOrigin(origin);
}
+<<<<<<< HEAD
void FrameLoader::committedLoad(DocumentLoader* loader, const char* data, int length)
{
#if ENABLE(ARCHIVE) // ANDROID extension: disabled to reduce code size
@@ -2747,6 +2742,8 @@ void FrameLoader::committedLoad(DocumentLoader* loader, const char* data, int le
m_client->committedLoad(loader, data, length);
}
+=======
+>>>>>>> webkit.org at r67908
void FrameLoader::loadPostRequest(const ResourceRequest& inRequest, const String& referrer, const String& frameName, bool lockHistory, FrameLoadType loadType, PassRefPtr<Event> event, PassRefPtr<FormState> prpFormState)
{
RefPtr<FormState> formState = prpFormState;
@@ -2817,7 +2814,7 @@ unsigned long FrameLoader::loadResourceSynchronously(const ResourceRequest& requ
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
if (!documentLoader()->applicationCacheHost()->maybeLoadSynchronously(newRequest, error, response, data)) {
#endif
- ResourceHandle::loadResourceSynchronously(newRequest, storedCredentials, error, response, data, m_frame);
+ ResourceHandle::loadResourceSynchronously(networkingContext(), newRequest, storedCredentials, error, response, data);
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
documentLoader()->applicationCacheHost()->maybeLoadFallbackSynchronously(newRequest, error, response, data);
}
@@ -3094,6 +3091,9 @@ void FrameLoader::loadedResourceFromMemoryCache(const CachedResource* resource)
unsigned long identifier;
ResourceError error;
requestFromDelegate(request, identifier, error);
+#if ENABLE(INSPECTOR)
+ page->inspectorController()->markResourceAsCached(identifier);
+#endif
notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, resource->response(), resource->encodedSize(), error);
}
diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h
index a887e3b..965e57f 100644
--- a/WebCore/loader/FrameLoader.h
+++ b/WebCore/loader/FrameLoader.h
@@ -157,7 +157,6 @@ public:
const ResourceRequest& originalRequest() const;
const ResourceRequest& initialRequest() const;
void receivedMainResourceError(const ResourceError&, bool isComplete);
- void receivedData(const char*, int);
bool willLoadMediaElementURL(KURL&);
@@ -183,7 +182,6 @@ public:
void didReceiveServerRedirectForProvisionalLoadForFrame();
void finishedLoadingDocument(DocumentLoader*);
- void committedLoad(DocumentLoader*, const char*, int);
bool isReplacing() const;
void setReplacing();
void revertToProvisional(DocumentLoader*);
@@ -266,8 +264,6 @@ public:
void resetMultipleFormSubmissionProtection();
- void addData(const char* bytes, int length);
-
void checkCallImplicitClose();
void frameDetached();
@@ -337,7 +333,7 @@ public:
bool pageDismissalEventBeingDispatched() const { return m_pageDismissalEventBeingDispatched; }
- inline NetworkingContext* networkingContext() const;
+ NetworkingContext* networkingContext() const;
private:
bool canCachePageContainingThisFrame();
diff --git a/WebCore/loader/FrameLoaderClient.h b/WebCore/loader/FrameLoaderClient.h
index 7c28c51..427b81e 100644
--- a/WebCore/loader/FrameLoaderClient.h
+++ b/WebCore/loader/FrameLoaderClient.h
@@ -204,6 +204,7 @@ namespace WebCore {
virtual bool canHandleRequest(const ResourceRequest&) const = 0;
virtual bool canShowMIMEType(const String& MIMEType) const = 0;
+ virtual bool canShowMIMETypeAsHTML(const String& MIMEType) const = 0;
virtual bool representationExistsForURLScheme(const String& URLScheme) const = 0;
virtual String generatedMIMETypeForURLScheme(const String& URLScheme) const = 0;
diff --git a/WebCore/loader/MainResourceLoader.cpp b/WebCore/loader/MainResourceLoader.cpp
index a7a5968..d976841 100644
--- a/WebCore/loader/MainResourceLoader.cpp
+++ b/WebCore/loader/MainResourceLoader.cpp
@@ -146,7 +146,7 @@ bool MainResourceLoader::isPostOrRedirectAfterPost(const ResourceRequest& newReq
void MainResourceLoader::addData(const char* data, int length, bool allAtOnce)
{
ResourceLoader::addData(data, length, allAtOnce);
- frameLoader()->receivedData(data, length);
+ documentLoader()->receivedData(data, length);
}
void MainResourceLoader::willSendRequest(ResourceRequest& newRequest, const ResourceResponse& redirectResponse)
@@ -275,9 +275,9 @@ void MainResourceLoader::continueAfterContentPolicy(PolicyAction contentPolicy,
if (m_substituteData.content()->size())
didReceiveData(m_substituteData.content()->data(), m_substituteData.content()->size(), m_substituteData.content()->size(), true);
if (frameLoader() && !frameLoader()->isStopping())
- didFinishLoading();
+ didFinishLoading(0);
} else if (shouldLoadAsEmptyDocument(url) || frameLoader()->representationExistsForURLScheme(url.protocol()))
- didFinishLoading();
+ didFinishLoading(0);
}
}
@@ -420,7 +420,7 @@ void MainResourceLoader::didReceiveData(const char* data, int length, long long
ResourceLoader::didReceiveData(data, length, lengthReceived, allAtOnce);
}
-void MainResourceLoader::didFinishLoading()
+void MainResourceLoader::didFinishLoading(double finishTime)
{
// There is a bug in CFNetwork where callbacks can be dispatched even when loads are deferred.
// See <rdar://problem/6304600> for more details.
@@ -439,7 +439,7 @@ void MainResourceLoader::didFinishLoading()
ASSERT(!documentLoader()->timing()->responseEnd);
documentLoader()->timing()->responseEnd = m_timeOfLastDataReceived;
frameLoader()->finishedLoading();
- ResourceLoader::didFinishLoading();
+ ResourceLoader::didFinishLoading(finishTime);
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
dl->applicationCacheHost()->finishedLoadingMainResource();
@@ -538,7 +538,7 @@ bool MainResourceLoader::loadNow(ResourceRequest& r)
else if (shouldLoadEmpty || frameLoader()->representationExistsForURLScheme(url.protocol()))
handleEmptyLoad(url, !shouldLoadEmpty);
else
- m_handle = ResourceHandle::create(r, this, m_frame.get(), false, true);
+ m_handle = ResourceHandle::create(m_frame->loader()->networkingContext(), r, this, false, true);
return false;
}
diff --git a/WebCore/loader/MainResourceLoader.h b/WebCore/loader/MainResourceLoader.h
index e2d075c..35eab2f 100644
--- a/WebCore/loader/MainResourceLoader.h
+++ b/WebCore/loader/MainResourceLoader.h
@@ -58,7 +58,7 @@ namespace WebCore {
virtual void willSendRequest(ResourceRequest&, const ResourceResponse& redirectResponse);
virtual void didReceiveResponse(const ResourceResponse&);
virtual void didReceiveData(const char*, int, long long lengthReceived, bool allAtOnce);
- virtual void didFinishLoading();
+ virtual void didFinishLoading(double finishTime);
virtual void didFail(const ResourceError&);
#if HAVE(RUNLOOP_TIMER)
diff --git a/WebCore/loader/NetscapePlugInStreamLoader.cpp b/WebCore/loader/NetscapePlugInStreamLoader.cpp
index 9d0e81b..1225652 100644
--- a/WebCore/loader/NetscapePlugInStreamLoader.cpp
+++ b/WebCore/loader/NetscapePlugInStreamLoader.cpp
@@ -95,13 +95,13 @@ void NetscapePlugInStreamLoader::didReceiveData(const char* data, int length, lo
ResourceLoader::didReceiveData(data, length, lengthReceived, allAtOnce);
}
-void NetscapePlugInStreamLoader::didFinishLoading()
+void NetscapePlugInStreamLoader::didFinishLoading(double finishTime)
{
RefPtr<NetscapePlugInStreamLoader> protect(this);
m_documentLoader->removePlugInStreamLoader(this);
m_client->didFinishLoading(this);
- ResourceLoader::didFinishLoading();
+ ResourceLoader::didFinishLoading(finishTime);
}
void NetscapePlugInStreamLoader::didFail(const ResourceError& error)
diff --git a/WebCore/loader/NetscapePlugInStreamLoader.h b/WebCore/loader/NetscapePlugInStreamLoader.h
index 092c6fc..c8c4cb6 100644
--- a/WebCore/loader/NetscapePlugInStreamLoader.h
+++ b/WebCore/loader/NetscapePlugInStreamLoader.h
@@ -55,7 +55,7 @@ namespace WebCore {
private:
virtual void didReceiveResponse(const ResourceResponse&);
virtual void didReceiveData(const char*, int, long long lengthReceived, bool allAtOnce);
- virtual void didFinishLoading();
+ virtual void didFinishLoading(double finishTime);
virtual void didFail(const ResourceError&);
virtual void releaseResources();
diff --git a/WebCore/loader/PingLoader.cpp b/WebCore/loader/PingLoader.cpp
index 268e007..2a628ce 100644
--- a/WebCore/loader/PingLoader.cpp
+++ b/WebCore/loader/PingLoader.cpp
@@ -42,7 +42,7 @@ namespace WebCore {
void PingLoader::loadImage(Frame* frame, const KURL& url)
{
- if (SecurityOrigin::restrictAccessToLocal() && !SecurityOrigin::canDisplay(url, String(), frame->document())) {
+ if (!frame->document()->securityOrigin()->canDisplay(url)) {
FrameLoader::reportLocalLoadFailed(frame, url);
return;
}
@@ -62,7 +62,7 @@ void PingLoader::loadImage(Frame* frame, const KURL& url)
PingLoader::PingLoader(Frame* frame, const ResourceRequest& request)
{
- m_handle = ResourceHandle::create(request, this, frame, false, false);
+ m_handle = ResourceHandle::create(frame->loader()->networkingContext(), request, this, false, false);
}
PingLoader::~PingLoader()
diff --git a/WebCore/loader/PingLoader.h b/WebCore/loader/PingLoader.h
index 1d8a2d8..e26a9c9 100644
--- a/WebCore/loader/PingLoader.h
+++ b/WebCore/loader/PingLoader.h
@@ -60,7 +60,7 @@ private:
void didReceiveResponse(ResourceHandle*, const ResourceResponse&) { delete this; }
void didReceiveData(ResourceHandle*, const char*, int) { delete this; }
- void didFinishLoading(ResourceHandle*) { delete this; }
+ void didFinishLoading(ResourceHandle*, double) { delete this; }
void didFail(ResourceHandle*, const ResourceError&) { delete this; }
RefPtr<ResourceHandle> m_handle;
diff --git a/WebCore/loader/RedirectScheduler.cpp b/WebCore/loader/RedirectScheduler.cpp
index 7cb6090..ce0e3f8 100644
--- a/WebCore/loader/RedirectScheduler.cpp
+++ b/WebCore/loader/RedirectScheduler.cpp
@@ -33,6 +33,7 @@
#include "RedirectScheduler.h"
#include "BackForwardList.h"
+#include "DOMWindow.h"
#include "DocumentLoader.h"
#include "Event.h"
#include "FormState.h"
@@ -41,9 +42,9 @@
#include "FrameLoadRequest.h"
#include "FrameLoader.h"
#include "FrameLoaderStateMachine.h"
-#include "HistoryItem.h"
#include "HTMLFormElement.h"
#include "HTMLFrameOwnerElement.h"
+#include "HistoryItem.h"
#include "Page.h"
#include "UserGestureIndicator.h"
#include <wtf/CurrentTime.h>
@@ -52,12 +53,13 @@ namespace WebCore {
class ScheduledNavigation : public Noncopyable {
public:
- ScheduledNavigation(double delay, bool lockHistory, bool lockBackForwardList, bool wasDuringLoad, bool isLocationChange)
+ ScheduledNavigation(double delay, bool lockHistory, bool lockBackForwardList, bool wasDuringLoad, bool isLocationChange, bool wasUserGesture)
: m_delay(delay)
, m_lockHistory(lockHistory)
, m_lockBackForwardList(lockBackForwardList)
, m_wasDuringLoad(wasDuringLoad)
, m_isLocationChange(isLocationChange)
+ , m_wasUserGesture(wasUserGesture)
{
}
virtual ~ScheduledNavigation() { }
@@ -73,6 +75,7 @@ public:
bool lockBackForwardList() const { return m_lockBackForwardList; }
bool wasDuringLoad() const { return m_wasDuringLoad; }
bool isLocationChange() const { return m_isLocationChange; }
+ bool wasUserGesture() const { return m_wasUserGesture; }
private:
double m_delay;
@@ -80,22 +83,22 @@ private:
bool m_lockBackForwardList;
bool m_wasDuringLoad;
bool m_isLocationChange;
+ bool m_wasUserGesture;
};
class ScheduledURLNavigation : public ScheduledNavigation {
public:
ScheduledURLNavigation(double delay, const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture, bool duringLoad, bool isLocationChange)
- : ScheduledNavigation(delay, lockHistory, lockBackForwardList, duringLoad, isLocationChange)
+ : ScheduledNavigation(delay, lockHistory, lockBackForwardList, duringLoad, isLocationChange, wasUserGesture)
, m_url(url)
, m_referrer(referrer)
- , m_wasUserGesture(wasUserGesture)
, m_haveToldClient(false)
{
}
virtual void fire(Frame* frame)
{
- frame->loader()->changeLocation(KURL(ParsedURLString, m_url), m_referrer, lockHistory(), lockBackForwardList(), m_wasUserGesture, false);
+ frame->loader()->changeLocation(KURL(ParsedURLString, m_url), m_referrer, lockHistory(), lockBackForwardList(), wasUserGesture(), false);
}
virtual void didStartTimer(Frame* frame, Timer<RedirectScheduler>* timer)
@@ -115,12 +118,10 @@ public:
String url() const { return m_url; }
String referrer() const { return m_referrer; }
- bool wasUserGesture() const { return m_wasUserGesture; }
private:
String m_url;
String m_referrer;
- bool m_wasUserGesture;
bool m_haveToldClient;
};
@@ -151,14 +152,17 @@ public:
class ScheduledHistoryNavigation : public ScheduledNavigation {
public:
- explicit ScheduledHistoryNavigation(int historySteps) : ScheduledNavigation(0, false, false, false, true), m_historySteps(historySteps) { }
+ explicit ScheduledHistoryNavigation(int historySteps, bool wasUserGesture) : ScheduledNavigation(0, false, false, false, true, wasUserGesture), m_historySteps(historySteps) { }
virtual void fire(Frame* frame)
{
+ UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
+
FrameLoader* loader = frame->loader();
if (!m_historySteps) {
// Special case for go(0) from a frame -> reload only the frame
- loader->urlSelected(loader->url(), "", 0, lockHistory(), lockBackForwardList(), false, SendReferrer);
+ // To follow Firefox and IE's behavior, history reload can only navigate the self frame.
+ loader->urlSelected(loader->url(), "_self", 0, lockHistory(), lockBackForwardList(), wasUserGesture(), SendReferrer);
return;
}
// go(i!=0) from a frame navigates into the history of the frame only,
@@ -173,17 +177,16 @@ private:
class ScheduledFormSubmission : public ScheduledNavigation {
public:
ScheduledFormSubmission(PassRefPtr<FormSubmission> submission, bool lockBackForwardList, bool duringLoad, bool wasUserGesture)
- : ScheduledNavigation(0, submission->lockHistory(), lockBackForwardList, duringLoad, true)
+ : ScheduledNavigation(0, submission->lockHistory(), lockBackForwardList, duringLoad, true, wasUserGesture)
, m_submission(submission)
, m_haveToldClient(false)
- , m_wasUserGesture(wasUserGesture)
{
ASSERT(m_submission->state());
}
virtual void fire(Frame* frame)
{
- UserGestureIndicator gestureIndicator(m_wasUserGesture ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
+ UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
// The submitForm function will find a target frame before using the redirection timer.
// Now that the timer has fired, we need to repeat the security check which normally is done when
@@ -214,7 +217,6 @@ public:
private:
RefPtr<FormSubmission> m_submission;
bool m_haveToldClient;
- bool m_wasUserGesture;
};
RedirectScheduler::RedirectScheduler(Frame* frame)
@@ -344,9 +346,9 @@ void RedirectScheduler::scheduleHistoryNavigation(int steps)
cancel();
return;
}
-
+
// In all other cases, schedule the history traversal to occur asynchronously.
- schedule(adoptPtr(new ScheduledHistoryNavigation(steps)));
+ schedule(adoptPtr(new ScheduledHistoryNavigation(steps, m_frame->loader()->isProcessingUserGesture())));
}
void RedirectScheduler::timerFired(Timer<RedirectScheduler>*)
diff --git a/WebCore/loader/ResourceLoadNotifier.cpp b/WebCore/loader/ResourceLoadNotifier.cpp
index d225cb8..c43a1da 100644
--- a/WebCore/loader/ResourceLoadNotifier.cpp
+++ b/WebCore/loader/ResourceLoadNotifier.cpp
@@ -82,11 +82,11 @@ void ResourceLoadNotifier::didReceiveData(ResourceLoader* loader, const char* da
dispatchDidReceiveContentLength(loader->documentLoader(), loader->identifier(), lengthReceived);
}
-void ResourceLoadNotifier::didFinishLoad(ResourceLoader* loader)
+void ResourceLoadNotifier::didFinishLoad(ResourceLoader* loader, double finishTime)
{
if (Page* page = m_frame->page())
page->progress()->completeProgress(loader->identifier());
- dispatchDidFinishLoading(loader->documentLoader(), loader->identifier());
+ dispatchDidFinishLoading(loader->documentLoader(), loader->identifier(), finishTime);
}
void ResourceLoadNotifier::didFailToLoad(ResourceLoader* loader, const ResourceError& error)
@@ -150,13 +150,13 @@ void ResourceLoadNotifier::dispatchDidReceiveContentLength(DocumentLoader* loade
#endif
}
-void ResourceLoadNotifier::dispatchDidFinishLoading(DocumentLoader* loader, unsigned long identifier)
+void ResourceLoadNotifier::dispatchDidFinishLoading(DocumentLoader* loader, unsigned long identifier, double finishTime)
{
m_frame->loader()->client()->dispatchDidFinishLoading(loader, identifier);
#if ENABLE(INSPECTOR)
if (Page* page = m_frame->page())
- page->inspectorController()->didFinishLoading(identifier);
+ page->inspectorController()->didFinishLoading(identifier, finishTime);
#endif
}
@@ -169,7 +169,7 @@ void ResourceLoadNotifier::sendRemainingDelegateMessages(DocumentLoader* loader,
dispatchDidReceiveContentLength(loader, identifier, length);
if (error.isNull())
- dispatchDidFinishLoading(loader, identifier);
+ dispatchDidFinishLoading(loader, identifier, 0);
else
m_frame->loader()->client()->dispatchDidFailLoading(loader, identifier, error);
}
diff --git a/WebCore/loader/ResourceLoadNotifier.h b/WebCore/loader/ResourceLoadNotifier.h
index b0a5cbf..758e414 100644
--- a/WebCore/loader/ResourceLoadNotifier.h
+++ b/WebCore/loader/ResourceLoadNotifier.h
@@ -53,14 +53,14 @@ public:
void willSendRequest(ResourceLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
void didReceiveResponse(ResourceLoader*, const ResourceResponse&);
void didReceiveData(ResourceLoader*, const char*, int, int lengthReceived);
- void didFinishLoad(ResourceLoader*);
+ void didFinishLoad(ResourceLoader*, double finishTime);
void didFailToLoad(ResourceLoader*, const ResourceError&);
void assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&);
void dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse);
void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&);
void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int length);
- void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier);
+ void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier, double finishTime);
void sendRemainingDelegateMessages(DocumentLoader*, unsigned long identifier, const ResourceResponse&, int length, const ResourceError&);
diff --git a/WebCore/loader/ResourceLoader.cpp b/WebCore/loader/ResourceLoader.cpp
index f66aa67..3bc1119 100644
--- a/WebCore/loader/ResourceLoader.cpp
+++ b/WebCore/loader/ResourceLoader.cpp
@@ -35,6 +35,8 @@
#include "FileStreamProxy.h"
#include "Frame.h"
#include "FrameLoader.h"
+#include "FrameLoaderClient.h"
+#include "InspectorController.h"
#include "InspectorTimelineAgent.h"
#include "Page.h"
#include "ProgressTracker.h"
@@ -145,7 +147,7 @@ bool ResourceLoader::load(const ResourceRequest& r)
return true;
}
- m_handle = ResourceHandle::create(clientRequest, this, m_frame.get(), m_defersLoading, m_shouldContentSniff);
+ m_handle = ResourceHandle::create(m_frame->loader()->networkingContext(), clientRequest, this, m_defersLoading, m_shouldContentSniff);
return true;
}
@@ -286,7 +288,7 @@ void ResourceLoader::willStopBufferingData(const char* data, int length)
m_resourceData = SharedBuffer::create(data, length);
}
-void ResourceLoader::didFinishLoading()
+void ResourceLoader::didFinishLoading(double finishTime)
{
// If load has been cancelled after finishing (which could happen with a
// JavaScript that changes the window location), do nothing.
@@ -294,11 +296,11 @@ void ResourceLoader::didFinishLoading()
return;
ASSERT(!m_reachedTerminalState);
- didFinishLoadingOnePart();
+ didFinishLoadingOnePart(finishTime);
releaseResources();
}
-void ResourceLoader::didFinishLoadingOnePart()
+void ResourceLoader::didFinishLoadingOnePart(double finishTime)
{
if (m_cancelled)
return;
@@ -308,7 +310,7 @@ void ResourceLoader::didFinishLoadingOnePart()
return;
m_calledDidFinishLoad = true;
if (m_sendResourceLoadCallbacks)
- frameLoader()->notifier()->didFinishLoad(this);
+ frameLoader()->notifier()->didFinishLoad(this, finishTime);
}
void ResourceLoader::didFail(const ResourceError& error)
@@ -450,9 +452,9 @@ void ResourceLoader::didReceiveData(ResourceHandle*, const char* data, int lengt
#endif
}
-void ResourceLoader::didFinishLoading(ResourceHandle*)
+void ResourceLoader::didFinishLoading(ResourceHandle*, double finishTime)
{
- didFinishLoading();
+ didFinishLoading(finishTime);
}
void ResourceLoader::didFail(ResourceHandle*, const ResourceError& error)
diff --git a/WebCore/loader/ResourceLoader.h b/WebCore/loader/ResourceLoader.h
index f2a3161..29afbc1 100644
--- a/WebCore/loader/ResourceLoader.h
+++ b/WebCore/loader/ResourceLoader.h
@@ -86,7 +86,7 @@ namespace WebCore {
virtual void didReceiveData(const char*, int, long long lengthReceived, bool allAtOnce);
virtual void didReceiveCachedMetadata(const char*, int) { }
void willStopBufferingData(const char*, int);
- virtual void didFinishLoading();
+ virtual void didFinishLoading(double finishTime);
virtual void didFail(const ResourceError&);
virtual bool shouldUseCredentialStorage();
@@ -103,7 +103,7 @@ namespace WebCore {
virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
virtual void didReceiveData(ResourceHandle*, const char*, int, int lengthReceived);
virtual void didReceiveCachedMetadata(ResourceHandle*, const char* data, int length) { didReceiveCachedMetadata(data, length); }
- virtual void didFinishLoading(ResourceHandle*);
+ virtual void didFinishLoading(ResourceHandle*, double finishTime);
virtual void didFail(ResourceHandle*, const ResourceError&);
virtual void wasBlocked(ResourceHandle*);
virtual void cannotShowURL(ResourceHandle*);
@@ -139,7 +139,7 @@ namespace WebCore {
#endif
virtual void didCancel(const ResourceError&);
- void didFinishLoadingOnePart();
+ void didFinishLoadingOnePart(double finishTime);
const ResourceRequest& request() const { return m_request; }
bool reachedTerminalState() const { return m_reachedTerminalState; }
diff --git a/WebCore/loader/SubframeLoader.cpp b/WebCore/loader/SubframeLoader.cpp
index c25b37e..e247e5b 100644
--- a/WebCore/loader/SubframeLoader.cpp
+++ b/WebCore/loader/SubframeLoader.cpp
@@ -87,6 +87,15 @@ bool SubframeLoader::requestFrame(HTMLFrameOwnerElement* ownerElement, const Str
return true;
}
+
+bool SubframeLoader::resourceWillUsePlugin(const String& url, const String& mimeType)
+{
+ KURL completedURL;
+ if (!url.isEmpty())
+ completedURL = completeURL(url);
+ bool useFallback;
+ return shouldUsePlugin(completedURL, mimeType, false, useFallback);
+}
bool SubframeLoader::requestObject(HTMLPlugInImageElement* ownerElement, const String& url, const AtomicString& frameName,
const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues)
@@ -147,7 +156,7 @@ PassRefPtr<Widget> SubframeLoader::loadMediaPlayerProxyPlugin(Node* node, const
if (!url.isEmpty())
completedURL = completeURL(url);
- if (!SecurityOrigin::canDisplay(completedURL, String(), m_frame->document())) {
+ if (!m_frame->document()->securityOrigin()->canDisplay(completedURL)) {
FrameLoader::reportLocalLoadFailed(m_frame, completedURL.string());
return 0;
}
@@ -205,7 +214,7 @@ PassRefPtr<Widget> SubframeLoader::createJavaAppletWidget(const IntSize& size, H
if (!codeBaseURLString.isEmpty()) {
KURL codeBaseURL = completeURL(codeBaseURLString);
- if (!SecurityOrigin::canDisplay(codeBaseURL, String(), element->document())) {
+ if (!element->document()->securityOrigin()->canDisplay(codeBaseURL)) {
FrameLoader::reportLocalLoadFailed(m_frame, codeBaseURL.string());
return 0;
}
@@ -247,7 +256,7 @@ Frame* SubframeLoader::loadSubframe(HTMLFrameOwnerElement* ownerElement, const K
marginHeight = o->getMarginHeight();
}
- if (!SecurityOrigin::canDisplay(url, String(), ownerElement->document())) {
+ if (!ownerElement->document()->securityOrigin()->canDisplay(url)) {
FrameLoader::reportLocalLoadFailed(m_frame, url.string());
return 0;
}
@@ -336,7 +345,7 @@ bool SubframeLoader::loadPlugin(HTMLPlugInImageElement* pluginElement, const KUR
if (!renderer || useFallback)
return false;
- if (!SecurityOrigin::canDisplay(url, String(), document())) {
+ if (!document()->securityOrigin()->canDisplay(url)) {
FrameLoader::reportLocalLoadFailed(m_frame, url.string());
return false;
}
diff --git a/WebCore/loader/SubframeLoader.h b/WebCore/loader/SubframeLoader.h
index 6c3baf8..a573045 100644
--- a/WebCore/loader/SubframeLoader.h
+++ b/WebCore/loader/SubframeLoader.h
@@ -75,6 +75,8 @@ public:
bool allowPlugins(ReasonForCallingAllowPlugins);
bool containsPlugins() const { return m_containsPlugins; }
+
+ bool resourceWillUsePlugin(const String& url, const String& mimeType);
private:
Frame* loadOrRedirectSubframe(HTMLFrameOwnerElement*, const KURL&, const AtomicString& frameName, bool lockHistory, bool lockBackForwardList);
diff --git a/WebCore/loader/SubresourceLoader.cpp b/WebCore/loader/SubresourceLoader.cpp
index a389082..5377382 100644
--- a/WebCore/loader/SubresourceLoader.cpp
+++ b/WebCore/loader/SubresourceLoader.cpp
@@ -71,9 +71,7 @@ PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, Subresourc
ResourceRequest newRequest = request;
- if (securityCheck == DoSecurityCheck
- && SecurityOrigin::restrictAccessToLocal()
- && !SecurityOrigin::canDisplay(request.url(), String(), frame->document())) {
+ if (securityCheck == DoSecurityCheck && !frame->document()->securityOrigin()->canDisplay(request.url())) {
FrameLoader::reportLocalLoadFailed(frame, request.url().string());
return 0;
}
@@ -142,7 +140,7 @@ void SubresourceLoader::didReceiveResponse(const ResourceResponse& r)
// After the first multipart section is complete, signal to delegates that this load is "finished"
m_documentLoader->subresourceLoaderFinishedLoadingOnePart(this);
- didFinishLoadingOnePart();
+ didFinishLoadingOnePart(0);
}
}
@@ -170,7 +168,7 @@ void SubresourceLoader::didReceiveCachedMetadata(const char* data, int length)
m_client->didReceiveCachedMetadata(this, data, length);
}
-void SubresourceLoader::didFinishLoading()
+void SubresourceLoader::didFinishLoading(double finishTime)
{
if (cancelled())
return;
@@ -187,7 +185,7 @@ void SubresourceLoader::didFinishLoading()
if (cancelled())
return;
m_documentLoader->removeSubresourceLoader(this);
- ResourceLoader::didFinishLoading();
+ ResourceLoader::didFinishLoading(finishTime);
}
void SubresourceLoader::didFail(const ResourceError& error)
diff --git a/WebCore/loader/SubresourceLoader.h b/WebCore/loader/SubresourceLoader.h
index 4a58345..cb7ed81 100644
--- a/WebCore/loader/SubresourceLoader.h
+++ b/WebCore/loader/SubresourceLoader.h
@@ -52,7 +52,7 @@ namespace WebCore {
virtual void didReceiveResponse(const ResourceResponse&);
virtual void didReceiveData(const char*, int, long long lengthReceived, bool allAtOnce);
virtual void didReceiveCachedMetadata(const char*, int);
- virtual void didFinishLoading();
+ virtual void didFinishLoading(double finishTime);
virtual void didFail(const ResourceError&);
virtual bool shouldUseCredentialStorage();
virtual void didReceiveAuthenticationChallenge(const AuthenticationChallenge&);
diff --git a/WebCore/loader/appcache/ApplicationCacheGroup.cpp b/WebCore/loader/appcache/ApplicationCacheGroup.cpp
index 3ae8d9f..d89f819 100644
--- a/WebCore/loader/appcache/ApplicationCacheGroup.cpp
+++ b/WebCore/loader/appcache/ApplicationCacheGroup.cpp
@@ -39,6 +39,7 @@
#include "DOMWindow.h"
#include "Frame.h"
#include "FrameLoader.h"
+#include "FrameLoaderClient.h"
#include "MainResourceLoader.h"
#include "ManifestParser.h"
#include "Page.h"
@@ -479,7 +480,7 @@ PassRefPtr<ResourceHandle> ApplicationCacheGroup::createResourceHandle(const KUR
}
}
- RefPtr<ResourceHandle> handle = ResourceHandle::create(request, this, m_frame, false, true);
+ RefPtr<ResourceHandle> handle = ResourceHandle::create(m_frame->loader()->networkingContext(), request, this, false, true);
#if ENABLE(INSPECTOR)
// Because willSendRequest only gets called during redirects, we initialize
// the identifier and the first willSendRequest here.
@@ -601,11 +602,11 @@ void ApplicationCacheGroup::didReceiveData(ResourceHandle* handle, const char* d
m_loadedSize += length;
}
-void ApplicationCacheGroup::didFinishLoading(ResourceHandle* handle)
+void ApplicationCacheGroup::didFinishLoading(ResourceHandle* handle, double finishTime)
{
#if ENABLE(INSPECTOR)
if (Page* page = m_frame->page())
- page->inspectorController()->didFinishLoading(m_currentResourceIdentifier);
+ page->inspectorController()->didFinishLoading(m_currentResourceIdentifier, finishTime);
#endif
if (handle == m_manifestHandle) {
diff --git a/WebCore/loader/appcache/ApplicationCacheGroup.h b/WebCore/loader/appcache/ApplicationCacheGroup.h
index b5cdf7b..99ab71a 100644
--- a/WebCore/loader/appcache/ApplicationCacheGroup.h
+++ b/WebCore/loader/appcache/ApplicationCacheGroup.h
@@ -113,7 +113,7 @@ private:
#endif
virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
virtual void didReceiveData(ResourceHandle*, const char*, int length, int lengthReceived);
- virtual void didFinishLoading(ResourceHandle*);
+ virtual void didFinishLoading(ResourceHandle*, double finishTime);
virtual void didFail(ResourceHandle*, const ResourceError&);
void didReceiveManifestResponse(const ResourceResponse&);
diff --git a/WebCore/loader/icon/IconDatabase.cpp b/WebCore/loader/icon/IconDatabase.cpp
index 130b442..6040037 100644
--- a/WebCore/loader/icon/IconDatabase.cpp
+++ b/WebCore/loader/icon/IconDatabase.cpp
@@ -43,6 +43,7 @@
#include <wtf/CurrentTime.h>
#include <wtf/MainThread.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/CString.h>
// For methods that are meant to support API from the main thread - should not be called internally
#define ASSERT_NOT_SYNC_THREAD() ASSERT(!m_syncThreadRunning || !IS_ICON_SYNC_THREAD())
diff --git a/WebCore/loader/icon/IconFetcher.cpp b/WebCore/loader/icon/IconFetcher.cpp
index 1107d7b..f6b80fa 100644
--- a/WebCore/loader/icon/IconFetcher.cpp
+++ b/WebCore/loader/icon/IconFetcher.cpp
@@ -27,6 +27,7 @@
#include "IconFetcher.h"
#include "Frame.h"
+#include "FrameLoaderClient.h"
#include "HTMLHeadElement.h"
#include "HTMLLinkElement.h"
#include "HTMLNames.h"
@@ -173,7 +174,7 @@ void IconFetcher::loadEntry()
ASSERT(m_currentEntry < m_entries.size());
ASSERT(!m_handle);
- m_handle = ResourceHandle::create(m_entries[m_currentEntry].url(), this, m_frame, false, false);
+ m_handle = ResourceHandle::create(m_frame->loader()->networkingContext(), m_entries[m_currentEntry].url(), this, false, false);
}
void IconFetcher::loadFailed()
@@ -201,7 +202,7 @@ void IconFetcher::didReceiveData(ResourceHandle* handle, const char* data, int l
m_entries[m_currentEntry].buffer()->append(data, length);
}
-void IconFetcher::didFinishLoading(ResourceHandle* handle)
+void IconFetcher::didFinishLoading(ResourceHandle* handle, double)
{
ASSERT_UNUSED(handle, m_handle == handle);
diff --git a/WebCore/loader/icon/IconFetcher.h b/WebCore/loader/icon/IconFetcher.h
index 5327693..387e1c3 100644
--- a/WebCore/loader/icon/IconFetcher.h
+++ b/WebCore/loader/icon/IconFetcher.h
@@ -62,12 +62,12 @@ private:
virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
virtual void didReceiveData(ResourceHandle*, const char*, int, int lengthReceived);
- virtual void didFinishLoading(ResourceHandle*);
+ virtual void didFinishLoading(ResourceHandle*, double /*finishTime*/);
virtual void didFail(ResourceHandle*, const ResourceError&);
-
+
Frame* m_frame;
IconFetcherClient* m_client;
-
+
unsigned m_currentEntry;
RefPtr<ResourceHandle> m_handle;
Vector<IconLinkEntry> m_entries;
diff --git a/WebCore/loader/icon/IconLoader.cpp b/WebCore/loader/icon/IconLoader.cpp
index 877c80e..adfa04b 100644
--- a/WebCore/loader/icon/IconLoader.cpp
+++ b/WebCore/loader/icon/IconLoader.cpp
@@ -38,6 +38,7 @@
#include "SharedBuffer.h"
#include "SubresourceLoader.h"
#include <wtf/UnusedParam.h>
+#include <wtf/text/CString.h>
using namespace std;
diff --git a/WebCore/loader/icon/wince/IconDatabaseWince.cpp b/WebCore/loader/icon/wince/IconDatabaseWinCE.cpp
index 54a36e5..54a36e5 100644
--- a/WebCore/loader/icon/wince/IconDatabaseWince.cpp
+++ b/WebCore/loader/icon/wince/IconDatabaseWinCE.cpp
diff --git a/WebCore/manual-tests/qt/numpad-enter-key.html b/WebCore/manual-tests/qt/numpad-enter-key.html
new file mode 100644
index 0000000..ea9b800
--- /dev/null
+++ b/WebCore/manual-tests/qt/numpad-enter-key.html
@@ -0,0 +1,22 @@
+<html>
+<head>
+ <script type="text/javascript">
+ window.onload = function() {
+ document.getElementById('test').addEventListener('keypress', function(e) {
+ out = document.getElementById('out');
+ out.innerHTML = 'keyCode: ' + e.keyCode + ' (should be 13)';
+ if (e.keyCode == 13)
+ out.style.background = '#6f6';
+ else
+ out.style.background = '#f66';
+ }, false);
+ document.getElementById('test').focus()
+ };
+ </script>
+</head>
+<body>
+ <p>Press the numpad Enter key while the input box below is focused:</p>
+ <p><input type="text" id="test" /></p>
+ <p id="out"></p>
+</body>
+</html>
diff --git a/WebCore/manual-tests/selection-drag-crash.html b/WebCore/manual-tests/selection-drag-crash.html
new file mode 100644
index 0000000..42fd740
--- /dev/null
+++ b/WebCore/manual-tests/selection-drag-crash.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+<script>
+function selectText() {
+ window.getSelection().selectAllChildren(document.body);
+}
+</script>
+</head>
+<body onload="selectText()">
+<p>
+Drag the selected text. It shouldn't crash, though it used to on Chromium Mac since createDragImageForSelection() didn't properly use the return value from dissolveDragImageToFraction(), which resulted in a race condition for the drag image's refcount. This issue can't be tested in an automated manner, due to the fact that the race condition is hard to trigger deterministically and that test_shell/DRT simply don't use the (potentially invalid) image parameter.
+</p>
+</body>
+</html>
diff --git a/WebCore/manual-tests/spatial-navigation/links.html b/WebCore/manual-tests/spatial-navigation/links.html
index 18cfd62..18cfd62 100755..100644
--- a/WebCore/manual-tests/spatial-navigation/links.html
+++ b/WebCore/manual-tests/spatial-navigation/links.html
diff --git a/WebCore/manual-tests/spatial-navigation/spatial-navigation-test-cases.html b/WebCore/manual-tests/spatial-navigation/spatial-navigation-test-cases.html
index bf00c23..bf00c23 100755..100644
--- a/WebCore/manual-tests/spatial-navigation/spatial-navigation-test-cases.html
+++ b/WebCore/manual-tests/spatial-navigation/spatial-navigation-test-cases.html
diff --git a/WebCore/page/Chrome.cpp b/WebCore/page/Chrome.cpp
index bff0100..8feedce 100644
--- a/WebCore/page/Chrome.cpp
+++ b/WebCore/page/Chrome.cpp
@@ -350,7 +350,7 @@ void Chrome::setToolTip(const HitTestResult& result)
// Get tooltip representing form action, if relevant
if (node->hasTagName(inputTag)) {
HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
- if (input->inputType() == HTMLInputElement::SUBMIT)
+ if (input->isSubmitButton())
if (HTMLFormElement* form = input->form()) {
toolTip = form->action();
if (form->renderer())
@@ -379,7 +379,7 @@ void Chrome::setToolTip(const HitTestResult& result)
if (Node* node = result.innerNonSharedNode()) {
if (node->hasTagName(inputTag)) {
HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
- if (input->inputType() == HTMLInputElement::FILE) {
+ if (input->isFileUpload()) {
FileList* files = input->files();
unsigned listSize = files->length();
if (files && listSize > 1) {
diff --git a/WebCore/page/ContextMenuController.cpp b/WebCore/page/ContextMenuController.cpp
index 4ce17bd..d2317d2 100644
--- a/WebCore/page/ContextMenuController.cpp
+++ b/WebCore/page/ContextMenuController.cpp
@@ -231,7 +231,7 @@ void ContextMenuController::contextMenuItemSelected(ContextMenuItem* item)
Document* document = frame->document();
RefPtr<ReplaceSelectionCommand> command = ReplaceSelectionCommand::create(document, createFragmentFromMarkup(document, item->title(), ""), true, false, true);
applyCommand(command);
- frame->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
+ frame->selection()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
}
break;
case ContextMenuItemTagIgnoreSpelling:
diff --git a/WebCore/page/DOMTimer.cpp b/WebCore/page/DOMTimer.cpp
index f9178c9..3ac6d15 100644
--- a/WebCore/page/DOMTimer.cpp
+++ b/WebCore/page/DOMTimer.cpp
@@ -60,9 +60,6 @@ DOMTimer::DOMTimer(ScriptExecutionContext* context, PassOwnPtr<ScheduledAction>
double intervalMilliseconds = max(oneMillisecond, timeout * oneMillisecond);
- // Use a minimum interval of 10 ms to match other browsers, but only once we've
- // nested enough to notice that we're repeating.
- // Faster timers might be "better", but they're incompatible.
if (intervalMilliseconds < s_minTimerInterval && m_nestingLevel >= maxTimerNestingLevel)
intervalMilliseconds = s_minTimerInterval;
if (singleShot)
diff --git a/WebCore/page/DOMTimer.h b/WebCore/page/DOMTimer.h
index dc793da..c1d8d9e 100644
--- a/WebCore/page/DOMTimer.h
+++ b/WebCore/page/DOMTimer.h
@@ -49,8 +49,6 @@ namespace WebCore {
virtual void stop();
// The lowest allowable timer setting (in seconds, 0.001 == 1 ms).
- // Default is 10ms.
- // Chromium uses a non-default timeout.
static double minTimerInterval() { return s_minTimerInterval; }
static void setMinTimerInterval(double value) { s_minTimerInterval = value; }
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index eeb57c4..310ab25 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -1053,11 +1053,15 @@ int DOMWindow::innerHeight() const
if (!view)
return 0;
+<<<<<<< HEAD
#if PLATFORM(ANDROID)
return static_cast<int>(view->actualHeight() / view->pageZoomFactor());
#else
return static_cast<int>(view->height() / view->pageZoomFactor());
#endif
+=======
+ return static_cast<int>(view->height() / m_frame->pageZoomFactor());
+>>>>>>> webkit.org at r67908
}
int DOMWindow::innerWidth() const
@@ -1069,11 +1073,15 @@ int DOMWindow::innerWidth() const
if (!view)
return 0;
+<<<<<<< HEAD
#if PLATFORM(ANDROID)
return static_cast<int>(view->actualWidth() / view->pageZoomFactor());
#else
return static_cast<int>(view->width() / view->pageZoomFactor());
#endif
+=======
+ return static_cast<int>(view->width() / m_frame->pageZoomFactor());
+>>>>>>> webkit.org at r67908
}
int DOMWindow::screenX() const
@@ -1111,11 +1119,15 @@ int DOMWindow::scrollX() const
m_frame->document()->updateLayoutIgnorePendingStylesheets();
+<<<<<<< HEAD
#if PLATFORM(ANDROID)
return static_cast<int>(view->actualScrollX() / view->pageZoomFactor());
#else
return static_cast<int>(view->scrollX() / view->pageZoomFactor());
#endif
+=======
+ return static_cast<int>(view->scrollX() / m_frame->pageZoomFactor());
+>>>>>>> webkit.org at r67908
}
int DOMWindow::scrollY() const
@@ -1129,11 +1141,15 @@ int DOMWindow::scrollY() const
m_frame->document()->updateLayoutIgnorePendingStylesheets();
+<<<<<<< HEAD
#if PLATFORM(ANDROID)
return static_cast<int>(view->actualScrollY() / view->pageZoomFactor());
#else
return static_cast<int>(view->scrollY() / view->pageZoomFactor());
#endif
+=======
+ return static_cast<int>(view->scrollY() / m_frame->pageZoomFactor());
+>>>>>>> webkit.org at r67908
}
bool DOMWindow::closed() const
@@ -1353,8 +1369,8 @@ void DOMWindow::scrollTo(int x, int y) const
if (!view)
return;
- int zoomedX = static_cast<int>(x * view->pageZoomFactor());
- int zoomedY = static_cast<int>(y * view->pageZoomFactor());
+ int zoomedX = static_cast<int>(x * m_frame->pageZoomFactor());
+ int zoomedY = static_cast<int>(y * m_frame->pageZoomFactor());
view->setScrollPosition(IntPoint(zoomedX, zoomedY));
}
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index 29d12cc..7ae948c 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -193,6 +193,8 @@ module window {
const unsigned short TEMPORARY = 0;
const unsigned short PERSISTENT = 1;
[EnabledAtRuntime] void requestFileSystem(in unsigned short type, in long long size, in [Callback, Optional] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);
+
+ attribute [EnabledAtRuntime=FileSystem] FlagsConstructor Flags;
#endif
#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
@@ -496,6 +498,7 @@ module window {
attribute EventConstructor Event;
attribute BeforeLoadEventConstructor BeforeLoadEvent;
+ attribute HashChangeEventConstructor HashChangeEvent;
attribute KeyboardEventConstructor KeyboardEvent;
attribute MouseEventConstructor MouseEvent;
attribute MutationEventConstructor MutationEvent;
@@ -755,13 +758,13 @@ module window {
attribute DOMFormDataConstructor FormData;
- attribute [Conditional=BLOB|FILE_WRITER] FileErrorConstructor FileError;
+ attribute [Conditional=BLOB|FILE_SYSTEM] FileErrorConstructor FileError;
attribute [Conditional=BLOB] FileReaderConstructor FileReader;
attribute [Conditional=BLOB] BlobBuilderConstructor BlobBuilder;
#if defined(ENABLE_BLOB) && ENABLE_BLOB
- DOMString createBlobURL(in Blob blob);
+ [ConvertNullStringTo=Undefined] DOMString createBlobURL(in Blob blob);
void revokeBlobURL(in DOMString blobURL);
#endif
diff --git a/WebCore/page/DragController.cpp b/WebCore/page/DragController.cpp
index c623bf6..2e7d241 100644
--- a/WebCore/page/DragController.cpp
+++ b/WebCore/page/DragController.cpp
@@ -255,23 +255,23 @@ static HTMLInputElement* asFileInput(Node* node)
// The button for a FILE input is a sub element with no set input type
// In order to get around this problem we assume any non-FILE input element
// is this internal button, and try querying the shadow parent node.
- if (node->hasTagName(HTMLNames::inputTag) && node->isShadowNode() && static_cast<HTMLInputElement*>(node)->inputType() != HTMLInputElement::FILE)
- node = node->shadowParentNode();
+ if (node->hasTagName(HTMLNames::inputTag) && node->isShadowNode() && !static_cast<HTMLInputElement*>(node)->isFileUpload())
+ node = node->shadowParentNode();
if (!node || !node->hasTagName(HTMLNames::inputTag))
return 0;
- HTMLInputElement* inputElem = static_cast<HTMLInputElement*>(node);
- if (inputElem->inputType() == HTMLInputElement::FILE)
- return inputElem;
+ HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(node);
+ if (!inputElement->isFileUpload())
+ return 0;
- return 0;
+ return inputElement;
}
static Element* elementUnderMouse(Document* documentUnderMouse, const IntPoint& p)
{
- FrameView* view = documentUnderMouse->view();
- float zoomFactor = view ? view->pageZoomFactor() : 1;
+ Frame* frame = documentUnderMouse->frame();
+ float zoomFactor = frame ? frame->pageZoomFactor() : 1;
IntPoint point = roundedIntPoint(FloatPoint(p.x() * zoomFactor, p.y() * zoomFactor));
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
@@ -455,7 +455,7 @@ bool DragController::concludeEditDrag(DragData* dragData)
// NSTextView behavior is to always smart delete on moving a selection,
// but only to smart insert if the selection granularity is word granularity.
bool smartDelete = innerFrame->editor()->smartInsertDeleteEnabled();
- bool smartInsert = smartDelete && innerFrame->selectionGranularity() == WordGranularity && dragData->canSmartReplace();
+ bool smartInsert = smartDelete && innerFrame->selection()->granularity() == WordGranularity && dragData->canSmartReplace();
applyCommand(MoveSelectionCommand::create(fragment, dragCaret.base(), smartInsert, smartDelete));
} else {
if (setSelectionToDragCaret(innerFrame, dragCaret, range, point))
@@ -636,7 +636,7 @@ static IntPoint dragLocForDHTMLDrag(const IntPoint& mouseDraggedPoint, const Int
static IntPoint dragLocForSelectionDrag(Frame* src)
{
- IntRect draggingRect = enclosingIntRect(src->selectionBounds());
+ IntRect draggingRect = enclosingIntRect(src->selection()->bounds());
int xpos = draggingRect.right();
xpos = draggingRect.x() < xpos ? draggingRect.x() : xpos;
int ypos = draggingRect.bottom();
diff --git a/WebCore/page/EditorClient.h b/WebCore/page/EditorClient.h
index 4a192d7..97b0902 100644
--- a/WebCore/page/EditorClient.h
+++ b/WebCore/page/EditorClient.h
@@ -37,12 +37,16 @@
#if PLATFORM(MAC)
#ifdef __OBJC__
@class NSArray;
+@class NSAttributedString;
@class NSData;
+@class NSPasteboard;
@class NSString;
@class NSURL;
#else
class NSArray;
+class NSAttributedString;
class NSData;
+class NSPasteboard;
class NSString;
class NSURL;
#endif
@@ -50,7 +54,9 @@ class NSURL;
namespace WebCore {
+class ArchiveResource;
class CSSStyleDeclaration;
+class DocumentFragment;
class EditCommand;
class Editor;
class Element;
@@ -147,6 +153,8 @@ public:
#if PLATFORM(MAC)
virtual NSString* userVisibleString(NSURL*) = 0;
+ virtual DocumentFragment* documentFragmentFromAttributedString(NSAttributedString*, Vector< RefPtr<ArchiveResource> >&) = 0;
+ virtual void setInsertionPasteboard(NSPasteboard*) = 0;
#ifdef BUILDING_ON_TIGER
virtual NSArray* pasteboardTypesForSelection(Frame*) = 0;
#endif
@@ -183,6 +191,7 @@ public:
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
virtual void showCorrectionPanel(const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacmentString, Editor*) = 0;
virtual void dismissCorrectionPanel(bool correctionAccepted) = 0;
+ virtual bool isShowingCorrectionPanel() = 0;
#endif
virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail& detail) = 0;
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index 1464de6..b660918 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -270,7 +270,7 @@ void EventHandler::selectClosestWordFromMouseEvent(const MouseEventWithHitTestRe
newSelection.appendTrailingWhitespace();
}
- if (m_frame->shouldChangeSelection(newSelection))
+ if (m_frame->selection()->shouldChangeSelection(newSelection))
m_frame->selection()->setSelection(newSelection, granularity, MakeNonDirectionalSelection);
}
}
@@ -295,7 +295,7 @@ void EventHandler::selectClosestWordOrLinkFromMouseEvent(const MouseEventWithHit
m_beganSelectingText = true;
}
- if (m_frame->shouldChangeSelection(newSelection))
+ if (m_frame->selection()->shouldChangeSelection(newSelection))
m_frame->selection()->setSelection(newSelection, granularity, MakeNonDirectionalSelection);
}
}
@@ -340,7 +340,7 @@ bool EventHandler::handleMousePressEventTripleClick(const MouseEventWithHitTestR
m_beganSelectingText = true;
}
- if (m_frame->shouldChangeSelection(newSelection))
+ if (m_frame->selection()->shouldChangeSelection(newSelection))
m_frame->selection()->setSelection(newSelection, granularity, MakeNonDirectionalSelection);
return true;
@@ -398,16 +398,16 @@ bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestR
newSelection.setExtent(pos);
}
- if (m_frame->selectionGranularity() != CharacterGranularity) {
- granularity = m_frame->selectionGranularity();
- newSelection.expandUsingGranularity(m_frame->selectionGranularity());
+ if (m_frame->selection()->granularity() != CharacterGranularity) {
+ granularity = m_frame->selection()->granularity();
+ newSelection.expandUsingGranularity(m_frame->selection()->granularity());
}
m_beganSelectingText = true;
} else
newSelection = VisibleSelection(visiblePos);
- if (m_frame->shouldChangeSelection(newSelection))
+ if (m_frame->selection()->shouldChangeSelection(newSelection))
m_frame->selection()->setSelection(newSelection, granularity, MakeNonDirectionalSelection);
return true;
@@ -640,12 +640,12 @@ void EventHandler::updateSelectionForMouseDrag(Node* targetNode, const IntPoint&
}
newSelection.setExtent(targetPosition);
- if (m_frame->selectionGranularity() != CharacterGranularity)
- newSelection.expandUsingGranularity(m_frame->selectionGranularity());
+ if (m_frame->selection()->granularity() != CharacterGranularity)
+ newSelection.expandUsingGranularity(m_frame->selection()->granularity());
- if (m_frame->shouldChangeSelection(newSelection)) {
+ if (m_frame->selection()->shouldChangeSelection(newSelection)) {
m_frame->selection()->setIsDirectional(false);
- m_frame->selection()->setSelection(newSelection, m_frame->selectionGranularity(), MakeNonDirectionalSelection);
+ m_frame->selection()->setSelection(newSelection, m_frame->selection()->granularity(), MakeNonDirectionalSelection);
}
}
#endif // ENABLE(DRAG_SUPPORT)
@@ -707,13 +707,13 @@ bool EventHandler::handleMouseReleaseEvent(const MouseEventWithHitTestResults& e
VisiblePosition pos = node->renderer()->positionForPoint(event.localPoint());
newSelection = VisibleSelection(pos);
}
- if (m_frame->shouldChangeSelection(newSelection))
+ if (m_frame->selection()->shouldChangeSelection(newSelection))
m_frame->selection()->setSelection(newSelection);
handled = true;
}
- m_frame->notifyRendererOfSelectionChange(true);
+ m_frame->selection()->notifyRendererOfSelectionChange(true);
m_frame->selection()->selectFrameElementInParentIfFullySelected();
@@ -1052,8 +1052,7 @@ Frame* EventHandler::subframeForTargetNode(Node* node)
static bool isSubmitImage(Node* node)
{
- return node && node->hasTagName(inputTag)
- && static_cast<HTMLInputElement*>(node)->inputType() == HTMLInputElement::IMAGE;
+ return node && node->hasTagName(inputTag) && static_cast<HTMLInputElement*>(node)->isImageButton();
}
// Returns true if the node's editable block is not current focused for editing
@@ -1389,17 +1388,12 @@ bool EventHandler::handleMouseDoubleClickEvent(const PlatformMouseEvent& mouseEv
m_clickCount = mouseEvent.clickCount();
bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false);
- bool swallowClickEvent = false;
- // Don't ever dispatch click events for right clicks
- if (mouseEvent.button() != RightButton && mev.targetNode() == m_clickNode)
- swallowClickEvent = dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
+ bool swallowClickEvent = mouseEvent.button() == LeftButton && mev.targetNode() == m_clickNode && dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
if (m_lastScrollbarUnderMouse)
swallowMouseUpEvent = m_lastScrollbarUnderMouse->mouseUp();
-
- bool swallowMouseReleaseEvent = false;
- if (!swallowMouseUpEvent)
- swallowMouseReleaseEvent = handleMouseReleaseEvent(mev);
+
+ bool swallowMouseReleaseEvent = !swallowMouseUpEvent && handleMouseReleaseEvent(mev);
invalidateClick();
@@ -1592,10 +1586,7 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false);
- // Don't ever dispatch click events for right clicks
- bool swallowClickEvent = false;
- if (m_clickCount > 0 && mouseEvent.button() != RightButton && mev.targetNode() == m_clickNode)
- swallowClickEvent = dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
+ bool swallowClickEvent = m_clickCount > 0 && mouseEvent.button() == LeftButton && mev.targetNode() == m_clickNode && dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
if (m_resizeLayer) {
m_resizeLayer->setInResizeMode(false);
@@ -2179,12 +2170,7 @@ bool EventHandler::canMouseDownStartSelect(Node* node)
if (!node->canStartSelection())
return false;
- for (RenderObject* curr = node->renderer(); curr; curr = curr->parent()) {
- if (Node* node = curr->node())
- return node->dispatchEvent(Event::create(eventNames().selectstartEvent, true, true));
- }
-
- return true;
+ return node->dispatchEvent(Event::create(eventNames().selectstartEvent, true, true));
}
#if ENABLE(DRAG_SUPPORT)
@@ -2193,12 +2179,7 @@ bool EventHandler::canMouseDragExtendSelect(Node* node)
if (!node || !node->renderer())
return true;
- for (RenderObject* curr = node->renderer(); curr; curr = curr->parent()) {
- if (Node* node = curr->node())
- return node->dispatchEvent(Event::create(eventNames().selectstartEvent, true, true));
- }
-
- return true;
+ return node->dispatchEvent(Event::create(eventNames().selectstartEvent, true, true));
}
#endif // ENABLE(DRAG_SUPPORT)
@@ -2846,12 +2827,6 @@ static PassRefPtr<TouchList> assembleTargetTouches(Touch* touchTarget, TouchList
return targetTouches.release();
}
-static float pageZoomFactor(Frame* frame)
-{
- FrameView* view = frame->view();
- return view ? view->pageZoomFactor() : 1.0f;
-}
-
bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
{
RefPtr<TouchList> touches = TouchList::create();
@@ -2908,8 +2883,8 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
pagePoint = documentPointForWindowPoint(doc->frame(), point.pos());
}
- int adjustedPageX = lroundf(pagePoint.x() / pageZoomFactor(m_frame));
- int adjustedPageY = lroundf(pagePoint.y() / pageZoomFactor(m_frame));
+ int adjustedPageX = lroundf(pagePoint.x() / m_frame->pageZoomFactor());
+ int adjustedPageY = lroundf(pagePoint.y() / m_frame->pageZoomFactor());
// Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap.
unsigned touchPointTargetKey = point.id() + 1;
diff --git a/WebCore/page/FocusController.cpp b/WebCore/page/FocusController.cpp
index aeb4fa0..1ac50cb 100644
--- a/WebCore/page/FocusController.cpp
+++ b/WebCore/page/FocusController.cpp
@@ -278,7 +278,7 @@ bool FocusController::advanceFocusInDocumentOrder(FocusDirection direction, Keyb
if (caretBrowsing) {
VisibleSelection newSelection(Position(node, 0), Position(node, 0), DOWNSTREAM);
- if (frame->shouldChangeSelection(newSelection))
+ if (frame->selection()->shouldChangeSelection(newSelection))
frame->selection()->setSelection(newSelection);
}
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index 3a03e9b..558f339 100644..100755
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -133,6 +133,22 @@ static inline Frame* parentFromOwnerElement(HTMLFrameOwnerElement* ownerElement)
return ownerElement->document()->frame();
}
+static inline float parentPageZoomFactor(Frame* frame)
+{
+ Frame* parent = frame->tree()->parent();
+ if (!parent)
+ return 1;
+ return parent->pageZoomFactor();
+}
+
+static inline float parentTextZoomFactor(Frame* frame)
+{
+ Frame* parent = frame->tree()->parent();
+ if (!parent)
+ return 1;
+ return parent->textZoomFactor();
+}
+
inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* frameLoaderClient)
: m_page(page)
, m_treeNode(this, parentFromOwnerElement(ownerElement))
@@ -145,6 +161,8 @@ inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoader
, m_eventHandler(this)
, m_animationController(this)
, m_lifeSupportTimer(this, &Frame::lifeSupportTimerFired)
+ , m_pageZoomFactor(parentPageZoomFactor(this))
+ , m_textZoomFactor(parentTextZoomFactor(this))
#if ENABLE(ORIENTATION_EVENTS)
, m_orientation(0)
#endif
@@ -290,16 +308,6 @@ Settings* Frame::settings() const
return m_page ? m_page->settings() : 0;
}
-TextGranularity Frame::selectionGranularity() const
-{
- return m_selectionController.granularity();
-}
-
-SelectionController* Frame::dragCaretController() const
-{
- return m_page->dragCaretController();
-}
-
static RegularExpression* createRegExpForLabels(const Vector<String>& labels)
{
// REVIEW- version of this call in FrameMac.mm caches based on the NSArray ptrs being
@@ -487,87 +495,6 @@ String Frame::matchLabelsAgainstElement(const Vector<String>& labels, Element* e
return matchLabelsAgainstString(labels, element->getAttribute(idAttr));
}
-void Frame::notifyRendererOfSelectionChange(bool userTriggered)
-{
- RenderObject* renderer = 0;
-
- document()->updateStyleIfNeeded();
-
- if (selection()->rootEditableElement())
- renderer = selection()->rootEditableElement()->shadowAncestorNode()->renderer();
-
- // If the current selection is in a textfield or textarea, notify the renderer that the selection has changed
- if (renderer && renderer->isTextControl())
- toRenderTextControl(renderer)->selectionChanged(userTriggered);
-}
-
-// Helper function that tells whether a particular node is an element that has an entire
-// Frame and FrameView, a <frame>, <iframe>, or <object>.
-static bool isFrameElement(const Node *n)
-{
- if (!n)
- return false;
- RenderObject *renderer = n->renderer();
- if (!renderer || !renderer->isWidget())
- return false;
- Widget* widget = toRenderWidget(renderer)->widget();
- return widget && widget->isFrameView();
-}
-
-void Frame::setFocusedNodeIfNeeded()
-{
- if (selection()->isNone() || !selection()->isFocused())
- return;
-
- bool caretBrowsing = settings() && settings()->caretBrowsingEnabled();
- if (caretBrowsing) {
- Node* anchor = enclosingAnchorElement(selection()->base());
- if (anchor) {
- page()->focusController()->setFocusedNode(anchor, this);
- return;
- }
- }
-
- Node* target = selection()->rootEditableElement();
- if (target) {
- RenderObject* renderer = target->renderer();
-
- // Walk up the render tree to search for a node to focus.
- // Walking up the DOM tree wouldn't work for shadow trees, like those behind the engine-based text fields.
- while (renderer) {
- // We don't want to set focus on a subframe when selecting in a parent frame,
- // so add the !isFrameElement check here. There's probably a better way to make this
- // work in the long term, but this is the safest fix at this time.
- if (target && target->isMouseFocusable() && !isFrameElement(target)) {
- page()->focusController()->setFocusedNode(target, this);
- return;
- }
- renderer = renderer->parent();
- if (renderer)
- target = renderer->node();
- }
- document()->setFocusedNode(0);
- }
-
- if (caretBrowsing)
- page()->focusController()->setFocusedNode(0, this);
-}
-
-void Frame::paintDragCaret(GraphicsContext* p, int tx, int ty, const IntRect& clipRect) const
-{
-#if ENABLE(TEXT_CARET)
- SelectionController* dragCaretController = m_page->dragCaretController();
- ASSERT(dragCaretController->selection().isCaret());
- if (dragCaretController->selection().start().node()->document()->frame() == this)
- dragCaretController->paintCaret(p, tx, ty, clipRect);
-#else
- UNUSED_PARAM(p);
- UNUSED_PARAM(tx);
- UNUSED_PARAM(ty);
- UNUSED_PARAM(clipRect);
-#endif
-}
-
void Frame::setPrinting(bool printing, const FloatSize& pageSize, float maximumShrinkRatio, AdjustViewSizeOrNot shouldAdjustViewSize)
{
m_doc->setPrinting(printing);
@@ -615,11 +542,6 @@ void Frame::injectUserScriptsForWorld(DOMWrapperWorld* world, const UserScriptVe
}
}
-bool Frame::shouldDeleteSelection(const VisibleSelection& selection) const
-{
- return editor()->client()->shouldDeleteRange(selection.toNormalizedRange().get());
-}
-
bool Frame::isContentEditable() const
{
if (m_editor.clientIsEditable())
@@ -627,11 +549,6 @@ bool Frame::isContentEditable() const
return m_doc->inDesignMode();
}
-void Frame::setTypingStyle(CSSMutableStyleDeclaration *style)
-{
- m_typingStyle = style;
-}
-
#ifndef NDEBUG
static HashSet<Frame*>& keepAliveSet()
{
@@ -710,123 +627,6 @@ RenderPart* Frame::ownerRenderer() const
return toRenderPart(object);
}
-// returns FloatRect because going through IntRect would truncate any floats
-FloatRect Frame::selectionBounds(bool clipToVisibleContent) const
-{
- RenderView* root = contentRenderer();
- FrameView* view = m_view.get();
- if (!root || !view)
- return IntRect();
-
- IntRect selectionRect = root->selectionBounds(clipToVisibleContent);
- return clipToVisibleContent ? intersection(selectionRect, view->visibleContentRect()) : selectionRect;
-}
-
-void Frame::selectionTextRects(Vector<FloatRect>& rects, SelectionRectRespectTransforms respectTransforms, bool clipToVisibleContent) const
-{
- RenderView* root = contentRenderer();
- if (!root)
- return;
-
- RefPtr<Range> selectedRange = selection()->toNormalizedRange();
-
- FloatRect visibleContentRect = m_view->visibleContentRect();
-
- // FIMXE: we are appending empty rects to the list for those that fall outside visibleContentRect.
- // We may not want to do that.
- if (respectTransforms) {
- Vector<FloatQuad> quads;
- selectedRange->textQuads(quads, true);
-
- unsigned size = quads.size();
- for (unsigned i = 0; i < size; ++i) {
- IntRect currRect = quads[i].enclosingBoundingBox();
- if (clipToVisibleContent)
- rects.append(intersection(currRect, visibleContentRect));
- else
- rects.append(currRect);
- }
- } else {
- Vector<IntRect> intRects;
- selectedRange->textRects(intRects, true);
-
- unsigned size = intRects.size();
- for (unsigned i = 0; i < size; ++i) {
- if (clipToVisibleContent)
- rects.append(intersection(intRects[i], visibleContentRect));
- else
- rects.append(intRects[i]);
- }
- }
-}
-
-// Scans logically forward from "start", including any child frames
-static HTMLFormElement *scanForForm(Node *start)
-{
- Node *n;
- for (n = start; n; n = n->traverseNextNode()) {
- if (n->hasTagName(formTag))
- return static_cast<HTMLFormElement*>(n);
- else if (n->isHTMLElement() && static_cast<Element*>(n)->isFormControlElement())
- return static_cast<HTMLFormControlElement*>(n)->form();
- else if (n->hasTagName(frameTag) || n->hasTagName(iframeTag)) {
- Node *childDoc = static_cast<HTMLFrameElementBase*>(n)->contentDocument();
- if (HTMLFormElement *frameResult = scanForForm(childDoc))
- return frameResult;
- }
- }
- return 0;
-}
-
-// We look for either the form containing the current focus, or for one immediately after it
-HTMLFormElement *Frame::currentForm() const
-{
- // start looking either at the active (first responder) node, or where the selection is
- Node *start = m_doc ? m_doc->focusedNode() : 0;
- if (!start)
- start = selection()->start().node();
-
- // try walking up the node tree to find a form element
- Node *n;
- for (n = start; n; n = n->parentNode()) {
- if (n->hasTagName(formTag))
- return static_cast<HTMLFormElement*>(n);
- else if (n->isHTMLElement() && static_cast<Element*>(n)->isFormControlElement())
- return static_cast<HTMLFormControlElement*>(n)->form();
- }
-
- // try walking forward in the node tree to find a form element
- return start ? scanForForm(start) : 0;
-}
-
-void Frame::revealSelection(const ScrollAlignment& alignment, bool revealExtent)
-{
- IntRect rect;
-
- switch (selection()->selectionType()) {
- case VisibleSelection::NoSelection:
- return;
- case VisibleSelection::CaretSelection:
- rect = selection()->absoluteCaretBounds();
- break;
- case VisibleSelection::RangeSelection:
- rect = revealExtent ? VisiblePosition(selection()->extent()).absoluteCaretBounds() : enclosingIntRect(selectionBounds(false));
- break;
- }
-
- Position start = selection()->start();
- ASSERT(start.node());
- if (start.node() && start.node()->renderer()) {
- // FIXME: This code only handles scrolling the startContainer's layer, but
- // the selection rect could intersect more than just that.
- // See <rdar://problem/4799899>.
- if (RenderLayer* layer = start.node()->renderer()->enclosingLayer()) {
- layer->scrollRectToVisible(rect, false, alignment, alignment);
- selection()->updateAppearance();
- }
- }
-}
-
Frame* Frame::frameForWidget(const Widget* widget)
{
ASSERT_ARG(widget, widget);
@@ -857,22 +657,6 @@ void Frame::clearTimers()
clearTimers(m_view.get(), document());
}
-void Frame::setSelectionFromNone()
-{
- // Put a caret inside the body if the entire frame is editable (either the
- // entire WebView is editable or designMode is on for this document).
- Document *doc = document();
- bool caretBrowsing = settings() && settings()->caretBrowsingEnabled();
- if (!selection()->isNone() || !(isContentEditable() || caretBrowsing))
- return;
-
- Node* node = doc->documentElement();
- while (node && !node->hasTagName(bodyTag))
- node = node->traverseNextNode();
- if (node)
- selection()->setSelection(VisibleSelection(Position(node, 0), DOWNSTREAM));
-}
-
void Frame::setDOMWindow(DOMWindow* domWindow)
{
if (m_domWindow) {
@@ -983,11 +767,6 @@ String Frame::documentTypeString() const
return String();
}
-bool Frame::shouldChangeSelection(const VisibleSelection& newSelection) const
-{
- return editor()->shouldChangeSelection(selection()->selection(), newSelection, newSelection.affinity(), false);
-}
-
VisiblePosition Frame::visiblePositionForPoint(const IntPoint& framePoint)
{
HitTestResult result = eventHandler()->hitTestResultAtPoint(framePoint, true);
@@ -1119,18 +898,67 @@ String Frame::layerTreeAsText() const
if (!contentRenderer())
return String();
- RenderLayerCompositor* compositor = contentRenderer()->compositor();
- if (compositor->compositingLayerUpdatePending())
- compositor->updateCompositingLayers();
-
- GraphicsLayer* rootLayer = compositor->rootPlatformLayer();
- if (!rootLayer)
- return String();
-
- return rootLayer->layerTreeAsText();
+ return contentRenderer()->compositor()->layerTreeAsText();
#else
return String();
#endif
}
+void Frame::setPageZoomFactor(float factor)
+{
+ setPageAndTextZoomFactors(factor, m_textZoomFactor);
+}
+
+void Frame::setTextZoomFactor(float factor)
+{
+ setPageAndTextZoomFactors(m_pageZoomFactor, factor);
+}
+
+void Frame::setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor)
+{
+ if (m_pageZoomFactor == pageZoomFactor && m_textZoomFactor == textZoomFactor)
+ return;
+
+ Page* page = this->page();
+ if (!page)
+ return;
+
+ Document* document = this->document();
+ if (!document)
+ return;
+
+#if ENABLE(SVG)
+ // Respect SVGs zoomAndPan="disabled" property in standalone SVG documents.
+ // FIXME: How to handle compound documents + zoomAndPan="disabled"? Needs SVG WG clarification.
+ if (document->isSVGDocument()) {
+ if (!static_cast<SVGDocument*>(document)->zoomAndPanEnabled())
+ return;
+ if (document->renderer())
+ document->renderer()->setNeedsLayout(true);
+ }
+#endif
+
+ if (m_pageZoomFactor != pageZoomFactor) {
+ if (FrameView* view = this->view()) {
+ // Update the scroll position when doing a full page zoom, so the content stays in relatively the same position.
+ IntPoint scrollPosition = view->scrollPosition();
+ float percentDifference = (pageZoomFactor / m_pageZoomFactor);
+ view->setScrollPosition(IntPoint(scrollPosition.x() * percentDifference, scrollPosition.y() * percentDifference));
+ }
+ }
+
+ m_pageZoomFactor = pageZoomFactor;
+ m_textZoomFactor = textZoomFactor;
+
+ document->recalcStyle(Node::Force);
+
+ for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling())
+ child->setPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor);
+
+ if (FrameView* view = this->view()) {
+ if (document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
+ view->layout();
+ }
+}
+
} // namespace WebCore
diff --git a/WebCore/page/Frame.h b/WebCore/page/Frame.h
index 1e6b9b6..c09c330 100644
--- a/WebCore/page/Frame.h
+++ b/WebCore/page/Frame.h
@@ -29,16 +29,13 @@
#define Frame_h
#include "AnimationController.h"
-#include "CSSMutableStyleDeclaration.h"
#include "DragImage.h"
#include "Editor.h"
#include "EventHandler.h"
#include "FrameLoader.h"
#include "FrameTree.h"
#include "ScriptController.h"
-#include "ScrollBehavior.h"
#include "UserScriptTypes.h"
-#include "ZoomMode.h"
#if PLATFORM(WIN)
#include "FrameWin.h"
@@ -67,38 +64,32 @@ namespace WebCore {
class RenderPart;
class TiledBackingStore;
- class Frame : public RefCounted<Frame>
-#if ENABLE(TILED_BACKING_STORE)
- , public TiledBackingStoreClient
+#if !ENABLE(TILED_BACKING_STORE)
+ class TiledBackingStoreClient { };
#endif
- {
+
+ class Frame : public RefCounted<Frame>, public TiledBackingStoreClient {
public:
static PassRefPtr<Frame> create(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
- void setView(PassRefPtr<FrameView>);
- ~Frame();
void init();
+ void setView(PassRefPtr<FrameView>);
+ void createView(const IntSize&, const Color&, bool, const IntSize&, bool,
+ ScrollbarMode = ScrollbarAuto, bool horizontalLock = false,
+ ScrollbarMode = ScrollbarAuto, bool verticalLock = false);
- Page* page() const;
- void detachFromPage();
- void transferChildFrameToNewDocument();
-
- HTMLFrameOwnerElement* ownerElement() const;
+ ~Frame();
+ void detachFromPage();
void pageDestroyed();
void disconnectOwnerElement();
+ Page* page() const;
+ HTMLFrameOwnerElement* ownerElement() const;
+
Document* document() const;
FrameView* view() const;
- void setDOMWindow(DOMWindow*);
- void clearFormerDOMWindow(DOMWindow*);
-
- // Unlike many of the accessors in Frame, domWindow() always creates a new DOMWindow if m_domWindow is null.
- // Callers that don't need a new DOMWindow to be created should use existingDOMWindow().
- DOMWindow* domWindow() const;
- DOMWindow* existingDOMWindow() { return m_domWindow.get(); }
-
Editor* editor() const;
EventHandler* eventHandler() const;
FrameLoader* loader() const;
@@ -108,31 +99,30 @@ namespace WebCore {
AnimationController* animation() const;
ScriptController* script();
- RenderView* contentRenderer() const; // root renderer for the document contained in this frame
- RenderPart* ownerRenderer() const; // renderer for the element that contains this frame
+ RenderView* contentRenderer() const; // Root of the render tree for the document contained in this frame.
+ RenderPart* ownerRenderer() const; // Renderer for the element that contains this frame.
+
+ void transferChildFrameToNewDocument();
+
+ // ======== All public functions below this point are candidates to move out of Frame into another class. ========
bool isDisconnected() const;
void setIsDisconnected(bool);
bool excludeFromTextSearch() const;
void setExcludeFromTextSearch(bool);
- void createView(const IntSize&, const Color&, bool, const IntSize &, bool,
- ScrollbarMode = ScrollbarAuto, bool horizontalLock = false,
- ScrollbarMode = ScrollbarAuto, bool verticalLock = false);
-
void injectUserScripts(UserScriptInjectionTime);
String layerTreeAsText() const;
- private:
- void injectUserScriptsForWorld(DOMWrapperWorld*, const UserScriptVector&, UserScriptInjectionTime);
-
- private:
- Frame(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
-
- // === undecided, would like to consider moving to another class
+ // Unlike most accessors in this class, domWindow() always creates a new DOMWindow if m_domWindow is null.
+ // Callers that don't need a new DOMWindow to be created should use existingDOMWindow().
+ DOMWindow* domWindow() const;
+ DOMWindow* existingDOMWindow() { return m_domWindow.get(); }
+ void setDOMWindow(DOMWindow*);
+ void clearFormerDOMWindow(DOMWindow*);
+ void clearDOMWindow();
- public:
static Frame* frameForWidget(const Widget*);
Settings* settings() const; // can be NULL
@@ -144,12 +134,16 @@ namespace WebCore {
void setInViewSourceMode(bool = true);
void keepAlive(); // Used to keep the frame alive when running a script that might destroy it.
-#ifndef NDEBUG
static void cancelAllKeepAlive();
-#endif
void setDocument(PassRefPtr<Document>);
+ void setPageZoomFactor(float factor);
+ float pageZoomFactor() const { return m_pageZoomFactor; }
+ void setTextZoomFactor(float factor);
+ float textZoomFactor() const { return m_textZoomFactor; }
+ void setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor);
+
#if ENABLE(ORIENTATION_EVENTS)
// Orientation is the interface orientation in degrees. Some examples are:
// 0 is straight up; -90 is when the device is rotated 90 clockwise;
@@ -163,95 +157,40 @@ namespace WebCore {
String documentTypeString() const;
- // This method -- and the corresponding list of former DOM windows --
- // should move onto ScriptController
- void clearDOMWindow();
-
String displayStringModifiedByEncoding(const String& str) const
{
return document() ? document()->displayStringModifiedByEncoding(str) : str;
}
-#if ENABLE(TILED_BACKING_STORE)
- // FIXME: This should be in FrameView, not Frame.
- TiledBackingStore* tiledBackingStore() const { return m_tiledBackingStore.get(); }
- void setTiledBackingStoreEnabled(bool);
-#endif
-
DragImageRef nodeImage(Node*);
DragImageRef dragImageForSelection();
- private:
- void lifeSupportTimerFired(Timer<Frame>*);
-
- // === to be moved into SelectionController
-
- public:
- TextGranularity selectionGranularity() const;
-
- bool shouldChangeSelection(const VisibleSelection&) const;
- bool shouldDeleteSelection(const VisibleSelection&) const;
- void setFocusedNodeIfNeeded();
- void notifyRendererOfSelectionChange(bool userTriggered);
-
- void paintDragCaret(GraphicsContext*, int tx, int ty, const IntRect& clipRect) const;
-
bool isContentEditable() const; // if true, everything in frame is editable
- CSSMutableStyleDeclaration* typingStyle() const;
- void setTypingStyle(CSSMutableStyleDeclaration*);
- void clearTypingStyle();
-
- FloatRect selectionBounds(bool clipToVisibleContent = true) const;
- enum SelectionRectRespectTransforms { RespectTransforms = true, IgnoreTransforms = false };
- void selectionTextRects(Vector<FloatRect>&, SelectionRectRespectTransforms respectTransforms, bool clipToVisibleContent = true) const;
-
- HTMLFormElement* currentForm() const;
-
- void revealSelection(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, bool revealExtent = false);
- void setSelectionFromNone();
-
- SelectionController* dragCaretController() const;
+ VisiblePosition visiblePositionForPoint(const IntPoint& framePoint);
+ Document* documentAtPoint(const IntPoint& windowPoint);
String searchForLabelsAboveCell(RegularExpression*, HTMLTableCellElement*, size_t* resultDistanceFromStartOfCell);
String searchForLabelsBeforeElement(const Vector<String>& labels, Element*, size_t* resultDistance, bool* resultIsInCellAbove);
String matchLabelsAgainstElement(const Vector<String>& labels, Element*);
- VisiblePosition visiblePositionForPoint(const IntPoint& framePoint);
- Document* documentAtPoint(const IntPoint& windowPoint);
-
-#if ENABLE(TILED_BACKING_STORE)
- // FIXME: This should be in FrameView, not Frame.
-
- private:
- // TiledBackingStoreClient interface
- virtual void tiledBackingStorePaintBegin();
- virtual void tiledBackingStorePaint(GraphicsContext*, const IntRect&);
- virtual void tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea);
- virtual IntRect tiledBackingStoreContentsRect();
- virtual IntRect tiledBackingStoreVisibleRect();
-#endif
-
#if PLATFORM(MAC)
-
- // === undecided, would like to consider moving to another class
-
- public:
- NSString* searchForNSLabelsAboveCell(RegularExpression*, HTMLTableCellElement*, size_t* resultDistanceFromStartOfCell);
NSString* searchForLabelsBeforeElement(NSArray* labels, Element*, size_t* resultDistance, bool* resultIsInCellAbove);
NSString* matchLabelsAgainstElement(NSArray* labels, Element*);
-#if ENABLE(DASHBOARD_SUPPORT)
- NSMutableDictionary* dashboardRegionsDictionary();
-#endif
-
NSImage* selectionImage(bool forceBlackText = false) const;
NSImage* snapshotDragImage(Node*, NSRect* imageRect, NSRect* elementRect) const;
NSImage* imageFromRect(NSRect) const;
-
#endif
+ // ========
+
private:
+ Frame(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
+
+ void injectUserScriptsForWorld(DOMWrapperWorld*, const UserScriptVector&, UserScriptInjectionTime);
+ void lifeSupportTimerFired(Timer<Frame>*);
+
Page* m_page;
mutable FrameTree m_treeNode;
mutable FrameLoader m_loader;
@@ -271,10 +210,11 @@ namespace WebCore {
mutable EventHandler m_eventHandler;
mutable AnimationController m_animationController;
- RefPtr<CSSMutableStyleDeclaration> m_typingStyle;
-
Timer<Frame> m_lifeSupportTimer;
+ float m_pageZoomFactor;
+ float m_textZoomFactor;
+
#if ENABLE(ORIENTATION_EVENTS)
int m_orientation;
#endif
@@ -283,7 +223,21 @@ namespace WebCore {
bool m_isDisconnected;
bool m_excludeFromTextSearch;
-#if ENABLE(TILED_BACKING_STORE)
+#if ENABLE(TILED_BACKING_STORE)
+ // FIXME: The tiled backing store belongs in FrameView, not Frame.
+
+ public:
+ TiledBackingStore* tiledBackingStore() const { return m_tiledBackingStore.get(); }
+ void setTiledBackingStoreEnabled(bool);
+
+ private:
+ // TiledBackingStoreClient interface
+ virtual void tiledBackingStorePaintBegin();
+ virtual void tiledBackingStorePaint(GraphicsContext*, const IntRect&);
+ virtual void tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea);
+ virtual IntRect tiledBackingStoreContentsRect();
+ virtual IntRect tiledBackingStoreVisibleRect();
+
OwnPtr<TiledBackingStore> m_tiledBackingStore;
#endif
};
@@ -333,16 +287,6 @@ namespace WebCore {
return &m_animationController;
}
- inline CSSMutableStyleDeclaration* Frame::typingStyle() const
- {
- return m_typingStyle.get();
- }
-
- inline void Frame::clearTypingStyle()
- {
- m_typingStyle = 0;
- }
-
inline HTMLFrameOwnerElement* Frame::ownerElement() const
{
return m_ownerElement;
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index a808ab6..e881c94 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -29,9 +29,9 @@
#include "AXObjectCache.h"
#include "CSSStyleSelector.h"
+#include "CachedResourceLoader.h"
#include "Chrome.h"
#include "ChromeClient.h"
-#include "CachedResourceLoader.h"
#include "EventHandler.h"
#include "FloatRect.h"
#include "FocusController.h"
@@ -120,17 +120,6 @@ struct ScheduledEvent : Noncopyable {
RefPtr<Node> m_eventTarget;
};
-static inline float parentZoomFactor(Frame* frame)
-{
- Frame* parent = frame->tree()->parent();
- if (!parent)
- return 1;
- FrameView* parentView = parent->view();
- if (!parentView)
- return 1;
- return parentView->zoomFactor();
-}
-
FrameView::FrameView(Frame* frame)
: m_frame(frame)
, m_canHaveScrollbars(true)
@@ -154,7 +143,6 @@ FrameView::FrameView(Frame* frame)
, m_deferSetNeedsLayouts(0)
, m_setNeedsLayoutWasDeferred(false)
, m_scrollCorner(0)
- , m_zoomFactor(parentZoomFactor(frame))
{
init();
}
@@ -226,7 +214,6 @@ void FrameView::reset()
m_wasScrolledByUser = false;
m_lastLayoutSize = IntSize();
m_lastZoomFactor = 1.0f;
- m_pageHeight = 0;
m_deferringRepaints = 0;
m_repaintCount = 0;
m_repaintRects.clear();
@@ -798,7 +785,7 @@ void FrameView::layout(bool allowSubtree)
if (subtree) {
RenderView* view = root->view();
- view->popLayoutState();
+ view->popLayoutState(root);
if (disableLayoutState)
view->enableLayoutState();
}
@@ -1815,6 +1802,13 @@ void FrameView::valueChanged(Scrollbar* bar)
frame()->loader()->client()->didChangeScrollOffset();
}
+void FrameView::valueChanged(const IntSize& scrollDelta)
+{
+ ScrollView::valueChanged(scrollDelta);
+ frame()->eventHandler()->sendScrollEvent();
+ frame()->loader()->client()->didChangeScrollOffset();
+}
+
void FrameView::invalidateScrollbarRect(Scrollbar* scrollbar, const IntRect& rect)
{
// Add in our offset within the FrameView.
@@ -2119,12 +2113,6 @@ void FrameView::flushDeferredRepaints()
void FrameView::forceLayout(bool allowSubtree)
{
layout(allowSubtree);
- // We cannot unschedule a pending relayout, since the force can be called with
- // a tiny rectangle from a drawRect update. By unscheduling we in effect
- // "validate" and stop the necessary full repaint from occurring. Basically any basic
- // append/remove DHTML is broken by this call. For now, I have removed the optimization
- // until we have a better invalidation stategy. -dwh
- //unscheduleRelayout();
}
void FrameView::forceLayoutForPagination(const FloatSize& pageSize, float maximumShrinkFactor, Frame::AdjustViewSizeOrNot shouldAdjustViewSize)
@@ -2134,8 +2122,8 @@ void FrameView::forceLayoutForPagination(const FloatSize& pageSize, float maximu
RenderView *root = toRenderView(m_frame->document()->renderer());
if (root) {
int pageW = ceilf(pageSize.width());
- m_pageHeight = pageSize.height() ? pageSize.height() : visibleHeight();
root->setWidth(pageW);
+ root->setPageHeight(pageSize.height());
root->setNeedsLayoutAndPrefWidthsRecalc();
forceLayout();
@@ -2147,19 +2135,21 @@ void FrameView::forceLayoutForPagination(const FloatSize& pageSize, float maximu
if (rightmostPos > pageSize.width()) {
pageW = std::min<int>(rightmostPos, ceilf(pageSize.width() * maximumShrinkFactor));
if (pageSize.height())
- m_pageHeight = pageW / pageSize.width() * pageSize.height();
+ root->setPageHeight(pageW / pageSize.width() * pageSize.height());
root->setWidth(pageW);
root->setNeedsLayoutAndPrefWidthsRecalc();
forceLayout();
+ int docHeight = root->bottomLayoutOverflow();
+ root->clearLayoutOverflow();
+ root->addLayoutOverflow(IntRect(0, 0, pageW, docHeight)); // This is how we clip in case we overflow again.
}
}
if (shouldAdjustViewSize)
adjustViewSize();
- m_pageHeight = 0;
}
-void FrameView::adjustPageHeight(float *newBottom, float oldTop, float oldBottom, float /*bottomLimit*/)
+void FrameView::adjustPageHeightDeprecated(float *newBottom, float oldTop, float oldBottom, float /*bottomLimit*/)
{
RenderView* root = m_frame->contentRenderer();
if (root) {
@@ -2167,10 +2157,12 @@ void FrameView::adjustPageHeight(float *newBottom, float oldTop, float oldBottom
GraphicsContext context((PlatformGraphicsContext*)0);
root->setTruncatedAt((int)floorf(oldBottom));
IntRect dirtyRect(0, (int)floorf(oldTop), root->rightLayoutOverflow(), (int)ceilf(oldBottom - oldTop));
+ root->setPrintRect(dirtyRect);
root->layer()->paint(&context, dirtyRect);
*newBottom = root->bestTruncatedAt();
if (*newBottom == 0)
*newBottom = oldBottom;
+ root->setPrintRect(IntRect());
} else
*newBottom = oldBottom;
}
@@ -2313,75 +2305,6 @@ IntPoint FrameView::convertFromContainingView(const IntPoint& parentPoint) const
return parentPoint;
}
-bool FrameView::shouldApplyTextZoom() const
-{
- if (m_zoomFactor == 1)
- return false;
- if (!m_frame)
- return false;
- Page* page = m_frame->page();
- return page && page->settings()->zoomMode() == ZoomTextOnly;
-}
-
-bool FrameView::shouldApplyPageZoom() const
-{
- if (m_zoomFactor == 1)
- return false;
- if (!m_frame)
- return false;
- Page* page = m_frame->page();
- return page && page->settings()->zoomMode() == ZoomPage;
-}
-
-void FrameView::setZoomFactor(float percent, ZoomMode mode)
-{
- if (!m_frame)
- return;
-
- Page* page = m_frame->page();
- if (!page)
- return;
-
- if (m_zoomFactor == percent && page->settings()->zoomMode() == mode)
- return;
-
- Document* document = m_frame->document();
- if (!document)
- return;
-
-#if ENABLE(SVG)
- // Respect SVGs zoomAndPan="disabled" property in standalone SVG documents.
- // FIXME: How to handle compound documents + zoomAndPan="disabled"? Needs SVG WG clarification.
- if (document->isSVGDocument()) {
- if (!static_cast<SVGDocument*>(document)->zoomAndPanEnabled())
- return;
- if (document->renderer())
- document->renderer()->setNeedsLayout(true);
- }
-#endif
-
- if (mode == ZoomPage) {
- // Update the scroll position when doing a full page zoom, so the content stays in relatively the same position.
- IntPoint scrollPosition = this->scrollPosition();
- float percentDifference = (percent / m_zoomFactor);
- setScrollPosition(IntPoint(scrollPosition.x() * percentDifference, scrollPosition.y() * percentDifference));
- }
-
- m_zoomFactor = percent;
- page->settings()->setZoomMode(mode);
-
- document->recalcStyle(Node::Force);
-
- for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
- if (FrameView* childView = child->view())
- childView->setZoomFactor(m_zoomFactor, mode);
- }
-
- if (document->renderer() && document->renderer()->needsLayout() && didFirstLayout())
- layout();
-}
-
-
// Normal delay
void FrameView::setRepaintThrottlingDeferredRepaintDelay(double p)
{
diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h
index f9a4bf3..22c05be 100644
--- a/WebCore/page/FrameView.h
+++ b/WebCore/page/FrameView.h
@@ -200,9 +200,24 @@ public:
void forceLayout(bool allowSubtree = false);
void forceLayoutForPagination(const FloatSize& pageSize, float maximumShrinkFactor, Frame::AdjustViewSizeOrNot);
- int pageHeight() const { return m_pageHeight; }
- void adjustPageHeight(float* newBottom, float oldTop, float oldBottom, float bottomLimit);
+ // FIXME: This method is retained because of embedded WebViews in AppKit. When a WebView is embedded inside
+ // some enclosing view with auto-pagination, no call happens to resize the view. The new pagination model
+ // needs the view to resize as a result of the breaks, but that means that the enclosing view has to potentially
+ // resize around that view. Auto-pagination uses the bounds of the actual view that's being printed to determine
+ // the edges of the print operation, so the resize is necessary if the enclosing view's bounds depend on the
+ // web document's bounds.
+ //
+ // This is already a problem if the view needs to be a different size because of printer fonts or because of print stylesheets.
+ // Mail/Dictionary work around this problem by using the _layoutForPrinting SPI
+ // to at least get print stylesheets and printer fonts into play, but since WebKit doesn't know about the page offset or
+ // page size, it can't actually paginate correctly during _layoutForPrinting.
+ //
+ // We can eventually move Mail to a newer SPI that would let them opt in to the layout-time pagination model,
+ // but that doesn't solve the general problem of how other AppKit views could opt in to the better model.
+ //
+ // NO OTHER PLATFORM BESIDES MAC SHOULD USE THIS METHOD.
+ void adjustPageHeightDeprecated(float* newBottom, float oldTop, float oldBottom, float bottomLimit);
bool scrollToFragment(const KURL&);
bool scrollToAnchor(const String&);
@@ -217,13 +232,6 @@ public:
bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { return m_scrollCorner == scrollCorner; }
void invalidateScrollCorner();
- void setZoomFactor(float scale, ZoomMode);
- float zoomFactor() const { return m_zoomFactor; }
- bool shouldApplyTextZoom() const;
- bool shouldApplyPageZoom() const;
- float pageZoomFactor() const { return shouldApplyPageZoom() ? m_zoomFactor : 1.0f; }
- float textZoomFactor() const { return shouldApplyTextZoom() ? m_zoomFactor : 1.0f; }
-
// Normal delay
static void setRepaintThrottlingDeferredRepaintDelay(double p);
// Negative value would mean that first few repaints happen without a delay
@@ -270,6 +278,7 @@ private:
// ScrollBarClient interface
virtual void valueChanged(Scrollbar*);
+ virtual void valueChanged(const IntSize&);
virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
virtual bool isActive() const;
virtual void getTickmarks(Vector<IntRect>&) const;
@@ -336,8 +345,6 @@ private:
String m_mediaType;
String m_mediaTypeWhenNotPrinting;
- int m_pageHeight;
-
unsigned m_enqueueEvents;
Vector<ScheduledEvent*> m_scheduledEvents;
@@ -373,8 +380,6 @@ private:
// Renderer to hold our custom scroll corner.
RenderScrollbarPart* m_scrollCorner;
- float m_zoomFactor;
-
static double s_deferredRepaintDelay;
static double s_initialDeferredRepaintDelayDuringLoading;
static double s_maxDeferredRepaintDelayDuringLoading;
diff --git a/WebCore/page/PageGroupLoadDeferrer.cpp b/WebCore/page/PageGroupLoadDeferrer.cpp
index 79554cf..98a4720 100644
--- a/WebCore/page/PageGroupLoadDeferrer.cpp
+++ b/WebCore/page/PageGroupLoadDeferrer.cpp
@@ -44,8 +44,10 @@ PageGroupLoadDeferrer::PageGroupLoadDeferrer(Page* page, bool deferSelf)
// This code is not logically part of load deferring, but we do not want JS code executed beneath modal
// windows or sheets, which is exactly when PageGroupLoadDeferrer is used.
+ // NOTE: if PageGroupLoadDeferrer is ever used for tasks other than showing a modal window or sheet,
+ // the constructor will need to take a ActiveDOMObject::ReasonForSuspension.
for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
- frame->document()->suspendActiveDOMObjects();
+ frame->document()->suspendActiveDOMObjects(ActiveDOMObject::WillShowDialog);
frame->document()->asyncScriptRunner()->suspend();
}
}
diff --git a/WebCore/page/PrintContext.cpp b/WebCore/page/PrintContext.cpp
index 7b0179d..8cc7dd6 100644
--- a/WebCore/page/PrintContext.cpp
+++ b/WebCore/page/PrintContext.cpp
@@ -95,26 +95,22 @@ void PrintContext::computePageRectsWithPageSizeInternal(const FloatSize& pageSiz
{
if (!m_frame->document() || !m_frame->view() || !m_frame->document()->renderer())
return;
+
RenderView* root = toRenderView(m_frame->document()->renderer());
- const float pageWidth = pageSizeInPixels.width();
- const float docWidth = root->layer()->width();
- const float docHeight = root->layer()->height();
- float currPageHeight = pageSizeInPixels.height();
-
- // always return at least one page, since empty files should print a blank page
- float printedPagesHeight = 0;
- do {
- float proposedBottom = std::min(docHeight, printedPagesHeight + pageSizeInPixels.height());
- m_frame->view()->adjustPageHeight(&proposedBottom, printedPagesHeight, proposedBottom, printedPagesHeight);
- currPageHeight = max(1.0f, proposedBottom - printedPagesHeight);
+ int docWidth = root->layer()->width();
+ int docHeight = root->layer()->height();
+ int pageWidth = pageSizeInPixels.width();
+ int pageHeight = pageSizeInPixels.height();
+
+ unsigned pageCount = ceilf((float)docHeight / pageHeight);
+ for (unsigned i = 0; i < pageCount; ++i) {
if (allowHorizontalMultiPages) {
- for (float curWidth = 0; curWidth < docWidth; curWidth += pageWidth)
- m_pageRects.append(IntRect(curWidth, (int)printedPagesHeight, (int)pageWidth, (int)currPageHeight));
+ for (int currWidth = 0; currWidth < docWidth; currWidth += pageWidth)
+ m_pageRects.append(IntRect(currWidth, i * pageHeight, pageWidth, pageHeight));
} else
- m_pageRects.append(IntRect(0, (int)printedPagesHeight, (int)pageWidth, (int)currPageHeight));
- printedPagesHeight += currPageHeight;
- } while (printedPagesHeight < docHeight);
+ m_pageRects.append(IntRect(0, i * pageHeight, pageWidth, pageHeight));
+ }
}
void PrintContext::begin(float width, float height)
diff --git a/WebCore/page/SecurityOrigin.cpp b/WebCore/page/SecurityOrigin.cpp
index b44a35e..6001983 100644
--- a/WebCore/page/SecurityOrigin.cpp
+++ b/WebCore/page/SecurityOrigin.cpp
@@ -125,7 +125,7 @@ PassRefPtr<SecurityOrigin> SecurityOrigin::create(const KURL& url, SandboxFlags
if (!url.isValid())
return adoptRef(new SecurityOrigin(KURL(), sandboxFlags));
#if ENABLE(BLOB)
- if (url.protocolIs("blob"))
+ if (url.protocolIs(BlobURL::blobProtocol()))
return adoptRef(new SecurityOrigin(BlobURL::getOrigin(url), sandboxFlags));
#endif
return adoptRef(new SecurityOrigin(url, sandboxFlags));
@@ -240,7 +240,7 @@ bool SecurityOrigin::canRequest(const KURL& url) const
bool doUniqueOriginCheck = true;
#if ENABLE(BLOB)
// For blob scheme, we want to ignore this check.
- doUniqueOriginCheck = !url.protocolIs("blob");
+ doUniqueOriginCheck = !url.protocolIs(BlobURL::blobProtocol());
#endif
if (doUniqueOriginCheck && targetOrigin->isUnique())
return false;
@@ -284,32 +284,35 @@ bool SecurityOrigin::isAccessWhiteListed(const SecurityOrigin* targetOrigin) con
return false;
}
-bool SecurityOrigin::canDisplay(const KURL& url, const String& referrer, Document* document)
+bool SecurityOrigin::canDisplay(const KURL& url) const
{
#if ENABLE(BLOB)
- if (url.protocolIs("blob") && document) {
- SecurityOrigin* documentOrigin = document->securityOrigin();
- RefPtr<SecurityOrigin> targetOrigin = SecurityOrigin::create(url);
- return documentOrigin->isSameSchemeHostPort(targetOrigin.get());
- }
+ if (url.protocolIs(BlobURL::blobProtocol()))
+ return canRequest(url);
#endif
+ if (!restrictAccessToLocal())
+ return true;
+
if (!SchemeRegistry::shouldTreatURLAsLocal(url.string()))
return true;
- // If we were provided a document, we first check if the access has been white listed.
- // Then we let its local file police dictate the result.
- // Otherwise we allow local loads only if the supplied referrer is also local.
- if (document) {
- SecurityOrigin* documentOrigin = document->securityOrigin();
- RefPtr<SecurityOrigin> targetOrigin = SecurityOrigin::create(url);
- if (documentOrigin->isAccessWhiteListed(targetOrigin.get()))
- return true;
- return documentOrigin->canLoadLocalResources();
- }
- if (!referrer.isEmpty())
- return SchemeRegistry::shouldTreatURLAsLocal(referrer);
- return false;
+ RefPtr<SecurityOrigin> targetOrigin = SecurityOrigin::create(url);
+ if (isAccessWhiteListed(targetOrigin.get()))
+ return true;
+
+ return canLoadLocalResources();
+}
+
+bool SecurityOrigin::deprecatedCanDisplay(const String& referrer, const KURL& url)
+{
+ if (!restrictAccessToLocal())
+ return true;
+
+ if (!SchemeRegistry::shouldTreatURLAsLocal(url.string()))
+ return true;
+
+ return SchemeRegistry::shouldTreatURLAsLocal(referrer);
}
void SecurityOrigin::grantLoadLocalResources()
diff --git a/WebCore/page/SecurityOrigin.h b/WebCore/page/SecurityOrigin.h
index 132fa5f..4789d3c 100644
--- a/WebCore/page/SecurityOrigin.h
+++ b/WebCore/page/SecurityOrigin.h
@@ -86,9 +86,11 @@ public:
// Returns true if |document| can display content from the given URL (e.g.,
// in an iframe or as an image). For example, web sites generally cannot
- // display content from the user's files system. If |document| is 0,
- // |referrer| is used to make this determination.
- static bool canDisplay(const KURL&, const String& referrer, Document* document);
+ // display content from the user's files system.
+ bool canDisplay(const KURL&) const;
+
+ // FIXME: Remove this function. This function exists only to service FrameLoader.
+ static bool deprecatedCanDisplay(const String& referrer, const KURL& targetURL);
// Returns true if this SecurityOrigin can load local resources, such
// as images, iframes, and style sheets, and can link to local URLs.
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index 210c97e..147e9e1 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -27,8 +27,9 @@
#include "Settings.h"
#include "BackForwardList.h"
-#include "Database.h"
#include "CachedResourceLoader.h"
+#include "DOMTimer.h"
+#include "Database.h"
#include "Frame.h"
#include "FrameTree.h"
#include "FrameView.h"
@@ -87,7 +88,6 @@ Settings::Settings(Page* page)
, m_sessionStorageQuota(StorageMap::noQuota)
#endif
, m_pluginAllowedRunTime(numeric_limits<unsigned>::max())
- , m_zoomMode(ZoomPage)
, m_isSpatialNavigationEnabled(false)
, m_isJavaEnabled(false)
, m_loadsImagesAutomatically(false)
@@ -158,12 +158,16 @@ Settings::Settings(Page* page)
#endif
, m_memoryInfoEnabled(false)
, m_interactiveFormValidation(false)
+<<<<<<< HEAD
#if ENABLE(WEB_AUTOFILL)
, m_autoFillEnabled(false)
#endif
#ifdef ANDROID_PLUGINS
, m_pluginsOnDemand(false)
#endif
+=======
+ , m_usePreHTML5ParserQuirks(false)
+>>>>>>> webkit.org at r67908
{
// A Frame may not have been created yet, so we initialize the AtomicString
// hash before trying to use it.
@@ -434,6 +438,11 @@ void Settings::setDOMPasteAllowed(bool DOMPasteAllowed)
m_isDOMPasteAllowed = DOMPasteAllowed;
}
+void Settings::setMinDOMTimerInterval(double interval)
+{
+ DOMTimer::setMinTimerInterval(interval);
+}
+
void Settings::setUsesPageCache(bool usesPageCache)
{
if (m_usesPageCache == usesPageCache)
@@ -713,15 +722,6 @@ void Settings::setShouldPaintCustomScrollbars(bool shouldPaintCustomScrollbars)
m_shouldPaintCustomScrollbars = shouldPaintCustomScrollbars;
}
-void Settings::setZoomMode(ZoomMode mode)
-{
- if (mode == m_zoomMode)
- return;
-
- m_zoomMode = mode;
- setNeedsRecalcStyleInAllFrames(m_page);
-}
-
void Settings::setEnforceCSSMIMETypeInNoQuirksMode(bool enforceCSSMIMETypeInNoQuirksMode)
{
m_enforceCSSMIMETypeInNoQuirksMode = enforceCSSMIMETypeInNoQuirksMode;
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index 6f18616..a0d07ff 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -30,7 +30,6 @@
#include "EditingBehaviorTypes.h"
#include "FontRenderingMode.h"
#include "KURL.h"
-#include "ZoomMode.h"
#include <wtf/text/AtomicString.h>
namespace WebCore {
@@ -229,6 +228,8 @@ namespace WebCore {
void setDOMPasteAllowed(bool);
bool isDOMPasteAllowed() const { return m_isDOMPasteAllowed; }
+ void setMinDOMTimerInterval(double); // Interval specified in seconds.
+
void setUsesPageCache(bool);
bool usesPageCache() const { return m_usesPageCache; }
@@ -319,9 +320,6 @@ namespace WebCore {
void setShouldPaintCustomScrollbars(bool);
bool shouldPaintCustomScrollbars() const { return m_shouldPaintCustomScrollbars; }
-
- void setZoomMode(ZoomMode);
- ZoomMode zoomMode() const { return m_zoomMode; }
void setEnforceCSSMIMETypeInNoQuirksMode(bool);
bool enforceCSSMIMETypeInNoQuirksMode() { return m_enforceCSSMIMETypeInNoQuirksMode; }
@@ -396,6 +394,9 @@ namespace WebCore {
// and http://webkit.org/b/40908
void setInteractiveFormValidationEnabled(bool flag) { m_interactiveFormValidation = flag; }
bool interactiveFormValidationEnabled() const { return m_interactiveFormValidation; }
+
+ void setUsePreHTML5ParserQuirks(bool flag) { m_usePreHTML5ParserQuirks = flag; }
+ bool usePreHTML5ParserQuirks() const { return m_usePreHTML5ParserQuirks; }
#if ENABLE(WEB_AUTOFILL)
void setAutoFillEnabled(bool flag) { m_autoFillEnabled = flag; }
@@ -465,7 +466,6 @@ namespace WebCore {
unsigned m_sessionStorageQuota;
#endif
unsigned m_pluginAllowedRunTime;
- ZoomMode m_zoomMode;
bool m_isSpatialNavigationEnabled : 1;
bool m_isJavaEnabled : 1;
bool m_loadsImagesAutomatically : 1;
@@ -527,12 +527,16 @@ namespace WebCore {
#endif
bool m_memoryInfoEnabled: 1;
bool m_interactiveFormValidation: 1;
+<<<<<<< HEAD
#ifdef ANDROID_PLUGINS
bool m_pluginsOnDemand : 1;
#endif
#if ENABLE(WEB_AUTOFILL)
bool m_autoFillEnabled: 1;
#endif
+=======
+ bool m_usePreHTML5ParserQuirks: 1;
+>>>>>>> webkit.org at r67908
#if USE(SAFARI_THEME)
static bool gShouldPaintNativeControls;
diff --git a/WebCore/page/SuspendableTimer.cpp b/WebCore/page/SuspendableTimer.cpp
index 532b0ed..23f00b0 100644
--- a/WebCore/page/SuspendableTimer.cpp
+++ b/WebCore/page/SuspendableTimer.cpp
@@ -55,7 +55,7 @@ void SuspendableTimer::stop()
TimerBase::stop();
}
-void SuspendableTimer::suspend()
+void SuspendableTimer::suspend(ReasonForSuspension)
{
#if !ASSERT_DISABLED
ASSERT(!m_suspended);
diff --git a/WebCore/page/SuspendableTimer.h b/WebCore/page/SuspendableTimer.h
index eae6153..cc90b62 100644
--- a/WebCore/page/SuspendableTimer.h
+++ b/WebCore/page/SuspendableTimer.h
@@ -41,7 +41,7 @@ public:
virtual bool hasPendingActivity() const;
virtual void stop();
virtual bool canSuspend() const;
- virtual void suspend();
+ virtual void suspend(ReasonForSuspension);
virtual void resume();
private:
diff --git a/WebCore/page/animation/AnimationBase.cpp b/WebCore/page/animation/AnimationBase.cpp
index 6efed8e..ade68b5 100644
--- a/WebCore/page/animation/AnimationBase.cpp
+++ b/WebCore/page/animation/AnimationBase.cpp
@@ -1180,6 +1180,10 @@ void AnimationBase::fireAnimationEventsIfNeeded()
// Check for end timeout
if (m_totalDuration >= 0 && elapsedDuration >= m_totalDuration) {
+ // We may still be in AnimationStateLooping if we've managed to skip a
+ // whole iteration, in which case we should jump to the end state.
+ m_animState = AnimationStateEnding;
+
// Fire an end event
updateStateMachine(AnimationStateInputEndTimerFired, m_totalDuration);
} else {
diff --git a/WebCore/page/animation/AnimationBase.h b/WebCore/page/animation/AnimationBase.h
index 182cb3c..f5f3172 100644
--- a/WebCore/page/animation/AnimationBase.h
+++ b/WebCore/page/animation/AnimationBase.h
@@ -42,7 +42,7 @@ class Element;
class Node;
class RenderObject;
class RenderStyle;
-struct TimingFunction;
+class TimingFunction;
class AnimationBase : public RefCounted<AnimationBase> {
friend class CompositeAnimation;
diff --git a/WebCore/page/chromium/ChromeClientChromium.h b/WebCore/page/chromium/ChromeClientChromium.h
index 7765472..44e005f 100644
--- a/WebCore/page/chromium/ChromeClientChromium.h
+++ b/WebCore/page/chromium/ChromeClientChromium.h
@@ -31,6 +31,7 @@
#ifndef ChromeClientChromium_h
#define ChromeClientChromium_h
+#include "AXObjectCache.h"
#include "ChromeClient.h"
#include <wtf/Forward.h>
@@ -58,6 +59,9 @@ public:
// Notified embedder that the children of an accessibility object has changed.
virtual void didChangeAccessibilityObjectChildren(AccessibilityObject*) = 0;
+
+ // Notifies embedder about an accessibility notification.
+ virtual void postAccessibilityNotification(AccessibilityObject*, AXObjectCache::AXNotification) = 0;
};
} // namespace WebCore
diff --git a/WebCore/page/chromium/EventHandlerChromium.cpp b/WebCore/page/chromium/EventHandlerChromium.cpp
index 719163f..dd6cf99 100644
--- a/WebCore/page/chromium/EventHandlerChromium.cpp
+++ b/WebCore/page/chromium/EventHandlerChromium.cpp
@@ -63,7 +63,7 @@ bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& m
VisiblePosition visiblePos(
mev.targetNode()->renderer()->positionForPoint(mev.localPoint()));
VisibleSelection newSelection(visiblePos);
- if (m_frame->shouldChangeSelection(newSelection))
+ if (m_frame->selection()->shouldChangeSelection(newSelection))
m_frame->selection()->setSelection(newSelection);
}
diff --git a/WebCore/page/chromium/FrameChromium.cpp b/WebCore/page/chromium/FrameChromium.cpp
index 4146b39..15ff8b4 100644
--- a/WebCore/page/chromium/FrameChromium.cpp
+++ b/WebCore/page/chromium/FrameChromium.cpp
@@ -86,7 +86,7 @@ DragImageRef Frame::nodeImage(Node* node)
buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
buffer->context()->clip(FloatRect(0, 0, paintingRect.right(), paintingRect.bottom()));
- m_view->paint(buffer->context(), paintingRect);
+ m_view->paintContents(buffer->context(), paintingRect);
RefPtr<Image> image = buffer->copyImage();
return createDragImageFromImage(image.get());
@@ -101,7 +101,7 @@ DragImageRef Frame::dragImageForSelection()
m_view->setPaintBehavior(PaintBehaviorSelectionOnly);
m_doc->updateLayout();
- IntRect paintingRect = enclosingIntRect(selectionBounds());
+ IntRect paintingRect = enclosingIntRect(selection()->bounds());
OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size()));
if (!buffer)
@@ -109,7 +109,7 @@ DragImageRef Frame::dragImageForSelection()
buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
buffer->context()->clip(FloatRect(0, 0, paintingRect.right(), paintingRect.bottom()));
- m_view->paint(buffer->context(), paintingRect);
+ m_view->paintContents(buffer->context(), paintingRect);
RefPtr<Image> image = buffer->copyImage();
return createDragImageFromImage(image.get());
diff --git a/WebCore/page/gtk/DragControllerGtk.cpp b/WebCore/page/gtk/DragControllerGtk.cpp
index c064a87..5f9044f 100644
--- a/WebCore/page/gtk/DragControllerGtk.cpp
+++ b/WebCore/page/gtk/DragControllerGtk.cpp
@@ -58,8 +58,7 @@ DragOperation DragController::dragOperation(DragData* dragData)
const IntSize& DragController::maxDragImageSize()
{
- static const IntSize maxDragImageSize(400, 400);
-
+ static const IntSize maxDragImageSize(200, 200);
return maxDragImageSize;
}
diff --git a/WebCore/page/mac/EventHandlerMac.mm b/WebCore/page/mac/EventHandlerMac.mm
index bb466db..584f38f 100644
--- a/WebCore/page/mac/EventHandlerMac.mm
+++ b/WebCore/page/mac/EventHandlerMac.mm
@@ -447,14 +447,25 @@ static void selfRetainingNSScrollViewScrollWheel(NSScrollView *self, SEL selecto
[self release];
}
-bool EventHandler::passWheelEventToWidget(PlatformWheelEvent&, Widget* widget)
+bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& wheelEvent, Widget* widget)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
-
- if ([currentNSEvent() type] != NSScrollWheel || m_sendingEventToSubview || !widget)
+
+ if (!widget)
return false;
NSView* nodeView = widget->platformWidget();
+ if (!nodeView) {
+ // WebKit2 code path.
+ if (!widget->isFrameView())
+ return false;
+
+ return static_cast<FrameView*>(widget)->frame()->eventHandler()->handleWheelEvent(wheelEvent);
+ }
+
+ if ([currentNSEvent() type] != NSScrollWheel || m_sendingEventToSubview)
+ return false;
+
ASSERT(nodeView);
ASSERT([nodeView superview]);
NSView *view = [nodeView hitTest:[[nodeView superview] convertPoint:[currentNSEvent() locationInWindow] fromView:nil]];
@@ -615,19 +626,49 @@ void EventHandler::mouseMoved(NSEvent *event)
END_BLOCK_OBJC_EXCEPTIONS;
}
+static bool frameHasPlatformWidget(Frame* frame)
+{
+ if (FrameView* frameView = frame->view()) {
+ if (frameView->platformWidget())
+ return true;
+ }
+
+ return false;
+}
+
bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
{
- return passSubframeEventToSubframe(mev, subframe);
+ // WebKit1 code path.
+ if (frameHasPlatformWidget(m_frame))
+ return passSubframeEventToSubframe(mev, subframe);
+
+ // WebKit2 code path.
+ subframe->eventHandler()->handleMousePressEvent(mev.event());
+ return true;
}
bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe, HitTestResult* hoveredNode)
{
- return passSubframeEventToSubframe(mev, subframe, hoveredNode);
+ // WebKit1 code path.
+ if (frameHasPlatformWidget(m_frame))
+ return passSubframeEventToSubframe(mev, subframe, hoveredNode);
+
+ // WebKit2 code path.
+ if (m_mouseDownMayStartDrag && !m_mouseDownWasInSubframe)
+ return false;
+ subframe->eventHandler()->handleMouseMoveEvent(mev.event(), hoveredNode);
+ return true;
}
bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
{
- return passSubframeEventToSubframe(mev, subframe);
+ // WebKit1 code path.
+ if (frameHasPlatformWidget(m_frame))
+ return passSubframeEventToSubframe(mev, subframe);
+
+ // WebKit2 code path.
+ subframe->eventHandler()->handleMouseReleaseEvent(mev.event());
+ return true;
}
PlatformMouseEvent EventHandler::currentPlatformMouseEvent() const
diff --git a/WebCore/page/mac/FrameMac.mm b/WebCore/page/mac/FrameMac.mm
index 510cb96..d4e4098 100644
--- a/WebCore/page/mac/FrameMac.mm
+++ b/WebCore/page/mac/FrameMac.mm
@@ -55,10 +55,6 @@
#import <Carbon/Carbon.h>
#import <wtf/StdLibExtras.h>
-#if ENABLE(DASHBOARD_SUPPORT)
-#import "WebDashboardRegion.h"
-#endif
-
@interface NSView (WebCoreHTMLDocumentView)
- (void)drawSingleRect:(NSRect)rect;
@end
@@ -140,43 +136,6 @@ static RegularExpression* regExpForLabels(NSArray* labels)
return result;
}
-NSString* Frame::searchForNSLabelsAboveCell(RegularExpression* regExp, HTMLTableCellElement* cell, size_t* resultDistanceFromStartOfCell)
-{
- RenderObject* cellRenderer = cell->renderer();
-
- if (cellRenderer && cellRenderer->isTableCell()) {
- RenderTableCell* tableCellRenderer = toRenderTableCell(cellRenderer);
- RenderTableCell* cellAboveRenderer = tableCellRenderer->table()->cellAbove(tableCellRenderer);
-
- if (cellAboveRenderer) {
- HTMLTableCellElement* aboveCell =
- static_cast<HTMLTableCellElement*>(cellAboveRenderer->node());
-
- if (aboveCell) {
- // search within the above cell we found for a match
- size_t lengthSearched = 0;
- for (Node* n = aboveCell->firstChild(); n; n = n->traverseNextNode(aboveCell)) {
- if (n->isTextNode() && n->renderer() && n->renderer()->style()->visibility() == VISIBLE) {
- // For each text chunk, run the regexp
- String nodeString = n->nodeValue();
- int pos = regExp->searchRev(nodeString);
- if (pos >= 0) {
- if (resultDistanceFromStartOfCell)
- *resultDistanceFromStartOfCell = lengthSearched;
- return nodeString.substring(pos, regExp->matchedLength());
- }
- lengthSearched += nodeString.length();
- }
- }
- }
- }
- }
- // Any reason in practice to search all cells in that are above cell?
- if (resultDistanceFromStartOfCell)
- *resultDistanceFromStartOfCell = notFound;
- return nil;
-}
-
NSString* Frame::searchForLabelsBeforeElement(NSArray* labels, Element* element, size_t* resultDistance, bool* resultIsInCellAbove)
{
RegularExpression* regExp = regExpForLabels(labels);
@@ -195,7 +154,7 @@ NSString* Frame::searchForLabelsBeforeElement(NSArray* labels, Element* element,
*resultIsInCellAbove = false;
// walk backwards in the node tree, until another element, or form, or end of tree
- int unsigned lengthSearched = 0;
+ unsigned lengthSearched = 0;
Node* n;
for (n = element->traversePreviousNode();
n && lengthSearched < charsSearchedThreshold;
@@ -347,7 +306,7 @@ NSImage* Frame::selectionImage(bool forceBlackText) const
{
m_view->setPaintBehavior(PaintBehaviorSelectionOnly | (forceBlackText ? PaintBehaviorForceBlackText : 0));
m_doc->updateLayout();
- NSImage* result = imageFromRect(selectionBounds());
+ NSImage* result = imageFromRect(selection()->bounds());
m_view->setPaintBehavior(PaintBehaviorNormal);
return result;
}
@@ -395,44 +354,6 @@ DragImageRef Frame::nodeImage(Node* node)
return result;
}
-#if ENABLE(DASHBOARD_SUPPORT)
-NSMutableDictionary* Frame::dashboardRegionsDictionary()
-{
- Document* doc = document();
-
- const Vector<DashboardRegionValue>& regions = doc->dashboardRegions();
- size_t n = regions.size();
-
- // Convert the Vector<DashboardRegionValue> into a NSDictionary of WebDashboardRegions
- NSMutableDictionary* webRegions = [NSMutableDictionary dictionaryWithCapacity:n];
- for (size_t i = 0; i < n; i++) {
- const DashboardRegionValue& region = regions[i];
-
- if (region.type == StyleDashboardRegion::None)
- continue;
-
- NSString *label = region.label;
- WebDashboardRegionType type = WebDashboardRegionTypeNone;
- if (region.type == StyleDashboardRegion::Circle)
- type = WebDashboardRegionTypeCircle;
- else if (region.type == StyleDashboardRegion::Rectangle)
- type = WebDashboardRegionTypeRectangle;
- NSMutableArray *regionValues = [webRegions objectForKey:label];
- if (!regionValues) {
- regionValues = [[NSMutableArray alloc] initWithCapacity:1];
- [webRegions setObject:regionValues forKey:label];
- [regionValues release];
- }
-
- WebDashboardRegion *webRegion = [[WebDashboardRegion alloc] initWithRect:region.bounds clip:region.clip type:type];
- [regionValues addObject:webRegion];
- [webRegion release];
- }
-
- return webRegions;
-}
-#endif
-
DragImageRef Frame::dragImageForSelection()
{
if (!selection()->isRange())
diff --git a/WebCore/page/win/FrameCGWin.cpp b/WebCore/page/win/FrameCGWin.cpp
index b61deef..62d33ef 100644
--- a/WebCore/page/win/FrameCGWin.cpp
+++ b/WebCore/page/win/FrameCGWin.cpp
@@ -87,7 +87,7 @@ HBITMAP imageFromSelection(Frame* frame, bool forceBlackText)
frame->document()->updateLayout();
frame->view()->setPaintBehavior(PaintBehaviorSelectionOnly | (forceBlackText ? PaintBehaviorForceBlackText : 0));
- FloatRect fr = frame->selectionBounds();
+ FloatRect fr = frame->selection()->bounds();
IntRect ir(static_cast<int>(fr.x()), static_cast<int>(fr.y()),
static_cast<int>(fr.width()), static_cast<int>(fr.height()));
HBITMAP image = imageFromRect(frame, ir);
diff --git a/WebCore/page/wince/FrameWince.cpp b/WebCore/page/wince/FrameWinCE.cpp
index 7cfbae0..dfea864 100644
--- a/WebCore/page/wince/FrameWince.cpp
+++ b/WebCore/page/wince/FrameWinCE.cpp
@@ -96,7 +96,7 @@ void computePageRectsForFrame(Frame* frame, const IntRect& printRect, float head
float printedPagesHeight = 0.0;
do {
float proposedBottom = min(docHeight, printedPagesHeight + pageHeight);
- frame->view()->adjustPageHeight(&proposedBottom, printedPagesHeight, proposedBottom, printedPagesHeight);
+ frame->view()->adjustPageHeightDeprecated(&proposedBottom, printedPagesHeight, proposedBottom, printedPagesHeight);
currPageHeight = max(1.0f, proposedBottom - printedPagesHeight);
pages.append(IntRect(0, printedPagesHeight, currPageWidth, currPageHeight));
@@ -109,8 +109,8 @@ HBITMAP imageFromSelection(Frame* frame, bool forceBlackText)
if (!frame->view())
return 0;
- frame->view()->setPaintRestriction(forceBlackText ? PaintRestrictionSelectionOnlyBlackText : PaintRestrictionSelectionOnly);
- FloatRect fr = frame->selectionBounds();
+ frame->view()->setPaintBehavior(PaintBehaviorSelectionOnly | (forceBlackText ? PaintBehaviorForceBlackText : 0));
+ FloatRect fr = frame->selection()->bounds();
IntRect ir((int)fr.x(), (int)fr.y(), (int)fr.width(), (int)fr.height());
if (ir.isEmpty())
return 0;
@@ -120,8 +120,8 @@ HBITMAP imageFromSelection(Frame* frame, bool forceBlackText)
FrameView* view = frame->view();
if (view->parent()) {
ir.setLocation(view->parent()->convertChildToSelf(view, ir.location()));
- w = ir.width() * view->zoomFactor() + 0.5;
- h = ir.height() * view->zoomFactor() + 0.5;
+ w = ir.width() * frame->pageZoomFactor() + 0.5;
+ h = ir.height() * frame->pageZoomFactor() + 0.5;
} else {
ir = view->contentsToWindow(ir);
w = ir.width();
@@ -143,7 +143,7 @@ HBITMAP imageFromSelection(Frame* frame, bool forceBlackText)
SelectObject(bmpDC.get(), hbmpOld);
- frame->view()->setPaintRestriction(PaintRestrictionNone);
+ frame->view()->setPaintBehavior(PaintBehaviorNormal);
return hBmp;
}
diff --git a/WebCore/platform/AsyncFileStream.h b/WebCore/platform/AsyncFileStream.h
index 3abda01..a555a24 100644
--- a/WebCore/platform/AsyncFileStream.h
+++ b/WebCore/platform/AsyncFileStream.h
@@ -31,7 +31,7 @@
#ifndef AsyncFileStream_h
#define AsyncFileStream_h
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#include "FileStreamClient.h"
#include <wtf/Forward.h>
@@ -69,6 +69,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // AsyncFileStream_h
diff --git a/WebCore/platform/DragImage.cpp b/WebCore/platform/DragImage.cpp
index aff4aba..5fcafc1 100644
--- a/WebCore/platform/DragImage.cpp
+++ b/WebCore/platform/DragImage.cpp
@@ -69,7 +69,7 @@ DragImageRef createDragImageForSelection(Frame* frame)
{
DragImageRef image = frame->dragImageForSelection();
if (image)
- dissolveDragImageToFraction(image, DragController::DragImageAlpha);
+ image = dissolveDragImageToFraction(image, DragController::DragImageAlpha);
return image;
}
diff --git a/WebCore/platform/DragImage.h b/WebCore/platform/DragImage.h
index e825798..a371821 100644
--- a/WebCore/platform/DragImage.h
+++ b/WebCore/platform/DragImage.h
@@ -48,7 +48,7 @@ class wxDragImage;
#elif PLATFORM(CHROMIUM)
#include "DragImageRef.h"
#elif PLATFORM(GTK)
-typedef struct _GdkPixbuf GdkPixbuf;
+typedef struct _cairo_surface cairo_surface_t;
#elif PLATFORM(HAIKU)
class BBitmap;
#elif PLATFORM(BREWMP)
@@ -75,7 +75,7 @@ namespace WebCore {
#elif PLATFORM(WX)
typedef wxDragImage* DragImageRef;
#elif PLATFORM(GTK)
- typedef GdkPixbuf* DragImageRef;
+ typedef cairo_surface_t* DragImageRef;
#elif PLATFORM(HAIKU)
typedef BBitmap* DragImageRef;
#elif PLATFORM(BREWMP)
diff --git a/WebCore/platform/FileStream.cpp b/WebCore/platform/FileStream.cpp
index 45f435e..5c77e08 100644
--- a/WebCore/platform/FileStream.cpp
+++ b/WebCore/platform/FileStream.cpp
@@ -30,7 +30,7 @@
#include "config.h"
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#include "FileStream.h"
@@ -147,4 +147,4 @@ bool FileStream::truncate(long long)
} // namespace WebCore
-#endif // ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
diff --git a/WebCore/platform/FileStream.h b/WebCore/platform/FileStream.h
index 6c3a221..c369eb0 100644
--- a/WebCore/platform/FileStream.h
+++ b/WebCore/platform/FileStream.h
@@ -31,7 +31,7 @@
#ifndef FileStream_h
#define FileStream_h
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#include "FileSystem.h"
#include <wtf/Forward.h>
@@ -95,6 +95,6 @@ private:
} // namespace WebCore
-#endif // ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // FileStream_h
diff --git a/WebCore/platform/FileStreamClient.h b/WebCore/platform/FileStreamClient.h
index b3d1fff..4066d9f 100644
--- a/WebCore/platform/FileStreamClient.h
+++ b/WebCore/platform/FileStreamClient.h
@@ -31,7 +31,7 @@
#ifndef FileStreamClient_h
#define FileStreamClient_h
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
namespace WebCore {
@@ -58,6 +58,6 @@ protected:
} // namespace WebCore
-#endif // ENABLE(BLOB) || ENABLE(FILE_WRITER)
+#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // FileStreamClient_h
diff --git a/WebCore/platform/LinkHash.cpp b/WebCore/platform/LinkHash.cpp
index 86b4c8a..ac3aa3c 100644
--- a/WebCore/platform/LinkHash.cpp
+++ b/WebCore/platform/LinkHash.cpp
@@ -31,36 +31,36 @@
namespace WebCore {
-static inline size_t findSlashDotDotSlash(const UChar* characters, size_t length)
+static inline size_t findSlashDotDotSlash(const UChar* characters, size_t length, size_t position)
{
if (length < 4)
return notFound;
- unsigned loopLimit = length - 3;
- for (unsigned i = 0; i < loopLimit; ++i) {
+ size_t loopLimit = length - 3;
+ for (size_t i = position; i < loopLimit; ++i) {
if (characters[i] == '/' && characters[i + 1] == '.' && characters[i + 2] == '.' && characters[i + 3] == '/')
return i;
}
return notFound;
}
-static inline size_t findSlashSlash(const UChar* characters, size_t length, int position)
+static inline size_t findSlashSlash(const UChar* characters, size_t length, size_t position)
{
if (length < 2)
return notFound;
- unsigned loopLimit = length - 1;
- for (unsigned i = position; i < loopLimit; ++i) {
+ size_t loopLimit = length - 1;
+ for (size_t i = position; i < loopLimit; ++i) {
if (characters[i] == '/' && characters[i + 1] == '/')
return i;
}
return notFound;
}
-static inline size_t findSlashDotSlash(const UChar* characters, size_t length)
+static inline size_t findSlashDotSlash(const UChar* characters, size_t length, size_t position)
{
if (length < 3)
return notFound;
- unsigned loopLimit = length - 2;
- for (unsigned i = 0; i < loopLimit; ++i) {
+ size_t loopLimit = length - 2;
+ for (size_t i = position; i < loopLimit; ++i) {
if (characters[i] == '/' && characters[i + 1] == '.' && characters[i + 2] == '/')
return i;
}
@@ -79,38 +79,90 @@ static inline bool containsColonSlashSlash(const UChar* characters, unsigned len
return false;
}
-static inline void cleanPath(Vector<UChar, 512>& path)
+static inline void squeezeOutNullCharacters(Vector<UChar, 512>& string)
{
- // FIXME: Should not do this in the query or anchor part.
- size_t pos;
- while ((pos = findSlashDotDotSlash(path.data(), path.size())) != notFound) {
- size_t prev = reverseFind(path.data(), path.size(), '/', pos - 1);
- // don't remove the host, i.e. http://foo.org/../foo.html
- if (prev == notFound || (prev > 3 && path[prev - 2] == ':' && path[prev - 1] == '/'))
- path.remove(pos, 3);
- else
- path.remove(prev, pos - prev + 3);
+ size_t size = string.size();
+ size_t i = 0;
+ for (i = 0; i < size; ++i) {
+ if (!string[i])
+ break;
}
+ if (i == size)
+ return;
+ size_t j = i;
+ for (++i; i < size; ++i) {
+ if (UChar character = string[i])
+ string[j++] = character;
+ }
+ ASSERT(j < size);
+ string.shrink(j);
+}
- // FIXME: Should not do this in the query part.
- pos = 0;
- if ((pos = findSlashSlash(path.data(), path.size(), pos)) != notFound) {
- size_t refPos = find(path.data(), path.size(), '#');
- while (refPos == 0 || refPos == notFound || pos < refPos) {
- if (pos == 0 || path[pos - 1] != ':')
- path.remove(pos);
- else
- pos += 2;
- if ((pos = findSlashSlash(path.data(), path.size(), pos)) == notFound)
- break;
+static void cleanSlashDotDotSlashes(Vector<UChar, 512>& path, size_t firstSlash)
+{
+ size_t slash = firstSlash;
+ do {
+ size_t previousSlash = slash ? reverseFind(path.data(), path.size(), '/', slash - 1) : notFound;
+ // Don't remove the host, i.e. http://foo.org/../foo.html
+ if (previousSlash == notFound || (previousSlash > 3 && path[previousSlash - 2] == ':' && path[previousSlash - 1] == '/')) {
+ path[slash] = 0;
+ path[slash + 1] = 0;
+ path[slash + 2] = 0;
+ } else {
+ for (size_t i = previousSlash; i < slash + 3; ++i)
+ path[i] = 0;
}
+ slash += 3;
+ } while ((slash = findSlashDotDotSlash(path.data(), path.size(), slash)) != notFound);
+ squeezeOutNullCharacters(path);
+}
+
+static void mergeDoubleSlashes(Vector<UChar, 512>& path, size_t firstSlash)
+{
+ size_t refPos = find(path.data(), path.size(), '#');
+ if (!refPos || refPos == notFound)
+ refPos = path.size();
+
+ size_t slash = firstSlash;
+ while (slash < refPos) {
+ if (!slash || path[slash - 1] != ':')
+ path[slash++] = 0;
+ else
+ slash += 2;
+ if ((slash = findSlashSlash(path.data(), path.size(), slash)) == notFound)
+ break;
}
+ squeezeOutNullCharacters(path);
+}
- // FIXME: Should not do this in the query or anchor part.
- while ((pos = findSlashDotSlash(path.data(), path.size())) != notFound)
- path.remove(pos, 2);
+static void cleanSlashDotSlashes(Vector<UChar, 512>& path, size_t firstSlash)
+{
+ size_t slash = firstSlash;
+ do {
+ path[slash] = 0;
+ path[slash + 1] = 0;
+ slash += 2;
+ } while ((slash = findSlashDotSlash(path.data(), path.size(), slash)) != notFound);
+ squeezeOutNullCharacters(path);
}
+static inline void cleanPath(Vector<UChar, 512>& path)
+{
+ // FIXME: Should not do this in the query or anchor part of the URL.
+ size_t firstSlash = findSlashDotDotSlash(path.data(), path.size(), 0);
+ if (firstSlash != notFound)
+ cleanSlashDotDotSlashes(path, firstSlash);
+
+ // FIXME: Should not do this in the query part.
+ firstSlash = findSlashSlash(path.data(), path.size(), 0);
+ if (firstSlash != notFound)
+ mergeDoubleSlashes(path, firstSlash);
+
+ // FIXME: Should not do this in the query or anchor part.
+ firstSlash = findSlashDotSlash(path.data(), path.size(), 0);
+ if (firstSlash != notFound)
+ cleanSlashDotSlashes(path, firstSlash);
+}
static inline bool matchLetter(UChar c, UChar lowercaseLetter)
{
diff --git a/WebCore/platform/MIMETypeRegistry.cpp b/WebCore/platform/MIMETypeRegistry.cpp
index 5c20e08..a99c448 100644
--- a/WebCore/platform/MIMETypeRegistry.cpp
+++ b/WebCore/platform/MIMETypeRegistry.cpp
@@ -104,9 +104,12 @@ static void initializeSupportedImageMIMETypes()
continue;
#endif
String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData());
- supportedImageMIMETypes->add(mimeType);
- supportedImageResourceMIMETypes->add(mimeType);
+ if (!mimeType.isEmpty()) {
+ supportedImageMIMETypes->add(mimeType);
+ supportedImageResourceMIMETypes->add(mimeType);
+ }
}
+<<<<<<< HEAD
supportedImageMIMETypes->remove("application/octet-stream");
supportedImageResourceMIMETypes->remove("application/octet-stream");
@@ -132,6 +135,8 @@ static void initializeSupportedImageMIMETypes()
#if !ENABLE(XSLT)
supportedNonImageMIMETypes->remove("text/xsl");
#endif
+=======
+>>>>>>> webkit.org at r67908
#else
// assume that all implementations at least support the following standard
// image types:
@@ -176,10 +181,9 @@ static void initializeSupportedImageMIMETypesForEncoding()
QList<QByteArray> formats = QImageWriter::supportedImageFormats();
for (int i = 0; i < formats.size(); ++i) {
String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData());
- supportedImageMIMETypesForEncoding->add(mimeType);
+ if (!mimeType.isEmpty())
+ supportedImageMIMETypesForEncoding->add(mimeType);
}
-
- supportedImageMIMETypesForEncoding->remove("application/octet-stream");
#elif PLATFORM(GTK)
supportedImageMIMETypesForEncoding->add("image/png");
supportedImageMIMETypesForEncoding->add("image/jpeg");
diff --git a/WebCore/platform/Pasteboard.h b/WebCore/platform/Pasteboard.h
index 7773624..7c50737 100644
--- a/WebCore/platform/Pasteboard.h
+++ b/WebCore/platform/Pasteboard.h
@@ -79,6 +79,7 @@ class HitTestResult;
class KURL;
class Node;
class Range;
+class ArchiveResource;
class Pasteboard : public Noncopyable {
public:
@@ -118,6 +119,8 @@ private:
#if PLATFORM(MAC)
Pasteboard(NSPasteboard *);
RetainPtr<NSPasteboard> m_pasteboard;
+ PassRefPtr<DocumentFragment> documentFragmentWithImageResource(Frame* frame, PassRefPtr<ArchiveResource> resource);
+ PassRefPtr<DocumentFragment> documentFragmentWithRtf(Frame* frame, NSString* pboardType);
#endif
#if PLATFORM(WIN)
diff --git a/WebCore/platform/ScrollAnimator.cpp b/WebCore/platform/ScrollAnimator.cpp
index c863c1d..583e833 100644
--- a/WebCore/platform/ScrollAnimator.cpp
+++ b/WebCore/platform/ScrollAnimator.cpp
@@ -36,7 +36,7 @@
namespace WebCore {
-#if !OS(WINDOWS)
+#if !ENABLE(SMOOTH_SCROLLING)
ScrollAnimator* ScrollAnimator::create(ScrollbarClient* client)
{
return new ScrollAnimator(client);
diff --git a/WebCore/platform/ScrollAnimatorWin.cpp b/WebCore/platform/ScrollAnimatorWin.cpp
index 8b7d0f6..025aa71 100644
--- a/WebCore/platform/ScrollAnimatorWin.cpp
+++ b/WebCore/platform/ScrollAnimatorWin.cpp
@@ -29,6 +29,9 @@
*/
#include "config.h"
+
+#if ENABLE(SMOOTH_SCROLLING)
+
#include "ScrollAnimatorWin.h"
#include "ScrollbarClient.h"
@@ -128,7 +131,7 @@ bool ScrollAnimatorWin::scroll(ScrollbarOrientation orientation, ScrollGranulari
// velocity needed to stay smoothly in sync with the user's actions; for
// events that come slower, we'll scroll one increment and then pause until
// the next event fires.
- float animationStep = abs(newPos - *data->m_currentPos);
+ float animationStep = fabs(newPos - *data->m_currentPos);
// If a key is held down (or the wheel continually spun), then once we have
// reached a velocity close to the steady-state velocity, we're likely to
// hit the desired position at around the same time we'd expect the next
@@ -275,7 +278,7 @@ void ScrollAnimatorWin::animateScroll(PerAxisData* data)
}
// Now update the scroll position based on the distance traveled.
- if (distanceTraveled >= abs(data->m_desiredPos - *data->m_currentPos)) {
+ if (distanceTraveled >= fabs(data->m_desiredPos - *data->m_currentPos)) {
// We've traveled far enough to reach the desired position. Stop smooth
// scrolling.
*data->m_currentPos = data->m_desiredPos;
@@ -294,3 +297,5 @@ void ScrollAnimatorWin::animateScroll(PerAxisData* data)
}
} // namespace WebCore
+
+#endif // ENABLE(SMOOTH_SCROLLING)
diff --git a/WebCore/platform/ScrollAnimatorWin.h b/WebCore/platform/ScrollAnimatorWin.h
index 002a454..7043634 100644
--- a/WebCore/platform/ScrollAnimatorWin.h
+++ b/WebCore/platform/ScrollAnimatorWin.h
@@ -31,6 +31,8 @@
#ifndef ScrollAnimatorWin_h
#define ScrollAnimatorWin_h
+#if ENABLE(SMOOTH_SCROLLING)
+
#include "ScrollAnimator.h"
#include "Timer.h"
@@ -68,4 +70,7 @@ private:
};
}
+
+#endif // ENABLE(SMOOTH_SCROLLING)
+
#endif
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index 43badd0..0273807 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -340,6 +340,15 @@ void ScrollView::valueChanged(Scrollbar* scrollbar)
scrollContents(scrollDelta);
}
+void ScrollView::valueChanged(const IntSize& scrollDelta)
+{
+ if (scrollbarsSuppressed())
+ return;
+
+ repaintFixedElementsAfterScrolling();
+ scrollContents(scrollDelta);
+}
+
void ScrollView::setScrollPosition(const IntPoint& scrollPoint)
{
if (prohibitsScrolling())
@@ -524,7 +533,7 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset)
IntSize scrollDelta = scroll - m_scrollOffset;
if (scrollDelta != IntSize()) {
m_scrollOffset = scroll;
- scrollContents(scrollDelta);
+ valueChanged(scrollDelta);
}
m_inUpdateScrollbars = false;
diff --git a/WebCore/platform/ScrollView.h b/WebCore/platform/ScrollView.h
index a55fed4..751b276 100644
--- a/WebCore/platform/ScrollView.h
+++ b/WebCore/platform/ScrollView.h
@@ -62,6 +62,7 @@ public:
virtual int scrollSize(ScrollbarOrientation orientation) const;
virtual void setScrollOffsetFromAnimation(const IntPoint&);
virtual void valueChanged(Scrollbar*);
+ virtual void valueChanged(const IntSize&);
// The window thats hosts the ScrollView. The ScrollView will communicate scrolls and repaints to the
// host window in the window's coordinate space.
diff --git a/WebCore/platform/animation/Animation.h b/WebCore/platform/animation/Animation.h
index 9130415..1541b4d 100644
--- a/WebCore/platform/animation/Animation.h
+++ b/WebCore/platform/animation/Animation.h
@@ -84,7 +84,7 @@ public:
double delay() const { return m_delay; }
enum AnimationDirection { AnimationDirectionNormal, AnimationDirectionAlternate };
- AnimationDirection direction() const { return m_direction; }
+ AnimationDirection direction() const { return static_cast<AnimationDirection>(m_direction); }
unsigned fillMode() const { return m_fillMode; }
@@ -131,7 +131,7 @@ private:
double m_delay;
double m_duration;
RefPtr<TimingFunction> m_timingFunction;
- AnimationDirection m_direction : 1;
+ unsigned m_direction : 1; // AnimationDirection
unsigned m_fillMode : 2;
unsigned m_playState : 2;
diff --git a/WebCore/platform/audio/AudioFileReader.h b/WebCore/platform/audio/AudioFileReader.h
new file mode 100644
index 0000000..3c02490
--- /dev/null
+++ b/WebCore/platform/audio/AudioFileReader.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:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AudioFileReader_h
+#define AudioFileReader_h
+
+#include <stdlib.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class AudioBus;
+
+// For both create functions:
+// Pass in 0.0 for sampleRate to use the file's sample-rate, otherwise a sample-rate conversion to the requested
+// sampleRate will be made (if it doesn't already match the file's sample-rate).
+// The created buffer will have its sample-rate set correctly to the result.
+
+PassOwnPtr<AudioBus> createBusFromInMemoryAudioFile(const void* data, size_t dataSize, bool mixToMono, double sampleRate);
+
+PassOwnPtr<AudioBus> createBusFromAudioFile(const char* filePath, bool mixToMono, double sampleRate);
+
+// May pass in 0.0 for sampleRate in which case it will use the AudioBus's sampleRate
+void writeBusToAudioFile(AudioBus* bus, const char* filePath, double fileSampleRate);
+
+} // namespace WebCore
+
+#endif // AudioFileReader_h
diff --git a/WebCore/platform/audio/mac/AudioFileReaderMac.cpp b/WebCore/platform/audio/mac/AudioFileReaderMac.cpp
new file mode 100644
index 0000000..9dad611
--- /dev/null
+++ b/WebCore/platform/audio/mac/AudioFileReaderMac.cpp
@@ -0,0 +1,257 @@
+/*
+ * 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"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioFileReaderMac.h"
+
+#include "AudioBus.h"
+#include "AudioFileReader.h"
+#include <CoreFoundation/CoreFoundation.h>
+
+namespace WebCore {
+
+static AudioBufferList* createAudioBufferList(size_t numberOfBuffers)
+{
+ size_t bufferListSize = sizeof(AudioBufferList) - sizeof(AudioBuffer);
+ bufferListSize += numberOfBuffers * sizeof(AudioBuffer);
+
+ AudioBufferList* bufferList = static_cast<AudioBufferList*>(calloc(1, bufferListSize));
+ if (bufferList)
+ bufferList->mNumberBuffers = numberOfBuffers;
+
+ return bufferList;
+}
+
+static void destroyAudioBufferList(AudioBufferList* bufferList)
+{
+ free(bufferList);
+}
+
+AudioFileReader::AudioFileReader(const char* filePath)
+ : m_data(0)
+ , m_dataSize(0)
+ , m_filePath(filePath)
+ , m_audioFileID(0)
+ , m_extAudioFileRef(0)
+{
+ FSRef fsref;
+ OSStatus result = FSPathMakeRef((UInt8*)filePath, &fsref, 0);
+ if (result != noErr)
+ return;
+
+ CFURLRef urlRef = CFURLCreateFromFSRef(0, &fsref);
+ if (!urlRef)
+ return;
+
+ ExtAudioFileOpenURL(urlRef, &m_extAudioFileRef);
+
+ if (urlRef)
+ CFRelease(urlRef);
+}
+
+AudioFileReader::AudioFileReader(const void* data, size_t dataSize)
+ : m_data(data)
+ , m_dataSize(dataSize)
+ , m_filePath(0)
+ , m_audioFileID(0)
+ , m_extAudioFileRef(0)
+{
+ OSStatus result = AudioFileOpenWithCallbacks(this, readProc, 0, getSizeProc, 0, 0, &m_audioFileID);
+
+ if (result != noErr)
+ return;
+
+ result = ExtAudioFileWrapAudioFileID(m_audioFileID, false, &m_extAudioFileRef);
+ if (result != noErr)
+ m_extAudioFileRef = 0;
+}
+
+AudioFileReader::~AudioFileReader()
+{
+ if (m_extAudioFileRef)
+ ExtAudioFileDispose(m_extAudioFileRef);
+
+ m_extAudioFileRef = 0;
+
+ if (m_audioFileID)
+ AudioFileClose(m_audioFileID);
+
+ m_audioFileID = 0;
+}
+
+OSStatus AudioFileReader::readProc(void* clientData, SInt64 position, UInt32 requestCount, void* buffer, UInt32* actualCount)
+{
+ AudioFileReader* audioFileReader = static_cast<AudioFileReader*>(clientData);
+
+ size_t dataSize = audioFileReader->dataSize();
+ const void* data = audioFileReader->data();
+ size_t bytesToRead = 0;
+
+ if (static_cast<UInt64>(position) < dataSize) {
+ size_t bytesAvailable = dataSize - static_cast<size_t>(position);
+ bytesToRead = requestCount <= bytesAvailable ? requestCount : bytesAvailable;
+ memcpy(buffer, static_cast<const char*>(data) + position, bytesToRead);
+ } else
+ bytesToRead = 0;
+
+ if (actualCount)
+ *actualCount = bytesToRead;
+
+ return noErr;
+}
+
+SInt64 AudioFileReader::getSizeProc(void* clientData)
+{
+ AudioFileReader* audioFileReader = static_cast<AudioFileReader*>(clientData);
+ return audioFileReader->dataSize();
+}
+
+PassOwnPtr<AudioBus> AudioFileReader::createBus(double sampleRate, bool mixToMono)
+{
+ if (!m_extAudioFileRef)
+ return 0;
+
+ // Get file's data format
+ UInt32 size = sizeof(m_fileDataFormat);
+ OSStatus result = ExtAudioFileGetProperty(m_extAudioFileRef, kExtAudioFileProperty_FileDataFormat, &size, &m_fileDataFormat);
+ if (result != noErr)
+ return 0;
+
+ // Number of channels
+ size_t numberOfChannels = m_fileDataFormat.mChannelsPerFrame;
+
+ // Number of frames
+ SInt64 numberOfFrames64 = 0;
+ size = sizeof(numberOfFrames64);
+ result = ExtAudioFileGetProperty(m_extAudioFileRef, kExtAudioFileProperty_FileLengthFrames, &size, &numberOfFrames64);
+ if (result != noErr)
+ return 0;
+
+ // Sample-rate
+ double fileSampleRate = m_fileDataFormat.mSampleRate;
+
+ // Make client format same number of channels as file format, but tweak a few things.
+ // Client format will be linear PCM (canonical), and potentially change sample-rate.
+ m_clientDataFormat = m_fileDataFormat;
+
+ m_clientDataFormat.mFormatID = kAudioFormatLinearPCM;
+ m_clientDataFormat.mFormatFlags = kAudioFormatFlagsCanonical;
+ m_clientDataFormat.mBitsPerChannel = 8 * sizeof(AudioSampleType);
+ m_clientDataFormat.mChannelsPerFrame = numberOfChannels;
+ m_clientDataFormat.mFramesPerPacket = 1;
+ m_clientDataFormat.mBytesPerPacket = sizeof(AudioSampleType);
+ m_clientDataFormat.mBytesPerFrame = sizeof(AudioSampleType);
+ m_clientDataFormat.mFormatFlags |= kAudioFormatFlagIsNonInterleaved;
+
+ if (sampleRate)
+ m_clientDataFormat.mSampleRate = sampleRate;
+
+ result = ExtAudioFileSetProperty(m_extAudioFileRef, kExtAudioFileProperty_ClientDataFormat, sizeof(AudioStreamBasicDescription), &m_clientDataFormat);
+ if (result != noErr)
+ return 0;
+
+ // Change numberOfFrames64 to destination sample-rate
+ numberOfFrames64 = numberOfFrames64 * (m_clientDataFormat.mSampleRate / fileSampleRate);
+ size_t numberOfFrames = static_cast<size_t>(numberOfFrames64);
+
+ size_t busChannelCount = mixToMono ? 1 : numberOfChannels;
+
+ // Create AudioBus where we'll put the PCM audio data
+ OwnPtr<AudioBus> audioBus = adoptPtr(new AudioBus(busChannelCount, numberOfFrames));
+ audioBus->setSampleRate(m_clientDataFormat.mSampleRate); // save for later
+
+ // Only allocated in the mixToMono case
+ AudioFloatArray bufL;
+ AudioFloatArray bufR;
+ float* bufferL = 0;
+ float* bufferR = 0;
+
+ // Setup AudioBufferList in preparation for reading
+ AudioBufferList* bufferList = createAudioBufferList(numberOfChannels);
+
+ if (mixToMono && numberOfChannels == 2) {
+ bufL.resize(numberOfFrames);
+ bufR.resize(numberOfFrames);
+ bufferL = bufL.data();
+ bufferR = bufR.data();
+
+ bufferList->mBuffers[0].mNumberChannels = 1;
+ bufferList->mBuffers[0].mDataByteSize = numberOfFrames * sizeof(float);
+ bufferList->mBuffers[0].mData = bufferL;
+
+ bufferList->mBuffers[1].mNumberChannels = 1;
+ bufferList->mBuffers[1].mDataByteSize = numberOfFrames * sizeof(float);
+ bufferList->mBuffers[1].mData = bufferR;
+ } else {
+ ASSERT(!mixToMono || numberOfChannels == 1);
+
+ // for True-stereo (numberOfChannels == 4)
+ for (size_t i = 0; i < numberOfChannels; ++i) {
+ bufferList->mBuffers[i].mNumberChannels = 1;
+ bufferList->mBuffers[i].mDataByteSize = numberOfFrames * sizeof(float);
+ bufferList->mBuffers[i].mData = audioBus->channel(i)->data();
+ }
+ }
+
+ // Read from the file (or in-memory version)
+ UInt32 framesToRead = numberOfFrames;
+ result = ExtAudioFileRead(m_extAudioFileRef, &framesToRead, bufferList);
+ if (result != noErr)
+ return 0;
+
+ if (mixToMono && numberOfChannels == 2) {
+ // Mix stereo down to mono
+ float* destL = audioBus->channel(0)->data();
+ for (size_t i = 0; i < numberOfFrames; i++)
+ destL[i] = 0.5f * (bufferL[i] + bufferR[i]);
+ }
+
+ // Cleanup
+ destroyAudioBufferList(bufferList);
+
+ return audioBus.release();
+}
+
+PassOwnPtr<AudioBus> createBusFromAudioFile(const char* filePath, bool mixToMono, double sampleRate)
+{
+ AudioFileReader reader(filePath);
+ return reader.createBus(sampleRate, mixToMono);
+}
+
+PassOwnPtr<AudioBus> createBusFromInMemoryAudioFile(const void* data, size_t dataSize, bool mixToMono, double sampleRate)
+{
+ AudioFileReader reader(data, dataSize);
+ return reader.createBus(sampleRate, mixToMono);
+}
+
+} // WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/platform/audio/mac/AudioFileReaderMac.h b/WebCore/platform/audio/mac/AudioFileReaderMac.h
new file mode 100644
index 0000000..d531266
--- /dev/null
+++ b/WebCore/platform/audio/mac/AudioFileReaderMac.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AudioFileReaderMac_h
+#define AudioFileReaderMac_h
+
+#include <AudioToolbox/AudioFile.h>
+#include <AudioToolbox/ExtendedAudioFile.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class AudioBus;
+
+// Wrapper class for AudioFile and ExtAudioFile CoreAudio APIs for reading files and in-memory versions of them...
+
+class AudioFileReader {
+public:
+ AudioFileReader(const char* filePath);
+ AudioFileReader(const void* data, size_t dataSize);
+ ~AudioFileReader();
+
+ // Returns 0 if error
+ PassOwnPtr<AudioBus> createBus(double sampleRate, bool mixToMono);
+
+ const void* data() const { return m_data; }
+ size_t dataSize() const { return m_dataSize; }
+
+private:
+ static OSStatus readProc(void* clientData, SInt64 position, UInt32 requestCount, void* buffer, UInt32* actualCount);
+ static SInt64 getSizeProc(void* clientData);
+
+ const void* m_data;
+ size_t m_dataSize;
+ const char* m_filePath;
+
+ AudioFileID m_audioFileID;
+ ExtAudioFileRef m_extAudioFileRef;
+
+ AudioStreamBasicDescription m_fileDataFormat;
+ AudioStreamBasicDescription m_clientDataFormat;
+};
+
+} // namespace WebCore
+
+#endif // AudioFileReaderMac_h
diff --git a/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp b/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
index 9d172a3..d7a1279 100644
--- a/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
+++ b/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
@@ -35,7 +35,7 @@
namespace WebCore {
-static String keyIdentifierForBrewKeyCode(int16 keyCode)
+static String keyIdentifierForBrewKeyCode(uint16 keyCode)
{
switch (keyCode) {
case AVK_LALT:
@@ -106,7 +106,7 @@ static String keyIdentifierForBrewKeyCode(int16 keyCode)
static int windowsKeyCodeForKeyEvent(uint16 code)
{
switch (code) {
- case AVK_A:
+ case AVK_CLR:
return VK_BACK; // (08) BACKSPACE key
case AVK_ENTER:
return VK_RETURN; // (0D) Return key
diff --git a/WebCore/platform/brew/PlatformMouseEventBrew.cpp b/WebCore/platform/brew/PlatformMouseEventBrew.cpp
index 32593e6..a118d19 100644
--- a/WebCore/platform/brew/PlatformMouseEventBrew.cpp
+++ b/WebCore/platform/brew/PlatformMouseEventBrew.cpp
@@ -65,15 +65,10 @@ PlatformMouseEvent::PlatformMouseEvent(AEEEvent event, uint16 wParam, uint32 dwP
m_altKey = keyModifiers & (KB_LALT | KB_RALT);
m_metaKey = m_altKey;
- uint16 mouseModifiers = AEE_POINTER_GET_MOUSE_MODIFIERS(dwParamStr);
- if (mouseModifiers & AEE_POINTER_MOUSE_LBUTTON)
- m_button = LeftButton;
- else if (mouseModifiers & AEE_POINTER_MOUSE_RBUTTON)
- m_button = RightButton;
- else if (mouseModifiers & AEE_POINTER_MOUSE_MBUTTON)
- m_button = MiddleButton;
- else
- m_button = NoButton;
+ // AEE_POINTER_GET_MOUSE_MODIFIERS(dwParamStr) always returns 0,
+ // so it is impossible to know which button is pressed or released.
+ // Just use LeftButton because Brew MP usually runs on touch device.
+ m_button = LeftButton;
// AEE_POINTER_GET_TIME returns milliseconds
m_timestamp = AEE_POINTER_GET_TIME(dwParamStr) * 0.001;
diff --git a/WebCore/platform/brew/SSLKeyGeneratorBrew.cpp b/WebCore/platform/brew/SSLKeyGeneratorBrew.cpp
index 4887e4f..dc1a148 100644
--- a/WebCore/platform/brew/SSLKeyGeneratorBrew.cpp
+++ b/WebCore/platform/brew/SSLKeyGeneratorBrew.cpp
@@ -24,12 +24,12 @@
namespace WebCore {
-void WebCore::getSupportedKeySizes(Vector<String>& v)
+void getSupportedKeySizes(Vector<String>& v)
{
notImplemented();
}
-String WebCore::signedPublicKeyAndChallengeString(unsigned index, const String& challenge, const KURL& url)
+String signedPublicKeyAndChallengeString(unsigned index, const String& challenge, const KURL& url)
{
notImplemented();
return String();
diff --git a/WebCore/platform/brew/SharedBufferBrew.cpp b/WebCore/platform/brew/SharedBufferBrew.cpp
index 597825c..3d4c20a 100644
--- a/WebCore/platform/brew/SharedBufferBrew.cpp
+++ b/WebCore/platform/brew/SharedBufferBrew.cpp
@@ -64,6 +64,7 @@ PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String& fi
int32 bytesRead;
while ((bytesRead = IFILE_Read(file.get(), result->m_buffer.data() + totalBytesRead, fileSize - totalBytesRead)) > 0)
totalBytesRead += bytesRead;
+ result->m_size = totalBytesRead;
if (totalBytesRead != fileSize) {
LOG_ERROR("Failed to fully read contents of file %s - errno(%i)", filePath.ascii().data(), IFILEMGR_GetLastError(fileMgr.get()));
diff --git a/WebCore/platform/chromium/ClipboardChromium.cpp b/WebCore/platform/chromium/ClipboardChromium.cpp
index aff1466..3d82aea 100644
--- a/WebCore/platform/chromium/ClipboardChromium.cpp
+++ b/WebCore/platform/chromium/ClipboardChromium.cpp
@@ -364,10 +364,9 @@ PassRefPtr<FileList> ClipboardChromium::files() const
if (!m_dataObject || m_dataObject->filenames.isEmpty())
return FileList::create();
- ScriptExecutionContext* scriptExecutionContext = m_frame->document()->scriptExecutionContext();
RefPtr<FileList> fileList = FileList::create();
for (size_t i = 0; i < m_dataObject->filenames.size(); ++i)
- fileList->append(File::create(scriptExecutionContext, m_dataObject->filenames.at(i)));
+ fileList->append(File::create(m_dataObject->filenames.at(i)));
return fileList.release();
}
diff --git a/WebCore/platform/chromium/GeolocationServiceChromium.cpp b/WebCore/platform/chromium/GeolocationServiceChromium.cpp
index 9333999..b64f5eb 100644
--- a/WebCore/platform/chromium/GeolocationServiceChromium.cpp
+++ b/WebCore/platform/chromium/GeolocationServiceChromium.cpp
@@ -35,6 +35,10 @@
namespace WebCore {
+GeolocationServiceBridge::~GeolocationServiceBridge()
+{
+}
+
GeolocationServiceChromium::GeolocationServiceChromium(GeolocationServiceClient* c)
: GeolocationService(c),
m_geolocation(static_cast<Geolocation*>(c)),
diff --git a/WebCore/platform/chromium/GeolocationServiceChromium.h b/WebCore/platform/chromium/GeolocationServiceChromium.h
index f139220..7e6f633 100644
--- a/WebCore/platform/chromium/GeolocationServiceChromium.h
+++ b/WebCore/platform/chromium/GeolocationServiceChromium.h
@@ -42,6 +42,7 @@ namespace WebCore {
// Provides an interface for GeolocationServiceChromium to call into the embedder.
class GeolocationServiceBridge {
public:
+ virtual ~GeolocationServiceBridge();
// Called by GeolocationServiceChromium.
virtual bool startUpdating(PositionOptions*) = 0;
virtual void stopUpdating() = 0;
diff --git a/WebCore/platform/graphics/Gradient.cpp b/WebCore/platform/graphics/Gradient.cpp
index 3d8dfc9..f9427fb 100644
--- a/WebCore/platform/graphics/Gradient.cpp
+++ b/WebCore/platform/graphics/Gradient.cpp
@@ -117,9 +117,16 @@ void Gradient::sortStopsIfNecessary()
if (m_stopsSorted)
return;
- if (m_stops.size())
- std::stable_sort(m_stops.begin(), m_stops.end(), compareStops);
m_stopsSorted = true;
+
+ if (!m_stops.size())
+ return;
+
+ // Shortcut for the ideal case (ordered 2-stop gradient)
+ if (m_stops.size() == 2 && compareStops(*m_stops.begin(), *m_stops.end()))
+ return;
+
+ std::stable_sort(m_stops.begin(), m_stops.end(), compareStops);
}
void Gradient::getColor(float value, float* r, float* g, float* b, float* a) const
diff --git a/WebCore/platform/graphics/Gradient.h b/WebCore/platform/graphics/Gradient.h
index c4ac01b..0a69fa2 100644
--- a/WebCore/platform/graphics/Gradient.h
+++ b/WebCore/platform/graphics/Gradient.h
@@ -101,7 +101,7 @@ namespace WebCore {
const FloatPoint& p1() const { return m_p1; }
float r0() const { return m_r0; }
float r1() const { return m_r1; }
- const Vector<ColorStop>& getStops() const;
+ const Vector<ColorStop, 2>& getStops() const;
#else
#if PLATFORM(ANDROID)
SkShader* getShader(SkShader::TileMode);
@@ -150,7 +150,7 @@ namespace WebCore {
FloatPoint m_p1;
float m_r0;
float m_r1;
- mutable Vector<ColorStop> m_stops;
+ mutable Vector<ColorStop, 2> m_stops;
mutable bool m_stopsSorted;
mutable int m_lastStop;
GradientSpreadMethod m_spreadMethod;
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index 170bb84..2da5862 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -830,6 +830,40 @@ bool GraphicsContext3D::supportsBGRA()
// Returning false for now to be safe.
return false;
}
+
+bool GraphicsContext3D::supportsMapSubCHROMIUM()
+{
+ // We don't claim support for this extension at this time.
+ return false;
+}
+
+void* GraphicsContext3D::mapBufferSubDataCHROMIUM(unsigned, int, int, unsigned)
+{
+ return 0;
+}
+
+void GraphicsContext3D::unmapBufferSubDataCHROMIUM(const void*)
+{
+}
+
+void* GraphicsContext3D::mapTexSubImage2DCHROMIUM(unsigned, int, int, int, int, int, unsigned, unsigned, unsigned)
+{
+ return 0;
+}
+
+void GraphicsContext3D::unmapTexSubImage2DCHROMIUM(const void*)
+{
+}
+
+bool GraphicsContext3D::supportsCopyTextureToParentTextureCHROMIUM()
+{
+ // We don't claim support for this extension at this time.
+ return false;
+}
+
+void GraphicsContext3D::copyTextureToParentTextureCHROMIUM(unsigned, unsigned)
+{
+}
#endif
} // namespace WebCore
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index b583813..bcb7997 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -404,7 +404,12 @@ public:
UNPACK_FLIP_Y_WEBGL = 0x9240,
UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241,
- BGRA_EXT = 0x80E1
+ // GL_EXT_texture_format_BGRA8888
+ BGRA_EXT = 0x80E1,
+
+ // GL_CHROMIUM_map_sub (enums inherited from GL_ARB_vertex_buffer_object)
+ READ_ONLY = 0x88B8,
+ WRITE_ONLY = 0x88B9
};
// Context creation attributes.
@@ -425,7 +430,12 @@ public:
bool premultipliedAlpha;
};
- static PassOwnPtr<GraphicsContext3D> create(Attributes attrs, HostWindow* hostWindow);
+ enum RenderStyle {
+ RenderOffscreen,
+ RenderDirectlyToHostWindow
+ };
+
+ static PassOwnPtr<GraphicsContext3D> create(Attributes attrs, HostWindow* hostWindow, RenderStyle renderStyle = RenderOffscreen);
virtual ~GraphicsContext3D();
#if PLATFORM(MAC)
@@ -751,10 +761,22 @@ public:
// getError in the order they were added.
void synthesizeGLError(unsigned long error);
+ // EXT_texture_format_BGRA8888
bool supportsBGRA();
+ // GL_CHROMIUM_map_sub
+ bool supportsMapSubCHROMIUM();
+ void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access);
+ void unmapBufferSubDataCHROMIUM(const void*);
+ void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access);
+ void unmapTexSubImage2DCHROMIUM(const void*);
+
+ // GL_CHROMIUM_copy_texture_to_parent_texture
+ bool supportsCopyTextureToParentTextureCHROMIUM();
+ void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture);
+
private:
- GraphicsContext3D(Attributes attrs, HostWindow* hostWindow);
+ GraphicsContext3D(Attributes attrs, HostWindow* hostWindow, bool renderDirectlyToHostWindow);
// Each platform must provide an implementation of this method.
//
diff --git a/WebCore/platform/graphics/GraphicsLayer.cpp b/WebCore/platform/graphics/GraphicsLayer.cpp
index 5003907..b0f529b 100644
--- a/WebCore/platform/graphics/GraphicsLayer.cpp
+++ b/WebCore/platform/graphics/GraphicsLayer.cpp
@@ -73,7 +73,6 @@ GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client)
, m_masksToBounds(false)
, m_drawsContent(false)
, m_paintingPhase(GraphicsLayerPaintAll)
- , m_geometryOrientation(CompositingCoordinatesTopDown)
, m_contentsOrientation(CompositingCoordinatesTopDown)
, m_parent(0)
, m_maskLayer(0)
@@ -411,29 +410,45 @@ void GraphicsLayer::dumpLayer(TextStream& ts, int indent, LayerTreeAsTextBehavio
void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBehavior behavior) const
{
- writeIndent(ts, indent + 1);
- ts << "(position " << m_position.x() << " " << m_position.y() << ")\n";
+ if (m_position != FloatPoint()) {
+ writeIndent(ts, indent + 1);
+ ts << "(position " << m_position.x() << " " << m_position.y() << ")\n";
+ }
- writeIndent(ts, indent + 1);
- ts << "(anchor " << m_anchorPoint.x() << " " << m_anchorPoint.y() << ")\n";
+ if (m_anchorPoint != FloatPoint3D(0.5f, 0.5f, 0)) {
+ writeIndent(ts, indent + 1);
+ ts << "(anchor " << m_anchorPoint.x() << " " << m_anchorPoint.y() << ")\n";
+ }
- writeIndent(ts, indent + 1);
- ts << "(bounds " << m_size.width() << " " << m_size.height() << ")\n";
+ if (m_size != IntSize()) {
+ writeIndent(ts, indent + 1);
+ ts << "(bounds " << m_size.width() << " " << m_size.height() << ")\n";
+ }
- writeIndent(ts, indent + 1);
- ts << "(opacity " << m_opacity << ")\n";
+ if (m_opacity != 1) {
+ writeIndent(ts, indent + 1);
+ ts << "(opacity " << m_opacity << ")\n";
+ }
- writeIndent(ts, indent + 1);
- ts << "(usingTiledLayer " << m_usingTiledLayer << ")\n";
+ if (m_usingTiledLayer) {
+ writeIndent(ts, indent + 1);
+ ts << "(usingTiledLayer " << m_usingTiledLayer << ")\n";
+ }
- writeIndent(ts, indent + 1);
- ts << "(preserves3D " << m_preserves3D << ")\n";
+ if (m_preserves3D) {
+ writeIndent(ts, indent + 1);
+ ts << "(preserves3D " << m_preserves3D << ")\n";
+ }
- writeIndent(ts, indent + 1);
- ts << "(drawsContent " << m_drawsContent << ")\n";
+ if (m_drawsContent) {
+ writeIndent(ts, indent + 1);
+ ts << "(drawsContent " << m_drawsContent << ")\n";
+ }
- writeIndent(ts, indent + 1);
- ts << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")\n";
+ if (!m_backfaceVisibility) {
+ writeIndent(ts, indent + 1);
+ ts << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")\n";
+ }
if (behavior & LayerTreeAsTextDebug) {
writeIndent(ts, indent + 1);
@@ -445,40 +460,29 @@ void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBe
ts << ")\n";
}
- writeIndent(ts, indent + 1);
- ts << "(backgroundColor ";
- if (!m_backgroundColorSet)
- ts << "none";
- else
- ts << m_backgroundColor.name();
- ts << ")\n";
+ if (m_backgroundColorSet) {
+ writeIndent(ts, indent + 1);
+ ts << "(backgroundColor " << m_backgroundColor.name() << ")\n";
+ }
- writeIndent(ts, indent + 1);
- ts << "(transform ";
- if (m_transform.isIdentity())
- ts << "identity";
- else {
+ if (!m_transform.isIdentity()) {
+ writeIndent(ts, indent + 1);
+ ts << "(transform ";
ts << "[" << m_transform.m11() << " " << m_transform.m12() << " " << m_transform.m13() << " " << m_transform.m14() << "] ";
ts << "[" << m_transform.m21() << " " << m_transform.m22() << " " << m_transform.m23() << " " << m_transform.m24() << "] ";
ts << "[" << m_transform.m31() << " " << m_transform.m32() << " " << m_transform.m33() << " " << m_transform.m34() << "] ";
- ts << "[" << m_transform.m41() << " " << m_transform.m42() << " " << m_transform.m43() << " " << m_transform.m44() << "]";
+ ts << "[" << m_transform.m41() << " " << m_transform.m42() << " " << m_transform.m43() << " " << m_transform.m44() << "])\n";
}
- ts << ")\n";
// Avoid dumping the sublayer transform on the root layer, because it's used for geometry flipping, whose behavior
// differs between platforms.
- if (parent()) {
+ if (parent() && !m_childrenTransform.isIdentity()) {
writeIndent(ts, indent + 1);
ts << "(childrenTransform ";
- if (m_childrenTransform.isIdentity())
- ts << "identity";
- else {
- ts << "[" << m_childrenTransform.m11() << " " << m_childrenTransform.m12() << " " << m_childrenTransform.m13() << " " << m_childrenTransform.m14() << "] ";
- ts << "[" << m_childrenTransform.m21() << " " << m_childrenTransform.m22() << " " << m_childrenTransform.m23() << " " << m_childrenTransform.m24() << "] ";
- ts << "[" << m_childrenTransform.m31() << " " << m_childrenTransform.m32() << " " << m_childrenTransform.m33() << " " << m_childrenTransform.m34() << "] ";
- ts << "[" << m_childrenTransform.m41() << " " << m_childrenTransform.m42() << " " << m_childrenTransform.m43() << " " << m_childrenTransform.m44() << "]";
- }
- ts << ")\n";
+ ts << "[" << m_childrenTransform.m11() << " " << m_childrenTransform.m12() << " " << m_childrenTransform.m13() << " " << m_childrenTransform.m14() << "] ";
+ ts << "[" << m_childrenTransform.m21() << " " << m_childrenTransform.m22() << " " << m_childrenTransform.m23() << " " << m_childrenTransform.m24() << "] ";
+ ts << "[" << m_childrenTransform.m31() << " " << m_childrenTransform.m32() << " " << m_childrenTransform.m33() << " " << m_childrenTransform.m34() << "] ";
+ ts << "[" << m_childrenTransform.m41() << " " << m_childrenTransform.m42() << " " << m_childrenTransform.m43() << " " << m_childrenTransform.m44() << "])\n";
}
if (m_replicaLayer) {
diff --git a/WebCore/platform/graphics/GraphicsLayer.h b/WebCore/platform/graphics/GraphicsLayer.h
index 68a580e..04899f2 100644
--- a/WebCore/platform/graphics/GraphicsLayer.h
+++ b/WebCore/platform/graphics/GraphicsLayer.h
@@ -313,14 +313,7 @@ public:
int repaintCount() const { return m_repaintCount; }
int incrementRepaintCount() { return ++m_repaintCount; }
- // Report whether the underlying compositing system uses a top-down
- // or a bottom-up coordinate system.
enum CompositingCoordinatesOrientation { CompositingCoordinatesTopDown, CompositingCoordinatesBottomUp };
- static CompositingCoordinatesOrientation compositingCoordinatesOrientation();
-
- // Set the geometry orientation (top-down, or bottom-up) for this layer, which also controls sublayer geometry.
- virtual void setGeometryOrientation(CompositingCoordinatesOrientation orientation) { m_geometryOrientation = orientation; }
- CompositingCoordinatesOrientation geometryOrientation() const { return m_geometryOrientation; }
// Flippedness of the contents of this layer. Does not affect sublayer geometry.
virtual void setContentsOrientation(CompositingCoordinatesOrientation orientation) { m_contentsOrientation = orientation; }
@@ -395,8 +388,7 @@ protected:
bool m_drawsContent : 1;
GraphicsLayerPaintingPhase m_paintingPhase;
- CompositingCoordinatesOrientation m_geometryOrientation; // affects geometry of layer positions
- CompositingCoordinatesOrientation m_contentsOrientation; // affects orientation of layer contents
+ CompositingCoordinatesOrientation m_contentsOrientation; // affects orientation of layer contents
Vector<GraphicsLayer*> m_children;
GraphicsLayer* m_parent;
diff --git a/WebCore/platform/graphics/MediaPlayer.cpp b/WebCore/platform/graphics/MediaPlayer.cpp
index 2588d8d..b4a669c 100644
--- a/WebCore/platform/graphics/MediaPlayer.cpp
+++ b/WebCore/platform/graphics/MediaPlayer.cpp
@@ -48,7 +48,7 @@
#if PLATFORM(MAC)
#include "MediaPlayerPrivateQTKit.h"
#elif OS(WINCE) && !PLATFORM(QT)
-#include "MediaPlayerPrivateWince.h"
+#include "MediaPlayerPrivateWinCE.h"
#elif PLATFORM(WIN)
#include "MediaPlayerPrivateQuickTimeVisualContext.h"
#include "MediaPlayerPrivateQuicktimeWin.h"
diff --git a/WebCore/platform/graphics/Path.h b/WebCore/platform/graphics/Path.h
index 9896713..43ba889 100644
--- a/WebCore/platform/graphics/Path.h
+++ b/WebCore/platform/graphics/Path.h
@@ -133,11 +133,6 @@ namespace WebCore {
void addBezierCurveTo(const FloatPoint& controlPoint1, const FloatPoint& controlPoint2, const FloatPoint& endPoint);
void addArcTo(const FloatPoint&, const FloatPoint&, float radius);
void closeSubpath();
-#if PLATFORM(QT)
- void closeCanvasSubpath();
-#else
- void closeCanvasSubpath() { closeSubpath(); }
-#endif
void addArc(const FloatPoint&, float radius, float startAngle, float endAngle, bool anticlockwise);
void addRect(const FloatRect&);
@@ -161,10 +156,6 @@ namespace WebCore {
private:
PlatformPathPtr m_path;
-
-#if PLATFORM(QT)
- int m_lastMoveToIndex;
-#endif
};
}
diff --git a/WebCore/platform/graphics/cairo/FontCacheCairo.cpp b/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp
index 5d3263e..c09dd49 100644
--- a/WebCore/platform/graphics/cairo/FontCacheCairo.cpp
+++ b/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp
@@ -24,6 +24,7 @@
#include "CString.h"
#include "Font.h"
#include "OwnPtrCairo.h"
+#include "PlatformRefPtrCairo.h"
#include "SimpleFontData.h"
#include <wtf/Assertions.h>
@@ -37,7 +38,6 @@ void FontCache::platformInit()
const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
{
-#if defined(USE_FREETYPE)
FcResult fresult;
FontPlatformData* prim = const_cast<FontPlatformData*>(&font.primaryFont()->platformData());
@@ -47,13 +47,13 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons
return 0;
if (!prim->m_fallbacks)
- prim->m_fallbacks = FcFontSort(NULL, prim->m_pattern, FcTrue, NULL, &fresult);
+ prim->m_fallbacks = FcFontSort(0, prim->m_pattern.get(), FcTrue, 0, &fresult);
FcFontSet* fs = prim->m_fallbacks;
for (int i = 0; i < fs->nfont; i++) {
- FcPattern* fin = FcFontRenderPrepare(NULL, prim->m_pattern, fs->fonts[i]);
- cairo_font_face_t* fontFace = cairo_ft_font_face_create_for_pattern(fin);
+ PlatformRefPtr<FcPattern> fin = adoptPlatformRef(FcFontRenderPrepare(0, prim->m_pattern.get(), fs->fonts[i]));
+ cairo_font_face_t* fontFace = cairo_ft_font_face_create_for_pattern(fin.get());
FontPlatformData alternateFont(fontFace, font.fontDescription().computedPixelSize(), false, false);
cairo_font_face_destroy(fontFace);
alternateFont.m_pattern = fin;
@@ -61,7 +61,6 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons
if (sfd->containsCharacters(characters, length))
return sfd;
}
-#endif
return 0;
}
@@ -103,7 +102,6 @@ static bool isWellKnownFontName(const AtomicString family)
FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
{
-#if defined(USE_FREETYPE)
// Handle generic family types specially, because fontconfig does not know them, but we have
// code to fallback correctly in our platform data implementation.
if (!family.length() || family.startsWith("-webkit-")
@@ -115,7 +113,7 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
CString familyNameString = family.string().utf8();
const char* fcfamily = familyNameString.data();
- OwnPtr<FcPattern> pattern(FcPatternCreate());
+ PlatformRefPtr<FcPattern> pattern = adoptPlatformRef(FcPatternCreate());
if (!FcPatternAddString(pattern.get(), FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
return 0;
@@ -130,7 +128,6 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
if (!fontSet->fonts)
return 0;
-#endif
return new FontPlatformData(fontDescription, family);
}
diff --git a/WebCore/platform/graphics/cairo/FontPlatformData.h b/WebCore/platform/graphics/cairo/FontPlatformData.h
index fc6b9f1..e5ffef2 100644
--- a/WebCore/platform/graphics/cairo/FontPlatformData.h
+++ b/WebCore/platform/graphics/cairo/FontPlatformData.h
@@ -1,11 +1,5 @@
/*
- * This file is part of the internal font implementation. It should not be included by anyone other than
- * FontMac.cpp, FontWin.cpp and Font.cpp.
- *
- * Copyright (C) 2006, 2007, 2008 Apple Inc.
- * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
- * Copyright (C) 2007 Holger Hans Peter Freyther
- * Copyright (C) 2007 Pioneer Research Center USA, Inc.
+ * Copyright (C) 2010 Igalia S.L.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or
@@ -28,160 +22,12 @@
#ifndef FontPlatformData_h
#define FontPlatformData_h
-#include <wtf/Forward.h>
-#include <cairo.h>
-#include "FontDescription.h"
-#include "GlyphBuffer.h"
-
-#if defined(USE_FREETYPE)
-#include <cairo-ft.h>
-#include <fontconfig/fcfreetype.h>
-#elif defined(USE_PANGO)
-#include <pango/pangocairo.h>
-#elif PLATFORM(WIN)
-#include <cairo-win32.h>
-#include "RefCountedGDIHandle.h"
-#include "StringImpl.h"
-#else
-#error "Must defined a font backend"
-#endif
-
-#if PLATFORM(WIN)
-typedef struct HFONT__* HFONT;
-#endif
-namespace WebCore {
-
-class FontPlatformData {
-public:
- FontPlatformData(WTF::HashTableDeletedValueType)
#if defined(USE_FREETYPE)
- : m_pattern(hashTableDeletedFontValue())
- , m_fallbacks(0)
+#include "FontPlatformDataFreeType.h"
#elif defined(USE_PANGO)
- : m_context(0)
- , m_font(hashTableDeletedFontValue())
+#include "FontPlatformDataPango.h"
#elif PLATFORM(WIN)
- : m_fontFace(0)
- , m_useGDI(false)
- , m_font(WTF::HashTableDeletedValue)
-#else
-#error "Must defined a font backend"
+#include "FontPlatformDataCairoWin.h"
#endif
- , m_size(0)
- , m_syntheticBold(false)
- , m_syntheticOblique(false)
- , m_scaledFont(0)
- { }
- FontPlatformData()
-#if defined(USE_FREETYPE)
- : m_pattern(0)
- , m_fallbacks(0)
-#elif defined(USE_PANGO)
- : m_context(0)
- , m_font(0)
-#elif PLATFORM(WIN)
- : m_fontFace(0)
- , m_useGDI(false)
-#else
-#error "Must defined a font backend"
-#endif
- , m_size(0)
- , m_syntheticBold(false)
- , m_syntheticOblique(false)
- , m_scaledFont(0)
- { }
-
-#if PLATFORM(WIN)
- FontPlatformData(HFONT, float size, bool bold, bool oblique, bool useGDI);
-#else
- FontPlatformData(const FontDescription&, const AtomicString& family);
-#endif
-
- FontPlatformData(cairo_font_face_t* fontFace, float size, bool bold, bool italic);
- FontPlatformData(float size, bool bold, bool italic);
- FontPlatformData(const FontPlatformData&);
-
- ~FontPlatformData();
-
-#if !PLATFORM(WIN)
- static bool init();
-#else
- HFONT hfont() const { return m_font->handle(); }
- bool useGDI() const { return m_useGDI; }
- cairo_font_face_t* fontFace() const { return m_fontFace; }
-#endif
-
- bool isFixedPitch();
- float size() const { return m_size; }
- void setSize(float size) { m_size = size; }
- bool syntheticBold() const { return m_syntheticBold; }
- bool syntheticOblique() const { return m_syntheticOblique; }
-
- cairo_scaled_font_t* scaledFont() const { return m_scaledFont; }
-
- unsigned hash() const
- {
-#if PLATFORM(WIN)
- return m_font->hash();
-#else
-#if defined(USE_FREETYPE)
- if (m_pattern)
- return FcPatternHash(m_pattern);
-#endif
- uintptr_t hashCodes[1] = { reinterpret_cast<uintptr_t>(m_scaledFont) };
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
-#endif
- }
-
- bool operator==(const FontPlatformData&) const;
- FontPlatformData& operator=(const FontPlatformData&);
- bool isHashTableDeletedValue() const
- {
-#if defined(USE_FREETYPE)
- return m_pattern == hashTableDeletedFontValue();
-#elif defined(USE_PANGO)
- return m_font == hashTableDeletedFontValue();
-#elif PLATFORM(WIN)
- return m_font.isHashTableDeletedValue();
-#endif
- }
-
-#ifndef NDEBUG
- String description() const;
-#endif
-
-#if defined(USE_FREETYPE)
- FcPattern* m_pattern;
- FcFontSet* m_fallbacks;
-#elif defined(USE_PANGO)
- static PangoFontMap* m_fontMap;
- static GHashTable* m_hashTable;
-
- PangoContext* m_context;
- PangoFont* m_font;
-#elif PLATFORM(WIN)
-private:
- void platformDataInit(HFONT, float size, HDC, WCHAR* faceName);
-
- RefPtr<RefCountedGDIHandle<HFONT> > m_font;
- cairo_font_face_t* m_fontFace;
- bool m_useGDI;
-#else
-#error "Must defined a font backend"
-#endif
- float m_size;
- bool m_syntheticBold;
- bool m_syntheticOblique;
- cairo_scaled_font_t* m_scaledFont;
-private:
-#if defined(USE_FREETYPE)
- static FcPattern *hashTableDeletedFontValue() { return reinterpret_cast<FcPattern*>(-1); }
-#elif defined(USE_PANGO)
- static PangoFont *hashTableDeletedFontValue() { return reinterpret_cast<PangoFont*>(-1); }
-#endif
-};
-
-}
-
-#endif
+#endif // FontPlatformData_h
diff --git a/WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp
index 1f94f5a..7968966 100644
--- a/WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp
+++ b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.cpp
@@ -39,12 +39,10 @@
namespace WebCore {
FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const AtomicString& familyName)
- : m_pattern(0)
- , m_fallbacks(0)
+ : m_fallbacks(0)
, m_size(fontDescription.computedPixelSize())
, m_syntheticBold(false)
, m_syntheticOblique(false)
- , m_scaledFont(0)
{
FontPlatformData::init();
@@ -61,14 +59,14 @@ FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const
int type = fontDescription.genericFamily();
- FcPattern* pattern = FcPatternCreate();
+ PlatformRefPtr<FcPattern> pattern = adoptPlatformRef(FcPatternCreate());
cairo_font_face_t* fontFace;
static const cairo_font_options_t* defaultOptions = cairo_font_options_create();
const cairo_font_options_t* options = NULL;
cairo_matrix_t fontMatrix;
- if (!FcPatternAddString(pattern, FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
- goto freePattern;
+ if (!FcPatternAddString(pattern.get(), FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
+ return;
switch (type) {
case FontDescription::SerifFamily:
@@ -89,31 +87,31 @@ FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const
break;
}
- if (fcfamily && !FcPatternAddString(pattern, FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
- goto freePattern;
- if (!FcPatternAddInteger(pattern, FC_WEIGHT, fcweight))
- goto freePattern;
- if (!FcPatternAddInteger(pattern, FC_SLANT, fcslant))
- goto freePattern;
- if (!FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fcsize))
- goto freePattern;
+ if (fcfamily && !FcPatternAddString(pattern.get(), FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
+ return;
+ if (!FcPatternAddInteger(pattern.get(), FC_WEIGHT, fcweight))
+ return;
+ if (!FcPatternAddInteger(pattern.get(), FC_SLANT, fcslant))
+ return;
+ if (!FcPatternAddDouble(pattern.get(), FC_PIXEL_SIZE, fcsize))
+ return;
- FcConfigSubstitute(NULL, pattern, FcMatchPattern);
- FcDefaultSubstitute(pattern);
+ FcConfigSubstitute(0, pattern.get(), FcMatchPattern);
+ FcDefaultSubstitute(pattern.get());
FcResult fcresult;
- m_pattern = FcFontMatch(NULL, pattern, &fcresult);
+ m_pattern = adoptPlatformRef(FcFontMatch(0, pattern.get(), &fcresult));
// FIXME: should we set some default font?
if (!m_pattern)
- goto freePattern;
- fontFace = cairo_ft_font_face_create_for_pattern(m_pattern);
+ return;
+ fontFace = cairo_ft_font_face_create_for_pattern(m_pattern.get());
cairo_matrix_t ctm;
cairo_matrix_init_scale(&fontMatrix, fontDescription.computedPixelSize(), fontDescription.computedPixelSize());
cairo_matrix_init_identity(&ctm);
#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT)
if (GdkScreen* screen = gdk_screen_get_default())
- options = gdk_screen_get_font_options(screen);
+gdk_screen_get_font_options(screen);
#endif
// gdk_screen_get_font_options() returns NULL if no default options are
@@ -121,30 +119,23 @@ FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const
if (!options)
options = defaultOptions;
- m_scaledFont = cairo_scaled_font_create(fontFace, &fontMatrix, &ctm, options);
+ m_scaledFont = adoptPlatformRef(cairo_scaled_font_create(fontFace, &fontMatrix, &ctm, options));
cairo_font_face_destroy(fontFace);
-
-freePattern:
- FcPatternDestroy(pattern);
}
FontPlatformData::FontPlatformData(float size, bool bold, bool italic)
- : m_pattern(0)
- , m_fallbacks(0)
+ : m_fallbacks(0)
, m_size(size)
, m_syntheticBold(bold)
, m_syntheticOblique(italic)
- , m_scaledFont(0)
{
}
FontPlatformData::FontPlatformData(cairo_font_face_t* fontFace, float size, bool bold, bool italic)
- : m_pattern(0)
- , m_fallbacks(0)
+ : m_fallbacks(0)
, m_size(size)
, m_syntheticBold(bold)
, m_syntheticOblique(italic)
- , m_scaledFont(0)
{
cairo_matrix_t fontMatrix;
cairo_matrix_init_scale(&fontMatrix, size, size);
@@ -163,7 +154,7 @@ FontPlatformData::FontPlatformData(cairo_font_face_t* fontFace, float size, bool
if (!options)
options = defaultOptions;
- m_scaledFont = cairo_scaled_font_create(fontFace, &fontMatrix, &ctm, options);
+ m_scaledFont = adoptPlatformRef(cairo_scaled_font_create(fontFace, &fontMatrix, &ctm, options));
}
FontPlatformData& FontPlatformData::operator=(const FontPlatformData& other)
@@ -175,17 +166,7 @@ FontPlatformData& FontPlatformData::operator=(const FontPlatformData& other)
m_size = other.m_size;
m_syntheticBold = other.m_syntheticBold;
m_syntheticOblique = other.m_syntheticOblique;
-
- if (other.m_scaledFont)
- cairo_scaled_font_reference(other.m_scaledFont);
- if (m_scaledFont)
- cairo_scaled_font_destroy(m_scaledFont);
m_scaledFont = other.m_scaledFont;
-
- if (other.m_pattern)
- FcPatternReference(other.m_pattern);
- if (m_pattern)
- FcPatternDestroy(m_pattern);
m_pattern = other.m_pattern;
if (m_fallbacks) {
@@ -198,9 +179,7 @@ FontPlatformData& FontPlatformData::operator=(const FontPlatformData& other)
}
FontPlatformData::FontPlatformData(const FontPlatformData& other)
- : m_pattern(0)
- , m_fallbacks(0)
- , m_scaledFont(0)
+ : m_fallbacks(0)
{
*this = other;
}
@@ -220,18 +199,10 @@ bool FontPlatformData::init()
FontPlatformData::~FontPlatformData()
{
- if (m_pattern && ((FcPattern*)-1 != m_pattern)) {
- FcPatternDestroy(m_pattern);
- m_pattern = 0;
- }
-
if (m_fallbacks) {
FcFontSetDestroy(m_fallbacks);
m_fallbacks = 0;
}
-
- if (m_scaledFont)
- cairo_scaled_font_destroy(m_scaledFont);
}
bool FontPlatformData::isFixedPitch()
@@ -241,7 +212,7 @@ bool FontPlatformData::isFixedPitch()
return false;
int spacing;
- if (FcPatternGetInteger(m_pattern, FC_SPACING, 0, &spacing) == FcResultMatch)
+ if (FcPatternGetInteger(m_pattern.get(), FC_SPACING, 0, &spacing) == FcResultMatch)
return spacing == FC_MONO;
return false;
}
@@ -250,10 +221,9 @@ bool FontPlatformData::operator==(const FontPlatformData& other) const
{
if (m_pattern == other.m_pattern)
return true;
- if (m_pattern == 0 || m_pattern == reinterpret_cast<FcPattern*>(-1)
- || other.m_pattern == 0 || other.m_pattern == reinterpret_cast<FcPattern*>(-1))
+ if (!m_pattern || m_pattern.isHashTableDeletedValue() || !other.m_pattern || other.m_pattern.isHashTableDeletedValue())
return false;
- return FcPatternEqual(m_pattern, other.m_pattern);
+ return FcPatternEqual(m_pattern.get(), other.m_pattern.get());
}
#ifndef NDEBUG
diff --git a/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h
new file mode 100644
index 0000000..987a684
--- /dev/null
+++ b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Inc.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2007 Pioneer Research Center USA, Inc.
+ * All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef FontPlatformDataFreeType_h
+#define FontPlatformDataFreeType_h
+
+#include "FontDescription.h"
+#include "GlyphBuffer.h"
+#include "HashFunctions.h"
+#include "PlatformRefPtrCairo.h"
+#include <cairo-ft.h>
+#include <cairo.h>
+#include <fontconfig/fcfreetype.h>
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+class FontPlatformData {
+public:
+ FontPlatformData(WTF::HashTableDeletedValueType)
+ : m_fallbacks(0)
+ , m_size(0)
+ , m_syntheticBold(false)
+ , m_syntheticOblique(false)
+ , m_scaledFont(WTF::HashTableDeletedValue)
+ { }
+
+ FontPlatformData()
+ : m_fallbacks(0)
+ , m_size(0)
+ , m_syntheticBold(false)
+ , m_syntheticOblique(false)
+ { }
+
+ FontPlatformData(const FontDescription&, const AtomicString& family);
+ FontPlatformData(cairo_font_face_t* fontFace, float size, bool bold, bool italic);
+ FontPlatformData(float size, bool bold, bool italic);
+ FontPlatformData(const FontPlatformData&);
+
+ ~FontPlatformData();
+
+ static bool init();
+ bool isFixedPitch();
+ float size() const { return m_size; }
+ void setSize(float size) { m_size = size; }
+ bool syntheticBold() const { return m_syntheticBold; }
+ bool syntheticOblique() const { return m_syntheticOblique; }
+
+ cairo_scaled_font_t* scaledFont() const { return m_scaledFont.get(); }
+
+ unsigned hash() const
+ {
+ return PtrHash<cairo_scaled_font_t*>::hash(m_scaledFont.get());
+ }
+
+ bool operator==(const FontPlatformData&) const;
+ FontPlatformData& operator=(const FontPlatformData&);
+ bool isHashTableDeletedValue() const
+ {
+ return m_scaledFont.isHashTableDeletedValue();
+ }
+
+#ifndef NDEBUG
+ String description() const;
+#endif
+
+ PlatformRefPtr<FcPattern> m_pattern;
+ FcFontSet* m_fallbacks;
+ float m_size;
+ bool m_syntheticBold;
+ bool m_syntheticOblique;
+ PlatformRefPtr<cairo_scaled_font_t> m_scaledFont;
+};
+
+}
+
+#endif // FontPlatformDataFreeType_h
diff --git a/WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp b/WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp
index 7c9ffe6..26da68d 100644
--- a/WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp
@@ -42,7 +42,7 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
if (bufferLength > GlyphPage::size)
return false;
- FT_Face face = cairo_ft_scaled_font_lock_face(fontData->platformData().m_scaledFont);
+ FT_Face face = cairo_ft_scaled_font_lock_face(fontData->platformData().m_scaledFont.get());
if (!face)
return false;
@@ -57,7 +57,7 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
}
}
- cairo_ft_scaled_font_unlock_face(fontData->platformData().m_scaledFont);
+ cairo_ft_scaled_font_unlock_face(fontData->platformData().m_scaledFont.get());
return haveGlyphs;
}
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index 283e75a..5de7e1f 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -38,6 +38,7 @@
#include "FEGaussianBlur.h"
#include "FloatRect.h"
#include "Font.h"
+#include "OwnPtrCairo.h"
#include "ImageBuffer.h"
#include "ImageBufferFilter.h"
#include "IntRect.h"
@@ -201,7 +202,6 @@ static inline void drawPathShadow(GraphicsContext* context, GraphicsContextPriva
// Calculate filter values to create appropriate shadow.
cairo_t* cr = context->platformContext();
- cairo_path_t* path = cairo_copy_path(cr);
double x0, x1, y0, y1;
if (strokeShadow)
cairo_stroke_extents(cr, &x0, &y0, &x1, &y1);
@@ -214,15 +214,32 @@ static inline void drawPathShadow(GraphicsContext* context, GraphicsContextPriva
float radius = 0;
GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowOffset, shadowBlur);
+ cairo_clip_extents(cr, &x0, &y0, &x1, &y1);
+ FloatRect clipRect(x0, y0, x1 - x0, y1 - y0);
+
+ FloatPoint rectLocation = shadowRect.location();
+
+ // Reduce the shadow rect using the clip area.
+ if (!clipRect.contains(shadowRect)) {
+ shadowRect.intersect(clipRect);
+ if (shadowRect.isEmpty())
+ return;
+ shadowRect.inflate(radius);
+ shadowBufferSize = IntSize(shadowRect.width(), shadowRect.height());
+ }
+
+ shadowOffset = rectLocation - shadowRect.location();
+
// Create suitably-sized ImageBuffer to hold the shadow.
OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(shadowBufferSize);
// Draw shadow into a new ImageBuffer.
cairo_t* shadowContext = shadowBuffer->context()->platformContext();
copyContextProperties(cr, shadowContext);
- cairo_translate(shadowContext, -rect.x() + radius, -rect.y() + radius);
+ cairo_translate(shadowContext, -rect.x() + radius + shadowOffset.width(), -rect.y() + radius + shadowOffset.height());
cairo_new_path(shadowContext);
- cairo_append_path(shadowContext, path);
+ OwnPtr<cairo_path_t> path(cairo_copy_path(cr));
+ cairo_append_path(shadowContext, path.get());
if (fillShadow)
setPlatformFill(context, shadowContext, gcp);
@@ -624,6 +641,12 @@ void GraphicsContext::fillRect(const FloatRect& rect)
static void drawBorderlessRectShadow(GraphicsContext* context, const FloatRect& rect, const Color& rectColor)
{
#if ENABLE(FILTERS)
+ FloatSize shadowOffset;
+ float shadowBlur;
+ Color shadowColor;
+ if (!context->getShadow(shadowOffset, shadowBlur, shadowColor))
+ return;
+
AffineTransform transform = context->getCTM();
// drawTiledShadow still does not work with rotations.
if ((transform.isIdentityOrTranslationOrFlipped())) {
@@ -638,13 +661,6 @@ static void drawBorderlessRectShadow(GraphicsContext* context, const FloatRect&
return;
}
- FloatSize shadowOffset;
- float shadowBlur;
- Color shadowColor;
-
- if (!context->getShadow(shadowOffset, shadowBlur, shadowColor))
- return;
-
IntSize shadowBufferSize;
FloatRect shadowRect;
float radius = 0;
@@ -957,18 +973,20 @@ PlatformRefPtr<cairo_surface_t> GraphicsContext::createShadowMask(PassOwnPtr<Ima
return buffer->m_data.m_surface;
FloatPoint blurRadius = FloatPoint(radius, radius);
- float sd = FEGaussianBlur::calculateStdDeviation(radius);
- if (!sd)
+ float stdDeviation = FEGaussianBlur::calculateStdDeviation(radius);
+ if (!stdDeviation)
return buffer->m_data.m_surface;
// create filter
RefPtr<Filter> filter = ImageBufferFilter::create();
filter->setSourceImage(buffer);
RefPtr<FilterEffect> source = SourceGraphic::create();
- source->setScaledSubRegion(FloatRect(FloatPoint(), shadowRect.size()));
+ source->setRepaintRectInLocalCoordinates(FloatRect(FloatPoint(), shadowRect.size()));
source->setIsAlphaImage(true);
- RefPtr<FilterEffect> blur = FEGaussianBlur::create(source.get(), sd, sd);
- blur->setScaledSubRegion(FloatRect(FloatPoint(), shadowRect.size()));
+ RefPtr<FilterEffect> blur = FEGaussianBlur::create(stdDeviation, stdDeviation);
+ FilterEffectVector& inputEffects = blur->inputEffects();
+ inputEffects.append(source.get());
+ blur->setRepaintRectInLocalCoordinates(FloatRect(FloatPoint(), shadowRect.size()));
blur->apply(filter.get());
return blur->resultImage()->m_data.m_surface;
#endif
diff --git a/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp b/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp
index 9be8670..94f6809 100644
--- a/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp
+++ b/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp
@@ -25,15 +25,11 @@
#include <fontconfig/fcfreetype.h>
#endif
+#include <cairo.h>
+
namespace WTF {
#if defined(USE_FREETYPE)
-template <> void deleteOwnedPtr<FcPattern>(FcPattern* ptr)
-{
- if (ptr)
- FcPatternDestroy(ptr);
-}
-
template <> void deleteOwnedPtr<FcObjectSet>(FcObjectSet* ptr)
{
if (ptr)
@@ -47,4 +43,10 @@ template <> void deleteOwnedPtr<FcFontSet>(FcFontSet* ptr)
}
#endif
+template <> void deleteOwnedPtr<cairo_path_t>(cairo_path_t* ptr)
+{
+ if (ptr)
+ cairo_path_destroy(ptr);
+}
+
} // namespace WTF
diff --git a/WebCore/platform/graphics/cairo/OwnPtrCairo.h b/WebCore/platform/graphics/cairo/OwnPtrCairo.h
index 29f4562..035d80e 100644
--- a/WebCore/platform/graphics/cairo/OwnPtrCairo.h
+++ b/WebCore/platform/graphics/cairo/OwnPtrCairo.h
@@ -23,19 +23,21 @@
#include "OwnPtr.h"
#if defined(USE_FREETYPE)
-typedef struct _FcPattern FcPattern;
typedef struct _FcObjectSet FcObjectSet;
typedef struct _FcFontSet FcFontSet;
#endif
+typedef struct cairo_path cairo_path_t;
+
namespace WTF {
#if defined(USE_FREETYPE)
-template <> void deleteOwnedPtr<FcPattern>(FcPattern*);
template <> void deleteOwnedPtr<FcObjectSet>(FcObjectSet*);
template <> void deleteOwnedPtr<FcFontSet>(FcFontSet*);
#endif
+template <> void deleteOwnedPtr<cairo_path_t>(cairo_path_t*);
+
} // namespace WTF
#endif
diff --git a/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp b/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp
index 6870560..aa466f9 100644
--- a/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp
+++ b/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.cpp
@@ -21,6 +21,11 @@
#include <cairo.h>
+#if defined(USE_FREETYPE)
+#include <cairo-ft.h>
+#include <fontconfig/fcfreetype.h>
+#endif
+
namespace WTF {
template <> cairo_t* refPlatformPtr(cairo_t* ptr)
@@ -49,4 +54,32 @@ template <> void derefPlatformPtr(cairo_surface_t* ptr)
cairo_surface_destroy(ptr);
}
+template <> cairo_scaled_font_t* refPlatformPtr(cairo_scaled_font_t* ptr)
+{
+ if (ptr)
+ cairo_scaled_font_reference(ptr);
+ return ptr;
+}
+
+template <> void derefPlatformPtr(cairo_scaled_font_t* ptr)
+{
+ if (ptr)
+ cairo_scaled_font_destroy(ptr);
+}
+
+#if defined(USE_FREETYPE)
+template <> FcPattern* refPlatformPtr(FcPattern* ptr)
+{
+ if (ptr)
+ FcPatternReference(ptr);
+ return ptr;
+}
+
+template <> void derefPlatformPtr(FcPattern* ptr)
+{
+ if (ptr)
+ FcPatternDestroy(ptr);
+}
+#endif
+
}
diff --git a/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h b/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h
index 51d8fa9..4b45c1b 100644
--- a/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h
+++ b/WebCore/platform/graphics/cairo/PlatformRefPtrCairo.h
@@ -24,6 +24,11 @@
typedef struct _cairo cairo_t;
typedef struct _cairo_surface cairo_surface_t;
+typedef struct _cairo_scaled_font cairo_scaled_font_t;
+
+#if defined(USE_FREETYPE)
+typedef struct _FcPattern FcPattern;
+#endif
namespace WTF {
@@ -33,6 +38,14 @@ template <> void derefPlatformPtr(cairo_t* ptr);
template <> cairo_surface_t* refPlatformPtr(cairo_surface_t* ptr);
template <> void derefPlatformPtr(cairo_surface_t* ptr);
+template <> cairo_scaled_font_t* refPlatformPtr(cairo_scaled_font_t*);
+template <> void derefPlatformPtr(cairo_scaled_font_t*);
+
+#if defined(USE_FREETYPE)
+template <> FcPattern* refPlatformPtr(FcPattern*);
+template <> void derefPlatformPtr(FcPattern*);
+#endif
+
}
#endif
diff --git a/WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp b/WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp
index 0055078..fd85d6f 100644
--- a/WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp
+++ b/WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp
@@ -47,7 +47,7 @@ void SimpleFontData::platformInit()
{
cairo_font_extents_t font_extents;
cairo_text_extents_t text_extents;
- cairo_scaled_font_extents(m_platformData.m_scaledFont, &font_extents);
+ cairo_scaled_font_extents(m_platformData.m_scaledFont.get(), &font_extents);
m_ascent = static_cast<int>(lroundf(font_extents.ascent));
m_descent = static_cast<int>(lroundf(font_extents.descent));
m_lineSpacing = static_cast<int>(lroundf(font_extents.height));
@@ -58,9 +58,9 @@ void SimpleFontData::platformInit()
// while we figure out what's going on.
if (m_lineSpacing < m_ascent + m_descent)
m_lineSpacing = m_ascent + m_descent;
- cairo_scaled_font_text_extents(m_platformData.m_scaledFont, "x", &text_extents);
+ cairo_scaled_font_text_extents(m_platformData.m_scaledFont.get(), "x", &text_extents);
m_xHeight = text_extents.height;
- cairo_scaled_font_text_extents(m_platformData.m_scaledFont, " ", &text_extents);
+ cairo_scaled_font_text_extents(m_platformData.m_scaledFont.get(), " ", &text_extents);
m_spaceWidth = static_cast<float>(text_extents.x_advance);
m_lineGap = m_lineSpacing - m_ascent - m_descent;
m_syntheticBoldOffset = m_platformData.syntheticBold() ? 1.0f : 0.f;
@@ -92,19 +92,19 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
bool SimpleFontData::containsCharacters(const UChar* characters, int length) const
{
- FT_Face face = cairo_ft_scaled_font_lock_face(m_platformData.m_scaledFont);
+ FT_Face face = cairo_ft_scaled_font_lock_face(m_platformData.m_scaledFont.get());
if (!face)
return false;
for (int i = 0; i < length; i++) {
if (FcFreeTypeCharIndex(face, characters[i]) == 0) {
- cairo_ft_scaled_font_unlock_face(m_platformData.m_scaledFont);
+ cairo_ft_scaled_font_unlock_face(m_platformData.m_scaledFont.get());
return false;
}
}
- cairo_ft_scaled_font_unlock_face(m_platformData.m_scaledFont);
+ cairo_ft_scaled_font_unlock_face(m_platformData.m_scaledFont.get());
return true;
}
@@ -125,10 +125,10 @@ float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
cairo_glyph_t cglyph = { glyph, 0, 0 };
cairo_text_extents_t extents;
- cairo_scaled_font_glyph_extents(m_platformData.m_scaledFont, &cglyph, 1, &extents);
+ cairo_scaled_font_glyph_extents(m_platformData.m_scaledFont.get(), &cglyph, 1, &extents);
float w = (float)m_spaceWidth;
- if (cairo_scaled_font_status(m_platformData.m_scaledFont) == CAIRO_STATUS_SUCCESS && extents.x_advance != 0)
+ if (cairo_scaled_font_status(m_platformData.m_scaledFont.get()) == CAIRO_STATUS_SUCCESS && extents.x_advance)
w = (float)extents.x_advance;
return w;
diff --git a/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp b/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp
index 9826c3e..c2cde19 100644
--- a/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp
@@ -35,8 +35,7 @@
#include "Canvas2DLayerChromium.h"
#include "DrawingBuffer.h"
-
-#include <GLES2/gl2.h>
+#include "GraphicsContext3D.h"
namespace WebCore {
@@ -54,7 +53,7 @@ Canvas2DLayerChromium::Canvas2DLayerChromium(DrawingBuffer* drawingBuffer, Graph
Canvas2DLayerChromium::~Canvas2DLayerChromium()
{
if (m_textureId)
- glDeleteTextures(1, &m_textureId);
+ layerRendererContext()->deleteTexture(m_textureId);
}
void Canvas2DLayerChromium::updateContents()
@@ -62,26 +61,27 @@ void Canvas2DLayerChromium::updateContents()
if (!m_drawingBuffer)
return;
if (m_textureChanged) { // We have to generate a new backing texture.
+ GraphicsContext3D* context = layerRendererContext();
if (m_textureId)
- glDeleteTextures(1, &m_textureId);
- glGenTextures(1, &m_textureId);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, m_textureId);
+ context->deleteTexture(m_textureId);
+ m_textureId = context->createTexture();
+ context->activeTexture(GraphicsContext3D::TEXTURE0);
+ context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textureId);
IntSize size = m_drawingBuffer->size();
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size.width(), size.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
- // Set the min-mag filters to linear and wrap modes to GL_CLAMP_TO_EDGE
+ context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, size.width(), size.height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, 0);
+ // Set the min-mag filters to linear and wrap modes to GraphicsContext3D::CLAMP_TO_EDGE
// to get around NPOT texture limitations of GLES.
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
+ context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
+ context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
+ context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
m_textureChanged = false;
- // FIXME: The glFinish() here is required because we have to make sure that the texture created in this
+ // FIXME: The finish() here is required because we have to make sure that the texture created in this
// context (the compositor context) is actually created by the service side before the child context
- // attempts to use it (in publishToPlatformLayer). glFinish() is currently the only call with strong
+ // attempts to use it (in publishToPlatformLayer). finish() is currently the only call with strong
// enough semantics to promise this, but is actually much stronger. Ideally we'd do something like
// inserting a fence here and waiting for it before trying to publish.
- glFinish();
+ context->finish();
}
// Update the contents of the texture used by the compositor.
if (m_contentsDirty) {
diff --git a/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp b/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp
index 56a7262..4aef25b 100644
--- a/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp
@@ -34,16 +34,16 @@
#include "CanvasLayerChromium.h"
+#include "GraphicsContext3D.h"
#include "LayerRendererChromium.h"
-#include <GLES2/gl2.h>
-
namespace WebCore {
unsigned CanvasLayerChromium::m_shaderProgramId = 0;
-CanvasLayerChromium::SharedValues::SharedValues()
- : m_canvasShaderProgram(0)
+CanvasLayerChromium::SharedValues::SharedValues(GraphicsContext3D* context)
+ : m_context(context)
+ , m_canvasShaderProgram(0)
, m_shaderSamplerLocation(-1)
, m_shaderMatrixLocation(-1)
, m_shaderAlphaLocation(-1)
@@ -73,15 +73,15 @@ CanvasLayerChromium::SharedValues::SharedValues()
" gl_FragColor = vec4(texColor.x, texColor.y, texColor.z, texColor.w) * alpha; \n"
"} \n";
- m_canvasShaderProgram = createShaderProgram(vertexShaderString, fragmentShaderString);
+ m_canvasShaderProgram = createShaderProgram(m_context, vertexShaderString, fragmentShaderString);
if (!m_canvasShaderProgram) {
LOG_ERROR("CanvasLayerChromium: Failed to create shader program");
return;
}
- m_shaderSamplerLocation = glGetUniformLocation(m_canvasShaderProgram, "s_texture");
- m_shaderMatrixLocation = glGetUniformLocation(m_canvasShaderProgram, "matrix");
- m_shaderAlphaLocation = glGetUniformLocation(m_canvasShaderProgram, "alpha");
+ m_shaderSamplerLocation = m_context->getUniformLocation(m_canvasShaderProgram, "s_texture");
+ m_shaderMatrixLocation = m_context->getUniformLocation(m_canvasShaderProgram, "matrix");
+ m_shaderAlphaLocation = m_context->getUniformLocation(m_canvasShaderProgram, "alpha");
ASSERT(m_shaderSamplerLocation != -1);
ASSERT(m_shaderMatrixLocation != -1);
ASSERT(m_shaderAlphaLocation != -1);
@@ -92,7 +92,7 @@ CanvasLayerChromium::SharedValues::SharedValues()
CanvasLayerChromium::SharedValues::~SharedValues()
{
if (m_canvasShaderProgram)
- GLC(glDeleteProgram(m_canvasShaderProgram));
+ GLC(m_context, m_context->deleteProgram(m_canvasShaderProgram));
}
CanvasLayerChromium::CanvasLayerChromium(GraphicsLayerChromium* owner)
@@ -111,11 +111,12 @@ void CanvasLayerChromium::draw()
ASSERT(layerRenderer());
const CanvasLayerChromium::SharedValues* sv = layerRenderer()->canvasLayerSharedValues();
ASSERT(sv && sv->initialized());
- GLC(glActiveTexture(GL_TEXTURE0));
- GLC(glBindTexture(GL_TEXTURE_2D, m_textureId));
+ GraphicsContext3D* context = layerRendererContext();
+ GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE0));
+ GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textureId));
layerRenderer()->useShader(sv->canvasShaderProgram());
- GLC(glUniform1i(sv->shaderSamplerLocation(), 0));
- drawTexturedQuad(layerRenderer()->projectionMatrix(), drawTransform(),
+ GLC(context, context->uniform1i(sv->shaderSamplerLocation(), 0));
+ drawTexturedQuad(context, layerRenderer()->projectionMatrix(), drawTransform(),
bounds().width(), bounds().height(), drawOpacity(),
sv->shaderMatrixLocation(), sv->shaderAlphaLocation());
diff --git a/WebCore/platform/graphics/chromium/CanvasLayerChromium.h b/WebCore/platform/graphics/chromium/CanvasLayerChromium.h
index d591c73..6520b55 100644
--- a/WebCore/platform/graphics/chromium/CanvasLayerChromium.h
+++ b/WebCore/platform/graphics/chromium/CanvasLayerChromium.h
@@ -47,7 +47,7 @@ public:
class SharedValues {
public:
- SharedValues();
+ explicit SharedValues(GraphicsContext3D*);
~SharedValues();
unsigned canvasShaderProgram() const { return m_canvasShaderProgram; }
@@ -57,6 +57,7 @@ public:
bool initialized() const { return m_initialized; }
private:
+ GraphicsContext3D* m_context;
unsigned m_canvasShaderProgram;
int m_shaderSamplerLocation;
int m_shaderMatrixLocation;
diff --git a/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp b/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
index 48119bb..86be8da 100644
--- a/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
@@ -34,6 +34,7 @@
#include "ContentLayerChromium.h"
+#include "GraphicsContext3D.h"
#include "LayerRendererChromium.h"
#include "RenderLayerBacking.h"
@@ -47,12 +48,11 @@
#include <CoreGraphics/CGBitmapContext.h>
#endif
-#include <GLES2/gl2.h>
-
namespace WebCore {
-ContentLayerChromium::SharedValues::SharedValues()
- : m_contentShaderProgram(0)
+ContentLayerChromium::SharedValues::SharedValues(GraphicsContext3D* context)
+ : m_context(context)
+ , m_contentShaderProgram(0)
, m_shaderSamplerLocation(-1)
, m_shaderMatrixLocation(-1)
, m_shaderAlphaLocation(-1)
@@ -71,8 +71,8 @@ ContentLayerChromium::SharedValues::SharedValues()
"} \n";
// Note differences between Skia and Core Graphics versions:
- // - Skia uses BGRA and origin is upper left
- // - Core Graphics uses RGBA and origin is lower left
+ // - Skia uses BGRA
+ // - Core Graphics uses RGBA
char fragmentShaderString[] =
"precision mediump float; \n"
"varying vec2 v_texCoord; \n"
@@ -80,26 +80,25 @@ ContentLayerChromium::SharedValues::SharedValues()
"uniform float alpha; \n"
"void main() \n"
"{ \n"
-#if PLATFORM(SKIA)
" vec4 texColor = texture2D(s_texture, v_texCoord); \n"
+#if PLATFORM(SKIA)
" gl_FragColor = vec4(texColor.z, texColor.y, texColor.x, texColor.w) * alpha; \n"
#elif PLATFORM(CG)
- " vec4 texColor = texture2D(s_texture, vec2(v_texCoord.x, 1.0 - v_texCoord.y)); \n"
" gl_FragColor = vec4(texColor.x, texColor.y, texColor.z, texColor.w) * alpha; \n"
#else
#error "Need to implement for your platform."
#endif
"} \n";
- m_contentShaderProgram = createShaderProgram(vertexShaderString, fragmentShaderString);
+ m_contentShaderProgram = createShaderProgram(m_context, vertexShaderString, fragmentShaderString);
if (!m_contentShaderProgram) {
LOG_ERROR("ContentLayerChromium: Failed to create shader program");
return;
}
- m_shaderSamplerLocation = glGetUniformLocation(m_contentShaderProgram, "s_texture");
- m_shaderMatrixLocation = glGetUniformLocation(m_contentShaderProgram, "matrix");
- m_shaderAlphaLocation = glGetUniformLocation(m_contentShaderProgram, "alpha");
+ m_shaderSamplerLocation = m_context->getUniformLocation(m_contentShaderProgram, "s_texture");
+ m_shaderMatrixLocation = m_context->getUniformLocation(m_contentShaderProgram, "matrix");
+ m_shaderAlphaLocation = m_context->getUniformLocation(m_contentShaderProgram, "alpha");
ASSERT(m_shaderSamplerLocation != -1);
ASSERT(m_shaderMatrixLocation != -1);
ASSERT(m_shaderAlphaLocation != -1);
@@ -110,7 +109,7 @@ ContentLayerChromium::SharedValues::SharedValues()
ContentLayerChromium::SharedValues::~SharedValues()
{
if (m_contentShaderProgram)
- GLC(glDeleteProgram(m_contentShaderProgram));
+ GLC(m_context, m_context->deleteProgram(m_contentShaderProgram));
}
@@ -128,7 +127,7 @@ ContentLayerChromium::ContentLayerChromium(GraphicsLayerChromium* owner)
ContentLayerChromium::~ContentLayerChromium()
{
if (m_contentsTexture)
- GLC(glDeleteTextures(1, &m_contentsTexture));
+ GLC(layerRendererContext(), layerRendererContext()->deleteTexture(m_contentsTexture));
}
@@ -207,11 +206,13 @@ void ContentLayerChromium::updateContents()
dirtyRect.width(), dirtyRect.height(), 8, rowBytes,
colorSpace.get(),
kCGImageAlphaPremultipliedLast));
+ CGContextTranslateCTM(contextCG.get(), 0, dirtyRect.height());
+ CGContextScaleCTM(contextCG.get(), 1, -1);
GraphicsContext graphicsContext(contextCG.get());
LocalCurrentGraphicsContext scopedNSGraphicsContext(&graphicsContext);
- // Translate the graphics contxt into the coordinate system of the dirty rect.
+ // Translate the graphics context into the coordinate system of the dirty rect.
graphicsContext.translate(-dirtyRect.x(), -dirtyRect.y());
m_owner->paintGraphicsLayerContents(graphicsContext, dirtyRect);
@@ -235,30 +236,21 @@ void ContentLayerChromium::updateTextureRect(void* pixels, const IntSize& bitmap
if (!pixels)
return;
- glBindTexture(GL_TEXTURE_2D, textureId);
+ GraphicsContext3D* context = layerRendererContext();
+ context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId);
// If the texture id or size changed since last time then we need to tell GL
// to re-allocate a texture.
if (m_contentsTexture != textureId || requiredTextureSize != m_allocatedTextureSize) {
ASSERT(bitmapSize == requiredTextureSize);
- GLC(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, requiredTextureSize.width(), requiredTextureSize.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels));
+ GLC(context, context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, requiredTextureSize.width(), requiredTextureSize.height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels));
m_contentsTexture = textureId;
m_allocatedTextureSize = requiredTextureSize;
} else {
ASSERT(updateRect.width() <= m_allocatedTextureSize.width() && updateRect.height() <= m_allocatedTextureSize.height());
ASSERT(updateRect.width() == bitmapSize.width() && updateRect.height() == bitmapSize.height());
-#if PLATFORM(CG)
- // The origin is at the lower left in Core Graphics' coordinate system. We need to correct for this here.
- GLC(glTexSubImage2D(GL_TEXTURE_2D, 0,
- updateRect.x(), m_allocatedTextureSize.height() - updateRect.height() - updateRect.y(),
- updateRect.width(), updateRect.height(),
- GL_RGBA, GL_UNSIGNED_BYTE, pixels));
-#elif PLATFORM(SKIA)
- GLC(glTexSubImage2D(GL_TEXTURE_2D, 0, updateRect.x(), updateRect.y(), updateRect.width(), updateRect.height(), GL_RGBA, GL_UNSIGNED_BYTE, pixels));
-#else
-#error "Need to implement for your platform."
-#endif
+ GLC(context, context->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, updateRect.x(), updateRect.y(), updateRect.width(), updateRect.height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels));
}
m_dirtyRect.setSize(FloatSize());
@@ -273,11 +265,12 @@ void ContentLayerChromium::draw()
ASSERT(layerRenderer());
const ContentLayerChromium::SharedValues* sv = layerRenderer()->contentLayerSharedValues();
ASSERT(sv && sv->initialized());
- GLC(glActiveTexture(GL_TEXTURE0));
- GLC(glBindTexture(GL_TEXTURE_2D, m_contentsTexture));
+ GraphicsContext3D* context = layerRendererContext();
+ GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE0));
+ GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_contentsTexture));
layerRenderer()->useShader(sv->contentShaderProgram());
- GLC(glUniform1i(sv->shaderSamplerLocation(), 0));
- drawTexturedQuad(layerRenderer()->projectionMatrix(), drawTransform(),
+ GLC(context, context->uniform1i(sv->shaderSamplerLocation(), 0));
+ drawTexturedQuad(context, layerRenderer()->projectionMatrix(), drawTransform(),
bounds().width(), bounds().height(), drawOpacity(),
sv->shaderMatrixLocation(), sv->shaderAlphaLocation());
}
diff --git a/WebCore/platform/graphics/chromium/ContentLayerChromium.h b/WebCore/platform/graphics/chromium/ContentLayerChromium.h
index 3e15372..42a77c7 100644
--- a/WebCore/platform/graphics/chromium/ContentLayerChromium.h
+++ b/WebCore/platform/graphics/chromium/ContentLayerChromium.h
@@ -44,7 +44,7 @@ class ContentLayerChromium : public LayerChromium {
public:
static PassRefPtr<ContentLayerChromium> create(GraphicsLayerChromium* owner = 0);
- ~ContentLayerChromium();
+ virtual ~ContentLayerChromium();
virtual void updateContents();
virtual void draw();
@@ -55,7 +55,7 @@ public:
// context).
class SharedValues {
public:
- SharedValues();
+ explicit SharedValues(GraphicsContext3D*);
~SharedValues();
unsigned contentShaderProgram() const { return m_contentShaderProgram; }
@@ -65,6 +65,7 @@ public:
int initialized() const { return m_initialized; }
private:
+ GraphicsContext3D* m_context;
unsigned m_contentShaderProgram;
int m_shaderSamplerLocation;
int m_shaderMatrixLocation;
diff --git a/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp b/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp
index 64981ee..9ce0efe 100644
--- a/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp
+++ b/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp
@@ -39,12 +39,6 @@
#include "Canvas2DLayerChromium.h"
#endif
-#include <GLES2/gl2.h>
-#ifndef GL_GLEXT_PROTOTYPES
-#define GL_GLEXT_PROTOTYPES 1
-#endif
-#include <GLES2/gl2ext.h>
-
namespace WebCore {
struct DrawingBufferInternal {
@@ -105,8 +99,8 @@ void DrawingBuffer::publishToPlatformLayer()
// happens before the compositor draws. This means we might draw stale frames sometimes. Ideally this
// would insert a fence into the child command stream that the compositor could wait for.
m_context->makeContextCurrent();
- glCopyTextureToParentTexture(m_internal->offscreenColorTexture, parentTexture);
- glFlush();
+ m_context->copyTextureToParentTextureCHROMIUM(m_internal->offscreenColorTexture, parentTexture);
+ m_context->flush();
}
#endif
diff --git a/WebCore/platform/graphics/chromium/FontCacheLinux.cpp b/WebCore/platform/graphics/chromium/FontCacheLinux.cpp
index 2fda22d..4399d35 100644
--- a/WebCore/platform/graphics/chromium/FontCacheLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontCacheLinux.cpp
@@ -43,7 +43,6 @@
#include "SkTypeface.h"
#include "SkUtils.h"
-#include <unicode/utf16.h>
#include <wtf/Assertions.h>
#include <wtf/text/AtomicString.h>
#include <wtf/text/CString.h>
diff --git a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
index bbae72a..21dcd8e 100644
--- a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
@@ -84,11 +84,6 @@ static void clearLayerBackgroundColor(LayerChromium& layer)
layer.setBackgroundColor(static_cast<RGBA32>(0));
}
-GraphicsLayer::CompositingCoordinatesOrientation GraphicsLayer::compositingCoordinatesOrientation()
-{
- return CompositingCoordinatesBottomUp;
-}
-
PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
{
return new GraphicsLayerChromium(client);
@@ -324,7 +319,6 @@ void GraphicsLayerChromium::setContentsToImage(Image* image)
{
bool childrenChanged = false;
if (image) {
- NativeImagePtr nativeImage = image->nativeImageForCurrentFrame();
if (!m_contentsLayer.get() || m_contentsLayerPurpose != ContentsLayerForImage) {
RefPtr<ImageLayerChromium> imageLayer = ImageLayerChromium::create(this);
setupContentsLayer(imageLayer.get());
@@ -333,7 +327,7 @@ void GraphicsLayerChromium::setContentsToImage(Image* image)
childrenChanged = true;
}
ImageLayerChromium* imageLayer = static_cast<ImageLayerChromium*>(m_contentsLayer.get());
- imageLayer->setContents(nativeImage);
+ imageLayer->setContents(image);
updateContentsRect();
} else {
if (m_contentsLayer) {
@@ -400,15 +394,6 @@ void GraphicsLayerChromium::setContentsToMedia(PlatformLayer* layer)
updateSublayerList();
}
-void GraphicsLayerChromium::setGeometryOrientation(CompositingCoordinatesOrientation orientation)
-{
- if (orientation == m_geometryOrientation)
- return;
-
- GraphicsLayer::setGeometryOrientation(orientation);
- updateGeometryOrientation();
-}
-
PlatformLayer* GraphicsLayerChromium::hostLayerForSublayers() const
{
return m_transformLayer ? m_transformLayer.get() : m_layer.get();
@@ -625,21 +610,6 @@ void GraphicsLayerChromium::updateContentsRect()
m_contentsLayer->setBounds(IntSize(m_contentsRect.width(), m_contentsRect.height()));
}
-void GraphicsLayerChromium::updateGeometryOrientation()
-{
- switch (geometryOrientation()) {
- case CompositingCoordinatesTopDown:
- m_layer->setGeometryFlipped(false);
- break;
-
- case CompositingCoordinatesBottomUp:
- m_layer->setGeometryFlipped(true);
- break;
- }
- // Geometry orientation is mapped onto children transform in older QuartzCores,
- // so is handled via setGeometryOrientation().
-}
-
void GraphicsLayerChromium::setupContentsLayer(LayerChromium* contentsLayer)
{
if (contentsLayer == m_contentsLayer)
diff --git a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
index dde443d..214058d 100644
--- a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
+++ b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
@@ -94,8 +94,6 @@ public:
virtual void setDebugBackgroundColor(const Color&);
virtual void setDebugBorder(const Color&, float borderWidth);
- virtual void setGeometryOrientation(CompositingCoordinatesOrientation);
-
void notifySyncRequired()
{
if (m_client)
@@ -125,7 +123,6 @@ private:
void updateContentsImage();
void updateContentsVideo();
void updateContentsRect();
- void updateGeometryOrientation();
void setupContentsLayer(LayerChromium*);
LayerChromium* contentsLayer() const { return m_contentsLayer.get(); }
diff --git a/WebKit/chromium/src/js/DevToolsHostStub.js b/WebCore/platform/graphics/chromium/ImageChromium.cpp
index d3333e2..e90d566 100644
--- a/WebKit/chromium/src/js/DevToolsHostStub.js
+++ b/WebCore/platform/graphics/chromium/ImageChromium.cpp
@@ -1,10 +1,10 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
+ * Copyright (c) 2008-2010, Google Inc. All rights reserved.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* 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
@@ -14,7 +14,7 @@
* * 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
@@ -28,11 +28,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/**
- * @fileoverview These stubs emulate backend functionality and allows
- * DevTools frontend to function as a standalone web app.
- */
+#include "config.h"
+#include "Image.h"
+
+#include "ChromiumBridge.h"
+
+namespace WebCore {
-if (!window["RemoteDebuggerCommandExecutor"]) {
- window["RemoteDebuggerCommandExecutor"] = {};
+// Other Image methods are implemented in ImageSkia.cpp
+
+PassRefPtr<Image> Image::loadPlatformResource(const char *name)
+{
+ return ChromiumBridge::loadPlatformImageResource(name);
}
+
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp b/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
index 060bb46..c97be82 100644
--- a/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
@@ -34,6 +34,7 @@
#include "ImageLayerChromium.h"
+#include "Image.h"
#include "LayerRendererChromium.h"
#if PLATFORM(SKIA)
@@ -61,7 +62,7 @@ ImageLayerChromium::ImageLayerChromium(GraphicsLayerChromium* owner)
{
}
-void ImageLayerChromium::setContents(NativeImagePtr contents)
+void ImageLayerChromium::setContents(Image* contents)
{
// Check if the image has changed.
if (m_contents == contents)
@@ -75,13 +76,14 @@ void ImageLayerChromium::updateContents()
ASSERT(layerRenderer());
void* pixels = 0;
- IntRect dirtyRect(m_dirtyRect);
IntSize requiredTextureSize;
IntSize bitmapSize;
+ NativeImagePtr nativeImage = m_contents->nativeImageForCurrentFrame();
+
#if PLATFORM(SKIA)
// The layer contains an Image.
- NativeImageSkia* skiaImage = static_cast<NativeImageSkia*>(m_contents);
+ NativeImageSkia* skiaImage = static_cast<NativeImageSkia*>(nativeImage);
const SkBitmap* skiaBitmap = skiaImage;
requiredTextureSize = IntSize(skiaBitmap->width(), skiaBitmap->height());
ASSERT(skiaBitmap);
@@ -95,9 +97,8 @@ void ImageLayerChromium::updateContents()
}
#elif PLATFORM(CG)
// NativeImagePtr is a CGImageRef on Mac OS X.
- CGImageRef cgImage = m_contents;
- int width = CGImageGetWidth(cgImage);
- int height = CGImageGetHeight(cgImage);
+ int width = CGImageGetWidth(nativeImage);
+ int height = CGImageGetHeight(nativeImage);
requiredTextureSize = IntSize(width, height);
bitmapSize = requiredTextureSize;
// FIXME: we should get rid of this temporary copy where possible.
@@ -109,7 +110,7 @@ void ImageLayerChromium::updateContents()
// Try to reuse the color space from the image to preserve its colors.
// Some images use a color space (such as indexed) unsupported by the bitmap context.
RetainPtr<CGColorSpaceRef> colorSpaceReleaser;
- CGColorSpaceRef colorSpace = CGImageGetColorSpace(cgImage);
+ CGColorSpaceRef colorSpace = CGImageGetColorSpace(nativeImage);
CGColorSpaceModel colorSpaceModel = CGColorSpaceGetModel(colorSpace);
switch (colorSpaceModel) {
case kCGColorSpaceModelMonochrome:
@@ -130,7 +131,7 @@ void ImageLayerChromium::updateContents()
CGContextSetBlendMode(tempContext.get(), kCGBlendModeCopy);
CGContextDrawImage(tempContext.get(),
CGRectMake(0, 0, static_cast<CGFloat>(width), static_cast<CGFloat>(height)),
- cgImage);
+ nativeImage);
pixels = tempVector.data();
#else
#error "Need to implement for your platform."
@@ -146,6 +147,10 @@ void ImageLayerChromium::updateContents()
if (!textureId)
textureId = layerRenderer()->createLayerTexture();
+ // Clip the dirty rect to the bitmap dimensions.
+ IntRect dirtyRect(m_dirtyRect);
+ dirtyRect.intersect(IntRect(IntPoint(0, 0), bitmapSize));
+
if (pixels)
updateTextureRect(pixels, bitmapSize, requiredTextureSize, dirtyRect, textureId);
}
diff --git a/WebCore/platform/graphics/chromium/ImageLayerChromium.h b/WebCore/platform/graphics/chromium/ImageLayerChromium.h
index e95284c..b91f04a 100644
--- a/WebCore/platform/graphics/chromium/ImageLayerChromium.h
+++ b/WebCore/platform/graphics/chromium/ImageLayerChromium.h
@@ -36,8 +36,14 @@
#include "ContentLayerChromium.h"
+#if PLATFORM(CG)
+#include <wtf/RetainPtr.h>
+#endif
+
namespace WebCore {
+class Image;
+
// A Layer that contains only an Image element.
class ImageLayerChromium : public ContentLayerChromium {
public:
@@ -46,11 +52,12 @@ public:
virtual void updateContents();
virtual bool drawsContent() { return m_contents; }
- void setContents(NativeImagePtr);
+ void setContents(Image* image);
private:
ImageLayerChromium(GraphicsLayerChromium* owner);
- NativeImagePtr m_contents;
+
+ RefPtr<Image> m_contents;
};
}
diff --git a/WebCore/platform/graphics/chromium/LayerChromium.cpp b/WebCore/platform/graphics/chromium/LayerChromium.cpp
index 6519f1f..e36c69d 100644
--- a/WebCore/platform/graphics/chromium/LayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/LayerChromium.cpp
@@ -34,6 +34,7 @@
#include "LayerChromium.h"
+#include "GraphicsContext3D.h"
#include "LayerRendererChromium.h"
#if PLATFORM(SKIA)
#include "NativeImageSkia.h"
@@ -41,8 +42,7 @@
#endif
#include "RenderLayerBacking.h"
#include "skia/ext/platform_canvas.h"
-
-#include <GLES2/gl2.h>
+#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -51,24 +51,26 @@ using namespace std;
const unsigned LayerChromium::s_positionAttribLocation = 0;
const unsigned LayerChromium::s_texCoordAttribLocation = 1;
-static GLuint loadShader(GLenum type, const char* shaderSource)
+static unsigned loadShader(GraphicsContext3D* context, unsigned type, const char* shaderSource)
{
- GLuint shader = glCreateShader(type);
+ unsigned shader = context->createShader(type);
if (!shader)
return 0;
- GLC(glShaderSource(shader, 1, &shaderSource, 0));
- GLC(glCompileShader(shader));
- GLint compiled;
- GLC(glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled));
+ String sourceString(shaderSource);
+ GLC(context, context->shaderSource(shader, sourceString));
+ GLC(context, context->compileShader(shader));
+ int compiled;
+ GLC(context, context->getShaderiv(shader, GraphicsContext3D::COMPILE_STATUS, &compiled));
if (!compiled) {
- GLC(glDeleteShader(shader));
+ GLC(context, context->deleteShader(shader));
return 0;
}
return shader;
}
-LayerChromium::SharedValues::SharedValues()
- : m_quadVerticesVbo(0)
+LayerChromium::SharedValues::SharedValues(GraphicsContext3D* context)
+ : m_context(context)
+ , m_quadVerticesVbo(0)
, m_quadElementsVbo(0)
, m_maxTextureSize(0)
, m_borderShaderProgram(0)
@@ -77,24 +79,22 @@ LayerChromium::SharedValues::SharedValues()
, m_initialized(false)
{
// Vertex positions and texture coordinates for the 4 corners of a 1x1 quad.
- GLfloat vertices[] = { -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
- -0.5f, -0.5f, 0.0f, 0.0f, 0.0f,
- 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
- 0.5f, 0.5f, 0.0f, 1.0f, 1.0f };
- GLushort indices[] = { 0, 1, 2, 0, 2, 3, // The two triangles that make up the layer quad.
+ float vertices[] = { -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
+ -0.5f, -0.5f, 0.0f, 0.0f, 0.0f,
+ 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
+ 0.5f, 0.5f, 0.0f, 1.0f, 1.0f };
+ uint16_t indices[] = { 0, 1, 2, 0, 2, 3, // The two triangles that make up the layer quad.
0, 1, 2, 3}; // A line path for drawing the layer border.
- GLuint vboIds[2];
- GLC(glGenBuffers(2, vboIds));
- m_quadVerticesVbo = vboIds[0];
- m_quadElementsVbo = vboIds[1];
- GLC(glBindBuffer(GL_ARRAY_BUFFER, m_quadVerticesVbo));
- GLC(glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW));
- GLC(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_quadElementsVbo));
- GLC(glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW));
+ GLC(m_context, m_quadVerticesVbo = m_context->createBuffer());
+ GLC(m_context, m_quadElementsVbo = m_context->createBuffer());
+ GLC(m_context, m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_quadVerticesVbo));
+ GLC(m_context, m_context->bufferData(GraphicsContext3D::ARRAY_BUFFER, sizeof(vertices), vertices, GraphicsContext3D::STATIC_DRAW));
+ GLC(m_context, m_context->bindBuffer(GraphicsContext3D::ELEMENT_ARRAY_BUFFER, m_quadElementsVbo));
+ GLC(m_context, m_context->bufferData(GraphicsContext3D::ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GraphicsContext3D::STATIC_DRAW));
// Get the max texture size supported by the system.
- GLC(glGetIntegerv(GL_MAX_TEXTURE_SIZE, &m_maxTextureSize));
+ GLC(m_context, m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &m_maxTextureSize));
// Shaders for drawing the debug borders around the layers.
char borderVertexShaderString[] =
@@ -112,14 +112,14 @@ LayerChromium::SharedValues::SharedValues()
" gl_FragColor = vec4(color.xyz * color.w, color.w);\n"
"} \n";
- m_borderShaderProgram = createShaderProgram(borderVertexShaderString, borderFragmentShaderString);
+ m_borderShaderProgram = createShaderProgram(m_context, borderVertexShaderString, borderFragmentShaderString);
if (!m_borderShaderProgram) {
LOG_ERROR("ContentLayerChromium: Failed to create shader program");
return;
}
- m_borderShaderMatrixLocation = glGetUniformLocation(m_borderShaderProgram, "matrix");
- m_borderShaderColorLocation = glGetUniformLocation(m_borderShaderProgram, "color");
+ m_borderShaderMatrixLocation = m_context->getUniformLocation(m_borderShaderProgram, "matrix");
+ m_borderShaderColorLocation = m_context->getUniformLocation(m_borderShaderProgram, "color");
ASSERT(m_borderShaderMatrixLocation != -1);
ASSERT(m_borderShaderColorLocation != -1);
@@ -128,11 +128,10 @@ LayerChromium::SharedValues::SharedValues()
LayerChromium::SharedValues::~SharedValues()
{
- GLuint vboIds[2] = { m_quadVerticesVbo, m_quadElementsVbo };
- GLC(glDeleteBuffers(2, vboIds));
-
+ GLC(m_context, m_context->deleteBuffer(m_quadVerticesVbo));
+ GLC(m_context, m_context->deleteBuffer(m_quadElementsVbo));
if (m_borderShaderProgram)
- GLC(glDeleteProgram(m_borderShaderProgram));
+ GLC(m_context, m_context->deleteProgram(m_borderShaderProgram));
}
@@ -181,45 +180,45 @@ void LayerChromium::setLayerRenderer(LayerRendererChromium* renderer)
m_layerRenderer = renderer;
}
-unsigned LayerChromium::createShaderProgram(const char* vertexShaderSource, const char* fragmentShaderSource)
+unsigned LayerChromium::createShaderProgram(GraphicsContext3D* context, const char* vertexShaderSource, const char* fragmentShaderSource)
{
- GLuint vertexShader = loadShader(GL_VERTEX_SHADER, vertexShaderSource);
+ unsigned vertexShader = loadShader(context, GraphicsContext3D::VERTEX_SHADER, vertexShaderSource);
if (!vertexShader) {
LOG_ERROR("Failed to create vertex shader");
return 0;
}
- GLuint fragmentShader = loadShader(GL_FRAGMENT_SHADER, fragmentShaderSource);
+ unsigned fragmentShader = loadShader(context, GraphicsContext3D::FRAGMENT_SHADER, fragmentShaderSource);
if (!fragmentShader) {
- GLC(glDeleteShader(vertexShader));
+ GLC(context, context->deleteShader(vertexShader));
LOG_ERROR("Failed to create fragment shader");
return 0;
}
- GLuint programObject = glCreateProgram();
+ unsigned programObject = context->createProgram();
if (!programObject) {
LOG_ERROR("Failed to create shader program");
return 0;
}
- GLC(glAttachShader(programObject, vertexShader));
- GLC(glAttachShader(programObject, fragmentShader));
+ GLC(context, context->attachShader(programObject, vertexShader));
+ GLC(context, context->attachShader(programObject, fragmentShader));
// Bind the common attrib locations.
- GLC(glBindAttribLocation(programObject, s_positionAttribLocation, "a_position"));
- GLC(glBindAttribLocation(programObject, s_texCoordAttribLocation, "a_texCoord"));
+ GLC(context, context->bindAttribLocation(programObject, s_positionAttribLocation, "a_position"));
+ GLC(context, context->bindAttribLocation(programObject, s_texCoordAttribLocation, "a_texCoord"));
- GLC(glLinkProgram(programObject));
- GLint linked;
- GLC(glGetProgramiv(programObject, GL_LINK_STATUS, &linked));
+ GLC(context, context->linkProgram(programObject));
+ int linked;
+ GLC(context, context->getProgramiv(programObject, GraphicsContext3D::LINK_STATUS, &linked));
if (!linked) {
LOG_ERROR("Failed to link shader program");
- GLC(glDeleteProgram(programObject));
+ GLC(context, context->deleteProgram(programObject));
return 0;
}
- GLC(glDeleteShader(vertexShader));
- GLC(glDeleteShader(fragmentShader));
+ GLC(context, context->deleteShader(vertexShader));
+ GLC(context, context->deleteShader(fragmentShader));
return programObject;
}
@@ -299,10 +298,15 @@ void LayerChromium::setBounds(const IntSize& size)
if (m_bounds == size)
return;
+ bool firstResize = !m_bounds.width() && !m_bounds.height() && size.width() && size.height();
+
m_bounds = size;
m_backingStoreSize = size;
- setNeedsCommit();
+ if (firstResize)
+ setNeedsDisplay(FloatRect(0, 0, m_bounds.width(), m_bounds.height()));
+ else
+ setNeedsCommit();
}
void LayerChromium::setFrame(const FloatRect& rect)
@@ -311,7 +315,7 @@ void LayerChromium::setFrame(const FloatRect& rect)
return;
m_frame = rect;
- setNeedsCommit();
+ setNeedsDisplay(FloatRect(0, 0, m_bounds.width(), m_bounds.height()));
}
const LayerChromium* LayerChromium::rootLayer() const
@@ -353,7 +357,6 @@ void LayerChromium::setNeedsDisplay(const FloatRect& dirtyRect)
m_contentsDirty = true;
m_dirtyRect.unite(dirtyRect);
-
setNeedsCommit();
}
@@ -363,6 +366,12 @@ void LayerChromium::setNeedsDisplay()
m_contentsDirty = true;
}
+void LayerChromium::resetNeedsDisplay()
+{
+ m_dirtyRect = FloatRect();
+ m_contentsDirty = false;
+}
+
void LayerChromium::toGLMatrix(float* flattened, const TransformationMatrix& m)
{
flattened[0] = m.m11();
@@ -383,11 +392,17 @@ void LayerChromium::toGLMatrix(float* flattened, const TransformationMatrix& m)
flattened[15] = m.m44();
}
-void LayerChromium::drawTexturedQuad(const TransformationMatrix& projectionMatrix, const TransformationMatrix& drawMatrix,
+GraphicsContext3D* LayerChromium::layerRendererContext() const
+{
+ ASSERT(layerRenderer());
+ return layerRenderer()->context();
+}
+
+void LayerChromium::drawTexturedQuad(GraphicsContext3D* context, const TransformationMatrix& projectionMatrix, const TransformationMatrix& drawMatrix,
float width, float height, float opacity,
int matrixLocation, int alphaLocation)
{
- static GLfloat glMatrix[16];
+ static float glMatrix[16];
TransformationMatrix renderMatrix = drawMatrix;
@@ -399,17 +414,17 @@ void LayerChromium::drawTexturedQuad(const TransformationMatrix& projectionMatri
toGLMatrix(&glMatrix[0], renderMatrix);
- GLC(glUniformMatrix4fv(matrixLocation, 1, false, &glMatrix[0]));
+ GLC(context, context->uniformMatrix4fv(matrixLocation, false, &glMatrix[0], 1));
if (alphaLocation != -1)
- GLC(glUniform1f(alphaLocation, opacity));
+ GLC(context, context->uniform1f(alphaLocation, opacity));
- GLC(glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0));
+ GLC(context, context->drawElements(GraphicsContext3D::TRIANGLES, 6, GraphicsContext3D::UNSIGNED_SHORT, 0));
}
void LayerChromium::drawDebugBorder()
{
- static GLfloat glMatrix[16];
+ static float glMatrix[16];
if (!borderColor().alpha())
return;
@@ -421,14 +436,15 @@ void LayerChromium::drawDebugBorder()
renderMatrix.scale3d(bounds().width(), bounds().height(), 1);
renderMatrix.multiply(layerRenderer()->projectionMatrix());
toGLMatrix(&glMatrix[0], renderMatrix);
- GLC(glUniformMatrix4fv(sv->borderShaderMatrixLocation(), 1, false, &glMatrix[0]));
+ GraphicsContext3D* context = layerRendererContext();
+ GLC(context, context->uniformMatrix4fv(sv->borderShaderMatrixLocation(), false, &glMatrix[0], 1));
- GLC(glUniform4f(sv->borderShaderColorLocation(), borderColor().red() / 255.0, borderColor().green() / 255.0, borderColor().blue() / 255.0, 1));
+ GLC(context, context->uniform4f(sv->borderShaderColorLocation(), borderColor().red() / 255.0, borderColor().green() / 255.0, borderColor().blue() / 255.0, 1));
- GLC(glLineWidth(borderWidth()));
+ GLC(context, context->lineWidth(borderWidth()));
// The indices for the line are stored in the same array as the triangle indices.
- GLC(glDrawElements(GL_LINE_LOOP, 4, GL_UNSIGNED_SHORT, (void*)(6 * sizeof(unsigned short))));
+ GLC(context, context->drawElements(GraphicsContext3D::LINE_LOOP, 4, GraphicsContext3D::UNSIGNED_SHORT, 6 * sizeof(unsigned short)));
}
const FloatRect LayerChromium::getDrawRect() const
@@ -455,24 +471,26 @@ void LayerChromium::drawAsMask()
// We reuse the border shader here as all we need a single colored shader pass.
// The color specified here is only for debug puproses as typically when we call this
// method, writes to the color channels are disabled.
- GLC(glUniform4f(sv->borderShaderColorLocation(), 0, 1 , 0, 0.7));
+ GraphicsContext3D* context = layerRendererContext();
+ GLC(context, context->uniform4f(sv->borderShaderColorLocation(), 0, 1 , 0, 0.7));
- drawTexturedQuad(layerRenderer()->projectionMatrix(), drawTransform(),
- bounds().width(), bounds().height(), drawOpacity(),
- sv->borderShaderMatrixLocation(), -1);
+ drawTexturedQuad(context, layerRenderer()->projectionMatrix(), drawTransform(),
+ bounds().width(), bounds().height(), drawOpacity(),
+ sv->borderShaderMatrixLocation(), -1);
}
// static
void LayerChromium::prepareForDraw(const SharedValues* sv)
{
- GLC(glBindBuffer(GL_ARRAY_BUFFER, sv->quadVerticesVbo()));
- GLC(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, sv->quadElementsVbo()));
- GLuint offset = 0;
- GLC(glVertexAttribPointer(s_positionAttribLocation, 3, GL_FLOAT, GL_FALSE, 5 * sizeof(GLfloat), (GLvoid*)offset));
- offset += 3 * sizeof(GLfloat);
- GLC(glVertexAttribPointer(s_texCoordAttribLocation, 2, GL_FLOAT, GL_FALSE, 5 * sizeof(GLfloat), (GLvoid*)offset));
- GLC(glEnableVertexAttribArray(s_positionAttribLocation));
- GLC(glEnableVertexAttribArray(s_texCoordAttribLocation));
+ GraphicsContext3D* context = sv->context();
+ GLC(context, context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, sv->quadVerticesVbo()));
+ GLC(context, context->bindBuffer(GraphicsContext3D::ELEMENT_ARRAY_BUFFER, sv->quadElementsVbo()));
+ unsigned offset = 0;
+ GLC(context, context->vertexAttribPointer(s_positionAttribLocation, 3, GraphicsContext3D::FLOAT, false, 5 * sizeof(float), offset));
+ offset += 3 * sizeof(float);
+ GLC(context, context->vertexAttribPointer(s_texCoordAttribLocation, 2, GraphicsContext3D::FLOAT, false, 5 * sizeof(float), offset));
+ GLC(context, context->enableVertexAttribArray(s_positionAttribLocation));
+ GLC(context, context->enableVertexAttribArray(s_texCoordAttribLocation));
}
}
diff --git a/WebCore/platform/graphics/chromium/LayerChromium.h b/WebCore/platform/graphics/chromium/LayerChromium.h
index ba15088..30d35d1 100644
--- a/WebCore/platform/graphics/chromium/LayerChromium.h
+++ b/WebCore/platform/graphics/chromium/LayerChromium.h
@@ -62,7 +62,7 @@ class LayerChromium : public RefCounted<LayerChromium> {
public:
static PassRefPtr<LayerChromium> create(GraphicsLayerChromium* owner = 0);
- ~LayerChromium();
+ virtual ~LayerChromium();
const LayerChromium* rootLayer() const;
LayerChromium* superlayer() const;
@@ -112,6 +112,8 @@ public:
void setNeedsDisplay(const FloatRect& dirtyRect);
void setNeedsDisplay();
+ const FloatRect& dirtyRect() const { return m_dirtyRect; }
+ void resetNeedsDisplay();
void setNeedsDisplayOnBoundsChange(bool needsDisplay) { m_needsDisplayOnBoundsChange = needsDisplay; }
@@ -169,9 +171,10 @@ public:
// context).
class SharedValues {
public:
- SharedValues();
+ explicit SharedValues(GraphicsContext3D*);
~SharedValues();
+ GraphicsContext3D* context() const { return m_context; }
unsigned quadVerticesVbo() const { return m_quadVerticesVbo; }
unsigned quadElementsVbo() const { return m_quadElementsVbo; }
int maxTextureSize() const { return m_maxTextureSize; }
@@ -181,6 +184,7 @@ public:
bool initialized() const { return m_initialized; }
private:
+ GraphicsContext3D* m_context;
unsigned m_quadVerticesVbo;
unsigned m_quadElementsVbo;
int m_maxTextureSize;
@@ -197,14 +201,15 @@ protected:
LayerChromium(GraphicsLayerChromium* owner);
LayerRendererChromium* layerRenderer() const { return m_layerRenderer; }
+ GraphicsContext3D* layerRendererContext() const;
- static void drawTexturedQuad(const TransformationMatrix& projectionMatrix, const TransformationMatrix& layerMatrix,
+ static void drawTexturedQuad(GraphicsContext3D*, const TransformationMatrix& projectionMatrix, const TransformationMatrix& layerMatrix,
float width, float height, float opacity,
int matrixLocation, int alphaLocation);
static void toGLMatrix(float*, const TransformationMatrix&);
- static unsigned createShaderProgram(const char* vertexShaderSource, const char* fragmentShaderSource);
+ static unsigned createShaderProgram(GraphicsContext3D*, const char* vertexShaderSource, const char* fragmentShaderSource);
IntSize m_bounds;
FloatRect m_dirtyRect;
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
index 4708310..116a15d 100644
--- a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -35,7 +35,7 @@
#include "LayerRendererChromium.h"
#include "Canvas2DLayerChromium.h"
-#include "GLES2Context.h"
+#include "GraphicsContext3D.h"
#include "LayerChromium.h"
#include "NotImplemented.h"
#include "WebGLLayerChromium.h"
@@ -46,8 +46,6 @@
#include <CoreGraphics/CGBitmapContext.h>
#endif
-#include <GLES2/gl2.h>
-
namespace WebCore {
static TransformationMatrix orthoMatrix(float left, float right, float bottom, float top, float nearZ, float farZ)
@@ -75,19 +73,19 @@ static inline bool compareLayerZ(const LayerChromium* a, const LayerChromium* b)
return transformA.m43() < transformB.m43();
}
-PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(PassOwnPtr<GLES2Context> gles2Context)
+PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(PassOwnPtr<GraphicsContext3D> context)
{
- if (!gles2Context)
+ if (!context)
return 0;
- OwnPtr<LayerRendererChromium> layerRenderer(new LayerRendererChromium(gles2Context));
+ OwnPtr<LayerRendererChromium> layerRenderer(new LayerRendererChromium(context));
if (!layerRenderer->hardwareCompositing())
return 0;
return layerRenderer.release();
}
-LayerRendererChromium::LayerRendererChromium(PassOwnPtr<GLES2Context> gles2Context)
+LayerRendererChromium::LayerRendererChromium(PassOwnPtr<GraphicsContext3D> context)
: m_rootLayerTextureId(0)
, m_rootLayerTextureWidth(0)
, m_rootLayerTextureHeight(0)
@@ -96,7 +94,7 @@ LayerRendererChromium::LayerRendererChromium(PassOwnPtr<GLES2Context> gles2Conte
, m_needsDisplay(false)
, m_scrollPosition(IntPoint(-1, -1))
, m_currentShader(0)
- , m_gles2Context(gles2Context)
+ , m_context(context)
{
m_hardwareCompositing = initializeSharedObjects();
}
@@ -106,11 +104,16 @@ LayerRendererChromium::~LayerRendererChromium()
cleanupSharedObjects();
}
-void LayerRendererChromium::debugGLCall(const char* command, const char* file, int line)
+GraphicsContext3D* LayerRendererChromium::context()
+{
+ return m_context.get();
+}
+
+void LayerRendererChromium::debugGLCall(GraphicsContext3D* context, const char* command, const char* file, int line)
{
- GLenum error = glGetError();
- if (error != GL_NO_ERROR)
- LOG_ERROR("GL command failed: File: %s\n\tLine %d\n\tcommand: %s, error %x\n", file, line, command, error);
+ unsigned long error = context->getError();
+ if (error != GraphicsContext3D::NO_ERROR)
+ LOG_ERROR("GL command failed: File: %s\n\tLine %d\n\tcommand: %s, error %x\n", file, line, command, static_cast<int>(error));
}
// Creates a canvas and an associated graphics context that the root layer will
@@ -138,6 +141,8 @@ void LayerRendererChromium::setRootLayerCanvasSize(const IntSize& size)
size.width(), size.height(), 8, rowBytes,
colorSpace.get(),
kCGImageAlphaPremultipliedLast));
+ CGContextTranslateCTM(m_rootLayerCGContext.get(), 0, size.height());
+ CGContextScaleCTM(m_rootLayerCGContext.get(), 1, -1);
m_rootLayerGraphicsContext = new GraphicsContext(m_rootLayerCGContext.get());
#else
#error "Need to implement for your platform."
@@ -149,15 +154,15 @@ void LayerRendererChromium::setRootLayerCanvasSize(const IntSize& size)
void LayerRendererChromium::useShader(unsigned programId)
{
if (programId != m_currentShader) {
- GLC(glUseProgram(programId));
+ GLC(m_context, m_context->useProgram(programId));
m_currentShader = programId;
}
}
// Updates the contents of the root layer texture that fall inside the updateRect
// and re-composits all sublayers.
-void LayerRendererChromium::drawLayers(const IntRect& updateRect, const IntRect& visibleRect,
- const IntRect& contentRect, const IntPoint& scrollPosition)
+void LayerRendererChromium::prepareToDrawLayers(const IntRect& visibleRect, const IntRect& contentRect,
+ const IntPoint& scrollPosition)
{
ASSERT(m_hardwareCompositing);
@@ -166,7 +171,7 @@ void LayerRendererChromium::drawLayers(const IntRect& updateRect, const IntRect&
makeContextCurrent();
- GLC(glBindTexture(GL_TEXTURE_2D, m_rootLayerTextureId));
+ GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_rootLayerTextureId));
// If the size of the visible area has changed then allocate a new texture
// to store the contents of the root layer and adjust the projection matrix
@@ -178,56 +183,44 @@ void LayerRendererChromium::drawLayers(const IntRect& updateRect, const IntRect&
m_rootLayerTextureHeight = visibleRect.height();
m_projectionMatrix = orthoMatrix(0, visibleRectWidth, visibleRectHeight, 0, -1000, 1000);
- GLC(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_rootLayerTextureWidth, m_rootLayerTextureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0));
+ GLC(m_context, m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, m_rootLayerTextureWidth, m_rootLayerTextureHeight, 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, 0));
}
// The GL viewport covers the entire visible area, including the scrollbars.
- GLC(glViewport(0, 0, visibleRectWidth, visibleRectHeight));
+ GLC(m_context, m_context->viewport(0, 0, visibleRectWidth, visibleRectHeight));
// Bind the common vertex attributes used for drawing all the layers.
LayerChromium::prepareForDraw(layerSharedValues());
// FIXME: These calls can be made once, when the compositor context is initialized.
- GLC(glDisable(GL_DEPTH_TEST));
- GLC(glDisable(GL_CULL_FACE));
- GLC(glDepthFunc(GL_LEQUAL));
- GLC(glClearStencil(0));
+ GLC(m_context, m_context->disable(GraphicsContext3D::DEPTH_TEST));
+ GLC(m_context, m_context->disable(GraphicsContext3D::CULL_FACE));
+ GLC(m_context, m_context->depthFunc(GraphicsContext3D::LEQUAL));
+ GLC(m_context, m_context->clearStencil(0));
if (m_scrollPosition == IntPoint(-1, -1))
m_scrollPosition = scrollPosition;
IntPoint scrollDelta = toPoint(scrollPosition - m_scrollPosition);
- // Scroll only when the updateRect contains pixels for the newly uncovered region to avoid flashing.
- if ((scrollDelta.x() && updateRect.width() >= abs(scrollDelta.x()) && updateRect.height() >= contentRect.height())
- || (scrollDelta.y() && updateRect.height() >= abs(scrollDelta.y()) && updateRect.width() >= contentRect.width())) {
+ // Scroll the backbuffer
+ if (scrollDelta.x() || scrollDelta.y()) {
// Scrolling works as follows: We render a quad with the current root layer contents
// translated by the amount the page has scrolled since the last update and then read the
// pixels of the content area (visible area excluding the scroll bars) back into the
- // root layer texture. The newly exposed area is subesquently filled as usual with
- // the contents of the updateRect.
+ // root layer texture. The newly exposed area will be filled by a subsequent drawLayersIntoRect call
TransformationMatrix scrolledLayerMatrix;
-#if PLATFORM(SKIA)
- float scaleFactor = 1.0f;
-#elif PLATFORM(CG)
- // Because the contents of the OpenGL texture are inverted
- // vertically compared to the Skia backend, we need to move
- // the backing store in the opposite direction.
- float scaleFactor = -1.0f;
-#else
-#error "Need to implement for your platform."
-#endif
scrolledLayerMatrix.translate3d(0.5 * visibleRect.width() - scrollDelta.x(),
- 0.5 * visibleRect.height() + scaleFactor * scrollDelta.y(), 0);
+ 0.5 * visibleRect.height() + scrollDelta.y(), 0);
scrolledLayerMatrix.scale3d(1, -1, 1);
useShader(m_scrollShaderProgram);
- GLC(glUniform1i(m_scrollShaderSamplerLocation, 0));
- LayerChromium::drawTexturedQuad(m_projectionMatrix, scrolledLayerMatrix,
+ GLC(m_context, m_context->uniform1i(m_scrollShaderSamplerLocation, 0));
+ LayerChromium::drawTexturedQuad(m_context.get(), m_projectionMatrix, scrolledLayerMatrix,
visibleRect.width(), visibleRect.height(), 1,
m_scrollShaderMatrixLocation, -1);
- GLC(glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, contentRect.width(), contentRect.height()));
+ GLC(m_context, m_context->copyTexSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, 0, 0, 0, 0, contentRect.width(), contentRect.height()));
m_scrollPosition = scrollPosition;
} else if (abs(scrollDelta.y()) > contentRect.height() || abs(scrollDelta.x()) > contentRect.width()) {
// Scrolling larger than the contentRect size does not preserve any of the pixels, so there is
@@ -235,64 +228,83 @@ void LayerRendererChromium::drawLayers(const IntRect& updateRect, const IntRect&
m_scrollPosition = scrollPosition;
}
- // FIXME: The following check should go away when the compositor renders independently from its own thread.
- // Ignore a 1x1 update rect at (0, 0) as that's used a way to kick off a redraw for the compositor.
- if (!(!updateRect.x() && !updateRect.y() && updateRect.width() == 1 && updateRect.height() == 1)) {
- // Update the root layer texture.
- ASSERT((updateRect.x() + updateRect.width() <= m_rootLayerTextureWidth)
- && (updateRect.y() + updateRect.height() <= m_rootLayerTextureHeight));
+ // Translate all the composited layers by the scroll position.
+ TransformationMatrix matrix;
+ matrix.translate3d(-m_scrollPosition.x(), -m_scrollPosition.y(), 0);
+
+ // Traverse the layer tree and update the layer transforms.
+ float opacity = 1;
+ const Vector<RefPtr<LayerChromium> >& sublayers = m_rootLayer->getSublayers();
+ size_t i;
+ for (i = 0; i < sublayers.size(); i++)
+ updateLayersRecursive(sublayers[i].get(), matrix, opacity);
+}
+
+void LayerRendererChromium::updateRootLayerTextureRect(const IntRect& updateRect)
+{
+ ASSERT(m_hardwareCompositing);
+
+ if (!m_rootLayer)
+ return;
+
+ GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_rootLayerTextureId));
+
+ // Update the root layer texture.
+ ASSERT((updateRect.right() <= m_rootLayerTextureWidth)
+ && (updateRect.bottom() <= m_rootLayerTextureHeight));
#if PLATFORM(SKIA)
- // Get the contents of the updated rect.
- const SkBitmap bitmap = m_rootLayerCanvas->getDevice()->accessBitmap(false);
- int rootLayerWidth = bitmap.width();
- int rootLayerHeight = bitmap.height();
- ASSERT(rootLayerWidth == updateRect.width() && rootLayerHeight == updateRect.height());
- void* pixels = bitmap.getPixels();
-
- // Copy the contents of the updated rect to the root layer texture.
- GLC(glTexSubImage2D(GL_TEXTURE_2D, 0, updateRect.x(), updateRect.y(), updateRect.width(), updateRect.height(), GL_RGBA, GL_UNSIGNED_BYTE, pixels));
+ // Get the contents of the updated rect.
+ const SkBitmap bitmap = m_rootLayerCanvas->getDevice()->accessBitmap(false);
+ int bitmapWidth = bitmap.width();
+ int bitmapHeight = bitmap.height();
+ ASSERT(bitmapWidth == updateRect.width() && bitmapHeight == updateRect.height());
+ void* pixels = bitmap.getPixels();
#elif PLATFORM(CG)
- // Get the contents of the updated rect.
- ASSERT(static_cast<int>(CGBitmapContextGetWidth(m_rootLayerCGContext.get())) == updateRect.width() && static_cast<int>(CGBitmapContextGetHeight(m_rootLayerCGContext.get())) == updateRect.height());
- void* pixels = m_rootLayerBackingStore.data();
-
- // Copy the contents of the updated rect to the root layer texture.
- // The origin is at the lower left in Core Graphics' coordinate system. We need to correct for this here.
- GLC(glTexSubImage2D(GL_TEXTURE_2D, 0,
- updateRect.x(), m_rootLayerTextureHeight - updateRect.y() - updateRect.height(),
- updateRect.width(), updateRect.height(),
- GL_RGBA, GL_UNSIGNED_BYTE, pixels));
+ // Get the contents of the updated rect.
+ ASSERT(static_cast<int>(CGBitmapContextGetWidth(m_rootLayerCGContext.get())) == updateRect.width() && static_cast<int>(CGBitmapContextGetHeight(m_rootLayerCGContext.get())) == updateRect.height());
+ void* pixels = m_rootLayerBackingStore.data();
#else
#error "Need to implement for your platform."
#endif
- }
+ // Copy the contents of the updated rect to the root layer texture.
+ GLC(m_context, m_context->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, updateRect.x(), updateRect.y(), updateRect.width(), updateRect.height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels));
+}
+
+void LayerRendererChromium::drawLayers(const IntRect& visibleRect, const IntRect& contentRect)
+{
+ ASSERT(m_hardwareCompositing);
- glClearColor(0, 0, 1, 1);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ m_context->clearColor(0, 0, 1, 1);
+ m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT | GraphicsContext3D::DEPTH_BUFFER_BIT);
+
+ GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_rootLayerTextureId));
// Render the root layer using a quad that takes up the entire visible area of the window.
// We reuse the shader program used by ContentLayerChromium.
const ContentLayerChromium::SharedValues* contentLayerValues = contentLayerSharedValues();
useShader(contentLayerValues->contentShaderProgram());
- GLC(glUniform1i(contentLayerValues->shaderSamplerLocation(), 0));
+ GLC(m_context, m_context->uniform1i(contentLayerValues->shaderSamplerLocation(), 0));
TransformationMatrix layerMatrix;
layerMatrix.translate3d(visibleRect.width() * 0.5f, visibleRect.height() * 0.5f, 0);
- LayerChromium::drawTexturedQuad(m_projectionMatrix, layerMatrix,
+ LayerChromium::drawTexturedQuad(m_context.get(), m_projectionMatrix, layerMatrix,
visibleRect.width(), visibleRect.height(), 1,
contentLayerValues->shaderMatrixLocation(), contentLayerValues->shaderAlphaLocation());
// If culling is enabled then we will cull the backface.
- GLC(glCullFace(GL_BACK));
+ GLC(m_context, m_context->cullFace(GraphicsContext3D::BACK));
// The orthographic projection is setup such that Y starts at zero and
// increases going down the page so we need to adjust the winding order of
// front facing triangles.
- GLC(glFrontFace(GL_CW));
+ GLC(m_context, m_context->frontFace(GraphicsContext3D::CW));
// The shader used to render layers returns pre-multiplied alpha colors
// so we need to send the blending mode appropriately.
- GLC(glEnable(GL_BLEND));
- GLC(glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA));
+ GLC(m_context, m_context->enable(GraphicsContext3D::BLEND));
+ GLC(m_context, m_context->blendFunc(GraphicsContext3D::ONE, GraphicsContext3D::ONE_MINUS_SRC_ALPHA));
+
+ // Set the rootVisibleRect --- used by subsequent drawLayers calls
+ m_rootVisibleRect = visibleRect;
// Translate all the composited layers by the scroll position.
TransformationMatrix matrix;
@@ -305,43 +317,67 @@ void LayerRendererChromium::drawLayers(const IntRect& updateRect, const IntRect&
for (i = 0; i < sublayers.size(); i++)
updateLayersRecursive(sublayers[i].get(), matrix, opacity);
- m_rootVisibleRect = visibleRect;
-
// Enable scissoring to avoid rendering composited layers over the scrollbars.
- GLC(glEnable(GL_SCISSOR_TEST));
+ GLC(m_context, m_context->enable(GraphicsContext3D::SCISSOR_TEST));
FloatRect scissorRect(contentRect);
+
// The scissorRect should not include the scroll offset.
scissorRect.move(-m_scrollPosition.x(), -m_scrollPosition.y());
scissorToRect(scissorRect);
// Clear the stencil buffer to 0.
- GLC(glClear(GL_STENCIL_BUFFER_BIT));
+ GLC(m_context, m_context->clear(GraphicsContext3D::STENCIL_BUFFER_BIT));
// Disable writes to the stencil buffer.
- GLC(glStencilMask(0));
+ GLC(m_context, m_context->stencilMask(0));
// Traverse the layer tree one more time to draw the layers.
- for (i = 0; i < sublayers.size(); i++)
+ for (size_t i = 0; i < sublayers.size(); i++)
drawLayersRecursive(sublayers[i].get(), scissorRect);
- GLC(glDisable(GL_SCISSOR_TEST));
+ GLC(m_context, m_context->disable(GraphicsContext3D::SCISSOR_TEST));
+}
- m_gles2Context->swapBuffers();
+void LayerRendererChromium::finish()
+{
+ m_context->finish();
+}
+void LayerRendererChromium::present()
+{
+ // We're done! Time to swapbuffers!
+
+ // Note that currently this has the same effect as swapBuffers; we should
+ // consider exposing a different entry point on GraphicsContext3D.
+ m_context->prepareTexture();
m_needsDisplay = false;
}
+void LayerRendererChromium::getFramebufferPixels(void *pixels, const IntRect& rect)
+{
+ ASSERT(rect.right() <= rootLayerTextureSize().width()
+ && rect.bottom() <= rootLayerTextureSize().height());
+
+ if (!pixels)
+ return;
+
+ makeContextCurrent();
+
+ GLC(m_context, m_context->readPixels(rect.x(), rect.y(), rect.width(), rect.height(),
+ GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels));
+}
+
// FIXME: This method should eventually be replaced by a proper texture manager.
unsigned LayerRendererChromium::createLayerTexture()
{
- GLuint textureId = 0;
- GLC(glGenTextures(1, &textureId));
- GLC(glBindTexture(GL_TEXTURE_2D, textureId));
+ unsigned textureId = 0;
+ GLC(m_context, textureId = m_context->createTexture());
+ GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId));
// Do basic linear filtering on resize.
- GLC(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
- GLC(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
- // NPOT textures in GL ES only work when the wrap mode is set to GL_CLAMP_TO_EDGE.
- GLC(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
- GLC(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR));
+ // NPOT textures in GL ES only work when the wrap mode is set to GraphicsContext3D::CLAMP_TO_EDGE.
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE));
return textureId;
}
@@ -440,18 +476,18 @@ void LayerRendererChromium::drawLayerIntoStencilBuffer(LayerChromium* layer, boo
{
// Enable writes to the stencil buffer and increment the stencil values
// by one for every pixel under the current layer.
- GLC(glStencilMask(0xff));
- GLC(glStencilFunc(GL_ALWAYS, 1, 0xff));
- GLenum stencilOp = (decrement ? GL_DECR : GL_INCR);
- GLC(glStencilOp(stencilOp, stencilOp, stencilOp));
+ GLC(m_context, m_context->stencilMask(0xff));
+ GLC(m_context, m_context->stencilFunc(GraphicsContext3D::ALWAYS, 1, 0xff));
+ unsigned stencilOp = (decrement ? GraphicsContext3D::DECR : GraphicsContext3D::INCR);
+ GLC(m_context, m_context->stencilOp(stencilOp, stencilOp, stencilOp));
- GLC(glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE));
+ GLC(m_context, m_context->colorMask(false, false, false, false));
layer->drawAsMask();
// Disable writes to the stencil buffer.
- GLC(glStencilMask(0));
- GLC(glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE));
+ GLC(m_context, m_context->stencilMask(0));
+ GLC(m_context, m_context->colorMask(true, true, true, true));
}
// Recursively walk the layer tree and draw the layers.
@@ -468,7 +504,7 @@ void LayerRendererChromium::drawLayersRecursive(LayerChromium* layer, const Floa
bool mustClearDepth = false;
if (layer->preserves3D()) {
if (!depthTestEnabledForSubtree) {
- GLC(glEnable(GL_DEPTH_TEST));
+ GLC(m_context, m_context->enable(GraphicsContext3D::DEPTH_TEST));
depthTestEnabledForSubtree = true;
// Need to clear the depth buffer when we're done rendering this subtree.
@@ -505,7 +541,7 @@ void LayerRendererChromium::drawLayersRecursive(LayerChromium* layer, const Floa
// is rendered, the stencil values should be all back to zero. An 8 bit stencil buffer
// will allow us up to 255 nested clipping layers which is hopefully enough.
if (!currentStencilValue)
- GLC(glEnable(GL_STENCIL_TEST));
+ GLC(m_context, m_context->enable(GraphicsContext3D::STENCIL_TEST));
drawLayerIntoStencilBuffer(layer, false);
@@ -517,7 +553,7 @@ void LayerRendererChromium::drawLayersRecursive(LayerChromium* layer, const Floa
// currentStencilValue.
if (didStencilDraw) {
// The sublayers will render only if the stencil test passes.
- GLC(glStencilFunc(GL_EQUAL, currentStencilValue, 0xff));
+ GLC(m_context, m_context->stencilFunc(GraphicsContext3D::EQUAL, currentStencilValue, 0xff));
}
// If we're using depth testing then we need to sort the children in Z to
@@ -548,8 +584,8 @@ void LayerRendererChromium::drawLayersRecursive(LayerChromium* layer, const Floa
currentStencilValue--;
if (!currentStencilValue) {
// Disable stencil testing.
- GLC(glDisable(GL_STENCIL_TEST));
- GLC(glStencilFunc(GL_ALWAYS, 0, 0xff));
+ GLC(m_context, m_context->disable(GraphicsContext3D::STENCIL_TEST));
+ GLC(m_context, m_context->stencilFunc(GraphicsContext3D::ALWAYS, 0, 0xff));
}
}
@@ -558,8 +594,8 @@ void LayerRendererChromium::drawLayersRecursive(LayerChromium* layer, const Floa
}
if (mustClearDepth) {
- GLC(glDisable(GL_DEPTH_TEST));
- GLC(glClear(GL_DEPTH_BUFFER_BIT));
+ GLC(m_context, m_context->disable(GraphicsContext3D::DEPTH_TEST));
+ GLC(m_context, m_context->clear(GraphicsContext3D::DEPTH_BUFFER_BIT));
depthTestEnabledForSubtree = false;
}
}
@@ -573,13 +609,13 @@ void LayerRendererChromium::drawLayer(LayerChromium* layer)
if (layer->contentsDirty()) {
// Update the backing texture contents for any dirty portion of the layer.
layer->updateContents();
- m_gles2Context->makeCurrent();
+ m_context->makeContextCurrent();
}
if (layer->doubleSided())
- glDisable(GL_CULL_FACE);
+ m_context->disable(GraphicsContext3D::CULL_FACE);
else
- glEnable(GL_CULL_FACE);
+ m_context->enable(GraphicsContext3D::CULL_FACE);
layer->draw();
}
@@ -594,12 +630,13 @@ void LayerRendererChromium::scissorToRect(const FloatRect& scissorRect)
{
// Compute the lower left corner of the scissor rect.
float bottom = std::max((float)m_rootVisibleRect.height() - scissorRect.bottom(), 0.f);
- GLC(glScissor(scissorRect.x(), bottom, scissorRect.width(), scissorRect.height()));
+ GLC(m_context, m_context->scissor(scissorRect.x(), bottom, scissorRect.width(), scissorRect.height()));
}
bool LayerRendererChromium::makeContextCurrent()
{
- return m_gles2Context->makeCurrent();
+ m_context->makeContextCurrent();
+ return true;
}
// Checks whether a given size is within the maximum allowed texture size range.
@@ -610,6 +647,12 @@ bool LayerRendererChromium::checkTextureSize(const IntSize& textureSize)
return true;
}
+void LayerRendererChromium::resizeOnscreenContent(const IntSize& size)
+{
+ if (m_context)
+ m_context->reshape(size.width(), size.height());
+}
+
bool LayerRendererChromium::initializeSharedObjects()
{
makeContextCurrent();
@@ -637,15 +680,15 @@ bool LayerRendererChromium::initializeSharedObjects()
" gl_FragColor = vec4(texColor.x, texColor.y, texColor.z, texColor.w); \n"
"} \n";
- m_scrollShaderProgram = LayerChromium::createShaderProgram(scrollVertexShaderString, scrollFragmentShaderString);
+ m_scrollShaderProgram = LayerChromium::createShaderProgram(m_context.get(), scrollVertexShaderString, scrollFragmentShaderString);
if (!m_scrollShaderProgram) {
LOG_ERROR("LayerRendererChromium: Failed to create scroll shader program");
cleanupSharedObjects();
return false;
}
- GLC(m_scrollShaderSamplerLocation = glGetUniformLocation(m_scrollShaderProgram, "s_texture"));
- GLC(m_scrollShaderMatrixLocation = glGetUniformLocation(m_scrollShaderProgram, "matrix"));
+ GLC(m_context, m_scrollShaderSamplerLocation = m_context->getUniformLocation(m_scrollShaderProgram, "s_texture"));
+ GLC(m_context, m_scrollShaderMatrixLocation = m_context->getUniformLocation(m_scrollShaderProgram, "matrix"));
if (m_scrollShaderSamplerLocation == -1 || m_scrollShaderMatrixLocation == -1) {
LOG_ERROR("Failed to initialize scroll shader.");
cleanupSharedObjects();
@@ -661,19 +704,19 @@ bool LayerRendererChromium::initializeSharedObjects()
}
// Turn off filtering for the root layer to avoid blurring from the repeated
// writes and reads to the framebuffer that happen while scrolling.
- GLC(glBindTexture(GL_TEXTURE_2D, m_rootLayerTextureId));
- GLC(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST));
- GLC(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST));
+ GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_rootLayerTextureId));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::NEAREST));
+ GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::NEAREST));
// Get the max texture size supported by the system.
- GLC(glGetIntegerv(GL_MAX_TEXTURE_SIZE, &m_maxTextureSize));
+ GLC(m_context, m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &m_maxTextureSize));
// Get the number of bits available in the stencil buffer.
- GLC(glGetIntegerv(GL_STENCIL_BITS, &m_numStencilBits));
+ GLC(m_context, m_context->getIntegerv(GraphicsContext3D::STENCIL_BITS, &m_numStencilBits));
- m_layerSharedValues = adoptPtr(new LayerChromium::SharedValues());
- m_contentLayerSharedValues = adoptPtr(new ContentLayerChromium::SharedValues());
- m_canvasLayerSharedValues = adoptPtr(new CanvasLayerChromium::SharedValues());
+ m_layerSharedValues = adoptPtr(new LayerChromium::SharedValues(m_context.get()));
+ m_contentLayerSharedValues = adoptPtr(new ContentLayerChromium::SharedValues(m_context.get()));
+ m_canvasLayerSharedValues = adoptPtr(new CanvasLayerChromium::SharedValues(m_context.get()));
if (!m_layerSharedValues->initialized() || !m_contentLayerSharedValues->initialized() || !m_canvasLayerSharedValues->initialized()) {
cleanupSharedObjects();
return false;
@@ -691,12 +734,12 @@ void LayerRendererChromium::cleanupSharedObjects()
m_canvasLayerSharedValues.clear();
if (m_scrollShaderProgram) {
- GLC(glDeleteProgram(m_scrollShaderProgram));
+ GLC(m_context, m_context->deleteProgram(m_scrollShaderProgram));
m_scrollShaderProgram = 0;
}
if (m_rootLayerTextureId) {
- GLC(glDeleteTextures(1, &m_rootLayerTextureId));
+ GLC(m_context, m_context->deleteTexture(m_rootLayerTextureId));
m_rootLayerTextureId = 0;
}
}
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
index 8f44afe..c733228 100644
--- a/WebCore/platform/graphics/chromium/LayerRendererChromium.h
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
@@ -51,19 +51,32 @@
namespace WebCore {
-class GLES2Context;
+class GraphicsContext3D;
// Class that handles drawing of composited render layers using GL.
class LayerRendererChromium : public Noncopyable {
public:
- static PassOwnPtr<LayerRendererChromium> create(PassOwnPtr<GLES2Context> gles2Context);
+ static PassOwnPtr<LayerRendererChromium> create(PassOwnPtr<GraphicsContext3D> graphicsContext3D);
- LayerRendererChromium(PassOwnPtr<GLES2Context> gles2Context);
+ LayerRendererChromium(PassOwnPtr<GraphicsContext3D> graphicsContext3D);
~LayerRendererChromium();
- // Updates the contents of the root layer that fall inside the updateRect and recomposites
- // all the layers.
- void drawLayers(const IntRect& updateRect, const IntRect& visibleRect, const IntRect& contentRect, const IntPoint& scrollPosition);
+ GraphicsContext3D* context();
+
+ // updates size of root texture, if needed, and scrolls the backbuffer.
+ void prepareToDrawLayers(const IntRect& visibleRect, const IntRect& contentRect, const IntPoint& scrollPosition);
+
+ // updates a rectangle within the root layer texture
+ void updateRootLayerTextureRect(const IntRect& updateRect);
+
+ // draws the current layers onto the backbuffer
+ void drawLayers(const IntRect& visibleRect, const IntRect& contentRect);
+
+ // waits for rendering to finish
+ void finish();
+
+ // puts backbuffer onscreen
+ void present();
void setRootLayer(PassRefPtr<LayerChromium> layer) { m_rootLayer = layer; }
LayerChromium* rootLayer() { return m_rootLayer.get(); }
@@ -78,7 +91,7 @@ public:
unsigned createLayerTexture();
- static void debugGLCall(const char* command, const char* file, int line);
+ static void debugGLCall(GraphicsContext3D*, const char* command, const char* file, int line);
const TransformationMatrix& projectionMatrix() const { return m_projectionMatrix; }
@@ -90,6 +103,11 @@ public:
const ContentLayerChromium::SharedValues* contentLayerSharedValues() const { return m_contentLayerSharedValues.get(); }
const CanvasLayerChromium::SharedValues* canvasLayerSharedValues() const { return m_canvasLayerSharedValues.get(); }
+ void resizeOnscreenContent(const IntSize&);
+
+ IntSize rootLayerTextureSize() const { return IntSize(m_rootLayerTextureWidth, m_rootLayerTextureHeight); }
+ void getFramebufferPixels(void *pixels, const IntRect& rect);
+
private:
void updateLayersRecursive(LayerChromium* layer, const TransformationMatrix& parentMatrix, float opacity);
@@ -153,7 +171,7 @@ private:
OwnPtr<ContentLayerChromium::SharedValues> m_contentLayerSharedValues;
OwnPtr<CanvasLayerChromium::SharedValues> m_canvasLayerSharedValues;
- OwnPtr<GLES2Context> m_gles2Context;
+ OwnPtr<GraphicsContext3D> m_context;
};
// Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL
@@ -162,9 +180,9 @@ private:
#define DEBUG_GL_CALLS 0
#if DEBUG_GL_CALLS && !defined ( NDEBUG )
-#define GLC(x) { (x), LayerRendererChromium::debugGLCall(#x, __FILE__, __LINE__); }
+#define GLC(context, x) { (x), LayerRendererChromium::debugGLCall(context, #x, __FILE__, __LINE__); }
#else
-#define GLC(x) (x)
+#define GLC(context, x) (x)
#endif
diff --git a/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp b/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
index c0da285..0fb1bb4 100644
--- a/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
@@ -33,14 +33,11 @@
#if USE(ACCELERATED_COMPOSITING)
#include "VideoLayerChromium.h"
+#include "GraphicsContext3D.h"
#include "LayerRendererChromium.h"
#include "RenderLayerBacking.h"
#include "skia/ext/platform_canvas.h"
-#include <GLES2/gl2.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GLES2/gl2ext.h>
-
#if PLATFORM(SKIA)
#include "NativeImageSkia.h"
#include "PlatformContextSkia.h"
@@ -153,9 +150,10 @@ void VideoLayerChromium::createTextureRect(const IntSize& requiredTextureSize, c
if (!pixels)
return;
- glBindTexture(GL_TEXTURE_2D, textureId);
+ GraphicsContext3D* context = layerRendererContext();
+ context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId);
ASSERT(bitmapSize == requiredTextureSize);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, requiredTextureSize.width(), requiredTextureSize.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+ context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, requiredTextureSize.width(), requiredTextureSize.height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels);
m_contentsTexture = textureId;
m_allocatedTextureSize = requiredTextureSize;
@@ -174,11 +172,13 @@ void VideoLayerChromium::updateTextureRect(const IntRect& updateRect, unsigned t
SkBitmap::Config skiaConfig = skiaBitmap->config();
if (skiaConfig == SkBitmap::kARGB_8888_Config) {
- glBindTexture(GL_TEXTURE_2D, textureId);
- void* mem = glMapTexSubImage2D(GL_TEXTURE_2D, 0, updateRect.x(), updateRect.y(), updateRect.width(), updateRect.height(), GL_RGBA, GL_UNSIGNED_BYTE, GL_WRITE_ONLY);
+ GraphicsContext3D* context = layerRendererContext();
+ context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId);
+ ASSERT(context->supportsMapSubCHROMIUM());
+ void* mem = context->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, updateRect.x(), updateRect.y(), updateRect.width(), updateRect.height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, GraphicsContext3D::WRITE_ONLY);
skiaBitmap->setPixels(mem);
m_owner->paintGraphicsLayerContents(*m_graphicsContext, updateRect);
- glUnmapTexSubImage2D(mem);
+ context->unmapTexSubImage2DCHROMIUM(mem);
}
updateCompleted();
diff --git a/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp b/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
index 411f416..2055ae6 100644
--- a/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
@@ -36,7 +36,6 @@
#include "GraphicsContext3D.h"
#include "LayerRendererChromium.h"
-#include <GLES2/gl2.h>
namespace WebCore {
@@ -53,15 +52,16 @@ WebGLLayerChromium::WebGLLayerChromium(GraphicsLayerChromium* owner)
void WebGLLayerChromium::updateContents()
{
+ GraphicsContext3D* rendererContext = layerRendererContext();
ASSERT(m_context);
if (m_textureChanged) {
- glBindTexture(GL_TEXTURE_2D, m_textureId);
+ rendererContext->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textureId);
// Set the min-mag filters to linear and wrap modes to GL_CLAMP_TO_EDGE
// to get around NPOT texture limitations of GLES.
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ rendererContext->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
+ rendererContext->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
+ rendererContext->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
+ rendererContext->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
m_textureChanged = false;
}
// Update the contents of the texture used by the compositor.
diff --git a/WebCore/platform/graphics/filters/FEBlend.cpp b/WebCore/platform/graphics/filters/FEBlend.cpp
index 99c0ae7..acd6545 100644
--- a/WebCore/platform/graphics/filters/FEBlend.cpp
+++ b/WebCore/platform/graphics/filters/FEBlend.cpp
@@ -35,27 +35,15 @@ typedef unsigned char (*BlendType)(unsigned char colorA, unsigned char colorB, u
namespace WebCore {
-FEBlend::FEBlend(FilterEffect* in, FilterEffect* in2, BlendModeType mode)
+FEBlend::FEBlend(BlendModeType mode)
: FilterEffect()
- , m_in(in)
- , m_in2(in2)
, m_mode(mode)
{
}
-PassRefPtr<FEBlend> FEBlend::create(FilterEffect* in, FilterEffect* in2, BlendModeType mode)
+PassRefPtr<FEBlend> FEBlend::create(BlendModeType mode)
{
- return adoptRef(new FEBlend(in, in2, mode));
-}
-
-FilterEffect* FEBlend::in2() const
-{
- return m_in2.get();
-}
-
-void FEBlend::setIn2(FilterEffect* in2)
-{
- m_in2 = in2;
+ return adoptRef(new FEBlend(mode));
}
BlendModeType FEBlend::blendMode() const
@@ -100,9 +88,11 @@ static unsigned char lighten(unsigned char colorA, unsigned char colorB, unsigne
void FEBlend::apply(Filter* filter)
{
- m_in->apply(filter);
- m_in2->apply(filter);
- if (!m_in->resultImage() || !m_in2->resultImage())
+ FilterEffect* in = inputEffect(0);
+ FilterEffect* in2 = inputEffect(1);
+ in->apply(filter);
+ in2->apply(filter);
+ if (!in->resultImage() || !in2->resultImage())
return;
if (m_mode == FEBLEND_MODE_UNKNOWN)
@@ -111,11 +101,11 @@ void FEBlend::apply(Filter* filter)
if (!getEffectContext())
return;
- IntRect effectADrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion());
- RefPtr<CanvasPixelArray> srcPixelArrayA(m_in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
+ IntRect effectADrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
- IntRect effectBDrawingRect = calculateDrawingIntRect(m_in2->scaledSubRegion());
- RefPtr<CanvasPixelArray> srcPixelArrayB(m_in2->resultImage()->getPremultipliedImageData(effectBDrawingRect)->data());
+ IntRect effectBDrawingRect = calculateDrawingIntRect(in2->repaintRectInLocalCoordinates());
+ RefPtr<CanvasPixelArray> srcPixelArrayB(in2->resultImage()->getPremultipliedImageData(effectBDrawingRect)->data());
IntRect imageRect(IntPoint(), resultImage()->size());
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
@@ -176,8 +166,8 @@ TextStream& FEBlend::externalRepresentation(TextStream& ts, int indent) const
ts << "[feBlend";
FilterEffect::externalRepresentation(ts);
ts << " mode=\"" << m_mode << "\"]\n";
- m_in->externalRepresentation(ts, indent + 1);
- m_in2->externalRepresentation(ts, indent + 1);
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
+ inputEffect(1)->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/platform/graphics/filters/FEBlend.h b/WebCore/platform/graphics/filters/FEBlend.h
index 52de647..2e67588 100644
--- a/WebCore/platform/graphics/filters/FEBlend.h
+++ b/WebCore/platform/graphics/filters/FEBlend.h
@@ -40,24 +40,18 @@ namespace WebCore {
class FEBlend : public FilterEffect {
public:
- static PassRefPtr<FEBlend> create(FilterEffect*, FilterEffect*, BlendModeType);
-
- FilterEffect* in2() const;
- void setIn2(FilterEffect*);
+ static PassRefPtr<FEBlend> create(BlendModeType);
BlendModeType blendMode() const;
void setBlendMode(BlendModeType);
- virtual FloatRect uniteChildEffectSubregions(Filter* filter) { return calculateUnionOfChildEffectSubregions(filter, m_in.get(), m_in2.get()); }
void apply(Filter*);
void dump();
TextStream& externalRepresentation(TextStream&, int indent) const;
private:
- FEBlend(FilterEffect*, FilterEffect*, BlendModeType);
+ FEBlend(BlendModeType);
- RefPtr<FilterEffect> m_in;
- RefPtr<FilterEffect> m_in2;
BlendModeType m_mode;
};
diff --git a/WebCore/platform/graphics/filters/FEColorMatrix.cpp b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
index 7718066..1d9c66b 100644
--- a/WebCore/platform/graphics/filters/FEColorMatrix.cpp
+++ b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
@@ -34,17 +34,16 @@
namespace WebCore {
-FEColorMatrix::FEColorMatrix(FilterEffect* in, ColorMatrixType type, const Vector<float>& values)
+FEColorMatrix::FEColorMatrix(ColorMatrixType type, const Vector<float>& values)
: FilterEffect()
- , m_in(in)
, m_type(type)
, m_values(values)
{
}
-PassRefPtr<FEColorMatrix> FEColorMatrix::create(FilterEffect* in, ColorMatrixType type, const Vector<float>& values)
+PassRefPtr<FEColorMatrix> FEColorMatrix::create(ColorMatrixType type, const Vector<float>& values)
{
- return adoptRef(new FEColorMatrix(in, type, values));
+ return adoptRef(new FEColorMatrix(type, values));
}
ColorMatrixType FEColorMatrix::type() const
@@ -156,15 +155,16 @@ void effectType(const PassRefPtr<CanvasPixelArray>& srcPixelArray, PassRefPtr<Im
void FEColorMatrix::apply(Filter* filter)
{
- m_in->apply(filter);
- if (!m_in->resultImage())
+ FilterEffect* in = inputEffect(0);
+ in->apply(filter);
+ if (!in->resultImage())
return;
GraphicsContext* filterContext = getEffectContext();
if (!filterContext)
return;
- filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
IntRect imageRect(IntPoint(), resultImage()->size());
PassRefPtr<ImageData> imageData(resultImage()->getUnmultipliedImageData(imageRect));
@@ -236,7 +236,7 @@ TextStream& FEColorMatrix::externalRepresentation(TextStream& ts, int indent) co
ts << "\"";
}
ts << "]\n";
- m_in->externalRepresentation(ts, indent + 1);
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/platform/graphics/filters/FEColorMatrix.h b/WebCore/platform/graphics/filters/FEColorMatrix.h
index 906d0f1..9b9084c 100644
--- a/WebCore/platform/graphics/filters/FEColorMatrix.h
+++ b/WebCore/platform/graphics/filters/FEColorMatrix.h
@@ -40,7 +40,7 @@ namespace WebCore {
class FEColorMatrix : public FilterEffect {
public:
- static PassRefPtr<FEColorMatrix> create(FilterEffect*, ColorMatrixType, const Vector<float>&);
+ static PassRefPtr<FEColorMatrix> create(ColorMatrixType, const Vector<float>&);
ColorMatrixType type() const;
void setType(ColorMatrixType);
@@ -48,15 +48,13 @@ namespace WebCore {
const Vector<float>& values() const;
void setValues(const Vector<float>&);
- virtual FloatRect uniteChildEffectSubregions(Filter* filter) { return calculateUnionOfChildEffectSubregions(filter, m_in.get()); }
void apply(Filter*);
void dump();
TextStream& externalRepresentation(TextStream&, int indent) const;
private:
- FEColorMatrix(FilterEffect*, ColorMatrixType, const Vector<float>&);
+ FEColorMatrix(ColorMatrixType, const Vector<float>&);
- RefPtr<FilterEffect> m_in;
ColorMatrixType m_type;
Vector<float> m_values;
};
diff --git a/WebCore/platform/graphics/filters/FEComponentTransfer.cpp b/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
index 19df970..471fec8 100644
--- a/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
+++ b/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
@@ -36,10 +36,9 @@ namespace WebCore {
typedef void (*TransferType)(unsigned char*, const ComponentTransferFunction&);
-FEComponentTransfer::FEComponentTransfer(FilterEffect* in, const ComponentTransferFunction& redFunc,
+FEComponentTransfer::FEComponentTransfer(const ComponentTransferFunction& redFunc,
const ComponentTransferFunction& greenFunc, const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc)
: FilterEffect()
- , m_in(in)
, m_redFunc(redFunc)
, m_greenFunc(greenFunc)
, m_blueFunc(blueFunc)
@@ -47,10 +46,10 @@ FEComponentTransfer::FEComponentTransfer(FilterEffect* in, const ComponentTransf
{
}
-PassRefPtr<FEComponentTransfer> FEComponentTransfer::create(FilterEffect* in, const ComponentTransferFunction& redFunc,
+PassRefPtr<FEComponentTransfer> FEComponentTransfer::create(const ComponentTransferFunction& redFunc,
const ComponentTransferFunction& greenFunc, const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc)
{
- return adoptRef(new FEComponentTransfer(in, redFunc, greenFunc, blueFunc, alphaFunc));
+ return adoptRef(new FEComponentTransfer(redFunc, greenFunc, blueFunc, alphaFunc));
}
ComponentTransferFunction FEComponentTransfer::redFunction() const
@@ -150,8 +149,9 @@ static void gamma(unsigned char* values, const ComponentTransferFunction& transf
void FEComponentTransfer::apply(Filter* filter)
{
- m_in->apply(filter);
- if (!m_in->resultImage())
+ FilterEffect* in = inputEffect(0);
+ in->apply(filter);
+ if (!in->resultImage())
return;
if (!getEffectContext())
@@ -167,8 +167,8 @@ void FEComponentTransfer::apply(Filter* filter)
for (unsigned channel = 0; channel < 4; channel++)
(*callEffect[transferFunction[channel].type])(tables[channel], transferFunction[channel]);
- IntRect drawingRect = calculateDrawingIntRect(m_in->scaledSubRegion());
- RefPtr<ImageData> imageData(m_in->resultImage()->getUnmultipliedImageData(drawingRect));
+ IntRect drawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ RefPtr<ImageData> imageData(in->resultImage()->getUnmultipliedImageData(drawingRect));
CanvasPixelArray* srcPixelArray(imageData->data());
for (unsigned pixelOffset = 0; pixelOffset < srcPixelArray->length(); pixelOffset += 4) {
@@ -235,7 +235,7 @@ TextStream& FEComponentTransfer::externalRepresentation(TextStream& ts, int inde
ts << "{blue: " << m_blueFunc << "}\n";
writeIndent(ts, indent + 2);
ts << "{alpha: " << m_alphaFunc << "}]\n";
- m_in->externalRepresentation(ts, indent + 1);
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/platform/graphics/filters/FEComponentTransfer.h b/WebCore/platform/graphics/filters/FEComponentTransfer.h
index 834d9ee..55724db 100644
--- a/WebCore/platform/graphics/filters/FEComponentTransfer.h
+++ b/WebCore/platform/graphics/filters/FEComponentTransfer.h
@@ -63,7 +63,7 @@ namespace WebCore {
class FEComponentTransfer : public FilterEffect {
public:
- static PassRefPtr<FEComponentTransfer> create(FilterEffect*, const ComponentTransferFunction&,
+ static PassRefPtr<FEComponentTransfer> create(const ComponentTransferFunction&,
const ComponentTransferFunction&, const ComponentTransferFunction&, const ComponentTransferFunction&);
ComponentTransferFunction redFunction() const;
@@ -78,16 +78,14 @@ namespace WebCore {
ComponentTransferFunction alphaFunction() const;
void setAlphaFunction(const ComponentTransferFunction&);
- virtual FloatRect uniteChildEffectSubregions(Filter* filter) { return calculateUnionOfChildEffectSubregions(filter, m_in.get()); }
void apply(Filter*);
void dump();
TextStream& externalRepresentation(TextStream&, int indent) const;
private:
- FEComponentTransfer(FilterEffect*,const ComponentTransferFunction&, const ComponentTransferFunction&,
- const ComponentTransferFunction&, const ComponentTransferFunction&);
+ FEComponentTransfer(const ComponentTransferFunction&, const ComponentTransferFunction&,
+ const ComponentTransferFunction&, const ComponentTransferFunction&);
- RefPtr<FilterEffect> m_in;
ComponentTransferFunction m_redFunc;
ComponentTransferFunction m_greenFunc;
ComponentTransferFunction m_blueFunc;
diff --git a/WebCore/platform/graphics/filters/FEComposite.cpp b/WebCore/platform/graphics/filters/FEComposite.cpp
index d9f00ce..c10a0f2 100644
--- a/WebCore/platform/graphics/filters/FEComposite.cpp
+++ b/WebCore/platform/graphics/filters/FEComposite.cpp
@@ -32,11 +32,8 @@
namespace WebCore {
-FEComposite::FEComposite(FilterEffect* in, FilterEffect* in2, const CompositeOperationType& type,
- const float& k1, const float& k2, const float& k3, const float& k4)
+FEComposite::FEComposite(const CompositeOperationType& type, float k1, float k2, float k3, float k4)
: FilterEffect()
- , m_in(in)
- , m_in2(in2)
, m_type(type)
, m_k1(k1)
, m_k2(k2)
@@ -45,10 +42,9 @@ FEComposite::FEComposite(FilterEffect* in, FilterEffect* in2, const CompositeOpe
{
}
-PassRefPtr<FEComposite> FEComposite::create(FilterEffect* in, FilterEffect* in2, const CompositeOperationType& type,
- const float& k1, const float& k2, const float& k3, const float& k4)
+PassRefPtr<FEComposite> FEComposite::create(const CompositeOperationType& type, float k1, float k2, float k3, float k4)
{
- return adoptRef(new FEComposite(in, in2, type, k1, k2, k3, k4));
+ return adoptRef(new FEComposite(type, k1, k2, k3, k4));
}
CompositeOperationType FEComposite::operation() const
@@ -119,9 +115,11 @@ inline void arithmetic(const RefPtr<CanvasPixelArray>& srcPixelArrayA, CanvasPix
void FEComposite::apply(Filter* filter)
{
- m_in->apply(filter);
- m_in2->apply(filter);
- if (!m_in->resultImage() || !m_in2->resultImage())
+ FilterEffect* in = inputEffect(0);
+ FilterEffect* in2 = inputEffect(1);
+ in->apply(filter);
+ in2->apply(filter);
+ if (!in->resultImage() || !in2->resultImage())
return;
GraphicsContext* filterContext = getEffectContext();
@@ -131,33 +129,33 @@ void FEComposite::apply(Filter* filter)
FloatRect srcRect = FloatRect(0.f, 0.f, -1.f, -1.f);
switch (m_type) {
case FECOMPOSITE_OPERATOR_OVER:
- filterContext->drawImageBuffer(m_in2->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in2->scaledSubRegion()));
- filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()));
+ filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, calculateDrawingRect(in2->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
break;
case FECOMPOSITE_OPERATOR_IN:
filterContext->save();
- filterContext->clipToImageBuffer(m_in2->resultImage(), calculateDrawingRect(m_in2->scaledSubRegion()));
- filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()));
+ filterContext->clipToImageBuffer(in2->resultImage(), calculateDrawingRect(in2->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
filterContext->restore();
break;
case FECOMPOSITE_OPERATOR_OUT:
- filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()));
- filterContext->drawImageBuffer(m_in2->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in2->scaledSubRegion()), srcRect, CompositeDestinationOut);
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, calculateDrawingRect(in2->repaintRectInLocalCoordinates()), srcRect, CompositeDestinationOut);
break;
case FECOMPOSITE_OPERATOR_ATOP:
- filterContext->drawImageBuffer(m_in2->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in2->scaledSubRegion()));
- filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()), srcRect, CompositeSourceAtop);
+ filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, calculateDrawingRect(in2->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()), srcRect, CompositeSourceAtop);
break;
case FECOMPOSITE_OPERATOR_XOR:
- filterContext->drawImageBuffer(m_in2->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in2->scaledSubRegion()));
- filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()), srcRect, CompositeXOR);
+ filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, calculateDrawingRect(in2->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()), srcRect, CompositeXOR);
break;
case FECOMPOSITE_OPERATOR_ARITHMETIC: {
- IntRect effectADrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion());
- RefPtr<CanvasPixelArray> srcPixelArrayA(m_in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
+ IntRect effectADrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
- IntRect effectBDrawingRect = calculateDrawingIntRect(m_in2->scaledSubRegion());
- RefPtr<ImageData> imageData(m_in2->resultImage()->getPremultipliedImageData(effectBDrawingRect));
+ IntRect effectBDrawingRect = calculateDrawingIntRect(in2->repaintRectInLocalCoordinates());
+ RefPtr<ImageData> imageData(in2->resultImage()->getPremultipliedImageData(effectBDrawingRect));
CanvasPixelArray* srcPixelArrayB(imageData->data());
arithmetic(srcPixelArrayA, srcPixelArrayB, m_k1, m_k2, m_k3, m_k4);
@@ -210,8 +208,8 @@ TextStream& FEComposite::externalRepresentation(TextStream& ts, int indent) cons
if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC)
ts << " k1=\"" << m_k1 << "\" k2=\"" << m_k2 << "\" k3=\"" << m_k3 << "\" k4=\"" << m_k4 << "\"";
ts << "]\n";
- m_in->externalRepresentation(ts, indent + 1);
- m_in2->externalRepresentation(ts, indent + 1);
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
+ inputEffect(1)->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/platform/graphics/filters/FEComposite.h b/WebCore/platform/graphics/filters/FEComposite.h
index 11268c7..448d036 100644
--- a/WebCore/platform/graphics/filters/FEComposite.h
+++ b/WebCore/platform/graphics/filters/FEComposite.h
@@ -42,8 +42,7 @@ enum CompositeOperationType {
class FEComposite : public FilterEffect {
public:
- static PassRefPtr<FEComposite> create(FilterEffect*, FilterEffect*, const CompositeOperationType&,
- const float&, const float&, const float&, const float&);
+ static PassRefPtr<FEComposite> create(const CompositeOperationType&, float, float, float, float);
CompositeOperationType operation() const;
void setOperation(CompositeOperationType);
@@ -60,17 +59,13 @@ public:
float k4() const;
void setK4(float);
- virtual FloatRect uniteChildEffectSubregions(Filter* filter) { return calculateUnionOfChildEffectSubregions(filter, m_in.get(), m_in2.get()); }
void apply(Filter*);
void dump();
TextStream& externalRepresentation(TextStream&, int indent) const;
private:
- FEComposite(FilterEffect*, FilterEffect*, const CompositeOperationType&,
- const float&, const float&, const float&, const float&);
+ FEComposite(const CompositeOperationType&, float, float, float, float);
- RefPtr<FilterEffect> m_in;
- RefPtr<FilterEffect> m_in2;
CompositeOperationType m_type;
float m_k1;
float m_k2;
diff --git a/WebCore/platform/graphics/filters/FEGaussianBlur.cpp b/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
index 44bb65a..72a5a04 100644
--- a/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
+++ b/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
@@ -38,17 +38,16 @@ static const float gGaussianKernelFactor = (3 * sqrtf(2 * piFloat) / 4.f);
namespace WebCore {
-FEGaussianBlur::FEGaussianBlur(FilterEffect* in, const float& x, const float& y)
+FEGaussianBlur::FEGaussianBlur(float x, float y)
: FilterEffect()
- , m_in(in)
, m_stdX(x)
, m_stdY(y)
{
}
-PassRefPtr<FEGaussianBlur> FEGaussianBlur::create(FilterEffect* in, const float& x, const float& y)
+PassRefPtr<FEGaussianBlur> FEGaussianBlur::create(float x, float y)
{
- return adoptRef(new FEGaussianBlur(in, x, y));
+ return adoptRef(new FEGaussianBlur(x, y));
}
float FEGaussianBlur::stdDeviationX() const
@@ -128,17 +127,18 @@ void FEGaussianBlur::kernelPosition(int boxBlur, unsigned& std, int& dLeft, int&
void FEGaussianBlur::apply(Filter* filter)
{
- m_in->apply(filter);
- if (!m_in->resultImage())
+ FilterEffect* in = inputEffect(0);
+ in->apply(filter);
+ if (!in->resultImage())
return;
if (!getEffectContext())
return;
- setIsAlphaImage(m_in->isAlphaImage());
+ setIsAlphaImage(in->isAlphaImage());
- IntRect effectDrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion());
- RefPtr<ImageData> srcImageData(m_in->resultImage()->getPremultipliedImageData(effectDrawingRect));
+ IntRect effectDrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ RefPtr<ImageData> srcImageData(in->resultImage()->getPremultipliedImageData(effectDrawingRect));
IntRect imageRect(IntPoint(), resultImage()->size());
if (!m_stdX && !m_stdY) {
@@ -196,7 +196,7 @@ TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts, int indent) c
ts << "[feGaussianBlur";
FilterEffect::externalRepresentation(ts);
ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\"]\n";
- m_in->externalRepresentation(ts, indent + 1);
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/platform/graphics/filters/FEGaussianBlur.h b/WebCore/platform/graphics/filters/FEGaussianBlur.h
index ad5c5a3..63d763e 100644
--- a/WebCore/platform/graphics/filters/FEGaussianBlur.h
+++ b/WebCore/platform/graphics/filters/FEGaussianBlur.h
@@ -30,7 +30,7 @@ namespace WebCore {
class FEGaussianBlur : public FilterEffect {
public:
- static PassRefPtr<FEGaussianBlur> create(FilterEffect*, const float&, const float&);
+ static PassRefPtr<FEGaussianBlur> create(float, float);
float stdDeviationX() const;
void setStdDeviationX(float);
@@ -38,7 +38,6 @@ public:
float stdDeviationY() const;
void setStdDeviationY(float);
- virtual FloatRect uniteChildEffectSubregions(Filter* filter) { return calculateUnionOfChildEffectSubregions(filter, m_in.get()); }
void apply(Filter*);
void dump();
TextStream& externalRepresentation(TextStream&, int indent) const;
@@ -46,10 +45,9 @@ public:
static float calculateStdDeviation(float);
private:
- FEGaussianBlur(FilterEffect*, const float&, const float&);
+ FEGaussianBlur(float, float);
static void kernelPosition(int boxBlur, unsigned& std, int& dLeft, int& dRight);
- RefPtr<FilterEffect> m_in;
float m_stdX;
float m_stdY;
};
diff --git a/WebCore/platform/graphics/filters/Filter.h b/WebCore/platform/graphics/filters/Filter.h
index 16d499f..7ad25aa 100644
--- a/WebCore/platform/graphics/filters/Filter.h
+++ b/WebCore/platform/graphics/filters/Filter.h
@@ -48,7 +48,7 @@ namespace WebCore {
virtual FloatRect filterRegion() const = 0;
// SVG specific
- virtual void calculateEffectSubRegion(FilterEffect*) { }
+ virtual void determineFilterPrimitiveSubregion(FilterEffect*, const FloatRect&) { }
virtual FloatSize maxImageSize() const = 0;
virtual bool effectBoundingBoxMode() const = 0;
diff --git a/WebCore/platform/graphics/filters/FilterEffect.cpp b/WebCore/platform/graphics/filters/FilterEffect.cpp
index 4d7265c..b6278b2 100644
--- a/WebCore/platform/graphics/filters/FilterEffect.cpp
+++ b/WebCore/platform/graphics/filters/FilterEffect.cpp
@@ -1,21 +1,23 @@
/*
- Copyright (C) Alex Mathews <possessedpenguinbob@gmail.com>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#include "config.h"
@@ -25,11 +27,11 @@
namespace WebCore {
FilterEffect::FilterEffect()
- : m_hasX(false)
+ : m_alphaImage(false)
+ , m_hasX(false)
, m_hasY(false)
, m_hasWidth(false)
, m_hasHeight(false)
- , m_alphaImage(false)
{
}
@@ -37,43 +39,49 @@ FilterEffect::~FilterEffect()
{
}
-FloatRect FilterEffect::calculateUnionOfChildEffectSubregions(Filter* filter, FilterEffect* in)
-{
- return in->calculateEffectRect(filter);
-}
-
-FloatRect FilterEffect::calculateUnionOfChildEffectSubregions(Filter* filter, FilterEffect* in, FilterEffect* in2)
+FloatRect FilterEffect::determineFilterPrimitiveSubregion(Filter* filter)
{
- FloatRect uniteEffectRect = in->calculateEffectRect(filter);
- uniteEffectRect.unite(in2->calculateEffectRect(filter));
- return uniteEffectRect;
+ FloatRect uniteRect;
+ unsigned size = m_inputEffects.size();
+
+ // FETurbulence, FEImage and FEFlood don't have input effects, take the filter region as unite rect.
+ if (!size)
+ uniteRect = filter->filterRegion();
+ else {
+ for (unsigned i = 0; i < size; ++i)
+ uniteRect.unite(m_inputEffects.at(i)->determineFilterPrimitiveSubregion(filter));
+ }
+
+ filter->determineFilterPrimitiveSubregion(this, uniteRect);
+ return m_filterPrimitiveSubregion;
}
-FloatRect FilterEffect::calculateEffectRect(Filter* filter)
+IntRect FilterEffect::calculateDrawingIntRect(const FloatRect& effectRect) const
{
- setUnionOfChildEffectSubregions(uniteChildEffectSubregions(filter));
- filter->calculateEffectSubRegion(this);
- return subRegion();
+ ASSERT(m_effectBuffer);
+ FloatPoint location = m_repaintRectInLocalCoordinates.location();
+ location.move(-effectRect.x(), -effectRect.y());
+ return IntRect(roundedIntPoint(location), m_effectBuffer->size());
}
-IntRect FilterEffect::calculateDrawingIntRect(const FloatRect& effectRect)
+FloatRect FilterEffect::calculateDrawingRect(const FloatRect& srcRect) const
{
- IntPoint location = roundedIntPoint(FloatPoint(scaledSubRegion().x() - effectRect.x(),
- scaledSubRegion().y() - effectRect.y()));
- return IntRect(location, resultImage()->size());
+ return FloatRect(FloatPoint(srcRect.x() - m_repaintRectInLocalCoordinates.x(),
+ srcRect.y() - m_repaintRectInLocalCoordinates.y()), srcRect.size());
}
-FloatRect FilterEffect::calculateDrawingRect(const FloatRect& srcRect)
+FilterEffect* FilterEffect::inputEffect(unsigned number) const
{
- FloatPoint startPoint = FloatPoint(srcRect.x() - scaledSubRegion().x(), srcRect.y() - scaledSubRegion().y());
- FloatRect drawingRect = FloatRect(startPoint, srcRect.size());
- return drawingRect;
+ ASSERT(number < m_inputEffects.size());
+ return m_inputEffects.at(number).get();
}
GraphicsContext* FilterEffect::getEffectContext()
{
- IntRect bufferRect = enclosingIntRect(scaledSubRegion());
+ IntRect bufferRect = enclosingIntRect(m_repaintRectInLocalCoordinates);
m_effectBuffer = ImageBuffer::create(bufferRect.size(), LinearRGB);
+ if (!m_effectBuffer)
+ return 0;
return m_effectBuffer->context();
}
diff --git a/WebCore/platform/graphics/filters/FilterEffect.h b/WebCore/platform/graphics/filters/FilterEffect.h
index 3b8b5a3..91c52f3 100644
--- a/WebCore/platform/graphics/filters/FilterEffect.h
+++ b/WebCore/platform/graphics/filters/FilterEffect.h
@@ -1,22 +1,23 @@
/*
- Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
- 2009 Dirk Schulze <krit@webkit.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#ifndef FilterEffect_h
#define FilterEffect_h
@@ -32,84 +33,97 @@
#include <wtf/PassOwnPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
namespace WebCore {
- class FilterEffect : public RefCounted<FilterEffect> {
- public:
- virtual ~FilterEffect();
+typedef Vector<RefPtr<FilterEffect> > FilterEffectVector;
+
+class FilterEffect : public RefCounted<FilterEffect> {
+public:
+ virtual ~FilterEffect();
+
+ // The result is bounded to the size of the filter primitive to save resources.
+ ImageBuffer* resultImage() const { return m_effectBuffer.get(); }
+ void setEffectBuffer(PassOwnPtr<ImageBuffer> effectBuffer) { m_effectBuffer = effectBuffer; }
+
+ // Creates the ImageBuffer for the current filter primitive result in the size of the
+ // repaintRect. Gives back the GraphicsContext of the own ImageBuffer.
+ GraphicsContext* getEffectContext();
- void setUnionOfChildEffectSubregions(const FloatRect& uniteRect) { m_unionOfChildEffectSubregions = uniteRect; }
- FloatRect unionOfChildEffectSubregions() const { return m_unionOfChildEffectSubregions; }
+ FilterEffectVector& inputEffects() { return m_inputEffects; }
+ FilterEffect* inputEffect(unsigned) const;
+ unsigned numberOfEffectInputs() const { return m_inputEffects.size(); }
- FloatRect subRegion() const { return m_subRegion; }
- void setSubRegion(const FloatRect& subRegion) { m_subRegion = subRegion; }
+ FloatRect calculateDrawingRect(const FloatRect&) const;
+ IntRect calculateDrawingIntRect(const FloatRect&) const;
- FloatRect scaledSubRegion() const { return m_scaledSubRegion; }
- void setScaledSubRegion(const FloatRect& scaledSubRegion) { m_scaledSubRegion = scaledSubRegion; }
+ // Solid black image with different alpha values.
+ bool isAlphaImage() const { return m_alphaImage; }
+ void setIsAlphaImage(bool alphaImage) { m_alphaImage = alphaImage; }
- FloatRect effectBoundaries() const { return m_effectBoundaries; }
- void setEffectBoundaries(const FloatRect& effectBoundaries) { m_effectBoundaries = effectBoundaries; }
+ FloatRect repaintRectInLocalCoordinates() const { return m_repaintRectInLocalCoordinates; }
+ void setRepaintRectInLocalCoordinates(const FloatRect& repaintRectInLocalCoordinates) { m_repaintRectInLocalCoordinates = repaintRectInLocalCoordinates; }
- bool hasX() { return m_hasX; }
- void setHasX(bool value) { m_hasX = value; }
+ virtual void apply(Filter*) = 0;
+ virtual void dump() = 0;
- bool hasY() { return m_hasY; }
- void setHasY(bool value) { m_hasY = value; }
+ virtual bool isSourceInput() const { return false; }
- bool hasWidth() { return m_hasWidth; }
- void setHasWidth(bool value) { m_hasWidth = value; }
+ virtual TextStream& externalRepresentation(TextStream&, int indention = 0) const;
- bool hasHeight() { return m_hasHeight; }
- void setHasHeight(bool value) { m_hasHeight = value; }
+public:
+ // The following functions are SVG specific and will move to RenderSVGResourceFilterPrimitive.
+ // See bug https://bugs.webkit.org/show_bug.cgi?id=45614.
+ bool hasX() const { return m_hasX; }
+ void setHasX(bool value) { m_hasX = value; }
- // The result is bounded by the size of the filter primitive to save resources
- ImageBuffer* resultImage() { return m_effectBuffer.get(); }
- void setEffectBuffer(PassOwnPtr<ImageBuffer> effectBuffer) { m_effectBuffer = effectBuffer; }
+ bool hasY() const { return m_hasY; }
+ void setHasY(bool value) { m_hasY = value; }
- FloatRect calculateUnionOfChildEffectSubregions(Filter*, FilterEffect*, FilterEffect*);
- FloatRect calculateUnionOfChildEffectSubregions(Filter*, FilterEffect*);
+ bool hasWidth() const { return m_hasWidth; }
+ void setHasWidth(bool value) { m_hasWidth = value; }
- GraphicsContext* getEffectContext();
- FloatRect calculateDrawingRect(const FloatRect&);
- IntRect calculateDrawingIntRect(const FloatRect&);
+ bool hasHeight() const { return m_hasHeight; }
+ void setHasHeight(bool value) { m_hasHeight = value; }
- // black image with different alpha values
- bool isAlphaImage() { return m_alphaImage; }
- void setIsAlphaImage(bool alphaImage) { m_alphaImage = alphaImage; }
+ // FIXME: Pseudo primitives like SourceGraphic and SourceAlpha as well as FETile still need special handling.
+ virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
- virtual FloatRect uniteChildEffectSubregions(Filter* filter) { return filter->filterRegion(); }
- virtual FloatRect calculateEffectRect(Filter*);
- virtual void apply(Filter*) = 0;
- virtual void dump() = 0;
+ FloatRect filterPrimitiveSubregion() const { return m_filterPrimitiveSubregion; }
+ void setFilterPrimitiveSubregion(const FloatRect& filterPrimitiveSubregion) { m_filterPrimitiveSubregion = filterPrimitiveSubregion; }
- virtual bool isSourceInput() { return false; }
+ FloatRect effectBoundaries() const { return m_effectBoundaries; }
+ void setEffectBoundaries(const FloatRect& effectBoundaries) { m_effectBoundaries = effectBoundaries; }
- virtual TextStream& externalRepresentation(TextStream&, int indention = 0) const;
- protected:
- FilterEffect();
+protected:
+ FilterEffect();
- private:
+private:
+ OwnPtr<ImageBuffer> m_effectBuffer;
+ FilterEffectVector m_inputEffects;
- bool m_xBBoxMode : 1;
- bool m_yBBoxMode : 1;
- bool m_widthBBoxMode : 1;
- bool m_heightBBoxMode : 1;
+ bool m_alphaImage;
- bool m_hasX : 1;
- bool m_hasY : 1;
- bool m_hasWidth : 1;
- bool m_hasHeight : 1;
+ // FIXME: Should be the paint region of the filter primitive, instead of the scaled subregion on use of filterRes.
+ FloatRect m_repaintRectInLocalCoordinates;
- bool m_alphaImage;
+private:
+ // The following member variables are SVG specific and will move to RenderSVGResourceFilterPrimitive.
+ // See bug https://bugs.webkit.org/show_bug.cgi?id=45614.
- FloatRect m_effectBoundaries;
- FloatRect m_subRegion;
- FloatRect m_scaledSubRegion;
- FloatRect m_unionOfChildEffectSubregions;
+ // The subregion of a filter primitive according to the SVG Filter specification in local coordinates.
+ // This is SVG specific and needs to move to RenderSVGResourceFilterPrimitive.
+ FloatRect m_filterPrimitiveSubregion;
- mutable OwnPtr<ImageBuffer> m_effectBuffer;
- };
+ // x, y, width and height of the actual SVGFE*Element. Is needed to determine the subregion of the
+ // filter primitive on a later step.
+ FloatRect m_effectBoundaries;
+ bool m_hasX;
+ bool m_hasY;
+ bool m_hasWidth;
+ bool m_hasHeight;
+};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/filters/SourceAlpha.cpp b/WebCore/platform/graphics/filters/SourceAlpha.cpp
index 37b0023..9c6a953 100644
--- a/WebCore/platform/graphics/filters/SourceAlpha.cpp
+++ b/WebCore/platform/graphics/filters/SourceAlpha.cpp
@@ -42,16 +42,16 @@ const AtomicString& SourceAlpha::effectName()
return s_effectName;
}
-FloatRect SourceAlpha::calculateEffectRect(Filter* filter)
+FloatRect SourceAlpha::determineFilterPrimitiveSubregion(Filter* filter)
{
FloatRect clippedSourceRect = filter->sourceImageRect();
if (filter->sourceImageRect().x() < filter->filterRegion().x())
clippedSourceRect.setX(filter->filterRegion().x());
if (filter->sourceImageRect().y() < filter->filterRegion().y())
clippedSourceRect.setY(filter->filterRegion().y());
- setSubRegion(clippedSourceRect);
+ setFilterPrimitiveSubregion(clippedSourceRect);
clippedSourceRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
- setScaledSubRegion(clippedSourceRect);
+ setRepaintRectInLocalCoordinates(clippedSourceRect);
return filter->filterRegion();
}
diff --git a/WebCore/platform/graphics/filters/SourceAlpha.h b/WebCore/platform/graphics/filters/SourceAlpha.h
index e5c6815..25a17b2 100644
--- a/WebCore/platform/graphics/filters/SourceAlpha.h
+++ b/WebCore/platform/graphics/filters/SourceAlpha.h
@@ -34,11 +34,12 @@ namespace WebCore {
static const AtomicString& effectName();
- virtual bool isSourceInput() { return true; }
- virtual FloatRect calculateEffectRect(Filter*);
void apply(Filter*);
void dump();
TextStream& externalRepresentation(TextStream&, int indent) const;
+
+ virtual bool isSourceInput() const { return true; }
+ virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
private:
SourceAlpha() { }
diff --git a/WebCore/platform/graphics/filters/SourceGraphic.cpp b/WebCore/platform/graphics/filters/SourceGraphic.cpp
index 5730d34..6a32e36 100644
--- a/WebCore/platform/graphics/filters/SourceGraphic.cpp
+++ b/WebCore/platform/graphics/filters/SourceGraphic.cpp
@@ -41,16 +41,16 @@ const AtomicString& SourceGraphic::effectName()
return s_effectName;
}
-FloatRect SourceGraphic::calculateEffectRect(Filter* filter)
+FloatRect SourceGraphic::determineFilterPrimitiveSubregion(Filter* filter)
{
FloatRect clippedSourceRect = filter->sourceImageRect();
if (filter->sourceImageRect().x() < filter->filterRegion().x())
clippedSourceRect.setX(filter->filterRegion().x());
if (filter->sourceImageRect().y() < filter->filterRegion().y())
clippedSourceRect.setY(filter->filterRegion().y());
- setSubRegion(clippedSourceRect);
+ setFilterPrimitiveSubregion(clippedSourceRect);
clippedSourceRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
- setScaledSubRegion(clippedSourceRect);
+ setRepaintRectInLocalCoordinates(clippedSourceRect);
return filter->filterRegion();
}
diff --git a/WebCore/platform/graphics/filters/SourceGraphic.h b/WebCore/platform/graphics/filters/SourceGraphic.h
index 05238a2..911648c 100644
--- a/WebCore/platform/graphics/filters/SourceGraphic.h
+++ b/WebCore/platform/graphics/filters/SourceGraphic.h
@@ -35,12 +35,13 @@ namespace WebCore {
static const AtomicString& effectName();
- virtual bool isSourceInput() { return true; }
- virtual FloatRect calculateEffectRect(Filter*);
void apply(Filter*);
void dump();
TextStream& externalRepresentation(TextStream&, int indent) const;
-
+
+ virtual bool isSourceInput() const { return true; }
+ virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
+
private:
SourceGraphic() { }
};
diff --git a/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp b/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp
index 6424293..7629735 100644
--- a/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp
@@ -58,11 +58,13 @@ SharedGraphicsContext3D::SharedGraphicsContext3D(PassOwnPtr<GraphicsContext3D> c
, m_solidFillShader(SolidFillShader::create(m_context.get()))
, m_texShader(TexShader::create(m_context.get()))
{
+ allContexts()->add(this);
}
SharedGraphicsContext3D::~SharedGraphicsContext3D()
{
m_context->deleteBuffer(m_quadVertices);
+ allContexts()->remove(this);
}
void SharedGraphicsContext3D::makeContextCurrent()
@@ -112,6 +114,11 @@ void SharedGraphicsContext3D::getIntegerv(unsigned long pname, int* value)
m_context->getIntegerv(pname, value);
}
+void SharedGraphicsContext3D::flush()
+{
+ m_context->flush();
+}
+
unsigned SharedGraphicsContext3D::createFramebuffer()
{
return m_context->createFramebuffer();
@@ -162,6 +169,17 @@ bool SharedGraphicsContext3D::supportsBGRA()
return m_context->supportsBGRA();
}
+bool SharedGraphicsContext3D::supportsCopyTextureToParentTextureCHROMIUM()
+
+{
+ return m_context->supportsCopyTextureToParentTextureCHROMIUM();
+}
+
+void SharedGraphicsContext3D::copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture)
+{
+ return m_context->copyTextureToParentTextureCHROMIUM(texture, parentTexture);
+}
+
Texture* SharedGraphicsContext3D::createTexture(NativeImagePtr ptr, Texture::Format format, int width, int height)
{
RefPtr<Texture> texture = m_textures.get(ptr);
@@ -180,6 +198,28 @@ Texture* SharedGraphicsContext3D::getTexture(NativeImagePtr ptr)
return texture ? texture.get() : 0;
}
+void SharedGraphicsContext3D::removeTextureFor(NativeImagePtr ptr)
+{
+ TextureHashMap::iterator it = m_textures.find(ptr);
+ if (it != m_textures.end())
+ m_textures.remove(it);
+}
+
+// static
+void SharedGraphicsContext3D::removeTexturesFor(NativeImagePtr ptr)
+{
+ for (HashSet<SharedGraphicsContext3D*>::iterator it = allContexts()->begin(); it != allContexts()->end(); ++it)
+ (*it)->removeTextureFor(ptr);
+}
+
+// static
+HashSet<SharedGraphicsContext3D*>* SharedGraphicsContext3D::allContexts()
+{
+ static OwnPtr<HashSet<SharedGraphicsContext3D*> > set(new HashSet<SharedGraphicsContext3D*>);
+ return set.get();
+}
+
+
PassRefPtr<Texture> SharedGraphicsContext3D::createTexture(Texture::Format format, int width, int height)
{
return Texture::create(m_context.get(), format, width, height);
diff --git a/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.h b/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.h
index 1baa0f6..3ba3c52 100644
--- a/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.h
+++ b/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.h
@@ -36,6 +36,7 @@
#include "Texture.h"
#include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
#include <wtf/OwnPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
@@ -69,6 +70,7 @@ public:
void drawArrays(unsigned long mode, long first, long count);
unsigned long getError();
void getIntegerv(unsigned long pname, int* value);
+ void flush();
unsigned createFramebuffer();
unsigned createTexture();
@@ -97,17 +99,30 @@ public:
bool supportsBGRA();
+ // GL_CHROMIUM_copy_texture_to_parent_texture
+ bool supportsCopyTextureToParentTextureCHROMIUM();
+ void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture);
+
// Creates a texture associated with the given image. Is owned by this context's
// TextureHashMap.
Texture* createTexture(NativeImagePtr, Texture::Format, int width, int height);
Texture* getTexture(NativeImagePtr);
+ // Multiple SharedGraphicsContext3D can exist in a single process (one per compositing context) and the same
+ // NativeImagePtr may be uploaded as a texture into all of them. This function removes uploaded textures
+ // for a given NativeImagePtr in all contexts.
+ static void removeTexturesFor(NativeImagePtr);
+
// Creates a texture that is not associated with any image. The caller takes ownership of
// the texture.
PassRefPtr<Texture> createTexture(Texture::Format, int width, int height);
private:
- SharedGraphicsContext3D(PassOwnPtr<GraphicsContext3D> context);
+ explicit SharedGraphicsContext3D(PassOwnPtr<GraphicsContext3D> context);
+
+ // Used to implement removeTexturesFor(), see the comment above.
+ static HashSet<SharedGraphicsContext3D*>* allContexts();
+ void removeTextureFor(NativeImagePtr);
OwnPtr<GraphicsContext3D> m_context;
diff --git a/WebCore/platform/graphics/gpu/SolidFillShader.cpp b/WebCore/platform/graphics/gpu/SolidFillShader.cpp
index bbc4792..ff1b1fa 100644
--- a/WebCore/platform/graphics/gpu/SolidFillShader.cpp
+++ b/WebCore/platform/graphics/gpu/SolidFillShader.cpp
@@ -54,7 +54,9 @@ PassOwnPtr<SolidFillShader> SolidFillShader::create(GraphicsContext3D* context)
" gl_Position = vec4(matrix * position, 1.0);\n"
"}\n";
static const char* fragmentShaderSource =
+ "#ifdef GL_ES\n"
"precision mediump float;\n"
+ "#endif\n"
"uniform mat3 matrix;\n"
"uniform vec4 color;\n"
"void main() {\n"
diff --git a/WebCore/platform/graphics/gpu/TexShader.cpp b/WebCore/platform/graphics/gpu/TexShader.cpp
index ba3ecdd..01f4306 100644
--- a/WebCore/platform/graphics/gpu/TexShader.cpp
+++ b/WebCore/platform/graphics/gpu/TexShader.cpp
@@ -57,7 +57,9 @@ PassOwnPtr<TexShader> TexShader::create(GraphicsContext3D* context)
" gl_Position = vec4(matrix * position, 1.0);\n"
"}\n";
static const char* fragmentShaderSource =
+ "#ifdef GL_ES\n"
"precision mediump float;\n"
+ "#endif\n"
"uniform sampler2D sampler;\n"
"uniform float alpha;\n"
"varying vec3 texCoord;\n"
diff --git a/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp b/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp
index 2ff4f38..efccff0 100644
--- a/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp
+++ b/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp
@@ -195,7 +195,11 @@ void GStreamerGWorld::setWindowOverlay(GstMessage* message)
g_object_set(sink, "force-aspect-ratio", TRUE, NULL);
if (m_videoWindow)
+#if GST_CHECK_VERSION(0, 10, 31) || GST_VERSION_NANO
+ gst_x_overlay_set_window_handle(GST_X_OVERLAY(sink), m_videoWindow->videoWindowId());
+#else
gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(sink), m_videoWindow->videoWindowId());
+#endif
}
}
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index 4791b4c..0071d67 100644
--- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -23,6 +23,7 @@
#include "config.h"
#include "MediaPlayerPrivateGStreamer.h"
+
#if ENABLE(VIDEO)
#include "ColorSpace.h"
@@ -40,19 +41,15 @@
#include "MIMETypeRegistry.h"
#include "MediaPlayer.h"
#include "NotImplemented.h"
-#include "ScrollView.h"
#include "SecurityOrigin.h"
#include "TimeRanges.h"
#include "VideoSinkGStreamer.h"
#include "WebKitWebSourceGStreamer.h"
-#include "Widget.h"
#include <GOwnPtr.h>
#include <gst/gst.h>
-#include <gst/interfaces/mixer.h>
#include <gst/video/video.h>
#include <limits>
#include <math.h>
-#include <wtf/text/CString.h>
// GstPlayFlags flags from playbin2. It is the policy of GStreamer to
// not publicly expose element-specific enums. That's why this
diff --git a/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp b/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
index bcd59c6..4e57193 100644
--- a/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
+++ b/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
@@ -23,6 +23,7 @@
#include "Document.h"
#include "GOwnPtr.h"
#include "GRefPtr.h"
+#include "NetworkingContext.h"
#include "Noncopyable.h"
#include "NotImplemented.h"
#include "ResourceHandleClient.h"
@@ -43,7 +44,7 @@ class StreamingClient : public Noncopyable, public ResourceHandleClient {
virtual void willSendRequest(ResourceHandle*, ResourceRequest&, const ResourceResponse&);
virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
virtual void didReceiveData(ResourceHandle*, const char*, int, int);
- virtual void didFinishLoading(ResourceHandle*);
+ virtual void didFinishLoading(ResourceHandle*, double /*finishTime*/);
virtual void didFail(ResourceHandle*, const ResourceError&);
virtual void wasBlocked(ResourceHandle*);
virtual void cannotShowURL(ResourceHandle*);
@@ -391,14 +392,17 @@ static bool webKitWebSrcStart(WebKitWebSrc* src)
request.setTargetType(ResourceRequestBase::TargetIsMedia);
request.setAllowCookies(true);
+ NetworkingContext* context = 0;
if (priv->frame) {
Document* document = priv->frame->document();
if (document)
request.setHTTPReferrer(document->documentURI());
FrameLoader* loader = priv->frame->loader();
- if (loader)
+ if (loader) {
loader->addExtraFieldsToSubresourceRequest(request);
+ context = loader->networkingContext();
+ }
}
// Let Apple web servers know we want to access their nice movie trailers.
@@ -419,7 +423,7 @@ static bool webKitWebSrcStart(WebKitWebSrc* src)
// Needed to use DLNA streaming servers
request.setHTTPHeaderField("transferMode.dlna", "Streaming");
- priv->resourceHandle = ResourceHandle::create(request, priv->client, 0, false, false);
+ priv->resourceHandle = ResourceHandle::create(context, request, priv->client, false, false);
if (!priv->resourceHandle) {
GST_ERROR_OBJECT(src, "Failed to create ResourceHandle");
return false;
@@ -762,7 +766,7 @@ void StreamingClient::didReceiveData(ResourceHandle* handle, const char* data, i
GST_ELEMENT_ERROR(m_src, CORE, FAILED, (0), (0));
}
-void StreamingClient::didFinishLoading(ResourceHandle*)
+void StreamingClient::didFinishLoading(ResourceHandle*, double)
{
WebKitWebSrcPrivate* priv = m_src->priv;
diff --git a/WebCore/platform/graphics/gtk/FontCachePango.cpp b/WebCore/platform/graphics/gtk/FontCachePango.cpp
new file mode 100644
index 0000000..fad29e0
--- /dev/null
+++ b/WebCore/platform/graphics/gtk/FontCachePango.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "FontCache.h"
+
+#include "CString.h"
+#include "Font.h"
+#include "OwnPtrCairo.h"
+#include "SimpleFontData.h"
+#include <wtf/Assertions.h>
+
+namespace WebCore {
+
+void FontCache::platformInit()
+{
+ if (!FontPlatformData::init())
+ ASSERT_NOT_REACHED();
+}
+
+const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
+{
+ return 0;
+}
+
+SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
+{
+ return 0;
+}
+
+SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
+{
+ // FIXME: Would be even better to somehow get the user's default font here.
+ // For now we'll pick the default that the user would get without changing any prefs.
+ static AtomicString timesStr("Times New Roman");
+ return getCachedFontData(fontDescription, timesStr);
+}
+
+void FontCache::getTraitsInFamily(const AtomicString& familyName, Vector<unsigned>& traitsMasks)
+{
+}
+
+FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
+{
+ return new FontPlatformData(fontDescription, family);
+}
+
+}
diff --git a/WebCore/platform/graphics/gtk/FontGtk.cpp b/WebCore/platform/graphics/gtk/FontGtk.cpp
index 489bad7..27f48fc 100644
--- a/WebCore/platform/graphics/gtk/FontGtk.cpp
+++ b/WebCore/platform/graphics/gtk/FontGtk.cpp
@@ -139,7 +139,7 @@ static void setPangoAttributes(const Font* font, const TextRun& run, PangoLayout
{
#if defined(USE_FREETYPE)
if (font->primaryFont()->platformData().m_pattern) {
- PangoFontDescription* desc = pango_fc_font_description_from_pattern(font->primaryFont()->platformData().m_pattern, FALSE);
+ PangoFontDescription* desc = pango_fc_font_description_from_pattern(font->primaryFont()->platformData().m_pattern.get(), FALSE);
pango_layout_set_font_description(layout, desc);
pango_font_description_free(desc);
}
diff --git a/WebCore/platform/graphics/gtk/FontPlatformDataPango.h b/WebCore/platform/graphics/gtk/FontPlatformDataPango.h
new file mode 100644
index 0000000..7b1e51f
--- /dev/null
+++ b/WebCore/platform/graphics/gtk/FontPlatformDataPango.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Inc.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2007 Pioneer Research Center USA, Inc.
+ * All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef FontPlatformDataPango_h
+#define FontPlatformDataPango_h
+
+#include "FontDescription.h"
+#include "GlyphBuffer.h"
+#include <cairo.h>
+#include <pango/pangocairo.h>
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+class FontPlatformData {
+public:
+ FontPlatformData(WTF::HashTableDeletedValueType)
+ : m_context(0)
+ , m_font(hashTableDeletedFontValue())
+ , m_size(0)
+ , m_syntheticBold(false)
+ , m_syntheticOblique(false)
+ , m_scaledFont(0)
+ { }
+
+ FontPlatformData()
+ : m_context(0)
+ , m_font(0)
+ , m_size(0)
+ , m_syntheticBold(false)
+ , m_syntheticOblique(false)
+ , m_scaledFont(0)
+ { }
+
+ FontPlatformData(const FontDescription&, const AtomicString& family);
+ FontPlatformData(cairo_font_face_t* fontFace, float size, bool bold, bool italic);
+ FontPlatformData(float size, bool bold, bool italic);
+ FontPlatformData(const FontPlatformData&);
+ ~FontPlatformData();
+
+ static bool init();
+ bool isFixedPitch();
+ float size() const { return m_size; }
+ void setSize(float size) { m_size = size; }
+ bool syntheticBold() const { return m_syntheticBold; }
+ bool syntheticOblique() const { return m_syntheticOblique; }
+
+ cairo_scaled_font_t* scaledFont() const { return m_scaledFont; }
+
+ unsigned hash() const
+ {
+ uintptr_t hashCodes[1] = { reinterpret_cast<uintptr_t>(m_scaledFont) };
+ return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ }
+
+ bool operator==(const FontPlatformData&) const;
+ FontPlatformData& operator=(const FontPlatformData&);
+ bool isHashTableDeletedValue() const
+ {
+ return m_font == hashTableDeletedFontValue();
+ }
+
+#ifndef NDEBUG
+ String description() const;
+#endif
+
+ static PangoFontMap* m_fontMap;
+ static GHashTable* m_hashTable;
+ PangoContext* m_context;
+ PangoFont* m_font;
+ float m_size;
+ bool m_syntheticBold;
+ bool m_syntheticOblique;
+ cairo_scaled_font_t* m_scaledFont;
+private:
+ static PangoFont *hashTableDeletedFontValue() { return reinterpret_cast<PangoFont*>(-1); }
+};
+
+}
+
+#endif // FontPlatformDataPango_h
diff --git a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
index 54b261c..a4919d8 100644
--- a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
+++ b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
@@ -31,21 +31,22 @@
#import "BlockExceptions.h"
+#include "ANGLE/ShaderLang.h"
#include "ArrayBuffer.h"
#include "ArrayBufferView.h"
-#include "WebGLObject.h"
#include "CanvasRenderingContext.h"
+#include <CoreGraphics/CGBitmapContext.h>
#include "Float32Array.h"
#include "GraphicsContext.h"
#include "HTMLCanvasElement.h"
#include "ImageBuffer.h"
#include "Int32Array.h"
#include "NotImplemented.h"
-#include "Uint8Array.h"
-#include "WebGLLayer.h"
-#include <CoreGraphics/CGBitmapContext.h>
#include <OpenGL/CGLRenderers.h>
#include <OpenGL/gl.h>
+#include "Uint8Array.h"
+#include "WebGLLayer.h"
+#include "WebGLObject.h"
#include <wtf/UnusedParam.h>
#include <wtf/text/CString.h>
@@ -76,13 +77,16 @@ static void setPixelFormat(Vector<CGLPixelFormatAttribute>& attribs, int colorBi
attribs.append(static_cast<CGLPixelFormatAttribute>(0));
}
-PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
{
- OwnPtr<GraphicsContext3D> context(new GraphicsContext3D(attrs, hostWindow));
+ // This implementation doesn't currently support rendering directly to the HostWindow.
+ if (renderStyle == RenderDirectlyToHostWindow)
+ return 0;
+ OwnPtr<GraphicsContext3D> context(new GraphicsContext3D(attrs, hostWindow, false));
return context->m_contextObj ? context.release() : 0;
}
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool)
: m_currentWidth(0)
, m_currentHeight(0)
, m_attrs(attrs)
@@ -229,81 +233,14 @@ GraphicsContext3D::~GraphicsContext3D()
}
}
-void GraphicsContext3D::validateAttributes()
-{
- const char* extensions = reinterpret_cast<const char*>(::glGetString(GL_EXTENSIONS));
- if (m_attrs.stencil) {
- if (std::strstr(extensions, "GL_EXT_packed_depth_stencil")) {
- if (!m_attrs.depth)
- m_attrs.depth = true;
- } else
- m_attrs.stencil = false;
- }
- if (m_attrs.antialias) {
- bool isValidVendor = true;
- // Currently in Mac we only turn on antialias if vendor is NVIDIA.
- const char* vendor = reinterpret_cast<const char*>(::glGetString(GL_VENDOR));
- if (!std::strstr(vendor, "NVIDIA"))
- isValidVendor = false;
- if (!isValidVendor || !std::strstr(extensions, "GL_EXT_framebuffer_multisample"))
- m_attrs.antialias = false;
- }
- // FIXME: instead of enforcing premultipliedAlpha = true, implement the
- // correct behavior when premultipliedAlpha = false is requested.
- m_attrs.premultipliedAlpha = true;
-}
-
void GraphicsContext3D::makeContextCurrent()
{
- CGLSetCurrentContext(m_contextObj);
-}
-
-void GraphicsContext3D::paintRenderingResultsToCanvas(CanvasRenderingContext* 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)
+ if (!m_contextObj)
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());
+ CGLContextObj currentContext = CGLGetCurrentContext();
+ if (currentContext != m_contextObj)
+ CGLSetCurrentContext(m_contextObj);
}
bool GraphicsContext3D::isGLES2Compliant() const
@@ -320,1343 +257,7 @@ bool GraphicsContext3D::isErrorGeneratedOnOutOfBoundsAccesses() const
{
return false;
}
-
-void GraphicsContext3D::reshape(int width, int height)
-{
- if (width == m_currentWidth && height == m_currentHeight || !m_contextObj)
- return;
-
- m_currentWidth = width;
- m_currentHeight = height;
-
- CGLSetCurrentContext(m_contextObj);
-
- GLuint internalColorFormat, colorFormat, internalDepthStencilFormat = 0;
- if (m_attrs.alpha) {
- internalColorFormat = GL_RGBA8;
- colorFormat = GL_RGBA;
- } else {
- internalColorFormat = GL_RGB8;
- colorFormat = GL_RGB;
- }
- if (m_attrs.stencil || m_attrs.depth) {
- // We don't allow the logic where stencil is required and depth is not.
- // See GraphicsContext3D constructor.
- if (m_attrs.stencil && m_attrs.depth)
- internalDepthStencilFormat = GL_DEPTH24_STENCIL8_EXT;
- else
- internalDepthStencilFormat = GL_DEPTH_COMPONENT;
- }
-
- bool mustRestoreFBO = false;
-
- // resize multisample FBO
- if (m_attrs.antialias) {
- GLint maxSampleCount;
- ::glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSampleCount);
- GLint sampleCount = std::min(8, maxSampleCount);
- if (sampleCount > maxSampleCount)
- sampleCount = maxSampleCount;
- if (m_boundFBO != m_multisampleFBO) {
- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
- mustRestoreFBO = true;
- }
- ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleColorBuffer);
- ::glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, internalColorFormat, width, height);
- ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, m_multisampleColorBuffer);
- if (m_attrs.stencil || m_attrs.depth) {
- ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
- ::glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, internalDepthStencilFormat, width, height);
- if (m_attrs.stencil)
- ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
- if (m_attrs.depth)
- ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
- }
- ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
- if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT) {
- // FIXME: cleanup.
- notImplemented();
- }
- }
-
- // resize regular FBO
- if (m_boundFBO != m_fbo) {
- mustRestoreFBO = true;
- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
- }
- ::glBindTexture(GL_TEXTURE_2D, m_texture);
- ::glTexImage2D(GL_TEXTURE_2D, 0, internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
- ::glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, m_texture, 0);
- ::glBindTexture(GL_TEXTURE_2D, 0);
- if (!m_attrs.antialias && (m_attrs.stencil || m_attrs.depth)) {
- ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_depthStencilBuffer);
- ::glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, internalDepthStencilFormat, width, height);
- if (m_attrs.stencil)
- ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthStencilBuffer);
- if (m_attrs.depth)
- ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthStencilBuffer);
- ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
- }
- if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT) {
- // FIXME: cleanup
- notImplemented();
- }
-
- if (m_attrs.antialias) {
- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
- if (m_boundFBO == m_multisampleFBO)
- mustRestoreFBO = false;
- }
-
- // Initialize renderbuffers to 0.
- GLboolean colorMask[] = {GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE}, depthMask = GL_TRUE, stencilMask = GL_TRUE;
- GLboolean isScissorEnabled = GL_FALSE;
- GLboolean isDitherEnabled = GL_FALSE;
- GLbitfield clearMask = GL_COLOR_BUFFER_BIT;
- ::glGetBooleanv(GL_COLOR_WRITEMASK, colorMask);
- ::glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- if (m_attrs.depth) {
- ::glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMask);
- ::glDepthMask(GL_TRUE);
- clearMask |= GL_DEPTH_BUFFER_BIT;
- }
- if (m_attrs.stencil) {
- ::glGetBooleanv(GL_STENCIL_WRITEMASK, &stencilMask);
- ::glStencilMask(GL_TRUE);
- clearMask |= GL_STENCIL_BUFFER_BIT;
- }
- isScissorEnabled = ::glIsEnabled(GL_SCISSOR_TEST);
- ::glDisable(GL_SCISSOR_TEST);
- isDitherEnabled = ::glIsEnabled(GL_DITHER);
- ::glDisable(GL_DITHER);
-
- ::glClear(clearMask);
-
- ::glColorMask(colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
- if (m_attrs.depth)
- ::glDepthMask(depthMask);
- if (m_attrs.stencil)
- ::glStencilMask(stencilMask);
- if (isScissorEnabled)
- ::glEnable(GL_SCISSOR_TEST);
- else
- ::glDisable(GL_SCISSOR_TEST);
- if (isDitherEnabled)
- ::glEnable(GL_DITHER);
- else
- ::glDisable(GL_DITHER);
-
- if (mustRestoreFBO)
- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
-
- ::glFlush();
-}
-
-static inline void ensureContext(CGLContextObj context)
-{
- if (!context)
- return;
-
- CGLContextObj currentContext = CGLGetCurrentContext();
- if (currentContext != context)
- CGLSetCurrentContext(context);
-}
-
-void GraphicsContext3D::prepareTexture()
-{
- ensureContext(m_contextObj);
- 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_boundFBO);
- }
- ::glFinish();
-}
-
-void GraphicsContext3D::activeTexture(unsigned long texture)
-{
- ensureContext(m_contextObj);
- ::glActiveTexture(texture);
-}
-
-void GraphicsContext3D::attachShader(Platform3DObject program, Platform3DObject shader)
-{
- ASSERT(program);
- ASSERT(shader);
- ensureContext(m_contextObj);
- ::glAttachShader((GLuint) program, (GLuint) shader);
-}
-
-void GraphicsContext3D::bindAttribLocation(Platform3DObject program, unsigned long index, const String& name)
-{
- ASSERT(program);
- ensureContext(m_contextObj);
- ::glBindAttribLocation((GLuint) program, index, name.utf8().data());
-}
-
-void GraphicsContext3D::bindBuffer(unsigned long target, Platform3DObject buffer)
-{
- ensureContext(m_contextObj);
- ::glBindBuffer(target, (GLuint) buffer);
-}
-
-
-void GraphicsContext3D::bindFramebuffer(unsigned long target, Platform3DObject buffer)
-{
- ensureContext(m_contextObj);
- GLuint fbo;
- if (buffer)
- fbo = (GLuint)buffer;
- else
- fbo = (m_attrs.antialias ? m_multisampleFBO : m_fbo);
- if (fbo != m_boundFBO) {
- ::glBindFramebufferEXT(target, fbo);
- m_boundFBO = fbo;
- }
-}
-
-void GraphicsContext3D::bindRenderbuffer(unsigned long target, Platform3DObject renderbuffer)
-{
- ensureContext(m_contextObj);
- ::glBindRenderbufferEXT(target, (GLuint) renderbuffer);
-}
-
-
-void GraphicsContext3D::bindTexture(unsigned long target, Platform3DObject texture)
-{
- ensureContext(m_contextObj);
- ::glBindTexture(target, (GLuint) texture);
-}
-
-void GraphicsContext3D::blendColor(double red, double green, double blue, double alpha)
-{
- ensureContext(m_contextObj);
- ::glBlendColor(static_cast<float>(red), static_cast<float>(green), static_cast<float>(blue), static_cast<float>(alpha));
-}
-
-void GraphicsContext3D::blendEquation( unsigned long mode )
-{
- ensureContext(m_contextObj);
- ::glBlendEquation(mode);
-}
-
-void GraphicsContext3D::blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha)
-{
- ensureContext(m_contextObj);
- ::glBlendEquationSeparate(modeRGB, modeAlpha);
-}
-
-
-void GraphicsContext3D::blendFunc(unsigned long sfactor, unsigned long dfactor)
-{
- ensureContext(m_contextObj);
- ::glBlendFunc(sfactor, dfactor);
-}
-
-void GraphicsContext3D::blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha)
-{
- ensureContext(m_contextObj);
- ::glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
-}
-
-void GraphicsContext3D::bufferData(unsigned long target, int size, unsigned long usage)
-{
- ensureContext(m_contextObj);
- ::glBufferData(target, size, 0, usage);
-}
-
-void GraphicsContext3D::bufferData(unsigned long target, int size, const void* data, unsigned long usage)
-{
- ensureContext(m_contextObj);
- ::glBufferData(target, size, data, usage);
-}
-
-void GraphicsContext3D::bufferSubData(unsigned long target, long offset, int size, const void* data)
-{
- ensureContext(m_contextObj);
- ::glBufferSubData(target, offset, size, data);
-}
-
-unsigned long GraphicsContext3D::checkFramebufferStatus(unsigned long target)
-{
- ensureContext(m_contextObj);
- return ::glCheckFramebufferStatusEXT(target);
-}
-
-void GraphicsContext3D::clearColor(double r, double g, double b, double a)
-{
- ensureContext(m_contextObj);
- ::glClearColor(static_cast<float>(r), static_cast<float>(g), static_cast<float>(b), static_cast<float>(a));
-}
-
-void GraphicsContext3D::clear(unsigned long mask)
-{
- ensureContext(m_contextObj);
- ::glClear(mask);
-}
-
-void GraphicsContext3D::clearDepth(double depth)
-{
- ensureContext(m_contextObj);
- ::glClearDepth(depth);
-}
-
-void GraphicsContext3D::clearStencil(long s)
-{
- ensureContext(m_contextObj);
- ::glClearStencil(s);
-}
-
-void GraphicsContext3D::colorMask(bool red, bool green, bool blue, bool alpha)
-{
- ensureContext(m_contextObj);
- ::glColorMask(red, green, blue, alpha);
-}
-
-void GraphicsContext3D::compileShader(Platform3DObject shader)
-{
- ASSERT(shader);
- ensureContext(m_contextObj);
-
- int GLshaderType;
- ANGLEShaderType shaderType;
-
- glGetShaderiv(shader, SHADER_TYPE, &GLshaderType);
-
- if (GLshaderType == VERTEX_SHADER)
- shaderType = SHADER_TYPE_VERTEX;
- else if (GLshaderType == FRAGMENT_SHADER)
- shaderType = SHADER_TYPE_FRAGMENT;
- else
- return; // Invalid shader type.
-
- HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
-
- if (result == m_shaderSourceMap.end())
- return;
-
- ShaderSourceEntry& entry = result->second;
-
- String translatedShaderSource;
- String shaderInfoLog;
-
- bool isValid = m_compiler.validateShaderSource(entry.source.utf8().data(), shaderType, translatedShaderSource, shaderInfoLog);
-
- entry.log = shaderInfoLog;
- entry.isValid = isValid;
-
- if (!isValid)
- return; // Shader didn't validate, don't move forward with compiling translated source
-
- int translatedShaderLength = translatedShaderSource.length();
-
- const CString& translatedShaderCString = translatedShaderSource.utf8();
- const char* translatedShaderPtr = translatedShaderCString.data();
-
- ::glShaderSource((GLuint) shader, 1, &translatedShaderPtr, &translatedShaderLength);
-
- ::glCompileShader((GLuint) shader);
-
- int GLCompileSuccess;
-
- ::glGetShaderiv((GLuint) shader, COMPILE_STATUS, &GLCompileSuccess);
-
- // ASSERT that ANGLE generated GLSL will be accepted by OpenGL
- ASSERT(GLCompileSuccess == GL_TRUE);
-}
-
-void GraphicsContext3D::copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border)
-{
- ensureContext(m_contextObj);
- if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
- ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
- ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
- ::glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
- }
- ::glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
- if (m_attrs.antialias && m_boundFBO == m_multisampleFBO)
- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
-}
-
-void GraphicsContext3D::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height)
-{
- ensureContext(m_contextObj);
- if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
- ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
- ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
- ::glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
- }
- ::glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
- if (m_attrs.antialias && m_boundFBO == m_multisampleFBO)
- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
-}
-
-void GraphicsContext3D::cullFace(unsigned long mode)
-{
- ensureContext(m_contextObj);
- ::glCullFace(mode);
-}
-
-void GraphicsContext3D::depthFunc(unsigned long func)
-{
- ensureContext(m_contextObj);
- ::glDepthFunc(func);
-}
-
-void GraphicsContext3D::depthMask(bool flag)
-{
- ensureContext(m_contextObj);
- ::glDepthMask(flag);
-}
-
-void GraphicsContext3D::depthRange(double zNear, double zFar)
-{
- ensureContext(m_contextObj);
- ::glDepthRange(zNear, zFar);
-}
-
-void GraphicsContext3D::detachShader(Platform3DObject program, Platform3DObject shader)
-{
- ASSERT(program);
- ASSERT(shader);
- ensureContext(m_contextObj);
- ::glDetachShader((GLuint) program, (GLuint) shader);
-}
-
-void GraphicsContext3D::disable(unsigned long cap)
-{
- ensureContext(m_contextObj);
- ::glDisable(cap);
-}
-
-void GraphicsContext3D::disableVertexAttribArray(unsigned long index)
-{
- ensureContext(m_contextObj);
- ::glDisableVertexAttribArray(index);
-}
-
-void GraphicsContext3D::drawArrays(unsigned long mode, long first, long count)
-{
- ensureContext(m_contextObj);
- ::glDrawArrays(mode, first, count);
-}
-
-void GraphicsContext3D::drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset)
-{
- ensureContext(m_contextObj);
- ::glDrawElements(mode, count, type, reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
-}
-
-void GraphicsContext3D::enable(unsigned long cap)
-{
- ensureContext(m_contextObj);
- ::glEnable(cap);
-}
-
-void GraphicsContext3D::enableVertexAttribArray(unsigned long index)
-{
- ensureContext(m_contextObj);
- ::glEnableVertexAttribArray(index);
-}
-
-void GraphicsContext3D::finish()
-{
- ensureContext(m_contextObj);
- ::glFinish();
-}
-
-void GraphicsContext3D::flush()
-{
- ensureContext(m_contextObj);
- ::glFlush();
-}
-
-void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject buffer)
-{
- ensureContext(m_contextObj);
- GLuint renderbuffer = (GLuint) buffer;
- if (attachment == DEPTH_STENCIL_ATTACHMENT) {
- ::glFramebufferRenderbufferEXT(target, DEPTH_ATTACHMENT, renderbuffertarget, renderbuffer);
- ::glFramebufferRenderbufferEXT(target, STENCIL_ATTACHMENT, renderbuffertarget, renderbuffer);
- } else
- ::glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
-}
-
-void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject texture, long level)
-{
- ensureContext(m_contextObj);
- ::glFramebufferTexture2DEXT(target, attachment, textarget, (GLuint) texture, level);
-}
-
-void GraphicsContext3D::frontFace(unsigned long mode)
-{
- ensureContext(m_contextObj);
- ::glFrontFace(mode);
-}
-
-void GraphicsContext3D::generateMipmap(unsigned long target)
-{
- ensureContext(m_contextObj);
- ::glGenerateMipmapEXT(target);
-}
-
-bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo& info)
-{
- if (!program) {
- synthesizeGLError(INVALID_VALUE);
- return false;
- }
- ensureContext(m_contextObj);
- GLint maxAttributeSize = 0;
- ::glGetProgramiv(static_cast<GLuint>(program), GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxAttributeSize);
- GLchar name[maxAttributeSize]; // GL_ACTIVE_ATTRIBUTE_MAX_LENGTH includes null termination
- GLsizei nameLength = 0;
- GLint size = 0;
- GLenum type = 0;
- ::glGetActiveAttrib(static_cast<GLuint>(program), index, maxAttributeSize, &nameLength, &size, &type, name);
- if (!nameLength)
- return false;
- info.name = String(name, nameLength);
- info.type = type;
- info.size = size;
- return true;
-}
-
-bool GraphicsContext3D::getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo& info)
-{
- if (!program) {
- synthesizeGLError(INVALID_VALUE);
- return false;
- }
- ensureContext(m_contextObj);
- GLint maxUniformSize = 0;
- ::glGetProgramiv(static_cast<GLuint>(program), GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxUniformSize);
- GLchar name[maxUniformSize]; // GL_ACTIVE_UNIFORM_MAX_LENGTH includes null termination
- GLsizei nameLength = 0;
- GLint size = 0;
- GLenum type = 0;
- ::glGetActiveUniform(static_cast<GLuint>(program), index, maxUniformSize, &nameLength, &size, &type, name);
- if (!nameLength)
- return false;
- info.name = String(name, nameLength);
- info.type = type;
- info.size = size;
- return true;
-}
-
-void GraphicsContext3D::getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders)
-{
- if (!program) {
- synthesizeGLError(INVALID_VALUE);
- return;
- }
- ensureContext(m_contextObj);
- ::glGetAttachedShaders(static_cast<GLuint>(program), maxCount, count, shaders);
-}
-
-int GraphicsContext3D::getAttribLocation(Platform3DObject program, const String& name)
-{
- if (!program)
- return -1;
-
- ensureContext(m_contextObj);
- return ::glGetAttribLocation((GLuint) program, name.utf8().data());
-}
-
-GraphicsContext3D::Attributes GraphicsContext3D::getContextAttributes()
-{
- return m_attrs;
-}
-
-unsigned long GraphicsContext3D::getError()
-{
- if (m_syntheticErrors.size() > 0) {
- ListHashSet<unsigned long>::iterator iter = m_syntheticErrors.begin();
- unsigned long err = *iter;
- m_syntheticErrors.remove(iter);
- return err;
- }
-
- ensureContext(m_contextObj);
- return ::glGetError();
-}
-
-String GraphicsContext3D::getString(unsigned long name)
-{
- ensureContext(m_contextObj);
- return String((const char*) ::glGetString(name));
-}
-
-void GraphicsContext3D::hint(unsigned long target, unsigned long mode)
-{
- ensureContext(m_contextObj);
- ::glHint(target, mode);
-}
-
-bool GraphicsContext3D::isBuffer(Platform3DObject buffer)
-{
- if (!buffer)
- return false;
-
- ensureContext(m_contextObj);
- return ::glIsBuffer((GLuint) buffer);
-}
-
-bool GraphicsContext3D::isEnabled(unsigned long cap)
-{
- ensureContext(m_contextObj);
- return ::glIsEnabled(cap);
-}
-
-bool GraphicsContext3D::isFramebuffer(Platform3DObject framebuffer)
-{
- if (!framebuffer)
- return false;
-
- ensureContext(m_contextObj);
- return ::glIsFramebufferEXT((GLuint) framebuffer);
-}
-
-bool GraphicsContext3D::isProgram(Platform3DObject program)
-{
- if (!program)
- return false;
-
- ensureContext(m_contextObj);
- return ::glIsProgram((GLuint) program);
-}
-
-bool GraphicsContext3D::isRenderbuffer(Platform3DObject renderbuffer)
-{
- if (!renderbuffer)
- return false;
-
- ensureContext(m_contextObj);
- return ::glIsRenderbufferEXT((GLuint) renderbuffer);
-}
-
-bool GraphicsContext3D::isShader(Platform3DObject shader)
-{
- if (!shader)
- return false;
-
- ensureContext(m_contextObj);
- return ::glIsShader((GLuint) shader);
-}
-
-bool GraphicsContext3D::isTexture(Platform3DObject texture)
-{
- if (!texture)
- return false;
-
- ensureContext(m_contextObj);
- return ::glIsTexture((GLuint) texture);
-}
-
-void GraphicsContext3D::lineWidth(double width)
-{
- ensureContext(m_contextObj);
- ::glLineWidth(static_cast<float>(width));
-}
-
-void GraphicsContext3D::linkProgram(Platform3DObject program)
-{
- ASSERT(program);
- ensureContext(m_contextObj);
- ::glLinkProgram((GLuint) program);
-}
-
-void GraphicsContext3D::pixelStorei(unsigned long pname, long param)
-{
- ensureContext(m_contextObj);
- ::glPixelStorei(pname, param);
-}
-
-void GraphicsContext3D::polygonOffset(double factor, double units)
-{
- ensureContext(m_contextObj);
- ::glPolygonOffset(static_cast<float>(factor), static_cast<float>(units));
-}
-
-void GraphicsContext3D::readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data)
-{
- // FIXME: remove the two glFlush calls when the driver bug is fixed, i.e.,
- // all previous rendering calls should be done before reading pixels.
- ensureContext(m_contextObj);
- ::glFlush();
- if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
- ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
- ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
- ::glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
- ::glFlush();
- }
- ::glReadPixels(x, y, width, height, format, type, data);
- if (m_attrs.antialias && m_boundFBO == m_multisampleFBO)
- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
-}
-
-void GraphicsContext3D::releaseShaderCompiler()
-{
- // FIXME: This is not implemented on desktop OpenGL. We need to have ifdefs for the different GL variants
- ensureContext(m_contextObj);
- //::glReleaseShaderCompiler();
-}
-
-void GraphicsContext3D::renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height)
-{
- ensureContext(m_contextObj);
- switch (internalformat) {
- case DEPTH_STENCIL:
- internalformat = GL_DEPTH24_STENCIL8_EXT;
- break;
- case DEPTH_COMPONENT16:
- internalformat = GL_DEPTH_COMPONENT;
- break;
- case RGBA4:
- case RGB5_A1:
- internalformat = GL_RGBA;
- break;
- case RGB565:
- internalformat = GL_RGB;
- break;
- }
- ::glRenderbufferStorageEXT(target, internalformat, width, height);
-}
-
-void GraphicsContext3D::sampleCoverage(double value, bool invert)
-{
- ensureContext(m_contextObj);
- ::glSampleCoverage(static_cast<float>(value), invert);
-}
-
-void GraphicsContext3D::scissor(long x, long y, unsigned long width, unsigned long height)
-{
- ensureContext(m_contextObj);
- ::glScissor(x, y, width, height);
-}
-
-void GraphicsContext3D::shaderSource(Platform3DObject shader, const String& string)
-{
- ASSERT(shader);
-
- ensureContext(m_contextObj);
-
- ShaderSourceEntry entry;
-
- entry.source = string;
-
- m_shaderSourceMap.set(shader, entry);
-}
-
-void GraphicsContext3D::stencilFunc(unsigned long func, long ref, unsigned long mask)
-{
- ensureContext(m_contextObj);
- ::glStencilFunc(func, ref, mask);
-}
-
-void GraphicsContext3D::stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask)
-{
- ensureContext(m_contextObj);
- ::glStencilFuncSeparate(face, func, ref, mask);
-}
-
-void GraphicsContext3D::stencilMask(unsigned long mask)
-{
- ensureContext(m_contextObj);
- ::glStencilMask(mask);
-}
-
-void GraphicsContext3D::stencilMaskSeparate(unsigned long face, unsigned long mask)
-{
- ensureContext(m_contextObj);
- ::glStencilMaskSeparate(face, mask);
-}
-
-void GraphicsContext3D::stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass)
-{
- ensureContext(m_contextObj);
- ::glStencilOp(fail, zfail, zpass);
-}
-
-void GraphicsContext3D::stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass)
-{
- ensureContext(m_contextObj);
- ::glStencilOpSeparate(face, fail, zfail, zpass);
-}
-
-void GraphicsContext3D::texParameterf(unsigned target, unsigned pname, float value)
-{
- ensureContext(m_contextObj);
- ::glTexParameterf(target, pname, static_cast<float>(value));
-}
-
-void GraphicsContext3D::texParameteri(unsigned target, unsigned pname, int value)
-{
- ensureContext(m_contextObj);
- ::glTexParameteri(target, pname, static_cast<float>(value));
-}
-
-void GraphicsContext3D::uniform1f(long location, float v0)
-{
- ensureContext(m_contextObj);
- ::glUniform1f(location, v0);
-}
-
-void GraphicsContext3D::uniform1fv(long location, float* array, int size)
-{
- ensureContext(m_contextObj);
- ::glUniform1fv(location, size, array);
-}
-
-void GraphicsContext3D::uniform2f(long location, float v0, float v1)
-{
- ensureContext(m_contextObj);
- ::glUniform2f(location, v0, v1);
-}
-
-void GraphicsContext3D::uniform2fv(long location, float* array, int size)
-{
- // FIXME: length needs to be a multiple of 2
- ensureContext(m_contextObj);
- ::glUniform2fv(location, size, array);
-}
-
-void GraphicsContext3D::uniform3f(long location, float v0, float v1, float v2)
-{
- ensureContext(m_contextObj);
- ::glUniform3f(location, v0, v1, v2);
-}
-
-void GraphicsContext3D::uniform3fv(long location, float* array, int size)
-{
- // FIXME: length needs to be a multiple of 3
- ensureContext(m_contextObj);
- ::glUniform3fv(location, size, array);
-}
-
-void GraphicsContext3D::uniform4f(long location, float v0, float v1, float v2, float v3)
-{
- ensureContext(m_contextObj);
- ::glUniform4f(location, v0, v1, v2, v3);
-}
-
-void GraphicsContext3D::uniform4fv(long location, float* array, int size)
-{
- // FIXME: length needs to be a multiple of 4
- ensureContext(m_contextObj);
- ::glUniform4fv(location, size, array);
-}
-
-void GraphicsContext3D::uniform1i(long location, int v0)
-{
- ensureContext(m_contextObj);
- ::glUniform1i(location, v0);
-}
-
-void GraphicsContext3D::uniform1iv(long location, int* array, int size)
-{
- ensureContext(m_contextObj);
- ::glUniform1iv(location, size, array);
-}
-
-void GraphicsContext3D::uniform2i(long location, int v0, int v1)
-{
- ensureContext(m_contextObj);
- ::glUniform2i(location, v0, v1);
-}
-
-void GraphicsContext3D::uniform2iv(long location, int* array, int size)
-{
- // FIXME: length needs to be a multiple of 2
- ensureContext(m_contextObj);
- ::glUniform2iv(location, size, array);
-}
-
-void GraphicsContext3D::uniform3i(long location, int v0, int v1, int v2)
-{
- ensureContext(m_contextObj);
- ::glUniform3i(location, v0, v1, v2);
-}
-
-void GraphicsContext3D::uniform3iv(long location, int* array, int size)
-{
- // FIXME: length needs to be a multiple of 3
- ensureContext(m_contextObj);
- ::glUniform3iv(location, size, array);
-}
-
-void GraphicsContext3D::uniform4i(long location, int v0, int v1, int v2, int v3)
-{
- ensureContext(m_contextObj);
- ::glUniform4i(location, v0, v1, v2, v3);
-}
-
-void GraphicsContext3D::uniform4iv(long location, int* array, int size)
-{
- // FIXME: length needs to be a multiple of 4
- ensureContext(m_contextObj);
- ::glUniform4iv(location, size, array);
-}
-
-void GraphicsContext3D::uniformMatrix2fv(long location, bool transpose, float* array, int size)
-{
- // FIXME: length needs to be a multiple of 4
- ensureContext(m_contextObj);
- ::glUniformMatrix2fv(location, size, transpose, array);
-}
-
-void GraphicsContext3D::uniformMatrix3fv(long location, bool transpose, float* array, int size)
-{
- // FIXME: length needs to be a multiple of 9
- ensureContext(m_contextObj);
- ::glUniformMatrix3fv(location, size, transpose, array);
-}
-
-void GraphicsContext3D::uniformMatrix4fv(long location, bool transpose, float* array, int size)
-{
- // FIXME: length needs to be a multiple of 16
- ensureContext(m_contextObj);
- ::glUniformMatrix4fv(location, size, transpose, array);
-}
-
-void GraphicsContext3D::useProgram(Platform3DObject program)
-{
- ensureContext(m_contextObj);
- ::glUseProgram((GLuint) program);
-}
-
-void GraphicsContext3D::validateProgram(Platform3DObject program)
-{
- ASSERT(program);
- ensureContext(m_contextObj);
- ::glValidateProgram((GLuint) program);
-}
-
-void GraphicsContext3D::vertexAttrib1f(unsigned long indx, float v0)
-{
- ensureContext(m_contextObj);
- ::glVertexAttrib1f(indx, v0);
-}
-
-void GraphicsContext3D::vertexAttrib1fv(unsigned long indx, float* array)
-{
- ensureContext(m_contextObj);
- ::glVertexAttrib1fv(indx, array);
-}
-
-void GraphicsContext3D::vertexAttrib2f(unsigned long indx, float v0, float v1)
-{
- ensureContext(m_contextObj);
- ::glVertexAttrib2f(indx, v0, v1);
-}
-
-void GraphicsContext3D::vertexAttrib2fv(unsigned long indx, float* array)
-{
- ensureContext(m_contextObj);
- ::glVertexAttrib2fv(indx, array);
-}
-
-void GraphicsContext3D::vertexAttrib3f(unsigned long indx, float v0, float v1, float v2)
-{
- ensureContext(m_contextObj);
- ::glVertexAttrib3f(indx, v0, v1, v2);
-}
-
-void GraphicsContext3D::vertexAttrib3fv(unsigned long indx, float* array)
-{
- ensureContext(m_contextObj);
- ::glVertexAttrib3fv(indx, array);
-}
-
-void GraphicsContext3D::vertexAttrib4f(unsigned long indx, float v0, float v1, float v2, float v3)
-{
- ensureContext(m_contextObj);
- ::glVertexAttrib4f(indx, v0, v1, v2, v3);
-}
-
-void GraphicsContext3D::vertexAttrib4fv(unsigned long indx, float* array)
-{
- ensureContext(m_contextObj);
- ::glVertexAttrib4fv(indx, array);
-}
-
-void GraphicsContext3D::vertexAttribPointer(unsigned long indx, int size, int type, bool normalized, unsigned long stride, unsigned long offset)
-{
- ensureContext(m_contextObj);
- ::glVertexAttribPointer(indx, size, type, normalized, stride, reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
-}
-
-void GraphicsContext3D::viewport(long x, long y, unsigned long width, unsigned long height)
-{
- ensureContext(m_contextObj);
- ::glViewport(static_cast<GLint>(x), static_cast<GLint>(y), static_cast<GLsizei>(width), static_cast<GLsizei>(height));
-}
-
-void GraphicsContext3D::getBooleanv(unsigned long pname, unsigned char* value)
-{
- ensureContext(m_contextObj);
- ::glGetBooleanv(pname, value);
-}
-
-void GraphicsContext3D::getBufferParameteriv(unsigned long target, unsigned long pname, int* value)
-{
- ensureContext(m_contextObj);
- ::glGetBufferParameteriv(target, pname, value);
-}
-
-void GraphicsContext3D::getFloatv(unsigned long pname, float* value)
-{
- ensureContext(m_contextObj);
- ::glGetFloatv(pname, value);
-}
-
-void GraphicsContext3D::getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value)
-{
- ensureContext(m_contextObj);
- if (attachment == DEPTH_STENCIL_ATTACHMENT)
- attachment = DEPTH_ATTACHMENT; // Or STENCIL_ATTACHMENT, either works.
- ::glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, value);
-}
-
-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:
- *value = GL_RGB;
- break;
- 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);
- }
-}
-
-void GraphicsContext3D::getProgramiv(Platform3DObject program, unsigned long pname, int* value)
-{
- ensureContext(m_contextObj);
- ::glGetProgramiv((GLuint) program, pname, value);
-}
-
-String GraphicsContext3D::getProgramInfoLog(Platform3DObject program)
-{
- ASSERT(program);
-
- ensureContext(m_contextObj);
- GLint length;
- ::glGetProgramiv((GLuint) program, GL_INFO_LOG_LENGTH, &length);
-
- GLsizei size;
- GLchar* info = (GLchar*) fastMalloc(length);
- if (!info)
- return "";
-
- ::glGetProgramInfoLog((GLuint) program, length, &size, info);
- String s(info);
- fastFree(info);
- return s;
-}
-
-void GraphicsContext3D::getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value)
-{
- ensureContext(m_contextObj);
- ::glGetRenderbufferParameterivEXT(target, pname, value);
-}
-
-void GraphicsContext3D::getShaderiv(Platform3DObject shader, unsigned long pname, int* value)
-{
- ASSERT(shader);
-
- ensureContext(m_contextObj);
-
- HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
-
- switch (pname) {
- case DELETE_STATUS:
- case SHADER_TYPE:
- // Let OpenGL handle these.
-
- ::glGetShaderiv((GLuint) shader, pname, value);
- break;
-
- case COMPILE_STATUS:
- if (result == m_shaderSourceMap.end()) {
- (*value) = static_cast<int>(false);
- return;
- }
-
- (*value) = static_cast<int>(result->second.isValid);
- break;
-
- case INFO_LOG_LENGTH:
- if (result == m_shaderSourceMap.end()) {
- (*value) = 0;
- return;
- }
-
- (*value) = getShaderInfoLog(shader).length();
- break;
-
- case SHADER_SOURCE_LENGTH:
- (*value) = getShaderSource(shader).length();
- break;
-
- default:
- synthesizeGLError(INVALID_ENUM);
- }
-}
-
-String GraphicsContext3D::getShaderInfoLog(Platform3DObject shader)
-{
- ASSERT(shader);
-
- ensureContext(m_contextObj);
- GLint length;
- ::glGetShaderiv((GLuint) shader, GL_INFO_LOG_LENGTH, &length);
-
- HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
-
- if (result == m_shaderSourceMap.end())
- return "";
-
- ShaderSourceEntry entry = result->second;
-
- if (entry.isValid) {
- GLint length;
- ::glGetShaderiv((GLuint) shader, GL_INFO_LOG_LENGTH, &length);
-
- GLsizei size;
- GLchar* info = (GLchar*) fastMalloc(length);
- if (!info)
- return "";
-
- ::glGetShaderInfoLog((GLuint) shader, length, &size, info);
-
- String s(info);
- fastFree(info);
- return s;
- }
- else {
- return entry.log;
- }
-}
-
-String GraphicsContext3D::getShaderSource(Platform3DObject shader)
-{
- ASSERT(shader);
-
- ensureContext(m_contextObj);
-
- HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
-
- if (result == m_shaderSourceMap.end())
- return "";
-
- return result->second.source;
-}
-
-
-void GraphicsContext3D::getTexParameterfv(unsigned long target, unsigned long pname, float* value)
-{
- ensureContext(m_contextObj);
- ::glGetTexParameterfv(target, pname, value);
-}
-
-void GraphicsContext3D::getTexParameteriv(unsigned long target, unsigned long pname, int* value)
-{
- ensureContext(m_contextObj);
- ::glGetTexParameteriv(target, pname, value);
-}
-
-void GraphicsContext3D::getUniformfv(Platform3DObject program, long location, float* value)
-{
- ensureContext(m_contextObj);
- ::glGetUniformfv((GLuint) program, location, value);
-}
-
-void GraphicsContext3D::getUniformiv(Platform3DObject program, long location, int* value)
-{
- ensureContext(m_contextObj);
- ::glGetUniformiv((GLuint) program, location, value);
-}
-
-long GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name)
-{
- ASSERT(program);
-
- ensureContext(m_contextObj);
- return ::glGetUniformLocation((GLuint) program, name.utf8().data());
-}
-
-void GraphicsContext3D::getVertexAttribfv(unsigned long index, unsigned long pname, float* value)
-{
- ensureContext(m_contextObj);
- ::glGetVertexAttribfv(index, pname, value);
-}
-
-void GraphicsContext3D::getVertexAttribiv(unsigned long index, unsigned long pname, int* value)
-{
- ensureContext(m_contextObj);
- ::glGetVertexAttribiv(index, pname, value);
-}
-
-long GraphicsContext3D::getVertexAttribOffset(unsigned long index, unsigned long pname)
-{
- ensureContext(m_contextObj);
-
- void* pointer;
- ::glGetVertexAttribPointerv(index, pname, &pointer);
- return reinterpret_cast<long>(pointer);
-}
-
-int GraphicsContext3D::texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels)
-{
- ensureContext(m_contextObj);
-
- ::glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
- return 0;
-}
-
-int GraphicsContext3D::texSubImage2D(unsigned target, unsigned level, unsigned xoff, unsigned yoff, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels)
-{
- ensureContext(m_contextObj);
-
- // FIXME: we will need to deal with PixelStore params when dealing with image buffers that differ from the subimage size
- ::glTexSubImage2D(target, level, xoff, yoff, width, height, format, type, pixels);
- return 0;
-}
-
-unsigned GraphicsContext3D::createBuffer()
-{
- ensureContext(m_contextObj);
- GLuint o;
- glGenBuffers(1, &o);
- return o;
-}
-
-unsigned GraphicsContext3D::createFramebuffer()
-{
- ensureContext(m_contextObj);
- GLuint o;
- glGenFramebuffersEXT(1, &o);
- return o;
-}
-
-unsigned GraphicsContext3D::createProgram()
-{
- ensureContext(m_contextObj);
- return glCreateProgram();
-}
-
-unsigned GraphicsContext3D::createRenderbuffer()
-{
- ensureContext(m_contextObj);
- GLuint o;
- glGenRenderbuffersEXT(1, &o);
- return o;
-}
-
-unsigned GraphicsContext3D::createShader(unsigned long type)
-{
- ensureContext(m_contextObj);
- return glCreateShader((type == FRAGMENT_SHADER) ? GL_FRAGMENT_SHADER : GL_VERTEX_SHADER);
-}
-
-unsigned GraphicsContext3D::createTexture()
-{
- ensureContext(m_contextObj);
- GLuint o;
- glGenTextures(1, &o);
- return o;
-}
-
-void GraphicsContext3D::deleteBuffer(unsigned buffer)
-{
- ensureContext(m_contextObj);
- glDeleteBuffers(1, &buffer);
-}
-
-void GraphicsContext3D::deleteFramebuffer(unsigned framebuffer)
-{
- ensureContext(m_contextObj);
- glDeleteFramebuffersEXT(1, &framebuffer);
-}
-
-void GraphicsContext3D::deleteProgram(unsigned program)
-{
- ensureContext(m_contextObj);
- glDeleteProgram(program);
-}
-
-void GraphicsContext3D::deleteRenderbuffer(unsigned renderbuffer)
-{
- ensureContext(m_contextObj);
- glDeleteRenderbuffersEXT(1, &renderbuffer);
-}
-
-void GraphicsContext3D::deleteShader(unsigned shader)
-{
- ensureContext(m_contextObj);
- glDeleteShader(shader);
-}
-
-void GraphicsContext3D::deleteTexture(unsigned texture)
-{
- ensureContext(m_contextObj);
- glDeleteTextures(1, &texture);
-}
-
-int GraphicsContext3D::sizeInBytes(int type)
-{
- switch (type) {
- case GL_BYTE:
- return sizeof(GLbyte);
- case GL_UNSIGNED_BYTE:
- return sizeof(GLubyte);
- case GL_SHORT:
- return sizeof(GLshort);
- case GL_UNSIGNED_SHORT:
- return sizeof(GLushort);
- case GL_INT:
- return sizeof(GLint);
- case GL_UNSIGNED_INT:
- return sizeof(GLuint);
- case GL_FLOAT:
- return sizeof(GLfloat);
- default:
- return 0;
- }
-}
-
-void GraphicsContext3D::synthesizeGLError(unsigned long error)
-{
- m_syntheticErrors.add(error);
-}
}
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.h b/WebCore/platform/graphics/mac/GraphicsLayerCA.h
index a9f747a..6ff3ff0 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.h
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.h
@@ -112,8 +112,6 @@ public:
virtual void setDebugBackgroundColor(const Color&);
virtual void setDebugBorder(const Color&, float borderWidth);
- virtual void setGeometryOrientation(CompositingCoordinatesOrientation);
-
virtual void didDisplay(PlatformLayer*);
void recursiveCommitChanges();
@@ -259,7 +257,6 @@ private:
void updateContentsMediaLayer();
void updateContentsCanvasLayer();
void updateContentsRect();
- void updateGeometryOrientation();
void updateMaskLayer();
void updateReplicatedLayers();
@@ -304,10 +301,9 @@ private:
ContentsMediaLayerChanged = 1 << 18,
ContentsCanvasLayerChanged = 1 << 19,
ContentsRectChanged = 1 << 20,
- GeometryOrientationChanged = 1 << 21,
- MaskLayerChanged = 1 << 22,
- ReplicatedLayerChanged = 1 << 23,
- ContentsNeedsDisplay = 1 << 24
+ MaskLayerChanged = 1 << 21,
+ ReplicatedLayerChanged = 1 << 22,
+ ContentsNeedsDisplay = 1 << 23
};
typedef unsigned LayerChangeFlags;
void noteLayerPropertyChanged(LayerChangeFlags flags);
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
index 5fedaff..395a691 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
@@ -263,15 +263,6 @@ static String animationIdentifier(AnimatedPropertyID property, const String& key
return builder.toString();
}
-#if !HAVE_MODERN_QUARTZCORE
-static TransformationMatrix flipTransform()
-{
- TransformationMatrix flipper;
- flipper.flipY();
- return flipper;
-}
-#endif
-
static CAMediaTimingFunction* getCAMediaTimingFunction(const TimingFunction* timingFunction)
{
// By this point, timing functions can only be linear or cubic, not steps.
@@ -332,11 +323,6 @@ static bool forceSoftwareAnimation()
return forceSoftwareAnimation;
}
-GraphicsLayer::CompositingCoordinatesOrientation GraphicsLayer::compositingCoordinatesOrientation()
-{
- return CompositingCoordinatesBottomUp;
-}
-
static NSDictionary* nullActionsDictionary()
{
NSNull* nullValue = [NSNull null];
@@ -831,28 +817,6 @@ void GraphicsLayerCA::setContentsToMedia(PlatformLayer* mediaLayer)
noteLayerPropertyChanged(ContentsMediaLayerChanged);
}
-void GraphicsLayerCA::setGeometryOrientation(CompositingCoordinatesOrientation orientation)
-{
- if (orientation == m_geometryOrientation)
- return;
-
- GraphicsLayer::setGeometryOrientation(orientation);
- noteLayerPropertyChanged(GeometryOrientationChanged);
-
-#if !HAVE_MODERN_QUARTZCORE
- // Geometry orientation is mapped onto children transform in older QuartzCores.
- switch (m_geometryOrientation) {
- case CompositingCoordinatesTopDown:
- setChildrenTransform(TransformationMatrix());
- break;
-
- case CompositingCoordinatesBottomUp:
- setChildrenTransform(flipTransform());
- break;
- }
-#endif
-}
-
void GraphicsLayerCA::didDisplay(PlatformLayer* layer)
{
CALayer* sourceLayer;
@@ -984,9 +948,6 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers()
if (m_uncommittedChanges & ContentsRectChanged)
updateContentsRect();
- if (m_uncommittedChanges & GeometryOrientationChanged)
- updateGeometryOrientation();
-
if (m_uncommittedChanges & MaskLayerChanged)
updateMaskLayer();
@@ -1461,23 +1422,6 @@ void GraphicsLayerCA::updateContentsRect()
}
}
-void GraphicsLayerCA::updateGeometryOrientation()
-{
-#if HAVE_MODERN_QUARTZCORE
- switch (geometryOrientation()) {
- case CompositingCoordinatesTopDown:
- [m_layer.get() setGeometryFlipped:NO];
- break;
-
- case CompositingCoordinatesBottomUp:
- [m_layer.get() setGeometryFlipped:YES];
- break;
- }
- // Geometry orientation is mapped onto children transform in older QuartzCores,
- // so is handled via setGeometryOrientation().
-#endif
-}
-
void GraphicsLayerCA::updateMaskLayer()
{
CALayer *maskCALayer = m_maskLayer ? m_maskLayer->platformLayer() : 0;
@@ -2226,11 +2170,7 @@ void GraphicsLayerCA::swapFromOrToTiledLayer(bool useTiledLayer)
[tiledLayer setTileSize:tileSize];
[tiledLayer setLevelsOfDetail:1];
[tiledLayer setLevelsOfDetailBias:0];
-
- if (GraphicsLayer::compositingCoordinatesOrientation() == GraphicsLayer::CompositingCoordinatesBottomUp)
- [tiledLayer setContentsGravity:@"bottomLeft"];
- else
- [tiledLayer setContentsGravity:@"topLeft"];
+ [tiledLayer setContentsGravity:@"bottomLeft"];
#if !HAVE_MODERN_QUARTZCORE
// Tiled layer has issues with flipped coordinates.
diff --git a/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp b/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
new file mode 100644
index 0000000..53d9b86
--- /dev/null
+++ b/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
@@ -0,0 +1,1454 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(3D_CANVAS)
+
+#include "GraphicsContext3D.h"
+
+#include "ArrayBuffer.h"
+#include "ArrayBufferView.h"
+#include "WebGLObject.h"
+#include "CanvasRenderingContext.h"
+#include "Float32Array.h"
+#include "GraphicsContext.h"
+#include "HTMLCanvasElement.h"
+#include "ImageBuffer.h"
+#include "Int32Array.h"
+#include "NotImplemented.h"
+#include "Uint8Array.h"
+
+#if PLATFORM(MAC)
+#include <OpenGL/gl.h>
+#endif
+
+#include <wtf/UnusedParam.h>
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+void GraphicsContext3D::validateAttributes()
+{
+ const char* extensions = reinterpret_cast<const char*>(::glGetString(GL_EXTENSIONS));
+ if (m_attrs.stencil) {
+ if (std::strstr(extensions, "GL_EXT_packed_depth_stencil")) {
+ if (!m_attrs.depth)
+ m_attrs.depth = true;
+ } else
+ m_attrs.stencil = false;
+ }
+ if (m_attrs.antialias) {
+ bool isValidVendor = true;
+ // Currently in Mac we only turn on antialias if vendor is NVIDIA.
+ const char* vendor = reinterpret_cast<const char*>(::glGetString(GL_VENDOR));
+ if (!std::strstr(vendor, "NVIDIA"))
+ isValidVendor = false;
+ if (!isValidVendor || !std::strstr(extensions, "GL_EXT_framebuffer_multisample"))
+ m_attrs.antialias = false;
+ }
+ // FIXME: instead of enforcing premultipliedAlpha = true, implement the
+ // correct behavior when premultipliedAlpha = false is requested.
+ m_attrs.premultipliedAlpha = true;
+}
+
+void GraphicsContext3D::paintRenderingResultsToCanvas(CanvasRenderingContext* 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;
+
+ makeContextCurrent();
+
+ 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::reshape(int width, int height)
+{
+ if (width == m_currentWidth && height == m_currentHeight || !m_contextObj)
+ return;
+
+ m_currentWidth = width;
+ m_currentHeight = height;
+
+ makeContextCurrent();
+
+ GLuint internalColorFormat, colorFormat, internalDepthStencilFormat = 0;
+ if (m_attrs.alpha) {
+ internalColorFormat = GL_RGBA8;
+ colorFormat = GL_RGBA;
+ } else {
+ internalColorFormat = GL_RGB8;
+ colorFormat = GL_RGB;
+ }
+ if (m_attrs.stencil || m_attrs.depth) {
+ // We don't allow the logic where stencil is required and depth is not.
+ // See GraphicsContext3D constructor.
+ if (m_attrs.stencil && m_attrs.depth)
+ internalDepthStencilFormat = GL_DEPTH24_STENCIL8_EXT;
+ else
+ internalDepthStencilFormat = GL_DEPTH_COMPONENT;
+ }
+
+ bool mustRestoreFBO = false;
+
+ // resize multisample FBO
+ if (m_attrs.antialias) {
+ GLint maxSampleCount;
+ ::glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSampleCount);
+ GLint sampleCount = std::min(8, maxSampleCount);
+ if (sampleCount > maxSampleCount)
+ sampleCount = maxSampleCount;
+ if (m_boundFBO != m_multisampleFBO) {
+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
+ mustRestoreFBO = true;
+ }
+ ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleColorBuffer);
+ ::glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, internalColorFormat, width, height);
+ ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, m_multisampleColorBuffer);
+ if (m_attrs.stencil || m_attrs.depth) {
+ ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
+ ::glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, internalDepthStencilFormat, width, height);
+ if (m_attrs.stencil)
+ ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
+ if (m_attrs.depth)
+ ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
+ }
+ ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
+ if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ // FIXME: cleanup.
+ notImplemented();
+ }
+ }
+
+ // resize regular FBO
+ if (m_boundFBO != m_fbo) {
+ mustRestoreFBO = true;
+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+ }
+ ::glBindTexture(GL_TEXTURE_2D, m_texture);
+ ::glTexImage2D(GL_TEXTURE_2D, 0, internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
+ ::glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, m_texture, 0);
+ ::glBindTexture(GL_TEXTURE_2D, 0);
+ if (!m_attrs.antialias && (m_attrs.stencil || m_attrs.depth)) {
+ ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_depthStencilBuffer);
+ ::glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, internalDepthStencilFormat, width, height);
+ if (m_attrs.stencil)
+ ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthStencilBuffer);
+ if (m_attrs.depth)
+ ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthStencilBuffer);
+ ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
+ }
+ if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ // FIXME: cleanup
+ notImplemented();
+ }
+
+ if (m_attrs.antialias) {
+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
+ if (m_boundFBO == m_multisampleFBO)
+ mustRestoreFBO = false;
+ }
+
+ // Initialize renderbuffers to 0.
+ GLboolean colorMask[] = {GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE}, depthMask = GL_TRUE, stencilMask = GL_TRUE;
+ GLboolean isScissorEnabled = GL_FALSE;
+ GLboolean isDitherEnabled = GL_FALSE;
+ GLbitfield clearMask = GL_COLOR_BUFFER_BIT;
+ ::glGetBooleanv(GL_COLOR_WRITEMASK, colorMask);
+ ::glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+ if (m_attrs.depth) {
+ ::glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMask);
+ ::glDepthMask(GL_TRUE);
+ clearMask |= GL_DEPTH_BUFFER_BIT;
+ }
+ if (m_attrs.stencil) {
+ ::glGetBooleanv(GL_STENCIL_WRITEMASK, &stencilMask);
+ ::glStencilMask(GL_TRUE);
+ clearMask |= GL_STENCIL_BUFFER_BIT;
+ }
+ isScissorEnabled = ::glIsEnabled(GL_SCISSOR_TEST);
+ ::glDisable(GL_SCISSOR_TEST);
+ isDitherEnabled = ::glIsEnabled(GL_DITHER);
+ ::glDisable(GL_DITHER);
+
+ ::glClear(clearMask);
+
+ ::glColorMask(colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
+ if (m_attrs.depth)
+ ::glDepthMask(depthMask);
+ if (m_attrs.stencil)
+ ::glStencilMask(stencilMask);
+ if (isScissorEnabled)
+ ::glEnable(GL_SCISSOR_TEST);
+ else
+ ::glDisable(GL_SCISSOR_TEST);
+ if (isDitherEnabled)
+ ::glEnable(GL_DITHER);
+ else
+ ::glDisable(GL_DITHER);
+
+ if (mustRestoreFBO)
+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
+
+ ::glFlush();
+}
+
+void GraphicsContext3D::prepareTexture()
+{
+ makeContextCurrent();
+ 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_boundFBO);
+ }
+ ::glFinish();
+}
+
+void GraphicsContext3D::activeTexture(unsigned long texture)
+{
+ makeContextCurrent();
+ ::glActiveTexture(texture);
+}
+
+void GraphicsContext3D::attachShader(Platform3DObject program, Platform3DObject shader)
+{
+ ASSERT(program);
+ ASSERT(shader);
+ makeContextCurrent();
+ ::glAttachShader((GLuint) program, (GLuint) shader);
+}
+
+void GraphicsContext3D::bindAttribLocation(Platform3DObject program, unsigned long index, const String& name)
+{
+ ASSERT(program);
+ makeContextCurrent();
+ ::glBindAttribLocation((GLuint) program, index, name.utf8().data());
+}
+
+void GraphicsContext3D::bindBuffer(unsigned long target, Platform3DObject buffer)
+{
+ makeContextCurrent();
+ ::glBindBuffer(target, (GLuint) buffer);
+}
+
+
+void GraphicsContext3D::bindFramebuffer(unsigned long target, Platform3DObject buffer)
+{
+ makeContextCurrent();
+ GLuint fbo;
+ if (buffer)
+ fbo = (GLuint)buffer;
+ else
+ fbo = (m_attrs.antialias ? m_multisampleFBO : m_fbo);
+ if (fbo != m_boundFBO) {
+ ::glBindFramebufferEXT(target, fbo);
+ m_boundFBO = fbo;
+ }
+}
+
+void GraphicsContext3D::bindRenderbuffer(unsigned long target, Platform3DObject renderbuffer)
+{
+ makeContextCurrent();
+ ::glBindRenderbufferEXT(target, (GLuint) renderbuffer);
+}
+
+
+void GraphicsContext3D::bindTexture(unsigned long target, Platform3DObject texture)
+{
+ makeContextCurrent();
+ ::glBindTexture(target, (GLuint) texture);
+}
+
+void GraphicsContext3D::blendColor(double red, double green, double blue, double alpha)
+{
+ makeContextCurrent();
+ ::glBlendColor(static_cast<float>(red), static_cast<float>(green), static_cast<float>(blue), static_cast<float>(alpha));
+}
+
+void GraphicsContext3D::blendEquation( unsigned long mode )
+{
+ makeContextCurrent();
+ ::glBlendEquation(mode);
+}
+
+void GraphicsContext3D::blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha)
+{
+ makeContextCurrent();
+ ::glBlendEquationSeparate(modeRGB, modeAlpha);
+}
+
+
+void GraphicsContext3D::blendFunc(unsigned long sfactor, unsigned long dfactor)
+{
+ makeContextCurrent();
+ ::glBlendFunc(sfactor, dfactor);
+}
+
+void GraphicsContext3D::blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha)
+{
+ makeContextCurrent();
+ ::glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+}
+
+void GraphicsContext3D::bufferData(unsigned long target, int size, unsigned long usage)
+{
+ makeContextCurrent();
+ ::glBufferData(target, size, 0, usage);
+}
+
+void GraphicsContext3D::bufferData(unsigned long target, int size, const void* data, unsigned long usage)
+{
+ makeContextCurrent();
+ ::glBufferData(target, size, data, usage);
+}
+
+void GraphicsContext3D::bufferSubData(unsigned long target, long offset, int size, const void* data)
+{
+ makeContextCurrent();
+ ::glBufferSubData(target, offset, size, data);
+}
+
+unsigned long GraphicsContext3D::checkFramebufferStatus(unsigned long target)
+{
+ makeContextCurrent();
+ return ::glCheckFramebufferStatusEXT(target);
+}
+
+void GraphicsContext3D::clearColor(double r, double g, double b, double a)
+{
+ makeContextCurrent();
+ ::glClearColor(static_cast<float>(r), static_cast<float>(g), static_cast<float>(b), static_cast<float>(a));
+}
+
+void GraphicsContext3D::clear(unsigned long mask)
+{
+ makeContextCurrent();
+ ::glClear(mask);
+}
+
+void GraphicsContext3D::clearDepth(double depth)
+{
+ makeContextCurrent();
+ ::glClearDepth(depth);
+}
+
+void GraphicsContext3D::clearStencil(long s)
+{
+ makeContextCurrent();
+ ::glClearStencil(s);
+}
+
+void GraphicsContext3D::colorMask(bool red, bool green, bool blue, bool alpha)
+{
+ makeContextCurrent();
+ ::glColorMask(red, green, blue, alpha);
+}
+
+void GraphicsContext3D::compileShader(Platform3DObject shader)
+{
+ ASSERT(shader);
+ makeContextCurrent();
+
+ int GLshaderType;
+ ANGLEShaderType shaderType;
+
+ glGetShaderiv(shader, SHADER_TYPE, &GLshaderType);
+
+ if (GLshaderType == VERTEX_SHADER)
+ shaderType = SHADER_TYPE_VERTEX;
+ else if (GLshaderType == FRAGMENT_SHADER)
+ shaderType = SHADER_TYPE_FRAGMENT;
+ else
+ return; // Invalid shader type.
+
+ HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
+
+ if (result == m_shaderSourceMap.end())
+ return;
+
+ ShaderSourceEntry& entry = result->second;
+
+ String translatedShaderSource;
+ String shaderInfoLog;
+
+ bool isValid = m_compiler.validateShaderSource(entry.source.utf8().data(), shaderType, translatedShaderSource, shaderInfoLog);
+
+ entry.log = shaderInfoLog;
+ entry.isValid = isValid;
+
+ if (!isValid)
+ return; // Shader didn't validate, don't move forward with compiling translated source
+
+ int translatedShaderLength = translatedShaderSource.length();
+
+ const CString& translatedShaderCString = translatedShaderSource.utf8();
+ const char* translatedShaderPtr = translatedShaderCString.data();
+
+ ::glShaderSource((GLuint) shader, 1, &translatedShaderPtr, &translatedShaderLength);
+
+ ::glCompileShader((GLuint) shader);
+
+ int GLCompileSuccess;
+
+ ::glGetShaderiv((GLuint) shader, COMPILE_STATUS, &GLCompileSuccess);
+
+ // ASSERT that ANGLE generated GLSL will be accepted by OpenGL
+ ASSERT(GLCompileSuccess == GL_TRUE);
+}
+
+void GraphicsContext3D::copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border)
+{
+ makeContextCurrent();
+ if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
+ ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
+ ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
+ ::glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+ }
+ ::glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+ if (m_attrs.antialias && m_boundFBO == m_multisampleFBO)
+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
+}
+
+void GraphicsContext3D::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height)
+{
+ makeContextCurrent();
+ if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
+ ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
+ ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
+ ::glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+ }
+ ::glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+ if (m_attrs.antialias && m_boundFBO == m_multisampleFBO)
+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
+}
+
+void GraphicsContext3D::cullFace(unsigned long mode)
+{
+ makeContextCurrent();
+ ::glCullFace(mode);
+}
+
+void GraphicsContext3D::depthFunc(unsigned long func)
+{
+ makeContextCurrent();
+ ::glDepthFunc(func);
+}
+
+void GraphicsContext3D::depthMask(bool flag)
+{
+ makeContextCurrent();
+ ::glDepthMask(flag);
+}
+
+void GraphicsContext3D::depthRange(double zNear, double zFar)
+{
+ makeContextCurrent();
+ ::glDepthRange(zNear, zFar);
+}
+
+void GraphicsContext3D::detachShader(Platform3DObject program, Platform3DObject shader)
+{
+ ASSERT(program);
+ ASSERT(shader);
+ makeContextCurrent();
+ ::glDetachShader((GLuint) program, (GLuint) shader);
+}
+
+void GraphicsContext3D::disable(unsigned long cap)
+{
+ makeContextCurrent();
+ ::glDisable(cap);
+}
+
+void GraphicsContext3D::disableVertexAttribArray(unsigned long index)
+{
+ makeContextCurrent();
+ ::glDisableVertexAttribArray(index);
+}
+
+void GraphicsContext3D::drawArrays(unsigned long mode, long first, long count)
+{
+ makeContextCurrent();
+ ::glDrawArrays(mode, first, count);
+}
+
+void GraphicsContext3D::drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset)
+{
+ makeContextCurrent();
+ ::glDrawElements(mode, count, type, reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
+}
+
+void GraphicsContext3D::enable(unsigned long cap)
+{
+ makeContextCurrent();
+ ::glEnable(cap);
+}
+
+void GraphicsContext3D::enableVertexAttribArray(unsigned long index)
+{
+ makeContextCurrent();
+ ::glEnableVertexAttribArray(index);
+}
+
+void GraphicsContext3D::finish()
+{
+ makeContextCurrent();
+ ::glFinish();
+}
+
+void GraphicsContext3D::flush()
+{
+ makeContextCurrent();
+ ::glFlush();
+}
+
+void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject buffer)
+{
+ makeContextCurrent();
+ GLuint renderbuffer = (GLuint) buffer;
+ if (attachment == DEPTH_STENCIL_ATTACHMENT) {
+ ::glFramebufferRenderbufferEXT(target, DEPTH_ATTACHMENT, renderbuffertarget, renderbuffer);
+ ::glFramebufferRenderbufferEXT(target, STENCIL_ATTACHMENT, renderbuffertarget, renderbuffer);
+ } else
+ ::glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
+}
+
+void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject texture, long level)
+{
+ makeContextCurrent();
+ ::glFramebufferTexture2DEXT(target, attachment, textarget, (GLuint) texture, level);
+}
+
+void GraphicsContext3D::frontFace(unsigned long mode)
+{
+ makeContextCurrent();
+ ::glFrontFace(mode);
+}
+
+void GraphicsContext3D::generateMipmap(unsigned long target)
+{
+ makeContextCurrent();
+ ::glGenerateMipmapEXT(target);
+}
+
+bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo& info)
+{
+ if (!program) {
+ synthesizeGLError(INVALID_VALUE);
+ return false;
+ }
+ makeContextCurrent();
+ GLint maxAttributeSize = 0;
+ ::glGetProgramiv(static_cast<GLuint>(program), GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxAttributeSize);
+ GLchar name[maxAttributeSize]; // GL_ACTIVE_ATTRIBUTE_MAX_LENGTH includes null termination
+ GLsizei nameLength = 0;
+ GLint size = 0;
+ GLenum type = 0;
+ ::glGetActiveAttrib(static_cast<GLuint>(program), index, maxAttributeSize, &nameLength, &size, &type, name);
+ if (!nameLength)
+ return false;
+ info.name = String(name, nameLength);
+ info.type = type;
+ info.size = size;
+ return true;
+}
+
+bool GraphicsContext3D::getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo& info)
+{
+ if (!program) {
+ synthesizeGLError(INVALID_VALUE);
+ return false;
+ }
+ makeContextCurrent();
+ GLint maxUniformSize = 0;
+ ::glGetProgramiv(static_cast<GLuint>(program), GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxUniformSize);
+ GLchar name[maxUniformSize]; // GL_ACTIVE_UNIFORM_MAX_LENGTH includes null termination
+ GLsizei nameLength = 0;
+ GLint size = 0;
+ GLenum type = 0;
+ ::glGetActiveUniform(static_cast<GLuint>(program), index, maxUniformSize, &nameLength, &size, &type, name);
+ if (!nameLength)
+ return false;
+ info.name = String(name, nameLength);
+ info.type = type;
+ info.size = size;
+ return true;
+}
+
+void GraphicsContext3D::getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders)
+{
+ if (!program) {
+ synthesizeGLError(INVALID_VALUE);
+ return;
+ }
+ makeContextCurrent();
+ ::glGetAttachedShaders(static_cast<GLuint>(program), maxCount, count, shaders);
+}
+
+int GraphicsContext3D::getAttribLocation(Platform3DObject program, const String& name)
+{
+ if (!program)
+ return -1;
+
+ makeContextCurrent();
+ return ::glGetAttribLocation((GLuint) program, name.utf8().data());
+}
+
+GraphicsContext3D::Attributes GraphicsContext3D::getContextAttributes()
+{
+ return m_attrs;
+}
+
+unsigned long GraphicsContext3D::getError()
+{
+ if (m_syntheticErrors.size() > 0) {
+ ListHashSet<unsigned long>::iterator iter = m_syntheticErrors.begin();
+ unsigned long err = *iter;
+ m_syntheticErrors.remove(iter);
+ return err;
+ }
+
+ makeContextCurrent();
+ return ::glGetError();
+}
+
+String GraphicsContext3D::getString(unsigned long name)
+{
+ makeContextCurrent();
+ return String((const char*) ::glGetString(name));
+}
+
+void GraphicsContext3D::hint(unsigned long target, unsigned long mode)
+{
+ makeContextCurrent();
+ ::glHint(target, mode);
+}
+
+bool GraphicsContext3D::isBuffer(Platform3DObject buffer)
+{
+ if (!buffer)
+ return false;
+
+ makeContextCurrent();
+ return ::glIsBuffer((GLuint) buffer);
+}
+
+bool GraphicsContext3D::isEnabled(unsigned long cap)
+{
+ makeContextCurrent();
+ return ::glIsEnabled(cap);
+}
+
+bool GraphicsContext3D::isFramebuffer(Platform3DObject framebuffer)
+{
+ if (!framebuffer)
+ return false;
+
+ makeContextCurrent();
+ return ::glIsFramebufferEXT((GLuint) framebuffer);
+}
+
+bool GraphicsContext3D::isProgram(Platform3DObject program)
+{
+ if (!program)
+ return false;
+
+ makeContextCurrent();
+ return ::glIsProgram((GLuint) program);
+}
+
+bool GraphicsContext3D::isRenderbuffer(Platform3DObject renderbuffer)
+{
+ if (!renderbuffer)
+ return false;
+
+ makeContextCurrent();
+ return ::glIsRenderbufferEXT((GLuint) renderbuffer);
+}
+
+bool GraphicsContext3D::isShader(Platform3DObject shader)
+{
+ if (!shader)
+ return false;
+
+ makeContextCurrent();
+ return ::glIsShader((GLuint) shader);
+}
+
+bool GraphicsContext3D::isTexture(Platform3DObject texture)
+{
+ if (!texture)
+ return false;
+
+ makeContextCurrent();
+ return ::glIsTexture((GLuint) texture);
+}
+
+void GraphicsContext3D::lineWidth(double width)
+{
+ makeContextCurrent();
+ ::glLineWidth(static_cast<float>(width));
+}
+
+void GraphicsContext3D::linkProgram(Platform3DObject program)
+{
+ ASSERT(program);
+ makeContextCurrent();
+ ::glLinkProgram((GLuint) program);
+}
+
+void GraphicsContext3D::pixelStorei(unsigned long pname, long param)
+{
+ makeContextCurrent();
+ ::glPixelStorei(pname, param);
+}
+
+void GraphicsContext3D::polygonOffset(double factor, double units)
+{
+ makeContextCurrent();
+ ::glPolygonOffset(static_cast<float>(factor), static_cast<float>(units));
+}
+
+void GraphicsContext3D::readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data)
+{
+ // FIXME: remove the two glFlush calls when the driver bug is fixed, i.e.,
+ // all previous rendering calls should be done before reading pixels.
+ makeContextCurrent();
+ ::glFlush();
+ if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
+ ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
+ ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
+ ::glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+ ::glFlush();
+ }
+ ::glReadPixels(x, y, width, height, format, type, data);
+ if (m_attrs.antialias && m_boundFBO == m_multisampleFBO)
+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
+}
+
+void GraphicsContext3D::releaseShaderCompiler()
+{
+ // FIXME: This is not implemented on desktop OpenGL. We need to have ifdefs for the different GL variants
+ makeContextCurrent();
+ //::glReleaseShaderCompiler();
+}
+
+void GraphicsContext3D::renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height)
+{
+ makeContextCurrent();
+ switch (internalformat) {
+ case DEPTH_STENCIL:
+ internalformat = GL_DEPTH24_STENCIL8_EXT;
+ break;
+ case DEPTH_COMPONENT16:
+ internalformat = GL_DEPTH_COMPONENT;
+ break;
+ case RGBA4:
+ case RGB5_A1:
+ internalformat = GL_RGBA;
+ break;
+ case RGB565:
+ internalformat = GL_RGB;
+ break;
+ }
+ ::glRenderbufferStorageEXT(target, internalformat, width, height);
+}
+
+void GraphicsContext3D::sampleCoverage(double value, bool invert)
+{
+ makeContextCurrent();
+ ::glSampleCoverage(static_cast<float>(value), invert);
+}
+
+void GraphicsContext3D::scissor(long x, long y, unsigned long width, unsigned long height)
+{
+ makeContextCurrent();
+ ::glScissor(x, y, width, height);
+}
+
+void GraphicsContext3D::shaderSource(Platform3DObject shader, const String& string)
+{
+ ASSERT(shader);
+
+ makeContextCurrent();
+
+ ShaderSourceEntry entry;
+
+ entry.source = string;
+
+ m_shaderSourceMap.set(shader, entry);
+}
+
+void GraphicsContext3D::stencilFunc(unsigned long func, long ref, unsigned long mask)
+{
+ makeContextCurrent();
+ ::glStencilFunc(func, ref, mask);
+}
+
+void GraphicsContext3D::stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask)
+{
+ makeContextCurrent();
+ ::glStencilFuncSeparate(face, func, ref, mask);
+}
+
+void GraphicsContext3D::stencilMask(unsigned long mask)
+{
+ makeContextCurrent();
+ ::glStencilMask(mask);
+}
+
+void GraphicsContext3D::stencilMaskSeparate(unsigned long face, unsigned long mask)
+{
+ makeContextCurrent();
+ ::glStencilMaskSeparate(face, mask);
+}
+
+void GraphicsContext3D::stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass)
+{
+ makeContextCurrent();
+ ::glStencilOp(fail, zfail, zpass);
+}
+
+void GraphicsContext3D::stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass)
+{
+ makeContextCurrent();
+ ::glStencilOpSeparate(face, fail, zfail, zpass);
+}
+
+void GraphicsContext3D::texParameterf(unsigned target, unsigned pname, float value)
+{
+ makeContextCurrent();
+ ::glTexParameterf(target, pname, static_cast<float>(value));
+}
+
+void GraphicsContext3D::texParameteri(unsigned target, unsigned pname, int value)
+{
+ makeContextCurrent();
+ ::glTexParameteri(target, pname, static_cast<float>(value));
+}
+
+void GraphicsContext3D::uniform1f(long location, float v0)
+{
+ makeContextCurrent();
+ ::glUniform1f(location, v0);
+}
+
+void GraphicsContext3D::uniform1fv(long location, float* array, int size)
+{
+ makeContextCurrent();
+ ::glUniform1fv(location, size, array);
+}
+
+void GraphicsContext3D::uniform2f(long location, float v0, float v1)
+{
+ makeContextCurrent();
+ ::glUniform2f(location, v0, v1);
+}
+
+void GraphicsContext3D::uniform2fv(long location, float* array, int size)
+{
+ // FIXME: length needs to be a multiple of 2
+ makeContextCurrent();
+ ::glUniform2fv(location, size, array);
+}
+
+void GraphicsContext3D::uniform3f(long location, float v0, float v1, float v2)
+{
+ makeContextCurrent();
+ ::glUniform3f(location, v0, v1, v2);
+}
+
+void GraphicsContext3D::uniform3fv(long location, float* array, int size)
+{
+ // FIXME: length needs to be a multiple of 3
+ makeContextCurrent();
+ ::glUniform3fv(location, size, array);
+}
+
+void GraphicsContext3D::uniform4f(long location, float v0, float v1, float v2, float v3)
+{
+ makeContextCurrent();
+ ::glUniform4f(location, v0, v1, v2, v3);
+}
+
+void GraphicsContext3D::uniform4fv(long location, float* array, int size)
+{
+ // FIXME: length needs to be a multiple of 4
+ makeContextCurrent();
+ ::glUniform4fv(location, size, array);
+}
+
+void GraphicsContext3D::uniform1i(long location, int v0)
+{
+ makeContextCurrent();
+ ::glUniform1i(location, v0);
+}
+
+void GraphicsContext3D::uniform1iv(long location, int* array, int size)
+{
+ makeContextCurrent();
+ ::glUniform1iv(location, size, array);
+}
+
+void GraphicsContext3D::uniform2i(long location, int v0, int v1)
+{
+ makeContextCurrent();
+ ::glUniform2i(location, v0, v1);
+}
+
+void GraphicsContext3D::uniform2iv(long location, int* array, int size)
+{
+ // FIXME: length needs to be a multiple of 2
+ makeContextCurrent();
+ ::glUniform2iv(location, size, array);
+}
+
+void GraphicsContext3D::uniform3i(long location, int v0, int v1, int v2)
+{
+ makeContextCurrent();
+ ::glUniform3i(location, v0, v1, v2);
+}
+
+void GraphicsContext3D::uniform3iv(long location, int* array, int size)
+{
+ // FIXME: length needs to be a multiple of 3
+ makeContextCurrent();
+ ::glUniform3iv(location, size, array);
+}
+
+void GraphicsContext3D::uniform4i(long location, int v0, int v1, int v2, int v3)
+{
+ makeContextCurrent();
+ ::glUniform4i(location, v0, v1, v2, v3);
+}
+
+void GraphicsContext3D::uniform4iv(long location, int* array, int size)
+{
+ // FIXME: length needs to be a multiple of 4
+ makeContextCurrent();
+ ::glUniform4iv(location, size, array);
+}
+
+void GraphicsContext3D::uniformMatrix2fv(long location, bool transpose, float* array, int size)
+{
+ // FIXME: length needs to be a multiple of 4
+ makeContextCurrent();
+ ::glUniformMatrix2fv(location, size, transpose, array);
+}
+
+void GraphicsContext3D::uniformMatrix3fv(long location, bool transpose, float* array, int size)
+{
+ // FIXME: length needs to be a multiple of 9
+ makeContextCurrent();
+ ::glUniformMatrix3fv(location, size, transpose, array);
+}
+
+void GraphicsContext3D::uniformMatrix4fv(long location, bool transpose, float* array, int size)
+{
+ // FIXME: length needs to be a multiple of 16
+ makeContextCurrent();
+ ::glUniformMatrix4fv(location, size, transpose, array);
+}
+
+void GraphicsContext3D::useProgram(Platform3DObject program)
+{
+ makeContextCurrent();
+ ::glUseProgram((GLuint) program);
+}
+
+void GraphicsContext3D::validateProgram(Platform3DObject program)
+{
+ ASSERT(program);
+
+ makeContextCurrent();
+ ::glValidateProgram((GLuint) program);
+}
+
+void GraphicsContext3D::vertexAttrib1f(unsigned long indx, float v0)
+{
+ makeContextCurrent();
+ ::glVertexAttrib1f(indx, v0);
+}
+
+void GraphicsContext3D::vertexAttrib1fv(unsigned long indx, float* array)
+{
+ makeContextCurrent();
+ ::glVertexAttrib1fv(indx, array);
+}
+
+void GraphicsContext3D::vertexAttrib2f(unsigned long indx, float v0, float v1)
+{
+ makeContextCurrent();
+ ::glVertexAttrib2f(indx, v0, v1);
+}
+
+void GraphicsContext3D::vertexAttrib2fv(unsigned long indx, float* array)
+{
+ makeContextCurrent();
+ ::glVertexAttrib2fv(indx, array);
+}
+
+void GraphicsContext3D::vertexAttrib3f(unsigned long indx, float v0, float v1, float v2)
+{
+ makeContextCurrent();
+ ::glVertexAttrib3f(indx, v0, v1, v2);
+}
+
+void GraphicsContext3D::vertexAttrib3fv(unsigned long indx, float* array)
+{
+ makeContextCurrent();
+ ::glVertexAttrib3fv(indx, array);
+}
+
+void GraphicsContext3D::vertexAttrib4f(unsigned long indx, float v0, float v1, float v2, float v3)
+{
+ makeContextCurrent();
+ ::glVertexAttrib4f(indx, v0, v1, v2, v3);
+}
+
+void GraphicsContext3D::vertexAttrib4fv(unsigned long indx, float* array)
+{
+ makeContextCurrent();
+ ::glVertexAttrib4fv(indx, array);
+}
+
+void GraphicsContext3D::vertexAttribPointer(unsigned long indx, int size, int type, bool normalized, unsigned long stride, unsigned long offset)
+{
+ makeContextCurrent();
+ ::glVertexAttribPointer(indx, size, type, normalized, stride, reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
+}
+
+void GraphicsContext3D::viewport(long x, long y, unsigned long width, unsigned long height)
+{
+ makeContextCurrent();
+ ::glViewport(static_cast<GLint>(x), static_cast<GLint>(y), static_cast<GLsizei>(width), static_cast<GLsizei>(height));
+}
+
+void GraphicsContext3D::getBooleanv(unsigned long pname, unsigned char* value)
+{
+ makeContextCurrent();
+ ::glGetBooleanv(pname, value);
+}
+
+void GraphicsContext3D::getBufferParameteriv(unsigned long target, unsigned long pname, int* value)
+{
+ makeContextCurrent();
+ ::glGetBufferParameteriv(target, pname, value);
+}
+
+void GraphicsContext3D::getFloatv(unsigned long pname, float* value)
+{
+ makeContextCurrent();
+ ::glGetFloatv(pname, value);
+}
+
+void GraphicsContext3D::getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value)
+{
+ makeContextCurrent();
+ if (attachment == DEPTH_STENCIL_ATTACHMENT)
+ attachment = DEPTH_ATTACHMENT; // Or STENCIL_ATTACHMENT, either works.
+ ::glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, value);
+}
+
+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.
+ makeContextCurrent();
+ switch (pname) {
+ case IMPLEMENTATION_COLOR_READ_FORMAT:
+ *value = GL_RGB;
+ break;
+ 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);
+ }
+}
+
+void GraphicsContext3D::getProgramiv(Platform3DObject program, unsigned long pname, int* value)
+{
+ makeContextCurrent();
+ ::glGetProgramiv((GLuint) program, pname, value);
+}
+
+String GraphicsContext3D::getProgramInfoLog(Platform3DObject program)
+{
+ ASSERT(program);
+
+ makeContextCurrent();
+ GLint length;
+ ::glGetProgramiv((GLuint) program, GL_INFO_LOG_LENGTH, &length);
+
+ GLsizei size;
+ GLchar* info = (GLchar*) fastMalloc(length);
+ if (!info)
+ return "";
+
+ ::glGetProgramInfoLog((GLuint) program, length, &size, info);
+ String s(info);
+ fastFree(info);
+ return s;
+}
+
+void GraphicsContext3D::getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value)
+{
+ makeContextCurrent();
+ ::glGetRenderbufferParameterivEXT(target, pname, value);
+}
+
+void GraphicsContext3D::getShaderiv(Platform3DObject shader, unsigned long pname, int* value)
+{
+ ASSERT(shader);
+
+ makeContextCurrent();
+
+ HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
+
+ switch (pname) {
+ case DELETE_STATUS:
+ case SHADER_TYPE:
+ // Let OpenGL handle these.
+
+ ::glGetShaderiv((GLuint) shader, pname, value);
+ break;
+
+ case COMPILE_STATUS:
+ if (result == m_shaderSourceMap.end()) {
+ (*value) = static_cast<int>(false);
+ return;
+ }
+
+ (*value) = static_cast<int>(result->second.isValid);
+ break;
+
+ case INFO_LOG_LENGTH:
+ if (result == m_shaderSourceMap.end()) {
+ (*value) = 0;
+ return;
+ }
+
+ (*value) = getShaderInfoLog(shader).length();
+ break;
+
+ case SHADER_SOURCE_LENGTH:
+ (*value) = getShaderSource(shader).length();
+ break;
+
+ default:
+ synthesizeGLError(INVALID_ENUM);
+ }
+}
+
+String GraphicsContext3D::getShaderInfoLog(Platform3DObject shader)
+{
+ ASSERT(shader);
+
+ makeContextCurrent();
+ GLint length;
+ ::glGetShaderiv((GLuint) shader, GL_INFO_LOG_LENGTH, &length);
+
+ HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
+
+ if (result == m_shaderSourceMap.end())
+ return "";
+
+ ShaderSourceEntry entry = result->second;
+
+ if (entry.isValid) {
+ GLint length;
+ ::glGetShaderiv((GLuint) shader, GL_INFO_LOG_LENGTH, &length);
+
+ GLsizei size;
+ GLchar* info = (GLchar*) fastMalloc(length);
+ if (!info)
+ return "";
+
+ ::glGetShaderInfoLog((GLuint) shader, length, &size, info);
+
+ String s(info);
+ fastFree(info);
+ return s;
+ }
+ else {
+ return entry.log;
+ }
+}
+
+String GraphicsContext3D::getShaderSource(Platform3DObject shader)
+{
+ ASSERT(shader);
+
+ makeContextCurrent();
+
+ HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
+
+ if (result == m_shaderSourceMap.end())
+ return "";
+
+ return result->second.source;
+}
+
+
+void GraphicsContext3D::getTexParameterfv(unsigned long target, unsigned long pname, float* value)
+{
+ makeContextCurrent();
+ ::glGetTexParameterfv(target, pname, value);
+}
+
+void GraphicsContext3D::getTexParameteriv(unsigned long target, unsigned long pname, int* value)
+{
+ makeContextCurrent();
+ ::glGetTexParameteriv(target, pname, value);
+}
+
+void GraphicsContext3D::getUniformfv(Platform3DObject program, long location, float* value)
+{
+ makeContextCurrent();
+ ::glGetUniformfv((GLuint) program, location, value);
+}
+
+void GraphicsContext3D::getUniformiv(Platform3DObject program, long location, int* value)
+{
+ makeContextCurrent();
+ ::glGetUniformiv((GLuint) program, location, value);
+}
+
+long GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name)
+{
+ ASSERT(program);
+
+ makeContextCurrent();
+ return ::glGetUniformLocation((GLuint) program, name.utf8().data());
+}
+
+void GraphicsContext3D::getVertexAttribfv(unsigned long index, unsigned long pname, float* value)
+{
+ makeContextCurrent();
+ ::glGetVertexAttribfv(index, pname, value);
+}
+
+void GraphicsContext3D::getVertexAttribiv(unsigned long index, unsigned long pname, int* value)
+{
+ makeContextCurrent();
+ ::glGetVertexAttribiv(index, pname, value);
+}
+
+long GraphicsContext3D::getVertexAttribOffset(unsigned long index, unsigned long pname)
+{
+ makeContextCurrent();
+
+ void* pointer;
+ ::glGetVertexAttribPointerv(index, pname, &pointer);
+ return reinterpret_cast<long>(pointer);
+}
+
+int GraphicsContext3D::texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels)
+{
+ makeContextCurrent();
+
+ ::glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+ return 0;
+}
+
+int GraphicsContext3D::texSubImage2D(unsigned target, unsigned level, unsigned xoff, unsigned yoff, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels)
+{
+ makeContextCurrent();
+
+ // FIXME: we will need to deal with PixelStore params when dealing with image buffers that differ from the subimage size
+ ::glTexSubImage2D(target, level, xoff, yoff, width, height, format, type, pixels);
+ return 0;
+}
+
+unsigned GraphicsContext3D::createBuffer()
+{
+ makeContextCurrent();
+ GLuint o;
+ glGenBuffers(1, &o);
+ return o;
+}
+
+unsigned GraphicsContext3D::createFramebuffer()
+{
+ makeContextCurrent();
+ GLuint o;
+ glGenFramebuffersEXT(1, &o);
+ return o;
+}
+
+unsigned GraphicsContext3D::createProgram()
+{
+ makeContextCurrent();
+ return glCreateProgram();
+}
+
+unsigned GraphicsContext3D::createRenderbuffer()
+{
+ makeContextCurrent();
+ GLuint o;
+ glGenRenderbuffersEXT(1, &o);
+ return o;
+}
+
+unsigned GraphicsContext3D::createShader(unsigned long type)
+{
+ makeContextCurrent();
+ return glCreateShader((type == FRAGMENT_SHADER) ? GL_FRAGMENT_SHADER : GL_VERTEX_SHADER);
+}
+
+unsigned GraphicsContext3D::createTexture()
+{
+ makeContextCurrent();
+ GLuint o;
+ glGenTextures(1, &o);
+ return o;
+}
+
+void GraphicsContext3D::deleteBuffer(unsigned buffer)
+{
+ makeContextCurrent();
+ glDeleteBuffers(1, &buffer);
+}
+
+void GraphicsContext3D::deleteFramebuffer(unsigned framebuffer)
+{
+ makeContextCurrent();
+ glDeleteFramebuffersEXT(1, &framebuffer);
+}
+
+void GraphicsContext3D::deleteProgram(unsigned program)
+{
+ makeContextCurrent();
+ glDeleteProgram(program);
+}
+
+void GraphicsContext3D::deleteRenderbuffer(unsigned renderbuffer)
+{
+ makeContextCurrent();
+ glDeleteRenderbuffersEXT(1, &renderbuffer);
+}
+
+void GraphicsContext3D::deleteShader(unsigned shader)
+{
+ makeContextCurrent();
+ glDeleteShader(shader);
+}
+
+void GraphicsContext3D::deleteTexture(unsigned texture)
+{
+ makeContextCurrent();
+ glDeleteTextures(1, &texture);
+}
+
+int GraphicsContext3D::sizeInBytes(int type)
+{
+ switch (type) {
+ case GL_BYTE:
+ return sizeof(GLbyte);
+ case GL_UNSIGNED_BYTE:
+ return sizeof(GLubyte);
+ case GL_SHORT:
+ return sizeof(GLshort);
+ case GL_UNSIGNED_SHORT:
+ return sizeof(GLushort);
+ case GL_INT:
+ return sizeof(GLint);
+ case GL_UNSIGNED_INT:
+ return sizeof(GLuint);
+ case GL_FLOAT:
+ return sizeof(GLfloat);
+ default:
+ return 0;
+ }
+}
+
+void GraphicsContext3D::synthesizeGLError(unsigned long error)
+{
+ m_syntheticErrors.add(error);
+}
+
+}
+
+#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/platform/graphics/qt/ContextShadow.cpp b/WebCore/platform/graphics/qt/ContextShadow.cpp
index 829ca82..4609923 100644
--- a/WebCore/platform/graphics/qt/ContextShadow.cpp
+++ b/WebCore/platform/graphics/qt/ContextShadow.cpp
@@ -139,134 +139,80 @@ void ContextShadow::clear()
offset = QPointF(0, 0);
}
-// Instead of integer division, we use 18.14 for fixed-point division.
-static const int BlurSumShift = 14;
+// Instead of integer division, we use 17.15 for fixed-point division.
+static const int BlurSumShift = 15;
-// Note: image must be RGB32 format
-static void blurHorizontal(QImage& image, int radius, bool swap = false)
-{
- Q_ASSERT(image.format() == QImage::Format_ARGB32_Premultiplied);
+// Check http://www.w3.org/TR/SVG/filters.html#feGaussianBlur.
+// As noted in the SVG filter specification, running box blur 3x
+// approximates a real gaussian blur nicely.
+void shadowBlur(QImage& image, int radius, const QColor& shadowColor)
+{
// See comments in http://webkit.org/b/40793, it seems sensible
- // to follow Skia's limit of 128 pixels of blur radius
- radius = qMin(128, radius);
-
- int imgWidth = image.width();
- int imgHeight = image.height();
+ // to follow Skia's limit of 128 pixels for the blur radius.
+ if (radius > 128)
+ radius = 128;
- // Check http://www.w3.org/TR/SVG/filters.html#feGaussianBlur
- // for the approaches when the box-blur radius is even vs odd.
+ int channels[4] = { 3, 0, 1, 3 };
int dmax = radius >> 1;
- int dmin = qMax(0, dmax - 1 + (radius & 1));
-
- for (int y = 0; y < imgHeight; ++y) {
-
- unsigned char* pixels = image.scanLine(y);
-
- int left;
- int right;
- int pixelCount;
- int prev;
- int next;
- int firstAlpha;
- int lastAlpha;
- int totalAlpha;
- unsigned char* target;
- unsigned char* prevPtr;
- unsigned char* nextPtr;
-
- int invCount;
-
- static const int alphaChannel = 3;
- static const int blueChannel = 0;
- static const int greenChannel = 1;
-
- // For each step, we use sliding window algorithm. This is much more
- // efficient than computing the sum of each pixels covered by the box
- // kernel size for each x.
-
- // As noted in the SVG filter specification, running box blur 3x
- // approximates a real gaussian blur nicely.
-
- // Step 1: blur alpha channel and store the result in the blue channel.
- left = swap ? dmax : dmin;
- right = swap ? dmin : dmax;
- pixelCount = left + 1 + right;
- invCount = (1 << BlurSumShift) / pixelCount;
- prev = -left;
- next = 1 + right;
- firstAlpha = pixels[alphaChannel];
- lastAlpha = pixels[(imgWidth - 1) * 4 + alphaChannel];
- totalAlpha = 0;
- for (int i = 0; i < pixelCount; ++i)
- totalAlpha += pixels[qBound(0, i - left, imgWidth - 1) * 4 + alphaChannel];
- target = pixels + blueChannel;
- prevPtr = pixels + prev * 4 + alphaChannel;
- nextPtr = pixels + next * 4 + alphaChannel;
- for (int x = 0; x < imgWidth; ++x, ++prev, ++next, target += 4, prevPtr += 4, nextPtr += 4) {
- *target = (totalAlpha * invCount) >> BlurSumShift;
- int delta = ((next < imgWidth) ? *nextPtr : lastAlpha) -
- ((prev > 0) ? *prevPtr : firstAlpha);
- totalAlpha += delta;
- }
-
- // Step 2: blur blue channel and store the result in the green channel.
- left = swap ? dmin : dmax;
- right = swap ? dmax : dmin;
- pixelCount = left + 1 + right;
- invCount = (1 << BlurSumShift) / pixelCount;
- prev = -left;
- next = 1 + right;
- firstAlpha = pixels[blueChannel];
- lastAlpha = pixels[(imgWidth - 1) * 4 + blueChannel];
- totalAlpha = 0;
- for (int i = 0; i < pixelCount; ++i)
- totalAlpha += pixels[qBound(0, i - left, imgWidth - 1) * 4 + blueChannel];
- target = pixels + greenChannel;
- prevPtr = pixels + prev * 4 + blueChannel;
- nextPtr = pixels + next * 4 + blueChannel;
- for (int x = 0; x < imgWidth; ++x, ++prev, ++next, target += 4, prevPtr += 4, nextPtr += 4) {
- *target = (totalAlpha * invCount) >> BlurSumShift;
- int delta = ((next < imgWidth) ? *nextPtr : lastAlpha) -
- ((prev > 0) ? *prevPtr : firstAlpha);
- totalAlpha += delta;
- }
-
- // Step 3: blur green channel and store the result in the alpha channel.
- left = dmax;
- right = dmax;
- pixelCount = left + 1 + right;
- invCount = (1 << BlurSumShift) / pixelCount;
- prev = -left;
- next = 1 + right;
- firstAlpha = pixels[greenChannel];
- lastAlpha = pixels[(imgWidth - 1) * 4 + greenChannel];
- totalAlpha = 0;
- for (int i = 0; i < pixelCount; ++i)
- totalAlpha += pixels[qBound(0, i - left, imgWidth - 1) * 4 + greenChannel];
- target = pixels + alphaChannel;
- prevPtr = pixels + prev * 4 + greenChannel;
- nextPtr = pixels + next * 4 + greenChannel;
- for (int x = 0; x < imgWidth; ++x, ++prev, ++next, target += 4, prevPtr += 4, nextPtr += 4) {
- *target = (totalAlpha * invCount) >> BlurSumShift;
- int delta = ((next < imgWidth) ? *nextPtr : lastAlpha) -
- ((prev > 0) ? *prevPtr : firstAlpha);
- totalAlpha += delta;
+ int dmin = dmax - 1 + (radius & 1);
+ if (dmin < 0)
+ dmin = 0;
+
+ // Two stages: horizontal and vertical
+ for (int k = 0; k < 2; ++k) {
+
+ unsigned char* pixels = image.bits();
+ int stride = (!k) ? 4 : image.bytesPerLine();
+ int delta = (!k) ? image.bytesPerLine() : 4;
+ int jfinal = (!k) ? image.height() : image.width();
+ int dim = (!k) ? image.width() : image.height();
+
+ for (int j = 0; j < jfinal; ++j, pixels += delta) {
+
+ // For each step, we blur the alpha in a channel and store the result
+ // in another channel for the subsequent step.
+ // We use sliding window algorithm to accumulate the alpha values.
+ // This is much more efficient than computing the sum of each pixels
+ // covered by the box kernel size for each x.
+
+ for (int step = 0; step < 3; ++step) {
+ int side1 = (!step) ? dmin : dmax;
+ int side2 = (step == 1) ? dmin : dmax;
+ int pixelCount = side1 + 1 + side2;
+ int invCount = ((1 << BlurSumShift) + pixelCount - 1) / pixelCount;
+ int ofs = 1 + side2;
+ int alpha1 = pixels[channels[step]];
+ int alpha2 = pixels[(dim - 1) * stride + channels[step]];
+ unsigned char* ptr = pixels + channels[step + 1];
+ unsigned char* prev = pixels + stride + channels[step];
+ unsigned char* next = pixels + ofs * stride + channels[step];
+
+ int i;
+ int sum = side1 * alpha1 + alpha1;
+ int limit = (dim < side2 + 1) ? dim : side2 + 1;
+ for (i = 1; i < limit; ++i, prev += stride)
+ sum += *prev;
+ if (limit <= side2)
+ sum += (side2 - limit + 1) * alpha2;
+
+ limit = (side1 < dim) ? side1 : dim;
+ for (i = 0; i < limit; ptr += stride, next += stride, ++i, ++ofs) {
+ *ptr = (sum * invCount) >> BlurSumShift;
+ sum += ((ofs < dim) ? *next : alpha2) - alpha1;
+ }
+ prev = pixels + channels[step];
+ for (; ofs < dim; ptr += stride, prev += stride, next += stride, ++i, ++ofs) {
+ *ptr = (sum * invCount) >> BlurSumShift;
+ sum += (*next) - (*prev);
+ }
+ for (; i < dim; ptr += stride, prev += stride, ++i) {
+ *ptr = (sum * invCount) >> BlurSumShift;
+ sum += alpha2 - (*prev);
+ }
+ }
}
}
-}
-
-static void shadowBlur(QImage& image, int radius, const QColor& shadowColor)
-{
- blurHorizontal(image, radius);
-
- QTransform transform;
- transform.rotate(90);
- image = image.transformed(transform);
- blurHorizontal(image, radius, true);
- transform.reset();
- transform.rotate(270);
- image = image.transformed(transform);
// "Colorize" with the right shadow color.
QPainter p(&image);
diff --git a/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
index 7918378..0756aa7 100644
--- a/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
@@ -491,13 +491,16 @@ void* GraphicsContext3DInternal::getProcAddress(const String& proc)
return 0;
}
-PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
{
- OwnPtr<GraphicsContext3D> context(new GraphicsContext3D(attrs, hostWindow));
+ // This implementation doesn't currently support rendering directly to the HostWindow.
+ if (renderStyle == RenderDirectlyToHostWindow)
+ return 0;
+ OwnPtr<GraphicsContext3D> context(new GraphicsContext3D(attrs, hostWindow, false));
return context->m_internal ? context.release() : 0;
}
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool)
: m_internal(new GraphicsContext3DInternal(attrs, hostWindow))
{
if (!m_internal->isContextValid())
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index c9c74dd..5a29ad4 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -174,14 +174,10 @@ public:
GraphicsContextPlatformPrivate(QPainter* painter);
~GraphicsContextPlatformPrivate();
- inline QPainter* p()
+ inline QPainter* p() const
{
- if (layers.isEmpty()) {
- if (redirect)
- return redirect;
-
+ if (layers.isEmpty())
return painter;
- }
return &layers.top()->painter;
}
@@ -191,7 +187,6 @@ public:
// Counting real layers. Required by inTransparencyLayer() calls
// For example, layers with valid alphaMask are not real layers
int layerCount;
- QPainter* redirect;
// reuse this brush for solid color (to prevent expensive QBrush construction)
QBrush solidColor;
@@ -212,9 +207,9 @@ public:
QRectF clipBoundingRect() const
{
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
- return painter->clipBoundingRect();
+ return p()->clipBoundingRect();
#else
- return painter->clipRegion().boundingRect();
+ return p()->clipRegion().boundingRect();
#endif
}
@@ -227,7 +222,6 @@ GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate(QPainter* p)
{
painter = p;
layerCount = 0;
- redirect = 0;
solidColor = QBrush(Qt::black);
diff --git a/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp b/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
index e164f8c..079d8ba 100644
--- a/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
@@ -130,22 +130,21 @@ public:
TransformChange = (1L << 6),
ContentChange = (1L << 7),
- GeometryOrientationChange = (1L << 8),
- ContentsOrientationChange = (1L << 9),
- OpacityChange = (1L << 10),
- ContentsRectChange = (1L << 11),
-
- Preserves3DChange = (1L << 12),
- MasksToBoundsChange = (1L << 13),
- DrawsContentChange = (1L << 14),
- ContentsOpaqueChange = (1L << 15),
-
- BackfaceVisibilityChange = (1L << 16),
- ChildrenTransformChange = (1L << 17),
- DisplayChange = (1L << 18),
- BackgroundColorChange = (1L << 19),
-
- DistributesOpacityChange = (1L << 20)
+ ContentsOrientationChange = (1L << 8),
+ OpacityChange = (1L << 9),
+ ContentsRectChange = (1L << 10),
+
+ Preserves3DChange = (1L << 11),
+ MasksToBoundsChange = (1L << 12),
+ DrawsContentChange = (1L << 13),
+ ContentsOpaqueChange = (1L << 14),
+
+ BackfaceVisibilityChange = (1L << 15),
+ ChildrenTransformChange = (1L << 16),
+ DisplayChange = (1L << 17),
+ BackgroundColorChange = (1L << 18),
+
+ DistributesOpacityChange = (1L << 19)
};
// The compositor lets us special-case images and colors, so we try to do so.
@@ -250,7 +249,6 @@ public:
TransformationMatrix childrenTransform;
Color backgroundColor;
Color currentColor;
- GraphicsLayer::CompositingCoordinatesOrientation geoOrientation;
GraphicsLayer::CompositingCoordinatesOrientation contentsOrientation;
float opacity;
QRect contentsRect;
@@ -777,7 +775,6 @@ void GraphicsLayerQtImpl::flushChanges(bool recursive, bool forceUpdateTransform
m_state.anchorPoint = m_layer->anchorPoint();
m_state.size = m_layer->size();
m_state.transform = m_layer->transform();
- m_state.geoOrientation = m_layer->geometryOrientation();
m_state.contentsOrientation =m_layer->contentsOrientation();
m_state.opacity = m_layer->opacity();
m_state.contentsRect = m_layer->contentsRect();
@@ -837,13 +834,6 @@ PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
return new GraphicsLayerQt(client);
}
-/* \reimp (GraphicsLayer.h): Qt is top-down
-*/
-GraphicsLayer::CompositingCoordinatesOrientation GraphicsLayer::compositingCoordinatesOrientation()
-{
- return CompositingCoordinatesTopDown;
-}
-
/* \reimp (GraphicsLayer.h): The current size might change, thus we need to update the whole display.
*/
void GraphicsLayerQt::setNeedsDisplay()
@@ -1149,14 +1139,6 @@ void GraphicsLayerQt::setContentsToMedia(PlatformLayer* media)
/* \reimp (GraphicsLayer.h)
*/
-void GraphicsLayerQt::setGeometryOrientation(CompositingCoordinatesOrientation orientation)
-{
- m_impl->notifyChange(GraphicsLayerQtImpl::GeometryOrientationChange);
- GraphicsLayer::setGeometryOrientation(orientation);
-}
-
-/* \reimp (GraphicsLayer.h)
-*/
void GraphicsLayerQt::setContentsOrientation(CompositingCoordinatesOrientation orientation)
{
m_impl->notifyChange(GraphicsLayerQtImpl::ContentsOrientationChange);
diff --git a/WebCore/platform/graphics/qt/GraphicsLayerQt.h b/WebCore/platform/graphics/qt/GraphicsLayerQt.h
index 4282e64..75ca498 100644
--- a/WebCore/platform/graphics/qt/GraphicsLayerQt.h
+++ b/WebCore/platform/graphics/qt/GraphicsLayerQt.h
@@ -81,7 +81,6 @@ public:
virtual void setContentsToGraphicsContext3D(const GraphicsContext3D*);
virtual void setGraphicsContext3DNeedsDisplay();
#endif
- virtual void setGeometryOrientation(CompositingCoordinatesOrientation orientation);
virtual void setContentsOrientation(CompositingCoordinatesOrientation orientation);
virtual void distributeOpacity(float);
virtual float accumulatedOpacity() const;
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
index 605dcb7..1bf1a3d 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
@@ -25,6 +25,7 @@
#include "GraphicsContext.h"
#include "HTMLMediaElement.h"
#include "HTMLVideoElement.h"
+#include "NetworkingContext.h"
#include "NotImplemented.h"
#include "TimeRanges.h"
#include "Widget.h"
@@ -192,8 +193,8 @@ void MediaPlayerPrivate::commitLoad(const String& url)
// Grab the frame and network manager
Frame* frame = document ? document->frame() : 0;
+ QNetworkAccessManager* manager = frame ? frame->loader()->networkingContext()->networkAccessManager() : 0;
FrameLoaderClientQt* frameLoader = frame ? static_cast<FrameLoaderClientQt*>(frame->loader()->client()) : 0;
- QNetworkAccessManager* manager = frameLoader ? frameLoader->webFrame()->page()->networkAccessManager() : 0;
if (document && manager) {
// Set the cookies
diff --git a/WebCore/platform/graphics/qt/PathQt.cpp b/WebCore/platform/graphics/qt/PathQt.cpp
index df54684..b8b9d5e 100644
--- a/WebCore/platform/graphics/qt/PathQt.cpp
+++ b/WebCore/platform/graphics/qt/PathQt.cpp
@@ -51,7 +51,6 @@
namespace WebCore {
Path::Path()
- : m_lastMoveToIndex(0)
{
}
@@ -61,14 +60,12 @@ Path::~Path()
Path::Path(const Path& other)
: m_path(other.m_path)
- , m_lastMoveToIndex(other.m_lastMoveToIndex)
{
}
Path& Path::operator=(const Path& other)
{
m_path = other.m_path;
- m_lastMoveToIndex = other.m_lastMoveToIndex;
return *this;
}
@@ -183,7 +180,6 @@ FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
void Path::moveTo(const FloatPoint& point)
{
- m_lastMoveToIndex = m_path.elementCount();
m_path.moveTo(point);
}
@@ -267,30 +263,6 @@ void Path::closeSubpath()
m_path.closeSubpath();
}
-void Path::closeCanvasSubpath()
-{
- const int elementCount = m_path.elementCount();
-
- if (!elementCount)
- return;
-
- QPointF lastMoveToPoint = m_path.elementAt(m_lastMoveToIndex);
- int elementsInLastSubpath = 0;
-
- for (int i = m_lastMoveToIndex; i < elementCount; ++i) {
- QPainterPath::Element element = m_path.elementAt(i);
- if (element.isLineTo() || element.isCurveTo()) {
- // All we need to know is if there are 1 or more elements in the last subpath.
- if (++elementsInLastSubpath == 2) {
- m_path.lineTo(lastMoveToPoint);
- return;
- }
- }
- }
-
- moveTo(lastMoveToPoint);
-}
-
#define DEGREES(t) ((t) * 180.0 / M_PI)
void Path::addArc(const FloatPoint& p, float r, float sar, float ear, bool anticlockwise)
{
diff --git a/WebCore/platform/graphics/qt/TransparencyLayer.h b/WebCore/platform/graphics/qt/TransparencyLayer.h
index 1a614ac..6bdfb39 100644
--- a/WebCore/platform/graphics/qt/TransparencyLayer.h
+++ b/WebCore/platform/graphics/qt/TransparencyLayer.h
@@ -61,9 +61,6 @@ struct TransparencyLayer : FastAllocBase {
painter.setFont(p->font());
if (painter.paintEngine()->hasFeature(QPaintEngine::PorterDuff))
painter.setCompositionMode(p->compositionMode());
- // if the path is an empty region, this assignment disables all painting
- if (!p->clipPath().isEmpty())
- painter.setClipPath(p->clipPath());
}
TransparencyLayer()
diff --git a/WebCore/platform/graphics/skia/ImageSkia.cpp b/WebCore/platform/graphics/skia/ImageSkia.cpp
index 9625b34..0b96d80 100644
--- a/WebCore/platform/graphics/skia/ImageSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageSkia.cpp
@@ -33,7 +33,6 @@
#include "AffineTransform.h"
#include "BitmapImage.h"
#include "BitmapImageSingleFrameSkia.h"
-#include "ChromiumBridge.h"
#include "FloatConversion.h"
#include "FloatRect.h"
#include "GLES2Canvas.h"
@@ -311,11 +310,6 @@ bool FrameData::clear(bool clearMetadata)
return false;
}
-PassRefPtr<Image> Image::loadPlatformResource(const char *name)
-{
- return ChromiumBridge::loadPlatformImageResource(name);
-}
-
void Image::drawPattern(GraphicsContext* context,
const FloatRect& floatSrcRect,
const AffineTransform& patternTransform,
diff --git a/WebCore/platform/graphics/skia/NativeImageSkia.cpp b/WebCore/platform/graphics/skia/NativeImageSkia.cpp
index 28e0758..3cc89cc 100644
--- a/WebCore/platform/graphics/skia/NativeImageSkia.cpp
+++ b/WebCore/platform/graphics/skia/NativeImageSkia.cpp
@@ -35,6 +35,7 @@
#endif
#include "NativeImageSkia.h"
+#include "SharedGraphicsContext3D.h"
#include "SkiaUtils.h"
namespace WebCore {
@@ -54,6 +55,12 @@ NativeImageSkia::NativeImageSkia(const SkBitmap& other)
{
}
+
+NativeImageSkia::~NativeImageSkia()
+{
+ SharedGraphicsContext3D::removeTexturesFor(this);
+}
+
int NativeImageSkia::decodedSize() const
{
return getSize() + m_resizedImage.getSize();
diff --git a/WebCore/platform/graphics/skia/NativeImageSkia.h b/WebCore/platform/graphics/skia/NativeImageSkia.h
index e26a5ea..00b0a68 100644
--- a/WebCore/platform/graphics/skia/NativeImageSkia.h
+++ b/WebCore/platform/graphics/skia/NativeImageSkia.h
@@ -42,6 +42,7 @@ namespace WebCore {
class NativeImageSkia : public SkBitmap {
public:
NativeImageSkia();
+ ~NativeImageSkia();
// This constructor does a shallow copy of the passed-in SkBitmap (ie., it
// references the same pixel data and bumps the refcount). Use only when
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index 88fbcdd..88fbcdd 100755..100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
diff --git a/WebCore/platform/graphics/win/FontPlatformDataCairoWin.h b/WebCore/platform/graphics/win/FontPlatformDataCairoWin.h
new file mode 100644
index 0000000..05f9eab
--- /dev/null
+++ b/WebCore/platform/graphics/win/FontPlatformDataCairoWin.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Inc.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2007 Pioneer Research Center USA, Inc.
+ * All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef FontPlatformDataCairoWin_h
+#define FontPlatformDataCairoWin_h
+
+#include "FontDescription.h"
+#include "GlyphBuffer.h"
+#include "RefCountedGDIHandle.h"
+#include "StringImpl.h"
+#include <cairo-win32.h>
+#include <cairo.h>
+#include <wtf/Forward.h>
+
+typedef struct HFONT__* HFONT;
+
+namespace WebCore {
+
+class FontPlatformData {
+public:
+ FontPlatformData(WTF::HashTableDeletedValueType)
+ : m_fontFace(0)
+ , m_useGDI(false)
+ , m_font(WTF::HashTableDeletedValue)
+ , m_size(0)
+ , m_syntheticBold(false)
+ , m_syntheticOblique(false)
+ , m_scaledFont(0)
+ { }
+
+ FontPlatformData()
+ : m_fontFace(0)
+ , m_useGDI(false)
+ , m_size(0)
+ , m_syntheticBold(false)
+ , m_syntheticOblique(false)
+ , m_scaledFont(0)
+ { }
+
+ FontPlatformData(HFONT, float size, bool bold, bool oblique, bool useGDI);
+ FontPlatformData(cairo_font_face_t* fontFace, float size, bool bold, bool italic);
+ FontPlatformData(float size, bool bold, bool italic);
+ FontPlatformData(const FontPlatformData&);
+ ~FontPlatformData();
+
+ HFONT hfont() const { return m_font->handle(); }
+ bool useGDI() const { return m_useGDI; }
+ cairo_font_face_t* fontFace() const { return m_fontFace; }
+
+ bool isFixedPitch();
+ float size() const { return m_size; }
+ void setSize(float size) { m_size = size; }
+ bool syntheticBold() const { return m_syntheticBold; }
+ bool syntheticOblique() const { return m_syntheticOblique; }
+ cairo_scaled_font_t* scaledFont() const { return m_scaledFont; }
+
+ unsigned hash() const
+ {
+ return m_font->hash();
+ }
+
+ bool operator==(const FontPlatformData&) const;
+ FontPlatformData& operator=(const FontPlatformData&);
+ bool isHashTableDeletedValue() const
+ {
+ return m_font.isHashTableDeletedValue();
+ }
+
+#ifndef NDEBUG
+ String description() const;
+#endif
+
+private:
+ void platformDataInit(HFONT, float size, HDC, WCHAR* faceName);
+
+ RefPtr<RefCountedGDIHandle<HFONT> > m_font;
+ cairo_font_face_t* m_fontFace;
+ bool m_useGDI;
+ float m_size;
+ bool m_syntheticBold;
+ bool m_syntheticOblique;
+ cairo_scaled_font_t* m_scaledFont;
+};
+
+}
+
+#endif // FontPlatformDataCairoWin_h
diff --git a/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp b/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
index 96ac0c1..dad5da1 100644
--- a/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
+++ b/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
@@ -121,11 +121,6 @@ static void clearLayerBackgroundColor(WKCACFLayer* layer)
layer->setBackgroundColor(0);
}
-GraphicsLayer::CompositingCoordinatesOrientation GraphicsLayer::compositingCoordinatesOrientation()
-{
- return CompositingCoordinatesBottomUp;
-}
-
PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
{
return new GraphicsLayerCACF(client);
@@ -395,15 +390,6 @@ void GraphicsLayerCACF::setContentsToMedia(PlatformLayer* mediaLayer)
updateSublayerList();
}
-void GraphicsLayerCACF::setGeometryOrientation(CompositingCoordinatesOrientation orientation)
-{
- if (orientation == m_geometryOrientation)
- return;
-
- GraphicsLayer::setGeometryOrientation(orientation);
- updateGeometryOrientation();
-}
-
PlatformLayer* GraphicsLayerCACF::hostLayerForSublayers() const
{
return m_transformLayer ? m_transformLayer.get() : m_layer.get();
@@ -461,13 +447,6 @@ void GraphicsLayerCACF::swapFromOrToTiledLayer(bool useTiledLayer)
m_layer = WebLayer::create(WKCACFLayer::Layer, this);
m_usingTiledLayer = useTiledLayer;
-
- if (useTiledLayer) {
- if (GraphicsLayer::compositingCoordinatesOrientation() == GraphicsLayer::CompositingCoordinatesBottomUp)
- m_layer->setContentsGravity(WKCACFLayer::BottomLeft);
- else
- m_layer->setContentsGravity(WKCACFLayer::TopLeft);
- }
m_layer->adoptSublayers(oldLayer.get());
if (oldLayer->superlayer())
@@ -738,21 +717,6 @@ void GraphicsLayerCACF::updateContentsRect()
m_contentsLayer->setBounds(rect);
}
-void GraphicsLayerCACF::updateGeometryOrientation()
-{
- switch (geometryOrientation()) {
- case CompositingCoordinatesTopDown:
- m_layer->setGeometryFlipped(false);
- break;
-
- case CompositingCoordinatesBottomUp:
- m_layer->setGeometryFlipped(true);
- break;
- }
- // Geometry orientation is mapped onto children transform in older QuartzCores,
- // so is handled via setGeometryOrientation().
-}
-
void GraphicsLayerCACF::setupContentsLayer(WKCACFLayer* contentsLayer)
{
if (contentsLayer == m_contentsLayer)
diff --git a/WebCore/platform/graphics/win/GraphicsLayerCACF.h b/WebCore/platform/graphics/win/GraphicsLayerCACF.h
index 0b74266..c18a6e9 100644
--- a/WebCore/platform/graphics/win/GraphicsLayerCACF.h
+++ b/WebCore/platform/graphics/win/GraphicsLayerCACF.h
@@ -89,8 +89,6 @@ public:
virtual void setDebugBackgroundColor(const Color&);
virtual void setDebugBorder(const Color&, float borderWidth);
- virtual void setGeometryOrientation(CompositingCoordinatesOrientation);
-
private:
void updateOpacityOnLayer();
@@ -118,7 +116,6 @@ private:
void updateContentsImage();
void updateContentsMedia();
void updateContentsRect();
- void updateGeometryOrientation();
void setupContentsLayer(WKCACFLayer*);
WKCACFLayer* contentsLayer() const { return m_contentsLayer.get(); }
diff --git a/WebCore/platform/graphics/win/LocalWindowsContext.h b/WebCore/platform/graphics/win/LocalWindowsContext.h
index c216140..c216140 100755..100644
--- a/WebCore/platform/graphics/win/LocalWindowsContext.h
+++ b/WebCore/platform/graphics/win/LocalWindowsContext.h
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp b/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp
index e664f2a..4a7e45e 100644..100755
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp
@@ -107,7 +107,6 @@ void MediaPlayerPrivateFullscreenWindow::setRootChildLayer(PassRefPtr<WKCACFLaye
WKCACFLayer* rootLayer = m_rootChild->rootLayer();
CGRect rootBounds = m_rootChild->rootLayer()->bounds();
m_rootChild->setFrame(rootBounds);
- m_layerRenderer->setScrollFrame(IntPoint(rootBounds.origin), IntSize(rootBounds.size));
m_rootChild->setBackgroundColor(CGColorGetConstantColor(kCGColorBlack));
#ifndef NDEBUG
RetainPtr<CGColorRef> redColor(AdoptCF, CGColorCreateGenericRGB(1, 0, 0, 1));
@@ -165,7 +164,6 @@ LRESULT MediaPlayerPrivateFullscreenWindow::wndProc(HWND hWnd, UINT message, WPA
CGRect rootBounds = m_rootChild->rootLayer()->bounds();
m_rootChild->setFrame(rootBounds);
m_rootChild->setNeedsLayout();
- m_layerRenderer->setScrollFrame(IntPoint(rootBounds.origin), IntSize(rootBounds.size));
#endif
}
break;
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
index 9bc68d1..354e0bf 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
@@ -97,6 +97,39 @@ public:
private:
MediaPlayerPrivateQuickTimeVisualContext* m_parent;
};
+
+class MediaPlayerPrivateQuickTimeVisualContext::LayoutClient : public WKCACFLayerLayoutClient {
+public:
+ LayoutClient(MediaPlayerPrivateQuickTimeVisualContext* parent) : m_parent(parent) {}
+ virtual void layoutSublayersOfLayer(WKCACFLayer*);
+private:
+ MediaPlayerPrivateQuickTimeVisualContext* m_parent;
+};
+
+void MediaPlayerPrivateQuickTimeVisualContext::LayoutClient::layoutSublayersOfLayer(WKCACFLayer* layer)
+{
+ ASSERT(m_parent);
+ ASSERT(m_parent->m_transformLayer->platformLayer() == layer);
+
+ CGSize parentSize = layer->bounds().size;
+ CGSize naturalSize = m_parent->naturalSize();
+
+ // Calculate the ratio of these two sizes and use that ratio to scale the qtVideoLayer:
+ CGSize ratio = CGSizeMake(parentSize.width / naturalSize.width, parentSize.height / naturalSize.height);
+
+ int videoWidth = 0;
+ int videoHeight = 0;
+ m_parent->m_movie->getNaturalSize(videoWidth, videoHeight);
+ CGRect videoBounds = CGRectMake(0, 0, videoWidth * ratio.width, videoHeight * ratio.height);
+ CGPoint videoAnchor = m_parent->m_qtVideoLayer->anchorPoint();
+
+ // Calculate the new position based on the parent's size:
+ CGPoint position = CGPointMake(parentSize.width * 0.5 - videoBounds.size.width * (0.5 - videoAnchor.x),
+ parentSize.height * 0.5 - videoBounds.size.height * (0.5 - videoAnchor.y));
+
+ m_parent->m_qtVideoLayer->setBounds(videoBounds);
+ m_parent->m_qtVideoLayer->setPosition(position);
+}
#endif
class MediaPlayerPrivateQuickTimeVisualContext::VisualContextClient : public QTMovieVisualContextClient {
@@ -137,6 +170,8 @@ MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualConte
, m_movieClient(new MediaPlayerPrivateQuickTimeVisualContext::MovieClient(this))
#if USE(ACCELERATED_COMPOSITING)
, m_layerClient(new MediaPlayerPrivateQuickTimeVisualContext::LayerClient(this))
+ , m_layoutClient(new MediaPlayerPrivateQuickTimeVisualContext::LayoutClient(this))
+ , m_movieTransform(CGAffineTransformIdentity)
#endif
, m_visualContextClient(new MediaPlayerPrivateQuickTimeVisualContext::VisualContextClient(this))
{
@@ -169,7 +204,7 @@ PlatformMedia MediaPlayerPrivateQuickTimeVisualContext::platformMedia() const
#if USE(ACCELERATED_COMPOSITING)
PlatformLayer* MediaPlayerPrivateQuickTimeVisualContext::platformLayer() const
{
- return m_qtVideoLayer ? m_qtVideoLayer->platformLayer() : 0;
+ return m_transformLayer ? m_transformLayer->platformLayer() : 0;
}
#endif
@@ -263,6 +298,24 @@ void MediaPlayerPrivateQuickTimeVisualContext::setUpCookiesForQuickTime(const St
}
}
+static void disableComponentsOnce()
+{
+ static bool sComponentsDisabled = false;
+ if (sComponentsDisabled)
+ return;
+ sComponentsDisabled = true;
+
+ uint32_t componentsToDisable[][5] = {
+ {'eat ', 'TEXT', 'text', 0, 0},
+ {'eat ', 'TXT ', 'text', 0, 0},
+ {'eat ', 'utxt', 'text', 0, 0},
+ {'eat ', 'TEXT', 'tx3g', 0, 0},
+ };
+
+ for (size_t i = 0; i < sizeof(componentsToDisable) / sizeof(componentsToDisable[0]); ++i)
+ QTMovie::disableComponent(componentsToDisable[i]);
+}
+
void MediaPlayerPrivateQuickTimeVisualContext::load(const String& url)
{
if (!QTMovie::initializeQuickTime()) {
@@ -272,6 +325,8 @@ void MediaPlayerPrivateQuickTimeVisualContext::load(const String& url)
return;
}
+ disableComponentsOnce();
+
// Initialize the task timer.
MediaPlayerPrivateTaskTimer::initialize();
@@ -404,7 +459,13 @@ IntSize MediaPlayerPrivateQuickTimeVisualContext::naturalSize() const
int width;
int height;
m_movie->getNaturalSize(width, height);
+#if USE(ACCELERATED_COMPOSITING)
+ CGSize originalSize = {width, height};
+ CGSize transformedSize = CGSizeApplyAffineTransform(originalSize, m_movieTransform);
+ return IntSize(abs(transformedSize.width), abs(transformedSize.height));
+#else
return IntSize(width, height);
+#endif
}
bool MediaPlayerPrivateQuickTimeVisualContext::hasVideo() const
@@ -763,7 +824,7 @@ void MediaPlayerPrivateQuickTimeVisualContext::retrieveCurrentImage()
if (!buffer.pixelBufferRef())
return;
- WKCACFLayer* layer = static_cast<WKCACFLayer*>(m_qtVideoLayer->platformLayer());
+ WKCACFLayer* layer = m_qtVideoLayer.get();
if (!buffer.lockBaseAddress()) {
if (requiredDllsAvailable()) {
@@ -1017,6 +1078,40 @@ bool MediaPlayerPrivateQuickTimeVisualContext::hasSetUpVideoRendering() const
#endif
}
+void MediaPlayerPrivateQuickTimeVisualContext::retrieveAndResetMovieTransform()
+{
+#if USE(ACCELERATED_COMPOSITING)
+ // First things first, reset the total movie transform so that
+ // we can bail out early:
+ m_movieTransform = CGAffineTransformIdentity;
+
+ if (!m_movie || !m_movie->hasVideo())
+ return;
+
+ // This trick will only work on movies with a single video track,
+ // so bail out early if the video contains more than one (or zero)
+ // video tracks.
+ QTTrackArray videoTracks = m_movie->videoTracks();
+ if (videoTracks.size() != 1)
+ return;
+
+ QTTrack* track = videoTracks[0].get();
+ ASSERT(track);
+
+ CGAffineTransform movieTransform = m_movie->getTransform();
+ if (!CGAffineTransformEqualToTransform(movieTransform, CGAffineTransformIdentity))
+ m_movie->resetTransform();
+
+ CGAffineTransform trackTransform = track->getTransform();
+ if (!CGAffineTransformEqualToTransform(trackTransform, CGAffineTransformIdentity))
+ track->resetTransform();
+
+ // Multiply the two transforms together, taking care to
+ // do so in the correct order, track * movie = final:
+ m_movieTransform = CGAffineTransformConcat(trackTransform, movieTransform);
+#endif
+}
+
void MediaPlayerPrivateQuickTimeVisualContext::createLayerForMovie()
{
#if USE(ACCELERATED_COMPOSITING)
@@ -1028,17 +1123,35 @@ void MediaPlayerPrivateQuickTimeVisualContext::createLayerForMovie()
// Create a GraphicsLayer that won't be inserted directly into the render tree, but will used
// as a wrapper for a WKCACFLayer which gets inserted as the content layer of the video
// renderer's GraphicsLayer.
- m_qtVideoLayer.set(new GraphicsLayerCACF(m_layerClient.get()));
- if (!m_qtVideoLayer)
+ m_transformLayer.set(new GraphicsLayerCACF(m_layerClient.get()));
+ if (!m_transformLayer)
return;
// Mark the layer as drawing itself, anchored in the top left, and bottom-up.
- m_qtVideoLayer->setDrawsContent(true);
- m_qtVideoLayer->setAnchorPoint(FloatPoint3D());
- m_qtVideoLayer->setContentsOrientation(GraphicsLayer::CompositingCoordinatesBottomUp);
+ m_transformLayer->setDrawsContent(false);
+ m_transformLayer->setAnchorPoint(FloatPoint3D());
+ m_transformLayer->setContentsOrientation(GraphicsLayer::CompositingCoordinatesBottomUp);
+ m_transformLayer->platformLayer()->setLayoutClient(m_layoutClient.get());
+
+ m_qtVideoLayer = WKCACFLayer::create(WKCACFLayer::Layer);
+ if (!m_qtVideoLayer)
+ return;
+
+ if (CGAffineTransformEqualToTransform(m_movieTransform, CGAffineTransformIdentity))
+ retrieveAndResetMovieTransform();
+ CGAffineTransform t = m_movieTransform;
+
+ // Remove the translation portion of the transform, since we will always rotate about
+ // the layer's center point. In our limited use-case (a single video track), this is
+ // safe:
+ t.tx = t.ty = 0;
+ m_qtVideoLayer->setTransform(CATransform3DMakeAffineTransform(t));
+
#ifndef NDEBUG
m_qtVideoLayer->setName("Video layer");
#endif
+ m_transformLayer->platformLayer()->addSublayer(m_qtVideoLayer.get());
+ m_transformLayer->platformLayer()->setNeedsLayout();
// The layer will get hooked up via RenderLayerBacking::updateGraphicsLayerConfiguration().
#endif
@@ -1052,8 +1165,13 @@ void MediaPlayerPrivateQuickTimeVisualContext::createLayerForMovie()
void MediaPlayerPrivateQuickTimeVisualContext::destroyLayerForMovie()
{
#if USE(ACCELERATED_COMPOSITING)
- if (m_qtVideoLayer)
+ if (m_qtVideoLayer) {
+ m_qtVideoLayer->removeFromSuperlayer();
m_qtVideoLayer = 0;
+ }
+
+ if (m_transformLayer)
+ m_transformLayer = 0;
if (m_imageQueue)
m_imageQueue = 0;
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
index 9c449dd..272b90f 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
@@ -50,6 +50,7 @@ class IntSize;
class IntRect;
#if USE(ACCELERATED_COMPOSITING)
+class WKCACFLayer;
class WKCAImageQueue;
#endif
@@ -154,17 +155,25 @@ private:
class LayerClient;
friend class LayerClient;
OwnPtr<LayerClient> m_layerClient;
+
+ class LayoutClient;
+ friend class LayoutClient;
+ OwnPtr<LayoutClient> m_layoutClient;
#endif
class VisualContextClient;
friend class VisualContextClient;
OwnPtr<VisualContextClient> m_visualContextClient;
+ void retrieveAndResetMovieTransform();
+
MediaPlayer* m_player;
RefPtr<QTMovie> m_movie;
#if USE(ACCELERATED_COMPOSITING)
- OwnPtr<GraphicsLayer> m_qtVideoLayer;
+ RefPtr<WKCACFLayer> m_qtVideoLayer;
+ OwnPtr<GraphicsLayer> m_transformLayer;
OwnPtr<WKCAImageQueue> m_imageQueue;
+ CGAffineTransform m_movieTransform;
#endif
RefPtr<QTMovieVisualContext> m_visualContext;
float m_seekTo;
@@ -185,6 +194,7 @@ private:
double m_timeStartedPlaying;
double m_timeStoppedPlaying;
#endif
+
};
}
diff --git a/WebCore/platform/graphics/win/QTMovie.cpp b/WebCore/platform/graphics/win/QTMovie.cpp
index cc1349a..375d8c2 100644
--- a/WebCore/platform/graphics/win/QTMovie.cpp
+++ b/WebCore/platform/graphics/win/QTMovie.cpp
@@ -28,6 +28,7 @@
#include "QTMovieTask.h"
#include "QTMovieWinTimer.h"
+#include <FixMath.h>
#include <GXMath.h>
#include <Movies.h>
#include <QTML.h>
@@ -279,6 +280,16 @@ QTMovie::~QTMovie()
delete m_private;
}
+void QTMovie::disableComponent(uint32_t cd[5])
+{
+ ComponentDescription nullDesc = {'null', 'base', kAppleManufacturer, 0, 0};
+ Component nullComp = FindNextComponent(0, &nullDesc);
+ Component disabledComp = 0;
+
+ while (disabledComp = FindNextComponent(disabledComp, (ComponentDescription*)&cd[0]))
+ CaptureComponent(disabledComp, nullComp);
+}
+
void QTMovie::addClient(QTMovieClient* client)
{
if (client)
@@ -696,6 +707,16 @@ bool QTMovie::hasAudio() const
return (GetMovieIndTrackType(m_private->m_movie, 1, AudioMediaCharacteristic, movieTrackCharacteristic | movieTrackEnabledOnly));
}
+QTTrackArray QTMovie::videoTracks() const
+{
+ QTTrackArray tracks;
+ long trackIndex = 1;
+
+ while (Track theTrack = GetMovieIndTrackType(m_private->m_movie, trackIndex++, VisualMediaCharacteristic, movieTrackCharacteristic | movieTrackEnabledOnly))
+ tracks.append(QTTrack::create(theTrack));
+
+ return tracks;
+}
bool QTMovie::hasClosedCaptions() const
{
@@ -830,6 +851,45 @@ void QTMovie::getSupportedType(unsigned index, const UChar*& str, unsigned& len)
}
+CGAffineTransform QTMovie::getTransform() const
+{
+ ASSERT(m_private->m_movie);
+ MatrixRecord m = {0};
+ GetMovieMatrix(m_private->m_movie, &m);
+
+ ASSERT(!m.matrix[0][2]);
+ ASSERT(!m.matrix[1][2]);
+ CGAffineTransform transform = CGAffineTransformMake(
+ Fix2X(m.matrix[0][0]),
+ Fix2X(m.matrix[0][1]),
+ Fix2X(m.matrix[1][0]),
+ Fix2X(m.matrix[1][1]),
+ Fix2X(m.matrix[2][0]),
+ Fix2X(m.matrix[2][1]));
+ return transform;
+}
+
+void QTMovie::setTransform(CGAffineTransform t)
+{
+ ASSERT(m_private->m_movie);
+ MatrixRecord m = {{
+ {X2Fix(t.a), X2Fix(t.b), 0},
+ {X2Fix(t.c), X2Fix(t.d), 0},
+ {X2Fix(t.tx), X2Fix(t.ty), fract1},
+ }};
+
+ SetMovieMatrix(m_private->m_movie, &m);
+ m_private->cacheMovieScale();
+}
+
+void QTMovie::resetTransform()
+{
+ ASSERT(m_private->m_movie);
+ SetMovieMatrix(m_private->m_movie, 0);
+ m_private->cacheMovieScale();
+}
+
+
bool QTMovie::initializeQuickTime()
{
static bool initialized = false;
diff --git a/WebCore/platform/graphics/win/QTMovie.h b/WebCore/platform/graphics/win/QTMovie.h
index 8fa4b6e..e205b68 100644
--- a/WebCore/platform/graphics/win/QTMovie.h
+++ b/WebCore/platform/graphics/win/QTMovie.h
@@ -26,9 +26,8 @@
#ifndef QTMovie_h
#define QTMovie_h
-#include <Unicode.h>
-#include <windows.h>
-#include <wtf/RefCounted.h>
+#include "QTTrack.h"
+#include <WTF/Vector.h>
#ifdef QTMOVIEWIN_EXPORTS
#define QTMOVIEWIN_API __declspec(dllexport)
@@ -39,6 +38,7 @@
class QTMovie;
class QTMoviePrivate;
typedef struct MovieType** Movie;
+typedef Vector<RefPtr<QTTrack>> QTTrackArray;
class QTMovieClient {
public:
@@ -62,6 +62,8 @@ public:
static bool initializeQuickTime();
static void taskTimerFired();
+ static void disableComponent(uint32_t[5]);
+
QTMovie(QTMovieClient*);
~QTMovie();
@@ -99,12 +101,18 @@ public:
bool hasVideo() const;
bool hasAudio() const;
+ QTTrackArray videoTracks() const;
+
bool hasClosedCaptions() const;
void setClosedCaptionsVisible(bool);
static unsigned countSupportedTypes();
static void getSupportedType(unsigned index, const UChar*& str, unsigned& len);
+ CGAffineTransform getTransform() const;
+ void setTransform(CGAffineTransform);
+ void resetTransform();
+
Movie getMovieHandle() const;
private:
diff --git a/WebCore/platform/graphics/win/QTTrack.cpp b/WebCore/platform/graphics/win/QTTrack.cpp
new file mode 100644
index 0000000..09142bc
--- /dev/null
+++ b/WebCore/platform/graphics/win/QTTrack.cpp
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2007, 2008, 2009, 2010 Apple, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+
+#include "QTTrack.h"
+
+#include <Movies.h>
+#include <QTML.h>
+
+using namespace std;
+
+class QTTrackPrivate : public Noncopyable {
+public:
+ QTTrackPrivate();
+ ~QTTrackPrivate();
+
+ QTTrack* m_track;
+ Track m_trackHandle;
+};
+
+QTTrackPrivate::QTTrackPrivate()
+ : m_track(0)
+ , m_trackHandle(0)
+{
+}
+
+QTTrackPrivate::~QTTrackPrivate()
+{
+ m_trackHandle = 0;
+}
+
+PassRefPtr<QTTrack> QTTrack::create(Track trackHandle)
+{
+ return adoptRef(new QTTrack(trackHandle));
+}
+
+QTTrack::QTTrack(Track trackHandle)
+ : m_private(new QTTrackPrivate())
+{
+ m_private->m_track = this;
+ m_private->m_trackHandle = trackHandle;
+}
+
+QTTrack::~QTTrack()
+{
+ delete m_private;
+}
+
+bool QTTrack::isEnabled() const
+{
+ ASSERT(m_private->m_track);
+ return GetTrackEnabled(m_private->m_trackHandle);
+}
+
+void QTTrack::setEnabled(bool enabled)
+{
+ ASSERT(m_private->m_trackHandle);
+ SetTrackEnabled(m_private->m_trackHandle, enabled);
+}
+
+CGAffineTransform QTTrack::getTransform() const
+{
+ ASSERT(m_private->m_trackHandle);
+ MatrixRecord m = {0};
+ GetTrackMatrix(m_private->m_trackHandle, &m);
+
+ ASSERT(!m.matrix[0][2]);
+ ASSERT(!m.matrix[1][2]);
+ CGAffineTransform transform = CGAffineTransformMake(
+ Fix2X(m.matrix[0][0]),
+ Fix2X(m.matrix[0][1]),
+ Fix2X(m.matrix[1][0]),
+ Fix2X(m.matrix[1][1]),
+ Fix2X(m.matrix[2][0]),
+ Fix2X(m.matrix[2][1]));
+
+ return transform;
+}
+
+void QTTrack::setTransform(CGAffineTransform t)
+{
+ ASSERT(m_private->m_trackHandle);
+ MatrixRecord m = {{
+ {X2Fix(t.a), X2Fix(t.b), 0},
+ {X2Fix(t.c), X2Fix(t.d), 0},
+ {X2Fix(t.tx), X2Fix(t.ty), fract1},
+ }};
+
+ SetTrackMatrix(m_private->m_trackHandle, &m);
+}
+
+void QTTrack::resetTransform()
+{
+ ASSERT(m_private->m_trackHandle);
+ SetTrackMatrix(m_private->m_trackHandle, 0);
+}
+
diff --git a/WebCore/platform/graphics/win/QTTrack.h b/WebCore/platform/graphics/win/QTTrack.h
new file mode 100644
index 0000000..bda5644
--- /dev/null
+++ b/WebCore/platform/graphics/win/QTTrack.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2007, 2008, 2009, 2010 Apple, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef QTTrack_h
+#define QTTrack_h
+
+#include <Unicode.h>
+#include <windows.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+// We must include this after <Unicode.h>, or the definition of OSErr will change:
+#include <CoreGraphics/CGAffineTransform.h>
+
+#ifdef QTMOVIEWIN_EXPORTS
+#define QTMOVIEWIN_API __declspec(dllexport)
+#else
+#define QTMOVIEWIN_API __declspec(dllimport)
+#endif
+
+class QTTrack;
+class QTTrackPrivate;
+typedef struct TrackType** Track;
+
+class QTMOVIEWIN_API QTTrack : public RefCounted<QTTrack> {
+public:
+ static PassRefPtr<QTTrack> create(Track);
+ ~QTTrack();
+
+ CGAffineTransform getTransform() const;
+ void setTransform(CGAffineTransform);
+ void resetTransform();
+
+ bool isEnabled() const;
+ void setEnabled(bool);
+
+ Track getTrackHandle() const;
+private:
+ QTTrack(Track);
+ QTTrackPrivate* m_private;
+ friend class QTTrackPrivate;
+};
+
+#endif
diff --git a/WebCore/platform/graphics/win/WKCACFLayer.cpp b/WebCore/platform/graphics/win/WKCACFLayer.cpp
index bbe5883..bf47925 100644
--- a/WebCore/platform/graphics/win/WKCACFLayer.cpp
+++ b/WebCore/platform/graphics/win/WKCACFLayer.cpp
@@ -355,6 +355,9 @@ void WKCACFLayer::setBounds(const CGRect& rect)
if (m_needsDisplayOnBoundsChange)
setNeedsDisplay();
+
+ if (m_layoutClient)
+ setNeedsLayout();
}
void WKCACFLayer::setFrame(const CGRect& rect)
@@ -368,6 +371,9 @@ void WKCACFLayer::setFrame(const CGRect& rect)
if (m_needsDisplayOnBoundsChange && !CGSizeEqualToSize(rect.size, oldFrame.size))
setNeedsDisplay();
+
+ if (m_layoutClient)
+ setNeedsLayout();
}
void WKCACFLayer::setContentsGravity(ContentsGravityType type)
diff --git a/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp b/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp
index 630a8af..4f39b13 100644..100755
--- a/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp
+++ b/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp
@@ -226,15 +226,11 @@ WKCACFLayerRenderer::WKCACFLayerRenderer(WKCACFLayerRendererClient* client)
: m_client(client)
, m_mightBeAbleToCreateDeviceLater(true)
, m_rootLayer(WKCACFRootLayer::create(this))
- , m_scrollLayer(WKCACFLayer::create(WKCACFLayer::Layer))
- , m_clipLayer(WKCACFLayer::create(WKCACFLayer::Layer))
, m_context(AdoptCF, CACFContextCreate(0))
, m_renderContext(static_cast<CARenderContext*>(CACFContextGetRenderContext(m_context.get())))
, m_renderer(0)
, m_hostWindow(0)
, m_renderTimer(this, &WKCACFLayerRenderer::renderTimerFired)
- , m_scrollPosition(0, 0)
- , m_scrollSize(1, 1)
, m_backingStoreDirty(false)
, m_mustResetLostDeviceBeforeRendering(false)
{
@@ -250,15 +246,8 @@ WKCACFLayerRenderer::WKCACFLayerRenderer(WKCACFLayerRendererClient* client)
// Scrolling will affect only the position of the scroll layer without affecting the bounds.
m_rootLayer->setName("WKCACFLayerRenderer rootLayer");
- m_clipLayer->setName("WKCACFLayerRenderer clipLayer");
- m_scrollLayer->setName("WKCACFLayerRenderer scrollLayer");
-
- m_rootLayer->addSublayer(m_clipLayer);
- m_clipLayer->addSublayer(m_scrollLayer);
- m_clipLayer->setMasksToBounds(true);
m_rootLayer->setAnchorPoint(CGPointMake(0, 0));
- m_scrollLayer->setAnchorPoint(CGPointMake(0, 1));
- m_clipLayer->setAnchorPoint(CGPointMake(0, 1));
+ m_rootLayer->setGeometryFlipped(true);
#ifndef NDEBUG
CGColorRef debugColor = createCGColor(Color(255, 0, 0, 204));
@@ -285,26 +274,6 @@ WKCACFLayer* WKCACFLayerRenderer::rootLayer() const
return m_rootLayer.get();
}
-void WKCACFLayerRenderer::setScrollFrame(const IntPoint& position, const IntSize& size)
-{
- m_scrollSize = size;
- m_scrollPosition = position;
-
- updateScrollFrame();
-}
-
-void WKCACFLayerRenderer::updateScrollFrame()
-{
- CGRect frameBounds = bounds();
- m_clipLayer->setBounds(CGRectMake(0, 0, m_scrollSize.width(), m_scrollSize.height()));
- m_clipLayer->setPosition(CGPointMake(0, frameBounds.size.height));
- if (m_rootChildLayer) {
- CGRect rootBounds = m_rootChildLayer->bounds();
- m_scrollLayer->setBounds(rootBounds);
- }
- m_scrollLayer->setPosition(CGPointMake(-m_scrollPosition.x(), m_scrollPosition.y() + m_scrollSize.height()));
-}
-
void WKCACFLayerRenderer::setRootContents(CGImageRef image)
{
ASSERT(m_rootLayer);
@@ -321,16 +290,10 @@ void WKCACFLayerRenderer::setRootContentsAndDisplay(CGImageRef image)
void WKCACFLayerRenderer::setRootChildLayer(WKCACFLayer* layer)
{
- if (!m_scrollLayer)
- return;
-
- m_scrollLayer->removeAllSublayers();
+ m_rootLayer->removeAllSublayers();
m_rootChildLayer = layer;
- if (layer) {
- m_scrollLayer->addSublayer(layer);
- // Adjust the scroll frame accordingly
- updateScrollFrame();
- }
+ if (m_rootChildLayer)
+ m_rootLayer->addSublayer(m_rootChildLayer);
}
void WKCACFLayerRenderer::layerTreeDidChange()
@@ -435,8 +398,6 @@ void WKCACFLayerRenderer::destroyRenderer()
s_d3d = 0;
m_rootLayer = 0;
- m_clipLayer = 0;
- m_scrollLayer = 0;
m_rootChildLayer = 0;
m_mightBeAbleToCreateDeviceLater = true;
@@ -454,7 +415,6 @@ void WKCACFLayerRenderer::resize()
if (m_rootLayer) {
m_rootLayer->setBounds(bounds());
WKCACFContextFlusher::shared().flushAllContexts();
- updateScrollFrame();
}
}
diff --git a/WebCore/platform/graphics/win/WKCACFLayerRenderer.h b/WebCore/platform/graphics/win/WKCACFLayerRenderer.h
index 2647c5f..1d73b99 100644..100755
--- a/WebCore/platform/graphics/win/WKCACFLayerRenderer.h
+++ b/WebCore/platform/graphics/win/WKCACFLayerRenderer.h
@@ -66,7 +66,6 @@ public:
static bool acceleratedCompositingAvailable();
static void didFlushContext(CACFContextRef);
- void setScrollFrame(const IntPoint&, const IntSize&);
void setRootContents(CGImageRef);
void setRootContentsAndDisplay(CGImageRef);
void setRootChildLayer(WKCACFLayer* layer);
@@ -78,7 +77,6 @@ public:
void destroyRenderer();
void resize();
void renderSoon();
- void updateScrollFrame();
protected:
WKCACFLayer* rootLayer() const;
@@ -105,16 +103,12 @@ private:
bool m_mightBeAbleToCreateDeviceLater;
COMPtr<IDirect3DDevice9> m_d3dDevice;
RefPtr<WKCACFRootLayer> m_rootLayer;
- RefPtr<WKCACFLayer> m_scrollLayer;
RefPtr<WKCACFLayer> m_rootChildLayer;
- RefPtr<WKCACFLayer> m_clipLayer;
RetainPtr<CACFContextRef> m_context;
CARenderContext* m_renderContext;
CARenderOGLContext* m_renderer;
HWND m_hostWindow;
Timer<WKCACFLayerRenderer> m_renderTimer;
- IntPoint m_scrollPosition;
- IntSize m_scrollSize;
bool m_backingStoreDirty;
bool m_mustResetLostDeviceBeforeRendering;
#ifndef NDEBUG
diff --git a/WebCore/platform/graphics/win/WebLayer.cpp b/WebCore/platform/graphics/win/WebLayer.cpp
index 70a522d..70a522d 100755..100644
--- a/WebCore/platform/graphics/win/WebLayer.cpp
+++ b/WebCore/platform/graphics/win/WebLayer.cpp
diff --git a/WebCore/platform/graphics/win/WebTiledLayer.cpp b/WebCore/platform/graphics/win/WebTiledLayer.cpp
index 01dd6ae..01dd6ae 100755..100644
--- a/WebCore/platform/graphics/win/WebTiledLayer.cpp
+++ b/WebCore/platform/graphics/win/WebTiledLayer.cpp
diff --git a/WebCore/platform/graphics/wince/ColorWince.cpp b/WebCore/platform/graphics/wince/ColorWinCE.cpp
index 820b9d2..820b9d2 100644
--- a/WebCore/platform/graphics/wince/ColorWince.cpp
+++ b/WebCore/platform/graphics/wince/ColorWinCE.cpp
diff --git a/WebCore/platform/graphics/wince/FontCacheWince.cpp b/WebCore/platform/graphics/wince/FontCacheWinCE.cpp
index 6b5dfa5..ccfc063 100644
--- a/WebCore/platform/graphics/wince/FontCacheWince.cpp
+++ b/WebCore/platform/graphics/wince/FontCacheWinCE.cpp
@@ -348,5 +348,4 @@ void FontCache::getTraitsInFamily(const AtomicString& familyName, Vector<unsigne
copyToVector(procData.m_traitsMasks, traitsMasks);
}
-}
-
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/wince/FontWince.cpp b/WebCore/platform/graphics/wince/FontWinCE.cpp
index c0948c0..e2ff067 100644
--- a/WebCore/platform/graphics/wince/FontWince.cpp
+++ b/WebCore/platform/graphics/wince/FontWinCE.cpp
@@ -334,4 +334,4 @@ bool Font::canReturnFallbackFontsForComplexText()
return false;
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/wince/GlyphPageTreeNodeWince.cpp b/WebCore/platform/graphics/wince/GlyphPageTreeNodeWinCE.cpp
index 27c4e15..1c22f23 100644
--- a/WebCore/platform/graphics/wince/GlyphPageTreeNodeWince.cpp
+++ b/WebCore/platform/graphics/wince/GlyphPageTreeNodeWinCE.cpp
@@ -75,5 +75,4 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
return true;
}
-}
-
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/wince/GradientWince.cpp b/WebCore/platform/graphics/wince/GradientWinCE.cpp
index 49fa970..d735881 100644
--- a/WebCore/platform/graphics/wince/GradientWince.cpp
+++ b/WebCore/platform/graphics/wince/GradientWinCE.cpp
@@ -34,7 +34,7 @@ static inline bool compareStops(const Gradient::ColorStop& a, const Gradient::Co
return a.stop < b.stop;
}
-const Vector<Gradient::ColorStop>& Gradient::getStops() const
+const Vector<Gradient::ColorStop, 2>& Gradient::getStops() const
{
if (!m_stopsSorted) {
if (m_stops.size())
@@ -49,4 +49,4 @@ void Gradient::fill(GraphicsContext* c, const FloatRect& r)
c->fillRect(r, this);
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp b/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
index 990a31d..a91b988 100644
--- a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
+++ b/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
@@ -29,7 +29,7 @@
#include "GraphicsContextPrivate.h"
#include "NotImplemented.h"
#include "Path.h"
-#include "PlatformPathWince.h"
+#include "PlatformPathWinCE.h"
#include "SharedBitmap.h"
#include "SimpleFontData.h"
#include <wtf/OwnPtr.h>
diff --git a/WebCore/platform/graphics/wince/ImageBufferWince.cpp b/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp
index 10e502d..15720f3 100644
--- a/WebCore/platform/graphics/wince/ImageBufferWince.cpp
+++ b/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp
@@ -25,9 +25,7 @@
#include "GraphicsContext.h"
#include "Image.h"
#include "ImageData.h"
-#include "JPEGEncoder.h"
#include "NotImplemented.h"
-#include "PNGEncoder.h"
#include "SharedBitmap.h"
#include "UnusedParam.h"
#include <wtf/UnusedParam.h>
@@ -250,28 +248,8 @@ String ImageBuffer::toDataURL(const String& mimeType, const double*) const
if (!m_data.m_bitmap->bytes())
return "data:,";
- Vector<char> output;
- const char* header;
- if (mimeType.lower() == "image/png") {
- if (!compressBitmapToPng(m_data.m_bitmap.get(), output))
- return "data:,";
- header = "data:image/png;base64,";
- } else {
- if (!compressBitmapToJpeg(m_data.m_bitmap.get(), output))
- return "data:,";
- header = "data:image/jpeg;base64,";
- }
-
- Vector<char> base64;
- base64Encode(output, base64);
-
- output.clear();
-
- Vector<char> url;
- url.append(header, strlen(header));
- url.append(base64);
-
- return String(url.data(), url.size());
+ notImplemented();
+ return String();
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/wince/ImageWinCE.cpp b/WebCore/platform/graphics/wince/ImageWinCE.cpp
new file mode 100644
index 0000000..61ec954
--- /dev/null
+++ b/WebCore/platform/graphics/wince/ImageWinCE.cpp
@@ -0,0 +1,199 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2009 Torch Mobile Inc.
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Image.h"
+
+#include "BitmapImage.h"
+#include "GraphicsContext.h"
+#include "ImageDecoder.h"
+#include "NotImplemented.h"
+#include "PlatformString.h"
+#include "SharedBuffer.h"
+#include "TransformationMatrix.h"
+#include "WinceGraphicsExtras.h"
+#include <wtf/OwnPtr.h>
+
+#include <windows.h>
+
+namespace WebCore {
+
+NativeImagePtr RGBA32Buffer::asNewNativeImage() const
+{
+ NativeImagePtr image = SharedBitmap::createInstance(false, width(), height(), false);
+
+ memcpy(image->bytes(), m_bytes.data(), m_bytes.size() * sizeof(PixelData));
+
+ return image;
+}
+
+bool FrameData::clear(bool clearMetaData)
+{
+ if (clearMetaData)
+ m_haveMetadata = false;
+
+ if (m_frame) {
+ m_frame = 0;
+ return true;
+ }
+
+ return false;
+}
+
+bool BitmapImage::getHBITMAPOfSize(HBITMAP bmp, LPSIZE size)
+{
+ if (!bmp)
+ return false;
+
+ BITMAP bmpInfo;
+ GetObject(bmp, sizeof(BITMAP), &bmpInfo);
+
+ ASSERT(bmpInfo.bmBitsPixel == 32);
+ int bufferSize = bmpInfo.bmWidthBytes * bmpInfo.bmHeight;
+
+ OwnPtr<HDC> hdc(CreateCompatibleDC(0));
+ HGDIOBJ hOldBmp = SelectObject(hdc.get(), bmp);
+
+ {
+ GraphicsContext gc(hdc.get());
+
+ IntSize imageSize = BitmapImage::size();
+ if (size)
+ drawFrameMatchingSourceSize(&gc, FloatRect(0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight), IntSize(*size), DeviceColorSpace, CompositeCopy);
+ else
+ draw(&gc, FloatRect(0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0, 0, imageSize.width(), imageSize.height()), DeviceColorSpace, CompositeCopy);
+ }
+
+ SelectObject(hdc.get(), hOldBmp);
+
+ return true;
+}
+
+void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext* ctxt, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator compositeOp)
+{
+ int frames = frameCount();
+ for (int i = 0; i < frames; ++i) {
+ RefPtr<SharedBitmap> bmp = frameAtIndex(i);
+ if (!bmp || bmp->height() != static_cast<unsigned>(srcSize.height()) || bmp->width() != static_cast<unsigned>(srcSize.width()))
+ continue;
+
+ size_t currentFrame = m_currentFrame;
+ m_currentFrame = i;
+ draw(ctxt, dstRect, FloatRect(0, 0, srcSize.width(), srcSize.height()), styleColorSpace, compositeOp);
+ m_currentFrame = currentFrame;
+ return;
+ }
+
+ // No image of the correct size was found, fallback to drawing the current frame
+ IntSize imageSize = BitmapImage::size();
+ draw(ctxt, dstRect, FloatRect(0, 0, imageSize.width(), imageSize.height()), styleColorSpace, compositeOp);
+}
+
+void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRectIn, ColorSpace styleColorSpace, CompositeOperator compositeOp)
+{
+ if (!m_source.initialized())
+ return;
+
+ if (mayFillWithSolidColor())
+ fillWithSolidColor(ctxt, dstRect, solidColor(), styleColorSpace, compositeOp);
+ else {
+ IntRect intSrcRect(srcRectIn);
+ RefPtr<SharedBitmap> bmp = frameAtIndex(m_currentFrame);
+
+ if (bmp->width() != m_source.size().width()) {
+ double scaleFactor = static_cast<double>(bmp->width()) / m_source.size().width();
+
+ intSrcRect.setX(stableRound(srcRectIn.x() * scaleFactor));
+ intSrcRect.setWidth(stableRound(srcRectIn.width() * scaleFactor));
+ intSrcRect.setY(stableRound(srcRectIn.y() * scaleFactor));
+ intSrcRect.setHeight(stableRound(srcRectIn.height() * scaleFactor));
+ }
+ bmp->draw(ctxt, enclosingIntRect(dstRect), intSrcRect, styleColorSpace, compositeOp);
+ }
+
+ startAnimation();
+}
+
+void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const AffineTransform& patternTransform,
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
+{
+ notImplemented();
+}
+
+void BitmapImage::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRectIn, const AffineTransform& patternTransform,
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
+{
+ RefPtr<SharedBitmap> bmp = nativeImageForCurrentFrame();
+ if (!bmp)
+ return;
+
+ bmp->drawPattern(ctxt, tileRectIn, patternTransform, phase, styleColorSpace, op, destRect, m_source.size());
+}
+
+void BitmapImage::checkForSolidColor()
+{
+ if (m_checkedForSolidColor)
+ return;
+
+ if (frameCount() != 1) {
+ m_isSolidColor = false;
+ m_checkedForSolidColor = true;
+ return;
+ }
+
+ RefPtr<SharedBitmap> bmp = frameAtIndex(0);
+ if (!bmp || !bmp->validHeight()) {
+ m_isSolidColor = false;
+ return;
+ }
+
+ if (bmp->width() != 1 || bmp->validHeight() != 1) {
+ m_isSolidColor = false;
+ m_checkedForSolidColor = true;
+ return;
+ }
+
+ m_isSolidColor = true;
+
+ if (bmp->is16bit()) {
+ unsigned short c = ((unsigned short *)bmp->bytes())[0];
+ int r = (c >> 7) & 0xF8;
+ int g = (c >> 2) & 0xF8;
+ int b = (c << 3) & 0xF8;
+ if (bmp->usesTransparentColor() && bmp->transparentColor() == RGB(r, g, b))
+ m_solidColor = Color(r, g, b, 0);
+ else
+ m_solidColor = Color(r, g, b);
+ } else {
+ unsigned c = ((unsigned *)bmp->bytes())[0];
+ m_solidColor = Color(c);
+ }
+
+ if (bmp->validHeight() == bmp->height())
+ m_checkedForSolidColor = true;
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/wince/MediaPlayerPrivateWince.h b/WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h
index e86b8a9..f49d8e2 100644
--- a/WebCore/platform/graphics/wince/MediaPlayerPrivateWince.h
+++ b/WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h
@@ -24,8 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef MediaPlayerPrivateWince_h
-#define MediaPlayerPrivateWince_h
+#ifndef MediaPlayerPrivateWinCE_h
+#define MediaPlayerPrivateWinCE_h
#if ENABLE(VIDEO)
@@ -120,6 +120,6 @@ namespace WebCore {
}
-#endif
+#endif // ENABLE(VIDEO)
-#endif
+#endif // MediaPlayerPrivateWinCE_h
diff --git a/WebCore/platform/graphics/wince/PathWince.cpp b/WebCore/platform/graphics/wince/PathWinCE.cpp
index 6aa2864..4f0195c 100644
--- a/WebCore/platform/graphics/wince/PathWince.cpp
+++ b/WebCore/platform/graphics/wince/PathWinCE.cpp
@@ -23,7 +23,7 @@
#include "AffineTransform.h"
#include "FloatRect.h"
#include "NotImplemented.h"
-#include "PlatformPathWince.h"
+#include "PlatformPathWinCE.h"
#include "PlatformString.h"
#include <wtf/OwnPtr.h>
diff --git a/WebCore/platform/graphics/wince/PlatformPathWince.cpp b/WebCore/platform/graphics/wince/PlatformPathWinCE.cpp
index b42b52c..4072a18 100644
--- a/WebCore/platform/graphics/wince/PlatformPathWince.cpp
+++ b/WebCore/platform/graphics/wince/PlatformPathWinCE.cpp
@@ -18,14 +18,14 @@
*/
#include "config.h"
-#include "PlatformPathWince.h"
+#include "PlatformPathWinCE.h"
#include "AffineTransform.h"
#include "FloatRect.h"
#include "GraphicsContext.h"
#include "Path.h"
#include "PlatformString.h"
-#include "WinceGraphicsExtras.h"
+#include "WinCEGraphicsExtras.h"
#include <wtf/MathExtras.h>
#include <wtf/OwnPtr.h>
@@ -33,7 +33,7 @@
namespace WebCore {
-// Implemented in GraphicsContextWince.cpp
+// Implemented in GraphicsContextWinCE.cpp
void getEllipsePointByAngle(double angle, double a, double b, float& x, float& y);
static void quadCurve(int segments, Vector<PathPoint>& pts, const PathPoint* control)
diff --git a/WebCore/platform/graphics/wince/PlatformPathWince.h b/WebCore/platform/graphics/wince/PlatformPathWinCE.h
index 614e8c5..3414b04 100644
--- a/WebCore/platform/graphics/wince/PlatformPathWince.h
+++ b/WebCore/platform/graphics/wince/PlatformPathWinCE.h
@@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef PlatformPathWince_h
-#define PlatformPathWince_h
+#ifndef PlatformPathWinCE_h
+#define PlatformPathWinCE_h
#include "FloatPoint.h"
#include "FloatRect.h"
@@ -180,4 +180,4 @@ namespace WebCore {
}
-#endif // PlatformPathWince_h
+#endif // PlatformPathWinCE_h
diff --git a/WebCore/platform/graphics/wince/SimpleFontDataWince.cpp b/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp
index 6c815fc..c8c5474 100644
--- a/WebCore/platform/graphics/wince/SimpleFontDataWince.cpp
+++ b/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp
@@ -163,4 +163,4 @@ void SimpleFontData::platformCharWidthInit()
m_maxCharWidth = (tm.tmMaxCharWidth * m_platformData.size() + 36) / 72;
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/wince/WinceGraphicsExtras.h b/WebCore/platform/graphics/wince/WinCEGraphicsExtras.h
index 2a6fae1..4cab21c 100644
--- a/WebCore/platform/graphics/wince/WinceGraphicsExtras.h
+++ b/WebCore/platform/graphics/wince/WinCEGraphicsExtras.h
@@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef WinceGraphicsExtras_h
-#define WinceGraphicsExtras_h
+#ifndef WinCEGraphicsExtras_h
+#define WinCEGraphicsExtras_h
// This file is used to contain small utilities used by WINCE graphics code.
@@ -36,4 +36,4 @@ namespace WebCore {
}
}
-#endif WinceGraphicsExtras_h
+#endif WinCEGraphicsExtras_h
diff --git a/WebCore/platform/gtk/ClipboardGtk.cpp b/WebCore/platform/gtk/ClipboardGtk.cpp
index 3fe5ba1..327f069 100644
--- a/WebCore/platform/gtk/ClipboardGtk.cpp
+++ b/WebCore/platform/gtk/ClipboardGtk.cpp
@@ -265,9 +265,8 @@ PassRefPtr<FileList> ClipboardGtk::files() const
RefPtr<FileList> fileList = FileList::create();
Vector<String> fileVector(m_dataObject->files());
- ScriptExecutionContext* scriptExecutionContext = m_frame->document()->scriptExecutionContext();
for (size_t i = 0; i < fileVector.size(); i++)
- fileList->append(File::create(scriptExecutionContext, fileVector[i]));
+ fileList->append(File::create(fileVector[i]));
return fileList.release();
}
diff --git a/WebCore/platform/gtk/DragImageGtk.cpp b/WebCore/platform/gtk/DragImageGtk.cpp
index 4c77830..9d0d838 100644
--- a/WebCore/platform/gtk/DragImageGtk.cpp
+++ b/WebCore/platform/gtk/DragImageGtk.cpp
@@ -1,4 +1,6 @@
/*
+ * 2010 Igalia S.L
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@@ -19,15 +21,15 @@
#include "CachedImage.h"
#include "Image.h"
-
-#include <gtk/gtk.h>
+#include "PlatformRefPtrCairo.h"
+#include <cairo.h>
namespace WebCore {
IntSize dragImageSize(DragImageRef image)
{
if (image)
- return IntSize(gdk_pixbuf_get_width(image), gdk_pixbuf_get_height(image));
+ return IntSize(cairo_image_surface_get_width(image), cairo_image_surface_get_height(image));
return IntSize(0, 0);
}
@@ -35,32 +37,45 @@ IntSize dragImageSize(DragImageRef image)
void deleteDragImage(DragImageRef image)
{
if (image)
- g_object_unref(image);
+ cairo_surface_destroy(image);
}
DragImageRef scaleDragImage(DragImageRef image, FloatSize scale)
{
- if (image) {
- IntSize imageSize = dragImageSize(image);
- GdkPixbuf* scaledImage = gdk_pixbuf_scale_simple(image,
- imageSize.width() * scale.width(),
- imageSize.height() * scale.height(),
- GDK_INTERP_BILINEAR);
- deleteDragImage(image);
- return scaledImage;
- }
+ if (!image)
+ return 0;
- return 0;
+ int newWidth = scale.width() * cairo_image_surface_get_width(image);
+ int newHeight = scale.height() * cairo_image_surface_get_height(image);
+ cairo_surface_t* scaledSurface = cairo_surface_create_similar(image, CAIRO_CONTENT_COLOR_ALPHA, newWidth, newHeight);
+
+ PlatformRefPtr<cairo_t> context = adoptPlatformRef(cairo_create(scaledSurface));
+ cairo_scale(context.get(), scale.width(), scale.height());
+ cairo_pattern_set_extend(cairo_get_source(context.get()), CAIRO_EXTEND_PAD);
+ cairo_pattern_set_filter(cairo_get_source(context.get()), CAIRO_FILTER_BEST);
+ cairo_set_operator(context.get(), CAIRO_OPERATOR_SOURCE);
+ cairo_set_source_surface(context.get(), image, 0, 0);
+ cairo_paint(context.get());
+
+ deleteDragImage(image);
+ return scaledSurface;
}
-DragImageRef dissolveDragImageToFraction(DragImageRef image, float)
+DragImageRef dissolveDragImageToFraction(DragImageRef image, float fraction)
{
+ if (!image)
+ return 0;
+
+ PlatformRefPtr<cairo_t> context = adoptPlatformRef(cairo_create(image));
+ cairo_set_operator(context.get(), CAIRO_OPERATOR_DEST_IN);
+ cairo_set_source_rgba(context.get(), 0, 0, 0, fraction);
+ cairo_paint(context.get());
return image;
}
DragImageRef createDragImageFromImage(Image* image)
{
- return image->getGdkPixbuf();
+ return cairo_surface_reference(image->nativeImageForCurrentFrame());
}
DragImageRef createDragImageIconForCachedImage(CachedImage*)
diff --git a/WebCore/platform/gtk/GtkVersioning.h b/WebCore/platform/gtk/GtkVersioning.h
index eac3cb5..867e14f 100644
--- a/WebCore/platform/gtk/GtkVersioning.h
+++ b/WebCore/platform/gtk/GtkVersioning.h
@@ -23,9 +23,17 @@
#include <gtk/gtk.h>
+#ifndef GTK_API_VERSION_2
+#include <gdk/gdkkeysyms-compat.h>
+#endif
+
G_BEGIN_DECLS
// Macros to avoid deprecation checking churn
+#ifndef GTK_API_VERSION_2
+#define GDK_DISPLAY() (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()))
+#endif
+
#if !GTK_CHECK_VERSION(2, 21, 2)
#define gdk_visual_get_depth(visual) (visual)->depth
#define gdk_visual_get_bits_per_rgb(visual) (visual)->bits_per_rgb
@@ -34,6 +42,7 @@ G_BEGIN_DECLS
#endif // GTK_CHECK_VERSION(2, 21, 2)
#if !GTK_CHECK_VERSION(2, 20, 0)
+#define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED(widget)
#define gtk_widget_set_realized(widget, TRUE) GTK_WIDGET_SET_FLAGS((widget), GTK_REALIZED)
#define gtk_range_get_min_slider_size(range) (range)->min_slider_size
#endif // GTK_CHECK_VERSION(2, 20, 0)
diff --git a/WebCore/platform/gtk/KeyEventGtk.cpp b/WebCore/platform/gtk/KeyEventGtk.cpp
index f90647d..50dfa4c 100644
--- a/WebCore/platform/gtk/KeyEventGtk.cpp
+++ b/WebCore/platform/gtk/KeyEventGtk.cpp
@@ -30,6 +30,7 @@
#include "config.h"
#include "PlatformKeyboardEvent.h"
+#include "GtkVersioning.h"
#include "NotImplemented.h"
#include "TextEncoding.h"
#include "WindowsKeyboardCodes.h"
diff --git a/WebCore/platform/gtk/PopupMenuGtk.cpp b/WebCore/platform/gtk/PopupMenuGtk.cpp
index ca067d9..d3e933d 100644
--- a/WebCore/platform/gtk/PopupMenuGtk.cpp
+++ b/WebCore/platform/gtk/PopupMenuGtk.cpp
@@ -87,7 +87,12 @@ void PopupMenuGtk::show(const IntRect& rect, FrameView* view, int index)
// The size calls are directly copied from gtkcombobox.c which is LGPL
GtkRequisition requisition;
gtk_widget_set_size_request(GTK_WIDGET(m_popup.get()), -1, -1);
+#ifdef GTK_API_VERSION_2
gtk_widget_size_request(GTK_WIDGET(m_popup.get()), &requisition);
+#else
+ gtk_size_request_get_size(GTK_SIZE_REQUEST(m_popup.get()), &requisition, NULL);
+#endif
+
gtk_widget_set_size_request(GTK_WIDGET(m_popup.get()), std::max(rect.width(), requisition.width), -1);
GList* children = gtk_container_get_children(GTK_CONTAINER(m_popup.get()));
@@ -99,7 +104,11 @@ void PopupMenuGtk::show(const IntRect& rect, FrameView* view, int index)
GtkWidget* item = reinterpret_cast<GtkWidget*>(p->data);
GtkRequisition itemRequisition;
+#ifdef GTK_API_VERSION_2
gtk_widget_get_child_requisition(item, &itemRequisition);
+#else
+ gtk_size_request_get_size(GTK_SIZE_REQUEST(item), &itemRequisition, NULL);
+#endif
m_menuPosition.setY(m_menuPosition.y() - itemRequisition.height);
p = g_list_next(p);
diff --git a/WebCore/platform/gtk/gtk2drawing.c b/WebCore/platform/gtk/gtk2drawing.c
index ba69cdc..fd770d2 100644
--- a/WebCore/platform/gtk/gtk2drawing.c
+++ b/WebCore/platform/gtk/gtk2drawing.c
@@ -1265,7 +1265,9 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWidgetType widget,
GtkStyle* style;
GtkScrollbar *scrollbar;
GtkAdjustment *adj;
+#ifdef GTK_API_VERSION_2
gboolean activate_slider;
+#endif
ensure_scrollbar_widget();
@@ -1317,6 +1319,7 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWidgetType widget,
style = gtk_widget_get_style(GTK_WIDGET(scrollbar));
+#ifdef GTK_API_VERSION_2
gtk_widget_style_get(GTK_WIDGET(scrollbar), "activate-slider",
&activate_slider, NULL);
@@ -1324,6 +1327,7 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWidgetType widget,
shadow_type = GTK_SHADOW_IN;
state_type = GTK_STATE_ACTIVE;
}
+#endif
TSOffsetStyleGCs(style, rect->x, rect->y);
@@ -1812,7 +1816,11 @@ moz_gtk_combo_box_paint(GdkDrawable* drawable, GdkRectangle* rect,
rect, &arrow_rect, direction, ishtml);
/* Now arrow_rect contains the inner rect ; we want to correct the width
* to what the arrow needs (see gtk_combo_box_size_allocate) */
+#ifdef GTK_API_VERSION_2
gtk_widget_size_request(gParts->comboBoxArrowWidget, &arrow_req);
+#else
+ gtk_size_request_get_size(GTK_SIZE_REQUEST(gParts->comboBoxArrowWidget), &arrow_req, NULL);
+#endif
if (direction == GTK_TEXT_DIR_LTR)
arrow_rect.x += arrow_rect.width - arrow_req.width;
arrow_rect.width = arrow_req.width;
@@ -2783,8 +2791,11 @@ moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
XTHICKNESS(style);
}
+#ifdef GTK_API_VERSION_2
gtk_widget_size_request(gParts->comboBoxArrowWidget, &arrow_req);
-
+#else
+ gtk_size_request_get_size(GTK_SIZE_REQUEST(gParts->comboBoxArrowWidget), &arrow_req, NULL);
+#endif
if (direction == GTK_TEXT_DIR_RTL)
*left += separator_width + arrow_req.width;
else
@@ -2948,7 +2959,12 @@ moz_gtk_get_combo_box_entry_button_size(gint* width, gint* height)
GtkRequisition requisition;
ensure_combo_box_entry_widgets();
+#ifdef GTK_API_VERSION_2
gtk_widget_size_request(gParts->comboBoxEntryButtonWidget, &requisition);
+#else
+ gtk_size_request_get_size(GTK_SIZE_REQUEST(gParts->comboBoxEntryButtonWidget), &requisition, NULL);
+#endif
+
*width = requisition.width;
*height = requisition.height;
@@ -2976,7 +2992,12 @@ moz_gtk_get_downarrow_size(gint* width, gint* height)
GtkRequisition requisition;
ensure_button_arrow_widget();
+#ifdef GTK_API_VERSION_2
gtk_widget_size_request(gParts->buttonArrowWidget, &requisition);
+#else
+ gtk_size_request_get_size(GTK_SIZE_REQUEST(gParts->buttonArrowWidget), &requisition, NULL);
+#endif
+
*width = requisition.width;
*height = requisition.height;
diff --git a/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp b/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
index a2397ee..4d2a92d 100644
--- a/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
@@ -197,8 +197,8 @@ bool GIFImageDecoder::haveDecodedRow(unsigned frameIndex, unsigned char* rowBuff
// row's X-coordinates.
int xBegin = upperBoundScaledX(frameReader->x_offset);
int yBegin = upperBoundScaledY(frameReader->y_offset + rowNumber);
- int xEnd = lowerBoundScaledX(std::min(xBegin + static_cast<int>(rowEnd - rowBuffer), size().width()) - 1, xBegin + 1) + 1;
- int yEnd = lowerBoundScaledY(std::min(yBegin + static_cast<int>(repeatCount), size().height()) - 1, yBegin + 1) + 1;
+ int xEnd = lowerBoundScaledX(std::min(static_cast<int>(frameReader->x_offset + (rowEnd - rowBuffer)), size().width()) - 1, xBegin + 1) + 1;
+ int yEnd = lowerBoundScaledY(std::min(static_cast<int>(frameReader->y_offset + rowNumber + repeatCount), size().height()) - 1, yBegin + 1) + 1;
if (!rowBuffer || (xBegin < 0) || (yBegin < 0) || (xEnd <= xBegin) || (yEnd <= yBegin))
return true;
diff --git a/WebCore/platform/image-encoders/JPEGImageEncoder.cpp b/WebCore/platform/image-encoders/JPEGImageEncoder.cpp
new file mode 100644
index 0000000..d707aa8
--- /dev/null
+++ b/WebCore/platform/image-encoders/JPEGImageEncoder.cpp
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2009 Torch Mobile, Inc. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#include "config.h"
+#include "JPEGImageEncoder.h"
+
+#include "IntSize.h"
+// FIXME: jpeglib.h requires stdio.h to be included first for FILE
+#include <stdio.h>
+#include "jpeglib.h"
+#include <setjmp.h>
+
+namespace WebCore {
+
+class JPEGDestinationManager : public jpeg_destination_mgr {
+public:
+ explicit JPEGDestinationManager(Vector<char>& toDump)
+ : m_dump(toDump)
+ {
+ // Zero base class memory.
+ jpeg_destination_mgr* base = this;
+ memset(base, 0, sizeof(jpeg_destination_mgr));
+ }
+ Vector<char> m_buffer;
+ Vector<char>& m_dump;
+};
+
+class JPEGCompressErrorMgr : public jpeg_error_mgr {
+public:
+ JPEGCompressErrorMgr()
+ {
+ // Zero memory
+ memset(this, 0, sizeof(JPEGCompressErrorMgr));
+ }
+
+ jmp_buf m_setjmpBuffer;
+};
+
+static void jpegInitializeDestination(j_compress_ptr compressData)
+{
+ JPEGDestinationManager* dest = static_cast<JPEGDestinationManager*>(compressData->dest);
+ dest->m_buffer.resize(4096);
+ dest->next_output_byte = reinterpret_cast<JOCTET*>(dest->m_buffer.data());
+ dest->free_in_buffer = dest->m_buffer.size();
+}
+
+static boolean jpegEmptyOutputBuffer(j_compress_ptr compressData)
+{
+ JPEGDestinationManager* dest = static_cast<JPEGDestinationManager*>(compressData->dest);
+ dest->m_dump.append(dest->m_buffer.data(), dest->m_buffer.size() - dest->free_in_buffer);
+ dest->next_output_byte = reinterpret_cast<JOCTET*>(dest->m_buffer.data());
+ dest->free_in_buffer = dest->m_buffer.size();
+ return TRUE;
+}
+
+static void jpegTerminateDestination(j_compress_ptr compressData)
+{
+ JPEGDestinationManager* dest = static_cast<JPEGDestinationManager*>(compressData->dest);
+ dest->m_dump.append(dest->m_buffer.data(), dest->m_buffer.size() - dest->free_in_buffer);
+}
+
+static void jpegErrorExit(j_common_ptr compressData)
+{
+ JPEGCompressErrorMgr* err = static_cast<JPEGCompressErrorMgr*>(compressData->err);
+ longjmp(err->m_setjmpBuffer, -1);
+}
+
+bool compressRGBABigEndianToJPEG(unsigned char* rgbaBigEndianData, const IntSize& size, Vector<char>& jpegData)
+{
+ struct jpeg_compress_struct compressData = { 0 };
+ JPEGCompressErrorMgr err;
+ compressData.err = jpeg_std_error(&err);
+ err.error_exit = jpegErrorExit;
+
+ jpeg_create_compress(&compressData);
+
+ JPEGDestinationManager dest(jpegData);
+ compressData.dest = &dest;
+ dest.init_destination = jpegInitializeDestination;
+ dest.empty_output_buffer = jpegEmptyOutputBuffer;
+ dest.term_destination = jpegTerminateDestination;
+
+ compressData.image_width = size.width();
+ compressData.image_height = size.height();
+ compressData.input_components = 3;
+ compressData.in_color_space = JCS_RGB;
+ jpeg_set_defaults(&compressData);
+ jpeg_set_quality(&compressData, 65, FALSE);
+
+ // rowBuffer must be defined here so that its destructor is always called even when "setjmp" catches an error.
+ Vector<JSAMPLE, 600 * 3> rowBuffer;
+
+ if (setjmp(err.m_setjmpBuffer))
+ return false;
+
+ jpeg_start_compress(&compressData, TRUE);
+ rowBuffer.resize(compressData.image_width * 3);
+
+ const unsigned char* pixel = rgbaBigEndianData;
+ const unsigned char* pixelEnd = pixel + compressData.image_width * compressData.image_height * 4;
+ while (pixel < pixelEnd) {
+ JSAMPLE* output = rowBuffer.data();
+ for (const unsigned char* rowEnd = pixel + compressData.image_width * 4; pixel < rowEnd;) {
+ *output++ = static_cast<JSAMPLE>(*pixel++ & 0xFF); // red
+ *output++ = static_cast<JSAMPLE>(*pixel++ & 0xFF); // green
+ *output++ = static_cast<JSAMPLE>(*pixel++ & 0xFF); // blue
+ ++pixel; // skip alpha
+ }
+ output = rowBuffer.data();
+ jpeg_write_scanlines(&compressData, &output, 1);
+ }
+
+ jpeg_finish_compress(&compressData);
+ return true;
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/image-encoders/JPEGImageEncoder.h b/WebCore/platform/image-encoders/JPEGImageEncoder.h
new file mode 100644
index 0000000..a373c4f
--- /dev/null
+++ b/WebCore/platform/image-encoders/JPEGImageEncoder.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2009 Torch Mobile, Inc. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2009-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 JPEGImageEncoder_h
+#define JPEGImageEncoder_h
+
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class IntSize;
+bool compressRGBABigEndianToJPEG(unsigned char* rgbaBigEndianData, const IntSize& size, Vector<char>& jpegData);
+
+}
+
+#endif // JPEGImageEncoder_h
diff --git a/WebCore/platform/image-encoders/PNGImageEncoder.cpp b/WebCore/platform/image-encoders/PNGImageEncoder.cpp
new file mode 100644
index 0000000..358d351
--- /dev/null
+++ b/WebCore/platform/image-encoders/PNGImageEncoder.cpp
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2006-2009, Google Inc. All rights reserved.
+ * Copyright (c) 2009 Torch Mobile, Inc. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2009-2010. 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 "PNGImageEncoder.h"
+
+#include "IntSize.h"
+#include "png.h"
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+// Encoder --------------------------------------------------------------------
+//
+// This section of the code is based on nsPNGEncoder.cpp in Mozilla
+// (Copyright 2005 Google Inc.)
+
+// Passed around as the io_ptr in the png structs so our callbacks know where
+// to write data.
+struct PNGEncoderState {
+ PNGEncoderState(Vector<char>* o) : m_dump(o) {}
+ Vector<char>* m_dump;
+};
+
+// Called by libpng to flush its internal buffer to ours.
+void encoderWriteCallback(png_structp png, png_bytep data, png_size_t size)
+{
+ PNGEncoderState* state = static_cast<PNGEncoderState*>(png_get_io_ptr(png));
+ ASSERT(state->m_dump);
+
+ size_t oldSize = state->m_dump->size();
+ state->m_dump->resize(oldSize + size);
+ char* destination = state->m_dump->data() + oldSize;
+ memcpy(destination, data, size);
+}
+
+// Automatically destroys the given write structs on destruction to make
+// cleanup and error handling code cleaner.
+class PNGWriteStructDestroyer {
+public:
+ PNGWriteStructDestroyer(png_struct** ps, png_info** pi)
+ : m_pngStruct(ps)
+ , m_pngInfo(pi)
+ {
+ }
+
+ ~PNGWriteStructDestroyer()
+ {
+ png_destroy_write_struct(m_pngStruct, m_pngInfo);
+ }
+
+private:
+ png_struct** m_pngStruct;
+ png_info** m_pngInfo;
+};
+
+bool compressRGBABigEndianToPNG(unsigned char* rgbaBigEndianData, const IntSize& size, Vector<char>& pngData)
+{
+ png_struct* pngPtr = png_create_write_struct(PNG_LIBPNG_VER_STRING, png_voidp_NULL, png_error_ptr_NULL, png_error_ptr_NULL);
+ if (!pngPtr)
+ return false;
+
+ png_info* infoPtr = png_create_info_struct(pngPtr);
+ if (!infoPtr) {
+ png_destroy_write_struct(&pngPtr, 0);
+ return false;
+ }
+ PNGWriteStructDestroyer destroyer(&pngPtr, &infoPtr);
+
+ // The destroyer will ensure that the structures are cleaned up in this
+ // case, even though we may get here as a jump from random parts of the
+ // PNG library called below.
+ if (setjmp(png_jmpbuf(pngPtr)))
+ return false;
+
+ // Set our callback for libpng to give us the data.
+ PNGEncoderState state(&pngData);
+ png_set_write_fn(pngPtr, &state, encoderWriteCallback, 0);
+
+ int pngOutputColorType = PNG_COLOR_TYPE_RGB_ALPHA;
+
+ png_set_IHDR(pngPtr, infoPtr, size.width(), size.height(), 8, pngOutputColorType,
+ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
+ PNG_FILTER_TYPE_DEFAULT);
+ png_write_info(pngPtr, infoPtr);
+
+ unsigned bytesPerRow = size.width() * 4;
+ for (unsigned y = 0; y < size.height(); ++y) {
+ png_write_row(pngPtr, rgbaBigEndianData);
+ rgbaBigEndianData += bytesPerRow;
+ }
+
+ png_write_end(pngPtr, infoPtr);
+ return true;
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/image-encoders/PNGImageEncoder.h b/WebCore/platform/image-encoders/PNGImageEncoder.h
new file mode 100644
index 0000000..0c09086
--- /dev/null
+++ b/WebCore/platform/image-encoders/PNGImageEncoder.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2007-2009 Torch Mobile, Inc.
+ * Copyright (C) Research In Motion Limited 2009-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 PNGImageEncoder_h
+#define PNGImageEncoder_h
+
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class IntSize;
+bool compressRGBABigEndianToPNG(unsigned char* rgbaBigEndianData, const IntSize& size, Vector<char>& pngData);
+
+}
+
+#endif // PNGImageEncoder_h
diff --git a/WebCore/platform/mac/ClipboardMac.mm b/WebCore/platform/mac/ClipboardMac.mm
index 0cbb3f6..74a93b6 100644
--- a/WebCore/platform/mac/ClipboardMac.mm
+++ b/WebCore/platform/mac/ClipboardMac.mm
@@ -313,12 +313,11 @@ PassRefPtr<FileList> ClipboardMac::files() const
NSArray *absoluteURLs = absoluteURLsFromPasteboardFilenames(m_pasteboard.get());
NSUInteger count = [absoluteURLs count];
- ScriptExecutionContext* scriptExecutionContext = m_frame->document()->scriptExecutionContext();
RefPtr<FileList> fileList = FileList::create();
for (NSUInteger x = 0; x < count; x++) {
NSURL *absoluteURL = [NSURL URLWithString:[absoluteURLs objectAtIndex:x]];
ASSERT([absoluteURL isFileURL]);
- fileList->append(File::create(scriptExecutionContext, [absoluteURL path]));
+ fileList->append(File::create([absoluteURL path]));
}
return fileList.release(); // We will always return a FileList, sometimes empty
}
@@ -373,7 +372,7 @@ void ClipboardMac::writeRange(Range* range, Frame* frame)
{
ASSERT(range);
ASSERT(frame);
- Pasteboard::writeSelection(m_pasteboard.get(), range, frame->editor()->smartInsertDeleteEnabled() && frame->selectionGranularity() == WordGranularity, frame);
+ Pasteboard::writeSelection(m_pasteboard.get(), range, frame->editor()->smartInsertDeleteEnabled() && frame->selection()->granularity() == WordGranularity, frame);
}
void ClipboardMac::writePlainText(const String& text)
diff --git a/WebCore/platform/mac/PasteboardMac.mm b/WebCore/platform/mac/PasteboardMac.mm
index bba7cac..0625287 100644
--- a/WebCore/platform/mac/PasteboardMac.mm
+++ b/WebCore/platform/mac/PasteboardMac.mm
@@ -31,16 +31,22 @@
#import "DOMRangeInternal.h"
#import "Document.h"
#import "DocumentFragment.h"
+#import "DocumentLoader.h"
#import "Editor.h"
#import "EditorClient.h"
#import "Frame.h"
+#import "FrameLoaderClient.h"
#import "HitTestResult.h"
+#import "HTMLAnchorElement.h"
+#import "HTMLNames.h"
#import "Image.h"
#import "KURL.h"
#import "LegacyWebArchive.h"
#import "LoaderNSURLExtras.h"
#import "MIMETypeRegistry.h"
+#import "Page.h"
#import "RenderImage.h"
+#import "Text.h"
#import "WebCoreNSStringExtras.h"
#import "markup.h"
@@ -139,7 +145,8 @@ void Pasteboard::writeSelection(NSPasteboard* pasteboard, Range* selectedRange,
Pasteboard::generalPasteboard(); // Initializes pasteboard types.
ASSERT(selectedRange);
- NSAttributedString *attributedString = [[[NSAttributedString alloc] _initWithDOMRange:kit(selectedRange)] autorelease];
+ NSAttributedString *attributedString = [[[NSAttributedString alloc] initWithString:selectedRange->text()] autorelease];
+
#ifdef BUILDING_ON_TIGER
// 4930197: Mail overrides [WebHTMLView pasteboardTypesForSelection] in order to add another type to the pasteboard
// after WebKit does. On Tiger we must call this function so that Mail code will be executed, meaning that
@@ -362,12 +369,124 @@ String Pasteboard::plainText(Frame* frame)
return String();
}
+
+PassRefPtr<DocumentFragment> Pasteboard::documentFragmentWithImageResource(Frame* frame, PassRefPtr<ArchiveResource> resource)
+{
+ if (DocumentLoader* loader = frame->loader()->documentLoader())
+ loader->addArchiveResource(resource.get());
+
+ RefPtr<Element> imageElement = frame->document()->createElement(HTMLNames::imgTag, false);
+ if (!imageElement)
+ return 0;
+
+ NSURL *URL = resource->url();
+ imageElement->setAttribute(HTMLNames::srcAttr, [URL isFileURL] ? [URL absoluteString] : resource->url());
+ RefPtr<DocumentFragment> fragment = frame->document()->createDocumentFragment();
+ if (fragment) {
+ ExceptionCode ec;
+ fragment->appendChild(imageElement, ec);
+ return fragment.release();
+ }
+ return 0;
+}
+
+PassRefPtr<DocumentFragment> Pasteboard::documentFragmentWithRtf(Frame* frame, NSString* pboardType)
+{
+ if (!frame || !frame->document() || !frame->document()->isHTMLDocument())
+ return 0;
+
+ NSAttributedString *string = nil;
+ if (pboardType == NSRTFDPboardType)
+ string = [[NSAttributedString alloc] initWithRTFD:[m_pasteboard.get() dataForType:NSRTFDPboardType] documentAttributes:NULL];
+ if (string == nil)
+ string = [[NSAttributedString alloc] initWithRTF:[m_pasteboard.get() dataForType:NSRTFPboardType] documentAttributes:NULL];
+ if (string == nil)
+ return nil;
+
+ bool wasDeferringCallbacks = frame->page()->defersLoading();
+ if (!wasDeferringCallbacks)
+ frame->page()->setDefersLoading(true);
+
+ Vector<RefPtr<ArchiveResource> > resources;
+ RefPtr<DocumentFragment> fragment = frame->editor()->client()->documentFragmentFromAttributedString(string, resources);
+
+ size_t size = resources.size();
+ if (size) {
+ DocumentLoader* loader = frame->loader()->documentLoader();
+ for (size_t i = 0; i < size; ++i)
+ loader->addArchiveResource(resources[i]);
+ }
+
+ if (!wasDeferringCallbacks)
+ frame->page()->setDefersLoading(false);
+
+ [string release];
+ return fragment.release();
+}
+
+#define WebDataProtocolScheme @"webkit-fake-url"
+
+static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
+{
+ CFUUIDRef UUIDRef = CFUUIDCreate(kCFAllocatorDefault);
+ NSString *UUIDString = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, UUIDRef);
+ CFRelease(UUIDRef);
+ NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@/%@", WebDataProtocolScheme, UUIDString, relativePart]];
+ CFRelease(UUIDString);
+ return URL;
+}
+
PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefPtr<Range> context, bool allowPlainText, bool& chosePlainText)
{
NSArray *types = [m_pasteboard.get() types];
+ RefPtr<DocumentFragment> fragment;
chosePlainText = false;
+ if ([types containsObject:WebArchivePboardType]) {
+ RefPtr<LegacyWebArchive> coreArchive = LegacyWebArchive::create(SharedBuffer::wrapNSData([m_pasteboard.get() dataForType:WebArchivePboardType]).get());
+ if (coreArchive) {
+ RefPtr<ArchiveResource> mainResource = coreArchive->mainResource();
+ if (mainResource) {
+ NSString *MIMEType = mainResource->mimeType();
+ if (!frame || !frame->document())
+ return 0;
+ if (frame->loader()->client()->canShowMIMETypeAsHTML(MIMEType)) {
+ NSString *markupString = [[NSString alloc] initWithData:[mainResource->data()->createNSData() autorelease] encoding:NSUTF8StringEncoding];
+ // FIXME: seems poor form to do this as a side effect of getting a document fragment
+ if (DocumentLoader* loader = frame->loader()->documentLoader())
+ loader->addAllArchiveResources(coreArchive.get());
+
+ fragment = createFragmentFromMarkup(frame->document(), markupString, mainResource->url(), FragmentScriptingNotAllowed);
+ [markupString release];
+ } else if (MIMETypeRegistry::isSupportedImageMIMEType(MIMEType))
+ fragment = documentFragmentWithImageResource(frame, mainResource);
+ }
+ }
+ if (fragment)
+ return fragment.release();
+ }
+
+ if ([types containsObject:NSFilenamesPboardType]) {
+ NSArray* paths = [m_pasteboard.get() propertyListForType:NSFilenamesPboardType];
+ NSEnumerator* enumerator = [paths objectEnumerator];
+ NSString* path;
+ Vector< RefPtr<Node> > refNodesVector;
+ Vector<Node*> nodesVector;
+
+ while ((path = [enumerator nextObject]) != nil) {
+ // Non-image file types; _web_userVisibleString is appropriate here because this will
+ // be pasted as visible text.
+ NSString *url = frame->editor()->client()->userVisibleString([NSURL fileURLWithPath:path]);
+ RefPtr<Node> textNode = frame->document()->createTextNode(url);
+ refNodesVector.append(textNode.get());
+ nodesVector.append(textNode.get());
+ }
+ fragment = createFragmentFromNodes(frame->document(), nodesVector);
+ if (fragment && fragment->firstChild())
+ return fragment.release();
+ }
+
if ([types containsObject:NSHTMLPboardType]) {
NSString *HTMLString = [m_pasteboard.get() stringForType:NSHTMLPboardType];
// This is a hack to make Microsoft's HTML pasteboard data work. See 3778785.
@@ -377,24 +496,66 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
HTMLString = [HTMLString substringFromIndex:range.location];
}
}
- if ([HTMLString length] != 0) {
- // FIXME: FragmentScriptingNotAllowed is a HACK and should
- // be removed or replaced with an enum with a better name.
- // FragmentScriptingNotAllowed causes the Parser to remove children
- // of <script> tags (so javascript doesn't show up in pastes).
- RefPtr<DocumentFragment> fragment = createFragmentFromMarkup(frame->document(), HTMLString, "", FragmentScriptingNotAllowed);
- if (fragment)
- return fragment.release();
+ if ([HTMLString length] != 0 &&
+ (fragment = createFragmentFromMarkup(frame->document(), HTMLString, "", FragmentScriptingNotAllowed)))
+ return fragment.release();
+ }
+
+ if ([types containsObject:NSRTFDPboardType] &&
+ (fragment = documentFragmentWithRtf(frame, NSRTFDPboardType)))
+ return fragment.release();
+
+ if ([types containsObject:NSRTFPboardType] &&
+ (fragment = documentFragmentWithRtf(frame, NSRTFPboardType)))
+ return fragment.release();
+
+ if ([types containsObject:NSTIFFPboardType] &&
+ (fragment = documentFragmentWithImageResource(frame, ArchiveResource::create(SharedBuffer::wrapNSData([[[m_pasteboard.get() dataForType:NSTIFFPboardType] copy] autorelease]), uniqueURLWithRelativePart(@"image.tiff"), "image/tiff", "", ""))))
+ return fragment.release();
+
+ if ([types containsObject:NSPDFPboardType] &&
+ (fragment = documentFragmentWithImageResource(frame, ArchiveResource::create(SharedBuffer::wrapNSData([[[m_pasteboard.get() dataForType:NSPDFPboardType] copy] autorelease]), uniqueURLWithRelativePart(@"application.pdf"), "application/pdf", "", ""))))
+ return fragment.release();
+
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+ if ([types containsObject:NSPICTPboardType] &&
+ (fragment = documentFragmentWithImageResource(frame, ArchiveResource::create(SharedBuffer::wrapNSData([[[m_pasteboard.get() dataForType:NSPICTPboardType] copy] autorelease]), uniqueURLWithRelativePart(@"image.pict"), "image/pict", "", ""))))
+ return fragment.release();
+#endif
+
+ // Only 10.5 and higher support setting and retrieving pasteboard types with UTIs, but we don't believe
+ // that any applications on Tiger put types for which we only have a UTI, like PNG, on the pasteboard.
+ if ([types containsObject:(NSString*)kUTTypePNG] &&
+ (fragment = documentFragmentWithImageResource(frame, ArchiveResource::create(SharedBuffer::wrapNSData([[[m_pasteboard.get() dataForType:(NSString*)kUTTypePNG] copy] autorelease]), uniqueURLWithRelativePart(@"image.png"), "image/png", "", ""))))
+ return fragment.release();
+
+ if ([types containsObject:NSURLPboardType]) {
+ NSURL *URL = [NSURL URLFromPasteboard:m_pasteboard.get()];
+ Document* document = frame->document();
+ ASSERT(document);
+ if (!document)
+ return 0;
+ RefPtr<Element> anchor = document->createElement(HTMLNames::aTag, false);
+ NSString *URLString = [URL absoluteString]; // Original data is ASCII-only, so there is no need to precompose.
+ if ([URLString length] == 0)
+ return nil;
+ NSString *URLTitleString = [[m_pasteboard.get() stringForType:WebURLNamePboardType] precomposedStringWithCanonicalMapping];
+ ExceptionCode ec;
+ anchor->setAttribute(HTMLNames::hrefAttr, URLString);
+ anchor->appendChild(document->createTextNode(URLTitleString), ec);
+ fragment = document->createDocumentFragment();
+ if (fragment) {
+ fragment->appendChild(anchor, ec);
+ return fragment.release();
}
}
-
+
if (allowPlainText && [types containsObject:NSStringPboardType]) {
chosePlainText = true;
- RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), [[m_pasteboard.get() stringForType:NSStringPboardType] precomposedStringWithCanonicalMapping]);
- if (fragment)
- return fragment.release();
+ fragment = createFragmentFromText(context.get(), [[m_pasteboard.get() stringForType:NSStringPboardType] precomposedStringWithCanonicalMapping]);
+ return fragment.release();
}
-
+
return 0;
}
diff --git a/WebCore/platform/network/BlobResourceHandle.cpp b/WebCore/platform/network/BlobResourceHandle.cpp
index 8767b55..48ac2c0 100644
--- a/WebCore/platform/network/BlobResourceHandle.cpp
+++ b/WebCore/platform/network/BlobResourceHandle.cpp
@@ -80,7 +80,7 @@ public:
virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
virtual void didReceiveData(ResourceHandle*, const char*, int, int /*lengthReceived*/);
- virtual void didFinishLoading(ResourceHandle*);
+ virtual void didFinishLoading(ResourceHandle*, double /*finishTime*/);
virtual void didFail(ResourceHandle*, const ResourceError&);
private:
@@ -116,7 +116,7 @@ void BlobResourceSynchronousLoader::didReceiveData(ResourceHandle*, const char*,
{
}
-void BlobResourceSynchronousLoader::didFinishLoading(ResourceHandle*)
+void BlobResourceSynchronousLoader::didFinishLoading(ResourceHandle*, double)
{
}
@@ -581,7 +581,7 @@ void BlobResourceHandle::notifyFail(int errorCode)
void BlobResourceHandle::notifyFinish()
{
if (client())
- client()->didFinishLoading(this);
+ client()->didFinishLoading(this, 0);
}
} // namespace WebCore
diff --git a/WebCore/platform/network/NetworkingContext.h b/WebCore/platform/network/NetworkingContext.h
index 31f3025..a7d40dc 100644
--- a/WebCore/platform/network/NetworkingContext.h
+++ b/WebCore/platform/network/NetworkingContext.h
@@ -57,6 +57,7 @@ public:
#if PLATFORM(WIN)
virtual String userAgent() const = 0;
virtual String referrer() const = 0;
+ virtual ResourceError blockedError(const ResourceRequest&) const = 0;
#endif
protected:
diff --git a/WebCore/platform/network/ResourceHandle.cpp b/WebCore/platform/network/ResourceHandle.cpp
index 2da1d77..9910ac1 100644
--- a/WebCore/platform/network/ResourceHandle.cpp
+++ b/WebCore/platform/network/ResourceHandle.cpp
@@ -52,8 +52,7 @@ ResourceHandle::ResourceHandle(const ResourceRequest& request, ResourceHandleCli
}
}
-PassRefPtr<ResourceHandle> ResourceHandle::create(const ResourceRequest& request, ResourceHandleClient* client,
- Frame* frame, bool defersLoading, bool shouldContentSniff)
+PassRefPtr<ResourceHandle> ResourceHandle::create(NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff)
{
#if ENABLE(BLOB)
if (request.url().protocolIs("blob")) {
@@ -68,7 +67,7 @@ PassRefPtr<ResourceHandle> ResourceHandle::create(const ResourceRequest& request
if (newHandle->d->m_scheduledFailureType != NoFailure)
return newHandle.release();
- if (newHandle->start(frame))
+ if (newHandle->start(context))
return newHandle.release();
return 0;
diff --git a/WebCore/platform/network/ResourceHandle.h b/WebCore/platform/network/ResourceHandle.h
index 1167715..1cb9ee0 100644
--- a/WebCore/platform/network/ResourceHandle.h
+++ b/WebCore/platform/network/ResourceHandle.h
@@ -29,6 +29,7 @@
#include "AuthenticationChallenge.h"
#include "AuthenticationClient.h"
#include "HTTPHeaderMap.h"
+#include "NetworkingContext.h"
#include "ThreadableLoader.h"
#include <wtf/OwnPtr.h>
@@ -109,9 +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 PassRefPtr<ResourceHandle> create(NetworkingContext*, const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff);
+ static void loadResourceSynchronously(NetworkingContext*, const ResourceRequest&, StoredCredentials, ResourceError&, ResourceResponse&, Vector<char>& data);
static void prepareForURL(const KURL&);
static bool willLoadFromCache(ResourceRequest&, Frame*);
@@ -216,7 +216,7 @@ private:
void scheduleFailure(FailureType);
- bool start(Frame*);
+ bool start(NetworkingContext*);
virtual void refAuthenticationClient() { ref(); }
virtual void derefAuthenticationClient() { deref(); }
diff --git a/WebCore/platform/network/ResourceHandleClient.h b/WebCore/platform/network/ResourceHandleClient.h
index 97c0f54..d9350ee 100644
--- a/WebCore/platform/network/ResourceHandleClient.h
+++ b/WebCore/platform/network/ResourceHandleClient.h
@@ -26,6 +26,7 @@
#ifndef ResourceHandleClient_h
#define ResourceHandleClient_h
+#include <wtf/CurrentTime.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
@@ -72,7 +73,7 @@ namespace WebCore {
virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&) { }
virtual void didReceiveData(ResourceHandle*, const char*, int, int /*lengthReceived*/) { }
virtual void didReceiveCachedMetadata(ResourceHandle*, const char*, int) { }
- virtual void didFinishLoading(ResourceHandle*) { }
+ virtual void didFinishLoading(ResourceHandle*, double /*finishTime*/) { }
virtual void didFail(ResourceHandle*, const ResourceError&) { }
virtual void wasBlocked(ResourceHandle*) { }
virtual void cannotShowURL(ResourceHandle*) { }
diff --git a/WebCore/platform/network/ResourceHandleInternal.h b/WebCore/platform/network/ResourceHandleInternal.h
index 24b00bf..7b6db90 100644
--- a/WebCore/platform/network/ResourceHandleInternal.h
+++ b/WebCore/platform/network/ResourceHandleInternal.h
@@ -51,7 +51,6 @@ class Frame;
#endif
#if PLATFORM(QT)
-class QWebFrame;
class QWebNetworkJob;
namespace WebCore {
class QNetworkReplyHandler;
@@ -121,11 +120,9 @@ namespace WebCore {
, m_bufferSize(0)
, m_total(0)
, m_idleHandler(0)
- , m_frame(0)
#endif
#if PLATFORM(QT)
, m_job(0)
- , m_frame(0)
#endif
#if PLATFORM(MAC)
, m_startWhenScheduled(false)
@@ -202,11 +199,11 @@ namespace WebCore {
char* m_buffer;
gsize m_bufferSize, m_total;
guint m_idleHandler;
- Frame* m_frame;
+ RefPtr<NetworkingContext> m_context;
#endif
#if PLATFORM(QT)
QNetworkReplyHandler* m_job;
- QWebFrame* m_frame;
+ RefPtr<NetworkingContext> m_context;
#endif
#if PLATFORM(MAC)
diff --git a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
index 209906e..13412c1 100644
--- a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
+++ b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
@@ -92,7 +92,7 @@ private:
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 didFinishLoading(ResourceHandle*, double /*finishTime*/);
virtual void didFail(ResourceHandle*, const ResourceError&);
bool m_allowStoredCredentials;
@@ -241,7 +241,7 @@ void didFinishLoading(CFURLConnectionRef conn, const void* clientInfo)
LOG(Network, "CFNet - didFinishLoading(conn=%p, handle=%p) (%s)", conn, handle, handle->firstRequest().url().string().utf8().data());
if (handle->client())
- handle->client()->didFinishLoading(handle);
+ handle->client()->didFinishLoading(handle, 0);
}
void didFail(CFURLConnectionRef conn, CFErrorRef error, const void* clientInfo)
@@ -432,11 +432,14 @@ void ResourceHandle::createCFURLConnection(bool shouldUseCredentialStorage, bool
d->m_connection.adoptCF(CFURLConnectionCreateWithProperties(0, request.get(), reinterpret_cast<CFURLConnectionClient*>(&client), connectionProperties.get()));
}
-bool ResourceHandle::start(Frame* frame)
+bool ResourceHandle::start(NetworkingContext* context)
{
- // 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())
+ if (!context)
+ return false;
+
+ // If NetworkingContext is invalid then we are no longer attached to a Page,
+ // this must be an attempted load from an unload handler, so let's just block it.
+ if (!context->isValid())
return false;
bool shouldUseCredentialStorage = !client() || client()->shouldUseCredentialStorage(this);
@@ -615,7 +618,7 @@ CFURLConnectionRef ResourceHandle::releaseConnectionForDownload()
return d->m_connection.releaseRef();
}
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& vector, Frame* frame)
+void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& vector)
{
LOG(Network, "ResourceHandle::loadResourceSynchronously:%s allowStoredCredentials:%u", request.url().string().utf8().data(), storedCredentials);
@@ -629,8 +632,8 @@ void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, S
RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, client.get(), false /*defersLoading*/, true /*shouldContentSniff*/));
- if (handle->d->m_scheduledFailureType != NoFailure) {
- error = frame->loader()->blockedError(request);
+ if (context && handle->d->m_scheduledFailureType != NoFailure) {
+ error = context->blockedError(request);
return;
}
@@ -738,7 +741,7 @@ void WebCoreSynchronousLoaderClient::didReceiveData(ResourceHandle*, const char*
CFDataAppendBytes(m_data.get(), reinterpret_cast<const UInt8*>(data), length);
}
-void WebCoreSynchronousLoaderClient::didFinishLoading(ResourceHandle*)
+void WebCoreSynchronousLoaderClient::didFinishLoading(ResourceHandle*, double)
{
m_isDone = true;
}
diff --git a/WebCore/platform/network/curl/ResourceHandleCurl.cpp b/WebCore/platform/network/curl/ResourceHandleCurl.cpp
index 096905d..052ac56 100644
--- a/WebCore/platform/network/curl/ResourceHandleCurl.cpp
+++ b/WebCore/platform/network/curl/ResourceHandleCurl.cpp
@@ -47,7 +47,7 @@ public:
virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
virtual void didReceiveData(ResourceHandle*, const char*, int, int lengthReceived);
- virtual void didFinishLoading(ResourceHandle*);
+ virtual void didFinishLoading(ResourceHandle*, double /*finishTime*/);
virtual void didFail(ResourceHandle*, const ResourceError&);
ResourceResponse resourceResponse() const { return m_response; }
@@ -74,7 +74,7 @@ void WebCoreSynchronousLoader::didReceiveData(ResourceHandle*, const char* data,
m_data.append(data, length);
}
-void WebCoreSynchronousLoader::didFinishLoading(ResourceHandle*)
+void WebCoreSynchronousLoader::didFinishLoading(ResourceHandle*, double)
{
}
@@ -103,13 +103,14 @@ ResourceHandle::~ResourceHandle()
cancel();
}
-bool ResourceHandle::start(Frame* frame)
+bool ResourceHandle::start(NetworkingContext* context)
{
// The frame could be null if the ResourceHandle is not associated to any
// Frame, e.g. if we are downloading a file.
// If the frame is not null but the page is null this must be an attempted
- // load from an onUnload handler, so let's just block it.
- if (frame && !frame->page())
+ // load from an unload handler, so let's just block it.
+ // If both the frame and the page are not null the context is valid.
+ if (context && !context->isValid())
return false;
ResourceHandleManager::sharedInstance()->add(this);
@@ -187,7 +188,7 @@ bool ResourceHandle::loadsBlocked()
return false;
}
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame*)
+void ResourceHandle::loadResourceSynchronously(NetworkingContext*, const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data)
{
WebCoreSynchronousLoader syncLoader;
RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, &syncLoader, true, false));
diff --git a/WebCore/platform/network/curl/ResourceHandleManager.cpp b/WebCore/platform/network/curl/ResourceHandleManager.cpp
index 8d2a1bf..a4d71e0 100644
--- a/WebCore/platform/network/curl/ResourceHandleManager.cpp
+++ b/WebCore/platform/network/curl/ResourceHandleManager.cpp
@@ -397,7 +397,7 @@ void ResourceHandleManager::downloadTimerCallback(Timer<ResourceHandleManager>*
}
if (d->client())
- d->client()->didFinishLoading(job);
+ d->client()->didFinishLoading(job, 0);
} else {
char* url = 0;
curl_easy_getinfo(d->m_handle, CURLINFO_EFFECTIVE_URL, &url);
@@ -624,7 +624,7 @@ static void parseDataUrl(ResourceHandle* handle)
client->didReceiveData(handle, reinterpret_cast<const char*>(data.characters()), data.length() * sizeof(UChar), 0);
}
- client->didFinishLoading(handle);
+ client->didFinishLoading(handle, 0);
}
void ResourceHandleManager::dispatchSynchronousJob(ResourceHandle* job)
diff --git a/WebCore/platform/network/mac/ResourceHandleMac.mm b/WebCore/platform/network/mac/ResourceHandleMac.mm
index 0af86d0..daec366 100644
--- a/WebCore/platform/network/mac/ResourceHandleMac.mm
+++ b/WebCore/platform/network/mac/ResourceHandleMac.mm
@@ -115,7 +115,7 @@ private:
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 didFinishLoading(ResourceHandle*, double /*finishTime*/);
virtual void didFail(ResourceHandle*, const ResourceError&);
#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
virtual bool canAuthenticateAgainstProtectionSpace(ResourceHandle*, const ProtectionSpace&);
@@ -260,17 +260,16 @@ void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredential
#endif
}
-bool ResourceHandle::start(Frame* frame)
+bool ResourceHandle::start(NetworkingContext* context)
{
- if (!frame)
+ if (!context)
return false;
BEGIN_BLOCK_OBJC_EXCEPTIONS;
- // 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.
- Page* page = frame->page();
- if (!page)
+ // If NetworkingContext is invalid then we are no longer attached to a Page,
+ // this must be an attempted load from an unload event handler, so let's just block it.
+ if (!context->isValid())
return false;
#ifndef NDEBUG
@@ -293,16 +292,16 @@ bool ResourceHandle::start(Frame* frame)
firstRequest().setCachePolicy(ReloadIgnoringCacheData);
#endif
- d->m_needsSiteSpecificQuirks = frame->settings() && frame->settings()->needsSiteSpecificQuirks();
+ d->m_needsSiteSpecificQuirks = context->needsSiteSpecificQuirks();
createNSURLConnection(
d->m_proxy.get(),
shouldUseCredentialStorage,
- d->m_shouldContentSniff || frame->settings()->localFileContentSniffingEnabled());
+ d->m_shouldContentSniff || context->localFileContentSniffingEnabled());
#ifndef BUILDING_ON_TIGER
bool scheduled = false;
- if (SchedulePairHashSet* scheduledPairs = page->scheduledRunLoopPairs()) {
+ if (SchedulePairHashSet* scheduledPairs = context->scheduledRunLoopPairs()) {
SchedulePairHashSet::iterator end = scheduledPairs->end();
for (SchedulePairHashSet::iterator it = scheduledPairs->begin(); it != end; ++it) {
if (NSRunLoop *runLoop = (*it)->nsRunLoop()) {
@@ -461,7 +460,7 @@ bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame*)
#endif
}
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame)
+void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data)
{
LOG(Network, "ResourceHandle::loadResourceSynchronously:%@ allowStoredCredentials:%u", request.nsURLRequest(), storedCredentials);
@@ -483,15 +482,15 @@ void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, S
RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, client.get(), false /*defersLoading*/, true /*shouldContentSniff*/));
- if (handle->d->m_scheduledFailureType != NoFailure) {
- error = frame->loader()->blockedError(request);
+ if (context && handle->d->m_scheduledFailureType != NoFailure) {
+ error = context->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->shouldContentSniff() || (context && context->localFileContentSniffingEnabled()));
[handle->connection() scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:WebCoreSynchronousLoaderRunLoopMode];
[handle->connection() start];
@@ -507,7 +506,7 @@ void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, S
#else
UNUSED_PARAM(storedCredentials);
- UNUSED_PARAM(frame);
+ UNUSED_PARAM(context);
NSURLRequest *firstRequest = request.nsURLRequest();
// If a URL already has cookies, then we'll relax the 3rd party cookie policy and accept new cookies.
@@ -918,7 +917,7 @@ void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challen
if (!ResourceHandle::didSendBodyDataDelegateExists())
disassociateStreamWithResourceHandle([m_handle->firstRequest().nsURLRequest() HTTPBodyStream]);
- m_handle->client()->didFinishLoading(m_handle);
+ m_handle->client()->didFinishLoading(m_handle, 0);
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
@@ -1060,7 +1059,7 @@ void WebCoreSynchronousLoaderClient::didReceiveData(ResourceHandle*, const char*
[m_data appendBytes:data length:length];
}
-void WebCoreSynchronousLoaderClient::didFinishLoading(ResourceHandle*)
+void WebCoreSynchronousLoaderClient::didFinishLoading(ResourceHandle*, double)
{
m_isDone = true;
}
diff --git a/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index 915dc9a..30f7011 100644
--- a/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -34,6 +34,7 @@
#include <QNetworkCookie>
#include <qwebframe.h>
#include <qwebpage.h>
+
#include <wtf/text/CString.h>
#include <QDebug>
@@ -171,7 +172,11 @@ QNetworkReplyHandler::QNetworkReplyHandler(ResourceHandle* handle, LoadMode load
else
m_method = QNetworkAccessManager::UnknownOperation;
- m_request = r.toNetworkRequest(m_resourceHandle->getInternal()->m_frame);
+ QObject* originatingObject = 0;
+ if (m_resourceHandle->getInternal()->m_context)
+ originatingObject = m_resourceHandle->getInternal()->m_context->originatingObject();
+
+ m_request = r.toNetworkRequest(originatingObject);
if (m_loadMode == LoadNormal)
start();
@@ -258,7 +263,7 @@ void QNetworkReplyHandler::finish()
resetState();
start();
} else if (!m_reply->error() || ignoreHttpError(m_reply, m_responseDataSent)) {
- client->didFinishLoading(m_resourceHandle);
+ client->didFinishLoading(m_resourceHandle, 0);
} else {
QUrl url = m_reply->url();
int httpStatusCode = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
@@ -300,12 +305,7 @@ void QNetworkReplyHandler::sendResponseIfNeeded()
if (mimeType.isEmpty()) {
// let's try to guess from the extension
- QString extension = m_reply->url().path();
- int index = extension.lastIndexOf(QLatin1Char('.'));
- if (index > 0) {
- extension = extension.mid(index + 1);
- mimeType = MIMETypeRegistry::getMIMETypeForExtension(extension);
- }
+ mimeType = MIMETypeRegistry::getMIMETypeForPath(m_reply->url().path());
}
KURL url(m_reply->url());
@@ -374,7 +374,11 @@ void QNetworkReplyHandler::sendResponseIfNeeded()
if (!m_resourceHandle) // network error did cancel the request
return;
- m_request = newRequest.toNetworkRequest(m_resourceHandle->getInternal()->m_frame);
+ QObject* originatingObject = 0;
+ if (m_resourceHandle->getInternal()->m_context)
+ originatingObject = m_resourceHandle->getInternal()->m_context->originatingObject();
+
+ m_request = newRequest.toNetworkRequest(originatingObject);
return;
}
@@ -426,7 +430,12 @@ void QNetworkReplyHandler::start()
ResourceHandleInternal* d = m_resourceHandle->getInternal();
- QNetworkAccessManager* manager = d->m_frame->page()->networkAccessManager();
+ QNetworkAccessManager* manager = 0;
+ if (d->m_context)
+ manager = d->m_context->networkAccessManager();
+
+ if (!manager)
+ return;
const QUrl url = m_request.url();
const QString scheme = url.scheme();
diff --git a/WebCore/platform/network/qt/ResourceHandleQt.cpp b/WebCore/platform/network/qt/ResourceHandleQt.cpp
index 3548467..a5ac4c3 100644
--- a/WebCore/platform/network/qt/ResourceHandleQt.cpp
+++ b/WebCore/platform/network/qt/ResourceHandleQt.cpp
@@ -33,6 +33,7 @@
#include "ChromeClientQt.h"
#include "CachedResourceLoader.h"
#include "Frame.h"
+#include "FrameNetworkingContext.h"
#include "FrameLoaderClientQt.h"
#include "NotImplemented.h"
#include "Page.h"
@@ -61,7 +62,7 @@ public:
virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
virtual void didReceiveData(ResourceHandle*, const char*, int, int lengthReceived);
- virtual void didFinishLoading(ResourceHandle*);
+ virtual void didFinishLoading(ResourceHandle*, double /*finishTime*/);
virtual void didFail(ResourceHandle*, const ResourceError&);
ResourceResponse resourceResponse() const { return m_response; }
@@ -89,7 +90,7 @@ void WebCoreSynchronousLoader::didReceiveData(ResourceHandle*, const char* data,
m_data.append(data, length);
}
-void WebCoreSynchronousLoader::didFinishLoading(ResourceHandle*)
+void WebCoreSynchronousLoader::didFinishLoading(ResourceHandle*, double)
{
m_eventLoop.exit();
}
@@ -115,15 +116,11 @@ ResourceHandle::~ResourceHandle()
cancel();
}
-bool ResourceHandle::start(Frame* frame)
+bool ResourceHandle::start(NetworkingContext* context)
{
- if (!frame)
- return false;
-
- Page *page = frame->page();
- // 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 (!page)
+ // If NetworkingContext is invalid then we are no longer attached to a Page,
+ // this must be an attempted load from an unload event handler, so let's just block it.
+ if (context && !context->isValid())
return false;
if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) {
@@ -135,7 +132,7 @@ bool ResourceHandle::start(Frame* frame)
d->m_firstRequest.setURL(urlWithCredentials);
}
- getInternal()->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();
+ getInternal()->m_context = context;
ResourceHandleInternal *d = getInternal();
d->m_job = new QNetworkReplyHandler(this, QNetworkReplyHandler::LoadMode(d->m_defersLoading));
return true;
@@ -159,8 +156,12 @@ bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame* frame)
if (!frame)
return false;
- QNetworkAccessManager* manager = QWebFramePrivate::kit(frame)->page()->networkAccessManager();
- QAbstractNetworkCache* cache = manager->cache();
+ QNetworkAccessManager* manager = 0;
+ QAbstractNetworkCache* cache = 0;
+ if (frame->loader()->networkingContext()) {
+ manager = frame->loader()->networkingContext()->networkAccessManager();
+ cache = manager->cache();
+ }
if (!cache)
return false;
@@ -185,7 +186,7 @@ PassRefPtr<SharedBuffer> ResourceHandle::bufferedData()
return 0;
}
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame)
+void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data)
{
WebCoreSynchronousLoader syncLoader;
RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, &syncLoader, true, false));
@@ -199,7 +200,7 @@ void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, S
urlWithCredentials.setPass(d->m_pass);
d->m_firstRequest.setURL(urlWithCredentials);
}
- d->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();
+ d->m_context = context;
d->m_job = new QNetworkReplyHandler(handle.get(), QNetworkReplyHandler::LoadNormal);
syncLoader.waitForCompletion();
@@ -208,7 +209,6 @@ void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, S
response = syncLoader.resourceResponse();
}
-
void ResourceHandle::platformSetDefersLoading(bool defers)
{
if (d->m_job)
diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index dadbd22..0009e36 100644
--- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -65,7 +65,7 @@ public:
virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
virtual void didReceiveData(ResourceHandle*, const char*, int, int lengthReceived);
- virtual void didFinishLoading(ResourceHandle*);
+ virtual void didFinishLoading(ResourceHandle*, double /*finishTime*/);
virtual void didFail(ResourceHandle*, const ResourceError&);
void run();
@@ -102,7 +102,7 @@ void WebCoreSynchronousLoader::didReceiveData(ResourceHandle*, const char* data,
m_data.append(data, length);
}
-void WebCoreSynchronousLoader::didFinishLoading(ResourceHandle*)
+void WebCoreSynchronousLoader::didFinishLoading(ResourceHandle*, double)
{
g_main_loop_quit(m_mainLoop);
m_finished = true;
@@ -111,7 +111,7 @@ void WebCoreSynchronousLoader::didFinishLoading(ResourceHandle*)
void WebCoreSynchronousLoader::didFail(ResourceHandle* handle, const ResourceError& error)
{
m_error = error;
- didFinishLoading(handle);
+ didFinishLoading(handle, 0);
}
void WebCoreSynchronousLoader::run()
@@ -336,7 +336,7 @@ static void finishedCallback(SoupSession *session, SoupMessage* msg, gpointer da
client->didReceiveData(handle.get(), msg->response_body->data, msg->response_body->length, true);
}
- client->didFinishLoading(handle.get());
+ client->didFinishLoading(handle.get(), 0);
}
// parseDataUrl() is taken from the CURL http backend.
@@ -415,7 +415,7 @@ static gboolean parseDataUrl(gpointer callbackData)
if (d->m_cancelled || !handle->client())
return false;
- client->didFinishLoading(handle);
+ client->didFinishLoading(handle, 0);
return false;
}
@@ -578,16 +578,16 @@ static bool startHttp(ResourceHandle* handle)
return true;
}
-bool ResourceHandle::start(Frame* frame)
+bool ResourceHandle::start(NetworkingContext* context)
{
ASSERT(!d->m_msg);
-
// The frame could be null if the ResourceHandle is not associated to any
// Frame, e.g. if we are downloading a file.
// If the frame is not null but the page is null this must be an attempted
- // load from an onUnload handler, so let's just block it.
- if (frame && !frame->page())
+ // load from an unload handler, so let's just block it.
+ // If both the frame and the page are not null the context is valid.
+ if (context && !context->isValid())
return false;
KURL url = firstRequest().url();
@@ -595,7 +595,7 @@ bool ResourceHandle::start(Frame* frame)
String protocol = url.protocol();
// Used to set the authentication dialog toplevel; may be NULL
- d->m_frame = frame;
+ d->m_context = context;
if (equalIgnoringCase(protocol, "data"))
return startData(this, urlString);
@@ -655,14 +655,14 @@ bool ResourceHandle::willLoadFromCache(ResourceRequest&, Frame*)
return false;
}
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame)
+void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data)
{
WebCoreSynchronousLoader syncLoader(error, response, data);
// FIXME: we should use the ResourceHandle::create method here,
// but it makes us timeout in a couple of tests. See
// https://bugs.webkit.org/show_bug.cgi?id=41823
RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, &syncLoader, true, false));
- handle->start(frame);
+ handle->start(context);
syncLoader.run();
}
@@ -717,7 +717,7 @@ static void closeCallback(GObject* source, GAsyncResult* res, gpointer)
if (d->m_cancelled || !client)
return;
- client->didFinishLoading(handle.get());
+ client->didFinishLoading(handle.get(), 0);
}
static void readCallback(GObject* source, GAsyncResult* res, gpointer)
diff --git a/WebCore/platform/network/win/ResourceHandleWin.cpp b/WebCore/platform/network/win/ResourceHandleWin.cpp
index 2af03c0..832a8e2 100644
--- a/WebCore/platform/network/win/ResourceHandleWin.cpp
+++ b/WebCore/platform/network/win/ResourceHandleWin.cpp
@@ -38,6 +38,7 @@
#include "ResourceHandleWin.h"
#include "Timer.h"
#include "WebCoreInstanceHandle.h"
+
#include <wtf/text/CString.h>
#include <windows.h>
#include <wininet.h>
@@ -144,7 +145,7 @@ public:
virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
virtual void didReceiveData(ResourceHandle*, const char*, int, int lengthReceived);
- virtual void didFinishLoading(ResourceHandle*);
+ virtual void didFinishLoading(ResourceHandle*, double /*finishTime*/);
virtual void didFail(ResourceHandle*, const ResourceError&);
private:
@@ -170,7 +171,7 @@ void WebCoreSynchronousLoader::didReceiveData(ResourceHandle*, const char* data,
m_data.append(data, length);
}
-void WebCoreSynchronousLoader::didFinishLoading(ResourceHandle*)
+void WebCoreSynchronousLoader::didFinishLoading(ResourceHandle*, double)
{
}
@@ -349,7 +350,7 @@ void ResourceHandle::onRequestComplete(LPARAM lParam)
InternetCloseHandle(d->m_secondaryHandle);
InternetCloseHandle(d->m_resourceHandle);
- client()->didFinishLoading(this);
+ client()->didFinishLoading(this, 0);
delete this;
}
@@ -406,7 +407,7 @@ static void __stdcall transferJobStatusCallback(HINTERNET internetHandle,
PostMessage(transferJobWindowHandle, msg, (WPARAM) jobId, lParam);
}
-bool ResourceHandle::start(Frame* frame)
+bool ResourceHandle::start(NetworkingContext* context)
{
ref();
if (request().url().isLocalFile()) {
@@ -415,7 +416,7 @@ bool ResourceHandle::start(Frame* frame)
} else {
static HINTERNET internetHandle = 0;
if (!internetHandle) {
- String userAgentStr = frame->loader()->userAgent(request().url()) + String("", 1);
+ String userAgentStr = context->userAgent() + String("", 1);
LPCWSTR userAgent = reinterpret_cast<const WCHAR*>(userAgentStr.characters());
// leak the Internet for now
internetHandle = InternetOpen(userAgent, INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, INTERNET_FLAG_ASYNC);
@@ -438,7 +439,7 @@ bool ResourceHandle::start(Frame* frame)
// For form posting, we can't use InternetOpenURL. We have to use
// InternetConnect followed by HttpSendRequest.
HINTERNET urlHandle;
- String referrer = frame->loader()->referrer();
+ String referrer = context->referrer();
if (request().httpMethod() == "POST") {
d->m_postReferrer = referrer;
String host = request().url().host();
@@ -511,7 +512,7 @@ void ResourceHandle::fileLoadTimer(Timer<ResourceHandle>*)
CloseHandle(fileHandle);
- client()->didFinishLoading(this);
+ client()->didFinishLoading(this, 0);
}
void ResourceHandle::cancel()
@@ -521,7 +522,7 @@ void ResourceHandle::cancel()
else
d->m_fileLoadTimer.stop();
- client()->didFinishLoading(this);
+ client()->didFinishLoading(this, 0);
if (!d->m_resourceHandle)
// Async load canceled before we have a handle -- mark ourselves as in error, to be deleted later.
diff --git a/WebCore/platform/qt/CookieJarQt.cpp b/WebCore/platform/qt/CookieJarQt.cpp
index 15053eb..4e1de23 100644
--- a/WebCore/platform/qt/CookieJarQt.cpp
+++ b/WebCore/platform/qt/CookieJarQt.cpp
@@ -31,6 +31,7 @@
#include "Cookie.h"
#include "Document.h"
#include "KURL.h"
+#include "NetworkingContext.h"
#include "PlatformString.h"
#include "qwebpage.h"
@@ -51,9 +52,7 @@ static QNetworkCookieJar *cookieJar(const Document *document)
FrameLoader *loader = frame->loader();
if (!loader)
return 0;
- QWebFrame* webFrame = static_cast<FrameLoaderClientQt*>(loader->client())->webFrame();
- QWebPage* page = webFrame->page();
- QNetworkAccessManager* manager = page->networkAccessManager();
+ QNetworkAccessManager* manager = loader->networkingContext()->networkAccessManager();
QNetworkCookieJar* jar = manager->cookieJar();
return jar;
}
diff --git a/WebCore/platform/qt/Language.cpp b/WebCore/platform/qt/Language.cpp
new file mode 100644
index 0000000..0d2900b
--- /dev/null
+++ b/WebCore/platform/qt/Language.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Language.h"
+
+#include "PlatformString.h"
+#include <QLocale>
+
+namespace WebCore {
+
+String defaultLanguage()
+{
+ QLocale locale;
+ return locale.name().replace("_", "-");
+}
+
+}
diff --git a/WebCore/platform/qt/MIMETypeRegistryQt.cpp b/WebCore/platform/qt/MIMETypeRegistryQt.cpp
index 4161f81..12db891 100644
--- a/WebCore/platform/qt/MIMETypeRegistryQt.cpp
+++ b/WebCore/platform/qt/MIMETypeRegistryQt.cpp
@@ -79,7 +79,7 @@ String MIMETypeRegistry::getMIMETypeForExtension(const String &ext)
++e;
}
- return "application/octet-stream";
+ return String();
}
bool MIMETypeRegistry::isApplicationPluginMIMEType(const String& mimeType)
diff --git a/WebCore/platform/qt/PlatformBridge.h b/WebCore/platform/qt/PlatformBridge.h
new file mode 100644
index 0000000..918e139
--- /dev/null
+++ b/WebCore/platform/qt/PlatformBridge.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2009, 2010, The Android Open Source Project
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PlatformBridge_h
+#define PlatformBridge_h
+
+#include "KURL.h"
+#include "npapi.h"
+#include "PlatformString.h"
+
+#include <wtf/Vector.h>
+
+// V8 bindings use the ARRAYSIZE_UNSAFE macro. This macro was copied
+// from http://src.chromium.org/viewvc/chrome/trunk/src/base/basictypes.h
+//
+// ARRAYSIZE_UNSAFE performs essentially the same calculation as arraysize,
+// but can be used on anonymous types or types defined inside
+// functions. It's less safe than arraysize as it accepts some
+// (although not all) pointers. Therefore, you should use arraysize
+// whenever possible.
+//
+// The expression ARRAYSIZE_UNSAFE(a) is a compile-time constant of type
+// size_t.
+//
+// ARRAYSIZE_UNSAFE catches a few type errors. If you see a compiler error
+//
+// "warning: division by zero in ..."
+//
+// when using ARRAYSIZE_UNSAFE, you are (wrongfully) giving it a pointer.
+// You should only use ARRAYSIZE_UNSAFE on statically allocated arrays.
+//
+// The following comments are on the implementation details, and can
+// be ignored by the users.
+//
+// ARRAYSIZE_UNSAFE(arr) works by inspecting sizeof(arr) (the # of bytes in
+// the array) and sizeof(*(arr)) (the # of bytes in one array
+// element). If the former is divisible by the latter, perhaps arr is
+// indeed an array, in which case the division result is the # of
+// elements in the array. Otherwise, arr cannot possibly be an array,
+// and we generate a compiler error to prevent the code from
+// compiling.
+//
+// Since the size of bool is implementation-defined, we need to cast
+// !(sizeof(a) & sizeof(*(a))) to size_t in order to ensure the final
+// result has type size_t.
+//
+// This macro is not perfect as it wrongfully accepts certain
+// pointers, namely where the pointer size is divisible by the pointee
+// size. Since all our code has to go through a 32-bit compiler,
+// where a pointer is 4 bytes, this means all pointers to a type whose
+// size is 3 or greater than 4 will be (righteously) rejected.
+
+#define ARRAYSIZE_UNSAFE(a) \
+ ((sizeof(a) / sizeof(*(a))) / \
+ static_cast<size_t>(!(sizeof(a) % sizeof(*(a)))))
+
+
+class NPObject;
+
+namespace WebCore {
+
+class Widget;
+
+// An interface to the embedding layer, which has the ability to answer
+// questions about the system and so on...
+// This is very similar to ChromiumBridge and the two are likely to converge
+// in the future.
+class PlatformBridge {
+public:
+ static bool popupsAllowed(NPP npp);
+ // Plugin
+ static NPObject* pluginScriptableObject(Widget*);
+};
+
+}
+#endif // PlatformBridge_h
diff --git a/WebCore/platform/text/brew/TextBreakIteratorInternalICUBrew.cpp b/WebCore/platform/qt/PlatformBridgeQt.cpp
index 4384411..62065d7 100644
--- a/WebCore/platform/text/brew/TextBreakIteratorInternalICUBrew.cpp
+++ b/WebCore/platform/qt/PlatformBridgeQt.cpp
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2010 Company 100, Inc.
+ * This file is part of the WebKit project.
+ *
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -13,29 +15,37 @@
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*
*/
-
#include "config.h"
-#include "TextBreakIteratorInternalICU.h"
+#include "PlatformBridge.h"
-#include "NotImplemented.h"
+#include "Frame.h"
+#include "PluginView.h"
+#include "Widget.h"
namespace WebCore {
-const char* currentSearchLocaleID()
+bool PlatformBridge::popupsAllowed(NPP npp)
{
- notImplemented();
- return "";
+ if (npp && npp->ndata)
+ return static_cast<PluginView*>(npp->ndata)->arePopupsAllowed();
+
+ return false;
}
-const char* currentTextBreakLocaleID()
+NPObject* PlatformBridge::pluginScriptableObject(Widget* widget)
{
- notImplemented();
- return "en_us";
-}
+ if (!widget)
+ return 0;
-} // namespace WebCore
+ if (!widget->isPluginView())
+ return 0;
+ PluginView* pluginView = static_cast<PluginView*>(widget);
+ return pluginView->npObject();
+}
+
+}
diff --git a/WebCore/platform/qt/PlatformKeyboardEventQt.cpp b/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
index 6dde9c4..33e9552 100644
--- a/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
+++ b/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
@@ -188,6 +188,13 @@ int windowsKeyCodeForKeyEvent(unsigned int keycode, bool isKeypad)
return VK_RIGHT; // (27) RIGHT ARROW key
case Qt::Key_Down:
return VK_DOWN; // (28) DOWN ARROW key
+ case Qt::Key_Enter:
+ case Qt::Key_Return:
+ return VK_RETURN; // (0D) Return key
+ case Qt::Key_Insert:
+ return VK_INSERT; // (2D) INS key
+ case Qt::Key_Delete:
+ return VK_DELETE; // (2E) DEL key
default:
return 0;
}
@@ -304,12 +311,9 @@ int windowsKeyCodeForKeyEvent(unsigned int keycode, bool isKeypad)
case Qt::Key_Select:
return VK_SELECT; // (29) SELECT key
case Qt::Key_Print:
- return VK_PRINT; // (2A) PRINT key
+ return VK_SNAPSHOT; // (2A) PRINT key
case Qt::Key_Execute:
return VK_EXECUTE; // (2B) EXECUTE key
- // dunno on this
- // case Qt::Key_PrintScreen:
- // return VK_SNAPSHOT; // (2C) PRINT SCREEN key
case Qt::Key_Insert:
return VK_INSERT; // (2D) INS key
case Qt::Key_Delete:
diff --git a/WebCore/platform/qt/RenderThemeQt.cpp b/WebCore/platform/qt/RenderThemeQt.cpp
index 870f0eb..4a461ac 100644
--- a/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/WebCore/platform/qt/RenderThemeQt.cpp
@@ -380,6 +380,7 @@ void RenderThemeQt::computeSizeBasedOnStyle(RenderStyle* renderStyle) const
QStyleOption styleOption;
styleOption.state |= QStyle::State_Small;
int checkBoxWidth = style->pixelMetric(QStyle::PM_IndicatorWidth, &styleOption);
+ checkBoxWidth *= renderStyle->effectiveZoom();
size = QSize(checkBoxWidth, checkBoxWidth);
break;
}
@@ -387,6 +388,7 @@ void RenderThemeQt::computeSizeBasedOnStyle(RenderStyle* renderStyle) const
QStyleOption styleOption;
styleOption.state |= QStyle::State_Small;
int radioWidth = style->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth, &styleOption);
+ radioWidth *= renderStyle->effectiveZoom();
size = QSize(radioWidth, radioWidth);
break;
}
diff --git a/WebCore/platform/text/wince/TextBoundariesWince.cpp b/WebCore/platform/text/wince/TextBoundariesWinCE.cpp
index df6f757..f3070a4 100644
--- a/WebCore/platform/text/wince/TextBoundariesWince.cpp
+++ b/WebCore/platform/text/wince/TextBoundariesWinCE.cpp
@@ -71,5 +71,4 @@ void findWordBoundary(const UChar * buffer, int len, int position, int* start, i
*end = currentPosition;
}
-
-}
+} // namespace WebCore
diff --git a/WebCore/platform/text/wince/TextBreakIteratorWince.cpp b/WebCore/platform/text/wince/TextBreakIteratorWinCE.cpp
index 7f46e4f..7f46e4f 100644
--- a/WebCore/platform/text/wince/TextBreakIteratorWince.cpp
+++ b/WebCore/platform/text/wince/TextBreakIteratorWinCE.cpp
diff --git a/WebCore/platform/text/wince/TextCodecWinCE.cpp b/WebCore/platform/text/wince/TextCodecWinCE.cpp
index 2789148..499035f 100644
--- a/WebCore/platform/text/wince/TextCodecWinCE.cpp
+++ b/WebCore/platform/text/wince/TextCodecWinCE.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2007-2009 Torch Mobile, Inc. All rights reserved.
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -132,11 +133,11 @@ static UINT getCodePage(const char* name)
static PassOwnPtr<TextCodec> newTextCodecWinCE(const TextEncoding& encoding, const void*)
{
- return new TextCodecWinCE(encoding);
+ return new TextCodecWinCE(getCodePage(encoding.name()));
}
-TextCodecWinCE::TextCodecWinCE(const TextEncoding& encoding)
- : m_encoding(encoding)
+TextCodecWinCE::TextCodecWinCE(UINT codePage)
+ : m_codePage(codePage)
{
}
@@ -211,22 +212,12 @@ static inline const char* findFirstNonAsciiCharacter(const char* bytes, size_t l
return bytes;
}
-static void decode(Vector<UChar, 8192>& result, const char* encodingName, const char* bytes, size_t length, size_t* left, bool canBeFirstTime, bool& sawInvalidChar)
+static void decode(Vector<UChar, 8192>& result, UINT codePage, const char* bytes, size_t length, size_t* left, bool canBeFirstTime, bool& sawInvalidChar)
{
*left = length;
if (!bytes || !length)
return;
- UINT codePage;
-
- HashMap<String, CharsetInfo>::iterator i = knownCharsets().find(encodingName);
- if (i == knownCharsets().end()) {
- if (!strcmp(encodingName, "UTF-8"))
- codePage = CP_UTF8;
- else
- codePage = CP_ACP;
- }
-
DWORD flags = getCodePageFlags(codePage);
if (codePage == CP_UTF8) {
@@ -331,7 +322,7 @@ String TextCodecWinCE::decode(const char* bytes, size_t length, bool flush, bool
Vector<UChar, 8192> result;
for (;;) {
bool sawInvalidChar = false;
- WebCore::decode(result, m_encoding.name(), bytes, length, &left, m_decodeBuffer.isEmpty(), sawInvalidChar);
+ WebCore::decode(result, m_codePage, bytes, length, &left, m_decodeBuffer.isEmpty(), sawInvalidChar);
if (!left)
break;
@@ -367,21 +358,21 @@ CString TextCodecWinCE::encode(const UChar* characters, size_t length, Unencodab
if (!characters || !length)
return CString();
- UINT codePage = getCodePage(m_encoding.name());
- DWORD flags = codePage == CP_UTF8 ? 0 : WC_COMPOSITECHECK;
+ DWORD flags = m_codePage == CP_UTF8 ? 0 : WC_COMPOSITECHECK;
- int resultLength = WideCharToMultiByte(codePage, flags, characters, length, 0, 0, 0, 0);
+ int resultLength = WideCharToMultiByte(m_codePage, flags, characters, length, 0, 0, 0, 0);
// FIXME: We need to implement UnencodableHandling: QuestionMarksForUnencodables, EntitiesForUnencodables, and URLEncodedEntitiesForUnencodables.
if (resultLength <= 0)
return "?";
- Vector<char> result(resultLength);
+ char* characterBuffer;
+ CString result = CString::newUninitialized(resultLength, characterBuffer);
- WideCharToMultiByte(codePage, flags, characters, length, result.data(), resultLength, 0, 0);
+ WideCharToMultiByte(m_codePage, flags, characters, length, characterBuffer, resultLength, 0, 0);
- return CString(result.data(), result.size());
+ return result;
}
void TextCodecWinCE::enumerateSupportedEncodings(EncodingReceiver& receiver)
diff --git a/WebCore/platform/text/wince/TextCodecWinCE.h b/WebCore/platform/text/wince/TextCodecWinCE.h
index a870d3e..8d332a6 100644
--- a/WebCore/platform/text/wince/TextCodecWinCE.h
+++ b/WebCore/platform/text/wince/TextCodecWinCE.h
@@ -2,6 +2,7 @@
* Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com>
* Copyright (C) 2007-2009 Torch Mobile, Inc.
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,6 +33,7 @@
#include "TextCodec.h"
#include "TextEncoding.h"
#include <wtf/Vector.h>
+#include <windows.h>
namespace WebCore {
@@ -43,7 +45,7 @@ public:
static void registerExtendedEncodingNames(EncodingNameRegistrar);
static void registerExtendedCodecs(TextCodecRegistrar);
- TextCodecWinCE(const TextEncoding&);
+ TextCodecWinCE(UINT codePage);
virtual ~TextCodecWinCE();
virtual String decode(const char*, size_t length, bool flush, bool stopOnError, bool& sawError);
@@ -62,7 +64,7 @@ public:
static void enumerateSupportedEncodings(EncodingReceiver& receiver);
private:
- TextEncoding m_encoding;
+ UINT m_codePage;
Vector<char> m_decodeBuffer;
};
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp
index 6d9930c..b13473a 100644
--- a/WebCore/platform/win/ClipboardWin.cpp
+++ b/WebCore/platform/win/ClipboardWin.cpp
@@ -604,13 +604,12 @@ PassRefPtr<FileList> ClipboardWin::files() const
if (!hdrop)
return files.release();
- ScriptExecutionContext* scriptExecutionContext = m_frame->document()->scriptExecutionContext();
WCHAR filename[MAX_PATH];
UINT fileCount = DragQueryFileW(hdrop, 0xFFFFFFFF, 0, 0);
for (UINT i = 0; i < fileCount; i++) {
if (!DragQueryFileW(hdrop, i, filename, ARRAYSIZE(filename)))
continue;
- files->append(File::create(scriptExecutionContext, reinterpret_cast<UChar*>(filename)));
+ files->append(File::create(reinterpret_cast<UChar*>(filename)));
}
GlobalUnlock(medium.hGlobal);
diff --git a/WebCore/platform/wince/CursorWince.cpp b/WebCore/platform/wince/CursorWinCE.cpp
index d7dcfb4..90ba879 100644
--- a/WebCore/platform/wince/CursorWince.cpp
+++ b/WebCore/platform/wince/CursorWinCE.cpp
@@ -106,4 +106,4 @@ const Cursor& westPanningCursor() { return crossCursor(); }
const Cursor& grabbingCursor() { return moveCursor(); }
const Cursor& grabCursor() { return moveCursor(); }
-}
+} // namespace WebCore
diff --git a/WebCore/platform/wince/DragDataWince.cpp b/WebCore/platform/wince/DragDataWinCE.cpp
index 73dd8a2..5535ea9 100644
--- a/WebCore/platform/wince/DragDataWince.cpp
+++ b/WebCore/platform/wince/DragDataWinCE.cpp
@@ -80,5 +80,4 @@ Color DragData::asColor() const
return Color();
}
-}
-
+} // namespace WebCore
diff --git a/WebCore/platform/wince/DragImageWince.cpp b/WebCore/platform/wince/DragImageWinCE.cpp
index 4d60f80..f639b41 100644
--- a/WebCore/platform/wince/DragImageWince.cpp
+++ b/WebCore/platform/wince/DragImageWinCE.cpp
@@ -60,4 +60,4 @@ DragImageRef createDragImageIconForCachedImage(CachedImage*)
return 0;
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/wince/EditorWince.cpp b/WebCore/platform/wince/EditorWinCE.cpp
index 71f4db9..eb0ecb4 100644
--- a/WebCore/platform/wince/EditorWince.cpp
+++ b/WebCore/platform/wince/EditorWinCE.cpp
@@ -22,7 +22,7 @@
#include "Editor.h"
-#include "ClipboardWince.h"
+#include "ClipboardWinCE.h"
#include "Document.h"
#include "EditorClient.h"
#include "Element.h"
@@ -37,7 +37,7 @@ namespace WebCore {
PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
{
- return adoptRef(new ClipboardWince(policy, false));
+ return adoptRef(new ClipboardWinCE(policy, false));
}
} // namespace WebCore
diff --git a/WebCore/platform/wince/FileChooserWince.cpp b/WebCore/platform/wince/FileChooserWinCE.cpp
index 07c99b1..955e68a 100644
--- a/WebCore/platform/wince/FileChooserWince.cpp
+++ b/WebCore/platform/wince/FileChooserWinCE.cpp
@@ -57,4 +57,4 @@ String FileChooser::basenameForWidth(const Font& font, int width) const
return StringTruncator::centerTruncate(string, width, font, false);
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/wince/FileSystemWince.cpp b/WebCore/platform/wince/FileSystemWinCE.cpp
index cb165a6..2a27089 100644
--- a/WebCore/platform/wince/FileSystemWince.cpp
+++ b/WebCore/platform/wince/FileSystemWinCE.cpp
@@ -281,4 +281,4 @@ Vector<String> listDirectory(const String& path, const String& filter)
return entries;
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/wince/KURLWince.cpp b/WebCore/platform/wince/KURLWinCE.cpp
index 5ca1e4b..2bbdfe8 100644
--- a/WebCore/platform/wince/KURLWince.cpp
+++ b/WebCore/platform/wince/KURLWinCE.cpp
@@ -27,4 +27,4 @@ String KURL::fileSystemPath() const
return path();
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/wince/KeygenWince.cpp b/WebCore/platform/wince/KeygenWinCE.cpp
index 0c1b3c6..0c1b3c6 100644
--- a/WebCore/platform/wince/KeygenWince.cpp
+++ b/WebCore/platform/wince/KeygenWinCE.cpp
diff --git a/WebCore/platform/wince/MIMETypeRegistryWince.cpp b/WebCore/platform/wince/MIMETypeRegistryWinCE.cpp
index 9e1bece..7534b91 100644
--- a/WebCore/platform/wince/MIMETypeRegistryWince.cpp
+++ b/WebCore/platform/wince/MIMETypeRegistryWinCE.cpp
@@ -138,4 +138,4 @@ bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&)
return false;
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/wince/PasteboardWince.cpp b/WebCore/platform/wince/PasteboardWinCE.cpp
index 70b4083..70b4083 100644
--- a/WebCore/platform/wince/PasteboardWince.cpp
+++ b/WebCore/platform/wince/PasteboardWinCE.cpp
diff --git a/WebCore/platform/wince/SearchPopupMenuWince.cpp b/WebCore/platform/wince/SearchPopupMenuWinCE.cpp
index f9d65a6..b2a8442 100644
--- a/WebCore/platform/wince/SearchPopupMenuWince.cpp
+++ b/WebCore/platform/wince/SearchPopupMenuWinCE.cpp
@@ -51,4 +51,4 @@ void SearchPopupMenu::loadRecentSearches(const AtomicString& name, Vector<String
notImplemented();
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/wince/SharedTimerWince.cpp b/WebCore/platform/wince/SharedTimerWinCE.cpp
index 2328017..81295e2 100644
--- a/WebCore/platform/wince/SharedTimerWince.cpp
+++ b/WebCore/platform/wince/SharedTimerWinCE.cpp
@@ -128,4 +128,4 @@ void stopSharedTimer()
timerID = TimerIdNone;
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/wx/PasteboardWx.cpp b/WebCore/platform/wx/PasteboardWx.cpp
index 207c63c..4677d14 100644
--- a/WebCore/platform/wx/PasteboardWx.cpp
+++ b/WebCore/platform/wx/PasteboardWx.cpp
@@ -53,7 +53,7 @@ Pasteboard* Pasteboard::generalPasteboard()
void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame)
{
if (wxTheClipboard->Open()) {
- wxTheClipboard->SetData( new wxTextDataObject(frame->selectedText()) );
+ wxTheClipboard->SetData( new wxTextDataObject(frame->editor()->selectedText()) );
wxTheClipboard->Close();
}
}
diff --git a/WebCore/plugins/PluginDatabase.cpp b/WebCore/plugins/PluginDatabase.cpp
index 2426f78..368c83e 100644
--- a/WebCore/plugins/PluginDatabase.cpp
+++ b/WebCore/plugins/PluginDatabase.cpp
@@ -34,6 +34,7 @@
#include "FileSystem.h"
#endif
#include <stdlib.h>
+#include <wtf/text/CString.h>
#if PLATFORM(ANDROID)
#include "JavaSharedClient.h"
diff --git a/WebCore/plugins/PluginView.cpp b/WebCore/plugins/PluginView.cpp
index c657523..0413b21 100644
--- a/WebCore/plugins/PluginView.cpp
+++ b/WebCore/plugins/PluginView.cpp
@@ -28,7 +28,9 @@
#include "config.h"
#include "PluginView.h"
+#if USE(JSC)
#include "Bridge.h"
+#endif
#include "Chrome.h"
#include "Document.h"
#include "DocumentLoader.h"
@@ -562,8 +564,8 @@ NPError PluginView::load(const FrameLoadRequest& frameLoadRequest, bool sendNoti
// For security reasons, only allow JS requests to be made on the frame that contains the plug-in.
if (!targetFrameName.isNull() && m_parentFrame->tree()->find(targetFrameName) != m_parentFrame)
return NPERR_INVALID_PARAM;
- } else if (!SecurityOrigin::canDisplay(url, String(), m_parentFrame->document()))
- return NPERR_GENERIC_ERROR;
+ } else if (!m_parentFrame->document()->securityOrigin()->canDisplay(url))
+ return NPERR_GENERIC_ERROR;
PluginRequest* request = new PluginRequest(frameLoadRequest, sendNotification, notifyData, arePopupsAllowed());
scheduleRequest(request);
@@ -767,10 +769,9 @@ void PluginView::setJavaScriptPaused(bool paused)
m_requestTimer.startOneShot(0);
}
-#if USE(JSC)
-PassRefPtr<JSC::Bindings::Instance> PluginView::bindingInstance()
-{
#if ENABLE(NETSCAPE_PLUGIN_API)
+NPObject* PluginView::npObject()
+{
NPObject* object = 0;
if (!m_isStarted || !m_plugin || !m_plugin->pluginFuncs()->getvalue)
@@ -784,13 +785,30 @@ PassRefPtr<JSC::Bindings::Instance> PluginView::bindingInstance()
NPError npErr;
{
PluginView::setCurrentPluginView(this);
+#if USE(JSC)
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+#endif
setCallingPlugin(true);
npErr = m_plugin->pluginFuncs()->getvalue(m_instance, NPPVpluginScriptableNPObject, &object);
setCallingPlugin(false);
PluginView::setCurrentPluginView(0);
}
+ if (npErr != NPERR_NO_ERROR)
+ return 0;
+
+ return object;
+}
+#endif
+
+#if USE(JSC)
+PassRefPtr<JSC::Bindings::Instance> PluginView::bindingInstance()
+{
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ NPObject* object = npObject();
+ if (!object)
+ return 0;
+
if (hasOneRef()) {
// The renderer for the PluginView was destroyed during the above call, and
// the PluginView will be destroyed when this function returns, so we
@@ -798,9 +816,6 @@ PassRefPtr<JSC::Bindings::Instance> PluginView::bindingInstance()
return 0;
}
- if (npErr != NPERR_NO_ERROR || !object)
- return 0;
-
RefPtr<JSC::Bindings::RootObject> root = m_parentFrame->script()->createRootObject(this);
RefPtr<JSC::Bindings::Instance> instance = JSC::Bindings::CInstance::create(object, root.release());
@@ -1475,8 +1490,11 @@ void PluginView::privateBrowsingStateChanged(bool privateBrowsingEnabled)
return;
PluginView::setCurrentPluginView(this);
+<<<<<<< HEAD
// ANDROID
// Upstream to webkit.org
+=======
+>>>>>>> webkit.org at r67908
#if USE(JSC)
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
#endif
diff --git a/WebCore/plugins/PluginView.h b/WebCore/plugins/PluginView.h
index a17d327..8587c37 100644
--- a/WebCore/plugins/PluginView.h
+++ b/WebCore/plugins/PluginView.h
@@ -152,6 +152,9 @@ namespace WebCore {
void setNPWindowRect(const IntRect&);
static PluginView* currentPluginView();
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ NPObject* npObject();
+#endif
#if USE(JSC)
PassRefPtr<JSC::Bindings::Instance> bindingInstance();
#endif
diff --git a/WebCore/plugins/gtk/PluginViewGtk.cpp b/WebCore/plugins/gtk/PluginViewGtk.cpp
index 6d631e3..bee7821 100644
--- a/WebCore/plugins/gtk/PluginViewGtk.cpp
+++ b/WebCore/plugins/gtk/PluginViewGtk.cpp
@@ -143,7 +143,7 @@ void PluginView::updatePluginWidget()
m_drawable = XCreatePixmap(GDK_DISPLAY(), getRootWindow(m_parentFrame.get()),
m_windowRect.width(), m_windowRect.height(),
((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth);
- XSync(GDK_DISPLAY(), False); // make sure that the server knows about the Drawable
+ XSync(GDK_DISPLAY(), false); // make sure that the server knows about the Drawable
}
#endif
@@ -265,7 +265,7 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
dispatchNPEvent(xevent);
if (syncX)
- XSync(m_pluginDisplay, False); // sync changes by plugin
+ XSync(m_pluginDisplay, false); // sync changes by plugin
cairo_t* cr = context->platformContext();
cairo_save(cr);
diff --git a/WebCore/plugins/qt/PluginContainerQt.cpp b/WebCore/plugins/qt/PluginContainerQt.cpp
index cb894a7..8486180 100644
--- a/WebCore/plugins/qt/PluginContainerQt.cpp
+++ b/WebCore/plugins/qt/PluginContainerQt.cpp
@@ -56,7 +56,7 @@ PluginClientWrapper::~PluginClientWrapper()
bool PluginClientWrapper::x11Event(XEvent* event)
{
// modify the event window id and insert it into the Qt event system.
- event->xany.window = m_parent->parentWidget()->winId();
+ event->xany.window = m_parent->effectiveWinId();
static_cast<QApplication*>(QApplication::instance())->x11ProcessEvent(event);
return true;
}
diff --git a/WebCore/plugins/qt/PluginDataQt.cpp b/WebCore/plugins/qt/PluginDataQt.cpp
deleted file mode 100644
index 3dc86d0..0000000
--- a/WebCore/plugins/qt/PluginDataQt.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- Copyright (C) 2008 Collabora Ltd. All rights reserved.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-#include "PluginData.h"
-
-#include "PluginDatabase.h"
-#include "PluginPackage.h"
-
-#include "Chrome.h"
-#include "ChromeClientQt.h"
-#include "Page.h"
-#include <qwebpage.h>
-#include <qwebpluginfactory.h>
-
-namespace WebCore {
-
-void PluginData::initPlugins()
-{
- QWebPage* webPage = static_cast<ChromeClientQt*>(m_page->chrome()->client())->m_webPage;
- QWebPluginFactory* factory = webPage->pluginFactory();
- if (factory) {
-
- QList<QWebPluginFactory::Plugin> qplugins = factory->plugins();
- for (int i = 0; i < qplugins.count(); ++i) {
- const QWebPluginFactory::Plugin& qplugin = qplugins.at(i);
-
- PluginInfo info;
- info.name = qplugin.name;
- info.desc = qplugin.description;
-
- for (int j = 0; j < qplugin.mimeTypes.count(); ++j) {
- const QWebPluginFactory::MimeType& mimeType = qplugin.mimeTypes.at(j);
-
- MimeClassInfo mimeInfo;
- mimeInfo.type = mimeType.name;
- mimeInfo.desc = mimeType.description;
- for (int k = 0; k < mimeType.fileExtensions.count(); ++k)
- mimeInfo.extensions.append(mimeType.fileExtensions.at(k));
-
- info.mimes.append(mimeInfo);
- }
-
- m_plugins.append(info);
- }
- }
-
- PluginDatabase *db = PluginDatabase::installedPlugins();
- const Vector<PluginPackage*> &plugins = db->plugins();
-
- for (unsigned int i = 0; i < plugins.size(); ++i) {
- PluginInfo info;
- PluginPackage* package = plugins[i];
-
- info.name = package->name();
- info.file = package->fileName();
- info.desc = package->description();
-
- const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions();
- MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
- for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
- MimeClassInfo mime;
-
- mime.type = it->first;
- mime.desc = it->second;
- mime.extensions = package->mimeToExtensions().get(mime.type);
-
- info.mimes.append(mime);
- }
-
- m_plugins.append(info);
- }
-}
-
-void PluginData::refresh()
-{
- PluginDatabase *db = PluginDatabase::installedPlugins();
- db->refresh();
-}
-
-};
diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp
index e2df392..de7d12d 100644
--- a/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/WebCore/plugins/qt/PluginViewQt.cpp
@@ -28,7 +28,9 @@
#include "config.h"
#include "PluginView.h"
+#if USE(JSC)
#include "Bridge.h"
+#endif
#include "Document.h"
#include "DocumentLoader.h"
#include "Element.h"
@@ -44,7 +46,9 @@
#include "HTMLPlugInElement.h"
#include "HostWindow.h"
#include "Image.h"
+#if USE(JSC)
#include "JSDOMBinding.h"
+#endif
#include "KeyboardEvent.h"
#include "MouseEvent.h"
#include "NotImplemented.h"
@@ -322,7 +326,7 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
dispatchNPEvent(xevent);
if (syncX)
- XSync(m_pluginDisplay, False); // sync changes by plugin
+ XSync(m_pluginDisplay, false); // sync changes by plugin
painter->drawPixmap(QPoint(frameRect().x() + exposedRect.x(), frameRect().y() + exposedRect.y()), qtDrawable,
exposedRect);
@@ -335,7 +339,9 @@ bool PluginView::dispatchNPEvent(NPEvent& event)
return false;
PluginView::setCurrentPluginView(this);
+#if USE(JSC)
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+#endif
setCallingPlugin(true);
bool accepted = m_plugin->pluginFuncs()->event(m_instance, &event);
setCallingPlugin(false);
@@ -622,7 +628,9 @@ void PluginView::setNPWindowIfNeeded()
}
PluginView::setCurrentPluginView(this);
+#if USE(JSC)
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+#endif
setCallingPlugin(true);
m_plugin->pluginFuncs()->setwindow(m_instance, &m_npWindow);
setCallingPlugin(false);
@@ -838,7 +846,9 @@ bool PluginView::platformStart()
if (m_plugin->pluginFuncs()->getvalue) {
PluginView::setCurrentPluginView(this);
+#if USE(JSC)
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+#endif
setCallingPlugin(true);
m_plugin->pluginFuncs()->getvalue(m_instance, NPPVpluginNeedsXEmbed, &m_needsXEmbed);
setCallingPlugin(false);
diff --git a/WebCore/plugins/win/PluginViewWin.cpp b/WebCore/plugins/win/PluginViewWin.cpp
index 84d2984..758d90a 100644
--- a/WebCore/plugins/win/PluginViewWin.cpp
+++ b/WebCore/plugins/win/PluginViewWin.cpp
@@ -520,7 +520,9 @@ bool PluginView::dispatchNPEvent(NPEvent& npEvent)
void PluginView::paintIntoTransformedContext(HDC hdc)
{
if (m_isWindowed) {
+#if !OS(WINCE)
SendMessage(platformPluginWidget(), WM_PRINTCLIENT, reinterpret_cast<WPARAM>(hdc), PRF_CLIENT | PRF_CHILDREN | PRF_OWNED);
+#endif
return;
}
@@ -1010,7 +1012,7 @@ void PluginView::platformDestroy()
PassRefPtr<Image> PluginView::snapshot()
{
-#if !PLATFORM(WX)
+#if !PLATFORM(WX) && !OS(WINCE)
OwnPtr<HDC> hdc(CreateCompatibleDC(0));
if (!m_isWindowed) {
diff --git a/WebCore/rendering/ColumnInfo.h b/WebCore/rendering/ColumnInfo.h
index 883287b..5e6f619 100644
--- a/WebCore/rendering/ColumnInfo.h
+++ b/WebCore/rendering/ColumnInfo.h
@@ -36,6 +36,12 @@ public:
ColumnInfo()
: m_desiredColumnWidth(0)
, m_desiredColumnCount(1)
+ , m_columnCount(1)
+ , m_columnHeight(0)
+ , m_minimumColumnHeight(0)
+ , m_forcedBreaks(0)
+ , m_maximumDistanceBetweenForcedBreaks(0)
+ , m_forcedBreakOffset(0)
{ }
int desiredColumnWidth() const { return m_desiredColumnWidth; }
@@ -44,19 +50,51 @@ public:
unsigned desiredColumnCount() const { return m_desiredColumnCount; }
void setDesiredColumnCount(unsigned count) { m_desiredColumnCount = count; }
- // Encapsulated for the future where we can avoid storing the rects and just compute them dynamically.
- size_t columnCount() const { return m_columnRects.size(); }
- const IntRect& columnRectAt(size_t i) const { return m_columnRects[i]; }
+ unsigned columnCount() const { return m_columnCount; }
+ int columnHeight() const { return m_columnHeight; }
- void clearColumns() { m_columnRects.clear(); }
+ // Set our count and height. This is enough info for a RenderBlock to compute page rects
+ // dynamically.
+ void setColumnCountAndHeight(int count, int height)
+ {
+ m_columnCount = count;
+ m_columnHeight = height;
+ }
+ void setColumnHeight(int height) { m_columnHeight = height; }
+
+ void updateMinimumColumnHeight(int height) { m_minimumColumnHeight = std::max(height, m_minimumColumnHeight); }
+ int minimumColumnHeight() const { return m_minimumColumnHeight; }
+
+ int forcedBreaks() const { return m_forcedBreaks; }
+ int forcedBreakOffset() const { return m_forcedBreakOffset; }
+ int maximumDistanceBetweenForcedBreaks() const { return m_maximumDistanceBetweenForcedBreaks; }
+ void clearForcedBreaks()
+ {
+ m_forcedBreaks = 0;
+ m_maximumDistanceBetweenForcedBreaks = 0;
+ m_forcedBreakOffset = 0;
+ }
+ void addForcedBreak(int offsetFromFirstPage)
+ {
+ ASSERT(!m_columnHeight);
+ int distanceFromLastBreak = offsetFromFirstPage - m_forcedBreakOffset;
+ if (!distanceFromLastBreak)
+ return;
+ m_forcedBreaks++;
+ m_maximumDistanceBetweenForcedBreaks = std::max(m_maximumDistanceBetweenForcedBreaks, distanceFromLastBreak);
+ m_forcedBreakOffset = offsetFromFirstPage;
+ }
- // FIXME: Will go away once we don't use the Vector.
- void addColumnRect(const IntRect& rect) { m_columnRects.append(rect); }
-
private:
int m_desiredColumnWidth;
unsigned m_desiredColumnCount;
- Vector<IntRect> m_columnRects;
+
+ unsigned m_columnCount;
+ int m_columnHeight;
+ int m_minimumColumnHeight;
+ int m_forcedBreaks; // FIXME: We will ultimately need to cache more information to balance around forced breaks properly.
+ int m_maximumDistanceBetweenForcedBreaks;
+ int m_forcedBreakOffset;
};
}
diff --git a/WebCore/rendering/LayoutState.cpp b/WebCore/rendering/LayoutState.cpp
index 18c3da7..0d81b15 100644
--- a/WebCore/rendering/LayoutState.cpp
+++ b/WebCore/rendering/LayoutState.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "LayoutState.h"
+#include "ColumnInfo.h"
#include "RenderArena.h"
#include "RenderInline.h"
#include "RenderLayer.h"
@@ -33,8 +34,9 @@
namespace WebCore {
-LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const IntSize& offset)
- : m_next(prev)
+LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const IntSize& offset, int pageHeight, ColumnInfo* columnInfo)
+ : m_columnInfo(columnInfo)
+ , m_next(prev)
#ifndef NDEBUG
, m_renderer(renderer)
#endif
@@ -45,43 +47,67 @@ LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const IntSize&
if (fixed) {
// FIXME: This doesn't work correctly with transforms.
FloatPoint fixedOffset = renderer->view()->localToAbsolute(FloatPoint(), true);
- m_offset = IntSize(fixedOffset.x(), fixedOffset.y()) + offset;
+ m_paintOffset = IntSize(fixedOffset.x(), fixedOffset.y()) + offset;
} else
- m_offset = prev->m_offset + offset;
+ m_paintOffset = prev->m_paintOffset + offset;
- if (renderer->isRelPositioned()) {
- if (renderer->hasLayer())
- m_offset += renderer->layer()->relativePositionOffset();
- } else if (renderer->isPositioned() && !fixed) {
+ if (renderer->isPositioned() && !fixed) {
if (RenderObject* container = renderer->container()) {
if (container->isRelPositioned() && container->isRenderInline())
- m_offset += toRenderInline(container)->relativePositionedInlineOffset(renderer);
+ m_paintOffset += toRenderInline(container)->relativePositionedInlineOffset(renderer);
}
}
+ m_layoutOffset = m_paintOffset;
+
+ if (renderer->isRelPositioned() && renderer->hasLayer())
+ m_paintOffset += renderer->layer()->relativePositionOffset();
+
m_clipped = !fixed && prev->m_clipped;
if (m_clipped)
m_clipRect = prev->m_clipRect;
if (renderer->hasOverflowClip()) {
RenderLayer* layer = renderer->layer();
- IntRect clipRect(toPoint(m_offset) + renderer->view()->layoutDelta(), layer->size());
+ IntRect clipRect(toPoint(m_paintOffset) + renderer->view()->layoutDelta(), layer->size());
if (m_clipped)
m_clipRect.intersect(clipRect);
else {
m_clipRect = clipRect;
m_clipped = true;
}
- m_offset -= layer->scrolledContentOffset();
+
+ m_paintOffset -= layer->scrolledContentOffset();
}
- m_layoutDelta = m_next->m_layoutDelta;
+ // If we establish a new page height, then cache the offset to the top of the first page.
+ // We can compare this later on to figure out what part of the page we're actually on,
+ if (pageHeight || m_columnInfo) {
+ m_pageHeight = pageHeight;
+ m_pageOffset = IntSize(m_layoutOffset.width() + renderer->borderLeft() + renderer->paddingLeft(),
+ m_layoutOffset.height() + renderer->borderTop() + renderer->paddingTop());
+ } else {
+ // If we don't establish a new page height, then propagate the old page height and offset down.
+ m_pageHeight = m_next->m_pageHeight;
+ m_pageOffset = m_next->m_pageOffset;
+
+ // Disable pagination for objects we don't support. For now this includes overflow:scroll/auto and inline blocks.
+ if (renderer->isReplaced() || renderer->scrollsOverflow())
+ m_pageHeight = 0;
+ }
+
+ if (!m_columnInfo)
+ m_columnInfo = m_next->m_columnInfo;
+ m_layoutDelta = m_next->m_layoutDelta;
+
// FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present.
}
LayoutState::LayoutState(RenderObject* root)
: m_clipped(false)
+ , m_pageHeight(0)
+ , m_columnInfo(0)
, m_next(0)
#ifndef NDEBUG
, m_renderer(root)
@@ -89,13 +115,13 @@ LayoutState::LayoutState(RenderObject* root)
{
RenderObject* container = root->container();
FloatPoint absContentPoint = container->localToAbsolute(FloatPoint(), false, true);
- m_offset = IntSize(absContentPoint.x(), absContentPoint.y());
+ m_paintOffset = IntSize(absContentPoint.x(), absContentPoint.y());
if (container->hasOverflowClip()) {
RenderLayer* layer = toRenderBoxModelObject(container)->layer();
m_clipped = true;
- m_clipRect = IntRect(toPoint(m_offset), layer->size());
- m_offset -= layer->scrolledContentOffset();
+ m_clipRect = IntRect(toPoint(m_paintOffset), layer->size());
+ m_paintOffset -= layer->scrolledContentOffset();
}
}
@@ -126,4 +152,23 @@ void LayoutState::operator delete(void* ptr, size_t sz)
*(size_t*)ptr = sz;
}
+void LayoutState::clearPaginationInformation()
+{
+ m_pageHeight = m_next->m_pageHeight;
+ m_pageOffset = m_next->m_pageOffset;
+ m_columnInfo = m_next->m_columnInfo;
+}
+
+int LayoutState::pageY(int childY) const
+{
+ return m_layoutOffset.height() + childY - m_pageOffset.height();
+}
+
+void LayoutState::addForcedColumnBreak(int childY)
+{
+ if (!m_columnInfo || m_columnInfo->columnHeight())
+ return;
+ m_columnInfo->addForcedBreak(pageY(childY));
+}
+
} // namespace WebCore
diff --git a/WebCore/rendering/LayoutState.h b/WebCore/rendering/LayoutState.h
index 2f040c8..ca4cbfb 100644
--- a/WebCore/rendering/LayoutState.h
+++ b/WebCore/rendering/LayoutState.h
@@ -32,6 +32,7 @@
namespace WebCore {
+class ColumnInfo;
class RenderArena;
class RenderBox;
class RenderObject;
@@ -40,6 +41,8 @@ class LayoutState : public Noncopyable {
public:
LayoutState()
: m_clipped(false)
+ , m_pageHeight(0)
+ , m_columnInfo(0)
, m_next(0)
#ifndef NDEBUG
, m_renderer(0)
@@ -47,7 +50,7 @@ public:
{
}
- LayoutState(LayoutState*, RenderBox*, const IntSize& offset);
+ LayoutState(LayoutState*, RenderBox*, const IntSize& offset, int pageHeight, ColumnInfo*);
LayoutState(RenderObject*);
void destroy(RenderArena*);
@@ -58,6 +61,12 @@ public:
// Overridden to prevent the normal delete from being called.
void operator delete(void*, size_t);
+ void clearPaginationInformation();
+ bool isPaginatingColumns() const { return m_columnInfo; }
+ bool isPaginated() const { return m_pageHeight || m_columnInfo; }
+ int pageY(int childY) const;
+ void addForcedColumnBreak(int childY);
+
private:
// The normal operator new is disallowed.
void* operator new(size_t) throw();
@@ -65,10 +74,16 @@ private:
public:
bool m_clipped;
IntRect m_clipRect;
- IntSize m_offset; // x/y offset from container.
- IntSize m_layoutDelta; // Transient offset from the final position of the object
- // used to ensure that repaints happen in the correct place.
- // This is a total delta accumulated from the root.
+ IntSize m_paintOffset; // x/y offset from container. Includes relative positioning and scroll offsets.
+ IntSize m_layoutOffset; // x/y offset from container. Does not include relative positioning or scroll offsets.
+ IntSize m_layoutDelta; // Transient offset from the final position of the object
+ // used to ensure that repaints happen in the correct place.
+ // This is a total delta accumulated from the root.
+
+ int m_pageHeight; // The current page height for the pagination model that encloses us.
+ IntSize m_pageOffset; // The offset of the start of the first page in the nearest enclosing pagination model.
+ ColumnInfo* m_columnInfo; // If the enclosing pagination model is a column model, then this will store column information for easy retrieval/manipulation.
+
LayoutState* m_next;
#ifndef NDEBUG
RenderObject* m_renderer;
diff --git a/WebCore/rendering/MediaControlElements.cpp b/WebCore/rendering/MediaControlElements.cpp
index aaeb3e2..5533326 100644
--- a/WebCore/rendering/MediaControlElements.cpp
+++ b/WebCore/rendering/MediaControlElements.cpp
@@ -350,7 +350,7 @@ MediaControlInputElement::MediaControlInputElement(HTMLMediaElement* mediaElemen
, m_mediaElement(mediaElement)
, m_pseudoStyleId(pseudo)
{
- setInputType(type);
+ setType(type);
setInDocument();
switch (pseudo) {
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 52f5c52..0e44b32 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -118,7 +118,7 @@ RenderBlock::RenderBlock(Node* node)
, m_floatingObjects(0)
, m_positionedObjects(0)
, m_continuation(0)
- , m_maxMargin(0)
+ , m_rareData(0)
, m_lineHeight(-1)
{
setChildrenInline(true);
@@ -128,7 +128,6 @@ RenderBlock::~RenderBlock()
{
delete m_floatingObjects;
delete m_positionedObjects;
- delete m_maxMargin;
if (hasColumns())
delete gColumnInfoMap->take(this);
@@ -1116,7 +1115,7 @@ void RenderBlock::layout()
clearLayoutOverflow();
}
-void RenderBlock::layoutBlock(bool relayoutChildren)
+void RenderBlock::layoutBlock(bool relayoutChildren, int pageHeight)
{
ASSERT(needsLayout());
@@ -1127,7 +1126,6 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
return;
LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
- LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasColumns() || hasTransform() || hasReflection());
int oldWidth = width();
int oldColumnWidth = desiredColumnWidth();
@@ -1148,6 +1146,30 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
int previousHeight = height();
setHeight(0);
+ bool hasSpecifiedPageHeight = false;
+ ColumnInfo* colInfo = columnInfo();
+ if (hasColumns()) {
+ if (!pageHeight) {
+ // We need to go ahead and set our explicit page height if one exists, so that we can
+ // avoid doing two layout passes.
+ calcHeight();
+ int columnHeight = contentHeight();
+ if (columnHeight > 0) {
+ pageHeight = columnHeight;
+ hasSpecifiedPageHeight = true;
+ }
+ setHeight(0);
+ }
+ if (colInfo->columnHeight() != pageHeight && m_everHadLayout) {
+ colInfo->setColumnHeight(pageHeight);
+ markDescendantBlocksAndLinesForLayout(); // We need to dirty all descendant blocks and lines, since the column height is different now.
+ }
+
+ if (!hasSpecifiedPageHeight && !pageHeight)
+ colInfo->clearForcedBreaks();
+ }
+
+ LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasColumns() || hasTransform() || hasReflection(), pageHeight, colInfo);
// We use four values, maxTopPos, maxTopNeg, maxBottomPos, and maxBottomNeg, to track
// our current maximal positive and negative margins. These values are used when we
@@ -1162,7 +1184,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
bool isCell = isTableCell();
if (!isCell) {
initMaxMarginValues();
-
+
setTopMarginQuirk(style()->marginTop().quirk());
setBottomMarginQuirk(style()->marginBottom().quirk());
@@ -1172,6 +1194,8 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
// a bottom margin.
setMaxBottomMargins(0, 0);
}
+
+ setPaginationStrut(0);
}
// For overflow:scroll blocks, ensure we have both scrollbars in place always.
@@ -1197,10 +1221,9 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
if (floatBottom() > (height() - toAdd) && expandsToEncloseOverhangingFloats())
setHeight(floatBottom() + toAdd);
- // Now lay out our columns within this intrinsic height, since they can slightly affect the intrinsic height as
- // we adjust for clean column breaks.
- int singleColumnBottom = layoutColumns();
-
+ if (layoutColumns(hasSpecifiedPageHeight, pageHeight, statePusher))
+ return;
+
// Calculate our new height.
int oldHeight = height();
calcHeight();
@@ -1215,21 +1238,18 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
}
}
}
-
- // We have to rebalance columns to the new height.
- layoutColumns(singleColumnBottom);
}
if (previousHeight != height())
relayoutChildren = true;
- // This check is designed to catch anyone
- // who wasn't going to propagate float information up to the parent and yet could potentially be painted by its ancestor.
- if (isRoot() || expandsToEncloseOverhangingFloats())
- addOverflowFromFloats();
-
// Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway).
if (!hasColumns()) {
+ // This check is designed to catch anyone
+ // who wasn't going to propagate float information up to the parent and yet could potentially be painted by its ancestor.
+ if (isRoot() || expandsToEncloseOverhangingFloats())
+ addOverflowFromFloats();
+
if (childrenInline())
addOverflowFromInlineChildren();
else
@@ -1245,6 +1265,9 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
statePusher.pop();
+ if (view()->layoutState()->m_pageHeight)
+ setPageY(view()->layoutState()->pageY(y()));
+
// Update our scroll information if we're overflow:auto/scroll/hidden now that we know if
// we overflow or not.
updateScrollInfoAfterLayout();
@@ -1493,7 +1516,8 @@ int RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo)
if (marginInfo.quirkContainer() && marginInfo.atTopOfBlock() && (posTop - negTop))
marginInfo.setTopQuirk(topQuirk);
- int ypos = height();
+ int beforeCollapseY = height();
+ int ypos = beforeCollapseY;
if (child->isSelfCollapsingBlock()) {
// This child has no height. We need to compute our
// position before we collapse the child's margins together,
@@ -1535,6 +1559,14 @@ int RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo)
marginInfo.setBottomQuirk(child->isBottomMarginQuirk() || style()->marginBottomCollapse() == MDISCARD);
}
+ // If margins would pull us past the top of the next page, then we need to pull back and pretend like the margins
+ // collapsed into the page edge.
+ bool paginated = view()->layoutState()->isPaginated();
+ if (paginated && ypos > beforeCollapseY) {
+ int oldY = ypos;
+ ypos = min(ypos, nextPageTop(beforeCollapseY));
+ setHeight(height() + (ypos - oldY));
+ }
return ypos;
}
@@ -1594,7 +1626,27 @@ int RenderBlock::estimateVerticalPosition(RenderBox* child, const MarginInfo& ma
int childMarginTop = child->selfNeedsLayout() ? child->marginTop() : child->collapsedMarginTop();
yPosEstimate += max(marginInfo.margin(), childMarginTop);
}
+
+ bool paginated = view()->layoutState()->isPaginated();
+
+ // Adjust yPosEstimate down to the next page if the margins are so large that we don't fit on the current
+ // page.
+ if (paginated && yPosEstimate > height())
+ yPosEstimate = min(yPosEstimate, nextPageTop(height()));
+
yPosEstimate += getClearDelta(child, yPosEstimate);
+
+ if (paginated) {
+ // If the object has a page or column break value of "before", then we should shift to the top of the next page.
+ yPosEstimate = applyBeforeBreak(child, yPosEstimate);
+
+ // For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one.
+ yPosEstimate = adjustForUnsplittableChild(child, yPosEstimate);
+
+ if (!child->selfNeedsLayout() && child->isRenderBlock())
+ yPosEstimate += toRenderBlock(child)->paginationStrut();
+ }
+
return yPosEstimate;
}
@@ -1784,8 +1836,9 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
view()->addLayoutDelta(IntSize(0, child->y() - yPosEstimate));
child->setLocation(child->x(), yPosEstimate);
+ RenderBlock* childRenderBlock = child->isRenderBlock() ? toRenderBlock(child) : 0;
bool markDescendantsWithFloats = false;
- if (yPosEstimate != oldRect.y() && !child->avoidsFloats() && child->isBlockFlow() && toRenderBlock(child)->containsFloats())
+ if (yPosEstimate != oldRect.y() && !child->avoidsFloats() && childRenderBlock && childRenderBlock->containsFloats())
markDescendantsWithFloats = true;
else if (!child->avoidsFloats() || child->shrinkToAvoidFloats()) {
// If an element might be affected by the presence of floats, then always mark it for
@@ -1795,18 +1848,24 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
markDescendantsWithFloats = true;
}
- if (child->isRenderBlock()) {
+ if (childRenderBlock) {
if (markDescendantsWithFloats)
- toRenderBlock(child)->markAllDescendantsWithFloatsForLayout();
-
+ childRenderBlock->markAllDescendantsWithFloatsForLayout();
previousFloatBottom = max(previousFloatBottom, oldRect.y() + toRenderBlock(child)->floatBottom());
}
+ bool paginated = view()->layoutState()->isPaginated();
+ if (!child->needsLayout() && paginated && view()->layoutState()->m_pageHeight && childRenderBlock && view()->layoutState()->pageY(child->y()) != childRenderBlock->pageY())
+ childRenderBlock->markForPaginationRelayout();
+
bool childHadLayout = child->m_everHadLayout;
bool childNeededLayout = child->needsLayout();
if (childNeededLayout)
child->layout();
+ // Cache if we are at the top of the block right now.
+ bool atTopOfBlock = marginInfo.atTopOfBlock();
+
// Now determine the correct ypos based off examination of collapsing margin
// values.
int yBeforeClear = collapseMargins(child, marginInfo);
@@ -1814,6 +1873,41 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
// Now check for clear.
int yAfterClear = clearFloatsIfNeeded(child, marginInfo, oldTopPosMargin, oldTopNegMargin, yBeforeClear);
+ if (paginated) {
+ int oldY = yAfterClear;
+
+ // If the object has a page or column break value of "before", then we should shift to the top of the next page.
+ yAfterClear = applyBeforeBreak(child, yAfterClear);
+
+ // For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one.
+ int yBeforeUnsplittableAdjustment = yAfterClear;
+ int yAfterUnsplittableAdjustment = adjustForUnsplittableChild(child, yAfterClear);
+
+ int paginationStrut = 0;
+ int unsplittableAdjustmentDelta = yAfterUnsplittableAdjustment - yBeforeUnsplittableAdjustment;
+ if (unsplittableAdjustmentDelta)
+ paginationStrut = unsplittableAdjustmentDelta;
+ else if (childRenderBlock && childRenderBlock->paginationStrut())
+ paginationStrut = childRenderBlock->paginationStrut();
+
+ if (paginationStrut) {
+ // We are willing to propagate out to our parent block as long as we were at the top of the block prior
+ // to collapsing our margins, and as long as we didn't clear or move as a result of other pagination.
+ if (atTopOfBlock && oldY == yBeforeClear && !isPositioned() && !isTableCell()) {
+ // FIXME: Should really check if we're exceeding the page height before propagating the strut, but we don't
+ // have all the information to do so (the strut only has the remaining amount to push). Gecko gets this wrong too
+ // and pushes to the next page anyway, so not too concerned about it.
+ setPaginationStrut(yAfterClear + paginationStrut);
+ if (childRenderBlock)
+ childRenderBlock->setPaginationStrut(0);
+ } else
+ yAfterClear += paginationStrut;
+ }
+
+ // Similar to how we apply clearance. Go ahead and boost height() to be the place where we're going to position the child.
+ setHeight(height() + (yAfterClear - oldY));
+ }
+
view()->addLayoutDelta(IntSize(0, yPosEstimate - yAfterClear));
child->setLocation(child->x(), yAfterClear);
@@ -1826,8 +1920,13 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
// So go ahead and mark the item as dirty.
child->setChildNeedsLayout(true, false);
}
- if (!child->avoidsFloats() && child->isBlockFlow() && toRenderBlock(child)->containsFloats())
- toRenderBlock(child)->markAllDescendantsWithFloatsForLayout();
+ if (childRenderBlock) {
+ if (!child->avoidsFloats() && childRenderBlock->containsFloats())
+ childRenderBlock->markAllDescendantsWithFloatsForLayout();
+ if (paginated && !child->needsLayout() && view()->layoutState()->m_pageHeight && view()->layoutState()->pageY(child->y()) != childRenderBlock->pageY())
+ childRenderBlock->markForPaginationRelayout();
+ }
+
// Our guess was wrong. Make the child lay itself out again.
child->layoutIfNeeded();
}
@@ -1848,7 +1947,7 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
}
// If the child has overhanging floats that intrude into following siblings (or possibly out
// of this block), then the parent gets notified of the floats now.
- if (child->isBlockFlow() && toRenderBlock(child)->containsFloats())
+ if (childRenderBlock && childRenderBlock->containsFloats())
maxFloatBottom = max(maxFloatBottom, addOverhangingFloats(toRenderBlock(child), -child->x(), -child->y(), !childNeededLayout));
IntSize childOffset(child->x() - oldRect.x(), child->y() - oldRect.y());
@@ -1867,6 +1966,13 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
child->repaintOverhangingFloats(true);
}
+ if (paginated) {
+ // Check for an after page/column break.
+ int newHeight = applyAfterBreak(child, height(), marginInfo);
+ if (newHeight != height())
+ setHeight(newHeight);
+ }
+
ASSERT(oldLayoutDelta == view()->layoutDelta());
}
@@ -1904,6 +2010,11 @@ bool RenderBlock::layoutOnlyPositionedObjects()
void RenderBlock::layoutPositionedObjects(bool relayoutChildren)
{
if (m_positionedObjects) {
+ if (hasColumns())
+ view()->layoutState()->clearPaginationInformation(); // Positioned objects are not part of the column flow, so they don't paginate with the columns.
+
+ bool paginated = view()->layoutState()->isPaginated();
+
RenderBox* r;
Iterator end = m_positionedObjects->end();
for (Iterator it = m_positionedObjects->begin(); it != end; ++it) {
@@ -1919,12 +2030,21 @@ void RenderBlock::layoutPositionedObjects(bool relayoutChildren)
//if (relayoutChildren && (r->style()->paddingLeft().isPercent() || r->style()->paddingRight().isPercent()))
r->setPrefWidthsDirty(true, false);
+ if (!r->needsLayout() && paginated && view()->layoutState()->m_pageHeight) {
+ RenderBlock* childRenderBlock = r->isRenderBlock() ? toRenderBlock(r) : 0;
+ if (childRenderBlock && view()->layoutState()->pageY(childRenderBlock->y()) != childRenderBlock->pageY())
+ childRenderBlock->markForPaginationRelayout();
+ }
+
// We don't have to do a full layout. We just have to update our position. Try that first. If we have shrink-to-fit width
// and we hit the available width constraint, the layoutIfNeeded() will catch it and do a full layout.
if (r->needsPositionedMovementLayoutOnly())
r->tryLayoutDoingPositionedMovementOnly();
r->layoutIfNeeded();
}
+
+ if (hasColumns())
+ view()->layoutState()->m_columnInfo = columnInfo(); // FIXME: Kind of gross. We just put this back into the layout state so that pop() will work.
}
}
@@ -2012,12 +2132,12 @@ void RenderBlock::paintColumnRules(PaintInfo& paintInfo, int tx, int ty)
// We need to do multiple passes, breaking up our child painting into strips.
ColumnInfo* colInfo = columnInfo();
- unsigned colCount = colInfo->columnCount();
+ unsigned colCount = columnCount(colInfo);
int currXOffset = style()->direction() == LTR ? 0 : contentWidth();
int ruleAdd = borderLeft() + paddingLeft();
int ruleX = style()->direction() == LTR ? 0 : contentWidth();
for (unsigned i = 0; i < colCount; i++) {
- IntRect colRect = colInfo->columnRectAt(i);
+ IntRect colRect = columnRectAt(colInfo, i);
// Move to the next position.
if (style()->direction() == LTR) {
@@ -2048,14 +2168,14 @@ void RenderBlock::paintColumnContents(PaintInfo& paintInfo, int tx, int ty, bool
GraphicsContext* context = paintInfo.context;
int colGap = columnGap();
ColumnInfo* colInfo = columnInfo();
- unsigned colCount = colInfo->columnCount();
+ unsigned colCount = columnCount(colInfo);
if (!colCount)
return;
- int currXOffset = style()->direction() == LTR ? 0 : contentWidth() - colInfo->columnRectAt(0).width();
+ int currXOffset = style()->direction() == LTR ? 0 : contentWidth() - columnRectAt(colInfo, 0).width();
int currYOffset = 0;
for (unsigned i = 0; i < colCount; i++) {
// For each rect, we clip to the rect, and then we adjust our coords.
- IntRect colRect = colInfo->columnRectAt(i);
+ IntRect colRect = columnRectAt(colInfo, i);
colRect.move(tx, ty);
PaintInfo info(paintInfo);
info.rect.intersect(colRect);
@@ -2112,15 +2232,14 @@ void RenderBlock::paintChildren(PaintInfo& paintInfo, int tx, int ty)
info.phase = newPhase;
info.updatePaintingRootForChildren(this);
+ // FIXME: Paint-time pagination is obsolete and is now only used by embedded WebViews inside AppKit
+ // NSViews. Do not add any more code for this.
RenderView* renderView = view();
- bool usePrintRect = !renderView->printRect().isEmpty() && !document()->settings()->paginateDuringLayoutEnabled();
+ bool usePrintRect = !renderView->printRect().isEmpty();
- bool checkPageBreaks = document()->paginated() && !document()->settings()->paginateDuringLayoutEnabled();
- bool checkColumnBreaks = !checkPageBreaks && usePrintRect;
-
for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
// Check for page-break-before: always, and if it's set, break and bail.
- bool checkBeforeAlways = !childrenInline() && ((checkPageBreaks && child->style()->pageBreakBefore() == PBALWAYS) || (checkColumnBreaks && child->style()->columnBreakBefore() == PBALWAYS));
+ bool checkBeforeAlways = !childrenInline() && (usePrintRect && child->style()->pageBreakBefore() == PBALWAYS);
if (checkBeforeAlways
&& (ty + child->y()) > paintInfo.rect.y()
&& (ty + child->y()) < paintInfo.rect.bottom()) {
@@ -2143,7 +2262,7 @@ void RenderBlock::paintChildren(PaintInfo& paintInfo, int tx, int ty)
child->paint(info, tx, ty);
// Check for page-break-after: always, and if it's set, break and bail.
- bool checkAfterAlways = !childrenInline() && ((checkPageBreaks && child->style()->pageBreakAfter() == PBALWAYS) || (checkColumnBreaks && child->style()->columnBreakAfter() == PBALWAYS));
+ bool checkAfterAlways = !childrenInline() && (usePrintRect && child->style()->pageBreakAfter() == PBALWAYS);
if (checkAfterAlways
&& (ty + child->y() + child->height()) > paintInfo.rect.y()
&& (ty + child->y() + child->height()) < paintInfo.rect.bottom()) {
@@ -2155,7 +2274,7 @@ void RenderBlock::paintChildren(PaintInfo& paintInfo, int tx, int ty)
void RenderBlock::paintCaret(PaintInfo& paintInfo, int tx, int ty, CaretType type)
{
- SelectionController* selection = type == CursorCaret ? frame()->selection() : frame()->dragCaretController();
+ SelectionController* selection = type == CursorCaret ? frame()->selection() : frame()->page()->dragCaretController();
// Paint the caret if the SelectionController says so or if caret browsing is enabled
bool caretBrowsing = frame()->settings() && frame()->settings()->caretBrowsingEnabled();
@@ -2168,7 +2287,7 @@ void RenderBlock::paintCaret(PaintInfo& paintInfo, int tx, int ty, CaretType typ
if (type == CursorCaret)
frame()->selection()->paintCaret(paintInfo.context, tx, ty, paintInfo.rect);
else
- frame()->paintDragCaret(paintInfo.context, tx, ty, paintInfo.rect);
+ frame()->selection()->paintDragCaret(paintInfo.context, tx, ty, paintInfo.rect);
}
}
@@ -2791,7 +2910,7 @@ void RenderBlock::removePositionedObjects(RenderBlock* o)
m_positionedObjects->remove(deadObjects.at(i));
}
-void RenderBlock::insertFloatingObject(RenderBox* o)
+RenderBlock::FloatingObject* RenderBlock::insertFloatingObject(RenderBox* o)
{
ASSERT(o->isFloating());
@@ -2804,25 +2923,37 @@ void RenderBlock::insertFloatingObject(RenderBox* o)
DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
FloatingObject* f;
while ( (f = it.current()) ) {
- if (f->m_renderer == o) return;
+ if (f->m_renderer == o)
+ return f;
++it;
}
}
// Create the special object entry & append it to the list
- o->layoutIfNeeded();
-
FloatingObject* newObj = new FloatingObject(o->style()->floating() == FLEFT ? FloatingObject::FloatLeft : FloatingObject::FloatRight);
newObj->m_top = -1;
newObj->m_bottom = -1;
+
+ // Our location is irrelevant if we're unsplittable or no pagination is in effect.
+ // Just go ahead and lay out the float.
+ bool affectedByPagination = o->isRenderBlock() && view()->layoutState()->m_pageHeight;
+ if (!affectedByPagination)
+ o->layoutIfNeeded();
+ else {
+ o->calcWidth();
+ o->calcVerticalMargins();
+ }
newObj->m_width = o->width() + o->marginLeft() + o->marginRight();
+
newObj->m_shouldPaint = !o->hasSelfPaintingLayer(); // If a layer exists, the float will paint itself. Otherwise someone else will.
newObj->m_isDescendant = true;
newObj->m_renderer = o;
m_floatingObjects->append(newObj);
+
+ return newObj;
}
void RenderBlock::removeFloatingObject(RenderBox* o)
@@ -2846,6 +2977,18 @@ void RenderBlock::removeFloatingObject(RenderBox* o)
}
}
+void RenderBlock::removeFloatingObjectsBelow(FloatingObject* lastFloat, int y)
+{
+ if (!m_floatingObjects)
+ return;
+
+ FloatingObject* curr = m_floatingObjects->last();
+ while (curr != lastFloat && (curr->m_top == -1 || curr->m_top >= y)) {
+ m_floatingObjects->removeLast();
+ curr = m_floatingObjects->last();
+ }
+}
+
bool RenderBlock::positionNewFloats()
{
if (!m_floatingObjects)
@@ -2882,16 +3025,15 @@ bool RenderBlock::positionNewFloats()
}
RenderBox* o = f->m_renderer;
- int _height = o->height() + o->marginTop() + o->marginBottom();
int ro = rightOffset(); // Constant part of right offset.
- int lo = leftOffset(); // Constat part of left offset.
+ int lo = leftOffset(); // Constant part of left offset.
int fwidth = f->m_width; // The width we look for.
if (ro - lo < fwidth)
fwidth = ro - lo; // Never look for more than what will be available.
IntRect oldRect(o->x(), o->y() , o->width(), o->height());
-
+
if (o->style()->clear() & CLEFT)
y = max(leftBottom(), y);
if (o->style()->clear() & CRIGHT)
@@ -2920,9 +3062,38 @@ bool RenderBlock::positionNewFloats()
o->setLocation(fx - o->marginRight() - o->width(), y + o->marginTop());
}
- f->m_top = y;
- f->m_bottom = f->m_top + _height;
+ if (view()->layoutState()->isPaginated()) {
+ RenderBlock* childBlock = o->isRenderBlock() ? toRenderBlock(o) : 0;
+ if (childBlock && view()->layoutState()->m_pageHeight && view()->layoutState()->pageY(o->y()) != childBlock->pageY())
+ childBlock->markForPaginationRelayout();
+ o->layoutIfNeeded();
+
+ // If we are unsplittable and don't fit, then we need to move down.
+ // We include our margins as part of the unsplittable area.
+ int newY = adjustForUnsplittableChild(o, y, true);
+
+ // See if we have a pagination strut that is making us move down further.
+ // Note that an unsplittable child can't also have a pagination strut, so this is
+ // exclusive with the case above.
+ if (childBlock && childBlock->paginationStrut()) {
+ newY += childBlock->paginationStrut();
+ childBlock->setPaginationStrut(0);
+ }
+
+ if (newY != y) {
+ f->m_paginationStrut = newY - y;
+ y = newY;
+ o->setY(y + o->marginTop());
+ if (childBlock)
+ childBlock->setChildNeedsLayout(true, false);
+ o->layoutIfNeeded();
+ }
+ }
+
+ f->m_top = y;
+ f->m_bottom = f->m_top + o->marginTop() + o->height() + o->marginBottom();
+
// If the child moved, we have to repaint it.
if (o->checkForRepaintDuringLayout())
o->repaintDuringLayoutIfMoved(oldRect);
@@ -2932,6 +3103,40 @@ bool RenderBlock::positionNewFloats()
return true;
}
+bool RenderBlock::positionNewFloatOnLine(FloatingObject* newFloat, FloatingObject* lastFloatFromPreviousLine)
+{
+ bool didPosition = positionNewFloats();
+ if (!didPosition || !newFloat->m_paginationStrut)
+ return didPosition;
+
+ int floatTop = newFloat->m_top;
+ int paginationStrut = newFloat->m_paginationStrut;
+ FloatingObject* f = m_floatingObjects->last();
+
+ ASSERT(f == newFloat);
+
+ if (floatTop - paginationStrut != height())
+ return didPosition;
+
+ for (f = m_floatingObjects->prev(); f && f != lastFloatFromPreviousLine; f = m_floatingObjects->prev()) {
+ if (f->m_top == height()) {
+ ASSERT(!f->m_paginationStrut);
+ f->m_paginationStrut = paginationStrut;
+ RenderBox* o = f->m_renderer;
+ o->setY(o->y() + o->marginTop() + paginationStrut);
+ if (o->isRenderBlock())
+ toRenderBlock(o)->setChildNeedsLayout(true, false);
+ o->layoutIfNeeded();
+ f->m_top += f->m_paginationStrut;
+ f->m_bottom += f->m_paginationStrut;
+ }
+ }
+
+ setHeight(height() + paginationStrut);
+
+ return didPosition;
+}
+
void RenderBlock::newLine(EClear clear)
{
positionNewFloats();
@@ -3173,8 +3378,8 @@ int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf)
if (hasColumns()) {
ColumnInfo* colInfo = columnInfo();
- for (unsigned i = 0; i < colInfo->columnCount(); i++)
- bottom = max(bottom, colInfo->columnRectAt(i).bottom() + relativeOffset);
+ for (unsigned i = 0; i < columnCount(colInfo); i++)
+ bottom = max(bottom, columnRectAt(colInfo, i).bottom() + relativeOffset);
return bottom;
}
@@ -3268,8 +3473,9 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
// This only matters for LTR
if (style()->direction() == LTR) {
ColumnInfo* colInfo = columnInfo();
- if (colInfo->columnCount())
- right = max(colInfo->columnRectAt(colInfo->columnCount() - 1).right() + relativeOffset, right);
+ unsigned count = columnCount(colInfo);
+ if (count)
+ right = max(columnRectAt(colInfo, count - 1).right() + relativeOffset, right);
}
return right;
}
@@ -3368,8 +3574,9 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf
// This only matters for RTL
if (style()->direction() == RTL) {
ColumnInfo* colInfo = columnInfo();
- if (colInfo->columnCount())
- left = min(colInfo->columnRectAt(colInfo->columnCount() - 1).x() + relativeOffset, left);
+ unsigned count = columnCount(colInfo);
+ if (count)
+ left = min(columnRectAt(colInfo, count - 1).x() + relativeOffset, left);
}
return left;
}
@@ -3662,6 +3869,9 @@ bool RenderBlock::containsFloat(RenderObject* o)
void RenderBlock::markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove, bool inLayout)
{
+ if (!m_everHadLayout)
+ return;
+
setChildNeedsLayout(true, !inLayout);
if (floatToRemove)
@@ -3679,30 +3889,39 @@ void RenderBlock::markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove
}
}
-int RenderBlock::visibleTopOfHighestFloatExtendingBelow(int bottom, int maxHeight) const
+void RenderBlock::markDescendantBlocksAndLinesForLayout(bool inLayout)
{
- int top = bottom;
- if (m_floatingObjects) {
- FloatingObject* floatingObject;
- for (DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); (floatingObject = it.current()); ++it) {
- RenderBox* floatingBox = floatingObject->m_renderer;
- IntRect visibleOverflow = floatingBox->visibleOverflowRect();
- visibleOverflow.move(floatingBox->x(), floatingBox->y());
- if (visibleOverflow.y() < top && visibleOverflow.bottom() > bottom && visibleOverflow.height() <= maxHeight && floatingBox->containingBlock() == this)
- top = visibleOverflow.y();
- }
- }
+ if (!m_everHadLayout)
+ return;
+
+ setChildNeedsLayout(true, !inLayout);
+ // Iterate over our children and mark them as needed.
if (!childrenInline()) {
- for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
- if (child->isFloatingOrPositioned() || !child->isRenderBlock())
+ for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
+ if (child->isFloatingOrPositioned())
continue;
- RenderBlock* childBlock = toRenderBlock(child);
- top = min(top, childBlock->y() + childBlock->visibleTopOfHighestFloatExtendingBelow(bottom - childBlock->y(), maxHeight));
+ child->markDescendantBlocksAndLinesForLayout(inLayout);
+ }
+ }
+
+ // Walk our floating objects and mark them too.
+ if (m_floatingObjects) {
+ DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
+ while (it.current()) {
+ if (it.current()->m_renderer->isRenderBlock())
+ it.current()->m_renderer->markDescendantBlocksAndLinesForLayout(inLayout);
+ ++it;
}
}
- return top;
+ if (m_positionedObjects) {
+ // FIXME: Technically we don't have to mark the positioned objects if we're the block
+ // that established the columns, but we don't really have that information here.
+ Iterator end = m_positionedObjects->end();
+ for (Iterator it = m_positionedObjects->begin(); it != end; ++it)
+ (*it)->markDescendantBlocksAndLinesForLayout();
+ }
}
int RenderBlock::getClearDelta(RenderBox* child, int yPos)
@@ -3862,16 +4081,16 @@ bool RenderBlock::hitTestColumns(const HitTestRequest& request, HitTestResult& r
{
// We need to do multiple passes, breaking up our hit testing into strips.
ColumnInfo* colInfo = columnInfo();
- int colCount = colInfo->columnCount();
+ int colCount = columnCount(colInfo);
if (!colCount)
return false;
int left = borderLeft() + paddingLeft();
int currYOffset = 0;
int i;
for (i = 0; i < colCount; i++)
- currYOffset -= colInfo->columnRectAt(i).height();
+ currYOffset -= columnRectAt(colInfo, i).height();
for (i = colCount - 1; i >= 0; i--) {
- IntRect colRect = colInfo->columnRectAt(i);
+ IntRect colRect = columnRectAt(colInfo, i);
int currXOffset = colRect.x() - left;
currYOffset += colRect.height();
colRect.move(tx, ty);
@@ -4101,7 +4320,15 @@ int RenderBlock::availableWidth() const
// If we have multiple columns, then the available width is reduced to our column width.
if (hasColumns())
return desiredColumnWidth();
- return contentWidth();
+ return RenderBox::availableWidth();
+}
+
+int RenderBlock::availableLogicalWidth() const
+{
+ // If we have multiple columns, then the available logical width is reduced to our column width.
+ if (hasColumns())
+ return desiredColumnWidth();
+ return RenderBox::availableLogicalWidth();
}
int RenderBlock::columnGap() const
@@ -4165,8 +4392,7 @@ void RenderBlock::setDesiredColumnCountAndWidth(int count, int width)
bool destroyColumns = !firstChild()
|| (count == 1 && style()->hasAutoColumnWidth())
|| firstChild()->isAnonymousColumnsBlock()
- || firstChild()->isAnonymousColumnSpanBlock()
- || document()->settings()->paginateDuringLayoutEnabled();
+ || firstChild()->isAnonymousColumnSpanBlock();
if (destroyColumns) {
if (hasColumns()) {
delete gColumnInfoMap->take(this);
@@ -4209,133 +4435,75 @@ ColumnInfo* RenderBlock::columnInfo() const
return gColumnInfoMap->get(this);
}
-int RenderBlock::layoutColumns(int endOfContent, int requestedColumnHeight)
+unsigned RenderBlock::columnCount(ColumnInfo* colInfo) const
{
- // Don't do anything if we have no columns
- if (!hasColumns())
- return -1;
+ ASSERT(hasColumns() && gColumnInfoMap->get(this) == colInfo);
+ return colInfo->columnCount();
+}
- ColumnInfo* info = gColumnInfoMap->get(this);
- int desiredColumnWidth = info->desiredColumnWidth();
- int desiredColumnCount = info->desiredColumnCount();
-
- bool computeIntrinsicHeight = (endOfContent == -1);
-
- // Fill the columns in to the available height. Attempt to balance the height of the columns.
- // Add in half our line-height to help with best-guess initial balancing.
- int columnSlop = lineHeight(false) / 2;
- int remainingSlopSpace = columnSlop * desiredColumnCount;
- int availableHeight = contentHeight();
- int colHeight;
- if (computeIntrinsicHeight && requestedColumnHeight >= 0)
- colHeight = requestedColumnHeight;
- else if (computeIntrinsicHeight)
- colHeight = min(availableHeight, availableHeight / desiredColumnCount + columnSlop);
- else
- colHeight = availableHeight;
- int originalColHeight = colHeight;
+IntRect RenderBlock::columnRectAt(ColumnInfo* colInfo, unsigned index) const
+{
+ ASSERT(hasColumns() && gColumnInfoMap->get(this) == colInfo);
+ // Compute the appropriate rect based off our information.
+ int colWidth = colInfo->desiredColumnWidth();
+ int colHeight = colInfo->columnHeight();
+ int colTop = borderTop() + paddingTop();
int colGap = columnGap();
+ int colLeft = style()->direction() == LTR ?
+ borderLeft() + paddingLeft() + (index * (colWidth + colGap))
+ : borderLeft() + paddingLeft() + contentWidth() - colWidth - (index * (colWidth + colGap));
+ return IntRect(colLeft, colTop, colWidth, colHeight);
+}
- // Compute a collection of column rects.
- info->clearColumns();
-
- // Then we do a simulated "paint" into the column slices and allow the content to slightly adjust our individual column rects.
- // FIXME: We need to take into account layers that are affected by the columns as well here so that they can have an opportunity
- // to adjust column rects also.
- RenderView* v = view();
- int left = borderLeft() + paddingLeft();
- int top = borderTop() + paddingTop();
- int currX = style()->direction() == LTR ? borderLeft() + paddingLeft() : borderLeft() + paddingLeft() + contentWidth() - desiredColumnWidth;
- int currY = top;
- unsigned colCount = desiredColumnCount;
- int maxColBottom = borderTop() + paddingTop();
- int contentBottom = top + availableHeight;
- int minimumColumnHeight = -1;
- for (unsigned i = 0; i < colCount; i++) {
- // If we aren't constrained, then the last column can just get all the remaining space.
- if (computeIntrinsicHeight && i == colCount - 1)
- colHeight = availableHeight;
-
- // This represents the real column position.
- IntRect colRect(currX, top, desiredColumnWidth, colHeight);
-
- int truncationPoint = visibleTopOfHighestFloatExtendingBelow(currY + colHeight, colHeight);
-
- // For the simulated paint, we pretend like everything is in one long strip.
- IntRect pageRect(left, currY, contentWidth(), truncationPoint - currY);
- v->setPrintRect(pageRect);
- v->setTruncatedAt(truncationPoint);
- GraphicsContext context((PlatformGraphicsContext*)0);
- PaintInfo paintInfo(&context, pageRect, PaintPhaseForeground, false, 0, 0);
+bool RenderBlock::layoutColumns(bool hasSpecifiedPageHeight, int pageHeight, LayoutStateMaintainer& statePusher)
+{
+ if (hasColumns()) {
+ // FIXME: We don't balance properly at all in the presence of forced page breaks. We need to understand what
+ // the distance between forced page breaks is so that we can avoid making the minimum column height too tall.
+ ColumnInfo* colInfo = columnInfo();
+ int desiredColumnCount = colInfo->desiredColumnCount();
+ if (!hasSpecifiedPageHeight) {
+ int columnHeight = pageHeight;
+ int minColumnCount = colInfo->forcedBreaks() + 1;
+ if (minColumnCount >= desiredColumnCount) {
+ // The forced page breaks are in control of the balancing. Just set the column height to the
+ // maximum page break distance.
+ if (!pageHeight) {
+ int distanceBetweenBreaks = max(colInfo->maximumDistanceBetweenForcedBreaks(),
+ view()->layoutState()->pageY(borderTop() + paddingTop() + contentHeight()) - colInfo->forcedBreakOffset());
+ columnHeight = max(colInfo->minimumColumnHeight(), distanceBetweenBreaks);
+ }
+ } else if (contentHeight() > pageHeight * desiredColumnCount) {
+ // Now that we know the intrinsic height of the columns, we have to rebalance them.
+ columnHeight = max(colInfo->minimumColumnHeight(), (int)ceilf((float)contentHeight() / desiredColumnCount));
+ }
+
+ if (columnHeight && columnHeight != pageHeight) {
+ statePusher.pop();
+ m_everHadLayout = true;
+ layoutBlock(false, columnHeight);
+ return true;
+ }
+ }
- setHasColumns(false);
- paintObject(paintInfo, 0, 0);
- setHasColumns(true);
-
- if (computeIntrinsicHeight && v->minimumColumnHeight() > originalColHeight) {
- // The initial column height was too small to contain one line of text.
- minimumColumnHeight = max(minimumColumnHeight, v->minimumColumnHeight());
- }
+ if (pageHeight) // FIXME: Should we use lowestPosition (excluding our positioned objects) instead of contentHeight()?
+ colInfo->setColumnCountAndHeight(ceilf((float)contentHeight() / pageHeight), pageHeight);
+
+ if (columnCount(colInfo)) {
+ IntRect lastRect = columnRectAt(colInfo, columnCount(colInfo) - 1);
+ int overflowLeft = style()->direction() == RTL ? min(0, lastRect.x()) : 0;
+ int overflowRight = style()->direction() == LTR ? max(width(), lastRect.x() + lastRect.width()) : 0;
+ int overflowHeight = borderTop() + paddingTop() + colInfo->columnHeight();
+
+ setHeight(overflowHeight + borderBottom() + paddingBottom() + horizontalScrollbarHeight());
- int adjustedBottom = v->bestTruncatedAt();
- if (adjustedBottom <= currY)
- adjustedBottom = truncationPoint;
-
- colRect.setHeight(adjustedBottom - currY);
-
- // Add in the lost space to the subsequent columns.
- // FIXME: This will create a "staircase" effect if there are enough columns, but the effect should be pretty subtle.
- if (computeIntrinsicHeight) {
- int lostSpace = colHeight - colRect.height();
- if (lostSpace > remainingSlopSpace) {
- // Redestribute the space among the remaining columns.
- int spaceToRedistribute = lostSpace - remainingSlopSpace;
- int remainingColumns = colCount - i + 1;
- colHeight += spaceToRedistribute / remainingColumns;
- }
- remainingSlopSpace = max(0, remainingSlopSpace - lostSpace);
+ m_overflow.clear();
+ addLayoutOverflow(IntRect(overflowLeft, 0, overflowRight - overflowLeft, overflowHeight));
}
-
- if (style()->direction() == LTR)
- currX += desiredColumnWidth + colGap;
- else
- currX -= (desiredColumnWidth + colGap);
-
- currY += colRect.height();
- availableHeight -= colRect.height();
-
- maxColBottom = max(colRect.bottom(), maxColBottom);
-
- info->addColumnRect(colRect);
-
- // Start adding in more columns as long as there's still content left.
- if (currY < endOfContent && i == colCount - 1 && (computeIntrinsicHeight || contentHeight()))
- colCount++;
- }
-
- if (minimumColumnHeight >= 0) {
- // If originalColHeight was too small, we need to try to layout again.
- return layoutColumns(endOfContent, minimumColumnHeight);
}
-
- int overflowRight = max(width(), currX - colGap);
- int overflowLeft = min(0, currX + desiredColumnWidth + colGap);
- int overflowHeight = maxColBottom;
- int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
-
- if (computeIntrinsicHeight)
- setHeight(maxColBottom + toAdd);
-
- m_overflow.clear();
- addLayoutOverflow(IntRect(overflowLeft, 0, overflowRight - overflowLeft, overflowHeight));
-
- v->setPrintRect(IntRect());
- v->setTruncatedAt(0);
- ASSERT(colCount == info->columnCount());
-
- return contentBottom;
+ return false;
}
void RenderBlock::adjustPointToColumnContents(IntPoint& point) const
@@ -4345,17 +4513,17 @@ void RenderBlock::adjustPointToColumnContents(IntPoint& point) const
return;
ColumnInfo* colInfo = columnInfo();
- if (!colInfo->columnCount())
+ if (!columnCount(colInfo))
return;
// Determine which columns we intersect.
int colGap = columnGap();
int leftGap = colGap / 2;
- IntPoint columnPoint(colInfo->columnRectAt(0).location());
+ IntPoint columnPoint(columnRectAt(colInfo, 0).location());
int yOffset = 0;
for (unsigned i = 0; i < colInfo->columnCount(); i++) {
// Add in half the column gap to the left and right of the rect.
- IntRect colRect = colInfo->columnRectAt(i);
+ IntRect colRect = columnRectAt(colInfo, i);
IntRect gapAndColumnRect(colRect.x() - leftGap, colRect.y(), colRect.width() + colGap, colRect.height());
if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.right()) {
@@ -4393,7 +4561,7 @@ void RenderBlock::adjustRectForColumns(IntRect& r) const
IntRect result;
// Determine which columns we intersect.
- unsigned colCount = colInfo->columnCount();
+ unsigned colCount = columnCount(colInfo);
if (!colCount)
return;
@@ -4401,7 +4569,7 @@ void RenderBlock::adjustRectForColumns(IntRect& r) const
int currYOffset = 0;
for (unsigned i = 0; i < colCount; i++) {
- IntRect colRect = colInfo->columnRectAt(i);
+ IntRect colRect = columnRectAt(colInfo, i);
int currXOffset = colRect.x() - left;
IntRect repaintRect = r;
@@ -4427,9 +4595,9 @@ void RenderBlock::adjustForColumns(IntSize& offset, const IntPoint& point) const
int left = borderLeft() + paddingLeft();
int yOffset = 0;
- size_t columnCount = colInfo->columnCount();
- for (size_t i = 0; i < columnCount; ++i) {
- IntRect columnRect = colInfo->columnRectAt(i);
+ size_t colCount = columnCount(colInfo);
+ for (size_t i = 0; i < colCount; ++i) {
+ IntRect columnRect = columnRectAt(colInfo, i);
int xOffset = columnRect.x() - left;
if (point.y() < columnRect.bottom() + yOffset) {
offset.expand(xOffset, -yOffset);
@@ -5108,6 +5276,16 @@ RenderBlock* RenderBlock::firstLineBlock() const
return firstLineBlock;
}
+static RenderStyle* styleForFirstLetter(RenderObject* firstLetterBlock, RenderObject* firstLetterContainer)
+{
+ RenderStyle* pseudoStyle = firstLetterBlock->getCachedPseudoStyle(FIRST_LETTER, firstLetterContainer->firstLineStyle());
+ // Force inline display (except for floating first-letters).
+ pseudoStyle->setDisplay(pseudoStyle->isFloating() ? BLOCK : INLINE);
+ // CSS2 says first-letter can't be positioned.
+ pseudoStyle->setPosition(StaticPosition);
+ return pseudoStyle;
+}
+
void RenderBlock::updateFirstLetter()
{
if (!document()->usesFirstLetterRules())
@@ -5157,84 +5335,110 @@ void RenderBlock::updateFirstLetter()
if (!currChild)
return;
- RenderObject* firstLetterContainer = currChild->parent();
-
// If the child already has style, then it has already been created, so we just want
// to update it.
- if (firstLetterContainer->style()->styleType() == FIRST_LETTER) {
- RenderStyle* pseudo = firstLetterBlock->getCachedPseudoStyle(FIRST_LETTER,
- firstLetterContainer->parent()->firstLineStyle());
- firstLetterContainer->setStyle(pseudo);
- for (RenderObject* genChild = firstLetterContainer->firstChild(); genChild; genChild = genChild->nextSibling()) {
+ if (currChild->parent()->style()->styleType() == FIRST_LETTER) {
+ RenderObject* firstLetter = currChild->parent();
+ RenderObject* firstLetterContainer = firstLetter->parent();
+ RenderStyle* pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer);
+
+ if (Node::diff(firstLetter->style(), pseudoStyle) == Node::Detach) {
+ // The first-letter renderer needs to be replaced. Create a new renderer of the right type.
+ RenderObject* newFirstLetter;
+ if (pseudoStyle->display() == INLINE)
+ newFirstLetter = new (renderArena()) RenderInline(document());
+ else
+ newFirstLetter = new (renderArena()) RenderBlock(document());
+ newFirstLetter->setStyle(pseudoStyle);
+
+ // Move the first letter into the new renderer.
+ view()->disableLayoutState();
+ while (RenderObject* child = firstLetter->firstChild()) {
+ if (child->isText())
+ toRenderText(child)->dirtyLineBoxes(true);
+ firstLetter->removeChild(child);
+ newFirstLetter->addChild(child, 0);
+ }
+ RenderTextFragment* remainingText = toRenderTextFragment(firstLetter->nextSibling());
+ ASSERT(remainingText->node()->renderer() == remainingText);
+ // Replace the old renderer with the new one.
+ remainingText->setFirstLetter(newFirstLetter);
+ firstLetter->destroy();
+ firstLetter = newFirstLetter;
+ firstLetterContainer->addChild(firstLetter, remainingText);
+ view()->enableLayoutState();
+ } else
+ firstLetter->setStyle(pseudoStyle);
+
+ for (RenderObject* genChild = firstLetter->firstChild(); genChild; genChild = genChild->nextSibling()) {
if (genChild->isText())
- genChild->setStyle(pseudo);
+ genChild->setStyle(pseudoStyle);
}
+
return;
}
+ if (!currChild->isText() || currChild->isBR())
+ return;
+
// If the child does not already have style, we create it here.
- if (currChild->isText() && !currChild->isBR() && currChild->parent()->style()->styleType() != FIRST_LETTER) {
- // Our layout state is not valid for the repaints we are going to trigger by
- // adding and removing children of firstLetterContainer.
- view()->disableLayoutState();
+ RenderObject* firstLetterContainer = currChild->parent();
- RenderText* textObj = toRenderText(currChild);
-
- // Create our pseudo style now that we have our firstLetterContainer determined.
- RenderStyle* pseudoStyle = firstLetterBlock->getCachedPseudoStyle(FIRST_LETTER,
- firstLetterContainer->firstLineStyle());
-
- // Force inline display (except for floating first-letters)
- pseudoStyle->setDisplay(pseudoStyle->isFloating() ? BLOCK : INLINE);
- pseudoStyle->setPosition(StaticPosition); // CSS2 says first-letter can't be positioned.
-
- RenderObject* firstLetter = 0;
- if (pseudoStyle->display() == INLINE)
- firstLetter = new (renderArena()) RenderInline(document());
- else
- firstLetter = new (renderArena()) RenderBlock(document());
- firstLetter->setStyle(pseudoStyle);
- firstLetterContainer->addChild(firstLetter, currChild);
-
- // The original string is going to be either a generated content string or a DOM node's
- // string. We want the original string before it got transformed in case first-letter has
- // no text-transform or a different text-transform applied to it.
- RefPtr<StringImpl> oldText = textObj->originalText();
- ASSERT(oldText);
-
- if (oldText && oldText->length() > 0) {
- unsigned int length = 0;
-
- // account for leading spaces and punctuation
- while (length < oldText->length() && (isSpaceOrNewline((*oldText)[length]) || Unicode::isPunct((*oldText)[length])))
- length++;
-
- // account for first letter
+ // Our layout state is not valid for the repaints we are going to trigger by
+ // adding and removing children of firstLetterContainer.
+ view()->disableLayoutState();
+
+ RenderText* textObj = toRenderText(currChild);
+
+ // Create our pseudo style now that we have our firstLetterContainer determined.
+ RenderStyle* pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer);
+
+ RenderObject* firstLetter = 0;
+ if (pseudoStyle->display() == INLINE)
+ firstLetter = new (renderArena()) RenderInline(document());
+ else
+ firstLetter = new (renderArena()) RenderBlock(document());
+ firstLetter->setStyle(pseudoStyle);
+ firstLetterContainer->addChild(firstLetter, currChild);
+
+ // The original string is going to be either a generated content string or a DOM node's
+ // string. We want the original string before it got transformed in case first-letter has
+ // no text-transform or a different text-transform applied to it.
+ RefPtr<StringImpl> oldText = textObj->originalText();
+ ASSERT(oldText);
+
+ if (oldText && oldText->length() > 0) {
+ unsigned length = 0;
+
+ // account for leading spaces and punctuation
+ while (length < oldText->length() && (isSpaceOrNewline((*oldText)[length]) || Unicode::isPunct((*oldText)[length])))
length++;
-
- // construct text fragment for the text after the first letter
- // NOTE: this might empty
- RenderTextFragment* remainingText =
- new (renderArena()) RenderTextFragment(textObj->node() ? textObj->node() : textObj->document(), oldText.get(), length, oldText->length() - length);
- remainingText->setStyle(textObj->style());
- if (remainingText->node())
- remainingText->node()->setRenderer(remainingText);
-
- RenderObject* nextObj = textObj->nextSibling();
- firstLetterContainer->removeChild(textObj);
- firstLetterContainer->addChild(remainingText, nextObj);
- remainingText->setFirstLetter(firstLetter);
-
- // construct text fragment for the first letter
- RenderTextFragment* letter =
- new (renderArena()) RenderTextFragment(remainingText->node() ? remainingText->node() : remainingText->document(), oldText.get(), 0, length);
- letter->setStyle(pseudoStyle);
- firstLetter->addChild(letter);
- textObj->destroy();
- }
- view()->enableLayoutState();
+ // account for first letter
+ length++;
+
+ // construct text fragment for the text after the first letter
+ // NOTE: this might empty
+ RenderTextFragment* remainingText =
+ new (renderArena()) RenderTextFragment(textObj->node() ? textObj->node() : textObj->document(), oldText.get(), length, oldText->length() - length);
+ remainingText->setStyle(textObj->style());
+ if (remainingText->node())
+ remainingText->node()->setRenderer(remainingText);
+
+ RenderObject* nextObj = textObj->nextSibling();
+ firstLetterContainer->removeChild(textObj);
+ firstLetterContainer->addChild(remainingText, nextObj);
+ remainingText->setFirstLetter(firstLetter);
+
+ // construct text fragment for the first letter
+ RenderTextFragment* letter =
+ new (renderArena()) RenderTextFragment(remainingText->node() ? remainingText->node() : remainingText->document(), oldText.get(), 0, length);
+ letter->setStyle(pseudoStyle);
+ firstLetter->addChild(letter);
+
+ textObj->destroy();
}
+ view()->enableLayoutState();
}
// Helper methods for obtaining the last line, computing line counts and heights for line counts
@@ -5407,24 +5611,44 @@ void RenderBlock::clearTruncation()
void RenderBlock::setMaxTopMargins(int pos, int neg)
{
- if (!m_maxMargin) {
- if (pos == MaxMargin::topPosDefault(this) && neg == MaxMargin::topNegDefault(this))
+ if (!m_rareData) {
+ if (pos == RenderBlockRareData::topPosDefault(this) && neg == RenderBlockRareData::topNegDefault(this))
return;
- m_maxMargin = new MaxMargin(this);
+ m_rareData = new RenderBlockRareData(this);
}
- m_maxMargin->m_topPos = pos;
- m_maxMargin->m_topNeg = neg;
+ m_rareData->m_topPos = pos;
+ m_rareData->m_topNeg = neg;
}
void RenderBlock::setMaxBottomMargins(int pos, int neg)
{
- if (!m_maxMargin) {
- if (pos == MaxMargin::bottomPosDefault(this) && neg == MaxMargin::bottomNegDefault(this))
+ if (!m_rareData) {
+ if (pos == RenderBlockRareData::bottomPosDefault(this) && neg == RenderBlockRareData::bottomNegDefault(this))
+ return;
+ m_rareData = new RenderBlockRareData(this);
+ }
+ m_rareData->m_bottomPos = pos;
+ m_rareData->m_bottomNeg = neg;
+}
+
+void RenderBlock::setPaginationStrut(int strut)
+{
+ if (!m_rareData) {
+ if (!strut)
return;
- m_maxMargin = new MaxMargin(this);
+ m_rareData = new RenderBlockRareData(this);
}
- m_maxMargin->m_bottomPos = pos;
- m_maxMargin->m_bottomNeg = neg;
+ m_rareData->m_paginationStrut = strut;
+}
+
+void RenderBlock::setPageY(int y)
+{
+ if (!m_rareData) {
+ if (!y)
+ return;
+ m_rareData = new RenderBlockRareData(this);
+ }
+ m_rareData->m_pageY = y;
}
void RenderBlock::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
@@ -5685,6 +5909,119 @@ RenderBlock* RenderBlock::createAnonymousColumnSpanBlock() const
return newBox;
}
+int RenderBlock::nextPageTop(int yPos) const
+{
+ LayoutState* layoutState = view()->layoutState();
+ if (!layoutState->m_pageHeight)
+ return yPos;
+
+ // The yPos is in our coordinate space. We can add in our pushed offset.
+ int pageHeight = layoutState->m_pageHeight;
+ int remainingHeight = (pageHeight - ((layoutState->m_layoutOffset - layoutState->m_pageOffset).height() + yPos) % pageHeight) % pageHeight;
+ return yPos + remainingHeight;
+}
+
+static bool inNormalFlow(RenderBox* child)
+{
+ RenderBlock* curr = child->containingBlock();
+ RenderBlock* initialBlock = child->view();
+ while (curr && curr != initialBlock) {
+ if (curr->hasColumns())
+ return true;
+ if (curr->isFloatingOrPositioned())
+ return false;
+ curr = curr->containingBlock();
+ }
+ return true;
+}
+
+int RenderBlock::applyBeforeBreak(RenderBox* child, int yPos)
+{
+ // FIXME: Add page break checking here when we support printing.
+ bool checkColumnBreaks = view()->layoutState()->isPaginatingColumns();
+ bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->m_pageHeight; // FIXME: Once columns can print we have to check this.
+ bool checkBeforeAlways = (checkColumnBreaks && child->style()->columnBreakBefore() == PBALWAYS) || (checkPageBreaks && child->style()->pageBreakBefore() == PBALWAYS);
+ if (checkBeforeAlways && inNormalFlow(child)) {
+ if (checkColumnBreaks)
+ view()->layoutState()->addForcedColumnBreak(yPos);
+ return nextPageTop(yPos);
+ }
+ return yPos;
+}
+
+int RenderBlock::applyAfterBreak(RenderBox* child, int yPos, MarginInfo& marginInfo)
+{
+ // FIXME: Add page break checking here when we support printing.
+ bool checkColumnBreaks = view()->layoutState()->isPaginatingColumns();
+ bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->m_pageHeight; // FIXME: Once columns can print we have to check this.
+ bool checkAfterAlways = (checkColumnBreaks && child->style()->columnBreakAfter() == PBALWAYS) || (checkPageBreaks && child->style()->pageBreakAfter() == PBALWAYS);
+ if (checkAfterAlways && inNormalFlow(child)) {
+ marginInfo.setBottomQuirk(true); // Cause margins to be discarded for any following content.
+ if (checkColumnBreaks)
+ view()->layoutState()->addForcedColumnBreak(yPos);
+ return nextPageTop(yPos);
+ }
+ return yPos;
+}
+
+int RenderBlock::adjustForUnsplittableChild(RenderBox* child, int yPos, bool includeMargins)
+{
+ bool isUnsplittable = child->isReplaced() || child->scrollsOverflow();
+ if (!isUnsplittable)
+ return yPos;
+ int childHeight = child->height() + (includeMargins ? child->marginTop() + child->marginBottom() : 0);
+ LayoutState* layoutState = view()->layoutState();
+ if (layoutState->m_columnInfo)
+ layoutState->m_columnInfo->updateMinimumColumnHeight(childHeight);
+ int pageHeight = layoutState->m_pageHeight;
+ if (!pageHeight || childHeight > pageHeight)
+ return yPos;
+ int remainingHeight = (pageHeight - ((layoutState->m_layoutOffset - layoutState->m_pageOffset).height() + yPos) % pageHeight) % pageHeight;
+ if (remainingHeight < childHeight)
+ return yPos + remainingHeight;
+ return yPos;
+}
+
+void RenderBlock::adjustLinePositionForPagination(RootInlineBox* lineBox, int& delta)
+{
+ // FIXME: For now we paginate using line overflow. This ensures that lines don't overlap at all when we
+ // put a strut between them for pagination purposes. However, this really isn't the desired rendering, since
+ // the line on the top of the next page will appear too far down relative to the same kind of line at the top
+ // of the first column.
+ //
+ // The rendering we would like to see is one where the lineTop is at the top of the column, and any line overflow
+ // simply spills out above the top of the column. This effect would match what happens at the top of the first column.
+ // We can't achieve this rendering, however, until we stop columns from clipping to the column bounds (thus allowing
+ // for overflow to occur), and then cache visible overflow for each column rect.
+ //
+ // Furthermore, the paint we have to do when a column has overflow has to be special. We need to exclude
+ // content that paints in a previous column (and content that paints in the following column).
+ //
+ // FIXME: Another problem with simply moving lines is that the available line width may change (because of floats).
+ // Technically if the location we move the line to has a different line width than our old position, then we need to dirty the
+ // line and all following lines.
+ LayoutState* layoutState = view()->layoutState();
+ int pageHeight = layoutState->m_pageHeight;
+ int yPos = lineBox->topVisibleOverflow();
+ int lineHeight = lineBox->bottomVisibleOverflow() - yPos;
+ if (layoutState->m_columnInfo)
+ layoutState->m_columnInfo->updateMinimumColumnHeight(lineHeight);
+ yPos += delta;
+ lineBox->setPaginationStrut(0);
+ if (!pageHeight || lineHeight > pageHeight)
+ return;
+ int remainingHeight = pageHeight - ((layoutState->m_layoutOffset - layoutState->m_pageOffset).height() + yPos) % pageHeight;
+ if (remainingHeight < lineHeight) {
+ int totalHeight = lineHeight + max(0, yPos);
+ if (lineBox == firstRootBox() && totalHeight < pageHeight && !isPositioned() && !isTableCell())
+ setPaginationStrut(remainingHeight + max(0, yPos));
+ else {
+ delta += remainingHeight;
+ lineBox->setPaginationStrut(remainingHeight);
+ }
+ }
+}
+
const char* RenderBlock::renderName() const
{
if (isBody())
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index 6ed0d7b..b26c28c 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -34,6 +34,7 @@ namespace WebCore {
class ColumnInfo;
class InlineIterator;
+class LayoutStateMaintainer;
class RenderInline;
struct BidiRun;
@@ -70,7 +71,7 @@ public:
virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0);
virtual void removeChild(RenderObject*);
- virtual void layoutBlock(bool relayoutChildren);
+ virtual void layoutBlock(bool relayoutChildren, int pageHeight = 0);
void insertPositionedObject(RenderBox*);
void removePositionedObject(RenderBox*);
@@ -89,7 +90,15 @@ public:
void markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove = 0, bool inLayout = true);
void markPositionedObjectsForLayout();
-
+ void markForPaginationRelayout()
+ {
+ if (isTable())
+ markDescendantBlocksAndLinesForLayout();
+ else
+ setChildNeedsLayout(true, false);
+ }
+ virtual void markDescendantBlocksAndLinesForLayout(bool inLayout = true);
+
bool containsFloats() { return m_floatingObjects && !m_floatingObjects->isEmpty(); }
bool containsFloat(RenderObject*);
@@ -105,8 +114,9 @@ public:
virtual VisiblePosition positionForPoint(const IntPoint&);
// Block flows subclass availableWidth to handle multi column layout (shrinking the width available to children when laying out.)
- virtual int availableWidth() const;
-
+ virtual int availableWidth() const; // FIXME: Should be possible to remove this. See https://bugs.webkit.org/show_bug.cgi?id=46127
+ virtual int availableLogicalWidth() const;
+
RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(firstLineBox()); }
RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(lastLineBox()); }
@@ -151,6 +161,15 @@ public:
ColumnInfo* columnInfo() const;
int columnGap() const;
+
+ // These two functions take the ColumnInfo* to avoid repeated lookups of the info in the global HashMap.
+ unsigned columnCount(ColumnInfo*) const;
+ IntRect columnRectAt(ColumnInfo*, unsigned) const;
+
+ int paginationStrut() const { return m_rareData ? m_rareData->m_paginationStrut : 0; }
+ int pageY() const { return m_rareData ? m_rareData->m_pageY : 0; }
+ void setPaginationStrut(int strut);
+ void setPageY(int y);
protected:
// These functions are only used internally to manipulate the render tree structure via remove/insert/appendChildNode.
@@ -177,20 +196,22 @@ protected:
}
void moveChildrenTo(RenderBlock* to, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInsert = false);
- int maxTopPosMargin() const { return m_maxMargin ? m_maxMargin->m_topPos : MaxMargin::topPosDefault(this); }
- int maxTopNegMargin() const { return m_maxMargin ? m_maxMargin->m_topNeg : MaxMargin::topNegDefault(this); }
- int maxBottomPosMargin() const { return m_maxMargin ? m_maxMargin->m_bottomPos : MaxMargin::bottomPosDefault(this); }
- int maxBottomNegMargin() const { return m_maxMargin ? m_maxMargin->m_bottomNeg : MaxMargin::bottomNegDefault(this); }
+ int maxTopPosMargin() const { return m_rareData ? m_rareData->m_topPos : RenderBlockRareData::topPosDefault(this); }
+ int maxTopNegMargin() const { return m_rareData ? m_rareData->m_topNeg : RenderBlockRareData::topNegDefault(this); }
+ int maxBottomPosMargin() const { return m_rareData ? m_rareData->m_bottomPos : RenderBlockRareData::bottomPosDefault(this); }
+ int maxBottomNegMargin() const { return m_rareData ? m_rareData->m_bottomNeg : RenderBlockRareData::bottomNegDefault(this); }
+
void setMaxTopMargins(int pos, int neg);
void setMaxBottomMargins(int pos, int neg);
-
+
void initMaxMarginValues()
{
- if (m_maxMargin) {
- m_maxMargin->m_topPos = MaxMargin::topPosDefault(this);
- m_maxMargin->m_topNeg = MaxMargin::topNegDefault(this);
- m_maxMargin->m_bottomPos = MaxMargin::bottomPosDefault(this);
- m_maxMargin->m_bottomNeg = MaxMargin::bottomNegDefault(this);
+ if (m_rareData) {
+ m_rareData->m_topPos = RenderBlockRareData::topPosDefault(this);
+ m_rareData->m_topNeg = RenderBlockRareData::topNegDefault(this);
+ m_rareData->m_bottomPos = RenderBlockRareData::bottomPosDefault(this);
+ m_rareData->m_bottomNeg = RenderBlockRareData::bottomNegDefault(this);
+ m_rareData->m_paginationStrut = 0;
}
}
@@ -295,9 +316,42 @@ private:
bool everHadLayout;
};
+ struct FloatingObject : Noncopyable {
+ enum Type {
+ FloatLeft,
+ FloatRight
+ };
+
+ FloatingObject(Type type)
+ : m_renderer(0)
+ , m_top(0)
+ , m_bottom(0)
+ , m_left(0)
+ , m_width(0)
+ , m_paginationStrut(0)
+ , m_type(type)
+ , m_shouldPaint(true)
+ , m_isDescendant(false)
+ {
+ }
+
+ Type type() { return static_cast<Type>(m_type); }
+
+ RenderBox* m_renderer;
+ int m_top;
+ int m_bottom;
+ int m_left;
+ int m_width;
+ int m_paginationStrut;
+ unsigned m_type : 1; // Type (left or right aligned)
+ bool m_shouldPaint : 1;
+ bool m_isDescendant : 1;
+ };
+
// The following functions' implementations are in RenderBlockLineLayout.cpp.
RootInlineBox* determineStartPosition(bool& firstLine, bool& fullLayout, bool& previousLineBrokeCleanly,
- InlineBidiResolver&, Vector<FloatWithRect>& floats, unsigned& numCleanFloats);
+ InlineBidiResolver&, Vector<FloatWithRect>& floats, unsigned& numCleanFloats,
+ bool& useRepaintBounds, int& repaintTop, int& repaintBottom);
RootInlineBox* determineEndPosition(RootInlineBox* startBox, InlineIterator& cleanLineStart,
BidiStatus& cleanLineBidiStatus,
int& yPos);
@@ -305,9 +359,9 @@ private:
RootInlineBox*& endLine, int& endYPos, int& repaintBottom, int& repaintTop);
void skipTrailingWhitespace(InlineIterator&, bool isLineEmpty, bool previousLineBrokeCleanly);
- int skipLeadingWhitespace(InlineBidiResolver&, bool firstLine, bool isLineEmpty, bool previousLineBrokeCleanly);
+ int skipLeadingWhitespace(InlineBidiResolver&, bool firstLine, bool isLineEmpty, bool previousLineBrokeCleanly, FloatingObject* lastFloatFromPreviousLine);
void fitBelowFloats(int widthToFit, bool firstLine, int& availableWidth);
- InlineIterator findNextLineBreak(InlineBidiResolver&, bool firstLine, bool& isLineEmpty, bool& previousLineBrokeCleanly, bool& hyphenated, EClear* = 0);
+ InlineIterator findNextLineBreak(InlineBidiResolver&, bool firstLine, bool& isLineEmpty, bool& previousLineBrokeCleanly, bool& hyphenated, EClear*, FloatingObject* lastFloatFromPreviousLine);
RootInlineBox* constructLine(unsigned runCount, BidiRun* firstRun, BidiRun* lastRun, bool firstLine, bool lastLine, RenderObject* endObject);
InlineFlowBox* createLineBoxes(RenderObject*, bool firstLine);
void computeHorizontalPositionsForLine(RootInlineBox*, bool firstLine, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAndFallbackFontsMap&);
@@ -329,12 +383,18 @@ private:
void paintSelection(PaintInfo&, int tx, int ty);
void paintCaret(PaintInfo&, int tx, int ty, CaretType);
- void insertFloatingObject(RenderBox*);
+ FloatingObject* insertFloatingObject(RenderBox*);
void removeFloatingObject(RenderBox*);
-
+ void removeFloatingObjectsBelow(FloatingObject*, int y);
+
// Called from lineWidth, to position the floats added in the last line.
- // Returns ture if and only if it has positioned any floats.
+ // Returns true if and only if it has positioned any floats.
bool positionNewFloats();
+
+ // Positions new floats and also adjust all floats encountered on the line if any of them
+ // have to move to the next page/column.
+ bool positionNewFloatOnLine(FloatingObject* newFloat, FloatingObject* lastFloatFromPreviousLine);
+
void clearFloats();
int getClearDelta(RenderBox* child, int yPos);
@@ -416,8 +476,7 @@ private:
void offsetForContents(int& tx, int& ty) const;
void calcColumnWidth();
- int layoutColumns(int endOfContent = -1, int requestedColumnHeight = -1);
- int visibleTopOfHighestFloatExtendingBelow(int bottom, int maxHeight) const;
+ bool layoutColumns(bool hasSpecifiedPageHeight, int pageHeight, LayoutStateMaintainer&);
void makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBlock* newBlockBox, RenderObject* newChild);
bool expandsToEncloseOverhangingFloats() const;
@@ -433,36 +492,6 @@ private:
RenderBlock* continuationBefore(RenderObject* beforeChild);
RenderBlock* containingColumnsBlock(bool allowAnonymousColumnBlock = true);
RenderBlock* columnsBlockForSpanningElement(RenderObject* newChild);
-
- struct FloatingObject : Noncopyable {
- enum Type {
- FloatLeft,
- FloatRight
- };
-
- FloatingObject(Type type)
- : m_renderer(0)
- , m_top(0)
- , m_bottom(0)
- , m_left(0)
- , m_width(0)
- , m_type(type)
- , m_shouldPaint(true)
- , m_isDescendant(false)
- {
- }
-
- Type type() { return static_cast<Type>(m_type); }
-
- RenderBox* m_renderer;
- int m_top;
- int m_bottom;
- int m_left;
- int m_width;
- unsigned m_type : 1; // Type (left or right aligned)
- bool m_shouldPaint : 1;
- bool m_isDescendant : 1;
- };
class MarginInfo {
// Collapsing flags for whether we can collapse our margins with our children's margins.
@@ -539,6 +568,13 @@ private:
void setCollapsedBottomMargin(const MarginInfo&);
// End helper functions and structs used by layoutBlockChildren.
+ // Pagination routines.
+ int nextPageTop(int yPos) const; // Returns the top of the next page following yPos.
+ int applyBeforeBreak(RenderBox* child, int yPos); // If the child has a before break, then return a new yPos that shifts to the top of the next page/column.
+ int applyAfterBreak(RenderBox* child, int yPos, MarginInfo& marginInfo); // If the child has an after break, then return a new yPos that shifts to the top of the next page/column.
+ int adjustForUnsplittableChild(RenderBox* child, int yPos, bool includeMargins = false); // If the child is unsplittable and can't fit on the current page, return the top of the next page/column.
+ void adjustLinePositionForPagination(RootInlineBox*, int& deltaY); // Computes a deltaY value that put a line at the top of the next page if it doesn't fit on the current page.
+
typedef PositionedObjectsListHashSet::const_iterator Iterator;
DeprecatedPtrList<FloatingObject>* m_floatingObjects;
@@ -551,12 +587,14 @@ private:
RenderBoxModelObject* m_continuation;
// Allocated only when some of these fields have non-default values
- struct MaxMargin : Noncopyable {
- MaxMargin(const RenderBlock* o)
+ struct RenderBlockRareData : Noncopyable {
+ RenderBlockRareData(const RenderBlock* o)
: m_topPos(topPosDefault(o))
, m_topNeg(topNegDefault(o))
, m_bottomPos(bottomPosDefault(o))
, m_bottomNeg(bottomNegDefault(o))
+ , m_paginationStrut(0)
+ , m_pageY(0)
{
}
@@ -564,14 +602,16 @@ private:
static int topNegDefault(const RenderBlock* o) { return o->marginTop() < 0 ? -o->marginTop() : 0; }
static int bottomPosDefault(const RenderBlock* o) { return o->marginBottom() > 0 ? o->marginBottom() : 0; }
static int bottomNegDefault(const RenderBlock* o) { return o->marginBottom() < 0 ? -o->marginBottom() : 0; }
-
+
int m_topPos;
int m_topNeg;
int m_bottomPos;
int m_bottomNeg;
+ int m_paginationStrut;
+ int m_pageY;
};
- MaxMargin* m_maxMargin;
+ OwnPtr<RenderBlockRareData> m_rareData;
RenderObjectChildList m_children;
RenderLineBoxList m_lineBoxes; // All of the root line boxes created for this block flow. For example, <div>Hello<br>world.</div> will have two total lines for the <div>.
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index d703fb2..3cd944b 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -33,6 +33,7 @@
#include "RenderLayer.h"
#include "RenderListMarker.h"
#include "RenderView.h"
+#include "Settings.h"
#include "TrailingFloatsRootInlineBox.h"
#include "break_lines.h"
#include <wtf/AlwaysInline.h>
@@ -48,6 +49,7 @@
#endif // ANDROID_LAYOUT
#if ENABLE(SVG)
+#include "RenderSVGInlineText.h"
#include "SVGRootInlineBox.h"
#endif
@@ -597,6 +599,9 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
Vector<FloatWithRect> floats;
bool hasInlineChild = false;
while (o) {
+ if (!hasInlineChild && o->isInline())
+ hasInlineChild = true;
+
if (o->isReplaced() || o->isFloating() || o->isPositioned()) {
RenderBox* box = toRenderBox(o);
@@ -609,6 +614,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
if (o->isPositioned())
o->containingBlock()->insertPositionedObject(box);
+<<<<<<< HEAD
else {
#ifdef ANDROID_LAYOUT
// ignore text wrap for textField or menuList
@@ -629,6 +635,13 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
// the document is the DOM node associated with this RenderObject.
RefPtr<Node> protector(o->isAnonymous() ? o->document() : o->node());
#endif
+=======
+ else if (o->isFloating())
+ floats.append(FloatWithRect(box));
+ else if (fullLayout || o->needsLayout()) {
+ // Replaced elements
+ toRenderBox(o)->dirtyLineBoxes(fullLayout);
+>>>>>>> webkit.org at r67908
o->layoutIfNeeded();
#if defined(ANDROID_FLATTEN_IFRAME) || defined(ANDROID_FLATTEN_FRAMESET)
// Ensure that the renderer still exists. If it's gone away we will crash pretty
@@ -639,7 +652,6 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
#endif
}
} else if (o->isText() || (o->isRenderInline() && !endOfInline)) {
- hasInlineChild = true;
if (fullLayout || o->selfNeedsLayout())
dirtyLineBoxesForRenderer(o, fullLayout);
o->setNeedsLayout(false);
@@ -717,7 +729,8 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
unsigned floatIndex;
bool firstLine = true;
bool previousLineBrokeCleanly = true;
- RootInlineBox* startLine = determineStartPosition(firstLine, fullLayout, previousLineBrokeCleanly, resolver, floats, floatIndex);
+ RootInlineBox* startLine = determineStartPosition(firstLine, fullLayout, previousLineBrokeCleanly, resolver, floats, floatIndex,
+ useRepaintBounds, repaintTop, repaintBottom);
if (fullLayout && hasInlineChild && !selfNeedsLayout()) {
setNeedsLayout(true, false); // Mark ourselves as needing a full layout. This way we'll repaint like
@@ -745,9 +758,11 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
0 : determineEndPosition(startLine, cleanLineStart, cleanLineBidiStatus, endLineYPos);
if (startLine) {
- useRepaintBounds = true;
- repaintTop = height();
- repaintBottom = height();
+ if (!useRepaintBounds) {
+ useRepaintBounds = true;
+ repaintTop = height();
+ repaintBottom = height();
+ }
RenderArena* arena = renderArena();
RootInlineBox* box = startLine;
while (box) {
@@ -782,6 +797,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
bool checkForFloatsFromLastLine = false;
bool isLineEmpty = true;
+ bool paginated = view()->layoutState() && view()->layoutState()->isPaginated();
while (!end.atEnd()) {
// FIXME: Is this check necessary before the first iteration or can it be moved to the end?
@@ -794,7 +810,10 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
EClear clear = CNONE;
bool hyphenated;
- end = findNextLineBreak(resolver, firstLine, isLineEmpty, previousLineBrokeCleanly, hyphenated, &clear);
+
+ InlineIterator oldEnd = end;
+ FloatingObject* lastFloatFromPreviousLine = m_floatingObjects ? m_floatingObjects->last() : 0;
+ end = findNextLineBreak(resolver, firstLine, isLineEmpty, previousLineBrokeCleanly, hyphenated, &clear, lastFloatFromPreviousLine);
if (resolver.position().atEnd()) {
resolver.deleteRuns();
checkForFloatsFromLastLine = true;
@@ -859,6 +878,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
// inline flow boxes.
RootInlineBox* lineBox = 0;
+ int oldHeight = height();
if (resolver.runCount()) {
if (hyphenated)
resolver.logicallyLastRun()->m_hasHyphen = true;
@@ -909,6 +929,29 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
repaintTop = min(repaintTop, lineBox->topVisibleOverflow());
repaintBottom = max(repaintBottom, lineBox->bottomVisibleOverflow());
}
+
+ if (paginated) {
+ int adjustment = 0;
+ adjustLinePositionForPagination(lineBox, adjustment);
+ if (adjustment) {
+ int oldLineWidth = lineWidth(oldHeight, firstLine);
+ lineBox->adjustPosition(0, adjustment);
+ if (useRepaintBounds) // This can only be a positive adjustment, so no need to update repaintTop.
+ repaintBottom = max(repaintBottom, lineBox->bottomVisibleOverflow());
+
+ if (lineWidth(oldHeight + adjustment, firstLine) != oldLineWidth) {
+ // We have to delete this line, remove all floats that got added, and let line layout re-run.
+ lineBox->deleteLine(renderArena());
+ removeFloatingObjectsBelow(lastFloatFromPreviousLine, oldHeight);
+ setHeight(oldHeight + adjustment);
+ resolver.setPosition(oldEnd);
+ end = oldEnd;
+ continue;
+ }
+
+ setHeight(lineBox->blockHeight());
+ }
+ }
}
firstLine = false;
@@ -943,6 +986,10 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
int delta = height() - endLineYPos;
for (RootInlineBox* line = endLine; line; line = line->nextRootBox()) {
line->attachLine();
+ if (paginated) {
+ delta -= line->paginationStrut();
+ adjustLinePositionForPagination(line, delta);
+ }
if (delta) {
repaintTop = min(repaintTop, line->topVisibleOverflow() + min(delta, 0));
repaintBottom = max(repaintBottom, line->bottomVisibleOverflow() + max(delta, 0));
@@ -1023,20 +1070,44 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
}
RootInlineBox* RenderBlock::determineStartPosition(bool& firstLine, bool& fullLayout, bool& previousLineBrokeCleanly,
- InlineBidiResolver& resolver, Vector<FloatWithRect>& floats, unsigned& numCleanFloats)
+ InlineBidiResolver& resolver, Vector<FloatWithRect>& floats, unsigned& numCleanFloats,
+ bool& useRepaintBounds, int& repaintTop, int& repaintBottom)
{
RootInlineBox* curr = 0;
RootInlineBox* last = 0;
bool dirtiedByFloat = false;
if (!fullLayout) {
+ // Paginate all of the clean lines.
+ bool paginated = view()->layoutState() && view()->layoutState()->isPaginated();
+ int paginationDelta = 0;
size_t floatIndex = 0;
for (curr = firstRootBox(); curr && !curr->isDirty(); curr = curr->nextRootBox()) {
+ if (paginated) {
+ paginationDelta -= curr->paginationStrut();
+ adjustLinePositionForPagination(curr, paginationDelta);
+ if (paginationDelta) {
+ if (containsFloats() || !floats.isEmpty()) {
+ // FIXME: Do better eventually. For now if we ever shift because of pagination and floats are present just go to a full layout.
+ fullLayout = true;
+ break;
+ }
+
+ if (!useRepaintBounds)
+ useRepaintBounds = true;
+
+ repaintTop = min(repaintTop, curr->topVisibleOverflow() + min(paginationDelta, 0));
+ repaintBottom = max(repaintBottom, curr->bottomVisibleOverflow() + max(paginationDelta, 0));
+ curr->adjustPosition(0, paginationDelta);
+ }
+ }
+
if (Vector<RenderBox*>* cleanLineFloats = curr->floatsPtr()) {
Vector<RenderBox*>::iterator end = cleanLineFloats->end();
for (Vector<RenderBox*>::iterator o = cleanLineFloats->begin(); o != end; ++o) {
RenderBox* f = *o;
- IntSize newSize(f->width() + f->marginLeft() +f->marginRight(), f->height() + f->marginTop() + f->marginBottom());
+ f->layoutIfNeeded();
+ IntSize newSize(f->width() + f->marginLeft() + f->marginRight(), f->height() + f->marginTop() + f->marginBottom());
ASSERT(floatIndex < floats.size());
if (floats[floatIndex].object != f) {
// A new float has been inserted before this line or before its last known float.
@@ -1359,14 +1430,14 @@ void RenderBlock::skipTrailingWhitespace(InlineIterator& iterator, bool isLineEm
}
}
-int RenderBlock::skipLeadingWhitespace(InlineBidiResolver& resolver, bool firstLine, bool isLineEmpty, bool previousLineBrokeCleanly)
+int RenderBlock::skipLeadingWhitespace(InlineBidiResolver& resolver, bool firstLine, bool isLineEmpty, bool previousLineBrokeCleanly,
+ FloatingObject* lastFloatFromPreviousLine)
{
int availableWidth = lineWidth(height(), firstLine);
while (!resolver.position().atEnd() && !requiresLineBox(resolver.position(), isLineEmpty, previousLineBrokeCleanly)) {
RenderObject* object = resolver.position().obj;
if (object->isFloating()) {
- insertFloatingObject(toRenderBox(object));
- positionNewFloats();
+ positionNewFloatOnLine(insertFloatingObject(toRenderBox(object)), lastFloatFromPreviousLine);
availableWidth = lineWidth(height(), firstLine);
} else if (object->isPositioned()) {
// FIXME: The math here is actually not really right. It's a best-guess approximation that
@@ -1450,7 +1521,13 @@ static void tryHyphenating(RenderText* text, const Font& font, const AtomicStrin
const AtomicString& hyphenString = text->style()->hyphenString();
int hyphenWidth = font.width(TextRun(hyphenString.characters(), hyphenString.length()));
- unsigned prefixLength = font.offsetForPosition(TextRun(text->characters() + lastSpace, pos - lastSpace, !collapseWhiteSpace, xPos + lastSpaceWordSpacing), availableWidth - xPos - hyphenWidth - lastSpaceWordSpacing, false);
+ int maxPrefixWidth = availableWidth - xPos - hyphenWidth - lastSpaceWordSpacing;
+ // If the maximum width available for the prefix before the hyphen is small, then it is very unlikely
+ // that an hyphenation opportunity exists, so do not bother to look for it.
+ if (maxPrefixWidth <= font.pixelSize() * 5 / 4)
+ return;
+
+ unsigned prefixLength = font.offsetForPosition(TextRun(text->characters() + lastSpace, pos - lastSpace, !collapseWhiteSpace, xPos + lastSpaceWordSpacing), maxPrefixWidth, false);
if (!prefixLength)
return;
@@ -1472,14 +1549,14 @@ static void tryHyphenating(RenderText* text, const Font& font, const AtomicStrin
}
InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool firstLine, bool& isLineEmpty, bool& previousLineBrokeCleanly,
- bool& hyphenated, EClear* clear)
+ bool& hyphenated, EClear* clear, FloatingObject* lastFloatFromPreviousLine)
{
ASSERT(resolver.position().block == this);
bool appliedStartWidth = resolver.position().pos > 0;
LineMidpointState& lineMidpointState = resolver.midpointState();
- int width = skipLeadingWhitespace(resolver, firstLine, isLineEmpty, previousLineBrokeCleanly);
+ int width = skipLeadingWhitespace(resolver, firstLine, isLineEmpty, previousLineBrokeCleanly, lastFloatFromPreviousLine);
int w = 0;
int tmpW = 0;
@@ -1564,12 +1641,12 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
// add to special objects...
if (o->isFloating()) {
RenderBox* floatBox = toRenderBox(o);
- insertFloatingObject(floatBox);
+ FloatingObject* f = insertFloatingObject(floatBox);
// check if it fits in the current line.
// If it does, position it now, otherwise, position
// it after moving to next line (in newLine() func)
if (floatsFitOnLine && floatBox->width() + floatBox->marginLeft() + floatBox->marginRight() + w + tmpW <= width) {
- positionNewFloats();
+ positionNewFloatOnLine(f, lastFloatFromPreviousLine);
width = lineWidth(height(), firstLine);
} else
floatsFitOnLine = false;
@@ -1681,6 +1758,10 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
RenderText* t = toRenderText(o);
+#if ENABLE(SVG)
+ bool isSVGText = t->isSVGInlineText();
+#endif
+
int strlen = t->textLength();
int len = strlen - pos;
const UChar* str = t->characters();
@@ -1765,7 +1846,19 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
}
continue;
}
-
+
+#if ENABLE(SVG)
+ if (isSVGText) {
+ RenderSVGInlineText* svgInlineText = static_cast<RenderSVGInlineText*>(t);
+ if (pos > 0) {
+ if (svgInlineText->characterStartsNewTextChunk(pos)) {
+ addMidpoint(lineMidpointState, InlineIterator(0, o, pos - 1));
+ addMidpoint(lineMidpointState, InlineIterator(0, o, pos));
+ }
+ }
+ }
+#endif
+
bool applyWordSpacing = false;
currentCharacterIsWS = currentCharacterIsSpace || (breakNBSP && c == noBreakSpace);
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index e107c4f..33772a3 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -980,7 +980,7 @@ void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool
if (RenderView* v = view()) {
if (v->layoutStateEnabled() && !repaintContainer) {
LayoutState* layoutState = v->layoutState();
- IntSize offset = layoutState->m_offset;
+ IntSize offset = layoutState->m_paintOffset;
offset.expand(x(), y());
if (style()->position() == RelativePosition && layer())
offset += layer()->relativePositionOffset();
@@ -1177,7 +1177,7 @@ void RenderBox::computeRectForRepaint(RenderBoxModelObject* repaintContainer, In
rect.move(layer()->relativePositionOffset());
rect.move(x(), y());
- rect.move(layoutState->m_offset);
+ rect.move(layoutState->m_paintOffset);
if (layoutState->m_clipped)
rect.intersect(layoutState->m_clipRect);
return;
@@ -1584,11 +1584,11 @@ void RenderBox::calcHeight()
// is specified. When we're printing, we also need this quirk if the body or root has a percentage
// height since we don't set a height in RenderView when we're printing. So without this quirk, the
// height has nothing to be a percentage of, and it ends up being 0. That is bad.
- bool paginatedContentNeedsBaseHeight = document()->paginated() && h.isPercent()
+ bool paginatedContentNeedsBaseHeight = document()->printing() && h.isPercent()
&& (isRoot() || (isBody() && document()->documentElement()->renderer()->style()->height().isPercent()));
if (stretchesToViewHeight() || paginatedContentNeedsBaseHeight) {
int margins = collapsedMarginTop() + collapsedMarginBottom();
- int visHeight = document()->printing() ? view()->frameView()->pageHeight() : view()->viewHeight();
+ int visHeight = document()->printing() ? view()->pageHeight() : view()->viewHeight();
if (isRoot())
setHeight(max(height(), visHeight - margins));
else {
@@ -1803,6 +1803,13 @@ int RenderBox::availableHeightUsing(const Length& h) const
return containingBlock()->availableHeight();
}
+int RenderBox::availableLogicalWidth() const
+{
+ if (style()->isVerticalBlockFlow())
+ return contentWidth();
+ return contentHeight();
+}
+
void RenderBox::calcVerticalMargins()
{
if (isTableCell()) {
@@ -2984,4 +2991,19 @@ void RenderBox::clearLayoutOverflow()
m_overflow->resetLayoutOverflow(borderBoxRect());
}
+void RenderBox::markDescendantBlocksAndLinesForLayout(bool inLayout)
+{
+ if (!m_everHadLayout || isReplaced())
+ return;
+
+ setChildNeedsLayout(true, !inLayout);
+
+ // Iterate over our children and mark them as needed.
+ for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
+ if (child->isFloatingOrPositioned())
+ continue;
+ child->markDescendantBlocksAndLinesForLayout(inLayout);
+ }
+}
+
} // namespace WebCore
diff --git a/WebCore/rendering/RenderBox.h b/WebCore/rendering/RenderBox.h
index 8f1e9c3..dc1eb96 100644
--- a/WebCore/rendering/RenderBox.h
+++ b/WebCore/rendering/RenderBox.h
@@ -238,9 +238,10 @@ public:
int calcPercentageHeight(const Length& height);
// Block flows subclass availableWidth to handle multi column layout (shrinking the width available to children when laying out.)
- virtual int availableWidth() const { return contentWidth(); }
+ virtual int availableWidth() const { return contentWidth(); } // FIXME: Investigate removing eventually. https://bugs.webkit.org/show_bug.cgi?id=46127
virtual int availableHeight() const;
int availableHeightUsing(const Length&) const;
+ virtual int availableLogicalWidth() const;
void calcVerticalMargins();
@@ -297,10 +298,15 @@ public:
bool shrinkToAvoidFloats() const;
virtual bool avoidsFloats() const;
+<<<<<<< HEAD
#ifdef ANDROID_LAYOUT
int getVisibleWidth() const { return m_visibleWidth; }
#endif
+=======
+ virtual void markDescendantBlocksAndLinesForLayout(bool inLayout = true);
+
+>>>>>>> webkit.org at r67908
protected:
virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index 0fbc9f2..f4c2d2a 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -432,7 +432,7 @@ int RenderBoxModelObject::paddingTop(bool) const
int w = 0;
Length padding = style()->paddingTop();
if (padding.isPercent())
- w = containingBlock()->availableWidth();
+ w = containingBlock()->availableLogicalWidth();
return padding.calcMinValue(w);
}
@@ -441,7 +441,7 @@ int RenderBoxModelObject::paddingBottom(bool) const
int w = 0;
Length padding = style()->paddingBottom();
if (padding.isPercent())
- w = containingBlock()->availableWidth();
+ w = containingBlock()->availableLogicalWidth();
return padding.calcMinValue(w);
}
@@ -450,7 +450,7 @@ int RenderBoxModelObject::paddingLeft(bool) const
int w = 0;
Length padding = style()->paddingLeft();
if (padding.isPercent())
- w = containingBlock()->availableWidth();
+ w = containingBlock()->availableLogicalWidth();
return padding.calcMinValue(w);
}
@@ -459,7 +459,43 @@ int RenderBoxModelObject::paddingRight(bool) const
int w = 0;
Length padding = style()->paddingRight();
if (padding.isPercent())
- w = containingBlock()->availableWidth();
+ w = containingBlock()->availableLogicalWidth();
+ return padding.calcMinValue(w);
+}
+
+int RenderBoxModelObject::paddingBefore(bool) const
+{
+ int w = 0;
+ Length padding = style()->paddingBefore();
+ if (padding.isPercent())
+ w = containingBlock()->availableLogicalWidth();
+ return padding.calcMinValue(w);
+}
+
+int RenderBoxModelObject::paddingAfter(bool) const
+{
+ int w = 0;
+ Length padding = style()->paddingAfter();
+ if (padding.isPercent())
+ w = containingBlock()->availableLogicalWidth();
+ return padding.calcMinValue(w);
+}
+
+int RenderBoxModelObject::paddingStart(bool) const
+{
+ int w = 0;
+ Length padding = style()->paddingStart();
+ if (padding.isPercent())
+ w = containingBlock()->availableLogicalWidth();
+ return padding.calcMinValue(w);
+}
+
+int RenderBoxModelObject::paddingEnd(bool) const
+{
+ int w = 0;
+ Length padding = style()->paddingEnd();
+ if (padding.isPercent())
+ w = containingBlock()->availableLogicalWidth();
return padding.calcMinValue(w);
}
diff --git a/WebCore/rendering/RenderBoxModelObject.h b/WebCore/rendering/RenderBoxModelObject.h
index 49d5f3d..e91e799 100644
--- a/WebCore/rendering/RenderBoxModelObject.h
+++ b/WebCore/rendering/RenderBoxModelObject.h
@@ -70,6 +70,10 @@ public:
virtual int paddingBottom(bool includeIntrinsicPadding = true) const;
virtual int paddingLeft(bool includeIntrinsicPadding = true) const;
virtual int paddingRight(bool includeIntrinsicPadding = true) const;
+ virtual int paddingBefore(bool includeIntrinsicPadding = true) const;
+ virtual int paddingAfter(bool includeIntrinsicPadding = true) const;
+ virtual int paddingStart(bool includeIntrinsicPadding = true) const;
+ virtual int paddingEnd(bool includeIntrinsicPadding = true) const;
virtual int borderTop() const { return style()->borderTopWidth(); }
virtual int borderBottom() const { return style()->borderBottomWidth(); }
diff --git a/WebCore/rendering/RenderEmbeddedObject.cpp b/WebCore/rendering/RenderEmbeddedObject.cpp
index d08174d..4179af3 100644
--- a/WebCore/rendering/RenderEmbeddedObject.cpp
+++ b/WebCore/rendering/RenderEmbeddedObject.cpp
@@ -79,6 +79,10 @@ RenderEmbeddedObject::RenderEmbeddedObject(Element* element)
, m_mouseDownWasInMissingPluginIndicator(false)
{
view()->frameView()->setIsVisuallyNonEmpty();
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+ if (element->hasTagName(videoTag) || element->hasTagName(audioTag))
+ setHasIntrinsicSize();
+#endif
}
RenderEmbeddedObject::~RenderEmbeddedObject()
@@ -141,7 +145,7 @@ void RenderEmbeddedObject::paint(PaintInfo& paintInfo, int tx, int ty)
void RenderEmbeddedObject::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
{
- if (pluginCrashedOrWasMissing())
+ if (!pluginCrashedOrWasMissing())
return;
if (paintInfo.phase == PaintPhaseSelection)
diff --git a/WebCore/rendering/RenderFileUploadControl.cpp b/WebCore/rendering/RenderFileUploadControl.cpp
index f31ca20..20ebe4d 100644
--- a/WebCore/rendering/RenderFileUploadControl.cpp
+++ b/WebCore/rendering/RenderFileUploadControl.cpp
@@ -142,11 +142,11 @@ Chrome* RenderFileUploadControl::chrome() const
void RenderFileUploadControl::updateFromElement()
{
HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(node());
- ASSERT(inputElement->inputType() == HTMLInputElement::FILE);
+ ASSERT(inputElement->isFileUpload());
if (!m_button) {
m_button = ShadowInputElement::create(inputElement);
- m_button->setInputType("button");
+ m_button->setType("button");
m_button->setValue(fileButtonChooseFileLabel());
RefPtr<RenderStyle> buttonStyle = createButtonStyle(style());
RenderObject* renderer = m_button->createRenderer(renderArena(), buttonStyle.get());
diff --git a/WebCore/rendering/RenderFlexibleBox.cpp b/WebCore/rendering/RenderFlexibleBox.cpp
index 695bd31..659df8d 100644
--- a/WebCore/rendering/RenderFlexibleBox.cpp
+++ b/WebCore/rendering/RenderFlexibleBox.cpp
@@ -206,7 +206,7 @@ void RenderFlexibleBox::calcPrefWidths()
setPrefWidthsDirty(false);
}
-void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
+void RenderFlexibleBox::layoutBlock(bool relayoutChildren, int /*pageHeight FIXME: Implement */)
{
ASSERT(needsLayout());
@@ -286,6 +286,9 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
statePusher.pop();
+ if (view()->layoutState()->m_pageHeight)
+ setPageY(view()->layoutState()->pageY(y()));
+
// Update our scrollbars if we're overflow:auto/scroll/hidden now that we know if
// we overflow or not.
if (hasOverflowClip())
@@ -339,6 +342,8 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
bool haveFlex = false;
gatherFlexChildrenInfo(iterator, relayoutChildren, highestFlexGroup, lowestFlexGroup, haveFlex);
+ bool paginated = view()->layoutState()->isPaginated();
+
RenderBox* child;
RenderBlock::startDelayUpdateScrollInfo();
@@ -369,6 +374,12 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
// Compute the child's vertical margins.
child->calcVerticalMargins();
+ if (!child->needsLayout() && paginated && view()->layoutState()->m_pageHeight) {
+ RenderBlock* childRenderBlock = child->isRenderBlock() ? toRenderBlock(child) : 0;
+ if (childRenderBlock && view()->layoutState()->pageY(child->y()) != childRenderBlock->pageY())
+ childRenderBlock->markForPaginationRelayout();
+ }
+
// Now do the layout.
child->layoutIfNeeded();
@@ -436,6 +447,13 @@ void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
child->calcHeight();
if (oldChildHeight != child->height())
child->setChildNeedsLayout(true, false);
+
+ if (!child->needsLayout() && paginated && view()->layoutState()->m_pageHeight) {
+ RenderBlock* childRenderBlock = child->isRenderBlock() ? toRenderBlock(child) : 0;
+ if (childRenderBlock && view()->layoutState()->pageY(child->y()) != childRenderBlock->pageY())
+ childRenderBlock->markForPaginationRelayout();
+ }
+
child->layoutIfNeeded();
// We can place the child now, using our value of box-align.
@@ -649,112 +667,15 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
bool haveFlex = false;
gatherFlexChildrenInfo(iterator, relayoutChildren, highestFlexGroup, lowestFlexGroup, haveFlex);
+ bool paginated = view()->layoutState()->isPaginated();
+
RenderBox* child;
// We confine the line clamp ugliness to vertical flexible boxes (thus keeping it out of
// mainstream block layout); this is not really part of the XUL box model.
bool haveLineClamp = !style()->lineClamp().isNone();
- if (haveLineClamp) {
- int maxLineCount = 0;
- child = iterator.first();
- while (child) {
- if (!child->isPositioned()) {
- if (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent())) ||
- (child->style()->height().isAuto() && child->isBlockFlow() && !child->needsLayout())) {
- child->setChildNeedsLayout(true, false);
-
- // Dirty all the positioned objects.
- if (child->isRenderBlock()) {
- toRenderBlock(child)->markPositionedObjectsForLayout();
- toRenderBlock(child)->clearTruncation();
- }
- }
- child->layoutIfNeeded();
- if (child->style()->height().isAuto() && child->isBlockFlow())
- maxLineCount = max(maxLineCount, toRenderBlock(child)->lineCount());
- }
- child = iterator.next();
- }
-
- // Get the # of lines and then alter all block flow children with auto height to use the
- // specified height. We always try to leave room for at least one line.
- LineClampValue lineClamp = style()->lineClamp();
- int numVisibleLines = lineClamp.isPercentage() ? max(1, (maxLineCount + 1) * lineClamp.value() / 100) : lineClamp.value();
- if (numVisibleLines < maxLineCount) {
- for (child = iterator.first(); child; child = iterator.next()) {
- if (child->isPositioned() || !child->style()->height().isAuto() || !child->isBlockFlow())
- continue;
-
- RenderBlock* blockChild = toRenderBlock(child);
- int lineCount = blockChild->lineCount();
- if (lineCount <= numVisibleLines)
- continue;
-
- int newHeight = blockChild->heightForLineCount(numVisibleLines);
- if (newHeight == child->height())
- continue;
-
- child->setChildNeedsLayout(true, false);
- child->setOverrideSize(newHeight);
- m_flexingChildren = true;
- child->layoutIfNeeded();
- m_flexingChildren = false;
- child->setOverrideSize(-1);
-
- // FIXME: For now don't support RTL.
- if (style()->direction() != LTR)
- continue;
-
- // Get the last line
- RootInlineBox* lastLine = blockChild->lineAtIndex(lineCount-1);
- if (!lastLine)
- continue;
-
- RootInlineBox* lastVisibleLine = blockChild->lineAtIndex(numVisibleLines-1);
- if (!lastVisibleLine)
- continue;
-
- const UChar ellipsisAndSpace[2] = { horizontalEllipsis, ' ' };
- DEFINE_STATIC_LOCAL(AtomicString, ellipsisAndSpaceStr, (ellipsisAndSpace, 2));
- DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1));
- const Font& font = style(numVisibleLines == 1)->font();
-
- // Get ellipsis width, and if the last child is an anchor, it will go after the ellipsis, so add in a space and the anchor width too
- int totalWidth;
- InlineBox* anchorBox = lastLine->lastChild();
- if (anchorBox && anchorBox->renderer()->node() && anchorBox->renderer()->node()->isLink())
- totalWidth = anchorBox->width() + font.width(TextRun(ellipsisAndSpace, 2));
- else {
- anchorBox = 0;
- totalWidth = font.width(TextRun(&horizontalEllipsis, 1));
- }
-
- // See if this width can be accommodated on the last visible line
- RenderBlock* destBlock = toRenderBlock(lastVisibleLine->renderer());
- RenderBlock* srcBlock = toRenderBlock(lastLine->renderer());
-
- // FIXME: Directions of src/destBlock could be different from our direction and from one another.
- if (srcBlock->style()->direction() != LTR)
- continue;
- if (destBlock->style()->direction() != LTR)
- continue;
- int ltr = true;
-
- int blockRightEdge = destBlock->rightOffset(lastVisibleLine->y(), false);
- int blockLeftEdge = destBlock->leftOffset(lastVisibleLine->y(), false);
-
- int blockEdge = ltr ? blockRightEdge : blockLeftEdge;
- if (!lastVisibleLine->canAccommodateEllipsis(ltr, blockEdge,
- lastVisibleLine->x() + lastVisibleLine->width(),
- totalWidth))
- continue;
-
- // Let the truncation code kick in.
- lastVisibleLine->placeEllipsis(anchorBox ? ellipsisAndSpaceStr : ellipsisStr, ltr, blockLeftEdge, blockRightEdge, totalWidth, anchorBox);
- destBlock->setHasMarkupTruncation(true);
- }
- }
- }
+ if (haveLineClamp)
+ applyLineClamp(iterator, relayoutChildren);
RenderBlock::startDelayUpdateScrollInfo();
@@ -797,6 +718,12 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
// Add in the child's marginTop to our height.
setHeight(height() + child->marginTop());
+ if (!child->needsLayout() && paginated && view()->layoutState()->m_pageHeight) {
+ RenderBlock* childRenderBlock = child->isRenderBlock() ? toRenderBlock(child) : 0;
+ if (childRenderBlock && view()->layoutState()->pageY(child->y()) != childRenderBlock->pageY())
+ childRenderBlock->markForPaginationRelayout();
+ }
+
// Now do a layout.
child->layoutIfNeeded();
@@ -1004,6 +931,109 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
setHeight(oldHeight);
}
+void RenderFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool relayoutChildren)
+{
+ int maxLineCount = 0;
+ RenderBox* child = iterator.first();
+ while (child) {
+ if (!child->isPositioned()) {
+ if (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent())) ||
+ (child->style()->height().isAuto() && child->isBlockFlow() && !child->needsLayout())) {
+ child->setChildNeedsLayout(true, false);
+
+ // Dirty all the positioned objects.
+ if (child->isRenderBlock()) {
+ toRenderBlock(child)->markPositionedObjectsForLayout();
+ toRenderBlock(child)->clearTruncation();
+ }
+ }
+ child->layoutIfNeeded();
+ if (child->style()->height().isAuto() && child->isBlockFlow())
+ maxLineCount = max(maxLineCount, toRenderBlock(child)->lineCount());
+ }
+ child = iterator.next();
+ }
+
+ // Get the # of lines and then alter all block flow children with auto height to use the
+ // specified height. We always try to leave room for at least one line.
+ LineClampValue lineClamp = style()->lineClamp();
+ int numVisibleLines = lineClamp.isPercentage() ? max(1, (maxLineCount + 1) * lineClamp.value() / 100) : lineClamp.value();
+ if (numVisibleLines < maxLineCount) {
+ for (child = iterator.first(); child; child = iterator.next()) {
+ if (child->isPositioned() || !child->style()->height().isAuto() || !child->isBlockFlow())
+ continue;
+
+ RenderBlock* blockChild = toRenderBlock(child);
+ int lineCount = blockChild->lineCount();
+ if (lineCount <= numVisibleLines)
+ continue;
+
+ int newHeight = blockChild->heightForLineCount(numVisibleLines);
+ if (newHeight == child->height())
+ continue;
+
+ child->setChildNeedsLayout(true, false);
+ child->setOverrideSize(newHeight);
+ m_flexingChildren = true;
+ child->layoutIfNeeded();
+ m_flexingChildren = false;
+ child->setOverrideSize(-1);
+
+ // FIXME: For now don't support RTL.
+ if (style()->direction() != LTR)
+ continue;
+
+ // Get the last line
+ RootInlineBox* lastLine = blockChild->lineAtIndex(lineCount-1);
+ if (!lastLine)
+ continue;
+
+ RootInlineBox* lastVisibleLine = blockChild->lineAtIndex(numVisibleLines-1);
+ if (!lastVisibleLine)
+ continue;
+
+ const UChar ellipsisAndSpace[2] = { horizontalEllipsis, ' ' };
+ DEFINE_STATIC_LOCAL(AtomicString, ellipsisAndSpaceStr, (ellipsisAndSpace, 2));
+ DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1));
+ const Font& font = style(numVisibleLines == 1)->font();
+
+ // Get ellipsis width, and if the last child is an anchor, it will go after the ellipsis, so add in a space and the anchor width too
+ int totalWidth;
+ InlineBox* anchorBox = lastLine->lastChild();
+ if (anchorBox && anchorBox->renderer()->node() && anchorBox->renderer()->node()->isLink())
+ totalWidth = anchorBox->width() + font.width(TextRun(ellipsisAndSpace, 2));
+ else {
+ anchorBox = 0;
+ totalWidth = font.width(TextRun(&horizontalEllipsis, 1));
+ }
+
+ // See if this width can be accommodated on the last visible line
+ RenderBlock* destBlock = toRenderBlock(lastVisibleLine->renderer());
+ RenderBlock* srcBlock = toRenderBlock(lastLine->renderer());
+
+ // FIXME: Directions of src/destBlock could be different from our direction and from one another.
+ if (srcBlock->style()->direction() != LTR)
+ continue;
+ if (destBlock->style()->direction() != LTR)
+ continue;
+ int ltr = true;
+
+ int blockRightEdge = destBlock->rightOffset(lastVisibleLine->y(), false);
+ int blockLeftEdge = destBlock->leftOffset(lastVisibleLine->y(), false);
+
+ int blockEdge = ltr ? blockRightEdge : blockLeftEdge;
+ if (!lastVisibleLine->canAccommodateEllipsis(ltr, blockEdge,
+ lastVisibleLine->x() + lastVisibleLine->width(),
+ totalWidth))
+ continue;
+
+ // Let the truncation code kick in.
+ lastVisibleLine->placeEllipsis(anchorBox ? ellipsisAndSpaceStr : ellipsisStr, ltr, blockLeftEdge, blockRightEdge, totalWidth, anchorBox);
+ destBlock->setHasMarkupTruncation(true);
+ }
+ }
+}
+
void RenderFlexibleBox::placeChild(RenderBox* child, int x, int y)
{
IntRect oldRect(child->x(), child->y() , child->width(), child->height());
diff --git a/WebCore/rendering/RenderFlexibleBox.h b/WebCore/rendering/RenderFlexibleBox.h
index a0f84ce..2aa20b5 100644
--- a/WebCore/rendering/RenderFlexibleBox.h
+++ b/WebCore/rendering/RenderFlexibleBox.h
@@ -27,6 +27,8 @@
namespace WebCore {
+class FlexBoxIterator;
+
class RenderFlexibleBox : public RenderBlock {
public:
RenderFlexibleBox(Node*);
@@ -38,7 +40,7 @@ public:
void calcHorizontalPrefWidths();
void calcVerticalPrefWidths();
- virtual void layoutBlock(bool relayoutChildren);
+ virtual void layoutBlock(bool relayoutChildren, int pageHeight);
void layoutHorizontalBox(bool relayoutChildren);
void layoutVerticalBox(bool relayoutChildren);
@@ -59,6 +61,9 @@ protected:
bool m_flexingChildren : 1;
bool m_stretchingChildren : 1;
+
+private:
+ void applyLineClamp(FlexBoxIterator&, bool relayoutChildren);
};
} // namespace WebCore
diff --git a/WebCore/rendering/RenderImage.cpp b/WebCore/rendering/RenderImage.cpp
index 316b1cf..d5d52f6 100644
--- a/WebCore/rendering/RenderImage.cpp
+++ b/WebCore/rendering/RenderImage.cpp
@@ -218,9 +218,6 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
int leftPad = paddingLeft();
int topPad = paddingTop();
- if (document()->printing() && !view()->printImages())
- return;
-
GraphicsContext* context = paintInfo.context;
if (!m_imageResource->hasImage() || m_imageResource->errorOccurred()) {
@@ -523,7 +520,7 @@ int RenderImage::calcAspectRatioWidth() const
return 0;
if (!m_imageResource->hasImage() || m_imageResource->errorOccurred())
return size.width(); // Don't bother scaling.
- return RenderReplaced::calcReplacedHeight() * size.width() / size.height();
+ return RenderBox::calcReplacedHeight() * size.width() / size.height();
}
int RenderImage::calcAspectRatioHeight() const
@@ -533,27 +530,7 @@ int RenderImage::calcAspectRatioHeight() const
return 0;
if (!m_imageResource->hasImage() || m_imageResource->errorOccurred())
return size.height(); // Don't bother scaling.
- return RenderReplaced::calcReplacedWidth() * size.height() / size.width();
-}
-
-void RenderImage::calcPrefWidths()
-{
- ASSERT(prefWidthsDirty());
-
- int borderAndPadding = borderAndPaddingWidth();
- m_maxPrefWidth = calcReplacedWidth(false) + borderAndPadding;
-
- if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength)
- m_maxPrefWidth = min(m_maxPrefWidth, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : 0));
-
- if (style()->width().isPercent() || style()->height().isPercent() ||
- style()->maxWidth().isPercent() || style()->maxHeight().isPercent() ||
- style()->minWidth().isPercent() || style()->minHeight().isPercent())
- m_minPrefWidth = 0;
- else
- m_minPrefWidth = m_maxPrefWidth;
-
- setPrefWidthsDirty(false);
+ return RenderBox::calcReplacedWidth() * size.height() / size.width();
}
} // namespace WebCore
diff --git a/WebCore/rendering/RenderImage.h b/WebCore/rendering/RenderImage.h
index 2b88c32..f9acba8 100644
--- a/WebCore/rendering/RenderImage.h
+++ b/WebCore/rendering/RenderImage.h
@@ -41,7 +41,7 @@ public:
RenderImageResource* imageResource() { return m_imageResource.get(); }
const RenderImageResource* imageResource() const { return m_imageResource.get(); }
- CachedImage* cachedImage() const { return m_imageResource->cachedImage(); }
+ CachedImage* cachedImage() const { return m_imageResource ? m_imageResource->cachedImage() : 0; }
bool setImageSizeForAltText(CachedImage* newImage = 0);
@@ -79,8 +79,6 @@ private:
virtual int calcReplacedWidth(bool includeMaxWidth = true) const;
virtual int calcReplacedHeight() const;
- virtual void calcPrefWidths();
-
int calcAspectRatioWidth() const;
int calcAspectRatioHeight() const;
diff --git a/WebCore/rendering/RenderInline.cpp b/WebCore/rendering/RenderInline.cpp
index e91822e..c985b92 100644
--- a/WebCore/rendering/RenderInline.cpp
+++ b/WebCore/rendering/RenderInline.cpp
@@ -647,7 +647,7 @@ void RenderInline::computeRectForRepaint(RenderBoxModelObject* repaintContainer,
LayoutState* layoutState = v->layoutState();
if (style()->position() == RelativePosition && layer())
rect.move(layer()->relativePositionOffset());
- rect.move(layoutState->m_offset);
+ rect.move(layoutState->m_paintOffset);
if (layoutState->m_clipped)
rect.intersect(layoutState->m_clipRect);
return;
@@ -734,7 +734,7 @@ void RenderInline::mapLocalToContainer(RenderBoxModelObject* repaintContainer, b
if (RenderView *v = view()) {
if (v->layoutStateEnabled() && !repaintContainer) {
LayoutState* layoutState = v->layoutState();
- IntSize offset = layoutState->m_offset;
+ IntSize offset = layoutState->m_paintOffset;
if (style()->position() == RelativePosition && layer())
offset += layer()->relativePositionOffset();
transformState.move(offset);
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index 63ce830..da6fad1 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -471,7 +471,7 @@ TransformationMatrix RenderLayer::renderableTransform(PaintBehavior paintBehavio
void RenderLayer::updatePagination()
{
m_isPaginated = false;
- if (isComposited() || !parent() || renderer()->isPositioned())
+ if (isComposited() || !parent())
return; // FIXME: We will have to deal with paginated compositing layers someday.
// FIXME: For now the RenderView can't be paginated. Eventually printing will move to a model where it is though.
@@ -2588,11 +2588,11 @@ void RenderLayer::paintChildLayerIntoColumns(RenderLayer* childLayer, RenderLaye
columnBlock->layer()->convertToLayerCoords(rootLayer, layerX, layerY);
ColumnInfo* colInfo = columnBlock->columnInfo();
- unsigned colCount = colInfo->columnCount();
+ unsigned colCount = columnBlock->columnCount(colInfo);
int currYOffset = 0;
for (unsigned i = 0; i < colCount; i++) {
// For each rect, we clip to the rect, and then we adjust our coords.
- IntRect colRect = colInfo->columnRectAt(i);
+ IntRect colRect = columnBlock->columnRectAt(colInfo, i);
int currXOffset = colRect.x() - (columnBlock->borderLeft() + columnBlock->paddingLeft());
colRect.move(layerX, layerY);
@@ -3054,17 +3054,17 @@ RenderLayer* RenderLayer::hitTestChildLayerColumns(RenderLayer* childLayer, Rend
columnBlock->layer()->convertToLayerCoords(rootLayer, layerX, layerY);
ColumnInfo* colInfo = columnBlock->columnInfo();
- int colCount = colInfo->columnCount();
+ int colCount = columnBlock->columnCount(colInfo);
// We have to go backwards from the last column to the first.
int left = columnBlock->borderLeft() + columnBlock->paddingLeft();
int currYOffset = 0;
int i;
for (i = 0; i < colCount; i++)
- currYOffset -= colInfo->columnRectAt(i).height();
+ currYOffset -= columnBlock->columnRectAt(colInfo, i).height();
for (i = colCount - 1; i >= 0; i--) {
// For each rect, we clip to the rect, and then we adjust our coords.
- IntRect colRect = colInfo->columnRectAt(i);
+ IntRect colRect = columnBlock->columnRectAt(colInfo, i);
int currXOffset = colRect.x() - left;
currYOffset += colRect.height();
colRect.move(layerX, layerY);
diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
index 480d94b..dbd61e1 100644
--- a/WebCore/rendering/RenderLayerBacking.cpp
+++ b/WebCore/rendering/RenderLayerBacking.cpp
@@ -781,7 +781,17 @@ bool RenderLayerBacking::containsPaintedContent() const
bool RenderLayerBacking::isDirectlyCompositedImage() const
{
RenderObject* renderObject = renderer();
- return renderObject->isImage() && !hasBoxDecorationsOrBackground(renderObject) && !renderObject->hasClip();
+
+ if (!renderObject->isImage() || hasBoxDecorationsOrBackground(renderObject) || renderObject->hasClip())
+ return false;
+
+ RenderImage* imageRenderer = toRenderImage(renderObject);
+ if (CachedImage* cachedImage = imageRenderer->cachedImage()) {
+ if (Image* image = cachedImage->image())
+ return image->isBitmapImage();
+ }
+
+ return false;
}
void RenderLayerBacking::rendererContentChanged()
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp
index fd38f30..835d21e 100644..100755
--- a/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/WebCore/rendering/RenderLayerCompositor.cpp
@@ -864,6 +864,19 @@ void RenderLayerCompositor::frameViewDidScroll(const IntPoint& scrollPosition)
m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
}
+String RenderLayerCompositor::layerTreeAsText()
+{
+ if (compositingLayerUpdatePending())
+ updateCompositingLayers();
+
+ if (!m_rootPlatformLayer)
+ return String();
+
+ // We skip dumping the scroll and clip layers to keep layerTreeAsText output
+ // similar between platforms.
+ return m_rootPlatformLayer->layerTreeAsText();
+}
+
RenderLayerCompositor* RenderLayerCompositor::iframeContentsCompositor(RenderIFrame* renderer)
{
HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(renderer->node());
@@ -1368,16 +1381,9 @@ bool RenderLayerCompositor::needsContentsCompositingLayer(const RenderLayer* lay
bool RenderLayerCompositor::requiresScrollLayer(RootLayerAttachment attachment) const
{
- if (attachment == RootLayerAttachedViaEnclosingIframe)
- return true;
-
-#if PLATFORM(MAC)
- // If we're viewless (i.e. WebKit2), we need to scroll ourselves.
- // FIXME: eventually we should do this on other platforms too.
- if (!m_renderView->frameView()->platformWidget())
- return true;
-#endif
- return false;
+ // We need to handle our own scrolling if we're:
+ return !m_renderView->frameView()->platformWidget() // viewless (i.e. non-Mac, or Mac in WebKit2)
+ || attachment == RootLayerAttachedViaEnclosingIframe; // a composited iframe on Mac
}
void RenderLayerCompositor::ensureRootPlatformLayer()
@@ -1430,10 +1436,6 @@ void RenderLayerCompositor::ensureRootPlatformLayer()
}
}
- // The root layer does geometry flipping if we need it.
- m_rootPlatformLayer->setGeometryOrientation(expectedAttachment == RootLayerAttachedViaEnclosingIframe
- ? GraphicsLayer::CompositingCoordinatesTopDown : GraphicsLayer::compositingCoordinatesOrientation());
-
// Check to see if we have to change the attachment
if (m_rootLayerAttachment != RootLayerUnattached)
detachRootPlatformLayer();
diff --git a/WebCore/rendering/RenderLayerCompositor.h b/WebCore/rendering/RenderLayerCompositor.h
index 86c061b..b4e3afe 100644..100755
--- a/WebCore/rendering/RenderLayerCompositor.h
+++ b/WebCore/rendering/RenderLayerCompositor.h
@@ -166,6 +166,8 @@ public:
void frameViewDidChangeSize(const IntPoint& contentsOffset = IntPoint());
void frameViewDidScroll(const IntPoint& = IntPoint());
+ String layerTreeAsText();
+
private:
// Whether the given RL needs a compositing layer.
bool needsToBeComposited(const RenderLayer*) const;
diff --git a/WebCore/rendering/RenderLineBoxList.cpp b/WebCore/rendering/RenderLineBoxList.cpp
index 4d0dcd6..45e66eb 100644
--- a/WebCore/rendering/RenderLineBoxList.cpp
+++ b/WebCore/rendering/RenderLineBoxList.cpp
@@ -35,7 +35,6 @@
#include "RenderInline.h"
#include "RenderView.h"
#include "RootInlineBox.h"
-#include "Settings.h" // FIXME: This include can be removed when paginateDuringLayoutEnabled is taken out.
using namespace std;
@@ -160,8 +159,10 @@ void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn
if (!firstLineBox())
return;
+ // FIXME: Paint-time pagination is obsolete and is now only used by embedded WebViews inside AppKit
+ // NSViews. Do not add any more code for this.
RenderView* v = renderer->view();
- bool usePrintRect = !v->printRect().isEmpty() && !renderer->document()->settings()->paginateDuringLayoutEnabled();
+ bool usePrintRect = !v->printRect().isEmpty();
// We can check the first box and last box and avoid painting if we don't
// intersect. This is a quick short-circuit that we can take to avoid walking any lines.
@@ -215,7 +216,6 @@ void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn
int bottom = curr->bottomVisibleOverflow() + renderer->maximalOutlineSize(info.phase);
h = bottom - top;
yPos = ty + top;
- v->setMinimumColumnHeight(h);
if (yPos < info.rect.bottom() && yPos + h > info.rect.y())
curr->paint(info, tx, ty);
}
diff --git a/WebCore/rendering/RenderMediaControls.cpp b/WebCore/rendering/RenderMediaControls.cpp
index f75da70..9c4757c 100644
--- a/WebCore/rendering/RenderMediaControls.cpp
+++ b/WebCore/rendering/RenderMediaControls.cpp
@@ -29,44 +29,51 @@
#include "GraphicsContext.h"
#include "HTMLMediaElement.h"
#include "HTMLNames.h"
-#include "RenderThemeSafari.h"
-#include "SoftLinking.h"
+#include "RenderTheme.h"
#include <CoreGraphics/CoreGraphics.h>
+#include <WebKitSystemInterface/WebKitSystemInterface.h>
+
+#if PLATFORM(WIN)
+// The Windows version of WKSI defines these functions as capitalized, while the Mac version defines them as lower case.
+#define wkMediaControllerThemeAvailable(themeStyle) WKMediaControllerThemeAvailable(themeStyle)
+#define wkHitTestMediaUIPart(part, themeStyle, bounds, point) WKHitTestMediaUIPart(part, themeStyle, bounds, point)
+#define wkMeasureMediaUIPart(part, themeStyle, bounds, naturalSize) WKMeasureMediaUIPart(part, themeStyle, bounds, naturalSize)
+#define wkDrawMediaUIPart(part, themeStyle, context, rect, state) WKDrawMediaUIPart(part, themeStyle, context, rect, state)
+#define wkDrawMediaSliderTrack(themeStyle, context, rect, timeLoaded, currentTime, duration, state) WKDrawMediaSliderTrack(themeStyle, context, rect, timeLoaded, currentTime, duration, state)
+#endif
using namespace std;
namespace WebCore {
-#ifdef DEBUG_ALL
-SOFT_LINK_DEBUG_LIBRARY(SafariTheme)
-#else
-SOFT_LINK_LIBRARY(SafariTheme)
-#endif
-
-SOFT_LINK(SafariTheme, paintThemePart, void, __stdcall, (ThemePart part, CGContextRef context, const CGRect& rect, NSControlSize size, ThemeControlState state), (part, context, rect, size, state))
-SOFT_LINK(SafariTheme, STPaintProgressIndicator, void, APIENTRY, (ProgressIndicatorType type, CGContextRef context, const CGRect& rect, NSControlSize size, ThemeControlState state, float value), (type, context, rect, size, state, value))
-
#if ENABLE(VIDEO)
-static ThemeControlState determineState(RenderObject* o)
+static WKMediaControllerThemeState determineState(RenderObject* o)
{
- ThemeControlState result = 0;
+ int result = 0;
RenderTheme* theme = o->theme();
- if (theme->isActive(o))
- result |= SafariTheme::ActiveState;
- if (theme->isEnabled(o) && !theme->isReadOnlyControl(o))
- result |= SafariTheme::EnabledState;
+ if (!theme->isEnabled(o) || theme->isReadOnlyControl(o))
+ result |= WKMediaControllerFlagDisabled;
if (theme->isPressed(o))
- result |= SafariTheme::PressedState;
- if (theme->isChecked(o))
- result |= SafariTheme::CheckedState;
- if (theme->isIndeterminate(o))
- result |= SafariTheme::IndeterminateCheckedState;
+ result |= WKMediaControllerFlagPressed;
if (theme->isFocused(o))
- result |= SafariTheme::FocusedState;
- if (theme->isDefault(o))
- result |= SafariTheme::DefaultState;
- return result;
+ result |= WKMediaControllerFlagFocused;
+ return static_cast<WKMediaControllerThemeState>(result);
+}
+
+// Utility to scale when the UI part are not scaled by wkDrawMediaUIPart
+static FloatRect getUnzoomedRectAndAdjustCurrentContext(RenderObject* o, const PaintInfo& paintInfo, const IntRect &originalRect)
+{
+ float zoomLevel = o->style()->effectiveZoom();
+ FloatRect unzoomedRect(originalRect);
+ if (zoomLevel != 1.0f) {
+ unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
+ unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
+ paintInfo.context->translate(unzoomedRect.x(), unzoomedRect.y());
+ paintInfo.context->scale(FloatSize(zoomLevel, zoomLevel));
+ paintInfo.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
+ }
+ return unzoomedRect;
}
static const int mediaSliderThumbWidth = 13;
@@ -74,73 +81,78 @@ static const int mediaSliderThumbHeight = 14;
void RenderMediaControls::adjustMediaSliderThumbSize(RenderObject* o)
{
- if (o->style()->appearance() != MediaSliderThumbPart)
+ ControlPart part = o->style()->appearance();
+
+ if (part != MediaSliderThumbPart && part != MediaVolumeSliderThumbPart)
return;
+ CGSize size;
+ wkMeasureMediaUIPart(part == MediaSliderThumbPart ? MediaSliderThumb : MediaVolumeSliderThumb, WKMediaControllerThemeQuickTime, 0, &size);
+
float zoomLevel = o->style()->effectiveZoom();
- o->style()->setWidth(Length(static_cast<int>(mediaSliderThumbWidth * zoomLevel), Fixed));
- o->style()->setHeight(Length(static_cast<int>(mediaSliderThumbHeight * zoomLevel), Fixed));
+ o->style()->setWidth(Length(static_cast<int>(size.width * zoomLevel), Fixed));
+ o->style()->setHeight(Length(static_cast<int>(size.height * zoomLevel), Fixed));
}
bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
- ASSERT(SafariThemeLibrary());
-
+ static const int themeStyle = WKMediaControllerThemeQuickTime;
+ paintInfo.context->save();
switch (part) {
case MediaFullscreenButton:
- paintThemePart(SafariTheme::MediaFullscreenButtonPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
+ wkDrawMediaUIPart(WKMediaUIPartFullscreenButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
break;
case MediaShowClosedCaptionsButton:
case MediaHideClosedCaptionsButton:
-#if SAFARI_THEME_VERSION >= 4
if (MediaControlToggleClosedCaptionsButtonElement* btn = static_cast<MediaControlToggleClosedCaptionsButtonElement*>(o->node())) {
bool captionsVisible = btn->displayType() == MediaHideClosedCaptionsButton;
- paintThemePart(captionsVisible ? SafariTheme::MediaHideClosedCaptionsButtonPart : SafariTheme::MediaShowClosedCaptionsButtonPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
+ wkDrawMediaUIPart(captionsVisible ? WKMediaUIPartHideClosedCaptionsButton : WKMediaUIPartShowClosedCaptionsButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
}
-#endif
break;
case MediaMuteButton:
case MediaUnMuteButton:
if (MediaControlMuteButtonElement* btn = static_cast<MediaControlMuteButtonElement*>(o->node())) {
bool audioEnabled = btn->displayType() == MediaMuteButton;
- paintThemePart(audioEnabled ? SafariTheme::MediaMuteButtonPart : SafariTheme::MediaUnMuteButtonPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
+ wkDrawMediaUIPart(audioEnabled ? WKMediaUIPartMuteButton : WKMediaUIPartUnMuteButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
}
break;
case MediaPauseButton:
case MediaPlayButton:
if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonElement*>(o->node())) {
bool canPlay = btn->displayType() == MediaPlayButton;
- paintThemePart(canPlay ? SafariTheme::MediaPlayButtonPart : SafariTheme::MediaPauseButtonPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
+ wkDrawMediaUIPart(canPlay ? WKMediaUIPartPlayButton : WKMediaUIPartPauseButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
}
break;
+ case MediaRewindButton:
+ wkDrawMediaUIPart(WKMediaUIPartRewindButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
+ break;
case MediaSeekBackButton:
- paintThemePart(SafariTheme::MediaSeekBackButtonPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
+ wkDrawMediaUIPart(WKMediaUIPartSeekBackButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
break;
case MediaSeekForwardButton:
- paintThemePart(SafariTheme::MediaSeekForwardButtonPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
+ wkDrawMediaUIPart(WKMediaUIPartSeekForwardButton, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
break;
case MediaSlider: {
- if (HTMLMediaElement* mediaElement = toParentMediaElement(o))
- STPaintProgressIndicator(SafariTheme::MediaType, paintInfo.context->platformContext(), r, NSRegularControlSize, 0, mediaElement->percentLoaded());
+ if (HTMLMediaElement* mediaElement = toParentMediaElement(o)) {
+ FloatRect unzoomedRect = getUnzoomedRectAndAdjustCurrentContext(o, paintInfo, r);
+ wkDrawMediaSliderTrack(themeStyle, paintInfo.context->platformContext(), unzoomedRect, mediaElement->percentLoaded() * mediaElement->duration(), mediaElement->currentTime(), mediaElement->duration(), determineState(o));
+ }
break;
}
case MediaSliderThumb:
- paintThemePart(SafariTheme::MediaSliderThumbPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
+ wkDrawMediaUIPart(WKMediaUIPartTimelineSliderThumb, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
break;
case MediaVolumeSliderContainer:
- // FIXME: Implement volume slider.
- ASSERT_NOT_REACHED();
+ wkDrawMediaUIPart(WKMediaUIPartVolumeSliderContainer, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
break;
case MediaVolumeSlider:
- // FIXME: Implement volume slider.
- ASSERT_NOT_REACHED();
+ wkDrawMediaUIPart(WKMediaUIPartVolumeSlider, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
break;
case MediaVolumeSliderThumb:
- // FIXME: Implement volume slider.
- ASSERT_NOT_REACHED();
+ wkDrawMediaUIPart(WKMediaUIPartVolumeSliderThumb, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
break;
case MediaTimelineContainer:
- ASSERT_NOT_REACHED();
+ wkDrawMediaUIPart(WKMediaUIPartBackground, themeStyle, paintInfo.context->platformContext(), r, determineState(o));
break;
case MediaCurrentTimeDisplay:
ASSERT_NOT_REACHED();
@@ -152,9 +164,24 @@ bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, R
ASSERT_NOT_REACHED();
break;
}
+ paintInfo.context->restore();
+
return false;
}
+IntPoint RenderMediaControls::volumeSliderOffsetFromMuteButton(Node* muteButton, const IntSize& size)
+{
+ static const int xOffset = -4;
+ static const int yOffset = 5;
+
+ float zoomLevel = muteButton->renderer()->style()->effectiveZoom();
+ int y = yOffset * zoomLevel + muteButton->renderBox()->offsetHeight() - size.height();
+ FloatPoint absPoint = muteButton->renderer()->localToAbsolute(FloatPoint(muteButton->renderBox()->offsetLeft(), y), true, true);
+ if (absPoint.y() < 0)
+ y = muteButton->renderBox()->height();
+ return IntPoint(xOffset * zoomLevel, y);
+
+}
#endif // #if ENABLE(VIDEO)
} // namespace WebCore
diff --git a/WebCore/rendering/RenderMediaControls.h b/WebCore/rendering/RenderMediaControls.h
index 9683dd7..f05c549 100644
--- a/WebCore/rendering/RenderMediaControls.h
+++ b/WebCore/rendering/RenderMediaControls.h
@@ -36,6 +36,7 @@ class RenderMediaControls {
public:
static bool paintMediaControlsPart(MediaControlElementType, RenderObject*, const PaintInfo&, const IntRect&);
static void adjustMediaSliderThumbSize(RenderObject*);
+ static IntPoint volumeSliderOffsetFromMuteButton(Node*, const IntSize&);
};
} // namespace WebCore
diff --git a/WebCore/rendering/RenderObject.h b/WebCore/rendering/RenderObject.h
index c369db8..f2ca471 100644
--- a/WebCore/rendering/RenderObject.h
+++ b/WebCore/rendering/RenderObject.h
@@ -316,6 +316,7 @@ public:
virtual bool isSVGHiddenContainer() const { return false; }
virtual bool isRenderPath() const { return false; }
virtual bool isSVGText() const { return false; }
+ virtual bool isSVGInline() const { return false; }
virtual bool isSVGInlineText() const { return false; }
virtual bool isSVGImage() const { return false; }
virtual bool isSVGForeignObject() const { return false; }
@@ -988,14 +989,7 @@ inline void makeMatrixRenderable(TransformationMatrix& matrix, bool has3DRenderi
inline int adjustForAbsoluteZoom(int value, RenderObject* renderer)
{
- double zoomFactor = renderer->style()->effectiveZoom();
- if (zoomFactor == 1)
- return value;
- // Needed because computeLengthInt truncates (rather than rounds) when scaling up.
- if (zoomFactor > 1)
- value++;
-
- return roundForImpreciseConversion<int, INT_MAX, INT_MIN>(value / zoomFactor);
+ return adjustForAbsoluteZoom(value, renderer->style());
}
inline void adjustIntRectForAbsoluteZoom(IntRect& rect, RenderObject* renderer)
diff --git a/WebCore/rendering/RenderReplaced.cpp b/WebCore/rendering/RenderReplaced.cpp
index 0da321e..b54a228 100644
--- a/WebCore/rendering/RenderReplaced.cpp
+++ b/WebCore/rendering/RenderReplaced.cpp
@@ -40,6 +40,7 @@ const int cDefaultHeight = 150;
RenderReplaced::RenderReplaced(Node* node)
: RenderBox(node)
, m_intrinsicSize(cDefaultWidth, cDefaultHeight)
+ , m_hasIntrinsicSize(false)
{
setReplaced(true);
}
@@ -47,6 +48,7 @@ RenderReplaced::RenderReplaced(Node* node)
RenderReplaced::RenderReplaced(Node* node, const IntSize& intrinsicSize)
: RenderBox(node)
, m_intrinsicSize(intrinsicSize)
+ , m_hasIntrinsicSize(true)
{
setReplaced(true);
}
@@ -192,21 +194,78 @@ bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, int& tx, int& ty)
return true;
}
+static inline bool lengthIsSpecified(Length length)
+{
+ LengthType lengthType = length.type();
+ return lengthType == Fixed || lengthType == Percent;
+}
+
+int RenderReplaced::calcReplacedWidth(bool includeMaxWidth) const
+{
+ int width;
+ if (lengthIsSpecified(style()->width()))
+ width = calcReplacedWidthUsing(style()->width());
+ else if (m_hasIntrinsicSize)
+ width = calcAspectRatioWidth();
+ else
+ width = intrinsicSize().width();
+
+ int minW = calcReplacedWidthUsing(style()->minWidth());
+ int maxW = !includeMaxWidth || style()->maxWidth().isUndefined() ? width : calcReplacedWidthUsing(style()->maxWidth());
+
+ return max(minW, min(width, maxW));
+}
+
+int RenderReplaced::calcReplacedHeight() const
+{
+ int height;
+ if (lengthIsSpecified(style()->height()))
+ height = calcReplacedHeightUsing(style()->height());
+ else if (m_hasIntrinsicSize)
+ height = calcAspectRatioHeight();
+ else
+ height = intrinsicSize().height();
+
+ int minH = calcReplacedHeightUsing(style()->minHeight());
+ int maxH = style()->maxHeight().isUndefined() ? height : calcReplacedHeightUsing(style()->maxHeight());
+
+ return max(minH, min(height, maxH));
+}
+
+int RenderReplaced::calcAspectRatioWidth() const
+{
+ int intrinsicWidth = intrinsicSize().width();
+ int intrinsicHeight = intrinsicSize().height();
+ if (!intrinsicHeight)
+ return 0;
+ return RenderBox::calcReplacedHeight() * intrinsicWidth / intrinsicHeight;
+}
+
+int RenderReplaced::calcAspectRatioHeight() const
+{
+ int intrinsicWidth = intrinsicSize().width();
+ int intrinsicHeight = intrinsicSize().height();
+ if (!intrinsicWidth)
+ return 0;
+ return RenderBox::calcReplacedWidth() * intrinsicHeight / intrinsicWidth;
+}
+
void RenderReplaced::calcPrefWidths()
{
ASSERT(prefWidthsDirty());
int borderAndPadding = borderAndPaddingWidth();
- int width = calcReplacedWidth(false) + borderAndPadding;
+ m_maxPrefWidth = calcReplacedWidth(false) + borderAndPadding;
if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength)
- width = min(width, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : 0));
+ m_maxPrefWidth = min(m_maxPrefWidth, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : 0));
- if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent())) {
+ if (style()->width().isPercent() || style()->height().isPercent()
+ || style()->maxWidth().isPercent() || style()->maxHeight().isPercent()
+ || style()->minWidth().isPercent() || style()->minHeight().isPercent())
m_minPrefWidth = 0;
- m_maxPrefWidth = width;
- } else
- m_minPrefWidth = m_maxPrefWidth = width;
+ else
+ m_minPrefWidth = m_maxPrefWidth;
setPrefWidthsDirty(false);
}
@@ -329,6 +388,7 @@ IntSize RenderReplaced::intrinsicSize() const
void RenderReplaced::setIntrinsicSize(const IntSize& size)
{
+ ASSERT(m_hasIntrinsicSize);
m_intrinsicSize = size;
}
diff --git a/WebCore/rendering/RenderReplaced.h b/WebCore/rendering/RenderReplaced.h
index b5c6179..8a0543c 100644
--- a/WebCore/rendering/RenderReplaced.h
+++ b/WebCore/rendering/RenderReplaced.h
@@ -37,6 +37,10 @@ protected:
virtual IntSize intrinsicSize() const;
+ virtual int calcReplacedWidth(bool includeMaxWidth = true) const;
+ virtual int calcReplacedHeight() const;
+ virtual int minimumReplacedHeight() const { return 0; }
+
virtual void setSelectionState(SelectionState);
bool isSelected() const;
@@ -45,6 +49,7 @@ protected:
void setIntrinsicSize(const IntSize&);
virtual void intrinsicSizeChanged();
+ void setHasIntrinsicSize() { m_hasIntrinsicSize = true; }
virtual void paint(PaintInfo&, int tx, int ty);
bool shouldPaint(PaintInfo&, int& tx, int& ty);
@@ -60,7 +65,8 @@ private:
virtual void calcPrefWidths();
- virtual int minimumReplacedHeight() const { return 0; }
+ int calcAspectRatioWidth() const;
+ int calcAspectRatioHeight() const;
virtual void paintReplaced(PaintInfo&, int /*tx*/, int /*ty*/) { }
@@ -74,6 +80,7 @@ private:
virtual IntRect selectionRectForRepaint(RenderBoxModelObject* repaintContainer, bool clipToVisibleContent = true);
IntSize m_intrinsicSize;
+ bool m_hasIntrinsicSize;
};
}
diff --git a/WebCore/rendering/RenderSVGInline.h b/WebCore/rendering/RenderSVGInline.h
index fb38f1b..92b6fe7 100644
--- a/WebCore/rendering/RenderSVGInline.h
+++ b/WebCore/rendering/RenderSVGInline.h
@@ -37,6 +37,7 @@ public:
virtual const char* renderName() const { return "RenderSVGInline"; }
virtual bool requiresLayer() const { return false; }
+ virtual bool isSVGInline() const { return true; }
// Chapter 10.4 of the SVG Specification say that we should use the
// object bounding box of the parent text element.
diff --git a/WebCore/rendering/RenderSVGInlineText.cpp b/WebCore/rendering/RenderSVGInlineText.cpp
index ba99243..0539d27 100644
--- a/WebCore/rendering/RenderSVGInlineText.cpp
+++ b/WebCore/rendering/RenderSVGInlineText.cpp
@@ -65,6 +65,47 @@ IntRect RenderSVGInlineText::localCaretRect(InlineBox*, int, int*)
return IntRect();
}
+IntRect RenderSVGInlineText::linesBoundingBox() const
+{
+ IntRect boundingBox;
+ for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
+ boundingBox.unite(box->calculateBoundaries());
+ return boundingBox;
+}
+
+bool RenderSVGInlineText::characterStartsNewTextChunk(int position) const
+{
+ ASSERT(m_attributes.xValues().size() == textLength());
+ ASSERT(m_attributes.yValues().size() == textLength());
+ ASSERT(position >= 0);
+ ASSERT(position < static_cast<int>(textLength()));
+
+ int currentPosition = 0;
+ unsigned size = m_attributes.characterDataValues().size();
+ for (unsigned i = 0; i < size; ++i) {
+ const SVGTextLayoutAttributes::CharacterData& data = m_attributes.characterDataValues().at(i);
+
+ // We found the desired character.
+ if (currentPosition == position) {
+ if (isVerticalWritingMode(style()->svgStyle()))
+ return m_attributes.yValues().at(position) != SVGTextLayoutAttributes::emptyValue();
+
+ return m_attributes.xValues().at(position) != SVGTextLayoutAttributes::emptyValue();
+ }
+
+ currentPosition += data.spansCharacters;
+ if (currentPosition > position)
+ break;
+ }
+
+ // The desired position is available in the x/y list, but not in the character data values list.
+ // That means the previous character data described a single glyph, consisting of multiple unicode characters.
+ // The consequence is that the desired character does not define a new absolute x/y position, even if present in the x/y test.
+ // This code is tested by svg/W3C-SVG-1.1/text-text-06-t.svg (and described in detail, why this influences chunk detection).
+ ASSERT(currentPosition > position);
+ return false;
+}
+
}
#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/RenderSVGInlineText.h b/WebCore/rendering/RenderSVGInlineText.h
index 08b4a47..f606918 100644
--- a/WebCore/rendering/RenderSVGInlineText.h
+++ b/WebCore/rendering/RenderSVGInlineText.h
@@ -26,14 +26,18 @@
#define RenderSVGInlineText_h
#if ENABLE(SVG)
-
#include "RenderText.h"
+#include "SVGTextLayoutAttributes.h"
namespace WebCore {
+
class RenderSVGInlineText : public RenderText {
public:
RenderSVGInlineText(Node*, PassRefPtr<StringImpl>);
+ bool characterStartsNewTextChunk(int position) const;
+ void storeLayoutAttributes(const SVGTextLayoutAttributes& attributes) { m_attributes = attributes; }
+
private:
virtual const char* renderName() const { return "RenderSVGInlineText"; }
@@ -47,8 +51,10 @@ private:
virtual bool isSVGInlineText() const { return true; }
virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0);
-
+ virtual IntRect linesBoundingBox() const;
virtual InlineTextBox* createTextBox();
+
+ SVGTextLayoutAttributes m_attributes;
};
}
diff --git a/WebCore/rendering/RenderSVGResourceFilter.cpp b/WebCore/rendering/RenderSVGResourceFilter.cpp
index 982375e..698033e 100644
--- a/WebCore/rendering/RenderSVGResourceFilter.cpp
+++ b/WebCore/rendering/RenderSVGResourceFilter.cpp
@@ -1,8 +1,8 @@
/*
* Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * 2004, 2005 Rob Buis <buis@kde.org>
- * 2005 Eric Seidel <eric@webkit.org>
- * 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* This library is free software; you can redistribute it and/or
@@ -19,7 +19,6 @@
* 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"
@@ -193,12 +192,12 @@ bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*,
if (!lastEffect)
return false;
- lastEffect->calculateEffectRect(filterData->filter.get());
+ lastEffect->determineFilterPrimitiveSubregion(filterData->filter.get());
// At least one FilterEffect has a too big image size,
// recalculate the effect sizes with new scale factors.
if (!fitsInMaximumImageSize(filterData->filter->maxImageSize(), scale)) {
filterData->filter->setFilterResolution(scale);
- lastEffect->calculateEffectRect(filterData->filter.get());
+ lastEffect->determineFilterPrimitiveSubregion(filterData->filter.get());
}
clippedSourceRect.scale(scale.width(), scale.height());
@@ -255,7 +254,7 @@ void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsCo
FilterEffect* lastEffect = filterData->builder->lastEffect();
- if (lastEffect && !filterData->boundaries.isEmpty() && !lastEffect->subRegion().isEmpty()) {
+ if (lastEffect && !filterData->boundaries.isEmpty() && !lastEffect->filterPrimitiveSubregion().isEmpty()) {
// This is the real filtering of the object. It just needs to be called on the
// initial filtering process. We just take the stored filter result on a
// second drawing.
@@ -272,7 +271,7 @@ void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsCo
ImageBuffer* resultImage = lastEffect->resultImage();
if (resultImage)
- context->drawImageBuffer(resultImage, object->style()->colorSpace(), lastEffect->subRegion());
+ context->drawImageBuffer(resultImage, object->style()->colorSpace(), lastEffect->filterPrimitiveSubregion());
}
filterData->sourceGraphicBuffer.clear();
diff --git a/WebCore/rendering/RenderSVGText.cpp b/WebCore/rendering/RenderSVGText.cpp
index 80b8a91..c20a509 100644
--- a/WebCore/rendering/RenderSVGText.cpp
+++ b/WebCore/rendering/RenderSVGText.cpp
@@ -42,6 +42,7 @@
#include "SVGRenderSupport.h"
#include "SVGRootInlineBox.h"
#include "SVGTextElement.h"
+#include "SVGTextLayoutBuilder.h"
#include "SVGTransformList.h"
#include "SVGURIReference.h"
#include "SimpleFontData.h"
@@ -83,6 +84,9 @@ void RenderSVGText::layout()
updateCachedBoundariesInParents = true;
}
+ SVGTextLayoutBuilder layoutBuilder;
+ layoutBuilder.buildLayoutAttributesForTextSubtree(this);
+
// Reduced version of RenderBlock::layoutBlock(), which only takes care of SVG text.
// All if branches that could cause early exit in RenderBlocks layoutBlock() method are turned into assertions.
ASSERT(!isInline());
diff --git a/WebCore/rendering/RenderSlider.cpp b/WebCore/rendering/RenderSlider.cpp
index aef807b..39ac2e5 100644
--- a/WebCore/rendering/RenderSlider.cpp
+++ b/WebCore/rendering/RenderSlider.cpp
@@ -29,7 +29,7 @@
#include "Frame.h"
#include "HTMLInputElement.h"
#include "HTMLNames.h"
-#include "HTMLTreeBuilder.h"
+#include "HTMLParserIdioms.h"
#include "MediaControlElements.h"
#include "MouseEvent.h"
#include "RenderLayer.h"
diff --git a/WebCore/rendering/RenderTable.cpp b/WebCore/rendering/RenderTable.cpp
index 48f3920..124dacb 100644
--- a/WebCore/rendering/RenderTable.cpp
+++ b/WebCore/rendering/RenderTable.cpp
@@ -62,11 +62,16 @@ RenderTable::RenderTable(Node* node)
, m_borderLeft(0)
, m_borderRight(0)
{
+<<<<<<< HEAD
#ifdef ANDROID_LAYOUT
m_singleColumn = false;
#endif
+=======
+ setChildrenInline(false);
+>>>>>>> webkit.org at r67908
m_columnPos.fill(0, 2);
m_columns.fill(ColumnStruct(), 1);
+
}
void RenderTable::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
@@ -458,6 +463,9 @@ void RenderTable::layout()
statePusher.pop();
+ if (view()->layoutState()->m_pageHeight)
+ setPageY(view()->layoutState()->pageY(y()));
+
bool didFullRepaint = repainter.repaintAfterLayout();
// Repaint with our new bounds if they are different from our old bounds.
if (!didFullRepaint && sectionMoved)
diff --git a/WebCore/rendering/RenderTableCell.cpp b/WebCore/rendering/RenderTableCell.cpp
index c0532cf..add2b5e 100644
--- a/WebCore/rendering/RenderTableCell.cpp
+++ b/WebCore/rendering/RenderTableCell.cpp
@@ -304,34 +304,53 @@ void RenderTableCell::styleDidChange(StyleDifference diff, const RenderStyle* ol
// (4) If border styles differ only in color, then a style set on a cell wins over one on a row,
// which wins over a row group, column, column group and, lastly, table. It is undefined which color
// is used when two elements of the same type disagree.
-static CollapsedBorderValue compareBorders(const CollapsedBorderValue& border1, const CollapsedBorderValue& border2)
+static int compareBorders(const CollapsedBorderValue& border1, const CollapsedBorderValue& border2)
{
- // Sanity check the values passed in. If either is null, return the other.
- if (!border2.exists())
- return border1;
+ // Sanity check the values passed in. The null border have lowest priority.
+ if (!border2.exists()) {
+ if (!border1.exists())
+ return 0;
+ return 1;
+ }
if (!border1.exists())
- return border2;
+ return -1;
// Rule #1 above.
- if (border1.style() == BHIDDEN || border2.style() == BHIDDEN)
- return CollapsedBorderValue(); // No border should exist at this location.
+ if (border2.style() == BHIDDEN) {
+ if (border1.style() == BHIDDEN)
+ return 0;
+ return -1;
+ }
+ if (border1.style() == BHIDDEN)
+ return 1;
// Rule #2 above. A style of 'none' has lowest priority and always loses to any other border.
- if (border2.style() == BNONE)
- return border1;
+ if (border2.style() == BNONE) {
+ if (border1.style() == BNONE)
+ return 0;
+ return 1;
+ }
if (border1.style() == BNONE)
- return border2;
+ return -1;
// The first part of rule #3 above. Wider borders win.
if (border1.width() != border2.width())
- return border1.width() > border2.width() ? border1 : border2;
+ return border1.width() < border2.width() ? -1 : 1;
// The borders have equal width. Sort by border style.
if (border1.style() != border2.style())
- return border1.style() > border2.style() ? border1 : border2;
+ return border1.style() < border2.style() ? -1 : 1;
// The border have the same width and style. Rely on precedence (cell over row over row group, etc.)
- return border1.precedence() >= border2.precedence() ? border1 : border2;
+ if (border1.precedence() == border2.precedence())
+ return 0;
+ return border1.precedence() < border2.precedence() ? -1 : 1;
+}
+
+static CollapsedBorderValue chooseBorder(const CollapsedBorderValue& border1, const CollapsedBorderValue& border2)
+{
+ const CollapsedBorderValue& border = compareBorders(border1, border2) < 0 ? border2 : border1;
+ return border.style() == BHIDDEN ? CollapsedBorderValue() : border;
}
CollapsedBorderValue RenderTableCell::collapsedLeftBorder(bool rtl) const
@@ -355,17 +374,17 @@ CollapsedBorderValue RenderTableCell::collapsedLeftBorder(bool rtl) const
RenderTableCell* prevCell = rtl ? tableElt->cellAfter(this) : tableElt->cellBefore(this);
if (prevCell) {
CollapsedBorderValue prevCellBorder = CollapsedBorderValue(&prevCell->style()->borderRight(), prevCell->style()->visitedDependentColor(right), BCELL);
- result = rtl ? compareBorders(result, prevCellBorder) : compareBorders(prevCellBorder, result);
+ result = rtl ? chooseBorder(result, prevCellBorder) : chooseBorder(prevCellBorder, result);
if (!result.exists())
return result;
} else if (leftmostColumn) {
// (3) Our row's left border.
- result = compareBorders(result, CollapsedBorderValue(&parent()->style()->borderLeft(), parent()->style()->visitedDependentColor(left), BROW));
+ result = chooseBorder(result, CollapsedBorderValue(&parent()->style()->borderLeft(), parent()->style()->visitedDependentColor(left), BROW));
if (!result.exists())
return result;
// (4) Our row group's left border.
- result = compareBorders(result, CollapsedBorderValue(&section()->style()->borderLeft(), section()->style()->visitedDependentColor(left), BROWGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(&section()->style()->borderLeft(), section()->style()->visitedDependentColor(left), BROWGROUP));
if (!result.exists())
return result;
}
@@ -375,11 +394,11 @@ CollapsedBorderValue RenderTableCell::collapsedLeftBorder(bool rtl) const
bool endColEdge;
RenderTableCol* colElt = tableElt->colElement(col() + (rtl ? colSpan() - 1 : 0), &startColEdge, &endColEdge);
if (colElt && (!rtl ? startColEdge : endColEdge)) {
- result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderLeft(), colElt->style()->visitedDependentColor(left), BCOL));
+ result = chooseBorder(result, CollapsedBorderValue(&colElt->style()->borderLeft(), colElt->style()->visitedDependentColor(left), BCOL));
if (!result.exists())
return result;
if (colElt->parent()->isTableCol() && (!rtl ? !colElt->previousSibling() : !colElt->nextSibling())) {
- result = compareBorders(result, CollapsedBorderValue(&colElt->parent()->style()->borderLeft(), colElt->parent()->style()->visitedDependentColor(left), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(&colElt->parent()->style()->borderLeft(), colElt->parent()->style()->visitedDependentColor(left), BCOLGROUP));
if (!result.exists())
return result;
}
@@ -390,13 +409,13 @@ CollapsedBorderValue RenderTableCell::collapsedLeftBorder(bool rtl) const
colElt = tableElt->colElement(col() + (rtl ? colSpan() : -1), &startColEdge, &endColEdge);
if (colElt && (!rtl ? endColEdge : startColEdge)) {
CollapsedBorderValue rightBorder = CollapsedBorderValue(&colElt->style()->borderRight(), colElt->style()->visitedDependentColor(right), BCOL);
- result = rtl ? compareBorders(result, rightBorder) : compareBorders(rightBorder, result);
+ result = rtl ? chooseBorder(result, rightBorder) : chooseBorder(rightBorder, result);
if (!result.exists())
return result;
}
} else {
// (7) The table's left border.
- result = compareBorders(result, CollapsedBorderValue(&tableElt->style()->borderLeft(), tableElt->style()->visitedDependentColor(left), BTABLE));
+ result = chooseBorder(result, CollapsedBorderValue(&tableElt->style()->borderLeft(), tableElt->style()->visitedDependentColor(left), BTABLE));
if (!result.exists())
return result;
}
@@ -426,18 +445,18 @@ CollapsedBorderValue RenderTableCell::collapsedRightBorder(bool rtl) const
RenderTableCell* nextCell = rtl ? tableElt->cellBefore(this) : tableElt->cellAfter(this);
if (nextCell && nextCell->style()) {
CollapsedBorderValue leftBorder = CollapsedBorderValue(&nextCell->style()->borderLeft(), nextCell->style()->visitedDependentColor(left), BCELL);
- result = rtl ? compareBorders(leftBorder, result) : compareBorders(result, leftBorder);
+ result = rtl ? chooseBorder(leftBorder, result) : chooseBorder(result, leftBorder);
if (!result.exists())
return result;
}
} else {
// (3) Our row's right border.
- result = compareBorders(result, CollapsedBorderValue(&parent()->style()->borderRight(), parent()->style()->visitedDependentColor(right), BROW));
+ result = chooseBorder(result, CollapsedBorderValue(&parent()->style()->borderRight(), parent()->style()->visitedDependentColor(right), BROW));
if (!result.exists())
return result;
// (4) Our row group's right border.
- result = compareBorders(result, CollapsedBorderValue(&section()->style()->borderRight(), section()->style()->visitedDependentColor(right), BROWGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(&section()->style()->borderRight(), section()->style()->visitedDependentColor(right), BROWGROUP));
if (!result.exists())
return result;
}
@@ -447,11 +466,11 @@ CollapsedBorderValue RenderTableCell::collapsedRightBorder(bool rtl) const
bool endColEdge;
RenderTableCol* colElt = tableElt->colElement(col() + (rtl ? 0 : colSpan() - 1), &startColEdge, &endColEdge);
if (colElt && (!rtl ? endColEdge : startColEdge)) {
- result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderRight(), colElt->style()->visitedDependentColor(right), BCOL));
+ result = chooseBorder(result, CollapsedBorderValue(&colElt->style()->borderRight(), colElt->style()->visitedDependentColor(right), BCOL));
if (!result.exists())
return result;
if (colElt->parent()->isTableCol() && (!rtl ? !colElt->nextSibling() : !colElt->previousSibling())) {
- result = compareBorders(result, CollapsedBorderValue(&colElt->parent()->style()->borderRight(), colElt->parent()->style()->visitedDependentColor(right), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(&colElt->parent()->style()->borderRight(), colElt->parent()->style()->visitedDependentColor(right), BCOLGROUP));
if (!result.exists())
return result;
}
@@ -462,13 +481,13 @@ CollapsedBorderValue RenderTableCell::collapsedRightBorder(bool rtl) const
colElt = tableElt->colElement(col() + (rtl ? -1 : colSpan()), &startColEdge, &endColEdge);
if (colElt && (!rtl ? startColEdge : endColEdge)) {
CollapsedBorderValue leftBorder = CollapsedBorderValue(&colElt->style()->borderLeft(), colElt->style()->visitedDependentColor(left), BCOL);
- result = rtl ? compareBorders(leftBorder, result) : compareBorders(result, leftBorder);
+ result = rtl ? chooseBorder(leftBorder, result) : chooseBorder(result, leftBorder);
if (!result.exists())
return result;
}
} else {
// (7) The table's right border.
- result = compareBorders(result, CollapsedBorderValue(&tableElt->style()->borderRight(), tableElt->style()->visitedDependentColor(right), BTABLE));
+ result = chooseBorder(result, CollapsedBorderValue(&tableElt->style()->borderRight(), tableElt->style()->visitedDependentColor(right), BTABLE));
if (!result.exists())
return result;
}
@@ -487,13 +506,13 @@ CollapsedBorderValue RenderTableCell::collapsedTopBorder() const
RenderTableCell* prevCell = table()->cellAbove(this);
if (prevCell) {
// (2) A previous cell's bottom border.
- result = compareBorders(CollapsedBorderValue(&prevCell->style()->borderBottom(), prevCell->style()->visitedDependentColor(bottom), BCELL), result);
+ result = chooseBorder(CollapsedBorderValue(&prevCell->style()->borderBottom(), prevCell->style()->visitedDependentColor(bottom), BCELL), result);
if (!result.exists())
return result;
}
// (3) Our row's top border.
- result = compareBorders(result, CollapsedBorderValue(&parent()->style()->borderTop(), parent()->style()->visitedDependentColor(top), BROW));
+ result = chooseBorder(result, CollapsedBorderValue(&parent()->style()->borderTop(), parent()->style()->visitedDependentColor(top), BROW));
if (!result.exists())
return result;
@@ -506,7 +525,7 @@ CollapsedBorderValue RenderTableCell::collapsedTopBorder() const
prevRow = prevCell->section()->lastChild();
if (prevRow) {
- result = compareBorders(CollapsedBorderValue(&prevRow->style()->borderBottom(), prevRow->style()->visitedDependentColor(bottom), BROW), result);
+ result = chooseBorder(CollapsedBorderValue(&prevRow->style()->borderBottom(), prevRow->style()->visitedDependentColor(bottom), BROW), result);
if (!result.exists())
return result;
}
@@ -516,14 +535,14 @@ CollapsedBorderValue RenderTableCell::collapsedTopBorder() const
RenderTableSection* currSection = section();
if (!row()) {
// (5) Our row group's top border.
- result = compareBorders(result, CollapsedBorderValue(&currSection->style()->borderTop(), currSection->style()->visitedDependentColor(top), BROWGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(&currSection->style()->borderTop(), currSection->style()->visitedDependentColor(top), BROWGROUP));
if (!result.exists())
return result;
// (6) Previous row group's bottom border.
currSection = table()->sectionAbove(currSection);
if (currSection) {
- result = compareBorders(CollapsedBorderValue(&currSection->style()->borderBottom(), currSection->style()->visitedDependentColor(bottom), BROWGROUP), result);
+ result = chooseBorder(CollapsedBorderValue(&currSection->style()->borderBottom(), currSection->style()->visitedDependentColor(bottom), BROWGROUP), result);
if (!result.exists())
return result;
}
@@ -533,11 +552,11 @@ CollapsedBorderValue RenderTableCell::collapsedTopBorder() const
// (8) Our column and column group's top borders.
RenderTableCol* colElt = table()->colElement(col());
if (colElt) {
- result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderTop(), colElt->style()->visitedDependentColor(top), BCOL));
+ result = chooseBorder(result, CollapsedBorderValue(&colElt->style()->borderTop(), colElt->style()->visitedDependentColor(top), BCOL));
if (!result.exists())
return result;
if (colElt->parent()->isTableCol()) {
- result = compareBorders(result, CollapsedBorderValue(&colElt->parent()->style()->borderTop(), colElt->parent()->style()->visitedDependentColor(top), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(&colElt->parent()->style()->borderTop(), colElt->parent()->style()->visitedDependentColor(top), BCOLGROUP));
if (!result.exists())
return result;
}
@@ -545,7 +564,7 @@ CollapsedBorderValue RenderTableCell::collapsedTopBorder() const
// (9) The table's top border.
RenderTable* enclosingTable = table();
- result = compareBorders(result, CollapsedBorderValue(&enclosingTable->style()->borderTop(), enclosingTable->style()->visitedDependentColor(top), BTABLE));
+ result = chooseBorder(result, CollapsedBorderValue(&enclosingTable->style()->borderTop(), enclosingTable->style()->visitedDependentColor(top), BTABLE));
if (!result.exists())
return result;
}
@@ -564,19 +583,19 @@ CollapsedBorderValue RenderTableCell::collapsedBottomBorder() const
RenderTableCell* nextCell = table()->cellBelow(this);
if (nextCell) {
// (2) A following cell's top border.
- result = compareBorders(result, CollapsedBorderValue(&nextCell->style()->borderTop(), nextCell->style()->visitedDependentColor(top), BCELL));
+ result = chooseBorder(result, CollapsedBorderValue(&nextCell->style()->borderTop(), nextCell->style()->visitedDependentColor(top), BCELL));
if (!result.exists())
return result;
}
// (3) Our row's bottom border. (FIXME: Deal with rowspan!)
- result = compareBorders(result, CollapsedBorderValue(&parent()->style()->borderBottom(), parent()->style()->visitedDependentColor(bottom), BROW));
+ result = chooseBorder(result, CollapsedBorderValue(&parent()->style()->borderBottom(), parent()->style()->visitedDependentColor(bottom), BROW));
if (!result.exists())
return result;
// (4) The next row's top border.
if (nextCell) {
- result = compareBorders(result, CollapsedBorderValue(&nextCell->parent()->style()->borderTop(), nextCell->parent()->style()->visitedDependentColor(top), BROW));
+ result = chooseBorder(result, CollapsedBorderValue(&nextCell->parent()->style()->borderTop(), nextCell->parent()->style()->visitedDependentColor(top), BROW));
if (!result.exists())
return result;
}
@@ -585,14 +604,14 @@ CollapsedBorderValue RenderTableCell::collapsedBottomBorder() const
RenderTableSection* currSection = section();
if (row() + rowSpan() >= currSection->numRows()) {
// (5) Our row group's bottom border.
- result = compareBorders(result, CollapsedBorderValue(&currSection->style()->borderBottom(), currSection->style()->visitedDependentColor(bottom), BROWGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(&currSection->style()->borderBottom(), currSection->style()->visitedDependentColor(bottom), BROWGROUP));
if (!result.exists())
return result;
// (6) Following row group's top border.
currSection = table()->sectionBelow(currSection);
if (currSection) {
- result = compareBorders(result, CollapsedBorderValue(&currSection->style()->borderTop(), currSection->style()->visitedDependentColor(top), BROWGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(&currSection->style()->borderTop(), currSection->style()->visitedDependentColor(top), BROWGROUP));
if (!result.exists())
return result;
}
@@ -602,10 +621,10 @@ CollapsedBorderValue RenderTableCell::collapsedBottomBorder() const
// (8) Our column and column group's bottom borders.
RenderTableCol* colElt = table()->colElement(col());
if (colElt) {
- result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderBottom(), colElt->style()->visitedDependentColor(bottom), BCOL));
+ result = chooseBorder(result, CollapsedBorderValue(&colElt->style()->borderBottom(), colElt->style()->visitedDependentColor(bottom), BCOL));
if (!result.exists()) return result;
if (colElt->parent()->isTableCol()) {
- result = compareBorders(result, CollapsedBorderValue(&colElt->parent()->style()->borderBottom(), colElt->parent()->style()->visitedDependentColor(bottom), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(&colElt->parent()->style()->borderBottom(), colElt->parent()->style()->visitedDependentColor(bottom), BCOLGROUP));
if (!result.exists())
return result;
}
@@ -613,7 +632,7 @@ CollapsedBorderValue RenderTableCell::collapsedBottomBorder() const
// (9) The table's bottom border.
RenderTable* enclosingTable = table();
- result = compareBorders(result, CollapsedBorderValue(&enclosingTable->style()->borderBottom(), enclosingTable->style()->visitedDependentColor(bottom), BTABLE));
+ result = chooseBorder(result, CollapsedBorderValue(&enclosingTable->style()->borderBottom(), enclosingTable->style()->visitedDependentColor(bottom), BTABLE));
if (!result.exists())
return result;
}
@@ -776,6 +795,7 @@ static int compareBorderStylesForQSort(const void* pa, const void* pb)
const CollapsedBorderValue* b = static_cast<const CollapsedBorderValue*>(pb);
if (*a == *b)
return 0;
+<<<<<<< HEAD
CollapsedBorderValue borderWithHigherPrecedence = compareBorders(*a, *b);
#ifdef ANDROID_FIX
if (*a == borderWithHigherPrecedence) {
@@ -793,6 +813,9 @@ static int compareBorderStylesForQSort(const void* pa, const void* pb)
return 1;
#endif
return -1;
+=======
+ return compareBorders(*a, *b);
+>>>>>>> webkit.org at r67908
}
void RenderTableCell::sortBorderStyles(CollapsedBorderStyles& borderStyles)
diff --git a/WebCore/rendering/RenderTableRow.cpp b/WebCore/rendering/RenderTableRow.cpp
index a11a14b..0a8bfde 100644
--- a/WebCore/rendering/RenderTableRow.cpp
+++ b/WebCore/rendering/RenderTableRow.cpp
@@ -117,9 +117,14 @@ void RenderTableRow::layout()
// Table rows do not add translation.
LayoutStateMaintainer statePusher(view(), this, IntSize());
+ bool paginated = view()->layoutState()->isPaginated();
+
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
if (child->isTableCell()) {
RenderTableCell* cell = toRenderTableCell(child);
+ if (!cell->needsLayout() && paginated && view()->layoutState()->m_pageHeight && view()->layoutState()->pageY(cell->y()) != cell->pageY())
+ cell->setChildNeedsLayout(true, false);
+
if (child->needsLayout()) {
cell->calcVerticalMargins();
cell->layout();
diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp
index a9052ce..9e59109 100644
--- a/WebCore/rendering/RenderTableSection.cpp
+++ b/WebCore/rendering/RenderTableSection.cpp
@@ -689,26 +689,36 @@ int RenderTableSection::layoutRows(int toAdd)
int be = rHeight - heightWithoutIntrinsicPadding - te;
cell->setIntrinsicPaddingTop(te);
cell->setIntrinsicPaddingBottom(be);
- if (te != oldTe || be != oldBe) {
- cell->setNeedsLayout(true, false);
- cell->layoutIfNeeded();
- }
-
- if ((te != oldTe || be > oldBe) && !table()->selfNeedsLayout() && cell->checkForRepaintDuringLayout())
- cell->repaint();
IntRect oldCellRect(cell->x(), cell->y() , cell->width(), cell->height());
-
+
if (style()->direction() == RTL)
cell->setLocation(table()->columnPositions()[nEffCols] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + hspacing, m_rowPos[rindx]);
else
cell->setLocation(table()->columnPositions()[c] + hspacing, m_rowPos[rindx]);
+ view()->addLayoutDelta(IntSize(oldCellRect.x() - cell->x(), oldCellRect.y() - cell->y()));
- // If the cell moved, we have to repaint it as well as any floating/positioned
- // descendants. An exception is if we need a layout. In this case, we know we're going to
- // repaint ourselves (and the cell) anyway.
- if (!table()->selfNeedsLayout() && cell->checkForRepaintDuringLayout())
- cell->repaintDuringLayoutIfMoved(oldCellRect);
+ if (te != oldTe || be != oldBe)
+ cell->setNeedsLayout(true, false);
+
+ if (!cell->needsLayout() && view()->layoutState()->m_pageHeight && view()->layoutState()->pageY(cell->y()) != cell->pageY())
+ cell->setChildNeedsLayout(true, false);
+
+ cell->layoutIfNeeded();
+
+ if (view()->layoutState()->m_pageHeight && cell->height() != rHeight)
+ cell->setHeight(rHeight); // FIXME: Pagination might have made us change size. For now just shrink or grow the cell to fit without doing a relayout.
+
+ IntSize childOffset(cell->x() - oldCellRect.x(), cell->y() - oldCellRect.y());
+ if (childOffset.width() || childOffset.height()) {
+ view()->addLayoutDelta(childOffset);
+
+ // If the child moved, we have to repaint it as well as any floating/positioned
+ // descendants. An exception is if we need a layout. In this case, we know we're going to
+ // repaint ourselves (and the child) anyway.
+ if (!table()->selfNeedsLayout() && cell->checkForRepaintDuringLayout())
+ cell->repaintDuringLayoutIfMoved(oldCellRect);
+ }
}
}
diff --git a/WebCore/rendering/RenderText.cpp b/WebCore/rendering/RenderText.cpp
index da152b0..d786e6a 100644
--- a/WebCore/rendering/RenderText.cpp
+++ b/WebCore/rendering/RenderText.cpp
@@ -310,10 +310,46 @@ void RenderText::absoluteRectsForRange(Vector<IntRect>& rects, unsigned start, u
}
}
+static IntRect ellipsisRectForBox(InlineTextBox* box, unsigned startPos, unsigned endPos)
+{
+ if (!box)
+ return IntRect();
+
+ unsigned short truncation = box->truncation();
+ if (truncation == cNoTruncation)
+ return IntRect();
+
+ IntRect rect;
+ if (EllipsisBox* ellipsis = box->root()->ellipsisBox()) {
+ int ellipsisStartPosition = max<int>(startPos - box->start(), 0);
+ int ellipsisEndPosition = min<int>(endPos - box->start(), box->len());
+
+ // The ellipsis should be considered to be selected if the end of
+ // the selection is past the beginning of the truncation and the
+ // beginning of the selection is before or at the beginning of the truncation.
+ if (ellipsisEndPosition >= truncation && ellipsisStartPosition <= truncation)
+ return ellipsis->selectionRect(0, 0);
+ }
+
+ return IntRect();
+}
+
+void RenderText::absoluteQuads(Vector<FloatQuad>& quads, ClippingOption option)
+{
+ for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
+ IntRect boundaries = box->calculateBoundaries();
+
+ // Shorten the width of this text box if it ends in an ellipsis.
+ IntRect ellipsisRect = (option == ClipToEllipsis) ? ellipsisRectForBox(box, 0, textLength()) : IntRect();
+ if (!ellipsisRect.isEmpty())
+ boundaries.setWidth(ellipsisRect.right() - boundaries.x());
+ quads.append(localToAbsoluteQuad(FloatRect(boundaries)));
+ }
+}
+
void RenderText::absoluteQuads(Vector<FloatQuad>& quads)
{
- for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
- quads.append(localToAbsoluteQuad(FloatRect(box->calculateBoundaries())));
+ absoluteQuads(quads, NoClipping);
}
void RenderText::absoluteQuadsForRange(Vector<FloatQuad>& quads, unsigned start, unsigned end, bool useSelectionHeight)
@@ -1270,7 +1306,7 @@ IntRect RenderText::selectionRectForRepaint(RenderBoxModelObject* repaintContain
if (selectionState() == SelectionNone)
return IntRect();
- RenderBlock* cb = containingBlock();
+ RenderBlock* cb = containingBlock();
if (!cb)
return IntRect();
@@ -1295,21 +1331,7 @@ IntRect RenderText::selectionRectForRepaint(RenderBoxModelObject* repaintContain
IntRect rect;
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
rect.unite(box->selectionRect(0, 0, startPos, endPos));
-
- // Check if there are ellipsis which fall within the selection.
- unsigned short truncation = box->truncation();
- if (truncation != cNoTruncation) {
- if (EllipsisBox* ellipsis = box->root()->ellipsisBox()) {
- int ePos = min<int>(endPos - box->start(), box->len());
- int sPos = max<int>(startPos - box->start(), 0);
- // The ellipsis should be considered to be selected if the end of
- // the selection is past the beginning of the truncation and the
- // beginning of the selection is before or at the beginning of the
- // truncation.
- if (ePos >= truncation && sPos <= truncation)
- rect.unite(ellipsis->selectionRect(0, 0));
- }
- }
+ rect.unite(ellipsisRectForBox(box, startPos, endPos));
}
if (clipToVisibleContent)
diff --git a/WebCore/rendering/RenderText.h b/WebCore/rendering/RenderText.h
index f46f053..6ab73f6 100644
--- a/WebCore/rendering/RenderText.h
+++ b/WebCore/rendering/RenderText.h
@@ -62,6 +62,9 @@ public:
virtual void absoluteQuads(Vector<FloatQuad>&);
void absoluteQuadsForRange(Vector<FloatQuad>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false);
+ enum ClippingOption { NoClipping, ClipToEllipsis };
+ void absoluteQuads(Vector<FloatQuad>&, ClippingOption option = NoClipping);
+
virtual VisiblePosition positionForPoint(const IntPoint&);
const UChar* characters() const { return m_text.characters(); }
@@ -83,7 +86,7 @@ public:
int& beginMaxW, int& endMaxW,
int& minW, int& maxW, bool& stripFrontSpaces);
- IntRect linesBoundingBox() const;
+ virtual IntRect linesBoundingBox() const;
IntPoint firstRunOrigin() const;
int firstRunX() const;
diff --git a/WebCore/rendering/RenderTextFragment.h b/WebCore/rendering/RenderTextFragment.h
index e351436..e023042 100644
--- a/WebCore/rendering/RenderTextFragment.h
+++ b/WebCore/rendering/RenderTextFragment.h
@@ -59,6 +59,21 @@ private:
RenderObject* m_firstLetter;
};
+inline RenderTextFragment* toRenderTextFragment(RenderObject* object)
+{
+ ASSERT(!object || toRenderText(object)->isTextFragment());
+ return static_cast<RenderTextFragment*>(object);
+}
+
+inline const RenderTextFragment* toRenderTextFragment(const RenderObject* object)
+{
+ ASSERT(!object || toRenderText(object)->isTextFragment());
+ return static_cast<const RenderTextFragment*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toRenderTextFragment(const RenderTextFragment*);
+
} // namespace WebCore
#endif // RenderTextFragment_h
diff --git a/WebCore/rendering/RenderThemeWin.cpp b/WebCore/rendering/RenderThemeWin.cpp
index 8a33173..b4fb8eb 100644
--- a/WebCore/rendering/RenderThemeWin.cpp
+++ b/WebCore/rendering/RenderThemeWin.cpp
@@ -749,15 +749,16 @@ const int sliderThumbHeight = 15;
void RenderThemeWin::adjustSliderThumbSize(RenderObject* o) const
{
- if (o->style()->appearance() == SliderThumbVerticalPart) {
+ ControlPart part = o->style()->appearance();
+ if (part == SliderThumbVerticalPart) {
o->style()->setWidth(Length(sliderThumbHeight, Fixed));
o->style()->setHeight(Length(sliderThumbWidth, Fixed));
- } else if (o->style()->appearance() == SliderThumbHorizontalPart) {
+ } else if (part == SliderThumbHorizontalPart) {
o->style()->setWidth(Length(sliderThumbWidth, Fixed));
o->style()->setHeight(Length(sliderThumbHeight, Fixed));
}
#if ENABLE(VIDEO)
- else if (o->style()->appearance() == MediaSliderThumbPart)
+ else if (part == MediaSliderThumbPart || part == MediaVolumeSliderThumbPart)
RenderMediaControls::adjustMediaSliderThumbSize(o);
#endif
}
@@ -937,6 +938,11 @@ Color RenderThemeWin::systemColor(int cssValueId) const
#if ENABLE(VIDEO)
+String RenderThemeWin::extraMediaControlsStyleSheet()
+{
+ return String(mediaControlsQuickTimeUserAgentStyleSheet, sizeof(mediaControlsQuickTimeUserAgentStyleSheet));
+}
+
bool RenderThemeWin::shouldRenderMediaControlPart(ControlPart part, Element* element)
{
if (part == MediaToggleClosedCaptionsButtonPart) {
@@ -968,6 +974,11 @@ bool RenderThemeWin::paintMediaPlayButton(RenderObject* o, const PaintInfo& pain
return RenderMediaControls::paintMediaControlsPart(MediaPlayButton, o, paintInfo, r);
}
+bool RenderThemeWin::paintMediaRewindButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+{
+ return RenderMediaControls::paintMediaControlsPart(MediaRewindButton, o, paintInfo, r);
+}
+
bool RenderThemeWin::paintMediaSeekBackButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
return RenderMediaControls::paintMediaControlsPart(MediaSeekBackButton, o, paintInfo, r);
@@ -993,6 +1004,32 @@ bool RenderThemeWin::paintMediaToggleClosedCaptionsButton(RenderObject* o, const
return RenderMediaControls::paintMediaControlsPart(MediaShowClosedCaptionsButton, o, paintInfo, r);
}
+bool RenderThemeWin::paintMediaControlsBackground(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+{
+ return RenderMediaControls::paintMediaControlsPart(MediaTimelineContainer, o, paintInfo, r);
+}
+
+bool RenderThemeWin::paintMediaVolumeSliderContainer(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+{
+ return RenderMediaControls::paintMediaControlsPart(MediaVolumeSliderContainer, o, paintInfo, r);
+}
+
+bool RenderThemeWin::paintMediaVolumeSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+{
+ return RenderMediaControls::paintMediaControlsPart(MediaVolumeSlider, o, paintInfo, r);
+}
+
+bool RenderThemeWin::paintMediaVolumeSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+{
+ return RenderMediaControls::paintMediaControlsPart(MediaVolumeSliderThumb, o, paintInfo, r);
+}
+
+IntPoint RenderThemeWin::volumeSliderOffsetFromMuteButton(Node* muteButton, const IntSize& size) const
+{
+ return RenderMediaControls::volumeSliderOffsetFromMuteButton(muteButton, size);
+}
+
+
#endif
}
diff --git a/WebCore/rendering/RenderThemeWin.h b/WebCore/rendering/RenderThemeWin.h
index 0147900..1efb117 100644
--- a/WebCore/rendering/RenderThemeWin.h
+++ b/WebCore/rendering/RenderThemeWin.h
@@ -120,15 +120,22 @@ public:
virtual bool supportsFocusRing(const RenderStyle*) const;
#if ENABLE(VIDEO)
+ virtual String extraMediaControlsStyleSheet();
virtual bool shouldRenderMediaControlPart(ControlPart, Element*);
+ virtual bool paintMediaControlsBackground(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, const IntRect&);
- virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const IntRect&);
+ virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&);
+ virtual bool paintMediaRewindButton(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool paintMediaSeekBackButton(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool paintMediaSeekForwardButton(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const PaintInfo&, const IntRect&);
+ virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&, const IntRect&);
+ virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
+ virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
+ virtual IntPoint volumeSliderOffsetFromMuteButton(Node*, const IntSize&) const;
#endif
private:
diff --git a/WebCore/rendering/RenderThemeWince.cpp b/WebCore/rendering/RenderThemeWinCE.cpp
index 117601b..66cda11 100644
--- a/WebCore/rendering/RenderThemeWince.cpp
+++ b/WebCore/rendering/RenderThemeWinCE.cpp
@@ -22,7 +22,7 @@
*/
#include "config.h"
-#include "RenderThemeWince.h"
+#include "RenderThemeWinCE.h"
#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
@@ -83,49 +83,49 @@ namespace WebCore {
static const int dropDownButtonWidth = 17;
static const int trackWidth = 4;
-PassRefPtr<RenderTheme> RenderThemeWince::create()
+PassRefPtr<RenderTheme> RenderThemeWinCE::create()
{
- return adoptRef(new RenderThemeWince);
+ return adoptRef(new RenderThemeWinCE);
}
PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page* page)
{
- static RenderTheme* winceTheme = RenderThemeWince::create().releaseRef();
+ static RenderTheme* winceTheme = RenderThemeWinCE::create().releaseRef();
return winceTheme;
}
-RenderThemeWince::RenderThemeWince()
+RenderThemeWinCE::RenderThemeWinCE()
{
}
-RenderThemeWince::~RenderThemeWince()
+RenderThemeWinCE::~RenderThemeWinCE()
{
}
-Color RenderThemeWince::platformActiveSelectionBackgroundColor() const
+Color RenderThemeWinCE::platformActiveSelectionBackgroundColor() const
{
COLORREF color = GetSysColor(COLOR_HIGHLIGHT);
return Color(GetRValue(color), GetGValue(color), GetBValue(color), 255);
}
-Color RenderThemeWince::platformInactiveSelectionBackgroundColor() const
+Color RenderThemeWinCE::platformInactiveSelectionBackgroundColor() const
{
COLORREF color = GetSysColor(COLOR_GRAYTEXT);
return Color(GetRValue(color), GetGValue(color), GetBValue(color), 255);
}
-Color RenderThemeWince::platformActiveSelectionForegroundColor() const
+Color RenderThemeWinCE::platformActiveSelectionForegroundColor() const
{
COLORREF color = GetSysColor(COLOR_HIGHLIGHTTEXT);
return Color(GetRValue(color), GetGValue(color), GetBValue(color), 255);
}
-Color RenderThemeWince::platformInactiveSelectionForegroundColor() const
+Color RenderThemeWinCE::platformInactiveSelectionForegroundColor() const
{
return Color::white;
}
-bool RenderThemeWince::supportsFocus(ControlPart appearance) const
+bool RenderThemeWinCE::supportsFocus(ControlPart appearance) const
{
switch (appearance) {
case PushButtonPart:
@@ -140,12 +140,12 @@ bool RenderThemeWince::supportsFocus(ControlPart appearance) const
return false;
}
-bool RenderThemeWince::supportsFocusRing(const RenderStyle *style) const
+bool RenderThemeWinCE::supportsFocusRing(const RenderStyle *style) const
{
return supportsFocus(style->appearance());
}
-unsigned RenderThemeWince::determineClassicState(RenderObject* o)
+unsigned RenderThemeWinCE::determineClassicState(RenderObject* o)
{
unsigned result = 0;
if (!isEnabled(o) || isReadOnlyControl(o))
@@ -158,7 +158,7 @@ unsigned RenderThemeWince::determineClassicState(RenderObject* o)
return result;
}
-ThemeData RenderThemeWince::getThemeData(RenderObject* o)
+ThemeData RenderThemeWinCE::getThemeData(RenderObject* o)
{
ThemeData result;
switch (o->style()->appearance()) {
@@ -188,7 +188,7 @@ ThemeData RenderThemeWince::getThemeData(RenderObject* o)
return result;
}
-bool RenderThemeWince::paintButton(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWinCE::paintButton(RenderObject* o, const PaintInfo& i, const IntRect& r)
{
// Get the correct theme data for a button
ThemeData themeData = getThemeData(o);
@@ -207,7 +207,7 @@ bool RenderThemeWince::paintButton(RenderObject* o, const PaintInfo& i, const In
return false;
}
-void RenderThemeWince::setCheckboxSize(RenderStyle* style) const
+void RenderThemeWinCE::setCheckboxSize(RenderStyle* style) const
{
// If the width and height are both specified, then we have nothing to do.
if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto())
@@ -223,7 +223,7 @@ void RenderThemeWince::setCheckboxSize(RenderStyle* style) const
style->setHeight(Length(13, Fixed));
}
-bool RenderThemeWince::paintTextField(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWinCE::paintTextField(RenderObject* o, const PaintInfo& i, const IntRect& r)
{
// Get the correct theme data for a textfield
ThemeData themeData = getThemeData(o);
@@ -234,20 +234,20 @@ bool RenderThemeWince::paintTextField(RenderObject* o, const PaintInfo& i, const
return false;
}
-void RenderThemeWince::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+void RenderThemeWinCE::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
{
style->resetBorder();
adjustMenuListButtonStyle(selector, style, e);
}
-bool RenderThemeWince::paintMenuList(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWinCE::paintMenuList(RenderObject* o, const PaintInfo& i, const IntRect& r)
{
paintTextField(o, i, r);
paintMenuListButton(o, i, r);
return true;
}
-bool RenderThemeWince::paintMenuListButton(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWinCE::paintMenuListButton(RenderObject* o, const PaintInfo& i, const IntRect& r)
{
IntRect buttonRect(r.right() - dropDownButtonWidth - 1, r.y(), dropDownButtonWidth, r.height());
buttonRect.inflateY(-1);
@@ -255,28 +255,28 @@ bool RenderThemeWince::paintMenuListButton(RenderObject* o, const PaintInfo& i,
return true;
}
-void RenderThemeWince::systemFont(int propId, FontDescription& fontDescription) const
+void RenderThemeWinCE::systemFont(int propId, FontDescription& fontDescription) const
{
notImplemented();
}
-void RenderThemeWince::themeChanged()
+void RenderThemeWinCE::themeChanged()
{
}
-String RenderThemeWince::extraDefaultStyleSheet()
+String RenderThemeWinCE::extraDefaultStyleSheet()
{
notImplemented();
return String();
}
-String RenderThemeWince::extraQuirksStyleSheet()
+String RenderThemeWinCE::extraQuirksStyleSheet()
{
notImplemented();
return String();
}
-bool RenderThemeWince::supportsHover(const RenderStyle*) const
+bool RenderThemeWinCE::supportsHover(const RenderStyle*) const
{
return false;
}
@@ -317,7 +317,7 @@ static int cssValueIdToSysColorIndex(int cssValueId)
}
}
-Color RenderThemeWince::systemColor(int cssValueId) const
+Color RenderThemeWinCE::systemColor(int cssValueId) const
{
int sysColorIndex = cssValueIdToSysColorIndex(cssValueId);
if (sysColorIndex == -1)
@@ -330,7 +330,7 @@ Color RenderThemeWince::systemColor(int cssValueId) const
const int sliderThumbWidth = 7;
const int sliderThumbHeight = 15;
-void RenderThemeWince::adjustSliderThumbSize(RenderObject* o) const
+void RenderThemeWinCE::adjustSliderThumbSize(RenderObject* o) const
{
if (o->style()->appearance() == SliderThumbVerticalPart) {
o->style()->setWidth(Length(sliderThumbHeight, Fixed));
@@ -342,7 +342,7 @@ void RenderThemeWince::adjustSliderThumbSize(RenderObject* o) const
}
#if 0
-void RenderThemeWince::adjustButtonInnerStyle(RenderStyle* style) const
+void RenderThemeWinCE::adjustButtonInnerStyle(RenderStyle* style) const
{
// This inner padding matches Firefox.
style->setPaddingTop(Length(1, Fixed));
@@ -351,7 +351,7 @@ void RenderThemeWince::adjustButtonInnerStyle(RenderStyle* style) const
style->setPaddingLeft(Length(3, Fixed));
}
-void RenderThemeWince::adjustSearchFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+void RenderThemeWinCE::adjustSearchFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
{
// Override padding size to match AppKit text positioning.
const int padding = 1;
@@ -362,12 +362,12 @@ void RenderThemeWince::adjustSearchFieldStyle(CSSStyleSelector* selector, Render
}
#endif
-bool RenderThemeWince::paintSearchField(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWinCE::paintSearchField(RenderObject* o, const PaintInfo& i, const IntRect& r)
{
return paintTextField(o, i, r);
}
-bool RenderThemeWince::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeWinCE::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
Color buttonColor = (o->node() && o->node()->active()) ? Color(138, 138, 138) : Color(186, 186, 186);
@@ -391,47 +391,47 @@ bool RenderThemeWince::paintSearchFieldCancelButton(RenderObject* o, const Paint
return false;
}
-void RenderThemeWince::adjustSearchFieldCancelButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+void RenderThemeWinCE::adjustSearchFieldCancelButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
{
IntSize cancelSize(13, 11);
style->setWidth(Length(cancelSize.width(), Fixed));
style->setHeight(Length(cancelSize.height(), Fixed));
}
-void RenderThemeWince::adjustSearchFieldDecorationStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+void RenderThemeWinCE::adjustSearchFieldDecorationStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
{
IntSize emptySize(1, 11);
style->setWidth(Length(emptySize.width(), Fixed));
style->setHeight(Length(emptySize.height(), Fixed));
}
-void RenderThemeWince::adjustSearchFieldResultsDecorationStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+void RenderThemeWinCE::adjustSearchFieldResultsDecorationStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
{
IntSize magnifierSize(15, 11);
style->setWidth(Length(magnifierSize.width(), Fixed));
style->setHeight(Length(magnifierSize.height(), Fixed));
}
-bool RenderThemeWince::paintSearchFieldResultsDecoration(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeWinCE::paintSearchFieldResultsDecoration(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
notImplemented();
return false;
}
-void RenderThemeWince::adjustSearchFieldResultsButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+void RenderThemeWinCE::adjustSearchFieldResultsButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
{
IntSize magnifierSize(15, 11);
style->setWidth(Length(magnifierSize.width(), Fixed));
style->setHeight(Length(magnifierSize.height(), Fixed));
}
-bool RenderThemeWince::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeWinCE::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
paintSearchFieldResultsDecoration(o, paintInfo, r);
return false;
}
-void RenderThemeWince::adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+void RenderThemeWinCE::adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
{
// These are the paddings needed to place the text correctly in the <select> box
const int dropDownBoxPaddingTop = 2;
@@ -485,7 +485,7 @@ static HTMLMediaElement* mediaElementParent(Node* node)
}
#endif
-bool RenderThemeWince::paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWinCE::paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r)
{
bool rc = RenderTheme::paintSliderTrack(o, i, r);
IntPoint left = IntPoint(r.x() + 2, (r.y() + r.bottom()) / 2);
@@ -508,7 +508,7 @@ bool RenderThemeWince::paintSliderTrack(RenderObject* o, const PaintInfo& i, con
return rc;
}
-bool RenderThemeWince::paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWinCE::paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r)
{
bool rc = RenderTheme::paintSliderThumb(o, i, r);
i.context->save();
@@ -528,7 +528,7 @@ bool RenderThemeWince::paintSliderThumb(RenderObject* o, const PaintInfo& i, con
return rc;
}
-void RenderThemeWince::adjustSearchFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+void RenderThemeWinCE::adjustSearchFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
{
const int padding = 1;
style->setPaddingLeft(Length(padding, Fixed));
@@ -539,7 +539,7 @@ void RenderThemeWince::adjustSearchFieldStyle(CSSStyleSelector* selector, Render
#if ENABLE(VIDEO)
-bool RenderThemeWince::paintMediaFullscreenButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeWinCE::paintMediaFullscreenButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
bool rc = paintButton(o, paintInfo, r);
FloatRect imRect = r;
@@ -552,7 +552,7 @@ bool RenderThemeWince::paintMediaFullscreenButton(RenderObject* o, const PaintIn
return rc;
}
-bool RenderThemeWince::paintMediaMuteButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeWinCE::paintMediaMuteButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
bool rc = paintButton(o, paintInfo, r);
HTMLMediaElement* mediaElement = mediaElementParent(o->node());
@@ -577,7 +577,7 @@ bool RenderThemeWince::paintMediaMuteButton(RenderObject* o, const PaintInfo& pa
return rc;
}
-bool RenderThemeWince::paintMediaPlayButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeWinCE::paintMediaPlayButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
bool rc = paintButton(o, paintInfo, r);
FloatRect imRect = r;
@@ -601,7 +601,7 @@ bool RenderThemeWince::paintMediaPlayButton(RenderObject* o, const PaintInfo& pa
return rc;
}
-bool RenderThemeWince::paintMediaSeekBackButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeWinCE::paintMediaSeekBackButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
bool rc = paintButton(o, paintInfo, r);
FloatRect imRect = r;
@@ -617,7 +617,7 @@ bool RenderThemeWince::paintMediaSeekBackButton(RenderObject* o, const PaintInfo
return rc;
}
-bool RenderThemeWince::paintMediaSeekForwardButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeWinCE::paintMediaSeekForwardButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
bool rc = paintButton(o, paintInfo, r);
FloatRect imRect = r;
@@ -633,15 +633,15 @@ bool RenderThemeWince::paintMediaSeekForwardButton(RenderObject* o, const PaintI
return rc;
}
-bool RenderThemeWince::paintMediaSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeWinCE::paintMediaSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
return paintSliderTrack(o, paintInfo, r);
}
-bool RenderThemeWince::paintMediaSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeWinCE::paintMediaSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
return paintSliderThumb(o, paintInfo, r);
}
#endif
-}
+} // namespace WebCore
diff --git a/WebCore/rendering/RenderThemeWince.h b/WebCore/rendering/RenderThemeWinCE.h
index c1b57d4..14a5b12 100644
--- a/WebCore/rendering/RenderThemeWince.h
+++ b/WebCore/rendering/RenderThemeWinCE.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef RenderThemeWince_h
-#define RenderThemeWince_h
+#ifndef RenderThemeWinCE_h
+#define RenderThemeWinCE_h
#include "RenderTheme.h"
@@ -45,10 +45,10 @@ namespace WebCore {
unsigned m_classicState;
};
- class RenderThemeWince : public RenderTheme {
+ class RenderThemeWinCE : public RenderTheme {
public:
static PassRefPtr<RenderTheme> create();
- ~RenderThemeWince();
+ ~RenderThemeWinCE();
virtual String extraDefaultStyleSheet();
virtual String extraQuirksStyleSheet();
@@ -129,7 +129,7 @@ namespace WebCore {
#endif
private:
- RenderThemeWince();
+ RenderThemeWinCE();
unsigned determineClassicState(RenderObject*);
bool supportsFocus(ControlPart) const;
@@ -139,4 +139,4 @@ namespace WebCore {
};
-#endif
+#endif // RenderThemeWinCE_h
diff --git a/WebCore/rendering/RenderVideo.cpp b/WebCore/rendering/RenderVideo.cpp
index 3f4e2bf..3dfee7b 100644
--- a/WebCore/rendering/RenderVideo.cpp
+++ b/WebCore/rendering/RenderVideo.cpp
@@ -80,6 +80,7 @@ void RenderVideo::intrinsicSizeChanged()
void RenderVideo::updateIntrinsicSize()
{
IntSize size = calculateIntrinsicSize();
+ size.scale(style()->effectiveZoom());
// Never set the element size to zero when in a media document.
if (size.isEmpty() && node()->ownerDocument() && node()->ownerDocument()->isMediaDocument())
@@ -187,9 +188,6 @@ void RenderVideo::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
MediaPlayer* mediaPlayer = player();
bool displayingPoster = videoElement()->shouldDisplayPosterImage();
- if (displayingPoster && document()->printing() && !view()->printImages())
- return;
-
if (!displayingPoster) {
if (!mediaPlayer)
return;
@@ -250,53 +248,17 @@ void RenderVideo::updatePlayer()
int RenderVideo::calcReplacedWidth(bool includeMaxWidth) const
{
- int width;
- if (isWidthSpecified())
- width = calcReplacedWidthUsing(style()->width());
- else
- width = calcAspectRatioWidth() * style()->effectiveZoom();
-
- int minW = calcReplacedWidthUsing(style()->minWidth());
- int maxW = !includeMaxWidth || style()->maxWidth().isUndefined() ? width : calcReplacedWidthUsing(style()->maxWidth());
-
- return max(minW, min(width, maxW));
+ return RenderReplaced::calcReplacedWidth(includeMaxWidth);
}
int RenderVideo::calcReplacedHeight() const
{
- int height;
- if (isHeightSpecified())
- height = calcReplacedHeightUsing(style()->height());
- else
- height = calcAspectRatioHeight() * style()->effectiveZoom();
-
- int minH = calcReplacedHeightUsing(style()->minHeight());
- int maxH = style()->maxHeight().isUndefined() ? height : calcReplacedHeightUsing(style()->maxHeight());
-
- return max(minH, min(height, maxH));
-}
-
-int RenderVideo::calcAspectRatioWidth() const
-{
- int intrinsicWidth = intrinsicSize().width();
- int intrinsicHeight = intrinsicSize().height();
- if (!intrinsicHeight)
- return 0;
- return RenderBox::calcReplacedHeight() * intrinsicWidth / intrinsicHeight;
-}
-
-int RenderVideo::calcAspectRatioHeight() const
-{
- int intrinsicWidth = intrinsicSize().width();
- int intrinsicHeight = intrinsicSize().height();
- if (!intrinsicWidth)
- return 0;
- return RenderBox::calcReplacedWidth() * intrinsicHeight / intrinsicWidth;
+ return RenderReplaced::calcReplacedHeight();
}
int RenderVideo::minimumReplacedHeight() const
{
- return 0;
+ return RenderReplaced::minimumReplacedHeight();
}
#if USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/rendering/RenderVideo.h b/WebCore/rendering/RenderVideo.h
index dd7a531..2c47471 100644
--- a/WebCore/rendering/RenderVideo.h
+++ b/WebCore/rendering/RenderVideo.h
@@ -74,9 +74,6 @@ private:
virtual int calcReplacedHeight() const;
virtual int minimumReplacedHeight() const;
- int calcAspectRatioWidth() const;
- int calcAspectRatioHeight() const;
-
void updatePlayer();
IntSize m_cachedImageSize;
diff --git a/WebCore/rendering/RenderView.cpp b/WebCore/rendering/RenderView.cpp
index eba3468..edee4f6 100644
--- a/WebCore/rendering/RenderView.cpp
+++ b/WebCore/rendering/RenderView.cpp
@@ -52,12 +52,8 @@ RenderView::RenderView(Node* node, FrameView* view)
, m_selectionEnd(0)
, m_selectionStartPos(-1)
, m_selectionEndPos(-1)
- , m_printImages(true)
, m_maximalOutlineSize(0)
- , m_bestTruncatedAt(0)
- , m_truncatorWidth(0)
- , m_minimumColumnHeight(0)
- , m_forcedPageBreak(false)
+ , m_pageHeight(0)
, m_layoutState(0)
, m_layoutStateDisableCount(0)
{
@@ -112,6 +108,9 @@ void RenderView::calcPrefWidths()
void RenderView::layout()
{
+ if (!document()->paginated())
+ setPageHeight(0);
+
if (printing())
m_minPrefWidth = m_maxPrefWidth = width();
@@ -129,6 +128,7 @@ void RenderView::layout()
LayoutState state;
// FIXME: May be better to push a clip and avoid issuing offscreen repaints.
state.m_clipped = false;
+ state.m_pageHeight = m_pageHeight;
m_layoutState = &state;
if (needsLayout())
@@ -138,7 +138,6 @@ void RenderView::layout()
m_overflow.clear();
addLayoutOverflow(IntRect(0, 0, docWidth(), docHeight()));
-
ASSERT(layoutDelta() == IntSize());
ASSERT(m_layoutStateDisableCount == 0);
ASSERT(m_layoutState == &state);
@@ -184,12 +183,6 @@ void RenderView::paint(PaintInfo& paintInfo, int tx, int ty)
{
// If we ever require layout but receive a paint anyway, something has gone horribly wrong.
ASSERT(!needsLayout());
-
- // Cache the print rect because the dirty rect could get changed during painting.
- if (document()->paginated())
- setPrintRect(paintInfo.rect);
- else
- setPrintRect(IntRect());
paintObject(paintInfo, tx, ty);
}
@@ -703,37 +696,12 @@ int RenderView::viewWidth() const
float RenderView::zoomFactor() const
{
- if (!m_frameView->shouldApplyPageZoom())
- return 1;
- return m_frameView->zoomFactor();
-}
-
-// The idea here is to take into account what object is moving the pagination point, and
-// thus choose the best place to chop it.
-void RenderView::setBestTruncatedAt(int y, RenderBoxModelObject* forRenderer, bool forcedBreak)
-{
- // Nobody else can set a page break once we have a forced break.
- if (m_forcedPageBreak)
- return;
-
- // Forced breaks always win over unforced breaks.
- if (forcedBreak) {
- m_forcedPageBreak = true;
- m_bestTruncatedAt = y;
- return;
- }
-
- // Prefer the widest object that tries to move the pagination point
- IntRect boundingBox = forRenderer->borderBoundingBox();
- if (boundingBox.width() > m_truncatorWidth) {
- m_truncatorWidth = boundingBox.width();
- m_bestTruncatedAt = y;
- }
+ Frame* frame = m_frameView->frame();
+ return frame ? frame->pageZoomFactor() : 1;
}
void RenderView::pushLayoutState(RenderObject* root)
{
- ASSERT(!doingFullRepaint());
ASSERT(m_layoutStateDisableCount == 0);
ASSERT(m_layoutState == 0);
@@ -765,6 +733,31 @@ void RenderView::updateHitTestResult(HitTestResult& result, const IntPoint& poin
}
}
+// FIXME: This function is obsolete and only used by embedded WebViews inside AppKit NSViews.
+// Do not add callers of this function!
+// The idea here is to take into account what object is moving the pagination point, and
+// thus choose the best place to chop it.
+void RenderView::setBestTruncatedAt(int y, RenderBoxModelObject* forRenderer, bool forcedBreak)
+{
+ // Nobody else can set a page break once we have a forced break.
+ if (m_legacyPrinting.m_forcedPageBreak)
+ return;
+
+ // Forced breaks always win over unforced breaks.
+ if (forcedBreak) {
+ m_legacyPrinting.m_forcedPageBreak = true;
+ m_legacyPrinting.m_bestTruncatedAt = y;
+ return;
+ }
+
+ // Prefer the widest object that tries to move the pagination point
+ IntRect boundingBox = forRenderer->borderBoundingBox();
+ if (boundingBox.width() > m_legacyPrinting.m_truncatorWidth) {
+ m_legacyPrinting.m_truncatorWidth = boundingBox.width();
+ m_legacyPrinting.m_bestTruncatedAt = y;
+ }
+}
+
#if USE(ACCELERATED_COMPOSITING)
bool RenderView::usesCompositing() const
{
diff --git a/WebCore/rendering/RenderView.h b/WebCore/rendering/RenderView.h
index 8145cac..55aa3b4 100644
--- a/WebCore/rendering/RenderView.h
+++ b/WebCore/rendering/RenderView.h
@@ -77,19 +77,6 @@ public:
void selectionStartEnd(int& startPos, int& endPos) const;
bool printing() const;
- void setPrintImages(bool enable) { m_printImages = enable; }
- bool printImages() const { return m_printImages; }
-
- IntRect printRect() const { return m_printRect; }
- void setPrintRect(const IntRect& r) { m_printRect = r; }
-
- void setTruncatedAt(int y) { m_truncatedAt = y; m_bestTruncatedAt = m_truncatorWidth = 0; m_minimumColumnHeight = 0; m_forcedPageBreak = false; }
- void setBestTruncatedAt(int y, RenderBoxModelObject* forRenderer, bool forcedBreak = false);
- void setMinimumColumnHeight(int height) { m_minimumColumnHeight = height; }
- int bestTruncatedAt() const { return m_bestTruncatedAt; }
- int minimumColumnHeight() const { return m_minimumColumnHeight; }
-
- int truncatedAt() const { return m_truncatedAt; }
virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual void absoluteQuads(Vector<FloatQuad>&);
@@ -125,24 +112,9 @@ public:
bool doingFullRepaint() const { return m_frameView->needsFullRepaint(); }
- void pushLayoutState(RenderBox* renderer, const IntSize& offset)
- {
- if (doingFullRepaint())
- return;
- // We push LayoutState even if layoutState is disabled because it stores layoutDelta too.
- m_layoutState = new (renderArena()) LayoutState(m_layoutState, renderer, offset);
- }
-
+ // Subtree push/pop
void pushLayoutState(RenderObject*);
-
- void popLayoutState()
- {
- if (doingFullRepaint())
- return;
- LayoutState* state = m_layoutState;
- m_layoutState = state->m_next;
- state->destroy(renderArena());
- }
+ void popLayoutState(RenderObject*) { return popLayoutState(); } // Just doing this to keep popLayoutState() private and to make the subtree calls symmetrical.
bool shouldDisableLayoutStateForSubtree(RenderObject*) const;
@@ -159,6 +131,30 @@ public:
virtual void updateHitTestResult(HitTestResult&, const IntPoint&);
+ unsigned pageHeight() const { return m_pageHeight; }
+ void setPageHeight(unsigned height)
+ {
+ if (m_pageHeight != height) {
+ m_pageHeight = height;
+ markDescendantBlocksAndLinesForLayout();
+ }
+ }
+
+ // FIXME: These functions are deprecated. No code should be added that uses these.
+ int bestTruncatedAt() const { return m_legacyPrinting.m_bestTruncatedAt; }
+ void setBestTruncatedAt(int y, RenderBoxModelObject* forRenderer, bool forcedBreak = false);
+ int truncatedAt() const { return m_legacyPrinting.m_truncatedAt; }
+ void setTruncatedAt(int y)
+ {
+ m_legacyPrinting.m_truncatedAt = y;
+ m_legacyPrinting.m_bestTruncatedAt = 0;
+ m_legacyPrinting.m_truncatorWidth = 0;
+ m_legacyPrinting.m_forcedPageBreak = false;
+ }
+ const IntRect& printRect() const { return m_legacyPrinting.m_printRect; }
+ void setPrintRect(const IntRect& r) { m_legacyPrinting.m_printRect = r; }
+ // End deprecated functions.
+
// Notifications that this view became visible in a window, or will be
// removed from the window.
void didMoveOnscreen();
@@ -182,6 +178,26 @@ public: // used by layout function
int docHeight() const;
int docWidth() const;
+ // These functions may only be accessed by LayoutStateMaintainer.
+ bool pushLayoutState(RenderBox* renderer, const IntSize& offset, int pageHeight = 0, ColumnInfo* colInfo = 0)
+ {
+ // We push LayoutState even if layoutState is disabled because it stores layoutDelta too.
+ if (!doingFullRepaint() || renderer->hasColumns() || m_layoutState->isPaginated()) {
+ m_layoutState = new (renderArena()) LayoutState(m_layoutState, renderer, offset, pageHeight, colInfo);
+ return true;
+ }
+ return false;
+ }
+
+ void popLayoutState()
+ {
+ LayoutState* state = m_layoutState;
+ m_layoutState = state->m_next;
+ state->destroy(renderArena());
+ }
+
+ friend class LayoutStateMaintainer;
+
protected:
FrameView* m_frameView;
@@ -190,22 +206,31 @@ protected:
int m_selectionStartPos;
int m_selectionEndPos;
- // used to ignore viewport width when printing to the printer
- bool m_printImages;
- int m_truncatedAt;
+ // FIXME: Only used by embedded WebViews inside AppKit NSViews. Find a way to remove.
+ struct LegacyPrinting {
+ LegacyPrinting()
+ : m_bestTruncatedAt(0)
+ , m_truncatedAt(0)
+ , m_truncatorWidth(0)
+ , m_forcedPageBreak(false)
+ { }
+
+ int m_bestTruncatedAt;
+ int m_truncatedAt;
+ int m_truncatorWidth;
+ IntRect m_printRect;
+ bool m_forcedPageBreak;
+ };
+ LegacyPrinting m_legacyPrinting;
+ // End deprecated members.
int m_maximalOutlineSize; // Used to apply a fudge factor to dirty-rect checks on blocks/tables.
- IntRect m_printRect; // Used when printing.
typedef HashSet<RenderWidget*> RenderWidgetSet;
-
RenderWidgetSet m_widgets;
-
+
private:
- int m_bestTruncatedAt;
- int m_truncatorWidth;
- int m_minimumColumnHeight;
- bool m_forcedPageBreak;
+ unsigned m_pageHeight;
LayoutState* m_layoutState;
unsigned m_layoutStateDisableCount;
#if USE(ACCELERATED_COMPOSITING)
@@ -233,13 +258,14 @@ void toRenderView(const RenderView*);
class LayoutStateMaintainer : public Noncopyable {
public:
// ctor to push now
- LayoutStateMaintainer(RenderView* view, RenderBox* root, IntSize offset, bool disableState = false)
+ LayoutStateMaintainer(RenderView* view, RenderBox* root, IntSize offset, bool disableState = false, int pageHeight = 0, ColumnInfo* colInfo = 0)
: m_view(view)
, m_disabled(disableState)
, m_didStart(false)
, m_didEnd(false)
+ , m_didCreateLayoutState(false)
{
- push(root, offset);
+ push(root, offset, pageHeight, colInfo);
}
// ctor to maybe push later
@@ -248,6 +274,7 @@ public:
, m_disabled(false)
, m_didStart(false)
, m_didEnd(false)
+ , m_didCreateLayoutState(false)
{
}
@@ -256,12 +283,12 @@ public:
ASSERT(m_didStart == m_didEnd); // if this fires, it means that someone did a push(), but forgot to pop().
}
- void push(RenderBox* root, IntSize offset)
+ void push(RenderBox* root, IntSize offset, int pageHeight = 0, ColumnInfo* colInfo = 0)
{
ASSERT(!m_didStart);
// We push state even if disabled, because we still need to store layoutDelta
- m_view->pushLayoutState(root, offset);
- if (m_disabled)
+ m_didCreateLayoutState = m_view->pushLayoutState(root, offset, pageHeight, colInfo);
+ if (m_disabled && m_didCreateLayoutState)
m_view->disableLayoutState();
m_didStart = true;
}
@@ -270,9 +297,12 @@ public:
{
if (m_didStart) {
ASSERT(!m_didEnd);
- m_view->popLayoutState();
- if (m_disabled)
- m_view->enableLayoutState();
+ if (m_didCreateLayoutState) {
+ m_view->popLayoutState();
+ if (m_disabled)
+ m_view->enableLayoutState();
+ }
+
m_didEnd = true;
}
}
@@ -284,6 +314,7 @@ private:
bool m_disabled : 1; // true if the offset and clip part of layoutState is disabled
bool m_didStart : 1; // true if we did a push or disable
bool m_didEnd : 1; // true if we popped or re-enabled
+ bool m_didCreateLayoutState : 1; // true if we actually made a layout state.
};
} // namespace WebCore
diff --git a/WebCore/rendering/RootInlineBox.h b/WebCore/rendering/RootInlineBox.h
index ff98f24..d97d0b1 100644
--- a/WebCore/rendering/RootInlineBox.h
+++ b/WebCore/rendering/RootInlineBox.h
@@ -40,6 +40,7 @@ public:
, m_lineBreakPos(0)
, m_lineTop(0)
, m_lineBottom(0)
+ , m_paginationStrut(0)
{
}
@@ -57,6 +58,9 @@ public:
int lineTop() const { return m_lineTop; }
int lineBottom() const { return m_lineBottom; }
+ int paginationStrut() const { return m_paginationStrut; }
+ void setPaginationStrut(int s) { m_paginationStrut = s; }
+
int selectionTop() const;
int selectionBottom() const { return lineBottom(); }
int selectionHeight() const { return max(0, selectionBottom() - selectionTop()); }
@@ -141,6 +145,8 @@ private:
int m_lineTop;
int m_lineBottom;
+ int m_paginationStrut;
+
// Floats hanging off the line are pushed into this vector during layout. It is only
// good for as long as the line has not been marked dirty.
OwnPtr<Vector<RenderBox*> > m_floats;
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp
index 93cd8de..4b77d6b 100644
--- a/WebCore/rendering/style/RenderStyle.cpp
+++ b/WebCore/rendering/style/RenderStyle.cpp
@@ -441,6 +441,10 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
noninherited_flags._clear != other->noninherited_flags._clear)
return StyleDifferenceLayout;
+ // Check block flow direction.
+ if (inherited_flags._blockFlow != other->inherited_flags._blockFlow)
+ return StyleDifferenceLayout;
+
// Overflow returns a layout hint.
if (noninherited_flags._overflowX != other->noninherited_flags._overflowX ||
noninherited_flags._overflowY != other->noninherited_flags._overflowY)
@@ -1060,4 +1064,184 @@ const Color RenderStyle::visitedDependentColor(int colorProperty) const
return Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), unvisitedColor.alpha());
}
+Length RenderStyle::logicalWidth() const
+{
+ if (isVerticalBlockFlow())
+ return width();
+ return height();
+}
+
+Length RenderStyle::logicalHeight() const
+{
+ if (isVerticalBlockFlow())
+ return height();
+ return width();
+}
+
+Length RenderStyle::logicalMinWidth() const
+{
+ if (isVerticalBlockFlow())
+ return minWidth();
+ return minHeight();
+}
+
+Length RenderStyle::logicalMaxWidth() const
+{
+ if (isVerticalBlockFlow())
+ return maxWidth();
+ return maxHeight();
+}
+
+Length RenderStyle::logicalMinHeight() const
+{
+ if (isVerticalBlockFlow())
+ return minHeight();
+ return minWidth();
+}
+
+Length RenderStyle::logicalMaxHeight() const
+{
+ if (isVerticalBlockFlow())
+ return maxHeight();
+ return maxWidth();
+}
+
+unsigned short RenderStyle::borderBeforeWidth() const
+{
+ switch (blockFlow()) {
+ case TopToBottomBlockFlow:
+ return borderTopWidth();
+ case BottomToTopBlockFlow:
+ return borderBottomWidth();
+ case LeftToRightBlockFlow:
+ return borderLeftWidth();
+ case RightToLeftBlockFlow:
+ return borderRightWidth();
+ }
+ ASSERT_NOT_REACHED();
+ return borderTopWidth();
+}
+
+unsigned short RenderStyle::borderAfterWidth() const
+{
+ switch (blockFlow()) {
+ case TopToBottomBlockFlow:
+ return borderBottomWidth();
+ case BottomToTopBlockFlow:
+ return borderTopWidth();
+ case LeftToRightBlockFlow:
+ return borderRightWidth();
+ case RightToLeftBlockFlow:
+ return borderLeftWidth();
+ }
+ ASSERT_NOT_REACHED();
+ return borderBottomWidth();
+}
+
+unsigned short RenderStyle::borderStartWidth() const
+{
+ if (isVerticalBlockFlow())
+ return direction() == LTR ? borderLeftWidth() : borderRightWidth();
+ return direction() == LTR ? borderTopWidth() : borderBottomWidth();
+}
+
+unsigned short RenderStyle::borderEndWidth() const
+{
+ if (isVerticalBlockFlow())
+ return direction() == LTR ? borderRightWidth() : borderLeftWidth();
+ return direction() == LTR ? borderBottomWidth() : borderTopWidth();
+}
+
+Length RenderStyle::marginBefore() const
+{
+ switch (blockFlow()) {
+ case TopToBottomBlockFlow:
+ return marginTop();
+ case BottomToTopBlockFlow:
+ return marginBottom();
+ case LeftToRightBlockFlow:
+ return marginLeft();
+ case RightToLeftBlockFlow:
+ return marginRight();
+ }
+ ASSERT_NOT_REACHED();
+ return marginTop();
+}
+
+Length RenderStyle::marginAfter() const
+{
+ switch (blockFlow()) {
+ case TopToBottomBlockFlow:
+ return marginBottom();
+ case BottomToTopBlockFlow:
+ return marginTop();
+ case LeftToRightBlockFlow:
+ return marginRight();
+ case RightToLeftBlockFlow:
+ return marginLeft();
+ }
+ ASSERT_NOT_REACHED();
+ return marginBottom();
+}
+
+Length RenderStyle::marginStart() const
+{
+ if (isVerticalBlockFlow())
+ return direction() == LTR ? marginLeft() : marginRight();
+ return direction() == LTR ? marginTop() : marginBottom();
+}
+
+Length RenderStyle::marginEnd() const
+{
+ if (isVerticalBlockFlow())
+ return direction() == LTR ? marginRight() : marginLeft();
+ return direction() == LTR ? marginBottom() : marginTop();
+}
+
+Length RenderStyle::paddingBefore() const
+{
+ switch (blockFlow()) {
+ case TopToBottomBlockFlow:
+ return paddingTop();
+ case BottomToTopBlockFlow:
+ return paddingBottom();
+ case LeftToRightBlockFlow:
+ return paddingLeft();
+ case RightToLeftBlockFlow:
+ return paddingRight();
+ }
+ ASSERT_NOT_REACHED();
+ return paddingTop();
+}
+
+Length RenderStyle::paddingAfter() const
+{
+ switch (blockFlow()) {
+ case TopToBottomBlockFlow:
+ return paddingBottom();
+ case BottomToTopBlockFlow:
+ return paddingTop();
+ case LeftToRightBlockFlow:
+ return paddingRight();
+ case RightToLeftBlockFlow:
+ return paddingLeft();
+ }
+ ASSERT_NOT_REACHED();
+ return paddingBottom();
+}
+
+Length RenderStyle::paddingStart() const
+{
+ if (isVerticalBlockFlow())
+ return direction() == LTR ? paddingLeft() : paddingRight();
+ return direction() == LTR ? paddingTop() : paddingBottom();
+}
+
+Length RenderStyle::paddingEnd() const
+{
+ if (isVerticalBlockFlow())
+ return direction() == LTR ? paddingRight() : paddingLeft();
+ return direction() == LTR ? paddingBottom() : paddingTop();
+}
+
} // namespace WebCore
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index e696735..e287ab9 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -178,7 +178,8 @@ protected:
(_visuallyOrdered == other._visuallyOrdered) &&
(_force_backgrounds_to_white == other._force_backgrounds_to_white) &&
(_pointerEvents == other._pointerEvents) &&
- (_insideLink == other._insideLink);
+ (_insideLink == other._insideLink) &&
+ (_blockFlow == other._blockFlow);
}
bool operator!=(const InheritedFlags& other) const { return !(*this == other); }
@@ -204,6 +205,10 @@ protected:
unsigned _pointerEvents : 4; // EPointerEvents
unsigned _insideLink : 2; // EInsideLink
// 43 bits
+
+ // CSS Text Layout Module Level 3: Vertical writing support
+ unsigned _blockFlow : 2; // EBlockFlowDirection
+ // 45 bits
} inherited_flags;
// don't inherit
@@ -279,6 +284,7 @@ protected:
inherited_flags._force_backgrounds_to_white = false;
inherited_flags._pointerEvents = initialPointerEvents();
inherited_flags._insideLink = NotInsideLink;
+ inherited_flags._blockFlow = initialBlockFlow();
noninherited_flags._effectiveDisplay = noninherited_flags._originalDisplay = initialDisplay();
noninherited_flags._overflowX = initialOverflowX();
@@ -384,6 +390,13 @@ public:
Length maxWidth() const { return m_box->maxWidth(); }
Length minHeight() const { return m_box->minHeight(); }
Length maxHeight() const { return m_box->maxHeight(); }
+
+ Length logicalWidth() const;
+ Length logicalHeight() const;
+ Length logicalMinWidth() const;
+ Length logicalMaxWidth() const;
+ Length logicalMinHeight() const;
+ Length logicalMaxHeight() const;
const BorderData& border() const { return surround->border; }
const BorderValue& borderLeft() const { return surround->border.left(); }
@@ -411,6 +424,11 @@ public:
unsigned short borderBottomWidth() const { return surround->border.borderBottomWidth(); }
EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); }
bool borderBottomIsTransparent() const { return surround->border.bottom().isTransparent(); }
+
+ unsigned short borderBeforeWidth() const;
+ unsigned short borderAfterWidth() const;
+ unsigned short borderStartWidth() const;
+ unsigned short borderEndWidth() const;
unsigned short outlineSize() const { return max(0, outlineWidth() + outlineOffset()); }
unsigned short outlineWidth() const
@@ -576,12 +594,20 @@ public:
Length marginBottom() const { return surround->margin.bottom(); }
Length marginLeft() const { return surround->margin.left(); }
Length marginRight() const { return surround->margin.right(); }
+ Length marginBefore() const;
+ Length marginAfter() const;
+ Length marginStart() const;
+ Length marginEnd() const;
LengthBox paddingBox() const { return surround->padding; }
Length paddingTop() const { return surround->padding.top(); }
Length paddingBottom() const { return surround->padding.bottom(); }
Length paddingLeft() const { return surround->padding.left(); }
Length paddingRight() const { return surround->padding.right(); }
+ Length paddingBefore() const;
+ Length paddingAfter() const;
+ Length paddingStart() const;
+ Length paddingEnd() const;
ECursor cursor() const { return static_cast<ECursor>(inherited_flags._cursor_style); }
@@ -712,6 +738,7 @@ public:
bool textSizeAdjust() const { return rareInheritedData->textSizeAdjust; }
ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); }
+<<<<<<< HEAD
#ifdef ANDROID_CSS_RING
// called when building nav cache to determine if the ring data is unchanged
const void* ringData() const { return reinterpret_cast<const void*>(rareInheritedData.get()); }
@@ -728,6 +755,10 @@ public:
#ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR
Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; }
#endif
+=======
+ EBlockFlowDirection blockFlow() const { return static_cast<EBlockFlowDirection>(inherited_flags._blockFlow); }
+ bool isVerticalBlockFlow() const { return blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow; }
+>>>>>>> webkit.org at r67908
// attribute setter methods
@@ -1123,6 +1154,8 @@ public:
originalDisplay() == INLINE_BOX || originalDisplay() == INLINE_TABLE;
}
+ void setBlockFlow(EBlockFlowDirection v) { inherited_flags._blockFlow = v; }
+
// To tell if this style matched attribute selectors. This makes it impossible to share.
bool affectedByAttributeSelectors() const { return m_affectedByAttributeSelectors; }
void setAffectedByAttributeSelectors() { m_affectedByAttributeSelectors = true; }
@@ -1162,6 +1195,7 @@ public:
static ECaptionSide initialCaptionSide() { return CAPTOP; }
static EClear initialClear() { return CNONE; }
static TextDirection initialDirection() { return LTR; }
+ static EBlockFlowDirection initialBlockFlow() { return TopToBottomBlockFlow; }
static EDisplay initialDisplay() { return INLINE; }
static EEmptyCell initialEmptyCells() { return SHOW; }
static EFloat initialFloating() { return FNONE; }
@@ -1290,6 +1324,18 @@ private:
ContentData* prepareToSetContent(StringImpl*, bool add);
};
+inline int adjustForAbsoluteZoom(int value, const RenderStyle* style)
+{
+ double zoomFactor = style->effectiveZoom();
+ if (zoomFactor == 1)
+ return value;
+ // Needed because computeLengthInt truncates (rather than rounds) when scaling up.
+ if (zoomFactor > 1)
+ value++;
+
+ return roundForImpreciseConversion<int, INT_MAX, INT_MIN>(value / zoomFactor);
+}
+
} // namespace WebCore
#endif // RenderStyle_h
diff --git a/WebCore/rendering/style/RenderStyleConstants.h b/WebCore/rendering/style/RenderStyleConstants.h
index a78321f..94d30d5 100644
--- a/WebCore/rendering/style/RenderStyleConstants.h
+++ b/WebCore/rendering/style/RenderStyleConstants.h
@@ -128,6 +128,11 @@ enum EUnicodeBidi {
UBNormal, Embed, Override
};
+// CSS Text Layout Module Level 3: Vertical writing support
+enum EBlockFlowDirection {
+ TopToBottomBlockFlow, RightToLeftBlockFlow, LeftToRightBlockFlow, BottomToTopBlockFlow
+};
+
enum EFillAttachment {
ScrollBackgroundAttachment, LocalBackgroundAttachment, FixedBackgroundAttachment
};
diff --git a/WebCore/rendering/svg/SVGTextLayoutAttributes.cpp b/WebCore/rendering/svg/SVGTextLayoutAttributes.cpp
new file mode 100644
index 0000000..3283b35
--- /dev/null
+++ b/WebCore/rendering/svg/SVGTextLayoutAttributes.cpp
@@ -0,0 +1,100 @@
+/*
+ * 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 "SVGTextLayoutAttributes.h"
+
+#include <stdio.h>
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+SVGTextLayoutAttributes::SVGTextLayoutAttributes()
+{
+}
+
+void SVGTextLayoutAttributes::fillWithEmptyValues(unsigned length)
+{
+ m_xValues.fill(emptyValue(), length);
+ m_yValues.fill(emptyValue(), length);
+ m_dxValues.fill(emptyValue(), length);
+ m_dyValues.fill(emptyValue(), length);
+ m_rotateValues.fill(emptyValue(), length);
+}
+
+float SVGTextLayoutAttributes::emptyValue()
+{
+ static float s_emptyValue = std::numeric_limits<float>::max() - 1;
+ return s_emptyValue;
+}
+
+static inline void dumpLayoutVector(Vector<float>& values)
+{
+ if (values.isEmpty()) {
+ fprintf(stderr, "empty");
+ return;
+ }
+
+ unsigned size = values.size();
+ for (unsigned i = 0; i < size; ++i) {
+ float value = values.at(i);
+ if (value == SVGTextLayoutAttributes::emptyValue())
+ fprintf(stderr, "x ");
+ else
+ fprintf(stderr, "%lf ", value);
+ }
+}
+
+void SVGTextLayoutAttributes::dump()
+{
+ fprintf(stderr, "x values: ");
+ dumpLayoutVector(m_xValues);
+ fprintf(stderr, "\n");
+
+ fprintf(stderr, "y values: ");
+ dumpLayoutVector(m_yValues);
+ fprintf(stderr, "\n");
+
+ fprintf(stderr, "dx values: ");
+ dumpLayoutVector(m_dxValues);
+ fprintf(stderr, "\n");
+
+ fprintf(stderr, "dy values: ");
+ dumpLayoutVector(m_dyValues);
+ fprintf(stderr, "\n");
+
+ fprintf(stderr, "rotate values: ");
+ dumpLayoutVector(m_rotateValues);
+ fprintf(stderr, "\n");
+
+ fprintf(stderr, "character data values:\n");
+ Vector<CharacterData>::iterator end = m_characterDataValues.end();
+ for (Vector<CharacterData>::iterator it = m_characterDataValues.begin(); it != end; ++it) {
+ CharacterData& data = *it;
+ fprintf(stderr, "| {spansCharacters=%i, glyphName='%s', unicodeString='%s', width=%lf, height=%lf}\n",
+ data.spansCharacters, data.glyphName.utf8().data(), data.unicodeString.utf8().data(), data.width, data.height);
+ }
+ fprintf(stderr, "\n");
+}
+
+}
+
+#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/svg/SVGTextLayoutAttributes.h b/WebCore/rendering/svg/SVGTextLayoutAttributes.h
new file mode 100644
index 0000000..d88b356
--- /dev/null
+++ b/WebCore/rendering/svg/SVGTextLayoutAttributes.h
@@ -0,0 +1,89 @@
+/*
+ * 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 SVGTextLayoutAttributes_h
+#define SVGTextLayoutAttributes_h
+
+#if ENABLE(SVG)
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class SVGTextLayoutAttributes {
+public:
+ SVGTextLayoutAttributes();
+
+ void fillWithEmptyValues(unsigned length);
+ void dump();
+
+ Vector<float>& xValues() { return m_xValues; }
+ const Vector<float>& xValues() const { return m_xValues; }
+
+ Vector<float>& yValues() { return m_yValues; }
+ const Vector<float>& yValues() const { return m_yValues; }
+
+ Vector<float>& dxValues() { return m_dxValues; }
+ const Vector<float>& dxValues() const { return m_dxValues; }
+
+ Vector<float>& dyValues() { return m_dyValues; }
+ const Vector<float>& dyValues() const { return m_dyValues; }
+
+ Vector<float>& rotateValues() { return m_rotateValues; }
+ const Vector<float>& rotateValues() const { return m_rotateValues; }
+
+ static float emptyValue();
+
+ struct CharacterData {
+ CharacterData()
+ : spansCharacters(0)
+ , width(0)
+ , height(0)
+ {
+ }
+
+ // When multiple unicode characters map to a single glyph (eg. 'ffi' ligature)
+ // 'spansCharacters' contains the number of characters this glyph spans.
+ int spansCharacters;
+
+ // The 'glyphName' / 'unicodeString' pair is needed for kerning calculations.
+ String glyphName;
+ String unicodeString;
+
+ // 'width' and 'height' hold the size of this glyph/character.
+ float width;
+ float height;
+ };
+
+ Vector<CharacterData>& characterDataValues() { return m_characterDataValues; }
+ const Vector<CharacterData>& characterDataValues() const { return m_characterDataValues; }
+
+private:
+ Vector<float> m_xValues;
+ Vector<float> m_yValues;
+ Vector<float> m_dxValues;
+ Vector<float> m_dyValues;
+ Vector<float> m_rotateValues;
+ Vector<CharacterData> m_characterDataValues;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/rendering/svg/SVGTextLayoutBuilder.cpp b/WebCore/rendering/svg/SVGTextLayoutBuilder.cpp
new file mode 100644
index 0000000..0b3a752
--- /dev/null
+++ b/WebCore/rendering/svg/SVGTextLayoutBuilder.cpp
@@ -0,0 +1,304 @@
+/*
+ * 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 "SVGTextLayoutBuilder.h"
+
+#include "RenderSVGInlineText.h"
+#include "RenderSVGText.h"
+#include "SVGTextLayoutUtilities.h"
+#include "SVGTextPositioningElement.h"
+
+// Set to a value > 0 to dump the layout vectors
+#define DUMP_LAYOUT_VECTORS 0
+
+namespace WebCore {
+
+SVGTextLayoutBuilder::SVGTextLayoutBuilder()
+{
+}
+
+void SVGTextLayoutBuilder::buildLayoutAttributesForTextSubtree(RenderSVGText* textRoot)
+{
+ ASSERT(textRoot);
+ m_scopes.clear();
+
+ // Build layout scopes.
+ unsigned atCharacter = 0;
+ buildLayoutScopes(textRoot, atCharacter);
+
+ if (!atCharacter)
+ return;
+
+ // Add outermost scope, after text length is known.
+ LayoutScope scope;
+ buildLayoutScope(scope, textRoot, 0, atCharacter);
+ m_scopes.prepend(scope);
+
+ // Build layout information respecting scope of attribute values.
+ buildLayoutAttributesFromScopes();
+
+ atCharacter = 0;
+ propagateLayoutAttributes(textRoot, atCharacter);
+}
+
+static inline void copyToDestinationVector(Vector<float>& destination, unsigned destinationStartOffset, Vector<float>& source, unsigned sourceStartOffset, unsigned length)
+{
+ ASSERT(destinationStartOffset + length <= destination.size());
+
+ Vector<float>::iterator sourceBegin = source.begin() + sourceStartOffset;
+ std::copy(sourceBegin, sourceBegin + length, destination.begin() + destinationStartOffset);
+}
+
+static inline void copyToDestinationVectorIfSourceRangeIsNotEmpty(Vector<float>& destination, unsigned destinationStartOffset, Vector<float>& source, unsigned sourceStartOffset, unsigned length)
+{
+ bool rangeEmpty = true;
+
+ unsigned size = sourceStartOffset + length;
+ for (unsigned i = sourceStartOffset; i < size; ++i) {
+ if (source.at(i) == SVGTextLayoutAttributes::emptyValue())
+ continue;
+ rangeEmpty = false;
+ break;
+ }
+
+ if (rangeEmpty)
+ return;
+
+ destination.resize(length);
+ copyToDestinationVector(destination, destinationStartOffset, source, sourceStartOffset, length);
+}
+
+void SVGTextLayoutBuilder::propagateLayoutAttributes(RenderObject* start, unsigned& atCharacter)
+{
+ for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
+ if (!child->isSVGInlineText()) {
+ if (child->isSVGInline())
+ propagateLayoutAttributes(child, atCharacter);
+ continue;
+ }
+
+ RenderSVGInlineText* text = static_cast<RenderSVGInlineText*>(child);
+ unsigned textLength = text->textLength();
+
+ // Build layout attributes for a single RenderSVGInlineText renderer.
+ SVGTextLayoutAttributes attributes;
+
+ // The x value list should always be as large as the text length.
+ // Any values that are empty will be filled in by the actual text layout process later,
+ // as we need to be able to query the x/y position for every character through SVG DOM.
+ attributes.xValues().resize(textLength);
+ copyToDestinationVector(attributes.xValues(), 0, m_attributes.xValues(), atCharacter, textLength);
+
+ // Same for the y value list.
+ attributes.yValues().resize(textLength);
+ copyToDestinationVector(attributes.yValues(), 0, m_attributes.yValues(), atCharacter, textLength);
+
+ // The dx/dy/rotate value lists may be empty.
+ copyToDestinationVectorIfSourceRangeIsNotEmpty(attributes.dxValues(), 0, m_attributes.dxValues(), atCharacter, textLength);
+ copyToDestinationVectorIfSourceRangeIsNotEmpty(attributes.dyValues(), 0, m_attributes.dyValues(), atCharacter, textLength);
+ copyToDestinationVectorIfSourceRangeIsNotEmpty(attributes.rotateValues(), 0, m_attributes.rotateValues(), atCharacter, textLength);
+
+ // Build CharacterData, which will be used to detect ligatures, holds kerning pairs (glyph name, unicode string) and character metrics.
+ measureCharacters(text, attributes);
+
+#if DUMP_LAYOUT_VECTORS > 0
+ fprintf(stderr, "Dumping layout vector for RenderSVGInlineText, renderer=%p, node=%p\n", text, text->node());
+ attributes.dump();
+#endif
+
+ text->storeLayoutAttributes(attributes);
+ atCharacter += text->textLength();
+ }
+}
+
+void SVGTextLayoutBuilder::buildLayoutScopes(RenderObject* start, unsigned& atCharacter)
+{
+ for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
+ if (child->isSVGInlineText()) {
+ atCharacter += toRenderText(child)->textLength();
+ continue;
+ }
+
+ if (!child->isSVGInline())
+ continue;
+
+ unsigned textContentStart = atCharacter;
+ buildLayoutScopes(child, atCharacter);
+
+ LayoutScope scope;
+ buildLayoutScope(scope, child, textContentStart, atCharacter - textContentStart);
+ m_scopes.append(scope);
+ }
+}
+
+static inline void fillDestinationVectorWithLastSourceValue(Vector<float>& destination, unsigned destinationStartOffset, Vector<float>& source, unsigned length)
+{
+ if (source.isEmpty())
+ return;
+
+ float lastValue = source.last();
+
+ unsigned rotateValuesSize = source.size();
+ for (unsigned i = rotateValuesSize; i < length; ++i) {
+ ASSERT(i + destinationStartOffset < destination.size());
+ destination.at(i + destinationStartOffset) = lastValue;
+ }
+}
+
+void SVGTextLayoutBuilder::buildLayoutAttributesFromScopes()
+{
+ ASSERT(!m_scopes.isEmpty());
+
+ unsigned totalLength = m_scopes.first().textContentLength;
+ if (!totalLength)
+ return;
+
+ m_attributes.fillWithEmptyValues(totalLength);
+
+ // Build final list of x/y/dx/dy/rotate values for each character stores in the <text> subtree.
+ for (unsigned atScope = 0; atScope < m_scopes.size(); ++atScope) {
+ LayoutScope& scope = m_scopes.at(atScope);
+ SVGTextLayoutAttributes& attributes = scope.attributes;
+
+ copyToDestinationVector(m_attributes.xValues(), scope.textContentStart, attributes.xValues(), 0, attributes.xValues().size());
+ copyToDestinationVector(m_attributes.yValues(), scope.textContentStart, attributes.yValues(), 0, attributes.yValues().size());
+ copyToDestinationVector(m_attributes.dxValues(), scope.textContentStart, attributes.dxValues(), 0, attributes.dxValues().size());
+ copyToDestinationVector(m_attributes.dyValues(), scope.textContentStart, attributes.dyValues(), 0, attributes.dyValues().size());
+ copyToDestinationVector(m_attributes.rotateValues(), scope.textContentStart, attributes.rotateValues(), 0, attributes.rotateValues().size());
+
+ // In horizontal (vertical) writing modes, the last y (x) value in the scope is the default y (x) value for all following characters, unless explicitely overriden.
+ if (scope.isVerticalWritingMode)
+ fillDestinationVectorWithLastSourceValue(m_attributes.xValues(), scope.textContentStart, attributes.xValues(), scope.textContentLength);
+ else
+ fillDestinationVectorWithLastSourceValue(m_attributes.yValues(), scope.textContentStart, attributes.yValues(), scope.textContentLength);
+
+ // The last rotation value in the scope is the default rotation for all following character, unless explicitely overriden.
+ fillDestinationVectorWithLastSourceValue(m_attributes.rotateValues(), scope.textContentStart, attributes.rotateValues(), scope.textContentLength);
+ }
+}
+
+void SVGTextLayoutBuilder::measureCharacters(RenderSVGInlineText* text, SVGTextLayoutAttributes& attributes)
+{
+ ASSERT(text);
+ ASSERT(text->style());
+ const Font& font = text->style()->font();
+ const UChar* characters = text->characters();
+ int length = text->textLength();
+
+ TextRun run(0, 0);
+ run.disableSpacing();
+ run.disableRoundingHacks();
+
+ int charsConsumed = 0;
+ for (int position = 0; position < length; position += charsConsumed) {
+ run.setText(characters + position, 1);
+ int extraCharsAvailable = length - position - 1;
+
+ SVGTextLayoutAttributes::CharacterData characterData;
+ characterData.width = font.floatWidth(run, extraCharsAvailable, characterData.spansCharacters, characterData.glyphName);
+ characterData.height = font.height();
+ characterData.unicodeString = String(characters + position, characterData.spansCharacters);
+ attributes.characterDataValues().append(characterData);
+
+ charsConsumed = characterData.spansCharacters;
+ }
+}
+
+static inline void extractFloatValuesFromSVGLengthList(SVGElement* lengthContext, SVGLengthList* list, Vector<float>& floatValues, int textContentLength)
+{
+ ASSERT(lengthContext);
+ ASSERT(list);
+ ASSERT(textContentLength >= 0);
+
+ ExceptionCode ec = 0;
+ int length = list->numberOfItems();
+ if (length > textContentLength)
+ length = textContentLength;
+
+ for (int i = 0; i < length; ++i) {
+ SVGLength length(list->getItem(i, ec));
+ ASSERT(!ec);
+ floatValues.append(length.value(lengthContext));
+ }
+}
+
+static inline void extractFloatValuesFromSVGNumberList(SVGNumberList* list, Vector<float>& floatValues, int textContentLength)
+{
+ ASSERT(list);
+ ASSERT(textContentLength >= 0);
+
+ ExceptionCode ec = 0;
+ int length = list->numberOfItems();
+ if (length > textContentLength)
+ length = textContentLength;
+
+ for (int i = 0; i < length; ++i) {
+ float length(list->getItem(i, ec));
+ ASSERT(!ec);
+ floatValues.append(length);
+ }
+}
+
+static inline SVGTextPositioningElement* svgTextPositioningElementForInlineRenderer(RenderObject* renderer)
+{
+ ASSERT(renderer);
+ ASSERT(renderer->isSVGText() || renderer->isSVGInline());
+
+ Node* node = renderer->node();
+ ASSERT(node);
+ ASSERT(node->isSVGElement());
+
+ if (!node->hasTagName(SVGNames::textTag)
+ && !node->hasTagName(SVGNames::tspanTag)
+#if ENABLE(SVG_FONTS)
+ && !node->hasTagName(SVGNames::altGlyphTag)
+#endif
+ && !node->hasTagName(SVGNames::trefTag))
+ return 0;
+
+ return static_cast<SVGTextPositioningElement*>(node);
+}
+
+void SVGTextLayoutBuilder::buildLayoutScope(LayoutScope& scope, RenderObject* renderer, unsigned textContentStart, unsigned textContentLength)
+{
+ ASSERT(renderer);
+ ASSERT(renderer->style());
+
+ scope.isVerticalWritingMode = isVerticalWritingMode(renderer->style()->svgStyle());
+ scope.textContentStart = textContentStart;
+ scope.textContentLength = textContentLength;
+
+ SVGTextPositioningElement* element = svgTextPositioningElementForInlineRenderer(renderer);
+ if (!element)
+ return;
+
+ SVGTextLayoutAttributes& attributes = scope.attributes;
+ extractFloatValuesFromSVGLengthList(element, element->x(), attributes.xValues(), textContentLength);
+ extractFloatValuesFromSVGLengthList(element, element->y(), attributes.yValues(), textContentLength);
+ extractFloatValuesFromSVGLengthList(element, element->dx(), attributes.dxValues(), textContentLength);
+ extractFloatValuesFromSVGLengthList(element, element->dy(), attributes.dyValues(), textContentLength);
+ extractFloatValuesFromSVGNumberList(element->rotate(), attributes.rotateValues(), textContentLength);
+}
+
+}
+
+#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/svg/SVGTextLayoutBuilder.h b/WebCore/rendering/svg/SVGTextLayoutBuilder.h
new file mode 100644
index 0000000..6df7fa1
--- /dev/null
+++ b/WebCore/rendering/svg/SVGTextLayoutBuilder.h
@@ -0,0 +1,67 @@
+/*
+ * 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 SVGTextLayoutBuilder_h
+#define SVGTextLayoutBuilder_h
+
+#if ENABLE(SVG)
+#include "SVGTextLayoutAttributes.h"
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class RenderObject;
+class RenderSVGInlineText;
+class RenderSVGText;
+
+class SVGTextLayoutBuilder : public Noncopyable {
+public:
+ SVGTextLayoutBuilder();
+ void buildLayoutAttributesForTextSubtree(RenderSVGText*);
+
+private:
+ struct LayoutScope {
+ LayoutScope()
+ : isVerticalWritingMode(false)
+ , textContentStart(0)
+ , textContentLength(0)
+ {
+ }
+
+ bool isVerticalWritingMode;
+ unsigned textContentStart;
+ unsigned textContentLength;
+ SVGTextLayoutAttributes attributes;
+ };
+
+ void buildLayoutScopes(RenderObject*, unsigned& atCharacter);
+ void buildLayoutScope(LayoutScope&, RenderObject*, unsigned textContentStart, unsigned textContentLength);
+ void buildLayoutAttributesFromScopes();
+ void propagateLayoutAttributes(RenderObject*, unsigned& atCharacter);
+ void measureCharacters(RenderSVGInlineText*, SVGTextLayoutAttributes&);
+
+private:
+ Vector<LayoutScope> m_scopes;
+ SVGTextLayoutAttributes m_attributes;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/storage/AbstractDatabase.cpp b/WebCore/storage/AbstractDatabase.cpp
index 8d3bf1e..c8b8894 100644
--- a/WebCore/storage/AbstractDatabase.cpp
+++ b/WebCore/storage/AbstractDatabase.cpp
@@ -41,6 +41,7 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/CString.h>
#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/storage/Database.cpp b/WebCore/storage/Database.cpp
index 089f9ee..920f75b 100644
--- a/WebCore/storage/Database.cpp
+++ b/WebCore/storage/Database.cpp
@@ -54,6 +54,7 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/CString.h>
#if USE(JSC)
#include "JSDOMWindow.h"
diff --git a/WebCore/storage/DatabaseSync.cpp b/WebCore/storage/DatabaseSync.cpp
index 9c654a1..5634a60 100644
--- a/WebCore/storage/DatabaseSync.cpp
+++ b/WebCore/storage/DatabaseSync.cpp
@@ -42,6 +42,7 @@
#include "SecurityOrigin.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/CString.h>
namespace WebCore {
diff --git a/WebCore/storage/DatabaseTracker.cpp b/WebCore/storage/DatabaseTracker.cpp
index 1a13612..0b47842 100644
--- a/WebCore/storage/DatabaseTracker.cpp
+++ b/WebCore/storage/DatabaseTracker.cpp
@@ -46,6 +46,7 @@
#include "SQLiteStatement.h"
#include <wtf/MainThread.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/CString.h>
using namespace std;
diff --git a/WebCore/storage/IDBAny.cpp b/WebCore/storage/IDBAny.cpp
index 7303fd6..45b166d 100644
--- a/WebCore/storage/IDBAny.cpp
+++ b/WebCore/storage/IDBAny.cpp
@@ -123,7 +123,7 @@ void IDBAny::set(PassRefPtr<IDBDatabase> value)
void IDBAny::set(PassRefPtr<IDBIndex> value)
{
ASSERT(m_type == UndefinedType);
- m_type = IDBDatabaseType;
+ m_type = IDBIndexType;
m_idbIndex = value;
}
diff --git a/WebCore/storage/IDBCursor.cpp b/WebCore/storage/IDBCursor.cpp
index 52945f8..c1c077b 100644
--- a/WebCore/storage/IDBCursor.cpp
+++ b/WebCore/storage/IDBCursor.cpp
@@ -60,7 +60,7 @@ PassRefPtr<IDBKey> IDBCursor::key() const
PassRefPtr<IDBAny> IDBCursor::value() const
{
- return IDBAny::create(m_backend->value().get());
+ return m_backend->value();
}
PassRefPtr<IDBRequest> IDBCursor::update(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> value)
diff --git a/WebCore/storage/IDBCursorBackendImpl.cpp b/WebCore/storage/IDBCursorBackendImpl.cpp
index 4cbac0e..3a4dd67 100644
--- a/WebCore/storage/IDBCursorBackendImpl.cpp
+++ b/WebCore/storage/IDBCursorBackendImpl.cpp
@@ -32,6 +32,7 @@
#include "IDBDatabaseBackendImpl.h"
#include "IDBDatabaseError.h"
#include "IDBDatabaseException.h"
+#include "IDBIndexBackendImpl.h"
#include "IDBKeyRange.h"
#include "IDBObjectStoreBackendImpl.h"
#include "IDBRequest.h"
@@ -46,6 +47,17 @@ IDBCursorBackendImpl::IDBCursorBackendImpl(PassRefPtr<IDBObjectStoreBackendImpl>
, m_keyRange(keyRange)
, m_direction(direction)
, m_query(query)
+ , m_isSerializedScriptValueCursor(true)
+{
+ loadCurrentRow();
+}
+
+IDBCursorBackendImpl::IDBCursorBackendImpl(PassRefPtr<IDBIndexBackendImpl> idbIndex, PassRefPtr<IDBKeyRange> keyRange, IDBCursor::Direction direction, PassOwnPtr<SQLiteStatement> query, bool isSerializedScriptValueCursor)
+ : m_idbIndex(idbIndex)
+ , m_keyRange(keyRange)
+ , m_direction(direction)
+ , m_query(query)
+ , m_isSerializedScriptValueCursor(isSerializedScriptValueCursor)
{
loadCurrentRow();
}
@@ -65,13 +77,19 @@ PassRefPtr<IDBKey> IDBCursorBackendImpl::key() const
return m_currentKey;
}
-PassRefPtr<SerializedScriptValue> IDBCursorBackendImpl::value() const
+PassRefPtr<IDBAny> IDBCursorBackendImpl::value() const
{
- return m_currentValue;
+ if (m_isSerializedScriptValueCursor)
+ return IDBAny::create(m_currentSerializedScriptValue.get());
+ return IDBAny::create(m_currentIDBKeyValue.get());
}
void IDBCursorBackendImpl::update(PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBCallbacks> callbacks)
{
+ // FIXME: This method doesn't update indexes. It's dangerous to call in its current state.
+ callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Not implemented."));
+ return;
+
RefPtr<SerializedScriptValue> value = prpValue;
if (!m_query || m_currentId == InvalidId) {
@@ -81,7 +99,7 @@ void IDBCursorBackendImpl::update(PassRefPtr<SerializedScriptValue> prpValue, Pa
}
String sql = "UPDATE ObjectStoreData SET value = ? WHERE id = ?";
- SQLiteStatement updateQuery(m_idbObjectStore->database()->sqliteDatabase(), sql);
+ SQLiteStatement updateQuery(database()->sqliteDatabase(), sql);
bool ok = updateQuery.prepare() == SQLResultOk;
ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
@@ -90,7 +108,8 @@ void IDBCursorBackendImpl::update(PassRefPtr<SerializedScriptValue> prpValue, Pa
ok = updateQuery.step() == SQLResultDone;
ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
- m_currentValue = value.release();
+ if (m_isSerializedScriptValueCursor)
+ m_currentSerializedScriptValue = value.release();
callbacks->onSuccess();
}
@@ -102,7 +121,8 @@ void IDBCursorBackendImpl::continueFunction(PassRefPtr<IDBKey> prpKey, PassRefPt
m_query = 0;
m_currentId = InvalidId;
m_currentKey = 0;
- m_currentValue = 0;
+ m_currentSerializedScriptValue = 0;
+ m_currentIDBKeyValue = 0;
callbacks->onSuccess();
return;
}
@@ -126,6 +146,10 @@ void IDBCursorBackendImpl::continueFunction(PassRefPtr<IDBKey> prpKey, PassRefPt
void IDBCursorBackendImpl::remove(PassRefPtr<IDBCallbacks> callbacks)
{
+ // FIXME: This method doesn't update indexes. It's dangerous to call in its current state.
+ callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Not implemented."));
+ return;
+
if (!m_query || m_currentId == InvalidId) {
// FIXME: Use the proper error code when it's specced.
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Operation not possible."));
@@ -133,7 +157,7 @@ void IDBCursorBackendImpl::remove(PassRefPtr<IDBCallbacks> callbacks)
}
String sql = "DELETE FROM ObjectStoreData WHERE id = ?";
- SQLiteStatement deleteQuery(m_idbObjectStore->database()->sqliteDatabase(), sql);
+ SQLiteStatement deleteQuery(database()->sqliteDatabase(), sql);
bool ok = deleteQuery.prepare() == SQLResultOk;
ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
@@ -142,8 +166,8 @@ void IDBCursorBackendImpl::remove(PassRefPtr<IDBCallbacks> callbacks)
ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
m_currentId = InvalidId;
- m_currentKey = 0;
- m_currentValue = 0;
+ m_currentSerializedScriptValue = 0;
+ m_currentIDBKeyValue = 0;
callbacks->onSuccess();
}
@@ -151,16 +175,18 @@ void IDBCursorBackendImpl::loadCurrentRow()
{
// The column numbers depend on the query in IDBObjectStoreBackendImpl::openCursor.
m_currentId = m_query->getColumnInt64(0);
- if (!m_query->isColumnNull(1))
- m_currentKey = IDBKey::create(m_query->getColumnText(1));
- else if (!m_query->isColumnNull(2)) {
- ASSERT_NOT_REACHED(); // FIXME: Implement date.
- m_currentKey = IDBKey::create();
- } else if (!m_query->isColumnNull(3))
- m_currentKey = IDBKey::create(m_query->getColumnInt(3));
+ m_currentKey = IDBKey::fromQuery(*m_query, 1);
+ if (m_isSerializedScriptValueCursor)
+ m_currentSerializedScriptValue = SerializedScriptValue::createFromWire(m_query->getColumnText(4));
else
- m_currentKey = IDBKey::create();
- m_currentValue = SerializedScriptValue::createFromWire(m_query->getColumnText(4));
+ m_currentIDBKeyValue = IDBKey::fromQuery(*m_query, 4);
+}
+
+IDBDatabaseBackendImpl* IDBCursorBackendImpl::database() const
+{
+ if (m_idbObjectStore)
+ return m_idbObjectStore->database();
+ return m_idbIndex->objectStore()->database();
}
} // namespace WebCore
diff --git a/WebCore/storage/IDBCursorBackendImpl.h b/WebCore/storage/IDBCursorBackendImpl.h
index 3f7c4aa..b67ec70 100644
--- a/WebCore/storage/IDBCursorBackendImpl.h
+++ b/WebCore/storage/IDBCursorBackendImpl.h
@@ -37,6 +37,8 @@
namespace WebCore {
+class IDBDatabaseBackendImpl;
+class IDBIndexBackendImpl;
class IDBKeyRange;
class IDBObjectStoreBackendImpl;
class SQLiteStatement;
@@ -48,29 +50,42 @@ public:
{
return adoptRef(new IDBCursorBackendImpl(objectStore, keyRange, direction, query));
}
+ static PassRefPtr<IDBCursorBackendImpl> create(PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> keyRange, IDBCursor::Direction direction, PassOwnPtr<SQLiteStatement> query, bool isSerializedScriptValueCursor)
+ {
+ return adoptRef(new IDBCursorBackendImpl(index, keyRange, direction, query, isSerializedScriptValueCursor));
+ }
virtual ~IDBCursorBackendImpl();
virtual unsigned short direction() const;
virtual PassRefPtr<IDBKey> key() const;
- virtual PassRefPtr<SerializedScriptValue> value() const;
+ virtual PassRefPtr<IDBAny> value() const;
virtual void update(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBCallbacks>);
virtual void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>);
virtual void remove(PassRefPtr<IDBCallbacks>);
private:
IDBCursorBackendImpl(PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, IDBCursor::Direction, PassOwnPtr<SQLiteStatement> query);
+ IDBCursorBackendImpl(PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, IDBCursor::Direction, PassOwnPtr<SQLiteStatement> query, bool isSerializedScriptValueCursor);
void loadCurrentRow();
+ IDBDatabaseBackendImpl* database() const;
static const int64_t InvalidId = -1;
+ // Only one or the other should be used.
RefPtr<IDBObjectStoreBackendImpl> m_idbObjectStore;
+ RefPtr<IDBIndexBackendImpl> m_idbIndex;
+
RefPtr<IDBKeyRange> m_keyRange;
IDBCursor::Direction m_direction;
OwnPtr<SQLiteStatement> m_query;
+ bool m_isSerializedScriptValueCursor;
int64_t m_currentId;
RefPtr<IDBKey> m_currentKey;
- RefPtr<SerializedScriptValue> m_currentValue;
+
+ // Only one of these will ever be used for each instance. Which depends on m_isSerializedScriptValueCursor.
+ RefPtr<SerializedScriptValue> m_currentSerializedScriptValue;
+ RefPtr<IDBKey> m_currentIDBKeyValue;
};
} // namespace WebCore
diff --git a/WebCore/storage/IDBCursorBackendInterface.h b/WebCore/storage/IDBCursorBackendInterface.h
index acea955..4b209c4 100644
--- a/WebCore/storage/IDBCursorBackendInterface.h
+++ b/WebCore/storage/IDBCursorBackendInterface.h
@@ -46,7 +46,7 @@ public:
virtual unsigned short direction() const = 0;
virtual PassRefPtr<IDBKey> key() const = 0;
- virtual PassRefPtr<SerializedScriptValue> value() const = 0;
+ virtual PassRefPtr<IDBAny> value() const = 0;
virtual void update(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBCallbacks>) = 0;
virtual void continueFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>) = 0;
diff --git a/WebCore/storage/IDBFactory.cpp b/WebCore/storage/IDBFactory.cpp
index d3a83a5..06c06ea 100644
--- a/WebCore/storage/IDBFactory.cpp
+++ b/WebCore/storage/IDBFactory.cpp
@@ -29,16 +29,19 @@
#include "config.h"
#include "IDBFactory.h"
+#if ENABLE(INDEXED_DATABASE)
+
#include "DOMStringList.h"
#include "Document.h"
#include "ExceptionCode.h"
#include "Frame.h"
+#include "GroupSettings.h"
#include "IDBDatabase.h"
#include "IDBFactoryBackendInterface.h"
#include "IDBKeyRange.h"
#include "IDBRequest.h"
-
-#if ENABLE(INDEXED_DATABASE)
+#include "Page.h"
+#include "PageGroup.h"
namespace WebCore {
@@ -61,11 +64,11 @@ PassRefPtr<IDBRequest> IDBFactory::open(ScriptExecutionContext* context, const S
}
Document* document = static_cast<Document*>(context);
- if (!document->frame())
+ if (!document->frame() || !document->page())
return 0;
RefPtr<IDBRequest> request = IDBRequest::create(document, IDBAny::create(this));
- m_factoryBackend->open(name, description, request, document->securityOrigin(), document->frame());
+ m_factoryBackend->open(name, description, request, document->securityOrigin(), document->frame(), document->page()->group().groupSettings()->indexedDBDatabasePath());
return request;
}
diff --git a/WebCore/storage/IDBFactoryBackendImpl.cpp b/WebCore/storage/IDBFactoryBackendImpl.cpp
index 50cf778..d819c92 100644
--- a/WebCore/storage/IDBFactoryBackendImpl.cpp
+++ b/WebCore/storage/IDBFactoryBackendImpl.cpp
@@ -52,19 +52,21 @@ IDBFactoryBackendImpl::~IDBFactoryBackendImpl()
{
}
-static PassOwnPtr<SQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOrigin, String name)
+static PassOwnPtr<SQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOrigin, String name, const String& pathBase)
{
- String pathBase = "/tmp/temporary-indexed-db-files"; // FIXME: Write a PageGroupSettings class and have this value come from that.
- if (!makeAllDirectories(pathBase)) {
- // FIXME: Is there any other thing we could possibly do to recover at this point? If so, do it rather than just erroring out.
- LOG_ERROR("Unabled to create LocalStorage database path %s", pathBase.utf8().data());
- return 0;
+ String path = ":memory:";
+ if (!pathBase.isEmpty()) {
+ if (!makeAllDirectories(pathBase)) {
+ // FIXME: Is there any other thing we could possibly do to recover at this point? If so, do it rather than just erroring out.
+ LOG_ERROR("Unabled to create LocalStorage database path %s", pathBase.utf8().data());
+ return 0;
+ }
+
+ String databaseIdentifier = securityOrigin->databaseIdentifier();
+ String santizedName = encodeForFileName(name);
+ path = pathByAppendingComponent(pathBase, databaseIdentifier + "_" + santizedName + ".indexeddb");
}
- String databaseIdentifier = securityOrigin->databaseIdentifier();
- String santizedName = encodeForFileName(name);
- String path = pathByAppendingComponent(pathBase, databaseIdentifier + "_" + santizedName + ".indexeddb");
-
OwnPtr<SQLiteDatabase> sqliteDatabase = adoptPtr(new SQLiteDatabase());
if (!sqliteDatabase->open(path)) {
// FIXME: Is there any other thing we could possibly do to recover at this point? If so, do it rather than just erroring out.
@@ -98,13 +100,13 @@ static bool createTables(SQLiteDatabase* sqliteDatabase)
"CREATE UNIQUE INDEX IF NOT EXISTS ObjectStoreData_composit ON ObjectStoreData(keyString, keyDate, keyNumber, objectStoreId)",
"DROP TABLE IF EXISTS IndexData",
- "CREATE TABLE IF NOT EXISTS IndexData (id INTEGER PRIMARY KEY, indexId INTEGER NOT NULL REFERENCES Indexs(id), keyString TEXT, keyDate INTEGER, keyNumber INTEGER, objectStoreDataId INTEGER NOT NULL UNIQUE REFERENCES ObjectStoreData(id))",
+ "CREATE TABLE IF NOT EXISTS IndexData (id INTEGER PRIMARY KEY, indexId INTEGER NOT NULL REFERENCES Indexes(id), keyString TEXT, keyDate INTEGER, keyNumber INTEGER, objectStoreDataId INTEGER NOT NULL UNIQUE REFERENCES ObjectStoreData(id))",
"DROP INDEX IF EXISTS IndexData_composit",
- "CREATE UNIQUE INDEX IF NOT EXISTS IndexData_composit ON IndexData(keyString, keyDate, keyNumber, indexId)",
+ "CREATE INDEX IF NOT EXISTS IndexData_composit ON IndexData(keyString, keyDate, keyNumber, indexId)",
"DROP INDEX IF EXISTS IndexData_objectStoreDataId",
- "CREATE UNIQUE INDEX IF NOT EXISTS IndexData_objectStoreDataId ON IndexData(objectStoreDataId)",
+ "CREATE INDEX IF NOT EXISTS IndexData_objectStoreDataId ON IndexData(objectStoreDataId)",
"DROP INDEX IF EXISTS IndexData_indexId",
- "CREATE UNIQUE INDEX IF NOT EXISTS IndexData_indexId ON IndexData(indexId)"
+ "CREATE INDEX IF NOT EXISTS IndexData_indexId ON IndexData(indexId)"
};
for (size_t i = 0; i < arraysize(commands); ++i) {
@@ -117,7 +119,7 @@ static bool createTables(SQLiteDatabase* sqliteDatabase)
return true;
}
-void IDBFactoryBackendImpl::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> securityOrigin, Frame*)
+void IDBFactoryBackendImpl::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> securityOrigin, Frame*, const String& dataDir)
{
IDBDatabaseBackendMap::iterator it = m_databaseBackendMap.find(name);
if (it != m_databaseBackendMap.end()) {
@@ -129,7 +131,7 @@ void IDBFactoryBackendImpl::open(const String& name, const String& description,
// FIXME: Everything from now on should be done on another thread.
- OwnPtr<SQLiteDatabase> sqliteDatabase = openSQLiteDatabase(securityOrigin.get(), name);
+ OwnPtr<SQLiteDatabase> sqliteDatabase = openSQLiteDatabase(securityOrigin.get(), name, dataDir);
if (!sqliteDatabase || !createTables(sqliteDatabase.get())) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
return;
diff --git a/WebCore/storage/IDBFactoryBackendImpl.h b/WebCore/storage/IDBFactoryBackendImpl.h
index c9a33da..f2e1af8 100644
--- a/WebCore/storage/IDBFactoryBackendImpl.h
+++ b/WebCore/storage/IDBFactoryBackendImpl.h
@@ -49,7 +49,7 @@ public:
}
virtual ~IDBFactoryBackendImpl();
- virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*);
+ virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir);
virtual void abortPendingTransactions(const Vector<int>& pendingIDs);
private:
diff --git a/WebCore/storage/IDBFactoryBackendInterface.h b/WebCore/storage/IDBFactoryBackendInterface.h
index c052bc2..e591271 100644
--- a/WebCore/storage/IDBFactoryBackendInterface.h
+++ b/WebCore/storage/IDBFactoryBackendInterface.h
@@ -51,7 +51,7 @@ public:
static PassRefPtr<IDBFactoryBackendInterface> create();
virtual ~IDBFactoryBackendInterface() { }
- virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*) = 0;
+ virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir) = 0;
virtual void abortPendingTransactions(const Vector<int>& ids) = 0;
};
diff --git a/WebCore/storage/IDBIndex.cpp b/WebCore/storage/IDBIndex.cpp
index 62c1da8..5cd12dd 100644
--- a/WebCore/storage/IDBIndex.cpp
+++ b/WebCore/storage/IDBIndex.cpp
@@ -28,6 +28,12 @@
#if ENABLE(INDEXED_DATABASE)
+#include "IDBCursorBackendInterface.h"
+#include "IDBIndexBackendInterface.h"
+#include "IDBKey.h"
+#include "IDBKeyRange.h"
+#include "IDBRequest.h"
+
namespace WebCore {
IDBIndex::IDBIndex(PassRefPtr<IDBIndexBackendInterface> backend)
@@ -39,6 +45,34 @@ IDBIndex::~IDBIndex()
{
}
+PassRefPtr<IDBRequest> IDBIndex::openObjectCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, unsigned short direction)
+{
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
+ m_backend->openObjectCursor(keyRange, direction, request);
+ return request;
+}
+
+PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, unsigned short direction)
+{
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
+ m_backend->openCursor(keyRange, direction, request);
+ return request;
+}
+
+PassRefPtr<IDBRequest> IDBIndex::getObject(ScriptExecutionContext* context, PassRefPtr<IDBKey> key)
+{
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
+ m_backend->getObject(key, request);
+ return request;
+}
+
+PassRefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext* context, PassRefPtr<IDBKey> key)
+{
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
+ m_backend->get(key, request);
+ return request;
+}
+
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebCore/storage/IDBIndex.h b/WebCore/storage/IDBIndex.h
index 5e716b7..45fcfa1 100644
--- a/WebCore/storage/IDBIndex.h
+++ b/WebCore/storage/IDBIndex.h
@@ -26,6 +26,7 @@
#ifndef IDBIndex_h
#define IDBIndex_h
+#include "IDBCursor.h"
#include "IDBIndexBackendInterface.h"
#include "PlatformString.h"
#include <wtf/Forward.h>
@@ -44,9 +45,15 @@ public:
// Implement the IDL
String name() const { return m_backend->name(); }
+ String storeName() const { return m_backend->storeName(); }
String keyPath() const { return m_backend->keyPath(); }
bool unique() const { return m_backend->unique(); }
+ PassRefPtr<IDBRequest> openObjectCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange> = 0, unsigned short direction = IDBCursor::NEXT);
+ PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange> = 0, unsigned short direction = IDBCursor::NEXT);
+ PassRefPtr<IDBRequest> getObject(ScriptExecutionContext*, PassRefPtr<IDBKey>);
+ PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKey>);
+
private:
IDBIndex(PassRefPtr<IDBIndexBackendInterface>);
diff --git a/WebCore/storage/IDBIndex.idl b/WebCore/storage/IDBIndex.idl
index 629481e..ba3ecea 100644
--- a/WebCore/storage/IDBIndex.idl
+++ b/WebCore/storage/IDBIndex.idl
@@ -29,15 +29,15 @@ module storage {
Conditional=INDEXED_DATABASE
] IDBIndex {
readonly attribute DOMString name;
- // FIXME: Add "storeName".
+ readonly attribute DOMString storeName;
readonly attribute DOMString keyPath;
readonly attribute boolean unique;
- // FIXME: Implement.
- //IDBRequest openObjectCursor(in [Optional] IDBKeyRange range, in [Optional] unsigned short direction) raises (DOMException);
- //IDBRequest openCursor(in [Optional] IDBKeyRange range, in [Optional] unsigned short direction) raises (DOMException);
- //IDBRequest getObject(in IDBKey key) raises (DOMException);
- //IDBRequest get(in IDBKey key) raises (DOMException);
+ // FIXME: All of these should raise on certain errors.
+ [CallWith=ScriptExecutionContext] IDBRequest openObjectCursor(in [Optional] IDBKeyRange range, in [Optional] unsigned short direction);
+ [CallWith=ScriptExecutionContext] IDBRequest openCursor(in [Optional] IDBKeyRange range, in [Optional] unsigned short direction);
+ [CallWith=ScriptExecutionContext] IDBRequest getObject(in IDBKey key);
+ [CallWith=ScriptExecutionContext] IDBRequest get(in IDBKey key);
};
}
diff --git a/WebCore/storage/IDBIndexBackendImpl.cpp b/WebCore/storage/IDBIndexBackendImpl.cpp
index 42aa62b..6f698c6 100644
--- a/WebCore/storage/IDBIndexBackendImpl.cpp
+++ b/WebCore/storage/IDBIndexBackendImpl.cpp
@@ -28,8 +28,14 @@
#if ENABLE(INDEXED_DATABASE)
+#include "IDBCallbacks.h"
+#include "IDBCursorBackendImpl.h"
#include "IDBDatabaseBackendImpl.h"
+#include "IDBDatabaseException.h"
+#include "IDBKey.h"
+#include "IDBKeyRange.h"
#include "IDBObjectStoreBackendImpl.h"
+#include "SQLiteDatabase.h"
#include "SQLiteStatement.h"
namespace WebCore {
@@ -47,6 +53,98 @@ IDBIndexBackendImpl::~IDBIndexBackendImpl()
{
}
+String IDBIndexBackendImpl::storeName()
+{
+ return m_objectStore->name();
+}
+
+static void openCursorInternal(SQLiteDatabase& database, IDBIndexBackendImpl* index, IDBKeyRange* range, unsigned short untypedDirection, bool objectCursor, IDBCallbacks* callbacks)
+{
+ // Several files depend on this order of selects.
+ String sql = String("SELECT IndexData.id, IndexData.keyString, IndexData.keyDate, IndexData.keyNumber, ")
+ + (objectCursor ? "ObjectStoreData.value " : "ObjectStoreData.keyString, ObjectStoreData.keyDate, ObjectStoreData.keyNumber ")
+ + "FROM IndexData INNER JOIN ObjectStoreData ON IndexData.objectStoreDataId = ObjectStoreData.id WHERE ";
+
+ bool leftBound = range && (range->flags() & IDBKeyRange::LEFT_BOUND || range->flags() == IDBKeyRange::SINGLE);
+ bool rightBound = range && (range->flags() & IDBKeyRange::RIGHT_BOUND || range->flags() == IDBKeyRange::SINGLE);
+
+ if (leftBound)
+ sql += range->left()->leftCursorWhereFragment(range->leftWhereClauseComparisonOperator(), "IndexData.");
+ if (rightBound)
+ sql += range->right()->rightCursorWhereFragment(range->rightWhereClauseComparisonOperator(), "IndexData.");
+ sql += "IndexData.indexId = ? ORDER BY ";
+
+ IDBCursor::Direction direction = static_cast<IDBCursor::Direction>(untypedDirection);
+ if (direction == IDBCursor::NEXT || direction == IDBCursor::NEXT_NO_DUPLICATE)
+ sql += "IndexData.keyString, IndexData.keyDate, IndexData.keyNumber, IndexData.id";
+ else
+ sql += "IndexData.keyString DESC, IndexData.keyDate DESC, IndexData.keyNumber DESC, IndexData.id DESC";
+
+ OwnPtr<SQLiteStatement> query = adoptPtr(new SQLiteStatement(database, sql));
+ bool ok = query->prepare() == SQLResultOk;
+ ASSERT_UNUSED(ok, ok); // FIXME: Better error handling?
+
+ int indexColumn = 1;
+ if (leftBound)
+ indexColumn += range->left()->bind(*query, indexColumn);
+ if (rightBound)
+ indexColumn += range->right()->bind(*query, indexColumn);
+ query->bindInt64(indexColumn, index->id());
+
+ if (query->step() != SQLResultRow) {
+ callbacks->onSuccess();
+ return;
+ }
+
+ RefPtr<IDBCursorBackendInterface> cursor = IDBCursorBackendImpl::create(index, range, direction, query.release(), objectCursor);
+ callbacks->onSuccess(cursor.release());
+}
+
+void IDBIndexBackendImpl::openObjectCursor(PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks)
+{
+ openCursorInternal(sqliteDatabase(), this, keyRange.get(), direction, true, callbacks.get());
+}
+
+void IDBIndexBackendImpl::openCursor(PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks)
+{
+ openCursorInternal(sqliteDatabase(), this, keyRange.get(), direction, false, callbacks.get());
+}
+
+static void getInternal(SQLiteDatabase& database, int64 id, IDBKey* key, bool getObject, IDBCallbacks* callbacks)
+{
+ String sql = String("SELECT ")
+ + (getObject ? "ObjectStoreData.value " : "ObjectStoreData.keyString, ObjectStoreData.keyDate, ObjectStoreData.keyNumber ")
+ + "FROM IndexData INNER JOIN ObjectStoreData ON IndexData.objectStoreDataId = ObjectStoreData.id "
+ + "WHERE IndexData.indexId = ? AND " + key->whereSyntax("IndexData.")
+ + "ORDER BY IndexData.id LIMIT 1"; // Order by insertion order when all else fails.
+ SQLiteStatement query(database, sql);
+ bool ok = query.prepare() == SQLResultOk;
+ ASSERT_UNUSED(ok, ok); // FIXME: Better error handling?
+
+ query.bindInt64(1, id);
+ key->bind(query, 2);
+ if (query.step() != SQLResultRow) {
+ callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::NOT_FOUND_ERR, "Key does not exist in the index."));
+ return;
+ }
+
+ if (getObject)
+ callbacks->onSuccess(SerializedScriptValue::createFromWire(query.getColumnText(0)));
+ else
+ callbacks->onSuccess(IDBKey::fromQuery(query, 0));
+ ASSERT(query.step() != SQLResultRow);
+}
+
+void IDBIndexBackendImpl::getObject(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks)
+{
+ getInternal(sqliteDatabase(), m_id, key.get(), true, callbacks.get());
+}
+
+void IDBIndexBackendImpl::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks)
+{
+ getInternal(sqliteDatabase(), m_id, key.get(), false, callbacks.get());
+}
+
static String whereClause(IDBKey* key)
{
return "WHERE indexId = ? AND " + key->whereSyntax();
diff --git a/WebCore/storage/IDBIndexBackendImpl.h b/WebCore/storage/IDBIndexBackendImpl.h
index 97c65f9..a98ed2a 100644
--- a/WebCore/storage/IDBIndexBackendImpl.h
+++ b/WebCore/storage/IDBIndexBackendImpl.h
@@ -49,9 +49,17 @@ public:
// Implements IDBIndexBackendInterface.
virtual String name() { return m_name; }
+ virtual String storeName();
virtual String keyPath() { return m_keyPath; }
virtual bool unique() { return m_unique; }
+ virtual void openObjectCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>);
+ virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>);
+ virtual void getObject(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>);
+ virtual void get(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>);
+
+ IDBObjectStoreBackendImpl* objectStore() const { return m_objectStore.get(); }
+
private:
IDBIndexBackendImpl(IDBObjectStoreBackendImpl*, int64_t id, const String& name, const String& keyPath, bool unique);
diff --git a/WebCore/storage/IDBIndexBackendInterface.h b/WebCore/storage/IDBIndexBackendInterface.h
index 0d1ea34..ff2316f 100644
--- a/WebCore/storage/IDBIndexBackendInterface.h
+++ b/WebCore/storage/IDBIndexBackendInterface.h
@@ -33,13 +33,23 @@
namespace WebCore {
+class IDBCallbacks;
+class IDBKey;
+class IDBKeyRange;
+
class IDBIndexBackendInterface : public ThreadSafeShared<IDBIndexBackendInterface> {
public:
virtual ~IDBIndexBackendInterface() { }
virtual String name() = 0;
+ virtual String storeName() = 0;
virtual String keyPath() = 0;
virtual bool unique() = 0;
+
+ virtual void openObjectCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>) = 0;
+ virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>) = 0;
+ virtual void getObject(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>) = 0;
+ virtual void get(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>) = 0;
};
} // namespace WebCore
diff --git a/WebCore/storage/IDBKey.cpp b/WebCore/storage/IDBKey.cpp
index 6ae79ba..3eec36c 100644
--- a/WebCore/storage/IDBKey.cpp
+++ b/WebCore/storage/IDBKey.cpp
@@ -54,6 +54,22 @@ IDBKey::~IDBKey()
{
}
+PassRefPtr<IDBKey> IDBKey::fromQuery(SQLiteStatement& query, int baseColumn)
+{
+ if (!query.isColumnNull(baseColumn))
+ return IDBKey::create(query.getColumnText(baseColumn));
+
+ if (!query.isColumnNull(baseColumn + 1)) {
+ ASSERT_NOT_REACHED(); // FIXME: Implement date.
+ return IDBKey::create();
+ }
+
+ if (!query.isColumnNull(baseColumn + 2))
+ return IDBKey::create(query.getColumnInt(baseColumn + 2));
+
+ return IDBKey::create(); // Null.
+}
+
bool IDBKey::isEqual(IDBKey* other)
{
if (!other || other->m_type != m_type)
@@ -73,22 +89,56 @@ bool IDBKey::isEqual(IDBKey* other)
return false;
}
-String IDBKey::whereSyntax() const
+String IDBKey::whereSyntax(String qualifiedTableName) const
{
switch (m_type) {
case IDBKey::StringType:
- return "keyString = ?";
+ return qualifiedTableName + "keyString = ? ";
case IDBKey::NumberType:
- return "keyNumber = ?";
+ return qualifiedTableName + "keyNumber = ? ";
// FIXME: Implement date.
case IDBKey::NullType:
- return "keyString IS NULL AND keyDate IS NULL AND keyNumber IS NULL";
+ return qualifiedTableName + "keyString IS NULL AND " + qualifiedTableName + "keyDate IS NULL AND " + qualifiedTableName + "keyNumber IS NULL ";
}
ASSERT_NOT_REACHED();
return "";
}
+String IDBKey::leftCursorWhereFragment(String comparisonOperator, String qualifiedTableName)
+{
+ switch (m_type) {
+ case StringType:
+ return "? " + comparisonOperator + " " + qualifiedTableName + "keyString AND ";
+ // FIXME: Implement date.
+ case NumberType:
+ return "(? " + comparisonOperator + " " + qualifiedTableName + "keyNumber OR NOT " + qualifiedTableName + "keyString IS NULL OR NOT " + qualifiedTableName + "keyDate IS NULL) AND ";
+ case NullType:
+ if (comparisonOperator == "<")
+ return "NOT(" + qualifiedTableName + "keyString IS NULL AND " + qualifiedTableName + "keyDate IS NULL AND " + qualifiedTableName + "keyNumber IS NULL) AND ";
+ return ""; // If it's =, the upper bound half will do the constraining. If it's <=, then that's a no-op.
+ }
+ ASSERT_NOT_REACHED();
+ return "";
+}
+
+String IDBKey::rightCursorWhereFragment(String comparisonOperator, String qualifiedTableName)
+{
+ switch (m_type) {
+ case StringType:
+ return "(" + qualifiedTableName + "keyString " + comparisonOperator + " ? OR " + qualifiedTableName + "keyString IS NULL) AND ";
+ // FIXME: Implement date.
+ case NumberType:
+ return "(" + qualifiedTableName + "keyNumber " + comparisonOperator + " ? OR " + qualifiedTableName + "keyNumber IS NULL) AND " + qualifiedTableName + "keyString IS NULL AND " + qualifiedTableName + "keyDate IS NULL AND ";
+ case NullType:
+ if (comparisonOperator == "<")
+ return "0 != 0 AND ";
+ return qualifiedTableName + "keyString IS NULL AND " + qualifiedTableName + "keyDate IS NULL AND " + qualifiedTableName + "keyNumber IS NULL AND ";
+ }
+ ASSERT_NOT_REACHED();
+ return "";
+}
+
// Returns the number of items bound.
int IDBKey::bind(SQLiteStatement& query, int column) const
{
diff --git a/WebCore/storage/IDBKey.h b/WebCore/storage/IDBKey.h
index b9a0be7..3175e7e 100644
--- a/WebCore/storage/IDBKey.h
+++ b/WebCore/storage/IDBKey.h
@@ -73,8 +73,12 @@ public:
return m_number;
}
+ static PassRefPtr<IDBKey> fromQuery(SQLiteStatement& query, int baseColumn);
+
bool isEqual(IDBKey* other);
- String whereSyntax() const;
+ String whereSyntax(String qualifiedTableName = "") const;
+ String leftCursorWhereFragment(String comparisonOperator, String qualifiedTableName = "");
+ String rightCursorWhereFragment(String comparisonOperator, String qualifiedTableName = "");
int bind(SQLiteStatement& query, int column) const;
void bindWithNulls(SQLiteStatement& query, int baseColumn) const;
diff --git a/WebCore/storage/IDBKeyRange.cpp b/WebCore/storage/IDBKeyRange.cpp
index 4088b34..6c612cc 100644
--- a/WebCore/storage/IDBKeyRange.cpp
+++ b/WebCore/storage/IDBKeyRange.cpp
@@ -71,6 +71,36 @@ PassRefPtr<IDBKeyRange> IDBKeyRange::bound(PassRefPtr<IDBKey> left, PassRefPtr<I
return IDBKeyRange::create(left, right, flags);
}
+String IDBKeyRange::leftWhereClauseComparisonOperator() const
+{
+ if (m_flags & LEFT_OPEN)
+ return "<";
+
+ if (m_flags & LEFT_BOUND)
+ return "<=";
+
+ if (m_flags == SINGLE)
+ return "=";
+
+ ASSERT_NOT_REACHED();
+ return "";
+}
+
+String IDBKeyRange::rightWhereClauseComparisonOperator() const
+{
+ if (m_flags & RIGHT_OPEN)
+ return "<";
+
+ if (m_flags & RIGHT_BOUND)
+ return "<=";
+
+ if (m_flags == SINGLE)
+ return "=";
+
+ ASSERT_NOT_REACHED();
+ return "";
+}
+
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebCore/storage/IDBKeyRange.h b/WebCore/storage/IDBKeyRange.h
index 5a426b7..4621a50 100644
--- a/WebCore/storage/IDBKeyRange.h
+++ b/WebCore/storage/IDBKeyRange.h
@@ -57,6 +57,9 @@ public:
PassRefPtr<IDBKey> right() const { return m_right; }
unsigned short flags() const { return m_flags; }
+ String leftWhereClauseComparisonOperator() const;
+ String rightWhereClauseComparisonOperator() const;
+
static PassRefPtr<IDBKeyRange> only(PassRefPtr<IDBKey> value);
static PassRefPtr<IDBKeyRange> leftBound(PassRefPtr<IDBKey> bound, bool open = false);
static PassRefPtr<IDBKeyRange> rightBound(PassRefPtr<IDBKey> bound, bool open = false);
diff --git a/WebCore/storage/IDBObjectStoreBackendImpl.cpp b/WebCore/storage/IDBObjectStoreBackendImpl.cpp
index 86237de..e5f81ab 100755..100644
--- a/WebCore/storage/IDBObjectStoreBackendImpl.cpp
+++ b/WebCore/storage/IDBObjectStoreBackendImpl.cpp
@@ -279,64 +279,14 @@ void IDBObjectStoreBackendImpl::removeIndex(const String& name, PassRefPtr<IDBCa
callbacks->onSuccess();
}
-static String leftCursorWhereFragment(IDBKey::Type type, String comparisonOperator)
-{
- switch (type) {
- case IDBKey::StringType:
- return "? " + comparisonOperator + " keyString AND ";
- // FIXME: Implement date.
- case IDBKey::NumberType:
- return "(? " + comparisonOperator + " keyNumber OR NOT keyString IS NULL OR NOT keyDate IS NULL) AND ";
- case IDBKey::NullType:
- if (comparisonOperator == "<")
- return "NOT(keyString IS NULL AND keyDate IS NULL AND keyNumber IS NULL) AND ";
- return ""; // If it's =, the upper bound half will do the constraining. If it's <=, then that's a no-op.
- }
- ASSERT_NOT_REACHED();
- return "";
-}
-
-static String rightCursorWhereFragment(IDBKey::Type type, String comparisonOperator)
-{
- switch (type) {
- case IDBKey::StringType:
- return "(keyString " + comparisonOperator + " ? OR keyString IS NULL) AND ";
- // FIXME: Implement date.
- case IDBKey::NumberType:
- return "(keyNumber " + comparisonOperator + " ? OR keyNumber IS NULL) AND keyString IS NULL AND keyDate IS NULL AND ";
- case IDBKey::NullType:
- if (comparisonOperator == "<")
- return "0 != 0 AND ";
- return "keyString IS NULL AND keyDate IS NULL AND keyNumber IS NULL AND ";
- }
- ASSERT_NOT_REACHED();
- return "";
-}
-
void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> range, unsigned short tmpDirection, PassRefPtr<IDBCallbacks> callbacks)
{
- String lowerEquality;
- if (range->flags() & IDBKeyRange::LEFT_OPEN)
- lowerEquality = "<";
- else if (range->flags() & IDBKeyRange::LEFT_BOUND)
- lowerEquality = "<=";
- else
- lowerEquality = "=";
-
- String upperEquality;
- if (range->flags() & IDBKeyRange::RIGHT_OPEN)
- upperEquality = "<";
- else if (range->flags() & IDBKeyRange::RIGHT_BOUND)
- upperEquality = "<=";
- else
- upperEquality = "=";
-
- // If you change the order of this select, you'll need to change it in IDBCursorBackendImpl.cpp as well.
+ // Several files depend on this order of selects.
String sql = "SELECT id, keyString, keyDate, keyNumber, value FROM ObjectStoreData WHERE ";
if (range->flags() & IDBKeyRange::LEFT_BOUND || range->flags() == IDBKeyRange::SINGLE)
- sql += leftCursorWhereFragment(range->left()->type(), lowerEquality);
+ sql += range->left()->leftCursorWhereFragment(range->leftWhereClauseComparisonOperator());
if (range->flags() & IDBKeyRange::RIGHT_BOUND || range->flags() == IDBKeyRange::SINGLE)
- sql += rightCursorWhereFragment(range->right()->type(), upperEquality);
+ sql += range->right()->rightCursorWhereFragment(range->rightWhereClauseComparisonOperator());
sql += "objectStoreId = ? ORDER BY ";
IDBCursor::Direction direction = static_cast<IDBCursor::Direction>(tmpDirection);
diff --git a/WebCore/storage/IDBRequest.cpp b/WebCore/storage/IDBRequest.cpp
index 3513c17..6fbda0e 100644
--- a/WebCore/storage/IDBRequest.cpp
+++ b/WebCore/storage/IDBRequest.cpp
@@ -153,13 +153,12 @@ void IDBRequest::timerFired(Timer<IDBRequest>*)
Vector<PendingEvent> pendingEvents;
pendingEvents.swap(m_pendingEvents);
for (size_t i = 0; i < pendingEvents.size(); ++i) {
- PendingEvent pendingEvent = pendingEvents[i];
- if (pendingEvent.m_error) {
- ASSERT(!pendingEvent.m_result);
- dispatchEvent(IDBErrorEvent::create(m_source, *pendingEvent.m_error));
+ if (pendingEvents[i].m_error) {
+ ASSERT(!pendingEvents[i].m_result);
+ dispatchEvent(IDBErrorEvent::create(m_source, *pendingEvents[i].m_error));
} else {
- ASSERT(pendingEvent.m_result->type() != IDBAny::UndefinedType);
- dispatchEvent(IDBSuccessEvent::create(m_source, pendingEvent.m_result));
+ ASSERT(pendingEvents[i].m_result->type() != IDBAny::UndefinedType);
+ dispatchEvent(IDBSuccessEvent::create(m_source, pendingEvents[i].m_result));
}
}
}
diff --git a/WebCore/storage/IDBTransactionBackendImpl.cpp b/WebCore/storage/IDBTransactionBackendImpl.cpp
index 51b33b2..51b33b2 100755..100644
--- a/WebCore/storage/IDBTransactionBackendImpl.cpp
+++ b/WebCore/storage/IDBTransactionBackendImpl.cpp
diff --git a/WebCore/storage/IDBTransactionBackendImpl.h b/WebCore/storage/IDBTransactionBackendImpl.h
index fb57401..fb57401 100755..100644
--- a/WebCore/storage/IDBTransactionBackendImpl.h
+++ b/WebCore/storage/IDBTransactionBackendImpl.h
diff --git a/WebCore/storage/wince/DatabaseThreadWince.cpp b/WebCore/storage/wince/DatabaseThreadWinCE.cpp
index d81145d..d81145d 100644
--- a/WebCore/storage/wince/DatabaseThreadWince.cpp
+++ b/WebCore/storage/wince/DatabaseThreadWinCE.cpp
diff --git a/WebCore/storage/wince/DatabaseThreadWince.h b/WebCore/storage/wince/DatabaseThreadWinCE.h
index fafc791..1921cc1 100644
--- a/WebCore/storage/wince/DatabaseThreadWince.h
+++ b/WebCore/storage/wince/DatabaseThreadWinCE.h
@@ -21,8 +21,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef DatabaseThreadWince_h
-#define DatabaseThreadWince_h
+#ifndef DatabaseThreadWinCE_h
+#define DatabaseThreadWinCE_h
#include <wtf/Deque.h>
#include <wtf/RefCounted.h>
@@ -62,4 +62,4 @@ namespace WebCore {
} // namespace WebCore
-#endif // DatabaseThreadWince
+#endif // DatabaseThreadWinCE_h
diff --git a/WebCore/storage/wince/LocalStorageThreadWince.cpp b/WebCore/storage/wince/LocalStorageThreadWinCE.cpp
index 8dcb902..90c4e89 100644
--- a/WebCore/storage/wince/LocalStorageThreadWince.cpp
+++ b/WebCore/storage/wince/LocalStorageThreadWinCE.cpp
@@ -80,4 +80,4 @@ void LocalStorageThread::performTerminate()
m_timer.stop();
}
-}
+} // namespace WebCore
diff --git a/WebCore/storage/wince/LocalStorageThreadWince.h b/WebCore/storage/wince/LocalStorageThreadWinCE.h
index 300abb5..06e7d45 100644
--- a/WebCore/storage/wince/LocalStorageThreadWince.h
+++ b/WebCore/storage/wince/LocalStorageThreadWinCE.h
@@ -22,8 +22,8 @@
*/
-#ifndef LocalStorageThreadWince_h
-#define LocalStorageThreadWince_h
+#ifndef LocalStorageThreadWinCE_h
+#define LocalStorageThreadWinCE_h
#include <wtf/Deque.h>
#include <wtf/PassRefPtr.h>
@@ -55,4 +55,4 @@ namespace WebCore {
} // namespace WebCore
-#endif // LocalStorageThreadWince_h
+#endif // LocalStorageThreadWinCE_h
diff --git a/WebCore/svg/SVGAElement.cpp b/WebCore/svg/SVGAElement.cpp
index b0ffc74..d711a52 100644
--- a/WebCore/svg/SVGAElement.cpp
+++ b/WebCore/svg/SVGAElement.cpp
@@ -2,6 +2,7 @@
* Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org>
* Copyright (C) 2007 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 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
@@ -33,6 +34,7 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameLoaderTypes.h"
+#include "HTMLAnchorElement.h"
#include "KeyboardEvent.h"
#include "MouseEvent.h"
#include "PlatformMouseEvent.h"
@@ -125,60 +127,47 @@ RenderObject* SVGAElement::createRenderer(RenderArena* arena, RenderStyle*)
return new (arena) RenderSVGTransformableContainer(this);
}
-void SVGAElement::defaultEventHandler(Event* evt)
+void SVGAElement::defaultEventHandler(Event* event)
{
- if (isLink() && (evt->type() == eventNames().clickEvent || (evt->type() == eventNames().keydownEvent && focused()))) {
- MouseEvent* e = 0;
- if (evt->type() == eventNames().clickEvent && evt->isMouseEvent())
- e = static_cast<MouseEvent*>(evt);
-
- KeyboardEvent* k = 0;
- if (evt->type() == eventNames().keydownEvent && evt->isKeyboardEvent())
- k = static_cast<KeyboardEvent*>(evt);
-
- if (e && e->button() == RightButton) {
- SVGStyledTransformableElement::defaultEventHandler(evt);
+ if (isLink()) {
+ if (focused() && isEnterKeyKeydownEvent(event)) {
+ event->setDefaultHandled();
+ dispatchSimulatedClick(event);
return;
}
-
- if (k) {
- if (k->keyIdentifier() != "Enter") {
- SVGStyledTransformableElement::defaultEventHandler(evt);
- return;
- }
- evt->setDefaultHandled();
- dispatchSimulatedClick(evt);
- return;
- }
-
- String target = this->target();
- if (e && e->button() == MiddleButton)
- target = "_blank";
- else if (target.isEmpty()) // if target is empty, default to "_self" or use xlink:target if set
- target = (getAttribute(XLinkNames::showAttr) == "new") ? "_blank" : "_self";
-
- if (!evt->defaultPrevented()) {
+
+ if (isLinkClick(event)) {
String url = deprecatedParseURL(href());
+
#if ENABLE(SVG_ANIMATION)
- if (url.startsWith("#")) {
+ if (url[0] == '#') {
Element* targetElement = document()->getElementById(url.substring(1));
if (SVGSMILElement::isSMILElement(targetElement)) {
- SVGSMILElement* timed = static_cast<SVGSMILElement*>(targetElement);
- timed->beginByLinkActivation();
- evt->setDefaultHandled();
- SVGStyledTransformableElement::defaultEventHandler(evt);
+ static_cast<SVGSMILElement*>(targetElement)->beginByLinkActivation();
+ event->setDefaultHandled();
return;
}
}
#endif
- if (document()->frame())
- document()->frame()->loader()->urlSelected(document()->completeURL(url), target, evt, false, false, true, SendReferrer);
- }
- evt->setDefaultHandled();
+ // FIXME: Why does the SVG anchor element have this special logic
+ // for middle click that the HTML anchor element does not have?
+ // Making a middle click open a link in a new window or tab is
+ // properly handled at the client level, not inside WebKit; this
+ // code should be deleted.
+ String target = isMiddleMouseButtonEvent(event) ? "_blank" : this->target();
+
+ // FIXME: It's not clear why setting target to "_self" is ever
+ // helpful.
+ if (target.isEmpty())
+ target = (getAttribute(XLinkNames::showAttr) == "new") ? "_blank" : "_self";
+
+ handleLinkClick(event, document(), url, target);
+ return;
+ }
}
- SVGStyledTransformableElement::defaultEventHandler(evt);
+ SVGStyledTransformableElement::defaultEventHandler(event);
}
bool SVGAElement::supportsFocus() const
diff --git a/WebCore/svg/SVGFEBlendElement.cpp b/WebCore/svg/SVGFEBlendElement.cpp
index 451b7d1..c4d816b 100644
--- a/WebCore/svg/SVGFEBlendElement.cpp
+++ b/WebCore/svg/SVGFEBlendElement.cpp
@@ -87,7 +87,12 @@ PassRefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilde
if (!input1 || !input2)
return 0;
- return FEBlend::create(input1, input2, static_cast<BlendModeType>(mode()));
+ RefPtr<FilterEffect> effect = FEBlend::create(static_cast<BlendModeType>(mode()));
+ FilterEffectVector& inputEffects = effect->inputEffects();
+ inputEffects.reserveCapacity(2);
+ inputEffects.append(input1);
+ inputEffects.append(input2);
+ return effect.release();
}
}
diff --git a/WebCore/svg/SVGFEColorMatrixElement.cpp b/WebCore/svg/SVGFEColorMatrixElement.cpp
index 7f496bc..f14b4e7 100644
--- a/WebCore/svg/SVGFEColorMatrixElement.cpp
+++ b/WebCore/svg/SVGFEColorMatrixElement.cpp
@@ -123,7 +123,9 @@ PassRefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filter
return 0;
}
- return FEColorMatrix::create(input1, filterType, filterValues);
+ RefPtr<FilterEffect> effect = FEColorMatrix::create(filterType, filterValues);
+ effect->inputEffects().append(input1);
+ return effect.release();
}
} //namespace WebCore
diff --git a/WebCore/svg/SVGFEComponentTransferElement.cpp b/WebCore/svg/SVGFEComponentTransferElement.cpp
index a99e74c..f6b26f5 100644
--- a/WebCore/svg/SVGFEComponentTransferElement.cpp
+++ b/WebCore/svg/SVGFEComponentTransferElement.cpp
@@ -83,7 +83,9 @@ PassRefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder*
alpha = static_cast<SVGFEFuncAElement*>(n)->transferFunction();
}
- return FEComponentTransfer::create(input1, red, green, blue, alpha);
+ RefPtr<FilterEffect> effect = FEComponentTransfer::create(red, green, blue, alpha);
+ effect->inputEffects().append(input1);
+ return effect.release();
}
}
diff --git a/WebCore/svg/SVGFECompositeElement.cpp b/WebCore/svg/SVGFECompositeElement.cpp
index f658632..b6f1002 100644
--- a/WebCore/svg/SVGFECompositeElement.cpp
+++ b/WebCore/svg/SVGFECompositeElement.cpp
@@ -109,9 +109,14 @@ PassRefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBu
if (!input1 || !input2)
return 0;
-
- return FEComposite::create(input1, input2, static_cast<CompositeOperationType>(_operator()),
- k1(), k2(), k3(), k4());
+
+ RefPtr<FilterEffect> effect = FEComposite::create(static_cast<CompositeOperationType>(_operator()),
+ k1(), k2(), k3(), k4());
+ FilterEffectVector& inputEffects = effect->inputEffects();
+ inputEffects.reserveCapacity(2);
+ inputEffects.append(input1);
+ inputEffects.append(input2);
+ return effect.release();
}
}
diff --git a/WebCore/svg/SVGFEConvolveMatrixElement.cpp b/WebCore/svg/SVGFEConvolveMatrixElement.cpp
index 9432a00..db2fad5 100644
--- a/WebCore/svg/SVGFEConvolveMatrixElement.cpp
+++ b/WebCore/svg/SVGFEConvolveMatrixElement.cpp
@@ -151,10 +151,12 @@ PassRefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* fil
divisorValue = 1;
}
- return FEConvolveMatrix::create(
- input1, IntSize(orderXValue, orderYValue), divisorValue,
- bias(), IntPoint(targetXValue, targetYValue), static_cast<EdgeModeType>(edgeMode()),
- FloatPoint(kernelUnitLengthX(), kernelUnitLengthX()), preserveAlpha(), kernelMatrixValues);
+ RefPtr<FilterEffect> effect = FEConvolveMatrix::create(
+ IntSize(orderXValue, orderYValue), divisorValue,
+ bias(), IntPoint(targetXValue, targetYValue), static_cast<EdgeModeType>(edgeMode()),
+ FloatPoint(kernelUnitLengthX(), kernelUnitLengthX()), preserveAlpha(), kernelMatrixValues);
+ effect->inputEffects().append(input1);
+ return effect.release();
}
} // namespace WebCore
diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
index 4349f27..4bc1bdb 100644
--- a/WebCore/svg/SVGFEDiffuseLightingElement.cpp
+++ b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
@@ -113,8 +113,10 @@ PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* fi
RefPtr<RenderStyle> filterStyle = styleForRenderer();
Color color = filterStyle->svgStyle()->lightingColor();
- return FEDiffuseLighting::create(input1, color, surfaceScale(), diffuseConstant(),
- kernelUnitLengthX(), kernelUnitLengthY(), findLights());
+ RefPtr<FilterEffect> effect = FEDiffuseLighting::create(color, surfaceScale(), diffuseConstant(),
+ kernelUnitLengthX(), kernelUnitLengthY(), findLights());
+ effect->inputEffects().append(input1);
+ return effect.release();
}
PassRefPtr<LightSource> SVGFEDiffuseLightingElement::findLights() const
diff --git a/WebCore/svg/SVGFEDisplacementMapElement.cpp b/WebCore/svg/SVGFEDisplacementMapElement.cpp
index 013eca5..ea8a7b8 100644
--- a/WebCore/svg/SVGFEDisplacementMapElement.cpp
+++ b/WebCore/svg/SVGFEDisplacementMapElement.cpp
@@ -101,10 +101,14 @@ PassRefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* fi
if (!input1 || !input2)
return 0;
-
-
- return FEDisplacementMap::create(input1, input2, static_cast<ChannelSelectorType>(xChannelSelector()),
- static_cast<ChannelSelectorType>(yChannelSelector()), scale());
+
+ RefPtr<FilterEffect> effect = FEDisplacementMap::create(static_cast<ChannelSelectorType>(xChannelSelector()),
+ static_cast<ChannelSelectorType>(yChannelSelector()), scale());
+ FilterEffectVector& inputEffects = effect->inputEffects();
+ inputEffects.reserveCapacity(2);
+ inputEffects.append(input1);
+ inputEffects.append(input2);
+ return effect.release();
}
}
diff --git a/WebCore/svg/SVGFEGaussianBlurElement.cpp b/WebCore/svg/SVGFEGaussianBlurElement.cpp
index f66fa90..3dfd51c 100644
--- a/WebCore/svg/SVGFEGaussianBlurElement.cpp
+++ b/WebCore/svg/SVGFEGaussianBlurElement.cpp
@@ -87,7 +87,9 @@ PassRefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filte
if (!input1)
return 0;
- return FEGaussianBlur::create(input1, stdDeviationX(), stdDeviationY());
+ RefPtr<FilterEffect> effect = FEGaussianBlur::create(stdDeviationX(), stdDeviationY());
+ effect->inputEffects().append(input1);
+ return effect.release();
}
}
diff --git a/WebCore/svg/SVGFEMergeElement.cpp b/WebCore/svg/SVGFEMergeElement.cpp
index 6254b24..49a052e 100644
--- a/WebCore/svg/SVGFEMergeElement.cpp
+++ b/WebCore/svg/SVGFEMergeElement.cpp
@@ -39,7 +39,8 @@ PassRefPtr<SVGFEMergeElement> SVGFEMergeElement::create(const QualifiedName& tag
PassRefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder)
{
- Vector<RefPtr<FilterEffect> > mergeInputs;
+ RefPtr<FilterEffect> effect = FEMerge::create();
+ FilterEffectVector& mergeInputs = effect->inputEffects();
for (Node* n = firstChild(); n != 0; n = n->nextSibling()) {
if (n->hasTagName(SVGNames::feMergeNodeTag)) {
FilterEffect* mergeEffect = filterBuilder->getEffectById(static_cast<SVGFEMergeNodeElement*>(n)->in1());
@@ -52,7 +53,7 @@ PassRefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilde
if (mergeInputs.isEmpty())
return 0;
- return FEMerge::create(mergeInputs);
+ return effect.release();
}
}
diff --git a/WebCore/svg/SVGFEMorphologyElement.cpp b/WebCore/svg/SVGFEMorphologyElement.cpp
index c3db844..b45c6f9 100644
--- a/WebCore/svg/SVGFEMorphologyElement.cpp
+++ b/WebCore/svg/SVGFEMorphologyElement.cpp
@@ -101,7 +101,9 @@ PassRefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterB
if (xRadius < 0 || yRadius < 0)
return 0;
- return FEMorphology::create(input1, static_cast<MorphologyOperatorType>(_operator()), xRadius, yRadius);
+ RefPtr<FilterEffect> effect = FEMorphology::create(static_cast<MorphologyOperatorType>(_operator()), xRadius, yRadius);
+ effect->inputEffects().append(input1);
+ return effect.release();
}
} //namespace WebCore
diff --git a/WebCore/svg/SVGFEOffsetElement.cpp b/WebCore/svg/SVGFEOffsetElement.cpp
index 58b4a6a..65523a5 100644
--- a/WebCore/svg/SVGFEOffsetElement.cpp
+++ b/WebCore/svg/SVGFEOffsetElement.cpp
@@ -86,7 +86,9 @@ PassRefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuild
if (!input1)
return 0;
- return FEOffset::create(input1, dx(), dy());
+ RefPtr<FilterEffect> effect = FEOffset::create(dx(), dy());
+ effect->inputEffects().append(input1);
+ return effect.release();
}
}
diff --git a/WebCore/svg/SVGFESpecularLightingElement.cpp b/WebCore/svg/SVGFESpecularLightingElement.cpp
index d07c6ce..1647525 100644
--- a/WebCore/svg/SVGFESpecularLightingElement.cpp
+++ b/WebCore/svg/SVGFESpecularLightingElement.cpp
@@ -118,9 +118,11 @@ PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* f
RefPtr<RenderStyle> filterStyle = styleForRenderer();
Color color = filterStyle->svgStyle()->lightingColor();
-
- return FESpecularLighting::create(input1, color, surfaceScale(), specularConstant(),
- specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), findLights());
+
+ RefPtr<FilterEffect> effect = FESpecularLighting::create(color, surfaceScale(), specularConstant(),
+ specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), findLights());
+ effect->inputEffects().append(input1);
+ return effect.release();
}
}
diff --git a/WebCore/svg/SVGFETileElement.cpp b/WebCore/svg/SVGFETileElement.cpp
index 4379b96..9664490 100644
--- a/WebCore/svg/SVGFETileElement.cpp
+++ b/WebCore/svg/SVGFETileElement.cpp
@@ -62,7 +62,9 @@ PassRefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder
if (!input1)
return 0;
- return FETile::create(input1);
+ RefPtr<FilterEffect> effect = FETile::create();
+ effect->inputEffects().append(input1);
+ return effect.release();
}
}
diff --git a/WebCore/svg/SVGFETurbulenceElement.cpp b/WebCore/svg/SVGFETurbulenceElement.cpp
index 5c1d32f..5339e02 100644
--- a/WebCore/svg/SVGFETurbulenceElement.cpp
+++ b/WebCore/svg/SVGFETurbulenceElement.cpp
@@ -55,7 +55,7 @@ void SVGFETurbulenceElement::parseMappedAttribute(Attribute* attr)
} else if (attr->name() == SVGNames::stitchTilesAttr) {
if (value == "stitch")
setStitchTilesBaseValue(SVG_STITCHTYPE_STITCH);
- else if (value == "nostitch")
+ else if (value == "noStitch")
setStitchTilesBaseValue(SVG_STITCHTYPE_NOSTITCH);
} else if (attr->name() == SVGNames::baseFrequencyAttr) {
float x, y;
@@ -71,6 +71,18 @@ void SVGFETurbulenceElement::parseMappedAttribute(Attribute* attr)
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
+void SVGFETurbulenceElement::svgAttributeChanged(const QualifiedName& attrName)
+{
+ SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
+
+ if (attrName == SVGNames::baseFrequencyAttr
+ || attrName == SVGNames::numOctavesAttr
+ || attrName == SVGNames::seedAttr
+ || attrName == SVGNames::stitchTilesAttr
+ || attrName == SVGNames::typeAttr)
+ invalidate();
+}
+
void SVGFETurbulenceElement::synchronizeProperty(const QualifiedName& attrName)
{
SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
diff --git a/WebCore/svg/SVGFETurbulenceElement.h b/WebCore/svg/SVGFETurbulenceElement.h
index 78d47f9..887aacf 100644
--- a/WebCore/svg/SVGFETurbulenceElement.h
+++ b/WebCore/svg/SVGFETurbulenceElement.h
@@ -44,6 +44,7 @@ private:
SVGFETurbulenceElement(const QualifiedName&, Document*);
virtual void parseMappedAttribute(Attribute*);
+ virtual void svgAttributeChanged(const QualifiedName&);
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
diff --git a/WebCore/svg/SVGGElement.cpp b/WebCore/svg/SVGGElement.cpp
index 8174eac..a455cd5 100644
--- a/WebCore/svg/SVGGElement.cpp
+++ b/WebCore/svg/SVGGElement.cpp
@@ -91,6 +91,11 @@ RenderObject* SVGGElement::createRenderer(RenderArena* arena, RenderStyle* style
return new (arena) RenderSVGTransformableContainer(this);
}
+bool SVGGElement::rendererIsNeeded(RenderStyle*)
+{
+ return parentNode() && parentNode()->isSVGElement();
+}
+
}
#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGGElement.h b/WebCore/svg/SVGGElement.h
index a149351..b47eaba 100644
--- a/WebCore/svg/SVGGElement.h
+++ b/WebCore/svg/SVGGElement.h
@@ -50,7 +50,7 @@ namespace WebCore {
virtual void svgAttributeChanged(const QualifiedName&);
virtual void synchronizeProperty(const QualifiedName&);
- virtual bool rendererIsNeeded(RenderStyle*) { return true; }
+ virtual bool rendererIsNeeded(RenderStyle*);
// SVGExternalResourcesRequired
DECLARE_ANIMATED_PROPERTY(SVGGElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
diff --git a/WebCore/svg/SVGImageLoader.cpp b/WebCore/svg/SVGImageLoader.cpp
index 5ba9c81..2079f74 100644
--- a/WebCore/svg/SVGImageLoader.cpp
+++ b/WebCore/svg/SVGImageLoader.cpp
@@ -48,7 +48,7 @@ void SVGImageLoader::dispatchLoadEvent()
String SVGImageLoader::sourceURI(const AtomicString& attr) const
{
- return deprecatedParseURL(KURL(element()->baseURI(), attr).string());
+ return KURL(element()->baseURI(), deprecatedParseURL(attr)).string();
}
}
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index bc669a3..a461ec4 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -193,18 +193,18 @@ SVGViewSpec* SVGSVGElement::currentView() const
float SVGSVGElement::currentScale() const
{
// Only the page zoom factor is relevant for SVG
- if (FrameView* view = document()->view())
- return view->pageZoomFactor();
+ if (Frame* frame = document()->frame())
+ return frame->pageZoomFactor();
return m_scale;
}
void SVGSVGElement::setCurrentScale(float scale)
{
- if (FrameView* view = document()->view()) {
+ if (Frame* frame = document()->frame()) {
// Calling setCurrentScale() on the outermost <svg> element in a standalone SVG document
// is allowed to change the page zoom factor, influencing the document size, scrollbars etc.
if (parentNode() == document())
- view->setZoomFactor(scale, ZoomPage);
+ frame->setPageZoomFactor(scale);
return;
}
diff --git a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp b/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp
index c1a1166..2dbc7ab 100644
--- a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp
@@ -33,11 +33,10 @@
namespace WebCore {
-FEConvolveMatrix::FEConvolveMatrix(FilterEffect* in, const IntSize& kernelSize,
+FEConvolveMatrix::FEConvolveMatrix(const IntSize& kernelSize,
float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode,
const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
: FilterEffect()
- , m_in(in)
, m_kernelSize(kernelSize)
, m_divisor(divisor)
, m_bias(bias)
@@ -49,11 +48,11 @@ FEConvolveMatrix::FEConvolveMatrix(FilterEffect* in, const IntSize& kernelSize,
{
}
-PassRefPtr<FEConvolveMatrix> FEConvolveMatrix::create(FilterEffect* in, const IntSize& kernelSize,
+PassRefPtr<FEConvolveMatrix> FEConvolveMatrix::create(const IntSize& kernelSize,
float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode,
const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
{
- return adoptRef(new FEConvolveMatrix(in, kernelSize, divisor, bias, targetOffset, edgeMode, kernelUnitLength,
+ return adoptRef(new FEConvolveMatrix(kernelSize, divisor, bias, targetOffset, edgeMode, kernelUnitLength,
preserveAlpha, kernelMatrix));
}
@@ -374,21 +373,22 @@ ALWAYS_INLINE void FEConvolveMatrix::setOuterPixels(PaintingData& paintingData,
void FEConvolveMatrix::apply(Filter* filter)
{
- m_in->apply(filter);
- if (!m_in->resultImage())
+ FilterEffect* in = inputEffect(0);
+ in->apply(filter);
+ if (!in->resultImage())
return;
if (!getEffectContext())
return;
IntRect imageRect(IntPoint(), resultImage()->size());
- IntRect effectDrawingRect = calculateDrawingIntRect(m_in->subRegion());
+ IntRect effectDrawingRect = calculateDrawingIntRect(in->filterPrimitiveSubregion());
RefPtr<CanvasPixelArray> srcPixelArray;
if (m_preserveAlpha)
- srcPixelArray = m_in->resultImage()->getUnmultipliedImageData(effectDrawingRect)->data();
+ srcPixelArray = in->resultImage()->getUnmultipliedImageData(effectDrawingRect)->data();
else
- srcPixelArray = m_in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data();
+ srcPixelArray = in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data();
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
@@ -463,7 +463,7 @@ TextStream& FEConvolveMatrix::externalRepresentation(TextStream& ts, int indent)
<< "edgeMode=\"" << m_edgeMode << "\" "
<< "kernelUnitLength=\"" << m_kernelUnitLength << "\" "
<< "preserveAlpha=\"" << m_preserveAlpha << "\"]\n";
- m_in->externalRepresentation(ts, indent + 1);
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h b/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h
index 662d097..736933c 100644
--- a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h
+++ b/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h
@@ -44,7 +44,7 @@ class CanvasPixelArray;
class FEConvolveMatrix : public FilterEffect {
public:
- static PassRefPtr<FEConvolveMatrix> create(FilterEffect*, const IntSize&,
+ static PassRefPtr<FEConvolveMatrix> create(const IntSize&,
float, float, const IntPoint&, EdgeModeType, const FloatPoint&,
bool, const Vector<float>&);
@@ -72,13 +72,12 @@ public:
bool preserveAlpha() const;
void setPreserveAlpha(bool);
- virtual FloatRect uniteChildEffectSubregions(Filter* filter) { return calculateUnionOfChildEffectSubregions(filter, m_in.get()); }
void apply(Filter*);
void dump();
TextStream& externalRepresentation(TextStream&, int indent) const;
private:
- FEConvolveMatrix(FilterEffect*, const IntSize&, float, float,
+ FEConvolveMatrix(const IntSize&, float, float,
const IntPoint&, EdgeModeType, const FloatPoint&, bool, const Vector<float>&);
struct PaintingData {
@@ -101,7 +100,6 @@ private:
ALWAYS_INLINE void setInteriorPixels(PaintingData& paintingData, int clipRight, int clipBottom);
ALWAYS_INLINE void setOuterPixels(PaintingData& paintingData, int x1, int y1, int x2, int y2);
- RefPtr<FilterEffect> m_in;
IntSize m_kernelSize;
float m_divisor;
float m_bias;
diff --git a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp
index 3a008fa..b439c46 100644
--- a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp
@@ -29,17 +29,17 @@
namespace WebCore {
-FEDiffuseLighting::FEDiffuseLighting(FilterEffect* in, const Color& lightingColor, float surfaceScale,
+FEDiffuseLighting::FEDiffuseLighting(const Color& lightingColor, float surfaceScale,
float diffuseConstant, float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
- : FELighting(DiffuseLighting, in, lightingColor, surfaceScale, diffuseConstant, 0.0f, 0.0f, kernelUnitLengthX, kernelUnitLengthY, lightSource)
+ : FELighting(DiffuseLighting, lightingColor, surfaceScale, diffuseConstant, 0, 0, kernelUnitLengthX, kernelUnitLengthY, lightSource)
{
}
-PassRefPtr<FEDiffuseLighting> FEDiffuseLighting::create(FilterEffect* in , const Color& lightingColor,
+PassRefPtr<FEDiffuseLighting> FEDiffuseLighting::create(const Color& lightingColor,
float surfaceScale, float diffuseConstant, float kernelUnitLengthX,
float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
{
- return adoptRef(new FEDiffuseLighting(in, lightingColor, surfaceScale, diffuseConstant, kernelUnitLengthX, kernelUnitLengthY, lightSource));
+ return adoptRef(new FEDiffuseLighting(lightingColor, surfaceScale, diffuseConstant, kernelUnitLengthX, kernelUnitLengthY, lightSource));
}
FEDiffuseLighting::~FEDiffuseLighting()
@@ -118,7 +118,7 @@ TextStream& FEDiffuseLighting::externalRepresentation(TextStream& ts, int indent
ts << " surfaceScale=\"" << m_surfaceScale << "\" "
<< "diffuseConstant=\"" << m_diffuseConstant << "\" "
<< "kernelUnitLength=\"" << m_kernelUnitLengthX << ", " << m_kernelUnitLengthY << "\"]\n";
- m_in->externalRepresentation(ts, indent + 1);
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h
index ee4d5b1..0cdeae3 100644
--- a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h
+++ b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h
@@ -31,7 +31,7 @@ class LightSource;
class FEDiffuseLighting : public FELighting {
public:
- static PassRefPtr<FEDiffuseLighting> create(FilterEffect*, const Color&, float, float,
+ static PassRefPtr<FEDiffuseLighting> create(const Color&, float, float,
float, float, PassRefPtr<LightSource>);
virtual ~FEDiffuseLighting();
@@ -57,7 +57,7 @@ public:
TextStream& externalRepresentation(TextStream&, int indent) const;
private:
- FEDiffuseLighting(FilterEffect*, const Color&, float, float,
+ FEDiffuseLighting(const Color&, float, float,
float, float, PassRefPtr<LightSource>);
};
diff --git a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp
index 3305f27..9d9857e 100644
--- a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp
@@ -33,21 +33,18 @@
namespace WebCore {
-FEDisplacementMap::FEDisplacementMap(FilterEffect* in, FilterEffect* in2, ChannelSelectorType xChannelSelector,
- ChannelSelectorType yChannelSelector, const float& scale)
+FEDisplacementMap::FEDisplacementMap(ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float scale)
: FilterEffect()
- , m_in(in)
- , m_in2(in2)
, m_xChannelSelector(xChannelSelector)
, m_yChannelSelector(yChannelSelector)
, m_scale(scale)
{
}
-PassRefPtr<FEDisplacementMap> FEDisplacementMap::create(FilterEffect* in, FilterEffect* in2,
- ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, const float& scale)
+PassRefPtr<FEDisplacementMap> FEDisplacementMap::create(ChannelSelectorType xChannelSelector,
+ ChannelSelectorType yChannelSelector, float scale)
{
- return adoptRef(new FEDisplacementMap(in, in2, xChannelSelector, yChannelSelector, scale));
+ return adoptRef(new FEDisplacementMap(xChannelSelector, yChannelSelector, scale));
}
ChannelSelectorType FEDisplacementMap::xChannelSelector() const
@@ -82,9 +79,11 @@ void FEDisplacementMap::setScale(float scale)
void FEDisplacementMap::apply(Filter* filter)
{
- m_in->apply(filter);
- m_in2->apply(filter);
- if (!m_in->resultImage() || !m_in2->resultImage())
+ FilterEffect* in = inputEffect(0);
+ FilterEffect* in2 = inputEffect(1);
+ in->apply(filter);
+ in2->apply(filter);
+ if (!in->resultImage() || !in2->resultImage())
return;
if (m_xChannelSelector == CHANNEL_UNKNOWN || m_yChannelSelector == CHANNEL_UNKNOWN)
@@ -93,11 +92,11 @@ void FEDisplacementMap::apply(Filter* filter)
if (!getEffectContext())
return;
- IntRect effectADrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion());
- RefPtr<CanvasPixelArray> srcPixelArrayA(m_in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
+ IntRect effectADrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
- IntRect effectBDrawingRect = calculateDrawingIntRect(m_in2->scaledSubRegion());
- RefPtr<CanvasPixelArray> srcPixelArrayB(m_in2->resultImage()->getUnmultipliedImageData(effectBDrawingRect)->data());
+ IntRect effectBDrawingRect = calculateDrawingIntRect(in2->repaintRectInLocalCoordinates());
+ RefPtr<CanvasPixelArray> srcPixelArrayB(in2->resultImage()->getUnmultipliedImageData(effectBDrawingRect)->data());
IntRect imageRect(IntPoint(), resultImage()->size());
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
@@ -163,8 +162,8 @@ TextStream& FEDisplacementMap::externalRepresentation(TextStream& ts, int indent
ts << " scale=\"" << m_scale << "\" "
<< "xChannelSelector=\"" << m_xChannelSelector << "\" "
<< "yChannelSelector=\"" << m_yChannelSelector << "\"]\n";
- m_in->externalRepresentation(ts, indent + 1);
- m_in2->externalRepresentation(ts, indent + 1);
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
+ inputEffect(1)->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h
index 7bb9d19..9e17da4 100644
--- a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h
+++ b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h
@@ -39,8 +39,7 @@ namespace WebCore {
class FEDisplacementMap : public FilterEffect {
public:
- static PassRefPtr<FEDisplacementMap> create(FilterEffect*, FilterEffect*, ChannelSelectorType,
- ChannelSelectorType, const float&);
+ static PassRefPtr<FEDisplacementMap> create(ChannelSelectorType, ChannelSelectorType, float);
ChannelSelectorType xChannelSelector() const;
void setXChannelSelector(const ChannelSelectorType);
@@ -51,17 +50,13 @@ namespace WebCore {
float scale() const;
void setScale(float scale);
- virtual FloatRect uniteChildEffectSubregions(Filter* filter) { return calculateUnionOfChildEffectSubregions(filter, m_in.get(), m_in2.get()); }
void apply(Filter*);
void dump();
TextStream& externalRepresentation(TextStream&, int indent) const;
private:
- FEDisplacementMap(FilterEffect*, FilterEffect*, ChannelSelectorType,
- ChannelSelectorType, const float&);
+ FEDisplacementMap(ChannelSelectorType, ChannelSelectorType, float);
- RefPtr<FilterEffect> m_in;
- RefPtr<FilterEffect> m_in2;
ChannelSelectorType m_xChannelSelector;
ChannelSelectorType m_yChannelSelector;
float m_scale;
diff --git a/WebCore/svg/graphics/filters/SVGFEFlood.cpp b/WebCore/svg/graphics/filters/SVGFEFlood.cpp
index 5286d80..a2b2cd2 100644
--- a/WebCore/svg/graphics/filters/SVGFEFlood.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEFlood.cpp
@@ -70,7 +70,7 @@ void FEFlood::apply(Filter*)
return;
Color color = colorWithOverrideAlpha(floodColor().rgb(), floodOpacity());
- filterContext->fillRect(FloatRect(FloatPoint(), scaledSubRegion().size()), color, DeviceColorSpace);
+ filterContext->fillRect(FloatRect(FloatPoint(), repaintRectInLocalCoordinates().size()), color, DeviceColorSpace);
}
void FEFlood::dump()
diff --git a/WebCore/svg/graphics/filters/SVGFEImage.cpp b/WebCore/svg/graphics/filters/SVGFEImage.cpp
index b21ceae..a3ac882 100644
--- a/WebCore/svg/graphics/filters/SVGFEImage.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEImage.cpp
@@ -55,7 +55,7 @@ void FEImage::apply(Filter*)
return;
FloatRect srcRect(FloatPoint(), m_image->size());
- FloatRect destRect(FloatPoint(), subRegion().size());
+ FloatRect destRect(FloatPoint(), filterPrimitiveSubregion().size());
m_preserveAspectRatio.transformRect(destRect, srcRect);
diff --git a/WebCore/svg/graphics/filters/SVGFELighting.cpp b/WebCore/svg/graphics/filters/SVGFELighting.cpp
index 7c3c81c..dc82840 100644
--- a/WebCore/svg/graphics/filters/SVGFELighting.cpp
+++ b/WebCore/svg/graphics/filters/SVGFELighting.cpp
@@ -35,12 +35,11 @@
namespace WebCore {
-FELighting::FELighting(LightingType lightingType, FilterEffect* in, const Color& lightingColor, float surfaceScale,
+FELighting::FELighting(LightingType lightingType, const Color& lightingColor, float surfaceScale,
float diffuseConstant, float specularConstant, float specularExponent,
float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
: FilterEffect()
, m_lightingType(lightingType)
- , m_in(in)
, m_lightSource(lightSource)
, m_lightingColor(lightingColor)
, m_surfaceScale(surfaceScale)
@@ -243,8 +242,9 @@ bool FELighting::drawLighting(CanvasPixelArray* pixels, int width, int height)
void FELighting::apply(Filter* filter)
{
- m_in->apply(filter);
- if (!m_in->resultImage())
+ FilterEffect* in = inputEffect(0);
+ in->apply(filter);
+ if (!in->resultImage())
return;
if (!getEffectContext())
@@ -252,8 +252,8 @@ void FELighting::apply(Filter* filter)
setIsAlphaImage(false);
- IntRect effectDrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion());
- RefPtr<ImageData> srcImageData(m_in->resultImage()->getUnmultipliedImageData(effectDrawingRect));
+ IntRect effectDrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ RefPtr<ImageData> srcImageData(in->resultImage()->getUnmultipliedImageData(effectDrawingRect));
CanvasPixelArray* srcPixelArray(srcImageData->data());
// FIXME: support kernelUnitLengths other than (1,1). The issue here is that the W3
diff --git a/WebCore/svg/graphics/filters/SVGFELighting.h b/WebCore/svg/graphics/filters/SVGFELighting.h
index 7db50e0..55802ca 100644
--- a/WebCore/svg/graphics/filters/SVGFELighting.h
+++ b/WebCore/svg/graphics/filters/SVGFELighting.h
@@ -42,7 +42,6 @@ class CanvasPixelArray;
class FELighting : public FilterEffect {
public:
- virtual FloatRect uniteChildEffectSubregions(Filter* filter) { return calculateUnionOfChildEffectSubregions(filter, m_in.get()); }
void apply(Filter*);
protected:
@@ -72,15 +71,13 @@ protected:
ALWAYS_INLINE int downRightPixelValue();
};
- FELighting(LightingType, FilterEffect*, const Color&, float, float, float,
- float, float, float, PassRefPtr<LightSource>);
+ FELighting(LightingType, const Color&, float, float, float, float, float, float, PassRefPtr<LightSource>);
bool drawLighting(CanvasPixelArray*, int, int);
ALWAYS_INLINE void setPixel(LightingData&, LightSource::PaintingData&,
int lightX, int lightY, float factorX, int normalX, float factorY, int normalY);
LightingType m_lightingType;
- RefPtr<FilterEffect> m_in;
RefPtr<LightSource> m_lightSource;
Color m_lightingColor;
diff --git a/WebCore/svg/graphics/filters/SVGFEMerge.cpp b/WebCore/svg/graphics/filters/SVGFEMerge.cpp
index 11c7407..e92ce4c 100644
--- a/WebCore/svg/graphics/filters/SVGFEMerge.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEMerge.cpp
@@ -30,46 +30,24 @@
namespace WebCore {
-FEMerge::FEMerge(const Vector<RefPtr<FilterEffect> >& mergeInputs)
+FEMerge::FEMerge()
: FilterEffect()
- , m_mergeInputs(mergeInputs)
{
}
-PassRefPtr<FEMerge> FEMerge::create(const Vector<RefPtr<FilterEffect> >& mergeInputs)
+PassRefPtr<FEMerge> FEMerge::create()
{
- return adoptRef(new FEMerge(mergeInputs));
-}
-
-const Vector<RefPtr<FilterEffect> >& FEMerge::mergeInputs() const
-{
- return m_mergeInputs;
-}
-
-void FEMerge::setMergeInputs(const Vector<RefPtr<FilterEffect> >& mergeInputs)
-{
- m_mergeInputs = mergeInputs;
-}
-
-FloatRect FEMerge::uniteChildEffectSubregions(Filter* filter)
-{
- ASSERT(!m_mergeInputs.isEmpty());
-
- FloatRect uniteEffectRect = m_mergeInputs[0]->calculateEffectRect(filter);
-
- for (unsigned i = 1; i < m_mergeInputs.size(); i++)
- uniteEffectRect.unite(m_mergeInputs[i]->calculateEffectRect(filter));
-
- return uniteEffectRect;
+ return adoptRef(new FEMerge);
}
void FEMerge::apply(Filter* filter)
{
- ASSERT(!m_mergeInputs.isEmpty());
-
- for (unsigned i = 0; i < m_mergeInputs.size(); i++) {
- m_mergeInputs[i]->apply(filter);
- if (!m_mergeInputs[i]->resultImage())
+ unsigned size = numberOfEffectInputs();
+ ASSERT(size > 0);
+ for (unsigned i = 0; i < size; ++i) {
+ FilterEffect* in = inputEffect(i);
+ in->apply(filter);
+ if (!in->resultImage())
return;
}
@@ -77,9 +55,9 @@ void FEMerge::apply(Filter* filter)
if (!filterContext)
return;
- for (unsigned i = 0; i < m_mergeInputs.size(); i++) {
- FloatRect destRect = calculateDrawingRect(m_mergeInputs[i]->scaledSubRegion());
- filterContext->drawImageBuffer(m_mergeInputs[i]->resultImage(), DeviceColorSpace, destRect);
+ for (unsigned i = 0; i < size; ++i) {
+ FilterEffect* in = inputEffect(i);
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
}
}
@@ -92,12 +70,11 @@ TextStream& FEMerge::externalRepresentation(TextStream& ts, int indent) const
writeIndent(ts, indent);
ts << "[feMerge";
FilterEffect::externalRepresentation(ts);
- ts << " mergeNodes=\"" << m_mergeInputs.size() << "\"]\n";
- if (!m_mergeInputs.isEmpty()) {
- const Vector<RefPtr<FilterEffect> >::const_iterator end = m_mergeInputs.end();
- for (Vector<RefPtr<FilterEffect> >::const_iterator it = m_mergeInputs.begin(); it != end; ++it)
- (*it)->externalRepresentation(ts, indent + 1);
- }
+ unsigned size = numberOfEffectInputs();
+ ASSERT(size > 0);
+ ts << " mergeNodes=\"" << size << "\"]\n";
+ for (unsigned i = 0; i < size; ++i)
+ inputEffect(i)->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/svg/graphics/filters/SVGFEMerge.h b/WebCore/svg/graphics/filters/SVGFEMerge.h
index 66decfc..439d789 100644
--- a/WebCore/svg/graphics/filters/SVGFEMerge.h
+++ b/WebCore/svg/graphics/filters/SVGFEMerge.h
@@ -31,20 +31,14 @@ namespace WebCore {
class FEMerge : public FilterEffect {
public:
- static PassRefPtr<FEMerge> create(const Vector<RefPtr<FilterEffect> >&);
+ static PassRefPtr<FEMerge> create();
- const Vector<RefPtr<FilterEffect> >& mergeInputs() const;
- void setMergeInputs(const Vector<RefPtr<FilterEffect> >& mergeInputs);
-
- virtual FloatRect uniteChildEffectSubregions(Filter*);
void apply(Filter*);
void dump();
TextStream& externalRepresentation(TextStream&, int indent) const;
private:
- FEMerge(const Vector<RefPtr<FilterEffect> >&);
-
- Vector<RefPtr<FilterEffect> > m_mergeInputs;
+ FEMerge();
};
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp b/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
index 3fdf369..6645259 100644
--- a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
@@ -37,18 +37,17 @@ using std::max;
namespace WebCore {
-FEMorphology::FEMorphology(FilterEffect* in, MorphologyOperatorType type, float radiusX, float radiusY)
+FEMorphology::FEMorphology(MorphologyOperatorType type, float radiusX, float radiusY)
: FilterEffect()
- , m_in(in)
, m_type(type)
, m_radiusX(radiusX)
, m_radiusY(radiusY)
{
}
-PassRefPtr<FEMorphology> FEMorphology::create(FilterEffect* in, MorphologyOperatorType type, float radiusX, float radiusY)
+PassRefPtr<FEMorphology> FEMorphology::create(MorphologyOperatorType type, float radiusX, float radiusY)
{
- return adoptRef(new FEMorphology(in, type, radiusX, radiusY));
+ return adoptRef(new FEMorphology(type, radiusX, radiusY));
}
MorphologyOperatorType FEMorphology::morphologyOperator() const
@@ -83,14 +82,15 @@ void FEMorphology::setRadiusY(float radiusY)
void FEMorphology::apply(Filter* filter)
{
- m_in->apply(filter);
- if (!m_in->resultImage())
+ FilterEffect* in = inputEffect(0);
+ in->apply(filter);
+ if (!in->resultImage())
return;
-
+
if (!getEffectContext())
return;
- setIsAlphaImage(m_in->isAlphaImage());
+ setIsAlphaImage(in->isAlphaImage());
int radiusX = static_cast<int>(m_radiusX * filter->filterResolution().width());
int radiusY = static_cast<int>(m_radiusY * filter->filterResolution().height());
@@ -98,8 +98,8 @@ void FEMorphology::apply(Filter* filter)
return;
IntRect imageRect(IntPoint(), resultImage()->size());
- IntRect effectDrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion());
- RefPtr<CanvasPixelArray> srcPixelArray(m_in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data());
+ IntRect effectDrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ RefPtr<CanvasPixelArray> srcPixelArray(in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data());
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
int effectWidth = effectDrawingRect.width() * 4;
@@ -179,8 +179,8 @@ TextStream& FEMorphology::externalRepresentation(TextStream& ts, int indent) con
ts << "[feMorphology";
FilterEffect::externalRepresentation(ts);
ts << " operator=\"" << morphologyOperator() << "\" "
- << "radius=\"" << radiusX() << ", " << radiusY() << "\"]\n";
- m_in->externalRepresentation(ts, indent + 1);
+ << "radius=\"" << radiusX() << ", " << radiusY() << "\"]\n";
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/svg/graphics/filters/SVGFEMorphology.h b/WebCore/svg/graphics/filters/SVGFEMorphology.h
index 79f292d..9743d2b 100644
--- a/WebCore/svg/graphics/filters/SVGFEMorphology.h
+++ b/WebCore/svg/graphics/filters/SVGFEMorphology.h
@@ -36,7 +36,7 @@ namespace WebCore {
class FEMorphology : public FilterEffect {
public:
- static PassRefPtr<FEMorphology> create(FilterEffect*, MorphologyOperatorType, float radiusX, float radiusY);
+ static PassRefPtr<FEMorphology> create(MorphologyOperatorType, float radiusX, float radiusY);
MorphologyOperatorType morphologyOperator() const;
void setMorphologyOperator(MorphologyOperatorType);
@@ -46,15 +46,13 @@ namespace WebCore {
float radiusY() const;
void setRadiusY(float);
- virtual FloatRect uniteChildEffectSubregions(Filter* filter) { return calculateUnionOfChildEffectSubregions(filter, m_in.get()); }
void apply(Filter*);
void dump();
TextStream& externalRepresentation(TextStream&, int indent) const;
private:
- FEMorphology(FilterEffect*, MorphologyOperatorType, float radiusX, float radiusY);
+ FEMorphology(MorphologyOperatorType, float radiusX, float radiusY);
- RefPtr<FilterEffect> m_in;
MorphologyOperatorType m_type;
float m_radiusX;
float m_radiusY;
diff --git a/WebCore/svg/graphics/filters/SVGFEOffset.cpp b/WebCore/svg/graphics/filters/SVGFEOffset.cpp
index e12b8e0..685bd7b 100644
--- a/WebCore/svg/graphics/filters/SVGFEOffset.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEOffset.cpp
@@ -31,17 +31,16 @@
namespace WebCore {
-FEOffset::FEOffset(FilterEffect* in, const float& dx, const float& dy)
+FEOffset::FEOffset(float dx, float dy)
: FilterEffect()
- , m_in(in)
, m_dx(dx)
, m_dy(dy)
{
}
-PassRefPtr<FEOffset> FEOffset::create(FilterEffect* in, const float& dx, const float& dy)
+PassRefPtr<FEOffset> FEOffset::create(float dx, float dy)
{
- return adoptRef(new FEOffset(in, dx, dy));
+ return adoptRef(new FEOffset(dx, dy));
}
float FEOffset::dx() const
@@ -66,15 +65,16 @@ void FEOffset::setDy(float dy)
void FEOffset::apply(Filter* filter)
{
- m_in->apply(filter);
- if (!m_in->resultImage())
+ FilterEffect* in = inputEffect(0);
+ in->apply(filter);
+ if (!in->resultImage())
return;
GraphicsContext* filterContext = getEffectContext();
if (!filterContext)
return;
- setIsAlphaImage(m_in->isAlphaImage());
+ setIsAlphaImage(in->isAlphaImage());
FloatRect sourceImageRect = filter->sourceImageRect();
sourceImageRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
@@ -86,12 +86,12 @@ void FEOffset::apply(Filter* filter)
m_dx *= filter->filterResolution().width();
m_dy *= filter->filterResolution().height();
- FloatRect dstRect = FloatRect(m_dx + m_in->scaledSubRegion().x() - scaledSubRegion().x(),
- m_dy + m_in->scaledSubRegion().y() - scaledSubRegion().y(),
- m_in->scaledSubRegion().width(),
- m_in->scaledSubRegion().height());
+ FloatRect dstRect = FloatRect(m_dx + in->repaintRectInLocalCoordinates().x() - repaintRectInLocalCoordinates().x(),
+ m_dy + in->repaintRectInLocalCoordinates().y() - repaintRectInLocalCoordinates().y(),
+ in->repaintRectInLocalCoordinates().width(),
+ in->repaintRectInLocalCoordinates().height());
- filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, dstRect);
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, dstRect);
}
void FEOffset::dump()
@@ -104,7 +104,7 @@ TextStream& FEOffset::externalRepresentation(TextStream& ts, int indent) const
ts << "[feOffset";
FilterEffect::externalRepresentation(ts);
ts << " dx=\"" << dx() << "\" dy=\"" << dy() << "\"]\n";
- m_in->externalRepresentation(ts, indent + 1);
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/svg/graphics/filters/SVGFEOffset.h b/WebCore/svg/graphics/filters/SVGFEOffset.h
index ad071d6..34ed97b 100644
--- a/WebCore/svg/graphics/filters/SVGFEOffset.h
+++ b/WebCore/svg/graphics/filters/SVGFEOffset.h
@@ -30,7 +30,7 @@ namespace WebCore {
class FEOffset : public FilterEffect {
public:
- static PassRefPtr<FEOffset> create(FilterEffect*, const float&, const float&);
+ static PassRefPtr<FEOffset> create(float, float);
float dx() const;
void setDx(float);
@@ -38,15 +38,13 @@ namespace WebCore {
float dy() const;
void setDy(float);
- virtual FloatRect uniteChildEffectSubregions(Filter* filter) { return calculateUnionOfChildEffectSubregions(filter, m_in.get()); }
void apply(Filter*);
void dump();
TextStream& externalRepresentation(TextStream&, int indent) const;
private:
- FEOffset(FilterEffect*, const float&, const float&);
+ FEOffset(float, float);
- RefPtr<FilterEffect> m_in;
float m_dx;
float m_dy;
};
diff --git a/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp b/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp
index 5c6dc2a..33f7b6c 100644
--- a/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp
+++ b/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp
@@ -29,18 +29,18 @@
namespace WebCore {
-FESpecularLighting::FESpecularLighting(FilterEffect* in, const Color& lightingColor, float surfaceScale,
+FESpecularLighting::FESpecularLighting(const Color& lightingColor, float surfaceScale,
float specularConstant, float specularExponent, float kernelUnitLengthX,
float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
- : FELighting(SpecularLighting, in, lightingColor, surfaceScale, 0.0f, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, lightSource)
+ : FELighting(SpecularLighting, lightingColor, surfaceScale, 0, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, lightSource)
{
}
-PassRefPtr<FESpecularLighting> FESpecularLighting::create(FilterEffect* in, const Color& lightingColor,
+PassRefPtr<FESpecularLighting> FESpecularLighting::create(const Color& lightingColor,
float surfaceScale, float specularConstant, float specularExponent,
float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
{
- return adoptRef(new FESpecularLighting(in, lightingColor, surfaceScale, specularConstant, specularExponent,
+ return adoptRef(new FESpecularLighting(lightingColor, surfaceScale, specularConstant, specularExponent,
kernelUnitLengthX, kernelUnitLengthY, lightSource));
}
@@ -130,7 +130,7 @@ TextStream& FESpecularLighting::externalRepresentation(TextStream& ts, int inden
ts << " surfaceScale=\"" << m_surfaceScale << "\" "
<< "specualConstant=\"" << m_specularConstant << "\" "
<< "specularExponent=\"" << m_specularExponent << "\"]\n";
- m_in->externalRepresentation(ts, indent + 1);
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/svg/graphics/filters/SVGFESpecularLighting.h b/WebCore/svg/graphics/filters/SVGFESpecularLighting.h
index 3a49c1e..6067a76 100644
--- a/WebCore/svg/graphics/filters/SVGFESpecularLighting.h
+++ b/WebCore/svg/graphics/filters/SVGFESpecularLighting.h
@@ -29,7 +29,7 @@ namespace WebCore {
class FESpecularLighting : public FELighting {
public:
- static PassRefPtr<FESpecularLighting> create(FilterEffect*, const Color&, float, float,
+ static PassRefPtr<FESpecularLighting> create(const Color&, float, float,
float, float, float, PassRefPtr<LightSource>);
virtual ~FESpecularLighting();
@@ -58,8 +58,7 @@ public:
TextStream& externalRepresentation(TextStream&, int indent) const;
private:
- FESpecularLighting(FilterEffect*, const Color&, float, float, float,
- float, float, PassRefPtr<LightSource>);
+ FESpecularLighting(const Color&, float, float, float, float, float, PassRefPtr<LightSource>);
};
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFETile.cpp b/WebCore/svg/graphics/filters/SVGFETile.cpp
index 56cbc1e..80eb9b3 100644
--- a/WebCore/svg/graphics/filters/SVGFETile.cpp
+++ b/WebCore/svg/graphics/filters/SVGFETile.cpp
@@ -31,40 +31,42 @@
namespace WebCore {
-FETile::FETile(FilterEffect* in)
+FETile::FETile()
: FilterEffect()
- , m_in(in)
{
}
-PassRefPtr<FETile> FETile::create(FilterEffect* in)
+PassRefPtr<FETile> FETile::create()
{
- return adoptRef(new FETile(in));
+ return adoptRef(new FETile);
}
-FloatRect FETile::uniteChildEffectSubregions(Filter* filter)
+FloatRect FETile::determineFilterPrimitiveSubregion(Filter* filter)
{
- m_in->calculateEffectRect(filter);
- return filter->filterRegion();
+ inputEffect(0)->determineFilterPrimitiveSubregion(filter);
+
+ filter->determineFilterPrimitiveSubregion(this, filter->filterRegion());
+ return filterPrimitiveSubregion();
}
void FETile::apply(Filter* filter)
{
- m_in->apply(filter);
- if (!m_in->resultImage())
+ FilterEffect* in = inputEffect(0);
+ in->apply(filter);
+ if (!in->resultImage())
return;
GraphicsContext* filterContext = getEffectContext();
if (!filterContext)
return;
- setIsAlphaImage(m_in->isAlphaImage());
+ setIsAlphaImage(in->isAlphaImage());
- IntRect tileRect = enclosingIntRect(m_in->scaledSubRegion());
+ IntRect tileRect = enclosingIntRect(in->repaintRectInLocalCoordinates());
// Source input needs more attention. It has the size of the filterRegion but gives the
// size of the cutted sourceImage back. This is part of the specification and optimization.
- if (m_in->isSourceInput()) {
+ if (in->isSourceInput()) {
FloatRect filterRegion = filter->filterRegion();
filterRegion.scale(filter->filterResolution().width(), filter->filterResolution().height());
tileRect = enclosingIntRect(filterRegion);
@@ -72,15 +74,16 @@ void FETile::apply(Filter* filter)
OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(tileRect.size());
GraphicsContext* tileImageContext = tileImage->context();
- tileImageContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, IntPoint());
+ tileImageContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, IntPoint());
RefPtr<Pattern> pattern = Pattern::create(tileImage->copyImage(), true, true);
AffineTransform matrix;
- matrix.translate(m_in->scaledSubRegion().x() - scaledSubRegion().x(), m_in->scaledSubRegion().y() - scaledSubRegion().y());
+ matrix.translate(in->repaintRectInLocalCoordinates().x() - repaintRectInLocalCoordinates().x(),
+ in->repaintRectInLocalCoordinates().y() - repaintRectInLocalCoordinates().y());
pattern.get()->setPatternSpaceTransform(matrix);
filterContext->setFillPattern(pattern);
- filterContext->fillRect(FloatRect(FloatPoint(), scaledSubRegion().size()));
+ filterContext->fillRect(FloatRect(FloatPoint(), repaintRectInLocalCoordinates().size()));
}
void FETile::dump()
@@ -93,7 +96,7 @@ TextStream& FETile::externalRepresentation(TextStream& ts, int indent) const
ts << "[feTile";
FilterEffect::externalRepresentation(ts);
ts << "]\n";
- m_in->externalRepresentation(ts, indent + 1);
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/svg/graphics/filters/SVGFETile.h b/WebCore/svg/graphics/filters/SVGFETile.h
index 7af9c13..128c9cb 100644
--- a/WebCore/svg/graphics/filters/SVGFETile.h
+++ b/WebCore/svg/graphics/filters/SVGFETile.h
@@ -30,17 +30,16 @@ namespace WebCore {
class FETile : public FilterEffect {
public:
- static PassRefPtr<FETile> create(FilterEffect*);
+ static PassRefPtr<FETile> create();
- virtual FloatRect uniteChildEffectSubregions(Filter*);
void apply(Filter*);
void dump();
TextStream& externalRepresentation(TextStream&, int indent) const;
+
+ virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
private:
- FETile(FilterEffect*);
-
- RefPtr<FilterEffect> m_in;
+ FETile();
};
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFilter.cpp b/WebCore/svg/graphics/filters/SVGFilter.cpp
index 947dbed..d72dc3d 100644
--- a/WebCore/svg/graphics/filters/SVGFilter.cpp
+++ b/WebCore/svg/graphics/filters/SVGFilter.cpp
@@ -24,60 +24,64 @@
namespace WebCore {
-SVGFilter::SVGFilter(const FloatRect& itemBox, const FloatRect& filterRect, bool effectBBoxMode)
+SVGFilter::SVGFilter(const FloatRect& targetBoundingBox, const FloatRect& filterRect, bool effectBBoxMode)
: Filter()
- , m_itemBox(itemBox)
+ , m_targetBoundingBox(targetBoundingBox)
, m_filterRect(filterRect)
, m_effectBBoxMode(effectBBoxMode)
{
}
-void SVGFilter::calculateEffectSubRegion(FilterEffect* effect)
+void SVGFilter::determineFilterPrimitiveSubregion(FilterEffect* effect, const FloatRect& unionOfPreviousPrimitiveSubregions)
{
FloatRect subRegionBBox = effect->effectBoundaries();
- FloatRect useBBox = effect->unionOfChildEffectSubregions();
FloatRect newSubRegion = subRegionBBox;
if (m_effectBBoxMode) {
- newSubRegion = useBBox;
+ newSubRegion = unionOfPreviousPrimitiveSubregions;
if (effect->hasX())
- newSubRegion.setX(m_itemBox.x() + subRegionBBox.x() * m_itemBox.width());
+ newSubRegion.setX(m_targetBoundingBox.x() + subRegionBBox.x() * m_targetBoundingBox.width());
- if (effect->hasY())
- newSubRegion.setY(m_itemBox.y() + subRegionBBox.y() * m_itemBox.height());
+ if (effect->hasY())
+ newSubRegion.setY(m_targetBoundingBox.y() + subRegionBBox.y() * m_targetBoundingBox.height());
if (effect->hasWidth())
- newSubRegion.setWidth(subRegionBBox.width() * m_itemBox.width());
+ newSubRegion.setWidth(subRegionBBox.width() * m_targetBoundingBox.width());
if (effect->hasHeight())
- newSubRegion.setHeight(subRegionBBox.height() * m_itemBox.height());
+ newSubRegion.setHeight(subRegionBBox.height() * m_targetBoundingBox.height());
} else {
if (!effect->hasX())
- newSubRegion.setX(useBBox.x());
+ newSubRegion.setX(unionOfPreviousPrimitiveSubregions.x());
if (!effect->hasY())
- newSubRegion.setY(useBBox.y());
+ newSubRegion.setY(unionOfPreviousPrimitiveSubregions.y());
if (!effect->hasWidth())
- newSubRegion.setWidth(useBBox.width());
+ newSubRegion.setWidth(unionOfPreviousPrimitiveSubregions.width());
if (!effect->hasHeight())
- newSubRegion.setHeight(useBBox.height());
+ newSubRegion.setHeight(unionOfPreviousPrimitiveSubregions.height());
}
// clip every filter effect to the filter region
newSubRegion.intersect(m_filterRect);
- effect->setSubRegion(newSubRegion);
+ effect->setFilterPrimitiveSubregion(newSubRegion);
+
+ // TODO: Everything above should be moved to a first phase of layout in RenderSVGResourceFilterPrimitive.
+ // The scaling of the subregion to the repaint rect should be merged with a more intelligent repaint logic
+ // and moved to the second phase of layout in RenderSVGResourceFilterPrimitive.
+ // See bug https://bugs.webkit.org/show_bug.cgi?id=45614.
newSubRegion.scale(filterResolution().width(), filterResolution().height());
- effect->setScaledSubRegion(newSubRegion);
+ effect->setRepaintRectInLocalCoordinates(newSubRegion);
m_maxImageSize = m_maxImageSize.expandedTo(newSubRegion.size());
}
-PassRefPtr<SVGFilter> SVGFilter::create(const FloatRect& itemBox, const FloatRect& filterRect, bool effectBBoxMode)
+PassRefPtr<SVGFilter> SVGFilter::create(const FloatRect& targetBoundingBox, const FloatRect& filterRect, bool effectBBoxMode)
{
- return adoptRef(new SVGFilter(itemBox, filterRect, effectBBoxMode));
+ return adoptRef(new SVGFilter(targetBoundingBox, filterRect, effectBBoxMode));
}
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFilter.h b/WebCore/svg/graphics/filters/SVGFilter.h
index 1ee5e8a..631f1ee 100644
--- a/WebCore/svg/graphics/filters/SVGFilter.h
+++ b/WebCore/svg/graphics/filters/SVGFilter.h
@@ -39,16 +39,17 @@ namespace WebCore {
virtual bool effectBoundingBoxMode() const { return m_effectBBoxMode; }
virtual FloatRect filterRegion() const { return m_filterRect; }
- virtual FloatRect sourceImageRect() const { return m_itemBox; }
+
+ virtual FloatRect sourceImageRect() const { return m_targetBoundingBox; }
virtual FloatSize maxImageSize() const { return m_maxImageSize; }
- virtual void calculateEffectSubRegion(FilterEffect*);
+ virtual void determineFilterPrimitiveSubregion(FilterEffect*, const FloatRect&);
private:
- SVGFilter(const FloatRect& itemBox, const FloatRect& filterRect, bool effectBBoxMode);
+ SVGFilter(const FloatRect& targetBoundingBox, const FloatRect& filterRect, bool effectBBoxMode);
FloatSize m_maxImageSize;
- FloatRect m_itemBox;
+ FloatRect m_targetBoundingBox;
FloatRect m_filterRect;
bool m_effectBBoxMode;
};
diff --git a/WebCore/websockets/WebSocket.cpp b/WebCore/websockets/WebSocket.cpp
index 38629d7..073a924 100644
--- a/WebCore/websockets/WebSocket.cpp
+++ b/WebCore/websockets/WebSocket.cpp
@@ -216,7 +216,7 @@ bool WebSocket::canSuspend() const
return !m_channel;
}
-void WebSocket::suspend()
+void WebSocket::suspend(ReasonForSuspension)
{
if (m_channel)
m_channel->suspend();
diff --git a/WebCore/websockets/WebSocket.h b/WebCore/websockets/WebSocket.h
index fd3ee56..7f63cbf 100644
--- a/WebCore/websockets/WebSocket.h
+++ b/WebCore/websockets/WebSocket.h
@@ -83,7 +83,7 @@ namespace WebCore {
virtual ScriptExecutionContext* scriptExecutionContext() const;
virtual void contextDestroyed();
virtual bool canSuspend() const;
- virtual void suspend();
+ virtual void suspend(ReasonForSuspension);
virtual void resume();
virtual void stop();
diff --git a/WebCore/websockets/WebSocketChannel.cpp b/WebCore/websockets/WebSocketChannel.cpp
index a09224d..5ce1cc3 100644
--- a/WebCore/websockets/WebSocketChannel.cpp
+++ b/WebCore/websockets/WebSocketChannel.cpp
@@ -36,8 +36,11 @@
#include "CookieJar.h"
#include "Document.h"
+#include "InspectorController.h"
#include "Logging.h"
+#include "Page.h"
#include "PlatformString.h"
+#include "ProgressTracker.h"
#include "ScriptExecutionContext.h"
#include "SocketStreamError.h"
#include "SocketStreamHandle.h"
@@ -63,7 +66,14 @@ WebSocketChannel::WebSocketChannel(ScriptExecutionContext* context, WebSocketCha
, m_closed(false)
, m_shouldDiscardReceivedData(false)
, m_unhandledBufferedAmount(0)
+#if ENABLE(INSPECTOR)
+ , m_identifier(0)
+#endif
{
+#if ENABLE(INSPECTOR)
+ if (InspectorController* controller = m_context->inspectorController())
+ controller->didCreateWebSocket(identifier(), url, m_context->url());
+#endif
}
WebSocketChannel::~WebSocketChannel()
@@ -113,6 +123,11 @@ void WebSocketChannel::close()
void WebSocketChannel::disconnect()
{
LOG(Network, "WebSocketChannel %p disconnect", this);
+#if ENABLE(INSPECTOR)
+ if (m_context)
+ if (InspectorController* controller = m_context->inspectorController())
+ controller->didCloseWebSocket(identifier());
+#endif
m_handshake.clearScriptExecutionContext();
m_client = 0;
m_context = 0;
@@ -138,6 +153,10 @@ void WebSocketChannel::didOpen(SocketStreamHandle* handle)
ASSERT(handle == m_handle);
if (!m_context)
return;
+#if ENABLE(INSPECTOR)
+ if (InspectorController* controller = m_context->inspectorController())
+ controller->willSendWebSocketHandshakeRequest(identifier(), m_handshake.clientHandshakeRequest());
+#endif
const CString& handshakeMessage = m_handshake.clientHandshakeMessage();
if (!handle->send(handshakeMessage.data(), handshakeMessage.length())) {
m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error sending handshake message.", 0, m_handshake.clientOrigin());
@@ -148,6 +167,11 @@ void WebSocketChannel::didOpen(SocketStreamHandle* handle)
void WebSocketChannel::didClose(SocketStreamHandle* handle)
{
LOG(Network, "WebSocketChannel %p didClose", this);
+#if ENABLE(INSPECTOR)
+ if (m_context)
+ if (InspectorController* controller = m_context->inspectorController())
+ controller->didCloseWebSocket(identifier());
+#endif
ASSERT_UNUSED(handle, handle == m_handle || !m_handle);
m_closed = true;
if (m_handle) {
@@ -251,6 +275,10 @@ bool WebSocketChannel::processBuffer()
if (headerLength <= 0)
return false;
if (m_handshake.mode() == WebSocketHandshake::Connected) {
+#if ENABLE(INSPECTOR)
+ if (InspectorController* controller = m_context->inspectorController())
+ controller->didReceiveWebSocketHandshakeResponse(identifier(), m_handshake.serverHandshakeResponse());
+#endif
if (!m_handshake.serverSetCookie().isEmpty()) {
if (m_context->isDocument()) {
Document* document = static_cast<Document*>(m_context);
@@ -368,6 +396,21 @@ void WebSocketChannel::resumeTimerFired(Timer<WebSocketChannel>* timer)
didClose(m_handle.get());
}
+#if ENABLE(INSPECTOR)
+unsigned long WebSocketChannel::identifier()
+{
+ if (m_identifier)
+ return m_identifier;
+
+ if (InspectorController* controller = m_context->inspectorController())
+ if (Page* page = controller->inspectedPage())
+ m_identifier = page->progress()->createUniqueIdentifier();
+
+ ASSERT(m_identifier);
+ return m_identifier;
+}
+#endif // ENABLE(INSPECTOR)
+
} // namespace WebCore
#endif // ENABLE(WEB_SOCKETS)
diff --git a/WebCore/websockets/WebSocketChannel.h b/WebCore/websockets/WebSocketChannel.h
index 43d431a..a08e6bb 100644
--- a/WebCore/websockets/WebSocketChannel.h
+++ b/WebCore/websockets/WebSocketChannel.h
@@ -84,6 +84,10 @@ namespace WebCore {
bool processBuffer();
void resumeTimerFired(Timer<WebSocketChannel>* timer);
+#if ENABLE(INSPECTOR)
+ unsigned long identifier();
+#endif
+
ScriptExecutionContext* m_context;
WebSocketChannelClient* m_client;
WebSocketHandshake m_handshake;
@@ -96,6 +100,10 @@ namespace WebCore {
bool m_closed;
bool m_shouldDiscardReceivedData;
unsigned long m_unhandledBufferedAmount;
+
+#if ENABLE(INSPECTOR)
+ unsigned long m_identifier;
+#endif
};
} // namespace WebCore
diff --git a/WebCore/wml/WMLAElement.cpp b/WebCore/wml/WMLAElement.cpp
index 4d1bf95..c60db5e 100644
--- a/WebCore/wml/WMLAElement.cpp
+++ b/WebCore/wml/WMLAElement.cpp
@@ -4,7 +4,7 @@
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Simon Hausmann <hausmann@kde.org>
- * Copyright (C) 2003, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
* (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* This library is free software; you can redistribute it and/or
@@ -35,6 +35,7 @@
#include "EventNames.h"
#include "Frame.h"
#include "FrameLoader.h"
+#include "HTMLAnchorElement.h"
#include "HTMLNames.h"
#include "KeyboardEvent.h"
#include "MouseEvent.h"
@@ -119,37 +120,17 @@ bool WMLAElement::isKeyboardFocusable(KeyboardEvent* event) const
void WMLAElement::defaultEventHandler(Event* event)
{
- if (isLink() && (event->type() == eventNames().clickEvent || (event->type() == eventNames().keydownEvent && focused()))) {
- MouseEvent* e = 0;
- if (event->type() == eventNames().clickEvent && event->isMouseEvent())
- e = static_cast<MouseEvent*>(event);
-
- KeyboardEvent* k = 0;
- if (event->type() == eventNames().keydownEvent && event->isKeyboardEvent())
- k = static_cast<KeyboardEvent*>(event);
-
- if (e && e->button() == RightButton) {
- WMLElement::defaultEventHandler(event);
- return;
- }
-
- if (k) {
- if (k->keyIdentifier() != "Enter") {
- WMLElement::defaultEventHandler(event);
- return;
- }
-
+ if (isLink()) {
+ if (focused() && isEnterKeyKeydownEvent(event)) {
event->setDefaultHandled();
dispatchSimulatedClick(event);
return;
}
-
- if (!event->defaultPrevented() && document()->frame()) {
- KURL url = document()->completeURL(deprecatedParseURL(getAttribute(HTMLNames::hrefAttr)));
- document()->frame()->loader()->urlSelected(url, target(), event, false, false, true, SendReferrer);
- }
- event->setDefaultHandled();
+ if (isLinkClick(event)) {
+ handleLinkClick(event, document(), deprecatedParseURL(getAttribute(HTMLNames::hrefAttr)), target(), event);
+ return;
+ }
}
WMLElement::defaultEventHandler(event);
diff --git a/WebCore/wml/WMLElement.cpp b/WebCore/wml/WMLElement.cpp
index 4d18e94..5c8a94c 100644
--- a/WebCore/wml/WMLElement.cpp
+++ b/WebCore/wml/WMLElement.cpp
@@ -72,12 +72,10 @@ void WMLElement::parseMappedAttribute(Attribute* attr)
addCSSProperty(attr, CSSPropertyTextAlign, attr->value());
} else if (attr->name() == HTMLNames::tabindexAttr) {
String indexstring = attr->value();
- if (indexstring.length()) {
- bool parsedOK;
- int tabindex = indexstring.toIntStrict(&parsedOK);
- if (parsedOK)
- // Clamp tabindex to the range of 'short' to match Firefox's behavior.
- setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max()))));
+ int tabindex = 0;
+ if (parseHTMLInteger(tabindex)) {
+ // Clamp tabindex to the range of 'short' to match Firefox's behavior.
+ setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max()))));
}
}
}
diff --git a/WebCore/wml/WMLImageLoader.cpp b/WebCore/wml/WMLImageLoader.cpp
index 3c40215..1f1054f 100644
--- a/WebCore/wml/WMLImageLoader.cpp
+++ b/WebCore/wml/WMLImageLoader.cpp
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
*
* This library is free software; you can redistribute it and/or
@@ -49,7 +49,7 @@ void WMLImageLoader::dispatchLoadEvent()
String WMLImageLoader::sourceURI(const AtomicString& attr) const
{
- return deprecatedParseURL(KURL(element()->baseURI(), attr).string());
+ return KURL(element()->baseURI(), deprecatedParseURL(attr));
}
void WMLImageLoader::notifyFinished(CachedResource* image)
diff --git a/WebCore/wml/WMLInputElement.cpp b/WebCore/wml/WMLInputElement.cpp
index 639658f..2165bd4 100644
--- a/WebCore/wml/WMLInputElement.cpp
+++ b/WebCore/wml/WMLInputElement.cpp
@@ -274,7 +274,7 @@ void WMLInputElement::defaultEventHandler(Event* evt)
}
if (evt->type() == eventNames().keydownEvent && evt->isKeyboardEvent() && focused() && document()->frame()
- && document()->frame()->doTextFieldCommandFromEvent(this, static_cast<KeyboardEvent*>(evt))) {
+ && document()->frame()->editor()->doTextFieldCommandFromEvent(this, static_cast<KeyboardEvent*>(evt))) {
evt->setDefaultHandled();
return;
}
diff --git a/WebCore/xml/XMLHttpRequest.cpp b/WebCore/xml/XMLHttpRequest.cpp
index 9f93e1a..9c7d076 100644
--- a/WebCore/xml/XMLHttpRequest.cpp
+++ b/WebCore/xml/XMLHttpRequest.cpp
@@ -1061,7 +1061,7 @@ bool XMLHttpRequest::canSuspend() const
return !m_loader;
}
-void XMLHttpRequest::suspend()
+void XMLHttpRequest::suspend(ReasonForSuspension)
{
m_progressEventThrottle.suspend();
}
diff --git a/WebCore/xml/XMLHttpRequest.h b/WebCore/xml/XMLHttpRequest.h
index d25f63f..ac18828 100644
--- a/WebCore/xml/XMLHttpRequest.h
+++ b/WebCore/xml/XMLHttpRequest.h
@@ -59,7 +59,7 @@ public:
virtual void contextDestroyed();
virtual bool canSuspend() const;
- virtual void suspend();
+ virtual void suspend(ReasonForSuspension);
virtual void resume();
virtual void stop();
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index bdddda0..c6da648 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,36 @@
+2010-09-17 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/45989> Add WebArchiveInternal.h to Xcode project
+
+ Reviewed by Joseph Pecoraro.
+
+ * WebKit.xcodeproj/project.pbxproj: Added missing
+ WebArchiveInternal.h header file to the project. It has been
+ missing since r31281!
+
+2010-09-16 Dan Bernstein <mitz@apple.com>
+
+ Reverted the previous change because r67628 has been reverted.
+
+ * English.lproj/Localizable.strings:
+
+2010-09-16 Dan Bernstein <mitz@apple.com>
+
+ Updated localizable strings.
+
+ * English.lproj/Localizable.strings:
+
+2010-09-10 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Move some Dashboard stuff from WebCore to WebKit along with a bit more FrameMac cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=45582
+
+ * WebKit.xcodeproj/project.pbxproj: Added WebDashboardRegion.h/mm and
+ also gave the header private visibility so it will get installed in the
+ PrivateHeaders directory.
+
2010-09-02 Steve Block <steveblock@google.com>
Reviewed by Adam Barth.
diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj
index 5b44054..a2a6091 100644
--- a/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -91,6 +91,7 @@
41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F4484D10338E8C0030E55E /* WebWorkersPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41F4484E10338E8C0030E55E /* WebWorkersPrivate.mm */; };
441793A60E34EE150055E1AE /* WebHTMLRepresentationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */; };
+ 44BB8B141241A022001E3A22 /* WebArchiveInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 44BB8B131241A022001E3A22 /* WebArchiveInternal.h */; };
4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */; settings = {ATTRIBUTES = (); }; };
4BF99F910AE050BC00815C2B /* WebEditorClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */; };
511F3FD50CECC88F00852565 /* WebDatabaseManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 511F3FD10CECC88F00852565 /* WebDatabaseManager.mm */; };
@@ -321,6 +322,8 @@
9398112C0824BF01008DF038 /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F738C9EA03FAD3DF0321FBE0 /* WebCore.framework */; };
9398112E0824BF01008DF038 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 93D623DD051E791F002F47DD /* libicucore.dylib */; };
9398112F0824BF01008DF038 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 830E81E005853AC000AD0891 /* Security.framework */; };
+ 93E2A1A4123B0B3C009FE12A /* WebDashboardRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E2A1A2123B0B3C009FE12A /* WebDashboardRegion.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 93E2A1A5123B0B3C009FE12A /* WebDashboardRegion.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93E2A1A3123B0B3C009FE12A /* WebDashboardRegion.mm */; };
93EB178D09F88D460091F8FF /* WebSystemInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93EB178C09F88D460091F8FF /* WebSystemInterface.mm */; };
93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EB178E09F88D510091F8FF /* WebSystemInterface.h */; };
93FDE9330D79CAF30074F029 /* WebHistoryInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FDE9320D79CAF30074F029 /* WebHistoryInternal.h */; };
@@ -488,6 +491,7 @@
41F4484E10338E8C0030E55E /* WebWorkersPrivate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebWorkersPrivate.mm; path = mac/Workers/WebWorkersPrivate.mm; sourceTree = "<group>"; };
441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebHTMLRepresentationInternal.h; sourceTree = "<group>"; };
449098B90F8F82DF0076A327 /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; };
+ 44BB8B131241A022001E3A22 /* WebArchiveInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebArchiveInternal.h; sourceTree = "<group>"; };
4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebEditorClient.h; sourceTree = "<group>"; };
4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEditorClient.mm; sourceTree = "<group>"; };
511F3FD10CECC88F00852565 /* WebDatabaseManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDatabaseManager.mm; sourceTree = "<group>"; };
@@ -627,6 +631,8 @@
93C6F14507920B93002449CD /* WebFrameViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameViewPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
93D1FE13067EB10B009CE68A /* WebNSObjectExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSObjectExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
93D623DD051E791F002F47DD /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = /usr/lib/libicucore.dylib; sourceTree = "<absolute>"; };
+ 93E2A1A2123B0B3C009FE12A /* WebDashboardRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDashboardRegion.h; sourceTree = "<group>"; };
+ 93E2A1A3123B0B3C009FE12A /* WebDashboardRegion.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDashboardRegion.mm; sourceTree = "<group>"; };
93EB178C09F88D460091F8FF /* WebSystemInterface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSystemInterface.mm; sourceTree = "<group>"; };
93EB178E09F88D510091F8FF /* WebSystemInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSystemInterface.h; sourceTree = "<group>"; };
93FDE9320D79CAF30074F029 /* WebHistoryInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryInternal.h; sourceTree = "<group>"; };
@@ -1142,25 +1148,28 @@
9C7CABBB0190A37C0ECA16EA /* WebView */ = {
isa = PBXGroup;
children = (
- 598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */,
- 598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */,
- 598AD9271201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm */,
- 598AD9251201CF2500ABAE4E /* WebDeviceOrientationProviderMock.h */,
- 598AD9231201CF1900ABAE4E /* WebDeviceOrientationInternal.h */,
- 598AD9211201CF1000ABAE4E /* WebDeviceOrientation.mm */,
- 598AD91F1201CF0700ABAE4E /* WebDeviceOrientation.h */,
F52CA6BD02DF9D0F018635CA /* HTML */,
51E94C0706C02CA300A9B09E /* PDF */,
8373435A0624EE0D00F3B289 /* WebArchive.h */,
8373435B0624EE0D00F3B289 /* WebArchive.mm */,
+ 44BB8B131241A022001E3A22 /* WebArchiveInternal.h */,
933D659903413FF2008635CE /* WebClipView.h */,
933D659A03413FF2008635CE /* WebClipView.mm */,
+ 93E2A1A2123B0B3C009FE12A /* WebDashboardRegion.h */,
+ 93E2A1A3123B0B3C009FE12A /* WebDashboardRegion.mm */,
39446070020F50ED0ECA1767 /* WebDataSource.h */,
39446071020F50ED0ECA1767 /* WebDataSource.mm */,
658A40950A14853B005E6987 /* WebDataSourceInternal.h */,
39446072020F50ED0ECA1767 /* WebDataSourcePrivate.h */,
BC542C400FD7766F00D8AB5D /* WebDelegateImplementationCaching.h */,
BC542C410FD7766F00D8AB5D /* WebDelegateImplementationCaching.mm */,
+ 598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */,
+ 598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */,
+ 598AD9271201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm */,
+ 598AD9251201CF2500ABAE4E /* WebDeviceOrientationProviderMock.h */,
+ 598AD9231201CF1900ABAE4E /* WebDeviceOrientationInternal.h */,
+ 598AD9211201CF1000ABAE4E /* WebDeviceOrientation.mm */,
+ 598AD91F1201CF0700ABAE4E /* WebDeviceOrientation.h */,
35081DAE02B6D4F50ACA2ACA /* WebDocument.h */,
ED21B9810528F7AA003299AC /* WebDocumentInternal.h */,
65FFB7FA0AD0B7D30048CD05 /* WebDocumentLoaderMac.h */,
@@ -1425,6 +1434,7 @@
E169836211346D1B00894115 /* ProxyRuntimeObject.h in Headers */,
B6CE5C25100BC5F500219936 /* WebApplicationCache.h in Headers */,
9398109A0824BF01008DF038 /* WebArchive.h in Headers */,
+ 44BB8B141241A022001E3A22 /* WebArchiveInternal.h in Headers */,
5DE92FEF0BD7017E0059A5FD /* WebAssertions.h in Headers */,
939810290824BF01008DF038 /* WebAuthenticationPanel.h in Headers */,
939810110824BF01008DF038 /* WebBackForwardList.h in Headers */,
@@ -1622,6 +1632,7 @@
598AD9261201CF2500ABAE4E /* WebDeviceOrientationProviderMock.h in Headers */,
598AD92A1201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h in Headers */,
598ADA461202275000ABAE4E /* WebDeviceOrientationProvider.h in Headers */,
+ 93E2A1A4123B0B3C009FE12A /* WebDashboardRegion.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1988,6 +1999,7 @@
598AD91E1201CECF00ABAE4E /* WebDeviceOrientationClient.mm in Sources */,
598AD9221201CF1000ABAE4E /* WebDeviceOrientation.mm in Sources */,
598AD9281201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm in Sources */,
+ 93E2A1A5123B0B3C009FE12A /* WebDashboardRegion.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index e9f6354..dd23f6f 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,961 @@
+2010-09-20 Darin Adler <darin@apple.com>
+
+ Reviewed by James Robinson.
+
+ Deprecate the inputType function on HTMLInputElement
+ https://bugs.webkit.org/show_bug.cgi?id=46023
+
+ * src/WebInputElement.cpp:
+ (WebKit::WebInputElement::inputType):
+ * src/WebPasswordFormUtils.cpp:
+ (WebKit::findPasswordFormFields):
+ * src/WebSearchableFormData.cpp:
+ (WebCore::HasSuitableTextElement):
+ Use deprecatedInputType instead of inputType.
+
+2010-09-20 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ [chromium] Change compositor to use GraphicsContext3D rather than GLES2Context
+ https://bugs.webkit.org/show_bug.cgi?id=45912
+
+ Switched Chromium's compositor to use GraphicsContext3D to issue
+ its OpenGL rendering calls rather than the Chromium-specific
+ GLES2Context and command buffer OpenGL implementation.
+
+ The in-process software rendering path for GraphicsContext3D does
+ not yet work with the compositor, at least not on Mac OS X. This
+ will be worked on in subsequent bugs.
+
+ Tested manually with 3D CSS, WebGL and video content on Mac OS X
+ and Linux. No new tests.
+
+ * src/GraphicsContext3D.cpp:
+ (WebCore::GraphicsContext3DInternal::initialize):
+ (WebCore::GraphicsContext3DInternal::extractWebGraphicsContext3D):
+ (WebCore::GraphicsContext3D::create):
+ * src/GraphicsContext3DInternal.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::resize):
+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+ (WebKit::WebViewImpl::gles2Context):
+ (WebKit::WebViewImpl::graphicsContext3D):
+ * src/WebViewImpl.h:
+
+2010-09-20 Kenneth Russell <kbr@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] Roll forward Chromium DEPS to pick up WebGraphicsContext3D implementation changes
+ https://bugs.webkit.org/show_bug.cgi?id=46115
+
+ * DEPS:
+
+2010-09-20 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: merge Inspector client runtime events into the serialized inspector state object.
+
+ Drive-by rename getBackendSettings -> getInspectorState to better reflect the nature of the data.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45974
+
+ * src/InspectorClientImpl.cpp:
+ (WebKit::InspectorClientImpl::updateInspectorStateCookie):
+ * src/InspectorClientImpl.h:
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::setRuntimeProperty):
+ (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled):
+ (WebKit::WebDevToolsAgentImpl::updateInspectorStateCookie):
+ * src/WebDevToolsAgentImpl.h:
+
+2010-09-19 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r67749.
+ http://trac.webkit.org/changeset/67749
+ https://bugs.webkit.org/show_bug.cgi?id=46068
+
+ breaking ToT chromium canary build (Requested by shans on
+ #webkit).
+
+ * public/WebFrameClient.h:
+ * public/WebScriptController.h:
+ * src/FrameLoaderClientImpl.cpp:
+ * src/FrameLoaderClientImpl.h:
+ * src/WebScriptController.cpp:
+ (WebKit::WebScriptController::registerExtension):
+
+2010-09-19 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [Chromium] Add is<input type>() functions to WebInputElement
+ https://bugs.webkit.org/show_bug.cgi?id=46035
+
+ We're going to stop exposing HTMLInputElemnt::InputType. So, add
+ isFoo() functions in order to remove WebInputElement::InputType.
+
+ * public/WebInputElement.h:
+ * src/WebInputElement.cpp:
+ (WebKit::WebInputElement::isTextField):
+ (WebKit::WebInputElement::isText):
+ (WebKit::WebInputElement::isPasswordField):
+ (WebKit::WebInputElement::isImageButton):
+
+2010-09-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ REGRESSION (r60104): Zoom level is unexpectedly reset on page reload
+ https://bugs.webkit.org/show_bug.cgi?id=42863
+
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::createPlugin):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::setZoomLevel):
+ Call functions on Frame instead of FrameView.
+
+2010-09-17 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ [chromium] Roll forward Chromium DEPS to pick up Mesa DRT changes
+ https://bugs.webkit.org/show_bug.cgi?id=46006
+
+ * DEPS:
+
+2010-09-17 Kenneth Russell <kbr@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] Add mesa as DumpRenderTree dependency
+ https://bugs.webkit.org/show_bug.cgi?id=46001
+
+ * WebKit.gyp:
+
+2010-09-13 Matt Perry <mpcomplete@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Have V8DOMWindowShell ask the embedder whether to run a V8 extension
+ in a particular script context.
+ https://bugs.webkit.org/show_bug.cgi?id=45721
+
+ * public/WebFrameClient.h:
+ (WebKit::WebFrameClient::allowScriptExtension):
+ * public/WebScriptController.h:
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::allowScriptExtension):
+ * src/FrameLoaderClientImpl.h:
+ * src/WebScriptController.cpp:
+ (WebKit::WebScriptController::registerExtension):
+
+2010-09-17 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by David Levin.
+
+ Remove unimplemented destructor declaration to fix Chromium build.
+ https://bugs.webkit.org/show_bug.cgi?id=45987
+
+ * src/AsyncFileWriterChromium.h:
+
+2010-09-16 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r67693.
+ http://trac.webkit.org/changeset/67693
+ https://bugs.webkit.org/show_bug.cgi?id=45946
+
+ "Need to pick up a chromium change first" (Requested by dumi
+ on #webkit).
+
+ * public/WebHTTPBody.h:
+ * src/WebHTTPBody.cpp:
+ (WebKit::WebHTTPBody::elementAt):
+ (WebKit::WebHTTPBody::appendFileRange):
+
+2010-09-15 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Remove WebHTTPBody::appendFileRange(..., const WebFileInfo&).
+
+ * public/WebHTTPBody.h:
+ * src/WebHTTPBody.cpp:
+ (WebKit::WebHTTPBody::elementAt):
+
+2010-09-16 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ Add entry points to GraphicsContext3D needed for Chromium compositor port
+ https://bugs.webkit.org/show_bug.cgi?id=45939
+
+ Added entry points for two Chromium-specific extensions, and added
+ a flag to the GraphicsContext3D constructor, currently unsupported
+ by all ports (including Chromium), indicating whether the context
+ should render directly to the passed HostWindow or off-screen per
+ the current semantics. The switch to use GraphicsContext3D in
+ Chromium's compositor will follow in a subsequent patch.
+
+ No new tests; functionality is unchanged. Built and tested
+ Chromium and WebKit on Mac OS X.
+
+ * src/GraphicsContext3D.cpp:
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+ (WebCore::GraphicsContext3D::create):
+ * src/GraphicsContext3DInternal.h:
+
+2010-09-16 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ [chromium] Add needed entry points to WebGraphicsContext3D for compositor
+ https://bugs.webkit.org/show_bug.cgi?id=45921
+
+ * public/WebGraphicsContext3D.h:
+ * src/WebGraphicsContext3DDefaultImpl.cpp:
+ (WebKit::WebGraphicsContext3DDefaultImpl::initialize):
+ (WebKit::WebGraphicsContext3DDefaultImpl::supportsMapSubCHROMIUM):
+ (WebKit::WebGraphicsContext3DDefaultImpl::mapBufferSubDataCHROMIUM):
+ (WebKit::WebGraphicsContext3DDefaultImpl::unmapBufferSubDataCHROMIUM):
+ (WebKit::WebGraphicsContext3DDefaultImpl::mapTexSubImage2DCHROMIUM):
+ (WebKit::WebGraphicsContext3DDefaultImpl::unmapTexSubImage2DCHROMIUM):
+ (WebKit::WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM):
+ (WebKit::WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM):
+ * src/WebGraphicsContext3DDefaultImpl.h:
+
+2010-09-15 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [Chromium] Needs DRT queueLoadHTMLString and setDeferMainResourceLoad-implementations
+ https://bugs.webkit.org/show_bug.cgi?id=42151
+
+ * public/WebDataSource.h:
+ * src/WebDataSourceImpl.cpp:
+ (WebKit::WebDataSourceImpl::applicationCacheHost):
+ (WebKit::WebDataSourceImpl::setDeferMainResourceDataLoad): Added so DRT can set this flag before a load.
+ * src/WebDataSourceImpl.h:
+
+2010-09-16 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ Roll forward Chromium DEPS to r59706
+ https://bugs.webkit.org/show_bug.cgi?id=45916
+
+ * DEPS:
+
+2010-09-16 Darin Adler <darin@apple.com>
+
+ Reviewed by Andreas Kling.
+
+ Reduce use of HTMLInputElement::inputType so we can remove it later
+ https://bugs.webkit.org/show_bug.cgi?id=45903
+
+ * src/DOMUtilitiesPrivate.cpp:
+ (WebKit::elementHasLegalLinkAttribute): Use isImageButton.
+ * src/WebPasswordFormUtils.cpp:
+ (WebKit::findPasswordFormFields): Use isPasswordField.
+ * src/WebSearchableFormData.cpp:
+ (WebCore::IsInDefaultState): Use isCheckbox and isRadioButton.
+ (WebCore::HasSuitableTextElement): Use isFileUpload and isPasswordField.
+
+2010-09-16 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ [chromium] Expose separate GraphicsContext3DInternal.h
+ https://bugs.webkit.org/show_bug.cgi?id=45914
+
+ * WebKit.gyp:
+ * src/GraphicsContext3D.cpp:
+ * src/GraphicsContext3DInternal.h: Added.
+
+2010-09-16 Kenneth Russell <kbr@google.com>
+
+ Reviewed by James Robinson.
+
+ [chromium] Add WebGraphicsContext3D accessor to WebView
+ https://bugs.webkit.org/show_bug.cgi?id=45913
+
+ * public/WebView.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::graphicsContext3D):
+ * src/WebViewImpl.h:
+
+2010-09-16 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: move resourceTracking flag under control of BackendSettings.
+
+ Four Inspector API methods about resourceTracking flag were removed.
+ Actual state of the flag is transfered as the response of setResourceTracking request.
+ Initial state of the flag on the frontend side is obtained from settings.backend.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45887
+
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::setRuntimeProperty):
+ (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled):
+
+2010-09-16 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: [REGRESSION] Scripts disappear from scripts panel after navigation
+ https://bugs.webkit.org/show_bug.cgi?id=45890
+
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::setRuntimeProperty): make sure debugger and profiler
+ are initialized when inspected page navigation leads to renderer process change.
+
+2010-09-16 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by Jian Li.
+
+ Unify FILE_SYSTEM and FILE_WRITER enables under the name FILE_SYSTEM.
+ https://bugs.webkit.org/show_bug.cgi?id=45798
+
+ * src/AsyncFileWriterChromium.h:
+ * src/AsyncFileWriterChromium.cpp:
+
+2010-09-16 Nat Duca <nduca@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] Make compositor obey finish flag
+ https://bugs.webkit.org/show_bug.cgi?id=45552
+
+ The compositor should obey the finish flag on doComposite. This
+ flag causes the compositor to finish rendering before returning,
+ which is needed when resizing the window to avoid flashes of green.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::composite):
+
+2010-09-15 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Allow the embedder to specify the base path for IndexedDB.
+ https://bugs.webkit.org/show_bug.cgi?id=45815
+
+ Need to add the extra .open() parameter to make this all work.
+
+ * public/WebIDBFactory.h:
+ (WebKit::WebIDBFactory::open):
+ * src/IDBFactoryBackendProxy.cpp:
+ (WebCore::IDBFactoryBackendProxy::open):
+ * src/IDBFactoryBackendProxy.h:
+ * src/WebIDBFactoryImpl.cpp:
+ (WebKit::WebIDBFactoryImpl::open):
+ * src/WebIDBFactoryImpl.h:
+
+2010-09-16 Jeremy Orlow <jorlow@chromium.org>
+
+ Speculative build fix.
+
+ * src/IDBIndexBackendProxy.cpp:
+
+2010-09-08 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Complete index support for IndexedDB
+ https://bugs.webkit.org/show_bug.cgi?id=45386
+
+ * public/WebIDBCursor.h:
+ (WebKit::WebIDBCursor::direction):
+ (WebKit::WebIDBCursor::key):
+ (WebKit::WebIDBCursor::value):
+ (WebKit::WebIDBCursor::update):
+ (WebKit::WebIDBCursor::continueFunction):
+ (WebKit::WebIDBCursor::remove):
+ * public/WebIDBIndex.h:
+ (WebKit::WebIDBIndex::storeName):
+ (WebKit::WebIDBIndex::openObjectCursor):
+ (WebKit::WebIDBIndex::openCursor):
+ (WebKit::WebIDBIndex::getObject):
+ (WebKit::WebIDBIndex::get):
+ * public/WebIDBKey.h:
+ * src/IDBCursorBackendProxy.cpp:
+ (WebCore::IDBCursorBackendProxy::value):
+ * src/IDBCursorBackendProxy.h:
+ * src/IDBIndexBackendProxy.cpp:
+ (WebCore::IDBIndexBackendProxy::storeName):
+ (WebCore::IDBIndexBackendProxy::openObjectCursor):
+ (WebCore::IDBIndexBackendProxy::openCursor):
+ (WebCore::IDBIndexBackendProxy::getObject):
+ (WebCore::IDBIndexBackendProxy::get):
+ * src/IDBIndexBackendProxy.h:
+ * src/WebIDBCursorImpl.cpp:
+ (WebKit::WebIDBCursorImpl::value):
+ * src/WebIDBCursorImpl.h:
+ * src/WebIDBIndexImpl.cpp:
+ (WebKit::WebIDBIndexImpl::storeName):
+ (WebKit::WebIDBIndexImpl::openCursor):
+ (WebKit::WebIDBIndexImpl::openObjectCursor):
+ (WebKit::WebIDBIndexImpl::getObject):
+ (WebKit::WebIDBIndexImpl::get):
+ * src/WebIDBIndexImpl.h:
+
+2010-09-15 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Overload WebHTTPBody::appendFileRange() to take a double modification time argument.
+ https://bugs.webkit.org/show_bug.cgi?id=45829
+
+ The plan is to change all callers of
+ WebHTTPBody::appendFileRange(..., const WebFileInfo&) to use the
+ new method, and then remove it.
+
+ * public/WebHTTPBody.h:
+ * src/WebHTTPBody.cpp:
+ (WebKit::WebHTTPBody::elementAt):
+ (WebKit::WebHTTPBody::appendFileRange):
+
+2010-09-14 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Provide network-based load timing.
+ Before this change, inspector used timers taken from
+ within WebCore notifications (that are by definition
+ synchronous and serialized). As a result, timing was
+ affected by the routines running on the main thread
+ (JavaScript and such).
+ https://bugs.webkit.org/show_bug.cgi?id=45664
+
+ * public/WebURLLoadTiming.h:
+ * public/WebURLLoaderClient.h:
+ (WebKit::WebURLLoaderClient::didFinishLoading):
+ * src/ResourceHandle.cpp:
+ (WebCore::ResourceHandleInternal::didFinishLoading):
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::didFinishLoading):
+ * src/WebURLLoadTiming.cpp:
+ (WebKit::WebURLLoadTiming::receiveHeadersStart):
+ (WebKit::WebURLLoadTiming::setReceiveHeadersStart):
+
+2010-09-15 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r67551.
+ http://trac.webkit.org/changeset/67551
+ https://bugs.webkit.org/show_bug.cgi?id=45816
+
+ "Plugin tests fail" (Requested by yurys on #webkit).
+
+ * public/WebURLLoaderClient.h:
+ (WebKit::WebURLLoaderClient::didFinishLoading):
+ * src/ResourceHandle.cpp:
+ (WebCore::ResourceHandleInternal::didFinishLoading):
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::didFinishLoading):
+
+2010-09-14 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Provide network-based load timing.
+ Before this change, inspector used timers taken from
+ within WebCore notifications (that are by definition
+ synchronous and serialized). As a result, timing was
+ affected by the routines running on the main thread
+ (JavaScript and such).
+ https://bugs.webkit.org/show_bug.cgi?id=45664
+
+ * public/WebURLLoadTiming.h:
+ * public/WebURLLoaderClient.h:
+ (WebKit::WebURLLoaderClient::didFinishLoading):
+ * src/ResourceHandle.cpp:
+ (WebCore::ResourceHandleInternal::didFinishLoading):
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::didFinishLoading):
+ * src/WebURLLoadTiming.cpp:
+ (WebKit::WebURLLoadTiming::receiveHeadersStart):
+ (WebKit::WebURLLoadTiming::setReceiveHeadersStart):
+
+2010-09-14 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r67503.
+ http://trac.webkit.org/changeset/67503
+ https://bugs.webkit.org/show_bug.cgi?id=45802
+
+ This patch broke GTK builds (Requested by jianli_ on #webkit).
+
+ * src/ResourceHandle.cpp:
+
+2010-09-14 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Links from "Profiles" don't lead to "Scripts"
+ https://bugs.webkit.org/show_bug.cgi?id=45756
+
+ * src/js/DevTools.js: remove obsolete code
+
+2010-09-14 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] fix http/tests/security/local-user-CSS-from-remote.html
+ https://bugs.webkit.org/show_bug.cgi?id=45788
+
+ * DEPS: Include webkit_support::LocalFileToDataURL
+
+2010-09-14 Tony Chang <tony@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ [chromium] Remove WebKit::areLayoutTestImagesOpaque since it's no longer needed
+ https://bugs.webkit.org/show_bug.cgi?id=45768
+
+ * public/WebKit.h:
+ * src/WebKit.cpp:
+
+2010-09-14 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ blob: URL scheme does not work with Chromium DRT
+ https://bugs.webkit.org/show_bug.cgi?id=45772
+
+ Roll Chromium forward to r59406, which registers the blob
+ URL scheme for the Chromium DRT too.
+
+ * DEPS:
+
+2010-09-14 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ fast/files/apply-blob-url-to-img.html timeout on Leopard
+ https://bugs.webkit.org/show_bug.cgi?id=45576
+
+ * src/ResourceHandle.cpp: Remove the no longer applicable static comment.
+
+2010-09-14 Chris Guillory <chris.guillory@google.com>
+
+ Reviewed by Chris Fleizach.
+
+ Send all accessibility notifications to Chromium.
+ https://bugs.webkit.org/show_bug.cgi?id=45156
+
+ Use postAccessibilityNotification to pass accessibility notifications
+ to chromium.
+
+ * WebKit.gyp:
+ * public/WebAccessibilityNotification.h: Added.
+ * public/WebViewClient.h:
+ (WebKit::WebViewClient::postAccessibilityNotification):
+ * src/AssertMatchingEnums.h: Added.
+ * src/ChromeClientImpl.cpp:
+ (WebKit::toWebAccessibilityNotification):
+ (WebKit::ChromeClientImpl::didChangeAccessibilityObjectChildren):
+ (WebKit::ChromeClientImpl::postAccessibilityNotification):
+ * src/ChromeClientImpl.h:
+
+2010-09-14 Tony Chang <tony@chromium.org>
+
+ Unreviewed, fix chromium win compile.
+
+ * public/WebView.h:
+
+2010-09-14 Tony Chang <tony@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] implement layoutTestController.setDomainRelaxationForbiddenForURLScheme
+ https://bugs.webkit.org/show_bug.cgi?id=45762
+
+ * public/WebView.h: add WebView::setDomainRelaxationForbidden
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::setDomainRelaxationForbidden):
+ * src/WebViewImpl.h:
+
+2010-09-14 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Andreas Kling.
+
+ Move DebuggerScript.js from WebKit/chromium/src/js to WebCore/bindings/v8
+ https://bugs.webkit.org/show_bug.cgi?id=45739
+
+ * WebKit.grd:
+ * WebKit.gypi:
+ * src/js/DebuggerScript.js: Removed.
+ * src/js/DevToolsHostStub.js: Removed.
+
+2010-09-14 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Make WebDeviceOrientationClientMock constructor private.
+ https://bugs.webkit.org/show_bug.cgi?id=45743
+
+ Clients should use the create member function instead. DumpRenderTree
+ and the Chromium test_shell have previously been updated to call create.
+
+ * public/WebDeviceOrientationClientMock.h:
+ (WebKit::WebDeviceOrientationClientMock::WebDeviceOrientationClientMock):
+
+2010-09-13 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add Chromium API for FileWriter
+ https://bugs.webkit.org/show_bug.cgi?id=44360
+
+ Build file changes.
+ * WebKit.gyp:
+
+ Added a way to get a WebFileWriter.
+ * public/WebFileSystem.h:
+ (WebKit::WebFileSystem::createFileWriter):
+
+ WebFileWriter writes and truncates files.
+ * public/WebFileWriter.h: Added.
+
+ WebFileWriterClient reports success/failure and progress events.
+ * public/WebFileWriterClient.h: Added.
+
+ AsyncFileWriterChromium is a connector that links FileWriter and WebFileWriter, FileWriterClient and WebFileWriterClient.
+ * src/AsyncFileWriterChromium.cpp: Added.
+ * src/AsyncFileWriterChromium.h: Added.
+
+2010-09-13 W. James MacLean <wjmaclean@google.com>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] Thumbnails not generated for GPU Rendered Pages
+ https://bugs.webkit.org/show_bug.cgi?id=44127
+
+ Modified WebViewImpl::paint() to detect non-null canvas pointers when
+ accelerated compositing is active, and instead fills the pixel buffer
+ from the GPU framebuffer. Includes re-scaling support when provided
+ canvas does not match size of current render layer. Limits pixel
+ readback to rect passed to paint(), clipped by size of rootLayerTexture.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::doPixelReadbackToCanvas):
+ (WebKit::WebViewImpl::paint):
+ * src/WebViewImpl.h:
+
+2010-09-13 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] Return NULL from getSharedGraphicsContext3D if we couldn't initialize
+ https://bugs.webkit.org/show_bug.cgi?id=45731
+
+ If we can't create a GraphicsContext3D, return NULL from getSharedGraphicsContext3D rather
+ than an object with NULL internal pointers. Callers know how to handle a null return value
+ but not one that has inconsistent internal state.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::getSharedGraphicsContext3D):
+
+2010-09-13 Chris Guillory <chris.guillory@google.com>
+
+ Reviewed by Chris Fleizach.
+
+ WebAccessibilityCacheImpl needs to handle invalid accessibility object ids.
+ https://bugs.webkit.org/show_bug.cgi?id=45572
+
+ * public/WebAccessibilityObject.h:
+ * src/WebAccessibilityCacheImpl.cpp:
+ (WebKit::WebAccessibilityCacheImpl::addOrGetId):
+ * src/WebAccessibilityObject.cpp:
+ (WebKit::WebAccessibilityObject::isAxObjectIdValid):
+
+2010-09-13 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [Chromium] fix broken dependency in ImageDiff
+ https://bugs.webkit.org/show_bug.cgi?id=45684
+
+ * WebKit.gyp:
+
+2010-09-13 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Paste should be implemented in WebCore like Copy and Cut for Mac also.
+ https://bugs.webkit.org/show_bug.cgi?id=45494
+ <rdar://problem/7660537>
+
+ On the Mac platform, the implementation of the paste operation is all done
+ at the WebKit level. In order to support it on WebKit2 it is necessary to
+ refactor the code and move this functionality at the level of WebCore like
+ we already have on Windows.
+ The original code relies on some in AppKit functions that call back into
+ WebKit causing problems in WebKit2. All this functionality has been moved
+ at the level of the editor client where it can be dealt with appropriately.
+
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::canShowMIMETypeAsHTML): Added stub.
+ * src/FrameLoaderClientImpl.h:
+
+2010-09-13 Jonathan Dixon <joth@chromium.org>
+
+ Reviewed by Steve Block.
+
+ [chromium] Port test shell geolocation fixes to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=45313
+
+ Ports over fixes from test shell:
+ - http://codereview.chromium.org/3294007
+ - http://codereview.chromium.org/333800
+
+ Resets state between service instances, which fixes delayed-permission-allowed-for-multiple-requests.html
+
+ Also re-apply rolled out patch http://trac.webkit.org/changeset/66886 :-
+ Access to out-of-scope WebGeolocationServiceBridgeImpl
+ https://bugs.webkit.org/show_bug.cgi?id=45112
+
+ Keep the WebGeolocationService pointer for lifetime of the bridge, to
+ ensure it can be detached reliably
+
+ Includes follow-up review comment to rename onWebGeolocationServiceDestroyed to didDestroyGeolocationService
+
+ * public/WebGeolocationService.h:
+ (WebKit::WebGeolocationService::~WebGeolocationService):
+ * public/WebGeolocationServiceBridge.h:
+ (WebKit::WebGeolocationServiceBridge::onWebGeolocationServiceDestroyed):
+ * public/WebGeolocationServiceMock.h:
+ * src/WebGeolocationServiceBridgeImpl.cpp:
+ (WebKit::WebGeolocationServiceBridgeImpl::WebGeolocationServiceBridgeImpl):
+ (WebKit::WebGeolocationServiceBridgeImpl::~WebGeolocationServiceBridgeImpl):
+ (WebKit::WebGeolocationServiceBridgeImpl::startUpdating):
+ (WebKit::WebGeolocationServiceBridgeImpl::stopUpdating):
+ (WebKit::WebGeolocationServiceBridgeImpl::suspend):
+ (WebKit::WebGeolocationServiceBridgeImpl::resume):
+ (WebKit::WebGeolocationServiceBridgeImpl::attachBridgeIfNeeded):
+ (WebKit::WebGeolocationServiceBridgeImpl::setIsAllowed):
+ (WebKit::WebGeolocationServiceBridgeImpl::setLastPosition):
+ (WebKit::WebGeolocationServiceBridgeImpl::setLastError):
+ (WebKit::WebGeolocationServiceBridgeImpl::didDestroyGeolocationService):
+ (WebKit::WebGeolocationServiceBridgeImpl::isAttached):
+ * src/WebGeolocationServiceMock.cpp:
+ (WebKit::WebGeolocationServiceMock::setMockGeolocationPermission):
+ (WebKit::WebGeolocationServiceMockImpl::WebGeolocationServiceMockImpl):
+ (WebKit::WebGeolocationServiceMockImpl::~WebGeolocationServiceMockImpl):
+ (WebKit::WebGeolocationServiceMockImpl::setMockGeolocationPermission):
+ (WebKit::WebGeolocationServiceMockImpl::requestPermissionForFrame):
+ (WebKit::WebGeolocationServiceMockImpl::notifyPendingPermissions):
+
+2010-09-13 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: upstream testExpandScope debugger test
+ https://bugs.webkit.org/show_bug.cgi?id=45260
+
+ * src/js/DebuggerScript.js: copy scope variables into a new object, but for global scope object,
+ with statement parameter and catch block exception variable pass the object itself to the injected
+ script.
+ * src/js/Tests.js: moved testExpandScope to LayoutTests
+
+2010-09-13 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Add WebDeviceOrientationClientMock::create() and use it from DRT.
+ https://bugs.webkit.org/show_bug.cgi?id=45650
+
+ Since the virtual member functions of WebDeviceOrientationClientMock
+ are not exported from the DLL, construction of the object must be done inside
+ the DLL, or else the linker will complain (because the vtable cannot
+ be set up). Clients should use the create() member function, and the constructor
+ will be made private in a subsequent patch.
+
+ * public/WebDeviceOrientationClientMock.h:
+ (WebKit::WebDeviceOrientationClientMock::WebDeviceOrientationClientMock):
+ * src/WebDeviceOrientationClientMock.cpp:
+ (WebKit::WebDeviceOrientationClientMock::create):
+
+2010-09-12 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ [DRT/Chromium] Remove dependency to base/string16.h and gfx/codec/png_codec.h
+ https://bugs.webkit.org/show_bug.cgi?id=45517
+
+ * DEPS: Roll Chromium revision to r59033 to have webkit_support_gfx.h.
+ * WebKit.gyp:
+
+2010-09-10 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Tony Chang.
+
+ [Chromium] Implement textInputController.hasSpellingMarker() for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45441
+
+ Exported Frame::selectionStartHasSpellingMarkerFor() for DRT use.
+
+ * public/WebFrame.h:
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::selectionStartHasSpellingMarkerFor):
+ * src/WebFrameImpl.h:
+
+2010-09-10 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Add NetworkingContext to avoid layer violations
+ https://bugs.webkit.org/show_bug.cgi?id=42292
+
+ * src/ResourceHandle.cpp:
+ (WebCore::ResourceHandle::create):
+ (WebCore::ResourceHandle::start):
+ (WebCore::ResourceHandle::loadResourceSynchronously):
+
+2010-09-10 Sam Weinig <sam@webkit.org>
+
+ Fix chromium build.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::setZoomLevel):
+
+2010-09-10 Ryosuke Niwa <rniwa@webkit.org>
+
+ Unreviewed, speculative chromium build fix.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::setZoomLevel):
+
+2010-09-10 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove unnecessary constraint in WebCore of choosing either text zoom or full page zoom.
+ Precursor to <rdar://problem/7660657>
+ https://bugs.webkit.org/show_bug.cgi?id=45522
+
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::createPlugin):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::setZoomLevel):
+ * src/WebViewImpl.h:
+ (WebKit::WebViewImpl::zoomTextOnly):
+ Move tracking of text only zoom here from WebCore.
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::committedLoad):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::commitDocumentData):
+
+2010-09-10 Tony Chang <tony@chromium.org>
+
+ Unreviewed, fix chromium compile after r67238.
+
+ shouldChangeSelection was removed from Frame.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::selectWordAroundPosition):
+
+2010-09-10 Nat Duca <nduca@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] Accelerated Compositing: screen garbage when scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=45092
+
+ Introduce a new API on WebWidget for painting with accelerated
+ compositing that allows the compositor to properly distingiush
+ scrolling, invalidation and repainting from one another. The key
+ change is that in accelerated rendering case, invalidates and
+ scrolling pass directly to the compositor, rather than passing up
+ to the client as was the case in the software path. For
+ accelerated rendering, the previous paint() method is replaced by
+ composite().
+
+ * public/WebWidget.h:
+ * public/WebWidgetClient.h:
+ (WebKit::WebWidgetClient::scheduleComposite):
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::invalidateContentsAndWindow):
+ (WebKit::ChromeClientImpl::scroll):
+ * src/WebPopupMenuImpl.cpp:
+ (WebKit::WebPopupMenuImpl::themeChanged):
+ (WebKit::WebPopupMenuImpl::composite):
+ * src/WebPopupMenuImpl.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::resize):
+ (WebKit::WebViewImpl::paint):
+ (WebKit::WebViewImpl::themeChanged):
+ (WebKit::WebViewImpl::composite):
+ (WebKit::WebViewImpl::setRootGraphicsLayer):
+ (WebKit::WebViewImpl::setRootLayerNeedsDisplay):
+ (WebKit::WebViewImpl::scrollRootLayerRect):
+ (WebKit::WebViewImpl::invalidateRootLayerRect):
+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+ (WebKit::WebViewImpl::updateRootLayerContents):
+ (WebKit::WebViewImpl::doComposite):
+ * src/WebViewImpl.h:
+ * tests/PopupMenuTest.cpp:
+ (WebKit::TestWebWidget::themeChanged):
+ (WebKit::TestWebWidget::composite):
+
+2010-09-10 David Holloway <dhollowa@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Change WebKit::WebFormElement::wasUserSubmitted to use WebCore::HTMLFormElement::submittedByUserGesture
+ instead of WebCore::HTMLFormElement::submissionTrigger.
+ Chromium AutoFill feature semantics changed with respect to what we mean by "user submitted" form. A
+ more accurate measure of the user manually submitting a form is via user gesture.
+ https://bugs.webkit.org/show_bug.cgi?id=45128
+
+ * src/WebFormElement.cpp:
+ (WebKit::WebFormElement::wasUserSubmitted):
+
+2010-09-09 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Move functions from Frame to SelectionController as planned
+ https://bugs.webkit.org/show_bug.cgi?id=45508
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::selectionBoundsRect):
+ Call functions on selection().
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Chromium build fix (one hopes!)
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::commitDocumentData):
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Main resource bytes shouldn't bounce through FrameLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45496
+
+ Now return the bytes to the DocumentLoader.
+
+ Also, removed comment about wrong code in the Mac port.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::commitDocumentData):
+
2010-09-08 Darin Adler <darin@apple.com>
Reviewed by Adam Barth.
@@ -53,13 +1011,22 @@
* src/WebKit.cpp:
(WebKit::areLayoutTestImagesOpaque): Make linux match windows.
+2010-09-10 Jay Civelli <jcivelli@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add the destructor to WebDOMEvent to prevent a leak.
+ https://bugs.webkit.org/show_bug.cgi?id=45287
+
+ * public/WebDOMEvent.h:
+ (WebKit::WebDOMEvent::~WebDOMEvent):
+
2010-09-09 Chris Guillory <chris.guillory@google.com>
Reviewed by Chris Fleizach.
Add methods used to determine accessibility state.
https://bugs.webkit.org/show_bug.cgi?id=45434
-
* public/WebAccessibilityObject.h:
* src/WebAccessibilityObject.cpp:
diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS
index 2fc218b..17cf7b5 100644
--- a/WebKit/chromium/DEPS
+++ b/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
vars = {
'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
- 'chromium_rev': '58277',
+ 'chromium_rev': '59961',
}
deps = {
diff --git a/WebKit/chromium/WebKit.grd b/WebKit/chromium/WebKit.grd
index 92ee008..3b7209a 100644
--- a/WebKit/chromium/WebKit.grd
+++ b/WebKit/chromium/WebKit.grd
@@ -9,7 +9,7 @@
</outputs>
<release seq="1">
<includes>
- <include name="IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS" file="src\js\DebuggerScript.js" type="BINDATA"/>
+ <include name="IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS" file="..\..\WebCore\bindings\v8\DebuggerScript.js" type="BINDATA"/>
<include name="IDR_DEVTOOLS_INJECT_WEBKIT_JS" file="..\..\WebCore\inspector\front-end\InjectedScript.js" type="BINDATA"/>
</includes>
</release>
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index 11246fa..3523f21 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -98,6 +98,7 @@
'public/mac/WebSandboxSupport.h',
'public/mac/WebScreenInfoFactory.h',
'public/WebAccessibilityCache.h',
+ 'public/WebAccessibilityNotification.h',
'public/WebAccessibilityObject.h',
'public/WebAccessibilityRole.h',
'public/WebAnimationController.h',
@@ -153,6 +154,8 @@
'public/WebFileSystemCallbacks.h',
'public/WebFileSystemEntry.h',
'public/WebFileUtilities.h',
+ 'public/WebFileWriter.h',
+ 'public/WebFileWriterClient.h',
'public/WebFindOptions.h',
'public/WebFloatPoint.h',
'public/WebFloatRect.h',
@@ -280,6 +283,8 @@
'src/AssertMatchingEnums.cpp',
'src/AsyncFileSystemChromium.cpp',
'src/AsyncFileSystemChromium.h',
+ 'src/AsyncFileWriterChromium.cpp',
+ 'src/AsyncFileWriterChromium.h',
'src/AutoFillPopupMenuClient.cpp',
'src/AutoFillPopupMenuClient.h',
'src/BackForwardListClientImpl.cpp',
@@ -322,6 +327,7 @@
'src/GLES2ContextInternal.cpp',
'src/GLES2ContextInternal.h',
'src/GraphicsContext3D.cpp',
+ 'src/GraphicsContext3DInternal.h',
'src/gtk/WebFontInfo.cpp',
'src/gtk/WebFontInfo.h',
'src/gtk/WebInputEventFactory.cpp',
@@ -781,7 +787,8 @@
'dependencies': [
'webkit',
'../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
- '<(chromium_src_dir)/gfx/gfx.gyp:gfx',
+ '<(chromium_src_dir)/webkit/support/webkit_support.gyp:blob',
+ '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
],
'include_dirs': [
'../../JavaScriptCore',
@@ -801,6 +808,7 @@
'webkit',
'../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf_config',
'<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc',
+ '<(chromium_src_dir)/third_party/mesa/mesa.gyp:osmesa',
'<(chromium_src_dir)/webkit/support/webkit_support.gyp:blob',
'<(chromium_src_dir)/webkit/support/webkit_support.gyp:copy_npapi_layout_test_plugin',
'<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
diff --git a/WebKit/chromium/WebKit.gypi b/WebKit/chromium/WebKit.gypi
index 4c6ac37..035015b 100644
--- a/WebKit/chromium/WebKit.gypi
+++ b/WebKit/chromium/WebKit.gypi
@@ -34,7 +34,6 @@
# for copying them to resource dir, and for generating 'devtools.html' file.
'devtools_js_files': [
'src/js/DevTools.js',
- 'src/js/DevToolsHostStub.js',
'src/js/Tests.js',
],
'devtools_css_files': [
diff --git a/WebKit/chromium/public/WebAccessibilityNotification.h b/WebKit/chromium/public/WebAccessibilityNotification.h
new file mode 100644
index 0000000..c4a9551
--- /dev/null
+++ b/WebKit/chromium/public/WebAccessibilityNotification.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebAccessibilityNotification_h
+#define WebAccessibilityNotification_h
+
+namespace WebKit {
+
+enum WebAccessibilityNotification {
+ WebAccessibilityNotificationActiveDescendantChanged,
+ WebAccessibilityNotificationCheckedStateChanged,
+ WebAccessibilityNotificationChildrenChanged,
+ WebAccessibilityNotificationFocusedUIElementChanged,
+ WebAccessibilityNotificationLayoutComplete,
+ WebAccessibilityNotificationLoadComplete,
+ WebAccessibilityNotificationSelectedChildrenChanged,
+ WebAccessibilityNotificationSelectedTextChanged,
+ WebAccessibilityNotificationValueChanged,
+ WebAccessibilityNotificationScrolledToAnchor,
+ WebAccessibilityNotificationLiveRegionChanged,
+ WebAccessibilityNotificationMenuListValueChanged,
+ WebAccessibilityNotificationRowCountChanged,
+ WebAccessibilityNotificationRowCollapsed,
+ WebAccessibilityNotificationRowExpanded,
+ WebAccessibilityNotificationInvalid
+};
+
+} // namespace WebKit
+
+#endif // WebAccessibilityNotification_h
diff --git a/WebKit/chromium/public/WebAccessibilityObject.h b/WebKit/chromium/public/WebAccessibilityObject.h
index 6b55376..f7c93f2 100644
--- a/WebKit/chromium/public/WebAccessibilityObject.h
+++ b/WebKit/chromium/public/WebAccessibilityObject.h
@@ -70,6 +70,7 @@ public:
WEBKIT_API WebString actionVerb() const;
WEBKIT_API bool canSetFocusAttribute() const;
WEBKIT_API bool canSetValueAttribute() const;
+ WEBKIT_API bool isValid() const;
WEBKIT_API unsigned childCount() const;
diff --git a/WebKit/chromium/public/WebDOMEvent.h b/WebKit/chromium/public/WebDOMEvent.h
index d34c8d4..fa02b0c 100644
--- a/WebKit/chromium/public/WebDOMEvent.h
+++ b/WebKit/chromium/public/WebDOMEvent.h
@@ -50,6 +50,8 @@ public:
BubblingPhase = 3
};
+ ~WebDOMEvent() { reset(); }
+
WebDOMEvent() : m_private(0) { }
WebDOMEvent(const WebDOMEvent& e) : m_private(0) { assign(e); }
WebDOMEvent& operator=(const WebDOMEvent& e)
diff --git a/WebKit/chromium/public/WebDataSource.h b/WebKit/chromium/public/WebDataSource.h
index 1aa7a98..1a8c270 100644
--- a/WebKit/chromium/public/WebDataSource.h
+++ b/WebKit/chromium/public/WebDataSource.h
@@ -95,6 +95,10 @@ public:
// The application cache host associated with this datasource.
virtual WebApplicationCacheHost* applicationCacheHost() = 0;
+ // Set deferMainResourceDataLoad flag on the loader. This is used for
+ // testing.
+ virtual void setDeferMainResourceDataLoad(bool) = 0;
+
protected:
~WebDataSource() { }
};
diff --git a/WebKit/chromium/public/WebDeviceOrientationClientMock.h b/WebKit/chromium/public/WebDeviceOrientationClientMock.h
index 9cbccf7..7fae792 100644
--- a/WebKit/chromium/public/WebDeviceOrientationClientMock.h
+++ b/WebKit/chromium/public/WebDeviceOrientationClientMock.h
@@ -36,7 +36,7 @@ namespace WebKit {
class WebDeviceOrientationClientMock : public WebDeviceOrientationClient {
public:
- WebDeviceOrientationClientMock() { initialize(); }
+ WEBKIT_API static WebDeviceOrientationClientMock* create();
~WebDeviceOrientationClientMock() { reset(); }
virtual void setController(WebDeviceOrientationController*);
@@ -47,6 +47,7 @@ public:
WEBKIT_API void setOrientation(WebDeviceOrientation&);
private:
+ WebDeviceOrientationClientMock() { initialize(); }
WEBKIT_API void initialize();
WEBKIT_API void reset();
diff --git a/WebKit/chromium/public/WebFileSystem.h b/WebKit/chromium/public/WebFileSystem.h
index 641c169..b21235d 100644
--- a/WebKit/chromium/public/WebFileSystem.h
+++ b/WebKit/chromium/public/WebFileSystem.h
@@ -37,6 +37,8 @@
namespace WebKit {
class WebFileSystemCallbacks;
+class WebFileWriter;
+class WebFileWriterClient;
class WebFileSystem {
public:
@@ -100,6 +102,10 @@ public:
// WebFileSystemCallbacks::didFail() must be called otherwise.
virtual void readDirectory(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+ // Creates a WebFileWriter that can be used to write to the given file.
+ // This is a fast, synchronous call, and should not stat the filesystem.
+ virtual WebFileWriter* createFileWriter(const WebString& path, WebFileWriterClient*) { WEBKIT_ASSERT_NOT_REACHED(); return 0; }
+
protected:
virtual ~WebFileSystem() { }
};
diff --git a/WebKit/chromium/public/WebFileWriter.h b/WebKit/chromium/public/WebFileWriter.h
new file mode 100644
index 0000000..9cde098
--- /dev/null
+++ b/WebKit/chromium/public/WebFileWriter.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFileWriter_h
+#define WebFileWriter_h
+
+#include "WebCommon.h"
+#include "WebString.h"
+
+namespace WebKit {
+
+class WebURL;
+
+class WebFileWriter {
+public:
+ virtual ~WebFileWriter() { }
+
+ // Only one write or one truncate operation can be in progress at a time.
+ // These functions are asynchronous and will report results through the WebFileWriter's associated WebFileWriterClient.
+ virtual void write(long long position, const WebURL& blobURL) = 0;
+ virtual void truncate(long long length) = 0;
+
+ // Cancel will attempt to abort a running write or truncate. However, it may not be possible to cancel an in-progress action, or the call may have come in too late. Partial writes are possible.
+ // Do not call cancel when there is no write or truncate in progress.
+ virtual void cancel() = 0;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFileWriterClient.h b/WebKit/chromium/public/WebFileWriterClient.h
new file mode 100644
index 0000000..d371582
--- /dev/null
+++ b/WebKit/chromium/public/WebFileWriterClient.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFileWriterClient_h
+#define WebFileWriterClient_h
+
+#include "WebCommon.h"
+#include "WebFileError.h"
+
+namespace WebKit {
+
+class WebFileWriterClient {
+public:
+ // Called for each chunk of a write, to indicate progress.
+ // On the final chunk, when the write is finished, complete will be true.
+ virtual void didWrite(long long bytes, bool complete) = 0;
+
+ // Called once when the truncate completes successfully.
+ virtual void didTruncate(long long length) = 0;
+
+ // Called if the write or truncate fails, or if it is cancelled before the write or truncate completes. Completion of an operation will be signalled exactly once, either by didFail, didTruncate, or didWrite(..., true).
+ virtual void didFail(WebFileError) = 0;
+
+protected:
+ virtual ~WebFileWriterClient() { }
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h
index d8eca6a..6725f58 100644
--- a/WebKit/chromium/public/WebFrame.h
+++ b/WebKit/chromium/public/WebFrame.h
@@ -533,6 +533,9 @@ public:
// empty ((0,0), (0,0)).
virtual WebRect selectionBoundsRect() const = 0;
+ // Only for testing purpose:
+ // Returns true if selection.anchorNode has a marker on range from |from| with |length|.
+ virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const = 0;
protected:
~WebFrame() { }
};
diff --git a/WebKit/chromium/public/WebGeolocationService.h b/WebKit/chromium/public/WebGeolocationService.h
index ed8c4e8..ea91b58 100644
--- a/WebKit/chromium/public/WebGeolocationService.h
+++ b/WebKit/chromium/public/WebGeolocationService.h
@@ -31,10 +31,9 @@
#ifndef WebGeolocationService_h
#define WebGeolocationService_h
-#include "WebGeolocationServiceBridge.h"
-
namespace WebKit {
+class WebGeolocationServiceBridge;
class WebString;
class WebURL;
@@ -50,10 +49,14 @@ public:
// Attaches the WebGeolocationServiceBridge to the embedder and returns its
// id, which should be used on subsequent calls for the methods above.
+ // An ID of zero indicates the attach failed.
virtual int attachBridge(WebGeolocationServiceBridge*) { return 0; }
// Detaches the WebGeolocationServiceBridge from the embedder.
virtual void detachBridge(int bridgeId) { }
+
+protected:
+ virtual ~WebGeolocationService() {}
};
} // namespace WebKit
diff --git a/WebKit/chromium/public/WebGeolocationServiceBridge.h b/WebKit/chromium/public/WebGeolocationServiceBridge.h
index 422b32b..d209c23 100644
--- a/WebKit/chromium/public/WebGeolocationServiceBridge.h
+++ b/WebKit/chromium/public/WebGeolocationServiceBridge.h
@@ -47,7 +47,11 @@ public:
virtual void setIsAllowed(bool allowed) = 0;
virtual void setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp) = 0;
virtual void setLastError(int errorCode, const WebString& message) = 0;
- virtual void onWebGeolocationServiceDestroyed() = 0;
+ // Called when the WebGeolocationService to which this bridge is attached is going out of scope. On receiving
+ // this call the bridge implementation must not make any further access to the service.
+ virtual void didDestroyGeolocationService() = 0;
+ // FIXME: Remove this badly named method when all callers are using didDestroyGeolocationService directly.
+ void onWebGeolocationServiceDestroyed() { didDestroyGeolocationService(); }
protected:
virtual ~WebGeolocationServiceBridge() {}
diff --git a/WebKit/chromium/public/WebGeolocationServiceMock.h b/WebKit/chromium/public/WebGeolocationServiceMock.h
index 407fe9d..820975e 100644
--- a/WebKit/chromium/public/WebGeolocationServiceMock.h
+++ b/WebKit/chromium/public/WebGeolocationServiceMock.h
@@ -44,9 +44,6 @@ public:
WEBKIT_API static void setMockGeolocationPermission(bool allowed);
WEBKIT_API static void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
WEBKIT_API static void setMockGeolocationError(int errorCode, const WebString& message);
-
-protected:
- static bool s_mockGeolocationPermission;
};
} // namespace WebKit
diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h
index 44a0498..9857174 100644
--- a/WebKit/chromium/public/WebGraphicsContext3D.h
+++ b/WebKit/chromium/public/WebGraphicsContext3D.h
@@ -83,6 +83,11 @@ public:
// Initializes the graphics context; should be the first operation performed
// on newly-constructed instances. Returns true on success.
+ virtual bool initialize(Attributes, WebView*, bool renderDirectlyToWebView) = 0;
+
+ // Initializes the graphics context; should be the first operation performed
+ // on newly-constructed instances. Returns true on success.
+ // FIXME: remove this entry point once the compositor is switched to use GraphicsContext3D.
virtual bool initialize(Attributes, WebView*) = 0;
// Makes the OpenGL context current on the current thread. Returns true on
@@ -134,8 +139,20 @@ public:
// getError in the order they were added.
virtual void synthesizeGLError(unsigned long error) = 0;
+ // EXT_texture_format_BGRA8888
virtual bool supportsBGRA() = 0;
+ // GL_CHROMIUM_map_sub
+ virtual bool supportsMapSubCHROMIUM() = 0;
+ virtual void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access) = 0;
+ virtual void unmapBufferSubDataCHROMIUM(const void*) = 0;
+ virtual void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access) = 0;
+ virtual void unmapTexSubImage2DCHROMIUM(const void*) = 0;
+
+ // GL_CHROMIUM_copy_texture_to_parent_texture
+ virtual bool supportsCopyTextureToParentTextureCHROMIUM() = 0;
+ virtual void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture) = 0;
+
// The entry points below map directly to the OpenGL ES 2.0 API.
// See: http://www.khronos.org/registry/gles/
// and: http://www.khronos.org/opengles/sdk/docs/man/
diff --git a/WebKit/chromium/public/WebHTTPBody.h b/WebKit/chromium/public/WebHTTPBody.h
index a2bb5cd..6e45bf6 100644
--- a/WebKit/chromium/public/WebHTTPBody.h
+++ b/WebKit/chromium/public/WebHTTPBody.h
@@ -54,7 +54,9 @@ public:
WebString filePath;
long long fileStart;
long long fileLength; // -1 means to the end of the file.
+ // FIXME: remove this field once all users of Element have been switched to use 'modificationTime'.
WebFileInfo fileInfo;
+ double modificationTime;
WebURL blobURL;
};
@@ -85,6 +87,8 @@ public:
WEBKIT_API void appendData(const WebData&);
WEBKIT_API void appendFile(const WebString&);
// Passing -1 to fileLength means to the end of the file.
+ WEBKIT_API void appendFileRange(const WebString&, long long fileStart, long long fileLength, double modificationTime);
+ // FIXME: Remove this method once all callers have been switched to use the method above.
WEBKIT_API void appendFileRange(const WebString&, long long fileStart, long long fileLength, const WebFileInfo&);
WEBKIT_API void appendBlob(const WebURL&);
diff --git a/WebKit/chromium/public/WebIDBCursor.h b/WebKit/chromium/public/WebIDBCursor.h
index 27eb924..f47a44c 100644
--- a/WebKit/chromium/public/WebIDBCursor.h
+++ b/WebKit/chromium/public/WebIDBCursor.h
@@ -44,33 +44,30 @@ public:
WEBKIT_ASSERT_NOT_REACHED();
return 0;
}
-
virtual WebIDBKey key() const
{
WEBKIT_ASSERT_NOT_REACHED();
- return WebIDBKey("");
+ return WebIDBKey::createInvalid();
}
-
+ // FIXME: Remove the legacy version of value() (the first version) as soon as a WebKit roll happens.
virtual WebSerializedScriptValue value() const
{
- WEBKIT_ASSERT_NOT_REACHED();
- return WebSerializedScriptValue();
- }
-
- virtual void update(const WebSerializedScriptValue&, WebIDBCallbacks*)
- {
- WEBKIT_ASSERT_NOT_REACHED();
+ WebSerializedScriptValue serializedScriptValue;
+ WebIDBKey idbKey;
+ value(serializedScriptValue, idbKey);
+ WEBKIT_ASSERT(!serializedScriptValue.isNull());
+ WEBKIT_ASSERT(idbKey.type() == WebIDBKey::InvalidType);
+ return serializedScriptValue;
}
-
- virtual void continueFunction(const WebIDBKey&, WebIDBCallbacks*)
+ // One or the other will set, depending on what type of cursor this is.
+ virtual void value(WebSerializedScriptValue& serializedScriptValue, WebIDBKey& idbKey) const
{
- WEBKIT_ASSERT_NOT_REACHED();
+ serializedScriptValue = value();
}
- virtual void remove(WebIDBCallbacks*)
- {
- WEBKIT_ASSERT_NOT_REACHED();
- }
+ virtual void update(const WebSerializedScriptValue&, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+ virtual void continueFunction(const WebIDBKey&, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+ virtual void remove(WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
};
} // namespace WebKit
diff --git a/WebKit/chromium/public/WebIDBFactory.h b/WebKit/chromium/public/WebIDBFactory.h
index 7c070a2..ab05b06 100755
--- a/WebKit/chromium/public/WebIDBFactory.h
+++ b/WebKit/chromium/public/WebIDBFactory.h
@@ -52,16 +52,14 @@ public:
virtual ~WebIDBFactory() { }
// The WebKit implementation of open ignores the WebFrame* parameter.
- virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame)
+ virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, const WebString& dataDir)
{
- int exceptionCode;
- open(name, description, callbacks, origin, webFrame, exceptionCode);
+ open(name, description, callbacks, origin, webFrame);
}
// FIXME: Delete soon. Compatability hack.
- virtual void open(const WebString& name, const WebString& description,
- WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, int& exceptionCode)
+ virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame)
{
- open(name, description, callbacks, origin, webFrame);
+ open(name, description, callbacks, origin, webFrame, "/tmp/temporary-indexed-db-files");
}
virtual void abortPendingTransactions(const WebVector<int>& pendingIDs) { WEBKIT_ASSERT_NOT_REACHED(); }
diff --git a/WebKit/chromium/public/WebIDBIndex.h b/WebKit/chromium/public/WebIDBIndex.h
index dafea0e..e03fc58 100644
--- a/WebKit/chromium/public/WebIDBIndex.h
+++ b/WebKit/chromium/public/WebIDBIndex.h
@@ -30,6 +30,10 @@
namespace WebKit {
+class WebIDBCallbacks;
+class WebIDBKey;
+class WebIDBKeyRange;
+
// See comment in WebIndexedDatabase for a high level overview of these classes.
class WebIDBIndex {
public:
@@ -40,6 +44,11 @@ public:
WEBKIT_ASSERT_NOT_REACHED();
return WebString();
}
+ virtual WebString storeName() const
+ {
+ WEBKIT_ASSERT_NOT_REACHED();
+ return WebString();
+ }
virtual WebString keyPath() const
{
WEBKIT_ASSERT_NOT_REACHED();
@@ -50,6 +59,11 @@ public:
WEBKIT_ASSERT_NOT_REACHED();
return false;
}
+
+ virtual void openObjectCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+ virtual void openCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+ virtual void getObject(const WebIDBKey&, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+ virtual void get(const WebIDBKey&, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
};
} // namespace WebKit
diff --git a/WebKit/chromium/public/WebIDBKey.h b/WebKit/chromium/public/WebIDBKey.h
index 6aef332..60d3325 100644
--- a/WebKit/chromium/public/WebIDBKey.h
+++ b/WebKit/chromium/public/WebIDBKey.h
@@ -42,7 +42,7 @@ public:
// Please use one of the factory methods. This is public only to allow WebVector.
WebIDBKey() { }
~WebIDBKey() { reset(); }
-
+
WEBKIT_API static WebIDBKey createNull();
WEBKIT_API static WebIDBKey createInvalid();
WEBKIT_API static WebIDBKey createFromValueAndKeyPath(const WebSerializedScriptValue&, const WebIDBKeyPath&);
diff --git a/WebKit/chromium/public/WebInputElement.h b/WebKit/chromium/public/WebInputElement.h
index ef3b577..3ef92de 100644
--- a/WebKit/chromium/public/WebInputElement.h
+++ b/WebKit/chromium/public/WebInputElement.h
@@ -79,9 +79,17 @@ namespace WebKit {
Week
};
+ // This returns true for all of textfield-looking types such as text,
+ // password, search, email, url, and number.
+ WEBKIT_API bool isTextField() const;
+ // This returns true only for type=text.
+ WEBKIT_API bool isText() const;
+ WEBKIT_API bool isPasswordField() const;
+ WEBKIT_API bool isImageButton() const;
WEBKIT_API bool autoComplete() const;
WEBKIT_API bool isReadOnly() const;
WEBKIT_API bool isEnabledFormControl() const;
+ // Deperated.
WEBKIT_API InputType inputType() const;
WEBKIT_API int maxLength() const;
WEBKIT_API bool isActivatedSubmit() const;
diff --git a/WebKit/chromium/public/WebKit.h b/WebKit/chromium/public/WebKit.h
index 5550db1..732cac6 100644
--- a/WebKit/chromium/public/WebKit.h
+++ b/WebKit/chromium/public/WebKit.h
@@ -55,11 +55,6 @@ WEBKIT_API WebKitClient* webKitClient();
WEBKIT_API void setLayoutTestMode(bool);
WEBKIT_API bool layoutTestMode();
-// This is a temporary flag while we try to get Linux to match Windows'
-// checksum computation. It specifies whether or not the baseline images
-// should be opaque or not.
-WEBKIT_API bool areLayoutTestImagesOpaque();
-
// Enables the named log channel. See WebCore/platform/Logging.h for details.
WEBKIT_API void enableLogChannel(const char*);
diff --git a/WebKit/chromium/public/WebURLLoaderClient.h b/WebKit/chromium/public/WebURLLoaderClient.h
index c716e5d..7614ea3 100644
--- a/WebKit/chromium/public/WebURLLoaderClient.h
+++ b/WebKit/chromium/public/WebURLLoaderClient.h
@@ -64,7 +64,10 @@ public:
virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) { }
// Called when the load completes successfully.
- virtual void didFinishLoading(WebURLLoader*) { }
+ virtual void didFinishLoading(WebURLLoader*, double finishTime) { }
+
+ // FIXME: remove this once clients are updated.
+ virtual void didFinishLoading(WebURLLoader* loader) { didFinishLoading(loader, 0); }
// Called when the load completes with an error.
virtual void didFail(WebURLLoader*, const WebURLError&) { }
diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h
index 1b94da2..d162f26 100644
--- a/WebKit/chromium/public/WebView.h
+++ b/WebKit/chromium/public/WebView.h
@@ -45,6 +45,7 @@ class WebDragData;
class WebFrame;
class WebFrameClient;
class WebGLES2Context;
+class WebGraphicsContext3D;
class WebNode;
class WebSettings;
class WebString;
@@ -109,6 +110,9 @@ public:
virtual bool isActive() const = 0;
virtual void setIsActive(bool) = 0;
+ // Allows disabling domain relaxation.
+ virtual void setDomainRelaxationForbidden(bool, const WebString& scheme) = 0;
+
// Closing -------------------------------------------------------------
@@ -339,8 +343,17 @@ public:
// Returns the GLES2Context associated with this WebView. One will be
// created if it doesn't already exist.
+ // FIXME: remove this method once the compositor is fully switched
+ // over to GraphicsContext3D.
virtual WebGLES2Context* gles2Context() = 0;
+ // Returns the (on-screen) WebGraphicsContext3D associated with
+ // this WebView. One will be created if it doesn't already exist.
+ // This is used to set up sharing between this context (which is
+ // that used by the compositor) and contexts for WebGL and other
+ // APIs.
+ virtual WebGraphicsContext3D* graphicsContext3D() = 0;
+
protected:
~WebView() {}
};
diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h
index 5c9a79b..f686419 100644
--- a/WebKit/chromium/public/WebViewClient.h
+++ b/WebKit/chromium/public/WebViewClient.h
@@ -31,6 +31,7 @@
#ifndef WebViewClient_h
#define WebViewClient_h
+#include "WebAccessibilityNotification.h"
#include "WebDragOperation.h"
#include "WebEditingAction.h"
#include "WebFileChooserCompletion.h"
@@ -280,6 +281,9 @@ public:
// Notifies embedder that the children of an accessibility object has changed.
virtual void didChangeAccessibilityObjectChildren(const WebAccessibilityObject&) { }
+
+ // Notifies embedder about an accessibility notification.
+ virtual void postAccessibilityNotification(const WebAccessibilityObject&, WebAccessibilityNotification) { }
// Developer tools -----------------------------------------------------
diff --git a/WebKit/chromium/public/WebWidget.h b/WebKit/chromium/public/WebWidget.h
index 5c9f54e..d010270 100644
--- a/WebKit/chromium/public/WebWidget.h
+++ b/WebKit/chromium/public/WebWidget.h
@@ -60,13 +60,26 @@ public:
// and it may result in calls to WebWidgetClient::didInvalidateRect.
virtual void layout() = 0;
- // Called to paint the specified region of the WebWidget onto the given
- // canvas. You MUST call Layout before calling this method. It is
- // okay to call paint multiple times once layout has been called,
- // assuming no other changes are made to the WebWidget (e.g., once
- // events are processed, it should be assumed that another call to
- // layout is warranted before painting again).
- virtual void paint(WebCanvas*, const WebRect&) = 0;
+ // Called to paint the rectangular region within the WebWidget
+ // onto the specified canvas at (viewPort.x,viewPort.y). You MUST call
+ // Layout before calling this method. It is okay to call paint
+ // multiple times once layout has been called, assuming no other
+ // changes are made to the WebWidget (e.g., once events are
+ // processed, it should be assumed that another call to layout is
+ // warranted before painting again).
+ virtual void paint(WebCanvas*, const WebRect& viewPort) = 0;
+
+ // Triggers compositing of the current layers onto the screen.
+ // The finish argument controls whether the compositor will wait for the
+ // GPU to finish rendering before returning. You MUST call Layout
+ // before calling this method, for the same reasons described in
+ // the paint method above.
+ virtual void composite(bool finish) = 0;
+
+ // Called to inform the WebWidget of a change in theme.
+ // Implementors that cache rendered copies of widgets need to re-render
+ // on receiving this message
+ virtual void themeChanged() = 0;
// Called to inform the WebWidget of an input event. Returns true if
// the event has been processed, false otherwise.
diff --git a/WebKit/chromium/public/WebWidgetClient.h b/WebKit/chromium/public/WebWidgetClient.h
index bd7bd6a..9bd553f 100644
--- a/WebKit/chromium/public/WebWidgetClient.h
+++ b/WebKit/chromium/public/WebWidgetClient.h
@@ -50,6 +50,9 @@ public:
// scrolled by the specified dx and dy amounts.
virtual void didScrollRect(int dx, int dy, const WebRect& clipRect) { }
+ // Called when a call to WebWidget::composite is required
+ virtual void scheduleComposite() { }
+
// Called when the widget acquires or loses focus, respectively.
virtual void didFocus() { }
virtual void didBlur() { }
diff --git a/WebKit/chromium/src/AsyncFileWriterChromium.cpp b/WebKit/chromium/src/AsyncFileWriterChromium.cpp
new file mode 100644
index 0000000..4bfc988
--- /dev/null
+++ b/WebKit/chromium/src/AsyncFileWriterChromium.cpp
@@ -0,0 +1,92 @@
+/*
+ * 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 "AsyncFileWriterChromium.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "Blob.h"
+#include "FileWriterClient.h"
+#include "WebFileWriter.h"
+#include "WebURL.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+AsyncFileWriterChromium::AsyncFileWriterChromium(FileWriterClient* client)
+ : m_client(client)
+{
+}
+
+void AsyncFileWriterChromium::setWebFileWriter(WebFileWriter* writer)
+{
+ ASSERT(!m_writer);
+ m_writer = writer;
+}
+
+void AsyncFileWriterChromium::write(long long position, Blob* data)
+{
+ ASSERT(m_writer);
+ m_writer->write(position, WebURL(data->url()));
+}
+
+void AsyncFileWriterChromium::truncate(long long length)
+{
+ ASSERT(m_writer);
+ m_writer->truncate(length);
+}
+
+void AsyncFileWriterChromium::abort()
+{
+ ASSERT(m_writer);
+ m_writer->cancel();
+}
+
+void AsyncFileWriterChromium::didWrite(long long bytes, bool complete)
+{
+ ASSERT(m_writer);
+ m_client->didWrite(bytes, complete);
+}
+
+void AsyncFileWriterChromium::didTruncate(long long length)
+{
+ m_client->didTruncate(length);
+}
+
+void AsyncFileWriterChromium::didFail(WebFileError error)
+{
+ m_client->didFail(error);
+}
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebKit/chromium/src/AsyncFileWriterChromium.h b/WebKit/chromium/src/AsyncFileWriterChromium.h
new file mode 100644
index 0000000..92743ca
--- /dev/null
+++ b/WebKit/chromium/src/AsyncFileWriterChromium.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AsyncFileWriterChromium_h
+#define AsyncFileWriterChromium_h
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "AsyncFileWriter.h"
+#include "WebFileError.h"
+#include "WebFileWriterClient.h"
+
+namespace WebCore {
+class Blob;
+class FileWriterClient;
+}
+
+namespace WebKit {
+
+class WebFileWriter;
+
+class AsyncFileWriterChromium : public WebCore::AsyncFileWriter, public WebFileWriterClient {
+public:
+ AsyncFileWriterChromium(WebCore::FileWriterClient* client);
+
+ void setWebFileWriter(WebFileWriter* writer);
+
+ // FileWriter
+ virtual void write(long long position, WebCore::Blob* data);
+ virtual void truncate(long long length);
+ virtual void abort();
+
+ // WebFileWriterClient
+ virtual void didWrite(long long bytes, bool complete);
+ virtual void didTruncate(long long length);
+ virtual void didFail(WebFileError);
+
+private:
+ OwnPtr<WebFileWriter> m_writer;
+ WebCore::FileWriterClient* m_client;
+};
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
+
+#endif // AsyncFileWriterChromium_h
diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp
index 8a3eda6..8c13cbb 100644
--- a/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -56,11 +56,10 @@
#include "NotificationPresenterImpl.h"
#include "Page.h"
#include "PopupMenuChromium.h"
-#include "SearchPopupMenuChromium.h"
#include "ScriptController.h"
+#include "SearchPopupMenuChromium.h"
#include "SecurityOrigin.h"
#include "SharedGraphicsContext3D.h"
-#include "WebGeolocationService.h"
#if USE(V8)
#include "V8Proxy.h"
#endif
@@ -70,6 +69,7 @@
#include "WebFileChooserCompletionImpl.h"
#include "WebFrameClient.h"
#include "WebFrameImpl.h"
+#include "WebGeolocationService.h"
#include "WebInputEvent.h"
#include "WebKit.h"
#include "WebNode.h"
@@ -103,6 +103,46 @@ static WebPopupType convertPopupType(PopupContainer::PopupType type)
}
}
+// Converts a WebCore::AXObjectCache::AXNotification to a WebKit::WebAccessibilityNotification
+static WebAccessibilityNotification toWebAccessibilityNotification(AXObjectCache::AXNotification notification)
+{
+ switch (notification) {
+ case AXObjectCache::AXActiveDescendantChanged:
+ return WebAccessibilityNotificationActiveDescendantChanged;
+ case AXObjectCache::AXCheckedStateChanged:
+ return WebAccessibilityNotificationCheckedStateChanged;
+ case AXObjectCache::AXChildrenChanged:
+ return WebAccessibilityNotificationChildrenChanged;
+ case AXObjectCache::AXFocusedUIElementChanged:
+ return WebAccessibilityNotificationFocusedUIElementChanged;
+ case AXObjectCache::AXLayoutComplete:
+ return WebAccessibilityNotificationLayoutComplete;
+ case AXObjectCache::AXLoadComplete:
+ return WebAccessibilityNotificationLoadComplete;
+ case AXObjectCache::AXSelectedChildrenChanged:
+ return WebAccessibilityNotificationSelectedChildrenChanged;
+ case AXObjectCache::AXSelectedTextChanged:
+ return WebAccessibilityNotificationSelectedTextChanged;
+ case AXObjectCache::AXValueChanged:
+ return WebAccessibilityNotificationValueChanged;
+ case AXObjectCache::AXScrolledToAnchor:
+ return WebAccessibilityNotificationScrolledToAnchor;
+ case AXObjectCache::AXLiveRegionChanged:
+ return WebAccessibilityNotificationLiveRegionChanged;
+ case AXObjectCache::AXMenuListValueChanged:
+ return WebAccessibilityNotificationMenuListValueChanged;
+ case AXObjectCache::AXRowCountChanged:
+ return WebAccessibilityNotificationRowCountChanged;
+ case AXObjectCache::AXRowCollapsed:
+ return WebAccessibilityNotificationRowCollapsed;
+ case AXObjectCache::AXRowExpanded:
+ return WebAccessibilityNotificationRowExpanded;
+ default:
+ ASSERT_NOT_REACHED();
+ return WebAccessibilityNotificationInvalid;
+ }
+}
+
ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView)
: m_webView(webView)
, m_toolbarsVisible(true)
@@ -343,9 +383,9 @@ bool ChromeClientImpl::statusbarVisible()
void ChromeClientImpl::setScrollbarsVisible(bool value)
{
m_scrollbarsVisible = value;
- WebFrameImpl* web_frame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
- if (web_frame)
- web_frame->setCanHaveScrollbars(value);
+ WebFrameImpl* webFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
+ if (webFrame)
+ webFrame->setCanHaveScrollbars(value);
}
bool ChromeClientImpl::scrollbarsVisible()
@@ -493,8 +533,15 @@ void ChromeClientImpl::invalidateContentsAndWindow(const IntRect& updateRect, bo
{
if (updateRect.isEmpty())
return;
- if (m_webView->client())
- m_webView->client()->didInvalidateRect(updateRect);
+#if USE(ACCELERATED_COMPOSITING)
+ if (!m_webView->isAcceleratedCompositingActive()) {
+#endif
+ if (m_webView->client())
+ m_webView->client()->didInvalidateRect(updateRect);
+#if USE(ACCELERATED_COMPOSITING)
+ } else
+ m_webView->invalidateRootLayerRect(updateRect);
+#endif
}
void ChromeClientImpl::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
@@ -508,11 +555,18 @@ void ChromeClientImpl::scroll(
const IntRect& clipRect)
{
m_webView->hidePopups();
- if (m_webView->client()) {
- int dx = scrollDelta.width();
- int dy = scrollDelta.height();
- m_webView->client()->didScrollRect(dx, dy, clipRect);
- }
+#if USE(ACCELERATED_COMPOSITING)
+ if (!m_webView->isAcceleratedCompositingActive()) {
+#endif
+ if (m_webView->client()) {
+ int dx = scrollDelta.width();
+ int dy = scrollDelta.height();
+ m_webView->client()->didScrollRect(dx, dy, clipRect);
+ }
+#if USE(ACCELERATED_COMPOSITING)
+ } else
+ m_webView->scrollRootLayerRect(scrollDelta, clipRect);
+#endif
}
IntPoint ChromeClientImpl::screenToWindow(const IntPoint&) const
@@ -720,6 +774,13 @@ void ChromeClientImpl::didChangeAccessibilityObjectChildren(WebCore::Accessibili
m_webView->client()->didChangeAccessibilityObjectChildren(WebAccessibilityObject(obj));
}
+void ChromeClientImpl::postAccessibilityNotification(AccessibilityObject* obj, AXObjectCache::AXNotification notification)
+{
+ // Alert assistive technology about the accessibility object notification.
+ if (obj)
+ m_webView->client()->postAccessibilityNotification(WebAccessibilityObject(obj), toWebAccessibilityNotification(notification));
+}
+
#if ENABLE(NOTIFICATIONS)
NotificationPresenter* ChromeClientImpl::notificationPresenter() const
{
diff --git a/WebKit/chromium/src/ChromeClientImpl.h b/WebKit/chromium/src/ChromeClientImpl.h
index d16d8f6..fbaac87 100644
--- a/WebKit/chromium/src/ChromeClientImpl.h
+++ b/WebKit/chromium/src/ChromeClientImpl.h
@@ -168,6 +168,7 @@ public:
virtual void popupClosed(WebCore::PopupContainer* popupContainer);
virtual void didChangeAccessibilityObjectState(WebCore::AccessibilityObject*);
virtual void didChangeAccessibilityObjectChildren(WebCore::AccessibilityObject*);
+ virtual void postAccessibilityNotification(WebCore::AccessibilityObject*, WebCore::AXObjectCache::AXNotification);
// ChromeClientImpl:
void setCursor(const WebCursorInfo& cursor);
diff --git a/WebKit/chromium/src/DOMUtilitiesPrivate.cpp b/WebKit/chromium/src/DOMUtilitiesPrivate.cpp
index 4081db6..6f952f7 100644
--- a/WebKit/chromium/src/DOMUtilitiesPrivate.cpp
+++ b/WebKit/chromium/src/DOMUtilitiesPrivate.cpp
@@ -97,7 +97,7 @@ bool elementHasLegalLinkAttribute(const Element* element,
if (element->hasTagName(HTMLNames::inputTag)) {
const HTMLInputElement* input =
static_cast<const HTMLInputElement*>(element);
- if (input->inputType() == HTMLInputElement::IMAGE)
+ if (input->isImageButton())
return true;
}
} else if (attrName == HTMLNames::hrefAttr) {
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index ea668c7..61d43df 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -1053,8 +1053,7 @@ void FrameLoaderClientImpl::committedLoad(DocumentLoader* loader, const char* da
// If we are sending data to MediaDocument, we should stop here
// and cancel the request.
- if (m_webFrame->frame()->document()
- && m_webFrame->frame()->document()->isMediaDocument())
+ if (m_webFrame->frame()->document()->isMediaDocument())
loader->cancelMainResourceLoad(pluginWillHandleLoadError(loader->response()));
// The plugin widget could have been created in the m_webFrame->DidReceiveData
@@ -1207,6 +1206,12 @@ bool FrameLoaderClientImpl::canHandleRequest(const ResourceRequest& request) con
m_webFrame, WrappedResourceRequest(request));
}
+bool FrameLoaderClientImpl::canShowMIMETypeAsHTML(const String& MIMEType) const
+{
+ notImplemented();
+ return false;
+}
+
bool FrameLoaderClientImpl::canShowMIMEType(const String& mimeType) const
{
// This method is called to determine if the media type can be shown
@@ -1398,12 +1403,12 @@ PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin(
if (!webPlugin->initialize(container.get()))
return 0;
- if (m_webFrame->frame()->view()->zoomFactor() != 1) {
+ bool zoomTextOnly = m_webFrame->viewImpl()->zoomTextOnly();
+ float zoomFactor = zoomTextOnly ? m_webFrame->frame()->textZoomFactor() : m_webFrame->frame()->pageZoomFactor();
+ if (zoomFactor != 1) {
// There's a saved zoom level, so tell the plugin about it since
// WebViewImpl::setZoomLevel was called before the plugin was created.
- webPlugin->setZoomFactor(
- m_webFrame->frame()->view()->zoomFactor(),
- m_webFrame->frame()->page()->settings()->zoomMode() == ZoomTextOnly);
+ webPlugin->setZoomFactor(zoomFactor, zoomTextOnly);
}
// The element might have been removed during plugin initialization!
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.h b/WebKit/chromium/src/FrameLoaderClientImpl.h
index 361bae4..57105de 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.h
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.h
@@ -149,6 +149,7 @@ public:
virtual bool shouldFallBack(const WebCore::ResourceError&);
virtual bool canHandleRequest(const WebCore::ResourceRequest&) const;
virtual bool canShowMIMEType(const WTF::String& MIMEType) const;
+ virtual bool canShowMIMETypeAsHTML(const String& MIMEType) const;
virtual bool representationExistsForURLScheme(const WTF::String& URLScheme) const;
virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String& URLScheme) const;
virtual void frameLoadCompleted();
diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp
index 3051b9b..c78d334 100644
--- a/WebKit/chromium/src/GraphicsContext3D.cpp
+++ b/WebKit/chromium/src/GraphicsContext3D.cpp
@@ -39,6 +39,7 @@
#include "CanvasRenderingContext.h"
#include "Chrome.h"
#include "ChromeClientImpl.h"
+#include "GraphicsContext3DInternal.h"
#include "HTMLCanvasElement.h"
#include "HTMLImageElement.h"
#include "ImageBuffer.h"
@@ -60,8 +61,6 @@
#include <CoreGraphics/CGImage.h>
#endif
-// using namespace std;
-
// There are two levels of delegation in this file:
//
// 1. GraphicsContext3D delegates to GraphicsContext3DInternal. This is done
@@ -82,239 +81,6 @@ namespace WebCore {
//----------------------------------------------------------------------
// GraphicsContext3DInternal
-class GraphicsContext3DInternal {
-public:
- GraphicsContext3DInternal();
- ~GraphicsContext3DInternal();
-
- bool initialize(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow);
-
- PlatformGraphicsContext3D platformGraphicsContext3D() const;
- Platform3DObject platformTexture() const;
-
- bool makeContextCurrent();
-
- int sizeInBytes(int type);
-
- void reshape(int width, int height);
-
- void paintRenderingResultsToCanvas(CanvasRenderingContext* context);
- bool paintsIntoCanvasBuffer() const;
-
- void prepareTexture();
-
-#if USE(ACCELERATED_COMPOSITING)
- WebGLLayerChromium* platformLayer() const;
-#endif
- bool isGLES2Compliant() const;
- bool isGLES2NPOTStrict() const;
- bool isErrorGeneratedOnOutOfBoundsAccesses() const;
-
- //----------------------------------------------------------------------
- // Entry points for WebGL.
- //
- void activeTexture(unsigned long texture);
- void attachShader(Platform3DObject program, Platform3DObject shader);
- void bindAttribLocation(Platform3DObject, unsigned long index, const String& name);
- void bindBuffer(unsigned long target, Platform3DObject);
- void bindFramebuffer(unsigned long target, Platform3DObject);
- void bindRenderbuffer(unsigned long target, Platform3DObject);
- void bindTexture(unsigned long target, Platform3DObject texture);
- void blendColor(double red, double green, double blue, double alpha);
- void blendEquation(unsigned long mode);
- void blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha);
- void blendFunc(unsigned long sfactor, unsigned long dfactor);
- 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, int size, const void* data, unsigned long usage);
- void bufferSubData(unsigned long target, long offset, int size, const void* data);
-
- unsigned long checkFramebufferStatus(unsigned long target);
- void clear(unsigned long mask);
- void clearColor(double red, double green, double blue, double alpha);
- void clearDepth(double depth);
- void clearStencil(long s);
- void colorMask(bool red, bool green, bool blue, bool alpha);
- void compileShader(Platform3DObject);
-
- void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border);
- void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height);
- void cullFace(unsigned long mode);
- void depthFunc(unsigned long func);
- void depthMask(bool flag);
- void depthRange(double zNear, double zFar);
- void detachShader(Platform3DObject, Platform3DObject);
- void disable(unsigned long cap);
- void disableVertexAttribArray(unsigned long index);
- void drawArrays(unsigned long mode, long first, long count);
- void drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset);
-
- void enable(unsigned long cap);
- void enableVertexAttribArray(unsigned long index);
- void finish();
- void flush();
- void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject);
- void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject, long level);
- void frontFace(unsigned long mode);
- void generateMipmap(unsigned long target);
-
- bool getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo&);
- bool getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo&);
-
- void getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders);
-
- int getAttribLocation(Platform3DObject, const String& name);
-
- void getBooleanv(unsigned long pname, unsigned char* value);
-
- void getBufferParameteriv(unsigned long target, unsigned long pname, int* value);
-
- GraphicsContext3D::Attributes getContextAttributes();
-
- unsigned long getError();
-
- void getFloatv(unsigned long pname, float* value);
-
- void getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value);
-
- void getIntegerv(unsigned long pname, int* value);
-
- void getProgramiv(Platform3DObject program, unsigned long pname, int* value);
-
- String getProgramInfoLog(Platform3DObject);
-
- void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value);
-
- void getShaderiv(Platform3DObject, unsigned long pname, int* value);
-
- String getShaderInfoLog(Platform3DObject);
-
- String getShaderSource(Platform3DObject);
- String getString(unsigned long name);
-
- void getTexParameterfv(unsigned long target, unsigned long pname, float* value);
- void getTexParameteriv(unsigned long target, unsigned long pname, int* value);
-
- void getUniformfv(Platform3DObject program, long location, float* value);
- void getUniformiv(Platform3DObject program, long location, int* value);
-
- long getUniformLocation(Platform3DObject, const String& name);
-
- void getVertexAttribfv(unsigned long index, unsigned long pname, float* value);
- void getVertexAttribiv(unsigned long index, unsigned long pname, int* value);
-
- long getVertexAttribOffset(unsigned long index, unsigned long pname);
-
- void hint(unsigned long target, unsigned long mode);
- bool isBuffer(Platform3DObject);
- bool isEnabled(unsigned long cap);
- bool isFramebuffer(Platform3DObject);
- bool isProgram(Platform3DObject);
- bool isRenderbuffer(Platform3DObject);
- bool isShader(Platform3DObject);
- bool isTexture(Platform3DObject);
- void lineWidth(double);
- void linkProgram(Platform3DObject);
- void pixelStorei(unsigned long pname, long param);
- void polygonOffset(double factor, double units);
-
- void readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data);
-
- void releaseShaderCompiler();
- void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height);
- void sampleCoverage(double value, bool invert);
- void scissor(long x, long y, unsigned long width, unsigned long height);
- void shaderSource(Platform3DObject, const String& string);
- void stencilFunc(unsigned long func, long ref, unsigned long mask);
- void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask);
- void stencilMask(unsigned long mask);
- void stencilMaskSeparate(unsigned long face, unsigned long mask);
- void stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass);
- void stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass);
-
- // These next several functions return an error code (0 if no errors) rather than using an ExceptionCode.
- // Currently they return -1 on any error.
- int texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels);
-
- void texParameterf(unsigned target, unsigned pname, float param);
- void texParameteri(unsigned target, unsigned pname, int param);
-
- int texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels);
-
- void uniform1f(long location, float x);
- void uniform1fv(long location, float* v, int size);
- void uniform1i(long location, int x);
- void uniform1iv(long location, int* v, int size);
- void uniform2f(long location, float x, float y);
- void uniform2fv(long location, float* v, int size);
- void uniform2i(long location, int x, int y);
- void uniform2iv(long location, int* v, int size);
- void uniform3f(long location, float x, float y, float z);
- void uniform3fv(long location, float* v, int size);
- void uniform3i(long location, int x, int y, int z);
- void uniform3iv(long location, int* v, int size);
- void uniform4f(long location, float x, float y, float z, float w);
- void uniform4fv(long location, float* v, int size);
- void uniform4i(long location, int x, int y, int z, int w);
- void uniform4iv(long location, int* v, int size);
- void uniformMatrix2fv(long location, bool transpose, float* value, int size);
- void uniformMatrix3fv(long location, bool transpose, float* value, int size);
- void uniformMatrix4fv(long location, bool transpose, float* value, int size);
-
- void useProgram(Platform3DObject);
- void validateProgram(Platform3DObject);
-
- void vertexAttrib1f(unsigned long indx, float x);
- void vertexAttrib1fv(unsigned long indx, float* values);
- void vertexAttrib2f(unsigned long indx, float x, float y);
- void vertexAttrib2fv(unsigned long indx, float* values);
- void vertexAttrib3f(unsigned long indx, float x, float y, float z);
- void vertexAttrib3fv(unsigned long indx, float* values);
- void vertexAttrib4f(unsigned long indx, float x, float y, float z, float w);
- void vertexAttrib4fv(unsigned long indx, float* values);
- void vertexAttribPointer(unsigned long indx, int size, int type, bool normalized,
- unsigned long stride, unsigned long offset);
-
- void viewport(long x, long y, unsigned long width, unsigned long height);
-
- unsigned createBuffer();
- unsigned createFramebuffer();
- unsigned createProgram();
- unsigned createRenderbuffer();
- unsigned createShader(unsigned long);
- unsigned createTexture();
-
- void deleteBuffer(unsigned);
- void deleteFramebuffer(unsigned);
- void deleteProgram(unsigned);
- void deleteRenderbuffer(unsigned);
- void deleteShader(unsigned);
- void deleteTexture(unsigned);
-
- void synthesizeGLError(unsigned long error);
- bool supportsBGRA();
-
-private:
- OwnPtr<WebKit::WebGraphicsContext3D> m_impl;
- WebKit::WebViewImpl* m_webViewImpl;
-#if USE(ACCELERATED_COMPOSITING)
- RefPtr<WebGLLayerChromium> m_compositingLayer;
-#endif
-#if PLATFORM(SKIA)
- // If the width and height of the Canvas's backing store don't
- // match those that we were given in the most recent call to
- // reshape(), then we need an intermediate bitmap to read back the
- // frame buffer into. This seems to happen when CSS styles are
- // used to resize the Canvas.
- SkBitmap m_resizingBitmap;
-#endif
-
-#if PLATFORM(CG)
- unsigned char* m_renderOutput;
-#endif
-};
-
GraphicsContext3DInternal::GraphicsContext3DInternal()
: m_webViewImpl(0)
#if PLATFORM(SKIA)
@@ -334,8 +100,7 @@ GraphicsContext3DInternal::~GraphicsContext3DInternal()
#endif
}
-bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs,
- HostWindow* hostWindow)
+bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool renderDirectlyToHostWindow)
{
WebKit::WebGraphicsContext3D::Attributes webAttributes;
webAttributes.alpha = attrs.alpha;
@@ -354,7 +119,7 @@ bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs,
if (!m_webViewImpl)
return false;
- if (!webContext->initialize(webAttributes, m_webViewImpl)) {
+ if (!webContext->initialize(webAttributes, m_webViewImpl, renderDirectlyToHostWindow)) {
delete webContext;
return false;
}
@@ -366,6 +131,13 @@ bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs,
return true;
}
+WebKit::WebGraphicsContext3D* GraphicsContext3DInternal::extractWebGraphicsContext3D(GraphicsContext3D* context)
+{
+ if (!context)
+ return 0;
+ return context->m_internal->m_impl.get();
+}
+
PlatformGraphicsContext3D GraphicsContext3DInternal::platformGraphicsContext3D() const
{
return m_impl.get();
@@ -528,6 +300,12 @@ void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4) \
m_impl->name(a1, a2, a3, a4); \
}
+#define DELEGATE_TO_IMPL_4R(name, t1, t2, t3, t4, rt) \
+rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4) \
+{ \
+ return m_impl->name(a1, a2, a3, a4); \
+}
+
#define DELEGATE_TO_IMPL_5(name, t1, t2, t3, t4, t5) \
void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) \
{ \
@@ -898,6 +676,13 @@ DELEGATE_TO_IMPL_1(deleteTexture, unsigned)
DELEGATE_TO_IMPL_1(synthesizeGLError, unsigned long)
DELEGATE_TO_IMPL_R(supportsBGRA, bool)
+DELEGATE_TO_IMPL_R(supportsMapSubCHROMIUM, bool)
+DELEGATE_TO_IMPL_4R(mapBufferSubDataCHROMIUM, unsigned, int, int, unsigned, void*)
+DELEGATE_TO_IMPL_1(unmapBufferSubDataCHROMIUM, const void*)
+DELEGATE_TO_IMPL_9R(mapTexSubImage2DCHROMIUM, unsigned, int, int, int, int, int, unsigned, unsigned, unsigned, void*)
+DELEGATE_TO_IMPL_1(unmapTexSubImage2DCHROMIUM, const void*)
+DELEGATE_TO_IMPL_R(supportsCopyTextureToParentTextureCHROMIUM, bool)
+DELEGATE_TO_IMPL_2(copyTextureToParentTextureCHROMIUM, unsigned, unsigned)
//----------------------------------------------------------------------
// GraphicsContext3D
@@ -960,6 +745,12 @@ void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4) \
m_internal->name(a1, a2, a3, a4); \
}
+#define DELEGATE_TO_INTERNAL_4R(name, t1, t2, t3, t4, rt) \
+rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4) \
+{ \
+ return m_internal->name(a1, a2, a3, a4); \
+}
+
#define DELEGATE_TO_INTERNAL_5(name, t1, t2, t3, t4, t5) \
void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) \
{ \
@@ -1002,7 +793,7 @@ rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a
return m_internal->name(a1, a2, a3, a4, a5, a6, a7, a8, a9); \
}
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes, HostWindow*)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes, HostWindow*, bool)
{
}
@@ -1010,15 +801,14 @@ GraphicsContext3D::~GraphicsContext3D()
{
}
-PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
{
- GraphicsContext3DInternal* internal = new GraphicsContext3DInternal();
- if (!internal->initialize(attrs, hostWindow)) {
- delete internal;
+ OwnPtr<GraphicsContext3DInternal> internal = adoptPtr(new GraphicsContext3DInternal());
+ if (!internal->initialize(attrs, hostWindow, renderStyle == RenderDirectlyToHostWindow)) {
return 0;
}
- PassOwnPtr<GraphicsContext3D> result = new GraphicsContext3D(attrs, hostWindow);
- result->m_internal.set(internal);
+ PassOwnPtr<GraphicsContext3D> result = new GraphicsContext3D(attrs, hostWindow, renderStyle == RenderDirectlyToHostWindow);
+ result->m_internal = internal.release();
return result;
}
@@ -1234,6 +1024,13 @@ DELEGATE_TO_INTERNAL_1(deleteTexture, unsigned)
DELEGATE_TO_INTERNAL_1(synthesizeGLError, unsigned long)
DELEGATE_TO_INTERNAL_R(supportsBGRA, bool)
+DELEGATE_TO_INTERNAL_R(supportsMapSubCHROMIUM, bool)
+DELEGATE_TO_INTERNAL_4R(mapBufferSubDataCHROMIUM, unsigned, int, int, unsigned, void*)
+DELEGATE_TO_INTERNAL_1(unmapBufferSubDataCHROMIUM, const void*)
+DELEGATE_TO_INTERNAL_9R(mapTexSubImage2DCHROMIUM, unsigned, int, int, int, int, int, unsigned, unsigned, unsigned, void*)
+DELEGATE_TO_INTERNAL_1(unmapTexSubImage2DCHROMIUM, const void*)
+DELEGATE_TO_INTERNAL_R(supportsCopyTextureToParentTextureCHROMIUM, bool)
+DELEGATE_TO_INTERNAL_2(copyTextureToParentTextureCHROMIUM, unsigned, unsigned)
bool GraphicsContext3D::isGLES2Compliant() const
{
diff --git a/WebKit/chromium/src/GraphicsContext3DInternal.h b/WebKit/chromium/src/GraphicsContext3DInternal.h
new file mode 100644
index 0000000..f12fff0
--- /dev/null
+++ b/WebKit/chromium/src/GraphicsContext3DInternal.h
@@ -0,0 +1,301 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef GraphicsContext3DInternal_h
+#define GraphicsContext3DInternal_h
+
+#include "GraphicsContext3D.h"
+#include <wtf/OwnPtr.h>
+#if PLATFORM(SKIA)
+#include "SkBitmap.h"
+#endif
+
+namespace WebKit {
+class WebGraphicsContext3D;
+class WebViewImpl;
+} // namespace WebKit
+
+namespace WebCore {
+
+#if USE(ACCELERATED_COMPOSITING)
+class WebGLLayerChromium;
+#endif
+
+class GraphicsContext3DInternal {
+public:
+ GraphicsContext3DInternal();
+ ~GraphicsContext3DInternal();
+
+ bool initialize(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool renderDirectlyToHostWindow);
+
+ // Helper function to provide access to the lower-level WebGraphicsContext3D,
+ // which is needed for subordinate contexts like WebGL's to share resources
+ // with the compositor's context.
+ static WebKit::WebGraphicsContext3D* extractWebGraphicsContext3D(GraphicsContext3D* context);
+
+ PlatformGraphicsContext3D platformGraphicsContext3D() const;
+ Platform3DObject platformTexture() const;
+
+ bool makeContextCurrent();
+
+ int sizeInBytes(int type);
+
+ void reshape(int width, int height);
+
+ void paintRenderingResultsToCanvas(CanvasRenderingContext*);
+ bool paintsIntoCanvasBuffer() const;
+
+ void prepareTexture();
+
+#if USE(ACCELERATED_COMPOSITING)
+ WebGLLayerChromium* platformLayer() const;
+#endif
+ bool isGLES2Compliant() const;
+ bool isGLES2NPOTStrict() const;
+ bool isErrorGeneratedOnOutOfBoundsAccesses() const;
+
+ //----------------------------------------------------------------------
+ // Entry points for WebGL.
+ //
+ void activeTexture(unsigned long texture);
+ void attachShader(Platform3DObject program, Platform3DObject shader);
+ void bindAttribLocation(Platform3DObject, unsigned long index, const String& name);
+ void bindBuffer(unsigned long target, Platform3DObject);
+ void bindFramebuffer(unsigned long target, Platform3DObject);
+ void bindRenderbuffer(unsigned long target, Platform3DObject);
+ void bindTexture(unsigned long target, Platform3DObject texture);
+ void blendColor(double red, double green, double blue, double alpha);
+ void blendEquation(unsigned long mode);
+ void blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha);
+ void blendFunc(unsigned long sfactor, unsigned long dfactor);
+ 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, int size, const void* data, unsigned long usage);
+ void bufferSubData(unsigned long target, long offset, int size, const void* data);
+
+ unsigned long checkFramebufferStatus(unsigned long target);
+ void clear(unsigned long mask);
+ void clearColor(double red, double green, double blue, double alpha);
+ void clearDepth(double depth);
+ void clearStencil(long s);
+ void colorMask(bool red, bool green, bool blue, bool alpha);
+ void compileShader(Platform3DObject);
+
+ void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border);
+ void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height);
+ void cullFace(unsigned long mode);
+ void depthFunc(unsigned long func);
+ void depthMask(bool flag);
+ void depthRange(double zNear, double zFar);
+ void detachShader(Platform3DObject, Platform3DObject);
+ void disable(unsigned long cap);
+ void disableVertexAttribArray(unsigned long index);
+ void drawArrays(unsigned long mode, long first, long count);
+ void drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset);
+
+ void enable(unsigned long cap);
+ void enableVertexAttribArray(unsigned long index);
+ void finish();
+ void flush();
+ void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject);
+ void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject, long level);
+ void frontFace(unsigned long mode);
+ void generateMipmap(unsigned long target);
+
+ bool getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo&);
+ bool getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo&);
+
+ void getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders);
+
+ int getAttribLocation(Platform3DObject, const String& name);
+
+ void getBooleanv(unsigned long pname, unsigned char* value);
+
+ void getBufferParameteriv(unsigned long target, unsigned long pname, int* value);
+
+ GraphicsContext3D::Attributes getContextAttributes();
+
+ unsigned long getError();
+
+ void getFloatv(unsigned long pname, float* value);
+
+ void getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value);
+
+ void getIntegerv(unsigned long pname, int* value);
+
+ void getProgramiv(Platform3DObject program, unsigned long pname, int* value);
+
+ String getProgramInfoLog(Platform3DObject);
+
+ void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value);
+
+ void getShaderiv(Platform3DObject, unsigned long pname, int* value);
+
+ String getShaderInfoLog(Platform3DObject);
+
+ String getShaderSource(Platform3DObject);
+ String getString(unsigned long name);
+
+ void getTexParameterfv(unsigned long target, unsigned long pname, float* value);
+ void getTexParameteriv(unsigned long target, unsigned long pname, int* value);
+
+ void getUniformfv(Platform3DObject program, long location, float* value);
+ void getUniformiv(Platform3DObject program, long location, int* value);
+
+ long getUniformLocation(Platform3DObject, const String& name);
+
+ void getVertexAttribfv(unsigned long index, unsigned long pname, float* value);
+ void getVertexAttribiv(unsigned long index, unsigned long pname, int* value);
+
+ long getVertexAttribOffset(unsigned long index, unsigned long pname);
+
+ void hint(unsigned long target, unsigned long mode);
+ bool isBuffer(Platform3DObject);
+ bool isEnabled(unsigned long cap);
+ bool isFramebuffer(Platform3DObject);
+ bool isProgram(Platform3DObject);
+ bool isRenderbuffer(Platform3DObject);
+ bool isShader(Platform3DObject);
+ bool isTexture(Platform3DObject);
+ void lineWidth(double);
+ void linkProgram(Platform3DObject);
+ void pixelStorei(unsigned long pname, long param);
+ void polygonOffset(double factor, double units);
+
+ void readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data);
+
+ void releaseShaderCompiler();
+ void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height);
+ void sampleCoverage(double value, bool invert);
+ void scissor(long x, long y, unsigned long width, unsigned long height);
+ void shaderSource(Platform3DObject, const String& string);
+ void stencilFunc(unsigned long func, long ref, unsigned long mask);
+ void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask);
+ void stencilMask(unsigned long mask);
+ void stencilMaskSeparate(unsigned long face, unsigned long mask);
+ void stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass);
+ void stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass);
+
+ // These next several functions return an error code (0 if no errors) rather than using an ExceptionCode.
+ // Currently they return -1 on any error.
+ int texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels);
+
+ void texParameterf(unsigned target, unsigned pname, float param);
+ void texParameteri(unsigned target, unsigned pname, int param);
+
+ int texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels);
+
+ void uniform1f(long location, float x);
+ void uniform1fv(long location, float* v, int size);
+ void uniform1i(long location, int x);
+ void uniform1iv(long location, int* v, int size);
+ void uniform2f(long location, float x, float y);
+ void uniform2fv(long location, float* v, int size);
+ void uniform2i(long location, int x, int y);
+ void uniform2iv(long location, int* v, int size);
+ void uniform3f(long location, float x, float y, float z);
+ void uniform3fv(long location, float* v, int size);
+ void uniform3i(long location, int x, int y, int z);
+ void uniform3iv(long location, int* v, int size);
+ void uniform4f(long location, float x, float y, float z, float w);
+ void uniform4fv(long location, float* v, int size);
+ void uniform4i(long location, int x, int y, int z, int w);
+ void uniform4iv(long location, int* v, int size);
+ void uniformMatrix2fv(long location, bool transpose, float* value, int size);
+ void uniformMatrix3fv(long location, bool transpose, float* value, int size);
+ void uniformMatrix4fv(long location, bool transpose, float* value, int size);
+
+ void useProgram(Platform3DObject);
+ void validateProgram(Platform3DObject);
+
+ void vertexAttrib1f(unsigned long indx, float x);
+ void vertexAttrib1fv(unsigned long indx, float* values);
+ void vertexAttrib2f(unsigned long indx, float x, float y);
+ void vertexAttrib2fv(unsigned long indx, float* values);
+ void vertexAttrib3f(unsigned long indx, float x, float y, float z);
+ void vertexAttrib3fv(unsigned long indx, float* values);
+ void vertexAttrib4f(unsigned long indx, float x, float y, float z, float w);
+ void vertexAttrib4fv(unsigned long indx, float* values);
+ void vertexAttribPointer(unsigned long indx, int size, int type, bool normalized,
+ unsigned long stride, unsigned long offset);
+
+ void viewport(long x, long y, unsigned long width, unsigned long height);
+
+ unsigned createBuffer();
+ unsigned createFramebuffer();
+ unsigned createProgram();
+ unsigned createRenderbuffer();
+ unsigned createShader(unsigned long);
+ unsigned createTexture();
+
+ void deleteBuffer(unsigned);
+ void deleteFramebuffer(unsigned);
+ void deleteProgram(unsigned);
+ void deleteRenderbuffer(unsigned);
+ void deleteShader(unsigned);
+ void deleteTexture(unsigned);
+
+ void synthesizeGLError(unsigned long error);
+
+ void swapBuffers();
+
+ // EXT_texture_format_BGRA8888
+ bool supportsBGRA();
+
+ // GL_CHROMIUM_map_sub
+ bool supportsMapSubCHROMIUM();
+ void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access);
+ void unmapBufferSubDataCHROMIUM(const void*);
+ void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access);
+ void unmapTexSubImage2DCHROMIUM(const void*);
+
+ // GL_CHROMIUM_copy_texture_to_parent_texture
+ bool supportsCopyTextureToParentTextureCHROMIUM();
+ void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture);
+
+private:
+ OwnPtr<WebKit::WebGraphicsContext3D> m_impl;
+ WebKit::WebViewImpl* m_webViewImpl;
+#if USE(ACCELERATED_COMPOSITING)
+ RefPtr<WebGLLayerChromium> m_compositingLayer;
+#endif
+#if PLATFORM(SKIA)
+ // If the width and height of the Canvas's backing store don't
+ // match those that we were given in the most recent call to
+ // reshape(), then we need an intermediate bitmap to read back the
+ // frame buffer into. This seems to happen when CSS styles are
+ // used to resize the Canvas.
+ SkBitmap m_resizingBitmap;
+#endif
+
+#if PLATFORM(CG)
+ unsigned char* m_renderOutput;
+#endif
+};
+
+} // namespace WebCore
+
+#endif // GraphicsContext3D_h
diff --git a/WebKit/chromium/src/IDBCursorBackendProxy.cpp b/WebKit/chromium/src/IDBCursorBackendProxy.cpp
index b4711eb..cf18917 100644
--- a/WebKit/chromium/src/IDBCursorBackendProxy.cpp
+++ b/WebKit/chromium/src/IDBCursorBackendProxy.cpp
@@ -30,9 +30,11 @@
#include "IDBAny.h"
#include "IDBCallbacks.h"
+#include "IDBKey.h"
#include "SerializedScriptValue.h"
#include "WebIDBCallbacksImpl.h"
#include "WebIDBKey.h"
+#include "WebSerializedScriptValue.h"
namespace WebCore {
@@ -60,9 +62,17 @@ PassRefPtr<IDBKey> IDBCursorBackendProxy::key() const
return m_idbCursor->key();
}
-PassRefPtr<SerializedScriptValue> IDBCursorBackendProxy::value() const
+PassRefPtr<IDBAny> IDBCursorBackendProxy::value() const
{
- return m_idbCursor->value();
+ WebKit::WebSerializedScriptValue webScriptValue;
+ WebKit::WebIDBKey webKey;
+ m_idbCursor->value(webScriptValue, webKey);
+ if (!webScriptValue.isNull()) {
+ ASSERT(webKey.type() == WebKit::WebIDBKey::InvalidType);
+ return IDBAny::create<SerializedScriptValue>(webScriptValue);
+ }
+ ASSERT(webKey.type() != WebKit::WebIDBKey::InvalidType);
+ return IDBAny::create<IDBKey>(webKey);
}
void IDBCursorBackendProxy::update(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBCallbacks> callbacks)
diff --git a/WebKit/chromium/src/IDBCursorBackendProxy.h b/WebKit/chromium/src/IDBCursorBackendProxy.h
index 8af27cf..d8b621a 100644
--- a/WebKit/chromium/src/IDBCursorBackendProxy.h
+++ b/WebKit/chromium/src/IDBCursorBackendProxy.h
@@ -44,7 +44,7 @@ public:
virtual unsigned short direction() const;
virtual PassRefPtr<IDBKey> key() const;
- virtual PassRefPtr<SerializedScriptValue> value() const;
+ virtual PassRefPtr<IDBAny> value() const;
virtual void update(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBCallbacks>);
virtual void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>);
virtual void remove(PassRefPtr<IDBCallbacks>);
diff --git a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp b/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
index 114e7e1..18101e4 100755
--- a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
+++ b/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
@@ -59,10 +59,10 @@ IDBFactoryBackendProxy::~IDBFactoryBackendProxy()
{
}
-void IDBFactoryBackendProxy::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame)
+void IDBFactoryBackendProxy::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir)
{
WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame);
- m_webIDBFactory->open(name, description, new WebIDBCallbacksImpl(callbacks), origin, webFrame);
+ m_webIDBFactory->open(name, description, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir);
}
void IDBFactoryBackendProxy::abortPendingTransactions(const Vector<int>& pendingIDs)
diff --git a/WebKit/chromium/src/IDBFactoryBackendProxy.h b/WebKit/chromium/src/IDBFactoryBackendProxy.h
index 9efc7af..ac30cf2 100755
--- a/WebKit/chromium/src/IDBFactoryBackendProxy.h
+++ b/WebKit/chromium/src/IDBFactoryBackendProxy.h
@@ -45,7 +45,7 @@ public:
virtual ~IDBFactoryBackendProxy();
PassRefPtr<DOMStringList> databases(void) const;
- virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*);
+ virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir);
virtual void abortPendingTransactions(const Vector<int>& pendingIDs);
private:
diff --git a/WebKit/chromium/src/IDBIndexBackendProxy.cpp b/WebKit/chromium/src/IDBIndexBackendProxy.cpp
index 5f1b9d9..f92f4f2 100644
--- a/WebKit/chromium/src/IDBIndexBackendProxy.cpp
+++ b/WebKit/chromium/src/IDBIndexBackendProxy.cpp
@@ -26,10 +26,15 @@
#include "config.h"
#include "IDBIndexBackendProxy.h"
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBCallbacks.h"
+#include "IDBKeyRange.h"
+#include "WebIDBCallbacksImpl.h"
#include "WebIDBDatabaseError.h"
#include "WebIDBIndex.h"
-
-#if ENABLE(INDEXED_DATABASE)
+#include "WebIDBKey.h"
+#include "WebIDBKeyRange.h"
namespace WebCore {
@@ -52,6 +57,11 @@ String IDBIndexBackendProxy::name()
return m_webIDBIndex->name();
}
+String IDBIndexBackendProxy::storeName()
+{
+ return m_webIDBIndex->storeName();
+}
+
String IDBIndexBackendProxy::keyPath()
{
return m_webIDBIndex->keyPath();
@@ -62,6 +72,26 @@ bool IDBIndexBackendProxy::unique()
return m_webIDBIndex->unique();
}
+void IDBIndexBackendProxy::openObjectCursor(PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks)
+{
+ m_webIDBIndex->openObjectCursor(keyRange, direction, new WebIDBCallbacksImpl(callbacks));
+}
+
+void IDBIndexBackendProxy::openCursor(PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks)
+{
+ m_webIDBIndex->openCursor(keyRange, direction, new WebIDBCallbacksImpl(callbacks));
+}
+
+void IDBIndexBackendProxy::getObject(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks)
+{
+ m_webIDBIndex->getObject(key, new WebIDBCallbacksImpl(callbacks));
+}
+
+void IDBIndexBackendProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks)
+{
+ m_webIDBIndex->get(key, new WebIDBCallbacksImpl(callbacks));
+}
+
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebKit/chromium/src/IDBIndexBackendProxy.h b/WebKit/chromium/src/IDBIndexBackendProxy.h
index 1b378dd..6aafdfa 100644
--- a/WebKit/chromium/src/IDBIndexBackendProxy.h
+++ b/WebKit/chromium/src/IDBIndexBackendProxy.h
@@ -42,10 +42,14 @@ public:
virtual ~IDBIndexBackendProxy();
virtual String name();
+ virtual String storeName();
virtual String keyPath();
virtual bool unique();
- // FIXME: Add other methods.
+ virtual void openObjectCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>);
+ virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>);
+ virtual void getObject(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>);
+ virtual void get(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>);
private:
IDBIndexBackendProxy(PassOwnPtr<WebKit::WebIDBIndex>);
diff --git a/WebKit/chromium/src/InspectorClientImpl.cpp b/WebKit/chromium/src/InspectorClientImpl.cpp
index 76acbb2..77150bb 100644
--- a/WebKit/chromium/src/InspectorClientImpl.cpp
+++ b/WebKit/chromium/src/InspectorClientImpl.cpp
@@ -100,28 +100,10 @@ bool InspectorClientImpl::sendMessageToFrontend(const WTF::String& message)
return false;
}
-void InspectorClientImpl::resourceTrackingWasEnabled()
+void InspectorClientImpl::updateInspectorStateCookie(const WTF::String& inspectorState)
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
- agent->resourceTrackingWasEnabled();
-}
-
-void InspectorClientImpl::resourceTrackingWasDisabled()
-{
- if (WebDevToolsAgentImpl* agent = devToolsAgent())
- agent->resourceTrackingWasDisabled();
-}
-
-void InspectorClientImpl::timelineProfilerWasStarted()
-{
- if (WebDevToolsAgentImpl* agent = devToolsAgent())
- agent->timelineProfilerWasStarted();
-}
-
-void InspectorClientImpl::timelineProfilerWasStopped()
-{
- if (WebDevToolsAgentImpl* agent = devToolsAgent())
- agent->timelineProfilerWasStopped();
+ agent->updateInspectorStateCookie(inspectorState);
}
WebDevToolsAgentImpl* InspectorClientImpl::devToolsAgent()
diff --git a/WebKit/chromium/src/InspectorClientImpl.h b/WebKit/chromium/src/InspectorClientImpl.h
index 34fcdc3..78d34e3 100644
--- a/WebKit/chromium/src/InspectorClientImpl.h
+++ b/WebKit/chromium/src/InspectorClientImpl.h
@@ -58,10 +58,7 @@ public:
virtual bool sendMessageToFrontend(const WTF::String&);
- virtual void resourceTrackingWasEnabled();
- virtual void resourceTrackingWasDisabled();
- virtual void timelineProfilerWasStarted();
- virtual void timelineProfilerWasStopped();
+ virtual void updateInspectorStateCookie(const WTF::String&);
private:
WebDevToolsAgentImpl* devToolsAgent();
diff --git a/WebKit/chromium/src/ResourceHandle.cpp b/WebKit/chromium/src/ResourceHandle.cpp
index 88f7f39..83e0017 100644
--- a/WebKit/chromium/src/ResourceHandle.cpp
+++ b/WebKit/chromium/src/ResourceHandle.cpp
@@ -74,7 +74,7 @@ public:
virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&);
virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength);
virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength);
- virtual void didFinishLoading(WebURLLoader*);
+ virtual void didFinishLoading(WebURLLoader*, double finishTime);
virtual void didFail(WebURLLoader*, const WebURLError&);
enum ConnectionState {
@@ -182,13 +182,13 @@ void ResourceHandleInternal::didReceiveCachedMetadata(WebURLLoader*, const char*
m_client->didReceiveCachedMetadata(m_owner, data, dataLength);
}
-void ResourceHandleInternal::didFinishLoading(WebURLLoader*)
+void ResourceHandleInternal::didFinishLoading(WebURLLoader*, double finishTime)
{
ASSERT(m_client);
if (m_state != ConnectionStateReceivedResponse && m_state != ConnectionStateReceivingData)
CRASH();
m_state = ConnectionStateFinishedLoading;
- m_client->didFinishLoading(m_owner);
+ m_client->didFinishLoading(m_owner, finishTime);
}
void ResourceHandleInternal::didFail(WebURLLoader*, const WebURLError& error)
@@ -211,16 +211,16 @@ ResourceHandle::ResourceHandle(const ResourceRequest& request,
// FIXME: Figure out what to do with the bool params.
}
-PassRefPtr<ResourceHandle> ResourceHandle::create(const ResourceRequest& request,
+PassRefPtr<ResourceHandle> ResourceHandle::create(NetworkingContext* context,
+ const ResourceRequest& request,
ResourceHandleClient* client,
- Frame* deprecated,
bool defersLoading,
bool shouldContentSniff)
{
RefPtr<ResourceHandle> newHandle = adoptRef(new ResourceHandle(
request, client, defersLoading, shouldContentSniff));
- if (newHandle->start(deprecated))
+ if (newHandle->start(context))
return newHandle.release();
return 0;
@@ -246,7 +246,7 @@ void ResourceHandle::setDefersLoading(bool value)
d->setDefersLoading(value);
}
-bool ResourceHandle::start(Frame* deprecated)
+bool ResourceHandle::start(NetworkingContext* context)
{
d->start();
return true;
@@ -288,12 +288,12 @@ bool ResourceHandle::supportsBufferedData()
}
// static
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request,
+void ResourceHandle::loadResourceSynchronously(NetworkingContext* context,
+ const ResourceRequest& request,
StoredCredentials storedCredentials,
ResourceError& error,
ResourceResponse& response,
- Vector<char>& data,
- Frame* deprecated)
+ Vector<char>& data)
{
OwnPtr<WebURLLoader> loader(webKitClient()->createURLLoader());
ASSERT(loader.get());
diff --git a/WebKit/chromium/src/WebAccessibilityCacheImpl.cpp b/WebKit/chromium/src/WebAccessibilityCacheImpl.cpp
index abb63cc..8304878 100644
--- a/WebKit/chromium/src/WebAccessibilityCacheImpl.cpp
+++ b/WebKit/chromium/src/WebAccessibilityCacheImpl.cpp
@@ -63,7 +63,6 @@ WebAccessibilityCache* WebAccessibilityCache::create()
PassRefPtr<WebAccessibilityCacheImpl::WeakHandle> WebAccessibilityCacheImpl::WeakHandle::create(AccessibilityObject* object)
{
- // FIXME: Remove resetting ref-count from AccessibilityObjectWrapper
RefPtr<WebAccessibilityCacheImpl::WeakHandle> weakHandle = adoptRef(new WebAccessibilityCacheImpl::WeakHandle(object));
weakHandle->m_object->setWrapper(weakHandle.get());
@@ -149,7 +148,7 @@ void WebAccessibilityCacheImpl::clear()
int WebAccessibilityCacheImpl::addOrGetId(const WebAccessibilityObject& object)
{
- if (object.isNull())
+ if (!object.isValid())
return invalidObjectId;
RefPtr<AccessibilityObject> o = toAccessibilityObject(object);
diff --git a/WebKit/chromium/src/WebAccessibilityObject.cpp b/WebKit/chromium/src/WebAccessibilityObject.cpp
index 3a3e94b..96a3173 100644
--- a/WebKit/chromium/src/WebAccessibilityObject.cpp
+++ b/WebKit/chromium/src/WebAccessibilityObject.cpp
@@ -101,6 +101,15 @@ bool WebAccessibilityObject::canSetValueAttribute() const
return m_private->canSetValueAttribute();
}
+bool WebAccessibilityObject::isValid() const
+{
+ if (!m_private)
+ return false;
+
+ m_private->updateBackingStore();
+ return m_private->axObjectID();
+}
+
unsigned WebAccessibilityObject::childCount() const
{
if (!m_private)
diff --git a/WebKit/chromium/src/WebDataSourceImpl.cpp b/WebKit/chromium/src/WebDataSourceImpl.cpp
index ac2a02d..d5b1d79 100644
--- a/WebKit/chromium/src/WebDataSourceImpl.cpp
+++ b/WebKit/chromium/src/WebDataSourceImpl.cpp
@@ -109,7 +109,8 @@ void WebDataSourceImpl::setExtraData(ExtraData* extraData)
m_extraData.set(extraData);
}
-WebApplicationCacheHost* WebDataSourceImpl::applicationCacheHost() {
+WebApplicationCacheHost* WebDataSourceImpl::applicationCacheHost()
+{
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
return ApplicationCacheHostInternal::toWebApplicationCacheHost(DocumentLoader::applicationCacheHost());
#else
@@ -117,6 +118,11 @@ WebApplicationCacheHost* WebDataSourceImpl::applicationCacheHost() {
#endif
}
+void WebDataSourceImpl::setDeferMainResourceDataLoad(bool defer)
+{
+ DocumentLoader::setDeferMainResourceDataLoad(defer);
+}
+
WebNavigationType WebDataSourceImpl::toWebNavigationType(NavigationType type)
{
switch (type) {
diff --git a/WebKit/chromium/src/WebDataSourceImpl.h b/WebKit/chromium/src/WebDataSourceImpl.h
index be32217..05329ff 100644
--- a/WebKit/chromium/src/WebDataSourceImpl.h
+++ b/WebKit/chromium/src/WebDataSourceImpl.h
@@ -68,6 +68,7 @@ public:
virtual ExtraData* extraData() const;
virtual void setExtraData(ExtraData*);
virtual WebApplicationCacheHost* applicationCacheHost();
+ virtual void setDeferMainResourceDataLoad(bool);
static WebNavigationType toWebNavigationType(WebCore::NavigationType type);
diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
index 971c290..c7bb050 100644
--- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
+++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
@@ -36,7 +36,6 @@
#include "InjectedScriptHost.h"
#include "InspectorBackendDispatcher.h"
#include "InspectorController.h"
-#include "InspectorValues.h"
#include "Page.h"
#include "PageGroup.h"
#include "PlatformString.h"
@@ -58,6 +57,7 @@
#include "WebURLResponse.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
+#include <wtf/CurrentTime.h>
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
@@ -67,8 +67,6 @@ using WebCore::InjectedScriptHost;
using WebCore::InspectorArray;
using WebCore::InspectorBackendDispatcher;
using WebCore::InspectorController;
-using WebCore::InspectorObject;
-using WebCore::InspectorValue;
using WebCore::Node;
using WebCore::Page;
using WebCore::ResourceError;
@@ -82,10 +80,9 @@ namespace WebKit {
namespace {
-static const char kFrontendConnectedFeatureName[] = "frontend-connected";
-static const char kResourceTrackingFeatureName[] = "resource-tracking";
-static const char kTimelineFeatureName[] = "timeline-profiler";
static const char kApuAgentFeatureName[] = "apu-agent";
+static const char kFrontendConnectedFeatureName[] = "frontend-connected";
+static const char kInspectorStateFeatureName[] = "inspector-state";
class ClientMessageLoopAdapter : public WebCore::ScriptDebugServer::ClientMessageLoop {
public:
@@ -223,9 +220,7 @@ void WebDevToolsAgentImpl::detach()
void WebDevToolsAgentImpl::frontendLoaded()
{
- inspectorController()->connectFrontend();
- // We know that by this time injected script has already been pushed to the backend.
- m_client->runtimePropertyChanged(kFrontendConnectedFeatureName, inspectorController()->injectedScriptHost()->injectedScriptSource());
+ connectFrontend(false);
}
void WebDevToolsAgentImpl::didNavigate()
@@ -253,17 +248,12 @@ void WebDevToolsAgentImpl::setRuntimeProperty(const WebString& name, const WebSt
{
if (name == kApuAgentFeatureName)
setApuAgentEnabled(value == "true");
- else if (name == kTimelineFeatureName)
- setTimelineProfilingEnabled(value == "true");
- else if (name == kResourceTrackingFeatureName) {
+ else if (name == kInspectorStateFeatureName) {
InspectorController* ic = inspectorController();
- if (value == "true")
- ic->enableResourceTracking(false /* not sticky */, false /* no reload */);
- else
- ic->disableResourceTracking(false /* not sticky */);
+ ic->restoreInspectorStateFromCookie(value);
} else if (name == kFrontendConnectedFeatureName && !inspectorController()->hasFrontend()) {
inspectorController()->injectedScriptHost()->setInjectedScriptSource(value);
- frontendLoaded();
+ connectFrontend(true);
}
}
@@ -273,19 +263,19 @@ void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled)
InspectorController* ic = inspectorController();
if (enabled) {
if (!ic->hasFrontend())
- frontendLoaded();
+ connectFrontend(true);
m_resourceTrackingWasEnabled = ic->resourceTrackingEnabled();
ic->startTimelineProfiler();
if (!m_resourceTrackingWasEnabled) {
// TODO(knorton): Introduce some kind of agents dependency here so that
// user could turn off resource tracking while apu agent is on.
- ic->enableResourceTracking(false, false);
+ ic->setResourceTrackingEnabled(true);
}
m_debuggerAgentImpl->setAutoContinueOnException(true);
} else {
ic->stopTimelineProfiler();
if (!m_resourceTrackingWasEnabled)
- ic->disableResourceTracking(false);
+ ic->setResourceTrackingEnabled(false);
m_resourceTrackingWasEnabled = false;
}
m_client->runtimePropertyChanged(
@@ -293,6 +283,16 @@ void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled)
enabled ? String("true") : String("false"));
}
+void WebDevToolsAgentImpl::connectFrontend(bool afterNavigation)
+{
+ if (afterNavigation)
+ inspectorController()->reuseFrontend();
+ else
+ inspectorController()->connectFrontend();
+ // We know that by this time injected script has already been pushed to the backend.
+ m_client->runtimePropertyChanged(kFrontendConnectedFeatureName, inspectorController()->injectedScriptHost()->injectedScriptSource());
+}
+
WebCore::InspectorController* WebDevToolsAgentImpl::inspectorController()
{
if (Page* page = m_webViewImpl->page())
@@ -336,7 +336,7 @@ void WebDevToolsAgentImpl::didReceiveResponse(unsigned long resourceId, const We
void WebDevToolsAgentImpl::didFinishLoading(unsigned long resourceId)
{
if (InspectorController* ic = inspectorController())
- ic->didFinishLoading(resourceId);
+ ic->didFinishLoading(resourceId, 0);
}
void WebDevToolsAgentImpl::didFailLoading(unsigned long resourceId, const WebURLError& error)
@@ -402,24 +402,9 @@ bool WebDevToolsAgentImpl::sendMessageToFrontend(const WTF::String& message)
return true;
}
-void WebDevToolsAgentImpl::resourceTrackingWasEnabled()
-{
- m_client->runtimePropertyChanged(kResourceTrackingFeatureName, "true");
-}
-
-void WebDevToolsAgentImpl::resourceTrackingWasDisabled()
-{
- m_client->runtimePropertyChanged(kResourceTrackingFeatureName, "false");
-}
-
-void WebDevToolsAgentImpl::timelineProfilerWasStarted()
-{
- m_client->runtimePropertyChanged(kTimelineFeatureName, "true");
-}
-
-void WebDevToolsAgentImpl::timelineProfilerWasStopped()
+void WebDevToolsAgentImpl::updateInspectorStateCookie(const WTF::String& state)
{
- m_client->runtimePropertyChanged(kTimelineFeatureName, "false");
+ m_client->runtimePropertyChanged(kInspectorStateFeatureName, state);
}
void WebDevToolsAgentImpl::evaluateInWebInspector(long callId, const WebString& script)
diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.h b/WebKit/chromium/src/WebDevToolsAgentImpl.h
index 36cafcf..47c4ccf 100644
--- a/WebKit/chromium/src/WebDevToolsAgentImpl.h
+++ b/WebKit/chromium/src/WebDevToolsAgentImpl.h
@@ -93,16 +93,14 @@ public:
virtual void hideHighlight();
virtual void populateSetting(const WTF::String& key, WTF::String* value);
virtual void storeSetting(const WTF::String& key, const WTF::String& value);
- virtual void resourceTrackingWasEnabled();
- virtual void resourceTrackingWasDisabled();
- virtual void timelineProfilerWasStarted();
- virtual void timelineProfilerWasStopped();
+ virtual void updateInspectorStateCookie(const WTF::String&);
virtual bool sendMessageToFrontend(const WTF::String&);
int hostId() { return m_hostId; }
private:
void setApuAgentEnabled(bool enabled);
+ void connectFrontend(bool afterNavigation);
WebCore::InspectorController* inspectorController();
diff --git a/WebKit/chromium/src/WebDeviceOrientationClientMock.cpp b/WebKit/chromium/src/WebDeviceOrientationClientMock.cpp
index 820c970..8a75ca1 100644
--- a/WebKit/chromium/src/WebDeviceOrientationClientMock.cpp
+++ b/WebKit/chromium/src/WebDeviceOrientationClientMock.cpp
@@ -32,6 +32,11 @@
namespace WebKit {
+WebDeviceOrientationClientMock* WebDeviceOrientationClientMock::create()
+{
+ return new WebDeviceOrientationClientMock();
+}
+
void WebDeviceOrientationClientMock::setController(WebDeviceOrientationController* controller)
{
m_clientMock->setController(controller->controller());
diff --git a/WebKit/chromium/src/WebFormElement.cpp b/WebKit/chromium/src/WebFormElement.cpp
index 9c77732..7a01053 100644
--- a/WebKit/chromium/src/WebFormElement.cpp
+++ b/WebKit/chromium/src/WebFormElement.cpp
@@ -68,7 +68,7 @@ WebString WebFormElement::method() const
bool WebFormElement::wasUserSubmitted() const
{
- return constUnwrap<HTMLFormElement>()->submissionTrigger() == NotSubmittedByJavaScript;
+ return constUnwrap<HTMLFormElement>()->wasUserSubmitted();
}
void WebFormElement::submit()
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index a2d6a46..2d42f4b 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -1012,22 +1012,9 @@ void WebFrameImpl::dispatchWillSendRequest(WebURLRequest& request)
0, 0, request.toMutableResourceRequest(), response);
}
-void WebFrameImpl::commitDocumentData(const char* data, size_t dataLen)
+void WebFrameImpl::commitDocumentData(const char* data, size_t length)
{
- DocumentLoader* documentLoader = m_frame->loader()->documentLoader();
-
- // Set the text encoding. This calls begin() for us. It is safe to call
- // this multiple times (Mac does: page/mac/WebCoreFrameBridge.mm).
- bool userChosen = true;
- String encoding = documentLoader->overrideEncoding();
- if (encoding.isNull()) {
- userChosen = false;
- encoding = documentLoader->response().textEncodingName();
- }
- m_frame->loader()->writer()->setEncoding(encoding, userChosen);
-
- // NOTE: mac only does this if there is a document
- m_frame->loader()->addData(data, dataLen);
+ m_frame->loader()->documentLoader()->commitData(data, length);
}
unsigned WebFrameImpl::unloadListenerCount() const
@@ -1229,7 +1216,7 @@ void WebFrameImpl::selectWordAroundPosition(Frame* frame, VisiblePosition pos)
VisibleSelection selection(pos);
selection.expandUsingGranularity(WordGranularity);
- if (frame->shouldChangeSelection(selection)) {
+ if (frame->selection()->shouldChangeSelection(selection)) {
TextGranularity granularity = selection.isRange() ? WordGranularity : CharacterGranularity;
frame->selection()->setSelection(selection, granularity);
}
@@ -1713,11 +1700,18 @@ int WebFrameImpl::pageNumberForElementById(const WebString& id,
WebRect WebFrameImpl::selectionBoundsRect() const
{
if (hasSelection())
- return IntRect(frame()->selectionBounds(false));
+ return IntRect(frame()->selection()->bounds(false));
return WebRect();
}
+bool WebFrameImpl::selectionStartHasSpellingMarkerFor(int from, int length) const
+{
+ if (!m_frame)
+ return false;
+ return m_frame->editor()->selectionStartHasSpellingMarkerFor(from, length);
+}
+
// WebFrameImpl public ---------------------------------------------------------
PassRefPtr<WebFrameImpl> WebFrameImpl::create(WebFrameClient* client)
diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h
index 14217fa..25e7004 100644
--- a/WebKit/chromium/src/WebFrameImpl.h
+++ b/WebKit/chromium/src/WebFrameImpl.h
@@ -182,6 +182,8 @@ public:
float pageHeightInPixels) const;
virtual WebRect selectionBoundsRect() const;
+ virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const;
+
static PassRefPtr<WebFrameImpl> create(WebFrameClient* client);
~WebFrameImpl();
diff --git a/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp
index bbb7162..bbc852f 100644
--- a/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp
+++ b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp
@@ -79,13 +79,15 @@ public:
virtual void setIsAllowed(bool allowed);
virtual void setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp);
virtual void setLastError(int errorCode, const WebString& message);
- virtual void onWebGeolocationServiceDestroyed();
+ virtual void didDestroyGeolocationService();
private:
- WebViewClient* getWebViewClient();
-
+ bool isAttached() const;
+ // Pointer back to the WebKit geolocation client. We obtain this via the frame's page, but need to cache it
+ // as it may still be alive after the page has detached from the frame.
+ WebGeolocationService* m_webGeolocationService;
// GeolocationServiceChromium owns us, we only have a pointer back to it.
- GeolocationServiceChromium* m_GeolocationServiceChromium;
+ GeolocationServiceChromium* m_geolocationServiceChromium;
int m_bridgeId;
};
@@ -95,49 +97,47 @@ GeolocationServiceBridge* createGeolocationServiceBridgeImpl(GeolocationServiceC
}
WebGeolocationServiceBridgeImpl::WebGeolocationServiceBridgeImpl(GeolocationServiceChromium* geolocationServiceChromium)
- : m_GeolocationServiceChromium(geolocationServiceChromium)
+ : m_webGeolocationService(0)
+ , m_geolocationServiceChromium(geolocationServiceChromium)
, m_bridgeId(0)
{
}
WebGeolocationServiceBridgeImpl::~WebGeolocationServiceBridgeImpl()
{
- WebKit::WebViewClient* webViewClient = getWebViewClient();
- // Geolocation has an OwnPtr to us, and it's destroyed after the frame has
- // been potentially disconnected. In this case, it calls stopUpdating()
- // has been called and we have already detached ourselves.
- if (!webViewClient)
- ASSERT(!m_bridgeId);
- else if (m_bridgeId)
- webViewClient->geolocationService()->detachBridge(m_bridgeId);
+ if (isAttached())
+ m_webGeolocationService->detachBridge(m_bridgeId);
}
bool WebGeolocationServiceBridgeImpl::startUpdating(PositionOptions* positionOptions)
{
attachBridgeIfNeeded();
- getWebViewClient()->geolocationService()->startUpdating(m_bridgeId, m_GeolocationServiceChromium->frame()->document()->url(), positionOptions->enableHighAccuracy());
+ if (!isAttached())
+ return false;
+ m_webGeolocationService->startUpdating(m_bridgeId, m_geolocationServiceChromium->frame()->document()->url(), positionOptions->enableHighAccuracy());
return true;
}
void WebGeolocationServiceBridgeImpl::stopUpdating()
{
- WebViewClient* webViewClient = getWebViewClient();
- if (m_bridgeId && webViewClient) {
- WebGeolocationService* geolocationService = webViewClient->geolocationService();
- geolocationService->stopUpdating(m_bridgeId);
- geolocationService->detachBridge(m_bridgeId);
+ if (isAttached()) {
+ m_webGeolocationService->stopUpdating(m_bridgeId);
+ m_webGeolocationService->detachBridge(m_bridgeId);
+ m_bridgeId = 0;
+ m_webGeolocationService = 0;
}
- m_bridgeId = 0;
}
void WebGeolocationServiceBridgeImpl::suspend()
{
- getWebViewClient()->geolocationService()->suspend(m_bridgeId);
+ if (isAttached())
+ m_webGeolocationService->suspend(m_bridgeId);
}
void WebGeolocationServiceBridgeImpl::resume()
{
- getWebViewClient()->geolocationService()->resume(m_bridgeId);
+ if (isAttached())
+ m_webGeolocationService->resume(m_bridgeId);
}
int WebGeolocationServiceBridgeImpl::getBridgeId() const
@@ -147,38 +147,54 @@ int WebGeolocationServiceBridgeImpl::getBridgeId() const
void WebGeolocationServiceBridgeImpl::attachBridgeIfNeeded()
{
- if (!m_bridgeId)
- m_bridgeId = getWebViewClient()->geolocationService()->attachBridge(this);
+ if (isAttached())
+ return;
+ // Lazy attach to the geolocation service of the associated page if there is one.
+ Frame* frame = m_geolocationServiceChromium->frame();
+ if (!frame || !frame->page())
+ return;
+ WebKit::ChromeClientImpl* chromeClientImpl = static_cast<WebKit::ChromeClientImpl*>(frame->page()->chrome()->client());
+ WebKit::WebViewClient* webViewClient = chromeClientImpl->webView()->client();
+ m_webGeolocationService = webViewClient->geolocationService();
+ ASSERT(m_webGeolocationService);
+ m_bridgeId = m_webGeolocationService->attachBridge(this);
+ if (!m_bridgeId) {
+ // Attach failed. Release association with this service.
+ m_webGeolocationService = 0;
+ }
}
void WebGeolocationServiceBridgeImpl::setIsAllowed(bool allowed)
{
- m_GeolocationServiceChromium->setIsAllowed(allowed);
+ m_geolocationServiceChromium->setIsAllowed(allowed);
}
void WebGeolocationServiceBridgeImpl::setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp)
{
RefPtr<Geoposition> geoposition = Geoposition::create(Coordinates::create(latitude, longitude, providesAltitude, altitude, accuracy, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed), timestamp);
- m_GeolocationServiceChromium->setLastPosition(geoposition);
+ m_geolocationServiceChromium->setLastPosition(geoposition);
}
void WebGeolocationServiceBridgeImpl::setLastError(int errorCode, const WebString& message)
{
- m_GeolocationServiceChromium->setLastError(errorCode, message);
+ m_geolocationServiceChromium->setLastError(errorCode, message);
}
-WebViewClient* WebGeolocationServiceBridgeImpl::getWebViewClient()
+void WebGeolocationServiceBridgeImpl::didDestroyGeolocationService()
{
- Frame* frame = m_GeolocationServiceChromium->frame();
- if (!frame || !frame->page())
- return 0;
- WebKit::ChromeClientImpl* chromeClientImpl = static_cast<WebKit::ChromeClientImpl*>(frame->page()->chrome()->client());
- WebKit::WebViewClient* webViewClient = chromeClientImpl->webView()->client();
- return webViewClient;
+ m_bridgeId = 0;
+ m_webGeolocationService = 0;
}
-void WebGeolocationServiceBridgeImpl::onWebGeolocationServiceDestroyed()
+bool WebGeolocationServiceBridgeImpl::isAttached() const
{
+ // Test the class invariant.
+ if (m_webGeolocationService)
+ ASSERT(m_bridgeId);
+ else
+ ASSERT(!m_bridgeId);
+
+ return m_webGeolocationService;
}
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebGeolocationServiceMock.cpp b/WebKit/chromium/src/WebGeolocationServiceMock.cpp
index 2a10c96..e149cf1 100644
--- a/WebKit/chromium/src/WebGeolocationServiceMock.cpp
+++ b/WebKit/chromium/src/WebGeolocationServiceMock.cpp
@@ -34,9 +34,11 @@
#include "GeolocationService.h"
#include "GeolocationServiceChromium.h"
#include "GeolocationServiceMock.h"
+#include "WebGeolocationServiceBridge.h"
#include "WebString.h"
#include <wtf/CurrentTime.h>
#include <wtf/HashMap.h>
+#include <wtf/Vector.h>
#if ENABLE(GEOLOCATION)
@@ -51,6 +53,7 @@ using WebCore::Geoposition;
using WebCore::PositionError;
using WebCore::PositionOptions;
using WTF::String;
+using WTF::Vector;
namespace WebCore {
class GeolocationServiceChromiumMock : public GeolocationServiceChromium, public GeolocationServiceClient {
@@ -124,17 +127,34 @@ namespace WebKit {
class WebGeolocationServiceMockImpl : public WebGeolocationServiceMock {
public:
- virtual ~WebGeolocationServiceMockImpl() { }
+ WebGeolocationServiceMockImpl();
+ virtual ~WebGeolocationServiceMockImpl();
+ static void setMockGeolocationPermission(bool allowed);
+
+ // WebGeolocationService
virtual void requestPermissionForFrame(int bridgeId, const WebURL& url);
virtual int attachBridge(WebGeolocationServiceBridge*);
virtual void detachBridge(int bridgeId);
private:
+ void notifyPendingPermissions();
+
typedef HashMap<int, WebGeolocationServiceBridge*> IdToBridgeMap;
IdToBridgeMap m_idToBridgeMap;
+ Vector<int> m_pendingPermissionRequests;
+
+ // In addition to the singleton instance pointer, we need to keep the setMockGeolocationPermission() state
+ // as a static (not object members) as this call may come in before the service has been created.
+ static enum PermissionState {
+ PermissionStateUnset,
+ PermissionStateAllowed,
+ PermissionStateDenied,
+ } s_permissionState;
+ static WebGeolocationServiceMockImpl* s_instance;
};
-bool WebGeolocationServiceMock::s_mockGeolocationPermission = false;
+WebGeolocationServiceMockImpl::PermissionState WebGeolocationServiceMockImpl::s_permissionState = WebGeolocationServiceMockImpl::PermissionStateUnset;
+WebGeolocationServiceMockImpl* WebGeolocationServiceMockImpl::s_instance = 0;
WebGeolocationServiceMock* WebGeolocationServiceMock::createWebGeolocationServiceMock()
{
@@ -143,7 +163,7 @@ WebGeolocationServiceMock* WebGeolocationServiceMock::createWebGeolocationServic
void WebGeolocationServiceMock::setMockGeolocationPermission(bool allowed)
{
- s_mockGeolocationPermission = allowed;
+ WebGeolocationServiceMockImpl::setMockGeolocationPermission(allowed);
}
void WebGeolocationServiceMock::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
@@ -160,12 +180,35 @@ void WebGeolocationServiceMock::setMockGeolocationError(int errorCode, const Web
GeolocationServiceMock::setError(positionError);
}
+WebGeolocationServiceMockImpl::WebGeolocationServiceMockImpl()
+{
+ ASSERT(!s_instance);
+ s_instance = this;
+}
+
+WebGeolocationServiceMockImpl::~WebGeolocationServiceMockImpl()
+{
+ ASSERT(this == s_instance);
+ s_instance = 0;
+ // Reset the permission state, so any future service instance (e.g. running
+ // multiple tests in a single DRT run) will see a clean call sequence.
+ s_permissionState = PermissionStateUnset;
+ for (IdToBridgeMap::iterator it = m_idToBridgeMap.begin(); it != m_idToBridgeMap.end(); ++it)
+ it->second->didDestroyGeolocationService();
+}
+
+void WebGeolocationServiceMockImpl::setMockGeolocationPermission(bool allowed)
+{
+ s_permissionState = allowed ? PermissionStateAllowed : PermissionStateDenied;
+ if (s_instance)
+ s_instance->notifyPendingPermissions();
+}
+
void WebGeolocationServiceMockImpl::requestPermissionForFrame(int bridgeId, const WebURL& url)
{
- IdToBridgeMap::iterator iter = m_idToBridgeMap.find(bridgeId);
- if (iter == m_idToBridgeMap.end())
- return;
- iter->second->setIsAllowed(s_mockGeolocationPermission);
+ m_pendingPermissionRequests.append(bridgeId);
+ if (s_permissionState != PermissionStateUnset)
+ notifyPendingPermissions();
}
int WebGeolocationServiceMockImpl::attachBridge(WebGeolocationServiceBridge* bridge)
@@ -183,6 +226,19 @@ void WebGeolocationServiceMockImpl::detachBridge(int bridgeId)
m_idToBridgeMap.remove(bridgeId);
}
+void WebGeolocationServiceMockImpl::notifyPendingPermissions()
+{
+ ASSERT(s_permissionState == PermissionStateAllowed || s_permissionState == PermissionStateDenied);
+ Vector<int> pendingPermissionRequests;
+ pendingPermissionRequests.swap(m_pendingPermissionRequests);
+ for (Vector<int>::const_iterator it = pendingPermissionRequests.begin(); it != pendingPermissionRequests.end(); ++it) {
+ ASSERT(*it > 0);
+ IdToBridgeMap::iterator iter = m_idToBridgeMap.find(*it);
+ if (iter != m_idToBridgeMap.end())
+ iter->second->setIsAllowed(s_permissionState == PermissionStateAllowed);
+ }
+}
+
} // namespace WebKit
#endif // ENABLE(GEOLOCATION)
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
index 6e1adca..24dcf9a 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
@@ -97,11 +97,16 @@ WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl()
}
}
-bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attributes attributes, WebView* webView)
+bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attributes attributes, WebView* webView, bool renderDirectlyToWebView)
{
+ if (renderDirectlyToWebView) {
+ // This mode isn't supported with the in-process implementation yet. (FIXME)
+ return false;
+ }
+
if (!gfx::GLContext::InitializeOneOff())
return false;
-
+
m_glContext = WTF::adoptPtr(gfx::GLContext::CreateOffscreenGLContext(0));
if (!m_glContext)
return false;
@@ -114,6 +119,11 @@ bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attribute
return true;
}
+bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attributes attributes, WebView* webView)
+{
+ return initialize(attributes, webView, false);
+}
+
void WebGraphicsContext3DDefaultImpl::validateAttributes()
{
const char* extensions = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
@@ -463,6 +473,40 @@ bool WebGraphicsContext3DDefaultImpl::supportsBGRA()
return false;
}
+bool WebGraphicsContext3DDefaultImpl::supportsMapSubCHROMIUM()
+{
+ // We don't claim support for this extension at this time
+ return false;
+}
+
+void* WebGraphicsContext3DDefaultImpl::mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access)
+{
+ return 0;
+}
+
+void WebGraphicsContext3DDefaultImpl::unmapBufferSubDataCHROMIUM(const void* mem)
+{
+}
+
+void* WebGraphicsContext3DDefaultImpl::mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access)
+{
+ return 0;
+}
+
+void WebGraphicsContext3DDefaultImpl::unmapTexSubImage2DCHROMIUM(const void* mem)
+{
+}
+
+bool WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM()
+{
+ // We don't claim support for this extension at this time
+ return false;
+}
+
+void WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM(unsigned id, unsigned id2)
+{
+}
+
// Helper macros to reduce the amount of code.
#define DELEGATE_TO_GL(name, glname) \
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
index a4c5b4b..5bf439a 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
@@ -59,6 +59,8 @@ public:
//----------------------------------------------------------------------
// WebGraphicsContext3D methods
+ virtual bool initialize(WebGraphicsContext3D::Attributes attributes, WebView*, bool);
+ // FIXME: remove once compositor is switched over to GraphicsContext3D.
virtual bool initialize(WebGraphicsContext3D::Attributes attributes, WebView*);
virtual bool makeContextCurrent();
@@ -80,6 +82,13 @@ public:
virtual void synthesizeGLError(unsigned long error);
virtual bool supportsBGRA();
+ virtual bool supportsMapSubCHROMIUM();
+ virtual void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access);
+ virtual void unmapBufferSubDataCHROMIUM(const void*);
+ virtual void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access);
+ virtual void unmapTexSubImage2DCHROMIUM(const void*);
+ virtual bool supportsCopyTextureToParentTextureCHROMIUM();
+ virtual void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture);
virtual void activeTexture(unsigned long texture);
virtual void attachShader(WebGLId program, WebGLId shader);
diff --git a/WebKit/chromium/src/WebHTTPBody.cpp b/WebKit/chromium/src/WebHTTPBody.cpp
index e54b4e5..93b94c2 100644
--- a/WebKit/chromium/src/WebHTTPBody.cpp
+++ b/WebKit/chromium/src/WebHTTPBody.cpp
@@ -78,7 +78,9 @@ bool WebHTTPBody::elementAt(size_t index, Element& result) const
result.filePath.reset();
result.fileStart = 0;
result.fileLength = 0;
+ // FIXME: remove this line once all users of Element have been switched to use 'modificationTime'.
result.fileInfo.modificationTime = 0.0;
+ result.modificationTime = 0.0;
result.blobURL = KURL();
switch (element.m_type) {
@@ -92,7 +94,9 @@ bool WebHTTPBody::elementAt(size_t index, Element& result) const
#if ENABLE(BLOB)
result.fileStart = element.m_fileStart;
result.fileLength = element.m_fileLength;
+ // FIXME: remove this line once all users of Element have been switched to use 'modificationTime'.
result.fileInfo.modificationTime = element.m_expectedFileModificationTime;
+ result.modificationTime = element.m_expectedFileModificationTime;
#endif
break;
#if ENABLE(BLOB)
@@ -123,14 +127,20 @@ void WebHTTPBody::appendFile(const WebString& filePath)
m_private->appendFile(filePath);
}
-void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart, long long fileLength, const WebFileInfo& fileInfo)
+void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart, long long fileLength, double modificationTime)
{
#if ENABLE(BLOB)
ensureMutable();
- m_private->appendFileRange(filePath, fileStart, fileLength, fileInfo.modificationTime);
+ m_private->appendFileRange(filePath, fileStart, fileLength, modificationTime);
#endif
}
+// FIXME: Remove this method once all callers have been switched to use the method above.
+void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart, long long fileLength, const WebFileInfo& fileInfo)
+{
+ return appendFileRange(filePath, fileStart, fileLength, fileInfo.modificationTime);
+}
+
void WebHTTPBody::appendBlob(const WebURL& blobURL)
{
#if ENABLE(BLOB)
diff --git a/WebKit/chromium/src/WebIDBCursorImpl.cpp b/WebKit/chromium/src/WebIDBCursorImpl.cpp
index b74d680..6a1053e 100644
--- a/WebKit/chromium/src/WebIDBCursorImpl.cpp
+++ b/WebKit/chromium/src/WebIDBCursorImpl.cpp
@@ -55,9 +55,19 @@ WebIDBKey WebIDBCursorImpl::key() const
return WebIDBKey(m_idbCursorBackend->key());
}
-WebSerializedScriptValue WebIDBCursorImpl::value() const
+void WebIDBCursorImpl::value(WebSerializedScriptValue& serializedScriptValue, WebIDBKey& idbKey) const
{
- return m_idbCursorBackend->value();
+ // Verify we're starting off with blank slates.
+ ASSERT(serializedScriptValue.isNull());
+ ASSERT(idbKey.type() == WebIDBKey::InvalidType);
+
+ RefPtr<IDBAny> any = m_idbCursorBackend->value();
+ if (any->type() == IDBAny::SerializedScriptValueType)
+ serializedScriptValue.assign(any->serializedScriptValue());
+ else if (any->type() == IDBAny::IDBKeyType)
+ idbKey.assign(any->idbKey());
+ else
+ ASSERT_NOT_REACHED();
}
void WebIDBCursorImpl::update(const WebSerializedScriptValue& value, WebIDBCallbacks* callbacks)
diff --git a/WebKit/chromium/src/WebIDBCursorImpl.h b/WebKit/chromium/src/WebIDBCursorImpl.h
index 565e86a..5fb9e1c 100644
--- a/WebKit/chromium/src/WebIDBCursorImpl.h
+++ b/WebKit/chromium/src/WebIDBCursorImpl.h
@@ -43,7 +43,7 @@ public:
virtual unsigned short direction() const;
virtual WebIDBKey key() const;
- virtual WebSerializedScriptValue value() const;
+ virtual void value(WebSerializedScriptValue&, WebIDBKey&) const;
virtual void update(const WebSerializedScriptValue&, WebIDBCallbacks*);
virtual void continueFunction(const WebIDBKey&, WebIDBCallbacks*);
virtual void remove(WebIDBCallbacks*);
diff --git a/WebKit/chromium/src/WebIDBFactoryImpl.cpp b/WebKit/chromium/src/WebIDBFactoryImpl.cpp
index 564be36..3c8d459 100755
--- a/WebKit/chromium/src/WebIDBFactoryImpl.cpp
+++ b/WebKit/chromium/src/WebIDBFactoryImpl.cpp
@@ -58,9 +58,9 @@ WebIDBFactoryImpl::~WebIDBFactoryImpl()
{
}
-void WebIDBFactoryImpl::open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*)
+void WebIDBFactoryImpl::open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir)
{
- m_idbFactoryBackend->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0);
+ m_idbFactoryBackend->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0, dataDir);
}
void WebIDBFactoryImpl::abortPendingTransactions(const WebVector<int>& pendingIDs)
diff --git a/WebKit/chromium/src/WebIDBFactoryImpl.h b/WebKit/chromium/src/WebIDBFactoryImpl.h
index aeab478..4dc0a10 100755
--- a/WebKit/chromium/src/WebIDBFactoryImpl.h
+++ b/WebKit/chromium/src/WebIDBFactoryImpl.h
@@ -42,7 +42,7 @@ public:
WebIDBFactoryImpl();
virtual ~WebIDBFactoryImpl();
- virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*);
+ virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
virtual void abortPendingTransactions(const WebVector<int>& pendingIDs);
private:
diff --git a/WebKit/chromium/src/WebIDBIndexImpl.cpp b/WebKit/chromium/src/WebIDBIndexImpl.cpp
index 777ec32..c049aac 100644
--- a/WebKit/chromium/src/WebIDBIndexImpl.cpp
+++ b/WebKit/chromium/src/WebIDBIndexImpl.cpp
@@ -26,7 +26,12 @@
#include "config.h"
#include "WebIDBIndexImpl.h"
+#include "IDBCallbacksProxy.h"
#include "IDBIndex.h"
+#include "IDBKeyRange.h"
+#include "WebIDBCallbacks.h"
+#include "WebIDBKey.h"
+#include "WebIDBKeyRange.h"
#if ENABLE(INDEXED_DATABASE)
@@ -48,6 +53,11 @@ WebString WebIDBIndexImpl::name() const
return m_backend->name();
}
+WebString WebIDBIndexImpl::storeName() const
+{
+ return m_backend->storeName();
+}
+
WebString WebIDBIndexImpl::keyPath() const
{
return m_backend->keyPath();
@@ -58,6 +68,26 @@ bool WebIDBIndexImpl::unique() const
return m_backend->unique();
}
+void WebIDBIndexImpl::openCursor(const WebIDBKeyRange& keyRange, unsigned short direction, WebIDBCallbacks* callbacks)
+{
+ m_backend->openCursor(keyRange, direction, IDBCallbacksProxy::create(callbacks));
+}
+
+void WebIDBIndexImpl::openObjectCursor(const WebIDBKeyRange& keyRange, unsigned short direction, WebIDBCallbacks* callbacks)
+{
+ m_backend->openObjectCursor(keyRange, direction, IDBCallbacksProxy::create(callbacks));
+}
+
+void WebIDBIndexImpl::getObject(const WebIDBKey& keyRange, WebIDBCallbacks* callbacks)
+{
+ m_backend->getObject(keyRange, IDBCallbacksProxy::create(callbacks));
+}
+
+void WebIDBIndexImpl::get(const WebIDBKey& keyRange, WebIDBCallbacks* callbacks)
+{
+ m_backend->get(keyRange, IDBCallbacksProxy::create(callbacks));
+}
+
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebKit/chromium/src/WebIDBIndexImpl.h b/WebKit/chromium/src/WebIDBIndexImpl.h
index 73f3819..2108001 100644
--- a/WebKit/chromium/src/WebIDBIndexImpl.h
+++ b/WebKit/chromium/src/WebIDBIndexImpl.h
@@ -42,9 +42,15 @@ public:
virtual ~WebIDBIndexImpl();
virtual WebString name() const;
+ virtual WebString storeName() const;
virtual WebString keyPath() const;
virtual bool unique() const;
+ virtual void openObjectCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*);
+ virtual void openCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*);
+ virtual void getObject(const WebIDBKey&, WebIDBCallbacks*);
+ virtual void get(const WebIDBKey&, WebIDBCallbacks*);
+
private:
WTF::RefPtr<WebCore::IDBIndexBackendInterface> m_backend;
};
diff --git a/WebKit/chromium/src/WebInputElement.cpp b/WebKit/chromium/src/WebInputElement.cpp
index 7bf6407..25d484c 100644
--- a/WebKit/chromium/src/WebInputElement.cpp
+++ b/WebKit/chromium/src/WebInputElement.cpp
@@ -40,6 +40,26 @@ using namespace WebCore;
namespace WebKit {
+bool WebInputElement::isTextField() const
+{
+ return constUnwrap<HTMLInputElement>()->isTextField();
+}
+
+bool WebInputElement::isText() const
+{
+ return constUnwrap<HTMLInputElement>()->isText();
+}
+
+bool WebInputElement::isPasswordField() const
+{
+ return constUnwrap<HTMLInputElement>()->isPasswordField();
+}
+
+bool WebInputElement::isImageButton() const
+{
+ return constUnwrap<HTMLInputElement>()->isImageButton();
+}
+
bool WebInputElement::autoComplete() const
{
return constUnwrap<HTMLInputElement>()->autoComplete();
@@ -57,7 +77,7 @@ bool WebInputElement::isEnabledFormControl() const
WebInputElement::InputType WebInputElement::inputType() const
{
- return static_cast<InputType>(constUnwrap<HTMLInputElement>()->inputType());
+ return static_cast<InputType>(constUnwrap<HTMLInputElement>()->deprecatedInputType());
}
int WebInputElement::maxLength() const
diff --git a/WebKit/chromium/src/WebKit.cpp b/WebKit/chromium/src/WebKit.cpp
index f3336ea..cadcb6c 100644
--- a/WebKit/chromium/src/WebKit.cpp
+++ b/WebKit/chromium/src/WebKit.cpp
@@ -103,11 +103,6 @@ bool layoutTestMode()
return s_layoutTestMode;
}
-bool areLayoutTestImagesOpaque()
-{
- return true;
-}
-
void enableLogChannel(const char* name)
{
WTFLogChannel* channel = WebCore::getChannelFromName(name);
diff --git a/WebKit/chromium/src/WebPasswordFormUtils.cpp b/WebKit/chromium/src/WebPasswordFormUtils.cpp
index e5d5411..6968e1a 100644
--- a/WebKit/chromium/src/WebPasswordFormUtils.cpp
+++ b/WebKit/chromium/src/WebPasswordFormUtils.cpp
@@ -79,8 +79,8 @@ void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields)
continue;
if ((fields->passwords.size() < maxPasswords)
- && (inputElement->inputType() == HTMLInputElement::PASSWORD)
- && (inputElement->autoComplete())) {
+ && inputElement->isPasswordField()
+ && inputElement->autoComplete()) {
if (fields->passwords.isEmpty())
firstPasswordIndex = i;
fields->passwords.append(inputElement);
@@ -98,7 +98,9 @@ void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields)
if (!inputElement->isEnabledFormControl())
continue;
- if ((inputElement->inputType() == HTMLInputElement::TEXT)
+ // FIXME: This needs to use a function other than deprecatedInputType.
+ // Does this really want to special-case TEXT, and not other text-field-like input elements?
+ if ((inputElement->deprecatedInputType() == HTMLInputElement::TEXT)
&& (inputElement->autoComplete())) {
fields->userName = inputElement;
break;
diff --git a/WebKit/chromium/src/WebPopupMenuImpl.cpp b/WebKit/chromium/src/WebPopupMenuImpl.cpp
index 75d6cc1..085a157 100644
--- a/WebKit/chromium/src/WebPopupMenuImpl.cpp
+++ b/WebKit/chromium/src/WebPopupMenuImpl.cpp
@@ -174,6 +174,16 @@ void WebPopupMenuImpl::paint(WebCanvas* canvas, const WebRect& rect)
}
}
+void WebPopupMenuImpl::themeChanged()
+{
+ notImplemented();
+}
+
+void WebPopupMenuImpl::composite(bool finish)
+{
+ notImplemented();
+}
+
bool WebPopupMenuImpl::handleInputEvent(const WebInputEvent& inputEvent)
{
if (!m_widget)
diff --git a/WebKit/chromium/src/WebPopupMenuImpl.h b/WebKit/chromium/src/WebPopupMenuImpl.h
index edbb4ab..221ba03 100644
--- a/WebKit/chromium/src/WebPopupMenuImpl.h
+++ b/WebKit/chromium/src/WebPopupMenuImpl.h
@@ -63,6 +63,8 @@ public:
virtual void resize(const WebSize&);
virtual void layout();
virtual void paint(WebCanvas* canvas, const WebRect& rect);
+ virtual void themeChanged();
+ virtual void composite(bool finish);
virtual bool handleInputEvent(const WebInputEvent&);
virtual void mouseCaptureLost();
virtual void setFocus(bool enable);
diff --git a/WebKit/chromium/src/WebSearchableFormData.cpp b/WebKit/chromium/src/WebSearchableFormData.cpp
index 1864514..5fc51ca 100644
--- a/WebKit/chromium/src/WebSearchableFormData.cpp
+++ b/WebKit/chromium/src/WebSearchableFormData.cpp
@@ -131,7 +131,7 @@ bool IsInDefaultState(const HTMLFormControlElement* formElement)
{
if (formElement->hasTagName(HTMLNames::inputTag)) {
const HTMLInputElement* inputElement = static_cast<const HTMLInputElement*>(formElement);
- if (inputElement->inputType() == HTMLInputElement::CHECKBOX || inputElement->inputType() == HTMLInputElement::RADIO)
+ if (inputElement->isCheckbox() || inputElement->isRadioButton())
return inputElement->checked() == inputElement->defaultChecked();
} else if (formElement->hasTagName(HTMLNames::selectTag))
return IsSelectInDefaultState(static_cast<const HTMLSelectElement*>(formElement));
@@ -166,19 +166,24 @@ bool HasSuitableTextElement(const HTMLFormElement* form, Vector<char>* encodedSt
bool isTextElement = false;
if (formElement->hasTagName(HTMLNames::inputTag)) {
- switch (static_cast<const HTMLInputElement*>(formElement)->inputType()) {
+ if (static_cast<const HTMLInputElement*>(formElement)->isFileUpload()) {
+ // Too big, don't try to index this.
+ return 0;
+ }
+
+ if (static_cast<const HTMLInputElement*>(formElement)->isPasswordField()) {
+ // Don't store passwords! This is most likely an https anyway.
+ return 0;
+ }
+
+ // FIXME: This needs to use a function on HTMLInputElement other than deprecatedInputType.
+ // Also, it's not clear why TEXT should be handled differently than, say, SEARCH.
+ switch (static_cast<const HTMLInputElement*>(formElement)->deprecatedInputType()) {
case HTMLInputElement::TEXT:
case HTMLInputElement::ISINDEX:
isTextElement = true;
break;
- case HTMLInputElement::PASSWORD:
- // Don't store passwords! This is most likely an https anyway.
- // Fall through.
- case HTMLInputElement::FILE:
- // Too big, don't try to index this.
- return 0;
default:
- // All other input types are indexable.
break;
}
}
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 137bf06..a1c6578 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -34,6 +34,7 @@
#include "AutoFillPopupMenuClient.h"
#include "AXObjectCache.h"
#include "Chrome.h"
+#include "ColorSpace.h"
#include "CompositionUnderlineVectorBuilder.h"
#include "ContextMenu.h"
#include "ContextMenuController.h"
@@ -55,17 +56,17 @@
#include "FrameLoader.h"
#include "FrameTree.h"
#include "FrameView.h"
-#include "GLES2Context.h"
-#include "GLES2ContextInternal.h"
#include "GraphicsContext.h"
#include "GraphicsContext3D.h"
+#include "GraphicsContext3DInternal.h"
#include "HTMLInputElement.h"
#include "HTMLMediaElement.h"
#include "HitTestResult.h"
#include "HTMLNames.h"
#include "Image.h"
+#include "ImageBuffer.h"
+#include "ImageData.h"
#include "InspectorController.h"
-#include "IntRect.h"
#include "KeyboardCodes.h"
#include "KeyboardEvent.h"
#include "MIMETypeRegistry.h"
@@ -115,7 +116,11 @@
#include "WebString.h"
#include "WebVector.h"
#include "WebViewClient.h"
-#include "wtf/OwnPtr.h"
+#include <wtf/RefPtr.h>
+
+#if PLATFORM(CG)
+#include <CoreGraphics/CGContext.h>
+#endif
#if OS(WINDOWS)
#include "RenderThemeChromiumWin.h"
@@ -245,6 +250,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools
, m_newNavigationLoader(0)
#endif
, m_zoomLevel(0)
+ , m_zoomTextOnly(false)
, m_contextMenuAllowed(false)
, m_doingDragAndDrop(false)
, m_ignoreInputEvents(false)
@@ -270,7 +276,6 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools
#if ENABLE(INPUT_SPEECH)
, m_speechInputClient(client)
#endif
- , m_gles2Context(0)
, m_deviceOrientationClientProxy(new DeviceOrientationClientProxy(client ? client->deviceOrientationClient() : 0))
{
// WebKit/win/WebView.cpp does the same thing, except they call the
@@ -912,13 +917,18 @@ void WebViewImpl::resize(const WebSize& newSize)
if (m_client) {
WebRect damagedRect(0, 0, m_size.width, m_size.height);
- m_client->didInvalidateRect(damagedRect);
+ if (isAcceleratedCompositingActive()) {
+#if USE(ACCELERATED_COMPOSITING)
+ invalidateRootLayerRect(damagedRect);
+#endif
+ } else
+ m_client->didInvalidateRect(damagedRect);
}
#if OS(DARWIN)
- if (m_gles2Context) {
- m_gles2Context->resizeOnscreenContent(WebSize(std::max(1, m_size.width),
- std::max(1, m_size.height)));
+ if (m_layerRenderer) {
+ m_layerRenderer->resizeOnscreenContent(WebCore::IntSize(std::max(1, m_size.width),
+ std::max(1, m_size.height)));
}
#endif
}
@@ -944,35 +954,90 @@ void WebViewImpl::layout()
}
}
-void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect)
+#if USE(ACCELERATED_COMPOSITING)
+void WebViewImpl::doPixelReadbackToCanvas(WebCanvas* canvas, const IntRect& rect)
{
+ ASSERT(rect.right() <= m_layerRenderer->rootLayerTextureSize().width()
+ && rect.bottom() <= m_layerRenderer->rootLayerTextureSize().height());
+
+#if PLATFORM(SKIA)
+ PlatformContextSkia context(canvas);
+
+ // PlatformGraphicsContext is actually a pointer to PlatformContextSkia
+ GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context));
+ int bitmapHeight = canvas->getDevice()->accessBitmap(false).height();
+#elif PLATFORM(CG)
+ GraphicsContext gc(canvas);
+ int bitmapHeight = CGBitmapContextGetHeight(reinterpret_cast<CGContextRef>(canvas));
+#else
+ notImplemented();
+#endif
+ // Compute rect to sample from inverted GPU buffer.
+ IntRect invertRect(rect.x(), bitmapHeight - rect.bottom(), rect.width(), rect.height());
+
+ OwnPtr<ImageBuffer> imageBuffer(ImageBuffer::create(rect.size()));
+ RefPtr<ImageData> imageData(ImageData::create(rect.width(), rect.height()));
+ if (imageBuffer.get() && imageData.get()) {
+ m_layerRenderer->getFramebufferPixels(imageData->data()->data()->data(), invertRect);
+ imageBuffer->putPremultipliedImageData(imageData.get(), IntRect(IntPoint(), rect.size()), IntPoint());
+ gc.save();
+ gc.translate(FloatSize(0.0f, bitmapHeight));
+ gc.scale(FloatSize(1.0f, -1.0f));
+ // Use invertRect in next line, so that transform above inverts it back to
+ // desired destination rect.
+ gc.drawImageBuffer(imageBuffer.get(), DeviceColorSpace, invertRect.location());
+ gc.restore();
+ }
+}
+#endif
+void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect)
+{
+ if (isAcceleratedCompositingActive()) {
#if USE(ACCELERATED_COMPOSITING)
- if (!isAcceleratedCompositingActive()) {
+ doComposite();
+
+ // If a canvas was passed in, we use it to grab a copy of the
+ // freshly-rendered pixels.
+ if (canvas) {
+ // Clip rect to the confines of the rootLayerTexture.
+ IntRect resizeRect(rect);
+ resizeRect.intersect(IntRect(IntPoint(), m_layerRenderer->rootLayerTextureSize()));
+ doPixelReadbackToCanvas(canvas, resizeRect);
+ }
+
+ // Temporarily present so the downstream Chromium renderwidget still renders.
+ // FIXME: remove this call once the changes to Chromium's renderwidget have landed.
+ m_layerRenderer->present();
#endif
+ } else {
WebFrameImpl* webframe = mainFrameImpl();
if (webframe)
webframe->paint(canvas, rect);
-#if USE(ACCELERATED_COMPOSITING)
- } else {
- // Draw the contents of the root layer.
- updateRootLayerContents(rect);
+ }
+}
- WebFrameImpl* webframe = mainFrameImpl();
- if (!webframe)
- return;
- FrameView* view = webframe->frameView();
- if (!view)
- return;
+void WebViewImpl::themeChanged()
+{
+ if (!page())
+ return;
+ FrameView* view = page()->mainFrame()->view();
- // The visibleRect includes scrollbars whereas the contentRect doesn't.
- IntRect visibleRect = view->visibleContentRect(true);
- IntRect contentRect = view->visibleContentRect(false);
+ WebRect damagedRect(0, 0, m_size.width, m_size.height);
+ view->invalidateRect(damagedRect);
+}
- // Ask the layer compositor to redraw all the layers.
- ASSERT(m_layerRenderer->hardwareCompositing());
- m_layerRenderer->drawLayers(rect, visibleRect, contentRect, IntPoint(view->scrollX(), view->scrollY()));
- }
+void WebViewImpl::composite(bool finish)
+{
+#if USE(ACCELERATED_COMPOSITING)
+ doComposite();
+
+ // Finish if requested.
+ if (finish)
+ m_layerRenderer->finish();
+
+ // Put result onscreen.
+ m_layerRenderer->present();
#endif
}
@@ -1474,16 +1539,23 @@ int WebViewImpl::setZoomLevel(bool textOnly, int zoomLevel)
maxTextSizeMultiplier),
minTextSizeMultiplier));
Frame* frame = mainFrameImpl()->frame();
- FrameView* view = frame->view();
- if (!view)
- return m_zoomLevel;
- if (zoomFactor != view->zoomFactor()) {
- view->setZoomFactor(zoomFactor, textOnly ? ZoomTextOnly : ZoomPage);
+
+ float oldZoomFactor = m_zoomTextOnly ? frame->textZoomFactor() : frame->pageZoomFactor();
+
+ if (textOnly)
+ frame->setPageAndTextZoomFactors(1, zoomFactor);
+ else
+ frame->setPageAndTextZoomFactors(zoomFactor, 1);
+
+ if (oldZoomFactor != zoomFactor || textOnly != m_zoomTextOnly) {
WebPluginContainerImpl* pluginContainer = WebFrameImpl::pluginContainerFromFrame(frame);
if (pluginContainer)
pluginContainer->plugin()->setZoomFactor(zoomFactor, textOnly);
- m_zoomLevel = zoomLevel;
}
+
+ m_zoomLevel = zoomLevel;
+ m_zoomTextOnly = textOnly;
+
return m_zoomLevel;
}
@@ -1904,6 +1976,11 @@ bool WebViewImpl::isActive() const
return (page() && page()->focusController()) ? page()->focusController()->isActive() : false;
}
+void WebViewImpl::setDomainRelaxationForbidden(bool forbidden, const WebString& scheme)
+{
+ SecurityOrigin::setDomainRelaxationForbiddenForURLScheme(forbidden, String(scheme));
+}
+
void WebViewImpl::setScrollbarColors(unsigned inactiveColor,
unsigned activeColor,
unsigned trackColor) {
@@ -2114,24 +2191,126 @@ bool WebViewImpl::allowsAcceleratedCompositing()
void WebViewImpl::setRootGraphicsLayer(WebCore::PlatformLayer* layer)
{
+ bool wasActive = m_isAcceleratedCompositingActive;
setIsAcceleratedCompositingActive(layer ? true : false);
if (m_layerRenderer)
m_layerRenderer->setRootLayer(layer);
+ if (wasActive != m_isAcceleratedCompositingActive) {
+ IntRect damagedRect(0, 0, m_size.width, m_size.height);
+ if (m_isAcceleratedCompositingActive)
+ invalidateRootLayerRect(damagedRect);
+ else
+ m_client->didInvalidateRect(damagedRect);
+ }
+}
+
+void WebViewImpl::setRootLayerNeedsDisplay()
+{
+ if (m_layerRenderer)
+ m_layerRenderer->setNeedsDisplay();
+ m_client->scheduleComposite();
+ // FIXME: To avoid breaking the downstream Chrome render_widget while downstream
+ // changes land, we also have to pass a 1x1 invalidate up to the client
+ {
+ WebRect damageRect(0, 0, 1, 1);
+ m_client->didInvalidateRect(damageRect);
+ }
}
+
+void WebViewImpl::scrollRootLayerRect(const IntSize& scrollDelta, const IntRect& clipRect)
+{
+ // FIXME: To avoid breaking the Chrome render_widget when the new compositor render
+ // path is not checked in, we must still pass scroll damage up to the client. This
+ // code will be backed out in a followup CL once the Chromium changes have landed.
+ m_client->didScrollRect(scrollDelta.width(), scrollDelta.height(), clipRect);
+
+ ASSERT(m_layerRenderer);
+ // Compute the damage rect in viewport space.
+ WebFrameImpl* webframe = mainFrameImpl();
+ if (!webframe)
+ return;
+ FrameView* view = webframe->frameView();
+ if (!view)
+ return;
+
+ IntRect contentRect = view->visibleContentRect(false);
+
+ // We support fast scrolling in one direction at a time.
+ if (scrollDelta.width() && scrollDelta.height()) {
+ invalidateRootLayerRect(WebRect(contentRect));
+ return;
+ }
+
+ // Compute the region we will expose by scrolling. We use the
+ // content rect for invalidation. Using this space for damage
+ // rects allows us to intermix invalidates with scrolls.
+ IntRect damagedContentsRect;
+ if (scrollDelta.width()) {
+ float dx = static_cast<float>(scrollDelta.width());
+ damagedContentsRect.setY(contentRect.y());
+ damagedContentsRect.setHeight(contentRect.height());
+ if (dx > 0) {
+ damagedContentsRect.setX(contentRect.x());
+ damagedContentsRect.setWidth(dx);
+ } else {
+ damagedContentsRect.setX(contentRect.right() + dx);
+ damagedContentsRect.setWidth(-dx);
+ }
+ } else {
+ float dy = static_cast<float>(scrollDelta.height());
+ damagedContentsRect.setX(contentRect.x());
+ damagedContentsRect.setWidth(contentRect.width());
+ if (dy > 0) {
+ damagedContentsRect.setY(contentRect.y());
+ damagedContentsRect.setHeight(dy);
+ } else {
+ damagedContentsRect.setY(contentRect.bottom() + dy);
+ damagedContentsRect.setHeight(-dy);
+ }
+ }
+
+ m_scrollDamage.unite(damagedContentsRect);
+ setRootLayerNeedsDisplay();
+}
+
+void WebViewImpl::invalidateRootLayerRect(const IntRect& rect)
+{
+ // FIXME: To avoid breaking the Chrome render_widget when the new compositor render
+ // path is not checked in, we must still pass damage up to the client. This
+ // code will be backed out in a followup CL once the Chromium changes have landed.
+ m_client->didInvalidateRect(rect);
+
+ ASSERT(m_layerRenderer);
+
+ if (!page())
+ return;
+ FrameView* view = page()->mainFrame()->view();
+
+ // rect is in viewport space. Convert to content space
+ // so that invalidations and scroll invalidations play well with one-another.
+ FloatRect contentRect = view->windowToContents(rect);
+
+ // FIXME: add a smarter damage aggregation logic? Right now, LayerChromium does simple union-ing.
+ m_layerRenderer->rootLayer()->setNeedsDisplay(contentRect);
+}
+
+
void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
{
if (m_isAcceleratedCompositingActive == active)
return;
if (active) {
- m_layerRenderer = LayerRendererChromium::create(getOnscreenGLES2Context());
+ OwnPtr<GraphicsContext3D> context = m_temporaryOnscreenGraphicsContext3D.release();
+ if (!context) {
+ context = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow);
+ if (context)
+ context->reshape(std::max(1, m_size.width), std::max(1, m_size.height));
+ }
+ m_layerRenderer = LayerRendererChromium::create(context.release());
if (m_layerRenderer) {
m_isAcceleratedCompositingActive = true;
-
- // Force a redraw the entire view so that the compositor gets the entire view,
- // rather than just the currently-dirty subset.
- m_client->didInvalidateRect(IntRect(0, 0, m_size.width, m_size.height));
} else {
m_isAcceleratedCompositingActive = false;
m_compositorCreationFailed = true;
@@ -2142,17 +2321,11 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
}
}
-void WebViewImpl::updateRootLayerContents(const WebRect& rect)
+void WebViewImpl::updateRootLayerContents(const IntRect& rect)
{
if (!isAcceleratedCompositingActive())
return;
- // FIXME: The accelerated compositing path invalidates a 1x1 rect at (0, 0)
- // in order to get the renderer to ask the compositor to redraw. This is only
- // temporary until we get the compositor to render directly from its own thread.
- if (!rect.x && !rect.y && rect.width == 1 && rect.height == 1)
- return;
-
WebFrameImpl* webframe = mainFrameImpl();
if (!webframe)
return;
@@ -2164,7 +2337,7 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect)
if (rootLayer) {
IntRect visibleRect = view->visibleContentRect(true);
- m_layerRenderer->setRootLayerCanvasSize(IntSize(rect.width, rect.height));
+ m_layerRenderer->setRootLayerCanvasSize(IntSize(rect.width(), rect.height()));
GraphicsContext* rootLayerContext = m_layerRenderer->rootLayerGraphicsContext();
#if PLATFORM(SKIA)
@@ -2174,7 +2347,7 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect)
platformCanvas->save();
// Bring the canvas into the coordinate system of the paint rect.
- platformCanvas->translate(static_cast<SkScalar>(-rect.x), static_cast<SkScalar>(-rect.y));
+ platformCanvas->translate(static_cast<SkScalar>(-rect.x()), static_cast<SkScalar>(-rect.y()));
rootLayerContext->save();
@@ -2188,7 +2361,7 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect)
CGContextSaveGState(cgContext);
// Bring the CoreGraphics context into the coordinate system of the paint rect.
- CGContextTranslateCTM(cgContext, -rect.x, -rect.y);
+ CGContextTranslateCTM(cgContext, -rect.x(), -rect.y());
rootLayerContext->save();
@@ -2202,62 +2375,88 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect)
}
}
-void WebViewImpl::setRootLayerNeedsDisplay()
+void WebViewImpl::doComposite()
{
- // FIXME: For now we're posting a repaint event for the entire page which is an overkill.
- if (WebFrameImpl* webframe = mainFrameImpl()) {
- if (FrameView* view = webframe->frameView()) {
- // FIXME: Temporary hack to invalidate part of the page so that we get called to render
- // again.
- IntRect visibleRect = view->visibleContentRect(true);
- m_client->didInvalidateRect(IntRect(0, 0, 1, 1));
+ ASSERT(isAcceleratedCompositingActive());
+ if (!page())
+ return;
+ FrameView* view = page()->mainFrame()->view();
+
+ // The visibleRect includes scrollbars whereas the contentRect doesn't.
+ IntRect visibleRect = view->visibleContentRect(true);
+ IntRect contentRect = view->visibleContentRect(false);
+ IntRect viewPort = IntRect(0, 0, m_size.width, m_size.height);
+
+ // Give the compositor a chance to setup/resize the root texture handle and perform scrolling.
+ m_layerRenderer->prepareToDrawLayers(visibleRect, contentRect, IntPoint(view->scrollX(), view->scrollY()));
+
+ // Draw the contents of the root layer.
+ Vector<FloatRect> damageRects;
+ damageRects.append(m_scrollDamage);
+ damageRects.append(m_layerRenderer->rootLayer()->dirtyRect());
+ for (size_t i = 0; i < damageRects.size(); ++i) {
+ // The damage rect for the root layer is in content space [e.g. unscrolled].
+ // Convert from content space to viewPort space.
+ const FloatRect damagedContentRect = damageRects[i];
+ IntRect damagedRect = view->contentsToWindow(IntRect(damagedContentRect));
+
+ // Intersect this rectangle with the viewPort.
+ damagedRect.intersect(viewPort);
+
+ // Now render it.
+ if (damagedRect.width() && damagedRect.height()) {
+ updateRootLayerContents(damagedRect);
+ m_layerRenderer->updateRootLayerTextureRect(damagedRect);
}
}
+ m_layerRenderer->rootLayer()->resetNeedsDisplay();
+ m_scrollDamage = WebRect();
- if (m_layerRenderer)
- m_layerRenderer->setNeedsDisplay();
+ // Draw the actual layers...
+ m_layerRenderer->drawLayers(visibleRect, contentRect);
}
-#endif // USE(ACCELERATED_COMPOSITING)
+#endif
-PassOwnPtr<GLES2Context> WebViewImpl::getOnscreenGLES2Context()
-{
- WebGLES2Context* context = gles2Context();
- if (!context)
- return 0;
- return GLES2Context::create(GLES2ContextInternal::create(context, false));
-}
SharedGraphicsContext3D* WebViewImpl::getSharedGraphicsContext3D()
{
if (!m_sharedContext3D) {
GraphicsContext3D::Attributes attr;
OwnPtr<GraphicsContext3D> context = GraphicsContext3D::create(attr, m_page->chrome());
+ if (!context)
+ return 0;
m_sharedContext3D = SharedGraphicsContext3D::create(context.release());
}
return m_sharedContext3D.get();
}
-// Returns the GLES2 context associated with this View. If one doesn't exist
-// it will get created first.
WebGLES2Context* WebViewImpl::gles2Context()
{
- if (!m_gles2Context) {
- m_gles2Context = webKitClient()->createGLES2Context();
- if (!m_gles2Context)
- return 0;
-
- if (!m_gles2Context->initialize(this, 0)) {
- m_gles2Context.clear();
- return 0;
- }
+ return 0;
+}
+WebGraphicsContext3D* WebViewImpl::graphicsContext3D()
+{
+#if USE(ACCELERATED_COMPOSITING)
+ GraphicsContext3D* context = 0;
+ if (m_layerRenderer)
+ context = m_layerRenderer->context();
+ else if (m_temporaryOnscreenGraphicsContext3D)
+ context = m_temporaryOnscreenGraphicsContext3D.get();
+ else {
+ GraphicsContext3D::Attributes attributes;
+ m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow);
#if OS(DARWIN)
- m_gles2Context->resizeOnscreenContent(WebSize(std::max(1, m_size.width),
- std::max(1, m_size.height)));
+ if (m_temporaryOnscreenGraphicsContext3D)
+ m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height));
#endif
+ context = m_temporaryOnscreenGraphicsContext3D.get();
}
- return m_gles2Context.get();
+ return GraphicsContext3DInternal::extractWebGraphicsContext3D(context);
+#else
+ return 0;
+#endif
}
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h
index a42099c..bbd25a2 100644
--- a/WebKit/chromium/src/WebViewImpl.h
+++ b/WebKit/chromium/src/WebViewImpl.h
@@ -31,9 +31,9 @@
#ifndef WebViewImpl_h
#define WebViewImpl_h
-#include "WebGLES2Context.h"
#include "WebNavigationPolicy.h"
#include "WebPoint.h"
+#include "WebRect.h"
#include "WebSize.h"
#include "WebString.h"
#include "WebView.h"
@@ -43,8 +43,10 @@
#include "ContextMenuClientImpl.h"
#include "DragClientImpl.h"
#include "EditorClientImpl.h"
+#include "GraphicsContext3D.h"
#include "GraphicsLayer.h"
#include "InspectorClientImpl.h"
+#include "IntRect.h"
#include "LayerRendererChromium.h"
#include "NotificationPresenterImpl.h"
#include "SpeechInputClientImpl.h"
@@ -54,7 +56,6 @@
namespace WebCore {
class ChromiumDataObject;
class Frame;
-class GLES2Context;
class HistoryItem;
class HitTestResult;
class KeyboardEvent;
@@ -92,6 +93,8 @@ public:
virtual void resize(const WebSize&);
virtual void layout();
virtual void paint(WebCanvas*, const WebRect&);
+ virtual void themeChanged();
+ virtual void composite(bool finish);
virtual bool handleInputEvent(const WebInputEvent&);
virtual void mouseCaptureLost();
virtual void setFocus(bool enable);
@@ -119,6 +122,7 @@ public:
virtual void setTabKeyCyclesThroughElements(bool value);
virtual bool isActive() const;
virtual void setIsActive(bool value);
+ virtual void setDomainRelaxationForbidden(bool, const WebString& scheme);
virtual bool dispatchBeforeUnloadEvent();
virtual void dispatchUnloadEvent();
virtual WebFrame* mainFrame();
@@ -322,21 +326,28 @@ public:
}
#if USE(ACCELERATED_COMPOSITING)
- void setRootLayerNeedsDisplay();
- void setRootGraphicsLayer(WebCore::PlatformLayer*);
bool allowsAcceleratedCompositing();
+ void setRootGraphicsLayer(WebCore::PlatformLayer*);
+ void setRootLayerNeedsDisplay();
+ void scrollRootLayerRect(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& clipRect);
+ void invalidateRootLayerRect(const WebCore::IntRect&);
#endif
- // Onscreen contexts display to the screen associated with this view.
- // Offscreen contexts render offscreen but can share resources with the
- // onscreen context and thus can be composited.
- PassOwnPtr<WebCore::GLES2Context> getOnscreenGLES2Context();
-
- // Returns an onscreen context
+ // FIXME: remove this method once the compositor is fully switched
+ // over to GraphicsContext3D.
virtual WebGLES2Context* gles2Context();
+
+ // Returns the onscreen 3D context used by the compositor. This is
+ // used by the renderer's code to set up resource sharing between
+ // the compositor's context and subordinate contexts for APIs like
+ // WebGL. Returns 0 if compositing support is not compiled in.
+ virtual WebGraphicsContext3D* graphicsContext3D();
+
virtual WebCore::SharedGraphicsContext3D* getSharedGraphicsContext3D();
WebCore::PopupContainer* selectPopup() const { return m_selectPopup.get(); }
+ bool zoomTextOnly() const { return m_zoomTextOnly; }
+
// Returns true if the event leads to scrolling.
static bool mapKeyCodeForScroll(int keyCode,
WebCore::ScrollDirection* scrollDirection,
@@ -386,7 +397,9 @@ private:
#if USE(ACCELERATED_COMPOSITING)
void setIsAcceleratedCompositingActive(bool);
- void updateRootLayerContents(const WebRect&);
+ void updateRootLayerContents(const WebCore::IntRect&);
+ void doComposite();
+ void doPixelReadbackToCanvas(WebCanvas*, const WebCore::IntRect&);
#endif
WebViewClient* m_client;
@@ -433,6 +446,8 @@ private:
// mean zoom in, negative numbers mean zoom out.
int m_zoomLevel;
+ bool m_zoomTextOnly;
+
bool m_contextMenuAllowed;
bool m_doingDragAndDrop;
@@ -511,6 +526,7 @@ private:
RefPtr<WebCore::Node> m_mouseCaptureNode;
#if USE(ACCELERATED_COMPOSITING)
+ WebCore::IntRect m_scrollDamage;
OwnPtr<WebCore::LayerRendererChromium> m_layerRenderer;
bool m_isAcceleratedCompositingActive;
bool m_compositorCreationFailed;
@@ -520,8 +536,10 @@ private:
#if ENABLE(INPUT_SPEECH)
SpeechInputClientImpl m_speechInputClient;
#endif
-
- OwnPtr<WebGLES2Context> m_gles2Context;
+ // If we attempt to fetch the on-screen GraphicsContext3D before
+ // the compositor has been turned on, we need to instantiate it
+ // early. This member holds on to the GC3D in this case.
+ OwnPtr<WebCore::GraphicsContext3D> m_temporaryOnscreenGraphicsContext3D;
RefPtr<WebCore::SharedGraphicsContext3D> m_sharedContext3D;
diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js
index f55be4e..0c7241d 100644
--- a/WebKit/chromium/src/js/DevTools.js
+++ b/WebKit/chromium/src/js/DevTools.js
@@ -162,7 +162,3 @@ WebInspector.resetToolbarColors = function()
}
-// TODO(yurys): should be removed when eclipse debugger stops using it.
-if (window.RemoteDebuggerAgent) {
- RemoteDebuggerAgent.setContextId = function() {};
-}
diff --git a/WebKit/chromium/src/js/Tests.js b/WebKit/chromium/src/js/Tests.js
index 2233463..5cebb52 100644
--- a/WebKit/chromium/src/js/Tests.js
+++ b/WebKit/chromium/src/js/Tests.js
@@ -953,230 +953,6 @@ TestSuite.prototype._waitUntilScriptsAreParsed = function(expectedScripts, callb
/**
- * Gets a XPathResult matching given xpath.
- * @param {string} xpath
- * @param {number} resultType
- * @param {Node} opt_ancestor Context node. If not specified documentElement
- * will be used
- * @return {XPathResult} Type of returned value is determined by "resultType" parameter
- */
-
-TestSuite.prototype._evaluateXpath = function(xpath, resultType, opt_ancestor)
-{
- if (!opt_ancestor)
- opt_ancestor = document.documentElement;
- try {
- return document.evaluate(xpath, opt_ancestor, null, resultType, null);
- } catch(e) {
- this.fail('Error in expression: "' + xpath + '".' + e);
- }
-};
-
-
-/**
- * Gets first Node matching given xpath.
- * @param {string} xpath
- * @param {Node} opt_ancestor Context node. If not specified documentElement
- * will be used
- * @return {?Node}
- */
-TestSuite.prototype._findNode = function(xpath, opt_ancestor)
-{
- var result = this._evaluateXpath(xpath, XPathResult.FIRST_ORDERED_NODE_TYPE, opt_ancestor).singleNodeValue;
- this.assertTrue(!!result, "Cannot find node on path: " + xpath);
- return result;
-};
-
-
-/**
- * Gets a text matching given xpath.
- * @param {string} xpath
- * @param {Node} opt_ancestor Context node. If not specified documentElement
- * will be used
- * @return {?string}
- */
-TestSuite.prototype._findText = function(xpath, opt_ancestor)
-{
- var result = this._evaluateXpath(xpath, XPathResult.STRING_TYPE, opt_ancestor).stringValue;
- this.assertTrue(!!result, "Cannot find text on path: " + xpath);
- return result;
-};
-
-
-/**
- * Gets an iterator over nodes matching given xpath.
- * @param {string} xpath
- * @param {Node} opt_ancestor Context node. If not specified, documentElement
- * will be used
- * @return {XPathResult} Iterator over the nodes
- */
-TestSuite.prototype._nodeIterator = function(xpath, opt_ancestor)
-{
- return this._evaluateXpath(xpath, XPathResult.ORDERED_NODE_ITERATOR_TYPE, opt_ancestor);
-};
-
-
-/**
- * Checks the scopeSectionDiv against the expectations.
- * @param {Node} scopeSectionDiv The section div
- * @param {Object} expectations Expectations dictionary
- */
-TestSuite.prototype._checkScopeSectionDiv = function(scopeSectionDiv, expectations)
-{
- var scopeTitle = this._findText('./div[@class="header"]/div[@class="title"]/text()', scopeSectionDiv);
- this.assertEquals(expectations.title, scopeTitle, "Unexpected scope section title.");
- if (!expectations.properties)
- return;
- this.assertTrue(scopeSectionDiv.hasStyleClass("expanded"), 'Section "' + scopeTitle + '" is collapsed.');
-
- var propertyIt = this._nodeIterator("./ol/li", scopeSectionDiv);
- var propertyLi;
- var foundProps = [];
- while (propertyLi = propertyIt.iterateNext()) {
- var name = this._findText('./span[@class="name"]/text()', propertyLi);
- var value = this._findText('./span[@class="value"]/text()', propertyLi);
- this.assertTrue(!!name, 'Invalid variable name: "' + name + '"');
- this.assertTrue(name in expectations.properties, "Unexpected property: " + name);
- this.assertEquals(expectations.properties[name], value, 'Unexpected "' + name + '" property value.');
- delete expectations.properties[name];
- foundProps.push(name + " = " + value);
- }
-
- // Check that all expected properties were found.
- for (var p in expectations.properties)
- this.fail('Property "' + p + '" was not found in scope "' + scopeTitle + '". Found properties: "' + foundProps.join(",") + '"');
-};
-
-
-/**
- * Expands scope sections matching the filter and invokes the callback on
- * success.
- * @param {function(WebInspector.ObjectPropertiesSection, number):boolean}
- * filter
- * @param {Function} callback
- */
-TestSuite.prototype._expandScopeSections = function(filter, callback)
-{
- var sections = WebInspector.currentPanel.sidebarPanes.scopechain.sections;
-
- var toBeUpdatedCount = 0;
- function updateListener() {
- --toBeUpdatedCount;
- if (toBeUpdatedCount === 0) {
- // Report when all scopes are expanded and populated.
- callback();
- }
- }
-
- // Global scope is always the last one.
- for (var i = 0; i < sections.length - 1; i++) {
- var section = sections[i];
- if (!filter(sections, i))
- continue;
- ++toBeUpdatedCount;
- var populated = section.populated;
-
- this._hookGetPropertiesCallback(updateListener,
- function() {
- section.expand();
- if (populated) {
- // Make sure "updateProperties" callback will be called at least once
- // after it was overridden.
- section.update();
- }
- });
- }
-};
-
-
-/**
- * Tests that scopes can be expanded and contain expected data.
- */
-TestSuite.prototype.testExpandScope = function()
-{
- this.showPanel("scripts");
- var test = this;
-
- this._executeCodeWhenScriptsAreParsed("handleClick()", ["debugger_closure.html"]);
-
- this._waitForScriptPause(
- {
- functionsOnStack: ["innerFunction", "handleClick", ""],
- lineNumber: 8,
- lineText: " debugger;"
- },
- expandAllSectionsExceptGlobal);
-
- // Expanding Global scope takes for too long so we skeep it.
- function expandAllSectionsExceptGlobal() {
- test._expandScopeSections(function(sections, i) {
- return i < sections.length - 1;
- },
- examineScopes /* When all scopes are expanded and populated check them. */);
- }
-
- // Check scope sections contents.
- function examineScopes() {
- var scopeVariablesSection = test._findNode('//div[@id="scripts-sidebar"]/div[div[@class="title"]/text()="Scope Variables"]');
- var expectedScopes = [
- {
- title: "Local",
- properties: {
- x:"2009",
- innerFunctionLocalVar:"2011",
- "this": "DOMWindow",
- }
- },
- {
- title: "Closure",
- properties: {
- n: '"TextParam"',
- makeClosureLocalVar: '"local.TextParam"',
- }
- },
- {
- title: "Global",
- },
- ];
- var it = test._nodeIterator('./div[@class="body"]/div', scopeVariablesSection);
- var scopeIndex = 0;
- var scopeDiv;
- while (scopeDiv = it.iterateNext()) {
- test.assertTrue(scopeIndex < expectedScopes.length, "Too many scopes.");
- test._checkScopeSectionDiv(scopeDiv, expectedScopes[scopeIndex]);
- ++scopeIndex;
- }
- test.assertEquals(expectedScopes.length, scopeIndex, "Unexpected number of scopes.");
-
- test.releaseControl();
- }
-
- test.takeControl();
-};
-
-
-/**
- * Returns child tree element for a property with given name.
- * @param {TreeElement} parent Parent tree element.
- * @param {string} childName
- * @param {string} objectPath Path to the object. Will be printed in the case
- * of failure.
- * @return {TreeElement}
- */
-TestSuite.prototype._findChildProperty = function(parent, childName, objectPath)
-{
- var children = parent.children;
- for (var i = 0; i < children.length; i++) {
- var treeElement = children[i];
- var property = treeElement.property;
- if (property.name === childName)
- return treeElement;
- }
- this.fail('Cannot find property "' + childName + '" in ' + objectPath);
-};
-
-
-/**
* Executes the 'code' with InjectedScriptAccess.getProperties overriden
* so that all callbacks passed to InjectedScriptAccess.getProperties are
* extended with the "hook".
diff --git a/WebKit/chromium/tests/PopupMenuTest.cpp b/WebKit/chromium/tests/PopupMenuTest.cpp
index 50319af..aef29cf 100644
--- a/WebKit/chromium/tests/PopupMenuTest.cpp
+++ b/WebKit/chromium/tests/PopupMenuTest.cpp
@@ -128,6 +128,8 @@ public:
virtual void resize(const WebSize&) { }
virtual void layout() { }
virtual void paint(WebCanvas*, const WebRect&) { }
+ virtual void themeChanged() { }
+ virtual void composite(bool finish) { }
virtual bool handleInputEvent(const WebInputEvent&) { return true; }
virtual void mouseCaptureLost() { }
virtual void setFocus(bool) { }
diff --git a/WebKit/efl/CMakeListsEfl.txt b/WebKit/efl/CMakeListsEfl.txt
index 2ea5ee5..8b77260 100644
--- a/WebKit/efl/CMakeListsEfl.txt
+++ b/WebKit/efl/CMakeListsEfl.txt
@@ -16,7 +16,7 @@ LIST(APPEND WebKit_INCLUDE_DIRECTORIES
${EDJE_INCLUDE_DIRS}
${EFLDEPS_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
- ${LIBXML2_INCLUDE_DIRS}
+ ${LIBXML2_INCLUDE_DIR}
${LIBXSLT_INCLUDE_DIRS}
${SQLITE_INCLUDE_DIRS}
)
diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog
index e805d2c..879a1af 100644
--- a/WebKit/efl/ChangeLog
+++ b/WebKit/efl/ChangeLog
@@ -1,3 +1,140 @@
+2010-09-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ REGRESSION (r60104): Zoom level is unexpectedly reset on page reload
+ https://bugs.webkit.org/show_bug.cgi?id=42863
+
+ * ewk/ewk_frame.cpp:
+ (ewk_frame_zoom_get):
+ (ewk_frame_zoom_set):
+ (ewk_frame_zoom_text_only_set):
+ Call functions on Frame instead of FrameView.
+
+2010-09-16 Darin Adler <darin@apple.com>
+
+ Fix build.
+
+ * ewk/ewk_view.cpp:
+ (ewk_view_input_method_state_set): Updated for change
+ in name of isUrlField to isURLField.
+
+2010-09-14 Ryuan Choi <ryuan.choi@samsung.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [EFL] ewk_frame_view_create_for_view set null as theme.
+ https://bugs.webkit.org/show_bug.cgi?id=45741
+
+ Add theme in ewk_view to use instead of frame's theme which is null in
+ ewk_frame_view_create_for_view.
+
+ * ewk/ewk_frame.cpp:
+ (ewk_frame_view_create_for_view):
+ * ewk/ewk_view.cpp:
+ (ewk_view_theme_set):
+ (ewk_view_theme_get):
+
+2010-09-14 Leandro Pereira <leandro@profusion.mobi>
+
+ [EFL] Unreviewed build fix: remove "virtual" keyword from
+ implementation file.
+
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::canShowMIMETypeAsHTML):
+
+2010-09-13 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Unreviewed build fix.
+
+ [EFL] Fix build break when enabling HTML5 video support
+ https://bugs.webkit.org/show_bug.cgi?id=45674
+
+ The correct include variable for LibXml2 in cmake is
+ LIBXML2_INCLUDE_DIR instead of LIBXML2_INCLUDE_DIRS.
+
+ * CMakeListsEfl.txt:
+
+2010-09-13 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [EFL] Add setting API for enabling page cache
+ https://bugs.webkit.org/show_bug.cgi?id=44931
+
+ * ewk/ewk_view.cpp:
+ (_ewk_view_priv_new):
+ (ewk_view_setting_page_cache_get): Added.
+ (ewk_view_setting_page_cache_set): Added.
+ * ewk/ewk_view.h:
+
+2010-09-13 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Paste should be implemented in WebCore like Copy and Cut for Mac also.
+ https://bugs.webkit.org/show_bug.cgi?id=45494
+ <rdar://problem/7660537>
+
+ On the Mac platform, the implementation of the paste operation is all done
+ at the WebKit level. In order to support it on WebKit2 it is necessary to
+ refactor the code and move this functionality at the level of WebCore like
+ we already have on Windows.
+ The original code relies on some in AppKit functions that call back into
+ WebKit causing problems in WebKit2. All this functionality has been moved
+ at the level of the editor client where it can be dealt with appropriately.
+
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::canShowMIMETypeAsHTML): Added stub.
+ * WebCoreSupport/FrameLoaderClientEfl.h:
+
+2010-09-11 Ryuan Choi <ryuan.choi@samsung.com>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Fix EFL build after r67274
+ https://bugs.webkit.org/show_bug.cgi?id=45584
+
+ Remove include of ZoomMode.h and change setZoomFactor and zoomFactor
+ to proper apis chaged by r67264.
+
+ * ewk/ewk_frame.cpp:
+ (ewk_frame_zoom_get):
+ (ewk_frame_zoom_set):
+ (ewk_frame_zoom_text_only_get):
+ (ewk_frame_zoom_text_only_set):
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ This code didn't know that setEncoding could be called multiple times
+ safely.
+
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::FrameLoaderClientEfl):
+ (WebCore::FrameLoaderClientEfl::committedLoad):
+ (WebCore::FrameLoaderClientEfl::dispatchDidReceiveResponse):
+ (WebCore::FrameLoaderClientEfl::finishedLoading):
+ (WebCore::FrameLoaderClientEfl::dispatchDidFailLoading):
+ (WebCore::FrameLoaderClientEfl::setMainDocumentError):
+ * WebCoreSupport/FrameLoaderClientEfl.h:
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Main resource bytes shouldn't bounce through FrameLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45496
+
+ Now return the bytes to the DocumentLoader.
+
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::committedLoad):
+
2010-09-08 Darin Adler <darin@apple.com>
Reviewed by Adam Barth.
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
index 8ec783a..056687c 100644
--- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
@@ -67,7 +67,6 @@ namespace WebCore {
FrameLoaderClientEfl::FrameLoaderClientEfl(Evas_Object *view)
: m_view(view)
, m_frame(0)
- , m_firstData(false)
, m_userAgent("")
, m_customUserAgent("")
, m_pluginView(0)
@@ -182,20 +181,10 @@ void FrameLoaderClientEfl::dispatchWillSubmitForm(FramePolicyFunction function,
callPolicyFunction(function, PolicyUse);
}
-
void FrameLoaderClientEfl::committedLoad(DocumentLoader* loader, const char* data, int length)
{
- if (!m_pluginView) {
- if (!m_frame)
- return;
-
- FrameLoader* fl = loader->frameLoader();
- if (m_firstData) {
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
- fl->addData(data, length);
- }
+ if (!m_pluginView)
+ loader->commitData(data, length);
// We re-check here as the plugin can have been created
if (m_pluginView) {
@@ -325,7 +314,6 @@ void FrameLoaderClientEfl::frameLoaderDestroyed()
void FrameLoaderClientEfl::dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse& response)
{
m_response = response;
- m_firstData = true;
}
void FrameLoaderClientEfl::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const String& MIMEType, const ResourceRequest&)
@@ -690,6 +678,12 @@ bool FrameLoaderClientEfl::canHandleRequest(const ResourceRequest&) const
return true;
}
+bool FrameLoaderClientEfl::canShowMIMETypeAsHTML(const String& MIMEType) const
+{
+ notImplemented();
+ return false;
+}
+
bool FrameLoaderClientEfl::canShowMIMEType(const String& MIMEType) const
{
if (MIMETypeRegistry::isSupportedImageMIMEType(MIMEType))
@@ -719,17 +713,11 @@ String FrameLoaderClientEfl::generatedMIMETypeForURLScheme(const String&) const
void FrameLoaderClientEfl::finishedLoading(DocumentLoader* loader)
{
- if (!m_pluginView) {
- if (m_firstData) {
- FrameLoader* fl = loader->frameLoader();
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
- } else {
- m_pluginView->didFinishLoading();
- m_pluginView = 0;
- m_hasSentResponseToPlugin = false;
- }
+ if (!m_pluginView)
+ return;
+ m_pluginView->didFinishLoading();
+ m_pluginView = 0;
+ m_hasSentResponseToPlugin = false;
}
@@ -765,15 +753,7 @@ void FrameLoaderClientEfl::dispatchDidFinishLoading(DocumentLoader*, unsigned lo
void FrameLoaderClientEfl::dispatchDidFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError& err)
{
- if (!shouldFallBack(err))
- return;
-
- if (m_firstData) {
- FrameLoader* fl = loader->frameLoader();
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
-
+ notImplemented();
}
bool FrameLoaderClientEfl::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length)
@@ -904,16 +884,11 @@ void FrameLoaderClientEfl::dispatchUnableToImplementPolicy(const ResourceError&)
void FrameLoaderClientEfl::setMainDocumentError(DocumentLoader* loader, const ResourceError& error)
{
- if (!m_pluginView) {
- if (m_firstData) {
- loader->frameLoader()->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
- } else {
- m_pluginView->didFail(error);
- m_pluginView = 0;
- m_hasSentResponseToPlugin = false;
- }
+ if (!m_pluginView)
+ return;
+ m_pluginView->didFail(error);
+ m_pluginView = 0;
+ m_hasSentResponseToPlugin = false;
}
void FrameLoaderClientEfl::startDownload(const ResourceRequest&)
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
index bd105cd..68f145d 100644
--- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
@@ -181,6 +181,7 @@ class FrameLoaderClientEfl : public FrameLoaderClient {
virtual bool canHandleRequest(const ResourceRequest&) const;
virtual bool canShowMIMEType(const String&) const;
+ virtual bool canShowMIMETypeAsHTML(const String& MIMEType) const;
virtual bool representationExistsForURLScheme(const String&) const;
virtual String generatedMIMETypeForURLScheme(const String&) const;
@@ -209,7 +210,6 @@ class FrameLoaderClientEfl : public FrameLoaderClient {
Evas_Object *m_frame;
ResourceResponse m_response;
- bool m_firstData;
String m_userAgent;
String m_customUserAgent;
diff --git a/WebKit/efl/ewk/ewk_frame.cpp b/WebKit/efl/ewk/ewk_frame.cpp
index 8945ee7..038e105 100644
--- a/WebKit/efl/ewk/ewk_frame.cpp
+++ b/WebKit/efl/ewk/ewk_frame.cpp
@@ -45,7 +45,6 @@
#include "SharedBuffer.h"
#include "SubstituteData.h"
#include "WindowsKeyboardCodes.h"
-#include "ZoomMode.h"
#include "ewk_private.h"
#include <Eina.h>
@@ -71,7 +70,7 @@ struct Ewk_Frame_Smart_Data {
struct {
Evas_Coord w, h;
} contents_size;
- WebCore::ZoomMode zoom_mode;
+ Eina_Bool textZoom:1;
Eina_Bool editable:1;
};
@@ -1021,10 +1020,10 @@ float ewk_frame_zoom_get(const Evas_Object* o)
{
EWK_FRAME_SD_GET_OR_RETURN(o, sd, -1.0);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, -1.0);
- WebCore::FrameView* view = sd->frame->view();
- if (!view)
- return -1;
- return view->zoomFactor();
+
+ if (sd->textZoom)
+ return sd->frame->textZoomFactor();
+ return sd->frame->pageZoomFactor();
}
/**
@@ -1041,10 +1040,10 @@ Eina_Bool ewk_frame_zoom_set(Evas_Object* o, float zoom)
{
EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
- WebCore::FrameView* view = sd->frame->view();
- if (!view)
- return EINA_FALSE;
- view->setZoomFactor(zoom, sd->zoom_mode);
+ if (sd->textZoom)
+ sd->frame->setTextZoomFactor(zoom);
+ else
+ sd->frame->setPageZoomFactor(zoom);
return EINA_TRUE;
}
@@ -1058,7 +1057,7 @@ Eina_Bool ewk_frame_zoom_set(Evas_Object* o, float zoom)
Eina_Bool ewk_frame_zoom_text_only_get(const Evas_Object* o)
{
EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
- return sd->zoom_mode == WebCore::ZoomTextOnly;
+ return sd->textZoom;
}
/**
@@ -1073,15 +1072,15 @@ Eina_Bool ewk_frame_zoom_text_only_set(Evas_Object* o, Eina_Bool setting)
{
EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
- WebCore::ZoomMode zm = setting ? WebCore::ZoomTextOnly : WebCore::ZoomPage;
- if (sd->zoom_mode == zm)
+ if (sd->textZoom == setting)
return EINA_TRUE;
- sd->zoom_mode = zm;
- WebCore::FrameView* view = sd->frame->view();
- if (!view)
- return EINA_FALSE;
- view->setZoomFactor(view->zoomFactor(), sd->zoom_mode);
+ float zoom_level = sd->textZoom ? sd->frame->textZoomFactor() : sd->frame->pageZoomFactor();
+ sd->textZoom = setting;
+ if (sd->textZoom)
+ sd->frame->setPageAndTextZoomFactors(1, zoom_level);
+ else
+ sd->frame->setPageAndTextZoomFactors(zoom_level, 1);
return EINA_TRUE;
}
@@ -1953,7 +1952,9 @@ void ewk_frame_view_create_for_view(Evas_Object* o, Evas_Object* view)
sd->frame->createView(size, bg, !a, WebCore::IntSize(), false);
if (!sd->frame->view())
return;
- sd->frame->view()->setEdjeTheme(sd->theme);
+
+ const char* theme = ewk_view_theme_get(view);
+ sd->frame->view()->setEdjeTheme(theme);
sd->frame->view()->setEvasObject(o);
}
diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp
index 254fdfd..76e4bf5 100644
--- a/WebKit/efl/ewk/ewk_view.cpp
+++ b/WebKit/efl/ewk/ewk_view.cpp
@@ -90,6 +90,7 @@ struct _Ewk_View_Private_Data {
const char* encoding_default;
const char* encoding_custom;
const char* cache_directory;
+ const char* theme;
int font_minimum_size;
int font_minimum_logical_size;
int font_default_size;
@@ -112,6 +113,7 @@ struct _Ewk_View_Private_Data {
Eina_Bool spatial_navigation:1;
Eina_Bool local_storage:1;
Eina_Bool offline_app_cache: 1;
+ Eina_Bool page_cache: 1;
struct {
float w;
float h;
@@ -565,6 +567,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd)
priv->page_settings->setPluginsEnabled(true);
priv->page_settings->setLocalStorageEnabled(true);
priv->page_settings->setOfflineWebApplicationCacheEnabled(true);
+ priv->page_settings->setUsesPageCache(true);
url = priv->page_settings->userStyleSheetLocation();
priv->settings.user_stylesheet = eina_stringshare_add(url.prettyURL().utf8().data());
@@ -605,6 +608,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd)
priv->settings.caret_browsing = priv->page_settings->caretBrowsingEnabled();
priv->settings.local_storage = priv->page_settings->localStorageEnabled();
priv->settings.offline_app_cache = true; // XXX no function to read setting; this keeps the original setting
+ priv->settings.page_cache = priv->page_settings->usesPageCache();
// Since there's no scale separated from zooming in webkit-efl, this functionality of
// viewport meta tag is implemented using zoom. When scale zoom is supported by webkit-efl,
@@ -1110,6 +1114,9 @@ void ewk_view_fixed_layout_size_get(Evas_Object* o, Evas_Coord* w, Evas_Coord* h
void ewk_view_theme_set(Evas_Object* o, const char* path)
{
EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+ EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv);
+ if (!eina_stringshare_replace(&priv->settings.theme, path))
+ return;
ewk_frame_theme_set(sd->main_frame, path);
}
@@ -1125,7 +1132,8 @@ void ewk_view_theme_set(Evas_Object* o, const char* path)
const char* ewk_view_theme_get(Evas_Object* o)
{
EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
- return ewk_frame_theme_get(sd->main_frame);
+ EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+ return priv->settings.theme;
}
/**
@@ -2746,6 +2754,37 @@ Eina_Bool ewk_view_setting_local_storage_set(Evas_Object* o, Eina_Bool enable)
}
/**
+ * Gets if the page cache is enabled.
+ *
+ * @param o view object to set if page cache is enabled.
+ * @return @c EINA_TRUE if page cache is enabled, @c EINA_FALSE if not.
+ */
+Eina_Bool ewk_view_setting_page_cache_get(Evas_Object* o)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+ EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+ return priv->settings.page_cache;
+}
+
+/**
+ * Sets the page cache.
+ *
+ * @param o view object to set if page cache is enabled.
+ * @return @c EINA_TRUE on success and @c EINA_FALSE on failure
+ */
+Eina_Bool ewk_view_setting_page_cache_set(Evas_Object* o, Eina_Bool enable)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+ EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+ enable = !!enable;
+ if (priv->settings.page_cache != enable) {
+ priv->page_settings->setUsesPageCache(enable);
+ priv->settings.page_cache = enable;
+ }
+ return EINA_TRUE;
+}
+
+/**
* Similar to evas_object_smart_data_get(), but does type checking.
*
* @param o view object to query internal data.
@@ -3211,7 +3250,7 @@ void ewk_view_input_method_state_set(Evas_Object* o, Eina_Bool active)
priv->imh |= inputElement->isTelephoneField() * EWK_IMH_TELEPHONE;
priv->imh |= inputElement->isNumberField() * EWK_IMH_NUMBER;
priv->imh |= inputElement->isEmailField() * EWK_IMH_EMAIL;
- priv->imh |= inputElement->isUrlField() * EWK_IMH_URL;
+ priv->imh |= inputElement->isURLField() * EWK_IMH_URL;
}
}
}
diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h
index c5d2d45..be27f68 100644
--- a/WebKit/efl/ewk/ewk_view.h
+++ b/WebKit/efl/ewk/ewk_view.h
@@ -450,6 +450,9 @@ EAPI Eina_Bool ewk_view_setting_spatial_navigation_set(Evas_Object* o, Eina_B
EAPI Eina_Bool ewk_view_setting_local_storage_get(Evas_Object* o);
EAPI Eina_Bool ewk_view_setting_local_storage_set(Evas_Object* o, Eina_Bool enable);
+EAPI Eina_Bool ewk_view_setting_page_cache_get(Evas_Object* o);
+EAPI Eina_Bool ewk_view_setting_page_cache_set(Evas_Object* o, Eina_Bool enable);
+
/* to be used by subclass implementations */
EAPI Ewk_View_Smart_Data *ewk_view_smart_data_get(const Evas_Object *o);
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 25fe4fd..16f4063 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,384 @@
+2010-09-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ REGRESSION (r60104): Zoom level is unexpectedly reset on page reload
+ https://bugs.webkit.org/show_bug.cgi?id=42863
+
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_get_zoom_level):
+ (webkit_web_view_apply_zoom_level):
+ (webkit_web_view_set_full_content_zoom):
+ Call functions on Frame instead of FrameView.
+
+2010-09-16 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Implement dissolveDragImageToFraction
+ https://bugs.webkit.org/show_bug.cgi?id=45826
+
+ To support full alpha in the drag icon, changed the drag icon to be a
+ GtkWindow with an RGBA colormap. Added logic to support painting the drag
+ image to this window during the expose event.
+
+ * WebCoreSupport/DragClientGtk.cpp:
+ (WebKit::dragIconWindowExposeEventCallback): Added.
+ (WebKit::DragClient::DragClient): Initialize the new drag icon window.
+ (WebKit::DragClient::~DragClient): Disconnect the expose event signal.
+ (WebKit::DragClient::startDrag): Resize the drag icon window the appropriate size and
+ if necessary, set its colormap.
+ (WebKit::DragClient::dragIconWindowExposeEvent): Added.
+ * WebCoreSupport/DragClientGtk.h: Added new member and method declarations.
+
+2010-09-14 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson and Martin Robinson.
+
+ [GTK] eventSender.contextClick() should return the contents of the context menu
+ https://bugs.webkit.org/show_bug.cgi?id=39102
+
+ New private WebView API to retrieve the context-menu widget. This
+ is used by DRT only.
+
+ * webkit/webkitprivate.h:
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_get_context_menu):
+
+2010-09-16 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ GTK+ 3.x. updates, gtk_widget_size_request is deprecated and
+ "activate-slider" style property for scrollbars is gone.
+
+ * webkit/webkitwebview.cpp:
+ (PopupMenuPositionFunc):
+
+2010-09-15 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by David Levin.
+
+ [GTK] [REGRESSION] r67591 broke the testwebbackforwardlist API test and introduced a memory leak
+ https://bugs.webkit.org/show_bug.cgi?id=45865
+
+ When initializing the backForwardList private member of the WebView, do
+ so with adoptPlatformRef to prevent a memory leak.
+
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_init): Initialize member with adoptPlatformRef.
+
+2010-09-15 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Gtk] Use GOwnPtr for code that needs it
+ https://bugs.webkit.org/show_bug.cgi?id=21594
+
+ Convert as reference counted private members of WebKitWebView to
+ smart pointers as possible. This removes a lot of unecessary manual
+ memory management. Also convert some pointer members away from pointer
+ types, now that we are sure their destructors are called.
+
+ * WebCoreSupport/ContextMenuClientGtk.cpp:
+ (WebKit::inputMethodsMenuItem): Updated to reflect PlatformRefPtr changes.
+ * WebCoreSupport/DragClientGtk.cpp:
+ (WebKit::DragClient::startDrag): Ditto.
+ * WebCoreSupport/EditorClientGtk.cpp:
+ (WebKit::EditorClient::setInputMethodState): Ditto.
+ (WebKit::EditorClient::respondToChangedSelection): Ditto.
+ (WebKit::EditorClient::handleInputMethodKeydown): Ditto.
+ (WebKit::EditorClient::handleInputMethodMousePress): Ditto.
+ (WebKit::EditorClient::EditorClient): Ditto.
+ (WebKit::EditorClient::~EditorClient): Ditto.
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::postCommitFrameViewSetup): Ditto.
+ * webkit/webkitprivate.h: Ditto.
+ * webkit/webkitwebview.cpp: Ditto.
+ (destroy_menu_cb): Ditto.
+ (webkit_web_view_forward_context_menu_event): Ditto.
+ (webkit_web_view_key_release_event): Ditto.
+ (webkit_web_view_button_press_event): Ditto.
+ (webkit_web_view_button_release_event): Ditto.
+ (webkit_web_view_focus_in_event): Ditto.
+ (webkit_web_view_focus_out_event): Ditto.
+ (webkit_web_view_realize): Ditto.
+ (webkit_web_view_set_scroll_adjustments): Ditto.
+ (webkit_web_view_dispose): Changed all g_object_unref calls to
+ PlatformRefPtr.clear(). Although this will also be done by the manual
+ call to the WebKitWebViewPrivate destructor, the order that these
+ fields are zero'd in is still very sensitive.
+ (webkit_web_view_finalize): Updated to reflect PlatformRefPtr changes.
+ (webViewGetDPI): Ditto.
+ (webkit_web_view_screen_changed): Ditto.
+ (webkit_web_view_drag_end): Ditto.
+ (webkit_web_view_drag_data_get): Ditto.
+ (doDragLeaveLater): Ditto.
+ (webkit_web_view_drag_leave): Ditto.
+ (webkit_web_view_drag_motion): Ditto.
+ (webkit_web_view_drag_data_received): Ditto.
+ (webkit_web_view_drag_drop): Ditto.
+ (webkit_web_view_get_im_context): Ditto.
+ (webkit_web_view_update_settings): Ditto.
+ (webkit_web_view_init): Ditto.
+ (webkit_web_view_set_settings): Ditto.
+ (webkit_web_view_get_settings): Ditto.
+ (webkit_web_view_get_inspector): Ditto.
+ (webkit_web_view_set_window_features): Ditto.
+ (webkit_web_view_get_window_features): Ditto.
+ (webkit_web_view_get_back_forward_list): Ditto.
+ (webkit_web_view_zoom_in): Ditto.
+ (webkit_web_view_zoom_out): Ditto.
+ (webkit_web_view_add_resource): Ditto.
+ (webkit_web_view_get_resource): Ditto.
+ (webkit_web_view_get_main_resource): Ditto.
+ (webkit_web_view_clear_resources): Ditto.
+ (webkit_web_view_get_subresources): Ditto.
+
+2010-09-14 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] fast/events/keydown-numpad-keys.html produces many GLib warnings
+ https://bugs.webkit.org/show_bug.cgi?id=45775
+
+ Handle the toggle-overwrite signal on the GtkTextView used for generating editing
+ commands. Ignore this signals, as the default handler assumes that the GtkTextView
+ has a layout and this one does not.
+
+ * WebCoreSupport/EditorClientGtk.cpp:
+ (WebKit::toggleOverwriteCallback): Added. Cancels the default handler.
+ (WebKit::EditorClient::EditorClient): Attach a handler for toggle-overwrite.
+
+2010-09-14 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Provide network-based load timing.
+ Before this change, inspector used timers taken from
+ within WebCore notifications (that are by definition
+ synchronous and serialized). As a result, timing was
+ affected by the routines running on the main thread
+ (JavaScript and such).
+ https://bugs.webkit.org/show_bug.cgi?id=45664
+
+ * webkit/webkitdownload.cpp:
+ (DownloadClient::didFinishLoading):
+
+2010-09-15 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r67551.
+ http://trac.webkit.org/changeset/67551
+ https://bugs.webkit.org/show_bug.cgi?id=45816
+
+ "Plugin tests fail" (Requested by yurys on #webkit).
+
+ * webkit/webkitdownload.cpp:
+ (DownloadClient::didFinishLoading):
+
+2010-09-14 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Provide network-based load timing.
+ Before this change, inspector used timers taken from
+ within WebCore notifications (that are by definition
+ synchronous and serialized). As a result, timing was
+ affected by the routines running on the main thread
+ (JavaScript and such).
+ https://bugs.webkit.org/show_bug.cgi?id=45664
+
+ * webkit/webkitdownload.cpp:
+ (DownloadClient::didFinishLoading):
+
+2010-09-13 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Paste should be implemented in WebCore like Copy and Cut for Mac also.
+ https://bugs.webkit.org/show_bug.cgi?id=45494
+ <rdar://problem/7660537>
+
+ On the Mac platform, the implementation of the paste operation is all done
+ at the WebKit level. In order to support it on WebKit2 it is necessary to
+ refactor the code and move this functionality at the level of WebCore like
+ we already have on Windows.
+ The original code relies on some in AppKit functions that call back into
+ WebKit causing problems in WebKit2. All this functionality has been moved
+ at the level of the editor client where it can be dealt with appropriately.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::canShowMIMETypeAsHTML): Added stub.
+ * WebCoreSupport/FrameLoaderClientGtk.h:
+
+2010-09-13 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Provide unit tests for AtkText's text selection functions
+ https://bugs.webkit.org/show_bug.cgi?id=43919
+
+ New tests to check getting, setting and removing text selections
+
+ * tests/testatk.c:
+ (testWekitAtkTextSelections): New unit tests to check all the text
+ selection related functions altogether through a single test
+ function.
+ (main):
+
+ Make sure that code dependant on getting information from the
+ clipboard gets executed only when there's a GDK window associated
+ to the webview widget, as that's not the case when executing the
+ unit tests (the wedbview is not inside of any toplevel window) and
+ will make the tests crash if not taken into account.
+
+ * WebCoreSupport/EditorClientGtk.cpp:
+ (WebKit::EditorClient::respondToChangedSelection):
+
+2010-09-11 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Make introspection work with g-o-i 0.9.5
+ https://bugs.webkit.org/show_bug.cgi?id=45590
+
+ Use new type syntax and bump version number of the gir file.
+
+ * JSCore.gir.in:
+
+2010-09-10 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Add NetworkingContext to avoid layer violations
+ https://bugs.webkit.org/show_bug.cgi?id=42292
+
+ * webkit/webkitdownload.cpp:
+ (webkit_download_start):
+ * webkit/webkitprivate.cpp:
+ (currentToplevelCallback):
+
+2010-09-10 Sam Weinig <sam@webkit.org>
+
+ Fix GTK build.
+
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_set_full_content_zoom):
+
+2010-09-10 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove unnecessary constraint in WebCore of choosing either text zoom or full page zoom.
+ Precursor to <rdar://problem/7660657>
+ https://bugs.webkit.org/show_bug.cgi?id=45522
+
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_get_zoom_level):
+ (webkit_web_view_apply_zoom_level):
+ (webkit_web_view_set_full_content_zoom):
+
+2010-09-10 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] Fix warnings because of bad assignments in testatk.c
+ https://bugs.webkit.org/show_bug.cgi?id=45538
+
+ Use AtkObject and AtkText instances properly in the code.
+
+ * tests/testatk.c:
+ (testWebkitAtkListsOfItems):
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::committedLoad):
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Main resource bytes shouldn't bounce through FrameLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45496
+
+ Now return the bytes to the DocumentLoader.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::committedLoad):
+
+2010-09-10 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Placement new / manual destructor invocation should be used on private GObject memory
+ https://bugs.webkit.org/show_bug.cgi?id=45550
+
+ GLib allocates and deallocates GObject private data structs itself. When
+ those structs contain C++ members, their constructors and destructors are not
+ called. This is not only dangerous, it makes RefPtr-type smart pointers much
+ less useful. We can fix this problem by calling placement new on the private
+ data struct during instance initialization and calling the destructor during
+ finalization.
+
+ This patch takes that approach and switches plain char* members of
+ WebKitWebView (with manual memory allocation) to use CString.
+
+ * webkit/webkitprivate.h: Switch char* members to CString.
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_finalize): Manually call the destructor on the private
+ data. Remove manual deallocation of members which are now CString.
+ (webkit_web_view_query_tooltip): Update to reflect CString change.
+ (webkit_web_view_init): Use placement new to initialize C++ members of
+ the private data section.
+ (webkit_web_view_get_encoding): Update to reflect CString change.
+ (webkit_web_view_get_custom_encoding): Ditto.
+ (webkit_web_view_add_resource): Ditto.
+ (webkit_web_view_get_resource): Ditto.
+ (webkit_web_view_clear_resources): Ditto.
+ (webkit_web_view_set_tooltip_text): Ditto.
+ (webkit_web_view_get_icon_uri): Ditto.
+
+2010-09-10 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Google sites do not like WebKitGTK+
+ https://bugs.webkit.org/show_bug.cgi?id=39617
+
+ Special-case Google domains, and spoof User-Agent when talking to
+ them, to stop being treated as a second-class citizen.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::initializeDomainsList):
+ (WebKit::isGoogleDomain):
+ (WebKit::FrameLoaderClient::userAgent): If enable-site-specific-quirks
+ is enabled, send the standard WebKit User-Agent string, disregarding the
+ custom one set by the browser for Google domains.
+ * webkit/webkitprivate.h:
+ * webkit/webkitwebsettings.cpp:
+ (webkitPlatform): Fix style, and simplify.
+ (webkitOSVersion): Ditto.
+ (webkitUserAgent): Add the Version/x.y string Safari has been
+ using since Safari 2.2.
+
+2010-09-10 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ Fix compilation with GTK+ 3.x.
+
+ GDK key macros were renamed from GDK_FOO to GDK_KEY_FOO, we need
+ to include the compat header provided if we want to keep using the
+ old names.
+
+ * WebCoreSupport/FullscreenVideoController.cpp: include GtkVersioning.h
+
2010-09-08 Darin Adler <darin@apple.com>
Reviewed by Adam Barth.
diff --git a/WebKit/gtk/JSCore.gir.in b/WebKit/gtk/JSCore.gir.in
index e979c33..e143982 100644
--- a/WebKit/gtk/JSCore.gir.in
+++ b/WebKit/gtk/JSCore.gir.in
@@ -1,12 +1,14 @@
<?xml version="1.0"?>
-<repository version="1.1"
+<repository version="1.2"
xmlns="http://www.gtk.org/introspection/core/1.0"
xmlns:c="http://www.gtk.org/introspection/c/1.0">
<namespace name="JSCore" version="@WEBKITGTK_API_VERSION@" shared-library="webkitgtk-@WEBKITGTK_API_VERSION@">
- <alias name="GlobalContextRef"
- target="none"
- c:type="JSGlobalContextRef"/>
- <alias name="ObjectRef" target="none" c:type="JSObjectRef"/>
+ <alias name="GlobalContextRef" target="none">
+ <type name="JSGlobalContextRef" c:type="JSGlobalContextRef"/>
+ </alias>
+ <alias name="ObjectRef" target="none">
+ <type name="JSObjectRef" c:type="JSObjectRef"/>
+ </alias>
<function name="EvaluateScript" c:identifier="JSEvaluateScript">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
diff --git a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
index 5c1bc0b..069fb19 100644
--- a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
@@ -62,7 +62,7 @@ static GtkWidget* inputMethodsMenuItem (WebKitWebView* webView)
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
GtkWidget* imContextMenu = gtk_menu_new();
- gtk_im_multicontext_append_menuitems(GTK_IM_MULTICONTEXT(priv->imContext), GTK_MENU_SHELL(imContextMenu));
+ gtk_im_multicontext_append_menuitems(GTK_IM_MULTICONTEXT(priv->imContext.get()), GTK_MENU_SHELL(imContextMenu));
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), imContextMenu);
diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
index b6075b6..cc75d36 100644
--- a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
@@ -34,16 +34,30 @@
#include "RenderObject.h"
#include "webkitprivate.h"
#include "webkitwebview.h"
+#include <gdk/gdk.h>
#include <gtk/gtk.h>
using namespace WebCore;
namespace WebKit {
+static gboolean dragIconWindowExposeEventCallback(GtkWidget* widget, GdkEventExpose* event, DragClient* client)
+{
+ client->dragIconWindowExposeEvent(widget, event);
+ return TRUE;
+}
+
DragClient::DragClient(WebKitWebView* webView)
: m_webView(webView)
, m_startPos(0, 0)
+ , m_dragIconWindow(gtk_window_new(GTK_WINDOW_POPUP))
{
+ g_signal_connect(m_dragIconWindow.get(), "expose-event", G_CALLBACK(dragIconWindowExposeEventCallback), this);
+}
+
+DragClient::~DragClient()
+{
+ g_signal_handlers_disconnect_by_func(m_dragIconWindow.get(), (gpointer) dragIconWindowExposeEventCallback, this);
}
void DragClient::willPerformDragDestinationAction(DragDestinationAction, DragData*)
@@ -77,18 +91,44 @@ void DragClient::startDrag(DragImageRef image, const IntPoint& dragImageOrigin,
GOwnPtr<GdkEvent> currentEvent(gtk_get_current_event());
GdkDragContext* context = gtk_drag_begin(GTK_WIDGET(m_webView), targetList.get(), dragOperationToGdkDragActions(clipboard->sourceOperation()), 1, currentEvent.get());
- webView->priv->draggingDataObjects->set(context, dataObject);
+ webView->priv->draggingDataObjects.set(context, dataObject);
// A drag starting should prevent a double-click from happening. This might
// happen if a drag is followed very quickly by another click (like in the DRT).
webView->priv->previousClickTime = 0;
- if (image)
- gtk_drag_set_icon_pixbuf(context, image, eventPos.x() - dragImageOrigin.x(), eventPos.y() - dragImageOrigin.y());
- else
+ // This strategy originally comes from Chromium:
+ // src/chrome/browser/gtk/tab_contents_drag_source.cc
+ if (image) {
+ m_dragImage = image;
+ IntSize imageSize(cairo_image_surface_get_width(image), cairo_image_surface_get_height(image));
+ gtk_window_resize(GTK_WINDOW(m_dragIconWindow.get()), imageSize.width(), imageSize.height());
+
+ if (!gtk_widget_get_realized(m_dragIconWindow.get())) {
+ GdkScreen* screen = gtk_widget_get_screen(m_dragIconWindow.get());
+ GdkColormap* rgba = gdk_screen_get_rgba_colormap(screen);
+ if (rgba)
+ gtk_widget_set_colormap(m_dragIconWindow.get(), rgba);
+ }
+
+ IntSize origin = eventPos - dragImageOrigin;
+ gtk_drag_set_icon_widget(context, m_dragIconWindow.get(),
+ origin.width(), origin.height());
+ } else
gtk_drag_set_icon_default(context);
}
+void DragClient::dragIconWindowExposeEvent(GtkWidget* widget, GdkEventExpose* event)
+{
+ PlatformRefPtr<cairo_t> context = adoptPlatformRef(gdk_cairo_create(event->window));
+ cairo_rectangle(context.get(), 0, 0,
+ cairo_image_surface_get_width(m_dragImage.get()),
+ cairo_image_surface_get_height(m_dragImage.get()));
+ cairo_set_operator(context.get(), CAIRO_OPERATOR_SOURCE);
+ cairo_set_source_surface(context.get(), m_dragImage.get(), 0, 0);
+ cairo_fill(context.get());
+}
+
DragImageRef DragClient::createDragImageForLink(KURL&, const String&, Frame*)
{
notImplemented();
diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.h b/WebKit/gtk/WebCoreSupport/DragClientGtk.h
index 514852e..2ab7e2d 100644
--- a/WebKit/gtk/WebCoreSupport/DragClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.h
@@ -31,6 +31,8 @@
#define DragClientGtk_h
#include "DragClient.h"
+#include "GRefPtr.h"
+#include "PlatformRefPtrCairo.h"
typedef struct _WebKitWebView WebKitWebView;
@@ -39,6 +41,7 @@ namespace WebKit {
class DragClient : public WebCore::DragClient {
public:
DragClient(WebKitWebView*);
+ ~DragClient();
virtual void willPerformDragDestinationAction(WebCore::DragDestinationAction, WebCore::DragData*);
virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*);
@@ -51,9 +54,13 @@ namespace WebKit {
virtual void dragControllerDestroyed();
+ void dragIconWindowExposeEvent(GtkWidget*, GdkEventExpose*);
+
private:
WebKitWebView* m_webView;
WebCore::IntPoint m_startPos;
+ PlatformRefPtr<GtkWidget> m_dragIconWindow;
+ PlatformRefPtr<cairo_surface_t> m_dragImage;
};
}
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
index 8a019b4..d4e70b6 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
@@ -122,6 +122,13 @@ static void pasteClipboardCallback(GtkWidget* widget, EditorClient* client)
client->addPendingEditorCommand("Paste");
}
+static void toggleOverwriteCallback(GtkWidget* widget, EditorClient* client)
+{
+ // We don't support toggling the overwrite mode, but the default callback expects
+ // the GtkTextView to have a layout, so we handle this signal just to stop it.
+ g_signal_stop_emission_by_name(widget, "toggle-overwrite");
+}
+
static const char* const gtkDeleteCommands[][2] = {
{ "DeleteBackward", "DeleteForward" }, // Characters
{ "DeleteWordBackward", "DeleteWordForward" }, // Word ends
@@ -229,15 +236,15 @@ void EditorClient::setInputMethodState(bool active)
WebKitWebViewPrivate* priv = m_webView->priv;
if (active)
- gtk_im_context_focus_in(priv->imContext);
+ gtk_im_context_focus_in(priv->imContext.get());
else
- gtk_im_context_focus_out(priv->imContext);
+ gtk_im_context_focus_out(priv->imContext.get());
#ifdef MAEMO_CHANGES
if (active)
- hildon_gtk_im_context_show(priv->imContext);
+ hildon_gtk_im_context_show(priv->imContext.get());
else
- hildon_gtk_im_context_hide(priv->imContext);
+ hildon_gtk_im_context_hide(priv->imContext.get());
#endif
}
@@ -341,6 +348,31 @@ static void collapseSelection(GtkClipboard* clipboard, WebKitWebView* webView)
frame->selection()->setBase(frame->selection()->extent(), frame->selection()->affinity());
}
+#if PLATFORM(X11)
+static void setSelectionPrimaryClipboardIfNeeded(WebKitWebView* webView)
+{
+ if (!gtk_widget_has_screen(GTK_WIDGET(webView)))
+ return;
+
+ GtkClipboard* clipboard = gtk_widget_get_clipboard(GTK_WIDGET(webView), GDK_SELECTION_PRIMARY);
+ DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
+ WebCore::Page* corePage = core(webView);
+ Frame* targetFrame = corePage->focusController()->focusedOrMainFrame();
+
+ if (!targetFrame->selection()->isRange())
+ return;
+
+ dataObject->clear();
+ dataObject->setRange(targetFrame->selection()->toNormalizedRange());
+
+ viewSettingClipboard = webView;
+ GClosure* callback = g_cclosure_new_object(G_CALLBACK(collapseSelection), G_OBJECT(webView));
+ g_closure_set_marshal(callback, g_cclosure_marshal_VOID__VOID);
+ pasteboardHelperInstance()->writeClipboardContents(clipboard, callback);
+ viewSettingClipboard = 0;
+}
+#endif
+
void EditorClient::respondToChangedSelection()
{
WebKitWebViewPrivate* priv = m_webView->priv;
@@ -354,19 +386,7 @@ void EditorClient::respondToChangedSelection()
return;
#if PLATFORM(X11)
- GtkClipboard* clipboard = gtk_widget_get_clipboard(GTK_WIDGET(m_webView), GDK_SELECTION_PRIMARY);
- DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
-
- if (targetFrame->selection()->isRange()) {
- dataObject->clear();
- dataObject->setRange(targetFrame->selection()->toNormalizedRange());
-
- viewSettingClipboard = m_webView;
- GClosure* callback = g_cclosure_new_object(G_CALLBACK(collapseSelection), G_OBJECT(m_webView));
- g_closure_set_marshal(callback, g_cclosure_marshal_VOID__VOID);
- pasteboardHelperInstance()->writeClipboardContents(clipboard, callback);
- viewSettingClipboard = 0;
- }
+ setSelectionPrimaryClipboardIfNeeded(m_webView);
#endif
if (!targetFrame->editor()->hasComposition())
@@ -376,7 +396,7 @@ void EditorClient::respondToChangedSelection()
unsigned end;
if (!targetFrame->editor()->getCompositionSelection(start, end)) {
// gtk_im_context_reset() clears the composition for us.
- gtk_im_context_reset(priv->imContext);
+ gtk_im_context_reset(priv->imContext.get());
targetFrame->editor()->confirmCompositionWithoutDisturbingSelection();
}
}
@@ -710,7 +730,7 @@ void EditorClient::handleInputMethodKeydown(KeyboardEvent* event)
m_treatContextCommitAsKeyEvent = (!targetFrame->editor()->hasComposition())
&& event->keyEvent()->gdkEventKey()->keyval;
clearPendingComposition();
- if ((gtk_im_context_filter_keypress(priv->imContext, event->keyEvent()->gdkEventKey()) && !m_pendingComposition)
+ if ((gtk_im_context_filter_keypress(priv->imContext.get(), event->keyEvent()->gdkEventKey()) && !m_pendingComposition)
|| (!m_treatContextCommitAsKeyEvent && !targetFrame->editor()->hasComposition()))
event->preventDefault();
@@ -730,12 +750,12 @@ void EditorClient::handleInputMethodMousePress()
// In this case, if the focused node is changed, the commit signal happens in a diffrent node.
// Therefore, we need to confirm the current compositon and ignore the next commit signal.
GOwnPtr<gchar> newPreedit(0);
- gtk_im_context_get_preedit_string(priv->imContext, &newPreedit.outPtr(), 0, 0);
+ gtk_im_context_get_preedit_string(priv->imContext.get(), &newPreedit.outPtr(), 0, 0);
if (g_utf8_strlen(newPreedit.get(), -1)) {
targetFrame->editor()->confirmComposition();
m_preventNextCompositionCommit = true;
- gtk_im_context_reset(priv->imContext);
+ gtk_im_context_reset(priv->imContext.get());
}
}
@@ -747,8 +767,8 @@ EditorClient::EditorClient(WebKitWebView* webView)
, m_nativeWidget(gtk_text_view_new())
{
WebKitWebViewPrivate* priv = m_webView->priv;
- g_signal_connect(priv->imContext, "commit", G_CALLBACK(imContextCommitted), this);
- g_signal_connect(priv->imContext, "preedit-changed", G_CALLBACK(imContextPreeditChanged), this);
+ g_signal_connect(priv->imContext.get(), "commit", G_CALLBACK(imContextCommitted), this);
+ g_signal_connect(priv->imContext.get(), "preedit-changed", G_CALLBACK(imContextPreeditChanged), this);
g_signal_connect(m_nativeWidget.get(), "backspace", G_CALLBACK(backspaceCallback), this);
g_signal_connect(m_nativeWidget.get(), "cut-clipboard", G_CALLBACK(cutClipboardCallback), this);
@@ -757,13 +777,14 @@ EditorClient::EditorClient(WebKitWebView* webView)
g_signal_connect(m_nativeWidget.get(), "select-all", G_CALLBACK(selectAllCallback), this);
g_signal_connect(m_nativeWidget.get(), "move-cursor", G_CALLBACK(moveCursorCallback), this);
g_signal_connect(m_nativeWidget.get(), "delete-from-cursor", G_CALLBACK(deleteFromCursorCallback), this);
+ g_signal_connect(m_nativeWidget.get(), "toggle-overwrite", G_CALLBACK(toggleOverwriteCallback), this);
}
EditorClient::~EditorClient()
{
WebKitWebViewPrivate* priv = m_webView->priv;
- g_signal_handlers_disconnect_by_func(priv->imContext, (gpointer)imContextCommitted, this);
- g_signal_handlers_disconnect_by_func(priv->imContext, (gpointer)imContextPreeditChanged, this);
+ g_signal_handlers_disconnect_by_func(priv->imContext.get(), (gpointer)imContextCommitted, this);
+ g_signal_handlers_disconnect_by_func(priv->imContext.get(), (gpointer)imContextPreeditChanged, this);
}
void EditorClient::textFieldDidBeginEditing(Element*)
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 4b0da3d..93b4cc2 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -49,6 +49,7 @@
#include "MIMETypeRegistry.h"
#include "MouseEvent.h"
#include "NotImplemented.h"
+#include "Page.h"
#include "PlatformString.h"
#include "PluginDatabase.h"
#include "RenderPart.h"
@@ -93,9 +94,115 @@ FrameLoaderClient::~FrameLoaderClient()
g_object_unref(m_policyDecision);
}
-String FrameLoaderClient::userAgent(const KURL&)
+static void initializeDomainsList(HashSet<String>& googleDomains)
+{
+ // Google search domains.
+ googleDomains.add("biz");
+ googleDomains.add("com");
+ googleDomains.add("net");
+ googleDomains.add("org");
+ googleDomains.add("ae");
+ googleDomains.add("ag");
+ googleDomains.add("am");
+ googleDomains.add("at");
+ googleDomains.add("az");
+ googleDomains.add("be");
+ googleDomains.add("bi");
+ googleDomains.add("ca");
+ googleDomains.add("cc");
+ googleDomains.add("cd");
+ googleDomains.add("cg");
+ googleDomains.add("ch");
+ googleDomains.add("cl");
+ googleDomains.add("com.br");
+ googleDomains.add("co.uk");
+ googleDomains.add("co.jp");
+ googleDomains.add("de");
+ googleDomains.add("dj");
+ googleDomains.add("dk");
+ googleDomains.add("es");
+ googleDomains.add("fi");
+ googleDomains.add("fm");
+ googleDomains.add("fr");
+ googleDomains.add("gg");
+ googleDomains.add("gl");
+ googleDomains.add("gm");
+ googleDomains.add("gs");
+ googleDomains.add("hn");
+ googleDomains.add("hu");
+ googleDomains.add("ie");
+ googleDomains.add("it");
+ googleDomains.add("je");
+ googleDomains.add("kz");
+ googleDomains.add("li");
+ googleDomains.add("lt");
+ googleDomains.add("lu");
+ googleDomains.add("lv");
+ googleDomains.add("ma");
+ googleDomains.add("ms");
+ googleDomains.add("mu");
+ googleDomains.add("mw");
+ googleDomains.add("nl");
+ googleDomains.add("no");
+ googleDomains.add("nu");
+ googleDomains.add("pl");
+ googleDomains.add("pn");
+ googleDomains.add("pt");
+ googleDomains.add("ru");
+ googleDomains.add("rw");
+ googleDomains.add("sh");
+ googleDomains.add("sk");
+ googleDomains.add("sm");
+ googleDomains.add("st");
+ googleDomains.add("td");
+ googleDomains.add("tk");
+ googleDomains.add("tp");
+ googleDomains.add("tv");
+ googleDomains.add("us");
+ googleDomains.add("uz");
+ googleDomains.add("ws");
+}
+
+static bool isGoogleDomain(String host)
+{
+ DEFINE_STATIC_LOCAL(HashSet<String>, googleDomains, ());
+ DEFINE_STATIC_LOCAL(Vector<String>, otherGoogleDomains, ());
+
+ if (googleDomains.isEmpty()) {
+ otherGoogleDomains.append("gmail.com");
+ otherGoogleDomains.append("youtube.com");
+ otherGoogleDomains.append("gstatic.com");
+ otherGoogleDomains.append("ytimg.com");
+
+ initializeDomainsList(googleDomains);
+ }
+
+ // First check if this is one of the various google.com international domains.
+ int position = host.find(".google.");
+ if (position > 0 && googleDomains.contains(host.substring(position + sizeof(".google."))))
+ return true;
+
+ // Then we check the possibility of it being one of the other, .com-only google domains.
+ for (unsigned int i = 0; i < otherGoogleDomains.size(); i++) {
+ if (host.endsWith(otherGoogleDomains.at(i)))
+ return true;
+ }
+
+ return false;
+}
+
+String FrameLoaderClient::userAgent(const KURL& url)
{
WebKitWebSettings* settings = webkit_web_view_get_settings(getViewFromFrame(m_frame));
+
+ gboolean useQuirks;
+ g_object_get(settings, "enable-site-specific-quirks", &useQuirks, NULL);
+
+ // For Google domains, drop the browser's custom User Agent string, and use the standard
+ // WebKit/Safari one, so they don't give us a broken experience.
+ if (useQuirks && isGoogleDomain(url.host()))
+ return webkitUserAgent();
+
return String::fromUTF8(webkit_web_settings_get_user_agent(settings));
}
@@ -138,26 +245,15 @@ void FrameLoaderClient::dispatchWillSubmitForm(FramePolicyFunction policyFunctio
(core(m_frame)->loader()->policyChecker()->*policyFunction)(PolicyUse);
}
-
void FrameLoaderClient::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
{
if (!m_pluginView) {
ASSERT(loader->frame());
- // Setting the encoding on the frame loader is our way to get work done that is normally done
- // when the first bit of data is received, even for the case of a document with no data (like about:blank).
- String encoding = loader->overrideEncoding();
- bool userChosen = !encoding.isNull();
- if (!userChosen)
- encoding = loader->response().textEncodingName();
-
- FrameLoader* frameLoader = loader->frameLoader();
- frameLoader->writer()->setEncoding(encoding, userChosen);
- if (data)
- frameLoader->addData(data, length);
+ loader->commitData(data, length);
Frame* coreFrame = loader->frame();
- if (coreFrame && coreFrame->document() && coreFrame->document()->isMediaDocument())
- loader->cancelMainResourceLoad(frameLoader->client()->pluginWillHandleLoadError(loader->response()));
+ if (coreFrame && coreFrame->document()->isMediaDocument())
+ loader->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(loader->response()));
}
if (m_pluginView) {
@@ -859,6 +955,12 @@ bool FrameLoaderClient::canHandleRequest(const ResourceRequest&) const
return true;
}
+bool FrameLoaderClient::canShowMIMETypeAsHTML(const String& MIMEType) const
+{
+ notImplemented();
+ return false;
+}
+
bool FrameLoaderClient::canShowMIMEType(const String& type) const
{
return (MIMETypeRegistry::isSupportedImageMIMEType(type)
@@ -1145,14 +1247,12 @@ static void postCommitFrameViewSetup(WebKitWebFrame *frame, FrameView *view, boo
{
WebKitWebView* containingWindow = getViewFromFrame(frame);
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(containingWindow);
- view->setGtkAdjustments(priv->horizontalAdjustment, priv->verticalAdjustment, resetValues);
+ view->setGtkAdjustments(priv->horizontalAdjustment.get(), priv->verticalAdjustment.get(), resetValues);
if (priv->currentMenu) {
- GtkMenu* menu = priv->currentMenu;
- priv->currentMenu = 0;
-
- gtk_menu_popdown(menu);
- g_object_unref(menu);
+ PlatformRefPtr<GtkMenu> menu(priv->currentMenu);
+ priv->currentMenu.clear();
+ gtk_menu_popdown(menu.get());
}
// Do not allow click counting between main frame loads.
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
index 753576b..c5ffc6a 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
@@ -160,6 +160,7 @@ namespace WebKit {
virtual bool canHandleRequest(const WebCore::ResourceRequest&) const;
virtual bool canShowMIMEType(const WTF::String&) const;
+ virtual bool canShowMIMETypeAsHTML(const String& MIMEType) const;
virtual bool representationExistsForURLScheme(const WTF::String&) const;
virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String&) const;
diff --git a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp
index c95dcff..cf9a548 100644
--- a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp
+++ b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp
@@ -23,6 +23,7 @@
#include "FullscreenVideoController.h"
+#include "GtkVersioning.h"
#include "MediaPlayer.h"
#include <gdk/gdk.h>
diff --git a/WebKit/gtk/tests/testatk.c b/WebKit/gtk/tests/testatk.c
index 9930bc2..9ca7c05 100644
--- a/WebKit/gtk/tests/testatk.c
+++ b/WebKit/gtk/tests/testatk.c
@@ -44,10 +44,12 @@ static const char* contentsInTable = "<html><body><table><tr><td>foo</td><td>bar
static const char* contentsInTableWithHeaders = "<html><body><table><tr><th>foo</th><th>bar</th><th colspan='2'>baz</th></tr><tr><th>qux</th><td>1</td><td>2</td><td>3</td></tr><tr><th rowspan='2'>quux</th><td>4</td><td>5</td><td>6</td></tr><tr><td>6</td><td>7</td><td>8</td></tr><tr><th>corge</th><td>9</td><td>10</td><td>11</td></tr></table><table><tr><td>1</td><td>2</td></tr><tr><td>3</td><td>4</td></tr></table></body></html>";
-static const char* textWithAttributes = "<html><head><style>.st1 {font-family: monospace; color:rgb(120,121,122);} .st2 {text-decoration:underline; background-color:rgb(80,81,82);}</style></head><body><p style=\"font-size:14; text-align:right;\">This is the <i>first</i><b> sentence of this text.</b></p><p class=\"st1\">This sentence should have an style applied <span class=\"st2\">and this part should have another one</span>.</p><p>x<sub>1</sub><sup>2</sup>=x<sub>2</sub><sup>3</sup></p><p style=\"text-align:center;\">This sentence is the <strike>last</strike> one.</p></body></html>";
-
static const char* listsOfItems = "<html><body><ul><li>text only</li><li><a href='foo'>link only</a></li><li>text and a <a href='bar'>link</a></li></ul><ol><li>text only</li><li><a href='foo'>link only</a></li><li>text and a <a href='bar'>link</a></li></ol></body></html>";
+static const char* textForSelections = "<html><body><p>A paragraph with plain text</p><p>A paragraph with <a href='http://webkit.org'>a link</a> in the middle</p></body></html>";
+
+static const char* textWithAttributes = "<html><head><style>.st1 {font-family: monospace; color:rgb(120,121,122);} .st2 {text-decoration:underline; background-color:rgb(80,81,82);}</style></head><body><p style=\"font-size:14; text-align:right;\">This is the <i>first</i><b> sentence of this text.</b></p><p class=\"st1\">This sentence should have an style applied <span class=\"st2\">and this part should have another one</span>.</p><p>x<sub>1</sub><sup>2</sup>=x<sub>2</sub><sup>3</sup></p><p style=\"text-align:center;\">This sentence is the <strike>last</strike> one.</p></body></html>";
+
static gboolean bail_out(GMainLoop* loop)
{
if (g_main_loop_is_running(loop))
@@ -742,6 +744,121 @@ static void testWebkitAtkTextAttributes(void)
atk_attribute_set_free(set3);
}
+static void testWekitAtkTextSelections(void)
+{
+ WebKitWebView* webView;
+ AtkObject* obj;
+ GMainLoop* loop;
+ gchar* selectedText;
+ gint startOffset;
+ gint endOffset;
+ gboolean result;
+
+ webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
+ g_object_ref_sink(webView);
+ GtkAllocation alloc = { 0, 0, 800, 600 };
+ gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc);
+ webkit_web_view_load_string(webView, textForSelections, NULL, NULL, NULL);
+ loop = g_main_loop_new(NULL, TRUE);
+
+ g_timeout_add(100, (GSourceFunc)bail_out, loop);
+ g_main_loop_run(loop);
+
+ obj = gtk_widget_get_accessible(GTK_WIDGET(webView));
+ g_assert(obj);
+
+ AtkText* paragraph1 = ATK_TEXT(atk_object_ref_accessible_child(obj, 0));
+ g_assert(ATK_IS_TEXT(paragraph1));
+ AtkText* paragraph2 = ATK_TEXT(atk_object_ref_accessible_child(obj, 1));
+ g_assert(ATK_IS_TEXT(paragraph2));
+ AtkText* link = ATK_TEXT(atk_object_ref_accessible_child(ATK_OBJECT(paragraph2), 0));
+ g_assert(ATK_IS_TEXT(link));
+
+ // First paragraph (simple text)
+
+ // Basic initial checks
+ g_assert_cmpint(atk_text_get_n_selections(paragraph1), ==, 0);
+ selectedText = atk_text_get_selection(paragraph1, 0, &startOffset, &endOffset);
+ g_assert_cmpint(startOffset, ==, 0);
+ g_assert_cmpint(endOffset, ==, 0);
+ g_assert_cmpstr(selectedText, ==, NULL);
+ g_free (selectedText);
+ // Try removing a non existing (yet) selection
+ result = atk_text_remove_selection(paragraph1, 0);
+ g_assert(!result);
+ // Try setting a 0-char selection
+ result = atk_text_set_selection(paragraph1, 0, 5, 5);
+ g_assert(result);
+
+ // Make a selection and test it
+ result = atk_text_set_selection(paragraph1, 0, 5, 25);
+ g_assert(result);
+ g_assert_cmpint(atk_text_get_n_selections(paragraph1), ==, 1);
+ selectedText = atk_text_get_selection(paragraph1, 0, &startOffset, &endOffset);
+ g_assert_cmpint(startOffset, ==, 5);
+ g_assert_cmpint(endOffset, ==, 25);
+ g_assert_cmpstr(selectedText, ==, "agraph with plain te");
+ g_free (selectedText);
+ // Try removing the selection from other AtkText object (should fail)
+ result = atk_text_remove_selection(paragraph2, 0);
+ g_assert(!result);
+
+ // Remove the selection and test everything again
+ result = atk_text_remove_selection(paragraph1, 0);
+ g_assert(result);
+ g_assert_cmpint(atk_text_get_n_selections(paragraph1), ==, 0);
+ selectedText = atk_text_get_selection(paragraph1, 0, &startOffset, &endOffset);
+ // Now offsets should be the same, set to the last position of the caret
+ g_assert_cmpint(startOffset, ==, endOffset);
+ g_assert_cmpint(startOffset, ==, 25);
+ g_assert_cmpint(endOffset, ==, 25);
+ g_assert_cmpstr(selectedText, ==, NULL);
+ g_free (selectedText);
+
+ // Second paragraph (text + link + text)
+
+ // Set a selection partially covering the link and test it
+ result = atk_text_set_selection(paragraph2, 0, 7, 21);
+ g_assert(result);
+
+ // Test the paragraph first
+ g_assert_cmpint(atk_text_get_n_selections(paragraph2), ==, 1);
+ selectedText = atk_text_get_selection(paragraph2, 0, &startOffset, &endOffset);
+ g_assert_cmpint(startOffset, ==, 7);
+ g_assert_cmpint(endOffset, ==, 21);
+ g_assert_cmpstr(selectedText, ==, "raph with a li");
+ g_free (selectedText);
+
+ // Now test just the link
+ g_assert_cmpint(atk_text_get_n_selections(link), ==, 1);
+ selectedText = atk_text_get_selection(link, 0, &startOffset, &endOffset);
+ g_assert_cmpint(startOffset, ==, 0);
+ g_assert_cmpint(endOffset, ==, 4);
+ g_assert_cmpstr(selectedText, ==, "a li");
+ g_free (selectedText);
+
+ // Remove selections and text everything again
+ result = atk_text_remove_selection(paragraph2, 0);
+ g_assert(result);
+ g_assert_cmpint(atk_text_get_n_selections(paragraph2), ==, 0);
+ selectedText = atk_text_get_selection(paragraph2, 0, &startOffset, &endOffset);
+ // Now offsets should be the same (no selection)
+ g_assert_cmpint(startOffset, ==, endOffset);
+ g_assert_cmpstr(selectedText, ==, NULL);
+ g_free (selectedText);
+
+ g_assert_cmpint(atk_text_get_n_selections(link), ==, 0);
+ selectedText = atk_text_get_selection(link, 0, &startOffset, &endOffset);
+ // Now offsets should be the same (no selection)
+ g_assert_cmpint(startOffset, ==, endOffset);
+ g_assert_cmpstr(selectedText, ==, NULL);
+ g_free (selectedText);
+
+ g_object_unref(paragraph1);
+ g_object_unref(paragraph2);
+ g_object_unref(webView);
+}
+
static void test_webkit_atk_get_extents(void)
{
WebKitWebView* webView;
@@ -876,17 +993,17 @@ static void testWebkitAtkListsOfItems(void)
g_assert(atk_object_get_role(uList) == ATK_ROLE_LIST);
g_assert_cmpint(atk_object_get_n_accessible_children(uList), ==, 3);
- item1 = ATK_TEXT(atk_object_ref_accessible_child(uList, 0));
- item2 = ATK_TEXT(atk_object_ref_accessible_child(uList, 1));
- item3 = ATK_TEXT(atk_object_ref_accessible_child(uList, 2));
+ item1 = atk_object_ref_accessible_child(uList, 0);
+ item2 = atk_object_ref_accessible_child(uList, 1);
+ item3 = atk_object_ref_accessible_child(uList, 2);
g_assert_cmpint(atk_object_get_n_accessible_children(item1), ==, 0);
g_assert_cmpint(atk_object_get_n_accessible_children(item2), ==, 1);
g_assert_cmpint(atk_object_get_n_accessible_children(item3), ==, 1);
- g_assert_cmpstr(atk_text_get_text(item1, 0, -1), ==, "\342\200\242 text only");
- g_assert_cmpstr(atk_text_get_text(item2, 0, -1), ==, "\342\200\242 link only");
- g_assert_cmpstr(atk_text_get_text(item3, 0, -1), ==, "\342\200\242 text and a link");
+ g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item1), 0, -1), ==, "\342\200\242 text only");
+ g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item2), 0, -1), ==, "\342\200\242 link only");
+ g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item3), 0, -1), ==, "\342\200\242 text and a link");
g_object_unref(item1);
g_object_unref(item2);
@@ -899,13 +1016,13 @@ static void testWebkitAtkListsOfItems(void)
g_assert(atk_object_get_role(oList) == ATK_ROLE_LIST);
g_assert_cmpint(atk_object_get_n_accessible_children(oList), ==, 3);
- item1 = ATK_TEXT(atk_object_ref_accessible_child(oList, 0));
- item2 = ATK_TEXT(atk_object_ref_accessible_child(oList, 1));
- item3 = ATK_TEXT(atk_object_ref_accessible_child(oList, 2));
+ item1 = atk_object_ref_accessible_child(oList, 0);
+ item2 = atk_object_ref_accessible_child(oList, 1);
+ item3 = atk_object_ref_accessible_child(oList, 2);
- g_assert_cmpstr(atk_text_get_text(item1, 0, -1), ==, "1 text only");
- g_assert_cmpstr(atk_text_get_text(item2, 0, -1), ==, "2 link only");
- g_assert_cmpstr(atk_text_get_text(item3, 0, -1), ==, "3 text and a link");
+ g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item1), 0, -1), ==, "1 text only");
+ g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item2), 0, -1), ==, "2 link only");
+ g_assert_cmpstr(atk_text_get_text(ATK_TEXT(item3), 0, -1), ==, "3 text and a link");
g_assert_cmpint(atk_object_get_n_accessible_children(item1), ==, 0);
g_assert_cmpint(atk_object_get_n_accessible_children(item2), ==, 1);
@@ -936,6 +1053,7 @@ int main(int argc, char** argv)
g_test_add_func("/webkit/atk/getTextInTable", testWebkitAtkGetTextInTable);
g_test_add_func("/webkit/atk/getHeadersInTable", testWebkitAtkGetHeadersInTable);
g_test_add_func("/webkit/atk/textAttributes", testWebkitAtkTextAttributes);
+ g_test_add_func("/webkit/atk/textSelections", testWekitAtkTextSelections);
g_test_add_func("/webkit/atk/get_extents", test_webkit_atk_get_extents);
g_test_add_func("/webkit/atk/listsOfItems", testWebkitAtkListsOfItems);
return g_test_run ();
diff --git a/WebKit/gtk/webkit/webkitdownload.cpp b/WebKit/gtk/webkit/webkitdownload.cpp
index 9bcb739..1e45250 100644
--- a/WebKit/gtk/webkit/webkitdownload.cpp
+++ b/WebKit/gtk/webkit/webkitdownload.cpp
@@ -60,7 +60,7 @@ class DownloadClient : public Noncopyable, public ResourceHandleClient {
virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
virtual void didReceiveData(ResourceHandle*, const char*, int, int);
- virtual void didFinishLoading(ResourceHandle*);
+ virtual void didFinishLoading(ResourceHandle*, double);
virtual void didFail(ResourceHandle*, const ResourceError&);
virtual void wasBlocked(ResourceHandle*);
virtual void cannotShowURL(ResourceHandle*);
@@ -485,8 +485,9 @@ void webkit_download_start(WebKitDownload* download)
g_return_if_fail(priv->status == WEBKIT_DOWNLOAD_STATUS_CREATED);
g_return_if_fail(priv->timer == NULL);
+ // For GTK, when downloading a file NetworkingContext is null
if (!priv->resourceHandle)
- priv->resourceHandle = ResourceHandle::create(core(priv->networkRequest), priv->downloadClient, 0, false, false);
+ priv->resourceHandle = ResourceHandle::create(/* Null NetworkingContext */ NULL, core(priv->networkRequest), priv->downloadClient, false, false);
else {
priv->resourceHandle->setClient(priv->downloadClient);
@@ -929,7 +930,7 @@ void DownloadClient::didReceiveData(ResourceHandle*, const char* data, int lengt
webkit_download_received_data(m_download, data, length);
}
-void DownloadClient::didFinishLoading(ResourceHandle*)
+void DownloadClient::didFinishLoading(ResourceHandle*, double)
{
webkit_download_finished_loading(m_download);
}
diff --git a/WebKit/gtk/webkit/webkitprivate.cpp b/WebKit/gtk/webkit/webkitprivate.cpp
index 1b7f7a3..aa3d3da 100644
--- a/WebKit/gtk/webkit/webkitprivate.cpp
+++ b/WebKit/gtk/webkit/webkitprivate.cpp
@@ -27,6 +27,7 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameLoaderClientGtk.h"
+#include "FrameNetworkingContextGtk.h"
#include "GtkVersioning.h"
#include "HTMLMediaElement.h"
#include "HTMLNames.h"
@@ -205,11 +206,14 @@ static GtkWidget* currentToplevelCallback(WebKitSoupAuthDialog* feature, SoupMes
if (!d)
return NULL;
- WebCore::Frame* frame = d->m_frame;
- if (!frame)
+ WebKit::FrameNetworkingContextGtk* context = static_cast<WebKit::FrameNetworkingContextGtk*>(d->m_context.get());
+ if (!context)
+ return NULL;
+
+ if (!context->coreFrame())
return NULL;
- GtkWidget* toplevel = gtk_widget_get_toplevel(GTK_WIDGET(frame->page()->chrome()->platformPageClient()));
+ GtkWidget* toplevel = gtk_widget_get_toplevel(GTK_WIDGET(context->coreFrame()->page()->chrome()->platformPageClient()));
if (gtk_widget_is_toplevel(toplevel))
return toplevel;
else
diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h
index bde5b55..616ee6b 100644
--- a/WebKit/gtk/webkit/webkitprivate.h
+++ b/WebKit/gtk/webkit/webkitprivate.h
@@ -59,6 +59,7 @@
#include "FullscreenVideoController.h"
#include "Node.h"
#include "Page.h"
+#include "PlatformString.h"
#include "ResourceHandle.h"
#include "ResourceRequest.h"
#include "ResourceResponse.h"
@@ -133,32 +134,32 @@ extern "C" {
typedef struct _WebKitWebViewPrivate WebKitWebViewPrivate;
struct _WebKitWebViewPrivate {
WebCore::Page* corePage;
- WebKitWebSettings* webSettings;
- WebKitWebInspector* webInspector;
- WebKitWebWindowFeatures* webWindowFeatures;
+ PlatformRefPtr<WebKitWebSettings> webSettings;
+ PlatformRefPtr<WebKitWebInspector> webInspector;
+ PlatformRefPtr<WebKitWebWindowFeatures> webWindowFeatures;
WebKitWebFrame* mainFrame;
- WebKitWebBackForwardList* backForwardList;
+ PlatformRefPtr<WebKitWebBackForwardList> backForwardList;
- GtkMenu* currentMenu;
+ PlatformRefPtr<GtkMenu> currentMenu;
gint lastPopupXPosition;
gint lastPopupYPosition;
HashSet<GtkWidget*> children;
bool editable;
- GtkIMContext* imContext;
+ PlatformRefPtr<GtkIMContext> imContext;
gboolean transparent;
- GtkAdjustment* horizontalAdjustment;
- GtkAdjustment* verticalAdjustment;
+ PlatformRefPtr<GtkAdjustment> horizontalAdjustment;
+ PlatformRefPtr<GtkAdjustment> verticalAdjustment;
gboolean zoomFullContent;
WebKitLoadStatus loadStatus;
- char* encoding;
- char* customEncoding;
+ CString encoding;
+ CString customEncoding;
- char* iconURI;
+ CString iconURI;
gboolean disposing;
gboolean usePrimaryForPaste;
@@ -169,18 +170,17 @@ extern "C" {
// These are hosted here because the DataSource object is
// created too late in the frame loading process.
- WebKitWebResource* mainResource;
- char* mainResourceIdentifier;
- GHashTable* subResources;
- char* tooltipText;
+ PlatformRefPtr<WebKitWebResource> mainResource;
+ CString mainResourceIdentifier;
+ PlatformRefPtr<GHashTable> subResources;
+ CString tooltipText;
int currentClickCount;
- WebCore::IntPoint* previousClickPoint;
+ WebCore::IntPoint previousClickPoint;
guint previousClickButton;
guint32 previousClickTime;
-
- HashMap<GdkDragContext*, RefPtr<WebCore::DataObjectGtk> >* draggingDataObjects;
- HashMap<GdkDragContext*, WebKit::DroppingContext*>* droppingContexts;
+ HashMap<GdkDragContext*, RefPtr<WebCore::DataObjectGtk> > draggingDataObjects;
+ HashMap<GdkDragContext*, WebKit::DroppingContext*> droppingContexts;
};
#define WEBKIT_WEB_FRAME_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_FRAME, WebKitWebFramePrivate))
@@ -206,6 +206,9 @@ extern "C" {
gboolean disposed;
};
+ WTF::String
+ webkitUserAgent();
+
void
webkit_web_frame_core_frame_gone(WebKitWebFrame*);
@@ -283,6 +286,9 @@ extern "C" {
void
webkit_web_view_set_tooltip_text(WebKitWebView*, const char*);
+ GtkMenu*
+ webkit_web_view_get_context_menu(WebKitWebView*);
+
WEBKIT_API void
webkit_web_view_execute_core_command_by_name(WebKitWebView* webView, const gchar* name, const gchar* value);
diff --git a/WebKit/gtk/webkit/webkitwebsettings.cpp b/WebKit/gtk/webkit/webkitwebsettings.cpp
index 71a338c..767fce1 100644
--- a/WebKit/gtk/webkit/webkitwebsettings.cpp
+++ b/WebKit/gtk/webkit/webkitwebsettings.cpp
@@ -163,56 +163,62 @@ enum {
// Create a default user agent string
// This is a liberal interpretation of http://www.mozilla.org/build/revised-user-agent-strings.html
// See also http://developer.apple.com/internet/safari/faq.html#anchor2
-static String webkit_get_user_agent()
+static String webkitPlatform()
{
- gchar* platform;
- gchar* osVersion;
-
#if PLATFORM(X11)
- platform = g_strdup("X11");
+ DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("X11")));
#elif OS(WINDOWS)
- platform = g_strdup("Windows");
+ DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("Windows")));
#elif PLATFORM(MAC)
- platform = g_strdup("Macintosh");
+ DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("Macintosh")));
#elif defined(GDK_WINDOWING_DIRECTFB)
- platform = g_strdup("DirectFB");
+ DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("DirectFB")));
#else
- platform = g_strdup("Unknown");
+ DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("Unknown")));
#endif
+ return uaPlatform;
+}
+
+static String webkitOSVersion()
+{
// FIXME: platform/version detection can be shared.
#if OS(DARWIN)
#if CPU(X86)
- osVersion = g_strdup("Intel Mac OS X");
+ DEFINE_STATIC_LOCAL(const String, uaOSVersion, (String("Intel Mac OS X")));
#else
- osVersion = g_strdup("PPC Mac OS X");
+ DEFINE_STATIC_LOCAL(const String, uaOSVersion, (String("PPC Mac OS X")));
#endif
#elif OS(UNIX)
+ DEFINE_STATIC_LOCAL(String, uaOSVersion, (String()));
+
+ if (!uaOSVersion.isEmpty())
+ return uaOSVersion;
+
struct utsname name;
if (uname(&name) != -1)
- osVersion = g_strdup_printf("%s %s", name.sysname, name.machine);
+ uaOSVersion = String::format("%s %s", name.sysname, name.machine);
else
- osVersion = g_strdup("Unknown");
-
+ uaOSVersion = String("Unknown");
#elif OS(WINDOWS)
- // FIXME: Compute the Windows version
- osVersion = g_strdup("Windows");
-
+ DEFINE_STATIC_LOCAL(const String, uaOSVersion, (String("Windows")));
#else
- osVersion = g_strdup("Unknown");
+ DEFINE_STATIC_LOCAL(const String, uaOSVersion, (String("Unknown")));
#endif
+ return uaOSVersion;
+}
+
+String webkitUserAgent()
+{
// We mention Safari since many broken sites check for it (OmniWeb does this too)
// We re-use the WebKit version, though it doesn't seem to matter much in practice
DEFINE_STATIC_LOCAL(const String, uaVersion, (String::format("%d.%d+", WEBKIT_USER_AGENT_MAJOR_VERSION, WEBKIT_USER_AGENT_MINOR_VERSION)));
- DEFINE_STATIC_LOCAL(const String, staticUA, (String::format("Mozilla/5.0 (%s; U; %s; %s) AppleWebKit/%s (KHTML, like Gecko) Safari/%s",
- platform, osVersion, defaultLanguage().utf8().data(), uaVersion.utf8().data(), uaVersion.utf8().data())));
-
- g_free(osVersion);
- g_free(platform);
+ DEFINE_STATIC_LOCAL(const String, staticUA, (String::format("Mozilla/5.0 (%s; U; %s; %s) AppleWebKit/%s (KHTML, like Gecko) Version/5.0 Safari/%s",
+ webkitPlatform().utf8().data(), webkitOSVersion().utf8().data(), defaultLanguage().utf8().data(), uaVersion.utf8().data(), uaVersion.utf8().data())));
return staticUA;
}
@@ -607,7 +613,7 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
g_param_spec_string("user-agent",
_("User Agent"),
_("The User-Agent string used by WebKitGtk"),
- webkit_get_user_agent().utf8().data(),
+ webkitUserAgent().utf8().data(),
flags));
/**
@@ -1034,7 +1040,7 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
case PROP_USER_AGENT:
g_free(priv->user_agent);
if (!g_value_get_string(value) || !strlen(g_value_get_string(value)))
- priv->user_agent = g_strdup(webkit_get_user_agent().utf8().data());
+ priv->user_agent = g_strdup(webkitUserAgent().utf8().data());
else
priv->user_agent = g_strdup(g_value_get_string(value));
break;
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index 480983f..3212450 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -210,11 +210,7 @@ static GtkIMContext* webkit_web_view_get_im_context(WebKitWebView*);
static void destroy_menu_cb(GtkObject* object, gpointer data)
{
- WebKitWebView* webView = WEBKIT_WEB_VIEW(data);
- WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
-
- g_object_unref(priv->currentMenu);
- priv->currentMenu = NULL;
+ WEBKIT_WEB_VIEW(data)->priv->currentMenu = 0;
}
static void PopupMenuPositionFunc(GtkMenu* menu, gint *x, gint *y, gboolean *pushIn, gpointer userData)
@@ -224,7 +220,11 @@ static void PopupMenuPositionFunc(GtkMenu* menu, gint *x, gint *y, gboolean *pus
GdkScreen* screen = gtk_widget_get_screen(GTK_WIDGET(view));
GtkRequisition menuSize;
+#ifdef GTK_API_VERSION_2
gtk_widget_size_request(GTK_WIDGET(menu), &menuSize);
+#else
+ gtk_size_request_get_size(GTK_SIZE_REQUEST(menu), &menuSize, NULL);
+#endif
*x = priv->lastPopupXPosition;
if ((*x + menuSize.width) >= gdk_screen_get_width(screen))
@@ -304,7 +304,7 @@ static gboolean webkit_web_view_forward_context_menu_event(WebKitWebView* webVie
return FALSE;
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
- priv->currentMenu = GTK_MENU(g_object_ref(menu));
+ priv->currentMenu = menu;
priv->lastPopupXPosition = event.globalX();
priv->lastPopupYPosition = event.globalY();
@@ -592,7 +592,7 @@ static gboolean webkit_web_view_key_release_event(GtkWidget* widget, GdkEventKey
// the event if we don't have a pending composition, because that means we
// are using a context like 'simple' which marks every keystroke as filtered.
WebKit::EditorClient* client = static_cast<WebKit::EditorClient*>(core(webView)->editorClient());
- if (gtk_im_context_filter_keypress(webView->priv->imContext, event) && !client->hasPendingComposition())
+ if (gtk_im_context_filter_keypress(webView->priv->imContext.get(), event) && !client->hasPendingComposition())
return TRUE;
Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
@@ -651,8 +651,8 @@ static gboolean webkit_web_view_button_press_event(GtkWidget* widget, GdkEventBu
// GDK logic for counting clicks.
guint32 eventTime = getEventTime(reinterpret_cast<GdkEvent*>(event));
if ((event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS)
- || ((abs(event->x - priv->previousClickPoint->x()) < doubleClickDistance)
- && (abs(event->y - priv->previousClickPoint->y()) < doubleClickDistance)
+ || ((abs(event->x - priv->previousClickPoint.x()) < doubleClickDistance)
+ && (abs(event->y - priv->previousClickPoint.y()) < doubleClickDistance)
&& (eventTime - priv->previousClickTime < static_cast<guint>(doubleClickTime))
&& (event->button == priv->previousClickButton)))
priv->currentClickCount++;
@@ -661,7 +661,7 @@ static gboolean webkit_web_view_button_press_event(GtkWidget* widget, GdkEventBu
PlatformMouseEvent platformEvent(event);
platformEvent.setClickCount(priv->currentClickCount);
- *priv->previousClickPoint = platformEvent.pos();
+ priv->previousClickPoint = platformEvent.pos();
priv->previousClickButton = event->button;
priv->previousClickTime = eventTime;
@@ -702,7 +702,7 @@ static gboolean webkit_web_view_button_release_event(GtkWidget* widget, GdkEvent
if (focusedFrame && focusedFrame->editor()->canEdit()) {
#ifdef MAEMO_CHANGES
WebKitWebViewPrivate* priv = webView->priv;
- hildon_gtk_im_context_filter_event(priv->imContext, (GdkEvent*)event);
+ hildon_gtk_im_context_filter_event(priv->imContext.get(), (GdkEvent*)event);
#endif
}
@@ -806,7 +806,7 @@ static gboolean webkit_web_view_focus_in_event(GtkWidget* widget, GdkEventFocus*
focusController->setFocusedFrame(core(webView)->mainFrame());
if (focusController->focusedFrame()->editor()->canEdit())
- gtk_im_context_focus_in(webView->priv->imContext);
+ gtk_im_context_focus_in(webView->priv->imContext.get());
}
return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->focus_in_event(widget, event);
}
@@ -824,7 +824,7 @@ static gboolean webkit_web_view_focus_out_event(GtkWidget* widget, GdkEventFocus
}
if (webView->priv->imContext)
- gtk_im_context_focus_out(webView->priv->imContext);
+ gtk_im_context_focus_out(webView->priv->imContext.get());
return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->focus_out_event(widget, event);
}
@@ -875,7 +875,7 @@ static void webkit_web_view_realize(GtkWidget* widget)
WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
WebKitWebViewPrivate* priv = webView->priv;
- gtk_im_context_set_client_window(priv->imContext, window);
+ gtk_im_context_set_client_window(priv->imContext.get(), window);
}
static void webkit_web_view_set_scroll_adjustments(WebKitWebView* webView, GtkAdjustment* hadj, GtkAdjustment* vadj)
@@ -883,26 +883,12 @@ static void webkit_web_view_set_scroll_adjustments(WebKitWebView* webView, GtkAd
if (!core(webView))
return;
- FrameView* view = core(webkit_web_view_get_main_frame(webView))->view();
-
- if (hadj)
- g_object_ref(hadj);
- if (vadj)
- g_object_ref(vadj);
-
- WebKitWebViewPrivate* priv = webView->priv;
-
- if (priv->horizontalAdjustment)
- g_object_unref(priv->horizontalAdjustment);
- if (priv->verticalAdjustment)
- g_object_unref(priv->verticalAdjustment);
-
- priv->horizontalAdjustment = hadj;
- priv->verticalAdjustment = vadj;
+ webView->priv->horizontalAdjustment = hadj;
+ webView->priv->verticalAdjustment = vadj;
+ FrameView* view = core(webkit_web_view_get_main_frame(webView))->view();
if (!view)
return;
-
view->setGtkAdjustments(hadj, vadj);
}
@@ -1158,78 +1144,42 @@ static void webkit_web_view_dispose(GObject* object)
priv->disposing = TRUE;
- if (priv->horizontalAdjustment) {
- g_object_unref(priv->horizontalAdjustment);
- priv->horizontalAdjustment = NULL;
- }
-
- if (priv->verticalAdjustment) {
- g_object_unref(priv->verticalAdjustment);
- priv->verticalAdjustment = NULL;
- }
-
- if (priv->backForwardList) {
- g_object_unref(priv->backForwardList);
- priv->backForwardList = NULL;
- }
+ // These smart pointers are cleared manually, because some cleanup operations are
+ // very sensitive to their value. We may crash if these are done in the wrong order.
+ priv->horizontalAdjustment.clear();
+ priv->verticalAdjustment.clear();
+ priv->backForwardList.clear();
if (priv->corePage) {
webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(object));
-
core(priv->mainFrame)->loader()->detachFromParent();
delete priv->corePage;
- priv->corePage = NULL;
+ priv->corePage = 0;
}
if (priv->webSettings) {
- g_signal_handlers_disconnect_by_func(priv->webSettings, (gpointer)webkit_web_view_settings_notify, webView);
- g_object_unref(priv->webSettings);
- priv->webSettings = NULL;
-
- g_object_unref(priv->webInspector);
- priv->webInspector = NULL;
-
- g_object_unref(priv->webWindowFeatures);
- priv->webWindowFeatures = NULL;
-
- g_object_unref(priv->imContext);
- priv->imContext = NULL;
- }
-
- if (priv->mainResource) {
- g_object_unref(priv->mainResource);
- priv->mainResource = NULL;
+ g_signal_handlers_disconnect_by_func(priv->webSettings.get(), (gpointer)webkit_web_view_settings_notify, webView);
+ priv->webSettings.clear();
}
- if (priv->subResources) {
- g_hash_table_unref(priv->subResources);
- priv->subResources = NULL;
- }
+ priv->webInspector.clear();
+ priv->webWindowFeatures.clear();
+ priv->mainResource.clear();
+ priv->subResources.clear();
- priv->draggingDataObjects->clear();
- HashMap<GdkDragContext*, DroppingContext*>::iterator endDroppingContexts = priv->droppingContexts->end();
- for (HashMap<GdkDragContext*, DroppingContext*>::iterator iter = priv->droppingContexts->begin(); iter != endDroppingContexts; ++iter)
+ HashMap<GdkDragContext*, DroppingContext*>::iterator endDroppingContexts = priv->droppingContexts.end();
+ for (HashMap<GdkDragContext*, DroppingContext*>::iterator iter = priv->droppingContexts.begin(); iter != endDroppingContexts; ++iter)
delete (iter->second);
- priv->droppingContexts->clear();
+ priv->droppingContexts.clear();
G_OBJECT_CLASS(webkit_web_view_parent_class)->dispose(object);
}
static void webkit_web_view_finalize(GObject* object)
{
- WebKitWebView* webView = WEBKIT_WEB_VIEW(object);
- WebKitWebViewPrivate* priv = webView->priv;
-
- g_free(priv->tooltipText);
- g_free(priv->mainResourceIdentifier);
- g_free(priv->encoding);
- g_free(priv->customEncoding);
- g_free(priv->iconURI);
-
- delete priv->previousClickPoint;
- delete priv->draggingDataObjects;
- delete priv->droppingContexts;
-
+ // We need to manually call the destructor here, since this object's memory is managed
+ // by GLib. This calls all C++ members' destructors and prevents memory leaks.
+ WEBKIT_WEB_VIEW(object)->priv->~WebKitWebViewPrivate();
G_OBJECT_CLASS(webkit_web_view_parent_class)->finalize(object);
}
@@ -1279,7 +1229,7 @@ static AtkObject* webkit_web_view_get_accessible(GtkWidget* widget)
static gdouble webViewGetDPI(WebKitWebView* webView)
{
WebKitWebViewPrivate* priv = webView->priv;
- WebKitWebSettings* webSettings = priv->webSettings;
+ WebKitWebSettings* webSettings = priv->webSettings.get();
gboolean enforce96DPI;
g_object_get(webSettings, "enforce-96-dpi", &enforce96DPI, NULL);
if (enforce96DPI)
@@ -1305,7 +1255,7 @@ static void webkit_web_view_screen_changed(GtkWidget* widget, GdkScreen* previou
if (priv->disposing)
return;
- WebKitWebSettings* webSettings = priv->webSettings;
+ WebKitWebSettings* webSettings = priv->webSettings.get();
Settings* settings = core(webView)->settings();
gdouble DPI = webViewGetDPI(webView);
@@ -1339,10 +1289,10 @@ static void webkit_web_view_drag_end(GtkWidget* widget, GdkDragContext* context)
// This might happen if a drag is still in progress after a WebKitWebView
// is disposed and before it is finalized.
- if (!priv->draggingDataObjects->contains(context))
+ if (!priv->draggingDataObjects.contains(context))
return;
- priv->draggingDataObjects->remove(context);
+ priv->draggingDataObjects.remove(context);
Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
if (!frame)
@@ -1377,10 +1327,10 @@ static void webkit_web_view_drag_data_get(GtkWidget* widget, GdkDragContext* con
// This might happen if a drag is still in progress after a WebKitWebView
// is diposed and before it is finalized.
- if (!priv->draggingDataObjects->contains(context))
+ if (!priv->draggingDataObjects.contains(context))
return;
- pasteboardHelperInstance()->fillSelectionData(selectionData, info, priv->draggingDataObjects->get(context).get());
+ pasteboardHelperInstance()->fillSelectionData(selectionData, info, priv->draggingDataObjects.get(context).get());
}
static gboolean doDragLeaveLater(DroppingContext* context)
@@ -1388,7 +1338,7 @@ static gboolean doDragLeaveLater(DroppingContext* context)
WebKitWebView* webView = context->webView;
WebKitWebViewPrivate* priv = webView->priv;
- if (!priv->droppingContexts->contains(context->gdkContext))
+ if (!priv->droppingContexts.contains(context->gdkContext))
return FALSE;
// If the view doesn't know about the drag yet (there are still pending data)
@@ -1405,7 +1355,7 @@ static gboolean doDragLeaveLater(DroppingContext* context)
}
core(webView)->dragController()->dragEnded();
- priv->droppingContexts->remove(context->gdkContext);
+ priv->droppingContexts.remove(context->gdkContext);
delete context;
return FALSE;
}
@@ -1415,13 +1365,13 @@ static void webkit_web_view_drag_leave(GtkWidget* widget, GdkDragContext* contex
WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
WebKitWebViewPrivate* priv = webView->priv;
- if (!priv->droppingContexts->contains(context))
+ if (!priv->droppingContexts.contains(context))
return;
// During a drop GTK+ will fire a drag-leave signal right before firing
// the drag-drop signal. We want the actions for drag-leave to happen after
// those for drag-drop, so schedule them to happen asynchronously here.
- g_timeout_add(0, reinterpret_cast<GSourceFunc>(doDragLeaveLater), priv->droppingContexts->get(context));
+ g_timeout_add(0, reinterpret_cast<GSourceFunc>(doDragLeaveLater), priv->droppingContexts.get(context));
}
static gboolean webkit_web_view_drag_motion(GtkWidget* widget, GdkDragContext* context, gint x, gint y, guint time)
@@ -1431,21 +1381,21 @@ static gboolean webkit_web_view_drag_motion(GtkWidget* widget, GdkDragContext* c
DroppingContext* droppingContext = 0;
IntPoint position = IntPoint(x, y);
- if (!priv->droppingContexts->contains(context)) {
+ if (!priv->droppingContexts.contains(context)) {
droppingContext = new DroppingContext;
droppingContext->webView = webView;
droppingContext->gdkContext = context;
droppingContext->dataObject = WebCore::DataObjectGtk::create();
droppingContext->dropHappened = false;
droppingContext->lastMotionPosition = position;
- priv->droppingContexts->set(context, droppingContext);
+ priv->droppingContexts.set(context, droppingContext);
Vector<GdkAtom> acceptableTargets(pasteboardHelperInstance()->dropAtomsForContext(widget, context));
droppingContext->pendingDataRequests = acceptableTargets.size();
for (size_t i = 0; i < acceptableTargets.size(); i++)
gtk_drag_get_data(widget, context, acceptableTargets.at(i), time);
} else {
- droppingContext = priv->droppingContexts->get(context);
+ droppingContext = priv->droppingContexts.get(context);
droppingContext->lastMotionPosition = position;
}
@@ -1468,10 +1418,10 @@ static void webkit_web_view_drag_data_received(GtkWidget* widget, GdkDragContext
WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
WebKitWebViewPrivate* priv = webView->priv;
- if (!priv->droppingContexts->contains(context))
+ if (!priv->droppingContexts.contains(context))
return;
- DroppingContext* droppingContext = priv->droppingContexts->get(context);
+ DroppingContext* droppingContext = priv->droppingContexts.get(context);
droppingContext->pendingDataRequests--;
pasteboardHelperInstance()->fillDataObjectFromDropData(selectionData, info, droppingContext->dataObject.get());
@@ -1493,10 +1443,10 @@ static gboolean webkit_web_view_drag_drop(GtkWidget* widget, GdkDragContext* con
WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
WebKitWebViewPrivate* priv = webView->priv;
- if (!priv->droppingContexts->contains(context))
+ if (!priv->droppingContexts.contains(context))
return FALSE;
- DroppingContext* droppingContext = priv->droppingContexts->get(context);
+ DroppingContext* droppingContext = priv->droppingContexts.get(context);
droppingContext->dropHappened = true;
IntPoint position(x, y);
@@ -1512,8 +1462,8 @@ static gboolean webkit_web_view_query_tooltip(GtkWidget *widget, gint x, gint y,
{
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(widget);
- if (priv->tooltipText) {
- gtk_tooltip_set_text(tooltip, priv->tooltipText);
+ if (priv->tooltipText.length() > 0) {
+ gtk_tooltip_set_text(tooltip, priv->tooltipText.data());
return TRUE;
}
@@ -1524,7 +1474,7 @@ static gboolean webkit_web_view_query_tooltip(GtkWidget *widget, gint x, gint y,
static GtkIMContext* webkit_web_view_get_im_context(WebKitWebView* webView)
{
g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
- return GTK_IM_CONTEXT(webView->priv->imContext);
+ return GTK_IM_CONTEXT(webView->priv->imContext.get());
}
static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
@@ -2892,7 +2842,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
static void webkit_web_view_update_settings(WebKitWebView* webView)
{
WebKitWebViewPrivate* priv = webView->priv;
- WebKitWebSettings* webSettings = priv->webSettings;
+ WebKitWebSettings* webSettings = priv->webSettings.get();
Settings* settings = core(webView)->settings();
gchar* defaultEncoding, *cursiveFontFamily, *defaultFontFamily, *fantasyFontFamily, *monospaceFontFamily, *sansSerifFontFamily, *serifFontFamily, *userStylesheetUri;
@@ -3095,8 +3045,14 @@ static void webkit_web_view_init(WebKitWebView* webView)
{
WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
webView->priv = priv;
+ // This is the placement new syntax: http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.10
+ // It allows us to call a constructor on manually allocated locations in memory. We must use it
+ // in this case, because GLib manages the memory for the private data section, but we wish it
+ // to contain C++ object members. The use of placement new calls the constructor on all C++ data
+ // members, which ensures they are initialized properly.
+ new (priv) WebKitWebViewPrivate();
- priv->imContext = gtk_im_multicontext_new();
+ priv->imContext = adoptPlatformRef(gtk_im_multicontext_new());
Page::PageClients pageClients;
pageClients.chromeClient = new WebKit::ChromeClient(webView);
@@ -3108,40 +3064,33 @@ static void webkit_web_view_init(WebKitWebView* webView)
// We also add a simple wrapper class to provide the public
// interface for the Web Inspector.
- priv->webInspector = WEBKIT_WEB_INSPECTOR(g_object_new(WEBKIT_TYPE_WEB_INSPECTOR, NULL));
- webkit_web_inspector_set_inspector_client(priv->webInspector, priv->corePage);
+ priv->webInspector = adoptPlatformRef(WEBKIT_WEB_INSPECTOR(g_object_new(WEBKIT_TYPE_WEB_INSPECTOR, NULL)));
+ webkit_web_inspector_set_inspector_client(priv->webInspector.get(), priv->corePage);
+ // The smart pointer will call g_object_ref_sink on these adjustments.
priv->horizontalAdjustment = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
priv->verticalAdjustment = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
- g_object_ref_sink(priv->horizontalAdjustment);
- g_object_ref_sink(priv->verticalAdjustment);
-
gtk_widget_set_can_focus(GTK_WIDGET(webView), TRUE);
priv->mainFrame = WEBKIT_WEB_FRAME(webkit_web_frame_new(webView));
priv->lastPopupXPosition = priv->lastPopupYPosition = -1;
priv->editable = false;
- priv->backForwardList = webkit_web_back_forward_list_new_with_web_view(webView);
+ priv->backForwardList = adoptPlatformRef(webkit_web_back_forward_list_new_with_web_view(webView));
priv->zoomFullContent = FALSE;
- priv->webSettings = webkit_web_settings_new();
+ priv->webSettings = adoptPlatformRef(webkit_web_settings_new());
webkit_web_view_update_settings(webView);
- g_signal_connect(priv->webSettings, "notify", G_CALLBACK(webkit_web_view_settings_notify), webView);
+ g_signal_connect(priv->webSettings.get(), "notify", G_CALLBACK(webkit_web_view_settings_notify), webView);
- priv->webWindowFeatures = webkit_web_window_features_new();
+ priv->webWindowFeatures = adoptPlatformRef(webkit_web_window_features_new());
- priv->subResources = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref);
+ priv->subResources = adoptPlatformRef(g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref));
- priv->tooltipText = 0;
priv->currentClickCount = 0;
- priv->previousClickPoint = new IntPoint(0, 0);
priv->previousClickButton = 0;
priv->previousClickTime = 0;
-
- priv->draggingDataObjects = new HashMap<GdkDragContext*, RefPtr<WebCore::DataObjectGtk> >();
- priv->droppingContexts = new HashMap<GdkDragContext*, DroppingContext*>();
gtk_drag_dest_set(GTK_WIDGET(webView), static_cast<GtkDestDefaults>(0), 0, 0, static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_PRIVATE));
gtk_drag_dest_set_target_list(GTK_WIDGET(webView), pasteboardHelperInstance()->targetList());
}
@@ -3211,9 +3160,7 @@ void webkit_web_view_set_settings(WebKitWebView* webView, WebKitWebSettings* web
g_return_if_fail(WEBKIT_IS_WEB_SETTINGS(webSettings));
WebKitWebViewPrivate* priv = webView->priv;
- g_signal_handlers_disconnect_by_func(priv->webSettings, (gpointer)webkit_web_view_settings_notify, webView);
- g_object_unref(priv->webSettings);
- g_object_ref(webSettings);
+ g_signal_handlers_disconnect_by_func(priv->webSettings.get(), (gpointer)webkit_web_view_settings_notify, webView);
priv->webSettings = webSettings;
webkit_web_view_update_settings(webView);
g_signal_connect(webSettings, "notify", G_CALLBACK(webkit_web_view_settings_notify), webView);
@@ -3235,10 +3182,8 @@ void webkit_web_view_set_settings(WebKitWebView* webView, WebKitWebSettings* web
*/
WebKitWebSettings* webkit_web_view_get_settings(WebKitWebView* webView)
{
- g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
-
- WebKitWebViewPrivate* priv = webView->priv;
- return priv->webSettings;
+ g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
+ return webView->priv->webSettings.get();
}
/**
@@ -3257,26 +3202,18 @@ WebKitWebSettings* webkit_web_view_get_settings(WebKitWebView* webView)
*/
WebKitWebInspector* webkit_web_view_get_inspector(WebKitWebView* webView)
{
- g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
-
- WebKitWebViewPrivate* priv = webView->priv;
- return priv->webInspector;
+ g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
+ return webView->priv->webInspector.get();
}
// internal
static void webkit_web_view_set_window_features(WebKitWebView* webView, WebKitWebWindowFeatures* webWindowFeatures)
{
- WebKitWebViewPrivate* priv = webView->priv;
-
if (!webWindowFeatures)
return;
-
- if (webkit_web_window_features_equal(priv->webWindowFeatures, webWindowFeatures))
+ if (webkit_web_window_features_equal(webView->priv->webWindowFeatures.get(), webWindowFeatures))
return;
-
- g_object_unref(priv->webWindowFeatures);
- g_object_ref(webWindowFeatures);
- priv->webWindowFeatures = webWindowFeatures;
+ webView->priv->webWindowFeatures = webWindowFeatures;
}
/**
@@ -3292,10 +3229,8 @@ static void webkit_web_view_set_window_features(WebKitWebView* webView, WebKitWe
*/
WebKitWebWindowFeatures* webkit_web_view_get_window_features(WebKitWebView* webView)
{
- g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
-
- WebKitWebViewPrivate* priv = webView->priv;
- return priv->webWindowFeatures;
+ g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
+ return webView->priv->webWindowFeatures.get();
}
/**
@@ -3359,14 +3294,10 @@ void webkit_web_view_set_maintains_back_forward_list(WebKitWebView* webView, gbo
*/
WebKitWebBackForwardList* webkit_web_view_get_back_forward_list(WebKitWebView* webView)
{
- g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
-
- WebKitWebViewPrivate* priv = webView->priv;
-
+ g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
if (!core(webView) || !core(webView)->backForwardList()->enabled())
- return NULL;
-
- return priv->backForwardList;
+ return 0;
+ return webView->priv->backForwardList.get();
}
/**
@@ -4075,11 +4006,8 @@ gfloat webkit_web_view_get_zoom_level(WebKitWebView* webView)
if (!frame)
return 1.0f;
- FrameView* view = frame->view();
- if (!view)
- return 1;
-
- return view->zoomFactor();
+ WebKitWebViewPrivate* priv = webView->priv;
+ return priv->zoomFullContent ? frame->pageZoomFactor() : frame->textZoomFactor();
}
static void webkit_web_view_apply_zoom_level(WebKitWebView* webView, gfloat zoomLevel)
@@ -4088,12 +4016,11 @@ static void webkit_web_view_apply_zoom_level(WebKitWebView* webView, gfloat zoom
if (!frame)
return;
- FrameView* view = frame->view();
- if (!view)
- return;
-
WebKitWebViewPrivate* priv = webView->priv;
- view->setZoomFactor(zoomLevel, priv->zoomFullContent ? ZoomPage : ZoomTextOnly);
+ if (priv->zoomFullContent)
+ frame->setPageZoomFactor(zoomLevel);
+ else
+ frame->setTextZoomFactor(zoomLevel);
}
/**
@@ -4133,7 +4060,7 @@ void webkit_web_view_zoom_in(WebKitWebView* webView)
WebKitWebViewPrivate* priv = webView->priv;
gfloat zoomMultiplierRatio;
- g_object_get(priv->webSettings, "zoom-step", &zoomMultiplierRatio, NULL);
+ g_object_get(priv->webSettings.get(), "zoom-step", &zoomMultiplierRatio, NULL);
webkit_web_view_set_zoom_level(webView, webkit_web_view_get_zoom_level(webView) + zoomMultiplierRatio);
}
@@ -4154,7 +4081,7 @@ void webkit_web_view_zoom_out(WebKitWebView* webView)
WebKitWebViewPrivate* priv = webView->priv;
gfloat zoomMultiplierRatio;
- g_object_get(priv->webSettings, "zoom-step", &zoomMultiplierRatio, NULL);
+ g_object_get(priv->webSettings.get(), "zoom-step", &zoomMultiplierRatio, NULL);
webkit_web_view_set_zoom_level(webView, webkit_web_view_get_zoom_level(webView) - zoomMultiplierRatio);
}
@@ -4196,8 +4123,17 @@ void webkit_web_view_set_full_content_zoom(WebKitWebView* webView, gboolean zoom
if (priv->zoomFullContent == zoomFullContent)
return;
+ Frame* frame = core(webView)->mainFrame();
+ if (!frame)
+ return;
+
+ gfloat zoomLevel = priv->zoomFullContent ? frame->pageZoomFactor() : frame->textZoomFactor();
+
priv->zoomFullContent = zoomFullContent;
- webkit_web_view_apply_zoom_level(webView, webkit_web_view_get_zoom_level(webView));
+ if (priv->zoomFullContent)
+ frame->setPageAndTextZoomFactors(zoomLevel, 1);
+ else
+ frame->setPageAndTextZoomFactors(1, zoomLevel);
g_object_notify(G_OBJECT(webView), "full-content-zoom");
}
@@ -4246,16 +4182,11 @@ gdouble webkit_web_view_get_progress(WebKitWebView* webView)
const gchar* webkit_web_view_get_encoding(WebKitWebView* webView)
{
g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
-
String encoding = core(webView)->mainFrame()->loader()->writer()->encoding();
-
- if (!encoding.isEmpty()) {
- WebKitWebViewPrivate* priv = webView->priv;
- g_free(priv->encoding);
- priv->encoding = g_strdup(encoding.utf8().data());
- return priv->encoding;
- } else
- return NULL;
+ if (encoding.isEmpty())
+ return 0;
+ webView->priv->encoding = encoding.utf8();
+ return webView->priv->encoding.data();
}
/**
@@ -4289,16 +4220,11 @@ void webkit_web_view_set_custom_encoding(WebKitWebView* webView, const char* enc
const char* webkit_web_view_get_custom_encoding(WebKitWebView* webView)
{
g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
-
String overrideEncoding = core(webView)->mainFrame()->loader()->documentLoader()->overrideEncoding();
-
- if (!overrideEncoding.isEmpty()) {
- WebKitWebViewPrivate* priv = webView->priv;
- g_free (priv->customEncoding);
- priv->customEncoding = g_strdup(overrideEncoding.utf8().data());
- return priv->customEncoding;
- } else
- return NULL;
+ if (overrideEncoding.isEmpty())
+ return 0;
+ webView->priv->customEncoding = overrideEncoding.utf8();
+ return webView->priv->customEncoding.data();
}
/**
@@ -4520,27 +4446,26 @@ void webkit_web_view_add_resource(WebKitWebView* webView, const char* identifier
WebKitWebViewPrivate* priv = webView->priv;
if (!priv->mainResource) {
- priv->mainResource = webResource;
- priv->mainResourceIdentifier = g_strdup(identifier);
+ priv->mainResource = adoptPlatformRef(webResource);
+ priv->mainResourceIdentifier = identifier;
return;
}
- g_hash_table_insert(priv->subResources, g_strdup(identifier), webResource);
+ g_hash_table_insert(priv->subResources.get(), g_strdup(identifier), webResource);
}
WebKitWebResource* webkit_web_view_get_resource(WebKitWebView* webView, char* identifier)
{
WebKitWebViewPrivate* priv = webView->priv;
- gpointer webResource = NULL;
-
- gboolean resourceFound = g_hash_table_lookup_extended(priv->subResources, identifier, NULL, &webResource);
+ gpointer webResource = 0;
+ gboolean resourceFound = g_hash_table_lookup_extended(priv->subResources.get(), identifier, NULL, &webResource);
// The only resource we do not store in this hash table is the
// main! If we did not find a request, it probably means the load
// has been interrupted while while a resource was still being
// loaded.
- if (!resourceFound && !g_str_equal(identifier, priv->mainResourceIdentifier))
- return NULL;
+ if (!resourceFound && !g_str_equal(identifier, priv->mainResourceIdentifier.data()))
+ return 0;
if (!webResource)
return webkit_web_view_get_main_resource(webView);
@@ -4550,30 +4475,24 @@ WebKitWebResource* webkit_web_view_get_resource(WebKitWebView* webView, char* id
WebKitWebResource* webkit_web_view_get_main_resource(WebKitWebView* webView)
{
- return webView->priv->mainResource;
+ return webView->priv->mainResource.get();
}
void webkit_web_view_clear_resources(WebKitWebView* webView)
{
WebKitWebViewPrivate* priv = webView->priv;
-
- g_free(priv->mainResourceIdentifier);
- priv->mainResourceIdentifier = NULL;
-
- if (priv->mainResource) {
- g_object_unref(priv->mainResource);
- priv->mainResource = NULL;
- }
+ priv->mainResourceIdentifier = "";
+ priv->mainResource = 0;
if (priv->subResources)
- g_hash_table_remove_all(priv->subResources);
+ g_hash_table_remove_all(priv->subResources.get());
}
GList* webkit_web_view_get_subresources(WebKitWebView* webView)
{
WebKitWebViewPrivate* priv = webView->priv;
- GList* subResources = g_hash_table_get_values(priv->subResources);
- return g_list_remove(subResources, priv->mainResource);
+ GList* subResources = g_hash_table_get_values(priv->subResources.get());
+ return g_list_remove(subResources, priv->mainResource.get());
}
/* From EventHandler.cpp */
@@ -4589,12 +4508,11 @@ void webkit_web_view_set_tooltip_text(WebKitWebView* webView, const char* toolti
{
#if GTK_CHECK_VERSION(2, 12, 0)
WebKitWebViewPrivate* priv = webView->priv;
- g_free(priv->tooltipText);
if (tooltip && *tooltip != '\0') {
- priv->tooltipText = g_strdup(tooltip);
+ priv->tooltipText = tooltip;
gtk_widget_set_has_tooltip(GTK_WIDGET(webView), TRUE);
} else {
- priv->tooltipText = 0;
+ priv->tooltipText = "";
gtk_widget_set_has_tooltip(GTK_WIDGET(webView), FALSE);
}
@@ -4646,15 +4564,10 @@ WebKitHitTestResult* webkit_web_view_get_hit_test_result(WebKitWebView* webView,
*/
G_CONST_RETURN gchar* webkit_web_view_get_icon_uri(WebKitWebView* webView)
{
- g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
-
- Page* corePage = core(webView);
- String iconURL = iconDatabase()->iconURLForPageURL(corePage->mainFrame()->loader()->url().prettyURL());
-
- WebKitWebViewPrivate* priv = webView->priv;
- g_free(priv->iconURI);
- priv->iconURI = g_strdup(iconURL.utf8().data());
- return priv->iconURI;
+ g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
+ String iconURL = iconDatabase()->iconURLForPageURL(core(webView)->mainFrame()->loader()->url().prettyURL());
+ webView->priv->iconURI = iconURL.utf8();
+ return webView->priv->iconURI.data();
}
/**
@@ -4805,3 +4718,17 @@ gboolean webkit_web_view_is_command_enabled(WebKitWebView* webView, const gchar*
return core(webView)->focusController()->focusedOrMainFrame()->editor()->command(name).isEnabled();
}
+
+GtkMenu* webkit_web_view_get_context_menu(WebKitWebView* webView)
+{
+ g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
+
+#if ENABLE(CONTEXT_MENUS)
+ ContextMenu* menu = core(webView)->contextMenuController()->contextMenu();
+ if (!menu)
+ return 0;
+ return menu->platformDescription();
+#else
+ return 0;
+#endif
+}
diff --git a/WebKit/haiku/ChangeLog b/WebKit/haiku/ChangeLog
index 986b00f..718c4c3 100644
--- a/WebKit/haiku/ChangeLog
+++ b/WebKit/haiku/ChangeLog
@@ -1,3 +1,45 @@
+2010-09-13 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Paste should be implemented in WebCore like Copy and Cut for Mac also.
+ https://bugs.webkit.org/show_bug.cgi?id=45494
+ <rdar://problem/7660537>
+
+ On the Mac platform, the implementation of the paste operation is all done
+ at the WebKit level. In order to support it on WebKit2 it is necessary to
+ refactor the code and move this functionality at the level of WebCore like
+ we already have on Windows.
+ The original code relies on some in AppKit functions that call back into
+ WebKit causing problems in WebKit2. All this functionality has been moved
+ at the level of the editor client where it can be dealt with appropriately.
+
+ * WebCoreSupport/FrameLoaderClientHaiku.cpp:
+ (WebCore::FrameLoaderClientHaiku::canShowMIMETypeAsHTML): Added stub.
+ * WebCoreSupport/FrameLoaderClientHaiku.h:
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ * WebCoreSupport/FrameLoaderClientHaiku.cpp:
+ (WebCore::FrameLoaderClientHaiku::committedLoad):
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Main resource bytes shouldn't bounce through FrameLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45496
+
+ Now return the bytes to the DocumentLoader.
+
+ * WebCoreSupport/FrameLoaderClientHaiku.cpp:
+ (WebCore::FrameLoaderClientHaiku::committedLoad):
+
2010-08-06 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig
diff --git a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
index 430194a..705a333 100644
--- a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
+++ b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
@@ -361,6 +361,12 @@ void FrameLoaderClientHaiku::finishedLoading(DocumentLoader*)
notImplemented();
}
+bool FrameLoaderClientHaiku::canShowMIMETypeAsHTML(const String& MIMEType) const
+{
+ notImplemented();
+ return false;
+}
+
bool FrameLoaderClientHaiku::canShowMIMEType(const String& MIMEType) const
{
notImplemented();
@@ -506,12 +512,7 @@ void FrameLoaderClientHaiku::setMainDocumentError(WebCore::DocumentLoader*, cons
void FrameLoaderClientHaiku::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
{
- if (!m_frame)
- return;
-
- FrameLoader* frameLoader = loader->frameLoader();
- frameLoader->writer()->setEncoding(m_response.textEncodingName(), false);
- frameLoader->addData(data, length);
+ loader->commitData(data, length);
}
WebCore::ResourceError FrameLoaderClientHaiku::cancelledError(const WebCore::ResourceRequest& request)
diff --git a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
index dfe5747..eafbfc3 100644
--- a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
+++ b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
@@ -130,6 +130,7 @@ namespace WebCore {
virtual void finishedLoading(DocumentLoader*);
virtual bool canShowMIMEType(const String& MIMEType) const;
+ virtual bool canShowMIMETypeAsHTML(const String& MIMEType) const;
virtual bool representationExistsForURLScheme(const String& URLScheme) const;
virtual String generatedMIMETypeForURLScheme(const String& URLScheme) const;
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index df5ca46..a43b4c5 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,444 @@
+2010-09-20 Andy Estes <aestes@apple.com>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION (HTML5 Parser): Pages broken due to <tag<tag> parsing changes
+ https://bugs.webkit.org/show_bug.cgi?id=40961
+
+ Implement WebKitUsePreHTML5ParserQuirks preference.
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]): Default WebKitUsePreHTML5ParserQuirks to
+ false.
+ (-[WebPreferences usePreHTML5ParserQuirks]):
+ (-[WebPreferences setUsePreHTML5ParserQuirks:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]): Update WebCore::Settings
+ with the value of WebKitUsePreHTML5ParserQuirks when a preference
+ changes.
+
+2010-09-20 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Pasteboard doesn't work in WebKit2.
+ https://bugs.webkit.org/show_bug.cgi?id=42317
+ <rdar://problem/7660537>
+
+ Some changes to fix style inconsistencies.
+ Added OBJC 2.0 style enumeration.
+
+ * WebCoreSupport/WebEditorClient.h:
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::userVisibleString):
+ (createExcludedElementsForAttributedStringConversion):
+ (WebEditorClient::documentFragmentFromAttributedString): Changed parameter to be
+ a Vector of RefPtr.
+ (WebEditorClient::setInsertionPasteboard):
+ (WebEditorClient::pasteboardTypesForSelection):
+
+2010-09-17 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45993, convert printing to the new pagination model.
+
+ Make printing store the page height in the RenderView and push that into the layout state to
+ use the new pagination model. The old pagination model is retained because it is still used
+ for embedded WebViews.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _adjustedBottomOfPageWithTop:bottom:limit:]):
+
+2010-09-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ REGRESSION (r60104): Zoom level is unexpectedly reset on page reload
+ https://bugs.webkit.org/show_bug.cgi?id=42863
+
+ * WebView/WebView.mm:
+ (-[WebView _setZoomMultiplier:isTextOnly:]):
+ Call functions on Frame instead of FrameView.
+
+2010-09-17 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Reduce minimum DOMTimer interval
+ https://bugs.webkit.org/show_bug.cgi?id=45362
+
+ * WebView/WebView.mm: Added in a call to set the mimimum allowed DOMTimer to 4ms.
+
+2010-09-17 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Add WebKitAccelerated2dCanvasEnabled flag to WebKit for Mac
+ https://bugs.webkit.org/show_bug.cgi?id=45911
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences accelerated2dCanvasEnabled]):
+ (-[WebPreferences setAccelerated2dCanvasEnabled:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
+2010-09-17 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ WebKit should use system wide spell checking preference when application specific one isn't set.
+ https://bugs.webkit.org/show_bug.cgi?id=45789
+ <rdar://problem/8416041>
+
+ * WebView/WebView.mm:
+ (+[WebView initialize]): Use system wide autocorrection and text substitution preferences
+ when the application level preferences are not set.
+
+2010-09-16 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/8395558>
+ https://bugs.webkit.org/show_bug.cgi?id=45938
+ _web_makePluginViewsPerformSelector:: mutates subviews array while iterating it
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _web_makePluginSubviewsPerformSelector:withObject:]):
+ Converted from -[NSArray _web_makePluginViewsPerformSelector:withObject:]. The old method
+ was only ever called on the result of -[WebHTMLView subviews]. By moving that knowledge into
+ this helper method, it can't be used incorrectly. Now it makes a copy of [WebHTMLView subviews]
+ before enumerating it, to ensure that the selector can't mutate the array being enumerated.
+ (-[WebHTMLView viewWillMoveToHostWindow:]):
+ Updated for _web_makePluginSubviewsPerformSelector:: signature change.
+ (-[WebHTMLView viewDidMoveToHostWindow]):
+ Ditto.
+
+2010-09-16 Darin Adler <darin@apple.com>
+
+ Reviewed by Andreas Kling.
+
+ Reduce use of HTMLInputElement::inputType so we can remove it later
+ https://bugs.webkit.org/show_bug.cgi?id=45903
+
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation elementDoesAutoComplete:]): Use isPasswordField.
+ (-[WebHTMLRepresentation elementIsPassword:]): Use isPasswordField.
+
+2010-09-16 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Darin Adler.
+
+ Always use a valid string when setting WebKitUserStyleSheetLocationPreferenceKey.
+ https://bugs.webkit.org/show_bug.cgi?id=41510
+
+ This prevents usage of nil value, which would cause an uncaught exception.
+
+ * WebView/WebPreferences.mm:
+ (-[WebPreferences setUserStyleSheetLocation:]):
+
+2010-09-16 Dan Bernstein <mitz@apple.com>
+
+ Reverted the previous change because r67628 has been reverted.
+
+ * WebCoreSupport/WebPlatformStrategies.h:
+ * WebCoreSupport/WebPlatformStrategies.mm:
+
+2010-09-16 Dan Bernstein <mitz@apple.com>
+
+ Build fix after r67628. Added context menu item localizable strings for the items
+ added in r67628, following equivalent menu items in Mac OS X when possible. However,
+ this set of menu items does not make much sense for Mac OS X, and this should be
+ addressed separately.
+
+ * WebCoreSupport/WebPlatformStrategies.h:
+ * WebCoreSupport/WebPlatformStrategies.mm:
+ (WebPlatformStrategies::contextMenuItemTagOpenMediaInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagCopyMediaLinkToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagToggleMediaControls):
+ (WebPlatformStrategies::contextMenuItemTagToggleMediaLoop):
+ (WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen):
+ (WebPlatformStrategies::contextMenuItemTagMediaPlay):
+ (WebPlatformStrategies::contextMenuItemTagMediaPause):
+ (WebPlatformStrategies::contextMenuItemTagMediaMute):
+ (WebPlatformStrategies::contextMenuItemTagMediaUnMute):
+
+2010-09-16 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by Jian Li.
+
+ Unify FILE_SYSTEM and FILE_WRITER enables under the name FILE_SYSTEM.
+ https://bugs.webkit.org/show_bug.cgi?id=45798
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2010-09-15 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Adam Roben.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44715
+ maps.google.com flips upside down when zooming map using trackpad in WebKit2 on Mac
+
+ Move geometry flipping to platform-specific code.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView attachRootLayer:]):
+
+2010-09-14 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Only intercept ESC key press when autocorrection UI is visible.
+ https://bugs.webkit.org/show_bug.cgi?id=45071
+
+ * WebCoreSupport/WebEditorClient.h: Added declaration of isShowingCorrectionPanel(),
+ which provides an inteface to query whether autocorrection panel is shown.
+
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::WebEditorClient): Defined a constant, InvalidCorrectionPanelTag,
+ for invalid correction panel tag. Replaced -1 with this constant.
+ (WebEditorClient::dismissCorrectionPanel): Ditto
+ (WebEditorClient::isShowingCorrectionPanel): Query whether autocorrection panel is shown.
+
+2010-09-14 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by John Sullivan.
+
+ Part of <rdar://problem/8420003>. Make it possible to override the version number used in linked-in-or-after checks.
+
+ * Misc/WebKitVersionChecks.h: Remove two unused functions from the header and add a method to set the overriden version.
+ * Misc/WebKitVersionChecks.m:
+ (WebKitLinkedOnOrAfter):
+ (setWebKitLinkTimeVersion): Set the overridden version.
+ (WebKitLinkTimeVersion): Return the overridden version if set, otherwise do the old thing.
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences setWebKitLinkTimeVersion:]): Call through to set the overridden version.
+ * WebView/WebPreferencesPrivate.h:
+
+2010-09-14 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, reverting changes r67451 and r67451.
+ Broke lots of builders.
+
+ Only intercept ESC key press when autocorrection UI is visible.
+ https://bugs.webkit.org/show_bug.cgi?id=45071
+
+ * WebCoreSupport/WebEditorClient.h:
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::WebEditorClient):
+ (WebEditorClient::dismissCorrectionPanel):
+
+2010-09-14 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Only intercept ESC key press when autocorrection UI is visible.
+ https://bugs.webkit.org/show_bug.cgi?id=45071
+
+ * WebCoreSupport/WebEditorClient.h: Added declaration of isShowingCorrectionPanel(),
+ which provides an inteface to query whether autocorrection panel is shown.
+
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::WebEditorClient): Defined a constant, InvalidCorrectionPanelTag,
+ for invalid correction panel tag. Replaced -1 with this constant.
+ (WebEditorClient::dismissCorrectionPanel): Ditto
+ (WebEditorClient::isShowingCorrectionPanel): Query whether autocorrection panel is shown.
+
+2010-09-13 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Preparation for eliminating deprecatedParseURL
+ https://bugs.webkit.org/show_bug.cgi?id=45695
+
+ * DOM/WebDOMOperations.mm:
+ (-[DOMDocument webFrame]): Get rid of unneeded local variable.
+ (-[DOMDocument URLWithAttributeString:]): Remove unhelpful comment.
+
+2010-09-13 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Paste should be implemented in WebCore like Copy and Cut for Mac also.
+ https://bugs.webkit.org/show_bug.cgi?id=45494
+ <rdar://problem/7660537>
+
+ On the Mac platform, the implementation of the paste operation is all done
+ at the WebKit level. In order to support it on WebKit2 it is necessary to
+ refactor the code and move this functionality at the level of WebCore like
+ we already have on Windows.
+ The original code relies on some in AppKit functions that call back into
+ WebKit causing problems in WebKit2. All this functionality has been moved
+ at the level of the editor client where it can be dealt with appropriately.
+
+ * WebCoreSupport/WebEditorClient.h:
+ * WebCoreSupport/WebEditorClient.mm:
+ (excludedElementsForAttributedStringConversion):
+ (WebEditorClient::documentFragmentFromAttributedString): Added.
+ (WebEditorClient::setInsertionPasteboard):
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::canShowMIMETypeAsHTML): Re-implemented at the level
+ of the editor client.
+ * WebView/WebHTMLView.mm: Removed paste method.
+
+2010-09-13 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Adam Roben.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45677
+ [WebView canMarkAllTextMatches] can crash if called after [WebView close]
+
+ <rdar://problem/8404890>
+
+ * WebView/WebView.mm:
+ (-[WebView canMarkAllTextMatches]):
+ Return NO immediately if the webview has already been closed. This was an overlooked
+ case from the fix for 45175.
+
+2010-09-10 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Tony Chang.
+
+ [Chromium] Implement textInputController.hasSpellingMarker() for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45441
+
+ Moved the actual logic of hasSpellingMarker into WebCore to share
+ it with other ports.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame hasSpellingMarker:length:]):
+
+2010-09-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Sam Weinig.
+
+ Make SecurityOrigin::canDisplay an instance function
+ https://bugs.webkit.org/show_bug.cgi?id=45219
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::loadRequest):
+ * Plugins/WebNetscapePluginStream.mm:
+ (WebNetscapePluginStream::WebNetscapePluginStream):
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
+ * Plugins/WebPluginContainerCheck.mm:
+ (-[WebPluginContainerCheck _isForbiddenFileLoad]):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _allowsFollowingLink:]):
+
+2010-09-10 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove unnecessary constraint in WebCore of choosing either text zoom or full page zoom.
+ Precursor to <rdar://problem/7660657>
+ https://bugs.webkit.org/show_bug.cgi?id=45522
+
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+ (-[WebView _setZoomMultiplier:isTextOnly:]):
+ (-[WebView _realZoomMultiplierIsTextOnly]):
+ * WebView/WebViewData.h:
+ * WebView/WebViewData.mm:
+ (-[WebViewPrivate init]):
+ Move tracking of text only zoom here from WebCore.
+
+2010-09-10 Stephanie Lewis <slewis@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Refactor JavaScriptCore memory statistics so that WebKit doesn't need to know about the JIT and
+ other implementation details of JavaScriptCore. Necessary to fix PPC build.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45528
+
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics memoryStatistics]):
+
+2010-09-10 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Move some Dashboard stuff from WebCore to WebKit along with a bit more FrameMac cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=45582
+
+ * MigrateHeaders.make: Removed WebDashboardRegion.h from the set of header to copy.
+
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::dashboardRegionsChanged): Changed this to call
+ -[WebView _dashboardRegions] so we don't have two copies of that code.
+
+ * WebView/WebDashboardRegion.h: Copied from WebCore/page/mac/WebDashboardRegion.h.
+ * WebView/WebDashboardRegion.mm: Copied from WebCore/page/mac/WebDashboardRegion.m.
+
+ * WebView/WebView.mm:
+ (-[WebView _dashboardRegions]): Moved the code from Frame::dashboardRegions here.
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ This code is the most confused, but now should be a bit cleaner.
+ There's still a magical fake-setting for creating renderers that needs
+ to be cleaned up, but we can do that in a separate patch.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _commitData:]):
+ * WebView/WebFrameInternal.h:
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation receivedData:withDataSource:]):
+ (-[WebHTMLRepresentation finishedLoadingWithDataSource:]):
+
+2010-09-09 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Move functions from Frame to SelectionController as planned
+ https://bugs.webkit.org/show_bug.cgi?id=45508
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _selectionGranularity]):
+ (-[WebFrame _insertParagraphSeparatorInQuotedContent]):
+ (-[WebFrame _typingStyle]):
+ (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation currentForm]):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView jumpToSelection:]):
+ (-[WebHTMLView centerSelectionInVisibleArea:]):
+ (-[WebHTMLView _canSmartCopyOrDelete]):
+ (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
+ (-[WebHTMLView selectionRect]):
+ (-[WebHTMLView selectionTextRects]):
+ (-[WebHTMLView selectionImageRect]):
+ * WebView/WebView.mm:
+ (-[WebView setEditable:]):
+ Call functions on selection().
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Main resource bytes shouldn't bounce through FrameLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45496
+
+ Now return the bytes to the DocumentLoader.
+
+ Previously, we were checking the document for null. However, Frame can
+ never have a null document, so this check is no longer needed.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _addData:]):
+
2010-09-09 John Therrell <jtherrell@apple.com>
Reviewed by Alexey Proskuryakov.
diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig
index 8f8c213..81d912f 100644
--- a/WebKit/mac/Configurations/FeatureDefines.xcconfig
+++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig
@@ -69,7 +69,6 @@ ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
ENABLE_FILTERS = $(ENABLE_FILTERS_$(REAL_PLATFORM_NAME));
ENABLE_FILTERS_macosx = ENABLE_FILTERS;
-ENABLE_FILE_WRITER = ;
ENABLE_FILE_SYSTEM = ;
ENABLE_FULLSCREEN_API = ENABLE_FULLSCREEN_API;
ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
@@ -121,4 +120,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_WRITER) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig
index 9f9441c..67bf769 100644
--- a/WebKit/mac/Configurations/Version.xcconfig
+++ b/WebKit/mac/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 8;
+MINOR_VERSION = 9;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/WebKit/mac/DOM/WebDOMOperations.mm b/WebKit/mac/DOM/WebDOMOperations.mm
index d21f2b0..3d69836 100644
--- a/WebKit/mac/DOM/WebDOMOperations.mm
+++ b/WebKit/mac/DOM/WebDOMOperations.mm
@@ -121,8 +121,7 @@ using namespace JSC;
- (WebFrame *)webFrame
{
- Document* document = core(self);
- Frame* frame = document->frame();
+ Frame* frame = core(self)->frame();
if (!frame)
return nil;
return kit(frame);
@@ -130,7 +129,6 @@ using namespace JSC;
- (NSURL *)URLWithAttributeString:(NSString *)string
{
- // FIXME: Is deprecatedParseURL appropriate here?
return core(self)->completeURL(deprecatedParseURL(string));
}
diff --git a/WebKit/mac/MigrateHeaders.make b/WebKit/mac/MigrateHeaders.make
index 83e2e08..2e6f24a 100644
--- a/WebKit/mac/MigrateHeaders.make
+++ b/WebKit/mac/MigrateHeaders.make
@@ -180,7 +180,6 @@ all : \
$(PUBLIC_HEADERS_DIR)/DOMXPathExpression.h \
$(PUBLIC_HEADERS_DIR)/DOMXPathNSResolver.h \
$(PUBLIC_HEADERS_DIR)/DOMXPathResult.h \
- $(PRIVATE_HEADERS_DIR)/WebDashboardRegion.h \
$(PUBLIC_HEADERS_DIR)/WebScriptObject.h \
$(PUBLIC_HEADERS_DIR)/npapi.h \
$(PUBLIC_HEADERS_DIR)/npfunctions.h \
diff --git a/WebKit/mac/Misc/WebCoreStatistics.mm b/WebKit/mac/Misc/WebCoreStatistics.mm
index cc68cef..5b5a1bc 100644
--- a/WebKit/mac/Misc/WebCoreStatistics.mm
+++ b/WebKit/mac/Misc/WebCoreStatistics.mm
@@ -29,11 +29,10 @@
#import "WebCoreStatistics.h"
#import "DOMElementInternal.h"
-#import <JavaScriptCore/RegisterFile.h>
-#import <JavaScriptCore/ExecutableAllocator.h>
#import "WebCache.h"
#import "WebFrameInternal.h"
-#import <runtime/JSLock.h>
+#import <JavaScriptCore/JSLock.h>
+#import <JavaScriptCore/MemoryStatistics.h>
#import <WebCore/Console.h>
#import <WebCore/FontCache.h>
#import <WebCore/Frame.h>
@@ -196,18 +195,19 @@ using namespace WebCore;
+ (NSDictionary *)memoryStatistics
{
WTF::FastMallocStatistics fastMallocStatistics = WTF::fastMallocStatistics();
+
JSLock lock(SilenceAssertionsOnly);
- Heap::Statistics jsHeapStatistics = JSDOMWindow::commonJSGlobalData()->heap.statistics();
- size_t jscStackBytes = RegisterFile::committedByteCount();
- size_t jscJITBytes = ExecutableAllocator::committedByteCount();
+ Heap::Statistics heapMemoryStats = heapStatistics(JSDOMWindow::commonJSGlobalData());
+ GlobalMemoryStatistics globalMemoryStats = globalMemoryStatistics();
+
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:fastMallocStatistics.reservedVMBytes], @"FastMallocReservedVMBytes",
[NSNumber numberWithInt:fastMallocStatistics.committedVMBytes], @"FastMallocCommittedVMBytes",
[NSNumber numberWithInt:fastMallocStatistics.freeListBytes], @"FastMallocFreeListBytes",
- [NSNumber numberWithInt:jsHeapStatistics.size], @"JavaScriptHeapSize",
- [NSNumber numberWithInt:jsHeapStatistics.free], @"JavaScriptFreeSize",
- [NSNumber numberWithUnsignedInt:(unsigned int)jscStackBytes], @"JavaScriptStackSize",
- [NSNumber numberWithUnsignedInt:(unsigned int)jscJITBytes], @"JavaScriptJITSize",
+ [NSNumber numberWithInt:heapMemoryStats.size], @"JavaScriptHeapSize",
+ [NSNumber numberWithInt:heapMemoryStats.free], @"JavaScriptFreeSize",
+ [NSNumber numberWithUnsignedInt:(unsigned int)globalMemoryStats.stackBytes], @"JavaScriptStackSize",
+ [NSNumber numberWithUnsignedInt:(unsigned int)globalMemoryStats.JITBytes], @"JavaScriptJITSize",
nil];
}
diff --git a/WebKit/mac/Misc/WebKitVersionChecks.h b/WebKit/mac/Misc/WebKitVersionChecks.h
index 8b34c94..94286d6 100644
--- a/WebKit/mac/Misc/WebKitVersionChecks.h
+++ b/WebKit/mac/Misc/WebKitVersionChecks.h
@@ -30,9 +30,9 @@
Version numbers are based on the 'current library version' specified in the WebKit build rules.
All of these methods return or take version numbers with each part shifted to the left 2 bytes.
For example the version 1.2.3 is returned as 0x00010203 and version 200.3.5 is returned as 0x00C80305
- A version of -1 is returned if the main executable did not link against WebKit (should never happen).
+ A version of -1 is returned if the main executable did not link against WebKit.
- Please use the current WebKit version number, available in WebKit/Configurations/Version.xcconfig,
+ Please use the current WebKit version number, available in WebKit/mac/Configurations/Version.xcconfig,
when adding a new version constant.
*/
@@ -60,8 +60,7 @@ extern "C" {
#endif
BOOL WebKitLinkedOnOrAfter(int version);
-int WebKitLinkTimeVersion(void);
-int WebKitRunTimeVersion(void);
+void setWebKitLinkTimeVersion(int);
#ifdef __cplusplus
}
diff --git a/WebKit/mac/Misc/WebKitVersionChecks.m b/WebKit/mac/Misc/WebKitVersionChecks.m
index 5659273..a63e10b 100644
--- a/WebKit/mac/Misc/WebKitVersionChecks.m
+++ b/WebKit/mac/Misc/WebKitVersionChecks.m
@@ -29,17 +29,23 @@
#import "WebKitVersionChecks.h"
#import <mach-o/dyld.h>
+static int WebKitLinkTimeVersion(void);
+static int overridenWebKitLinkTimeVersion;
+
BOOL WebKitLinkedOnOrAfter(int version)
{
- return (WebKitLinkTimeVersion() >= version);
+ return (WebKitLinkTimeVersion() >= version);
}
-int WebKitLinkTimeVersion(void)
+void setWebKitLinkTimeVersion(int version)
{
- return NSVersionOfLinkTimeLibrary("WebKit");
+ overridenWebKitLinkTimeVersion = version;
}
-int WebKitRunTimeVersion(void)
+static int WebKitLinkTimeVersion(void)
{
- return NSVersionOfRunTimeLibrary("WebKit");
+ if (overridenWebKitLinkTimeVersion)
+ return overridenWebKitLinkTimeVersion;
+
+ return NSVersionOfLinkTimeLibrary("WebKit");
}
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index 88df4cf..c0c480b 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -762,7 +762,7 @@ NPError NetscapePluginInstanceProxy::loadRequest(NSURLRequest *request, const ch
return NPERR_GENERIC_ERROR;
}
} else {
- if (!SecurityOrigin::canDisplay(URL, String(), core([m_pluginView webFrame])->document()))
+ if (!core([m_pluginView webFrame])->document()->securityOrigin()->canDisplay(URL))
return NPERR_GENERIC_ERROR;
}
diff --git a/WebKit/mac/Plugins/WebNetscapePluginStream.mm b/WebKit/mac/Plugins/WebNetscapePluginStream.mm
index 35af439..f39b104 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginStream.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginStream.mm
@@ -161,7 +161,7 @@ WebNetscapePluginStream::WebNetscapePluginStream(NSURLRequest *request, NPP plug
WebNetscapePluginView *view = (WebNetscapePluginView *)plugin->ndata;
// This check has already been done by the plug-in view.
- ASSERT(SecurityOrigin::canDisplay([request URL], String(), core([view webFrame])->document()));
+ ASSERT(core([view webFrame])->document()->securityOrigin()->canDisplay([request URL]));
ASSERT([request URL]);
ASSERT(plugin);
diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.mm b/WebKit/mac/Plugins/WebNetscapePluginView.mm
index e98c6b7..3d5d7a1 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginView.mm
@@ -1728,7 +1728,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
return NPERR_INVALID_PARAM;
}
} else {
- if (!SecurityOrigin::canDisplay(URL, String(), core([self webFrame])->document()))
+ if (!core([self webFrame])->document()->securityOrigin()->canDisplay(URL))
return NPERR_GENERIC_ERROR;
}
diff --git a/WebKit/mac/Plugins/WebPluginContainerCheck.mm b/WebKit/mac/Plugins/WebPluginContainerCheck.mm
index e273bfc..30368a8 100644
--- a/WebKit/mac/Plugins/WebPluginContainerCheck.mm
+++ b/WebKit/mac/Plugins/WebPluginContainerCheck.mm
@@ -99,7 +99,7 @@ using namespace WebCore;
{
Frame* coreFrame = core([_controller webFrame]);
ASSERT(coreFrame);
- if (!SecurityOrigin::canDisplay([_request URL], String(), coreFrame->document())) {
+ if (!coreFrame->document()->securityOrigin()->canDisplay([_request URL])) {
[self _continueWithPolicy:PolicyIgnore];
return YES;
}
diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
index d973e2b..68e17be 100644
--- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
@@ -71,8 +71,6 @@
#import <wtf/PassRefPtr.h>
#import <wtf/Vector.h>
-
-
#if USE(ACCELERATED_COMPOSITING)
#import <WebCore/GraphicsLayer.h>
#endif
@@ -111,6 +109,7 @@ using namespace WebCore;
@end
#if ENABLE(FULLSCREEN_API)
+
@interface WebKitFullScreenListener : NSObject <WebKitFullScreenListener>
{
RefPtr<Element> _element;
@@ -118,6 +117,7 @@ using namespace WebCore;
- (id)initWithElement:(Element*)element;
@end
+
#endif
WebChromeClient::WebChromeClient(WebView *webView)
@@ -564,6 +564,7 @@ void WebChromeClient::print(Frame* frame)
}
#if ENABLE(DATABASE)
+
void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
@@ -579,9 +580,11 @@ void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& database
END_BLOCK_OBJC_EXCEPTIONS;
}
+
#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+
void WebChromeClient::reachedMaxAppCacheSize(int64_t spaceNeeded)
{
// FIXME: Free some space.
@@ -597,6 +600,7 @@ void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin* origin)
END_BLOCK_OBJC_EXCEPTIONS;
}
+
#endif
void WebChromeClient::populateVisitedLinks()
@@ -616,17 +620,14 @@ void WebChromeClient::populateVisitedLinks()
}
#if ENABLE(DASHBOARD_SUPPORT)
+
void WebChromeClient::dashboardRegionsChanged()
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
-
- NSMutableDictionary *regions = core([m_webView mainFrame])->dashboardRegionsDictionary();
- [m_webView _addScrollerDashboardRegions:regions];
-
- CallUIDelegate(m_webView, @selector(webView:dashboardRegionsChanged:), regions);
-
+ CallUIDelegate(m_webView, @selector(webView:dashboardRegionsChanged:), [m_webView _dashboardRegions]);
END_BLOCK_OBJC_EXCEPTIONS;
}
+
#endif
FloatRect WebChromeClient::customHighlightRect(Node* node, const AtomicString& type, const FloatRect& lineRect)
@@ -954,7 +955,9 @@ void WebChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geoloca
@end
#if ENABLE(FULLSCREEN_API)
+
@implementation WebKitFullScreenListener
+
- (id)initWithElement:(Element*)element
{
if (!(self = [super init]))
@@ -989,4 +992,5 @@ void WebChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geoloca
}
@end
+
#endif
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.h b/WebKit/mac/WebCoreSupport/WebEditorClient.h
index fe33e05..ad324b9 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.h
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.h
@@ -70,9 +70,11 @@ public:
virtual void didWriteSelectionToPasteboard();
virtual void didSetSelectionTypesForPasteboard();
- virtual NSString* userVisibleString(NSURL*);
+ virtual NSString* userVisibleString(NSURL *);
+ virtual WebCore::DocumentFragment* documentFragmentFromAttributedString(NSAttributedString *, Vector< RefPtr<WebCore::ArchiveResource> >&);
+ virtual void setInsertionPasteboard(NSPasteboard *);
#ifdef BUILDING_ON_TIGER
- virtual NSArray* pasteboardTypesForSelection(WebCore::Frame*);
+ virtual NSArray *pasteboardTypesForSelection(WebCore::Frame*);
#endif
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
@@ -133,6 +135,7 @@ public:
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
virtual void showCorrectionPanel(const WebCore::FloatRect& boundingBoxOfReplacedString, const WTF::String& replacedString, const WTF::String& replacementString, WebCore::Editor*);
virtual void dismissCorrectionPanel(bool correctionAccepted);
+ virtual bool isShowingCorrectionPanel();
#endif
private:
void registerCommandForUndoOrRedo(PassRefPtr<WebCore::EditCommand>, bool isRedo);
diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.mm b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
index 41cff68..2bf3259 100644
--- a/WebKit/mac/WebCoreSupport/WebEditorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebEditorClient.mm
@@ -30,6 +30,7 @@
#import "WebEditorClient.h"
#import "DOMCSSStyleDeclarationInternal.h"
+#import "DOMDocumentFragmentInternal.h"
#import "DOMHTMLElementInternal.h"
#import "DOMHTMLInputElementInternal.h"
#import "DOMHTMLTextAreaElementInternal.h"
@@ -48,8 +49,11 @@
#import "WebKitVersionChecks.h"
#import "WebLocalizableStrings.h"
#import "WebNSURLExtras.h"
+#import "WebResourceInternal.h"
#import "WebViewInternal.h"
+#import <WebCore/ArchiveResource.h>
#import <WebCore/Document.h>
+#import <WebCore/DocumentFragment.h>
#import <WebCore/EditAction.h>
#import <WebCore/EditCommand.h>
#import <WebCore/HTMLInputElement.h>
@@ -73,11 +77,18 @@ using namespace WTF;
using namespace HTMLNames;
+@interface NSAttributedString (WebNSAttributedStringDetails)
+- (id)_initWithDOMRange:(DOMRange*)range;
+- (DOMDocumentFragment*)_documentFromRange:(NSRange)range document:(DOMDocument*)document documentAttributes:(NSDictionary *)dict subresources:(NSArray **)subresources;
+@end
+
static WebViewInsertAction kit(EditorInsertAction coreAction)
{
return static_cast<WebViewInsertAction>(coreAction);
}
+static const int InvalidCorrectionPanelTag = 0;
+
#ifdef BUILDING_ON_TIGER
@interface NSSpellChecker (NotYetPublicMethods)
- (void)learnWord:(NSString *)word;
@@ -175,7 +186,7 @@ WebEditorClient::WebEditorClient(WebView *webView)
, m_undoTarget([[[WebEditorUndoTarget alloc] init] autorelease])
, m_haveUndoRedoOperations(false)
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
- , m_correctionPanelTag(-1)
+ , m_correctionPanelTag(InvalidCorrectionPanelTag)
#endif
{
}
@@ -325,13 +336,54 @@ void WebEditorClient::didSetSelectionTypesForPasteboard()
[[m_webView _editingDelegateForwarder] webView:m_webView didSetSelectionTypesForPasteboard:[NSPasteboard generalPasteboard]];
}
-NSString* WebEditorClient::userVisibleString(NSURL *URL)
+NSString *WebEditorClient::userVisibleString(NSURL *URL)
{
return [URL _web_userVisibleString];
}
+static NSArray *createExcludedElementsForAttributedStringConversion()
+{
+ NSArray *elements = [[NSArray alloc] initWithObjects:
+ // Omit style since we want style to be inline so the fragment can be easily inserted.
+ @"style",
+ // Omit xml so the result is not XHTML.
+ @"xml",
+ // Omit tags that will get stripped when converted to a fragment anyway.
+ @"doctype", @"html", @"head", @"body",
+ // Omit deprecated tags.
+ @"applet", @"basefont", @"center", @"dir", @"font", @"isindex", @"menu", @"s", @"strike", @"u",
+ // Omit object so no file attachments are part of the fragment.
+ @"object", nil];
+ CFRetain(elements);
+ return elements;
+}
+
+DocumentFragment* WebEditorClient::documentFragmentFromAttributedString(NSAttributedString *string, Vector<RefPtr<ArchiveResource> >& resources)
+{
+ static NSArray *excludedElements = createExcludedElementsForAttributedStringConversion();
+
+ NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: excludedElements, NSExcludedElementsDocumentAttribute,
+ nil, @"WebResourceHandler", nil];
+
+ NSArray *subResources;
+ DOMDocumentFragment* fragment = [string _documentFromRange:NSMakeRange(0, [string length])
+ document:[[m_webView mainFrame] DOMDocument]
+ documentAttributes:dictionary
+ subresources:&subResources];
+ for (WebResource* resource in subResources)
+ resources.append([resource _coreResource]);
+
+ [dictionary release];
+ return core(fragment);
+}
+
+void WebEditorClient::setInsertionPasteboard(NSPasteboard *pasteboard)
+{
+ [m_webView _setInsertionPasteboard:pasteboard];
+}
+
#ifdef BUILDING_ON_TIGER
-NSArray* WebEditorClient::pasteboardTypesForSelection(Frame* selectedFrame)
+NSArray *WebEditorClient::pasteboardTypesForSelection(Frame* selectedFrame)
{
WebFrame* frame = kit(selectedFrame);
return [[[frame frameView] documentView] pasteboardTypesForSelection];
@@ -829,11 +881,16 @@ void WebEditorClient::showCorrectionPanel(const FloatRect& boundingBoxOfReplaced
void WebEditorClient::dismissCorrectionPanel(bool correctionAccepted)
{
- if (m_correctionPanelTag >= 0) {
+ if (m_correctionPanelTag != InvalidCorrectionPanelTag) {
[[NSSpellChecker sharedSpellChecker] dismissCorrection:m_correctionPanelTag acceptCorrection:correctionAccepted];
- m_correctionPanelTag = -1;
+ m_correctionPanelTag = InvalidCorrectionPanelTag;
}
}
+
+bool WebEditorClient::isShowingCorrectionPanel()
+{
+ return m_correctionPanelTag != InvalidCorrectionPanelTag;
+}
#endif
void WebEditorClient::updateSpellingUIWithMisspelledWord(const String& misspelledWord)
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
index cbb89ec..447c515 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
@@ -177,6 +177,7 @@ private:
virtual bool canHandleRequest(const WebCore::ResourceRequest&) const;
virtual bool canShowMIMEType(const WTF::String& MIMEType) const;
+ virtual bool canShowMIMETypeAsHTML(const WTF::String& MIMEType) const;
virtual bool representationExistsForURLScheme(const WTF::String& URLScheme) const;
virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String& URLScheme) const;
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index dcbca28..a398ef7 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -1018,6 +1018,11 @@ bool WebFrameLoaderClient::canShowMIMEType(const String& MIMEType) const
return [getWebView(m_webFrame.get()) _canShowMIMEType:MIMEType];
}
+bool WebFrameLoaderClient::canShowMIMETypeAsHTML(const String& MIMEType) const
+{
+ return [WebView canShowMIMETypeAsHTML:MIMEType];
+}
+
bool WebFrameLoaderClient::representationExistsForURLScheme(const String& URLScheme) const
{
return [WebView _representationExistsForURLScheme:URLScheme];
diff --git a/WebCore/page/mac/WebDashboardRegion.h b/WebKit/mac/WebView/WebDashboardRegion.h
index 4963d04..4963d04 100644
--- a/WebCore/page/mac/WebDashboardRegion.h
+++ b/WebKit/mac/WebView/WebDashboardRegion.h
diff --git a/WebCore/page/mac/WebDashboardRegion.m b/WebKit/mac/WebView/WebDashboardRegion.mm
index a6b9872..c44977a 100644
--- a/WebCore/page/mac/WebDashboardRegion.m
+++ b/WebKit/mac/WebView/WebDashboardRegion.mm
@@ -23,7 +23,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "config.h"
#import "WebDashboardRegion.h"
#import <wtf/UnusedParam.h>
@@ -66,14 +65,14 @@
static const char* typeName(WebDashboardRegionType type)
{
switch (type) {
- case WebDashboardRegionTypeNone:
- return "None";
- case WebDashboardRegionTypeCircle:
- return "Circle";
- case WebDashboardRegionTypeRectangle:
- return "Rectangle";
- case WebDashboardRegionTypeScrollerRectangle:
- return "ScrollerRectangle";
+ case WebDashboardRegionTypeNone:
+ return "None";
+ case WebDashboardRegionTypeCircle:
+ return "Circle";
+ case WebDashboardRegionTypeRectangle:
+ return "Rectangle";
+ case WebDashboardRegionTypeScrollerRectangle:
+ return "ScrollerRectangle";
}
return "Unknown";
}
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 8d564a3..02696f4 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -487,21 +487,6 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return dataSource(_private->coreFrame->loader()->documentLoader());
}
-- (void)_addData:(NSData *)data
-{
- Document* document = _private->coreFrame->document();
-
- // Document may be nil if the part is about to redirect
- // as a result of JS executing during load, i.e. one frame
- // changing another's location before the frame's document
- // has been created.
- if (!document)
- return;
-
- document->setShouldCreateRenderers(_private->shouldCreateRenderers);
- _private->coreFrame->loader()->addData((const char *)[data bytes], [data length]);
-}
-
- (NSString *)_stringWithDocumentTypeStringAndMarkupString:(NSString *)markupString
{
return _private->coreFrame->documentTypeString() + markupString;
@@ -715,7 +700,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (TextGranularity)_selectionGranularity
{
- return _private->coreFrame->selectionGranularity();
+ return _private->coreFrame->selection()->granularity();
}
- (NSRange)_convertToNSRange:(Range *)range
@@ -859,7 +844,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return;
TypingCommand::insertParagraphSeparatorInQuotedContent(_private->coreFrame->document());
- _private->coreFrame->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
+ _private->coreFrame->selection()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
}
- (VisiblePosition)_visiblePositionForPoint:(NSPoint)point
@@ -895,9 +880,9 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (DOMCSSStyleDeclaration *)_typingStyle
{
- if (!_private->coreFrame || !_private->coreFrame->typingStyle())
+ if (!_private->coreFrame || !_private->coreFrame->selection()->typingStyle())
return nil;
- return kit(_private->coreFrame->typingStyle()->copy().get());
+ return kit(_private->coreFrame->selection()->typingStyle()->copy().get());
}
- (void)_setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction
@@ -942,15 +927,13 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return [self _canProvideDocumentSource];
}
-- (void)_receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName
+- (void)_commitData:(NSData *)data
{
- // Set the encoding. This only needs to be done once, but it's harmless to do it again later.
- String encoding = _private->coreFrame->loader()->documentLoader()->overrideEncoding();
- bool userChosen = !encoding.isNull();
- if (encoding.isNull())
- encoding = textEncodingName;
- _private->coreFrame->loader()->writer()->setEncoding(encoding, userChosen);
- [self _addData:data];
+ // FIXME: This really should be a setting.
+ Document* document = _private->coreFrame->document();
+ document->setShouldCreateRenderers(_private->shouldCreateRenderers);
+
+ _private->coreFrame->loader()->documentLoader()->commitData((const char *)[data bytes], [data length]);
}
@end
@@ -1167,7 +1150,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return;
applyCommand(ReplaceSelectionCommand::create(_private->coreFrame->document(), core(fragment), selectReplacement, smartReplace, matchStyle));
- _private->coreFrame->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
+ _private->coreFrame->selection()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
}
- (void)_replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace
@@ -1282,7 +1265,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
{
if (!_private->coreFrame)
return YES;
- return SecurityOrigin::canDisplay(URL, String(), _private->coreFrame->document());
+ return _private->coreFrame->document()->securityOrigin()->canDisplay(URL);
}
- (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string withGlobalObject:(JSObjectRef)globalObjectRef inScriptWorld:(WebScriptWorld *)world
@@ -1366,38 +1349,12 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return coreFrame->layerTreeAsText();
}
-static Node* spellingNode(Frame* coreFrame)
-{
- Node* focusedNode = coreFrame->selection()->start().node();
- if (!focusedNode || !focusedNode->renderer())
- return 0;
-
- for (const RenderObject* renderer = focusedNode->renderer(); renderer; renderer = renderer->childAt(0)) {
- if (renderer->isText())
- return renderer->node();
- }
- return 0;
-}
-
- (BOOL)hasSpellingMarker:(int)from length:(int)length
{
Frame* coreFrame = _private->coreFrame;
if (!coreFrame)
return NO;
-
- Node* node = spellingNode(coreFrame);
- if (!node)
- return NO;
-
- unsigned int startOffset = static_cast<unsigned int>(from);
- unsigned int endOffset = static_cast<unsigned int>(from + length);
- Vector<DocumentMarker> markers = coreFrame->document()->markers()->markersForNode(node);
- for (size_t i = 0; i < markers.size(); ++i) {
- DocumentMarker marker = markers[i];
- if (marker.startOffset <= startOffset && endOffset <= marker.endOffset && marker.type == DocumentMarker::Spelling)
- return YES;
- }
- return NO;
+ return coreFrame->editor()->selectionStartHasSpellingMarkerFor(from, length);
}
@end
diff --git a/WebKit/mac/WebView/WebFrameInternal.h b/WebKit/mac/WebView/WebFrameInternal.h
index dc3de21..8cdc272 100644
--- a/WebKit/mac/WebView/WebFrameInternal.h
+++ b/WebKit/mac/WebView/WebFrameInternal.h
@@ -162,7 +162,7 @@ WebView *getWebView(WebFrame *webFrame);
- (BOOL)_canProvideDocumentSource;
- (BOOL)_canSaveAsWebArchive;
-- (void)_receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
+- (void)_commitData:(NSData *)data;
@end
diff --git a/WebKit/mac/WebView/WebHTMLRepresentation.mm b/WebKit/mac/WebView/WebHTMLRepresentation.mm
index 188747d..2699472 100644
--- a/WebKit/mac/WebView/WebHTMLRepresentation.mm
+++ b/WebKit/mac/WebView/WebHTMLRepresentation.mm
@@ -166,23 +166,24 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
{
WebFrame *webFrame = [dataSource webFrame];
- if (webFrame) {
- if (!_private->pluginView)
- [webFrame _receivedData:data textEncodingName:[[_private->dataSource response] textEncodingName]];
-
- // If the document is a stand-alone media document, now is the right time to cancel the WebKit load
- Frame* coreFrame = core(webFrame);
- if (coreFrame->document() && coreFrame->document()->isMediaDocument())
- coreFrame->loader()->documentLoader()->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(coreFrame->loader()->documentLoader()->response()));
-
- if (_private->pluginView) {
- if (!_private->hasSentResponseToPlugin) {
- [_private->manualLoader pluginView:_private->pluginView receivedResponse:[dataSource response]];
- _private->hasSentResponseToPlugin = YES;
- }
-
- [_private->manualLoader pluginView:_private->pluginView receivedData:data];
+ if (!webFrame)
+ return;
+
+ if (!_private->pluginView)
+ [webFrame _commitData:data];
+
+ // If the document is a stand-alone media document, now is the right time to cancel the WebKit load
+ Frame* coreFrame = core(webFrame);
+ if (coreFrame->document()->isMediaDocument())
+ coreFrame->loader()->documentLoader()->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(coreFrame->loader()->documentLoader()->response()));
+
+ if (_private->pluginView) {
+ if (!_private->hasSentResponseToPlugin) {
+ [_private->manualLoader pluginView:_private->pluginView receivedResponse:[dataSource response]];
+ _private->hasSentResponseToPlugin = YES;
}
+
+ [_private->manualLoader pluginView:_private->pluginView receivedData:data];
}
}
@@ -195,25 +196,26 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
- (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource
{
- WebFrame *frame = [dataSource webFrame];
+ WebFrame* webFrame = [dataSource webFrame];
if (_private->pluginView) {
[_private->manualLoader pluginViewFinishedLoading:_private->pluginView];
return;
}
- if (frame) {
- if (![self _isDisplayingWebArchive]) {
- // Telling the frame we received some data and passing nil as the data is our
- // way to get work done that is normally done when the first bit of data is
- // received, even for the case of a document with no data (like about:blank).
- [frame _receivedData:nil textEncodingName:[[_private->dataSource response] textEncodingName]];
- }
-
- WebView *webView = [frame webView];
- if ([webView isEditable])
- core(frame)->editor()->applyEditingStyleToBodyElement();
+ if (!webFrame)
+ return;
+
+ if (![self _isDisplayingWebArchive]) {
+ // Telling the frame we received some data and passing nil as the data is our
+ // way to get work done that is normally done when the first bit of data is
+ // received, even for the case of a document with no data (like about:blank).
+ [webFrame _commitData:nil];
}
+
+ WebView *webView = [webFrame webView];
+ if ([webView isEditable])
+ core(webFrame)->editor()->applyEditingStyleToBodyElement();
}
- (BOOL)canProvideDocumentSource
@@ -304,15 +306,14 @@ static HTMLInputElement* inputElementFromDOMElement(DOMElement* element)
HTMLInputElement* inputElement = inputElementFromDOMElement(element);
return inputElement
&& inputElement->isTextField()
- && inputElement->inputType() != HTMLInputElement::PASSWORD
+ && !inputElement->isPasswordField()
&& inputElement->autoComplete();
}
- (BOOL)elementIsPassword:(DOMElement *)element
{
HTMLInputElement* inputElement = inputElementFromDOMElement(element);
- return inputElement
- && inputElement->inputType() == HTMLInputElement::PASSWORD;
+ return inputElement && inputElement->isPasswordField();
}
- (DOMElement *)formForElement:(DOMElement *)element
@@ -323,7 +324,7 @@ static HTMLInputElement* inputElementFromDOMElement(DOMElement* element)
- (DOMElement *)currentForm
{
- return kit(core([_private->dataSource webFrame])->currentForm());
+ return kit(core([_private->dataSource webFrame])->selection()->currentForm());
}
- (NSArray *)controlsInForm:(DOMElement *)form
diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm
index bd71eff..02d32d9 100644
--- a/WebKit/mac/WebView/WebHTMLView.mm
+++ b/WebKit/mac/WebView/WebHTMLView.mm
@@ -1914,12 +1914,11 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
- (NSImage *)_selectionDraggingImage
{
- if ([self _hasSelection]) {
- NSImage *dragImage = core([self _frame])->selectionImage();
- [dragImage _web_dissolveToFraction:WebDragImageAlpha];
- return dragImage;
- }
- return nil;
+ if (![self _hasSelection])
+ return nil;
+ NSImage *dragImage = core([self _frame])->selectionImage();
+ [dragImage _web_dissolveToFraction:WebDragImageAlpha];
+ return dragImage;
}
- (NSRect)_selectionDraggingRect
@@ -2303,7 +2302,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
return bottom;
float newBottom;
- view->adjustPageHeight(&newBottom, top, bottom, bottomLimit);
+ view->adjustPageHeightDeprecated(&newBottom, top, bottom, bottomLimit);
#ifdef __LP64__
// If the new bottom is equal to the old bottom (when both are treated as floats), we just return the original
@@ -2378,10 +2377,6 @@ static bool matchesExtensionOrEquivalent(NSString *filename, NSString *extension
#endif
-@interface NSArray (WebHTMLView)
-- (void)_web_makePluginViewsPerformSelector:(SEL)selector withObject:(id)object;
-@end
-
@implementation WebHTMLView
+ (void)initialize
@@ -2529,6 +2524,7 @@ WEBCORE_COMMAND(alignLeft)
WEBCORE_COMMAND(alignRight)
WEBCORE_COMMAND(copy)
WEBCORE_COMMAND(cut)
+WEBCORE_COMMAND(paste)
WEBCORE_COMMAND(delete)
WEBCORE_COMMAND(deleteBackward)
WEBCORE_COMMAND(deleteBackwardByDecomposingPreviousCharacter)
@@ -2664,7 +2660,7 @@ WEBCORE_COMMAND(yankAndSelect)
COMMAND_PROLOGUE
if (Frame* coreFrame = core([self _frame]))
- coreFrame->revealSelection(ScrollAlignment::alignCenterAlways);
+ coreFrame->selection()->revealSelection(ScrollAlignment::alignCenterAlways);
}
- (NSCellStateValue)selectionHasStyle:(CSSStyleDeclaration*)style
@@ -3080,14 +3076,31 @@ WEBCORE_COMMAND(yankAndSelect)
}
}
+- (void)_web_makePluginSubviewsPerformSelector:(SEL)selector withObject:(id)object
+{
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ // Copy subviews because [self subviews] returns the view's mutable internal array,
+ // and we must avoid mutating the array while enumerating it.
+ NSArray *subviews = [[self subviews] copy];
+
+ NSEnumerator *enumerator = [subviews objectEnumerator];
+ WebNetscapePluginView *view;
+ while ((view = [enumerator nextObject]) != nil)
+ if ([view isKindOfClass:[WebBaseNetscapePluginView class]])
+ [view performSelector:selector withObject:object];
+
+ [subviews release];
+#endif
+}
+
- (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow
{
- [[self subviews] _web_makePluginViewsPerformSelector:@selector(viewWillMoveToHostWindow:) withObject:hostWindow];
+ [self _web_makePluginSubviewsPerformSelector:@selector(viewWillMoveToHostWindow:) withObject:hostWindow];
}
- (void)viewDidMoveToHostWindow
{
- [[self subviews] _web_makePluginViewsPerformSelector:@selector(viewDidMoveToHostWindow) withObject:nil];
+ [self _web_makePluginSubviewsPerformSelector:@selector(viewDidMoveToHostWindow) withObject:nil];
}
@@ -4197,7 +4210,7 @@ static BOOL isInPasswordField(Frame* coreFrame)
COMMAND_PROLOGUE
if (Frame* coreFrame = core([self _frame]))
- coreFrame->revealSelection(ScrollAlignment::alignCenterAlways);
+ coreFrame->selection()->revealSelection(ScrollAlignment::alignCenterAlways);
}
- (NSData *)_selectionStartFontAttributesAsRTF
@@ -5082,21 +5095,6 @@ static BOOL writingDirectionKeyBindingsEnabled()
@end
-@implementation NSArray (WebHTMLView)
-
-- (void)_web_makePluginViewsPerformSelector:(SEL)selector withObject:(id)object
-{
-#if ENABLE(NETSCAPE_PLUGIN_API)
- NSEnumerator *enumerator = [self objectEnumerator];
- WebNetscapePluginView *view;
- while ((view = [enumerator nextObject]) != nil)
- if ([view isKindOfClass:[WebBaseNetscapePluginView class]])
- [view performSelector:selector withObject:object];
-#endif
-}
-
-@end
-
@implementation WebHTMLView (WebInternal)
- (void)_selectionChanged
@@ -5145,7 +5143,7 @@ static BOOL writingDirectionKeyBindingsEnabled()
if (![[self _webView] smartInsertDeleteEnabled])
return NO;
Frame* coreFrame = core([self _frame]);
- return coreFrame && coreFrame->selectionGranularity() == WordGranularity;
+ return coreFrame && coreFrame->selection()->granularity() == WordGranularity;
}
- (NSEvent *)_mouseDownEvent
@@ -5163,24 +5161,6 @@ static BOOL writingDirectionKeyBindingsEnabled()
return [_private->dataSource webFrame];
}
-- (void)paste:(id)sender
-{
- COMMAND_PROLOGUE
-
- RetainPtr<WebHTMLView> selfProtector = self;
- RefPtr<Frame> coreFrame = core([self _frame]);
- if (!coreFrame)
- return;
- if (coreFrame->editor()->tryDHTMLPaste())
- return; // DHTML did the whole operation
- if (!coreFrame->editor()->canPaste())
- return;
- if (coreFrame->selection()->isContentRichlyEditable())
- [self _pasteWithPasteboard:[NSPasteboard generalPasteboard] allowPlainText:YES];
- else
- coreFrame->editor()->pasteAsPlainTextBypassingDHTML();
-}
-
- (void)closeIfNotCurrentView
{
if ([[[self _frame] frameView] documentView] != self)
@@ -5360,7 +5340,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
if (!coreFrame)
return;
- NSRect rect = coreFrame->selectionBounds();
+ NSRect rect = coreFrame->selection()->bounds();
#ifndef BUILDING_ON_TIGER
NSDictionary *attributes = [attrString fontAttributesInRange:NSMakeRange(0,1)];
@@ -5582,7 +5562,11 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
[[NSNotificationCenter defaultCenter] postNotificationName:_WebViewDidStartAcceleratedCompositingNotification object:[self _webView] userInfo:nil];
#if defined(BUILDING_ON_LEOPARD)
+ [viewLayer setSublayerTransform:CATransform3DMakeScale(1, -1, 1)]; // setGeometryFlipped: doesn't exist on Leopard.
[self _updateLayerHostingViewPosition];
+#else
+ // Do geometry flipping here, which flips all the compositing layers so they are top-down.
+ [viewLayer setGeometryFlipped:YES];
#endif
}
@@ -6037,25 +6021,27 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
- (NSRect)selectionRect
{
- if ([self _hasSelection])
- return core([self _frame])->selectionBounds();
- return NSZeroRect;
+ if (![self _hasSelection])
+ return NSZeroRect;
+ return core([self _frame])->selection()->bounds();
}
- (NSArray *)selectionTextRects
{
if (![self _hasSelection])
return nil;
-
+
Vector<FloatRect> list;
if (Frame* coreFrame = core([self _frame]))
- coreFrame->selectionTextRects(list, Frame::RespectTransforms);
+ coreFrame->selection()->getClippedVisibleTextRectangles(list);
+
+ size_t size = list.size();
+
+ NSMutableArray *result = [NSMutableArray arrayWithCapacity:size];
- unsigned size = list.size();
- NSMutableArray *result = [[[NSMutableArray alloc] initWithCapacity:size] autorelease];
- for (unsigned i = 0; i < size; ++i)
+ for (size_t i = 0; i < size; ++i)
[result addObject:[NSValue valueWithRect:list[i]]];
-
+
return result;
}
@@ -6066,16 +6052,16 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
- (NSImage *)selectionImageForcingBlackText:(BOOL)forceBlackText
{
- if ([self _hasSelection])
- return core([self _frame])->selectionImage(forceBlackText);
- return nil;
+ if (![self _hasSelection])
+ return nil;
+ return core([self _frame])->selectionImage(forceBlackText);
}
- (NSRect)selectionImageRect
{
- if ([self _hasSelection])
- return core([self _frame])->selectionBounds();
- return NSZeroRect;
+ if (![self _hasSelection])
+ return NSZeroRect;
+ return core([self _frame])->selection()->bounds();
}
- (NSArray *)pasteboardTypesForSelection
diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
index 3b750ff..17c8e4d 100644
--- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
@@ -92,6 +92,7 @@
#define WebKitShowDebugBordersPreferenceKey @"WebKitShowDebugBorders"
#define WebKitShowRepaintCounterPreferenceKey @"WebKitShowRepaintCounter"
#define WebKitWebGLEnabledPreferenceKey @"WebKitWebGLEnabled"
+#define WebKitAccelerated2dCanvasEnabledPreferenceKey @"WebKitAccelerated2dCanvasEnabled"
#define WebKitUsesProxiedOpenPanelPreferenceKey @"WebKitUsesProxiedOpenPanel"
#define WebKitPluginAllowedRunTimePreferenceKey @"WebKitPluginAllowedRunTime"
#define WebKitFrameFlatteningEnabledPreferenceKey @"WebKitFrameFlatteningEnabled"
@@ -111,6 +112,7 @@
#define WebKitCacheModelPreferenceKey @"WebKitCacheModelPreferenceKey"
#define WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey @"WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey"
#define WebKitEditingBehaviorPreferenceKey @"WebKitEditingBehavior"
+#define WebKitUsePreHTML5ParserQuirksKey @"WebKitUsePreHTML5ParserQuirks"
// CoreGraphics deferred updates are disabled if WebKitEnableCoalescedUpdatesPreferenceKey is set
// to NO, or has no value. For compatibility with Mac OS X 10.4.6, deferred updates are OFF by
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index a4a5383..87284bb 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -361,12 +361,14 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:NO], WebKitShowDebugBordersPreferenceKey,
[NSNumber numberWithBool:NO], WebKitShowRepaintCounterPreferenceKey,
[NSNumber numberWithBool:NO], WebKitWebGLEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitAccelerated2dCanvasEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitUsesProxiedOpenPanelPreferenceKey,
[NSNumber numberWithUnsignedInt:4], WebKitPluginAllowedRunTimePreferenceKey,
[NSNumber numberWithBool:NO], WebKitFrameFlatteningEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitDNSPrefetchingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitFullScreenEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitMemoryInfoEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitUsePreHTML5ParserQuirksKey,
[NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
[NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
nil];
@@ -641,7 +643,10 @@ static WebCacheModel cacheModelForMainBundle(void)
} else {
locationString = [URL _web_originalDataAsString];
}
-
+
+ if (!locationString)
+ locationString = @"";
+
[self _setStringValue:locationString forKey: WebKitUserStyleSheetLocationPreferenceKey];
}
@@ -1267,6 +1272,16 @@ static NSString *classIBCreatorID = nil;
[self _setBoolValue:enabled forKey:WebKitWebGLEnabledPreferenceKey];
}
+- (BOOL)accelerated2dCanvasEnabled
+{
+ return [self _boolValueForKey:WebKitAccelerated2dCanvasEnabledPreferenceKey];
+}
+
+- (void)setAccelerated2dCanvasEnabled:(BOOL)enabled
+{
+ [self _setBoolValue:enabled forKey:WebKitAccelerated2dCanvasEnabledPreferenceKey];
+}
+
- (BOOL)usesProxiedOpenPanel
{
return [self _boolValueForKey:WebKitUsesProxiedOpenPanelPreferenceKey];
@@ -1327,6 +1342,16 @@ static NSString *classIBCreatorID = nil;
[self _setIntegerValue:behavior forKey:WebKitEditingBehaviorPreferenceKey];
}
+- (BOOL)usePreHTML5ParserQuirks
+{
+ return [self _boolValueForKey:WebKitUsePreHTML5ParserQuirksKey];
+}
+
+- (void)setUsePreHTML5ParserQuirks:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitUsePreHTML5ParserQuirksKey];
+}
+
- (void)didRemoveFromWebView
{
ASSERT(_private->numWebViews);
@@ -1357,6 +1382,11 @@ static NSString *classIBCreatorID = nil;
return [self _boolValueForKey:WebKitFullScreenEnabledPreferenceKey];
}
++ (void)setWebKitLinkTimeVersion:(int)version
+{
+ setWebKitLinkTimeVersion(version);
+}
+
@end
@implementation WebPreferences (WebInternal)
diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h
index 783038d..3bd5e24 100644
--- a/WebKit/mac/WebView/WebPreferencesPrivate.h
+++ b/WebKit/mac/WebView/WebPreferencesPrivate.h
@@ -184,6 +184,9 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)webGLEnabled;
- (void)setWebGLEnabled:(BOOL)enabled;
+- (BOOL)accelerated2dCanvasEnabled;
+- (void)setAccelerated2dCanvasEnabled:(BOOL)enabled;
+
- (BOOL)paginateDuringLayoutEnabled;
- (void)setPaginateDuringLayoutEnabled:(BOOL)flag;
@@ -203,6 +206,8 @@ extern NSString *WebPreferencesRemovedNotification;
+ (void)_setInitialDefaultTextEncodingToSystemEncoding;
+ (void)_setIBCreatorID:(NSString *)string;
++ (void)setWebKitLinkTimeVersion:(int)version;
+
// For WebView's use only.
- (void)willAddToWebView;
- (void)didRemoveFromWebView;
@@ -212,4 +217,7 @@ extern NSString *WebPreferencesRemovedNotification;
- (void)setFullScreenEnabled:(BOOL)flag;
- (BOOL)fullScreenEnabled;
+- (void)setUsePreHTML5ParserQuirks:(BOOL)flag;
+- (BOOL)usePreHTML5ParserQuirks;
+
@end
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 0125e1c..20f6e24 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -174,6 +174,10 @@
#import <wtf/StdLibExtras.h>
#import <wtf/Threading.h>
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#import <AppKit/NSTextChecker.h>
+#endif
+
#if ENABLE(DASHBOARD_SUPPORT)
#import <WebKit/WebDashboardRegion.h>
#endif
@@ -692,6 +696,7 @@ static bool shouldEnableLoadDeferring()
_private->page->setCanStartMedia([self window]);
_private->page->settings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]);
+ _private->page->settings()->setMinDOMTimerInterval(0.004);
[WebFrame _createMainFrameWithPage:_private->page frameName:frameName frameView:frameView];
@@ -1427,7 +1432,6 @@ static bool fastDocumentTeardownEnabled()
settings->setWebArchiveDebugModeEnabled([preferences webArchiveDebugModeEnabled]);
settings->setLocalFileContentSniffingEnabled([preferences localFileContentSniffingEnabled]);
settings->setOfflineWebApplicationCacheEnabled([preferences offlineWebApplicationCacheEnabled]);
- settings->setZoomMode([preferences zoomsTextOnly] ? ZoomTextOnly : ZoomPage);
settings->setJavaScriptCanAccessClipboard([preferences javaScriptCanAccessClipboard]);
settings->setXSSAuditorEnabled([preferences isXSSAuditorEnabled]);
settings->setEnforceCSSMIMETypeInNoQuirksMode(!WKAppVersionCheckLessThan(@"com.apple.iWeb", -1, 2.1));
@@ -1435,11 +1439,13 @@ static bool fastDocumentTeardownEnabled()
// FIXME: Enabling accelerated compositing when WebGL is enabled causes tests to fail on Leopard which expect HW compositing to be disabled.
// Until we fix that, I will comment out the test (CFM)
- settings->setAcceleratedCompositingEnabled((coreVideoHas7228836Fix() || [preferences webGLEnabled]) && [preferences acceleratedCompositingEnabled]);
+ settings->setAcceleratedCompositingEnabled((coreVideoHas7228836Fix() || [preferences webGLEnabled] ||
+ [preferences accelerated2dCanvasEnabled]) && [preferences acceleratedCompositingEnabled]);
settings->setShowDebugBorders([preferences showDebugBorders]);
settings->setShowRepaintCounter([preferences showRepaintCounter]);
settings->setPluginAllowedRunTime([preferences pluginAllowedRunTime]);
settings->setWebGLEnabled([preferences webGLEnabled]);
+ settings->setAccelerated2dCanvasEnabled([preferences accelerated2dCanvasEnabled]);
settings->setLoadDeferringEnabled(shouldEnableLoadDeferring());
settings->setFrameFlatteningEnabled([preferences isFrameFlatteningEnabled]);
settings->setPaginateDuringLayoutEnabled([preferences paginateDuringLayoutEnabled]);
@@ -1447,9 +1453,14 @@ static bool fastDocumentTeardownEnabled()
settings->setFullScreenEnabled([preferences fullScreenEnabled]);
#endif
settings->setMemoryInfoEnabled([preferences memoryInfoEnabled]);
+ settings->setUsePreHTML5ParserQuirks([preferences usePreHTML5ParserQuirks]);
// Application Cache Preferences are stored on the global cache storage manager, not in Settings.
[WebApplicationCache setDefaultOriginQuota:[preferences applicationCacheDefaultOriginQuota]];
+
+ BOOL zoomsTextOnly = [preferences zoomsTextOnly];
+ if (_private->zoomsTextOnly != zoomsTextOnly)
+ [self _setZoomMultiplier:_private->zoomMultiplier isTextOnly:zoomsTextOnly];
}
static inline IMP getMethod(id o, SEL s)
@@ -1908,9 +1919,38 @@ static inline IMP getMethod(id o, SEL s)
Frame* mainFrame = [self _mainCoreFrame];
if (!mainFrame)
return nil;
- NSMutableDictionary *regions = mainFrame->dashboardRegionsDictionary();
- [self _addScrollerDashboardRegions:regions];
- return regions;
+
+ const Vector<DashboardRegionValue>& regions = mainFrame->document()->dashboardRegions();
+ size_t size = regions.size();
+
+ NSMutableDictionary *webRegions = [NSMutableDictionary dictionaryWithCapacity:size];
+ for (size_t i = 0; i < size; i++) {
+ const DashboardRegionValue& region = regions[i];
+
+ if (region.type == StyleDashboardRegion::None)
+ continue;
+
+ NSString *label = region.label;
+ WebDashboardRegionType type = WebDashboardRegionTypeNone;
+ if (region.type == StyleDashboardRegion::Circle)
+ type = WebDashboardRegionTypeCircle;
+ else if (region.type == StyleDashboardRegion::Rectangle)
+ type = WebDashboardRegionTypeRectangle;
+ NSMutableArray *regionValues = [webRegions objectForKey:label];
+ if (!regionValues) {
+ regionValues = [[NSMutableArray alloc] initWithCapacity:1];
+ [webRegions setObject:regionValues forKey:label];
+ [regionValues release];
+ }
+
+ WebDashboardRegion *webRegion = [[WebDashboardRegion alloc] initWithRect:region.bounds clip:region.clip type:type];
+ [regionValues addObject:webRegion];
+ [webRegion release];
+ }
+
+ [self _addScrollerDashboardRegions:webRegions];
+
+ return webRegions;
}
- (void)_setDashboardBehavior:(WebDashboardBehavior)behavior to:(BOOL)flag
@@ -2604,6 +2644,13 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns)
automaticTextReplacementEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticTextReplacementEnabled];
automaticSpellingCorrectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticSpellingCorrectionEnabled];
#endif
+
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+ if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticTextReplacementEnabled])
+ automaticTextReplacementEnabled = [NSSpellChecker isAutomaticTextReplacementEnabled];
+ if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticSpellingCorrectionEnabled])
+ automaticTextReplacementEnabled = [NSSpellChecker isAutomaticSpellingCorrectionEnabled];
+#endif
}
+ (void)_applicationWillTerminate
@@ -3272,17 +3319,16 @@ static bool needsWebViewInitThreadWorkaround()
{
// NOTE: This has no visible effect when viewing a PDF (see <rdar://problem/4737380>)
_private->zoomMultiplier = multiplier;
+ _private->zoomsTextOnly = isTextOnly;
- ASSERT(_private->page);
- if (_private->page)
- _private->page->settings()->setZoomMode(isTextOnly ? ZoomTextOnly : ZoomPage);
-
- // FIXME: It would be nice to rework this code so that _private->zoomMultiplier doesn't exist
- // and instead FrameView::zoomFactor is used.
+ // FIXME: It might be nice to rework this code so that _private->zoomMultiplier doesn't exist
+ // and instead the zoom factors stored in Frame are used.
Frame* coreFrame = [self _mainCoreFrame];
if (coreFrame) {
- if (FrameView* view = coreFrame->view())
- view->setZoomFactor(multiplier, isTextOnly ? ZoomTextOnly : ZoomPage);
+ if (_private->zoomsTextOnly)
+ coreFrame->setPageAndTextZoomFactors(1, multiplier);
+ else
+ coreFrame->setPageAndTextZoomFactors(multiplier, 1);
}
}
@@ -3303,7 +3349,7 @@ static bool needsWebViewInitThreadWorkaround()
if (!_private->page)
return NO;
- return _private->page->settings()->zoomMode() == ZoomTextOnly;
+ return _private->zoomsTextOnly;
}
#define MinimumZoomMultiplier 0.5f
@@ -4366,6 +4412,9 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue jsValu
- (BOOL)canMarkAllTextMatches
{
+ if (_private->closed)
+ return NO;
+
WebFrame *frame = [self mainFrame];
do {
id <WebDocumentView> view = [[frame frameView] documentView];
@@ -4769,7 +4818,7 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue jsValu
mainFrame->editor()->applyEditingStyleToBodyElement();
// If the WebView is made editable and the selection is empty, set it to something.
if (![self selectedDOMRange])
- mainFrame->setSelectionFromNone();
+ mainFrame->selection()->setSelectionFromNone();
}
}
}
diff --git a/WebKit/mac/WebView/WebViewData.h b/WebKit/mac/WebView/WebViewData.h
index 558770e..9aa91dc 100644
--- a/WebKit/mac/WebView/WebViewData.h
+++ b/WebKit/mac/WebView/WebViewData.h
@@ -78,6 +78,7 @@ extern int pluginDatabaseClientCount;
BOOL allowsUndo;
float zoomMultiplier;
+ BOOL zoomsTextOnly;
NSString *applicationNameForUserAgent;
WTF::String userAgent;
diff --git a/WebKit/mac/WebView/WebViewData.mm b/WebKit/mac/WebView/WebViewData.mm
index 06da58f..9794d03 100644
--- a/WebKit/mac/WebView/WebViewData.mm
+++ b/WebKit/mac/WebView/WebViewData.mm
@@ -62,6 +62,7 @@ int pluginDatabaseClientCount = 0;
cssAnimationsSuspended = NO;
zoomMultiplier = 1;
+ zoomsTextOnly = NO;
#if ENABLE(DASHBOARD_SUPPORT)
dashboardBehaviorAllowWheelScrolling = YES;
diff --git a/WebKit/qt/Api/DerivedSources.pro b/WebKit/qt/Api/DerivedSources.pro
index 86d5dac..6fb52f2 100644
--- a/WebKit/qt/Api/DerivedSources.pro
+++ b/WebKit/qt/Api/DerivedSources.pro
@@ -10,7 +10,7 @@ DESTDIR = ../../../include/QtWebKit
QUOTE = ""
DOUBLE_ESCAPED_QUOTE = ""
ESCAPE = ""
-contains(QMAKE_HOST.os, "Windows"):isEmpty(QMAKE_SH) {
+win32-msvc* | (contains(QMAKE_HOST.os, "Windows"):isEmpty(QMAKE_SH)) {
# MinGW's make will run makefile commands using sh, even if make
# was run from the Windows shell, if it finds sh in the path.
ESCAPE = "^"
diff --git a/WebKit/qt/Api/qwebelement.cpp b/WebKit/qt/Api/qwebelement.cpp
index f7b1188..261631c 100644
--- a/WebKit/qt/Api/qwebelement.cpp
+++ b/WebKit/qt/Api/qwebelement.cpp
@@ -31,23 +31,33 @@
#include "FrameView.h"
#include "GraphicsContext.h"
#include "HTMLElement.h"
+#if USE(JSC)
#include "JSGlobalObject.h"
#include "JSHTMLElement.h"
#include "JSObject.h"
-#include "NodeList.h"
#include "PropertyNameArray.h"
+#include <parser/SourceCode.h>
+#include "qt_runtime.h"
+#elif USE(V8)
+#include "V8DOMWindow.h"
+#include "V8Binding.h"
+#include "NotImplemented.h"
+#endif
+#include "NodeList.h"
#include "RenderImage.h"
#include "StaticNodeList.h"
-#include "qt_runtime.h"
#include "qwebframe.h"
#include "qwebframe_p.h"
#include "runtime_root.h"
-#include <parser/SourceCode.h>
#include <wtf/Vector.h>
#include <wtf/text/CString.h>
#include <QPainter>
+#if USE(V8)
+using namespace V8::Bindings;
+#endif
+
using namespace WebCore;
class QWebElementPrivate {
@@ -694,6 +704,7 @@ QWebFrame *QWebElement::webFrame() const
return QWebFramePrivate::kit(frame);
}
+#if USE(JSC)
static bool setupScriptContext(WebCore::Element* element, JSC::JSValue& thisValue, ScriptState*& state, ScriptController*& scriptController)
{
if (!element)
@@ -721,6 +732,26 @@ static bool setupScriptContext(WebCore::Element* element, JSC::JSValue& thisValu
return true;
}
+#elif USE(V8)
+static bool setupScriptContext(WebCore::Element* element, v8::Handle<v8::Value>& thisValue, ScriptState*& state, ScriptController*& scriptController)
+{
+ if (!element)
+ return false;
+
+ Document* document = element->document();
+ if (!document)
+ return false;
+
+ Frame* frame = document->frame();
+ if (!frame)
+ return false;
+
+ state = mainWorldScriptState(frame);
+ // Get V8 wrapper for DOM element
+ thisValue = toV8(frame->domWindow());
+ return true;
+}
+#endif
/*!
@@ -732,12 +763,16 @@ QVariant QWebElement::evaluateJavaScript(const QString& scriptSource)
return QVariant();
ScriptState* state = 0;
+#if USE(JSC)
JSC::JSValue thisValue;
+#elif USE(V8)
+ v8::Handle<v8::Value> thisValue;
+#endif
ScriptController* scriptController = 0;
if (!setupScriptContext(m_element, thisValue, state, scriptController))
return QVariant();
-
+#if USE(JSC)
JSC::ScopeChain& scopeChain = state->dynamicGlobalObject()->globalScopeChain();
JSC::UString script(reinterpret_cast_ptr<const UChar*>(scriptSource.data()), scriptSource.length());
JSC::Completion completion = JSC::evaluate(state, scopeChain, JSC::makeSource(script), thisValue);
@@ -750,6 +785,10 @@ QVariant QWebElement::evaluateJavaScript(const QString& scriptSource)
int distance = 0;
return JSC::Bindings::convertValueToQVariant(state, result, QMetaType::Void, &distance);
+#elif USE(V8)
+ notImplemented();
+ return QVariant();
+#endif
}
/*!
diff --git a/WebKit/qt/Api/qwebelement.h b/WebKit/qt/Api/qwebelement.h
index c488d12..b94c372 100644
--- a/WebKit/qt/Api/qwebelement.h
+++ b/WebKit/qt/Api/qwebelement.h
@@ -32,11 +32,20 @@ namespace WebCore {
class Node;
}
-namespace JSC {
-namespace Bindings {
+
+#if defined(WTF_USE_V8) && WTF_USE_V8
+namespace V8 {
+ namespace Bindings {
class QtWebElementRuntime;
+ }
}
+#else
+namespace JSC {
+ namespace Bindings {
+ class QtWebElementRuntime;
+ }
}
+#endif
QT_BEGIN_NAMESPACE
class QPainter;
@@ -160,7 +169,12 @@ private:
friend class QWebHitTestResult;
friend class QWebHitTestResultPrivate;
friend class QWebPage;
+
+#if defined(WTF_USE_V8) && WTF_USE_V8
+ friend class V8::Bindings::QtWebElementRuntime;
+#else
friend class JSC::Bindings::QtWebElementRuntime;
+#endif
QWebElementPrivate* d;
WebCore::Element* m_element;
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 464b4a0..46580bb 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -21,8 +21,12 @@
#include "config.h"
#include "qwebframe.h"
+#if USE(JSC)
#include "Bridge.h"
#include "CallFrame.h"
+#elif USE(V8)
+#include "V8Binding.h"
+#endif
#include "Document.h"
#include "DocumentLoader.h"
#include "DragData.h"
@@ -32,23 +36,35 @@
#include "FrameLoaderClientQt.h"
#include "FrameTree.h"
#include "FrameView.h"
+#if USE(JSC)
#include "GCController.h"
+#elif USE(V8)
+#include "V8GCController.h"
+#endif
#include "GraphicsContext.h"
#include "HTMLMetaElement.h"
#include "HitTestResult.h"
#include "HTTPParsers.h"
#include "IconDatabase.h"
#include "InspectorController.h"
+#if USE(JSC)
#include "JSDOMBinding.h"
#include "JSDOMWindowBase.h"
#include "JSLock.h"
#include "JSObject.h"
+#elif USE(V8)
+#include "V8DOMWrapper.h"
+#include "V8DOMWindowShell.h"
+#endif
+#include "NetworkingContext.h"
#include "NodeList.h"
#include "Page.h"
#include "PlatformMouseEvent.h"
#include "PlatformWheelEvent.h"
#include "PrintContext.h"
+#if USE(JSC)
#include "PutPropertySlot.h"
+#endif
#include "RenderLayer.h"
#include "RenderTreeAsText.h"
#include "RenderView.h"
@@ -64,8 +80,10 @@
#include "TiledBackingStore.h"
#include "htmlediting.h"
#include "markup.h"
+#if USE(JSC)
#include "qt_instance.h"
#include "qt_runtime.h"
+#endif
#include "qwebelement.h"
#include "qwebframe_p.h"
#include "qwebpage.h"
@@ -74,8 +92,10 @@
#include "qwebsecurityorigin_p.h"
#include "qwebscriptworld.h"
#include "qwebscriptworld_p.h"
+#if USE(JSC)
#include "runtime_object.h"
#include "runtime_root.h"
+#endif
#include "wtf/HashMap.h"
#include <QMultiMap>
#include <qdebug.h>
@@ -476,7 +496,7 @@ void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object
{
if (!page()->settings()->testAttribute(QWebSettings::JavascriptEnabled))
return;
-
+#if USE(JSC)
JSC::JSLock lock(JSC::SilenceAssertionsOnly);
JSDOMWindow* window = toJSDOMWindow(d->frame, mainThreadNormalWorld());
JSC::Bindings::RootObject* root;
@@ -497,6 +517,13 @@ void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object
JSC::PutPropertySlot slot;
window->put(exec, JSC::Identifier(exec, reinterpret_cast_ptr<const UChar*>(name.constData()), name.length()), runtimeObject, slot);
+#elif USE(V8)
+ QScriptEngine* engine = d->frame->script()->qtScriptEngine();
+ if (!engine)
+ return;
+ QScriptValue v = engine->newQObject(object, ownership);
+ engine->globalObject().property("window").setProperty(name, v);
+#endif
}
/*!
@@ -868,9 +895,9 @@ QList<QWebFrame*> QWebFrame::childFrames() const
FrameTree *tree = d->frame->tree();
for (Frame *child = tree->firstChild(); child; child = child->tree()->nextSibling()) {
FrameLoader *loader = child->loader();
- FrameLoaderClientQt *client = static_cast<FrameLoaderClientQt*>(loader->client());
- if (client)
- rc.append(client->webFrame());
+ QWebFrame* webFrame = qobject_cast<QWebFrame*>(loader->networkingContext()->originatingObject());
+ if (webFrame)
+ rc.append(webFrame);
}
}
@@ -1105,11 +1132,9 @@ void QWebFrame::render(QPainter* painter)
*/
void QWebFrame::setTextSizeMultiplier(qreal factor)
{
- FrameView* view = d->frame->view();
- if (!view)
- return;
+ page()->settings()->setAttribute(QWebSettings::ZoomTextOnly, true);
- view->setZoomFactor(factor, ZoomTextOnly);
+ d->frame->setPageAndTextZoomFactors(1, factor);
}
/*!
@@ -1117,11 +1142,7 @@ void QWebFrame::setTextSizeMultiplier(qreal factor)
*/
qreal QWebFrame::textSizeMultiplier() const
{
- FrameView* view = d->frame->view();
- if (!view)
- return 1;
-
- return view->zoomFactor();
+ return d->zoomTextOnly ? d->frame->textZoomFactor() : d->frame->pageZoomFactor();
}
/*!
@@ -1132,24 +1153,15 @@ qreal QWebFrame::textSizeMultiplier() const
void QWebFrame::setZoomFactor(qreal factor)
{
- Page* page = d->frame->page();
- if (!page)
- return;
-
- FrameView* view = d->frame->view();
- if (!view)
- return;
-
- view->setZoomFactor(factor, page->settings()->zoomMode());
+ if (d->zoomTextOnly)
+ d->frame->setTextZoomFactor(factor);
+ else
+ d->frame->setPageZoomFactor(factor);
}
qreal QWebFrame::zoomFactor() const
{
- FrameView* view = d->frame->view();
- if (!view)
- return 1;
-
- return view->zoomFactor();
+ return d->zoomTextOnly ? d->frame->textZoomFactor() : d->frame->pageZoomFactor();
}
/*!
@@ -1388,9 +1400,17 @@ QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource)
ScriptController *proxy = d->frame->script();
QVariant rc;
if (proxy) {
- JSC::JSValue v = d->frame->script()->executeScript(ScriptSourceCode(scriptSource)).jsValue();
+#if USE(JSC)
int distance = 0;
+ JSC::JSValue v = d->frame->script()->executeScript(ScriptSourceCode(scriptSource)).jsValue();
+
rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject(mainThreadNormalWorld())->globalExec(), v, QMetaType::Void, &distance);
+#elif USE(V8)
+ QScriptEngine* engine = d->frame->script()->qtScriptEngine();
+ if (!engine)
+ return rc;
+ rc = engine->evaluate(scriptSource).toVariant();
+#endif
}
return rc;
}
@@ -1414,7 +1434,7 @@ WebCore::Frame* QWebFramePrivate::core(const QWebFrame* webFrame)
QWebFrame* QWebFramePrivate::kit(const WebCore::Frame* coreFrame)
{
- return static_cast<FrameLoaderClientQt*>(coreFrame->loader()->client())->webFrame();
+ return qobject_cast<QWebFrame*>(coreFrame->loader()->networkingContext()->originatingObject());
}
diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h
index b5dda62..6d6eca1 100644
--- a/WebKit/qt/Api/qwebframe_p.h
+++ b/WebKit/qt/Api/qwebframe_p.h
@@ -31,6 +31,7 @@
#include "qwebelement.h"
#include "wtf/RefPtr.h"
#include "Frame.h"
+#include "ViewportArguments.h"
namespace WebCore {
class FrameLoaderClientQt;
@@ -71,7 +72,7 @@ public:
, allowsScrolling(true)
, marginWidth(-1)
, marginHeight(-1)
- , initialLayoutComplete(false)
+ , zoomTextOnly(false)
{}
void init(QWebFrame* qframe, QWebFrameData* frameData);
void setPage(QWebPage*);
@@ -99,7 +100,8 @@ public:
bool allowsScrolling;
int marginWidth;
int marginHeight;
- bool initialLayoutComplete;
+ bool zoomTextOnly;
+ WebCore::ViewportArguments viewportArguments;
};
class QWebHitTestResultPrivate {
diff --git a/WebKit/qt/Api/qwebkitplatformplugin.h b/WebKit/qt/Api/qwebkitplatformplugin.h
index 3c56c98..76496c5 100644
--- a/WebKit/qt/Api/qwebkitplatformplugin.h
+++ b/WebKit/qt/Api/qwebkitplatformplugin.h
@@ -27,6 +27,7 @@
*/
#include <QObject>
+#include <QUrl>
class QWebSelectData
{
@@ -66,6 +67,7 @@ public:
virtual const QString title() const = 0;
virtual const QString message() const = 0;
virtual const QByteArray iconData() const = 0;
+ virtual const QUrl openerPageUrl() const = 0;
};
class QWebNotificationPresenter : public QObject
@@ -79,6 +81,7 @@ public:
Q_SIGNALS:
void notificationClosed();
+ void notificationClicked();
};
class QWebHapticFeedbackPlayer
@@ -113,6 +116,6 @@ public:
};
-Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.3");
+Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.4");
#endif // QWEBKITPLATFORMPLUGIN_H
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index 8bf9208..181b3a6 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -64,6 +64,7 @@
#include "FocusController.h"
#include "Editor.h"
#include "Scrollbar.h"
+#include "NetworkingContext.h"
#include "PlatformKeyboardEvent.h"
#include "PlatformWheelEvent.h"
#include "PluginDatabase.h"
@@ -77,6 +78,7 @@
#include "HTMLNames.h"
#include "HitTestResult.h"
#include "WindowFeatures.h"
+#include "WebPlatformStrategies.h"
#include "LocalizedStrings.h"
#include "Cache.h"
#include "runtime/InitializeThreading.h"
@@ -263,13 +265,15 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
, inspectorIsInternalOnly(false)
{
WebCore::InitializeLoggingChannelsIfNecessary();
- JSC::initializeThreading();
+ ScriptController::initializeThreading();
WTF::initializeMainThread();
WebCore::SecurityOrigin::setLocalLoadPolicy(WebCore::SecurityOrigin::AllowLocalLoadsForLocalAndSubstituteData);
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
WebCore::Font::setCodePath(WebCore::Font::Complex);
#endif
+ WebPlatformStrategies::initialize(qq);
+
Page::PageClients pageClients;
pageClients.chromeClient = new ChromeClientQt(q);
pageClients.contextMenuClient = new ContextMenuClientQt();
@@ -1201,7 +1205,8 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
(selection.length < 0) ? selection.start : selection.start + selection.length);
} else
#endif
- editor->setComposition(preedit, underlines, preedit.length(), 0);
+ if (!preedit.isEmpty())
+ editor->setComposition(preedit, underlines, preedit.length(), 0);
}
ev->accept();
@@ -1697,15 +1702,15 @@ InspectorController* QWebPagePrivate::inspectorController()
/*!
- \class QWebPage::ViewportHints
+ \class QWebPage::ViewportConfiguration
\since 4.7
- \brief The QWebPage::ViewportHints class describes hints that can be applied to a viewport.
+ \brief The QWebPage::ViewportConfiguration class describes hints that can be applied to a viewport.
- QWebPage::ViewportHints provides a description of a viewport, such as viewport geometry,
+ QWebPage::ViewportConfiguration provides a description of a viewport, such as viewport geometry,
initial scale factor with limits, plus information about whether a user should be able
to scale the contents in the viewport or not, ie. by zooming.
- ViewportHints can be set by a web author using the viewport meta tag extension, documented
+ ViewportConfiguration can be set by a web author using the viewport meta tag extension, documented
at \l{http://developer.apple.com/safari/library/documentation/appleapplications/reference/safariwebcontent/usingtheviewport/usingtheviewport.html}{Safari Reference Library: Using the Viewport Meta Tag}.
All values might not be set, as such when dealing with the hints, the developer needs to
@@ -1715,13 +1720,14 @@ InspectorController* QWebPagePrivate::inspectorController()
*/
/*!
- Constructs an empty QWebPage::ViewportHints.
+ Constructs an empty QWebPage::ViewportConfiguration.
*/
-QWebPage::ViewportHints::ViewportHints()
+QWebPage::ViewportConfiguration::ViewportConfiguration()
: d(0)
, m_initialScaleFactor(-1.0)
, m_minimumScaleFactor(-1.0)
, m_maximumScaleFactor(-1.0)
+ , m_devicePixelRatio(-1.0)
, m_isUserScalable(true)
, m_isValid(false)
{
@@ -1729,13 +1735,14 @@ QWebPage::ViewportHints::ViewportHints()
}
/*!
- Constructs a QWebPage::ViewportHints which is a copy from \a other .
+ Constructs a QWebPage::ViewportConfiguration which is a copy from \a other .
*/
-QWebPage::ViewportHints::ViewportHints(const QWebPage::ViewportHints& other)
+QWebPage::ViewportConfiguration::ViewportConfiguration(const QWebPage::ViewportConfiguration& other)
: d(other.d)
, m_initialScaleFactor(other.m_initialScaleFactor)
, m_minimumScaleFactor(other.m_minimumScaleFactor)
, m_maximumScaleFactor(other.m_maximumScaleFactor)
+ , m_devicePixelRatio(other.m_devicePixelRatio)
, m_isUserScalable(other.m_isUserScalable)
, m_isValid(other.m_isValid)
, m_size(other.m_size)
@@ -1744,18 +1751,18 @@ QWebPage::ViewportHints::ViewportHints(const QWebPage::ViewportHints& other)
}
/*!
- Destroys the QWebPage::ViewportHints.
+ Destroys the QWebPage::ViewportConfiguration.
*/
-QWebPage::ViewportHints::~ViewportHints()
+QWebPage::ViewportConfiguration::~ViewportConfiguration()
{
}
/*!
- Assigns the given QWebPage::ViewportHints to this viewport hints and returns a
+ Assigns the given QWebPage::ViewportConfiguration to this viewport hints and returns a
reference to this.
*/
-QWebPage::ViewportHints& QWebPage::ViewportHints::operator=(const QWebPage::ViewportHints& other)
+QWebPage::ViewportConfiguration& QWebPage::ViewportConfiguration::operator=(const QWebPage::ViewportConfiguration& other)
{
if (this != &other) {
d = other.d;
@@ -1770,30 +1777,30 @@ QWebPage::ViewportHints& QWebPage::ViewportHints::operator=(const QWebPage::View
return *this;
}
-/*! \fn inline bool QWebPage::ViewportHints::isValid() const
- Returns whether this is a valid ViewportHints or not.
+/*! \fn inline bool QWebPage::ViewportConfiguration::isValid() const
+ Returns whether this is a valid ViewportConfiguration or not.
- An invalid ViewportHints will have an empty QSize, negative values for scale factors and
+ An invalid ViewportConfiguration will have an empty QSize, negative values for scale factors and
true for the boolean isUserScalable.
*/
-/*! \fn inline QSize QWebPage::ViewportHints::size() const
+/*! \fn inline QSize QWebPage::ViewportConfiguration::size() const
Returns the size of the viewport.
*/
-/*! \fn inline qreal QWebPage::ViewportHints::initialScaleFactor() const
+/*! \fn inline qreal QWebPage::ViewportConfiguration::initialScaleFactor() const
Returns the initial scale of the viewport as a multiplier.
*/
-/*! \fn inline qreal QWebPage::ViewportHints::minimumScaleFactor() const
+/*! \fn inline qreal QWebPage::ViewportConfiguration::minimumScaleFactor() const
Returns the minimum scale value of the viewport as a multiplier.
*/
-/*! \fn inline qreal QWebPage::ViewportHints::maximumScaleFactor() const
+/*! \fn inline qreal QWebPage::ViewportConfiguration::maximumScaleFactor() const
Returns the maximum scale value of the viewport as a multiplier.
*/
-/*! \fn inline bool QWebPage::ViewportHints::isUserScalable() const
+/*! \fn inline bool QWebPage::ViewportConfiguration::isUserScalable() const
Determines whether or not the scale can be modified by the user.
*/
@@ -1913,7 +1920,8 @@ QWebFrame *QWebPage::mainFrame() const
QWebFrame *QWebPage::currentFrame() const
{
d->createMainFrame();
- return static_cast<WebCore::FrameLoaderClientQt *>(d->page->focusController()->focusedOrMainFrame()->loader()->client())->webFrame();
+ WebCore::Frame *frame = d->page->focusController()->focusedOrMainFrame();
+ return qobject_cast<QWebFrame*>(frame->loader()->networkingContext()->originatingObject());
}
@@ -2317,6 +2325,30 @@ void QWebPage::setViewportSize(const QSize &size) const
}
}
+QWebPage::ViewportConfiguration QWebPage::viewportConfigurationForSize(QSize availableSize) const
+{
+ static int desktopWidth = 980;
+ static int deviceDPI = 160;
+
+ FloatRect rect = d->page->chrome()->windowRect();
+
+ int deviceWidth = rect.width();
+ int deviceHeight = rect.height();
+
+ WebCore::ViewportConfiguration conf = WebCore::findConfigurationForViewportData(mainFrame()->d->viewportArguments, desktopWidth, deviceWidth, deviceHeight, deviceDPI, availableSize);
+
+ ViewportConfiguration result;
+
+ result.m_isValid = true;
+ result.m_size = conf.layoutViewport;
+ result.m_initialScaleFactor = conf.initialScale;
+ result.m_minimumScaleFactor = conf.minimumScale;
+ result.m_maximumScaleFactor = conf.maximumScale;
+ result.m_devicePixelRatio = conf.devicePixelRatio;
+
+ return result;
+}
+
QSize QWebPage::preferredContentsSize() const
{
QWebFrame* frame = d->mainFrame;
@@ -2366,8 +2398,7 @@ void QWebPage::setPreferredContentsSize(const QSize& size) const
} else if (view->useFixedLayout())
view->setUseFixedLayout(false);
- if (frame->d->initialLayoutComplete)
- view->layout();
+ view->layout();
}
/*!
@@ -3699,25 +3730,12 @@ quint64 QWebPage::bytesReceived() const
/*!
\since 4.7
- \fn void QWebPage::viewportChangeRequested(const QWebPage::ViewportHints& hints)
-
- This signal is emitted before any layout of the contents, giving you the viewport \a arguments
- the web page would like you to use when laying out its contents, including elements fixed to the
- viewport. This viewport might be larger that your actual viewport, meaning that a initialScaleFactor
- should be applied. When no scale is given, it is assumed that the contents should be scaled
- such that the width of the scaled contents fits within the actual viewport.
-
- The minimum and maximum allowed scale represents the min and max values that the page
- allows for scaling, and thus, affects the ability to zoom in on the page.
-
- Invalid values are supplied for the values not explicitly set by the web author; thus an
- invalid viewport size, and negative values for scale factor and limits. The boolean
- ViewportHints::isUserScalable is set to true.
+ \fn void QWebPage::viewportChangeRequested()
Page authors can provide the supplied values by using the viewport meta tag. More information
about this can be found at \l{http://developer.apple.com/safari/library/documentation/appleapplications/reference/safariwebcontent/usingtheviewport/usingtheviewport.html}{Safari Reference Library: Using the Viewport Meta Tag}.
- \sa QWebPage::ViewportHints, setPreferredContentsSize(), QGraphicsWebView::setScale()
+ \sa QWebPage::ViewportConfiguration, setPreferredContentsSize(), QGraphicsWebView::setScale()
*/
/*!
diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h
index dda4a6a..b1441ff 100644
--- a/WebKit/qt/Api/qwebpage.h
+++ b/WebKit/qt/Api/qwebpage.h
@@ -48,7 +48,7 @@ class QWebHitTestResult;
class QWebNetworkInterface;
class QWebPagePrivate;
class QWebPluginFactory;
-class QtViewportHintsPrivate;
+class QtViewportConfigurationPrivate;
namespace WebCore {
class ChromeClientQt;
@@ -207,34 +207,35 @@ public:
GeolocationPermissionDomain
};
- class ViewportHints {
+ class ViewportConfiguration {
public:
- ViewportHints();
- ViewportHints(const QWebPage::ViewportHints& other);
+ ViewportConfiguration();
+ ViewportConfiguration(const QWebPage::ViewportConfiguration& other);
- ~ViewportHints();
+ ~ViewportConfiguration();
- QWebPage::ViewportHints& operator=(const QWebPage::ViewportHints& other);
+ QWebPage::ViewportConfiguration& operator=(const QWebPage::ViewportConfiguration& other);
inline qreal initialScaleFactor() const { return m_initialScaleFactor; };
inline qreal minimumScaleFactor() const { return m_minimumScaleFactor; };
inline qreal maximumScaleFactor() const { return m_maximumScaleFactor; };
- inline int targetDensityDpi() const { return m_targetDensityDpi; };
+ inline qreal devicePixelRatio() const { return m_devicePixelRatio; };
inline bool isUserScalable() const { return m_isUserScalable; };
inline bool isValid() const { return m_isValid; };
inline QSize size() const { return m_size; };
private:
- QSharedDataPointer<QtViewportHintsPrivate> d;
+ QSharedDataPointer<QtViewportConfigurationPrivate> d;
qreal m_initialScaleFactor;
qreal m_minimumScaleFactor;
qreal m_maximumScaleFactor;
- int m_targetDensityDpi;
+ qreal m_devicePixelRatio;
bool m_isUserScalable;
bool m_isValid;
QSize m_size;
friend class WebCore::ChromeClientQt;
+ friend class QWebPage;
};
@@ -274,6 +275,7 @@ public:
QSize viewportSize() const;
void setViewportSize(const QSize &size) const;
+ ViewportConfiguration viewportConfigurationForSize(QSize availableSize) const;
QSize preferredContentsSize() const;
void setPreferredContentsSize(const QSize &size) const;
@@ -384,7 +386,7 @@ Q_SIGNALS:
void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item);
void restoreFrameStateRequested(QWebFrame* frame);
- void viewportChangeRequested(const QWebPage::ViewportHints& hints);
+ void viewportChangeRequested();
void requestPermissionFromUser(QWebFrame* frame, QWebPage::PermissionDomain domain);
void checkPermissionFromUser(QWebFrame* frame, QWebPage::PermissionDomain domain, QWebPage::PermissionPolicy& policy);
diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h
index 6310eaf..82f5365 100644
--- a/WebKit/qt/Api/qwebpage_p.h
+++ b/WebKit/qt/Api/qwebpage_p.h
@@ -58,13 +58,13 @@ QT_END_NAMESPACE
class QWebInspector;
class QWebPageClient;
-class QtViewportHintsPrivate : public QSharedData {
+class QtViewportConfigurationPrivate : public QSharedData {
public:
- QtViewportHintsPrivate(QWebPage::ViewportHints* qq)
+ QtViewportConfigurationPrivate(QWebPage::ViewportConfiguration* qq)
: q(qq)
{ }
- QWebPage::ViewportHints* q;
+ QWebPage::ViewportConfiguration* q;
};
class QWebPagePrivate {
diff --git a/WebKit/qt/Api/qwebscriptworld.cpp b/WebKit/qt/Api/qwebscriptworld.cpp
index 84b678d..74ab651 100644
--- a/WebKit/qt/Api/qwebscriptworld.cpp
+++ b/WebKit/qt/Api/qwebscriptworld.cpp
@@ -32,7 +32,9 @@ using namespace WebCore;
*/
QWebScriptWorld::QWebScriptWorld()
{
+#if USE(JSC)
d = new QWebScriptWorldPrivate(ScriptController::createWorld());
+#endif
}
QWebScriptWorld::QWebScriptWorld(const QWebScriptWorld& other)
diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp
index d88b0da..b71de25 100644
--- a/WebKit/qt/Api/qwebsettings.cpp
+++ b/WebKit/qt/Api/qwebsettings.cpp
@@ -217,10 +217,6 @@ void QWebSettingsPrivate::apply()
QString storagePath = !localStoragePath.isEmpty() ? localStoragePath : global->localStoragePath;
settings->setLocalStorageDatabasePath(storagePath);
- value = attributes.value(QWebSettings::ZoomTextOnly,
- global->attributes.value(QWebSettings::ZoomTextOnly));
- settings->setZoomMode(value ? WebCore::ZoomTextOnly : WebCore::ZoomPage);
-
value = attributes.value(QWebSettings::PrintElementBackgrounds,
global->attributes.value(QWebSettings::PrintElementBackgrounds));
settings->setShouldPrintBackgrounds(value);
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 95e79a4..34edbd7 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,557 @@
+2010-09-20 Jacob Dinu <dinu.jacob@nokia.com>
+
+ Reviewed by Adam Barth.
+
+ Added a new qwebpage test for loading a cached page
+ https://bugs.webkit.org/show_bug.cgi?id=41155
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::loadCachedPage):
+
+2010-09-08 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix forward includes generation for MSVC when sh is in PATH.
+
+ MSVC's nmake isn't affected by having sh in PATH.
+
+ * Api/DerivedSources.pro:
+
+2010-09-18 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Enable Platform Strategies on Qt
+
+ [Qt] Turn on PLATFORM_STRATEGIES
+ https://bugs.webkit.org/show_bug.cgi?id=45831
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate): Initialize the PlatformStrategy
+ singleton.
+ * WebCoreSupport/WebPlatformStrategies.cpp: Added, code was moved
+ from platform/qt/Localizations.cpp and plugins/qt/PluginDataQt.cpp
+ (WebPlatformStrategies::initialize): create the singleton,
+ following the same "pattern" used by Mac and Win ports.
+ (WebPlatformStrategies::WebPlatformStrategies):
+ (WebPlatformStrategies::createPluginStrategy):
+ (WebPlatformStrategies::createLocalizationStrategy):
+ (WebPlatformStrategies::createVisitedLinkStrategy):
+ (WebPlatformStrategies::refreshPlugins):
+ (WebPlatformStrategies::getPluginInfo):
+ (WebPlatformStrategies::inputElementAltText):
+ (WebPlatformStrategies::resetButtonDefaultLabel):
+ (WebPlatformStrategies::searchableIndexIntroduction):
+ (WebPlatformStrategies::submitButtonDefaultLabel):
+ (WebPlatformStrategies::fileButtonChooseFileLabel):
+ (WebPlatformStrategies::fileButtonNoFileSelectedLabel):
+ (WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk):
+ (WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk):
+ (WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagCopy):
+ (WebPlatformStrategies::contextMenuItemTagGoBack):
+ (WebPlatformStrategies::contextMenuItemTagGoForward):
+ (WebPlatformStrategies::contextMenuItemTagStop):
+ (WebPlatformStrategies::contextMenuItemTagReload):
+ (WebPlatformStrategies::contextMenuItemTagCut):
+ (WebPlatformStrategies::contextMenuItemTagPaste):
+ (WebPlatformStrategies::contextMenuItemTagNoGuessesFound):
+ (WebPlatformStrategies::contextMenuItemTagIgnoreSpelling):
+ (WebPlatformStrategies::contextMenuItemTagLearnSpelling):
+ (WebPlatformStrategies::contextMenuItemTagSearchWeb):
+ (WebPlatformStrategies::contextMenuItemTagLookUpInDictionary):
+ (WebPlatformStrategies::contextMenuItemTagOpenLink):
+ (WebPlatformStrategies::contextMenuItemTagIgnoreGrammar):
+ (WebPlatformStrategies::contextMenuItemTagSpellingMenu):
+ (WebPlatformStrategies::contextMenuItemTagShowSpellingPanel):
+ (WebPlatformStrategies::contextMenuItemTagCheckSpelling):
+ (WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping):
+ (WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling):
+ (WebPlatformStrategies::contextMenuItemTagFontMenu):
+ (WebPlatformStrategies::contextMenuItemTagBold):
+ (WebPlatformStrategies::contextMenuItemTagItalic):
+ (WebPlatformStrategies::contextMenuItemTagUnderline):
+ (WebPlatformStrategies::contextMenuItemTagOutline):
+ (WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu):
+ (WebPlatformStrategies::contextMenuItemTagTextDirectionMenu):
+ (WebPlatformStrategies::contextMenuItemTagDefaultDirection):
+ (WebPlatformStrategies::contextMenuItemTagLeftToRight):
+ (WebPlatformStrategies::contextMenuItemTagRightToLeft):
+ (WebPlatformStrategies::contextMenuItemTagInspectElement):
+ (WebPlatformStrategies::searchMenuNoRecentSearchesText):
+ (WebPlatformStrategies::searchMenuRecentSearchesText):
+ (WebPlatformStrategies::searchMenuClearRecentSearchesText):
+ (WebPlatformStrategies::AXWebAreaText):
+ (WebPlatformStrategies::AXLinkText):
+ (WebPlatformStrategies::AXListMarkerText):
+ (WebPlatformStrategies::AXImageMapText):
+ (WebPlatformStrategies::AXHeadingText):
+ (WebPlatformStrategies::AXDefinitionListTermText):
+ (WebPlatformStrategies::AXDefinitionListDefinitionText):
+ (WebPlatformStrategies::AXButtonActionVerb):
+ (WebPlatformStrategies::AXRadioButtonActionVerb):
+ (WebPlatformStrategies::AXTextFieldActionVerb):
+ (WebPlatformStrategies::AXCheckedCheckBoxActionVerb):
+ (WebPlatformStrategies::AXUncheckedCheckBoxActionVerb):
+ (WebPlatformStrategies::AXMenuListActionVerb):
+ (WebPlatformStrategies::AXMenuListPopupActionVerb):
+ (WebPlatformStrategies::AXLinkActionVerb):
+ (WebPlatformStrategies::missingPluginText):
+ (WebPlatformStrategies::crashedPluginText):
+ (WebPlatformStrategies::multipleFileUploadText):
+ (WebPlatformStrategies::unknownFileSizeText):
+ (WebPlatformStrategies::imageTitle):
+ (WebPlatformStrategies::mediaElementLoadingStateText):
+ (WebPlatformStrategies::mediaElementLiveBroadcastStateText):
+ (WebPlatformStrategies::localizedMediaControlElementString):
+ (WebPlatformStrategies::localizedMediaControlElementHelpText):
+ (WebPlatformStrategies::localizedMediaTimeDescription):
+ (WebPlatformStrategies::validationMessageValueMissingText):
+ (WebPlatformStrategies::validationMessageTypeMismatchText):
+ (WebPlatformStrategies::validationMessagePatternMismatchText):
+ (WebPlatformStrategies::validationMessageTooLongText):
+ (WebPlatformStrategies::validationMessageRangeUnderflowText):
+ (WebPlatformStrategies::validationMessageRangeOverflowText):
+ (WebPlatformStrategies::validationMessageStepMismatchText):
+ (WebPlatformStrategies::isLinkVisited):
+ (WebPlatformStrategies::addVisitedLink):
+ * WebCoreSupport/WebPlatformStrategies.h: Added, based on Mac and Win
+ versions.
+
+2010-09-18 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] V8 port: Add FrameLoaderClientQt::allowScriptExtension()
+ https://bugs.webkit.org/show_bug.cgi?id=46034
+
+ r67749 added FrameLoaderClient::allowScriptExtension() (V8-specific)
+ Add a stub implementation that simply returns false for now.
+
+ * WebCoreSupport/FrameLoaderClientQt.h:
+ (WebCore::FrameLoaderClientQt::allowScriptExtension):
+
+2010-09-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ REGRESSION (r60104): Zoom level is unexpectedly reset on page reload
+ https://bugs.webkit.org/show_bug.cgi?id=42863
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setTextSizeMultiplier):
+ (QWebFrame::textSizeMultiplier):
+ (QWebFrame::setZoomFactor):
+ (QWebFrame::zoomFactor):
+ Call functions on Frame instead of FrameView.
+
+2010-09-16 Darin Adler <darin@apple.com>
+
+ Fix build.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::setInputMethodState): Updated for change
+ in name of isUrlField to isURLField.
+
+2010-09-16 Darin Adler <darin@apple.com>
+
+ Reviewed by Andreas Kling.
+
+ Reduce use of HTMLInputElement::inputType so we can remove it later
+ https://bugs.webkit.org/show_bug.cgi?id=45903
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId):
+ Use isPasswordField.
+
+2010-09-16 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Support globalhistory tests
+ https://bugs.webkit.org/show_bug.cgi?id=45774
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::populateVisitedLinks):
+ * WebCoreSupport/ChromeClientQt.h:
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::dumpHistoryCallbacks):
+ (DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::setTitle):
+ (WebCore::FrameLoaderClientQt::updateGlobalHistory):
+ (WebCore::FrameLoaderClientQt::updateGlobalHistoryRedirectLinks):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2010-09-16 Diego Gonzalez <diegohcg@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Remove FrameLoaderClientQt::webFrame() to use NetworkingContext to get the WebFrame to avoid layering violations
+ https://bugs.webkit.org/show_bug.cgi?id=42293
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::childFrames):
+ (QWebFramePrivate::kit):
+ * Api/qwebpage.cpp:
+ (QWebPage::currentFrame):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::runJavaScriptAlert):
+ (WebCore::ChromeClientQt::runJavaScriptConfirm):
+ (WebCore::ChromeClientQt::runJavaScriptPrompt):
+ (WebCore::ChromeClientQt::contentsSizeChanged):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::chooseFile):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2010-09-15 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Update the Symbian def files
+
+ Re-freeze with the viewport meta tag updates.
+
+ * symbian/eabi/QtWebKitu.def:
+
+2010-09-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] V8 port: Get inspector up and running
+ https://bugs.webkit.org/show_bug.cgi?id=45771
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::ensureDebuggerScriptLoaded): Added, loads DebuggerScript.js into ScriptDebugServer.
+ (WebCore::InspectorClientQt::openInspectorFrontend): Ensure that DebuggerScript.js is loaded
+ before opening an inspector.
+
+2010-09-14 Enrico Ros <eros@codeaurora.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Respect title attribute on option elements
+ https://bugs.webkit.org/show_bug.cgi?id=45084
+
+ Set the tooltip in the combo box model, so it's reflected in the view.
+
+ * WebCoreSupport/QtFallbackWebPopup.cpp:
+ (WebCore::QtFallbackWebPopup::populate):
+
+2010-09-13 Daniel Bates <dbates@rim.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=45732
+
+ Fix the Qt build. I missed this when reviewing the patch
+ for Bug #45732.
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::suspendActiveDOMObjects): Change enum value ActiveDOMObject::JavaScriptPaused to
+ ActiveDOMObject::JavaScriptDebuggerPaused
+
+2010-09-13 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Daniel Bates.
+
+ [Qt] DumpRenderTreeSupportQt::suspendActiveDOMObjects needs a new parameter
+ https://bugs.webkit.org/show_bug.cgi?id=45732
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::suspendActiveDOMObjects): Pass ActiveDOMObject::JavaScriptPaused
+ to suspendActiveDOMObjects.
+
+2010-09-13 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Paste should be implemented in WebCore like Copy and Cut for Mac also.
+ https://bugs.webkit.org/show_bug.cgi?id=45494
+ <rdar://problem/7660537>
+
+ On the Mac platform, the implementation of the paste operation is all done
+ at the WebKit level. In order to support it on WebKit2 it is necessary to
+ refactor the code and move this functionality at the level of WebCore like
+ we already have on Windows.
+ The original code relies on some in AppKit functions that call back into
+ WebKit causing problems in WebKit2. All this functionality has been moved
+ at the level of the editor client where it can be dealt with appropriately.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::canShowMIMETypeAsHTML): Added stub.
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2010-08-27 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
+
+ Reviewed by Antti Koivisto.
+
+ Add a Qt API for the viewport meta tag support based on the
+ following draft spec:
+
+ http://people.opera.com/rune/TR/ED-css-viewport-20100806/
+
+ Add common handling of viewport meta tag based on new Opera spec
+ https://bugs.webkit.org/show_bug.cgi?id=44201
+
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+ * Api/qwebpage.cpp:
+ (QWebPage::ViewportConfiguration::ViewportConfiguration):
+ (QWebPage::ViewportConfiguration::~ViewportConfiguration):
+ (QWebPage::ViewportConfiguration::operator=):
+ (QWebPage::viewportConfigurationForSize):
+ (QWebPage::setPreferredContentsSize):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ (QtViewportConfigurationPrivate::QtViewportConfigurationPrivate):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::didReceiveViewportArguments):
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::viewportAsText):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout):
+
+2010-09-12 Martin Smith <martin.smith@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ doc: Changed the title so lists of contents sort better.
+
+ * docs/qtwebkit.qdoc:
+
+2010-09-12 David Boddie <david.boddie@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: More work on the QML documentation.
+
+ * declarative/qdeclarativewebview.cpp:
+
+2010-09-12 Martin Jones <martin.jones@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qml] Ensure WebView gets focus when an editable node is clicked on.
+
+ Task-number: QTBUG-13342
+
+ * declarative/qdeclarativewebview.cpp:
+ (GraphicsWebView::mousePressEvent):
+
+2010-09-12 David Boddie <david.boddie@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: qdoc fixes.
+
+ * declarative/qdeclarativewebview.cpp:
+
+2010-09-12 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] let WebKit inject itself into the qt configuration
+
+ Task-number: QTBUG-12379
+
+ * qt_webkit_version.pri: Use the faster + instead of *
+ operator to add webkit to the config.
+
+2010-09-12 Martin Smith <martin.smith@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix group of declarative web view in QML docs.
+
+ * declarative/qdeclarativewebview.cpp:
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Partial implementation of Qt bridge using V8 and QtScript.
+
+ * Api/qwebelement.cpp:
+ (QWebElement::evaluateJavaScript): Stub it out for now,
+ to compile, until we have a conversion path between v8::Object
+ and QScriptValue.
+ * Api/qwebframe.cpp:
+ (QWebFrame::addToJavaScriptWindowObject): Implemented using
+ few lines of QtScript code.
+ (QWebFrame::evaluateJavaScript): Ditto.
+
+2010-09-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ Fix the build with V8.
+
+ This is a temporary kludge until the scriptworld stuff is properly
+ ported, as part of the upcoming DRT work.
+
+ * Api/qwebscriptworld.cpp:
+ (QWebScriptWorld::QWebScriptWorld):
+
+2010-09-11 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] V8 port for Qt platform: Qt WebCoreSupport changes
+ https://bugs.webkit.org/show_bug.cgi?id=45149
+
+ Original patch by Vlad Burlik <volodimir.burlik@nokia.com>
+
+ Implemented the V8 specifics needed in DumpRenderTreeSupportQt and
+ FrameLoaderClientQt.
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::javaScriptObjectsCount):
+ (DumpRenderTreeSupportQt::garbageCollectorCollect):
+ (DumpRenderTreeSupportQt::garbageCollectorCollectOnAlternateThread):
+ (DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::didCreateScriptContextForFrame):
+ (WebCore::FrameLoaderClientQt::didDestroyScriptContextForFrame):
+ (WebCore::FrameLoaderClientQt::didCreateIsolatedScriptContext):
+ (WebCore::FrameLoaderClientQt::createDocumentLoader):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2010-09-11 Vlad Burlik <volodimir.burlik@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] V8 port for QT platform: QT API implementation changes
+ https://bugs.webkit.org/show_bug.cgi?id=45148
+
+ V8 Implementation of QWebFrame::addToJavaScriptWindowObject()
+ and QWebFrame::evaluateJavaScript()
+
+ * Api/qwebelement.cpp:
+ (setupScriptContext): JSC and V8 variations
+ (QWebElement::evaluateJavaScript):
+ * Api/qwebelement.h:
+ * Api/qwebframe.cpp: QObject injection to V8 world
+ (QWebFrame::addToJavaScriptWindowObject):
+ (QWebFrame::evaluateJavaScript):
+ * Api/qwebpage.cpp: Use ScriptController type definitions instead of direct references to JSC or V8
+ (QWebPagePrivate::QWebPagePrivate):
+
+2010-09-10 yi shen <yi.4.shen@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] selected text gets deleted when qgraphicswebview losts focus
+ https://bugs.webkit.org/show_bug.cgi?id=45539
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::inputMethodEvent):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods):
+
+2010-09-10 Sam Weinig <sam@webkit.org>
+
+ Fix Qt build.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+
+2010-09-10 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove unnecessary constraint in WebCore of choosing either text zoom or full page zoom.
+ Precursor to <rdar://problem/7660657>
+ https://bugs.webkit.org/show_bug.cgi?id=45522
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setTextSizeMultiplier):
+ (QWebFrame::textSizeMultiplier):
+ (QWebFrame::setZoomFactor):
+ (QWebFrame::zoomFactor):
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+ Move tracking of text only zoom here from WebCore.
+
+2010-09-10 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Support click event for notifications
+ https://bugs.webkit.org/show_bug.cgi?id=44836
+
+ Propagate click events to JavaScript from either the
+ platform plugn or from QSystemTrayIcon.
+ Also added the method NotificationWrapper::openerPageUrl so that
+ if the platform plugin can reopen the page that created the
+ notification directly, when the user clicks the notification.
+
+ Added DumpRenderTreeSupportQt::simulateDesktopNotificationClick
+ for testing purpose.
+
+ * Api/qwebkitplatformplugin.h:
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::simulateDesktopNotificationClick):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+ * WebCoreSupport/NotificationPresenterClientQt.cpp:
+ (WebCore::NotificationWrapper::openerPageUrl):
+ (WebCore::NotificationWrapper::notificationClicked):
+ (WebCore::NotificationPresenterClientQt::displayNotification):
+ (WebCore::NotificationPresenterClientQt::notificationClicked):
+ * WebCoreSupport/NotificationPresenterClientQt.h:
+ * examples/platformplugin/WebNotificationPresenter.cpp:
+ (WebNotificationWidget::event):
+ * examples/platformplugin/WebNotificationPresenter.h:
+ (WebNotificationPresenter::WebNotificationPresenter):
+ * examples/platformplugin/qwebkitplatformplugin.h:
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Attempt to fix the failign Qt tests. This patch adapts code from
+ Chromium. The long-term fix is to remove the need for this code, but
+ that's a bit too complicated for a buildfix patch.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
+ (WebCore::FrameLoaderClientQt::makeRepresentation):
+ (WebCore::FrameLoaderClientQt::revertToProvisionalState):
+ (WebCore::FrameLoaderClientQt::finishedLoading):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ This code didn't know that setEncoding can be called multiple times.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
+ (WebCore::FrameLoaderClientQt::finishedLoading):
+ (WebCore::FrameLoaderClientQt::setMainDocumentError):
+ (WebCore::FrameLoaderClientQt::committedLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoading):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Main resource bytes shouldn't bounce through FrameLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45496
+
+ Now return the bytes to the DocumentLoader.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::committedLoad):
+
2010-09-08 Darin Adler <darin@apple.com>
Reviewed by Adam Barth.
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 8b01d4d..a5dfdc7 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -44,6 +44,7 @@
#include "GeolocationPermissionClientQt.h"
#include "HitTestResult.h"
#include "Icon.h"
+#include "NetworkingContext.h"
#include "NotImplemented.h"
#include "NotificationPresenterClientQt.h"
#include "PageClientQt.h"
@@ -74,6 +75,8 @@
namespace WebCore {
+bool ChromeClientQt::dumpVisitedLinksCallbacks = false;
+
ChromeClientQt::ChromeClientQt(QWebPage* webPage)
: m_webPage(webPage)
, m_eventLoop(0)
@@ -294,22 +297,22 @@ void ChromeClientQt::closeWindowSoon()
void ChromeClientQt::runJavaScriptAlert(Frame* f, const String& msg)
{
QString x = msg;
- FrameLoaderClientQt* fl = static_cast<FrameLoaderClientQt*>(f->loader()->client());
- m_webPage->javaScriptAlert(fl->webFrame(), x);
+ QWebFrame* webFrame = qobject_cast<QWebFrame*>(f->loader()->networkingContext()->originatingObject());
+ m_webPage->javaScriptAlert(webFrame, x);
}
bool ChromeClientQt::runJavaScriptConfirm(Frame* f, const String& msg)
{
QString x = msg;
- FrameLoaderClientQt* fl = static_cast<FrameLoaderClientQt*>(f->loader()->client());
- return m_webPage->javaScriptConfirm(fl->webFrame(), x);
+ QWebFrame* webFrame = qobject_cast<QWebFrame*>(f->loader()->networkingContext()->originatingObject());
+ return m_webPage->javaScriptConfirm(webFrame, x);
}
bool ChromeClientQt::runJavaScriptPrompt(Frame* f, const String& message, const String& defaultValue, String& result)
{
QString x = result;
- FrameLoaderClientQt* fl = static_cast<FrameLoaderClientQt*>(f->loader()->client());
- bool rc = m_webPage->javaScriptPrompt(fl->webFrame(), (QString)message, (QString)defaultValue, &x);
+ QWebFrame* webFrame = qobject_cast<QWebFrame*>(f->loader()->networkingContext()->originatingObject());
+ bool rc = m_webPage->javaScriptPrompt(webFrame, (QString)message, (QString)defaultValue, &x);
// Fix up a quirk in the QInputDialog class. If no input happened the string should be empty
// but it is null. See https://bugs.webkit.org/show_bug.cgi?id=30914.
@@ -444,7 +447,8 @@ PlatformPageClient ChromeClientQt::platformPageClient() const
void ChromeClientQt::contentsSizeChanged(Frame* frame, const IntSize& size) const
{
- emit QWebFramePrivate::kit(frame)->contentsSizeChanged(size);
+ if (frame->loader()->networkingContext())
+ QWebFramePrivate::kit(frame)->contentsSizeChanged(size);
}
void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned)
@@ -640,22 +644,9 @@ QWebSelectMethod* ChromeClientQt::createSelectPopup() const
void ChromeClientQt::didReceiveViewportArguments(Frame* frame, const ViewportArguments& arguments) const
{
- if (m_webPage->mainFrame()->d->initialLayoutComplete)
- return;
-
- QSize viewportSize(arguments.width, arguments.height);
- bool isUserScalable = arguments.userScalable == 1;
-
- QWebPage::ViewportHints hints;
- hints.m_isValid = true;
- hints.m_size = viewportSize;
- hints.m_initialScaleFactor = arguments.initialScale;
- hints.m_minimumScaleFactor = arguments.minimumScale;
- hints.m_maximumScaleFactor = arguments.maximumScale;
- hints.m_targetDensityDpi = arguments.targetDensityDpi;
- hints.m_isUserScalable = isUserScalable;
+ m_webPage->mainFrame()->d->viewportArguments = arguments;
- emit m_webPage->viewportChangeRequested(hints);
+ emit m_webPage->viewportChangeRequested();
}
bool ChromeClientQt::selectItemWritingDirectionIsNatural()
@@ -673,4 +664,14 @@ PassRefPtr<SearchPopupMenu> ChromeClientQt::createSearchPopupMenu(PopupMenuClien
return adoptRef(new SearchPopupMenuQt(createPopupMenu(client)));
}
+void ChromeClientQt::populateVisitedLinks()
+{
+ // We don't need to do anything here because history is tied to QWebPage rather than stored
+ // in a separate database
+ if (dumpVisitedLinksCallbacks) {
+ printf("Asked to populate visited links for WebView \"%s\"\n",
+ qPrintable(m_webPage->mainFrame()->url().toString()));
+ }
+}
+
} // namespace WebCore
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index d18f993..56801aa 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -173,6 +173,7 @@ namespace WebCore {
virtual bool selectItemWritingDirectionIsNatural();
virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const;
virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
+ virtual void populateVisitedLinks();
QWebSelectMethod* createSelectPopup() const;
@@ -188,6 +189,8 @@ namespace WebCore {
bool menuBarVisible;
QEventLoop* m_eventLoop;
+ static bool dumpVisitedLinksCallbacks;
+
mutable QtPlatformPlugin m_platformPlugin;
};
}
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index c1be131..ed7ac32 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -24,6 +24,7 @@
#include "DumpRenderTreeSupportQt.h"
#include "CSSComputedStyleDeclaration.h"
+#include "ChromeClientQt.h"
#include "ContextMenu.h"
#include "ContextMenuClientQt.h"
#include "ContextMenuController.h"
@@ -34,7 +35,12 @@
#include "Frame.h"
#include "FrameLoaderClientQt.h"
#include "FrameView.h"
+#if USE(JSC)
#include "GCController.h"
+#elif USE(V8)
+#include "V8GCController.h"
+#include "V8Proxy.h"
+#endif
#include "Geolocation.h"
#include "GeolocationServiceMock.h"
#include "Geoposition.h"
@@ -296,17 +302,31 @@ void DumpRenderTreeSupportQt::clearFrameName(QWebFrame* frame)
int DumpRenderTreeSupportQt::javaScriptObjectsCount()
{
+#if USE(JSC)
return JSDOMWindowBase::commonJSGlobalData()->heap.globalObjectCount();
+#elif USE(V8)
+ // FIXME: Find a way to do this using V8.
+ return 1;
+#endif
}
void DumpRenderTreeSupportQt::garbageCollectorCollect()
{
+#if USE(JSC)
gcController().garbageCollectNow();
+#elif USE(V8)
+ v8::V8::LowMemoryNotification();
+#endif
}
void DumpRenderTreeSupportQt::garbageCollectorCollectOnAlternateThread(bool waitUntilDone)
{
+#if USE(JSC)
gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
+#elif USE(V8)
+ // FIXME: Find a way to do this using V8.
+ garbageCollectorCollect();
+#endif
}
// Returns the value of counter in the element specified by \a id.
@@ -347,7 +367,9 @@ void DumpRenderTreeSupportQt::suspendActiveDOMObjects(QWebFrame* frame)
{
Frame* coreFrame = QWebFramePrivate::core(frame);
if (coreFrame->document())
- coreFrame->document()->suspendActiveDOMObjects();
+ // FIXME: This function should be changed take a ReasonForSuspension parameter
+ // https://bugs.webkit.org/show_bug.cgi?id=45732
+ coreFrame->document()->suspendActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused);
}
// Resume active DOM objects in this frame.
@@ -511,9 +533,7 @@ bool DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(QWebFrame*
if (!inputElement)
return false;
- return (inputElement->isTextField()
- && inputElement->inputType() != HTMLInputElement::PASSWORD
- && inputElement->autoComplete());
+ return inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->autoComplete();
}
void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage* page, const QString& editingBehavior)
@@ -582,6 +602,16 @@ void DumpRenderTreeSupportQt::setCustomPolicyDelegate(bool enabled, bool permiss
FrameLoaderClientQt::policyDelegatePermissive = permissive;
}
+void DumpRenderTreeSupportQt::dumpHistoryCallbacks(bool b)
+{
+ FrameLoaderClientQt::dumpHistoryCallbacks = b;
+}
+
+void DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(bool b)
+{
+ ChromeClientQt::dumpVisitedLinksCallbacks = b;
+}
+
void DumpRenderTreeSupportQt::dumpEditingCallbacks(bool b)
{
EditorClientQt::dumpEditingCallbacks = b;
@@ -599,6 +629,27 @@ void DumpRenderTreeSupportQt::dumpNotification(bool b)
#endif
}
+QString DumpRenderTreeSupportQt::viewportAsText(QWebPage* page, const QSize& availableSize)
+{
+ WebCore::ViewportArguments args = page->mainFrame()->d->viewportArguments;
+ WebCore::ViewportConfiguration conf = WebCore::findConfigurationForViewportData(args,
+ /* desktop-width */ 980,
+ /* device-width */ 320,
+ /* device-height */ 480,
+ /* device-dpi */ 160,
+ availableSize);
+
+ QString res;
+ res = res.sprintf("viewport size %dx%d scale %f with limits [%f, %f]\n",
+ conf.layoutViewport.width(),
+ conf.layoutViewport.height(),
+ conf.initialScale,
+ conf.minimumScale,
+ conf.maximumScale);
+
+ return res;
+}
+
void DumpRenderTreeSupportQt::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
{
#if ENABLE(GEOLOCATION)
@@ -670,8 +721,16 @@ void DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(QWebFrame* frame, in
ScriptController* proxy = coreFrame->script();
- if (proxy)
- proxy->executeScriptInWorld(scriptWorld->world(), script, true);
+ if (!proxy)
+ return;
+#if USE(JSC)
+ proxy->executeScriptInWorld(scriptWorld->world(), script, true);
+#elif USE(V8)
+ ScriptSourceCode source(script);
+ Vector<ScriptSourceCode> sources;
+ sources.append(source);
+ proxy->evaluateInIsolatedWorld(0, sources, true);
+#endif
}
bool DumpRenderTreeSupportQt::isPageBoxVisible(QWebFrame* frame, int pageIndex)
@@ -698,6 +757,13 @@ void DumpRenderTreeSupportQt::addUserStyleSheet(QWebPage* page, const QString& s
page->handle()->page->group().addUserStyleSheetToWorld(mainThreadNormalWorld(), sourceCode, QUrl(), 0, 0, WebCore::InjectInAllFrames);
}
+void DumpRenderTreeSupportQt::simulateDesktopNotificationClick(const QString& title)
+{
+#if ENABLE(NOTIFICATIONS)
+ NotificationPresenterClientQt::notificationPresenter()->notificationClicked(title);
+#endif
+}
+
// Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release
void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* frame)
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
index 2069114..5a59475 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -106,6 +106,8 @@ public:
static void setWillSendRequestReturnsNullOnRedirect(bool b);
static void setWillSendRequestReturnsNull(bool b);
static void setWillSendRequestClearHeaders(const QStringList& headers);
+ static void dumpHistoryCallbacks(bool b);
+ static void dumpVisitedLinksCallbacks(bool b);
static void setDeferMainResourceDataLoad(bool b);
@@ -127,7 +129,8 @@ public:
static QString pageSizeAndMarginsInPixels(QWebFrame* frame, int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);
static QString pageProperty(QWebFrame* frame, const QString& propertyName, int pageNumber);
static void addUserStyleSheet(QWebPage* page, const QString& sourceCode);
-
+ static void simulateDesktopNotificationClick(const QString& title);
+ static QString viewportAsText(QWebPage*, const QSize&);
};
#endif
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 0a9a0ea..080c459 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -612,7 +612,7 @@ void EditorClientQt::setInputMethodState(bool active)
hints |= Qt::ImhDigitsOnly;
if (inputElement->isEmailField())
hints |= Qt::ImhEmailCharactersOnly;
- if (inputElement->isUrlField())
+ if (inputElement->isURLField())
hints |= Qt::ImhUrlCharactersOnly;
// Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag
// for password fields. The Qt platform is responsible for determining which widget
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 2d73f7f..4aadeb0 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -40,7 +40,11 @@
#include "FrameView.h"
#include "DocumentLoader.h"
#include "HitTestResult.h"
+#if USE(JSC)
#include "JSDOMWindowBase.h"
+#elif USE(V8)
+#include "V8DOMWindow.h"
+#endif
#include "MIMETypeRegistry.h"
#include "MouseEvent.h"
#include "ResourceResponse.h"
@@ -63,6 +67,7 @@
#include "ScriptString.h"
#include "Settings.h"
#include "QWebPageClient.h"
+#include "ViewportArguments.h"
#include "qwebpage.h"
#include "qwebpage_p.h"
@@ -160,6 +165,7 @@ bool FrameLoaderClientQt::sendRequestReturnsNullOnRedirect = false;
bool FrameLoaderClientQt::sendRequestReturnsNull = false;
bool FrameLoaderClientQt::dumpResourceResponseMIMETypes = false;
bool FrameLoaderClientQt::deferMainResourceDataLoad = true;
+bool FrameLoaderClientQt::dumpHistoryCallbacks = false;
QStringList FrameLoaderClientQt::sendRequestClearHeaders;
QString FrameLoaderClientQt::dumpResourceLoadCallbacksPath;
@@ -189,10 +195,10 @@ static const char* navigationTypeToString(NavigationType type)
FrameLoaderClientQt::FrameLoaderClientQt()
: m_frame(0)
, m_webFrame(0)
- , m_firstData(false)
, m_pluginView(0)
, m_hasSentResponseToPlugin(false)
- , m_loadError (ResourceError())
+ , m_hasRepresentation(false)
+ , m_loadError(ResourceError())
{
}
@@ -225,11 +231,6 @@ void FrameLoaderClientQt::setFrame(QWebFrame* webFrame, Frame* frame)
m_webFrame, SIGNAL(titleChanged(QString)));
}
-QWebFrame* FrameLoaderClientQt::webFrame() const
-{
- return m_webFrame;
-}
-
void FrameLoaderClientQt::callPolicyFunction(FramePolicyFunction function, PolicyAction action)
{
(m_frame->loader()->policyChecker()->*function)(action);
@@ -277,7 +278,7 @@ void FrameLoaderClientQt::transitionToCommittedForNewPage()
void FrameLoaderClientQt::makeRepresentation(DocumentLoader*)
{
- // don't need this for now I think.
+ m_hasRepresentation = true;
}
@@ -357,6 +358,18 @@ void FrameLoaderClientQt::dispatchDidChangeLocationWithinPage()
m_webFrame->page()->d->updateNavigationActions();
}
+#if USE(V8)
+void FrameLoaderClientQt::didCreateScriptContextForFrame()
+{
+}
+void FrameLoaderClientQt::didDestroyScriptContextForFrame()
+{
+}
+void FrameLoaderClientQt::didCreateIsolatedScriptContext()
+{
+}
+#endif
+
void FrameLoaderClientQt::dispatchDidPushStateWithinPage()
{
if (dumpFrameLoaderCallbacks)
@@ -429,7 +442,8 @@ void FrameLoaderClientQt::dispatchDidCommitLoad()
if (m_frame->tree()->parent() || !m_webFrame)
return;
- m_webFrame->d->initialLayoutComplete = false;
+ // Clear the viewport arguments.
+ m_webFrame->d->viewportArguments = WebCore::ViewportArguments();
emit m_webFrame->urlChanged(m_webFrame->url());
m_webFrame->page()->d->updateNavigationActions();
@@ -443,7 +457,7 @@ void FrameLoaderClientQt::dispatchDidCommitLoad()
if (!isMainFrame)
return;
- emit m_webFrame->page()->viewportChangeRequested(QWebPage::ViewportHints());
+ emit m_webFrame->page()->viewportChangeRequested();
}
@@ -481,7 +495,6 @@ void FrameLoaderClientQt::dispatchDidFinishLoad()
void FrameLoaderClientQt::dispatchDidFirstLayout()
{
- m_webFrame->d->initialLayoutComplete = true;
}
void FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout()
@@ -518,7 +531,7 @@ void FrameLoaderClientQt::dispatchDidLoadMainResource(DocumentLoader*)
void FrameLoaderClientQt::revertToProvisionalState(DocumentLoader*)
{
- notImplemented();
+ m_hasRepresentation = true;
}
@@ -582,21 +595,25 @@ void FrameLoaderClientQt::didChangeTitle(DocumentLoader*)
void FrameLoaderClientQt::finishedLoading(DocumentLoader* loader)
{
if (!m_pluginView) {
- if(m_firstData) {
- FrameLoader *fl = loader->frameLoader();
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
- }
- else {
- if (m_pluginView->isPluginView())
- m_pluginView->didFinishLoading();
- m_pluginView = 0;
- m_hasSentResponseToPlugin = false;
+ // This is necessary to create an empty document. See bug 634004.
+ // However, we only want to do this if makeRepresentation has been called, to
+ // match the behavior on the Mac.
+ if (m_hasRepresentation)
+ loader->frameLoader()->writer()->setEncoding("", false);
+ return;
}
+ if (m_pluginView->isPluginView())
+ m_pluginView->didFinishLoading();
+ m_pluginView = 0;
+ m_hasSentResponseToPlugin = false;
}
-
+bool FrameLoaderClientQt::canShowMIMETypeAsHTML(const String& MIMEType) const
+{
+ notImplemented();
+ return false;
+}
+
bool FrameLoaderClientQt::canShowMIMEType(const String& MIMEType) const
{
String type = MIMEType;
@@ -657,9 +674,17 @@ void FrameLoaderClientQt::prepareForDataSourceReplacement()
{
}
-void FrameLoaderClientQt::setTitle(const String&, const KURL&)
+void FrameLoaderClientQt::setTitle(const String& title, const KURL& url)
{
- // no need for, dispatchDidReceiveTitle is the right callback
+ // Used by Apple WebKit to update the title of an existing history item.
+ // QtWebKit doesn't accomodate this on history items. If it ever does,
+ // it should be privateBrowsing-aware.For now, we are just passing
+ // globalhistory layout tests.
+ if (dumpHistoryCallbacks) {
+ printf("WebView updated the title for history URL \"%s\" to \"%s\".\n",
+ qPrintable(drtDescriptionSuitableForTestResult(url)),
+ qPrintable(QString(title)));
+ }
}
@@ -722,12 +747,48 @@ void FrameLoaderClientQt::registerForIconNotification(bool)
void FrameLoaderClientQt::updateGlobalHistory()
{
QWebHistoryInterface *history = QWebHistoryInterface::defaultInterface();
+ WebCore::DocumentLoader* loader = m_frame->loader()->documentLoader();
if (history)
- history->addHistoryEntry(m_frame->loader()->documentLoader()->urlForHistory().prettyURL());
+ history->addHistoryEntry(loader->urlForHistory().prettyURL());
+
+ if (dumpHistoryCallbacks) {
+ printf("WebView navigated to url \"%s\" with title \"%s\" with HTTP equivalent method \"%s\". The navigation was %s and was %s%s.\n",
+ qPrintable(drtDescriptionSuitableForTestResult(loader->urlForHistory())),
+ qPrintable(QString(loader->title())),
+ qPrintable(QString(loader->request().httpMethod())),
+ ((loader->substituteData().isValid() || (loader->response().httpStatusCode() >= 400)) ? "a failure" : "successful"),
+ ((!loader->clientRedirectSourceForHistory().isEmpty()) ? "a client redirect from " : "not a client redirect"),
+ (!loader->clientRedirectSourceForHistory().isEmpty()) ? qPrintable(drtDescriptionSuitableForTestResult(loader->clientRedirectSourceForHistory())) : "");
+ }
}
void FrameLoaderClientQt::updateGlobalHistoryRedirectLinks()
{
+ // Apple WebKit is the only port that makes use of this callback. It calls
+ // WebCore::HistoryItem::addRedirectURL() with the contents of
+ // loader->[server|client]RedirectDestinationForHistory().
+ // WebCore can associate a bunch of redirect URLs with a particular
+ // item in the history, presumably this allows Safari to skip the redirections
+ // when navigating to that history item. That might be a feature Qt wants to
+ // offer through QWebHistoryInterface in the future. For now, we're just
+ // passing tests in LayoutTests/http/tests/globalhistory.
+ WebCore::DocumentLoader* loader = m_frame->loader()->documentLoader();
+
+ if (!loader->clientRedirectSourceForHistory().isNull()) {
+ if (dumpHistoryCallbacks) {
+ printf("WebView performed a client redirect from \"%s\" to \"%s\".\n",
+ qPrintable(QString(loader->clientRedirectSourceForHistory())),
+ qPrintable(QString(loader->clientRedirectDestinationForHistory())));
+ }
+ }
+
+ if (!loader->serverRedirectSourceForHistory().isNull()) {
+ if (dumpHistoryCallbacks) {
+ printf("WebView performed a server redirect from \"%s\" to \"%s\".\n",
+ qPrintable(QString(loader->serverRedirectSourceForHistory())),
+ qPrintable(QString(loader->serverRedirectDestinationForHistory())));
+ }
+ }
}
bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *) const
@@ -776,31 +837,19 @@ bool FrameLoaderClientQt::canCachePage() const
void FrameLoaderClientQt::setMainDocumentError(WebCore::DocumentLoader* loader, const WebCore::ResourceError& error)
{
- if (!m_pluginView) {
- if (m_firstData) {
- loader->frameLoader()->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
- } else {
- if (m_pluginView->isPluginView())
- m_pluginView->didFail(error);
- m_pluginView = 0;
- m_hasSentResponseToPlugin = false;
- }
+ if (!m_pluginView)
+ return;
+ if (m_pluginView->isPluginView())
+ m_pluginView->didFail(error);
+ m_pluginView = 0;
+ m_hasSentResponseToPlugin = false;
}
+// FIXME: This function should be moved into WebCore.
void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
{
- if (!m_pluginView) {
- if (!m_frame)
- return;
- FrameLoader *fl = loader->frameLoader();
- if (m_firstData) {
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
- fl->addData(data, length);
- }
+ if (!m_pluginView)
+ loader->commitData(data, length);
// We re-check here as the plugin can have been created
if (m_pluginView && m_pluginView->isPluginView()) {
@@ -887,7 +936,12 @@ WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClientQt::createDocumentLoad
// Use the default timeout interval for JS as the HTML tokenizer delay. This ensures
// that long-running JavaScript will still allow setHtml() to be synchronous, while
// still giving a reasonable timeout to prevent deadlock.
+#if USE(JSC)
double delay = JSDOMWindowBase::commonJSGlobalData()->timeoutChecker.timeoutInterval() / 1000.0f;
+#elif USE(V8)
+ // FIXME: Hard coded for now.
+ double delay = 10000 / 1000.0f;
+#endif
m_frame->page()->setCustomHTMLTokenizerTimeDelay(delay);
} else
m_frame->page()->setCustomHTMLTokenizerTimeDelay(-1);
@@ -961,7 +1015,6 @@ void FrameLoaderClientQt::dispatchDidReceiveResponse(WebCore::DocumentLoader*, u
{
m_response = response;
- m_firstData = true;
if (dumpResourceLoadCallbacks)
printf("%s - didReceiveResponse %s\n",
qPrintable(dumpAssignedUrls[identifier]),
@@ -991,12 +1044,6 @@ void FrameLoaderClientQt::dispatchDidFailLoading(WebCore::DocumentLoader* loader
printf("%s - didFailLoadingWithError: %s\n",
(dumpAssignedUrls.contains(identifier) ? qPrintable(dumpAssignedUrls[identifier]) : "<unknown>"),
qPrintable(drtDescriptionSuitableForTestResult(error)));
-
- if (m_firstData) {
- FrameLoader *fl = loader->frameLoader();
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
}
bool FrameLoaderClientQt::dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int)
@@ -1518,7 +1565,7 @@ String FrameLoaderClientQt::overrideMediaType() const
QString FrameLoaderClientQt::chooseFile(const QString& oldFile)
{
- return webFrame()->page()->chooseFile(webFrame(), oldFile);
+ return m_webFrame->page()->chooseFile(m_webFrame, oldFile);
}
PassRefPtr<FrameNetworkingContext> FrameLoaderClientQt::createNetworkingContext()
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index e506900..fffda58 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -75,7 +75,6 @@ public:
virtual void frameLoaderDestroyed();
void setFrame(QWebFrame* webFrame, Frame* frame);
- QWebFrame* webFrame() const;
virtual bool hasWebView() const; // mainly for assertions
@@ -174,6 +173,7 @@ public:
virtual bool canHandleRequest(const WebCore::ResourceRequest&) const;
virtual bool canShowMIMEType(const String& MIMEType) const;
+ virtual bool canShowMIMETypeAsHTML(const String& MIMEType) const;
virtual bool representationExistsForURLScheme(const String& URLScheme) const;
virtual String generatedMIMETypeForURLScheme(const String& URLScheme) const;
@@ -211,6 +211,21 @@ public:
virtual void documentElementAvailable();
virtual void didPerformFirstNavigation() const;
+#if USE(V8)
+ // A frame's V8 context was created or destroyed.
+ virtual void didCreateScriptContextForFrame();
+ virtual void didDestroyScriptContextForFrame();
+
+ // A context untied to a frame was created (through evaluateInIsolatedWorld).
+ // This context is not tied to the lifetime of its frame, and is destroyed
+ // in garbage collection.
+ virtual void didCreateIsolatedScriptContext();
+
+ // Returns true if we should allow the given V8 extension to be added to
+ // the script context at the currently loading page and given extension group.
+ virtual bool allowScriptExtension(const String& extensionName, int extensionGroup) { return false; }
+#endif
+
virtual void registerForIconNotification(bool);
QString chooseFile(const QString& oldFile);
@@ -227,17 +242,22 @@ public:
static bool policyDelegateEnabled;
static bool policyDelegatePermissive;
static bool deferMainResourceDataLoad;
+ static bool dumpHistoryCallbacks;
private:
Frame *m_frame;
QWebFrame *m_webFrame;
ResourceResponse m_response;
- bool m_firstData;
// Plugin view to redirect data to
WebCore::PluginView* m_pluginView;
bool m_hasSentResponseToPlugin;
+ // True if makeRepresentation was called. We don't actually have a concept
+ // of a "representation", but we need to know when we're expected to have one.
+ // See finishedLoading().
+ bool m_hasRepresentation;
+
ResourceError m_loadError;
};
diff --git a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index 55aca7f..e6e6fde 100644
--- a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -37,12 +37,14 @@
#include "Page.h"
#include "PlatformString.h"
#include "ScriptController.h"
+#include "ScriptDebugServer.h"
#include "qwebinspector.h"
#include "qwebinspector_p.h"
#include "qwebpage.h"
#include "qwebpage_p.h"
#include "qwebview.h"
#include <QtCore/QCoreApplication>
+#include <QtCore/QFile>
#include <QtCore/QSettings>
#include <QtCore/QVariant>
@@ -93,6 +95,22 @@ public slots:
}
};
+#if USE(V8)
+static void ensureDebuggerScriptLoaded()
+{
+ static bool scriptLoaded = false;
+ if (scriptLoaded)
+ return;
+
+ QFile debuggerScriptFile(":/webkit/inspector/DebuggerScript.js");
+ if (debuggerScriptFile.open(QIODevice::ReadOnly)) {
+ QByteArray ba = debuggerScriptFile.readAll();
+ ScriptDebugServer::shared().setDebuggerScriptSource(String(ba.constData(), ba.length()));
+ scriptLoaded = true;
+ }
+}
+#endif
+
InspectorClientQt::InspectorClientQt(QWebPage* page)
: m_inspectedWebPage(page)
, m_frontendWebPage(0)
@@ -109,6 +127,10 @@ void InspectorClientQt::inspectorDestroyed()
void InspectorClientQt::openInspectorFrontend(WebCore::InspectorController*)
{
+#if USE(V8)
+ ensureDebuggerScriptLoaded();
+#endif
+
QWebView* inspectorView = new QWebView;
InspectorClientWebPage* inspectorPage = new InspectorClientWebPage(inspectorView);
inspectorView->setPage(inspectorPage);
diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
index c24c4d5..7b33d9e 100644
--- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
@@ -118,6 +118,26 @@ const QByteArray NotificationWrapper::iconData() const
return iconData;
}
+const QUrl NotificationWrapper::openerPageUrl() const
+{
+ QUrl url;
+#if ENABLE(NOTIFICATIONS)
+ Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
+ if (notification) {
+ if (notification->scriptExecutionContext())
+ url = static_cast<Document*>(notification->scriptExecutionContext())->page()->mainFrame()->document()->url();
+ }
+#endif
+ return url;
+}
+
+void NotificationWrapper::notificationClicked()
+{
+#if ENABLE(NOTIFICATIONS)
+ NotificationPresenterClientQt::notificationPresenter()->notificationClicked(this);
+#endif
+}
+
void NotificationWrapper::notificationClosed()
{
#if ENABLE(NOTIFICATIONS)
@@ -204,11 +224,13 @@ void NotificationPresenterClientQt::displayNotification(Notification* notificati
if (wrapper->m_presenter) {
wrapper->connect(wrapper->m_presenter.get(), SIGNAL(notificationClosed()), wrapper, SLOT(notificationClosed()), Qt::QueuedConnection);
+ wrapper->connect(wrapper->m_presenter.get(), SIGNAL(notificationClicked()), wrapper, SLOT(notificationClicked()));
wrapper->m_presenter->showNotification(wrapper);
return;
}
#ifndef QT_NO_SYSTEMTRAYICON
+ wrapper->connect(wrapper->m_notificationIcon.get(), SIGNAL(messageClicked()), wrapper, SLOT(notificationClicked()));
wrapper->m_notificationIcon->show();
wrapper->m_notificationIcon->showMessage(notification->contents().title(), notification->contents().body());
#endif
@@ -237,6 +259,35 @@ void NotificationPresenterClientQt::cancel(NotificationWrapper* wrapper)
cancel(notification);
}
+void NotificationPresenterClientQt::notificationClicked(NotificationWrapper* wrapper)
+{
+ Notification* notification = notificationForWrapper(wrapper);
+ if (notification)
+ sendEvent(notification, eventNames().clickEvent);
+}
+
+void NotificationPresenterClientQt::notificationClicked(const QString& title)
+{
+ if (!dumpNotification)
+ return;
+ NotificationsQueue::ConstIterator end = m_notifications.end();
+ NotificationsQueue::ConstIterator iter = m_notifications.begin();
+ Notification* notification = 0;
+ while (iter != end) {
+ notification = iter.key();
+ QString notificationTitle;
+ if (notification->isHTML())
+ notificationTitle = notification->url().string();
+ else
+ notificationTitle = notification->contents().title();
+ if (notificationTitle == title)
+ break;
+ iter++;
+ }
+ if (notification)
+ sendEvent(notification, eventNames().clickEvent);
+}
+
Notification* NotificationPresenterClientQt::notificationForWrapper(const NotificationWrapper* wrapper) const
{
NotificationsQueue::ConstIterator end = m_notifications.end();
diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
index e8481d4..2520f6c 100644
--- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
+++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
@@ -61,9 +61,11 @@ public:
const QString title() const;
const QString message() const;
const QByteArray iconData() const;
+ const QUrl openerPageUrl() const;
public Q_SLOTS:
void notificationClosed();
+ void notificationClicked();
public:
#ifndef QT_NO_SYSTEMTRAYICON
@@ -102,6 +104,8 @@ public:
static NotificationPresenterClientQt* notificationPresenter();
Notification* notificationForWrapper(const NotificationWrapper*) const;
+ void notificationClicked(NotificationWrapper*);
+ void notificationClicked(const QString& title);
private:
void sendEvent(Notification*, const AtomicString& eventName);
diff --git a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
index 3b53476..3f69a47 100644
--- a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
+++ b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
@@ -232,6 +232,7 @@ void QtFallbackWebPopup::populate(const QWebSelectData& data)
case QWebSelectData::Option:
m_combo->insertItem(i, data.itemText(i));
model->item(i)->setEnabled(data.itemIsEnabled(i));
+ model->item(i)->setToolTip(data.itemToolTip(i));
if (data.itemIsSelected(i))
currentIndex = i;
break;
diff --git a/WebCore/platform/qt/Localizations.cpp b/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp
index 454872a..948e0cd 100644
--- a/WebCore/platform/qt/Localizations.cpp
+++ b/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp
@@ -1,8 +1,9 @@
/*
* Copyright (C) 2007 Staikos Computing Services Inc. <info@staikos.net>
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * All rights reserved.
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2008 Collabora Ltd. All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 INdT - Instituto Nokia de Tecnologia
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -13,383 +14,491 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS 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 "LocalizedStrings.h"
+#include "WebPlatformStrategies.h"
-#include "IntSize.h"
#include "NotImplemented.h"
-#include "PlatformString.h"
+#include <IntSize.h>
+#include <Page.h>
+#include <PageGroup.h>
+#include <PluginDatabase.h>
#include <QCoreApplication>
#include <QLocale>
+#include <qwebpage.h>
+#include <qwebpluginfactory.h>
#include <wtf/MathExtras.h>
+using namespace WebCore;
-namespace WebCore {
+void WebPlatformStrategies::initialize(QWebPage* webPage)
+{
+ DEFINE_STATIC_LOCAL(WebPlatformStrategies, platformStrategies, (webPage));
+ Q_UNUSED(platformStrategies);
+}
-String submitButtonDefaultLabel()
+WebPlatformStrategies::WebPlatformStrategies(QWebPage* webPage)
+ : m_page(webPage)
{
- return QCoreApplication::translate("QWebPage", "Submit", "default label for Submit buttons in forms on web pages");
+ setPlatformStrategies(this);
+}
+
+
+// PluginStrategy
+
+PluginStrategy* WebPlatformStrategies::createPluginStrategy()
+{
+ return this;
+}
+
+LocalizationStrategy* WebPlatformStrategies::createLocalizationStrategy()
+{
+ return this;
+}
+
+VisitedLinkStrategy* WebPlatformStrategies::createVisitedLinkStrategy()
+{
+ return this;
+}
+
+void WebPlatformStrategies::refreshPlugins()
+{
+ PluginDatabase::installedPlugins()->refresh();
+}
+
+void WebPlatformStrategies::getPluginInfo(Vector<WebCore::PluginInfo>& outPlugins)
+{
+ QWebPluginFactory* factory = m_page->pluginFactory();
+ if (factory) {
+
+ QList<QWebPluginFactory::Plugin> qplugins = factory->plugins();
+ for (int i = 0; i < qplugins.count(); ++i) {
+ const QWebPluginFactory::Plugin& qplugin = qplugins.at(i);
+ PluginInfo info;
+ info.name = qplugin.name;
+ info.desc = qplugin.description;
+
+ for (int j = 0; j < qplugin.mimeTypes.count(); ++j) {
+ const QWebPluginFactory::MimeType& mimeType = qplugin.mimeTypes.at(j);
+
+ MimeClassInfo mimeInfo;
+ mimeInfo.type = mimeType.name;
+ mimeInfo.desc = mimeType.description;
+ for (int k = 0; k < mimeType.fileExtensions.count(); ++k)
+ mimeInfo.extensions.append(mimeType.fileExtensions.at(k));
+
+ info.mimes.append(mimeInfo);
+ }
+ outPlugins.append(info);
+ }
+ }
+
+ PluginDatabase* db = PluginDatabase::installedPlugins();
+ const Vector<PluginPackage*> &plugins = db->plugins();
+
+ outPlugins.resize(plugins.size());
+
+ for (unsigned int i = 0; i < plugins.size(); ++i) {
+ PluginInfo info;
+ PluginPackage* package = plugins[i];
+
+ info.name = package->name();
+ info.file = package->fileName();
+ info.desc = package->description();
+
+ const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions();
+ MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
+ for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
+ MimeClassInfo mime;
+
+ mime.type = it->first;
+ mime.desc = it->second;
+ mime.extensions = package->mimeToExtensions().get(mime.type);
+
+ info.mimes.append(mime);
+ }
+
+ outPlugins.append(info);
+ }
+
}
-String inputElementAltText()
+
+// LocalizationStrategy
+
+String WebPlatformStrategies::inputElementAltText()
{
return QCoreApplication::translate("QWebPage", "Submit", "Submit (input element) alt text for <input> elements with no alt, title, or value");
}
-String resetButtonDefaultLabel()
+String WebPlatformStrategies::resetButtonDefaultLabel()
{
return QCoreApplication::translate("QWebPage", "Reset", "default label for Reset buttons in forms on web pages");
}
-String defaultLanguage()
+String WebPlatformStrategies::searchableIndexIntroduction()
{
- QLocale locale;
- return locale.name().replace("_", "-");
+ return QCoreApplication::translate("QWebPage", "This is a searchable index. Enter search keywords: ", "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'");
}
-String searchableIndexIntroduction()
+String WebPlatformStrategies::submitButtonDefaultLabel()
{
- return QCoreApplication::translate("QWebPage", "This is a searchable index. Enter search keywords: ", "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'");
+ return QCoreApplication::translate("QWebPage", "Submit", "default label for Submit buttons in forms on web pages");
}
-String fileButtonChooseFileLabel()
+String WebPlatformStrategies::fileButtonChooseFileLabel()
{
return QCoreApplication::translate("QWebPage", "Choose File", "title for file button used in HTML forms");
}
-String fileButtonNoFileSelectedLabel()
+String WebPlatformStrategies::fileButtonNoFileSelectedLabel()
{
return QCoreApplication::translate("QWebPage", "No file selected", "text to display in file button used in HTML forms when no file is selected");
}
-String contextMenuItemTagOpenLinkInNewWindow()
+String WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow()
{
return QCoreApplication::translate("QWebPage", "Open in New Window", "Open in New Window context menu item");
}
-String contextMenuItemTagDownloadLinkToDisk()
+String WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk()
{
return QCoreApplication::translate("QWebPage", "Save Link...", "Download Linked File context menu item");
}
-String contextMenuItemTagCopyLinkToClipboard()
+String WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard()
{
return QCoreApplication::translate("QWebPage", "Copy Link", "Copy Link context menu item");
}
-String contextMenuItemTagOpenImageInNewWindow()
+String WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow()
{
return QCoreApplication::translate("QWebPage", "Open Image", "Open Image in New Window context menu item");
}
-String contextMenuItemTagDownloadImageToDisk()
+String WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk()
{
return QCoreApplication::translate("QWebPage", "Save Image", "Download Image context menu item");
}
-String contextMenuItemTagCopyImageToClipboard()
+String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard()
{
return QCoreApplication::translate("QWebPage", "Copy Image", "Copy Link context menu item");
}
-String contextMenuItemTagOpenFrameInNewWindow()
+String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow()
{
return QCoreApplication::translate("QWebPage", "Open Frame", "Open Frame in New Window context menu item");
}
-String contextMenuItemTagCopy()
+String WebPlatformStrategies::contextMenuItemTagCopy()
{
return QCoreApplication::translate("QWebPage", "Copy", "Copy context menu item");
}
-String contextMenuItemTagGoBack()
+String WebPlatformStrategies::contextMenuItemTagGoBack()
{
return QCoreApplication::translate("QWebPage", "Go Back", "Back context menu item");
}
-String contextMenuItemTagGoForward()
+String WebPlatformStrategies::contextMenuItemTagGoForward()
{
return QCoreApplication::translate("QWebPage", "Go Forward", "Forward context menu item");
}
-String contextMenuItemTagStop()
+String WebPlatformStrategies::contextMenuItemTagStop()
{
return QCoreApplication::translate("QWebPage", "Stop", "Stop context menu item");
}
-String contextMenuItemTagReload()
+String WebPlatformStrategies::contextMenuItemTagReload()
{
return QCoreApplication::translate("QWebPage", "Reload", "Reload context menu item");
}
-String contextMenuItemTagCut()
+String WebPlatformStrategies::contextMenuItemTagCut()
{
return QCoreApplication::translate("QWebPage", "Cut", "Cut context menu item");
}
-String contextMenuItemTagPaste()
+String WebPlatformStrategies::contextMenuItemTagPaste()
{
return QCoreApplication::translate("QWebPage", "Paste", "Paste context menu item");
}
-String contextMenuItemTagNoGuessesFound()
+String WebPlatformStrategies::contextMenuItemTagNoGuessesFound()
{
return QCoreApplication::translate("QWebPage", "No Guesses Found", "No Guesses Found context menu item");
}
-String contextMenuItemTagIgnoreSpelling()
+String WebPlatformStrategies::contextMenuItemTagIgnoreSpelling()
{
return QCoreApplication::translate("QWebPage", "Ignore", "Ignore Spelling context menu item");
}
-String contextMenuItemTagLearnSpelling()
+String WebPlatformStrategies::contextMenuItemTagLearnSpelling()
{
return QCoreApplication::translate("QWebPage", "Add To Dictionary", "Learn Spelling context menu item");
}
-String contextMenuItemTagSearchWeb()
+String WebPlatformStrategies::contextMenuItemTagSearchWeb()
{
return QCoreApplication::translate("QWebPage", "Search The Web", "Search The Web context menu item");
}
-String contextMenuItemTagLookUpInDictionary()
+String WebPlatformStrategies::contextMenuItemTagLookUpInDictionary()
{
return QCoreApplication::translate("QWebPage", "Look Up In Dictionary", "Look Up in Dictionary context menu item");
}
-String contextMenuItemTagOpenLink()
+String WebPlatformStrategies::contextMenuItemTagOpenLink()
{
return QCoreApplication::translate("QWebPage", "Open Link", "Open Link context menu item");
}
-String contextMenuItemTagIgnoreGrammar()
+String WebPlatformStrategies::contextMenuItemTagIgnoreGrammar()
{
return QCoreApplication::translate("QWebPage", "Ignore", "Ignore Grammar context menu item");
}
-String contextMenuItemTagSpellingMenu()
+String WebPlatformStrategies::contextMenuItemTagSpellingMenu()
{
return QCoreApplication::translate("QWebPage", "Spelling", "Spelling and Grammar context sub-menu item");
}
-String contextMenuItemTagShowSpellingPanel(bool show)
+String WebPlatformStrategies::contextMenuItemTagShowSpellingPanel(bool show)
{
return show ? QCoreApplication::translate("QWebPage", "Show Spelling and Grammar", "menu item title") :
QCoreApplication::translate("QWebPage", "Hide Spelling and Grammar", "menu item title");
}
-String contextMenuItemTagCheckSpelling()
+String WebPlatformStrategies::contextMenuItemTagCheckSpelling()
{
return QCoreApplication::translate("QWebPage", "Check Spelling", "Check spelling context menu item");
}
-String contextMenuItemTagCheckSpellingWhileTyping()
+String WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping()
{
return QCoreApplication::translate("QWebPage", "Check Spelling While Typing", "Check spelling while typing context menu item");
}
-String contextMenuItemTagCheckGrammarWithSpelling()
+String WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling()
{
return QCoreApplication::translate("QWebPage", "Check Grammar With Spelling", "Check grammar with spelling context menu item");
}
-String contextMenuItemTagFontMenu()
+String WebPlatformStrategies::contextMenuItemTagFontMenu()
{
return QCoreApplication::translate("QWebPage", "Fonts", "Font context sub-menu item");
}
-String contextMenuItemTagBold()
+String WebPlatformStrategies::contextMenuItemTagBold()
{
return QCoreApplication::translate("QWebPage", "Bold", "Bold context menu item");
}
-String contextMenuItemTagItalic()
+String WebPlatformStrategies::contextMenuItemTagItalic()
{
return QCoreApplication::translate("QWebPage", "Italic", "Italic context menu item");
}
-String contextMenuItemTagUnderline()
+String WebPlatformStrategies::contextMenuItemTagUnderline()
{
return QCoreApplication::translate("QWebPage", "Underline", "Underline context menu item");
}
-String contextMenuItemTagOutline()
+String WebPlatformStrategies::contextMenuItemTagOutline()
{
return QCoreApplication::translate("QWebPage", "Outline", "Outline context menu item");
}
-String contextMenuItemTagWritingDirectionMenu()
+String WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu()
{
return QCoreApplication::translate("QWebPage", "Direction", "Writing direction context sub-menu item");
}
-String contextMenuItemTagTextDirectionMenu()
+String WebPlatformStrategies::contextMenuItemTagTextDirectionMenu()
{
return QCoreApplication::translate("QWebPage", "Text Direction", "Text direction context sub-menu item");
}
-String contextMenuItemTagDefaultDirection()
+String WebPlatformStrategies::contextMenuItemTagDefaultDirection()
{
return QCoreApplication::translate("QWebPage", "Default", "Default writing direction context menu item");
}
-String contextMenuItemTagLeftToRight()
+String WebPlatformStrategies::contextMenuItemTagLeftToRight()
{
return QCoreApplication::translate("QWebPage", "Left to Right", "Left to Right context menu item");
}
-String contextMenuItemTagRightToLeft()
+String WebPlatformStrategies::contextMenuItemTagRightToLeft()
{
return QCoreApplication::translate("QWebPage", "Right to Left", "Right to Left context menu item");
}
-String contextMenuItemTagInspectElement()
+String WebPlatformStrategies::contextMenuItemTagInspectElement()
{
return QCoreApplication::translate("QWebPage", "Inspect", "Inspect Element context menu item");
}
-String searchMenuNoRecentSearchesText()
+String WebPlatformStrategies::searchMenuNoRecentSearchesText()
{
return QCoreApplication::translate("QWebPage", "No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed");
}
-String searchMenuRecentSearchesText()
+String WebPlatformStrategies::searchMenuRecentSearchesText()
{
return QCoreApplication::translate("QWebPage", "Recent searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title");
}
-String searchMenuClearRecentSearchesText()
+String WebPlatformStrategies::searchMenuClearRecentSearchesText()
{
return QCoreApplication::translate("QWebPage", "Clear recent searches", "menu item in Recent Searches menu that empties menu's contents");
}
-String AXWebAreaText()
+String WebPlatformStrategies::AXWebAreaText()
{
+ notImplemented();
return String();
}
-String AXLinkText()
+String WebPlatformStrategies::AXLinkText()
{
+ notImplemented();
return String();
}
-String AXListMarkerText()
+String WebPlatformStrategies::AXListMarkerText()
{
+ notImplemented();
return String();
}
-String AXImageMapText()
+String WebPlatformStrategies::AXImageMapText()
{
+ notImplemented();
return String();
}
-String AXHeadingText()
+String WebPlatformStrategies::AXHeadingText()
{
+ notImplemented();
return String();
}
-String AXDefinitionListTermText()
+String WebPlatformStrategies::AXDefinitionListTermText()
{
+ notImplemented();
return String();
}
-String AXDefinitionListDefinitionText()
+String WebPlatformStrategies::AXDefinitionListDefinitionText()
{
+ notImplemented();
return String();
}
-String AXButtonActionVerb()
+String WebPlatformStrategies::AXButtonActionVerb()
{
+ notImplemented();
return String();
}
-String AXRadioButtonActionVerb()
+String WebPlatformStrategies::AXRadioButtonActionVerb()
{
+ notImplemented();
return String();
}
-String AXTextFieldActionVerb()
+String WebPlatformStrategies::AXTextFieldActionVerb()
{
+ notImplemented();
return String();
}
-String AXCheckedCheckBoxActionVerb()
+String WebPlatformStrategies::AXCheckedCheckBoxActionVerb()
{
+ notImplemented();
return String();
}
-String AXUncheckedCheckBoxActionVerb()
+String WebPlatformStrategies::AXUncheckedCheckBoxActionVerb()
{
+ notImplemented();
return String();
}
-String AXLinkActionVerb()
+String WebPlatformStrategies::AXMenuListActionVerb()
{
+ notImplemented();
return String();
}
-String AXMenuListPopupActionVerb()
+String WebPlatformStrategies::AXMenuListPopupActionVerb()
{
+ notImplemented();
return String();
}
-String AXMenuListActionVerb()
+String WebPlatformStrategies::AXLinkActionVerb()
{
+ notImplemented();
return String();
}
-String missingPluginText()
+String WebPlatformStrategies::missingPluginText()
{
return QCoreApplication::translate("QWebPage", "Missing Plug-in", "Label text to be used when a plug-in is missing");
}
-String crashedPluginText()
+String WebPlatformStrategies::crashedPluginText()
{
notImplemented();
return String();
}
-String multipleFileUploadText(unsigned)
+String WebPlatformStrategies::multipleFileUploadText(unsigned)
{
+ notImplemented();
return String();
}
-String unknownFileSizeText()
+String WebPlatformStrategies::unknownFileSizeText()
{
return QCoreApplication::translate("QWebPage", "Unknown", "Unknown filesize FTP directory listing item");
}
-String imageTitle(const String& filename, const IntSize& size)
+String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size)
{
return QCoreApplication::translate("QWebPage", "%1 (%2x%3 pixels)", "Title string for images").arg(filename).arg(size.width()).arg(size.height());
}
-String mediaElementLoadingStateText()
+String WebPlatformStrategies::mediaElementLoadingStateText()
{
return QCoreApplication::translate("QWebPage", "Loading...", "Media controller status message when the media is loading");
}
-String mediaElementLiveBroadcastStateText()
+String WebPlatformStrategies::mediaElementLiveBroadcastStateText()
{
return QCoreApplication::translate("QWebPage", "Live Broadcast", "Media controller status message when watching a live broadcast");
}
#if ENABLE(VIDEO)
-String localizedMediaControlElementString(const String& name)
+String WebPlatformStrategies::localizedMediaControlElementString(const String& name)
{
if (name == "AudioElement")
return QCoreApplication::translate("QWebPage", "Audio Element", "Media controller element");
@@ -427,7 +536,7 @@ String localizedMediaControlElementString(const String& name)
return String();
}
-String localizedMediaControlElementHelpText(const String& name)
+String WebPlatformStrategies::localizedMediaControlElementHelpText(const String& name)
{
if (name == "AudioElement")
return QCoreApplication::translate("QWebPage", "Audio element playback controls and status display", "Media controller element");
@@ -466,7 +575,7 @@ String localizedMediaControlElementHelpText(const String& name)
return String();
}
-String localizedMediaTimeDescription(float time)
+String WebPlatformStrategies::localizedMediaTimeDescription(float time)
{
if (!isfinite(time))
return QCoreApplication::translate("QWebPage", "Indefinite time", "Media time description");
@@ -488,49 +597,79 @@ String localizedMediaTimeDescription(float time)
return QCoreApplication::translate("QWebPage", "%1 seconds", "Media time description").arg(seconds);
}
+
+#else // ENABLE(VIDEO)
+// FIXME: #if ENABLE(VIDEO) should be in the base class
+
+String WebPlatformStrategies::localizedMediaControlElementString(const String& name)
+{
+ return String();
+}
+
+String WebPlatformStrategies::localizedMediaControlElementHelpText(const String& name)
+{
+ return String();
+}
+
+String WebPlatformStrategies::localizedMediaTimeDescription(float time)
+{
+ return String();
+}
+
#endif // ENABLE(VIDEO)
-String validationMessageValueMissingText()
+
+String WebPlatformStrategies::validationMessageValueMissingText()
{
notImplemented();
return String();
}
-String validationMessageTypeMismatchText()
+String WebPlatformStrategies::validationMessageTypeMismatchText()
{
notImplemented();
return String();
}
-String validationMessagePatternMismatchText()
+String WebPlatformStrategies::validationMessagePatternMismatchText()
{
notImplemented();
return String();
}
-String validationMessageTooLongText()
+String WebPlatformStrategies::validationMessageTooLongText()
{
notImplemented();
return String();
}
-String validationMessageRangeUnderflowText()
+String WebPlatformStrategies::validationMessageRangeUnderflowText()
{
notImplemented();
return String();
}
-String validationMessageRangeOverflowText()
+String WebPlatformStrategies::validationMessageRangeOverflowText()
{
notImplemented();
return String();
}
-String validationMessageStepMismatchText()
+String WebPlatformStrategies::validationMessageStepMismatchText()
{
notImplemented();
return String();
}
+
+// VisitedLinkStrategy
+
+bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash)
+{
+ return page->group().isLinkVisited(hash);
+}
+
+void WebPlatformStrategies::addVisitedLink(Page* page, LinkHash hash)
+{
+ page->group().addVisitedLinkHash(hash);
}
-// vim: ts=4 sw=4 et
diff --git a/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h b/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h
new file mode 100644
index 0000000..8ea60d9
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebPlatformStrategies_h
+#define WebPlatformStrategies_h
+
+#include <LocalizationStrategy.h>
+#include <PlatformStrategies.h>
+#include <PluginStrategy.h>
+#include <VisitedLinkStrategy.h>
+
+class QWebPage;
+
+class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy {
+public:
+ static void initialize(QWebPage* webPage);
+
+private:
+ WebPlatformStrategies(QWebPage* webPage);
+
+ // WebCore::PlatformStrategies
+ virtual WebCore::PluginStrategy* createPluginStrategy();
+ virtual WebCore::LocalizationStrategy* createLocalizationStrategy();
+ virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
+
+ // WebCore::PluginStrategy
+ virtual void refreshPlugins();
+ virtual void getPluginInfo(Vector<WebCore::PluginInfo>&);
+
+ // WebCore::LocalizationStrategy
+ virtual WTF::String inputElementAltText();
+ virtual WTF::String resetButtonDefaultLabel();
+ virtual WTF::String searchableIndexIntroduction();
+ virtual WTF::String submitButtonDefaultLabel();
+ virtual WTF::String fileButtonChooseFileLabel();
+ virtual WTF::String fileButtonNoFileSelectedLabel();
+ virtual WTF::String contextMenuItemTagOpenLinkInNewWindow();
+ virtual WTF::String contextMenuItemTagDownloadLinkToDisk();
+ virtual WTF::String contextMenuItemTagCopyLinkToClipboard();
+ virtual WTF::String contextMenuItemTagOpenImageInNewWindow();
+ virtual WTF::String contextMenuItemTagDownloadImageToDisk();
+ virtual WTF::String contextMenuItemTagCopyImageToClipboard();
+ virtual WTF::String contextMenuItemTagOpenFrameInNewWindow();
+ virtual WTF::String contextMenuItemTagCopy();
+ virtual WTF::String contextMenuItemTagGoBack();
+ virtual WTF::String contextMenuItemTagGoForward();
+ virtual WTF::String contextMenuItemTagStop();
+ virtual WTF::String contextMenuItemTagReload();
+ virtual WTF::String contextMenuItemTagCut();
+ virtual WTF::String contextMenuItemTagPaste();
+ virtual WTF::String contextMenuItemTagNoGuessesFound();
+ virtual WTF::String contextMenuItemTagIgnoreSpelling();
+ virtual WTF::String contextMenuItemTagLearnSpelling();
+ virtual WTF::String contextMenuItemTagSearchWeb();
+ virtual WTF::String contextMenuItemTagLookUpInDictionary();
+ virtual WTF::String contextMenuItemTagOpenLink();
+ virtual WTF::String contextMenuItemTagIgnoreGrammar();
+ virtual WTF::String contextMenuItemTagSpellingMenu();
+ virtual WTF::String contextMenuItemTagShowSpellingPanel(bool show);
+ virtual WTF::String contextMenuItemTagCheckSpelling();
+ virtual WTF::String contextMenuItemTagCheckSpellingWhileTyping();
+ virtual WTF::String contextMenuItemTagCheckGrammarWithSpelling();
+ virtual WTF::String contextMenuItemTagFontMenu();
+ virtual WTF::String contextMenuItemTagBold();
+ virtual WTF::String contextMenuItemTagItalic();
+ virtual WTF::String contextMenuItemTagUnderline();
+ virtual WTF::String contextMenuItemTagOutline();
+ virtual WTF::String contextMenuItemTagWritingDirectionMenu();
+ virtual WTF::String contextMenuItemTagTextDirectionMenu();
+ virtual WTF::String contextMenuItemTagDefaultDirection();
+ virtual WTF::String contextMenuItemTagLeftToRight();
+ virtual WTF::String contextMenuItemTagRightToLeft();
+ virtual WTF::String contextMenuItemTagInspectElement();
+ virtual WTF::String searchMenuNoRecentSearchesText();
+ virtual WTF::String searchMenuRecentSearchesText();
+ virtual WTF::String searchMenuClearRecentSearchesText();
+ virtual WTF::String AXWebAreaText();
+ virtual WTF::String AXLinkText();
+ virtual WTF::String AXListMarkerText();
+ virtual WTF::String AXImageMapText();
+ virtual WTF::String AXHeadingText();
+ virtual WTF::String AXDefinitionListTermText();
+ virtual WTF::String AXDefinitionListDefinitionText();
+ virtual WTF::String AXButtonActionVerb();
+ virtual WTF::String AXRadioButtonActionVerb();
+ virtual WTF::String AXTextFieldActionVerb();
+ virtual WTF::String AXCheckedCheckBoxActionVerb();
+ virtual WTF::String AXUncheckedCheckBoxActionVerb();
+ virtual WTF::String AXMenuListActionVerb();
+ virtual WTF::String AXMenuListPopupActionVerb();
+ virtual WTF::String AXLinkActionVerb();
+ virtual WTF::String missingPluginText();
+ virtual WTF::String crashedPluginText();
+ virtual WTF::String multipleFileUploadText(unsigned numberOfFiles);
+ virtual WTF::String unknownFileSizeText();
+ virtual WTF::String imageTitle(const WTF::String& filename, const WebCore::IntSize&);
+ virtual WTF::String mediaElementLoadingStateText();
+ virtual WTF::String mediaElementLiveBroadcastStateText();
+ virtual WTF::String localizedMediaControlElementString(const WTF::String&);
+ virtual WTF::String localizedMediaControlElementHelpText(const WTF::String&);
+ virtual WTF::String localizedMediaTimeDescription(float);
+ virtual WTF::String validationMessageValueMissingText();
+ virtual WTF::String validationMessageTypeMismatchText();
+ virtual WTF::String validationMessagePatternMismatchText();
+ virtual WTF::String validationMessageTooLongText();
+ virtual WTF::String validationMessageRangeUnderflowText();
+ virtual WTF::String validationMessageRangeOverflowText();
+ virtual WTF::String validationMessageStepMismatchText();
+
+ // WebCore::VisitedLinkStrategy
+ virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash);
+ virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash);
+
+ QWebPage* m_page;
+};
+
+#endif // WebPlatformStrategies_h
diff --git a/WebKit/qt/declarative/qdeclarativewebview.cpp b/WebKit/qt/declarative/qdeclarativewebview.cpp
index 9dcba60..94f08bd 100644
--- a/WebKit/qt/declarative/qdeclarativewebview.cpp
+++ b/WebKit/qt/declarative/qdeclarativewebview.cpp
@@ -91,7 +91,6 @@ GraphicsWebView::GraphicsWebView(QDeclarativeWebView* parent)
void GraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* event)
{
- setFocus();
pressPoint = event->pos();
if (pressTime) {
pressTimer.start(pressTime, this);
@@ -101,6 +100,11 @@ void GraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* event)
parent->setKeepMouseGrab(true);
}
QGraphicsWebView::mousePressEvent(event);
+
+ QWebHitTestResult hit = page()->mainFrame()->hitTestContent(pressPoint.toPoint());
+ if (hit.isContentEditable())
+ parent->forceActiveFocus();
+ setFocus();
}
void GraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
@@ -139,47 +143,78 @@ void GraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
/*!
\qmlclass WebView QDeclarativeWebView
+ \ingroup qml-view-elements
\since 4.7
- \brief The WebView item allows you to add web content to a canvas.
+ \brief The WebView item allows you to add Web content to a canvas.
\inherits Item
- A WebView renders web content based on a URL.
+ A WebView renders Web content based on a URL.
This type is made available by importing the \c QtWebKit module:
\bold{import QtWebKit 1.0}
- If the width and height of the item is not set, they will
- dynamically adjust to a size appropriate for the content.
- This width may be large for typical online web pages.
+ The WebView item includes no scrolling, scaling, toolbars, or other common browser
+ components. These must be implemented around WebView. See the \l{QML Web Browser}
+ example for a demonstration of this.
- If the width or height is explictly set, the rendered website
- will be clipped, not scaled, to fit into the set dimensions.
+ The page to be displayed by the item is specified using the \l url property,
+ and this can be changed to fetch and display a new page. While the page loads,
+ the \l progress property is updated to indicate how much of the page has been
+ loaded.
- If the preferredWidth is set, the width will be this amount or larger,
- usually laying out the web content to fit the preferredWidth.
+ \section1 Appearance
- \qml
- import QtWebKit 1.0
+ If the width and height of the item is not set, they will dynamically adjust
+ to a size appropriate for the content. This width may be large for typical
+ online web pages, typically greater than 800 by 600 pixels.
- WebView {
- url: "http://www.nokia.com"
- preferredWidth: 490
- preferredHeight: 400
- scale: 0.5
- smooth: false
- smoothCache: true
- }
- \endqml
+ If the \l{Item::}{width} or \l{Item::}{height} is explictly set, the rendered Web site will be
+ clipped, not scaled, to fit into the set dimensions.
- \image webview.png
+ If the preferredWidth property is set, the width will be this amount or larger,
+ usually laying out the Web content to fit the preferredWidth.
- The item includes no scrolling, scaling,
- toolbars, etc., those must be implemented around WebView. See the WebBrowser example
- for a demonstration of this.
+ The appearance of the content can be controlled to a certain extent by changing
+ the settings.standardFontFamily property and other settings related to fonts.
+
+ The page can be zoomed by calling the heuristicZoom() method, which performs a
+ series of tests to determine whether zoomed content will be displayed in an
+ appropriate way in the space allocated to the item.
+
+ \section1 User Interaction and Navigation
+
+ By default, certain mouse and touch events are delivered to other items in
+ preference to the Web content. For example, when a scrolling view is created
+ by placing a WebView in a Flickable, move events are delivered to the Flickable
+ so that the user can scroll the page. This prevents the user from accidentally
+ selecting text in a Web page instead of scrolling.
+
+ The pressGrabTime property defines the time the user must touch or press a
+ mouse button over the WebView before the Web content will receive the move
+ events it needs to select text and images.
+
+ When this item has keyboard focus, all keyboard input will be sent directly to
+ the Web page within.
+
+ When the navigates by clicking on links, the item records the pages visited
+ in its internal history
+
+ Because this item is designed to be used as a component in a browser, it
+ exposes \l{Action}{actions} for \l back, \l forward, \l reload and \l stop.
+ These can be triggered to change the current page displayed by the item.
+
+ \section1 Example Usage
+
+ \beginfloatright
+ \inlineimage webview.png
+ \endfloat
+
+ The following example displays a scaled down Web page at a fixed size.
+
+ \snippet doc/src/snippets/declarative/webview/webview.qml document
- When this item has keyboard focus, all keyboard input will be sent directly to the
- web page within.
+ \clearfloat
\sa {declarative/modelviews/webview}{WebView example}, {demos/declarative/webbrowser}{Web Browser demo}
*/
@@ -388,7 +423,7 @@ void QDeclarativeWebView::setPreferredHeight(int height)
}
/*!
- \qmlmethod bool WebView::evaluateJavaScript(string)
+ \qmlmethod bool WebView::evaluateJavaScript(string scriptSource)
Evaluates the \a scriptSource JavaScript inside the context of the
main web frame, and returns the result of the last executed statement.
@@ -512,14 +547,14 @@ void QDeclarativeWebView::setRenderingEnabled(bool enabled)
}
/*!
- \qmlsignal WebView::onDoubleClick(clickx, clicky)
+ \qmlsignal WebView::onDoubleClick(int clickx, int clicky)
The WebView does not pass double-click events to the web engine, but rather
emits this signals.
*/
/*!
- \qmlmethod bool WebView::heuristicZoom(clickX,clickY,maxzoom)
+ \qmlmethod bool WebView::heuristicZoom(int clickX, int clickY, real maxzoom)
Finds a zoom that:
\list
@@ -554,11 +589,11 @@ bool QDeclarativeWebView::heuristicZoom(int clickX, int clickY, qreal maxZoom)
\qmlproperty int WebView::pressGrabTime
The number of milliseconds the user must press before the WebView
- starts passing move events through to the web engine (rather than
+ starts passing move events through to the Web engine (rather than
letting other QML elements such as a Flickable take them).
Defaults to 400ms. Set to 0 to always grab and pass move events to
- the web engine.
+ the Web engine.
*/
int QDeclarativeWebView::pressGrabTime() const
{
@@ -975,7 +1010,7 @@ QString QDeclarativeWebPage::chooseFile(QWebFrame* originatingFrame, const QStri
}
/*!
- \qmlsignal WebView::onAlert(message)
+ \qmlsignal WebView::onAlert(string message)
The handler is called when the web engine sends a JavaScript alert. The \a message is the text
to be displayed in the alert to the user.
diff --git a/WebKit/qt/docs/qtwebkit.qdoc b/WebKit/qt/docs/qtwebkit.qdoc
index d3f5502..0335d46 100644
--- a/WebKit/qt/docs/qtwebkit.qdoc
+++ b/WebKit/qt/docs/qtwebkit.qdoc
@@ -1,6 +1,6 @@
/*!
\module QtWebKit
- \title QtWebKit Module
+ \title WebKit in Qt
\contentspage All Qt Modules
\previouspage QtSvg
\nextpage QtXml
diff --git a/WebKit/qt/examples/platformplugin/WebNotificationPresenter.cpp b/WebKit/qt/examples/platformplugin/WebNotificationPresenter.cpp
index c992236..d991ab1 100644
--- a/WebKit/qt/examples/platformplugin/WebNotificationPresenter.cpp
+++ b/WebKit/qt/examples/platformplugin/WebNotificationPresenter.cpp
@@ -57,7 +57,11 @@ void WebNotificationWidget::showNotification(const QWebNotificationData* data)
bool WebNotificationWidget::event(QEvent* ev)
{
- if (ev->type() == QEvent::MouseButtonRelease || ev->type() == QEvent::Close) {
+ if (ev->type() == QEvent::MouseButtonRelease) {
+ emit notificationClicked();
+ return true;
+ }
+ if (ev->type() == QEvent::Close) {
emit notificationClosed();
return true;
}
diff --git a/WebKit/qt/examples/platformplugin/WebNotificationPresenter.h b/WebKit/qt/examples/platformplugin/WebNotificationPresenter.h
index a2563b2..f46e5cb 100644
--- a/WebKit/qt/examples/platformplugin/WebNotificationPresenter.h
+++ b/WebKit/qt/examples/platformplugin/WebNotificationPresenter.h
@@ -36,6 +36,7 @@ public:
Q_SIGNALS:
void notificationClosed();
+ void notificationClicked();
};
class WebNotificationPresenter : public QWebNotificationPresenter
@@ -47,6 +48,7 @@ public:
{
m_widget = new WebNotificationWidget();
connect(m_widget, SIGNAL(notificationClosed()), this, SIGNAL(notificationClosed()));
+ connect(m_widget, SIGNAL(notificationClicked()), this, SIGNAL(notificationClicked()));
}
virtual ~WebNotificationPresenter() { m_widget->close(); delete m_widget; }
diff --git a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
index 3c56c98..76496c5 100644
--- a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
+++ b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
@@ -27,6 +27,7 @@
*/
#include <QObject>
+#include <QUrl>
class QWebSelectData
{
@@ -66,6 +67,7 @@ public:
virtual const QString title() const = 0;
virtual const QString message() const = 0;
virtual const QByteArray iconData() const = 0;
+ virtual const QUrl openerPageUrl() const = 0;
};
class QWebNotificationPresenter : public QObject
@@ -79,6 +81,7 @@ public:
Q_SIGNALS:
void notificationClosed();
+ void notificationClicked();
};
class QWebHapticFeedbackPlayer
@@ -113,6 +116,6 @@ public:
};
-Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.3");
+Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.4");
#endif // QWEBKITPLATFORMPLUGIN_H
diff --git a/WebKit/qt/qt_webkit_version.pri b/WebKit/qt/qt_webkit_version.pri
index ca6299a..4147d8f 100644
--- a/WebKit/qt/qt_webkit_version.pri
+++ b/WebKit/qt/qt_webkit_version.pri
@@ -2,4 +2,4 @@ QT_WEBKIT_VERSION = 4.9.0
QT_WEBKIT_MAJOR_VERSION = 4
QT_WEBKIT_MINOR_VERSION = 9
QT_WEBKIT_PATCH_VERSION = 0
-QT_CONFIG *= webkit
+QT_CONFIG += webkit
diff --git a/WebKit/qt/symbian/eabi/QtWebKitu.def b/WebKit/qt/symbian/eabi/QtWebKitu.def
index 9c3e152..8291197 100644
--- a/WebKit/qt/symbian/eabi/QtWebKitu.def
+++ b/WebKit/qt/symbian/eabi/QtWebKitu.def
@@ -797,7 +797,7 @@ EXPORTS
_ZN23DumpRenderTreeSupportQtD1Ev @ 796 NONAME
_ZN23DumpRenderTreeSupportQtD2Ev @ 797 NONAME
_ZN8QWebPage23allowGeolocationRequestEP9QWebFrame @ 798 NONAME
- _ZN8QWebPage23viewportChangeRequestedERKNS_13ViewportHintsE @ 799 NONAME
+ _ZN8QWebPage23viewportChangeRequestedERKNS_13ViewportHintsE @ 799 NONAME ABSENT
_ZNK15QWebScriptWorld5worldEv @ 800 NONAME
_ZN16QGraphicsWebView13setDeviceSizeERK5QSize @ 801 NONAME
_ZN23DumpRenderTreeSupportQt12pagePropertyEP9QWebFrameRK7QStringi @ 802 NONAME
@@ -812,4 +812,8 @@ EXPORTS
_ZN8QWebPage25requestPermissionFromUserEP9QWebFrameNS_16PermissionDomainE @ 811 NONAME
_ZN8QWebPage27cancelRequestsForPermissionEP9QWebFrameNS_16PermissionDomainE @ 812 NONAME
_ZNK16QGraphicsWebView10deviceSizeEv @ 813 NONAME
+ _ZN23DumpRenderTreeSupportQt14viewportAsTextEP8QWebPageRK5QSize @ 814 NONAME
+ _ZN23DumpRenderTreeSupportQt32simulateDesktopNotificationClickERK7QString @ 815 NONAME
+ _ZN8QWebPage23viewportChangeRequestedEv @ 816 NONAME
+ _ZNK8QWebPage28viewportConfigurationForSizeE5QSize @ 817 NONAME
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 9a6c35f..10af94c 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -97,6 +97,7 @@ private slots:
void backActionUpdate();
void frameAt();
void requestCache();
+ void loadCachedPage();
void protectBindingsRuntimeObjectsFromCollector();
void localURLSchemes();
void testOptionalJSObjects();
@@ -1288,6 +1289,37 @@ void tst_QWebPage::requestCache()
(int)QNetworkRequest::PreferCache);
}
+void tst_QWebPage::loadCachedPage()
+{
+ TestPage page;
+ QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+ page.settings()->setMaximumPagesInCache(3);
+
+ page.mainFrame()->load(QUrl("data:text/html,This is first page"));
+
+ QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(page.navigations.count(), 1);
+
+ QUrl firstPageUrl = page.mainFrame()->url();
+ page.mainFrame()->load(QUrl("data:text/html,This is second page"));
+
+ QTRY_COMPARE(loadSpy.count(), 2);
+ QTRY_COMPARE(page.navigations.count(), 2);
+
+ page.triggerAction(QWebPage::Stop);
+ QVERIFY(page.history()->canGoBack());
+
+ QSignalSpy urlSpy(page.mainFrame(), SIGNAL(urlChanged(QUrl)));
+ QVERIFY(urlSpy.isValid());
+
+ page.triggerAction(QWebPage::Back);
+ ::waitForSignal(page.mainFrame(), SIGNAL(urlChanged(QUrl)));
+ QCOMPARE(urlSpy.size(), 1);
+
+ QList<QVariant> arguments1 = urlSpy.takeFirst();
+ QCOMPARE(arguments1.at(0).toUrl(), firstPageUrl);
+
+}
void tst_QWebPage::backActionUpdate()
{
QWebView view;
@@ -1661,6 +1693,22 @@ void tst_QWebPage::inputMethods()
QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
#endif
+#if QT_VERSION >= 0x040600
+ //START - Test for sending empty QInputMethodEvent
+ page->mainFrame()->setHtml("<html><body>" \
+ "<input type='text' id='input3' value='QtWebKit2'/>" \
+ "</body></html>");
+ page->mainFrame()->evaluateJavaScript("var inputEle = document.getElementById('input3'); inputEle.focus(); inputEle.select();");
+
+ //Send empty QInputMethodEvent
+ QInputMethodEvent emptyEvent;
+ page->event(&emptyEvent);
+
+ QString inputValue = page->mainFrame()->evaluateJavaScript("document.getElementById('input3').value").toString();
+ QCOMPARE(inputValue, QString("QtWebKit2"));
+ //END - Test for sending empty QInputMethodEvent
+#endif
+
delete container;
}
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index b7e49cf..251bf91 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,185 @@
+2010-09-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ REGRESSION (r60104): Zoom level is unexpectedly reset on page reload
+ https://bugs.webkit.org/show_bug.cgi?id=42863
+
+ * WebView.cpp:
+ (WebView::setZoomMultiplier):
+ Call functions on Frame instead of FrameView.
+
+2010-09-17 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Reduce minimum DOMTimer interval
+ https://bugs.webkit.org/show_bug.cgi?id=45362
+
+ * WebView.cpp: Added in a call to set the mimimum allowed DOMTimer to 4ms.
+
+2010-09-17 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Chris Marrin.
+
+ Remove scroll and clip layers for WKCACFLayerRenderer
+ https://bugs.webkit.org/show_bug.cgi?id=45922
+
+ WKCACFLayerRenderer no longer needs its own layers for managing scrolling
+ and clipping, because RenderLayerCompositor provides this functionality.
+
+ * WebView.cpp:
+ (WebView::sizeChanged): Moved code that handles the WM_SIZE message
+ into this method. Use it to resize the layer renderer.
+ (WebView::WebViewWndProc): Call sizeChanged().
+ (WebView::updateRootLayerContents): No need to call setScrollFrame() any more.
+ (WebView::layerRendererBecameVisible): Move this from the header (no need to be inline).
+ * WebView.h:
+
+2010-09-16 Darin Adler <darin@apple.com>
+
+ Reviewed by Andreas Kling.
+
+ Reduce use of HTMLInputElement::inputType so we can remove it later
+ https://bugs.webkit.org/show_bug.cgi?id=45903
+
+ * WebFrame.cpp:
+ (WebFrame::elementDoesAutoComplete): Use isPasswordField.
+ (WebFrame::elementIsPassword): Use isPasswordField.
+
+2010-09-14 Ada Chan <adachan@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Add an IWebFramePrivate API to load string as plain text into the WebFrame.
+ https://bugs.webkit.org/show_bug.cgi?id=45782
+
+ * Interfaces/IWebFramePrivate.idl:
+ * Interfaces/WebKit.idl: Touch the file.
+ * WebFrame.cpp:
+ (WebFrame::loadPlainTextString):
+ * WebFrame.h:
+
+2010-09-13 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Paste should be implemented in WebCore like Copy and Cut for Mac also.
+ https://bugs.webkit.org/show_bug.cgi?id=45494
+ <rdar://problem/7660537>
+
+ On the Mac platform, the implementation of the paste operation is all done
+ at the WebKit level. In order to support it on WebKit2 it is necessary to
+ refactor the code and move this functionality at the level of WebCore like
+ we already have on Windows.
+ The original code relies on some in AppKit functions that call back into
+ WebKit causing problems in WebKit2. All this functionality has been moved
+ at the level of the editor client where it can be dealt with appropriately.
+
+ * WebFrame.cpp:
+ (WebFrame::canShowMIMETypeASHTML): Added.
+
+2010-09-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Sam Weinig.
+
+ Make SecurityOrigin::canDisplay an instance function
+ https://bugs.webkit.org/show_bug.cgi?id=45219
+
+ * WebFrame.cpp:
+ (WebFrame::allowsFollowingLink):
+
+2010-09-10 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Add NetworkingContext to avoid layer violations
+ https://bugs.webkit.org/show_bug.cgi?id=42292
+
+ * WebCoreSupport/WebFrameNetworkingContext.cpp:
+ (WebFrameNetworkingContext::blockedError):
+ * WebCoreSupport/WebFrameNetworkingContext.h:
+
+2010-09-10 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Movies with track or movie matrices don't display in <video> elements (Safari 5/Windows)
+ https://bugs.webkit.org/show_bug.cgi?id=45333
+
+ The rootChild layer must be set as flipped, otherwise transformed movies will appear
+ incorrectly rotated.
+
+ * FullscreenVideoController.cpp:
+ (FullscreenVideoController::enterFullscreen):
+
+2010-09-10 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove unnecessary constraint in WebCore of choosing either text zoom or full page zoom.
+ Precursor to <rdar://problem/7660657>
+ https://bugs.webkit.org/show_bug.cgi?id=45522
+
+ * WebFrame.cpp:
+ * WebFrame.h:
+ Remove dead code.
+
+ * WebView.cpp:
+ (WebView::WebView):
+ (WebView::setZoomMultiplier):
+ (WebView::zoomMultiplier):
+ (WebView::canMakeTextLarger):
+ (WebView::makeTextLarger):
+ (WebView::canMakeTextSmaller):
+ (WebView::makeTextSmaller):
+ (WebView::notifyPreferencesChanged):
+ * WebView.h:
+ Move tracking of text only zoom here from WebCore.
+
+2010-09-10 Brian Weinstein <bweinstein@apple.com>
+
+ Windows Build Fix. Fix some fallout from r67238, currentForm is now off of
+ SelectionController instead of frame. Also fix a style issue.
+
+ * WebFrame.cpp:
+ (WebFrame::currentForm):
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::committedLoad):
+ * WebCoreSupport/WebFrameLoaderClient.h:
+
+2010-09-09 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Move functions from Frame to SelectionController as planned
+ https://bugs.webkit.org/show_bug.cgi?id=45508
+
+ * WebView.cpp:
+ (WebView::selectionRect):
+ (WebView::centerSelectionInVisibleArea):
+ Call functions on selection().
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Main resource bytes shouldn't bounce through FrameLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45496
+
+ Now return the bytes to the DocumentLoader.
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::receivedData):
+
2010-09-09 Simon Fraser <simon.fraser@apple.com>
Reviewed by Adam Roben.
diff --git a/WebKit/win/FullscreenVideoController.cpp b/WebKit/win/FullscreenVideoController.cpp
index 4b50889..696aaa5 100644
--- a/WebKit/win/FullscreenVideoController.cpp
+++ b/WebKit/win/FullscreenVideoController.cpp
@@ -273,9 +273,10 @@ void FullscreenVideoController::enterFullscreen()
#if USE(ACCELERATED_COMPOSITING)
m_fullscreenWindow->setRootChildLayer(m_rootChild);
- WKCACFLayer* videoLayer = m_mediaElement->player()->platformLayer();
+ WKCACFLayer* videoLayer = m_mediaElement->platformLayer();
m_rootChild->addSublayer(videoLayer);
m_rootChild->setNeedsLayout();
+ m_rootChild->setGeometryFlipped(1);
#endif
RECT windowRect;
diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl
index bc9a4bd..499aa03 100755
--- a/WebKit/win/Interfaces/IWebFramePrivate.idl
+++ b/WebKit/win/Interfaces/IWebFramePrivate.idl
@@ -117,4 +117,6 @@ interface IWebFramePrivate : IUnknown
HRESULT suspendAnimations();
HRESULT resumeAnimations();
+
+ HRESULT loadPlainTextString([in] BSTR string, [in] BSTR url);
}
diff --git a/WebKit/win/Interfaces/JavaScriptCoreAPITypes.idl b/WebKit/win/Interfaces/JavaScriptCoreAPITypes.idl
index f2ef1f1..f2ef1f1 100755..100644
--- a/WebKit/win/Interfaces/JavaScriptCoreAPITypes.idl
+++ b/WebKit/win/Interfaces/JavaScriptCoreAPITypes.idl
diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl
index 98f5da8..d25cdfe 100644
--- a/WebKit/win/Interfaces/WebKit.idl
+++ b/WebKit/win/Interfaces/WebKit.idl
@@ -300,4 +300,3 @@ library WebKit
[default] interface IWebUserContentURLPattern;
}
}
-
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
index 48f7f3b..1fb827d 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -491,11 +491,8 @@ void WebFrameLoaderClient::postProgressFinishedNotification()
void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* data, int length)
{
- // FIXME: This should probably go through the data source.
- const String& textEncoding = loader->response().textEncodingName();
-
if (!m_manualLoader)
- receivedData(data, length, textEncoding);
+ loader->commitData(data, length);
if (!m_manualLoader)
return;
@@ -512,22 +509,6 @@ void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* dat
m_manualLoader->didReceiveData(data, length);
}
-void WebFrameLoaderClient::receivedData(const char* data, int length, const String& textEncoding)
-{
- Frame* coreFrame = core(m_webFrame);
- if (!coreFrame)
- return;
-
- // Set the encoding. This only needs to be done once, but it's harmless to do it again later.
- String encoding = coreFrame->loader()->documentLoader()->overrideEncoding();
- bool userChosen = !encoding.isNull();
- if (encoding.isNull())
- encoding = textEncoding;
- coreFrame->loader()->writer()->setEncoding(encoding, userChosen);
-
- coreFrame->loader()->addData(data, length);
-}
-
void WebFrameLoaderClient::finishedLoading(DocumentLoader* loader)
{
// Telling the frame we received some data and passing 0 as the data is our
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
index 648b5bf..6e8e354 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
@@ -126,7 +126,6 @@ protected:
private:
PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL&, const WTF::String& name, WebCore::HTMLFrameOwnerElement*, const WTF::String& referrer);
- void receivedData(const char*, int, const WTF::String&);
WebHistory* webHistory() const;
WebFrame* m_webFrame;
diff --git a/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp
index 9fcd4b1..b87b6d9 100644
--- a/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp
+++ b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp
@@ -37,3 +37,8 @@ String WebFrameNetworkingContext::referrer() const
{
return frame()->loader()->referrer();
}
+
+WebCore::ResourceError WebFrameNetworkingContext::blockedError(const WebCore::ResourceRequest& request) const
+{
+ return frame()->loader()->blockedError(request);
+}
diff --git a/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h
index 7fd55d5..a237c9a 100644
--- a/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h
+++ b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h
@@ -21,6 +21,7 @@
#define WebFrameNetworkingContext_h
#include <WebCore/FrameNetworkingContext.h>
+#include <WebCore/ResourceError.h>
class WebFrameNetworkingContext : public WebCore::FrameNetworkingContext {
public:
@@ -35,6 +36,7 @@ private:
virtual WTF::String userAgent() const;
virtual WTF::String referrer() const;
+ virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const;
WTF::String m_userAgent;
};
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index 014ea15..843f33a 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -507,9 +507,10 @@ HRESULT STDMETHODCALLTYPE WebFrame::currentForm(
*currentForm = 0;
- if (Frame* coreFrame = core(this))
- if (HTMLFormElement* formElement = coreFrame->currentForm())
+ if (Frame* coreFrame = core(this)) {
+ if (HTMLFormElement* formElement = coreFrame->selection()->currentForm())
*currentForm = DOMElement::createInstance(formElement);
+ }
return *currentForm ? S_OK : E_FAIL;
}
@@ -601,6 +602,17 @@ HRESULT STDMETHODCALLTYPE WebFrame::loadData(
return S_OK;
}
+HRESULT WebFrame::loadPlainTextString(
+ /* [in] */ BSTR string,
+ /* [in] */ BSTR url)
+{
+ RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(reinterpret_cast<char*>(string), sizeof(UChar) * SysStringLen(string));
+ BString plainTextMimeType(TEXT("text/plain"), 10);
+ BString utf16Encoding(TEXT("utf-16"), 6);
+ loadData(sharedBuffer.release(), plainTextMimeType, utf16Encoding, url, 0);
+ return S_OK;
+}
+
void WebFrame::loadHTMLString(BSTR string, BSTR baseURL, BSTR unreachableURL)
{
RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(reinterpret_cast<char*>(string), sizeof(UChar) * SysStringLen(string));
@@ -1098,15 +1110,6 @@ void WebFrame::invalidate()
document->recalcStyle(Node::Force);
}
-void WebFrame::setTextSizeMultiplier(float multiplier)
-{
- Frame* coreFrame = core(this);
- ASSERT(coreFrame);
-
- if (FrameView* view = coreFrame->view())
- view->setZoomFactor(multiplier, ZoomTextOnly);
-}
-
HRESULT WebFrame::inViewSourceMode(BOOL* flag)
{
if (!flag) {
@@ -1182,7 +1185,7 @@ HRESULT WebFrame::elementDoesAutoComplete(IDOMElement *element, BOOL *result)
if (!inputElement)
*result = false;
else
- *result = inputElement->isTextField() && inputElement->inputType() != HTMLInputElement::PASSWORD && inputElement->autoComplete();
+ *result = inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->autoComplete();
return S_OK;
}
@@ -1353,7 +1356,7 @@ HRESULT WebFrame::allowsFollowingLink(BSTR url, BOOL* result)
if (!frame)
return E_FAIL;
- *result = SecurityOrigin::canDisplay(MarshallingHelpers::BSTRToKURL(url), String(), frame->document());
+ *result = frame->document()->securityOrigin()->canDisplay(MarshallingHelpers::BSTRToKURL(url));
return S_OK;
}
@@ -1387,9 +1390,8 @@ HRESULT WebFrame::controlsInForm(IDOMElement* form, IDOMElement** controls, int*
HRESULT WebFrame::elementIsPassword(IDOMElement *element, bool *result)
{
- HTMLInputElement *inputElement = inputElementFromDOMElement(element);
- *result = inputElement != 0
- && inputElement->inputType() == HTMLInputElement::PASSWORD;
+ HTMLInputElement* inputElement = inputElementFromDOMElement(element);
+ *result = inputElement && inputElement->isPasswordField();
return S_OK;
}
@@ -1612,6 +1614,12 @@ bool WebFrame::canHandleRequest(const ResourceRequest& request) const
return WebView::canHandleRequest(request);
}
+bool WebFrame::canShowMIMETypeAsHTML(const String& /*MIMEType*/) const
+{
+ notImplemented();
+ return true;
+}
+
bool WebFrame::canShowMIMEType(const String& /*MIMEType*/) const
{
notImplemented();
diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h
index f4795c8..21c3027 100644
--- a/WebKit/win/WebFrame.h
+++ b/WebKit/win/WebFrame.h
@@ -260,6 +260,7 @@ public:
virtual HRESULT STDMETHODCALLTYPE numberOfActiveAnimations(UINT*);
virtual HRESULT STDMETHODCALLTYPE suspendAnimations();
virtual HRESULT STDMETHODCALLTYPE resumeAnimations();
+ virtual HRESULT STDMETHODCALLTYPE loadPlainTextString(BSTR string, BSTR url);
virtual HRESULT STDMETHODCALLTYPE isDisplayingStandaloneImage(BOOL*);
@@ -302,6 +303,7 @@ public:
virtual void didChangeIcons(WebCore::DocumentLoader*);
virtual bool canHandleRequest(const WebCore::ResourceRequest&) const;
virtual bool canShowMIMEType(const WTF::String& MIMEType) const;
+ virtual bool canShowMIMETypeAsHTML(const WTF::String& MIMEType) const;
virtual bool representationExistsForURLScheme(const WTF::String& URLScheme) const;
virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String& URLScheme) const;
virtual void frameLoadCompleted();
@@ -355,7 +357,6 @@ public:
void updateBackground();
// WebFrame (matching WebCoreFrameBridge)
- void setTextSizeMultiplier(float multiplier);
HRESULT inViewSourceMode(BOOL *flag);
HRESULT setInViewSourceMode(BOOL flag);
HRESULT elementWithName(BSTR name, IDOMElement* form, IDOMElement** element);
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index 0a1e334..04794c9 100644..100755
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -326,6 +326,7 @@ WebView::WebView()
, m_useBackForwardList(true)
, m_userAgentOverridden(false)
, m_zoomMultiplier(1.0f)
+ , m_zoomsTextOnly(false)
, m_mouseActivated(false)
, m_dragData(0)
, m_currentCharacterCode(0)
@@ -853,6 +854,19 @@ void WebView::scrollBackingStore(FrameView* frameView, int dx, int dy, const Int
::ReleaseDC(m_viewWindow, windowDC);
}
+void WebView::sizeChanged(const IntSize& newSize)
+{
+ deleteBackingStore();
+
+ if (Frame* coreFrame = core(topLevelFrame()))
+ coreFrame->view()->resize(newSize);
+
+#if USE(ACCELERATED_COMPOSITING)
+ if (m_layerRenderer)
+ m_layerRenderer->resize();
+#endif
+}
+
// This emulates the Mac smarts for painting rects intelligently. This is very
// important for us, since we double buffer based off dirty rects.
static void getUpdateRects(HRGN region, const IntRect& dirtyRect, Vector<IntRect>& rects)
@@ -2079,15 +2093,8 @@ LRESULT CALLBACK WebView::WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam,
break;
// FIXME: We need to check WM_UNICHAR to support supplementary characters (that don't fit in 16 bits).
case WM_SIZE:
- if (lParam != 0) {
- webView->deleteBackingStore();
-#if USE(ACCELERATED_COMPOSITING)
- if (webView->isAcceleratedCompositing())
- webView->resizeLayerRenderer();
-#endif
- if (Frame* coreFrame = core(mainFrameImpl))
- coreFrame->view()->resize(LOWORD(lParam), HIWORD(lParam));
- }
+ if (lParam != 0)
+ webView->sizeChanged(IntSize(LOWORD(lParam), HIWORD(lParam)));
break;
case WM_SHOWWINDOW:
lResult = DefWindowProc(hWnd, message, wParam, lParam);
@@ -2560,7 +2567,7 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
#endif
WebKitSetApplicationCachePathIfNecessary();
WebPlatformStrategies::initialize();
-
+
#if USE(SAFARI_THEME)
BOOL shouldPaintNativeControls;
if (SUCCEEDED(m_preferences->shouldPaintNativeControls(&shouldPaintNativeControls)))
@@ -2582,6 +2589,7 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
pageClients.geolocationControllerClient = new WebGeolocationControllerClient(this);
#endif
m_page = new Page(pageClients);
+ m_page->settings()->setMinDOMTimerInterval(0.004);
BSTR localStoragePath;
if (SUCCEEDED(m_preferences->localStorageDatabasePath(&localStoragePath))) {
@@ -2925,10 +2933,13 @@ HRESULT STDMETHODCALLTYPE WebView::setPageSizeMultiplier(
void WebView::setZoomMultiplier(float multiplier, bool isTextOnly)
{
m_zoomMultiplier = multiplier;
- m_page->settings()->setZoomMode(isTextOnly ? ZoomTextOnly : ZoomPage);
+ m_zoomsTextOnly = isTextOnly;
+
if (Frame* coreFrame = core(m_mainFrame)) {
- if (FrameView* view = coreFrame->view())
- view->setZoomFactor(multiplier, isTextOnly ? ZoomTextOnly : ZoomPage);
+ if (m_zoomsTextOnly)
+ coreFrame->setPageAndTextZoomFactors(1, multiplier);
+ else
+ coreFrame->setPageAndTextZoomFactors(multiplier, 1);
}
}
@@ -2948,8 +2959,7 @@ HRESULT STDMETHODCALLTYPE WebView::pageSizeMultiplier(
float WebView::zoomMultiplier(bool isTextOnly)
{
- ZoomMode zoomMode = isTextOnly ? ZoomTextOnly : ZoomPage;
- if (zoomMode != m_page->settings()->zoomMode())
+ if (isTextOnly != m_zoomsTextOnly)
return 1.0f;
return m_zoomMultiplier;
}
@@ -3401,7 +3411,7 @@ HRESULT STDMETHODCALLTYPE WebView::selectionRect(RECT* rc)
WebCore::Frame* frame = m_page->focusController()->focusedOrMainFrame();
if (frame) {
- IntRect ir = enclosingIntRect(frame->selectionBounds());
+ IntRect ir = enclosingIntRect(frame->selection()->bounds());
ir = frame->view()->convertToContainingWindow(ir);
ir.move(-frame->view()->scrollOffset().width(), -frame->view()->scrollOffset().height());
rc->left = ir.x();
@@ -3561,7 +3571,7 @@ HRESULT STDMETHODCALLTYPE WebView::centerSelectionInVisibleArea(
if (!coreFrame)
return E_FAIL;
- coreFrame->revealSelection(ScrollAlignment::alignCenterAlways);
+ coreFrame->selection()->revealSelection(ScrollAlignment::alignCenterAlways);
return S_OK;
}
@@ -3732,7 +3742,7 @@ HRESULT STDMETHODCALLTYPE WebView::canMakeTextLarger(
/* [in] */ IUnknown* /*sender*/,
/* [retval][out] */ BOOL* result)
{
- bool canGrowMore = canZoomIn(m_page->settings()->zoomMode() == ZoomTextOnly);
+ bool canGrowMore = canZoomIn(m_zoomsTextOnly);
*result = canGrowMore ? TRUE : FALSE;
return S_OK;
}
@@ -3754,7 +3764,7 @@ bool WebView::canZoomIn(bool isTextOnly)
HRESULT STDMETHODCALLTYPE WebView::makeTextLarger(
/* [in] */ IUnknown* /*sender*/)
{
- return zoomIn(m_page->settings()->zoomMode() == ZoomTextOnly);
+ return zoomIn(m_zoomsTextOnly);
}
HRESULT STDMETHODCALLTYPE WebView::zoomPageIn(
@@ -3775,7 +3785,7 @@ HRESULT STDMETHODCALLTYPE WebView::canMakeTextSmaller(
/* [in] */ IUnknown* /*sender*/,
/* [retval][out] */ BOOL* result)
{
- bool canShrinkMore = canZoomOut(m_page->settings()->zoomMode() == ZoomTextOnly);
+ bool canShrinkMore = canZoomOut(m_zoomsTextOnly);
*result = canShrinkMore ? TRUE : FALSE;
return S_OK;
}
@@ -3797,7 +3807,7 @@ bool WebView::canZoomOut(bool isTextOnly)
HRESULT STDMETHODCALLTYPE WebView::makeTextSmaller(
/* [in] */ IUnknown* /*sender*/)
{
- return zoomOut(m_page->settings()->zoomMode() == ZoomTextOnly);
+ return zoomOut(m_zoomsTextOnly);
}
HRESULT STDMETHODCALLTYPE WebView::zoomPageOut(
@@ -4634,7 +4644,9 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
hr = preferences->zoomsTextOnly(&enabled);
if (FAILED(hr))
return hr;
- settings->setZoomMode(enabled ? ZoomTextOnly : ZoomPage);
+
+ if (m_zoomsTextOnly != !!enabled)
+ setZoomMultiplier(m_zoomMultiplier, enabled);
settings->setShowsURLsInToolTips(false);
settings->setForceFTPDirectoryListings(true);
@@ -6272,14 +6284,11 @@ void WebView::updateRootLayerContents()
m_nextDisplayIsSynchronous = false;
} else
m_layerRenderer->setRootContents(backingStoreImage.get());
+}
- // Set the frame and scroll position
- Frame* coreFrame = core(m_mainFrame);
- if (!coreFrame)
- return;
- FrameView* frameView = coreFrame->view();
-
- m_layerRenderer->setScrollFrame(IntPoint(frameView->scrollX(), frameView->scrollY()), IntSize(frameView->layoutWidth(), frameView->layoutHeight()));
+void WebView::layerRendererBecameVisible()
+{
+ m_layerRenderer->createRenderer();
}
#endif
diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h
index eec24fd..61eb946 100644..100755
--- a/WebKit/win/WebView.h
+++ b/WebKit/win/WebView.h
@@ -921,6 +921,8 @@ private:
HRESULT resetZoom(bool isTextOnly);
bool active();
+ void sizeChanged(const WebCore::IntSize&);
+
enum WindowsToPaint { PaintWebViewOnly, PaintWebViewAndChildren };
void paintIntoBackingStore(WebCore::FrameView*, HDC bitmapDC, const WebCore::IntRect& dirtyRect, WindowsToPaint);
void updateBackingStore(WebCore::FrameView*, HDC = 0, bool backingStoreCompletelyDirty = false, WindowsToPaint = PaintWebViewOnly);
@@ -995,6 +997,7 @@ protected:
WTF::String m_userAgentCustom;
WTF::String m_userAgentStandard;
float m_zoomMultiplier;
+ bool m_zoomsTextOnly;
WTF::String m_overrideEncoding;
WTF::String m_applicationName;
bool m_mouseActivated;
@@ -1041,8 +1044,7 @@ protected:
bool isAcceleratedCompositing() const { return m_isAcceleratedCompositing; }
void setAcceleratedCompositing(bool);
void updateRootLayerContents();
- void resizeLayerRenderer() { m_layerRenderer->resize(); }
- void layerRendererBecameVisible() { m_layerRenderer->createRenderer(); }
+ void layerRendererBecameVisible();
OwnPtr<WebCore::WKCACFLayerRenderer> m_layerRenderer;
bool m_isAcceleratedCompositing;
diff --git a/WebKit/wince/ChangeLog b/WebKit/wince/ChangeLog
index ea106fe..fba4def 100644
--- a/WebKit/wince/ChangeLog
+++ b/WebKit/wince/ChangeLog
@@ -1,3 +1,38 @@
+2010-09-20 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ Add FrameLoaderClientWinCE
+ https://bugs.webkit.org/show_bug.cgi?id=45682
+
+ * WebCoreSupport/FrameLoaderClientWinCE.cpp: Added.
+ * WebCoreSupport/FrameLoaderClientWinCE.h: Added.
+
+2010-09-16 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Add missing FrameNetworkingContextWinCE::blockedError
+ https://bugs.webkit.org/show_bug.cgi?id=45680
+
+ * WebCoreSupport/FrameNetworkingContextWinCE.cpp:
+ (WebKit::FrameNetworkingContextWinCE::blockedError):
+ * WebCoreSupport/FrameNetworkingContextWinCE.h:
+
+2010-09-13 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add FrameNetworkingContextWinCE
+ https://bugs.webkit.org/show_bug.cgi?id=45474
+
+ * WebCoreSupport/FrameNetworkingContextWinCE.cpp: Added.
+ (WebKit::FrameNetworkingContextWinCE::FrameNetworkingContextWinCE):
+ (WebKit::FrameNetworkingContextWinCE::userAgent):
+ (WebKit::FrameNetworkingContextWinCE::referrer):
+ * WebCoreSupport/FrameNetworkingContextWinCE.h: Added.
+ (WebKit::FrameNetworkingContextWinCE::create):
+
2010-08-31 Patrick Gansterer <paroga@paroga.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
new file mode 100644
index 0000000..b11df84
--- /dev/null
+++ b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
@@ -0,0 +1,627 @@
+/*
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "FrameLoaderClientWinCE.h"
+
+#include "DocumentLoader.h"
+#include "FrameLoader.h"
+#include "FrameNetworkingContextWinCE.h"
+#include "FrameView.h"
+#include "HTMLFormElement.h"
+#include "MIMETypeRegistry.h"
+#include "NotImplemented.h"
+#include "PluginDatabase.h"
+#include "RenderPart.h"
+#include "WebView.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+FrameLoaderClientWinCE::FrameLoaderClientWinCE(WebView* view)
+ : m_webView(view)
+ , m_pluginView(0)
+{
+ ASSERT(m_webView);
+}
+
+FrameLoaderClientWinCE::~FrameLoaderClientWinCE()
+{
+}
+
+String FrameLoaderClientWinCE::userAgent(const KURL&)
+{
+ return "WebKitWinCE";
+}
+
+PassRefPtr<DocumentLoader> FrameLoaderClientWinCE::createDocumentLoader(const WebCore::ResourceRequest& request, const SubstituteData& substituteData)
+{
+ return DocumentLoader::create(request, substituteData);
+}
+
+void FrameLoaderClientWinCE::committedLoad(DocumentLoader* loader, const char* data, int length)
+{
+ if (m_pluginView) {
+ if (!m_hasSentResponseToPlugin) {
+ m_pluginView->didReceiveResponse(loader->response());
+ m_hasSentResponseToPlugin = true;
+ }
+ m_pluginView->didReceiveData(data, length);
+ } else
+ loader->commitData(data, length);
+}
+
+bool FrameLoaderClientWinCE::shouldUseCredentialStorage(DocumentLoader*, unsigned long)
+{
+ notImplemented();
+ return false;
+}
+
+void FrameLoaderClientWinCE::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchWillSendRequest(DocumentLoader*, unsigned long, WebCore::ResourceRequest&, const WebCore::ResourceResponse&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::assignIdentifierToInitialRequest(unsigned long, DocumentLoader*, const WebCore::ResourceRequest&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::postProgressStartedNotification()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::postProgressEstimateChangedNotification()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::postProgressFinishedNotification()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::frameLoaderDestroyed()
+{
+ m_webView = 0;
+ m_frame = 0;
+ delete this;
+}
+
+void FrameLoaderClientWinCE::dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse& response)
+{
+ m_response = response;
+}
+
+void FrameLoaderClientWinCE::dispatchDecidePolicyForMIMEType(FramePolicyFunction policyFunction, const String& mimeType, const WebCore::ResourceRequest&)
+{
+ if (canShowMIMEType(mimeType))
+ (m_frame->loader()->policyChecker()->*policyFunction)(PolicyUse);
+ else
+ (m_frame->loader()->policyChecker()->*policyFunction)(PolicyDownload);
+}
+
+void FrameLoaderClientWinCE::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction policyFunction, const NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<FormState>, const String&)
+{
+ (m_frame->loader()->policyChecker()->*policyFunction)(PolicyUse);
+}
+
+void FrameLoaderClientWinCE::dispatchDecidePolicyForNavigationAction(FramePolicyFunction policyFunction, const NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<FormState>)
+{
+ (m_frame->loader()->policyChecker()->*policyFunction)(PolicyUse);
+}
+
+void FrameLoaderClientWinCE::dispatchWillSubmitForm(FramePolicyFunction policyFunction, PassRefPtr<FormState>)
+{
+ (m_frame->loader()->policyChecker()->*policyFunction)(PolicyUse);
+}
+
+PassRefPtr<Widget> FrameLoaderClientWinCE::createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool)
+{
+ return 0;
+}
+
+PassRefPtr<Frame> FrameLoaderClientWinCE::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
+ const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight)
+{
+ return m_webView->createFrame(url, name, ownerElement, referrer, allowsScrolling, marginWidth, marginHeight);
+}
+
+void FrameLoaderClientWinCE::didTransferChildFrameToNewDocument()
+{
+}
+
+void FrameLoaderClientWinCE::redirectDataToPlugin(Widget* pluginWidget)
+{
+ ASSERT(!m_pluginView);
+ m_pluginView = static_cast<PluginView*>(pluginWidget);
+ m_hasSentResponseToPlugin = false;
+}
+
+PassRefPtr<Widget> FrameLoaderClientWinCE::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, const Vector<String>&, const Vector<String>&)
+{
+ notImplemented();
+ return 0;
+}
+
+ObjectContentType FrameLoaderClientWinCE::objectContentType(const KURL& url, const String& mimeType)
+{
+ return FrameLoader::defaultObjectContentType(url, mimeType);
+}
+
+String FrameLoaderClientWinCE::overrideMediaType() const
+{
+ notImplemented();
+ return String();
+}
+
+void FrameLoaderClientWinCE::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::documentElementAvailable()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::didPerformFirstNavigation() const
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::registerForIconNotification(bool)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::setMainFrameDocumentReady(bool)
+{
+ notImplemented();
+}
+
+bool FrameLoaderClientWinCE::hasWebView() const
+{
+ return true;
+}
+
+void FrameLoaderClientWinCE::dispatchDidFinishLoad()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::frameLoadCompleted()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::saveViewStateToItem(HistoryItem*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::restoreViewState()
+{
+ notImplemented();
+}
+
+bool FrameLoaderClientWinCE::shouldGoToHistoryItem(HistoryItem* item) const
+{
+ return item;
+}
+
+void FrameLoaderClientWinCE::dispatchDidAddBackForwardItem(HistoryItem*) const
+{
+}
+
+void FrameLoaderClientWinCE::dispatchDidRemoveBackForwardItem(HistoryItem*) const
+{
+}
+
+void FrameLoaderClientWinCE::dispatchDidChangeBackForwardIndex() const
+{
+}
+
+void FrameLoaderClientWinCE::didDisplayInsecureContent()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::didRunInsecureContent(SecurityOrigin*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::makeRepresentation(DocumentLoader*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::forceLayout()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::forceLayoutForNonHTML()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::setCopiesOnScroll()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::detachedFromParent2()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::detachedFromParent3()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidHandleOnloadEvents()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidReceiveServerRedirectForProvisionalLoad()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidCancelClientRedirect()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchWillPerformClientRedirect(const KURL&, double, double)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidChangeLocationWithinPage()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidPushStateWithinPage()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidReplaceStateWithinPage()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidPopStateWithinPage()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchWillClose()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidReceiveIcon()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidStartProvisionalLoad()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidReceiveTitle(const String&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidChangeIcons()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidCommitLoad()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidFinishDocumentLoad()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidFirstLayout()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidFirstVisuallyNonEmptyLayout()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchShow()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::cancelPolicyCheck()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidLoadMainResource(DocumentLoader*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::revertToProvisionalState(DocumentLoader*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::willChangeTitle(DocumentLoader*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::didChangeTitle(DocumentLoader* documentLoader)
+{
+ setTitle(documentLoader->title(), documentLoader->url());
+}
+
+bool FrameLoaderClientWinCE::canHandleRequest(const WebCore::ResourceRequest&) const
+{
+ notImplemented();
+ return true;
+}
+
+bool FrameLoaderClientWinCE::canShowMIMEType(const String& type) const
+{
+ return (MIMETypeRegistry::isSupportedImageMIMEType(type)
+ || MIMETypeRegistry::isSupportedNonImageMIMEType(type)
+ || MIMETypeRegistry::isSupportedMediaMIMEType(type)
+ || PluginDatabase::installedPlugins()->isMIMETypeRegistered(type));
+}
+
+bool FrameLoaderClientWinCE::representationExistsForURLScheme(const String&) const
+{
+ notImplemented();
+ return false;
+}
+
+String FrameLoaderClientWinCE::generatedMIMETypeForURLScheme(const String&) const
+{
+ notImplemented();
+ return String();
+}
+
+void FrameLoaderClientWinCE::finishedLoading(DocumentLoader* documentLoader)
+{
+ if (!m_pluginView) {
+ FrameLoader* loader = documentLoader->frameLoader();
+ loader->writer()->setEncoding(m_response.textEncodingName(), false);
+ return;
+ }
+
+ m_pluginView->didFinishLoading();
+ m_pluginView = 0;
+ m_hasSentResponseToPlugin = false;
+}
+
+void FrameLoaderClientWinCE::provisionalLoadStarted()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::didFinishLoad()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::prepareForDataSourceReplacement()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::setTitle(const String&, const KURL&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidReceiveContentLength(DocumentLoader*, unsigned long, int)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidFinishLoading(DocumentLoader*, unsigned long)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::dispatchDidFailLoading(DocumentLoader*, unsigned long, const ResourceError&)
+{
+ notImplemented();
+}
+
+bool FrameLoaderClientWinCE::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int)
+{
+ notImplemented();
+ return false;
+}
+
+void FrameLoaderClientWinCE::dispatchDidFailProvisionalLoad(const ResourceError& error)
+{
+ dispatchDidFailLoad(error);
+}
+
+void FrameLoaderClientWinCE::dispatchDidFailLoad(const ResourceError&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::download(ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&)
+{
+ notImplemented();
+}
+
+ResourceError FrameLoaderClientWinCE::cancelledError(const WebCore::ResourceRequest&)
+{
+ return ResourceError();
+}
+
+ResourceError FrameLoaderClientWinCE::blockedError(const WebCore::ResourceRequest&)
+{
+ return ResourceError();
+}
+
+ResourceError FrameLoaderClientWinCE::cannotShowURLError(const WebCore::ResourceRequest&)
+{
+ return ResourceError();
+}
+
+ResourceError FrameLoaderClientWinCE::interruptForPolicyChangeError(const WebCore::ResourceRequest&)
+{
+ return ResourceError();
+}
+
+ResourceError FrameLoaderClientWinCE::cannotShowMIMETypeError(const WebCore::ResourceResponse&)
+{
+ return ResourceError();
+}
+
+ResourceError FrameLoaderClientWinCE::fileDoesNotExistError(const WebCore::ResourceResponse&)
+{
+ return ResourceError();
+}
+
+ResourceError FrameLoaderClientWinCE::pluginWillHandleLoadError(const WebCore::ResourceResponse&)
+{
+ return ResourceError();
+}
+
+bool FrameLoaderClientWinCE::shouldFallBack(const ResourceError& error)
+{
+ return !(error.isCancellation());
+}
+
+bool FrameLoaderClientWinCE::canCachePage() const
+{
+ return true;
+}
+
+Frame* FrameLoaderClientWinCE::dispatchCreatePage()
+{
+ notImplemented();
+ return 0;
+}
+
+void FrameLoaderClientWinCE::dispatchUnableToImplementPolicy(const ResourceError&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::setMainDocumentError(DocumentLoader*, const ResourceError& error)
+{
+ if (!m_pluginView)
+ return;
+
+ m_pluginView->didFail(error);
+ m_pluginView = 0;
+ m_hasSentResponseToPlugin = false;
+}
+
+void FrameLoaderClientWinCE::startDownload(const WebCore::ResourceRequest&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::updateGlobalHistory()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::updateGlobalHistoryRedirectLinks()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::savePlatformDataToCachedFrame(CachedFrame*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::transitionToCommittedFromCachedFrame(CachedFrame*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWinCE::transitionToCommittedForNewPage()
+{
+ Page* page = m_frame->page();
+ ASSERT(page);
+
+ bool isMainFrame = m_frame == page->mainFrame();
+
+ m_frame->setView(0);
+
+ RefPtr<FrameView> frameView;
+ if (isMainFrame) {
+ RECT rect;
+ m_webView->frameRect(&rect);
+ frameView = FrameView::create(m_frame, IntRect(rect).size());
+ } else
+ frameView = FrameView::create(m_frame);
+
+ m_frame->setView(frameView);
+
+ if (m_frame->ownerRenderer())
+ m_frame->ownerRenderer()->setWidget(frameView);
+}
+
+PassRefPtr<WebCore::FrameNetworkingContext> FrameLoaderClientWinCE::createNetworkingContext()
+{
+ return FrameNetworkingContextWinCE::create(m_frame, userAgent(KURL()));
+}
+
+} // namespace WebKit
diff --git a/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
new file mode 100644
index 0000000..94810bc
--- /dev/null
+++ b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
@@ -0,0 +1,196 @@
+/*
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FrameLoaderClientWinCE_h
+#define FrameLoaderClientWinCE_h
+
+#include "FrameLoaderClient.h"
+#include "PluginView.h"
+#include "ResourceResponse.h"
+
+class WebView;
+
+namespace WebKit {
+
+class FrameLoaderClientWinCE : public WebCore::FrameLoaderClient {
+public:
+ FrameLoaderClientWinCE(WebView*);
+ virtual ~FrameLoaderClientWinCE();
+ virtual void frameLoaderDestroyed();
+
+ WebView* webView() const { return m_webView; }
+
+ virtual bool hasWebView() const;
+
+ virtual void makeRepresentation(WebCore::DocumentLoader*);
+ virtual void forceLayout();
+ virtual void forceLayoutForNonHTML();
+
+ virtual void setCopiesOnScroll();
+
+ virtual void detachedFromParent2();
+ virtual void detachedFromParent3();
+
+ virtual void assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader*, const WebCore::ResourceRequest&);
+
+ virtual void dispatchWillSendRequest(WebCore::DocumentLoader*, unsigned long identifier, WebCore::ResourceRequest&, const WebCore::ResourceResponse& redirectResponse);
+ virtual bool shouldUseCredentialStorage(WebCore::DocumentLoader*, unsigned long identifier);
+ virtual void dispatchDidReceiveAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&);
+ virtual void dispatchDidCancelAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&);
+ virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&);
+ virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived);
+ virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier);
+ virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&);
+ virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length);
+
+ virtual void dispatchDidHandleOnloadEvents();
+ virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
+ virtual void dispatchDidCancelClientRedirect();
+ virtual void dispatchWillPerformClientRedirect(const WebCore::KURL&, double, double);
+ virtual void dispatchDidChangeLocationWithinPage();
+ virtual void dispatchDidPushStateWithinPage();
+ virtual void dispatchDidReplaceStateWithinPage();
+ virtual void dispatchDidPopStateWithinPage();
+ virtual void dispatchWillClose();
+ virtual void dispatchDidReceiveIcon();
+ virtual void dispatchDidStartProvisionalLoad();
+ virtual void dispatchDidReceiveTitle(const WTF::String&);
+ virtual void dispatchDidChangeIcons();
+ virtual void dispatchDidCommitLoad();
+ virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&);
+ virtual void dispatchDidFailLoad(const WebCore::ResourceError&);
+ virtual void dispatchDidFinishDocumentLoad();
+ virtual void dispatchDidFinishLoad();
+ virtual void dispatchDidFirstLayout();
+ virtual void dispatchDidFirstVisuallyNonEmptyLayout();
+
+ virtual WebCore::Frame* dispatchCreatePage();
+ virtual void dispatchShow();
+
+ virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, const WTF::String& MIMEType, const WebCore::ResourceRequest&);
+ virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WTF::PassRefPtr<WebCore::FormState>, const WTF::String& frameName);
+ virtual void dispatchDecidePolicyForNavigationAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WTF::PassRefPtr<WebCore::FormState>);
+ virtual void cancelPolicyCheck();
+
+ virtual void dispatchUnableToImplementPolicy(const WebCore::ResourceError&);
+
+ virtual void dispatchWillSendSubmitEvent(WebCore::HTMLFormElement*) { }
+ virtual void dispatchWillSubmitForm(WebCore::FramePolicyFunction, WTF::PassRefPtr<WebCore::FormState>);
+
+ virtual void dispatchDidLoadMainResource(WebCore::DocumentLoader*);
+ virtual void revertToProvisionalState(WebCore::DocumentLoader*);
+ virtual void setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&);
+
+ virtual void postProgressStartedNotification();
+ virtual void postProgressEstimateChangedNotification();
+ virtual void postProgressFinishedNotification();
+
+ virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement,
+ const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
+ virtual void didTransferChildFrameToNewDocument();
+ virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const WTF::Vector<WTF::String>&, const WTF::Vector<WTF::String>&, const WTF::String&, bool);
+ virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
+ virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues);
+ virtual WTF::String overrideMediaType() const;
+ virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*);
+ virtual void documentElementAvailable();
+ virtual void didPerformFirstNavigation() const;
+
+ virtual void registerForIconNotification(bool);
+
+ virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WTF::String& mimeType);
+
+ virtual void setMainFrameDocumentReady(bool);
+
+ virtual void startDownload(const WebCore::ResourceRequest&);
+
+ virtual void willChangeTitle(WebCore::DocumentLoader*);
+ virtual void didChangeTitle(WebCore::DocumentLoader*);
+
+ virtual void committedLoad(WebCore::DocumentLoader*, const char*, int);
+ virtual void finishedLoading(WebCore::DocumentLoader*);
+
+ virtual void updateGlobalHistory();
+ virtual void updateGlobalHistoryRedirectLinks();
+ virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const;
+ virtual void dispatchDidAddBackForwardItem(WebCore::HistoryItem*) const;
+ virtual void dispatchDidRemoveBackForwardItem(WebCore::HistoryItem*) const;
+ virtual void dispatchDidChangeBackForwardIndex() const;
+
+ virtual void didDisplayInsecureContent();
+ virtual void didRunInsecureContent(WebCore::SecurityOrigin*);
+
+ virtual WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&);
+ virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&);
+ virtual WebCore::ResourceError cannotShowURLError(const WebCore::ResourceRequest&);
+ virtual WebCore::ResourceError interruptForPolicyChangeError(const WebCore::ResourceRequest&);
+
+ virtual WebCore::ResourceError cannotShowMIMETypeError(const WebCore::ResourceResponse&);
+ virtual WebCore::ResourceError fileDoesNotExistError(const WebCore::ResourceResponse&);
+ virtual WebCore::ResourceError pluginWillHandleLoadError(const WebCore::ResourceResponse&);
+
+ virtual bool shouldFallBack(const WebCore::ResourceError&);
+
+ virtual bool canHandleRequest(const WebCore::ResourceRequest&) const;
+ virtual bool canShowMIMEType(const WTF::String&) const;
+ virtual bool representationExistsForURLScheme(const WTF::String&) const;
+ virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String&) const;
+
+ virtual void frameLoadCompleted();
+ virtual void saveViewStateToItem(WebCore::HistoryItem*);
+ virtual void restoreViewState();
+ virtual void provisionalLoadStarted();
+ virtual void didFinishLoad();
+ virtual void prepareForDataSourceReplacement();
+
+ virtual WTF::PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
+ virtual void setTitle(const WTF::String& title, const WebCore::KURL&);
+
+ virtual WTF::String userAgent(const WebCore::KURL&);
+
+ virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*);
+ virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*);
+ virtual void transitionToCommittedForNewPage();
+
+ virtual bool canCachePage() const;
+ virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
+
+ virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
+
+ void setFrame(WebCore::Frame *frame) { m_frame = frame; }
+ WebCore::Frame *frame() { return m_frame; }
+
+private:
+ WebView* m_webView;
+ WebCore::Frame* m_frame;
+ WebCore::ResourceResponse m_response;
+
+ // Plugin view to redirect data to
+ WebCore::PluginView* m_pluginView;
+ bool m_hasSentResponseToPlugin;
+};
+
+} // namespace WebKit
+
+#endif // FrameLoaderClientWinCE_h
diff --git a/WebKit/wince/WebCoreSupport/FrameNetworkingContextWinCE.cpp b/WebKit/wince/WebCoreSupport/FrameNetworkingContextWinCE.cpp
new file mode 100644
index 0000000..477fe97
--- /dev/null
+++ b/WebKit/wince/WebCoreSupport/FrameNetworkingContextWinCE.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "FrameNetworkingContextWinCE.h"
+
+#include "NotImplemented.h"
+#include "ResourceError.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+FrameNetworkingContextWinCE::FrameNetworkingContextWinCE(Frame* frame, const String& userAgent)
+ : FrameNetworkingContext(frame)
+ , m_userAgent(userAgent)
+{
+}
+
+String FrameNetworkingContextWinCE::userAgent() const
+{
+ return m_userAgent;
+}
+
+String FrameNetworkingContextWinCE::referrer() const
+{
+ return frame()->loader()->referrer();
+}
+
+WebCore::ResourceError FrameNetworkingContextWinCE::blockedError(const WebCore::ResourceRequest&) const
+{
+ notImplemented();
+ return WebCore::ResourceError();
+}
+
+} // namespace WebKit
diff --git a/WebKit/wince/WebCoreSupport/FrameNetworkingContextWinCE.h b/WebKit/wince/WebCoreSupport/FrameNetworkingContextWinCE.h
new file mode 100644
index 0000000..436aff7
--- /dev/null
+++ b/WebKit/wince/WebCoreSupport/FrameNetworkingContextWinCE.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FrameNetworkingContextWinCE_h
+#define FrameNetworkingContextWinCE_h
+
+#include "FrameNetworkingContext.h"
+
+namespace WebKit {
+
+class FrameNetworkingContextWinCE : public WebCore::FrameNetworkingContext {
+public:
+ static PassRefPtr<FrameNetworkingContextWinCE> create(WebCore::Frame* frame, const WTF::String& userAgent)
+ {
+ return adoptRef(new FrameNetworkingContextWinCE(frame, userAgent));
+ }
+
+ virtual WTF::String userAgent() const;
+ virtual WTF::String referrer() const;
+ virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const;
+
+private:
+ FrameNetworkingContextWinCE(WebCore::Frame* frame, const WTF::String& userAgent);
+
+ WTF::String m_userAgent;
+};
+
+} // namespace WebKit
+
+#endif // FrameNetworkingContextWinCE_h
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index 8edf46f..7aedbac 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,3 +1,74 @@
+2010-09-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ REGRESSION (r60104): Zoom level is unexpectedly reset on page reload
+ https://bugs.webkit.org/show_bug.cgi?id=42863
+
+ * WebFrame.cpp:
+ (wxWebFrame::IncreaseTextSize):
+ (wxWebFrame::DecreaseTextSize):
+ (wxWebFrame::ResetTextSize):
+ Call functions on Frame instead of FrameView.
+
+2010-09-14 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after FrameNetworkingContext changes and setZoomLevel changes.
+
+ * WebFrame.cpp:
+ (wxWebFrame::IncreaseTextSize):
+ (wxWebFrame::DecreaseTextSize):
+ (wxWebFrame::ResetTextSize):
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::createNetworkingContext):
+ * WebKitSupport/FrameLoaderClientWx.h:
+ * WebKitSupport/FrameNetworkingContextWx.h: Added.
+ (WebCore::FrameNetworkingContextWx::create):
+ (WebCore::FrameNetworkingContextWx::coreFrame):
+ (WebCore::FrameNetworkingContextWx::FrameNetworkingContextWx):
+
+2010-09-13 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Paste should be implemented in WebCore like Copy and Cut for Mac also.
+ https://bugs.webkit.org/show_bug.cgi?id=45494
+ <rdar://problem/7660537>
+
+ On the Mac platform, the implementation of the paste operation is all done
+ at the WebKit level. In order to support it on WebKit2 it is necessary to
+ refactor the code and move this functionality at the level of WebCore like
+ we already have on Windows.
+ The original code relies on some in AppKit functions that call back into
+ WebKit causing problems in WebKit2. All this functionality has been moved
+ at the level of the editor client where it can be dealt with appropriately.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::canShowMIMETypeAsHTML): Added stub.
+ * WebKitSupport/FrameLoaderClientWx.h:
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::committedLoad):
+
+2010-09-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Main resource bytes shouldn't bounce through FrameLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45496
+
+ Now return the bytes to the DocumentLoader.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::committedLoad):
+
2010-09-08 Darin Adler <darin@apple.com>
Reviewed by Adam Barth.
diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp
index 3a556d5..1c2eebd 100644
--- a/WebKit/wx/WebFrame.cpp
+++ b/WebKit/wx/WebFrame.cpp
@@ -373,7 +373,7 @@ void wxWebFrame::IncreaseTextSize()
{
if (CanIncreaseTextSize()) {
m_textMagnifier = m_textMagnifier*TextSizeMultiplierRatio;
- m_impl->frame->view()->setZoomFactor(m_textMagnifier, WebCore::ZoomTextOnly);
+ m_impl->frame->setTextZoomFactor(m_textMagnifier);
}
}
@@ -390,15 +390,15 @@ void wxWebFrame::DecreaseTextSize()
{
if (CanDecreaseTextSize()) {
m_textMagnifier = m_textMagnifier/TextSizeMultiplierRatio;
- m_impl->frame->view()->setZoomFactor(m_textMagnifier, WebCore::ZoomTextOnly);
+ m_impl->frame->setTextZoomFactor(m_textMagnifier);
}
}
void wxWebFrame::ResetTextSize()
{
m_textMagnifier = 1.0;
- if (m_impl->frame && m_impl->frame->view())
- m_impl->frame->view()->setZoomFactor(m_textMagnifier, WebCore::ZoomTextOnly);
+ if (m_impl->frame)
+ m_impl->frame->setTextZoomFactor(m_textMagnifier);
}
void wxWebFrame::MakeEditable(bool enable)
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
index 5b708c2..facb387 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
@@ -55,6 +55,7 @@
#include <stdio.h>
+#include "FrameNetworkingContextWx.h"
#include "WebFrame.h"
#include "WebFramePrivate.h"
#include "WebView.h"
@@ -445,7 +446,13 @@ void FrameLoaderClientWx::finishedLoading(DocumentLoader* loader)
}
}
+bool FrameLoaderClientWx::canShowMIMETypeAsHTML(const String& MIMEType) const
+{
+ notImplemented();
+ return true;
+}
+
bool FrameLoaderClientWx::canShowMIMEType(const String& MIMEType) const
{
notImplemented();
@@ -612,16 +619,14 @@ void FrameLoaderClientWx::setMainDocumentError(WebCore::DocumentLoader* loader,
}
}
+// FIXME: This function should be moved into WebCore.
void FrameLoaderClientWx::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
{
if (!m_webFrame)
return;
- if (!m_pluginView) {
- FrameLoader* fl = loader->frameLoader();
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- fl->addData(data, length);
- }
-
+ if (!m_pluginView)
+ loader->commitData(data, length);
+
// We re-check here as the plugin can have been created
if (m_pluginView) {
if (!m_hasSentResponseToPlugin) {
@@ -965,4 +970,9 @@ bool FrameLoaderClientWx::shouldUsePluginDocument(const String &mimeType) const
return false;
}
+PassRefPtr<FrameNetworkingContext> FrameLoaderClientWx::createNetworkingContext()
+{
+ return FrameNetworkingContextWx::create(m_frame);
+}
+
}
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
index 0dee4bf..20b50d3 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
@@ -131,6 +131,7 @@ namespace WebCore {
virtual void finishedLoading(DocumentLoader*);
virtual bool canShowMIMEType(const String& MIMEType) const;
+ virtual bool canShowMIMETypeAsHTML(const String& MIMEType) const;
virtual bool representationExistsForURLScheme(const String& URLScheme) const;
virtual String generatedMIMETypeForURLScheme(const String& URLScheme) const;
@@ -220,6 +221,8 @@ namespace WebCore {
virtual void registerForIconNotification(bool listen = true);
virtual bool shouldUsePluginDocument(const String &mimeType) const;
+
+ virtual PassRefPtr<FrameNetworkingContext> createNetworkingContext();
private:
wxWebFrame *m_webFrame;
diff --git a/WebKit/wx/WebKitSupport/FrameNetworkingContextWx.h b/WebKit/wx/WebKitSupport/FrameNetworkingContextWx.h
new file mode 100644
index 0000000..3aa2374
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/FrameNetworkingContextWx.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2010 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FrameNetworkingContextWx_h
+#define FrameNetworkingContextWx_h
+
+#include "FrameNetworkingContext.h"
+
+namespace WebCore {
+
+class FrameNetworkingContextWx : public WebCore::FrameNetworkingContext {
+public:
+ static PassRefPtr<FrameNetworkingContextWx> create(WebCore::Frame* frame)
+ {
+ return adoptRef(new FrameNetworkingContextWx(frame));
+ }
+
+ WebCore::Frame* coreFrame() const { return frame(); }
+
+private:
+ FrameNetworkingContextWx(WebCore::Frame* frame)
+ : WebCore::FrameNetworkingContext(frame)
+ {
+ }
+};
+
+}
+
+#endif
diff --git a/WebKitLibraries/ChangeLog b/WebKitLibraries/ChangeLog
index 3d603d9..bcd8fab 100644
--- a/WebKitLibraries/ChangeLog
+++ b/WebKitLibraries/ChangeLog
@@ -1,3 +1,44 @@
+2010-09-17 Sam Weinig <sam@webkit.org>
+
+ Reviewed, tweaked, and landed by Anders Carlsson.
+
+ Add WKCopyNSURLResponsePeerCertificates.
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLeopard.a:
+ * libWebKitSystemInterfaceSnowLeopard.a:
+
+2010-09-16 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by Jian Li.
+
+ Unify FILE_SYSTEM and FILE_WRITER enables under the name FILE_SYSTEM.
+ https://bugs.webkit.org/show_bug.cgi?id=45798
+
+ * win/tools/vsprops/FeatureDefines.vsprops:
+ * win/tools/vsprops/FeatureDefinesCairo.vsprops:
+
+2010-09-09 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Adopt shared control drawing for <video> controls on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=45490
+
+ * win/lib/WebKitSystemInterface.lib:
+ * win/lib/WebKitSystemInterface_debug.lib:
+
+2010-09-10 Anders Carlsson <andersca@apple.com>
+
+ WebKitSystemInterface part of:
+ Set the visible name for the web process
+ https://bugs.webkit.org/show_bug.cgi?id=45564
+ <rdar://problem/8416970>
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLeopard.a:
+ * libWebKitSystemInterfaceSnowLeopard.a:
+
2010-08-05 Jian Li <jianli@chromium.org>
Reviewed by David Levin.
diff --git a/WebKitLibraries/WebKitSystemInterface.h b/WebKitLibraries/WebKitSystemInterface.h
index 5f6dcdb..8cb0770 100644
--- a/WebKitLibraries/WebKitSystemInterface.h
+++ b/WebKitLibraries/WebKitSystemInterface.h
@@ -33,6 +33,10 @@ NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *response);
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+CFArrayRef WKCopyNSURLResponsePeerCertificates(NSURLResponse *response);
+#endif
+
CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
@@ -205,6 +209,8 @@ void WKQTMovieDisableComponent(uint32_t[5]);
CFStringRef WKCopyFoundationCacheDirectory(void);
+void WKSetVisibleApplicationName(CFStringRef);
+
typedef enum {
WKMediaUIPartFullscreenButton = 0,
WKMediaUIPartMuteButton,
diff --git a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
index 39ceb4a..b3a7ebc 100644
--- a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
+++ b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
Binary files differ
diff --git a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
index 6dd8afc..aefd269 100644
--- a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
+++ b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
Binary files differ
diff --git a/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h b/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
index 445b292..80830a7 100644
--- a/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
+++ b/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
@@ -28,6 +28,7 @@
struct CGAffineTransform;
struct CGPoint;
+struct CGRect;
struct CGSize;
typedef const struct __CFData* CFDataRef;
@@ -89,4 +90,46 @@ CFURLCredentialRef wkCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceR
CFStringRef wkCFNetworkErrorGetLocalizedDescription(CFIndex errorCode);
+typedef enum {
+ WKMediaUIPartFullscreenButton = 0,
+ WKMediaUIPartMuteButton,
+ WKMediaUIPartPlayButton,
+ WKMediaUIPartSeekBackButton,
+ WKMediaUIPartSeekForwardButton,
+ WKMediaUIPartTimelineSlider,
+ WKMediaUIPartTimelineSliderThumb,
+ WKMediaUIPartRewindButton,
+ WKMediaUIPartSeekToRealtimeButton,
+ WKMediaUIPartShowClosedCaptionsButton,
+ WKMediaUIPartHideClosedCaptionsButton,
+ WKMediaUIPartUnMuteButton,
+ WKMediaUIPartPauseButton,
+ WKMediaUIPartBackground,
+ WKMediaUIPartCurrentTimeDisplay,
+ WKMediaUIPartTimeRemainingDisplay,
+ WKMediaUIPartStatusDisplay,
+ WKMediaUIPartControlsPanel,
+ WKMediaUIPartVolumeSliderContainer,
+ WKMediaUIPartVolumeSlider,
+ WKMediaUIPartVolumeSliderThumb
+} WKMediaUIPart;
+
+typedef enum {
+ WKMediaControllerThemeClassic = 1,
+ WKMediaControllerThemeQuickTime = 2
+} WKMediaControllerThemeStyle;
+
+typedef enum {
+ WKMediaControllerFlagDisabled = 1 << 0,
+ WKMediaControllerFlagPressed = 1 << 1,
+ WKMediaControllerFlagDrawEndCaps = 1 << 3,
+ WKMediaControllerFlagFocused = 1 << 4
+} WKMediaControllerThemeState;
+
+bool WKMediaControllerThemeAvailable(int themeStyle);
+bool WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
+void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
+void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
+void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
+
#endif // WebKitSystemInterface_h
diff --git a/WebKitLibraries/win/lib/WebKitSystemInterface.lib b/WebKitLibraries/win/lib/WebKitSystemInterface.lib
index 4fcc36b..40513e6 100644
--- a/WebKitLibraries/win/lib/WebKitSystemInterface.lib
+++ b/WebKitLibraries/win/lib/WebKitSystemInterface.lib
Binary files differ
diff --git a/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib b/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib
index 6d836db..124c241 100644
--- a/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib
+++ b/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib
Binary files differ
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
index 73622e1..17b5da4 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
@@ -9,7 +9,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_WRITER);$(ENABLE_FILE_SYSTEM);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_RUBY);$(ENABLE_SANDBOX);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_RUBY);$(ENABLE_SANDBOX);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_CANVAS"
@@ -77,11 +77,6 @@
PerformEnvironmentSet="true"
/>
<UserMacro
- Name="ENABLE_FILE_WRITER"
- Value=""
- PerformEnvironmentSet="true"
- />
- <UserMacro
Name="ENABLE_FILE_SYSTEM"
Value=""
PerformEnvironmentSet="true"
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
index f3c5b94..1aa406a 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
@@ -9,7 +9,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_WRITER);$(ENABLE_FILE_SYSTEM);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_CANVAS"
@@ -77,11 +77,6 @@
PerformEnvironmentSet="true"
/>
<UserMacro
- Name="ENABLE_FILE_WRITER"
- Value=""
- PerformEnvironmentSet="true"
- />
- <UserMacro
Name="ENABLE_FILE_SYSTEM"
Value=""
PerformEnvironmentSet="true"
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
index 89a768a..54a0dfe 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
@@ -196,7 +196,7 @@
}
],
- "schedulers": [ { "type": "AnyBranchScheduler", "name": "trunk", "branches": ["trunk"], "treeStableTimer": 45.0,
+ "schedulers": [ { "type": "AnyBranchScheduler", "name": "trunk", "change_filter": "trunk_filter", "treeStableTimer": 45.0,
"builderNames": ["Leopard Intel Release (Build)", "Leopard Intel Debug (Build)",
"SnowLeopard Intel Release (Build)", "SnowLeopard Intel Leaks",
"Windows Release (Build)", "Windows Debug (Build)",
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
index f30ac16..aca3c65 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
@@ -6,6 +6,7 @@ c = BuildmasterConfig = {}
from buildbot.buildslave import BuildSlave
from buildbot.changes.pb import PBChangeSource
from buildbot.scheduler import AnyBranchScheduler, Triggerable
+from buildbot.schedulers.filter import ChangeFilter
from buildbot.status import html
from buildbot.process import buildstep, factory, properties
from buildbot.steps import master, shell, source, transfer, trigger
@@ -419,6 +420,8 @@ class NewBuildAndTestFactory(BuildAndTestFactory):
class TestWebKit2Factory(TestFactory):
TestClass = RunWebKit2Tests
+trunk_filter = ChangeFilter(branch=["trunk", None])
+
def loadBuilderConfig(c):
# FIXME: These file handles are leaked.
passwords = simplejson.load(open('passwords.json'))
@@ -431,6 +434,8 @@ def loadBuilderConfig(c):
c['schedulers'] = []
for scheduler in config['schedulers']:
+ if "change_filter" in scheduler:
+ scheduler["change_filter"] = globals()[scheduler["change_filter"]]
kls = globals()[scheduler.pop('type')]
c['schedulers'].append(kls(**scheduler))
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/default.css b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/default.css
new file mode 100644
index 0000000..4223807
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/default.css
@@ -0,0 +1,524 @@
+div.header { display: none; }
+body > hr { display: none; }
+div.content h1 { display: none; }
+
+body.interface {
+ background: url(bg_gradient.jpg) repeat-x;
+ font-family: Verdana, Cursor;
+ font-size: 10px;
+ font-weight: bold;
+ background-color: #fff;
+ color: #333;
+}
+
+a:link,a:visited,a:active {
+ color: #444;
+}
+
+table {
+ border-spacing: 1px 1px;
+}
+
+table td {
+ padding: 3px 2px 3px 2px;
+}
+
+.Project {
+ min-width: 6em;
+}
+
+.LastBuild,.Activity {
+ padding: 0 0 0 4px;
+}
+
+/* Chromium Specific styles */
+div.BuildResultInfo {
+ color: #444;
+}
+
+div.Announcement {
+ margin-bottom: 1em;
+}
+
+div.Announcement>a:hover {
+ color: black;
+}
+
+div.Announcement>div.Notice {
+ background-color: #afdaff;
+ padding: 0.5em;
+ font-size: 16px;
+ text-align: center;
+}
+
+div.Announcement>div.Open {
+ border: 3px solid #8fdf5f;
+ padding: 0.5em;
+ font-size: 16px;
+ text-align: center;
+}
+
+div.Announcement>div.Closed {
+ border: 5px solid #e98080;
+ padding: 0.5em;
+ font-size: 24px;
+ font-weight: bold;
+ text-align: center;
+}
+
+td.Time {
+ color: #000;
+ border-bottom: 1px solid #aaa;
+ background-color: #eee;
+}
+
+td.Activity,td.Change,td.Builder {
+ color: #333333;
+ background-color: #CCCCCC;
+}
+
+td.Change {
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+}
+
+td.Event {
+ color: #777;
+ background-color: #ddd;
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+}
+
+td.Activity {
+ border-top-left-radius: 10px;
+ -webkit-border-top-left-radius: 10px;
+ -moz-border-radius-topleft: 10px;
+ min-height: 20px;
+ padding: 2px 0 2px 0;
+}
+
+td.idle,td.waiting,td.offline,td.building {
+ border-top-left-radius: 0px;
+ -webkit-border-top-left-radius: 0px;
+ -moz-border-radius-topleft: 0px;
+}
+
+.LastBuild {
+ border-top-left-radius: 5px;
+ -webkit-border-top-left-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+ border-top-right-radius: 5px;
+ -webkit-border-top-right-radius: 5px;
+ -moz-border-radius-topright: 5px;
+}
+
+/* Console view styles */
+td.DevRev {
+ padding: 4px 8px 4px 8px;
+ color: #333333;
+ border-top-left-radius: 5px;
+ -webkit-border-top-left-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+ background-color: #eee;
+ width: 1%;
+}
+
+td.DevRevCollapse {
+ border-bottom-left-radius: 5px;
+ -webkit-border-bottom-left-radius: 5px;
+ -moz-border-radius-bottomleft: 5px;
+}
+
+td.DevName {
+ padding: 4px 8px 4px 8px;
+ color: #333333;
+ background-color: #eee;
+ width: 1%;
+ text-align: left;
+}
+
+td.DevStatus {
+ padding: 4px 4px 4px 4px;
+ color: #333333;
+ background-color: #eee;
+}
+
+td.DevSlave {
+ padding: 4px 4px 4px 4px;
+ color: #333333;
+ background-color: #eee;
+}
+
+td.first {
+ border-top-left-radius: 5px;
+ -webkit-border-top-left-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+}
+
+td.last {
+ border-top-right-radius: 5px;
+ -webkit-border-top-right-radius: 5px;
+ -moz-border-radius-topright: 5px;
+}
+
+td.DevStatusCategory {
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-width: 1px;
+ border-style: solid;
+}
+
+td.DevStatusCollapse {
+ border-bottom-right-radius: 5px;
+ -webkit-border-bottom-right-radius: 5px;
+ -moz-border-radius-bottomright: 5px;
+}
+
+td.DevDetails {
+ font-weight: normal;
+ padding: 8px 8px 8px 8px;
+ color: #333333;
+ background-color: #eee;
+ text-align: left;
+}
+
+td.DevComment {
+ font-weight: normal;
+ padding: 8px 8px 8px 8px;
+ color: #333333;
+ border-bottom-right-radius: 5px;
+ -webkit-border-bottom-right-radius: 5px;
+ -moz-border-radius-bottomright: 5px;
+ border-bottom-left-radius: 5px;
+ -webkit-border-bottom-left-radius: 5px;
+ -moz-border-radius-bottomleft: 5px;
+ background-color: #eee;
+ text-align: left;
+}
+
+td.Alt {
+ background-color: #ddd;
+}
+
+.legend {
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ width: 100px;
+ max-width: 100px;
+ text-align: center;
+ padding: 2px 2px 2px 2px;
+ height: 14px;
+ white-space: nowrap;
+}
+
+.DevStatusBox {
+ text-align: center;
+ height: 20px;
+ padding: 0 2px;
+ line-height: 0;
+ white-space: nowrap;
+}
+
+.DevStatusBox a {
+ opacity: 0.85;
+ border-width: 1px;
+ border-style: solid;
+ border-radius: 4px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ display: block;
+ width: 90%;
+ height: 20px;
+ line-height: 20px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.DevSlaveBox {
+ text-align: center;
+ height: 10px;
+ padding: 0 2px;
+ line-height: 0;
+ white-space: nowrap;
+}
+
+.DevSlaveBox a {
+ opacity: 0.85;
+ border-width: 1px;
+ border-style: solid;
+ border-radius: 4px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ display: block;
+ width: 90%;
+ height: 10px;
+ line-height: 20px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+a.noround {
+ border-radius: 0px;
+ -webkit-border-radius: 0px;
+ -moz-border-radius: 0px;
+ position: relative;
+ margin-top: -8px;
+ margin-bottom: -8px;
+ height: 36px;
+ border-top-width: 0;
+ border-bottom-width: 0;
+}
+
+a.begin {
+ border-top-width: 1px;
+ position: relative;
+ margin-top: 0px;
+ margin-bottom: -7px;
+ height: 27px;
+ border-top-left-radius: 4px;
+ -webkit-border-top-left-radius: 4px;
+ -moz-border-radius-topleft: 4px;
+ border-top-right-radius: 4px;
+ -webkit-border-top-right-radius: 4px;
+ -moz-border-radius-topright: 4px;
+}
+
+a.end {
+ border-bottom-width: 1px;
+ position: relative;
+ margin-top: -7px;
+ margin-bottom: 0px;
+ height: 27px;
+ border-bottom-left-radius: 4px;
+ -webkit-border-bottom-left-radius: 4px;
+ -moz-border-radius-bottomleft: 4px;
+ border-bottom-right-radius: 4px;
+ -webkit-border-bottom-right-radius: 4px;
+ -moz-border-radius-bottomright: 4px;
+}
+
+.center_align {
+ text-align: center;
+}
+
+.right_align {
+ text-align: right;
+}
+
+.left_align {
+ text-align: left;
+}
+
+div.BuildWaterfall {
+ border-radius: 7px;
+ -webkit-border-radius: 7px;
+ -moz-border-radius: 7px;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ background-color: #FFFFFF;
+ padding: 4px 4px 4px 4px;
+ float: left;
+ display: none;
+ border-width: 1px;
+ border-style: solid;
+}
+
+/* LastBuild, BuildStep states */
+.success {
+ color: #FFFFFF;
+ background-color: #8FDF5F;
+ border-color: #4F8530;
+}
+
+.failure {
+ color: #FFFFFF;
+ background-color: #E98080;
+ border-color: #A77272;
+}
+
+.warnings {
+ color: #FFFFFF;
+ background-color: #FFC343;
+ border-color: #C29D46;
+}
+
+.exception {
+ color: #FFFFFF;
+ background-color: #E0B0FF;
+ border-color: #ACA0B3;
+}
+
+.start,.running,td.building {
+ color: #666666;
+ background-color: #FFFC6C;
+ border-color: #C5C56D;
+}
+
+.offline,td.offline {
+ color: #FFFFFF;
+ background-color: #E0B0FF;
+ border-color: #dddddd;
+}
+
+
+.start {
+ border-bottom-left-radius: 10px;
+ -webkit-border-bottom-left-radius: 10px;
+ -moz-border-radius-bottomleft: 10px;
+ border-bottom-right-radius: 10px;
+ -webkit-border-bottom-right-radius: 10px;
+ -moz-border-radius-bottomright: 10px;
+}
+
+.notstarted {
+ border-width: 1px;
+ border-style: solid;
+ border-color: #aaa;
+ background-color: #fff;
+}
+
+.closed {
+ background-color: #ff0000;
+}
+
+.closed .large {
+ font-size: 1.5em;
+ font-weight: bolder;
+}
+
+td.Project a:hover,td.start a:hover {
+ color: #000;
+}
+
+.mini-box {
+ text-align: center;
+ height: 20px;
+ padding: 0 2px;
+ line-height: 0;
+ white-space: nowrap;
+}
+
+.mini-box a {
+ border-radius: 0;
+ -webkit-border-radius: 0;
+ -moz-border-radius: 0;
+ display: block;
+ width: 100%;
+ height: 20px;
+ line-height: 20px;
+ margin-top: -30px;
+}
+
+.mini-closed {
+ -box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ border: 4px solid red;
+}
+
+/* grid styles */
+table.Grid {
+ border-collapse: collapse;
+}
+
+table.Grid tr td {
+ padding: 0.2em;
+ margin: 0px;
+ text-align: center;
+}
+
+table.Grid tr td.title {
+ font-size: 90%;
+ border-right: 1px gray solid;
+ border-bottom: 1px gray solid;
+}
+
+table.Grid tr td.sourcestamp {
+ font-size: 90%;
+}
+
+table.Grid tr td.builder {
+ text-align: right;
+ font-size: 90%;
+}
+
+table.Grid tr td.build {
+ border: 1px gray solid;
+}
+
+/* column container */
+div.column {
+ margin: 0 2em 2em 0;
+ float: left;
+}
+
+/* info tables */
+table.info {
+ border-spacing: 1px;
+}
+
+table.info td {
+ padding: 0.1em 1em 0.1em 1em;
+ text-align: center;
+}
+
+table.info th {
+ padding: 0.2em 1.5em 0.2em 1.5em;
+ text-align: center;
+}
+
+table.info td.left {
+ text-align: left
+}
+
+.alt {
+ background-color: #d6d6d6;
+}
+
+li {
+ padding: 0.1em 1em 0.1em 1em;
+}
+
+.result {
+ padding: 0.3em 1em 0.3em 1em;
+}
+
+/* log view */
+.log * {
+ vlink: #800080;
+ font-family: "Courier New", courier, monotype;
+}
+
+span.stdout {
+ color: black;
+}
+
+span.stderr {
+ color: red;
+}
+
+span.header {
+ color: blue;
+}
+
+/* revision & email */
+.revision .full {
+ display: none;
+}
+
+.user .email {
+ display: none;
+}
+
+/* change comments (use regular colors here) */
+pre.comments>a:link,pre.comments>a:visited {
+ color: blue;
+}
+
+pre.comments>a:active {
+ color: purple;
+}
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/index.html b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/templates/root.html
index c6d2343..c6d2343 100644..100755
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/index.html
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/templates/root.html
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index aa525b5..eace217 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,1373 @@
+2010-09-20 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ new-run-webkit-tests: refactor command line args getting passed to DRT
+
+ This change cleans up some argument parsing between functions to get
+ rid of some overlapping data structures. There should be no functional
+ changes in this patch; it is pure refactoring in preparation for
+ landing the Chrome GPU port and adding a generic way to pass
+ args to DRT/TestShell.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46135
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ - pass the options argument explicitly to the threads and drivers,
+ also consolidate the passing of options to the driver.
+ - pass options directly to process_output() to remove a couple
+ parameters (minor cleanup).
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ - pass the options argument to Port.create_driver().
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ - update Port.create_driver() test
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ - pass the options argument to Port.create_driver(), and clean up
+ building of the cmd line for DRT.
+ * Scripts/webkitpy/layout_tests/port/dryrun.py:
+ - pass the options argument to Port.create_driver()
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ - pass the options argument to Port.create_driver()
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ - pass the options argument to Port.create_driver(), and clean up
+ building of the cmd line for DRT.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ - consolidate args in _get_dump_render_tree_args and rename to
+ _get_test_args(); move all of the command-line args to the
+ Port implementations.
+
+2010-09-20 Andrew Wilson <atwilson@chromium.org>
+
+ Revert change which was accidentally committed along with some expectation changes.
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+
+2010-09-20 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Add explicit --force-patch flag to webkitpy tools
+ https://bugs.webkit.org/show_bug.cgi?id=46103
+
+ It wasn't obvious until I read the applypatch.py source code that
+ --non-interfactive implies passing --force to patch. Add --force-patch
+ as an alias to the flag, so that this behavior is more discoverable.
+
+ * Scripts/webkitpy/tool/steps/applypatch.py:
+ * Scripts/webkitpy/tool/steps/options.py:
+
+2010-09-20 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, adding a line which got dropped and is trivially correct (and tested).
+
+ commit-queue can't land patches
+ https://bugs.webkit.org/show_bug.cgi?id=46138
+
+ Add a line of code I forgot in my last commit.
+
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+
+2010-09-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ The commit-cluster bots still race to lock patch_ids
+ https://bugs.webkit.org/show_bug.cgi?id=46130
+
+ It turns out we need to use a transaction object to make the
+ read/modify/write lock operation atomic. From reading the AppEngine
+ documentation, I think this patch should do what we want. It's hard to
+ test locally because the test instance isn't distributed in the same
+ way the production instance is.
+
+ * QueueStatusServer/handlers/nextpatch.py:
+ * QueueStatusServer/model/activeworkitems.py: Added.
+
+2010-09-20 Andy Estes <aestes@apple.com>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION (HTML5 Parser): Pages broken due to <tag<tag> parsing changes
+ https://bugs.webkit.org/show_bug.cgi?id=40961
+
+ Implement WebKitUsePreHTML5ParserQuirks preference.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues): Reset WebKitUsePreHTML5ParserQuirks
+ to false after a test finishes.
+
+2010-09-20 Adam Roben <aroben@apple.com>
+
+ Windows build fix
+
+ * MiniBrowser/Configurations/MiniBrowserCommon.vsprops: Put
+ $(WebKitOutputDir)\include before $(WebKitLibrariesDir)\include so
+ we'll pick up the most recent versions of the headers.
+
+2010-09-20 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue should check commit-queue+ again just before committing
+ https://bugs.webkit.org/show_bug.cgi?id=32679
+
+ Added a _revalidate_patch check, right before landing.
+
+ Since _revalidate_patch passes the patch_id from the work item
+ back to bugzilla, I had to fix all of the previous queue tests to
+ use valid attachment ids (that's the majority of this change).
+
+ In order to validate that the bug was still open, I had to teach
+ bugzilla.Bug about open/closed states.
+
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-09-20 Mihai Parparita <mihaip@chromium.org>
+
+ Unreviewed.
+
+ Adding myself as a comitter.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-09-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Two instances of commit-queue try to process the same patch
+ https://bugs.webkit.org/show_bug.cgi?id=46113
+
+ This patch makes next-patch atomic so that the server won't vend the
+ same patch twice in the same hour.
+
+ * QueueStatusServer/handlers/nextpatch.py:
+
+2010-09-20 Adam Roben <aroben@apple.com>
+
+ Make WebKitTestRunner's wait-to-dump watchdog timer work on Windows
+
+ We were previously trying to use a CFRunLoopTimer, but since Windows
+ doesn't use CFRunLoop on most threads this doesn't work. Now we use a
+ Windows-style timer on Windows.
+
+ I also replaced all uses of "watchdog" with "watchdog timer".
+
+ Fixes <http://webkit.org/b/46101> WebKitTestRunner's wait-to-dump
+ watchdog timer doesn't work on Windows
+
+ Reviewed by Anders Carlsson.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::dump): Updated for rename.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: Removed
+ platform-specific functions.
+ (WTR::LayoutTestController::LayoutTestController): Added call to
+ platformInitialize.
+ (WTR::LayoutTestController::waitUntilDone): Changed to call
+ initializeWaitToDumpWatchdogTimerIfNeeded instead of doing the work
+ right in this function.
+ (WTR::LayoutTestController::waitToDumpWatchdogTimerFired): Updated for
+ rename.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Added new
+ members needed to support the watchdog timer abstraction. Replaced
+ some "watchdog"s with "watchdog timer".
+
+ * WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm:
+ Added.
+ (WTR::LayoutTestController::platformInitialize): Does nothing on this
+ platform.
+ (WTR::LayoutTestController::invalidateWaitToDumpWatchdog): Moved here
+ from LayoutTestController.cpp and changed to use an early return.
+ (WTR::waitUntilDoneWatchdogTimerFired): Moved here from
+ LayoutTestController.cpp.
+ (WTR::LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded):
+ Moved code here from LayoutTestController::waitUntilDone and changed
+ to use an early return.
+
+ * WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp:
+ Added.
+ (WTR::LayoutTestController::platformInitialize): Initialize our
+ watchdog timer.
+ (WTR::LayoutTestController::invalidateWaitToDumpWatchdog): Added.
+ Kills and clears the watchdog timer.
+ (WTR::waitToDumpWatchdogTimerFired): Added. Calls through to the
+ LayoutTestController member function of the same name.
+ (WTR::LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded):
+ Added. Sets up the timer if it isn't already set.
+
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: Added
+ LayoutTestControllerMac.mm.
+
+ * WebKitTestRunner/win/InjectedBundle.vcproj: Added
+ LayoutTestControllerWin.cpp.
+
+2010-09-20 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Daniel Bates.
+
+ [GTK] fast/forms/listbox-selection.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=45942
+
+ Use the gdkModifersFromJSValue helper to parse all appropriate modifier
+ strings in keyDownCallback.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (keyDownCallback): Use the gdkModifersFromJSValue instead of duplicating the
+ modifier parsing logic.
+
+2010-09-19 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 decidePolicyForNavigationAction should include mouse button information
+ <rdar://problem/8413165>
+ https://bugs.webkit.org/show_bug.cgi?id=46060
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (decidePolicyForNavigationAction):
+ (decidePolicyForNewWindowAction):
+
+2010-09-19 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Martin Robinson.
+
+ Add unit tests for diffs that delete or modify a change log entry
+ or describe changes that are far apart
+ https://bugs.webkit.org/show_bug.cgi?id=46046
+
+ Add additional unit tests to test change log diffs that contain
+ deletions or changes that are far apart from each other in the
+ ChangeLog file.
+
+ * Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl:
+ - Added the following unit tests:
+ "fixChangeLogPatch: [no change] In-place change."
+ "fixChangeLogPatch: [no change] Remove first entry."
+ "fixChangeLogPatch: [no change] Remove entry in the middle."
+ "fixChangeLogPatch: [no change] Far apart changes (i.e. more than one chunk)."
+
+2010-09-19 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Replace WKBundleRangeRef with WKBundleRangeHandleRef.
+ https://bugs.webkit.org/show_bug.cgi?id=46054
+
+ The new one acts like WKBundleNodeHandleRef and allows for getting a
+ wrapper in a specific world for the handle.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::propertyValue):
+ (WTR::propertyValueDouble):
+ (WTR::propertyValueInt):
+ (WTR::numericWindowPropertyValue):
+ (WTR::toStr):
+ (WTR::InjectedBundlePage::shouldBeginEditing):
+ (WTR::InjectedBundlePage::shouldEndEditing):
+ (WTR::InjectedBundlePage::shouldInsertNode):
+ (WTR::InjectedBundlePage::shouldInsertText):
+ (WTR::InjectedBundlePage::shouldDeleteRange):
+ (WTR::InjectedBundlePage::shouldChangeSelectedRange):
+ (WTR::InjectedBundlePage::shouldApplyStyle):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+
+2010-09-19 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed. Fix WebGL test regressions by r67809.
+
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ (WebPreferences::applyTo): Call setExperimentalWebGLEnabled().
+
+2010-09-19 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ [DRT/Chromium] Fix a WebSettings handling bug
+ https://bugs.webkit.org/show_bug.cgi?id=45945
+
+ Before this change, Chromium DRT reset WebSettings for every new
+ window. It was wrong.
+ If new window is not the first one, we have to apply the same
+ settings as the first window. So, we introduce WebPreference to
+ store the current settings, and apply it to new windows. It's same
+ as test_shell's behavior.
+
+ * DumpRenderTree/DumpRenderTree.gypi:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ Use WebPreferences instead of WebSettings.
+ (LayoutTestController::setUserStyleSheetEnabled):
+ (LayoutTestController::setUserStyleSheetLocation):
+ (LayoutTestController::setAuthorAndUserStylesEnabled):
+ (LayoutTestController::setPopupBlockingEnabled):
+ (LayoutTestController::disableImageLoading):
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+ (LayoutTestController::setXSSAuditorEnabled):
+ (LayoutTestController::setAllowUniversalAccessFromFileURLs):
+ (LayoutTestController::setAllowFileAccessFromFileURLs):
+ (LayoutTestController::overridePreference):
+ (LayoutTestController::setEditingBehavior):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::resetWebSettings): Use WebPreferences.
+ (TestShell::runFileTest): ditto.
+ (TestShell::createNewWindow): Apply existing WebPreferences to a new WebView.
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::preferences):
+ (TestShell::applyPreferences):
+ * DumpRenderTree/chromium/WebPreferences.cpp: Added.
+ * DumpRenderTree/chromium/WebPreferences.h: Added.
+
+2010-09-18 Prasad Tammana <prasadt@chromium.org>
+
+ Reviewed by David Levin.
+
+ update-webkit --chromium spitting out a spurious error
+ https://bugs.webkit.org/show_bug.cgi?id=45868
+
+ * Scripts/update-webkit-chromium: Use commandExists() function to check for existence of gclient.
+
+2010-09-18 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ Improve/unify the PageLoadClient interfaces
+ https://bugs.webkit.org/show_bug.cgi?id=46043
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (didStartProvisionalLoadForFrame):
+ (didReceiveServerRedirectForProvisionalLoadForFrame):
+ (didFailProvisionalLoadWithErrorForFrame):
+ (didCommitLoadForFrame):
+ (didFinishDocumentLoadForFrame):
+ (didFinishLoadForFrame):
+ (didFailLoadWithErrorForFrame):
+ (didReceiveTitleForFrame):
+ (didFirstLayoutForFrame):
+ (didFirstVisuallyNonEmptyLayoutForFrame):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::didStartProvisionalLoadForFrame):
+ (WTR::InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame):
+ (WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::didCommitLoadForFrame):
+ (WTR::InjectedBundlePage::didFinishLoadForFrame):
+ (WTR::InjectedBundlePage::didFinishDocumentLoadForFrame):
+ (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::didReceiveTitleForFrame):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::didReceiveMessageFromInjectedBundle):
+ (WTR::TestController::didFinishLoadForFrame):
+ * WebKitTestRunner/TestController.h:
+
+2010-09-17 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Adding a shell script I use to run the
+ commit-queue. Now that multiple machines run the cq,
+ it makes sense to share the script between them.
+
+ * EWSTools/start-commit-queue.sh: Added.
+
+2010-09-17 Brian Weinstein <bweinstein@apple.com>
+
+ Reviewed by Jon Honeycutt.
+
+ The colors on the new build.webkit.org (after upgrading the master to 0.8.1) are
+ slightly harder to read, so this reverts the previous background colors for various
+ states, making it easier to read.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/default.css:
+ (.success):
+ (.failure):
+ (.warnings):
+ (.exception):
+ (.start,.running,td.building):
+ (.offline,td.offline):
+
+2010-09-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r67692.
+ http://trac.webkit.org/changeset/67692
+ https://bugs.webkit.org/show_bug.cgi?id=46011
+
+ broke layout test dashboard (Requested by johnny_g on
+ #webkit).
+
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-09-17 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Oliver Hunt.
+
+ Style bot complains about cairo forward declaration naming
+ https://bugs.webkit.org/show_bug.cgi?id=45867
+
+ Exclude Cairo forward declarations from indentifiers with underscores checks.
+
+ * Scripts/webkitpy/style/checkers/cpp.py: Add exclusion for Cairo forward-declarations.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py: Add some tests for this.
+
+2010-09-16 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Include detailed test modifiers (e.g. FLAKY) in results.json for failing non-layout tests
+ https://bugs.webkit.org/show_bug.cgi?id=45408
+
+ This change also tries to remove duplicated upload_results_json methods
+ in run_webkit_tests.py and json_results_generator.py.
+
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-09-16 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] When switching views (WebViewGraphicsBased <--> WebViewTraditional), QWebPage signals and QActions have to be re-set.
+
+ Recently r67554 changed the way different views use the WebPage class: it was previously being shared between
+ different views, but now for each view switch, a new WebPage class is constructed and set. Signals and QAction's
+ were not being set to the new WebPage though. Patch fix that, by re constructing the toolbar, and then re-hooking
+ all page specific stuff to the UI.
+
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::initializeView):
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::MainWindow):
+ (MainWindow::buildUI):
+ (MainWindow::setPage):
+ * QtTestBrowser/mainwindow.h:
+
+2010-09-12 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ Make all accesses to m_item (GraphicsWebView) done by WebViewGraphicsBased class happen though graphicsWebView getter method.
+
+ This patch is mostly a preparation for another commit, where the ownership of the m_item/GraphicsWebView
+ object will move to the qgraphicsscene instead of the qgraphicsview.
+
+ * QtTestBrowser/webview.cpp:
+ (WebViewGraphicsBased::setPage):
+ (WebViewGraphicsBased::setResizesToContents):
+ (WebViewGraphicsBased::resizeEvent):
+ (WebViewGraphicsBased::animatedFlip):
+ * QtTestBrowser/webview.h:
+ (WebViewGraphicsBased::setItemCacheMode):
+ (WebViewGraphicsBased::itemCacheMode):
+
+2010-09-12 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ Moved setYRotation method body out of the class (WebViewGraphicsBased) definition.
+
+ We usually separate methods whose body are larger than a few lines from the class definition.
+
+ * QtTestBrowser/webview.h:
+ (WebViewGraphicsBased::yRotation):
+ (WebViewGraphicsBased::setYRotation):
+
+2010-09-12 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ Make initializeView method of LauncherWindow private.
+
+ No one else needs to be able to call it but LauncherWindow.
+ Also moving the declation of isGraphicsBased method down in the same file, in order
+ to better group related methods.
+
+ * QtTestBrowser/launcherwindow.h:
+
+2010-09-12 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ Make the getter 'page' method of MainWindow const.
+
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::page):
+ * QtTestBrowser/mainwindow.h:
+
+2010-09-12 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ Remove useless parameter from MainWindow class' constructor.
+
+ The parameter defaults to an empty URL and is not being used by any caller. Apart from that it is also
+ not referred in the constructor body and does not make much sense.
+
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::MainWindow):
+ * QtTestBrowser/mainwindow.h:
+
+2010-09-15 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [Chromium] Needs DRT queueLoadHTMLString and setDeferMainResourceLoad-implementations
+ https://bugs.webkit.org/show_bug.cgi?id=42151
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (WorkItemLoadHTMLString::WorkItemLoadHTMLString):
+ (WorkItemLoadHTMLString::run):
+ (LayoutTestController::queueLoadHTMLString):
+ (LayoutTestController::reset):
+ (LayoutTestController::setDeferMainResourceDataLoad):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ (LayoutTestController::deferMainResourceDataLoad):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::didCreateDataSource):
+
+2010-09-16 Adrienne Walker <enne@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add script to synchronize WebKit and Khronos WebGL tests
+ https://bugs.webkit.org/show_bug.cgi?id=42336
+
+ * Scripts/update-webgl-conformance-tests: Added.
+ * Scripts/webkitpy/layout_tests/update_webgl_conformance_tests.py: Added.
+ * Scripts/webkitpy/layout_tests/update_webgl_conformance_tests_unittest.py: Added.
+
+2010-09-16 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Add support for sending synchronous messages from the InjectedBundle to the WKContext
+ <rdar://problem/8365320>
+ https://bugs.webkit.org/show_bug.cgi?id=44785
+
+ * MiniBrowser/mac/AppDelegate.m:
+ (didReceiveSynchronousMessageFromInjectedBundle):
+ (-[BrowserAppDelegate init]):
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (didCreatePage):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
+
+2010-09-16 Leonid Ebril <leonid.ebril@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] QtTestBrowser: Disable creation of a new window for screenshot on Symbian platform.
+ https://bugs.webkit.org/show_bug.cgi?id=45885
+
+ Avoid creation of an additional window for screenshot to prevent overlapping with original window.
+
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::screenshot):
+
+2010-09-16 Anders Carlsson <andersca@apple.com>
+
+ Fix clang++ build.
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController zoomIn:]):
+ (-[BrowserWindowController zoomOut:]):
+ (-[BrowserWindowController resetZoom:]):
+ Remove trailing semicolons.
+
+2010-09-16 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r67628.
+ http://trac.webkit.org/changeset/67628
+ https://bugs.webkit.org/show_bug.cgi?id=45904
+
+ broke the build (Requested by eric_carlson on #webkit).
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (contextClickCallback):
+
+2010-09-16 Balazs Kelemen <kbalazs@webkit.org>
+
+ Unreviewed.
+
+ Adding myself as a comitter.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-09-15 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] enhanced context menu for media elements
+ https://bugs.webkit.org/show_bug.cgi?id=45021
+
+ EventSender::contextClick() now returns an array of js
+ objects. Each object has a title property and a click() method.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (getMenuItemTitleCallback):
+ (setMenuItemTitleCallback):
+ (menuItemClickCallback):
+ (getMenuItemClass):
+ (contextClickCallback):
+
+2010-09-14 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Eric Carlson and Martin Robinson.
+
+ [GTK] eventSender.contextClick() should return the contents of the context menu
+ https://bugs.webkit.org/show_bug.cgi?id=39102
+
+ Make the eventSender use the new private WebKitGtk+ API to
+ retrieve the context-menu item titles and store them in an array.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (contextClickCallback):
+
+2010-09-16 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by Jian Li.
+
+ Unify FILE_SYSTEM and FILE_WRITER enables under the name FILE_SYSTEM.
+ https://bugs.webkit.org/show_bug.cgi?id=45798
+
+ * Scripts/build-webkit:
+
+2010-09-16 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Support globalhistory tests
+ https://bugs.webkit.org/show_bug.cgi?id=45774
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::isGlobalHistoryTest):
+ (WebCore::DumpRenderTree::open):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::dumpHistoryCallbacks):
+ (LayoutTestController::removeAllVisitedLinks):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-09-10 Tony Chang <tony@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ deduplicate-tests should be runnable from any WebKit directory
+ https://bugs.webkit.org/show_bug.cgi?id=44709
+
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
+
+2010-09-15 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] sort testing methods in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=45850
+
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::EventSender):
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::TextInputController):
+
+2010-09-15 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ CQ status shows items out of order
+ https://bugs.webkit.org/show_bug.cgi?id=45846
+
+ Only group consecutive status items with the same patch ID into the same
+ group, so that overall item ordering is preserved.
+
+ Also don't indent status items that only have a single item in their
+ group.
+
+ * QueueStatusServer/handlers/queuestatus.py:
+ * QueueStatusServer/templates/includes/singlequeuestatus.html: Added.
+ * QueueStatusServer/templates/queuestatus.html:
+
+2010-09-15 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add queue start/stop messages
+ https://bugs.webkit.org/show_bug.cgi?id=45853
+
+ I ended up needing to clean up a bunch of our unit testing
+ in order to test this new code path nicely.
+
+ There are also a few PEP8 changes needed to pass check-webkit-style.
+
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+
+2010-09-15 Simon Fraser <simon.fraser@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=45849
+ WKURLCreateWithCFURL crashes with null url
+
+ Fix MiniBrowser crash when the url is not parseable.
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController fetch:]):
+
+2010-09-15 Patrick Gansterer <paroga@paroga.com>
+
+ Unreviewed.
+
+ Adding myself to the committers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-09-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Make it possible to run more than one commit-queue instance
+ https://bugs.webkit.org/show_bug.cgi?id=45786
+
+ Mostly we need to make sure the two (or more) instances get
+ different patches to work on. To do this, I re-worked
+ the code responsible for getting the next work item to
+ round trip through the status server. The status server only
+ vends patches from the work items list, only if those patches
+ have not had status reported for them in the last hour.
+
+ This is another step towards making all queues go through the
+ status server, thus making it possible to run more than one
+ instance of various EWS bots (as requested in bug 44292).
+
+ The webkitpy changes are already covered by existing unit tests.
+ The QueueStatusSever sadly has no testing infrastructure yet. :(
+
+ * QueueStatusServer/handlers/nextpatch.py: Added.
+ * QueueStatusServer/index.yaml:
+ * QueueStatusServer/main.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-09-15 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ NRWT fails with UnicodeDecodeError on editing/selection/mixed-editability-10.html
+ https://bugs.webkit.org/show_bug.cgi?id=45791
+
+ Force filenames to be raw bytes before running difflib.unified_diff.
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+
+2010-09-15 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] QtTestBrowser crashes when enabling QGraphicsView mode after first loading page without it enabled
+ https://bugs.webkit.org/show_bug.cgi?id=35247
+
+ The main issue when changing the views is that the plugins and any other components that
+ depend on view specific attributes such as the native window id are not teared down.
+ Even if we had a tear-down procedure, we'd have to re-initialize the plugin after
+ switching to the new view (QGraphicsWebView). This is a rather uncommon situation, so
+ we decided to work around this in QtTestBrowser by making toggling between QWebView
+ and QGraphicsWebView also re-create the page.
+
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::initializeView):
+ * QtTestBrowser/mainwindow.h:
+
+2010-09-14 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Send webkit accessibility notifications to Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45156
+
+ Move printf inside shouldDumpAccessibilityNotifications check.
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::postAccessibilityNotification):
+
+2010-09-14 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] fix http/tests/security/local-user-CSS-from-remote.html
+ https://bugs.webkit.org/show_bug.cgi?id=45788
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setUserStyleSheetLocation): use a base64 url like in Chrome
+
+2010-09-14 Tony Chang <tony@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ [chromium] Remove WebKit::areLayoutTestImagesOpaque since it's no longer needed
+ https://bugs.webkit.org/show_bug.cgi?id=45768
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::dumpImage): new baselines are checked in and Linux will match Windows going forward.
+
+2010-09-14 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, add newly added directories to the directory list.
+
+ * wx/build/settings.py:
+
+2010-09-14 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Remove WKBundleNodeRef, replacing uses with WKBundleNodeHandleRef.
+ https://bugs.webkit.org/show_bug.cgi?id=45785
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::propertyValue):
+ (WTR::numericWindowPropertyValue):
+ (WTR::dumpPath):
+ (WTR::toStr):
+ (WTR::operator<<):
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::shouldInsertNode):
+ (WTR::InjectedBundlePage::shouldBeginEditing):
+ (WTR::InjectedBundlePage::shouldEndEditing):
+ (WTR::InjectedBundlePage::shouldInsertText):
+ (WTR::InjectedBundlePage::shouldDeleteRange):
+ (WTR::InjectedBundlePage::shouldChangeSelectedRange):
+ (WTR::InjectedBundlePage::shouldApplyStyle):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+
+2010-09-14 Adam Barth <abarth@webkit.org>
+
+ Fix two typos in commit-queue. The first is harmless. The second
+ causes the queue to reject patches when the build is broken. :(
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-09-14 Chris Guillory <chris.guillory@google.com>
+
+ Reviewed by Chris Fleizach.
+
+ Send all accessibility notifications to Chromium.
+ https://bugs.webkit.org/show_bug.cgi?id=45156
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::postAccessibilityNotification):
+ * DumpRenderTree/chromium/WebViewHost.h:
+
+2010-09-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ commit-queue is slow during the day
+ https://bugs.webkit.org/show_bug.cgi?id=45780
+
+ Thanks to the new logging, we've noticed that checkout-is-out-of-date
+ errors in the first pass of landing don't retry the land. Instead,
+ they're treated as failures and cause the commit-queue to do two more
+ builds before really trying to land the patch. Worse, in the second
+ build, we can get bitten by a flaky test.
+
+ This patch takes a slightly different approach to the commit-queue's
+ main control logic. We now use a separate subprocess for building and
+ testing and for landing. This means we should very rarely see the
+ checkout-is-out-of-date error, and when we do see it, we should retry
+ more quickly. If my understanding is correct, this should be a big
+ speed win for the commit-queue.
+
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-09-14 Tony Chang <tony@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] implement layoutTestController.setDomainRelaxationForbiddenForURLScheme
+ https://bugs.webkit.org/show_bug.cgi?id=45762
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+
+2010-09-14 Csaba Osztrogonác <ossy@webkit.org>
+
+ Adding myself as a reviewer.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-09-14 Zoltan Horvath <zoltan@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Build-webkit shows a warning when WebKitBuild directory is not exist
+ https://bugs.webkit.org/show_bug.cgi?id=45736
+
+ Build-webkit has showed a warning when WebKitBuild didn't exist, add
+ an additional condition to avoid it.
+
+ * Scripts/build-webkit:
+
+2010-09-13 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue should log when it's retrying due to checkout out of date error
+ https://bugs.webkit.org/show_bug.cgi?id=45725
+
+ This will allow us to better track how often we see these errors
+ and how long it takes the queue to recover from them.
+
+ In order to pass the tests, I had to correct an error
+ from a previous change. The UnitTestPort should not have
+ ever been using the base port method as that will read
+ a file from disk. If the unit tests haven't passed the contents
+ it should raise an IOError as though the file doesn't exist.
+
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-09-13 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Upload results when cq patch landing fails
+ https://bugs.webkit.org/show_bug.cgi?id=45683
+
+ Include script errors when CommitQueue._land fails.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-09-13 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by David Kilzer.
+
+ AX: accessibilityIsIgnored is returning nil when return value expects a BOOL
+ https://bugs.webkit.org/show_bug.cgi?id=45548
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (isIgnoredCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::isIgnored):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::isIgnored):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::isIgnored):
+
+2010-09-13 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ jscPath() is incorrect in Windows' cmd.exe shell
+ https://bugs.webkit.org/show_bug.cgi?id=45651
+
+ * Scripts/webkitdirs.pm: Add ".exe" suffix to $jscName on Windows.
+
+2010-09-13 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r64816-r64889): Crash in WebCore::AccessibilityRenderObject
+ https://bugs.webkit.org/show_bug.cgi?id=43807
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (textMarkerForPointCallback):
+ (AccessibilityUIElement::textMarkerForPoint):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::textMarkerForPoint):
+
+2010-09-13 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] build-webkit: Add --v8 option to build against V8
+
+ Note that V8 is picked up from QtScript, so this currently requires building
+ against the experimental qt-script-v8 branch.
+
+ * Scripts/build-webkit:
+
+2010-09-13 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Add WebDeviceOrientationClientMock::create() and use it from DRT.
+ https://bugs.webkit.org/show_bug.cgi?id=45650
+
+ Do not use the WebDeviceOrientationClientMock constructor directly,
+ but use the create() member function.
+
+ This should fix the linker errors for the multi-DLL Chromium DRT build.
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockDeviceOrientation):
+ (LayoutTestController::deviceOrientationClient):
+
+2010-08-27 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
+
+ Reviewed by Antti Koivisto.
+
+ Add support for testing the viewport meta tag algorithm,
+ based on the following draft spec:
+
+ http://people.opera.com/rune/TR/ED-css-viewport-20100806/
+
+ Add common handling of viewport meta tag based on new Opera spec
+ https://bugs.webkit.org/show_bug.cgi?id=44201
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::dumpConfigurationForViewport):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-09-12 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ [DRT/Chromium] Remove dependency to base/string16.h and gfx/codec/png_codec.h
+ https://bugs.webkit.org/show_bug.cgi?id=45517
+
+ Use webkit_support_gfx.h for PNG encoding/decoding instead of png_codec.h
+
+ * DumpRenderTree/chromium/ImageDiff.cpp:
+ (Image::craeteFromStdin):
+ (Image::createFromFilename):
+ (diffImages):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::dumpImage):
+
+2010-09-10 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Tony Chang.
+
+ [Chromium] Implement textInputController.hasSpellingMarker() for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45441
+
+ Added TextInputController::hasSpellingMarker().
+
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::TextInputController):
+ (TextInputController::hasSpellingMarker):
+ * DumpRenderTree/chromium/TextInputController.h:
+
+2010-09-12 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ My last change accidentally contained a local change to the
+ rebaselinig script; webkit-patch land picked it up without telling
+ me and committed it :(
+
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-09-11 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Attempt to fix Windows MiniBrowser build (untested)
+ https://bugs.webkit.org/show_bug.cgi?id=45609
+
+ * MiniBrowser/win/BrowserView.cpp:
+ (runJavaScriptConfirm):
+ (runJavaScriptPrompt):
+
+2010-09-11 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Fix zoom related tests when testing WebKit2.
+
+ * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
+ (WTR::EventSendingController::zoomPageIn): Zoom in and zoom out are not the same.
+
+2010-09-11 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ Implement WebKit2 callback equivalent to - [WebUIDelegate webView:setStatusText:]
+ <rdar://problem/8359252>
+ https://bugs.webkit.org/show_bug.cgi?id=45605
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (setStatusText):
+ (contentsSizeChanged):
+ (-[BrowserWindowController awakeFromNib]):
+ * MiniBrowser/win/BrowserView.cpp:
+ (runJavaScriptConfirm):
+ (runJavaScriptPrompt):
+ (setStatusText):
+ (contentsSizeChanged):
+ (BrowserView::create):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
+
+2010-09-11 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ Add callback mechanism for the getting the source of a frame
+ <rdar://problem/8364681>
+ https://bugs.webkit.org/show_bug.cgi?id=45604
+
+ Add ability to dump the main frame's source to the console.
+
+ * MiniBrowser/mac/BrowserWindowController.h:
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController dumpSourceToConsole:]):
+ * MiniBrowser/mac/MainMenu.xib:
+
+2010-09-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Remove unneeded Empty Queue messages
+ https://bugs.webkit.org/show_bug.cgi?id=45602
+
+ We already have a /gc job to delete these.
+ recentstatus.py is already smart enough to use the
+ most recent of the workitems last update or the most recent status,
+ so removing these should not change the _last_status_date() return
+ value more than a few milliseconds.
+
+ These messages just spam the recent status log.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-09-11 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Fix Python exception when generating synthetic patch IDs
+ https://bugs.webkit.org/show_bug.cgi?id=45592
+
+ Can't concatenate strings and numbers directly.
+
+ * QueueStatusServer/handlers/queuestatus.py:
+
+2010-09-11 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Group statuses in queue status by patch ID
+ https://bugs.webkit.org/show_bug.cgi?id=45588
+
+ Group statuses by patch ID so that the status page is easier
+ to scan.
+
+ * QueueStatusServer/handlers/queuestatus.py:
+ * QueueStatusServer/stylesheets/dashboard.css:
+ (.status-group):
+ (.status-bug):
+ (.status-group ul):
+ (.status-group ul li):
+ (.status-group ul li:hover):
+ (.status-cell):
+ (.status-cell:hover):
+ (.status-cell.pass):
+ (.status-cell.fail):
+ (.status-cell.pending):
+ (.status-cell.error):
+ * QueueStatusServer/templates/dashboard.html:
+ * QueueStatusServer/templates/queuestatus.html:
+
+2010-09-11 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Implement layoutTestController.dumpResourceResponseMIMETypes in Chromium DRT
+ https://bugs.webkit.org/show_bug.cgi?id=45479
+
+ Implement layoutTestController.dumpResourceResponseMIMETypes (modelled after
+ implementation in ResourceLoadDelegate in the Mac port).
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::dumpResourceResponseMIMETypes):
+ (LayoutTestController::reset):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ (LayoutTestController::setShouldDumpResourceResponseMIMETypes):
+ (LayoutTestController::shouldDumpResourceResponseMIMETypes):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::shouldDumpResourceResponseMIMETypes):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::didReceiveResponse):
+
+2010-09-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ queues.webkit.org should expose /remote_api for data upload/download
+ https://bugs.webkit.org/show_bug.cgi?id=45559
+
+ * QueueStatusServer/app.yaml:
+ - /remote_api is a standard app-engine service which allows use of
+ the bulk uploader for data upload/download. Exposing this
+ (for admin access only) allows us to use
+
+2010-09-10 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ Add zoom support to WebKit2 API
+ <rdar://problem/7660657>
+ https://bugs.webkit.org/show_bug.cgi?id=45585
+
+ - Add zoom options to MiniBrowser that mimic Safari's options using
+ the new WebKit2 zoom APIs.
+ - Switch uses of float for the zoom APIs to use double.
+
+ * MiniBrowser/mac/BrowserWindowController.h:
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController initWithPageNamespace:]):
+ (-[BrowserWindowController validateMenuItem:]):
+ (-[BrowserWindowController validateUserInterfaceItem:]):
+ (-[BrowserWindowController currentZoomFactor]):
+ (-[BrowserWindowController setCurrentZoomFactor:]):
+ (-[BrowserWindowController canZoomIn]):
+ (-[BrowserWindowController zoomIn:]):
+ (-[BrowserWindowController canZoomOut]):
+ (-[BrowserWindowController zoomOut:]):
+ (-[BrowserWindowController canResetZoom]):
+ (-[BrowserWindowController resetZoom:]):
+ (-[BrowserWindowController toggleZoomMode:]):
+ * MiniBrowser/mac/MainMenu.xib:
+ * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
+ (WTR::EventSendingController::textZoomIn):
+ (WTR::EventSendingController::textZoomOut):
+ (WTR::EventSendingController::zoomPageIn):
+ (WTR::EventSendingController::zoomPageOut):
+
+2010-09-10 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Fix crash in DRT in standalone mode
+
+ https://bugs.webkit.org/show_bug.cgi?id=45454
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::loadNextTestInStandAloneMode):
+
+2010-09-10 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove unnecessary constraint in WebCore of choosing either text zoom or full page zoom.
+ Precursor to <rdar://problem/7660657>
+ https://bugs.webkit.org/show_bug.cgi?id=45522
+
+ Update for changes to the Bundle API to allow separate control of page and text zoom
+ levels.
+
+ * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
+ (WTR::EventSendingController::textZoomIn):
+ (WTR::EventSendingController::textZoomOut):
+ (WTR::EventSendingController::zoomPageIn):
+ (WTR::EventSendingController::zoomPageOut):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::reset):
+
+2010-09-10 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Support click event for notifications
+ https://bugs.webkit.org/show_bug.cgi?id=44836
+
+ Add support for simulateDesktopNotificationClick by calling
+ back to DumpRenderTreeSupportQt.cpp.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::simulateDesktopNotificationClick):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-09-10 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Update queue status when patches fail their first land attempt
+ https://bugs.webkit.org/show_bug.cgi?id=45583
+
+ Add a few more _update_status calls to make it more obvious if a patch is
+ being retried because tests failed.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-09-10 Balazs Kelemen <kb@inf.u-szeged.hu>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] MiniBrowser crashes with multiply windows when closing one of them
+ https://bugs.webkit.org/show_bug.cgi?id=45536
+
+ * MiniBrowser/qt/BrowserView.cpp:
+ (BrowserView::BrowserView): Reference the context instead of adopting it
+ because it can be shared across different views.
+
+2010-09-10 Tony Chang <tony@chromium.org>
+
+ Unreviewed, rolling out r67241.
+ http://trac.webkit.org/changeset/67241
+ https://bugs.webkit.org/show_bug.cgi?id=44709
+
+ Accidentally committed.
+
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
+
+2010-09-10 Tony Chang <tony@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ deduplicate-tests should be runnable from any WebKit directory
+ https://bugs.webkit.org/show_bug.cgi?id=44709
+
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
+
+2010-09-10 Tony Chang <tony@chromium.org>
+
+ Unreviewed, rolling out r67216.
+ http://trac.webkit.org/changeset/67216
+ https://bugs.webkit.org/show_bug.cgi?id=44709
+
+ Broke
+
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
+
+2010-09-10 Tony Chang <tony@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ deduplicate-tests should be runnable from any WebKit directory
+ https://bugs.webkit.org/show_bug.cgi?id=44709
+
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
+
2010-09-09 Hans Wennborg <hans@chromium.org>
Reviewed by Jeremy Orlow.
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
index 22bbbaa..13c642a 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
@@ -424,6 +424,18 @@ static JSValueRef textMarkerRangeLengthCallback(JSContextRef context, JSObjectRe
return JSValueMakeNumber(context, (int)toAXElement(thisObject)->textMarkerRangeLength(range));
}
+static JSValueRef textMarkerForPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int x = 0;
+ int y = 0;
+ if (argumentCount == 2) {
+ x = JSValueToNumber(context, arguments[0], exception);
+ y = JSValueToNumber(context, arguments[1], exception);
+ }
+
+ return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->textMarkerForPoint(x, y));
+}
+
static JSValueRef textMarkerRangeForMarkersCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
AccessibilityTextMarker* startMarker = 0;
@@ -662,6 +674,11 @@ static JSValueRef getIsCollapsedCallback(JSContextRef context, JSObjectRef thisO
return JSValueMakeBoolean(context, toAXElement(thisObject)->isCollapsed());
}
+static JSValueRef isIgnoredCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
+{
+ return JSValueMakeBoolean(context, toAXElement(thisObject)->isIgnored());
+}
+
static JSValueRef getHasPopupCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
{
return JSValueMakeBoolean(context, toAXElement(thisObject)->hasPopup());
@@ -752,6 +769,11 @@ AccessibilityUIElement AccessibilityUIElement::accessibilityElementForTextMarker
return 0;
}
+AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y)
+{
+ return 0;
+}
+
#endif
// Destruction
@@ -814,6 +836,7 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "orientation", getOrientationCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "ariaIsGrabbed", getARIAIsGrabbedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "ariaDropEffects", getARIADropEffectsCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "isIgnored", isIgnoredCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0, 0 }
};
@@ -872,6 +895,7 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "endTextMarkerForTextMarkerRange", endTextMarkerForTextMarkerRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "accessibilityElementForTextMarker", accessibilityElementForTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "textMarkerRangeLength", textMarkerRangeLengthCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "textMarkerForPoint", textMarkerForPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0 }
};
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
index 2606795..5170f20 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
@@ -138,6 +138,7 @@ public:
bool isVisible() const;
bool isOffScreen() const;
bool isCollapsed() const;
+ bool isIgnored() const;
bool hasPopup() const;
int hierarchicalLevel() const;
double clickPointX();
@@ -189,6 +190,7 @@ public:
AccessibilityTextMarkerRange textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker);
AccessibilityTextMarker startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
AccessibilityTextMarker endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
+ AccessibilityTextMarker textMarkerForPoint(int x, int y);
AccessibilityUIElement accessibilityElementForTextMarker(AccessibilityTextMarker*);
int textMarkerRangeLength(AccessibilityTextMarkerRange*);
diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.gypi b/WebKitTools/DumpRenderTree/DumpRenderTree.gypi
index b39fd2a..58ccaae 100644
--- a/WebKitTools/DumpRenderTree/DumpRenderTree.gypi
+++ b/WebKitTools/DumpRenderTree/DumpRenderTree.gypi
@@ -39,6 +39,8 @@
'chromium/TestShellWin.cpp',
'chromium/TextInputController.cpp',
'chromium/TextInputController.h',
+ 'chromium/WebPreferences.cpp',
+ 'chromium/WebPreferences.h',
'chromium/WebViewHost.cpp',
'chromium/WebViewHost.h',
],
diff --git a/WebKitTools/DumpRenderTree/chromium/EventSender.cpp b/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
index c2ba380..5f51553 100644
--- a/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
@@ -250,34 +250,34 @@ EventSender::EventSender(TestShell* shell)
// they will use when called by JavaScript. The actual binding of those
// names to their methods will be done by calling bindToJavaScript() (defined
// by CppBoundClass, the parent to EventSender).
- bindMethod("mouseDown", &EventSender::mouseDown);
- bindMethod("mouseUp", &EventSender::mouseUp);
+ bindMethod("addTouchPoint", &EventSender::addTouchPoint);
+ bindMethod("beginDragWithFiles", &EventSender::beginDragWithFiles);
+ bindMethod("cancelTouchPoint", &EventSender::cancelTouchPoint);
+ bindMethod("clearKillRing", &EventSender::clearKillRing);
+ bindMethod("clearTouchPoints", &EventSender::clearTouchPoints);
bindMethod("contextClick", &EventSender::contextClick);
- bindMethod("mouseMoveTo", &EventSender::mouseMoveTo);
- bindMethod("leapForward", &EventSender::leapForward);
- bindMethod("keyDown", &EventSender::keyDown);
+ bindMethod("continuousMouseScrollBy", &EventSender::continuousMouseScrollBy);
bindMethod("dispatchMessage", &EventSender::dispatchMessage);
bindMethod("enableDOMUIEventLogging", &EventSender::enableDOMUIEventLogging);
bindMethod("fireKeyboardEventsToElement", &EventSender::fireKeyboardEventsToElement);
- bindMethod("clearKillRing", &EventSender::clearKillRing);
- bindMethod("textZoomIn", &EventSender::textZoomIn);
- bindMethod("textZoomOut", &EventSender::textZoomOut);
- bindMethod("zoomPageIn", &EventSender::zoomPageIn);
- bindMethod("zoomPageOut", &EventSender::zoomPageOut);
+ bindMethod("keyDown", &EventSender::keyDown);
+ bindMethod("leapForward", &EventSender::leapForward);
+ bindMethod("mouseDown", &EventSender::mouseDown);
+ bindMethod("mouseMoveTo", &EventSender::mouseMoveTo);
bindMethod("mouseScrollBy", &EventSender::mouseScrollBy);
- bindMethod("continuousMouseScrollBy", &EventSender::continuousMouseScrollBy);
- bindMethod("scheduleAsynchronousClick", &EventSender::scheduleAsynchronousClick);
- bindMethod("beginDragWithFiles", &EventSender::beginDragWithFiles);
- bindMethod("addTouchPoint", &EventSender::addTouchPoint);
- bindMethod("cancelTouchPoint", &EventSender::cancelTouchPoint);
- bindMethod("clearTouchPoints", &EventSender::clearTouchPoints);
+ bindMethod("mouseUp", &EventSender::mouseUp);
bindMethod("releaseTouchPoint", &EventSender::releaseTouchPoint);
- bindMethod("updateTouchPoint", &EventSender::updateTouchPoint);
+ bindMethod("scheduleAsynchronousClick", &EventSender::scheduleAsynchronousClick);
bindMethod("setTouchModifier", &EventSender::setTouchModifier);
+ bindMethod("textZoomIn", &EventSender::textZoomIn);
+ bindMethod("textZoomOut", &EventSender::textZoomOut);
bindMethod("touchCancel", &EventSender::touchCancel);
bindMethod("touchEnd", &EventSender::touchEnd);
bindMethod("touchMove", &EventSender::touchMove);
bindMethod("touchStart", &EventSender::touchStart);
+ bindMethod("updateTouchPoint", &EventSender::updateTouchPoint);
+ bindMethod("zoomPageIn", &EventSender::zoomPageIn);
+ bindMethod("zoomPageOut", &EventSender::zoomPageOut);
// When set to true (the default value), we batch mouse move and mouse up
// events so we can simulate drag & drop.
diff --git a/WebKitTools/DumpRenderTree/chromium/ImageDiff.cpp b/WebKitTools/DumpRenderTree/chromium/ImageDiff.cpp
index d1adc3d..f2875dd 100644
--- a/WebKitTools/DumpRenderTree/chromium/ImageDiff.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/ImageDiff.cpp
@@ -36,7 +36,7 @@
#include "config.h"
-#include "gfx/codec/png_codec.h"
+#include "webkit/support/webkit_support_gfx.h"
#include <algorithm>
#include <stdio.h>
#include <string.h>
@@ -49,7 +49,6 @@
#define PATH_MAX MAX_PATH
#endif
-using namespace gfx;
using namespace std;
// Causes the app to remain open, waiting for pairs of filenames on stdin.
@@ -93,8 +92,7 @@ public:
if (fread(source.get(), 1, byteLength, stdin) != byteLength)
return false;
- if (!PNGCodec::Decode(source.get(), byteLength, PNGCodec::FORMAT_RGBA,
- &m_data, &m_width, &m_height)) {
+ if (!webkit_support::DecodePNG(source.get(), byteLength, &m_data, &m_width, &m_height)) {
clear();
return false;
}
@@ -118,8 +116,7 @@ public:
fclose(f);
- if (!PNGCodec::Decode(&compressed[0], compressed.size(),
- PNGCodec::FORMAT_RGBA, &m_data, &m_width, &m_height)) {
+ if (!webkit_support::DecodePNG(&compressed[0], compressed.size(), &m_data, &m_width, &m_height)) {
clear();
return false;
}
@@ -353,8 +350,8 @@ int diffImages(const char* file1, const char* file2, const char* outFile)
return statusSame;
vector<unsigned char> pngData;
- PNGCodec::Encode(diffImage.data(), PNGCodec::FORMAT_RGBA, diffImage.width(),
- diffImage.height(), diffImage.width() * 4, false, &pngData);
+ webkit_support::EncodeRGBAPNG(diffImage.data(), diffImage.width(), diffImage.height(),
+ diffImage.width() * 4, &pngData);
if (!writeFile(outFile, &pngData.front(), pngData.size()))
return statusError;
return statusDifferent;
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
index 6f962bf..2c6c600 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -38,6 +38,7 @@
#include "public/WebAnimationController.h"
#include "public/WebBindings.h"
#include "public/WebConsoleMessage.h"
+#include "public/WebData.h"
#include "public/WebDeviceOrientation.h"
#include "public/WebDeviceOrientationClientMock.h"
#include "public/WebDocument.h"
@@ -77,113 +78,112 @@ LayoutTestController::LayoutTestController(TestShell* shell)
// they will use when called by JavaScript. The actual binding of those
// names to their methods will be done by calling bindToJavaScript() (defined
// by CppBoundClass, the parent to LayoutTestController).
+ bindMethod("addFileToPasteboardOnDrag", &LayoutTestController::addFileToPasteboardOnDrag);
+ bindMethod("addOriginAccessWhitelistEntry", &LayoutTestController::addOriginAccessWhitelistEntry);
+ bindMethod("addUserScript", &LayoutTestController::addUserScript);
+ bindMethod("addUserStyleSheet", &LayoutTestController::addUserStyleSheet);
+ bindMethod("clearAllDatabases", &LayoutTestController::clearAllDatabases);
+ bindMethod("closeWebInspector", &LayoutTestController::closeWebInspector);
+ bindMethod("counterValueForElementById", &LayoutTestController::counterValueForElementById);
+ bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading);
+ bindMethod("display", &LayoutTestController::display);
bindMethod("dumpAsText", &LayoutTestController::dumpAsText);
- bindMethod("dumpChildFrameScrollPositions", &LayoutTestController::dumpChildFrameScrollPositions);
+ bindMethod("dumpBackForwardList", &LayoutTestController::dumpBackForwardList);
bindMethod("dumpChildFramesAsText", &LayoutTestController::dumpChildFramesAsText);
+ bindMethod("dumpChildFrameScrollPositions", &LayoutTestController::dumpChildFrameScrollPositions);
bindMethod("dumpDatabaseCallbacks", &LayoutTestController::dumpDatabaseCallbacks);
bindMethod("dumpEditingCallbacks", &LayoutTestController::dumpEditingCallbacks);
- bindMethod("dumpBackForwardList", &LayoutTestController::dumpBackForwardList);
bindMethod("dumpFrameLoadCallbacks", &LayoutTestController::dumpFrameLoadCallbacks);
bindMethod("dumpResourceLoadCallbacks", &LayoutTestController::dumpResourceLoadCallbacks);
+ bindMethod("dumpResourceResponseMIMETypes", &LayoutTestController::dumpResourceResponseMIMETypes);
+ bindMethod("dumpSelectionRect", &LayoutTestController::dumpSelectionRect);
bindMethod("dumpStatusCallbacks", &LayoutTestController::dumpWindowStatusChanges);
bindMethod("dumpTitleChanges", &LayoutTestController::dumpTitleChanges);
- bindMethod("setAcceptsEditing", &LayoutTestController::setAcceptsEditing);
- bindMethod("waitUntilDone", &LayoutTestController::waitUntilDone);
+ bindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId);
+ bindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspector);
+ bindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld);
+ bindMethod("execCommand", &LayoutTestController::execCommand);
+ bindMethod("forceRedSelectionColors", &LayoutTestController::forceRedSelectionColors);
+ bindMethod("grantDesktopNotificationPermission", &LayoutTestController::grantDesktopNotificationPermission);
+ bindMethod("isCommandEnabled", &LayoutTestController::isCommandEnabled);
+ bindMethod("markerTextForListItem", &LayoutTestController::markerTextForListItem);
bindMethod("notifyDone", &LayoutTestController::notifyDone);
- bindMethod("queueReload", &LayoutTestController::queueReload);
- bindMethod("queueLoadingScript", &LayoutTestController::queueLoadingScript);
- bindMethod("queueNonLoadingScript", &LayoutTestController::queueNonLoadingScript);
- bindMethod("queueLoad", &LayoutTestController::queueLoad);
- bindMethod("queueBackNavigation", &LayoutTestController::queueBackNavigation);
- bindMethod("queueForwardNavigation", &LayoutTestController::queueForwardNavigation);
- bindMethod("windowCount", &LayoutTestController::windowCount);
- bindMethod("setCanOpenWindows", &LayoutTestController::setCanOpenWindows);
- bindMethod("setCloseRemainingWindowsWhenComplete", &LayoutTestController::setCloseRemainingWindowsWhenComplete);
+ bindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations);
+ bindMethod("numberOfPages", &LayoutTestController::numberOfPages);
bindMethod("objCIdentityIsEqual", &LayoutTestController::objCIdentityIsEqual);
- bindMethod("setAlwaysAcceptCookies", &LayoutTestController::setAlwaysAcceptCookies);
- bindMethod("showWebInspector", &LayoutTestController::showWebInspector);
- bindMethod("closeWebInspector", &LayoutTestController::closeWebInspector);
- bindMethod("setWindowIsKey", &LayoutTestController::setWindowIsKey);
- bindMethod("setTabKeyCyclesThroughElements", &LayoutTestController::setTabKeyCyclesThroughElements);
- bindMethod("setUserStyleSheetLocation", &LayoutTestController::setUserStyleSheetLocation);
- bindMethod("setUserStyleSheetEnabled", &LayoutTestController::setUserStyleSheetEnabled);
- bindMethod("setAuthorAndUserStylesEnabled", &LayoutTestController::setAuthorAndUserStylesEnabled);
+ bindMethod("overridePreference", &LayoutTestController::overridePreference);
+ bindMethod("pageNumberForElementById", &LayoutTestController::pageNumberForElementById);
bindMethod("pathToLocalResource", &LayoutTestController::pathToLocalResource);
- bindMethod("addFileToPasteboardOnDrag", &LayoutTestController::addFileToPasteboardOnDrag);
- bindMethod("execCommand", &LayoutTestController::execCommand);
- bindMethod("isCommandEnabled", &LayoutTestController::isCommandEnabled);
- bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled);
- bindMethod("setStopProvisionalFrameLoads", &LayoutTestController::setStopProvisionalFrameLoads);
- bindMethod("setSmartInsertDeleteEnabled", &LayoutTestController::setSmartInsertDeleteEnabled);
- bindMethod("setSelectTrailingWhitespaceEnabled", &LayoutTestController::setSelectTrailingWhitespaceEnabled);
bindMethod("pauseAnimationAtTimeOnElementWithId", &LayoutTestController::pauseAnimationAtTimeOnElementWithId);
bindMethod("pauseTransitionAtTimeOnElementWithId", &LayoutTestController::pauseTransitionAtTimeOnElementWithId);
- bindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId);
- bindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations);
- bindMethod("suspendAnimations", &LayoutTestController::suspendAnimations);
+ bindMethod("queueBackNavigation", &LayoutTestController::queueBackNavigation);
+ bindMethod("queueForwardNavigation", &LayoutTestController::queueForwardNavigation);
+ bindMethod("queueLoadingScript", &LayoutTestController::queueLoadingScript);
+ bindMethod("queueLoad", &LayoutTestController::queueLoad);
+ bindMethod("queueLoadHTMLString", &LayoutTestController::queueLoadHTMLString);
+ bindMethod("queueNonLoadingScript", &LayoutTestController::queueNonLoadingScript);
+ bindMethod("queueReload", &LayoutTestController::queueReload);
+ bindMethod("removeOriginAccessWhitelistEntry", &LayoutTestController::removeOriginAccessWhitelistEntry);
+ bindMethod("repaintSweepHorizontally", &LayoutTestController::repaintSweepHorizontally);
bindMethod("resumeAnimations", &LayoutTestController::resumeAnimations);
- bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading);
- bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled);
+ bindMethod("setAcceptsEditing", &LayoutTestController::setAcceptsEditing);
+ bindMethod("setAllowFileAccessFromFileURLs", &LayoutTestController::setAllowFileAccessFromFileURLs);
+ bindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAllowUniversalAccessFromFileURLs);
+ bindMethod("setAlwaysAcceptCookies", &LayoutTestController::setAlwaysAcceptCookies);
+ bindMethod("setAuthorAndUserStylesEnabled", &LayoutTestController::setAuthorAndUserStylesEnabled);
+ bindMethod("setCanOpenWindows", &LayoutTestController::setCanOpenWindows);
+ bindMethod("setCloseRemainingWindowsWhenComplete", &LayoutTestController::setCloseRemainingWindowsWhenComplete);
bindMethod("setCustomPolicyDelegate", &LayoutTestController::setCustomPolicyDelegate);
+ bindMethod("setDatabaseQuota", &LayoutTestController::setDatabaseQuota);
+ bindMethod("setDeferMainResourceDataLoad", &LayoutTestController::setDeferMainResourceDataLoad);
+ bindMethod("setDomainRelaxationForbiddenForURLScheme", &LayoutTestController::setDomainRelaxationForbiddenForURLScheme);
+ bindMethod("setEditingBehavior", &LayoutTestController::setEditingBehavior);
+ bindMethod("setGeolocationPermission", &LayoutTestController::setGeolocationPermission);
+ bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled);
+ bindMethod("setJavaScriptCanAccessClipboard", &LayoutTestController::setJavaScriptCanAccessClipboard);
+ bindMethod("setMockDeviceOrientation", &LayoutTestController::setMockDeviceOrientation);
+ bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError);
+ bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition);
+ bindMethod("setMockSpeechInputResult", &LayoutTestController::setMockSpeechInputResult);
+ bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled);
+ bindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale);
bindMethod("setScrollbarPolicy", &LayoutTestController::setScrollbarPolicy);
- bindMethod("waitForPolicyDelegate", &LayoutTestController::waitForPolicyDelegate);
+ bindMethod("setSelectTrailingWhitespaceEnabled", &LayoutTestController::setSelectTrailingWhitespaceEnabled);
+ bindMethod("setSmartInsertDeleteEnabled", &LayoutTestController::setSmartInsertDeleteEnabled);
+ bindMethod("setStopProvisionalFrameLoads", &LayoutTestController::setStopProvisionalFrameLoads);
+ bindMethod("setTabKeyCyclesThroughElements", &LayoutTestController::setTabKeyCyclesThroughElements);
+ bindMethod("setTimelineProfilingEnabled", &LayoutTestController::setTimelineProfilingEnabled);
+ bindMethod("setUserStyleSheetEnabled", &LayoutTestController::setUserStyleSheetEnabled);
+ bindMethod("setUserStyleSheetLocation", &LayoutTestController::setUserStyleSheetLocation);
bindMethod("setWillSendRequestClearHeader", &LayoutTestController::setWillSendRequestClearHeader);
- bindMethod("setWillSendRequestReturnsNullOnRedirect", &LayoutTestController::setWillSendRequestReturnsNullOnRedirect);
bindMethod("setWillSendRequestReturnsNull", &LayoutTestController::setWillSendRequestReturnsNull);
- bindMethod("addOriginAccessWhitelistEntry", &LayoutTestController::addOriginAccessWhitelistEntry);
- bindMethod("removeOriginAccessWhitelistEntry", &LayoutTestController::removeOriginAccessWhitelistEntry);
- bindMethod("clearAllDatabases", &LayoutTestController::clearAllDatabases);
- bindMethod("setDatabaseQuota", &LayoutTestController::setDatabaseQuota);
- bindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale);
- bindMethod("counterValueForElementById", &LayoutTestController::counterValueForElementById);
- bindMethod("addUserScript", &LayoutTestController::addUserScript);
- bindMethod("addUserStyleSheet", &LayoutTestController::addUserStyleSheet);
- bindMethod("pageNumberForElementById", &LayoutTestController::pageNumberForElementById);
- bindMethod("numberOfPages", &LayoutTestController::numberOfPages);
- bindMethod("dumpSelectionRect", &LayoutTestController::dumpSelectionRect);
- bindMethod("grantDesktopNotificationPermission", &LayoutTestController::grantDesktopNotificationPermission);
+ bindMethod("setWillSendRequestReturnsNullOnRedirect", &LayoutTestController::setWillSendRequestReturnsNullOnRedirect);
+ bindMethod("setWindowIsKey", &LayoutTestController::setWindowIsKey);
+ bindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled);
+ bindMethod("showWebInspector", &LayoutTestController::showWebInspector);
bindMethod("simulateDesktopNotificationClick", &LayoutTestController::simulateDesktopNotificationClick);
+ bindMethod("suspendAnimations", &LayoutTestController::suspendAnimations);
+ bindMethod("testRepaint", &LayoutTestController::testRepaint);
+ bindMethod("waitForPolicyDelegate", &LayoutTestController::waitForPolicyDelegate);
+ bindMethod("waitUntilDone", &LayoutTestController::waitUntilDone);
+ bindMethod("windowCount", &LayoutTestController::windowCount);
// The following are stubs.
- bindMethod("dumpAsWebArchive", &LayoutTestController::dumpAsWebArchive);
- bindMethod("setMainFrameIsFirstResponder", &LayoutTestController::setMainFrameIsFirstResponder);
- bindMethod("dumpSelectionRect", &LayoutTestController::dumpSelectionRect);
- bindMethod("display", &LayoutTestController::display);
- bindMethod("testRepaint", &LayoutTestController::testRepaint);
- bindMethod("repaintSweepHorizontally", &LayoutTestController::repaintSweepHorizontally);
- bindMethod("clearBackForwardList", &LayoutTestController::clearBackForwardList);
- bindMethod("keepWebHistory", &LayoutTestController::keepWebHistory);
- bindMethod("storeWebScriptObject", &LayoutTestController::storeWebScriptObject);
+ bindMethod("abortModal", &LayoutTestController::abortModal);
bindMethod("accessStoredWebScriptObject", &LayoutTestController::accessStoredWebScriptObject);
- bindMethod("objCClassNameOf", &LayoutTestController::objCClassNameOf);
bindMethod("addDisallowedURL", &LayoutTestController::addDisallowedURL);
bindMethod("callShouldCloseOnWebView", &LayoutTestController::callShouldCloseOnWebView);
+ bindMethod("clearAllApplicationCaches", &LayoutTestController::clearAllApplicationCaches);
+ bindMethod("clearBackForwardList", &LayoutTestController::clearBackForwardList);
+ bindMethod("dumpAsWebArchive", &LayoutTestController::dumpAsWebArchive);
+ bindMethod("keepWebHistory", &LayoutTestController::keepWebHistory);
+ bindMethod("objCClassNameOf", &LayoutTestController::objCClassNameOf);
+ bindMethod("setApplicationCacheOriginQuota", &LayoutTestController::setApplicationCacheOriginQuota);
bindMethod("setCallCloseOnWebViews", &LayoutTestController::setCallCloseOnWebViews);
+ bindMethod("setMainFrameIsFirstResponder", &LayoutTestController::setMainFrameIsFirstResponder);
bindMethod("setPrivateBrowsingEnabled", &LayoutTestController::setPrivateBrowsingEnabled);
bindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDashboardCompatibilityMode);
- bindMethod("clearAllApplicationCaches", &LayoutTestController::clearAllApplicationCaches);
- bindMethod("setApplicationCacheOriginQuota", &LayoutTestController::setApplicationCacheOriginQuota);
-
- bindMethod("setJavaScriptCanAccessClipboard", &LayoutTestController::setJavaScriptCanAccessClipboard);
- bindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled);
- bindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld);
- bindMethod("overridePreference", &LayoutTestController::overridePreference);
- bindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAllowUniversalAccessFromFileURLs);
- bindMethod("setAllowFileAccessFromFileURLs", &LayoutTestController::setAllowFileAccessFromFileURLs);
- bindMethod("setTimelineProfilingEnabled", &LayoutTestController::setTimelineProfilingEnabled);
- bindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspector);
- bindMethod("forceRedSelectionColors", &LayoutTestController::forceRedSelectionColors);
- bindMethod("setEditingBehavior", &LayoutTestController::setEditingBehavior);
-
- bindMethod("setMockDeviceOrientation", &LayoutTestController::setMockDeviceOrientation);
-
- bindMethod("setGeolocationPermission", &LayoutTestController::setGeolocationPermission);
- bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition);
- bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError);
- bindMethod("abortModal", &LayoutTestController::abortModal);
- bindMethod("setMockSpeechInputResult", &LayoutTestController::setMockSpeechInputResult);
-
- bindMethod("markerTextForListItem", &LayoutTestController::markerTextForListItem);
+ bindMethod("storeWebScriptObject", &LayoutTestController::storeWebScriptObject);
// The fallback method is called when an unknown method is invoked.
bindFallbackMethod(&LayoutTestController::fallbackMethod);
@@ -291,6 +291,12 @@ void LayoutTestController::dumpResourceLoadCallbacks(const CppArgumentList&, Cpp
result->setNull();
}
+void LayoutTestController::dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpResourceResponseMIMETypes = true;
+ result->setNull();
+}
+
void LayoutTestController::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result)
{
m_dumpChildFrameScrollPositions = true;
@@ -460,6 +466,34 @@ void LayoutTestController::queueLoad(const CppArgumentList& arguments, CppVarian
result->setNull();
}
+class WorkItemLoadHTMLString : public LayoutTestController::WorkItem {
+public:
+ WorkItemLoadHTMLString(const std::string& html, const WebURL& baseURL)
+ : m_html(html)
+ , m_baseURL(baseURL) {}
+ bool run(TestShell* shell)
+ {
+ shell->webView()->mainFrame()->loadHTMLString(
+ WebKit::WebData(m_html.data(), m_html.length()), m_baseURL);
+ return true;
+ }
+private:
+ std::string m_html;
+ WebURL m_baseURL;
+};
+
+void LayoutTestController::queueLoadHTMLString(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isString()) {
+ string html = arguments[0].toString();
+ WebURL baseURL;
+ if (arguments.size() > 1 && arguments[1].isString())
+ baseURL = WebURL(GURL(arguments[1].toString()));
+ m_workQueue.addWork(new WorkItemLoadHTMLString(html, baseURL));
+ }
+ result->setNull();
+}
+
void LayoutTestController::objCIdentityIsEqual(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() < 2) {
@@ -486,6 +520,7 @@ void LayoutTestController::reset()
m_dumpEditingCallbacks = false;
m_dumpFrameLoadCallbacks = false;
m_dumpResourceLoadCallbacks = false;
+ m_dumpResourceResponseMIMETypes = false;
m_dumpBackForwardList = false;
m_dumpChildFrameScrollPositions = false;
m_dumpChildFramesAsText = false;
@@ -500,6 +535,7 @@ void LayoutTestController::reset()
m_sweepHorizontally = false;
m_shouldAddFileToPasteboard = false;
m_stopProvisionalFrameLoads = false;
+ m_deferMainResourceDataLoad = true;
m_globalFlag.set(false);
m_webHistoryItemCount.set(0);
m_userStyleSheetLocation = WebURL();
@@ -591,24 +627,30 @@ void LayoutTestController::setWindowIsKey(const CppArgumentList& arguments, CppV
void LayoutTestController::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppVariant* result)
{
- if (arguments.size() > 0 && arguments[0].isBool())
- m_shell->webView()->settings()->setUserStyleSheetLocation(arguments[0].value.boolValue ? m_userStyleSheetLocation : WebURL());
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ m_shell->preferences()->userStyleSheetLocation = arguments[0].value.boolValue ? m_userStyleSheetLocation : WebURL();
+ m_shell->applyPreferences();
+ }
result->setNull();
}
void LayoutTestController::setUserStyleSheetLocation(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isString()) {
- m_userStyleSheetLocation = webkit_support::RewriteLayoutTestsURL(arguments[0].toString());
- m_shell->webView()->settings()->setUserStyleSheetLocation(m_userStyleSheetLocation);
+ m_userStyleSheetLocation = webkit_support::LocalFileToDataURL(
+ webkit_support::RewriteLayoutTestsURL(arguments[0].toString()));
+ m_shell->preferences()->userStyleSheetLocation = m_userStyleSheetLocation;
+ m_shell->applyPreferences();
}
result->setNull();
}
void LayoutTestController::setAuthorAndUserStylesEnabled(const CppArgumentList& arguments, CppVariant* result)
{
- if (arguments.size() > 0 && arguments[0].isBool())
- m_shell->webView()->settings()->setAuthorAndUserStylesEnabled(arguments[0].value.boolValue);
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ m_shell->preferences()->authorAndUserStylesEnabled = arguments[0].value.boolValue;
+ m_shell->applyPreferences();
+ }
result->setNull();
}
@@ -645,7 +687,8 @@ void LayoutTestController::setPopupBlockingEnabled(const CppArgumentList& argume
{
if (arguments.size() > 0 && arguments[0].isBool()) {
bool blockPopups = arguments[0].toBoolean();
- m_shell->webView()->settings()->setJavaScriptCanOpenWindowsAutomatically(!blockPopups);
+ m_shell->preferences()->javaScriptCanOpenWindowsAutomatically = !blockPopups;
+ m_shell->applyPreferences();
}
result->setNull();
}
@@ -918,7 +961,8 @@ void LayoutTestController::resumeAnimations(const CppArgumentList&, CppVariant*
void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result)
{
- m_shell->webView()->settings()->setLoadsImagesAutomatically(false);
+ m_shell->preferences()->loadsImagesAutomatically = false;
+ m_shell->applyPreferences();
result->setNull();
}
@@ -955,6 +999,19 @@ void LayoutTestController::simulateDesktopNotificationClick(const CppArgumentLis
result->set(false);
}
+void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() != 2 || !arguments[0].isBool() || !arguments[1].isString())
+ return;
+ m_shell->webView()->setDomainRelaxationForbidden(cppVariantToBool(arguments[0]), cppVariantToWebString(arguments[1]));
+}
+
+void LayoutTestController::setDeferMainResourceDataLoad(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() == 1)
+ m_deferMainResourceDataLoad = cppVariantToBool(arguments[0]);
+}
+
//
// Unimplemented stubs
//
@@ -1027,6 +1084,7 @@ void LayoutTestController::addDisallowedURL(const CppArgumentList& arguments, Cp
{
result->setNull();
}
+
void LayoutTestController::setCallCloseOnWebViews(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
@@ -1039,15 +1097,19 @@ void LayoutTestController::setPrivateBrowsingEnabled(const CppArgumentList& argu
void LayoutTestController::setJavaScriptCanAccessClipboard(const CppArgumentList& arguments, CppVariant* result)
{
- if (arguments.size() > 0 && arguments[0].isBool())
- m_shell->webView()->settings()->setJavaScriptCanAccessClipboard(arguments[0].value.boolValue);
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ m_shell->preferences()->javaScriptCanAccessClipboard = arguments[0].value.boolValue;
+ m_shell->applyPreferences();
+ }
result->setNull();
}
void LayoutTestController::setXSSAuditorEnabled(const CppArgumentList& arguments, CppVariant* result)
{
- if (arguments.size() > 0 && arguments[0].isBool())
- m_shell->webView()->settings()->setXSSAuditorEnabled(arguments[0].value.boolValue);
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ m_shell->preferences()->XSSAuditorEnabled = arguments[0].value.boolValue;
+ m_shell->applyPreferences();
+ }
result->setNull();
}
@@ -1064,15 +1126,19 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(const CppArgumentList&
void LayoutTestController::setAllowUniversalAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result)
{
- if (arguments.size() > 0 && arguments[0].isBool())
- m_shell->webView()->settings()->setAllowUniversalAccessFromFileURLs(arguments[0].value.boolValue);
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ m_shell->preferences()->allowUniversalAccessFromFileURLs = arguments[0].value.boolValue;
+ m_shell->applyPreferences();
+ }
result->setNull();
}
void LayoutTestController::setAllowFileAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result)
{
- if (arguments.size() > 0 && arguments[0].isBool())
- m_shell->webView()->settings()->setAllowFileAccessFromFileURLs(arguments[0].value.boolValue);
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ m_shell->preferences()->allowFileAccessFromFileURLs = arguments[0].value.boolValue;
+ m_shell->applyPreferences();
+ }
result->setNull();
}
@@ -1128,68 +1194,69 @@ void LayoutTestController::overridePreference(const CppArgumentList& arguments,
string key = arguments[0].toString();
CppVariant value = arguments[1];
- WebSettings* settings = m_shell->webView()->settings();
+ WebPreferences* prefs = m_shell->preferences();
if (key == "WebKitStandardFont")
- settings->setStandardFontFamily(cppVariantToWebString(value));
+ prefs->standardFontFamily = cppVariantToWebString(value);
else if (key == "WebKitFixedFont")
- settings->setFixedFontFamily(cppVariantToWebString(value));
+ prefs->fixedFontFamily = cppVariantToWebString(value);
else if (key == "WebKitSerifFont")
- settings->setSerifFontFamily(cppVariantToWebString(value));
+ prefs->serifFontFamily = cppVariantToWebString(value);
else if (key == "WebKitSansSerifFont")
- settings->setSansSerifFontFamily(cppVariantToWebString(value));
+ prefs->sansSerifFontFamily = cppVariantToWebString(value);
else if (key == "WebKitCursiveFont")
- settings->setCursiveFontFamily(cppVariantToWebString(value));
+ prefs->cursiveFontFamily = cppVariantToWebString(value);
else if (key == "WebKitFantasyFont")
- settings->setFantasyFontFamily(cppVariantToWebString(value));
+ prefs->fantasyFontFamily = cppVariantToWebString(value);
else if (key == "WebKitDefaultFontSize")
- settings->setDefaultFontSize(cppVariantToInt32(value));
+ prefs->defaultFontSize = cppVariantToInt32(value);
else if (key == "WebKitDefaultFixedFontSize")
- settings->setDefaultFixedFontSize(cppVariantToInt32(value));
+ prefs->defaultFixedFontSize = cppVariantToInt32(value);
else if (key == "WebKitMinimumFontSize")
- settings->setMinimumFontSize(cppVariantToInt32(value));
+ prefs->minimumFontSize = cppVariantToInt32(value);
else if (key == "WebKitMinimumLogicalFontSize")
- settings->setMinimumLogicalFontSize(cppVariantToInt32(value));
+ prefs->minimumLogicalFontSize = cppVariantToInt32(value);
else if (key == "WebKitDefaultTextEncodingName")
- settings->setDefaultTextEncodingName(cppVariantToWebString(value));
+ prefs->defaultTextEncodingName = cppVariantToWebString(value);
else if (key == "WebKitJavaScriptEnabled")
- settings->setJavaScriptEnabled(cppVariantToBool(value));
+ prefs->javaScriptEnabled = cppVariantToBool(value);
else if (key == "WebKitWebSecurityEnabled")
- settings->setWebSecurityEnabled(cppVariantToBool(value));
+ prefs->webSecurityEnabled = cppVariantToBool(value);
else if (key == "WebKitJavaScriptCanOpenWindowsAutomatically")
- settings->setJavaScriptCanOpenWindowsAutomatically(cppVariantToBool(value));
+ prefs->javaScriptCanOpenWindowsAutomatically = cppVariantToBool(value);
else if (key == "WebKitDisplayImagesKey")
- settings->setLoadsImagesAutomatically(cppVariantToBool(value));
+ prefs->loadsImagesAutomatically = cppVariantToBool(value);
else if (key == "WebKitPluginsEnabled")
- settings->setPluginsEnabled(cppVariantToBool(value));
+ prefs->pluginsEnabled = cppVariantToBool(value);
else if (key == "WebKitDOMPasteAllowedPreferenceKey")
- settings->setDOMPasteAllowed(cppVariantToBool(value));
+ prefs->DOMPasteAllowed = cppVariantToBool(value);
else if (key == "WebKitDeveloperExtrasEnabledPreferenceKey")
- settings->setDeveloperExtrasEnabled(cppVariantToBool(value));
+ prefs->developerExtrasEnabled = cppVariantToBool(value);
else if (key == "WebKitShrinksStandaloneImagesToFit")
- settings->setShrinksStandaloneImagesToFit(cppVariantToBool(value));
+ prefs->shrinksStandaloneImagesToFit = cppVariantToBool(value);
else if (key == "WebKitTextAreasAreResizable")
- settings->setTextAreasAreResizable(cppVariantToBool(value));
+ prefs->textAreasAreResizable = cppVariantToBool(value);
else if (key == "WebKitJavaEnabled")
- settings->setJavaEnabled(cppVariantToBool(value));
+ prefs->javaEnabled = cppVariantToBool(value);
else if (key == "WebKitUsesPageCachePreferenceKey")
- settings->setUsesPageCache(cppVariantToBool(value));
+ prefs->usesPageCache = cppVariantToBool(value);
else if (key == "WebKitJavaScriptCanAccessClipboard")
- settings->setJavaScriptCanAccessClipboard(cppVariantToBool(value));
+ prefs->javaScriptCanAccessClipboard = cppVariantToBool(value);
else if (key == "WebKitXSSAuditorEnabled")
- settings->setXSSAuditorEnabled(cppVariantToBool(value));
+ prefs->XSSAuditorEnabled = cppVariantToBool(value);
else if (key == "WebKitLocalStorageEnabledPreferenceKey")
- settings->setLocalStorageEnabled(cppVariantToBool(value));
+ prefs->localStorageEnabled = cppVariantToBool(value);
else if (key == "WebKitOfflineWebApplicationCacheEnabled")
- settings->setOfflineWebApplicationCacheEnabled(cppVariantToBool(value));
+ prefs->offlineWebApplicationCacheEnabled = cppVariantToBool(value);
else if (key == "WebKitTabToLinksPreferenceKey")
- m_shell->webView()->setTabsToLinks(cppVariantToBool(value));
+ prefs->tabsToLinks = cppVariantToBool(value);
else if (key == "WebKitWebGLEnabled")
- settings->setExperimentalWebGLEnabled(cppVariantToBool(value));
+ prefs->experimentalWebGLEnabled = cppVariantToBool(value);
else {
string message("Invalid name for preference: ");
message.append(key);
logErrorToConsole(message);
}
+ m_shell->applyPreferences();
}
void LayoutTestController::fallbackMethod(const CppArgumentList&, CppVariant* result)
@@ -1381,13 +1448,14 @@ void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, C
void LayoutTestController::setEditingBehavior(const CppArgumentList& arguments, CppVariant* results)
{
- WebSettings* settings = m_shell->webView()->settings();
string key = arguments[0].toString();
- if (key == "mac")
- settings->setEditingBehavior(WebSettings::EditingBehaviorMac);
- else if (key == "win")
- settings->setEditingBehavior(WebSettings::EditingBehaviorWin);
- else
+ if (key == "mac") {
+ m_shell->preferences()->editingBehavior = WebSettings::EditingBehaviorMac;
+ m_shell->applyPreferences();
+ } else if (key == "win") {
+ m_shell->preferences()->editingBehavior = WebSettings::EditingBehaviorWin;
+ m_shell->applyPreferences();
+ } else
logErrorToConsole("Passed invalid editing behavior. Should be 'mac' or 'win'.");
}
@@ -1397,7 +1465,7 @@ void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& argum
if (arguments.size() < 6 || !arguments[0].isBool() || !arguments[1].isNumber() || !arguments[2].isBool() || !arguments[3].isNumber() || !arguments[4].isBool() || !arguments[5].isNumber())
return;
- WebKit::WebDeviceOrientation orientation(arguments[0].toBoolean(), arguments[1].toDouble(), arguments[2].toBoolean(), arguments[3].toDouble(), arguments[4].toBoolean(), arguments[5].toDouble());
+ WebDeviceOrientation orientation(arguments[0].toBoolean(), arguments[1].toDouble(), arguments[2].toBoolean(), arguments[3].toDouble(), arguments[4].toBoolean(), arguments[5].toDouble());
ASSERT(m_deviceOrientationClientMock);
m_deviceOrientationClientMock->setOrientation(orientation);
@@ -1457,9 +1525,9 @@ void LayoutTestController::markerTextForListItem(const CppArgumentList& args, Cp
result->set(element.document().frame()->markerTextForListItem(element).utf8());
}
-WebKit::WebDeviceOrientationClient* LayoutTestController::deviceOrientationClient()
+WebDeviceOrientationClient* LayoutTestController::deviceOrientationClient()
{
if (!m_deviceOrientationClientMock.get())
- m_deviceOrientationClientMock.set(new WebKit::WebDeviceOrientationClientMock());
+ m_deviceOrientationClientMock.set(WebDeviceOrientationClientMock::create());
return m_deviceOrientationClientMock.get();
}
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
index 7bb22ca..ec2503f 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
@@ -100,6 +100,16 @@ public:
// dump all frames as plain text if the dumpAsText flag is set.
// It takes no arguments, and ignores any that may be present.
void dumpChildFramesAsText(const CppArgumentList&, CppVariant*);
+
+ // This function sets a flag that tells the test_shell to dump a descriptive
+ // line for each resource load callback. It takes no arguments, and ignores
+ // any that may be present.
+ void dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant*);
+
+ // This function sets a flag that tells the test_shell to dump the MIME type
+ // for each resource that was loaded. It takes no arguments, and ignores any
+ // that may be present.
+ void dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant*);
// This function sets a flag that tells the test_shell to dump all calls
// to window.status().
@@ -129,6 +139,7 @@ public:
void queueLoadingScript(const CppArgumentList&, CppVariant*);
void queueNonLoadingScript(const CppArgumentList&, CppVariant*);
void queueLoad(const CppArgumentList&, CppVariant*);
+ void queueLoadHTMLString(const CppArgumentList&, CppVariant*);
// Although this is named "objC" to match the Mac version, it actually tests
// the identity of its two arguments in C++.
@@ -212,11 +223,8 @@ public:
void numberOfActiveAnimations(const CppArgumentList&, CppVariant*);
void suspendAnimations(const CppArgumentList&, CppVariant*);
void resumeAnimations(const CppArgumentList&, CppVariant*);
-
void disableImageLoading(const CppArgumentList&, CppVariant*);
-
void setIconDatabaseEnabled(const CppArgumentList&, CppVariant*);
-
void dumpSelectionRect(const CppArgumentList&, CppVariant*);
// Grants permission for desktop notifications to an origin
@@ -224,13 +232,14 @@ public:
// Simulates a click on a desktop notification.
void simulateDesktopNotificationClick(const CppArgumentList&, CppVariant*);
+ void setDomainRelaxationForbiddenForURLScheme(const CppArgumentList&, CppVariant*);
+ void setDeferMainResourceDataLoad(const CppArgumentList&, CppVariant*);
void setEditingBehavior(const CppArgumentList&, CppVariant*);
// The following are only stubs. TODO(pamg): Implement any of these that
// are needed to pass the layout tests.
void dumpAsWebArchive(const CppArgumentList&, CppVariant*);
void dumpTitleChanges(const CppArgumentList&, CppVariant*);
- void dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant*);
void setMainFrameIsFirstResponder(const CppArgumentList&, CppVariant*);
void display(const CppArgumentList&, CppVariant*);
void testRepaint(const CppArgumentList&, CppVariant*);
@@ -328,6 +337,8 @@ public:
bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
bool shouldDumpResourceLoadCallbacks() {return m_dumpResourceLoadCallbacks; }
+ void setShouldDumpResourceResponseMIMETypes(bool value) { m_dumpResourceResponseMIMETypes = value; }
+ bool shouldDumpResourceResponseMIMETypes() {return m_dumpResourceResponseMIMETypes; }
bool shouldDumpStatusCallbacks() { return m_dumpWindowStatusChanges; }
bool shouldDumpSelectionRect() { return m_dumpSelectionRect; }
bool shouldDumpBackForwardList() { return m_dumpBackForwardList; }
@@ -339,6 +350,7 @@ public:
bool canOpenWindows() { return m_canOpenWindows; }
bool shouldAddFileToPasteboard() { return m_shouldAddFileToPasteboard; }
bool stopProvisionalFrameLoads() { return m_stopProvisionalFrameLoads; }
+ bool deferMainResourceDataLoad() { return m_deferMainResourceDataLoad; }
bool testRepaint() const { return m_testRepaint; }
bool sweepHorizontally() const { return m_sweepHorizontally; }
@@ -447,6 +459,10 @@ private:
// If true, the test_shell will output a descriptive line for each resource
// load callback.
bool m_dumpResourceLoadCallbacks;
+
+ // If true, the test_shell will output the MIME type for each resource that
+ // was loaded.
+ bool m_dumpResourceResponseMIMETypes;
// If true, the test_shell will produce a dump of the back forward list as
// well.
@@ -501,6 +517,9 @@ private:
// If true, don't dump output until notifyDone is called.
bool m_waitUntilDone;
+ // If false, all new requests will not defer the main resource data load.
+ bool m_deferMainResourceDataLoad;
+
WorkQueue m_workQueue;
CppVariant m_globalFlag;
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
index 4557803..15d6dee 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
@@ -35,8 +35,6 @@
#include "DRTDevToolsClient.h"
#include "LayoutTestController.h"
#include "WebViewHost.h"
-#include "base/string16.h"
-#include "gfx/codec/png_codec.h" // FIXME: Remove dependecy. WebCore/platform/image-encoder is better?
#include "public/WebDataSource.h"
#include "public/WebDocument.h"
#include "public/WebElement.h"
@@ -55,6 +53,7 @@
#include "skia/ext/bitmap_platform_device.h"
#include "skia/ext/platform_canvas.h"
#include "webkit/support/webkit_support.h"
+#include "webkit/support/webkit_support_gfx.h"
#include <algorithm>
#include <cctype>
#include <vector>
@@ -155,84 +154,8 @@ void TestShell::closeDevTools()
void TestShell::resetWebSettings(WebView& webView)
{
- // Match the settings used by Mac DumpRenderTree, with the exception of
- // fonts.
- WebSettings* settings = webView.settings();
-#if OS(MAC_OS_X)
- WebString serif = WebString::fromUTF8("Times");
- settings->setCursiveFontFamily(WebString::fromUTF8("Apple Chancery"));
- settings->setFantasyFontFamily(WebString::fromUTF8("Papyrus"));
-#else
- // NOTE: case matters here, this must be 'times new roman', else
- // some layout tests fail.
- WebString serif = WebString::fromUTF8("times new roman");
-
- // These two fonts are picked from the intersection of
- // Win XP font list and Vista font list :
- // http://www.microsoft.com/typography/fonts/winxp.htm
- // http://blogs.msdn.com/michkap/archive/2006/04/04/567881.aspx
- // Some of them are installed only with CJK and complex script
- // support enabled on Windows XP and are out of consideration here.
- // (although we enabled both on our buildbots.)
- // They (especially Impact for fantasy) are not typical cursive
- // and fantasy fonts, but it should not matter for layout tests
- // as long as they're available.
- settings->setCursiveFontFamily(WebString::fromUTF8("Comic Sans MS"));
- settings->setFantasyFontFamily(WebString::fromUTF8("Impact"));
-#endif
- settings->setSerifFontFamily(serif);
- settings->setStandardFontFamily(serif);
- settings->setFixedFontFamily(WebString::fromUTF8("Courier"));
- settings->setSansSerifFontFamily(WebString::fromUTF8("Helvetica"));
-
- settings->setDefaultTextEncodingName(WebString::fromUTF8("ISO-8859-1"));
- settings->setDefaultFontSize(16);
- settings->setDefaultFixedFontSize(13);
- settings->setMinimumFontSize(1);
- settings->setMinimumLogicalFontSize(9);
- settings->setJavaScriptCanOpenWindowsAutomatically(true);
- settings->setJavaScriptCanAccessClipboard(true);
- settings->setDOMPasteAllowed(true);
- settings->setDeveloperExtrasEnabled(false);
- settings->setNeedsSiteSpecificQuirks(true);
- settings->setShrinksStandaloneImagesToFit(false);
- settings->setUsesEncodingDetector(false);
- settings->setTextAreasAreResizable(false);
- settings->setJavaEnabled(false);
- settings->setAllowScriptsToCloseWindows(false);
- settings->setXSSAuditorEnabled(false);
- settings->setDownloadableBinaryFontsEnabled(true);
- settings->setLocalStorageEnabled(true);
- settings->setOfflineWebApplicationCacheEnabled(true);
- settings->setAllowFileAccessFromFileURLs(true);
- settings->setUserStyleSheetLocation(WebURL());
-
- // LayoutTests were written with Safari Mac in mind which does not allow
- // tabbing to links by default.
- webView.setTabsToLinks(false);
-
- // Allow those layout tests running as local files, i.e. under
- // LayoutTests/http/tests/local, to access http server.
- settings->setAllowUniversalAccessFromFileURLs(true);
-
- settings->setJavaScriptEnabled(true);
- settings->setPluginsEnabled(true);
- settings->setWebSecurityEnabled(true);
- settings->setEditableLinkBehaviorNeverLive();
- settings->setFontRenderingModeNormal();
- settings->setShouldPaintCustomScrollbars(true);
- settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded();
-
- settings->setLoadsImagesAutomatically(true);
- settings->setImagesEnabled(true);
-
-#if OS(DARWIN)
- settings->setEditingBehavior(WebSettings::EditingBehaviorMac);
-#else
- settings->setEditingBehavior(WebSettings::EditingBehaviorWin);
-#endif
- // FIXME: crbug.com/51879
- settings->setAcceleratedCompositingEnabled(false);
+ m_prefs.reset();
+ m_prefs.applyTo(&webView);
}
void TestShell::runFileTest(const TestParams& params)
@@ -244,7 +167,8 @@ void TestShell::runFileTest(const TestParams& params)
bool inspectorTestMode = testUrl.find("/inspector/") != string::npos
|| testUrl.find("\\inspector\\") != string::npos;
- m_webView->settings()->setDeveloperExtrasEnabled(inspectorTestMode);
+ m_prefs.developerExtrasEnabled = inspectorTestMode;
+ applyPreferences();
if (testUrl.find("loading/") != string::npos
|| testUrl.find("loading\\") != string::npos)
@@ -585,23 +509,15 @@ void TestShell::dumpImage(skia::PlatformCanvas* canvas) const
// to keep it. On Windows, the alpha channel is wrong since text/form control
// drawing may have erased it in a few places. So on Windows we force it to
// opaque and also don't write the alpha channel for the reference. Linux
- // doesn't have the wrong alpha like Windows, but we ignore it anyway.
-#if OS(WINDOWS)
- bool discardTransparency = true;
- device.makeOpaque(0, 0, sourceBitmap.width(), sourceBitmap.height());
-#elif OS(MAC_OS_X)
+ // doesn't have the wrong alpha like Windows, but we match Windows.
+#if OS(MAC_OS_X)
bool discardTransparency = false;
-#elif OS(UNIX)
+#else
bool discardTransparency = true;
- if (areLayoutTestImagesOpaque())
- device.makeOpaque(0, 0, sourceBitmap.width(), sourceBitmap.height());
+ device.makeOpaque(0, 0, sourceBitmap.width(), sourceBitmap.height());
#endif
- // Compute MD5 sum. We should have done this before calling
- // device.makeOpaque on Windows. Because we do it after the call, there are
- // some images that are the pixel identical on windows and other platforms
- // but have different MD5 sums. At this point, rebaselining all the windows
- // tests is too much of a pain, so we just check in different baselines.
+ // Compute MD5 sum.
MD5 digester;
Vector<uint8_t, 16> digestValue;
digester.addBytes(reinterpret_cast<const uint8_t*>(sourceBitmap.getPixels()), sourceBitmap.getSize());
@@ -619,10 +535,9 @@ void TestShell::dumpImage(skia::PlatformCanvas* canvas) const
// is really expensive.
if (md5hash.compare(m_params.pixelHash)) {
std::vector<unsigned char> png;
- gfx::PNGCodec::ColorFormat colorFormat = gfx::PNGCodec::FORMAT_BGRA;
- gfx::PNGCodec::Encode(
+ webkit_support::EncodeBGRAPNG(
reinterpret_cast<const unsigned char*>(sourceBitmap.getPixels()),
- colorFormat, sourceBitmap.width(), sourceBitmap.height(),
+ sourceBitmap.width(), sourceBitmap.height(),
static_cast<int>(sourceBitmap.rowBytes()), discardTransparency, &png);
m_printer->handleImage(md5hash.c_str(), m_params.pixelHash.c_str(), &png[0], png.size(), m_params.pixelFileName.c_str());
@@ -649,7 +564,7 @@ WebViewHost* TestShell::createNewWindow(const WebURL& url)
WebViewHost* host = new WebViewHost(this);
WebView* view = WebView::create(host, m_drtDevToolsAgent.get());
host->setWebWidget(view);
- resetWebSettings(*view);
+ m_prefs.applyTo(view);
view->initializeMainFrame(host);
m_windowList.append(host);
host->loadURLForFrame(url, WebString());
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.h b/WebKitTools/DumpRenderTree/chromium/TestShell.h
index cb5f862..6d93d4a 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShell.h
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.h
@@ -38,6 +38,7 @@
#include "PlainTextController.h"
#include "TestEventPrinter.h"
#include "TextInputController.h"
+#include "WebPreferences.h"
#include "WebViewHost.h"
#include <string>
#include <wtf/OwnPtr.h>
@@ -50,7 +51,6 @@ namespace WebKit {
class WebDevToolsAgentClient;
class WebFrame;
class WebNotificationPresenter;
-class WebPreferences;
class WebView;
class WebURL;
}
@@ -92,6 +92,9 @@ public:
NotificationPresenter* notificationPresenter() const { return m_notificationPresenter.get(); }
TestEventPrinter* printer() const { return m_printer.get(); }
+ WebPreferences* preferences() { return &m_prefs; }
+ void applyPreferences() { m_prefs.applyTo(m_webView); }
+
void bindJSObjectsToWindow(WebKit::WebFrame*);
void runFileTest(const TestParams&);
void callJSGC();
@@ -107,6 +110,7 @@ public:
void setFocus(WebKit::WebWidget*, bool enable);
bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpFrameLoadCallbacks(); }
bool shouldDumpResourceLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceLoadCallbacks(); }
+ bool shouldDumpResourceResponseMIMETypes() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceResponseMIMETypes(); }
void setIsLoading(bool flag) { m_isLoading = flag; }
// Called by the LayoutTestController to signal test completion.
@@ -147,7 +151,7 @@ public:
private:
void createDRTDevToolsClient(DRTDevToolsAgent*);
- static void resetWebSettings(WebKit::WebView&);
+ void resetWebSettings(WebKit::WebView&);
void dump();
std::string dumpAllBackForwardLists();
void dumpImage(skia::PlatformCanvas*) const;
@@ -172,6 +176,7 @@ private:
TestParams m_params;
int m_timeout; // timeout value in millisecond
bool m_allowExternalPages;
+ WebPreferences m_prefs;
// List of all windows in this process.
// The main window should be put into windowList[0].
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
index 63c4719..16f1575 100644
--- a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
@@ -51,20 +51,21 @@ TextInputController::TextInputController(TestShell* shell)
if (!testShell)
testShell = shell;
- bindMethod("insertText", &TextInputController::insertText);
+ bindMethod("attributedSubstringFromRange", &TextInputController::attributedSubstringFromRange);
+ bindMethod("characterIndexForPoint", &TextInputController::characterIndexForPoint);
+ bindMethod("conversationIdentifier", &TextInputController::conversationIdentifier);
bindMethod("doCommand", &TextInputController::doCommand);
- bindMethod("setMarkedText", &TextInputController::setMarkedText);
- bindMethod("unmarkText", &TextInputController::unmarkText);
+ bindMethod("firstRectForCharacterRange", &TextInputController::firstRectForCharacterRange);
bindMethod("hasMarkedText", &TextInputController::hasMarkedText);
- bindMethod("conversationIdentifier", &TextInputController::conversationIdentifier);
- bindMethod("substringFromRange", &TextInputController::substringFromRange);
- bindMethod("attributedSubstringFromRange", &TextInputController::attributedSubstringFromRange);
+ bindMethod("hasSpellingMarker", &TextInputController::hasSpellingMarker);
+ bindMethod("insertText", &TextInputController::insertText);
+ bindMethod("makeAttributedString", &TextInputController::makeAttributedString);
bindMethod("markedRange", &TextInputController::markedRange);
bindMethod("selectedRange", &TextInputController::selectedRange);
- bindMethod("firstRectForCharacterRange", &TextInputController::firstRectForCharacterRange);
- bindMethod("characterIndexForPoint", &TextInputController::characterIndexForPoint);
+ bindMethod("setMarkedText", &TextInputController::setMarkedText);
+ bindMethod("substringFromRange", &TextInputController::substringFromRange);
+ bindMethod("unmarkText", &TextInputController::unmarkText);
bindMethod("validAttributesForMarkedText", &TextInputController::validAttributesForMarkedText);
- bindMethod("makeAttributedString", &TextInputController::makeAttributedString);
}
WebFrame* TextInputController::getMainFrame()
@@ -214,3 +215,14 @@ void TextInputController::makeAttributedString(const CppArgumentList&, CppVarian
// FIXME: Implement this.
result->setNull();
}
+
+void TextInputController::hasSpellingMarker(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
+ return;
+ WebFrame* mainFrame = getMainFrame();
+ if (!mainFrame)
+ return;
+ // Returns as a number for a compatibility reason.
+ result->set(mainFrame->selectionStartHasSpellingMarkerFor(arguments[0].toInt32(), arguments[1].toInt32()) ? 1 : 0);
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.h b/WebKitTools/DumpRenderTree/chromium/TextInputController.h
index 9896be5..ddacefe 100644
--- a/WebKitTools/DumpRenderTree/chromium/TextInputController.h
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.h
@@ -61,6 +61,7 @@ public:
void characterIndexForPoint(const CppArgumentList&, CppVariant*);
void validAttributesForMarkedText(const CppArgumentList&, CppVariant*);
void makeAttributedString(const CppArgumentList&, CppVariant*);
+ void hasSpellingMarker(const CppArgumentList&, CppVariant*);
private:
// Returns the test shell's main WebFrame.
diff --git a/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp b/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp
new file mode 100644
index 0000000..004865a
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp
@@ -0,0 +1,161 @@
+/*
+ * 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 "WebPreferences.h"
+
+#include "public/WebView.h"
+
+using namespace WebKit;
+
+void WebPreferences::reset()
+{
+#if OS(MAC_OS_X)
+ cursiveFontFamily = WebString::fromUTF8("Apple Chancery");
+ fantasyFontFamily = WebString::fromUTF8("Papyrus");
+ WebString serif = WebString::fromUTF8("Times");
+#else
+ // These two fonts are picked from the intersection of
+ // Win XP font list and Vista font list :
+ // http://www.microsoft.com/typography/fonts/winxp.htm
+ // http://blogs.msdn.com/michkap/archive/2006/04/04/567881.aspx
+ // Some of them are installed only with CJK and complex script
+ // support enabled on Windows XP and are out of consideration here.
+ // (although we enabled both on our buildbots.)
+ // They (especially Impact for fantasy) are not typical cursive
+ // and fantasy fonts, but it should not matter for layout tests
+ // as long as they're available.
+ cursiveFontFamily = WebString::fromUTF8("Comic Sans MS");
+ fantasyFontFamily = WebString::fromUTF8("Impact");
+ // NOTE: case matters here, this must be 'times new roman', else
+ // some layout tests fail.
+ WebString serif = WebString::fromUTF8("times new roman");
+#endif
+ serifFontFamily = serif;
+ standardFontFamily = serif;
+ fixedFontFamily = WebString::fromUTF8("Courier");
+ sansSerifFontFamily = WebString::fromUTF8("Helvetica");
+
+ defaultFontSize = 16;
+ defaultFixedFontSize = 13;
+ minimumFontSize = 1;
+ minimumLogicalFontSize = 9;
+
+ DOMPasteAllowed = true;
+ XSSAuditorEnabled = false;
+ allowFileAccessFromFileURLs = true;
+ authorAndUserStylesEnabled = true;
+ defaultTextEncodingName = WebString::fromUTF8("ISO-8859-1");
+ developerExtrasEnabled = false;
+ experimentalWebGLEnabled = false;
+ javaEnabled = false;
+ javaScriptCanAccessClipboard = true;
+ javaScriptCanOpenWindowsAutomatically = true;
+ javaScriptEnabled = true;
+ loadsImagesAutomatically = true;
+ localStorageEnabled = true;
+ offlineWebApplicationCacheEnabled = true;
+ pluginsEnabled = true;
+ shrinksStandaloneImagesToFit = false;
+ textAreasAreResizable = false;
+ userStyleSheetLocation = WebURL();
+ usesPageCache = false;
+ webSecurityEnabled = true;
+
+ // Allow those layout tests running as local files, i.e. under
+ // LayoutTests/http/tests/local, to access http server.
+ allowUniversalAccessFromFileURLs = true;
+
+#if OS(DARWIN)
+ editingBehavior = WebSettings::EditingBehaviorMac;
+#else
+ editingBehavior = WebSettings::EditingBehaviorWin;
+#endif
+
+ tabsToLinks = false;
+}
+
+void WebPreferences::applyTo(WebView* webView)
+{
+ WebSettings* settings = webView->settings();
+ settings->setCursiveFontFamily(cursiveFontFamily);
+ settings->setFantasyFontFamily(fantasyFontFamily);
+ settings->setSerifFontFamily(serifFontFamily);
+ settings->setStandardFontFamily(standardFontFamily);
+ settings->setFixedFontFamily(fixedFontFamily);
+ settings->setSansSerifFontFamily(sansSerifFontFamily);
+
+ settings->setDefaultFontSize(defaultFontSize);
+ settings->setDefaultFixedFontSize(defaultFixedFontSize);
+ settings->setMinimumFontSize(minimumFontSize);
+ settings->setMinimumLogicalFontSize(minimumLogicalFontSize);
+
+ settings->setDOMPasteAllowed(DOMPasteAllowed);
+ settings->setXSSAuditorEnabled(XSSAuditorEnabled);
+ settings->setAllowFileAccessFromFileURLs(allowFileAccessFromFileURLs);
+ settings->setAuthorAndUserStylesEnabled(authorAndUserStylesEnabled);
+ settings->setDefaultTextEncodingName(defaultTextEncodingName);
+ settings->setDeveloperExtrasEnabled(developerExtrasEnabled);
+ settings->setExperimentalWebGLEnabled(experimentalWebGLEnabled);
+ settings->setJavaEnabled(javaEnabled);
+ settings->setJavaScriptCanAccessClipboard(javaScriptCanAccessClipboard);
+ settings->setJavaScriptCanOpenWindowsAutomatically(javaScriptCanOpenWindowsAutomatically);
+ settings->setJavaScriptEnabled(javaScriptEnabled);
+ settings->setLoadsImagesAutomatically(loadsImagesAutomatically);
+ settings->setLocalStorageEnabled(localStorageEnabled);
+ settings->setOfflineWebApplicationCacheEnabled(offlineWebApplicationCacheEnabled);
+ settings->setPluginsEnabled(pluginsEnabled);
+ settings->setShrinksStandaloneImagesToFit(shrinksStandaloneImagesToFit);
+ settings->setTextAreasAreResizable(textAreasAreResizable);
+ settings->setUserStyleSheetLocation(userStyleSheetLocation);
+ settings->setUsesPageCache(usesPageCache);
+ settings->setWebSecurityEnabled(webSecurityEnabled);
+ settings->setAllowUniversalAccessFromFileURLs(allowUniversalAccessFromFileURLs);
+ settings->setEditingBehavior(editingBehavior);
+ // LayoutTests were written with Safari Mac in mind which does not allow
+ // tabbing to links by default.
+ webView->setTabsToLinks(tabsToLinks);
+
+ // Fixed values.
+ settings->setShouldPaintCustomScrollbars(true);
+ settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded();
+ settings->setDownloadableBinaryFontsEnabled(true);
+ settings->setAllowScriptsToCloseWindows(false);
+ settings->setNeedsSiteSpecificQuirks(true);
+ settings->setEditableLinkBehaviorNeverLive();
+ settings->setFontRenderingModeNormal();
+ settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded();
+ settings->setUsesEncodingDetector(false);
+ settings->setImagesEnabled(true);
+
+ // FIXME: crbug.com/51879
+ settings->setAcceleratedCompositingEnabled(false);
+}
+
diff --git a/WebKitTools/DumpRenderTree/chromium/WebPreferences.h b/WebKitTools/DumpRenderTree/chromium/WebPreferences.h
new file mode 100644
index 0000000..f197c16
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/WebPreferences.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 WebPreferences_h
+#define WebPerferences_h
+
+#include "public/WebSettings.h"
+#include "public/WebString.h"
+#include "public/WebURL.h"
+
+namespace WebKit {
+class WebView;
+}
+
+struct WebPreferences {
+ WebKit::WebString cursiveFontFamily;
+ WebKit::WebString fantasyFontFamily;
+ WebKit::WebString serifFontFamily;
+ WebKit::WebString standardFontFamily;
+ WebKit::WebString fixedFontFamily;
+ WebKit::WebString sansSerifFontFamily;
+
+ int defaultFontSize;
+ int defaultFixedFontSize;
+ int minimumFontSize;
+ int minimumLogicalFontSize;
+
+ bool DOMPasteAllowed;
+ bool XSSAuditorEnabled;
+ bool allowFileAccessFromFileURLs;
+ bool authorAndUserStylesEnabled;
+ WebKit::WebString defaultTextEncodingName;
+ bool developerExtrasEnabled;
+ bool experimentalWebGLEnabled;
+ bool javaEnabled;
+ bool javaScriptCanAccessClipboard;
+ bool javaScriptCanOpenWindowsAutomatically;
+ bool javaScriptEnabled;
+ bool loadsImagesAutomatically;
+ bool localStorageEnabled;
+ bool offlineWebApplicationCacheEnabled;
+ bool pluginsEnabled;
+ bool shrinksStandaloneImagesToFit;
+ bool textAreasAreResizable;
+ WebKit::WebURL userStyleSheetLocation;
+ bool usesPageCache;
+ bool webSecurityEnabled;
+ bool allowUniversalAccessFromFileURLs;
+ WebKit::WebSettings::EditingBehavior editingBehavior;
+ bool tabsToLinks;
+
+ WebPreferences() { reset(); }
+ void reset();
+ void applyTo(WebKit::WebView*);
+};
+
+#endif // WebPreferences_h
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
index 1e3a4d6..9a086e4 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -40,6 +40,7 @@
#include "public/WebContextMenuData.h"
#include "public/WebDataSource.h"
#include "public/WebDragData.h"
+#include "public/WebElement.h"
#include "public/WebFrame.h"
#include "public/WebGeolocationServiceMock.h"
#include "public/WebHistoryItem.h"
@@ -489,10 +490,68 @@ void WebViewHost::focusAccessibilityObject(const WebAccessibilityObject& object)
m_shell->accessibilityController()->setFocusedElement(object);
}
-void WebViewHost::didChangeAccessibilityObjectChildren(const WebAccessibilityObject& object)
-{
- if (m_shell->accessibilityController()->shouldDumpAccessibilityNotifications())
- printf("didChangeAccessibilityObjectChildren - new count: %d\n", object.childCount());
+void WebViewHost::postAccessibilityNotification(const WebAccessibilityObject& obj, WebAccessibilityNotification notification)
+{
+ if (m_shell->accessibilityController()->shouldDumpAccessibilityNotifications()) {
+ printf("AccessibilityNotification - ");
+
+ switch (notification) {
+ case WebAccessibilityNotificationActiveDescendantChanged:
+ printf("ActiveDescendantChanged");
+ break;
+ case WebAccessibilityNotificationCheckedStateChanged:
+ printf("CheckedStateChanged");
+ break;
+ case WebAccessibilityNotificationChildrenChanged:
+ printf("ChildrenChanged");
+ break;
+ case WebAccessibilityNotificationFocusedUIElementChanged:
+ printf("FocusedUIElementChanged");
+ break;
+ case WebAccessibilityNotificationLayoutComplete:
+ printf("LayoutComplete");
+ break;
+ case WebAccessibilityNotificationLoadComplete:
+ printf("LoadComplete");
+ break;
+ case WebAccessibilityNotificationSelectedChildrenChanged:
+ printf("SelectedChildrenChanged");
+ break;
+ case WebAccessibilityNotificationSelectedTextChanged:
+ printf("SelectedTextChanged");
+ break;
+ case WebAccessibilityNotificationValueChanged:
+ printf("ValueChanged");
+ break;
+ case WebAccessibilityNotificationScrolledToAnchor:
+ printf("ScrolledToAnchor");
+ break;
+ case WebAccessibilityNotificationLiveRegionChanged:
+ printf("LiveRegionChanged");
+ break;
+ case WebAccessibilityNotificationMenuListValueChanged:
+ printf("MenuListValueChanged");
+ break;
+ case WebAccessibilityNotificationRowCountChanged:
+ printf("RowCountChanged");
+ break;
+ case WebAccessibilityNotificationRowCollapsed:
+ printf("RowCollapsed");
+ break;
+ case WebAccessibilityNotificationRowExpanded:
+ printf("RowExpanded");
+ break;
+ }
+
+ WebKit::WebNode node = obj.node();
+ if (!node.isNull() && node.isElementNode()) {
+ WebKit::WebElement element = node.to<WebKit::WebElement>();
+ if (element.hasAttribute("id"))
+ printf(" - id:%s", element.getAttribute("id").utf8().data());
+ }
+
+ printf("\n");
+ }
}
WebNotificationPresenter* WebViewHost::notificationPresenter()
@@ -731,6 +790,8 @@ void WebViewHost::didCancelClientRedirect(WebFrame* frame)
void WebViewHost::didCreateDataSource(WebFrame*, WebDataSource* ds)
{
ds->setExtraData(m_pendingExtraData.leakPtr());
+ if (!layoutTestController()->deferMainResourceDataLoad())
+ ds->setDeferMainResourceDataLoad(false);
}
void WebViewHost::didStartProvisionalLoad(WebFrame* frame)
@@ -920,12 +981,20 @@ void WebViewHost::willSendRequest(WebFrame*, unsigned identifier, WebURLRequest&
void WebViewHost::didReceiveResponse(WebFrame*, unsigned identifier, const WebURLResponse& response)
{
- if (!m_shell->shouldDumpResourceLoadCallbacks())
- return;
- printResourceDescription(identifier);
- fputs(" - didReceiveResponse ", stdout);
- printResponseDescription(response);
- fputs("\n", stdout);
+ if (m_shell->shouldDumpResourceLoadCallbacks()) {
+ printResourceDescription(identifier);
+ fputs(" - didReceiveResponse ", stdout);
+ printResponseDescription(response);
+ fputs("\n", stdout);
+ }
+ if (m_shell->shouldDumpResourceResponseMIMETypes()) {
+ GURL url = response.url();
+ WebString mimeType = response.mimeType();
+ printf("%s has MIME type %s\n",
+ url.ExtractFileName().c_str(),
+ // Simulate NSURLResponse's mapping of empty/unknown MIME types to application/octet-stream
+ mimeType.isEmpty() ? "application/octet-stream" : mimeType.utf8().data());
+ }
}
void WebViewHost::didFinishResourceLoad(WebFrame*, unsigned identifier)
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
index 3a84ebd..bbb132d 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
@@ -33,6 +33,7 @@
#include "MockSpellCheck.h"
#include "TestNavigationController.h"
+#include "public/WebAccessibilityNotification.h"
#include "public/WebCursorInfo.h"
#include "public/WebFrameClient.h"
#include "public/WebViewClient.h"
@@ -127,7 +128,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
virtual int historyBackListCount();
virtual int historyForwardListCount();
virtual void focusAccessibilityObject(const WebKit::WebAccessibilityObject&);
- virtual void didChangeAccessibilityObjectChildren(const WebKit::WebAccessibilityObject&);
+ virtual void postAccessibilityNotification(const WebKit::WebAccessibilityObject&, WebKit::WebAccessibilityNotification);
virtual WebKit::WebNotificationPresenter* notificationPresenter();
virtual WebKit::WebGeolocationService* geolocationService();
virtual WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
index a5c5e9f..d39ff1e 100644
--- a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
@@ -667,6 +667,12 @@ bool AccessibilityUIElement::isCollapsed() const
return false;
}
+bool AccessibilityUIElement::isIgnored() const
+{
+ // FIXME: implement
+ return false;
+}
+
bool AccessibilityUIElement::hasPopup() const
{
// FIXME: implement
diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
index fc118bc..d1529db 100644
--- a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
@@ -42,6 +42,7 @@
#include <webkit/webkitwebview.h>
#include <wtf/ASCIICType.h>
#include <wtf/Platform.h>
+#include <wtf/text/CString.h>
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
@@ -49,6 +50,7 @@
extern "C" {
extern void webkit_web_frame_layout(WebKitWebFrame* frame);
+ extern GtkMenu* webkit_web_view_get_context_menu(WebKitWebView*);
}
static bool dragMode;
@@ -148,15 +150,37 @@ bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber, guint
static JSValueRef contextClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
GdkEvent* pressEvent = gdk_event_new(GDK_BUTTON_PRESS);
+
if (!prepareMouseButtonEvent(pressEvent, 2, 0))
- return JSValueMakeUndefined(context);
+ return JSObjectMakeArray(context, 0, 0, 0);
GdkEvent* releaseEvent = gdk_event_copy(pressEvent);
sendOrQueueEvent(pressEvent);
+
+ JSValueRef valueRef = JSObjectMakeArray(context, 0, 0, 0);
+ WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+ GtkMenu* gtkMenu = webkit_web_view_get_context_menu(view);
+ if (gtkMenu) {
+ GList* items = gtk_container_get_children(GTK_CONTAINER(gtkMenu));
+ JSValueRef arrayValues[g_list_length(items)];
+ int index = 0;
+ for (GList* item = g_list_first(items); item; item = g_list_next(item)) {
+ CString label;
+ if (GTK_IS_SEPARATOR_MENU_ITEM(item->data))
+ label = "<separator>";
+ else
+ label = gtk_menu_item_get_label(GTK_MENU_ITEM(item->data));
+
+ arrayValues[index] = JSValueMakeString(context, JSStringCreateWithUTF8CString(label.data()));
+ index++;
+ }
+ if (index)
+ valueRef = JSObjectMakeArray(context, index - 1, arrayValues, 0);
+ }
+
releaseEvent->type = GDK_BUTTON_RELEASE;
sendOrQueueEvent(releaseEvent);
-
- return JSValueMakeUndefined(context);
+ return valueRef;
}
static void updateClickCount(int button)
@@ -434,30 +458,7 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS
{
if (argumentCount < 1)
return JSValueMakeUndefined(context);
-
- static const JSStringRef lengthProperty = JSStringCreateWithUTF8CString("length");
-
- webkit_web_frame_layout(mainFrame);
-
- // handle modifier keys.
- int state = 0;
- if (argumentCount > 1) {
- JSObjectRef modifiersArray = JSValueToObject(context, arguments[1], exception);
- if (modifiersArray) {
- for (int i = 0; i < JSValueToNumber(context, JSObjectGetProperty(context, modifiersArray, lengthProperty, 0), 0); ++i) {
- JSValueRef value = JSObjectGetPropertyAtIndex(context, modifiersArray, i, 0);
- JSStringRef string = JSValueToStringCopy(context, value, 0);
- if (JSStringIsEqualToUTF8CString(string, "ctrlKey"))
- state |= GDK_CONTROL_MASK;
- else if (JSStringIsEqualToUTF8CString(string, "shiftKey"))
- state |= GDK_SHIFT_MASK;
- else if (JSStringIsEqualToUTF8CString(string, "altKey"))
- state |= GDK_MOD1_MASK;
-
- JSStringRelease(string);
- }
- }
- }
+ guint modifiers = argumentCount >= 2 ? gdkModifersFromJSValue(context, arguments[1]) : 0;
// handle location argument.
int location = DOM_KEY_LOCATION_STANDARD;
@@ -550,7 +551,7 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS
else {
gdkKeySym = gdk_unicode_to_keyval(charCode);
if (WTF::isASCIIUpper(charCode))
- state |= GDK_SHIFT_MASK;
+ modifiers |= GDK_SHIFT_MASK;
}
}
}
@@ -563,7 +564,7 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS
// create and send the event
GdkEvent* pressEvent = gdk_event_new(GDK_KEY_PRESS);
pressEvent->key.keyval = gdkKeySym;
- pressEvent->key.state = state;
+ pressEvent->key.state = modifiers;
pressEvent->key.window = gtk_widget_get_window(GTK_WIDGET(view));
g_object_ref(pressEvent->key.window);
#ifndef GTK_API_VERSION_2
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
index fa4acf5..5f9705a 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
@@ -1160,6 +1160,15 @@ bool AccessibilityUIElement::isCollapsed() const
return false;
}
+bool AccessibilityUIElement::isIgnored() const
+{
+ BOOL result = NO;
+ BEGIN_AX_OBJC_EXCEPTIONS
+ result = [m_element accessibilityIsIgnored];
+ END_AX_OBJC_EXCEPTIONS
+ return result;
+}
+
bool AccessibilityUIElement::hasPopup() const
{
BEGIN_AX_OBJC_EXCEPTIONS
@@ -1246,6 +1255,16 @@ AccessibilityTextMarker AccessibilityUIElement::endTextMarkerForTextMarkerRange(
return 0;
}
+AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id textMarker = [m_element accessibilityAttributeValue:@"AXTextMarkerForPosition" forParameter:[NSValue valueWithPoint:NSMakePoint(x, y)]];
+ return AccessibilityTextMarker(textMarker);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
AccessibilityUIElement AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker* marker)
{
BEGIN_AX_OBJC_EXCEPTIONS
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
index ffcb18a..3732247 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
@@ -457,6 +457,7 @@ static void resetDefaultsToConsistentValues()
[preferences setUsesPageCache:NO];
[preferences setAcceleratedCompositingEnabled:YES];
[preferences setWebGLEnabled:NO];
+ [preferences setUsePreHTML5ParserQuirks:NO];
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
index 00ccdb5..4e6f049 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
@@ -567,6 +567,13 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting()
setlocale(LC_ALL, "");
}
+static bool isGlobalHistoryTest(const QUrl& url)
+{
+ if (url.path().contains("globalhistory/"))
+ return true;
+ return false;
+}
+
static bool isWebInspectorTest(const QUrl& url)
{
if (url.path().contains("inspector/"))
@@ -595,6 +602,9 @@ void DumpRenderTree::open(const QUrl& url)
layoutTestController()->showWebInspector();
}
+ if (isGlobalHistoryTest(url))
+ layoutTestController()->dumpHistoryCallbacks();
+
// W3C SVG tests expect to be 480x360
bool isW3CTest = url.toString().contains("svg/W3C-SVG-1.1");
int width = isW3CTest ? 480 : LayoutTestController::maxViewWidth;
@@ -668,8 +678,10 @@ void DumpRenderTree::processArgsLine(const QStringList &args)
void DumpRenderTree::loadNextTestInStandAloneMode()
{
- if (m_standAloneModeTestList.isEmpty())
+ if (m_standAloneModeTestList.isEmpty()) {
emit quit();
+ return;
+ }
processLine(m_standAloneModeTestList.first());
m_standAloneModeTestList.removeFirst();
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index b783141..b2ef716 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -81,6 +81,8 @@ void LayoutTestController::reset()
DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(QStringList());
DumpRenderTreeSupportQt::clearScriptWorlds();
DumpRenderTreeSupportQt::setCustomPolicyDelegate(false, false);
+ DumpRenderTreeSupportQt::dumpHistoryCallbacks(false);
+ DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(false);
setIconDatabaseEnabled(false);
emit hidePage();
@@ -206,6 +208,11 @@ bool LayoutTestController::checkDesktopNotificationPermission(const QString& ori
return !m_ignoreDesktopNotification && m_desktopNotificationAllowedOrigins.contains(origin);
}
+void LayoutTestController::simulateDesktopNotificationClick(const QString& title)
+{
+ DumpRenderTreeSupportQt::simulateDesktopNotificationClick(title);
+}
+
void LayoutTestController::display()
{
emit showPage();
@@ -222,6 +229,12 @@ QString LayoutTestController::pathToLocalResource(const QString& url)
return QDir::toNativeSeparators(url);
}
+void LayoutTestController::dumpConfigurationForViewport(int availableWidth, int availableHeight)
+{
+ QString res = DumpRenderTreeSupportQt::viewportAsText(m_drt->webPage(), QSize(availableWidth, availableHeight));
+ fputs(qPrintable(res), stdout);
+}
+
void LayoutTestController::dumpEditingCallbacks()
{
qDebug() << ">>>dumpEditingCallbacks";
@@ -243,6 +256,11 @@ void LayoutTestController::dumpResourceResponseMIMETypes()
DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(true);
}
+void LayoutTestController::dumpHistoryCallbacks()
+{
+ DumpRenderTreeSupportQt::dumpHistoryCallbacks(true);
+}
+
void LayoutTestController::setWillSendRequestReturnsNullOnRedirect(bool enabled)
{
DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(enabled);
@@ -769,5 +787,12 @@ void LayoutTestController::addUserStyleSheet(const QString& sourceCode)
DumpRenderTreeSupportQt::addUserStyleSheet(m_drt->webPage(), sourceCode);
}
+void LayoutTestController::removeAllVisitedLinks()
+{
+ QWebHistory* history = m_drt->webPage()->history();
+ history->clear();
+ DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(true);
+}
+
const unsigned LayoutTestController::maxViewWidth = 800;
const unsigned LayoutTestController::maxViewHeight = 600;
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
index 7e58f44..ec89acb 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -108,6 +108,8 @@ public slots:
void dumpFrameLoadCallbacks();
void dumpResourceLoadCallbacks();
void dumpResourceResponseMIMETypes();
+ void dumpHistoryCallbacks();
+ void dumpConfigurationForViewport(int availableWidth, int availableHeight);
void setWillSendRequestReturnsNullOnRedirect(bool enabled);
void setWillSendRequestReturnsNull(bool enabled);
void setWillSendRequestClearHeader(const QStringList& headers);
@@ -124,6 +126,7 @@ public slots:
void grantDesktopNotificationPermission(const QString& origin);
void ignoreDesktopNotificationPermissionRequests();
bool checkDesktopNotificationPermission(const QString& origin);
+ void simulateDesktopNotificationClick(const QString& title);
void display();
void clearBackForwardList();
QString pathToLocalResource(const QString& url);
@@ -135,6 +138,7 @@ public slots:
void showWebInspector();
void closeWebInspector();
void evaluateInWebInspector(long callId, const QString& script);
+ void removeAllVisitedLinks();
void setMediaType(const QString& type);
void setFrameFlatteningEnabled(bool enable);
diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
index 8c2fea2..96937fd 100644
--- a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
@@ -614,6 +614,12 @@ bool AccessibilityUIElement::isCollapsed() const
return (state & STATE_SYSTEM_COLLAPSED) == STATE_SYSTEM_COLLAPSED;
}
+bool AccessibilityUIElement::isIgnored() const
+{
+ // FIXME: implement
+ return false;
+}
+
bool AccessibilityUIElement::hasPopup() const
{
DWORD state = accessibilityState(m_element);
diff --git a/WebKitTools/EWSTools/start-commit-queue.sh b/WebKitTools/EWSTools/start-commit-queue.sh
new file mode 100755
index 0000000..998300e
--- /dev/null
+++ b/WebKitTools/EWSTools/start-commit-queue.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# 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.
+
+cd "$HOME/Projects/CommitQueue"
+while :
+do
+ git reset --hard
+ git clean -f
+ git svn rebase
+ ./WebKitTools/Scripts/webkit-patch commit-queue --no-confirm --exit-after-iteration 10
+done
diff --git a/WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops
index 7f843ce..0031e14 100644
--- a/WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops
+++ b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops
@@ -6,7 +6,7 @@
>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include&quot;"
+ AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;"
UsePrecompiledHeader="2"
/>
<Tool
diff --git a/WebKitTools/MiniBrowser/mac/AppDelegate.m b/WebKitTools/MiniBrowser/mac/AppDelegate.m
index 3bd3d57..7098cea 100644
--- a/WebKitTools/MiniBrowser/mac/AppDelegate.m
+++ b/WebKitTools/MiniBrowser/mac/AppDelegate.m
@@ -141,7 +141,8 @@ static void populateVisitedLinks(WKContextRef context, const void *clientInfo)
WKContextInjectedBundleClient bundleClient = {
0, /* version */
0, /* clientInfo */
- didRecieveMessageFromInjectedBundle
+ didRecieveMessageFromInjectedBundle,
+ 0
};
WKContextSetInjectedBundleClient(processContext, &bundleClient);
WKContextSetHistoryClient(processContext, &historyClient);
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.h b/WebKitTools/MiniBrowser/mac/BrowserWindowController.h
index aad8240..98c6bf7 100644
--- a/WebKitTools/MiniBrowser/mac/BrowserWindowController.h
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.h
@@ -34,6 +34,7 @@
WKPageNamespaceRef _pageNamespace;
WKView *_webView;
+ BOOL _zoomTextOnly;
}
- (IBAction)fetch:(id)sender;
- (IBAction)reload:(id)sender;
@@ -48,4 +49,15 @@
- (void)loadURLString:(NSString *)urlString;
- (void)applicationTerminating;
+- (IBAction)zoomIn:(id)sender;
+- (IBAction)zoomOut:(id)sender;
+- (IBAction)resetZoom:(id)sender;
+- (BOOL)canZoomIn;
+- (BOOL)canZoomOut;
+- (BOOL)canResetZoom;
+
+- (IBAction)toggleZoomMode:(id)sender;
+
+- (IBAction)dumpSourceToConsole:(id)sender;
+
@end
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
index 0b4e170..9398e56 100644
--- a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
@@ -44,8 +44,10 @@
- (id)initWithPageNamespace:(WKPageNamespaceRef)pageNamespace
{
- if ((self = [super initWithWindowNibName:@"BrowserWindow"]))
+ if ((self = [super initWithWindowNibName:@"BrowserWindow"])) {
_pageNamespace = WKRetain(pageNamespace);
+ _zoomTextOnly = NO;
+ }
return self;
}
@@ -59,6 +61,9 @@
- (IBAction)fetch:(id)sender
{
CFURLRef cfURL = CFURLCreateWithString(0, (CFStringRef)[urlText stringValue], 0);
+ if (!cfURL)
+ return;
+
WKURLRef url = WKURLCreateWithCFURL(cfURL);
CFRelease(cfURL);
@@ -86,10 +91,21 @@
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
{
- if ([menuItem action] == @selector(showHideWebView:))
+ SEL action = [menuItem action];
+
+ if (action == @selector(zoomIn:))
+ return [self canZoomIn];
+ if (action == @selector(zoomOut:))
+ return [self canZoomOut];
+ if (action == @selector(resetZoom:))
+ return [self canResetZoom];
+
+ if (action == @selector(showHideWebView:))
[menuItem setTitle:[_webView isHidden] ? @"Show Web View" : @"Hide Web View"];
- else if ([menuItem action] == @selector(removeReinsertWebView:))
+ else if (action == @selector(removeReinsertWebView:))
[menuItem setTitle:[_webView window] ? @"Remove Web View" : @"Insert Web View"];
+ else if (action == @selector(toggleZoomMode:))
+ [menuItem setState:_zoomTextOnly ? NSOnState : NSOffState];
return YES;
}
@@ -116,7 +132,7 @@
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
{
SEL action = [item action];
-
+
if (action == @selector(goBack:))
return _webView && WKPageCanGoBack(_webView.pageRef);
@@ -150,56 +166,136 @@
WKRelease(_webView.pageRef);
}
+#define DefaultMinimumZoomFactor (.5)
+#define DefaultMaximumZoomFactor (3.0)
+#define DefaultZoomFactorRatio (1.2)
+
+- (double)currentZoomFactor
+{
+ return _zoomTextOnly ? WKPageGetTextZoomFactor(_webView.pageRef) : WKPageGetPageZoomFactor(_webView.pageRef);
+}
+
+- (void)setCurrentZoomFactor:(double)factor
+{
+ _zoomTextOnly ? WKPageSetTextZoomFactor(_webView.pageRef, factor) : WKPageSetPageZoomFactor(_webView.pageRef, factor);
+}
+
+- (BOOL)canZoomIn
+{
+ return [self currentZoomFactor] * DefaultZoomFactorRatio < DefaultMaximumZoomFactor;
+}
+
+- (void)zoomIn:(id)sender
+{
+ if (![self canZoomIn])
+ return;
+
+ double factor = [self currentZoomFactor] * DefaultZoomFactorRatio;
+ [self setCurrentZoomFactor:factor];
+}
+
+- (BOOL)canZoomOut
+{
+ return [self currentZoomFactor] / DefaultZoomFactorRatio > DefaultMinimumZoomFactor;
+}
+
+- (void)zoomOut:(id)sender
+{
+ if (![self canZoomIn])
+ return;
+
+ double factor = [self currentZoomFactor] / DefaultZoomFactorRatio;
+ [self setCurrentZoomFactor:factor];
+}
+
+- (BOOL)canResetZoom
+{
+ return _zoomTextOnly ? (WKPageGetTextZoomFactor(_webView.pageRef) != 1) : (WKPageGetPageZoomFactor(_webView.pageRef) != 1);
+}
+
+- (void)resetZoom:(id)sender
+{
+ if (![self canResetZoom])
+ return;
+
+ if (_zoomTextOnly)
+ WKPageSetTextZoomFactor(_webView.pageRef, 1);
+ else
+ WKPageSetPageZoomFactor(_webView.pageRef, 1);
+}
+
+- (IBAction)toggleZoomMode:(id)sender
+{
+ if (_zoomTextOnly) {
+ _zoomTextOnly = NO;
+ double currentTextZoom = WKPageGetTextZoomFactor(_webView.pageRef);
+ WKPageSetPageAndTextZoomFactors(_webView.pageRef, currentTextZoom, 1);
+ } else {
+ _zoomTextOnly = YES;
+ double currentPageZoom = WKPageGetPageZoomFactor(_webView.pageRef);
+ WKPageSetPageAndTextZoomFactors(_webView.pageRef, 1, currentPageZoom);
+ }
+}
+
+- (IBAction)dumpSourceToConsole:(id)sender
+{
+ WKPageGetSourceForFrame_b(_webView.pageRef, WKPageGetMainFrame(_webView.pageRef), ^(WKStringRef result, WKErrorRef error) {
+ CFStringRef cfResult = WKStringCopyCFString(0, result);
+ LOG(@"Main frame source\n \"%@\"", (NSString *)cfResult);
+ CFRelease(cfResult);
+ });
+}
+
#pragma mark Loader Client Callbacks
-static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didStartProvisionalLoadForFrame:frame];
}
-static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didReceiveServerRedirectForProvisionalLoadForFrame:frame];
}
-static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didFailProvisionalLoadWithErrorForFrame:frame];
}
-static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didCommitLoadForFrame:frame];
}
-static void didFinishDocumentLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didFinishDocumentLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
{
LOG(@"didFinishDocumentLoadForFrame");
}
-static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
{
LOG(@"didFinishLoadForFrame");
}
-static void didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didFailLoadWithErrorForFrame:frame];
}
-static void didReceiveTitleForFrame(WKPageRef page, WKStringRef title, WKFrameRef frame, const void *clientInfo)
+static void didReceiveTitleForFrame(WKPageRef page, WKStringRef title, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
{
CFStringRef cfTitle = WKStringCopyCFString(0, title);
LOG(@"didReceiveTitleForFrame \"%@\"", (NSString *)cfTitle);
CFRelease(cfTitle);
}
-static void didFirstLayoutForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didFirstLayoutForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
{
LOG(@"didFirstLayoutForFrame");
}
-static void didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+static void didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
{
LOG(@"didFirstVisuallyNonEmptyLayoutForFrame");
}
@@ -241,13 +337,13 @@ static void didChangeBackForwardList(WKPageRef page, const void *clientInfo)
#pragma mark Policy Client Callbacks
-static void decidePolicyForNavigationAction(WKPageRef page, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
+static void decidePolicyForNavigationAction(WKPageRef page, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
{
LOG(@"decidePolicyForNavigationAction");
WKFramePolicyListenerUse(listener);
}
-static void decidePolicyForNewWindowAction(WKPageRef page, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
+static void decidePolicyForNewWindowAction(WKPageRef page, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
{
LOG(@"decidePolicyForNewWindowAction");
WKFramePolicyListenerUse(listener);
@@ -368,6 +464,16 @@ static WKStringRef runJavaScriptPrompt(WKPageRef page, WKStringRef message, WKSt
return WKStringCreateWithCFString((CFStringRef)result);
}
+static void setStatusText(WKPageRef page, WKStringRef text, const void* clientInfo)
+{
+ LOG(@"setStatusText");
+}
+
+static void contentsSizeChanged(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo)
+{
+ LOG(@"contentsSizeChanged");
+}
+
- (void)awakeFromNib
{
_webView = [[WKView alloc] initWithFrame:[containerView frame] pageNamespaceRef:_pageNamespace];
@@ -418,7 +524,8 @@ static WKStringRef runJavaScriptPrompt(WKPageRef page, WKStringRef message, WKSt
runJavaScriptAlert,
runJavaScriptConfirm,
runJavaScriptPrompt,
- 0 /* contentsSizeChanged */
+ setStatusText,
+ contentsSizeChanged
};
WKPageSetPageUIClient(_webView.pageRef, &uiClient);
}
diff --git a/WebKitTools/MiniBrowser/mac/MainMenu.xib b/WebKitTools/MiniBrowser/mac/MainMenu.xib
index 229611c..634f615 100644
--- a/WebKitTools/MiniBrowser/mac/MainMenu.xib
+++ b/WebKitTools/MiniBrowser/mac/MainMenu.xib
@@ -2,13 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1060</int>
- <string key="IBDocument.SystemVersion">10D573</string>
- <string key="IBDocument.InterfaceBuilderVersion">762</string>
+ <string key="IBDocument.SystemVersion">10F569</string>
+ <string key="IBDocument.InterfaceBuilderVersion">788</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
- <string key="IBDocument.HIToolboxVersion">460.00</string>
+ <string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="NS.object.0">762</string>
+ <string key="NS.object.0">788</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -713,490 +713,6 @@
</object>
</object>
</object>
- <object class="NSMenuItem" id="302598603">
- <reference key="NSMenu" ref="649796088"/>
- <string key="NSTitle">Format</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="941447902">
- <string key="NSTitle">Format</string>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="792887677">
- <reference key="NSMenu" ref="941447902"/>
- <string key="NSTitle">Font</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="786677654">
- <string key="NSTitle">Font</string>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="159677712">
- <reference key="NSMenu" ref="786677654"/>
- <string key="NSTitle">Show Fonts</string>
- <string key="NSKeyEquiv">t</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="305399458">
- <reference key="NSMenu" ref="786677654"/>
- <string key="NSTitle">Bold</string>
- <string key="NSKeyEquiv">b</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- <int key="NSTag">2</int>
- </object>
- <object class="NSMenuItem" id="814362025">
- <reference key="NSMenu" ref="786677654"/>
- <string key="NSTitle">Italic</string>
- <string key="NSKeyEquiv">i</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- <int key="NSTag">1</int>
- </object>
- <object class="NSMenuItem" id="330926929">
- <reference key="NSMenu" ref="786677654"/>
- <string key="NSTitle">Underline</string>
- <string key="NSKeyEquiv">u</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="533507878">
- <reference key="NSMenu" ref="786677654"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="158063935">
- <reference key="NSMenu" ref="786677654"/>
- <string key="NSTitle">Bigger</string>
- <string key="NSKeyEquiv">+</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- <int key="NSTag">3</int>
- </object>
- <object class="NSMenuItem" id="885547335">
- <reference key="NSMenu" ref="786677654"/>
- <string key="NSTitle">Smaller</string>
- <string key="NSKeyEquiv">-</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- <int key="NSTag">4</int>
- </object>
- <object class="NSMenuItem" id="901062459">
- <reference key="NSMenu" ref="786677654"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="767671776">
- <reference key="NSMenu" ref="786677654"/>
- <string key="NSTitle">Kern</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="175441468">
- <string key="NSTitle">Kern</string>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="252969304">
- <reference key="NSMenu" ref="175441468"/>
- <string key="NSTitle">Use Default</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="766922938">
- <reference key="NSMenu" ref="175441468"/>
- <string key="NSTitle">Use None</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="677519740">
- <reference key="NSMenu" ref="175441468"/>
- <string key="NSTitle">Tighten</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="238351151">
- <reference key="NSMenu" ref="175441468"/>
- <string key="NSTitle">Loosen</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- </object>
- </object>
- </object>
- <object class="NSMenuItem" id="691570813">
- <reference key="NSMenu" ref="786677654"/>
- <string key="NSTitle">Ligature</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="1058217995">
- <string key="NSTitle">Ligature</string>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="706297211">
- <reference key="NSMenu" ref="1058217995"/>
- <string key="NSTitle">Use Default</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="568384683">
- <reference key="NSMenu" ref="1058217995"/>
- <string key="NSTitle">Use None</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="663508465">
- <reference key="NSMenu" ref="1058217995"/>
- <string key="NSTitle">Use All</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- </object>
- </object>
- </object>
- <object class="NSMenuItem" id="769124883">
- <reference key="NSMenu" ref="786677654"/>
- <string key="NSTitle">Baseline</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="18263474">
- <string key="NSTitle">Baseline</string>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="257962622">
- <reference key="NSMenu" ref="18263474"/>
- <string key="NSTitle">Use Default</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="644725453">
- <reference key="NSMenu" ref="18263474"/>
- <string key="NSTitle">Superscript</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="1037576581">
- <reference key="NSMenu" ref="18263474"/>
- <string key="NSTitle">Subscript</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="941806246">
- <reference key="NSMenu" ref="18263474"/>
- <string key="NSTitle">Raise</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="1045724900">
- <reference key="NSMenu" ref="18263474"/>
- <string key="NSTitle">Lower</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- </object>
- </object>
- </object>
- <object class="NSMenuItem" id="739652853">
- <reference key="NSMenu" ref="786677654"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="1012600125">
- <reference key="NSMenu" ref="786677654"/>
- <string key="NSTitle">Show Colors</string>
- <string key="NSKeyEquiv">C</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="214559597">
- <reference key="NSMenu" ref="786677654"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="596732606">
- <reference key="NSMenu" ref="786677654"/>
- <string key="NSTitle">Copy Style</string>
- <string key="NSKeyEquiv">c</string>
- <int key="NSKeyEquivModMask">1572864</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="393423671">
- <reference key="NSMenu" ref="786677654"/>
- <string key="NSTitle">Paste Style</string>
- <string key="NSKeyEquiv">v</string>
- <int key="NSKeyEquivModMask">1572864</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- </object>
- <string key="NSName">_NSFontMenu</string>
- </object>
- </object>
- <object class="NSMenuItem" id="215659978">
- <reference key="NSMenu" ref="941447902"/>
- <string key="NSTitle">Text</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="446991534">
- <string key="NSTitle">Text</string>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="875092757">
- <reference key="NSMenu" ref="446991534"/>
- <string key="NSTitle">Align Left</string>
- <string key="NSKeyEquiv">{</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="630155264">
- <reference key="NSMenu" ref="446991534"/>
- <string key="NSTitle">Center</string>
- <string key="NSKeyEquiv">|</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="945678886">
- <reference key="NSMenu" ref="446991534"/>
- <string key="NSTitle">Justify</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="512868991">
- <reference key="NSMenu" ref="446991534"/>
- <string key="NSTitle">Align Right</string>
- <string key="NSKeyEquiv">}</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="163117631">
- <reference key="NSMenu" ref="446991534"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="31516759">
- <reference key="NSMenu" ref="446991534"/>
- <string key="NSTitle">Writing Direction</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="956096989">
- <string key="NSTitle">Writing Direction</string>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="257099033">
- <reference key="NSMenu" ref="956096989"/>
- <bool key="NSIsDisabled">YES</bool>
- <string key="NSTitle">Paragraph</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="551969625">
- <reference key="NSMenu" ref="956096989"/>
- <string type="base64-UTF8" key="NSTitle">CURlZmF1bHQ</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="249532473">
- <reference key="NSMenu" ref="956096989"/>
- <string type="base64-UTF8" key="NSTitle">CUxlZnQgdG8gUmlnaHQ</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="607364498">
- <reference key="NSMenu" ref="956096989"/>
- <string type="base64-UTF8" key="NSTitle">CVJpZ2h0IHRvIExlZnQ</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="508151438">
- <reference key="NSMenu" ref="956096989"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="981751889">
- <reference key="NSMenu" ref="956096989"/>
- <bool key="NSIsDisabled">YES</bool>
- <string key="NSTitle">Selection</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="380031999">
- <reference key="NSMenu" ref="956096989"/>
- <string type="base64-UTF8" key="NSTitle">CURlZmF1bHQ</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="825984362">
- <reference key="NSMenu" ref="956096989"/>
- <string type="base64-UTF8" key="NSTitle">CUxlZnQgdG8gUmlnaHQ</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="560145579">
- <reference key="NSMenu" ref="956096989"/>
- <string type="base64-UTF8" key="NSTitle">CVJpZ2h0IHRvIExlZnQ</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- </object>
- </object>
- </object>
- <object class="NSMenuItem" id="908105787">
- <reference key="NSMenu" ref="446991534"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="644046920">
- <reference key="NSMenu" ref="446991534"/>
- <string key="NSTitle">Show Ruler</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="231811626">
- <reference key="NSMenu" ref="446991534"/>
- <string key="NSTitle">Copy Ruler</string>
- <string key="NSKeyEquiv">c</string>
- <int key="NSKeyEquivModMask">1310720</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- <object class="NSMenuItem" id="883618387">
- <reference key="NSMenu" ref="446991534"/>
- <string key="NSTitle">Paste Ruler</string>
- <string key="NSKeyEquiv">v</string>
- <int key="NSKeyEquivModMask">1310720</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="35465992"/>
- <reference key="NSMixedImage" ref="502551668"/>
- </object>
- </object>
- </object>
- </object>
- </object>
- </object>
- </object>
<object class="NSMenuItem" id="586577488">
<reference key="NSMenu" ref="649796088"/>
<string key="NSTitle">View</string>
@@ -1228,6 +744,51 @@
<reference key="NSOnImage" ref="35465992"/>
<reference key="NSMixedImage" ref="502551668"/>
</object>
+ <object class="NSMenuItem" id="1025359947">
+ <reference key="NSMenu" ref="466310130"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="694544109">
+ <reference key="NSMenu" ref="466310130"/>
+ <string key="NSTitle">Zoom In</string>
+ <string key="NSKeyEquiv">+</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="943694335">
+ <reference key="NSMenu" ref="466310130"/>
+ <string key="NSTitle">Zoom Out</string>
+ <string key="NSKeyEquiv">-</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="863984465">
+ <reference key="NSMenu" ref="466310130"/>
+ <string key="NSTitle">Reset Zoom</string>
+ <string key="NSKeyEquiv">0</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="138443116">
+ <reference key="NSMenu" ref="466310130"/>
+ <string key="NSTitle">Zoom Text Only</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
</object>
</object>
</object>
@@ -1407,6 +968,24 @@
</object>
</object>
</object>
+ <object class="NSMenuItem" id="377902755">
+ <reference key="NSMenu" ref="865232259"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="191469404">
+ <reference key="NSMenu" ref="865232259"/>
+ <string key="NSTitle">Dump Source To Console</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
</object>
</object>
</object>
@@ -1705,174 +1284,6 @@
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">addFontTrait:</string>
- <reference key="source" ref="755631768"/>
- <reference key="destination" ref="305399458"/>
- </object>
- <int key="connectionID">421</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">addFontTrait:</string>
- <reference key="source" ref="755631768"/>
- <reference key="destination" ref="814362025"/>
- </object>
- <int key="connectionID">422</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">modifyFont:</string>
- <reference key="source" ref="755631768"/>
- <reference key="destination" ref="885547335"/>
- </object>
- <int key="connectionID">423</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">orderFrontFontPanel:</string>
- <reference key="source" ref="755631768"/>
- <reference key="destination" ref="159677712"/>
- </object>
- <int key="connectionID">424</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">modifyFont:</string>
- <reference key="source" ref="755631768"/>
- <reference key="destination" ref="158063935"/>
- </object>
- <int key="connectionID">425</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">raiseBaseline:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="941806246"/>
- </object>
- <int key="connectionID">426</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">lowerBaseline:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="1045724900"/>
- </object>
- <int key="connectionID">427</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">copyFont:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="596732606"/>
- </object>
- <int key="connectionID">428</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">subscript:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="1037576581"/>
- </object>
- <int key="connectionID">429</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">superscript:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="644725453"/>
- </object>
- <int key="connectionID">430</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">tightenKerning:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="677519740"/>
- </object>
- <int key="connectionID">431</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">underline:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="330926929"/>
- </object>
- <int key="connectionID">432</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">orderFrontColorPanel:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="1012600125"/>
- </object>
- <int key="connectionID">433</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">useAllLigatures:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="663508465"/>
- </object>
- <int key="connectionID">434</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">loosenKerning:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="238351151"/>
- </object>
- <int key="connectionID">435</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">pasteFont:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="393423671"/>
- </object>
- <int key="connectionID">436</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">unscript:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="257962622"/>
- </object>
- <int key="connectionID">437</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">useStandardKerning:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="252969304"/>
- </object>
- <int key="connectionID">438</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">useStandardLigatures:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="706297211"/>
- </object>
- <int key="connectionID">439</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">turnOffLigatures:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="568384683"/>
- </object>
- <int key="connectionID">440</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">turnOffKerning:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="766922938"/>
- </object>
- <int key="connectionID">441</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
<string key="label">terminate:</string>
<reference key="source" ref="1050"/>
<reference key="destination" ref="632727374"/>
@@ -1985,163 +1396,99 @@
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">alignCenter:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="630155264"/>
- </object>
- <int key="connectionID">518</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">pasteRuler:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="883618387"/>
- </object>
- <int key="connectionID">519</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">toggleRuler:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="644046920"/>
- </object>
- <int key="connectionID">520</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">alignRight:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="512868991"/>
- </object>
- <int key="connectionID">521</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">copyRuler:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="231811626"/>
- </object>
- <int key="connectionID">522</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">alignJustified:</string>
+ <string key="label">newWindow:</string>
<reference key="source" ref="1014"/>
- <reference key="destination" ref="945678886"/>
+ <reference key="destination" ref="705341025"/>
</object>
- <int key="connectionID">523</int>
+ <int key="connectionID">533</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">alignLeft:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="875092757"/>
+ <string key="label">setSharedProcessProcessModel:</string>
+ <reference key="source" ref="976324537"/>
+ <reference key="destination" ref="993856752"/>
</object>
- <int key="connectionID">524</int>
+ <int key="connectionID">543</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">makeBaseWritingDirectionNatural:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="551969625"/>
+ <string key="label">setSharedThreadProcessModel:</string>
+ <reference key="source" ref="976324537"/>
+ <reference key="destination" ref="516840223"/>
</object>
- <int key="connectionID">525</int>
+ <int key="connectionID">544</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">makeBaseWritingDirectionLeftToRight:</string>
+ <string key="label">forceRepaint:</string>
<reference key="source" ref="1014"/>
- <reference key="destination" ref="249532473"/>
+ <reference key="destination" ref="878165919"/>
</object>
- <int key="connectionID">526</int>
+ <int key="connectionID">547</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">makeBaseWritingDirectionRightToLeft:</string>
+ <string key="label">showHideWebView:</string>
<reference key="source" ref="1014"/>
- <reference key="destination" ref="607364498"/>
+ <reference key="destination" ref="137933275"/>
</object>
- <int key="connectionID">527</int>
+ <int key="connectionID">549</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">makeTextWritingDirectionNatural:</string>
+ <string key="label">removeReinsertWebView:</string>
<reference key="source" ref="1014"/>
- <reference key="destination" ref="380031999"/>
+ <reference key="destination" ref="1027125810"/>
</object>
- <int key="connectionID">528</int>
+ <int key="connectionID">551</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">makeTextWritingDirectionLeftToRight:</string>
- <reference key="source" ref="1014"/>
- <reference key="destination" ref="825984362"/>
+ <string key="label">showStatisticsWindow:</string>
+ <reference key="source" ref="976324537"/>
+ <reference key="destination" ref="208343368"/>
</object>
- <int key="connectionID">529</int>
+ <int key="connectionID">554</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">makeTextWritingDirectionRightToLeft:</string>
+ <string key="label">zoomIn:</string>
<reference key="source" ref="1014"/>
- <reference key="destination" ref="560145579"/>
+ <reference key="destination" ref="694544109"/>
</object>
- <int key="connectionID">530</int>
+ <int key="connectionID">559</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">newWindow:</string>
+ <string key="label">zoomOut:</string>
<reference key="source" ref="1014"/>
- <reference key="destination" ref="705341025"/>
- </object>
- <int key="connectionID">533</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">setSharedProcessProcessModel:</string>
- <reference key="source" ref="976324537"/>
- <reference key="destination" ref="993856752"/>
+ <reference key="destination" ref="943694335"/>
</object>
- <int key="connectionID">543</int>
+ <int key="connectionID">560</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">setSharedThreadProcessModel:</string>
- <reference key="source" ref="976324537"/>
- <reference key="destination" ref="516840223"/>
- </object>
- <int key="connectionID">544</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">forceRepaint:</string>
+ <string key="label">resetZoom:</string>
<reference key="source" ref="1014"/>
- <reference key="destination" ref="878165919"/>
+ <reference key="destination" ref="863984465"/>
</object>
- <int key="connectionID">547</int>
+ <int key="connectionID">561</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">showHideWebView:</string>
+ <string key="label">toggleZoomMode:</string>
<reference key="source" ref="1014"/>
- <reference key="destination" ref="137933275"/>
+ <reference key="destination" ref="138443116"/>
</object>
- <int key="connectionID">549</int>
+ <int key="connectionID">564</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">removeReinsertWebView:</string>
+ <string key="label">dumpSourceToConsole:</string>
<reference key="source" ref="1014"/>
- <reference key="destination" ref="1027125810"/>
+ <reference key="destination" ref="191469404"/>
</object>
- <int key="connectionID">551</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">showStatisticsWindow:</string>
- <reference key="source" ref="976324537"/>
- <reference key="destination" ref="208343368"/>
- </object>
- <int key="connectionID">554</int>
+ <int key="connectionID">567</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -2181,7 +1528,6 @@
<reference ref="952259628"/>
<reference ref="379814623"/>
<reference ref="586577488"/>
- <reference ref="302598603"/>
<reference ref="448692316"/>
<reference ref="816668511"/>
</object>
@@ -2599,6 +1945,11 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="102151532"/>
<reference ref="237841660"/>
+ <reference ref="694544109"/>
+ <reference ref="1025359947"/>
+ <reference ref="943694335"/>
+ <reference ref="863984465"/>
+ <reference ref="138443116"/>
</object>
<reference key="parent" ref="586577488"/>
</object>
@@ -2686,246 +2037,6 @@
<reference key="parent" ref="698887838"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">375</int>
- <reference key="object" ref="302598603"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="941447902"/>
- </object>
- <reference key="parent" ref="649796088"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">376</int>
- <reference key="object" ref="941447902"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="792887677"/>
- <reference ref="215659978"/>
- </object>
- <reference key="parent" ref="302598603"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">377</int>
- <reference key="object" ref="792887677"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="786677654"/>
- </object>
- <reference key="parent" ref="941447902"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">388</int>
- <reference key="object" ref="786677654"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="159677712"/>
- <reference ref="305399458"/>
- <reference ref="814362025"/>
- <reference ref="330926929"/>
- <reference ref="533507878"/>
- <reference ref="158063935"/>
- <reference ref="885547335"/>
- <reference ref="901062459"/>
- <reference ref="767671776"/>
- <reference ref="691570813"/>
- <reference ref="769124883"/>
- <reference ref="739652853"/>
- <reference ref="1012600125"/>
- <reference ref="214559597"/>
- <reference ref="596732606"/>
- <reference ref="393423671"/>
- </object>
- <reference key="parent" ref="792887677"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">389</int>
- <reference key="object" ref="159677712"/>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">390</int>
- <reference key="object" ref="305399458"/>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">391</int>
- <reference key="object" ref="814362025"/>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">392</int>
- <reference key="object" ref="330926929"/>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">393</int>
- <reference key="object" ref="533507878"/>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">394</int>
- <reference key="object" ref="158063935"/>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">395</int>
- <reference key="object" ref="885547335"/>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">396</int>
- <reference key="object" ref="901062459"/>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">397</int>
- <reference key="object" ref="767671776"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="175441468"/>
- </object>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">398</int>
- <reference key="object" ref="691570813"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="1058217995"/>
- </object>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">399</int>
- <reference key="object" ref="769124883"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="18263474"/>
- </object>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">400</int>
- <reference key="object" ref="739652853"/>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">401</int>
- <reference key="object" ref="1012600125"/>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">402</int>
- <reference key="object" ref="214559597"/>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">403</int>
- <reference key="object" ref="596732606"/>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">404</int>
- <reference key="object" ref="393423671"/>
- <reference key="parent" ref="786677654"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">405</int>
- <reference key="object" ref="18263474"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="257962622"/>
- <reference ref="644725453"/>
- <reference ref="1037576581"/>
- <reference ref="941806246"/>
- <reference ref="1045724900"/>
- </object>
- <reference key="parent" ref="769124883"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">406</int>
- <reference key="object" ref="257962622"/>
- <reference key="parent" ref="18263474"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">407</int>
- <reference key="object" ref="644725453"/>
- <reference key="parent" ref="18263474"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">408</int>
- <reference key="object" ref="1037576581"/>
- <reference key="parent" ref="18263474"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">409</int>
- <reference key="object" ref="941806246"/>
- <reference key="parent" ref="18263474"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">410</int>
- <reference key="object" ref="1045724900"/>
- <reference key="parent" ref="18263474"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">411</int>
- <reference key="object" ref="1058217995"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="706297211"/>
- <reference ref="568384683"/>
- <reference ref="663508465"/>
- </object>
- <reference key="parent" ref="691570813"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">412</int>
- <reference key="object" ref="706297211"/>
- <reference key="parent" ref="1058217995"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">413</int>
- <reference key="object" ref="568384683"/>
- <reference key="parent" ref="1058217995"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">414</int>
- <reference key="object" ref="663508465"/>
- <reference key="parent" ref="1058217995"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">415</int>
- <reference key="object" ref="175441468"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="252969304"/>
- <reference ref="766922938"/>
- <reference ref="677519740"/>
- <reference ref="238351151"/>
- </object>
- <reference key="parent" ref="767671776"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">416</int>
- <reference key="object" ref="252969304"/>
- <reference key="parent" ref="175441468"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">417</int>
- <reference key="object" ref="766922938"/>
- <reference key="parent" ref="175441468"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">418</int>
- <reference key="object" ref="677519740"/>
- <reference key="parent" ref="175441468"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">419</int>
- <reference key="object" ref="238351151"/>
- <reference key="parent" ref="175441468"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">420</int>
<reference key="object" ref="755631768"/>
<reference key="parent" ref="0"/>
@@ -3029,149 +2140,6 @@
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">496</int>
- <reference key="object" ref="215659978"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="446991534"/>
- </object>
- <reference key="parent" ref="941447902"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">497</int>
- <reference key="object" ref="446991534"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="875092757"/>
- <reference ref="630155264"/>
- <reference ref="945678886"/>
- <reference ref="512868991"/>
- <reference ref="163117631"/>
- <reference ref="31516759"/>
- <reference ref="908105787"/>
- <reference ref="644046920"/>
- <reference ref="231811626"/>
- <reference ref="883618387"/>
- </object>
- <reference key="parent" ref="215659978"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">498</int>
- <reference key="object" ref="875092757"/>
- <reference key="parent" ref="446991534"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">499</int>
- <reference key="object" ref="630155264"/>
- <reference key="parent" ref="446991534"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">500</int>
- <reference key="object" ref="945678886"/>
- <reference key="parent" ref="446991534"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">501</int>
- <reference key="object" ref="512868991"/>
- <reference key="parent" ref="446991534"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">502</int>
- <reference key="object" ref="163117631"/>
- <reference key="parent" ref="446991534"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">503</int>
- <reference key="object" ref="31516759"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="956096989"/>
- </object>
- <reference key="parent" ref="446991534"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">504</int>
- <reference key="object" ref="908105787"/>
- <reference key="parent" ref="446991534"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">505</int>
- <reference key="object" ref="644046920"/>
- <reference key="parent" ref="446991534"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">506</int>
- <reference key="object" ref="231811626"/>
- <reference key="parent" ref="446991534"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">507</int>
- <reference key="object" ref="883618387"/>
- <reference key="parent" ref="446991534"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">508</int>
- <reference key="object" ref="956096989"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="257099033"/>
- <reference ref="551969625"/>
- <reference ref="249532473"/>
- <reference ref="607364498"/>
- <reference ref="508151438"/>
- <reference ref="981751889"/>
- <reference ref="380031999"/>
- <reference ref="825984362"/>
- <reference ref="560145579"/>
- </object>
- <reference key="parent" ref="31516759"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">509</int>
- <reference key="object" ref="257099033"/>
- <reference key="parent" ref="956096989"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">510</int>
- <reference key="object" ref="551969625"/>
- <reference key="parent" ref="956096989"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">511</int>
- <reference key="object" ref="249532473"/>
- <reference key="parent" ref="956096989"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">512</int>
- <reference key="object" ref="607364498"/>
- <reference key="parent" ref="956096989"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">513</int>
- <reference key="object" ref="508151438"/>
- <reference key="parent" ref="956096989"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">514</int>
- <reference key="object" ref="981751889"/>
- <reference key="parent" ref="956096989"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">515</int>
- <reference key="object" ref="380031999"/>
- <reference key="parent" ref="956096989"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">516</int>
- <reference key="object" ref="825984362"/>
- <reference key="parent" ref="956096989"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">517</int>
- <reference key="object" ref="560145579"/>
- <reference key="parent" ref="956096989"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">534</int>
<reference key="object" ref="816668511"/>
<object class="NSMutableArray" key="children">
@@ -3192,6 +2160,8 @@
<reference ref="1027125810"/>
<reference ref="864702084"/>
<reference ref="208343368"/>
+ <reference ref="377902755"/>
+ <reference ref="191469404"/>
</object>
<reference key="parent" ref="816668511"/>
</object>
@@ -3257,6 +2227,41 @@
<reference key="object" ref="864702084"/>
<reference key="parent" ref="865232259"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">555</int>
+ <reference key="object" ref="694544109"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">556</int>
+ <reference key="object" ref="1025359947"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">557</int>
+ <reference key="object" ref="943694335"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">558</int>
+ <reference key="object" ref="863984465"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">562</int>
+ <reference key="object" ref="138443116"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">565</int>
+ <reference key="object" ref="377902755"/>
+ <reference key="parent" ref="865232259"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">566</int>
+ <reference key="object" ref="191469404"/>
+ <reference key="parent" ref="865232259"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -3392,43 +2397,6 @@
<string>351.ImportedFromIB2</string>
<string>354.IBPluginDependency</string>
<string>354.ImportedFromIB2</string>
- <string>375.IBPluginDependency</string>
- <string>376.IBEditorWindowLastContentRect</string>
- <string>376.IBPluginDependency</string>
- <string>377.IBPluginDependency</string>
- <string>388.IBEditorWindowLastContentRect</string>
- <string>388.IBPluginDependency</string>
- <string>389.IBPluginDependency</string>
- <string>390.IBPluginDependency</string>
- <string>391.IBPluginDependency</string>
- <string>392.IBPluginDependency</string>
- <string>393.IBPluginDependency</string>
- <string>394.IBPluginDependency</string>
- <string>395.IBPluginDependency</string>
- <string>396.IBPluginDependency</string>
- <string>397.IBPluginDependency</string>
- <string>398.IBPluginDependency</string>
- <string>399.IBPluginDependency</string>
- <string>400.IBPluginDependency</string>
- <string>401.IBPluginDependency</string>
- <string>402.IBPluginDependency</string>
- <string>403.IBPluginDependency</string>
- <string>404.IBPluginDependency</string>
- <string>405.IBPluginDependency</string>
- <string>406.IBPluginDependency</string>
- <string>407.IBPluginDependency</string>
- <string>408.IBPluginDependency</string>
- <string>409.IBPluginDependency</string>
- <string>410.IBPluginDependency</string>
- <string>411.IBPluginDependency</string>
- <string>412.IBPluginDependency</string>
- <string>413.IBPluginDependency</string>
- <string>414.IBPluginDependency</string>
- <string>415.IBPluginDependency</string>
- <string>416.IBPluginDependency</string>
- <string>417.IBPluginDependency</string>
- <string>418.IBPluginDependency</string>
- <string>419.IBPluginDependency</string>
<string>450.IBPluginDependency</string>
<string>451.IBEditorWindowLastContentRect</string>
<string>451.IBPluginDependency</string>
@@ -3446,32 +2414,8 @@
<string>491.IBEditorWindowLastContentRect</string>
<string>491.IBPluginDependency</string>
<string>492.IBPluginDependency</string>
- <string>496.IBPluginDependency</string>
- <string>497.IBEditorWindowLastContentRect</string>
- <string>497.IBPluginDependency</string>
- <string>498.IBPluginDependency</string>
- <string>499.IBPluginDependency</string>
<string>5.IBPluginDependency</string>
<string>5.ImportedFromIB2</string>
- <string>500.IBPluginDependency</string>
- <string>501.IBPluginDependency</string>
- <string>502.IBPluginDependency</string>
- <string>503.IBPluginDependency</string>
- <string>504.IBPluginDependency</string>
- <string>505.IBPluginDependency</string>
- <string>506.IBPluginDependency</string>
- <string>507.IBPluginDependency</string>
- <string>508.IBEditorWindowLastContentRect</string>
- <string>508.IBPluginDependency</string>
- <string>509.IBPluginDependency</string>
- <string>510.IBPluginDependency</string>
- <string>511.IBPluginDependency</string>
- <string>512.IBPluginDependency</string>
- <string>513.IBPluginDependency</string>
- <string>514.IBPluginDependency</string>
- <string>515.IBPluginDependency</string>
- <string>516.IBPluginDependency</string>
- <string>517.IBPluginDependency</string>
<string>534.IBPluginDependency</string>
<string>535.IBEditorWindowLastContentRect</string>
<string>535.IBPluginDependency</string>
@@ -3486,8 +2430,15 @@
<string>550.IBPluginDependency</string>
<string>552.IBPluginDependency</string>
<string>553.IBPluginDependency</string>
+ <string>555.IBPluginDependency</string>
+ <string>556.IBPluginDependency</string>
+ <string>557.IBPluginDependency</string>
+ <string>558.IBPluginDependency</string>
<string>56.IBPluginDependency</string>
<string>56.ImportedFromIB2</string>
+ <string>562.IBPluginDependency</string>
+ <string>565.IBPluginDependency</string>
+ <string>566.IBPluginDependency</string>
<string>57.IBEditorWindowLastContentRect</string>
<string>57.IBPluginDependency</string>
<string>57.ImportedFromIB2</string>
@@ -3578,7 +2529,7 @@
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
- <string>{{546, 553}, {254, 283}}</string>
+ <string>{{650, 538}, {254, 283}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{187, 434}, {243, 243}}</string>
@@ -3623,17 +2574,17 @@
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
- <string>{{639, 872}, {194, 73}}</string>
+ <string>{{744, 748}, {194, 73}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{525, 802}, {197, 73}}</string>
- <string>{{317, 836}, {517, 20}}</string>
+ <string>{{488, 821}, {451, 20}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{74, 862}</string>
<string>{{6, 978}, {478, 20}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{656, 793}, {231, 43}}</string>
+ <string>{{694, 688}, {234, 133}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{475, 832}, {234, 43}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3653,43 +2604,6 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{527, 902}, {83, 43}}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{523, 2}, {178, 283}}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{753, 197}, {170, 63}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3703,29 +2617,16 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{714, 922}, {193, 23}}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{674, 260}, {204, 183}}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{881, 798}, {189, 23}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{864, 668}, {260, 153}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{878, 180}, {164, 173}}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{1110, 678}, {154, 43}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3733,10 +2634,6 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{759, 713}, {246, 123}}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{944, 872}, {154, 43}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3744,10 +2641,10 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
<string>{{286, 129}, {275, 183}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
@@ -3770,7 +2667,7 @@
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
- <string>{{504, 633}, {196, 203}}</string>
+ <string>{{608, 618}, {196, 203}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{145, 474}, {199, 203}}</string>
@@ -3798,7 +2695,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">554</int>
+ <int key="maxID">567</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -3821,6 +2718,30 @@
<string>id</string>
</object>
</object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>setSharedProcessProcessModel:</string>
+ <string>setSharedThreadProcessModel:</string>
+ <string>showStatisticsWindow:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">setSharedProcessProcessModel:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">setSharedThreadProcessModel:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">showStatisticsWindow:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">mac/AppDelegate.h</string>
@@ -3833,6 +2754,13 @@
<string key="NS.key.0">window</string>
<string key="NS.object.0">NSWindow</string>
</object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">window</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">window</string>
+ <string key="candidateClassName">NSWindow</string>
+ </object>
+ </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
@@ -3845,11 +2773,18 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <string>dumpSourceToConsole:</string>
<string>fetch:</string>
<string>forceRepaint:</string>
+ <string>goBack:</string>
+ <string>goForward:</string>
<string>reload:</string>
<string>removeReinsertWebView:</string>
+ <string>resetZoom:</string>
<string>showHideWebView:</string>
+ <string>toggleZoomMode:</string>
+ <string>zoomIn:</string>
+ <string>zoomOut:</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -3858,25 +2793,151 @@
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>dumpSourceToConsole:</string>
+ <string>fetch:</string>
+ <string>forceRepaint:</string>
+ <string>goBack:</string>
+ <string>goForward:</string>
+ <string>reload:</string>
+ <string>removeReinsertWebView:</string>
+ <string>resetZoom:</string>
+ <string>showHideWebView:</string>
+ <string>toggleZoomMode:</string>
+ <string>zoomIn:</string>
+ <string>zoomOut:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">dumpSourceToConsole:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">fetch:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">forceRepaint:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">goBack:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">goForward:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">reload:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">removeReinsertWebView:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">resetZoom:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">showHideWebView:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">toggleZoomMode:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">zoomIn:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">zoomOut:</string>
+ <string key="candidateClassName">id</string>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <string>backButton</string>
<string>containerView</string>
+ <string>forwardButton</string>
<string>progressIndicator</string>
<string>reloadButton</string>
+ <string>toolbar</string>
<string>urlText</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSButton</string>
<string>NSView</string>
+ <string>NSButton</string>
<string>NSProgressIndicator</string>
<string>NSButton</string>
+ <string>NSToolbar</string>
<string>NSTextField</string>
</object>
</object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>backButton</string>
+ <string>containerView</string>
+ <string>forwardButton</string>
+ <string>progressIndicator</string>
+ <string>reloadButton</string>
+ <string>toolbar</string>
+ <string>urlText</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">backButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">containerView</string>
+ <string key="candidateClassName">NSView</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">forwardButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">progressIndicator</string>
+ <string key="candidateClassName">NSProgressIndicator</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">reloadButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">toolbar</string>
+ <string key="candidateClassName">NSToolbar</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">urlText</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ </object>
+ </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">mac/BrowserWindowController.h</string>
@@ -3898,6 +2959,25 @@
<string>id</string>
</object>
</object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>forceRepaint:</string>
+ <string>newWindow:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">forceRepaint:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">newWindow:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
@@ -3997,6 +3077,45 @@
<string>id</string>
</object>
</object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>printDocument:</string>
+ <string>revertDocumentToSaved:</string>
+ <string>runPageLayout:</string>
+ <string>saveDocument:</string>
+ <string>saveDocumentAs:</string>
+ <string>saveDocumentTo:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">printDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">revertDocumentToSaved:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">runPageLayout:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">saveDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">saveDocumentAs:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">saveDocumentTo:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSDocument.h</string>
@@ -4029,6 +3148,35 @@
<string>id</string>
</object>
</object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>clearRecentDocuments:</string>
+ <string>newDocument:</string>
+ <string>openDocument:</string>
+ <string>saveAllDocuments:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">clearRecentDocuments:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">newDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">openDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">saveAllDocuments:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSDocumentController.h</string>
@@ -4376,6 +3524,14 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">NSToolbar</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSToolbar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
@@ -4427,6 +3583,13 @@
<string key="NS.key.0">showWindow:</string>
<string key="NS.object.0">id</string>
</object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">showWindow:</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">showWindow:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string>
@@ -4436,16 +3599,12 @@
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
- <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
- <integer value="1060" key="NS.object.0"/>
- </object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
- <string key="IBDocument.LastKnownRelativeProjectPath">../../MiniBrowser.xcodeproj</string>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../MiniBrowser.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<bool key="EncodedWithXMLCoder">YES</bool>
diff --git a/WebKitTools/MiniBrowser/qt/BrowserView.cpp b/WebKitTools/MiniBrowser/qt/BrowserView.cpp
index a5e06ec..ce101c2 100644
--- a/WebKitTools/MiniBrowser/qt/BrowserView.cpp
+++ b/WebKitTools/MiniBrowser/qt/BrowserView.cpp
@@ -39,9 +39,8 @@ static QWKPage* createNewPage(QWKPage* page)
BrowserView::BrowserView(QWidget* parent)
: QGraphicsView(parent)
, m_item(0)
+ , m_context(WKContextGetSharedProcessContext())
{
- m_context.adopt(WKContextGetSharedProcessContext());
-
WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(m_context.get()));
m_item = new QGraphicsWKView(pageNamespace.get(), QGraphicsWKView::Simple, 0);
diff --git a/WebKitTools/MiniBrowser/win/BrowserView.cpp b/WebKitTools/MiniBrowser/win/BrowserView.cpp
index d3d5e72..5e90fe2 100644
--- a/WebKitTools/MiniBrowser/win/BrowserView.cpp
+++ b/WebKitTools/MiniBrowser/win/BrowserView.cpp
@@ -60,6 +60,23 @@ static void runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef
{
}
+static bool runJavaScriptConfirm(WKPageRef page, WKStringRef message, WKFrameRef frame, const void* clientInfo)
+{
+ return false;
+}
+
+static WKStringRef runJavaScriptPrompt(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void* clientInfo)
+{
+ return 0;
+}
+
+static void setStatusText(WKPageRef page, WKStringRef text, const void* clientInfo)
+{
+}
+
+static void contentsSizeChanged(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo)
+{
+}
void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
{
@@ -84,8 +101,12 @@ void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
showPage,
closePage,
runJavaScriptAlert,
- 0 /* contentsSizeChanged */
+ runJavaScriptConfirm,
+ runJavaScriptPrompt,
+ setStatusText,
+ contentsSizeChanged
};
+
WKPageSetPageUIClient(WKViewGetPage(m_webView), &uiClient);
}
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.cpp b/WebKitTools/QtTestBrowser/launcherwindow.cpp
index 3b47f29..65bcee7 100644
--- a/WebKitTools/QtTestBrowser/launcherwindow.cpp
+++ b/WebKitTools/QtTestBrowser/launcherwindow.cpp
@@ -105,6 +105,9 @@ void LauncherWindow::initializeView()
{
delete m_view;
+ QUrl url = page()->mainFrame()->url();
+ setPage(new WebPage(this));
+
QSplitter* splitter = static_cast<QSplitter*>(centralWidget());
if (!m_windowOptions.useGraphicsView) {
@@ -128,6 +131,9 @@ void LauncherWindow::initializeView()
m_view = view;
}
+ if (url.isValid())
+ page()->mainFrame()->load(url);
+
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
m_touchMocking = false;
#endif
@@ -606,16 +612,20 @@ void LauncherWindow::print()
void LauncherWindow::screenshot()
{
QPixmap pixmap = QPixmap::grabWidget(m_view);
- QLabel* label = new QLabel;
+ QLabel* label = 0;
+#if !defined(Q_OS_SYMBIAN)
+ label = new QLabel;
label->setAttribute(Qt::WA_DeleteOnClose);
label->setWindowTitle("Screenshot - Preview");
label->setPixmap(pixmap);
label->show();
+#endif
QString fileName = QFileDialog::getSaveFileName(label, "Screenshot");
if (!fileName.isEmpty()) {
pixmap.save(fileName, "png");
- label->setWindowTitle(QString("Screenshot - Saved at %1").arg(fileName));
+ if (label)
+ label->setWindowTitle(QString("Screenshot - Saved at %1").arg(fileName));
}
#if defined(QT_CONFIGURED_WITH_OPENGL)
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.h b/WebKitTools/QtTestBrowser/launcherwindow.h
index 65f390d..d3b7f8e 100644
--- a/WebKitTools/QtTestBrowser/launcherwindow.h
+++ b/WebKitTools/QtTestBrowser/launcherwindow.h
@@ -148,8 +148,6 @@ protected slots:
/* void dumpPlugins() */
void dumpHtml();
- void initializeView();
-
void setTouchMocking(bool on);
void toggleWebView(bool graphicsBased);
void toggleAcceleratedCompositing(bool toggle);
@@ -183,11 +181,13 @@ signals:
private:
void init();
- bool isGraphicsBased() const;
+ void initializeView();
void createChrome();
void applyPrefs();
void applyZoom();
+ bool isGraphicsBased() const;
+
private:
static QVector<int> m_zoomLevels;
int m_currentZoom;
diff --git a/WebKitTools/QtTestBrowser/mainwindow.cpp b/WebKitTools/QtTestBrowser/mainwindow.cpp
index 1a9aa5f..fa8b87d 100644
--- a/WebKitTools/QtTestBrowser/mainwindow.cpp
+++ b/WebKitTools/QtTestBrowser/mainwindow.cpp
@@ -35,8 +35,9 @@
#include "locationedit.h"
#include "utils.h"
-MainWindow::MainWindow(const QString& url)
+MainWindow::MainWindow()
: m_page(new WebPage(this))
+ , m_toolBar(0)
{
setAttribute(Qt::WA_DeleteOnClose);
if (qgetenv("QTTESTBROWSER_USE_ARGB_VISUALS").toInt() == 1)
@@ -47,29 +48,31 @@ MainWindow::MainWindow(const QString& url)
void MainWindow::buildUI()
{
- QToolBar* bar = addToolBar("Navigation");
+ delete m_toolBar;
+
+ m_toolBar = addToolBar("Navigation");
#if defined(Q_OS_SYMBIAN)
- bar->setIconSize(QSize(16, 16));
+ m_toolBar->setIconSize(QSize(16, 16));
#endif
QAction* reloadAction = page()->action(QWebPage::Reload);
connect(reloadAction, SIGNAL(triggered()), this, SLOT(changeLocation()));
- bar->addAction(page()->action(QWebPage::Back));
- bar->addAction(page()->action(QWebPage::Forward));
- bar->addAction(reloadAction);
- bar->addAction(page()->action(QWebPage::Stop));
+ m_toolBar->addAction(page()->action(QWebPage::Back));
+ m_toolBar->addAction(page()->action(QWebPage::Forward));
+ m_toolBar->addAction(reloadAction);
+ m_toolBar->addAction(page()->action(QWebPage::Stop));
- urlEdit = new LocationEdit(this);
+ urlEdit = new LocationEdit(m_toolBar);
urlEdit->setSizePolicy(QSizePolicy::Expanding, urlEdit->sizePolicy().verticalPolicy());
connect(urlEdit, SIGNAL(returnPressed()), SLOT(changeLocation()));
- QCompleter* completer = new QCompleter(this);
+ QCompleter* completer = new QCompleter(m_toolBar);
urlEdit->setCompleter(completer);
completer->setModel(&urlModel);
#if defined(Q_OS_SYMBIAN)
addToolBarBreak();
addToolBar("Location")->addWidget(urlEdit);
#else
- bar->addWidget(urlEdit);
+ m_toolBar->addWidget(urlEdit);
#endif
connect(page()->mainFrame(), SIGNAL(titleChanged(const QString&)),
@@ -94,7 +97,15 @@ void MainWindow::buildUI()
page()->action(QWebPage::ToggleUnderline)->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_U));
}
-WebPage* MainWindow::page()
+void MainWindow::setPage(WebPage* page)
+{
+ delete m_page;
+ m_page = page;
+
+ buildUI();
+}
+
+WebPage* MainWindow::page() const
{
return m_page;
}
diff --git a/WebKitTools/QtTestBrowser/mainwindow.h b/WebKitTools/QtTestBrowser/mainwindow.h
index 6fbf9f4..3a39d57 100644
--- a/WebKitTools/QtTestBrowser/mainwindow.h
+++ b/WebKitTools/QtTestBrowser/mainwindow.h
@@ -42,14 +42,15 @@ class MainWindow : public QMainWindow {
Q_OBJECT
public:
- MainWindow(const QString& url = QString());
+ MainWindow();
void addCompleterEntry(const QUrl& url);
void load(const QString& url);
void load(const QUrl& url);
- WebPage* page();
+ WebPage* page() const;
+ void setPage(WebPage*);
protected slots:
void setAddressUrl(const QString& url);
@@ -61,11 +62,11 @@ protected slots:
private:
void buildUI();
+ WebPage* m_page;
+ QToolBar* m_toolBar;
QStringListModel urlModel;
QStringList urlList;
LocationEdit* urlEdit;
-
- WebPage* m_page;
};
#endif
diff --git a/WebKitTools/QtTestBrowser/webview.cpp b/WebKitTools/QtTestBrowser/webview.cpp
index bc8fad1..d8d89a9 100644
--- a/WebKitTools/QtTestBrowser/webview.cpp
+++ b/WebKitTools/QtTestBrowser/webview.cpp
@@ -59,7 +59,7 @@ WebViewGraphicsBased::WebViewGraphicsBased(QWidget* parent)
void WebViewGraphicsBased::setPage(QWebPage* page)
{
connect(page->mainFrame(), SIGNAL(contentsSizeChanged(const QSize&)), SLOT(contentsSizeChanged(const QSize&)));
- m_item->setPage(page);
+ graphicsWebView()->setPage(page);
}
void WebViewGraphicsBased::contentsSizeChanged(const QSize& size)
@@ -74,7 +74,7 @@ void WebViewGraphicsBased::setResizesToContents(bool b)
return;
m_resizesToContents = b;
- m_item->setResizesToContents(m_resizesToContents);
+ graphicsWebView()->setResizesToContents(m_resizesToContents);
// When setting resizesToContents ON, our web view widget will always size as big as the
// web content being displayed, and so will the QWebPage's viewport. It implies that internally
@@ -94,16 +94,16 @@ void WebViewGraphicsBased::setResizesToContents(bool b)
if (m_resizesToContents) {
setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
- m_item->page()->setPreferredContentsSize(size());
- QRectF itemRect(m_item->geometry().topLeft(), m_item->page()->mainFrame()->contentsSize());
- m_item->setGeometry(itemRect);
+ graphicsWebView()->page()->setPreferredContentsSize(size());
+ QRectF itemRect(graphicsWebView()->geometry().topLeft(), graphicsWebView()->page()->mainFrame()->contentsSize());
+ graphicsWebView()->setGeometry(itemRect);
scene()->setSceneRect(itemRect);
} else {
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- m_item->page()->setPreferredContentsSize(QSize());
+ graphicsWebView()->page()->setPreferredContentsSize(QSize());
QRect viewportRect(QPoint(0, 0), size());
- m_item->setGeometry(viewportRect);
+ graphicsWebView()->setGeometry(viewportRect);
scene()->setSceneRect(viewportRect);
}
}
@@ -115,12 +115,12 @@ void WebViewGraphicsBased::resizeEvent(QResizeEvent* event)
QSize size(event->size());
if (m_resizesToContents) {
- m_item->page()->setPreferredContentsSize(size);
+ graphicsWebView()->page()->setPreferredContentsSize(size);
return;
}
QRectF rect(QPoint(0, 0), size);
- m_item->setGeometry(rect);
+ graphicsWebView()->setGeometry(rect);
scene()->setSceneRect(rect);
}
@@ -152,14 +152,14 @@ void WebViewGraphicsBased::updateFrameRate()
void WebViewGraphicsBased::animatedFlip()
{
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- QSizeF center = m_item->boundingRect().size() / 2;
+ QSizeF center = graphicsWebView()->boundingRect().size() / 2;
QPointF centerPoint = QPointF(center.width(), center.height());
- m_item->setTransformOriginPoint(centerPoint);
+ graphicsWebView()->setTransformOriginPoint(centerPoint);
- QPropertyAnimation* animation = new QPropertyAnimation(m_item, "rotation", this);
+ QPropertyAnimation* animation = new QPropertyAnimation(graphicsWebView(), "rotation", this);
animation->setDuration(1000);
- int rotation = int(m_item->rotation());
+ int rotation = int(graphicsWebView()->rotation());
animation->setStartValue(rotation);
animation->setEndValue(rotation + 180 - (rotation % 180));
diff --git a/WebKitTools/QtTestBrowser/webview.h b/WebKitTools/QtTestBrowser/webview.h
index d0e1e57..aadf85c 100644
--- a/WebKitTools/QtTestBrowser/webview.h
+++ b/WebKitTools/QtTestBrowser/webview.h
@@ -75,8 +75,8 @@ public:
WebViewGraphicsBased(QWidget* parent);
void setPage(QWebPage* page);
- void setItemCacheMode(QGraphicsItem::CacheMode mode) { m_item->setCacheMode(mode); }
- QGraphicsItem::CacheMode itemCacheMode() { return m_item->cacheMode(); }
+ void setItemCacheMode(QGraphicsItem::CacheMode mode) { graphicsWebView()->setCacheMode(mode); }
+ QGraphicsItem::CacheMode itemCacheMode() { return graphicsWebView()->cacheMode(); }
void setFrameRateMeasurementEnabled(bool enabled);
bool frameRateMeasurementEnabled() const { return m_measureFps; }
@@ -87,21 +87,8 @@ public:
void setResizesToContents(bool b);
bool resizesToContents() const { return m_resizesToContents; }
- void setYRotation(qreal angle)
- {
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- QRectF r = m_item->boundingRect();
- m_item->setTransform(QTransform()
- .translate(r.width() / 2, r.height() / 2)
- .rotate(angle, Qt::YAxis)
- .translate(-r.width() / 2, -r.height() / 2));
-#endif
- m_yRotation = angle;
- }
- qreal yRotation() const
- {
- return m_yRotation;
- }
+ void setYRotation(qreal angle);
+ qreal yRotation() const { return m_yRotation; }
GraphicsWebView* graphicsWebView() const { return m_item; }
@@ -128,4 +115,16 @@ private:
FpsTimer m_fpsTimer;
};
+inline void WebViewGraphicsBased::setYRotation(qreal angle)
+{
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QRectF r = graphicsWebView()->boundingRect();
+ graphicsWebView()->setTransform(QTransform()
+ .translate(r.width() / 2, r.height() / 2)
+ .rotate(angle, Qt::YAxis)
+ .translate(-r.width() / 2, -r.height() / 2));
+#endif
+ m_yRotation = angle;
+}
+
#endif
diff --git a/WebKitTools/QueueStatusServer/app.yaml b/WebKitTools/QueueStatusServer/app.yaml
index f6ff870..76d8963 100644
--- a/WebKitTools/QueueStatusServer/app.yaml
+++ b/WebKitTools/QueueStatusServer/app.yaml
@@ -7,5 +7,9 @@ handlers:
- url: /stylesheets
static_dir: stylesheets
+- url: /remote_api
+ script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
+ login: admin
+
- url: /.*
script: main.py
diff --git a/WebKitTools/QueueStatusServer/handlers/nextpatch.py b/WebKitTools/QueueStatusServer/handlers/nextpatch.py
new file mode 100644
index 0000000..edb702a
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/handlers/nextpatch.py
@@ -0,0 +1,61 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.appengine.ext import db
+from google.appengine.ext import webapp
+
+from model.workitems import WorkItems
+from model.activeworkitems import ActiveWorkItems
+from model import queuestatus
+
+from datetime import datetime, timedelta
+
+
+class NextPatch(webapp.RequestHandler):
+ def _get_next_patch_id(self, queue_name):
+ work_items = WorkItems.all().filter("queue_name =", queue_name).get()
+ if not work_items:
+ return None
+ active_work_items = ActiveWorkItems.get_or_insert(key_name=queue_name, queue_name=queue_name)
+ return db.run_in_transaction(self._assign_patch, active_work_items.key(), work_items.item_ids)
+
+ def get(self, queue_name):
+ patch_id = self._get_next_patch_id(queue_name)
+ if not patch_id:
+ self.error(404)
+ return
+ self.response.out.write(patch_id)
+
+ @staticmethod
+ def _assign_patch(key, work_item_ids):
+ now = datetime.now()
+ active_work_items = db.get(key)
+ active_work_items.deactivate_expired(now)
+ next_item = active_work_items.next_item(work_item_ids, now)
+ active_work_items.put()
+ return next_item
diff --git a/WebKitTools/QueueStatusServer/handlers/queuestatus.py b/WebKitTools/QueueStatusServer/handlers/queuestatus.py
index 5295b17..f76157d 100644
--- a/WebKitTools/QueueStatusServer/handlers/queuestatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/queuestatus.py
@@ -50,9 +50,24 @@ class QueueStatus(webapp.RequestHandler):
def get(self, queue_name):
work_items = WorkItems.all().filter("queue_name =", queue_name).get()
statuses = queuestatus.QueueStatus.all().filter("queue_name =", queue_name).order("-date").fetch(15)
+
+ status_groups = []
+ last_patch_id = None
+ synthetic_patch_id_counter = 0
+
+ for status in statuses:
+ patch_id = status.active_patch_id
+ if not patch_id or last_patch_id != patch_id:
+ status_group = []
+ status_groups.append(status_group)
+ else:
+ status_group = status_groups[-1]
+ status_group.append(status)
+ last_patch_id = patch_id
+
template_values = {
"display_queue_name": display_name_for_queue(queue_name),
"work_item_rows": self._rows_for_work_items(work_items),
- "statuses": statuses,
+ "status_groups": status_groups,
}
self.response.out.write(template.render("templates/queuestatus.html", template_values))
diff --git a/WebKitTools/QueueStatusServer/index.yaml b/WebKitTools/QueueStatusServer/index.yaml
index 94b6692..6c9a3b2 100644
--- a/WebKitTools/QueueStatusServer/index.yaml
+++ b/WebKitTools/QueueStatusServer/index.yaml
@@ -27,6 +27,11 @@ indexes:
properties:
- name: queue_name
- name: date
+
+- kind: QueueStatus
+ properties:
+ - name: queue_name
+ - name: date
direction: desc
- kind: SVNRevision
diff --git a/WebKitTools/QueueStatusServer/main.py b/WebKitTools/QueueStatusServer/main.py
index e550dc5..93227ca 100644
--- a/WebKitTools/QueueStatusServer/main.py
+++ b/WebKitTools/QueueStatusServer/main.py
@@ -35,6 +35,7 @@ from google.appengine.ext.webapp.util import run_wsgi_app
from handlers.dashboard import Dashboard
from handlers.gc import GC
+from handlers.nextpatch import NextPatch
from handlers.patch import Patch
from handlers.patchstatus import PatchStatus
from handlers.queuestatus import QueueStatus
@@ -59,6 +60,7 @@ routes = [
(r'/status-bubble/(.*)', StatusBubble),
(r'/svn-revision/(.*)', SVNRevision),
(r'/queue-status/(.*)', QueueStatus),
+ (r'/next-patch/(.*)', NextPatch),
('/update-status', UpdateStatus),
('/update-work-items', UpdateWorkItems),
('/update-svn-revision', UpdateSVNRevision),
diff --git a/WebKitTools/QueueStatusServer/model/activeworkitems.py b/WebKitTools/QueueStatusServer/model/activeworkitems.py
new file mode 100644
index 0000000..e24e6ca
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/model/activeworkitems.py
@@ -0,0 +1,58 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * 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.
+
+from google.appengine.ext import db
+
+from datetime import timedelta
+import time
+
+
+class ActiveWorkItems(db.Model):
+ queue_name = db.StringProperty()
+ item_ids = db.ListProperty(int)
+ item_dates = db.ListProperty(float)
+ date = db.DateTimeProperty(auto_now_add=True)
+
+ def deactivate_expired(self, now):
+ one_hour_ago = time.mktime((now - timedelta(minutes=60)).timetuple())
+ nonexpired_item_ids = []
+ nonexpired_item_dates = []
+ for i in range(len(self.item_ids)):
+ if self.item_dates[i] > one_hour_ago:
+ nonexpired_item_ids.append(self.item_ids[i])
+ nonexpired_item_dates.append(self.item_dates[i])
+ self.item_ids = nonexpired_item_ids
+ self.item_dates = nonexpired_item_dates
+
+ def next_item(self, work_item_ids, now):
+ for item_id in work_item_ids:
+ if item_id not in self.item_ids:
+ self.item_ids.append(item_id)
+ self.item_dates.append(time.mktime(now.timetuple()))
+ return item_id
+ return None
diff --git a/WebKitTools/QueueStatusServer/stylesheets/dashboard.css b/WebKitTools/QueueStatusServer/stylesheets/dashboard.css
index 1ecf2eb..7b4f857 100644
--- a/WebKitTools/QueueStatusServer/stylesheets/dashboard.css
+++ b/WebKitTools/QueueStatusServer/stylesheets/dashboard.css
@@ -44,36 +44,59 @@ td {
tr:hover, li:hover {
background-color: #EEE;
}
+
+.status-group {
+ font-size: 90%;
+}
+
+.status-bug {
+ font-weight: bold;
+}
+
+.status-group ul {
+ font-size: 90%;
+}
+
+.status-group ul li {
+ padding: 2px 0 2px 7px;
+ overflow: hidden;
+}
+
+.status-group ul li:hover {
+ background: #ddd;
+}
+
.status-date {
color: #AAA;
float: right;
font-size: 8pt;
}
-.status {
+
+.status-cell {
margin: 1px;
padding: 1px 2px;
font-size: 9pt;
border: 1px solid transparent;
}
-.status:hover {
+.status-cell:hover {
border: 1px solid black;
}
-.pass {
+.status-cell.pass {
background-color: #8FDF5F;
cursor: pointer;
/* border: 1px solid #4F8530; */
}
-.fail {
+.status-cell.fail {
background-color: #E98080;
cursor: pointer;
/* border: 1px solid #A77272; */
}
-.pending {
+.status-cell.pending {
background-color: #FFFC6C;
cursor: pointer;
/* border: 1px solid #C5C56D; */
}
-.error {
+.status-cell.error {
background-color: #E0B0FF;
cursor: pointer;
/* border: 1px solid #ACA0B3; */
diff --git a/WebKitTools/QueueStatusServer/templates/dashboard.html b/WebKitTools/QueueStatusServer/templates/dashboard.html
index c5c2359..f88a5ea 100644
--- a/WebKitTools/QueueStatusServer/templates/dashboard.html
+++ b/WebKitTools/QueueStatusServer/templates/dashboard.html
@@ -24,14 +24,14 @@ function statusDetail(patch_id) {
</thead>
<tbody>{% for row in rows %}
<tr>
- <td class="status">
+ <td class="status-cell">
{{ row.bug_id|force_escape|webkit_bug_id|safe }}
</td>
- <td class="status">
+ <td class="status-cell">
{{ row.attachment_id|force_escape|webkit_attachment_id|safe }}
</td>
{% for bubble in row.bubbles %}
- <td class="status {{ bubble.status_class }}"
+ <td class="status-cell {{ bubble.status_class }}"
{% if bubble.status %}
onclick="statusDetail({{ row.attachment_id }})"
title="{{ bubble.status_date|timesince }}"
diff --git a/WebKitTools/QueueStatusServer/templates/includes/singlequeuestatus.html b/WebKitTools/QueueStatusServer/templates/includes/singlequeuestatus.html
new file mode 100644
index 0000000..075cd39
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/templates/includes/singlequeuestatus.html
@@ -0,0 +1,5 @@
+<span class="status-date">{{ status.date|timesince }} ago</span>
+<span class="status-message">{{ status.message|force_escape|urlize|webkit_linkify|safe }}</span>
+{% if status.results_file %}
+ <span class="status-results">[{{ status.key.id|results_link|safe }}]</span>
+{% endif %}
diff --git a/WebKitTools/QueueStatusServer/templates/queuestatus.html b/WebKitTools/QueueStatusServer/templates/queuestatus.html
index 38c125f..d2d72c7 100644
--- a/WebKitTools/QueueStatusServer/templates/queuestatus.html
+++ b/WebKitTools/QueueStatusServer/templates/queuestatus.html
@@ -11,18 +11,31 @@
<div class="status-details">
<ul>
- {% for status in statuses %}
- <li>{% if status.active_bug_id %}
- <span class="status-bug">
- Patch {{ status.active_patch_id|force_escape|webkit_attachment_id|safe }} from bug
- {{ status.active_bug_id|force_escape|webkit_bug_id|safe }}:
- </span>{% endif %}
- <span class="status-message">{{ status.message|force_escape|urlize|webkit_linkify|safe }}</span>
- {% if status.results_file %}
- <span class="status-results">[{{ status.key.id|results_link|safe }}]</span>
- {% endif %}
- <span class="status-date">{{ status.date|timesince }} ago</span>
- </li>
+ {% for status_group in status_groups %}
+ {% with status_group.0 as title_status %}
+ <li class="status-group">
+ {% if title_status.active_bug_id %}
+ <span class="status-bug">
+ Patch {{ title_status.active_patch_id|force_escape|webkit_attachment_id|safe }} from bug
+ {{ title_status.active_bug_id|force_escape|webkit_bug_id|safe }}:
+ </span>
+ {% endif %}
+
+ {% ifequal status_group|length 1 %}
+ {% with title_status as status %}
+ {% include 'includes/singlequeuestatus.html' %}
+ {% endwith %}
+ {% else %}
+ <ul>
+ {% for status in status_group %}
+ <li class="status">
+ {% include 'includes/singlequeuestatus.html' %}
+ </li>
+ {% endfor %}
+ </ul>
+ {% endifequal %}
+ </li>
+ {% endwith %}
{% endfor %}
</ul>
</div>
diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit
index 4234905..cd43499 100755
--- a/WebKitTools/Scripts/build-webkit
+++ b/WebKitTools/Scripts/build-webkit
@@ -50,6 +50,7 @@ chdirWebKit();
my $showHelp = 0;
my $clean = 0;
my $minimal = 0;
+my $v8 = 0;
my $installHeaders;
my $installLibs;
my $prefixPath;
@@ -197,9 +198,6 @@ my @features = (
{ option => "xslt", desc => "Toggle XSLT support",
define => "ENABLE_XSLT", default => 1, value => \$xsltSupport },
- { option => "file-writer", desc => "Toggle FileWriter support",
- define => "ENABLE_FILE_WRITER", default => 0, value => \$fileWriterSupport },
-
{ option => "file-system", desc => "Toggle FileSystem support",
define => "ENABLE_FILE_SYSTEM", default => 0, value => \$fileSystemSupport },
@@ -222,7 +220,8 @@ push @ARGV, split(/ /, $ENV{'BUILD_WEBKIT_ARGS'}) if ($ENV{'BUILD_WEBKIT_ARGS'})
foreach (@ARGV) {
if ($_ eq '--minimal') {
$minimal = 1;
- last;
+ } elsif ($_ eq '--v8') {
+ $v8 = 1;
}
}
@@ -250,6 +249,7 @@ Usage: $programName [options] [options to pass to build system]
--install-headers=<path> Set installation path for the headers (Qt only)
--install-libs=<path> Set installation path for the libraries (Qt only)
+ --v8 Use V8 as JavaScript engine (Qt only)
--prefix=<path> Set installation prefix to the given path (Gtk only)
--makeargs=<arguments> Optional Makefile flags
@@ -266,6 +266,7 @@ my %options = (
'prefix=s' => \$prefixPath,
'makeargs=s' => \$makeArgs,
'minimal' => \$minimal,
+ 'v8' => \$v8,
);
# Build usage text and options list from features
@@ -288,7 +289,7 @@ setConfiguration();
my $productDir = productDir();
# Remove 0 byte sized files from productDir after slave lost for Qt buildbots.
-File::Find::find(\&unlinkZeroFiles, $productDir) if isQt();
+File::Find::find(\&unlinkZeroFiles, $productDir) if (isQt() && -e $productDir);
sub unlinkZeroFiles ()
{
@@ -395,6 +396,10 @@ if (isGtk()) {
if ($minimal) {
push @options, "CONFIG+=minimal";
}
+
+ if ($v8) {
+ push @options, "CONFIG+=v8";
+ }
}
# Force re-link of existing libraries if different than expected
diff --git a/WebKitTools/Scripts/update-webgl-conformance-tests b/WebKitTools/Scripts/update-webgl-conformance-tests
new file mode 100755
index 0000000..dfe20a1
--- /dev/null
+++ b/WebKitTools/Scripts/update-webgl-conformance-tests
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Wrapper around webkitpy/layout_tests/update-webgl-conformance-tests.py"""
+
+import webkitpy.layout_tests.update_webgl_conformance_tests
+import sys
+
+if __name__ == '__main__':
+ sys.exit(webkitpy.layout_tests.update_webgl_conformance_tests.main())
diff --git a/WebKitTools/Scripts/update-webkit-chromium b/WebKitTools/Scripts/update-webkit-chromium
index 8458f83..1db1826 100755
--- a/WebKitTools/Scripts/update-webkit-chromium
+++ b/WebKitTools/Scripts/update-webkit-chromium
@@ -29,13 +29,16 @@
# Update script for the WebKit Chromium Port.
use File::Path;
+use FindBin;
use Getopt::Long;
+use lib $FindBin::Bin;
+use webkitdirs;
chdir("WebKit/chromium") or die $!;
# Find gclient or install it.
my $gclientPath;
-if (`gclient --version`) {
+if (commandExists('gclient')) {
$gclientPath = 'gclient';
} elsif (-e 'depot_tools/gclient') {
$gclientPath = 'depot_tools/gclient';
diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm
index b4d3f60..2980750 100644
--- a/WebKitTools/Scripts/webkitdirs.pm
+++ b/WebKitTools/Scripts/webkitdirs.pm
@@ -258,6 +258,7 @@ sub jscPath($)
my ($productDir) = @_;
my $jscName = "jsc";
$jscName .= "_debug" if (isCygwin() && ($configuration eq "Debug"));
+ $jscName .= ".exe" if (isWindows() || isCygwin());
return "$productDir/$jscName" if -e "$productDir/$jscName";
return "$productDir/JavaScriptCore.framework/Resources/$jscName";
}
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl
index 2fd187b..ee258da 100644
--- a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl
@@ -30,7 +30,7 @@
# Unit tests of VCSUtils::fixChangeLogPatch().
-use Test::Simple tests => 8;
+use Test::Simple tests => 12;
use VCSUtils;
# The source ChangeLog for these tests is the following:
@@ -58,6 +58,93 @@ my $in;
my $out;
# New test
+$title = "fixChangeLogPatch: [no change] In-place change.";
+
+$in = <<'END';
+--- ChangeLog
++++ ChangeLog
+@@ -1,5 +1,5 @@
+ 2010-12-22 Bob <bob@email.address>
+
+- Reviewed by Sue.
++ Reviewed by Ray.
+
+ Changed some code on 2010-12-22.
+END
+
+ok(fixChangeLogPatch($in) eq $in, $title);
+
+# New test
+$title = "fixChangeLogPatch: [no change] Remove first entry.";
+
+$in = <<'END';
+--- ChangeLog
++++ ChangeLog
+@@ -1,11 +1,3 @@
+-2010-12-22 Bob <bob@email.address>
+-
+- Reviewed by Ray.
+-
+- Changed some code on 2010-12-22.
+-
+- * File:
+-
+ 2010-12-22 Alice <alice@email.address>
+
+ Reviewed by Ray.
+END
+
+ok(fixChangeLogPatch($in) eq $in, $title);
+
+# New test
+$title = "fixChangeLogPatch: [no change] Remove entry in the middle.";
+
+$in = <<'END';
+--- ChangeLog
++++ ChangeLog
+@@@ -7,10 +7,6 @@
+
+ * File:
+
+-2010-12-22 Bob <bob@email.address>
+-
+- Changed some code on 2010-12-22.
+-
+ 2010-12-22 Alice <alice@email.address>
+
+ Reviewed by Ray.
+END
+
+ok(fixChangeLogPatch($in) eq $in, $title);
+
+# New test
+$title = "fixChangeLogPatch: [no change] Far apart changes (i.e. more than one chunk).";
+
+$in = <<'END';
+--- ChangeLog
++++ ChangeLog
+@@ -7,7 +7,7 @@
+
+ * File:
+
+-2010-12-22 Bob <bob@email.address>
++2010-12-22 Bobby <bob@email.address>
+
+ Changed some code on 2010-12-22.
+
+@@ -21,7 +21,7 @@
+
+ * File2:
+
+-2010-12-21 Bob <bob@email.address>
++2010-12-21 Bobby <bob@email.address>
+
+ Changed some code on 2010-12-21.
+END
+
+ok(fixChangeLogPatch($in) eq $in, $title);
+
+# New test
$title = "fixChangeLogPatch: [no change] First line is new line.";
$in = <<'END';
diff --git a/WebKitTools/Scripts/webkitpy/common/config/committers.py b/WebKitTools/Scripts/webkitpy/common/config/committers.py
index 6a45cab..113131f 100644
--- a/WebKitTools/Scripts/webkitpy/common/config/committers.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/committers.py
@@ -77,6 +77,7 @@ committers_unable_to_review = [
Committer("Andy Estes", "aestes@apple.com", "estes"),
Committer("Anthony Ricaud", "rik@webkit.org", "rik"),
Committer("Anton Muhin", "antonm@chromium.org", "antonm"),
+ Committer("Balazs Kelemen", "kbalazs@webkit.org", "kbalazs"),
Committer("Ben Murdoch", "benm@google.com", "benm"),
Committer("Benjamin C Meyer", ["ben@meyerhome.net", "ben@webkit.org"], "icefox"),
Committer("Benjamin Otte", ["otte@gnome.org", "otte@webkit.org"], "otte"),
@@ -92,7 +93,6 @@ committers_unable_to_review = [
Committer("Chris Rogers", "crogers@google.com", "crogers"),
Committer("Christian Dywan", ["christian@twotoasts.de", "christian@webkit.org"]),
Committer("Collin Jackson", "collinj@webkit.org"),
- Committer("Csaba Osztrogonac", "ossy@webkit.org", "ossy"),
Committer("David Smith", ["catfish.man@gmail.com", "dsmith@webkit.org"], "catfishman"),
Committer("Dean Jackson", "dino@apple.com", "dino"),
Committer("Diego Gonzalez", ["diegohcg@webkit.org", "diego.gonzalez@openbossa.org"], "diegohcg"),
@@ -148,6 +148,7 @@ committers_unable_to_review = [
Committer("Maxime Simon", ["simon.maxime@gmail.com", "maxime.simon@webkit.org"], "maxime.simon"),
Committer("Michael Saboff", "msaboff@apple.com"),
Committer("Michelangelo De Simone", "michelangelo@webkit.org", "michelangelo"),
+ Committer("Mihai Parparita", "mihaip@chromium.org", "mihaip"),
Committer("Mike Belshe", ["mbelshe@chromium.org", "mike@belshe.com"]),
Committer("Mike Fenton", ["mifenton@rim.com", "mike.fenton@torchmobile.com"], "mfenton"),
Committer("Mike Thole", ["mthole@mikethole.com", "mthole@apple.com"]),
@@ -156,6 +157,7 @@ committers_unable_to_review = [
Committer("Nico Weber", ["thakis@chromium.org", "thakis@google.com"], "thakis"),
Committer("Noam Rosenthal", "noam.rosenthal@nokia.com", "noamr"),
Committer("Pam Greene", "pam@chromium.org", "pamg"),
+ Committer("Patrick Gansterer", ["paroga@paroga.com", "paroga@webkit.org"], "paroga"),
Committer("Peter Kasting", ["pkasting@google.com", "pkasting@chromium.org"], "pkasting"),
Committer("Philippe Normand", ["pnormand@igalia.com", "philn@webkit.org"], "philn-tp"),
Committer("Pierre d'Herbemont", ["pdherbemont@free.fr", "pdherbemont@apple.com"], "pdherbemont"),
@@ -211,6 +213,7 @@ reviewers_list = [
Reviewer("Chris Marrin", "cmarrin@apple.com", "cmarrin"),
Reviewer("Chris Fleizach", "cfleizach@apple.com", "cfleizach"),
Reviewer("Chris Jerdonek", "cjerdonek@webkit.org", "cjerdonek"),
+ Reviewer(u"Csaba Osztrogon\u00e1c", "ossy@webkit.org", "ossy"),
Reviewer("Dan Bernstein", ["mitz@webkit.org", "mitz@apple.com"], "mitzpettel"),
Reviewer("Daniel Bates", "dbates@webkit.org", "dydz"),
Reviewer("Darin Adler", "darin@apple.com", "darin"),
diff --git a/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py
index 2b2258e..cc64fac 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py
@@ -175,6 +175,20 @@ class Bug(object):
def is_unassigned(self):
return self.assigned_to_email() in self.unassigned_emails
+ def status(self):
+ return self.bug_dictionary["bug_status"]
+
+ # Bugzilla has many status states we don't really use in WebKit:
+ # https://bugs.webkit.org/page.cgi?id=fields.html#status
+ _open_states = ["UNCONFIRMED", "NEW", "ASSIGNED", "REOPENED"]
+ _closed_states = ["RESOLVED", "VERIFIED", "CLOSED"]
+
+ def is_open(self):
+ return self.status() in self._open_states
+
+ def is_closed(self):
+ return not self.is_open()
+
# Rarely do we actually want obsolete attachments
def attachments(self, include_obsolete=False):
attachments = self.bug_dictionary["attachments"]
@@ -357,15 +371,14 @@ class CommitterValidator(object):
return False
return True
+ def _reject_patch_if_flags_are_invalid(self, patch):
+ return (self._validate_setter_email(
+ patch, "reviewer", self.reject_patch_from_review_queue)
+ and self._validate_setter_email(
+ patch, "committer", self.reject_patch_from_commit_queue))
+
def patches_after_rejecting_invalid_commiters_and_reviewers(self, patches):
- validated_patches = []
- for patch in patches:
- if (self._validate_setter_email(
- patch, "reviewer", self.reject_patch_from_review_queue)
- and self._validate_setter_email(
- patch, "committer", self.reject_patch_from_commit_queue)):
- validated_patches.append(patch)
- return validated_patches
+ return [patch for patch in patches if self._reject_patch_if_flags_are_invalid(patch)]
def reject_patch_from_commit_queue(self,
attachment_id,
@@ -500,6 +513,7 @@ class Bugzilla(object):
bug = {}
bug["id"] = int(soup.find("bug_id").string)
bug["title"] = self._string_contents(soup.find("short_desc"))
+ bug["bug_status"] = self._string_contents(soup.find("bug_status"))
bug["reporter_email"] = self._string_contents(soup.find("reporter"))
bug["assigned_to_email"] = self._string_contents(soup.find("assigned_to"))
bug["cc_emails"] = [self._string_contents(element)
diff --git a/WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py
index 280696e..32f23cd 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py
@@ -213,6 +213,7 @@ ZEZpbmlzaExvYWRXaXRoUmVhc29uOnJlYXNvbl07Cit9CisKIEBlbmQKIAogI2VuZGlmCg==
"cc_emails" : ["foo@bar.com", "example@example.com"],
"reporter_email" : "eric@webkit.org",
"assigned_to_email" : "webkit-unassigned@lists.webkit.org",
+ "bug_status": "NEW",
"attachments" : [{
"attach_date": datetime.datetime(2009, 12, 27, 23, 51),
'name': u'Patch',
diff --git a/WebKitTools/Scripts/webkitpy/common/net/statusserver.py b/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
index c8fced6..57390b8 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
@@ -96,6 +96,11 @@ class StatusServer:
self.browser["work_items"] = " ".join(work_items)
return self.browser.submit().read()
+ def next_work_item(self, queue_name):
+ _log.debug("Fetching next work item for %s" % queue_name)
+ patch_status_url = "%s/next-patch/%s" % (self.url, queue_name)
+ return self._fetch_url(patch_status_url)
+
def update_work_items(self, queue_name, work_items):
_log.debug("Recording work items: %s for %s" % (work_items, queue_name))
return NetworkTransaction().run(lambda: self._post_work_items_to_server(queue_name, work_items))
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py
index c543d91..51dcac8 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py
@@ -36,8 +36,10 @@ import os
import subprocess
import sys
import re
+import webkitpy.common.checkout.scm as scm
import webkitpy.common.system.executive as executive
import webkitpy.common.system.logutils as logutils
+import webkitpy.common.system.ospath as ospath
import webkitpy.layout_tests.port.factory as port_factory
_log = logutils.get_logger(__file__)
@@ -52,11 +54,14 @@ def port_fallbacks():
back on. All platforms fall back on 'base'.
"""
fallbacks = {_BASE_PLATFORM: []}
- for port_name in os.listdir(os.path.join('LayoutTests', 'platform')):
+ platform_dir = os.path.join(scm.find_checkout_root(), 'LayoutTests',
+ 'platform')
+ for port_name in os.listdir(platform_dir):
try:
platforms = port_factory.get(port_name).baseline_search_path()
except NotImplementedError:
- _log.error("'%s' lacks baseline_search_path(), please fix." % port_name)
+ _log.error("'%s' lacks baseline_search_path(), please fix."
+ % port_name)
fallbacks[port_name] = [_BASE_PLATFORM]
continue
fallbacks[port_name] = [os.path.basename(p) for p in platforms][1:]
@@ -102,7 +107,8 @@ def cluster_file_hashes(glob_pattern):
# Fill in the map.
cmd = ('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests')
try:
- git_output = executive.Executive().run_command(cmd)
+ git_output = executive.Executive().run_command(cmd,
+ cwd=scm.find_checkout_root())
except OSError, e:
if e.errno == 2: # No such file or directory.
_log.error("Error: 'No such file' when running git.")
@@ -156,11 +162,28 @@ def has_intermediate_results(test, fallbacks, matching_platform,
return False
-def find_dups(hashes, port_fallbacks):
+def get_relative_test_path(filename, relative_to,
+ checkout_root=scm.find_checkout_root()):
+ """Constructs a relative path to |filename| from |relative_to|.
+ Args:
+ filename: The test file we're trying to get a relative path to.
+ relative_to: The absolute path we're relative to.
+ Returns:
+ A relative path to filename or None if |filename| is not below
+ |relative_to|.
+ """
+ layout_test_dir = os.path.join(checkout_root, 'LayoutTests')
+ abs_path = os.path.join(layout_test_dir, filename)
+ return ospath.relpath(abs_path, relative_to)
+
+
+def find_dups(hashes, port_fallbacks, relative_to):
"""Yields info about redundant test expectations.
Args:
hashes: a list of hashes as returned by cluster_file_hashes.
- port_fallbacks: a list of fallback information as returned by get_port_fallbacks.
+ port_fallbacks: a list of fallback information as returned by
+ get_port_fallbacks.
+ relative_to: the directory that we want the results relative to
Returns:
a tuple containing (test, platform, fallback, platforms)
"""
@@ -176,13 +199,24 @@ def find_dups(hashes, port_fallbacks):
# See if any of the platforms are redundant with each other.
for platform in platforms.keys():
for fallback in port_fallbacks[platform]:
- if fallback in platforms.keys():
- # We have to verify that there isn't an intermediate result
- # that causes this duplicate hash to exist.
- if not has_intermediate_results(test,
- port_fallbacks[platform], fallback):
- path = os.path.join('LayoutTests', platforms[platform])
- yield test, platform, fallback, path
+ if fallback not in platforms.keys():
+ continue
+ # We have to verify that there isn't an intermediate result
+ # that causes this duplicate hash to exist.
+ if has_intermediate_results(test, port_fallbacks[platform],
+ fallback):
+ continue
+ # We print the relative path so it's easy to pipe the results
+ # to xargs rm.
+ path = get_relative_test_path(platforms[platform], relative_to)
+ if not path:
+ continue
+ yield {
+ 'test': test,
+ 'platform': platform,
+ 'fallback': fallback,
+ 'path': path,
+ }
def deduplicate(glob_pattern):
@@ -194,5 +228,4 @@ def deduplicate(glob_pattern):
"""
fallbacks = port_fallbacks()
hashes = cluster_file_hashes(glob_pattern)
- return [{'test': test, 'path': path, 'platform': platform, 'fallback': fallback}
- for test, platform, fallback, path in find_dups(hashes, fallbacks)]
+ return list(find_dups(hashes, fallbacks, os.getcwd()))
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py
index be2e381..bb9604f 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py
@@ -186,3 +186,22 @@ class ListDuplicatesTest(unittest.TestCase):
'fallback': 'chromium-win',
'platform': 'chromium-linux'},
result[0])
+
+ def test_get_relative_test_path(self):
+ checkout_root = scm.find_checkout_root()
+ layout_test_dir = os.path.join(checkout_root, 'LayoutTests')
+ test_cases = (
+ ('platform/mac/test.html',
+ ('platform/mac/test.html', layout_test_dir)),
+ ('LayoutTests/platform/mac/test.html',
+ ('platform/mac/test.html', checkout_root)),
+ (None,
+ ('platform/mac/test.html', os.path.join(checkout_root, 'WebCore'))),
+ ('test.html',
+ ('platform/mac/test.html', os.path.join(layout_test_dir, 'platform/mac'))),
+ (None,
+ ('platform/mac/test.html', os.path.join(layout_test_dir, 'platform/win'))),
+ )
+ for expected, inputs in test_cases:
+ self.assertEquals(expected,
+ deduplicate_tests.get_relative_test_path(*inputs))
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
index 9b963ca..970de60 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
@@ -72,20 +72,19 @@ def log_stack(stack):
_log.error(' %s' % line.strip())
-def _process_output(port, test_info, test_types, test_args, configuration,
- output_dir, crash, timeout, test_run_time, actual_checksum,
+def _process_output(port, options, test_info, test_types, test_args,
+ crash, timeout, test_run_time, actual_checksum,
output, error):
"""Receives the output from a DumpRenderTree process, subjects it to a
number of tests, and returns a list of failure types the test produced.
Args:
port: port-specific hooks
+ options: command line options argument from optparse
proc: an active DumpRenderTree process
test_info: Object containing the test filename, uri and timeout
test_types: list of test types to subject the output to
test_args: arguments to be passed to each test
- configuration: Debug or Release
- output_dir: directory to put crash stack traces into
Returns: a TestResult object
"""
@@ -106,7 +105,8 @@ def _process_output(port, test_info, test_types, test_args, configuration,
_log.debug("Stacktrace for %s:\n%s" % (test_info.filename, error))
# Strip off "file://" since RelativeTestFilename expects
# filesystem paths.
- filename = os.path.join(output_dir, port.relative_test_filename(
+ filename = os.path.join(options.results_directory,
+ port.relative_test_filename(
test_info.filename))
filename = os.path.splitext(filename)[0] + "-stack.txt"
port.maybe_make_directory(os.path.split(filename)[0])
@@ -122,7 +122,7 @@ def _process_output(port, test_info, test_types, test_args, configuration,
start_diff_time = time.time()
new_failures = test_type.compare_output(port, test_info.filename,
output, local_test_args,
- configuration)
+ options.configuration)
# Don't add any more failures if we already have a crash, so we don't
# double-report those tests. We do double-report for timeouts since
# we still want to see the text and image output.
@@ -166,25 +166,23 @@ class TestResult(object):
class SingleTestThread(threading.Thread):
"""Thread wrapper for running a single test file."""
- def __init__(self, port, image_path, shell_args, test_info,
- test_types, test_args, configuration, output_dir):
+ def __init__(self, port, options, test_info, test_types, test_args):
"""
Args:
port: object implementing port-specific hooks
+ options: command line argument object from optparse
test_info: Object containing the test filename, uri and timeout
- output_dir: Directory to put crash stacks into.
- See TestShellThread for documentation of the remaining arguments.
+ test_types: A list of TestType objects to run the test output
+ against.
+ test_args: A TestArguments object to pass to each TestType.
"""
threading.Thread.__init__(self)
self._port = port
- self._image_path = image_path
- self._shell_args = shell_args
+ self._options = options
self._test_info = test_info
self._test_types = test_types
self._test_args = test_args
- self._configuration = configuration
- self._output_dir = output_dir
self._driver = None
def run(self):
@@ -194,17 +192,17 @@ class SingleTestThread(threading.Thread):
# FIXME: this is a separate routine to work around a bug
# in coverage: see http://bitbucket.org/ned/coveragepy/issue/85.
test_info = self._test_info
- self._driver = self._port.create_driver(self._image_path,
- self._shell_args)
+ self._driver = self._port.create_driver(self._test_args.png_path,
+ self._options)
self._driver.start()
start = time.time()
crash, timeout, actual_checksum, output, error = \
self._driver.run_test(test_info.uri.strip(), test_info.timeout,
test_info.image_hash())
end = time.time()
- self._test_result = _process_output(self._port,
+ self._test_result = _process_output(self._port, self._options,
test_info, self._test_types, self._test_args,
- self._configuration, self._output_dir, crash, timeout, end - start,
+ crash, timeout, end - start,
actual_checksum, output, error)
self._driver.stop()
@@ -248,12 +246,13 @@ class WatchableThread(threading.Thread):
class TestShellThread(WatchableThread):
- def __init__(self, port, filename_list_queue, result_queue,
- test_types, test_args, image_path, shell_args, options):
+ def __init__(self, port, options, filename_list_queue, result_queue,
+ test_types, test_args):
"""Initialize all the local state for this DumpRenderTree thread.
Args:
port: interface to port-specific hooks
+ options: command line options argument from optparse
filename_list_queue: A thread safe Queue class that contains lists
of tuples of (filename, uri) pairs.
result_queue: A thread safe Queue class that will contain tuples of
@@ -261,22 +260,17 @@ class TestShellThread(WatchableThread):
test_types: A list of TestType objects to run the test output
against.
test_args: A TestArguments object to pass to each TestType.
- shell_args: Any extra arguments to be passed to DumpRenderTree.
- options: A property dictionary as produced by optparse. The
- command-line options should match those expected by
- run_webkit_tests; they are typically passed via the
- run_webkit_tests.TestRunner class."""
+
+ """
WatchableThread.__init__(self)
self._port = port
+ self._options = options
self._filename_list_queue = filename_list_queue
self._result_queue = result_queue
self._filename_list = []
self._test_types = test_types
self._test_args = test_args
self._driver = None
- self._image_path = image_path
- self._shell_args = shell_args
- self._options = options
self._directory_timing_stats = {}
self._test_results = []
self._num_tests = 0
@@ -433,13 +427,11 @@ class TestShellThread(WatchableThread):
A TestResult
"""
- worker = SingleTestThread(self._port, self._image_path,
- self._shell_args,
+ worker = SingleTestThread(self._port,
+ self._options,
test_info,
self._test_types,
- self._test_args,
- self._options.configuration,
- self._options.results_directory)
+ self._test_args)
worker.start()
@@ -503,11 +495,11 @@ class TestShellThread(WatchableThread):
self._driver.run_test(test_info.uri, test_info.timeout, image_hash)
end = time.time()
- result = _process_output(self._port, test_info, self._test_types,
- self._test_args, self._options.configuration,
- self._options.results_directory, crash,
- timeout, end - start, actual_checksum,
- output, error)
+ result = _process_output(self._port, self._options,
+ test_info, self._test_types,
+ self._test_args, crash,
+ timeout, end - start, actual_checksum,
+ output, error)
self._test_results.append(result)
return result
@@ -521,7 +513,8 @@ class TestShellThread(WatchableThread):
# poll() is not threadsafe and can throw OSError due to:
# http://bugs.python.org/issue1731717
if (not self._driver or self._driver.poll() is not None):
- self._driver = self._port.create_driver(self._image_path, self._shell_args)
+ self._driver = self._port.create_driver(self._test_args.png_path,
+ self._options)
self._driver.start()
def _kill_dump_render_tree(self):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
index 9125f9e..70beac3 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
@@ -152,6 +152,16 @@ class Port(object):
While this is a generic routine, we include it in the Port
interface so that it can be overriden for testing purposes."""
+
+ # The filenames show up in the diff output, make sure they're
+ # raw bytes and not unicode, so that they don't trigger join()
+ # trying to decode the input.
+ def to_raw_bytes(str):
+ if isinstance(str, unicode):
+ return str.encode('utf-8')
+ return str
+ expected_filename = to_raw_bytes(expected_filename)
+ actual_filename = to_raw_bytes(actual_filename)
diff = difflib.unified_diff(expected_text.splitlines(True),
actual_text.splitlines(True),
expected_filename,
@@ -364,7 +374,7 @@ class Port(object):
results_filename in a users' browser."""
raise NotImplementedError('Port.show_html_results_file')
- def create_driver(self, png_path, options):
+ def create_driver(self, image_path, options):
"""Return a newly created base.Driver subclass for starting/stopping
the test driver."""
raise NotImplementedError('Port.create_driver')
@@ -678,7 +688,7 @@ class Port(object):
class Driver:
"""Abstract interface for the DumpRenderTree interface."""
- def __init__(self, port, png_path, options):
+ def __init__(self, port, png_path, options, executive):
"""Initialize a Driver to subsequently run tests.
Typically this routine will spawn DumpRenderTree in a config
@@ -688,7 +698,10 @@ class Driver:
png_path - an absolute path for the driver to write any image
data for a test (as a PNG). If no path is provided, that
indicates that pixel test results will not be checked.
- options - any port-specific driver options."""
+ options - command line options argument from optparse
+ executive - reference to the process-wide Executive object
+
+ """
raise NotImplementedError('Driver.__init__')
def run_test(self, uri, timeout, checksum):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
index 1cc426f..780cd22 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
@@ -66,7 +66,7 @@ class UnitTestPort(base.Port):
def _open_configuration_file(self):
if self._configuration_contents:
return NewStringIO(self._configuration_contents)
- return base.Port._open_configuration_file(self)
+ raise IOError
class PortTest(unittest.TestCase):
@@ -163,6 +163,33 @@ class PortTest(unittest.TestCase):
self.assertFalse(base._wdiff_available)
base._wdiff_available = True
+ def test_diff_text(self):
+ port = base.Port()
+ # Make sure that we don't run into decoding exceptions when the
+ # filenames are unicode, with regular or malformed input (expected or
+ # actual input is always raw bytes, not unicode).
+ port.diff_text('exp', 'act', 'exp.txt', 'act.txt')
+ port.diff_text('exp', 'act', u'exp.txt', 'act.txt')
+ port.diff_text('exp', 'act', u'a\xac\u1234\u20ac\U00008000', 'act.txt')
+
+ port.diff_text('exp' + chr(255), 'act', 'exp.txt', 'act.txt')
+ port.diff_text('exp' + chr(255), 'act', u'exp.txt', 'act.txt')
+
+ # Though expected and actual files should always be read in with no
+ # encoding (and be stored as str objects), test unicode inputs just to
+ # be safe.
+ port.diff_text(u'exp', 'act', 'exp.txt', 'act.txt')
+ port.diff_text(
+ u'a\xac\u1234\u20ac\U00008000', 'act', 'exp.txt', 'act.txt')
+
+ # And make sure we actually get diff output.
+ diff = port.diff_text('foo', 'bar', 'exp.txt', 'act.txt')
+ self.assertTrue('foo' in diff)
+ self.assertTrue('bar' in diff)
+ self.assertTrue('exp.txt' in diff)
+ self.assertTrue('act.txt' in diff)
+ self.assertFalse('nosuchthing' in diff)
+
def test_default_configuration_notfound(self):
port = UnitTestPort()
self.assertEqual(port.default_configuration(), "Release")
@@ -223,8 +250,8 @@ class VirtualTest(unittest.TestCase):
self.assertVirtual(port._shut_down_http_server, None)
def test_virtual_driver_method(self):
- self.assertRaises(NotImplementedError, base.Driver, base.Port, "", None)
- self.assertVirtual(base.Driver, base.Port, "", None)
+ self.assertRaises(NotImplementedError, base.Driver, base.Port(),
+ "", None, None)
def test_virtual_driver_methods(self):
class VirtualDriver(base.Driver):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
index 896eab1..3fc4613 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -194,13 +194,11 @@ class ChromiumPort(base.Port):
def create_driver(self, image_path, options):
"""Starts a new Driver and returns a handle to it."""
- if self._options.use_drt and sys.platform == 'darwin':
- return webkit.WebKitDriver(self, image_path, options, executive=self._executive)
- if self._options.use_drt:
- options += ['--test-shell']
- else:
- options += ['--layout-tests']
- return ChromiumDriver(self, image_path, options, executive=self._executive)
+ if options.use_drt and sys.platform == 'darwin':
+ return webkit.WebKitDriver(self, image_path, options,
+ executive=self._executive)
+ return ChromiumDriver(self, image_path, options,
+ executive=self._executive)
def start_helper(self):
helper_path = self._path_to_helper()
@@ -337,22 +335,32 @@ class ChromiumDriver(base.Driver):
def __init__(self, port, image_path, options, executive=Executive()):
self._port = port
- self._configuration = port._options.configuration
- # FIXME: _options is very confusing, because it's not an Options() element.
- # FIXME: These don't need to be passed into the constructor, but could rather
- # be passed into .start()
self._options = options
self._image_path = image_path
self._executive = executive
+ def _driver_args(self):
+ driver_args = []
+ if self._image_path:
+ driver_args.append("--pixel-tests=" + self._image_path)
+
+ if self._options.use_drt:
+ driver_args.append('--test-shell')
+ else:
+ driver_args.append('--layout-tests')
+
+ if self._options.startup_dialog:
+ driver_args.append('--testshell-startup-dialog')
+
+ if self._options.gp_fault_error_box:
+ driver_args.append('--gp-fault-error-box')
+ return driver_args
+
def start(self):
# FIXME: Should be an error to call this method twice.
- cmd = []
- # FIXME: We should not be grabbing at self._port._options.wrapper directly.
- cmd += self._command_wrapper(self._port._options.wrapper)
- cmd += [self._port._path_to_driver()]
- if self._options:
- cmd += self._options
+ cmd = self._command_wrapper(self._options.wrapper)
+ cmd.append(self._port._path_to_driver())
+ cmd += self._driver_args()
# We need to pass close_fds=True to work around Python bug #2320
# (otherwise we can hang when we kill DumpRenderTree when we are running
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py
index 1af01ad..4940e4c 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py
@@ -86,6 +86,7 @@ class DryRunPort(object):
port_name = port_name[len(pfx):]
else:
port_name = None
+ self._options = options
self.__delegate = factory.get(port_name, options)
def __getattr__(self, name):
@@ -116,16 +117,17 @@ class DryRunPort(object):
pass
def create_driver(self, image_path, options):
- return DryrunDriver(self, image_path, options)
+ return DryrunDriver(self, image_path, options, executive=None)
class DryrunDriver(base.Driver):
"""Dryrun implementation of the DumpRenderTree / Driver interface."""
- def __init__(self, port, image_path, test_driver_options):
+ def __init__(self, port, image_path, options, executive):
self._port = port
- self._driver_options = test_driver_options
+ self._options = options
self._image_path = image_path
+ self._executive = executive
self._layout_tests_dir = None
def poll(self):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
index a3a16c3..2ccddb0 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
@@ -97,7 +97,7 @@ class TestPort(base.Port):
pass
def create_driver(self, image_path, options):
- return TestDriver(image_path, options, self)
+ return TestDriver(self, image_path, options, executive=None)
def start_http_server(self):
pass
@@ -139,10 +139,11 @@ class TestPort(base.Port):
class TestDriver(base.Driver):
"""Test/Dummy implementation of the DumpRenderTree interface."""
- def __init__(self, image_path, test_driver_options, port):
- self._driver_options = test_driver_options
- self._image_path = image_path
+ def __init__(self, port, image_path, options, executive):
self._port = port
+ self._image_path = image_path
+ self._options = options
+ self._executive = executive
self._image_written = False
def poll(self):
@@ -204,7 +205,7 @@ class TestDriver(base.Driver):
crash = False
timeout = False
output = basename + '-txt\n'
- if self._port.options().pixel_tests and (
+ if self._options.pixel_tests and (
'image' in basename or 'check' in basename):
checksum = basename + '-checksum\n'
with open(self._image_path, "w") as f:
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
index b085ceb..88c9bdf 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
@@ -199,7 +199,8 @@ class WebKitPort(base.Port):
webbrowser.open(uri, new=1)
def create_driver(self, image_path, options):
- return WebKitDriver(self, image_path, options, executive=self._executive)
+ return WebKitDriver(self, image_path, options,
+ executive=self._executive)
def test_base_platform_names(self):
# At the moment we don't use test platform names, but we have
@@ -405,22 +406,31 @@ class WebKitPort(base.Port):
class WebKitDriver(base.Driver):
"""WebKit implementation of the DumpRenderTree interface."""
- def __init__(self, port, image_path, driver_options, executive=Executive()):
+ def __init__(self, port, image_path, options, executive=Executive()):
self._port = port
- # FIXME: driver_options is never used.
self._image_path = image_path
+ self._options = options
+ self._executive = executive
self._driver_tempdir = tempfile.mkdtemp(prefix='DumpRenderTree-')
def __del__(self):
shutil.rmtree(self._driver_tempdir)
+ def _driver_args(self):
+ driver_args = []
+ if self._image_path:
+ driver_args.append('--pixel-tests')
+
+ # These are used by the Chromium DRT port
+ if self._options.use_drt:
+ driver_args.append('--test-shell')
+ return driver_args
+
def start(self):
- command = []
- # FIXME: We should not be grabbing at self._port._options.wrapper directly.
- command += self._command_wrapper(self._port._options.wrapper)
+ command = self._command_wrapper(self._options.wrapper)
command += [self._port._path_to_driver(), '-']
- if self._image_path:
- command.append('--pixel-tests')
+ command += self._driver_args()
+
environment = self._port.setup_environ_for_server()
environment['DYLD_FRAMEWORK_PATH'] = self._port._build_path()
environment['DUMPRENDERTREE_TEMP'] = self._driver_tempdir
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index 2e2da6d..14d4f0e 100755
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -564,27 +564,18 @@ class TestRunner:
filename_queue.put(item)
return filename_queue
- def _get_dump_render_tree_args(self, index):
+ def _get_test_args(self, index):
"""Returns the tuple of arguments for tests and for DumpRenderTree."""
- shell_args = []
test_args = test_type_base.TestArguments()
- png_path = None
+ test_args.png_path = None
if self._options.pixel_tests:
png_path = os.path.join(self._options.results_directory,
"png_result%s.png" % index)
- shell_args.append("--pixel-tests=" + png_path)
test_args.png_path = png_path
-
test_args.new_baseline = self._options.new_baseline
test_args.reset_results = self._options.reset_results
- if self._options.startup_dialog:
- shell_args.append('--testshell-startup-dialog')
-
- if self._options.gp_fault_error_box:
- shell_args.append('--gp-fault-error-box')
-
- return test_args, png_path, shell_args
+ return test_args
def _contains_tests(self, subdir):
for test_file in self._test_files:
@@ -610,11 +601,10 @@ class TestRunner:
test_types.append(test_type(self._port,
self._options.results_directory))
- test_args, png_path, shell_args = \
- self._get_dump_render_tree_args(i)
+ test_args = self._get_test_args(i)
thread = dump_render_tree_thread.TestShellThread(self._port,
- filename_queue, self._result_queue, test_types, test_args,
- png_path, shell_args, self._options)
+ self._options, filename_queue, self._result_queue,
+ test_types, test_args)
if self._is_single_threaded():
thread.run_in_main_thread(self, result_summary)
else:
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests.py
new file mode 100755
index 0000000..f4c8098
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests.py
@@ -0,0 +1,160 @@
+#!/usr/bin/env python
+
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from __future__ import with_statement
+
+import glob
+import logging
+import optparse
+import os
+import re
+import sys
+import webkitpy.common.checkout.scm as scm
+
+_log = logging.getLogger("webkitpy.layout_tests."
+ "update-webgl-conformance-tests")
+
+
+def remove_first_line_comment(text):
+ return re.compile(r'^<!--.*?-->\s*', re.DOTALL).sub('', text)
+
+
+def translate_includes(text):
+ # Mapping of single filename to relative path under WebKit root.
+ # Assumption: these filenames are globally unique.
+ include_mapping = {
+ "js-test-style.css": "../../js/resources",
+ "js-test-pre.js": "../../js/resources",
+ "js-test-post.js": "../../js/resources",
+ "desktop-gl-constants.js": "resources",
+ }
+
+ for filename, path in include_mapping.items():
+ search = r'(?:[^"\'= ]*/)?' + re.escape(filename)
+ replace = os.path.join(path, filename)
+ text = re.sub(search, replace, text)
+
+ return text
+
+
+def translate_khronos_test(text):
+ """
+ This method translates the contents of a Khronos test to a WebKit test.
+ """
+
+ translateFuncs = [
+ remove_first_line_comment,
+ translate_includes,
+ ]
+
+ for f in translateFuncs:
+ text = f(text)
+
+ return text
+
+
+def update_file(in_filename, out_dir):
+ # check in_filename exists
+ # check out_dir exists
+ out_filename = os.path.join(out_dir, os.path.basename(in_filename))
+
+ _log.debug("Processing " + in_filename)
+ with open(in_filename, 'r') as in_file:
+ with open(out_filename, 'w') as out_file:
+ out_file.write(translate_khronos_test(in_file.read()))
+
+
+def update_directory(in_dir, out_dir):
+ for filename in glob.glob(os.path.join(in_dir, '*.html')):
+ update_file(os.path.join(in_dir, filename), out_dir)
+
+
+def default_out_dir():
+ current_scm = scm.detect_scm_system(os.path.dirname(sys.argv[0]))
+ if not current_scm:
+ return os.getcwd()
+ root_dir = current_scm.checkout_root
+ if not root_dir:
+ return os.getcwd()
+ out_dir = os.path.join(root_dir, "LayoutTests/fast/canvas/webgl")
+ if os.path.isdir(out_dir):
+ return out_dir
+ return os.getcwd()
+
+
+def configure_logging(options):
+ """Configures the logging system."""
+ log_fmt = '%(levelname)s: %(message)s'
+ log_datefmt = '%y%m%d %H:%M:%S'
+ log_level = logging.INFO
+ if options.verbose:
+ log_fmt = ('%(asctime)s %(filename)s:%(lineno)-4d %(levelname)s '
+ '%(message)s')
+ log_level = logging.DEBUG
+ logging.basicConfig(level=log_level, format=log_fmt,
+ datefmt=log_datefmt)
+
+
+def option_parser():
+ usage = "usage: %prog [options] (input file or directory)"
+ parser = optparse.OptionParser(usage=usage)
+ parser.add_option('-v', '--verbose',
+ action='store_true',
+ default=False,
+ help='include debug-level logging')
+ parser.add_option('-o', '--output',
+ action='store',
+ type='string',
+ default=default_out_dir(),
+ metavar='DIR',
+ help='specify an output directory to place files '
+ 'in [default: %default]')
+ return parser
+
+
+def main():
+ parser = option_parser()
+ (options, args) = parser.parse_args()
+ configure_logging(options)
+
+ if len(args) == 0:
+ _log.error("Must specify an input directory or filename.")
+ parser.print_help()
+ return 1
+
+ in_name = args[0]
+ if os.path.isfile(in_name):
+ update_file(in_name, options.output)
+ elif os.path.isdir(in_name):
+ update_directory(in_name, options.output)
+ else:
+ _log.error("'%s' is not a directory or a file.", in_name)
+ return 2
+
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests_unittest.py
new file mode 100644
index 0000000..7393b70
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests_unittest.py
@@ -0,0 +1,102 @@
+#!/usr/bin/python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Unit tests for update_webgl_conformance_tests."""
+
+import unittest
+from webkitpy.layout_tests import update_webgl_conformance_tests as webgl
+
+
+def construct_script(name):
+ return "<script src=\"" + name + "\"></script>\n"
+
+
+def construct_style(name):
+ return "<link rel=\"stylesheet\" href=\"" + name + "\">"
+
+
+class TestTranslation(unittest.TestCase):
+ def assert_unchanged(self, text):
+ self.assertEqual(text, webgl.translate_khronos_test(text))
+
+ def assert_translate(self, input, output):
+ self.assertEqual(output, webgl.translate_khronos_test(input))
+
+ def test_simple_unchanged(self):
+ self.assert_unchanged("")
+ self.assert_unchanged("<html></html>")
+
+ def test_header_strip(self):
+ single_line_header = "<!-- single line header. -->"
+ multi_line_header = """<!-- this is a multi-line
+ header. it should all be removed too.
+ -->"""
+ text = "<html></html>"
+ self.assert_translate(single_line_header, "")
+ self.assert_translate(single_line_header + text, text)
+ self.assert_translate(multi_line_header + text, text)
+
+ def dont_strip_other_headers(self):
+ self.assert_unchanged("<html>\n<!-- don't remove comments on other lines. -->\n</html>")
+
+ def test_include_rewriting(self):
+ # Mappings to None are unchanged
+ styles = {
+ "../resources/js-test-style.css": "../../js/resources/js-test-style.css",
+ "fail.css": None,
+ "resources/stylesheet.css": None,
+ "../resources/style.css": None,
+ }
+ scripts = {
+ "../resources/js-test-pre.js": "../../js/resources/js-test-pre.js",
+ "../resources/js-test-post.js": "../../js/resources/js-test-post.js",
+ "../resources/desktop-gl-constants.js": "resources/desktop-gl-constants.js",
+
+ "resources/shadow-offset.js": None,
+ "../resources/js-test-post-async.js": None,
+ }
+
+ input_text = ""
+ output_text = ""
+ for input, output in styles.items():
+ input_text += construct_style(input)
+ output_text += construct_style(output if output else input)
+ for input, output in scripts.items():
+ input_text += construct_script(input)
+ output_text += construct_script(output if output else input)
+
+ head = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">\n<html>\n<head>\n'
+ foot = '</head>\n<body>\n</body>\n</html>'
+ input_text = head + input_text + foot
+ output_text = head + output_text + foot
+ self.assert_translate(input_text, output_text)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
index 62f40ea..f8ebeff 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
@@ -2519,6 +2519,7 @@ def check_identifier_name_in_declaration(filename, line_number, line, error):
and not modified_identifier.startswith('NPP_')
and not modified_identifier.startswith('NP_')
and not modified_identifier.startswith('qt_')
+ and not modified_identifier.startswith('cairo_')
and not modified_identifier.find('::qt_') >= 0
and not modified_identifier == "const_iterator"):
error(line_number, 'readability/naming', 4, identifier + " is incorrectly named. Don't use underscores in your identifier names.")
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
index 16b1a3c..2f54305 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -3703,6 +3703,11 @@ class WebKitStyleTest(CppStyleTestBase):
self.assert_lint('void QTFrame::qt_drt_is_awesome(int var1, int var2)', '')
self.assert_lint('void qt_drt_is_awesome(int var1, int var2);', '')
+ # Cairo forward-declarations should not be a failure.
+ self.assert_lint('typedef struct _cairo cairo_t;', '')
+ self.assert_lint('typedef struct _cairo_surface cairo_surface_t;', '')
+ self.assert_lint('typedef struct _cairo_scaled_font cairo_scaled_font_t;', '')
+
# NPAPI functions that start with NPN_, NPP_ or NP_ are allowed.
self.assert_lint('void NPN_Status(NPP, const char*)', '')
self.assert_lint('NPError NPP_SetWindow(NPP instance, NPWindow *window)', '')
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py
index 36cbc5f..289dc4a 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py
@@ -33,7 +33,6 @@ import traceback
from datetime import datetime, timedelta
-from webkitpy.common.net.statusserver import StatusServer
from webkitpy.common.system.executive import ScriptError
from webkitpy.common.system.deprecated_logging import log, OutputTee
@@ -117,10 +116,10 @@ class QueueEngine:
message = "Unexpected failure when processing patch! Please file a bug against webkit-patch.\n%s" % e.message_with_output()
self._delegate.handle_unexpected_error(work_item, message)
except TerminateQueue, e:
- log("\nTerminateQueue exception received.")
+ self._stopping("TerminateQueue exception received.")
return 0
except KeyboardInterrupt, e:
- log("\nUser terminated queue.")
+ self._stopping("User terminated queue.")
return 1
except Exception, e:
traceback.print_exc()
@@ -129,6 +128,13 @@ class QueueEngine:
# Never reached.
self._ensure_work_log_closed()
+ def _stopping(self, message):
+ log("\n%s" % message)
+ self._delegate.stop_work_queue(message)
+ # Be careful to shut down our OutputTee or the unit tests will be unhappy.
+ self._ensure_work_log_closed()
+ self._output_tee.remove_log(self._queue_log)
+
def _begin_logging(self):
self._queue_log = self._output_tee.add_log(self._delegate.queue_log_path())
self._work_log = None
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py
index ec91bdb..bfec401 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py
@@ -34,7 +34,9 @@ import threading
import unittest
from webkitpy.common.system.executive import ScriptError
-from webkitpy.tool.bot.queueengine import QueueEngine, QueueEngineDelegate
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.bot.queueengine import QueueEngine, QueueEngineDelegate, TerminateQueue
+
class LoggingDelegate(QueueEngineDelegate):
def __init__(self, test):
@@ -94,14 +96,19 @@ class LoggingDelegate(QueueEngineDelegate):
self._test.assertEquals(work_item, "work_item")
-class ThrowErrorDelegate(LoggingDelegate):
- def __init__(self, test, error_code):
+class RaisingDelegate(LoggingDelegate):
+ def __init__(self, test, exception):
LoggingDelegate.__init__(self, test)
- self.error_code = error_code
+ self._exception = exception
+ self.stop_message = None
def process_work_item(self, work_item):
self.record("process_work_item")
- raise ScriptError(exit_code=self.error_code)
+ raise self._exception
+
+ def stop_work_queue(self, message):
+ self.record("stop_work_queue")
+ self.stop_message = message
class NotSafeToProceedDelegate(LoggingDelegate):
@@ -132,7 +139,7 @@ class QueueEngineTest(unittest.TestCase):
self.assertTrue(os.path.exists(os.path.join(self.temp_dir, "work_log_path", "work_item.log")))
def test_unexpected_error(self):
- delegate = ThrowErrorDelegate(self, 3)
+ delegate = RaisingDelegate(self, ScriptError(exit_code=3))
work_queue = QueueEngine("error-queue", delegate, threading.Event())
work_queue.run()
expected_callbacks = LoggingDelegate.expected_callbacks[:]
@@ -143,11 +150,32 @@ class QueueEngineTest(unittest.TestCase):
self.assertEquals(delegate._callbacks, expected_callbacks)
def test_handled_error(self):
- delegate = ThrowErrorDelegate(self, QueueEngine.handled_error_code)
+ delegate = RaisingDelegate(self, ScriptError(exit_code=QueueEngine.handled_error_code))
work_queue = QueueEngine("handled-error-queue", delegate, threading.Event())
work_queue.run()
self.assertEquals(delegate._callbacks, LoggingDelegate.expected_callbacks)
+ def _test_terminating_queue(self, exception, expected_message):
+ work_item_index = LoggingDelegate.expected_callbacks.index('process_work_item')
+ # The terminating error should be handled right after process_work_item.
+ # There should be no other callbacks after stop_work_queue.
+ expected_callbacks = LoggingDelegate.expected_callbacks[:work_item_index + 1]
+ expected_callbacks.append("stop_work_queue")
+
+ delegate = RaisingDelegate(self, exception)
+ work_queue = QueueEngine("terminating-queue", delegate, threading.Event())
+
+ output = OutputCapture()
+ expected_stderr = "\n%s\n" % expected_message
+ output.assert_outputs(self, work_queue.run, [], expected_stderr=expected_stderr)
+
+ self.assertEquals(delegate._callbacks, expected_callbacks)
+ self.assertEquals(delegate.stop_message, expected_message)
+
+ def test_terminating_error(self):
+ self._test_terminating_queue(KeyboardInterrupt(), "User terminated queue.")
+ self._test_terminating_queue(TerminateQueue(), "TerminateQueue exception received.")
+
def test_not_safe_to_proceed(self):
delegate = NotSafeToProceedDelegate(self)
work_queue = FastQueueEngine(delegate)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/download.py b/WebKitTools/Scripts/webkitpy/tool/commands/download.py
index d27ab0e..ed0e3d6 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/download.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/download.py
@@ -194,6 +194,19 @@ class BuildAttachment(AbstractPatchSequencingCommand, ProcessAttachmentsMixin):
]
+class BuildAndTestAttachment(AbstractPatchSequencingCommand, ProcessAttachmentsMixin):
+ name = "build-and-test-attachment"
+ help_text = "Apply, build, and test patches from bugzilla"
+ argument_names = "ATTACHMENT_ID [ATTACHMENT_IDS]"
+ main_steps = [
+ steps.CleanWorkingDirectory,
+ steps.Update,
+ steps.ApplyPatch,
+ steps.Build,
+ steps.RunTests,
+ ]
+
+
class PostAttachmentToRietveld(AbstractPatchSequencingCommand, ProcessAttachmentsMixin):
name = "post-attachment-to-rietveld"
help_text = "Uploads a bugzilla attachment to rietveld"
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
index 1f04923..3b0ea47 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
@@ -42,16 +42,15 @@ class EarlyWarningSytemTest(QueuesTest):
def _default_expected_stderr(self, ews):
string_replacemnts = {
"name": ews.name,
- "checkout_dir": os.getcwd(), # FIXME: Use of os.getcwd() is wrong, should be scm.checkout_root
"port": ews.port_name,
"watchers": ews.watchers,
}
expected_stderr = {
- "begin_work_queue": "CAUTION: %(name)s will discard all local changes in \"%(checkout_dir)s\"\nRunning WebKit %(name)s.\n" % string_replacemnts,
+ "begin_work_queue": self._default_begin_work_queue_stderr(ews.name, os.getcwd()), # FIXME: Use of os.getcwd() is wrong, should be scm.checkout_root
"handle_unexpected_error": "Mock error message\n",
"next_work_item": "MOCK: update_work_items: %(name)s [103]\n" % string_replacemnts,
"process_work_item": "MOCK: update_status: %(name)s Pass\n" % string_replacemnts,
- "handle_script_error": "MOCK: update_status: %(name)s ScriptError error message\nMOCK bug comment: bug_id=345, cc=%(watchers)s\n--- Begin comment ---\\Attachment 1234 did not build on %(port)s:\nBuild output: http://dummy_url\n--- End comment ---\n\n" % string_replacemnts,
+ "handle_script_error": "MOCK: update_status: %(name)s ScriptError error message\nMOCK bug comment: bug_id=142, cc=%(watchers)s\n--- Begin comment ---\\Attachment 197 did not build on %(port)s:\nBuild output: http://dummy_url\n--- End comment ---\n\n" % string_replacemnts,
}
return expected_stderr
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
index 4d2a9df..bc9ee42 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
@@ -95,6 +95,10 @@ class AbstractQueue(Command, QueueEngineDelegate):
if (response != "yes"):
error("User declined.")
log("Running WebKit %s." % self.name)
+ self.tool.status_server.update_status(self.name, "Starting Queue")
+
+ def stop_work_queue(self, reason):
+ self.tool.status_server.update_status(self.name, "Stopping Queue, reason: %s" % reason)
def should_continue_work_queue(self):
self._iteration_count += 1
@@ -115,8 +119,8 @@ class AbstractQueue(Command, QueueEngineDelegate):
# Command methods
def execute(self, options, args, tool, engine=QueueEngine):
- self.options = options
- self.tool = tool
+ self.options = options # FIXME: This code is wrong. Command.options is a list, this assumes an Options element!
+ self.tool = tool # FIXME: This code is wrong too! Command.bind_to_tool handles this!
return engine(self.name, self, self.tool.wakeup_event).run()
@classmethod
@@ -144,8 +148,16 @@ class AbstractPatchQueue(AbstractQueue):
def _update_status(self, message, patch=None, results_file=None):
self.tool.status_server.update_status(self.name, message, patch, results_file)
+ # Note, eventually this will be done by a separate "feeder" queue
+ # whose job it is to poll bugzilla and feed work items into the
+ # status server for other queues to munch on.
def _update_work_items(self, patch_ids):
self.tool.status_server.update_work_items(self.name, patch_ids)
+ if patch_ids:
+ self.log_progress(patch_ids)
+
+ def _fetch_next_work_item(self):
+ return self.tool.status_server.next_work_item(self.name)
def _did_pass(self, patch):
self._update_status(self._pass_status, patch)
@@ -189,18 +201,22 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler):
return rollout_cmp
return cmp(a.attach_date(), b.attach_date())
- def next_work_item(self):
+ def _feed_work_items_to_server(self):
+ # Grab the set of patches from bugzilla, sort them, and update the status server.
+ # Eventually this will all be done by a separate feeder queue.
patches = self._validate_patches_in_commit_queue()
patches = sorted(patches, self._patch_cmp)
self._update_work_items([patch.id() for patch in patches])
- if not patches:
- self._update_status("Empty queue")
+
+ def next_work_item(self):
+ self._feed_work_items_to_server()
+ # The grab the next patch to work on back from the status server.
+ patch_id = self._fetch_next_work_item()
+ if not patch_id:
return None
- # Only bother logging if we have patches in the queue.
- self.log_progress([patch.id() for patch in patches])
- return patches[0]
+ return self.tool.bugs.fetch_attachment(patch_id)
- def _can_build_and_test(self):
+ def _can_build_and_test_without_patch(self):
try:
self.run_webkit_patch([
"build-and-test",
@@ -211,25 +227,24 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler):
"--no-update",
"--build-style=both",
"--quiet"])
+ return True
except ScriptError, e:
failure_log = self._log_from_script_error_for_upload(e)
- self._update_status("Unable to successfully build and test", results_file=failure_log)
+ self._update_status("Unable to build and test without patch", results_file=failure_log)
return False
- return True
def should_proceed_with_work_item(self, patch):
patch_text = "rollout patch" if patch.is_rollout() else "patch"
self._update_status("Landing %s" % patch_text, patch)
return True
- def _land(self, patch, first_run=False):
+ def _build_and_test_patch(self, patch, first_run=False):
try:
args = [
- "land-attachment",
+ "build-and-test-attachment",
"--force-clean",
"--build",
"--non-interactive",
- "--ignore-builders",
"--build-style=both",
"--quiet",
patch.id()
@@ -249,27 +264,68 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler):
# built and tested.
args.append("--no-update")
self.run_webkit_patch(args)
- self._did_pass(patch)
return True
except ScriptError, e:
+ failure_log = self._log_from_script_error_for_upload(e)
+ self._update_status("Unable to build and test patch", patch=patch, results_file=failure_log)
if first_run:
return False
self._did_fail(patch)
raise
+ def _revalidate_patch(self, patch):
+ # Bugs might get closed, or patches might be obsoleted or r-'d while the
+ # commit-queue is processing. Do one last minute check before landing.
+ patch = self.tool.bugs.fetch_attachment(patch.id())
+ if patch.is_obsolete():
+ return None
+ if patch.bug().is_closed():
+ return None
+ if not patch.committer():
+ return None
+ # Reviewer is not required. Misisng reviewers will be caught during the ChangeLog check during landing.
+ return patch
+
+ def _land(self, patch):
+ try:
+ args = [
+ "land-attachment",
+ "--force-clean",
+ "--non-interactive",
+ "--ignore-builders",
+ "--quiet",
+ "--parent-command=commit-queue",
+ patch.id(),
+ ]
+ self.run_webkit_patch(args)
+ self._did_pass(patch)
+ except ScriptError, e:
+ failure_log = self._log_from_script_error_for_upload(e)
+ self._update_status("Unable to land patch", patch=patch, results_file=failure_log)
+ self._did_fail(patch)
+ raise
+
def process_work_item(self, patch):
self._cc_watchers(patch.bug_id())
- if not self._land(patch, first_run=True):
- # The patch failed to land, but the bots were green. It's possible
- # that the bots were behind. To check that case, we try to build and
- # test ourselves.
- if not self._can_build_and_test():
+ if not self._build_and_test_patch(patch, first_run=True):
+ self._update_status("Building and testing without the patch as a sanity check", patch)
+ # The patch failed to build and test. It's possible that the
+ # tree is busted. To check that case, we try to build and test
+ # without the patch.
+ if not self._can_build_and_test_without_patch():
return False
+ self._update_status("Build and test succeeded, trying again with patch", patch)
# Hum, looks like the patch is actually bad. Of course, we could
# have been bitten by a flaky test the first time around. We try
- # to land again. If it fails a second time, we're pretty sure its
- # a bad test and re can reject it outright.
- self._land(patch)
+ # to build and test again. If it fails a second time, we're pretty
+ # sure its a bad test and re can reject it outright.
+ self._build_and_test_patch(patch)
+ # Do one last check to catch any bug changes (cq-, closed, reviewer changed, etc.)
+ # This helps catch races between the bots if locks expire.
+ patch = self._revalidate_patch(patch)
+ if not patch:
+ return False
+ self._land(patch)
return True
def handle_unexpected_error(self, patch, message):
@@ -291,6 +347,8 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler):
@classmethod
def handle_checkout_needs_update(cls, tool, state, options, error):
+ message = "Tests passed, but commit failed (checkout out of date). Updating, then landing without building or re-running tests."
+ tool.status_server.update_status(cls.name, message, state["patch"])
# The only time when we find out that out checkout needs update is
# when we were ready to actually pull the trigger and land the patch.
# Rather than spinning in the master process, we retry without
@@ -377,7 +435,6 @@ class AbstractReviewQueue(AbstractPatchQueue, PersistentPatchCollectionDelegate,
patch_id = self._patches.next()
if patch_id:
return self.tool.bugs.fetch_attachment(patch_id)
- self._update_status("Empty queue")
def should_proceed_with_work_item(self, patch):
raise NotImplementedError, "subclasses must implement"
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
index fd6543c..2deee76 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -34,9 +34,9 @@ from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.thirdparty.mock import Mock
from webkitpy.tool.commands.commandtest import CommandsTest
from webkitpy.tool.commands.queues import *
-from webkitpy.tool.commands.queuestest import QueuesTest
+from webkitpy.tool.commands.queuestest import QueuesTest, MockPatch
from webkitpy.tool.commands.stepsequence import StepSequence
-from webkitpy.tool.mocktool import MockTool, MockSCM
+from webkitpy.tool.mocktool import MockTool, MockSCM, MockStatusServer
class TestQueue(AbstractPatchQueue):
@@ -47,16 +47,10 @@ class TestReviewQueue(AbstractReviewQueue):
name = "test-review-queue"
-class MockPatch(object):
+class MockRolloutPatch(MockPatch):
def is_rollout(self):
return True
- def bug_id(self):
- return 12345
-
- def id(self):
- return 76543
-
class AbstractQueueTest(CommandsTest):
def _assert_log_progress_output(self, patch_ids, progress_output):
@@ -121,6 +115,16 @@ class AbstractQueueTest(CommandsTest):
self._assert_log_message(script_error, expected_output)
+class AbstractPatchQueueTest(CommandsTest):
+ def test_fetch_next_work_item(self):
+ queue = AbstractPatchQueue()
+ tool = MockTool()
+ queue.bind_to_tool(tool)
+ self.assertEquals(queue._fetch_next_work_item(), None)
+ tool.status_server = MockStatusServer(work_items=[2, 1, 3])
+ self.assertEquals(queue._fetch_next_work_item(), 2)
+
+
class AbstractReviewQueueTest(CommandsTest):
def test_patch_collection_delegate_methods(self):
queue = TestReviewQueue()
@@ -141,25 +145,47 @@ class NeedsUpdateSequence(StepSequence):
class AlwaysCommitQueueTool(object):
+ def __init__(self):
+ self.status_server = MockStatusServer()
+
def command_by_name(self, name):
return CommitQueue
+class SecondThoughtsCommitQueue(CommitQueue):
+ def _build_and_test_patch(self, patch, first_run=True):
+ attachment_dictionary = {
+ "id": patch.id(),
+ "bug_id": patch.bug_id(),
+ "name": "Rejected",
+ "is_obsolete": True,
+ "is_patch": False,
+ "review": "-",
+ "reviewer_email": "foo@bar.com",
+ "commit-queue": "-",
+ "committer_email": "foo@bar.com",
+ "attacher_email": "Contributer1",
+ }
+ patch = Attachment(attachment_dictionary, None)
+ self.tool.bugs.set_override_patch(patch)
+ return True
+
+
class CommitQueueTest(QueuesTest):
def test_commit_queue(self):
expected_stderr = {
- "begin_work_queue" : "CAUTION: commit-queue will discard all local changes in \"%s\"\nRunning WebKit commit-queue.\n" % MockSCM.fake_checkout_root,
+ "begin_work_queue": self._default_begin_work_queue_stderr("commit-queue", MockSCM.fake_checkout_root),
"should_proceed_with_work_item": "MOCK: update_status: commit-queue Landing patch\n",
# FIXME: The commit-queue warns about bad committers twice. This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
- "next_work_item" : """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+ "next_work_item": """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
MOCK setting flag 'commit-queue' to '-' on attachment '128' with comment 'Rejecting patch 128 from commit-queue.' and additional comment 'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.\n\n- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.\n\n- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights.'
MOCK: update_work_items: commit-queue [106, 197]
2 patches in commit-queue [106, 197]
""",
- "process_work_item" : "MOCK: update_status: commit-queue Pass\n",
- "handle_unexpected_error" : "MOCK setting flag 'commit-queue' to '-' on attachment '1234' with comment 'Rejecting patch 1234 from commit-queue.' and additional comment 'Mock error message'\n",
- "handle_script_error": "MOCK: update_status: commit-queue ScriptError error message\nMOCK setting flag 'commit-queue' to '-' on attachment '1234' with comment 'Rejecting patch 1234 from commit-queue.' and additional comment 'ScriptError error message'\n",
+ "process_work_item": "MOCK: update_status: commit-queue Pass\n",
+ "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'Mock error message'\n",
+ "handle_script_error": "MOCK: update_status: commit-queue ScriptError error message\nMOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'ScriptError error message'\n",
}
self.assert_queue_outputs(CommitQueue(), expected_stderr=expected_stderr)
@@ -167,10 +193,10 @@ MOCK: update_work_items: commit-queue [106, 197]
tool = MockTool(log_executive=True)
tool.buildbot.light_tree_on_fire()
expected_stderr = {
- "begin_work_queue" : "CAUTION: commit-queue will discard all local changes in \"%s\"\nRunning WebKit commit-queue.\n" % MockSCM.fake_checkout_root,
+ "begin_work_queue": self._default_begin_work_queue_stderr("commit-queue", MockSCM.fake_checkout_root),
"should_proceed_with_work_item": "MOCK: update_status: commit-queue Landing patch\n",
# FIXME: The commit-queue warns about bad committers twice. This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
- "next_work_item" : """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+ "next_work_item": """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
MOCK setting flag 'commit-queue' to '-' on attachment '128' with comment 'Rejecting patch 128 from commit-queue.' and additional comment 'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.
@@ -180,18 +206,18 @@ MOCK setting flag 'commit-queue' to '-' on attachment '128' with comment 'Reject
MOCK: update_work_items: commit-queue [106, 197]
2 patches in commit-queue [106, 197]
""",
- "process_work_item" : "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--build', '--non-interactive', '--ignore-builders', '--build-style=both', '--quiet', 1234, '--test']\nMOCK: update_status: commit-queue Pass\n",
- "handle_unexpected_error" : "MOCK setting flag 'commit-queue' to '-' on attachment '1234' with comment 'Rejecting patch 1234 from commit-queue.' and additional comment 'Mock error message'\n",
- "handle_script_error": "MOCK: update_status: commit-queue ScriptError error message\nMOCK setting flag 'commit-queue' to '-' on attachment '1234' with comment 'Rejecting patch 1234 from commit-queue.' and additional comment 'ScriptError error message'\n",
+ "process_work_item": "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build-and-test-attachment', '--force-clean', '--build', '--non-interactive', '--build-style=both', '--quiet', 197, '--test']\nMOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--non-interactive', '--ignore-builders', '--quiet', '--parent-command=commit-queue', 197]\nMOCK: update_status: commit-queue Pass\n",
+ "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'Mock error message'\n",
+ "handle_script_error": "MOCK: update_status: commit-queue ScriptError error message\nMOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'ScriptError error message'\n",
}
self.assert_queue_outputs(CommitQueue(), tool=tool, expected_stderr=expected_stderr)
def test_rollout_lands(self):
tool = MockTool(log_executive=True)
tool.buildbot.light_tree_on_fire()
- rollout_patch = MockPatch()
+ rollout_patch = MockRolloutPatch()
expected_stderr = {
- "begin_work_queue": "CAUTION: commit-queue will discard all local changes in \"%s\"\nRunning WebKit commit-queue.\n" % MockSCM.fake_checkout_root,
+ "begin_work_queue": self._default_begin_work_queue_stderr("commit-queue", MockSCM.fake_checkout_root),
"should_proceed_with_work_item": "MOCK: update_status: commit-queue Landing rollout patch\n",
# FIXME: The commit-queue warns about bad committers twice. This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
"next_work_item": """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
@@ -204,9 +230,9 @@ MOCK setting flag 'commit-queue' to '-' on attachment '128' with comment 'Reject
MOCK: update_work_items: commit-queue [106, 197]
2 patches in commit-queue [106, 197]
""",
- "process_work_item": "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--build', '--non-interactive', '--ignore-builders', '--build-style=both', '--quiet', 76543]\nMOCK: update_status: commit-queue Pass\n",
- "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '76543' with comment 'Rejecting patch 76543 from commit-queue.' and additional comment 'Mock error message'\n",
- "handle_script_error": "MOCK: update_status: commit-queue ScriptError error message\nMOCK setting flag 'commit-queue' to '-' on attachment '1234' with comment 'Rejecting patch 1234 from commit-queue.' and additional comment 'ScriptError error message'\n",
+ "process_work_item": "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build-and-test-attachment', '--force-clean', '--build', '--non-interactive', '--build-style=both', '--quiet', 197]\nMOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--non-interactive', '--ignore-builders', '--quiet', '--parent-command=commit-queue', 197]\nMOCK: update_status: commit-queue Pass\n",
+ "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'Mock error message'\n",
+ "handle_script_error": "MOCK: update_status: commit-queue ScriptError error message\nMOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'ScriptError error message'\n",
}
self.assert_queue_outputs(CommitQueue(), tool=tool, work_item=rollout_patch, expected_stderr=expected_stderr)
@@ -215,7 +241,7 @@ MOCK: update_work_items: commit-queue [106, 197]
tool = MockTool()
tool.executive = Mock()
queue.bind_to_tool(tool)
- self.assertTrue(queue._can_build_and_test())
+ self.assertTrue(queue._can_build_and_test_without_patch())
expected_run_args = ["echo", "--status-host=example.com", "build-and-test", "--force-clean", "--build", "--test", "--non-interactive", "--no-update", "--build-style=both", "--quiet"]
tool.executive.run_and_throw_if_fail.assert_called_with(expected_run_args)
@@ -245,22 +271,28 @@ MOCK: update_work_items: commit-queue [106, 197]
tool = AlwaysCommitQueueTool()
sequence = NeedsUpdateSequence(None)
- expected_stderr = "Commit failed because the checkout is out of date. Please update and try again.\n"
- OutputCapture().assert_outputs(self, sequence.run_and_handle_errors, [tool, options], expected_exception=TryAgain, expected_stderr=expected_stderr)
+ expected_stderr = "Commit failed because the checkout is out of date. Please update and try again.\nMOCK: update_status: commit-queue Tests passed, but commit failed (checkout out of date). Updating, then landing without building or re-running tests.\n"
+ state = {'patch': None}
+ OutputCapture().assert_outputs(self, sequence.run_and_handle_errors, [tool, options, state], expected_exception=TryAgain, expected_stderr=expected_stderr)
self.assertEquals(options.update, True)
self.assertEquals(options.build, False)
self.assertEquals(options.test, False)
+ def test_manual_reject_during_processing(self):
+ queue = SecondThoughtsCommitQueue()
+ queue.bind_to_tool(MockTool())
+ queue.process_work_item(MockPatch())
+
class RietveldUploadQueueTest(QueuesTest):
def test_rietveld_upload_queue(self):
expected_stderr = {
- "begin_work_queue": "CAUTION: rietveld-upload-queue will discard all local changes in \"%s\"\nRunning WebKit rietveld-upload-queue.\n" % MockSCM.fake_checkout_root,
+ "begin_work_queue": self._default_begin_work_queue_stderr("rietveld-upload-queue", MockSCM.fake_checkout_root),
"should_proceed_with_work_item": "MOCK: update_status: rietveld-upload-queue Uploading patch\n",
"process_work_item": "MOCK: update_status: rietveld-upload-queue Pass\n",
- "handle_unexpected_error": "Mock error message\nMOCK setting flag 'in-rietveld' to '-' on attachment '1234' with comment 'None' and additional comment 'None'\n",
- "handle_script_error": "ScriptError error message\nMOCK: update_status: rietveld-upload-queue ScriptError error message\nMOCK setting flag 'in-rietveld' to '-' on attachment '1234' with comment 'None' and additional comment 'None'\n",
+ "handle_unexpected_error": "Mock error message\nMOCK setting flag 'in-rietveld' to '-' on attachment '197' with comment 'None' and additional comment 'None'\n",
+ "handle_script_error": "ScriptError error message\nMOCK: update_status: rietveld-upload-queue ScriptError error message\nMOCK setting flag 'in-rietveld' to '-' on attachment '197' with comment 'None' and additional comment 'None'\n",
}
self.assert_queue_outputs(RietveldUploadQueue(), expected_stderr=expected_stderr)
@@ -268,12 +300,12 @@ class RietveldUploadQueueTest(QueuesTest):
class StyleQueueTest(QueuesTest):
def test_style_queue(self):
expected_stderr = {
- "begin_work_queue" : "CAUTION: style-queue will discard all local changes in \"%s\"\nRunning WebKit style-queue.\n" % MockSCM.fake_checkout_root,
+ "begin_work_queue": self._default_begin_work_queue_stderr("style-queue", MockSCM.fake_checkout_root),
"next_work_item": "MOCK: update_work_items: style-queue [103]\n",
"should_proceed_with_work_item": "MOCK: update_status: style-queue Checking style\n",
- "process_work_item" : "MOCK: update_status: style-queue Pass\n",
- "handle_unexpected_error" : "Mock error message\n",
- "handle_script_error": "MOCK: update_status: style-queue ScriptError error message\nMOCK bug comment: bug_id=345, cc=[]\n--- Begin comment ---\\Attachment 1234 did not pass style-queue:\n\nScriptError error message\n\nIf any of these errors are false positives, please file a bug against check-webkit-style.\n--- End comment ---\n\n",
+ "process_work_item": "MOCK: update_status: style-queue Pass\n",
+ "handle_unexpected_error": "Mock error message\n",
+ "handle_script_error": "MOCK: update_status: style-queue ScriptError error message\nMOCK bug comment: bug_id=142, cc=[]\n--- Begin comment ---\\Attachment 197 did not pass style-queue:\n\nScriptError error message\n\nIf any of these errors are false positives, please file a bug against check-webkit-style.\n--- End comment ---\n\n",
}
expected_exceptions = {
"handle_script_error": SystemExit,
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
index 9e17c5c..aa3cef4 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
@@ -45,16 +45,20 @@ class MockQueueEngine(object):
class MockPatch():
def id(self):
- return 1234
+ return 197
def bug_id(self):
- return 345
+ return 142
+
+ def is_rollout(self):
+ return False
class QueuesTest(unittest.TestCase):
+ # Ids match patch1 in mocktool.py
mock_work_item = Attachment({
- "id": 1234,
- "bug_id": 345,
+ "id": 197,
+ "bug_id": 142,
"name": "Patch",
"attacher_email": "adam@example.com",
}, None)
@@ -71,6 +75,10 @@ class QueuesTest(unittest.TestCase):
expected_stderr=expected_stderr.get(func_name, ""),
expected_exception=exception)
+ def _default_begin_work_queue_stderr(self, name, checkout_dir):
+ string_replacements = {"name": name, 'checkout_dir': checkout_dir}
+ return "CAUTION: %(name)s will discard all local changes in \"%(checkout_dir)s\"\nRunning WebKit %(name)s.\nMOCK: update_status: %(name)s Starting Queue\n" % string_replacements
+
def assert_queue_outputs(self, queue, args=None, work_item=None, expected_stdout=None, expected_stderr=None, expected_exceptions=None, options=Mock(), tool=MockTool()):
if not expected_stdout:
expected_stdout = {}
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py
index 4b4b8b6..a63ec24 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py
@@ -42,7 +42,7 @@ class SheriffBotTest(QueuesTest):
29837: [self.builder1],
}
expected_stderr = {
- "begin_work_queue": "CAUTION: sheriff-bot will discard all local changes in \"%s\"\nRunning WebKit sheriff-bot.\n" % os.getcwd(),
+ "begin_work_queue": self._default_begin_work_queue_stderr("sheriff-bot", os.getcwd()),
"next_work_item": "",
"process_work_item": "MOCK: irc.post: abarth, darin, eseidel: http://trac.webkit.org/changeset/29837 might have broken Builder1\nMOCK bug comment: bug_id=42, cc=['abarth@webkit.org', 'eric@webkit.org']\n--- Begin comment ---\\http://trac.webkit.org/changeset/29837 might have broken Builder1\n--- End comment ---\n\n",
"handle_unexpected_error": "Mock error message\n"
diff --git a/WebKitTools/Scripts/webkitpy/tool/mocktool.py b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
index e3d36ce..8a6188a 100644
--- a/WebKitTools/Scripts/webkitpy/tool/mocktool.py
+++ b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
@@ -161,6 +161,7 @@ _bug1 = {
"invalid commit-queue setter.",
"assigned_to_email": _unassigned_email,
"attachments": [_patch1, _patch2],
+ "bug_status": "UNCONFIRMED",
}
@@ -169,6 +170,7 @@ _bug2 = {
"title": "Bug with a patch needing review.",
"assigned_to_email": "foo@foo.com",
"attachments": [_patch3],
+ "bug_status": "ASSIGNED",
}
@@ -177,6 +179,7 @@ _bug3 = {
"title": "The third bug",
"assigned_to_email": _unassigned_email,
"attachments": [_patch7],
+ "bug_status": "NEW",
}
@@ -185,6 +188,7 @@ _bug4 = {
"title": "The fourth bug",
"assigned_to_email": "foo@foo.com",
"attachments": [_patch4, _patch5, _patch6],
+ "bug_status": "REOPENED",
}
@@ -254,8 +258,8 @@ class MockBugzilla(Mock):
def __init__(self):
Mock.__init__(self)
self.queries = MockBugzillaQueries(self)
- self.committers = CommitterList(reviewers=[Reviewer("Foo Bar",
- "foo@bar.com")])
+ self.committers = CommitterList(reviewers=[Reviewer("Foo Bar", "foo@bar.com")])
+ self._override_patch = None
def create_bug(self,
bug_title,
@@ -277,7 +281,13 @@ class MockBugzilla(Mock):
def fetch_bug(self, bug_id):
return Bug(self.bug_cache.get(bug_id), self)
+ def set_override_patch(self, patch):
+ self._override_patch = patch
+
def fetch_attachment(self, attachment_id):
+ if self._override_patch:
+ return self._override_patch
+
# This could be changed to .get() if we wish to allow failed lookups.
attachment_dictionary = self.attachment_cache[attachment_id]
bug = self.fetch_bug(attachment_dictionary["bug_id"])
@@ -497,8 +507,9 @@ class MockIRC(object):
class MockStatusServer(object):
- def __init__(self):
+ def __init__(self, work_items=None):
self.host = "example.com"
+ self._work_items = work_items or []
def patch_status(self, queue_name, patch_id):
return None
@@ -506,7 +517,13 @@ class MockStatusServer(object):
def svn_revision(self, svn_revision):
return None
+ def next_work_item(self, queue_name):
+ if not self._work_items:
+ return None
+ return self._work_items[0]
+
def update_work_items(self, queue_name, work_items):
+ self._work_items = work_items
log("MOCK: update_work_items: %s %s" % (queue_name, work_items))
def update_status(self, queue_name, status, patch=None, results_file=None):
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/applypatch.py b/WebKitTools/Scripts/webkitpy/tool/steps/applypatch.py
index 6cded27..327ac09 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/applypatch.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/applypatch.py
@@ -35,8 +35,9 @@ class ApplyPatch(AbstractStep):
def options(cls):
return AbstractStep.options() + [
Options.non_interactive,
+ Options.force_patch,
]
def run(self, state):
log("Processing patch %s from bug %s." % (state["patch"].id(), state["patch"].bug_id()))
- self._tool.checkout().apply_patch(state["patch"], force=self._options.non_interactive)
+ self._tool.checkout().apply_patch(state["patch"], force=self._options.non_interactive or self._options.force_patch)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/options.py b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
index e7e3855..3dc1963 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/options.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
@@ -43,6 +43,7 @@ class Options(object):
description = make_option("-m", "--description", action="store", type="string", dest="description", help="Description string for the attachment (default: \"patch\")")
email = make_option("--email", action="store", type="string", dest="email", help="Email address to use in ChangeLogs.")
force_clean = make_option("--force-clean", action="store_true", dest="force_clean", default=False, help="Clean working directory before applying patches (removes local changes and commits)")
+ force_patch = make_option("--force-patch", action="store_true", dest="force_patch", default=False, help="Forcefully applies the patch, continuing past errors.")
git_commit = make_option("-g", "--git-commit", action="store", dest="git_commit", help="Operate on a local commit. If a range, the commits are squashed into one. HEAD.. operates on working copy changes only.")
local_commit = make_option("--local-commit", action="store_true", dest="local_commit", default=False, help="Make a local commit for each applied patch")
non_interactive = make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible.")
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
index 472cf6c..73de45b 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
@@ -92,30 +92,38 @@ void EventSendingController::leapForward(JSContextRef context, size_t argumentCo
void EventSendingController::textZoomIn()
{
- WKBundlePageSetZoomMode(InjectedBundle::shared().page()->page(), kWKBundlePageZoomModeTextOnly);
- float zoomFactor = WKBundlePageGetZoomFactor(InjectedBundle::shared().page()->page());
- WKBundlePageSetZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor * ZoomMultiplierRatio);
+ // Ensure page zoom is reset.
+ WKBundlePageSetPageZoomFactor(InjectedBundle::shared().page()->page(), 1);
+
+ double zoomFactor = WKBundlePageGetTextZoomFactor(InjectedBundle::shared().page()->page());
+ WKBundlePageSetTextZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor * ZoomMultiplierRatio);
}
void EventSendingController::textZoomOut()
{
- WKBundlePageSetZoomMode(InjectedBundle::shared().page()->page(), kWKBundlePageZoomModeTextOnly);
- float zoomFactor = WKBundlePageGetZoomFactor(InjectedBundle::shared().page()->page());
- WKBundlePageSetZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor / ZoomMultiplierRatio);
+ // Ensure page zoom is reset.
+ WKBundlePageSetPageZoomFactor(InjectedBundle::shared().page()->page(), 1);
+
+ double zoomFactor = WKBundlePageGetTextZoomFactor(InjectedBundle::shared().page()->page());
+ WKBundlePageSetTextZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor / ZoomMultiplierRatio);
}
void EventSendingController::zoomPageIn()
{
- WKBundlePageSetZoomMode(InjectedBundle::shared().page()->page(), kWKBundlePageZoomModePage);
- float zoomFactor = WKBundlePageGetZoomFactor(InjectedBundle::shared().page()->page());
- WKBundlePageSetZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor * ZoomMultiplierRatio);
+ // Ensure text zoom is reset.
+ WKBundlePageSetTextZoomFactor(InjectedBundle::shared().page()->page(), 1);
+
+ double zoomFactor = WKBundlePageGetPageZoomFactor(InjectedBundle::shared().page()->page());
+ WKBundlePageSetPageZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor * ZoomMultiplierRatio);
}
void EventSendingController::zoomPageOut()
{
- WKBundlePageSetZoomMode(InjectedBundle::shared().page()->page(), kWKBundlePageZoomModePage);
- float zoomFactor = WKBundlePageGetZoomFactor(InjectedBundle::shared().page()->page());
- WKBundlePageSetZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor / ZoomMultiplierRatio);
+ // Ensure text zoom is reset.
+ WKBundlePageSetTextZoomFactor(InjectedBundle::shared().page()->page(), 1);
+
+ double zoomFactor = WKBundlePageGetPageZoomFactor(InjectedBundle::shared().page()->page());
+ WKBundlePageSetPageZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor / ZoomMultiplierRatio);
}
// Object Creation
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index bf7a029..dd92eca 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -31,54 +31,97 @@
#include <WebKit2/WKArray.h>
#include <WebKit2/WKBundleFrame.h>
#include <WebKit2/WKBundleFramePrivate.h>
-#include <WebKit2/WKBundleNode.h>
#include <WebKit2/WKBundlePagePrivate.h>
-#include <WebKit2/WKRetainPtr.h>
-#include <WebKit2/WKBundleRange.h>
-#include <WebKit2/WKBundleScriptWorld.h>
using namespace std;
namespace WTR {
-static ostream& operator<<(ostream& out, WKBundleFrameRef frame)
+static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const char* propertyName)
{
- WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame));
- if (WKBundleFrameIsMainFrame(frame)) {
- if (!WKStringIsEmpty(name.get()))
- out << "main frame \"" << name << "\"";
- else
- out << "main frame";
- } else {
- if (!WKStringIsEmpty(name.get()))
- out << "frame \"" << name << "\"";
- else
- out << "frame (anonymous)";
- }
+ if (!object)
+ return 0;
+ JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName));
+ return JSObjectGetProperty(context, object, propertyNameString.get(), 0);
+}
- return out;
+static double propertyValueDouble(JSContextRef context, JSObjectRef object, const char* propertyName)
+{
+ JSValueRef value = propertyValue(context, object, propertyName);
+ if (!value)
+ return 0;
+ return JSValueToNumber(context, value, 0);
}
-static string dumpPath(WKBundleNodeRef node)
+static int propertyValueInt(JSContextRef context, JSObjectRef object, const char* propertyName)
{
- if (!node)
- return "(null)";
- WKRetainPtr<WKStringRef> nodeName(AdoptWK, WKBundleNodeCopyNodeName(node));
+ return static_cast<int>(propertyValueDouble(context, object, propertyName));
+}
+
+static double numericWindowPropertyValue(WKBundleFrameRef frame, const char* propertyName)
+{
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+ return propertyValueDouble(context, JSContextGetGlobalObject(context), propertyName);
+}
+
+static string dumpPath(JSGlobalContextRef context, JSObjectRef nodeValue)
+{
+ JSValueRef nodeNameValue = propertyValue(context, nodeValue, "nodeName");
+ JSRetainPtr<JSStringRef> jsStringNodeName(Adopt, JSValueToStringCopy(context, nodeNameValue, 0));
+ WKRetainPtr<WKStringRef> nodeName = toWK(jsStringNodeName);
+
+ JSValueRef parentNode = propertyValue(context, nodeValue, "parentNode");
+
ostringstream out;
out << nodeName;
- if (WKBundleNodeRef parent = WKBundleNodeGetParent(node))
- out << " > " << dumpPath(parent);
+
+ if (parentNode && JSValueIsObject(context, parentNode))
+ out << " > " << dumpPath(context, (JSObjectRef)parentNode);
+
return out.str();
}
-static ostream& operator<<(ostream& out, WKBundleRangeRef rangeRef)
+static string dumpPath(WKBundlePageRef page, WKBundleScriptWorldRef world, WKBundleNodeHandleRef node)
{
- if (rangeRef)
- out << "range from " << WKBundleRangeGetStartOffset(rangeRef) << " of " << dumpPath(WKBundleRangeGetStartContainer(rangeRef)) << " to " << WKBundleRangeGetEndOffset(rangeRef) << " of " << dumpPath(WKBundleRangeGetEndContainer(rangeRef));
- else
- out << "(null)";
+ if (!node)
+ return "(null)";
- return out;
+ WKBundleFrameRef frame = WKBundlePageGetMainFrame(page);
+
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContextForWorld(frame, world);
+ JSValueRef nodeValue = WKBundleFrameGetJavaScriptWrapperForNodeForWorld(frame, node, world);
+ ASSERT(JSValueIsObject(context, nodeValue));
+ JSObjectRef nodeObject = (JSObjectRef)nodeValue;
+
+ return dumpPath(context, nodeObject);
+}
+
+static string toStr(WKBundlePageRef page, WKBundleScriptWorldRef world, WKBundleRangeHandleRef rangeRef)
+{
+ if (!rangeRef)
+ return "(null)";
+
+ WKBundleFrameRef frame = WKBundlePageGetMainFrame(page);
+
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContextForWorld(frame, world);
+ JSValueRef rangeValue = WKBundleFrameGetJavaScriptWrapperForRangeForWorld(frame, rangeRef, world);
+ ASSERT(JSValueIsObject(context, rangeValue));
+ JSObjectRef rangeObject = (JSObjectRef)rangeValue;
+
+ JSValueRef startNodeValue = propertyValue(context, rangeObject, "startContainer");
+ ASSERT(JSValueIsObject(context, startNodeValue));
+ JSObjectRef startNodeObject = (JSObjectRef)startNodeValue;
+
+ JSValueRef endNodeValue = propertyValue(context, rangeObject, "endContainer");
+ ASSERT(JSValueIsObject(context, endNodeValue));
+ JSObjectRef endNodeObject = (JSObjectRef)endNodeValue;
+
+ int startOffset = propertyValueInt(context, rangeObject, "startOffset");
+ int endOffset = propertyValueInt(context, rangeObject, "endOffset");
+
+ ostringstream out;
+ out << "range from " << startOffset << " of " << dumpPath(context, startNodeObject) << " to " << endOffset << " of " << dumpPath(context, endNodeObject);
+ return out.str();
}
static ostream& operator<<(ostream& out, WKBundleCSSStyleDeclarationRef style)
@@ -90,8 +133,27 @@ static ostream& operator<<(ostream& out, WKBundleCSSStyleDeclarationRef style)
return out;
}
+static ostream& operator<<(ostream& out, WKBundleFrameRef frame)
+{
+ WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame));
+ if (WKBundleFrameIsMainFrame(frame)) {
+ if (!WKStringIsEmpty(name.get()))
+ out << "main frame \"" << name << "\"";
+ else
+ out << "main frame";
+ } else {
+ if (!WKStringIsEmpty(name.get()))
+ out << "frame \"" << name << "\"";
+ else
+ out << "frame (anonymous)";
+ }
+
+ return out;
+}
+
InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
: m_page(page)
+ , m_world(AdoptWK, WKBundleScriptWorldCreateWorld())
, m_isLoading(false)
{
WKBundlePageLoaderClient loaderClient = {
@@ -105,6 +167,8 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
didFinishLoadForFrame,
didFailLoadWithErrorForFrame,
didReceiveTitleForFrame,
+ 0,
+ 0,
didClearWindowForFrame,
didCancelClientRedirectForFrame,
willPerformClientRedirectForFrame,
@@ -158,43 +222,48 @@ void InjectedBundlePage::reset()
{
WKBundlePageClearMainFrameName(m_page);
- WKBundlePageSetZoomFactor(m_page, 1.0f);
- WKBundlePageSetZoomMode(m_page, kWKBundlePageZoomModePage);
+ WKBundlePageSetPageZoomFactor(m_page, 1);
+ WKBundlePageSetTextZoomFactor(m_page, 1);
}
// Loader Client Callbacks
-void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
{
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didStartProvisionalLoadForFrame(frame);
}
-void InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+void InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
{
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didReceiveServerRedirectForProvisionalLoadForFrame(frame);
}
-void InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+void InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
{
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFailProvisionalLoadWithErrorForFrame(frame);
}
-void InjectedBundlePage::didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+void InjectedBundlePage::didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
{
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didCommitLoadForFrame(frame);
}
-void InjectedBundlePage::didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+void InjectedBundlePage::didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
{
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishLoadForFrame(frame);
}
-void InjectedBundlePage::didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishDocumentLoadForFrame(frame);
+}
+
+void InjectedBundlePage::didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
{
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFailLoadWithErrorForFrame(frame);
}
-void InjectedBundlePage::didReceiveTitleForFrame(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, const void *clientInfo)
+void InjectedBundlePage::didReceiveTitleForFrame(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
{
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didReceiveTitleForFrame(title, frame);
}
@@ -219,11 +288,6 @@ void InjectedBundlePage::didChangeLocationWithinPageForFrame(WKBundlePageRef pag
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didChangeLocationWithinPageForFrame(frame);
}
-void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo)
-{
- static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishDocumentLoadForFrame(frame);
-}
-
void InjectedBundlePage::didHandleOnloadEventsForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo)
{
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didHandleOnloadEventsForFrame(frame);
@@ -261,25 +325,6 @@ void InjectedBundlePage::didCommitLoadForFrame(WKBundleFrameRef frame)
{
}
-static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const char* propertyName)
-{
- if (!object)
- return 0;
- JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName));
- JSValueRef exception;
- return JSObjectGetProperty(context, object, propertyNameString.get(), &exception);
-}
-
-static double numericWindowPropertyValue(WKBundleFrameRef frame, const char* propertyName)
-{
- JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
- JSValueRef value = propertyValue(context, JSContextGetGlobalObject(context), propertyName);
- if (!value)
- return 0;
- JSValueRef exception;
- return JSValueToNumber(context, value, &exception);
-}
-
enum FrameNamePolicy { ShouldNotIncludeFrameName, ShouldIncludeFrameName };
static void dumpFrameScrollPosition(WKBundleFrameRef frame, FrameNamePolicy shouldIncludeFrameName = ShouldNotIncludeFrameName)
@@ -343,7 +388,7 @@ void InjectedBundlePage::dump()
{
ASSERT(InjectedBundle::shared().isTestRunning());
- InjectedBundle::shared().layoutTestController()->invalidateWaitToDumpWatchdog();
+ InjectedBundle::shared().layoutTestController()->invalidateWaitToDumpWatchdogTimer();
switch (InjectedBundle::shared().layoutTestController()->whatToDump()) {
case LayoutTestController::RenderTree: {
@@ -534,37 +579,37 @@ void InjectedBundlePage::willRunJavaScriptPrompt(WKStringRef message, WKStringRe
// Editor Client Callbacks
-bool InjectedBundlePage::shouldBeginEditing(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo)
+bool InjectedBundlePage::shouldBeginEditing(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo)
{
return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldBeginEditing(range);
}
-bool InjectedBundlePage::shouldEndEditing(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo)
+bool InjectedBundlePage::shouldEndEditing(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo)
{
return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldEndEditing(range);
}
-bool InjectedBundlePage::shouldInsertNode(WKBundlePageRef page, WKBundleNodeRef node, WKBundleRangeRef rangeToReplace, WKInsertActionType action, const void* clientInfo)
+bool InjectedBundlePage::shouldInsertNode(WKBundlePageRef page, WKBundleNodeHandleRef node, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action, const void* clientInfo)
{
return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldInsertNode(node, rangeToReplace, action);
}
-bool InjectedBundlePage::shouldInsertText(WKBundlePageRef page, WKStringRef text, WKBundleRangeRef rangeToReplace, WKInsertActionType action, const void* clientInfo)
+bool InjectedBundlePage::shouldInsertText(WKBundlePageRef page, WKStringRef text, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action, const void* clientInfo)
{
return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldInsertText(text, rangeToReplace, action);
}
-bool InjectedBundlePage::shouldDeleteRange(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo)
+bool InjectedBundlePage::shouldDeleteRange(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo)
{
return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldDeleteRange(range);
}
-bool InjectedBundlePage::shouldChangeSelectedRange(WKBundlePageRef page, WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType affinity, bool stillSelecting, const void* clientInfo)
+bool InjectedBundlePage::shouldChangeSelectedRange(WKBundlePageRef page, WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType affinity, bool stillSelecting, const void* clientInfo)
{
return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldChangeSelectedRange(fromRange, toRange, affinity, stillSelecting);
}
-bool InjectedBundlePage::shouldApplyStyle(WKBundlePageRef page, WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range, const void* clientInfo)
+bool InjectedBundlePage::shouldApplyStyle(WKBundlePageRef page, WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range, const void* clientInfo)
{
return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldApplyStyle(style, range);
}
@@ -589,27 +634,27 @@ void InjectedBundlePage::didChangeSelection(WKBundlePageRef page, WKStringRef no
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didChangeSelection(notificationName);
}
-bool InjectedBundlePage::shouldBeginEditing(WKBundleRangeRef range)
+bool InjectedBundlePage::shouldBeginEditing(WKBundleRangeHandleRef range)
{
if (!InjectedBundle::shared().isTestRunning())
return true;
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
- InjectedBundle::shared().os() << "EDITING DELEGATE: shouldBeginEditingInDOMRange:" << range << "\n";
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldBeginEditingInDOMRange:" << toStr(m_page, m_world.get(), range) << "\n";
return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
}
-bool InjectedBundlePage::shouldEndEditing(WKBundleRangeRef range)
+bool InjectedBundlePage::shouldEndEditing(WKBundleRangeHandleRef range)
{
if (!InjectedBundle::shared().isTestRunning())
return true;
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
- InjectedBundle::shared().os() << "EDITING DELEGATE: shouldEndEditingInDOMRange:" << range << "\n";
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldEndEditingInDOMRange:" << toStr(m_page, m_world.get(), range) << "\n";
return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
}
-bool InjectedBundlePage::shouldInsertNode(WKBundleNodeRef node, WKBundleRangeRef rangeToReplace, WKInsertActionType action)
+bool InjectedBundlePage::shouldInsertNode(WKBundleNodeHandleRef node, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action)
{
if (!InjectedBundle::shared().isTestRunning())
return true;
@@ -621,11 +666,11 @@ bool InjectedBundlePage::shouldInsertNode(WKBundleNodeRef node, WKBundleRangeRef
};
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
- InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertNode:" << dumpPath(node) << " replacingDOMRange:" << rangeToReplace << " givenAction:" << insertactionstring[action] << "\n";
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertNode:" << dumpPath(m_page, m_world.get(), node) << " replacingDOMRange:" << toStr(m_page, m_world.get(), rangeToReplace) << " givenAction:" << insertactionstring[action] << "\n";
return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
}
-bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeRef rangeToReplace, WKInsertActionType action)
+bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action)
{
if (!InjectedBundle::shared().isTestRunning())
return true;
@@ -637,21 +682,21 @@ bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeRef ran
};
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
- InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertText:" << text << " replacingDOMRange:" << rangeToReplace << " givenAction:" << insertactionstring[action] << "\n";
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertText:" << text << " replacingDOMRange:" << toStr(m_page, m_world.get(), rangeToReplace) << " givenAction:" << insertactionstring[action] << "\n";
return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
}
-bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeRef range)
+bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeHandleRef range)
{
if (!InjectedBundle::shared().isTestRunning())
return true;
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
- InjectedBundle::shared().os() << "EDITING DELEGATE: shouldDeleteDOMRange:" << range << "\n";
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldDeleteDOMRange:" << toStr(m_page, m_world.get(), range) << "\n";
return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
}
-bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType affinity, bool stillSelecting)
+bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType affinity, bool stillSelecting)
{
if (!InjectedBundle::shared().isTestRunning())
return true;
@@ -666,17 +711,17 @@ bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeRef fromRange, W
};
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
- InjectedBundle::shared().os() << "EDITING DELEGATE: shouldChangeSelectedDOMRange:" << fromRange << " toDOMRange:" << toRange << " affinity:" << affinitystring[affinity] << " stillSelecting:" << boolstring[stillSelecting] << "\n";
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldChangeSelectedDOMRange:" << toStr(m_page, m_world.get(), fromRange) << " toDOMRange:" << toStr(m_page, m_world.get(), toRange) << " affinity:" << affinitystring[affinity] << " stillSelecting:" << boolstring[stillSelecting] << "\n";
return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
}
-bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range)
+bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range)
{
if (!InjectedBundle::shared().isTestRunning())
return true;
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
- InjectedBundle::shared().os() << "EDITING DELEGATE: shouldApplyStyle:" << style << " toElementsInDOMRange:" << range << "\n";
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldApplyStyle:" << style << " toElementsInDOMRange:" << toStr(m_page, m_world.get(), range) << "\n";
return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
}
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
index cde1655..c814c85 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
@@ -27,6 +27,8 @@
#define InjectedBundlePage_h
#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKBundleScriptWorld.h>
+#include <WebKit2/WKRetainPtr.h>
namespace WTR {
@@ -45,18 +47,18 @@ public:
private:
// Loader Client
- static void didStartProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
- static void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
- static void didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
- static void didCommitLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
- static void didFinishLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
- static void didFailLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
- static void didReceiveTitleForFrame(WKBundlePageRef, WKStringRef title, WKBundleFrameRef, const void*);
+ static void didStartProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didCommitLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didFinishLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didFinishDocumentLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didFailLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didReceiveTitleForFrame(WKBundlePageRef, WKStringRef title, WKBundleFrameRef, WKTypeRef*, const void*);
static void didClearWindowForFrame(WKBundlePageRef, WKBundleFrameRef, WKBundleScriptWorldRef, const void*);
static void didCancelClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
static void willPerformClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, WKURLRef url, double delay, double date, const void*);
static void didChangeLocationWithinPageForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
- static void didFinishDocumentLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
static void didHandleOnloadEventsForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
static void didDisplayInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
static void didRunInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
@@ -89,24 +91,24 @@ private:
void willRunJavaScriptPrompt(WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef);
// Editor client
- static bool shouldBeginEditing(WKBundlePageRef, WKBundleRangeRef, const void* clientInfo);
- static bool shouldEndEditing(WKBundlePageRef, WKBundleRangeRef, const void* clientInfo);
- static bool shouldInsertNode(WKBundlePageRef, WKBundleNodeRef, WKBundleRangeRef rangeToReplace, WKInsertActionType, const void* clientInfo);
- static bool shouldInsertText(WKBundlePageRef, WKStringRef, WKBundleRangeRef rangeToReplace, WKInsertActionType, const void* clientInfo);
- static bool shouldDeleteRange(WKBundlePageRef, WKBundleRangeRef, const void* clientInfo);
- static bool shouldChangeSelectedRange(WKBundlePageRef, WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType, bool stillSelecting, const void* clientInfo);
- static bool shouldApplyStyle(WKBundlePageRef, WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range, const void* clientInfo);
+ static bool shouldBeginEditing(WKBundlePageRef, WKBundleRangeHandleRef, const void* clientInfo);
+ static bool shouldEndEditing(WKBundlePageRef, WKBundleRangeHandleRef, const void* clientInfo);
+ static bool shouldInsertNode(WKBundlePageRef, WKBundleNodeHandleRef, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType, const void* clientInfo);
+ static bool shouldInsertText(WKBundlePageRef, WKStringRef, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType, const void* clientInfo);
+ static bool shouldDeleteRange(WKBundlePageRef, WKBundleRangeHandleRef, const void* clientInfo);
+ static bool shouldChangeSelectedRange(WKBundlePageRef, WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType, bool stillSelecting, const void* clientInfo);
+ static bool shouldApplyStyle(WKBundlePageRef, WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range, const void* clientInfo);
static void didBeginEditing(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo);
static void didEndEditing(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo);
static void didChange(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo);
static void didChangeSelection(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo);
- bool shouldBeginEditing(WKBundleRangeRef);
- bool shouldEndEditing(WKBundleRangeRef);
- bool shouldInsertNode(WKBundleNodeRef, WKBundleRangeRef rangeToReplace, WKInsertActionType);
- bool shouldInsertText(WKStringRef, WKBundleRangeRef rangeToReplace, WKInsertActionType);
- bool shouldDeleteRange(WKBundleRangeRef);
- bool shouldChangeSelectedRange(WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType, bool stillSelecting);
- bool shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range);
+ bool shouldBeginEditing(WKBundleRangeHandleRef);
+ bool shouldEndEditing(WKBundleRangeHandleRef);
+ bool shouldInsertNode(WKBundleNodeHandleRef, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType);
+ bool shouldInsertText(WKStringRef, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType);
+ bool shouldDeleteRange(WKBundleRangeHandleRef);
+ bool shouldChangeSelectedRange(WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType, bool stillSelecting);
+ bool shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range);
void didBeginEditing(WKStringRef notificationName);
void didEndEditing(WKStringRef notificationName);
void didChange(WKStringRef notificationName);
@@ -116,6 +118,7 @@ private:
void dumpAllFrameScrollPositions();
WKBundlePageRef m_page;
+ WKRetainPtr<WKBundleScriptWorldRef> m_world;
bool m_isLoading;
};
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
index d54bb1d..f8cbd4f 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
@@ -41,7 +41,7 @@ namespace WTR {
// This is lower than DumpRenderTree's timeout, to make it easier to work through the failures
// Eventually it should be changed to match.
-static const CFTimeInterval waitToDumpWatchdogInterval = 6.0;
+const double LayoutTestController::waitToDumpWatchdogTimerInterval = 6;
static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const char* propertyName)
{
@@ -94,6 +94,7 @@ LayoutTestController::LayoutTestController()
, m_testRepaint(false)
, m_testRepaintSweepHorizontally(false)
{
+ platformInitialize();
}
LayoutTestController::~LayoutTestController()
@@ -110,32 +111,15 @@ void LayoutTestController::display()
// FIXME: actually implement, once we want pixel tests
}
-void LayoutTestController::invalidateWaitToDumpWatchdog()
-{
- if (m_waitToDumpWatchdog) {
- CFRunLoopTimerInvalidate(m_waitToDumpWatchdog.get());
- m_waitToDumpWatchdog = 0;
- }
-}
-
-static void waitUntilDoneWatchdogFired(CFRunLoopTimerRef timer, void* info)
-{
- InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired();
-}
-
void LayoutTestController::waitUntilDone()
{
m_waitToDump = true;
- if (!m_waitToDumpWatchdog) {
- m_waitToDumpWatchdog.adoptCF(CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + waitToDumpWatchdogInterval,
- 0, 0, 0, waitUntilDoneWatchdogFired, NULL));
- CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_waitToDumpWatchdog.get(), kCFRunLoopCommonModes);
- }
+ initializeWaitToDumpWatchdogTimerIfNeeded();
}
void LayoutTestController::waitToDumpWatchdogTimerFired()
{
- invalidateWaitToDumpWatchdog();
+ invalidateWaitToDumpWatchdogTimer();
const char* message = "FAIL: Timed out waiting for notifyDone to be called\n";
InjectedBundle::shared().os() << message << "\n";
InjectedBundle::shared().done();
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
index 2c112a7..6ae20d8 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
@@ -97,15 +97,20 @@ public:
bool waitToDump() const { return m_waitToDump; }
void waitToDumpWatchdogTimerFired();
- void invalidateWaitToDumpWatchdog();
+ void invalidateWaitToDumpWatchdogTimer();
bool shouldAllowEditing() const { return m_shouldAllowEditing; }
bool shouldCloseExtraWindowsAfterRunningTest() const { return m_shouldCloseExtraWindows; }
private:
+ static const double waitToDumpWatchdogTimerInterval;
+
LayoutTestController();
+ void platformInitialize();
+ void initializeWaitToDumpWatchdogTimerIfNeeded();
+
WhatToDump m_whatToDump;
bool m_shouldDumpAllFrameScrollPositions;
@@ -119,7 +124,11 @@ private:
bool m_testRepaint;
bool m_testRepaintSweepHorizontally;
- RetainPtr<CFRunLoopTimerRef> m_waitToDumpWatchdog;
+#if PLATFORM(MAC)
+ RetainPtr<CFRunLoopTimerRef> m_waitToDumpWatchdogTimer;
+#elif PLATFORM(WIN)
+ UINT_PTR m_waitToDumpWatchdogTimer;
+#endif
};
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm b/WebKitTools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm
new file mode 100644
index 0000000..2eb4d5b
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm
@@ -0,0 +1,59 @@
+/*
+ * 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 "LayoutTestController.h"
+
+#include "InjectedBundle.h"
+
+namespace WTR {
+
+void LayoutTestController::platformInitialize()
+{
+}
+
+void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
+{
+ if (!m_waitToDumpWatchdogTimer)
+ return;
+
+ CFRunLoopTimerInvalidate(m_waitToDumpWatchdogTimer.get());
+ m_waitToDumpWatchdogTimer = 0;
+}
+
+static void waitUntilDoneWatchdogTimerFired(CFRunLoopTimerRef timer, void* info)
+{
+ InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired();
+}
+
+void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
+{
+ if (m_waitToDumpWatchdogTimer)
+ return;
+
+ m_waitToDumpWatchdogTimer.adoptCF(CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + waitToDumpWatchdogTimerInterval, 0, 0, 0, WTR::waitUntilDoneWatchdogTimerFired, NULL));
+ CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_waitToDumpWatchdogTimer.get(), kCFRunLoopCommonModes);
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp
new file mode 100644
index 0000000..39cd727
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "LayoutTestController.h"
+
+#include "InjectedBundle.h"
+
+namespace WTR {
+
+void LayoutTestController::platformInitialize()
+{
+ m_waitToDumpWatchdogTimer = 0;
+}
+
+void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
+{
+ if (!m_waitToDumpWatchdogTimer)
+ return;
+
+ ::KillTimer(0, m_waitToDumpWatchdogTimer);
+ m_waitToDumpWatchdogTimer = 0;
+}
+
+static void CALLBACK waitToDumpWatchdogTimerFired(HWND, UINT, UINT_PTR, DWORD)
+{
+ InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired();
+}
+
+static const UINT_PTR waitToDumpWatchdogTimerIdentifier = 1;
+
+void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
+{
+ if (m_waitToDumpWatchdogTimer)
+ return;
+
+ m_waitToDumpWatchdogTimer = ::SetTimer(0, waitToDumpWatchdogTimerIdentifier, waitToDumpWatchdogTimerInterval * 1000, WTR::waitToDumpWatchdogTimerFired);
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
index 6f97b9f..a71b07d 100644
--- a/WebKitTools/WebKitTestRunner/TestController.cpp
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -83,6 +83,7 @@ static WKPageRef createOtherPage(WKPageRef oldPage, const void*)
0,
0,
0,
+ 0,
0
};
WKPageSetPageUIClient(newPage, &otherPageUIClient);
@@ -142,7 +143,8 @@ void TestController::initialize(int argc, const char* argv[])
WKContextInjectedBundleClient injectedBundleClient = {
0,
this,
- didReceiveMessageFromInjectedBundle
+ didReceiveMessageFromInjectedBundle,
+ 0
};
WKContextSetInjectedBundleClient(m_context.get(), &injectedBundleClient);
@@ -160,6 +162,7 @@ void TestController::initialize(int argc, const char* argv[])
0,
0,
0,
+ 0,
0
};
WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);
@@ -247,7 +250,7 @@ void TestController::run()
// WKContextInjectedBundleClient
-void TestController::didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo)
+void TestController::didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
{
static_cast<TestController*>(const_cast<void*>(clientInfo))->didReceiveMessageFromInjectedBundle(messageName, messageBody);
}
@@ -259,7 +262,7 @@ void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName
// WKPageLoaderClient
-void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo)
+void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef, const void* clientInfo)
{
static_cast<TestController*>(const_cast<void*>(clientInfo))->didFinishLoadForFrame(page, frame);
}
diff --git a/WebKitTools/WebKitTestRunner/TestController.h b/WebKitTools/WebKitTestRunner/TestController.h
index 5f6d99d..a9e6ab3 100644
--- a/WebKitTools/WebKitTestRunner/TestController.h
+++ b/WebKitTools/WebKitTestRunner/TestController.h
@@ -75,7 +75,7 @@ private:
void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
// WKPageLoaderClient
- static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void*);
+ static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void*);
void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame);
diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
index f5ee6d5..6ecbef9 100644
--- a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
+++ b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
@@ -54,6 +54,7 @@
BCC9981811D3F51E0017BCA2 /* LayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */; };
BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD7D2F711921278006DB7EE /* TestInvocation.cpp */; };
BCDA2B9A1191051F00C3BC47 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */; };
+ C0CE720B1247C93300BC0EC4 /* LayoutTestControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -132,6 +133,7 @@
BCD7D2F611921278006DB7EE /* TestInvocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestInvocation.h; sourceTree = "<group>"; };
BCD7D2F711921278006DB7EE /* TestInvocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestInvocation.cpp; sourceTree = "<group>"; };
BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = LayoutTestControllerMac.mm; path = mac/LayoutTestControllerMac.mm; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -223,6 +225,7 @@
BC14E4D8120E02D000826C0C /* GCController.h */,
BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */,
BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */,
+ C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */,
);
name = Controllers;
sourceTree = "<group>";
@@ -443,6 +446,7 @@
BC14E4EA120E03D800826C0C /* JSGCController.cpp in Sources */,
BC8FD8CA120E527F00F3E71A /* EventSendingController.cpp in Sources */,
BC8FD8D2120E545B00F3E71A /* JSEventSendingController.cpp in Sources */,
+ C0CE720B1247C93300BC0EC4 /* LayoutTestControllerMac.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj b/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj
index 71dcf95..22c9a89 100644
--- a/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj
+++ b/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj
@@ -317,39 +317,39 @@
>
</File>
<File
- RelativePath="..\InjectedBundle\InjectedBundle.cpp"
+ RelativePath="..\InjectedBundle\EventSendingController.cpp"
>
</File>
<File
- RelativePath="..\InjectedBundle\InjectedBundle.h"
+ RelativePath="..\InjectedBundle\EventSendingController.h"
>
</File>
<File
- RelativePath="..\InjectedBundle\InjectedBundleMain.cpp"
+ RelativePath="..\InjectedBundle\GCController.cpp"
>
</File>
<File
- RelativePath="..\InjectedBundle\InjectedBundlePage.cpp"
+ RelativePath="..\InjectedBundle\GCController.h"
>
</File>
<File
- RelativePath="..\InjectedBundle\InjectedBundlePage.h"
+ RelativePath="..\InjectedBundle\InjectedBundle.cpp"
>
</File>
<File
- RelativePath="..\InjectedBundle\EventSendingController.cpp"
+ RelativePath="..\InjectedBundle\InjectedBundle.h"
>
</File>
<File
- RelativePath="..\InjectedBundle\EventSendingController.h"
+ RelativePath="..\InjectedBundle\InjectedBundleMain.cpp"
>
</File>
<File
- RelativePath="..\InjectedBundle\GCController.cpp"
+ RelativePath="..\InjectedBundle\InjectedBundlePage.cpp"
>
</File>
<File
- RelativePath="..\InjectedBundle\GCController.h"
+ RelativePath="..\InjectedBundle\InjectedBundlePage.h"
>
</File>
<File
@@ -360,6 +360,10 @@
RelativePath="..\InjectedBundle\LayoutTestController.h"
>
</File>
+ <File
+ RelativePath="..\InjectedBundle\win\LayoutTestControllerWin.cpp"
+ >
+ </File>
</Files>
<Globals>
</Globals>
diff --git a/WebKitTools/wx/build/settings.py b/WebKitTools/wx/build/settings.py
index 7dfaa5f..cd3358c 100644
--- a/WebKitTools/wx/build/settings.py
+++ b/WebKitTools/wx/build/settings.py
@@ -102,6 +102,7 @@ webcore_dirs = [
'WebCore/bindings/cpp',
'WebCore/bindings/generic',
'WebCore/bindings/js',
+ 'WebCore/bindings/js/specialization',
'WebCore/bridge',
'WebCore/bridge/c',
'WebCore/bridge/jsc',
@@ -141,12 +142,14 @@ webcore_dirs = [
'WebCore/platform/text/transcoder',
'WebCore/plugins',
'WebCore/rendering',
- 'WebCore/rendering/style',
+ 'WebCore/rendering/style',
+ 'WebCore/rendering/svg',
'WebCore/storage',
'WebCore/svg',
'WebCore/svg/animation',
'WebCore/svg/graphics',
'WebCore/svg/graphics/filters',
+
'WebCore/websockets',
'WebCore/xml'
]